@embedreach/components 0.1.61 → 0.1.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -6,31 +6,31 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */As.exports="production"===process.env.NODE_ENV?function(){if(Rs)return Ls;Rs=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 Ls.AsyncMode=l,Ls.ConcurrentMode=c,Ls.ContextConsumer=a,Ls.ContextProvider=s,Ls.Element=t,Ls.ForwardRef=u,Ls.Fragment=r,Ls.Lazy=p,Ls.Memo=f,Ls.Portal=n,Ls.Profiler=i,Ls.StrictMode=o,Ls.Suspense=d,Ls.isAsyncMode=function(e){return x(e)||b(e)===l},Ls.isConcurrentMode=x,Ls.isContextConsumer=function(e){return b(e)===a},Ls.isContextProvider=function(e){return b(e)===s},Ls.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ls.isForwardRef=function(e){return b(e)===u},Ls.isFragment=function(e){return b(e)===r},Ls.isLazy=function(e){return b(e)===p},Ls.isMemo=function(e){return b(e)===f},Ls.isPortal=function(e){return b(e)===n},Ls.isProfiler=function(e){return b(e)===i},Ls.isStrictMode=function(e){return b(e)===o},Ls.isSuspense=function(e){return b(e)===d},Ls.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)},Ls.typeOf=b,Ls}():(Is||(Is=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,_=i,N=o,D=d,M=!1;function O(e){return b(e)===c}Fs.AsyncMode=l,Fs.ConcurrentMode=x,Fs.ContextConsumer=w,Fs.ContextProvider=S,Fs.Element=C,Fs.ForwardRef=k,Fs.Fragment=E,Fs.Lazy=j,Fs.Memo=P,Fs.Portal=T,Fs.Profiler=_,Fs.StrictMode=N,Fs.Suspense=D,Fs.isAsyncMode=function(e){return M||(M=!0),O(e)||b(e)===l},Fs.isConcurrentMode=O,Fs.isContextConsumer=function(e){return b(e)===a},Fs.isContextProvider=function(e){return b(e)===s},Fs.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Fs.isForwardRef=function(e){return b(e)===u},Fs.isFragment=function(e){return b(e)===r},Fs.isLazy=function(e){return b(e)===p},Fs.isMemo=function(e){return b(e)===f},Fs.isPortal=function(e){return b(e)===n},Fs.isProfiler=function(e){return b(e)===i},Fs.isStrictMode=function(e){return b(e)===o},Fs.isSuspense=function(e){return b(e)===d},Fs.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)},Fs.typeOf=b}()),Fs);var $s=As.exports,qs={};qs[$s.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qs[$s.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};const zs={useCamelCaseFlagKeys:!0,sendEventsOnFlagRead:!0,reactContext:n.createContext({flags:{},flagKeyMap:{},ldClient:void 0})},Us=e=>{var t;return null!=(t=e.context)?t:e.user},Vs=e=>{const t={};for(const n in e)0!==n.indexOf("$")&&(t[Os(n)]=e[n]);return t},Bs=(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 Ks(e,t,n=zs,r){const o=(l=t,void 0===(c=r)?l:Object.keys(c).reduce(((e,t)=>(Hs(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=Os(r);t[o]=e[r],n[o]=r}return[t,n]}(o):[o];var l,c;return{flags:n.sendEventsOnFlagRead?Ws(e,s,a,i):s,flagKeyMap:a}}function Hs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ws(e,t,n,r){return new Proxy(t,{get(t,o,i){const s=Reflect.get(t,o,i),a=r&&Hs(n,o)||Hs(t,o);if("symbol"==typeof o||!a)return s;if(void 0===s)return;return e.variation(r?n[o]:o,s)}})}Vs.camelCaseKeys=Vs;const Gs={wrapperName:"react-client-sdk",wrapperVersion:"3.6.1",sendEventsOnlyForVariation:!0};var Ys=Object.defineProperty,Qs=Object.defineProperties,Xs=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,ta=(e,t,n)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t)=>{for(var n in t||(t={}))Zs.call(t,n)&&ta(e,n,t[n]);if(Js)for(var n of Js(t))ea.call(t,n)&&ta(e,n,t[n]);return e},ra=(e,t)=>Qs(e,Xs(t)),oa=(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 ia=class extends n.Component{constructor(e){super(e),this.getReactOptions=()=>na(na({},zs),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=na(na({},this.state.unproxiedFlags),o);Object.keys(o).length>0&&this.setState((n=>na(ra(na({},n),{unproxiedFlags:i}),Ks(e,i,r,t))))}))},this.onFailed=(e,t)=>{this.setState((e=>ra(na({},e),{error:t})))},this.onReady=(e,t,n)=>{const r=Bs(e,n);this.setState((o=>na(ra(na({},o),{unproxiedFlags:r}),Ks(e,r,t,n))))},this.prepareLDClient=()=>oa(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=Bs(o,n);else{const c=null!=(e=Us(this.props))?e:{anonymous:!0,kind:"user"};o=Pi(t,c,na(na({},Gs),r));try{yield o.waitForInitialization(this.props.timeout),a=Bs(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=>ra(na(ra(na({},e),{unproxiedFlags:a}),Ks(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?Vs(e):e,unproxiedFlags:e,flagKeyMap:{}}}}}componentDidMount(){return oa(this,null,(function*(){const{deferInitialization:e}=this.props;e&&!Us(this.props)||(yield this.prepareLDClient())}))}componentDidUpdate(e){return oa(this,null,(function*(){const{deferInitialization:t}=this.props,n=!Us(e)&&Us(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 sa=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()}},aa="api:unauthorized",la="api:authorized",ca={staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!0};let ua,da=!1,ha=null,fa=!1;const pa=async(e,t={})=>{const n=await fetch(`https://api.embedreach.com/api${e}`,{...t,credentials:"include",headers:{"Content-Type":"application/json",...ua&&{Authorization:`Bearer ${ua}`},...t.headers}});if(401===n.status)throw da||(da=!0,sa.emit(aa,void 0),ha&&window.clearTimeout(ha),ha=window.setTimeout((()=>{da=!1,fa=!1,ha=null}),5e3)),new Error("Unauthorized");if(!n.ok)throw new Error(`API Error: ${n.statusText}`);return fa||(sa.emit(la,void 0),fa=!0),n.json()},ma=(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=sa.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})}}},ga=[{eventName:aa,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!1}),e({type:"SET_REAUTHING",payload:!0})}},{eventName:la,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!0})}}],{Provider:va}=ma(((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},ga),ya=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}},ba={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%","card-foreground":"240 10% 3.9%",popover:"0 0% 100%","popover-foreground":"240 10% 3.9%",primary:"240 5.9% 10%","primary-foreground":"0 0% 98%",secondary:"240 4.8% 95.9%","secondary-foreground":"240 5.9% 10%",muted:"240 4.8% 95.9%","muted-foreground":"240 3.8% 46.1%",accent:"240 4.8% 95.9%","accent-foreground":"240 5.9% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"240 5.9% 90%",input:"240 5.9% 90%",ring:"240 10% 3.9%","chart-1":"12 76% 61%","chart-2":"173 58% 39%","chart-3":"197 37% 24%","chart-4":"43 74% 66%","chart-5":"27 87% 67%",radius:"0.5rem","font-body":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-heading":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},xa=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(ba).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=ya(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)},{Context:wa,Provider:Sa}=ma(((e,t)=>{switch(t.type){case"set_theme":return{...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}),Ca=({initialTheme:e,children:r})=>{const{setTheme:o,setLoading:i}=n.useContext(wa),s=n.useRef(!1);return n.useEffect((()=>{e&&!s.current?(xa(e.styles),o(e),s.current=!0):i(!1)}),[e,o,i]),t.jsx(t.Fragment,{children:r})},ka=({initialTheme:e,children:n})=>t.jsx(Sa,{children:t.jsx(Ca,{initialTheme:e,children:n})}),Ea=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ja={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Pa=e=>ja[e];let Ta={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Ea,Pa)};const _a={type:"3rdParty",init(e){((e={})=>{Ta={...Ta,...e}})(e.options.react)}},Na=n.createContext();function Da({i18n:e,defaultNS:t,children:r}){const o=n.useMemo((()=>({i18n:e,defaultNS:t})),[e,t]);return n.createElement(Na.Provider,{value:o},r)}const Ma=e=>"string"==typeof e,Oa=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},Ra=e=>null==e?"":""+e,Aa=/###/g,La=e=>e&&e.indexOf("###")>-1?e.replace(Aa,"."):e,Ia=e=>!e||Ma(e),Fa=(e,t,n)=>{const r=Ma(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(Ia(e))return{};const t=La(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return Ia(e)?{}:{obj:e,k:La(r[o])}},$a=(e,t,n)=>{const{obj:r,k:o}=Fa(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=Fa(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=Fa(e,s,Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},qa=(e,t)=>{const{obj:n,k:r}=Fa(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},za=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Ma(e[r])||e[r]instanceof String||Ma(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):za(e[r],t[r],n):e[r]=t[r]);return e},Ua=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Va={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Ba=e=>Ma(e)?e.replace(/[&<>"'\/]/g,(e=>Va[e])):e;const Ka=[" ",",","?","!",";"],Ha=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),Wa=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},Ga=e=>e?.replace("_","-"),Ya={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class Qa{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||Ya,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:(Ma(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Qa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Qa(this.logger,e)}}var Xa=new Qa;class Ja{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 Za extends Ja{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):Ma(n)&&o?s.push(...n.split(o)):s.push(n)));const a=qa(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Ma(n)?Wa(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),$a(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)(Ma(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=qa(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?za(a,n,o):a={...a,...n},$a(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 el={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 tl={};class nl extends Ja{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=Xa.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=Ka.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=Ha.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:Ma(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:Ma(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=!Ma(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(g&&d&&v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0)||Ma(m)&&Array.isArray(d))if(g&&Ma(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&&!Ma(t.count),h=nl.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=Ma(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&&!Ma(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=Ma(s)?[s]:s;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=el.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 Ma(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&&!Ma(s.count),d=u&&!s.ordinal&&0===s.count,h=void 0!==s.context&&(Ma(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,tl[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(i)||(tl[`${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&&!Ma(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 rl{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xa.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Ga(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=Ga(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Ma(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)),Ma(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 Ma(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))):Ma(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}const ol={zero:0,one:1,two:2,few:3,many:4,other:5},il={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class sl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Xa.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=Ga("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!"),il;if(!e.match(/-|_/))return il;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)=>ol[e]-ol[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 al=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=qa(e,n);return void 0!==r?r:qa(t,n)})(e,t,n);return!i&&o&&Ma(n)&&(i=Wa(e,n,r),void 0===i&&(i=Wa(t,n,r))),i},ll=e=>e.replace(/\$/g,"$$$$");class cl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Xa.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:Ba,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?Ua(o):i||"{{",this.suffix=s?Ua(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Ua(d):h||Ua("$t("),this.nestingSuffix=f?Ua(f):p||Ua(")"),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=al(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(al(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=>ll(e)},{regex:this.regexp,safeValue:e=>ll(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=Ma(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 Ma(i)||this.useRawValueToEscape||(i=Ra(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&&!Ma(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&&!Ma(r))return r;Ma(r)||(r=Ra(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 ul=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(Ga(r),o),t[s]=a),a(n)}};class dl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Xa.create("formatter"),this.options=e,this.formats={number:ul(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:ul(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:ul(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:ul(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:ul(((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()]=ul(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 hl extends Ja{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=Xa.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}=Fa(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();Ma(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ma(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 fl=()=>({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]),Ma(e[1])&&(t.defaultValue=e[1]),Ma(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}}),pl=e=>(Ma(e.ns)&&(e.ns=[e.ns]),Ma(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ma(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),ml=()=>{};class gl extends Ja{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=pl(e),this.services={},this.logger=Xa,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&&(Ma(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=fl();this.options={...r,...this.options,...pl(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;Xa.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:dl;const n=new rl(this.options);this.store=new Za(this.options.resources,this.options);const i=this.services;i.logger=Xa,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new sl(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 cl(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new hl(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 nl(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=ml),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=Oa(),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]:ml;const n=Ma(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=Oa();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=ml),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&&el.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=Oa();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=Ma(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 Ma(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=Oa();return this.options.ns?(Ma(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=Oa();Ma(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 rl(fl());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 gl(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]:ml;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new gl(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 Za(e,r),o.services.resourceStore=o.store}return o.translator=new nl(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 vl=gl.createInstance();vl.createInstance=gl.createInstance;const{slice:yl,forEach:bl}=[];const xl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,wl={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(!xl.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!xl.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 Sl={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return wl.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&wl.create(n,e,r,o,i)}},Cl={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 kl=null;const El=()=>{if(null!==kl)return kl;try{kl="undefined"!==window&&null!==window.localStorage;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){kl=!1}return kl};var jl={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&El())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&El()&&window.localStorage.setItem(n,e)}};let Pl=null;const Tl=()=>{if(null!==Pl)return Pl;try{Pl="undefined"!==window&&null!==window.sessionStorage;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Pl=!1}return Pl};var _l={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Tl())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Tl()&&window.sessionStorage.setItem(n,e)}},Nl={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}},Dl={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}},Ml={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("/","")}},Ol={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 Rl=!1;try{document,Rl=!0}catch(SY){}const Al=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Rl||Al.splice(1,1);class Ll{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 bl.call(yl.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(e,this.options||{},{order:Al,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(Sl),this.addDetector(Cl),this.addDetector(jl),this.addDetector(_l),this.addDetector(Nl),this.addDetector(Dl),this.addDetector(Ml),this.addDetector(Ol)}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)})))}}Ll.type="languageDetector";const Il={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"}}}}};vl.use(Ll).use(_a).init({resources:Il,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 Fl=({children:e,initialLanguage:r})=>(n.useEffect((()=>{r&&vl.changeLanguage(r)}),[r]),t.jsx(Da,{i18n:vl,children:e}));let $l=0;const ql=new Map,zl=e=>{if(ql.has(e))return;const t=setTimeout((()=>{ql.delete(e),Kl({type:"REMOVE_TOAST",toastId:e})}),1e6);ql.set(e,t)},Ul=(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?zl(n):e.toasts.forEach((e=>{zl(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))}}},Vl=[];let Bl={toasts:[]};function Kl(e){Bl=Ul(Bl,e),Vl.forEach((e=>{e(Bl)}))}function Hl({...e}){const t=($l=($l+1)%Number.MAX_SAFE_INTEGER,$l.toString()),n=()=>Kl({type:"DISMISS_TOAST",toastId:t});return Kl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||n()}}}),{id:t,dismiss:n,update:e=>Kl({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function Wl(){const[e,t]=i.useState(Bl);return i.useEffect((()=>(Vl.push(t),()=>{const e=Vl.indexOf(t);e>-1&&Vl.splice(e,1)})),[e]),{...e,toast:Hl,dismiss:e=>Kl({type:"DISMISS_TOAST",toastId:e})}}function Gl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Yl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ql(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Yl(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():Yl(e[t],null)}}}}function Xl(...e){return i.useCallback(Ql(...e),e)}function Jl(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}\``)}]}function Zl(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}\``)}]},ec(o,...n)]}function ec(...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 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);return i.cloneElement(n,{...ic(r,n.props),ref:t?Ql(t,e):e})}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}function ic(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 sc(e){const r=e+"CollectionProvider",[o,i]=Zl(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=Xl(n,a(c,r).collectionRef);return t.jsx(tc,{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=Xl(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(tc,{[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 ac=["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}}),{});function lc(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}function cc(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function uc(e,t=globalThis?.document){const n=cc(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 dc,hc="dismissableLayer.update",fc="dismissableLayer.pointerDownOutside",pc="dismissableLayer.focusOutside",mc=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gc=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(mc),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Xl(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=cc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){bc(fc,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=cc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){bc(pc,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 uc((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&&(dc=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),yc(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=dc)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),yc())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(hc,e),()=>document.removeEventListener(hc,e)}),[]),t.jsx(ac.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Gl(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Gl(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Gl(e.onPointerDownCapture,C.onPointerDownCapture)})}));gc.displayName="DismissableLayer";var vc=i.forwardRef(((e,n)=>{const r=i.useContext(mc),o=i.useRef(null),s=Xl(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(ac.div,{...e,ref:s})}));function yc(){const e=new CustomEvent(hc);document.dispatchEvent(e)}function bc(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?lc(o,i):o.dispatchEvent(i)}vc.displayName="DismissableLayerBranch";var xc=gc,wc=vc,Sc=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},Cc=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);Sc((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(ac.div,{...s,ref:n}),c):null}));Cc.displayName="Portal";var kc=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=Ec(r.current);s.current="mounted"===l?e:"none"}),[l]),Sc((()=>{const t=r.current,n=o.current;if(n!==e){const r=s.current,i=Ec(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]),Sc((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const s=Ec(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=Ec(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=Xl(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 Ec(e){return e?.animationName||"none"}function jc({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=cc(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=cc(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])]}kc.displayName="Presence";var Pc=i.forwardRef(((e,n)=>t.jsx(ac.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}})));Pc.displayName="VisuallyHidden";var Tc=Pc,_c="ToastProvider",[Nc,Dc,Mc]=sc("Toast"),[Oc,Rc]=Zl("Toast",[Mc]),[Ac,Lc]=Oc(_c),Ic=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(Nc.Provider,{scope:n,children:t.jsx(Ac,{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})})};Ic.displayName=_c;var Fc="ToastViewport",$c=["F8"],qc="toast.viewportPause",zc="toast.viewportResume",Uc=i.forwardRef(((e,n)=>{const{__scopeToast:r,hotkey:o=$c,label:s="Notifications ({hotkey})",...a}=e,l=Lc(Fc,r),c=Dc(r),u=i.useRef(null),d=i.useRef(null),h=i.useRef(null),f=i.useRef(null),p=Xl(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(qc);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(zc);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,...su(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));au(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(wc,{ref:u,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&t.jsx(Bc,{ref:d,onFocusFromOutsideViewport:()=>{au(v({tabbingDirection:"forwards"}))}}),t.jsx(Nc.Slot,{scope:r,children:t.jsx(ac.ol,{tabIndex:-1,...a,ref:p})}),g&&t.jsx(Bc,{ref:h,onFocusFromOutsideViewport:()=>{au(v({tabbingDirection:"backwards"}))}})]})}));Uc.displayName=Fc;var Vc="ToastFocusProxy",Bc=i.forwardRef(((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...i}=e,s=Lc(Vc,r);return t.jsx(Pc,{"aria-hidden":!0,tabIndex:0,...i,ref:n,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));Bc.displayName=Vc;var Kc="Toast",Hc=i.forwardRef(((e,n)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:s,...a}=e,[l=!0,c]=jc({prop:o,defaultProp:i,onChange:s});return t.jsx(kc,{present:r||l,children:t.jsx(Yc,{open:l,...a,ref:n,onClose:()=>c(!1),onPause:cc(e.onPause),onResume:cc(e.onResume),onSwipeStart:Gl(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:Gl(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:Gl(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:Gl(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)}))})})}));Hc.displayName=Kc;var[Wc,Gc]=Oc(Kc,{onClose(){}}),Yc=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=Lc(Kc,r),[b,x]=i.useState(null),w=Xl(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:_}=y,N=cc((()=>{const e=b?.contains(document.activeElement);e&&y.viewport?.focus(),c()})),D=i.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(P.current),E.current=(new Date).getTime(),P.current=window.setTimeout(N,e))}),[N]);i.useEffect((()=>{const e=y.viewport;if(e){const t=()=>{D(j.current),h?.()},n=()=>{const e=(new Date).getTime()-E.current;j.current=j.current-e,window.clearTimeout(P.current),d?.()};return e.addEventListener(qc,n),e.addEventListener(zc,t),()=>{e.removeEventListener(qc,n),e.removeEventListener(zc,t)}}}),[y.viewport,k,d,h,D]),i.useEffect((()=>{l&&!y.isClosePausedRef.current&&D(k)}),[l,k,y.isClosePausedRef,D]),i.useEffect((()=>(T(),()=>_())),[T,_]);const M=i.useMemo((()=>b?ru(b):null),[b]);return y.viewport?t.jsxs(t.Fragment,{children:[M&&t.jsx(Qc,{__scopeToast:r,role:"status","aria-live":"foreground"===o?"assertive":"polite","aria-atomic":!0,children:M}),t.jsx(Wc,{scope:r,onClose:N,children:s.createPortal(t.jsx(Nc.ItemSlot,{scope:r,children:t.jsx(xc,{asChild:!0,onEscapeKeyDown:Gl(u,(()=>{y.isFocusedToastEscapeKeyDownRef.current||N(),y.isFocusedToastEscapeKeyDownRef.current=!1})),children:t.jsx(ac.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:Gl(e.onKeyDown,(e=>{"Escape"===e.key&&(u?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,N()))})),onPointerDown:Gl(e.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:Gl(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,ou("toast.swipeMove",p,u,{discrete:!1})):iu(c,y.swipeDirection,l)?(C.current=c,ou("toast.swipeStart",f,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(n)>l)&&(S.current=null)})),onPointerUp:Gl(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};iu(t,y.swipeDirection,y.swipeThreshold)?ou("toast.swipeEnd",g,r,{discrete:!0}):ou("toast.swipeCancel",m,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),y.viewport)})]}):null})),Qc=e=>{const{__scopeToast:n,children:r,...o}=e,s=Lc(Kc,n),[a,l]=i.useState(!1),[c,u]=i.useState(!1);return function(e=()=>{}){const t=cc(e);Sc((()=>{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(Cc,{asChild:!0,children:t.jsx(Pc,{...o,children:a&&t.jsxs(t.Fragment,{children:[s.label," ",r]})})})},Xc=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(ac.div,{...o,ref:n})}));Xc.displayName="ToastTitle";var Jc=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(ac.div,{...o,ref:n})}));Jc.displayName="ToastDescription";var Zc=i.forwardRef(((e,n)=>{const{altText:r,...o}=e;return r.trim()?t.jsx(nu,{altText:r,asChild:!0,children:t.jsx(tu,{...o,ref:n})}):null}));Zc.displayName="ToastAction";var eu="ToastClose",tu=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e,i=Gc(eu,r);return t.jsx(nu,{asChild:!0,children:t.jsx(ac.button,{type:"button",...o,ref:n,onClick:Gl(e.onClick,i.onClose)})})}));tu.displayName=eu;var nu=i.forwardRef(((e,n)=>{const{__scopeToast:r,altText:o,...i}=e;return t.jsx(ac.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:n})}));function ru(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(...ru(e))}})),t}function ou(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?lc(o,i):o.dispatchEvent(i)}var iu=(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 su(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 au(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var lu=Ic,cu=Uc,uu=Hc,du=Xc,hu=Jc,fu=Zc,pu=tu;function mu(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=mu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mu(e))&&(r&&(r+=" "),r+=t);return r}const vu=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,yu=gu,bu=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return yu(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=vu(t)||vu(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 yu(e,s,l,null==n?void 0:n.class,null==n?void 0:n.className)}
9
+ */As.exports="production"===process.env.NODE_ENV?function(){if(Rs)return Ls;Rs=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 Ls.AsyncMode=l,Ls.ConcurrentMode=c,Ls.ContextConsumer=a,Ls.ContextProvider=s,Ls.Element=t,Ls.ForwardRef=u,Ls.Fragment=r,Ls.Lazy=p,Ls.Memo=f,Ls.Portal=n,Ls.Profiler=i,Ls.StrictMode=o,Ls.Suspense=d,Ls.isAsyncMode=function(e){return x(e)||b(e)===l},Ls.isConcurrentMode=x,Ls.isContextConsumer=function(e){return b(e)===a},Ls.isContextProvider=function(e){return b(e)===s},Ls.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ls.isForwardRef=function(e){return b(e)===u},Ls.isFragment=function(e){return b(e)===r},Ls.isLazy=function(e){return b(e)===p},Ls.isMemo=function(e){return b(e)===f},Ls.isPortal=function(e){return b(e)===n},Ls.isProfiler=function(e){return b(e)===i},Ls.isStrictMode=function(e){return b(e)===o},Ls.isSuspense=function(e){return b(e)===d},Ls.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)},Ls.typeOf=b,Ls}():(Is||(Is=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,_=i,N=o,D=d,M=!1;function O(e){return b(e)===c}Fs.AsyncMode=l,Fs.ConcurrentMode=x,Fs.ContextConsumer=w,Fs.ContextProvider=S,Fs.Element=C,Fs.ForwardRef=k,Fs.Fragment=E,Fs.Lazy=j,Fs.Memo=P,Fs.Portal=T,Fs.Profiler=_,Fs.StrictMode=N,Fs.Suspense=D,Fs.isAsyncMode=function(e){return M||(M=!0),O(e)||b(e)===l},Fs.isConcurrentMode=O,Fs.isContextConsumer=function(e){return b(e)===a},Fs.isContextProvider=function(e){return b(e)===s},Fs.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Fs.isForwardRef=function(e){return b(e)===u},Fs.isFragment=function(e){return b(e)===r},Fs.isLazy=function(e){return b(e)===p},Fs.isMemo=function(e){return b(e)===f},Fs.isPortal=function(e){return b(e)===n},Fs.isProfiler=function(e){return b(e)===i},Fs.isStrictMode=function(e){return b(e)===o},Fs.isSuspense=function(e){return b(e)===d},Fs.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)},Fs.typeOf=b}()),Fs);var $s=As.exports,qs={};qs[$s.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qs[$s.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};const zs={useCamelCaseFlagKeys:!0,sendEventsOnFlagRead:!0,reactContext:n.createContext({flags:{},flagKeyMap:{},ldClient:void 0})},Us=e=>{var t;return null!=(t=e.context)?t:e.user},Vs=e=>{const t={};for(const n in e)0!==n.indexOf("$")&&(t[Os(n)]=e[n]);return t},Bs=(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 Ks(e,t,n=zs,r){const o=(l=t,void 0===(c=r)?l:Object.keys(c).reduce(((e,t)=>(Hs(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=Os(r);t[o]=e[r],n[o]=r}return[t,n]}(o):[o];var l,c;return{flags:n.sendEventsOnFlagRead?Ws(e,s,a,i):s,flagKeyMap:a}}function Hs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ws(e,t,n,r){return new Proxy(t,{get(t,o,i){const s=Reflect.get(t,o,i),a=r&&Hs(n,o)||Hs(t,o);if("symbol"==typeof o||!a)return s;if(void 0===s)return;return e.variation(r?n[o]:o,s)}})}Vs.camelCaseKeys=Vs;const Gs={wrapperName:"react-client-sdk",wrapperVersion:"3.6.1",sendEventsOnlyForVariation:!0};var Ys=Object.defineProperty,Qs=Object.defineProperties,Xs=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,ea=Object.prototype.propertyIsEnumerable,ta=(e,t,n)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,na=(e,t)=>{for(var n in t||(t={}))Zs.call(t,n)&&ta(e,n,t[n]);if(Js)for(var n of Js(t))ea.call(t,n)&&ta(e,n,t[n]);return e},ra=(e,t)=>Qs(e,Xs(t)),oa=(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 ia=class extends n.Component{constructor(e){super(e),this.getReactOptions=()=>na(na({},zs),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=na(na({},this.state.unproxiedFlags),o);Object.keys(o).length>0&&this.setState((n=>na(ra(na({},n),{unproxiedFlags:i}),Ks(e,i,r,t))))}))},this.onFailed=(e,t)=>{this.setState((e=>ra(na({},e),{error:t})))},this.onReady=(e,t,n)=>{const r=Bs(e,n);this.setState((o=>na(ra(na({},o),{unproxiedFlags:r}),Ks(e,r,t,n))))},this.prepareLDClient=()=>oa(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=Bs(o,n);else{const c=null!=(e=Us(this.props))?e:{anonymous:!0,kind:"user"};o=Pi(t,c,na(na({},Gs),r));try{yield o.waitForInitialization(this.props.timeout),a=Bs(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=>ra(na(ra(na({},e),{unproxiedFlags:a}),Ks(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?Vs(e):e,unproxiedFlags:e,flagKeyMap:{}}}}}componentDidMount(){return oa(this,null,(function*(){const{deferInitialization:e}=this.props;e&&!Us(this.props)||(yield this.prepareLDClient())}))}componentDidUpdate(e){return oa(this,null,(function*(){const{deferInitialization:t}=this.props,n=!Us(e)&&Us(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 sa=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()}},aa="api:unauthorized",la="api:authorized",ca={staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!0};let ua,da=!1,ha=null,fa=!1;const pa=async(e,t={})=>{const n=await fetch(`https://api.embedreach.com/api${e}`,{...t,credentials:"include",headers:{"Content-Type":"application/json",...ua&&{Authorization:`Bearer ${ua}`},...t.headers}});if(401===n.status)throw da||(da=!0,sa.emit(aa,void 0),ha&&window.clearTimeout(ha),ha=window.setTimeout((()=>{da=!1,fa=!1,ha=null}),5e3)),new Error("Unauthorized");if(!n.ok)throw new Error(`API Error: ${n.statusText}`);return fa||(sa.emit(la,void 0),fa=!0),n.json()};let ma=0;const ga=new Map,va=e=>{if(ga.has(e))return;const t=setTimeout((()=>{ga.delete(e),wa({type:"REMOVE_TOAST",toastId:e})}),1e6);ga.set(e,t)},ya=(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?va(n):e.toasts.forEach((e=>{va(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))}}},ba=[];let xa={toasts:[]};function wa(e){xa=ya(xa,e),ba.forEach((e=>{e(xa)}))}function Sa({...e}){const t=(ma=(ma+1)%Number.MAX_SAFE_INTEGER,ma.toString()),n=()=>wa({type:"DISMISS_TOAST",toastId:t});return wa({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||n()}}}),{id:t,dismiss:n,update:e=>wa({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function Ca(){const[e,t]=i.useState(xa);return i.useEffect((()=>(ba.push(t),()=>{const e=ba.indexOf(t);e>-1&&ba.splice(e,1)})),[e]),{...e,toast:Sa,dismiss:e=>wa({type:"DISMISS_TOAST",toastId:e})}}function ka(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Ea(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ja(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Ea(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():Ea(e[t],null)}}}}function Pa(...e){return i.useCallback(ja(...e),e)}function Ta(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}\``)}]}function _a(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}\``)}]},Na(o,...n)]}function Na(...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 Da=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(Ra);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(Ma,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(Ma,{...o,ref:n,children:r})}));Da.displayName="Slot";var Ma=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,{...Aa(r,n.props),ref:t?ja(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));Ma.displayName="SlotClone";var Oa=({children:e})=>t.jsx(t.Fragment,{children:e});function Ra(e){return i.isValidElement(e)&&e.type===Oa}function Aa(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 La(e){const r=e+"CollectionProvider",[o,i]=_a(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=Pa(n,a(c,r).collectionRef);return t.jsx(Da,{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=Pa(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(Da,{[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 Ia=["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?Da: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 Fa(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}function $a(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function qa(e,t=globalThis?.document){const n=$a(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 za,Ua="dismissableLayer.update",Va="dismissableLayer.pointerDownOutside",Ba="dismissableLayer.focusOutside",Ka=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ha=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(Ka),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Pa(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=$a(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Ya(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=$a(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){Ya(Ba,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 qa((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&&(za=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Ga(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=za)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Ga())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(Ua,e),()=>document.removeEventListener(Ua,e)}),[]),t.jsx(Ia.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ka(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ka(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ka(e.onPointerDownCapture,C.onPointerDownCapture)})}));Ha.displayName="DismissableLayer";var Wa=i.forwardRef(((e,n)=>{const r=i.useContext(Ka),o=i.useRef(null),s=Pa(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Ia.div,{...e,ref:s})}));function Ga(){const e=new CustomEvent(Ua);document.dispatchEvent(e)}function Ya(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?Fa(o,i):o.dispatchEvent(i)}Wa.displayName="DismissableLayerBranch";var Qa=Ha,Xa=Wa,Ja=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},Za=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);Ja((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(Ia.div,{...s,ref:n}),c):null}));Za.displayName="Portal";var el=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=tl(r.current);s.current="mounted"===l?e:"none"}),[l]),Ja((()=>{const t=r.current,n=o.current;if(n!==e){const r=s.current,i=tl(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]),Ja((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const s=tl(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=tl(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=Pa(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 tl(e){return e?.animationName||"none"}function nl({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=$a(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=$a(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])]}el.displayName="Presence";var rl=i.forwardRef(((e,n)=>t.jsx(Ia.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}})));rl.displayName="VisuallyHidden";var ol=rl,il="ToastProvider",[sl,al,ll]=La("Toast"),[cl,ul]=_a("Toast",[ll]),[dl,hl]=cl(il),fl=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(sl.Provider,{scope:n,children:t.jsx(dl,{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})})};fl.displayName=il;var pl="ToastViewport",ml=["F8"],gl="toast.viewportPause",vl="toast.viewportResume",yl=i.forwardRef(((e,n)=>{const{__scopeToast:r,hotkey:o=ml,label:s="Notifications ({hotkey})",...a}=e,l=hl(pl,r),c=al(r),u=i.useRef(null),d=i.useRef(null),h=i.useRef(null),f=i.useRef(null),p=Pa(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(gl);t.dispatchEvent(e),l.isClosePausedRef.current=!0}},r=()=>{if(l.isClosePausedRef.current){const e=new CustomEvent(vl);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,...Ll(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));Il(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(Xa,{ref:u,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&t.jsx(xl,{ref:d,onFocusFromOutsideViewport:()=>{Il(v({tabbingDirection:"forwards"}))}}),t.jsx(sl.Slot,{scope:r,children:t.jsx(Ia.ol,{tabIndex:-1,...a,ref:p})}),g&&t.jsx(xl,{ref:h,onFocusFromOutsideViewport:()=>{Il(v({tabbingDirection:"backwards"}))}})]})}));yl.displayName=pl;var bl="ToastFocusProxy",xl=i.forwardRef(((e,n)=>{const{__scopeToast:r,onFocusFromOutsideViewport:o,...i}=e,s=hl(bl,r);return t.jsx(rl,{"aria-hidden":!0,tabIndex:0,...i,ref:n,style:{position:"fixed"},onFocus:e=>{const t=e.relatedTarget;!s.viewport?.contains(t)&&o()}})}));xl.displayName=bl;var wl="Toast",Sl=i.forwardRef(((e,n)=>{const{forceMount:r,open:o,defaultOpen:i,onOpenChange:s,...a}=e,[l=!0,c]=nl({prop:o,defaultProp:i,onChange:s});return t.jsx(el,{present:r||l,children:t.jsx(El,{open:l,...a,ref:n,onClose:()=>c(!1),onPause:$a(e.onPause),onResume:$a(e.onResume),onSwipeStart:ka(e.onSwipeStart,(e=>{e.currentTarget.setAttribute("data-swipe","start")})),onSwipeMove:ka(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:ka(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:ka(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)}))})})}));Sl.displayName=wl;var[Cl,kl]=cl(wl,{onClose(){}}),El=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=hl(wl,r),[b,x]=i.useState(null),w=Pa(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:_}=y,N=$a((()=>{const e=b?.contains(document.activeElement);e&&y.viewport?.focus(),c()})),D=i.useCallback((e=>{e&&e!==1/0&&(window.clearTimeout(P.current),E.current=(new Date).getTime(),P.current=window.setTimeout(N,e))}),[N]);i.useEffect((()=>{const e=y.viewport;if(e){const t=()=>{D(j.current),h?.()},n=()=>{const e=(new Date).getTime()-E.current;j.current=j.current-e,window.clearTimeout(P.current),d?.()};return e.addEventListener(gl,n),e.addEventListener(vl,t),()=>{e.removeEventListener(gl,n),e.removeEventListener(vl,t)}}}),[y.viewport,k,d,h,D]),i.useEffect((()=>{l&&!y.isClosePausedRef.current&&D(k)}),[l,k,y.isClosePausedRef,D]),i.useEffect((()=>(T(),()=>_())),[T,_]);const M=i.useMemo((()=>b?Ol(b):null),[b]);return y.viewport?t.jsxs(t.Fragment,{children:[M&&t.jsx(jl,{__scopeToast:r,role:"status","aria-live":"foreground"===o?"assertive":"polite","aria-atomic":!0,children:M}),t.jsx(Cl,{scope:r,onClose:N,children:s.createPortal(t.jsx(sl.ItemSlot,{scope:r,children:t.jsx(Qa,{asChild:!0,onEscapeKeyDown:ka(u,(()=>{y.isFocusedToastEscapeKeyDownRef.current||N(),y.isFocusedToastEscapeKeyDownRef.current=!1})),children:t.jsx(Ia.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:ka(e.onKeyDown,(e=>{"Escape"===e.key&&(u?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,N()))})),onPointerDown:ka(e.onPointerDown,(e=>{0===e.button&&(S.current={x:e.clientX,y:e.clientY})})),onPointerMove:ka(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,Rl("toast.swipeMove",p,u,{discrete:!1})):Al(c,y.swipeDirection,l)?(C.current=c,Rl("toast.swipeStart",f,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>l||Math.abs(n)>l)&&(S.current=null)})),onPointerUp:ka(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};Al(t,y.swipeDirection,y.swipeThreshold)?Rl("toast.swipeEnd",g,r,{discrete:!0}):Rl("toast.swipeCancel",m,r,{discrete:!0}),n.addEventListener("click",(e=>e.preventDefault()),{once:!0})}}))})})}),y.viewport)})]}):null})),jl=e=>{const{__scopeToast:n,children:r,...o}=e,s=hl(wl,n),[a,l]=i.useState(!1),[c,u]=i.useState(!1);return function(e=()=>{}){const t=$a(e);Ja((()=>{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(Za,{asChild:!0,children:t.jsx(rl,{...o,children:a&&t.jsxs(t.Fragment,{children:[s.label," ",r]})})})},Pl=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(Ia.div,{...o,ref:n})}));Pl.displayName="ToastTitle";var Tl=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e;return t.jsx(Ia.div,{...o,ref:n})}));Tl.displayName="ToastDescription";var _l=i.forwardRef(((e,n)=>{const{altText:r,...o}=e;return r.trim()?t.jsx(Ml,{altText:r,asChild:!0,children:t.jsx(Dl,{...o,ref:n})}):null}));_l.displayName="ToastAction";var Nl="ToastClose",Dl=i.forwardRef(((e,n)=>{const{__scopeToast:r,...o}=e,i=kl(Nl,r);return t.jsx(Ml,{asChild:!0,children:t.jsx(Ia.button,{type:"button",...o,ref:n,onClick:ka(e.onClick,i.onClose)})})}));Dl.displayName=Nl;var Ml=i.forwardRef(((e,n)=>{const{__scopeToast:r,altText:o,...i}=e;return t.jsx(Ia.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...i,ref:n})}));function Ol(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(...Ol(e))}})),t}function Rl(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?Fa(o,i):o.dispatchEvent(i)}var Al=(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 Ll(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 Il(e){const t=document.activeElement;return e.some((e=>e===t||(e.focus(),document.activeElement!==t)))}var Fl=fl,$l=yl,ql=Sl,zl=Pl,Ul=Tl,Vl=_l,Bl=Dl;function Kl(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=Kl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Hl(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Kl(e))&&(r&&(r+=" "),r+=t);return r}const Wl=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Gl=Hl,Yl=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return Gl(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=Wl(t)||Wl(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 Gl(e,s,l,null==n?void 0:n.class,null==n?void 0:n.className)}
10
10
  /**
11
11
  * @license lucide-react v0.464.0 - ISC
12
12
  *
13
13
  * This source code is licensed under the ISC license.
14
14
  * See the LICENSE file in the root directory of this source tree.
15
- */,xu=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim()
15
+ */,Ql=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim()
16
16
  /**
17
17
  * @license lucide-react v0.464.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */;var wu={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"};
21
+ */;var Xl={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
22
  /**
23
23
  * @license lucide-react v0.464.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */const Su=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,...wu,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:xu("lucide",i),...l},[...a.map((([e,t])=>n.createElement(e,t))),...Array.isArray(s)?s:[s]]))),Cu=(e,t)=>{const r=n.forwardRef((({className:r,...o},i)=>{return n.createElement(Su,{ref:i,iconNode:t,className:xu(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var s}));return r.displayName=`${e}`,r},ku=Cu("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"}]]),Eu=Cu("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"}]]),ju=Cu("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Pu=Cu("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Tu=Cu("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),_u=Cu("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Nu=Cu("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Du=Cu("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Mu=Cu("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"}]]),Ou=Cu("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"}]]),Ru=Cu("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),Au=Cu("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Lu=Cu("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"}]]),Iu=Cu("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Fu=Cu("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"}]]),$u=Cu("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),qu=Cu("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"}]]),zu=Cu("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"}]]),Uu=Cu("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"}]]),Vu=Cu("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"}]]),Bu=Cu("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),Ku=Cu("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Hu=Cu("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"}]]),Wu=Cu("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Gu=Cu("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Yu=Cu("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"}]]),Qu=Cu("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"}]]),Xu=Cu("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Ju=Cu("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"}]]),Zu=Cu("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"}]]),ed=Cu("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"}]]),td=Cu("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"}]]),nd=Cu("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=Cu("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"}]]),od=Cu("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),id=e=>{const t=cd(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),sd(n,t)||ld(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},sd=(e,t)=>{if(0===e.length)return t.classGroupId;const n=t.nextPart.get(e[0]),r=n?sd(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},ad=/^\[(.+)\]$/,ld=e=>{if(ad.test(e)){const t=ad.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},cd=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return fd(Object.entries(e.classGroups),n).forEach((([e,n])=>{ud(n,r,e,t)})),r},ud=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return hd(e)?void ud(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{ud(o,dd(t,e),n,r)}))}else{(""===e?t:dd(t,e)).classGroupId=n}}))},dd=(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},hd=e=>e.isThemeGetter,fd=(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,pd=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)}}},md=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},gd=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},vd=/\s+/;
27
+ */const Jl=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,...Xl,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:Ql("lucide",i),...l},[...a.map((([e,t])=>n.createElement(e,t))),...Array.isArray(s)?s:[s]]))),Zl=(e,t)=>{const r=n.forwardRef((({className:r,...o},i)=>{return n.createElement(Jl,{ref:i,iconNode:t,className:Ql(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var s}));return r.displayName=`${e}`,r},ec=Zl("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"}]]),tc=Zl("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"}]]),nc=Zl("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),rc=Zl("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),oc=Zl("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),ic=Zl("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),sc=Zl("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),ac=Zl("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),lc=Zl("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"}]]),cc=Zl("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"}]]),uc=Zl("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),dc=Zl("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),hc=Zl("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"}]]),fc=Zl("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),pc=Zl("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"}]]),mc=Zl("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),gc=Zl("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"}]]),vc=Zl("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"}]]),yc=Zl("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"}]]),bc=Zl("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"}]]),xc=Zl("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),wc=Zl("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Sc=Zl("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"}]]),Cc=Zl("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),kc=Zl("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Ec=Zl("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"}]]),jc=Zl("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"}]]),Pc=Zl("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Tc=Zl("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"}]]),_c=Zl("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"}]]),Nc=Zl("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"}]]),Dc=Zl("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"}]]),Mc=Zl("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"}]]),Oc=Zl("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"}]]),Rc=Zl("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ac=e=>{const t=$c(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),Lc(n,t)||Fc(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},Lc=(e,t)=>{if(0===e.length)return t.classGroupId;const n=t.nextPart.get(e[0]),r=n?Lc(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},Ic=/^\[(.+)\]$/,Fc=e=>{if(Ic.test(e)){const t=Ic.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$c=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Vc(Object.entries(e.classGroups),n).forEach((([e,n])=>{qc(n,r,e,t)})),r},qc=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return Uc(e)?void qc(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{qc(o,zc(t,e),n,r)}))}else{(""===e?t:zc(t,e)).classGroupId=n}}))},zc=(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},Uc=e=>e.isThemeGetter,Vc=(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,Bc=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)}}},Kc=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},Hc=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},Wc=/\s+/;
28
28
  /**
29
29
  * @license lucide-react v0.464.0 - ISC
30
30
  *
31
31
  * This source code is licensed under the ISC license.
32
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=bd(e))&&(r&&(r+=" "),r+=t);return r}const bd=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bd(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:pd(e.cacheSize),parseClassName:md(e),...id(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(vd);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=gd(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 wd=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Sd=/^\[(?:([a-z-]+):)?(.+)\]$/i,Cd=/^\d+\/\d+$/,kd=new Set(["px","full","screen"]),Ed=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jd=/\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$/,Pd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Td=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_d=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nd=e=>Md(e)||kd.has(e)||Cd.test(e),Dd=e=>Kd(e,"length",Hd),Md=e=>Boolean(e)&&!Number.isNaN(Number(e)),Od=e=>Kd(e,"number",Md),Rd=e=>Boolean(e)&&Number.isInteger(Number(e)),Ad=e=>e.endsWith("%")&&Md(e.slice(0,-1)),Ld=e=>Sd.test(e),Id=e=>Ed.test(e),Fd=new Set(["length","size","percentage"]),$d=e=>Kd(e,Fd,Wd),qd=e=>Kd(e,"position",Wd),zd=new Set(["image","url"]),Ud=e=>Kd(e,zd,Yd),Vd=e=>Kd(e,"",Gd),Bd=()=>!0,Kd=(e,t,n)=>{const r=Sd.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Hd=e=>jd.test(e)&&!Pd.test(e),Wd=()=>!1,Gd=e=>Td.test(e),Yd=e=>_d.test(e),Qd=xd((()=>{const e=wd("colors"),t=wd("spacing"),n=wd("blur"),r=wd("brightness"),o=wd("borderColor"),i=wd("borderRadius"),s=wd("borderSpacing"),a=wd("borderWidth"),l=wd("contrast"),c=wd("grayscale"),u=wd("hueRotate"),d=wd("invert"),h=wd("gap"),f=wd("gradientColorStops"),p=wd("gradientColorStopPositions"),m=wd("inset"),g=wd("margin"),v=wd("opacity"),y=wd("padding"),b=wd("saturate"),x=wd("scale"),w=wd("sepia"),S=wd("skew"),C=wd("space"),k=wd("translate"),E=()=>["auto",Ld,t],j=()=>[Ld,t],P=()=>["",Nd,Dd],T=()=>["auto",Md,Ld],_=()=>["","0",Ld],N=()=>[Md,Ld];return{cacheSize:500,separator:":",theme:{colors:[Bd],spacing:[Nd,Dd],blur:["none","",Id,Ld],brightness:N(),borderColor:[e],borderRadius:["none","","full",Id,Ld],borderSpacing:j(),borderWidth:P(),contrast:N(),grayscale:_(),hueRotate:N(),invert:_(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[Ad,Dd],inset:E(),margin:E(),opacity:N(),padding:j(),saturate:N(),scale:N(),sepia:_(),skew:N(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",Ld]}],container:["container"],columns:[{columns:[Id]}],"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",Ld]}],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",Rd,Ld]}],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",Ld]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",Rd,Ld]}],"grid-cols":[{"grid-cols":[Bd]}],"col-start-end":[{col:["auto",{span:["full",Rd,Ld]},Ld]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[Bd]}],"row-start-end":[{row:["auto",{span:[Rd,Ld]},Ld]}],"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",Ld]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ld]}],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",Ld,t]}],"min-w":[{"min-w":[Ld,t,"min","max","fit"]}],"max-w":[{"max-w":[Ld,t,"none","full","min","max","fit","prose",{screen:[Id]},Id]}],h:[{h:[Ld,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ld,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ld,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ld,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Id,Dd]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Od]}],"font-family":[{font:[Bd]}],"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",Ld]}],"line-clamp":[{"line-clamp":["none",Md,Od]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nd,Ld]}],"list-image":[{"list-image":["none",Ld]}],"list-style-type":[{list:["none","disc","decimal",Ld]}],"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",Nd,Dd]}],"underline-offset":[{"underline-offset":["auto",Nd,Ld]}],"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",Ld]}],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",Ld]}],"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",qd]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$d]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ud]}],"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":[Nd,Ld]}],"outline-w":[{outline:[Nd,Dd]}],"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":[Nd,Dd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Id,Vd]}],"shadow-color":[{shadow:[Bd]}],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",Id,Ld]}],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",Ld]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",Ld]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ld]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Rd,Ld]}],"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",Ld]}],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",Ld]}],"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",Ld]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nd,Dd,Od]}],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 Xd(...e){return Qd(gu(e))}const Jd=lu,Zd=i.forwardRef((({className:e,...n},r)=>t.jsx(cu,{ref:r,className:Xd("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})));Zd.displayName=cu.displayName;const eh=bu("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"}}),th=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx(uu,{ref:o,className:Xd(eh({variant:n}),e),...r})));th.displayName=uu.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(fu,{ref:r,className:Xd("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=fu.displayName;const nh=i.forwardRef((({className:e,...n},r)=>t.jsx(pu,{ref:r,className:Xd("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(od,{className:"h-4 w-4"})})));nh.displayName=pu.displayName;const rh=i.forwardRef((({className:e,...n},r)=>t.jsx(du,{ref:r,className:Xd("text-sm font-semibold [&+div]:text-xs",e),...n})));rh.displayName=du.displayName;const oh=i.forwardRef((({className:e,...n},r)=>t.jsx(hu,{ref:r,className:Xd("text-sm opacity-90",e),...n})));function ih(){const{toasts:e}=Wl();return t.jsxs(Jd,{children:[e.map((function({id:e,title:n,description:r,action:o,...i}){return t.jsxs(th,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(rh,{children:n}),r&&t.jsx(oh,{children:r})]}),o,t.jsx(nh,{})]},e)})),t.jsx(Zd,{})]})}oh.displayName=hu.displayName;const sh=n.createContext({});function ah(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const lh=n.createContext(null),ch=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uh 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 dh({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(ch);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(uh,{isPresent:r,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const hh=({children:e,initial:r,isPresent:o,onExitComplete:s,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=ah(fh),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(dh,{isPresent:o,anchorX:u,children:e})),t.jsx(lh.Provider,{value:p,children:e})};function fh(){return new Map}function ph(e=!0){const t=n.useContext(lh);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 mh=e=>e.key||"";function gh(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const vh="undefined"!=typeof window,yh=vh?n.useLayoutEffect:n.useEffect,bh=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=ph(l),h=n.useMemo((()=>gh(e)),[e]),f=l&&!u?[]:h.map(mh),p=n.useRef(!0),m=n.useRef(h),g=ah((()=>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=mh(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=mh(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===a&&w.length&&(e=w),x(gh(e)),y(h),null}process;const{forceRender:S}=n.useContext(sh);return t.jsx(t.Fragment,{children:b.map((e=>{const n=mh(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(hh,{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 wh=xh,Sh=xh;function Ch(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(wh=(e,t)=>{},Sh=(e,t)=>{if(!e)throw new Error(t)});const kh=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Eh=e=>1e3*e,jh=e=>e/1e3,Ph=!1,Th=["read","resolveKeyframes","update","preRender","render","postRender"],_h={value:null,addProjectionMetrics:null};function Nh(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Th.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&&_h.value&&_h.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:Th.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<Th.length;t++)s[Th[t]].cancel(e)},state:o,steps:s}}const{schedule:Dh,cancel:Mh,state:Oh,steps:Rh}=Nh("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:xh,!0),Ah=n.createContext({strict:!1}),Lh={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"]},Ih={};for(const EY in Lh)Ih[EY]={isEnabled:e=>Lh[EY].some((t=>!!e[t]))};const Fh=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 $h(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Fh.has(e)}let qh=e=>!$h(e);try{(zh=require("@emotion/is-prop-valid").default)&&(qh=e=>e.startsWith("on")?!$h(e):zh(e))}catch(CY){}var zh;const Uh=new Set;function Vh(e,t,n){e||Uh.has(t)||Uh.add(t)}function Bh(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&Vh(!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 Kh=n.createContext({});function Hh(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Wh(e){return"string"==typeof e||Array.isArray(e)}const Gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yh=["initial",...Gh];function Qh(e){return Hh(e.animate)||Yh.some((t=>Wh(e[t])))}function Xh(e){return Boolean(Qh(e)||e.variants)}function Jh(e){const{initial:t,animate:r}=function(e,t){if(Qh(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Wh(t)?t:void 0,animate:Wh(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(Kh));return n.useMemo((()=>({initial:t,animate:r})),[Zh(t),Zh(r)])}function Zh(e){return Array.isArray(e)?e.join(" "):e}const ef=Symbol.for("motionComponentSymbol");function tf(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nf(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):tf(r)&&(r.current=n))}),[t])}const rf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),of="data-"+rf("framerAppearId"),{schedule:sf}=Nh(queueMicrotask,!1),af=n.createContext({});function lf(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(Kh),c=n.useContext(Ah),u=n.useContext(lh),d=n.useContext(ch).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(af);!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:cf(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&tf(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[of],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(),sf.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 cf(e){if(e)return!1!==e.options.allowProjection?e.projection:cf(e.parent)}function uf({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(ch),...a,layoutId:df(a)},{isStatic:d}=u,h=Jh(a),f=i(a,d);if(!d&&vh){!function(e,t){const r=n.useContext(Ah).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?wh(!1,t):Sh(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=Ih;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=lf(s,f,u,r,t.ProjectionNode)}return t.jsxs(Kh.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,nf(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)Ih[t]={...Ih[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[ef]=s,u}function df({layoutId:e}){const t=n.useContext(sh).id;return t&&void 0!==e?t+"-"+e:e}const hf=e=>t=>"string"==typeof t&&t.startsWith(e),ff=hf("--"),pf=hf("var(--"),mf=e=>!!pf(e)&&gf.test(e.split("/*")[0].trim()),gf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vf={};const yf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bf=new Set(yf);function xf(e,{layout:t,layoutId:n}){return bf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!vf[e]||"opacity"===e)}const wf=e=>Boolean(e&&e.getVelocity),Sf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Cf=(e,t,n)=>n>t?t:n<e?e:n,kf={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Ef={...kf,transform:e=>Cf(0,1,e)},jf={...kf,default:1},Pf=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Tf=Pf("deg"),_f=Pf("%"),Nf=Pf("px"),Df=Pf("vh"),Mf=Pf("vw"),Of={..._f,parse:e=>_f.parse(e)/100,transform:e=>_f.transform(100*e)},Rf={borderWidth:Nf,borderTopWidth:Nf,borderRightWidth:Nf,borderBottomWidth:Nf,borderLeftWidth:Nf,borderRadius:Nf,radius:Nf,borderTopLeftRadius:Nf,borderTopRightRadius:Nf,borderBottomRightRadius:Nf,borderBottomLeftRadius:Nf,width:Nf,maxWidth:Nf,height:Nf,maxHeight:Nf,top:Nf,right:Nf,bottom:Nf,left:Nf,padding:Nf,paddingTop:Nf,paddingRight:Nf,paddingBottom:Nf,paddingLeft:Nf,margin:Nf,marginTop:Nf,marginRight:Nf,marginBottom:Nf,marginLeft:Nf,backgroundPositionX:Nf,backgroundPositionY:Nf},Af={rotate:Tf,rotateX:Tf,rotateY:Tf,rotateZ:Tf,scale:jf,scaleX:jf,scaleY:jf,scaleZ:jf,skew:Tf,skewX:Tf,skewY:Tf,distance:Nf,translateX:Nf,translateY:Nf,translateZ:Nf,x:Nf,y:Nf,z:Nf,perspective:Nf,transformPerspective:Nf,opacity:Ef,originX:Of,originY:Of,originZ:Nf},Lf={...kf,transform:Math.round},If={...Rf,...Af,zIndex:Lf,size:Nf,fillOpacity:Ef,strokeOpacity:Ef,numOctaves:Lf},Ff={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$f=yf.length;function qf(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(bf.has(l))s=!0;else if(ff(l))o[l]=e;else{const t=Sf(e,If[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<$f;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=Sf(a,If[s]);l||(o=!1,r+=`${Ff[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 zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uf(e,t,n){for(const r in t)wf(t[r])||xf(r,n)||(e[r]=t[r])}function Vf(e,t){const r={};return Uf(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return qf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function Bf(e,t){const n={},r=Vf(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 Kf=["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 Hf(e){return"string"==typeof e&&!e.includes("-")&&!!(Kf.indexOf(e)>-1||/[A-Z]/u.test(e))}const Wf={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gf={offset:"strokeDashoffset",array:"strokeDasharray"};function Yf(e,t,n){return"string"==typeof e?e:Nf.transform(t+n*e)}function Qf(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(qf(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`${Yf(t,e.x,e.width)} ${Yf(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?Wf:Gf;e[i.offset]=Nf.transform(-r);const s=Nf.transform(t),a=Nf.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const Xf=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Jf=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Zf(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Qf(n,t,Jf(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Uf(t,e.style,e),i.style={...t,...i.style}}return i}function ep(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(Hf(t)?Zf:Bf)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(qh(o)||!0===n&&$h(o)||!t&&!$h(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((()=>wf(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function tp(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function np(e,t,n,r){if("function"==typeof t){const[o,i]=tp(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]=tp(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const rp=e=>Array.isArray(e);function op(e){const t=wf(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const ip=e=>(t,r)=>{const o=n.useContext(Kh),i=n.useContext(lh),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:sp(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():ah(s)};function sp(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=op(i[h]);let{initial:s,animate:a}=e;const l=Qh(e),c=Xh(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&&!Hh(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=np(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 ap(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(wf(o[s])||t.style&&wf(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 lp={useVisualState:ip({scrapeMotionValuesFromProps:ap,createRenderState:zf})};function cp(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(SY){t.dimensions={x:0,y:0,width:0,height:0}}}function up(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 dp=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 hp(e,t,n,r){up(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(dp.has(o)?o:rf(o),t.attrs[o])}function fp(e,t,n){const r=ap(e,t,n);for(const o in e)if(wf(e[o])||wf(t[o])){r[-1!==yf.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const pp=["x","y","width","height","cx","cy","r"],mp={useVisualState:ip({scrapeMotionValuesFromProps:fp,createRenderState:Xf,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(bf.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<pp.length;a++){const n=pp[a];e[n]!==t[n]&&(s=!0)}s&&Dh.read((()=>{cp(n,r),Dh.render((()=>{Qf(r,o,Jf(n.tagName),e.transformTemplate),hp(n,r)}))}))}})};function gp(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return uf({...Hf(n)?mp:lp,preloadedFeatures:e,useRender:ep(r),createVisualElement:t,Component:n})}}function vp(e,t,n){const r=e.getProps();return np(r,t,void 0!==n?n:r.custom,e)}const yp=Ch((()=>void 0!==window.ScrollTimeline));class bp{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 bp{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function wp(e,t){return e?e[t]||e.default||e:void 0}const Sp=2e4;function Cp(e){let t=0;let n=e.next(t);for(;!n.done&&t<Sp;)t+=50,n=e.next(t);return t>=Sp?1/0:t}function kp(e){return"function"==typeof e}function Ep(e,t){e.timeline=t,e.onfinish=null}const jp=e=>Array.isArray(e)&&"number"==typeof e[0],Pp={linearEasing:void 0};function Tp(e,t){const n=Ch(e);return()=>{var e;return null!==(e=Pp[t])&&void 0!==e?e:n()}}const _p=Tp((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(SY){return!1}return!0}),"linearEasing"),Np=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(kh(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Dp(e){return Boolean("function"==typeof e&&_p()||!e||"string"==typeof e&&(e in Op||_p())||jp(e)||Array.isArray(e)&&e.every(Dp))}const Mp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Op={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mp([0,.65,.55,1]),circOut:Mp([.55,0,1,.45]),backIn:Mp([.31,.01,.66,-.59]),backOut:Mp([.33,1.53,.69,.99])};function Rp(e,t){return e?"function"==typeof e&&_p()?Np(e,t):jp(e)?Mp(e):Array.isArray(e)?e.map((e=>Rp(e,t)||Op.easeOut)):Op[e]:void 0}const Ap={x:!1,y:!1};function Lp(){return Ap.x||Ap.y}function Ip(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 Fp(e){return!("touch"===e.pointerType||Lp())}const $p=(e,t)=>!!t&&(e===t||$p(e,t.parentElement)),qp=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,zp=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Up=new WeakSet;function Vp(e){return t=>{"Enter"===t.key&&e(t)}}function Bp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Kp(e){return qp(e)&&!Lp()}function Hp(e,t,n={}){const[r,o,i]=Ip(e,n),s=e=>{const r=e.currentTarget;if(!Kp(e)||Up.has(r))return;Up.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Kp(e)&&Up.has(r)&&(Up.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||$p(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 zp.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=Vp((()=>{if(Up.has(n))return;Bp(n,"down");const e=Vp((()=>{Bp(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>Bp(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const Wp=new Set(["width","height","top","left","right","bottom",...yf]);let Gp;function Yp(){Gp=void 0}const Qp={now:()=>(void 0===Gp&&Qp.set(Oh.isProcessing||Ph?Oh.timestamp:performance.now()),Gp),set:e=>{Gp=e,queueMicrotask(Yp)}};function Xp(e,t){-1===e.indexOf(t)&&e.push(t)}function Jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Zp{constructor(){this.subscriptions=[]}add(e){return Xp(this.subscriptions,e),()=>Jp(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 em(e,t){return t?e*(1e3/t):0}class tm{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Qp.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=Qp.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&&Vh(!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 Zp);const n=this.events[e].add(t);return"change"===e?()=>{n(),Dh.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=Qp.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return em(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 nm(e,t){return new tm(e,t)}function rm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,nm(n))}function om(e,t){const n=e.getValue("willChange");if(r=n,Boolean(wf(r)&&r.add))return n.add(t);var r}function im(e){return e.props[of]}const sm=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function am(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=sm(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:sm(o(e),t,r)}const lm=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,cm=e=>t=>1-e(1-t),um=am(.33,1.53,.69,.99),dm=cm(um),hm=lm(dm),fm=e=>(e*=2)<1?.5*dm(e):.5*(2-Math.pow(2,-10*(e-1))),pm=e=>1-Math.sin(Math.acos(e)),mm=cm(pm),gm=lm(pm),vm=e=>/^0[^.\s]+$/u.test(e);const ym=e=>Math.round(1e5*e)/1e5,bm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const xm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wm=(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)),Sm=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(bm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Cm={...kf,transform:e=>Math.round((e=>Cf(0,255,e))(e))},km={test:wm("rgb","red"),parse:Sm("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Cm.transform(e)+", "+Cm.transform(t)+", "+Cm.transform(n)+", "+ym(Ef.transform(r))+")"};const Em={test:wm("#"),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:km.transform},jm={test:wm("hsl","hue"),parse:Sm("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+_f.transform(ym(t))+", "+_f.transform(ym(n))+", "+ym(Ef.transform(r))+")"},Pm={test:e=>km.test(e)||Em.test(e)||jm.test(e),parse:e=>km.test(e)?km.parse(e):jm.test(e)?jm.parse(e):Em.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?km.transform(e):jm.transform(e)},Tm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const _m="number",Nm="color",Dm=/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 Mm(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Dm,(e=>(Pm.test(e)?(r.color.push(i),o.push(Nm),n.push(Pm.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(_m),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function Om(e){return Mm(e).values}function Rm(e){const{split:t,types:n}=Mm(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===_m?ym(e[i]):t===Nm?Pm.transform(e[i]):e[i]}return o}}const Am=e=>"number"==typeof e?0:e;const Lm={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(bm))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Tm))||void 0===n?void 0:n.length)||0)>0},parse:Om,createTransformer:Rm,getAnimatableNone:function(e){const t=Om(e);return Rm(e)(t.map(Am))}},Im=new Set(["brightness","contrast","saturate","opacity"]);function Fm(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(bm)||[];if(!r)return e;const o=n.replace(r,"");let i=Im.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const $m=/\b([a-z-]*)\(.*?\)/gu,qm={...Lm,getAnimatableNone:e=>{const t=e.match($m);return t?t.map(Fm).join(" "):e}},zm={...If,color:Pm,backgroundColor:Pm,outlineColor:Pm,fill:Pm,stroke:Pm,borderColor:Pm,borderTopColor:Pm,borderRightColor:Pm,borderBottomColor:Pm,borderLeftColor:Pm,filter:qm,WebkitFilter:qm},Um=e=>zm[e];function Vm(e,t){let n=Um(e);return n!==qm&&(n=Lm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bm=new Set(["auto","none","0"]);const Km=e=>e===kf||e===Nf,Hm=(e,t)=>parseFloat(e.split(", ")[t]),Wm=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Hm(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Hm(t[1],e):0}},Gm=new Set(["x","y","z"]),Ym=yf.filter((e=>!Gm.has(e)));const Qm={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:Wm(4,13),y:Wm(5,14)};Qm.translateX=Qm.x,Qm.translateY=Qm.y;const Xm=new Set;let Jm=!1,Zm=!1;function eg(){if(Zm){const e=Array.from(Xm).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 Ym.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)}))}Zm=!1,Jm=!1,Xm.forEach((e=>e.complete())),Xm.clear()}function tg(){Xm.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Zm=!0)}))}class ng{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?(Xm.add(this),Jm||(Jm=!0,Dh.read(tg),Dh.resolveKeyframes(eg))):(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),Xm.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Xm.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const rg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),og=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ig(e,t,n=1){Sh(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=og.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 mf(o)?ig(o,t,n+1):o}const sg=e=>t=>t.test(e),ag=[kf,Nf,_f,Tf,Mf,Df,{test:e=>"auto"===e,parse:e=>e}],lg=e=>ag.find(sg(e));class cg extends ng{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(),mf(n))){const r=ig(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Wp.has(n)||2!==e.length)return;const[r,o]=e,i=lg(r),s=lg(o);if(i!==s)if(Km(i)&&Km(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||vm(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&&!Bm.has(t)&&Mm(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=Vm(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=Qm[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]=Qm[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 ug=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Lm.test(e)&&"0"!==e||e.startsWith("url(")));const dg=e=>null!==e;function hg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(dg),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class fg{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=Qp.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||(tg(),eg()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Qp.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=ug(o,t),a=ug(i,t);return wh(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||kp(n))&&r)}(e,n,r,o)){if(!i)return a&&a(hg(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 pg=(e,t,n)=>e+(t-e)*n;function mg(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 gg(e,t){return n=>n>0?t:e}const vg=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yg=[Em,km,jm];function bg(e){const t=(n=e,yg.find((e=>e.test(n))));var n;if(wh(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===jm&&(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=mg(a,r,e+1/3),i=mg(a,r,e),s=mg(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=bg(e),r=bg(t);if(!n||!r)return gg(e,t);const o={...n};return e=>(o.red=vg(n.red,r.red,e),o.green=vg(n.green,r.green,e),o.blue=vg(n.blue,r.blue,e),o.alpha=pg(n.alpha,r.alpha,e),km.transform(o))},wg=(e,t)=>n=>t(e(n)),Sg=(...e)=>e.reduce(wg),Cg=new Set(["none","hidden"]);function kg(e,t){return n=>pg(e,t,n)}function Eg(e){return"number"==typeof e?kg:"string"==typeof e?mf(e)?gg:Pm.test(e)?xg:Tg:Array.isArray(e)?jg:"object"==typeof e?Pm.test(e)?xg:Pg:gg}function jg(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Eg(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function Pg(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=Eg(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Tg=(e,t)=>{const n=Lm.createTransformer(t),r=Mm(e),o=Mm(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?Cg.has(e)&&!o.values.length||Cg.has(t)&&!r.values.length?function(e,t){return Cg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Sg(jg(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):(wh(!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.`),gg(e,t))};function _g(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return pg(e,t,n);return Eg(e)(e,t)}function Ng(e,t,n){const r=Math.max(t-5,0);return em(n-e(r),t-r)}const Dg=100,Mg=10,Og=1,Rg=0,Ag=800,Lg=.3,Ig=.3,Fg={granular:.01,default:2},$g={granular:.005,default:.5},qg=.01,zg=10,Ug=.05,Vg=1,Bg=.001;function Kg({duration:e=Ag,bounce:t=Lg,velocity:n=Rg,mass:r=Og}){let o,i;wh(e<=Eh(zg),"Spring duration must be 10 seconds or less");let s=1-t;s=Cf(Ug,Vg,s),e=Cf(qg,zg,jh(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Wg(t,s),l=Math.exp(-o);return Bg-i/a*l},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=Wg(Math.pow(t,2),s);return(-o(t)+Bg>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<Hg;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=Eh(e),isNaN(a))return{stiffness:Dg,damping:Mg,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Hg=12;function Wg(e,t){return e*Math.sqrt(1-t*t)}const Gg=["duration","bounce"],Yg=["stiffness","damping","mass"];function Qg(e,t){return t.some((t=>void 0!==e[t]))}function Xg(e=Ig,t=Lg){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:Rg,stiffness:Dg,damping:Mg,mass:Og,isResolvedFromDuration:!1,...e};if(!Qg(e,Yg)&&Qg(e,Gg))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*Cf(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Og,stiffness:r,damping:o}}else{const n=Kg(e);t={...t,...n,mass:Og},t.isResolvedFromDuration=!0}return t}({...n,velocity:-jh(n.velocity||0)}),p=h||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=jh(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?Fg.granular:Fg.default),o||(o=y?$g.granular:$g.default),m<1){const e=Wg(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?Eh(p):Ng(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(Cp(x),Sp),t=Np((t=>x.next(e*t).value),e,30);return e+"ms "+t}};return x}function Jg({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=Xg({keyframes:[h.value,f(h.value)],velocity:Ng(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 Zg=am(.42,0,1,1),ev=am(0,0,.58,1),tv=am(.42,0,.58,1),nv={linear:xh,easeIn:Zg,easeInOut:tv,easeOut:ev,circIn:pm,circInOut:gm,circOut:mm,backIn:dm,backInOut:hm,backOut:um,anticipate:fm},rv=e=>{if(jp(e)){Sh(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return am(t,n,r,o)}return"string"==typeof e?(Sh(void 0!==nv[e],`Invalid easing type '${e}'`),nv[e]):e};function ov(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Sh(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||_g,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=Sg(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](kh(e[r],e[r+1],n))};return n?t=>c(Cf(e[0],e[i-1],t)):c}function iv(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(pg(n,1,kh(0,t,r)))}(t,e.length-1),t}function sv({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(rv):rv(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:iv(t),e),a=ov(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||tv)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const av=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Dh.update(t,!0),stop:()=>Mh(t),now:()=>Oh.isProcessing?Oh.timestamp:Qp.now()}},lv={decay:Jg,inertia:Jg,tween:sv,keyframes:sv,spring:Xg},cv=e=>e/100;class uv extends fg{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)||ng)(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=kp(t)?t:lv[t]||sv;let a,l;s!==sv&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Sh(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=Sg(cv,_g(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=Cp(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=Cf(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=hg(a,this.options,r)),m&&m(x.value),S&&this.finish(),x}get duration(){const{resolved:e}=this;return e?jh(e.calculatedDuration):0}get time(){return jh(this.currentTime)}set time(e){this.currentTime=e=Eh(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=jh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=av,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 dv=new Set(["opacity","clipPath","filter","transform"]);function hv(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=Rp(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 fv=Ch((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const pv={anticipate:fm,backInOut:hm,circInOut:gm};class mv extends fg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new cg(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&&_p()&&o in pv&&(o=pv[o]),kp((c=this.options).type)||"spring"===c.type||!Dp(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new uv({...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=hv(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Ep(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(hg(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 jh(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return jh(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Eh(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;Ep(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 uv({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Eh(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 fv()&&n&&dv.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const gv={type:"spring",stiffness:500,damping:25,restSpeed:10},vv={type:"keyframes",duration:.8},yv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bv=(e,{keyframes:t})=>t.length>2?vv:bf.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:gv:yv;const xv=(e,t,n,r={},o,i)=>s=>{const a=wp(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=Eh(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,...bv(e,u)}),u.duration&&(u.duration=Eh(u.duration)),u.repeatDelay&&(u.repeatDelay=Eh(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=hg(u.keyframes,a);if(void 0!==e)return Dh.update((()=>{u.onUpdate(e),u.onComplete()})),new xp([])}return!i&&mv.supports(u)?new mv(u):new uv(u)};function wv({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Sv(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&&wv(u,d))continue;const o={delay:n,...wp(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=im(e);if(t){const e=window.MotionHandoffAnimation(t,d,Dh);null!==e&&(o.startTime=e,a=!0)}}om(e,d),t.start(xv(d,t,r,e.shouldReduceMotion&&Wp.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{Dh.update((()=>{a&&function(e,t){const n=vp(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 Cv(e,t,n={}){var r;const o=vp(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(Sv(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(kv).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Cv(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 kv(e,t){return e.sortNodePosition(t)}function Ev(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 jv=Yh.length;function Pv(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Pv(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<jv;n++){const r=Yh[n],o=e.props[r];(Wh(o)||!1===o)&&(t[r]=o)}return t}const Tv=[...Gh].reverse(),_v=Gh.length;function Nv(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=>Cv(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Cv(e,t,n);else{const o="function"==typeof t?vp(e,t,n.custom):t;r=Promise.all(Sv(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function Dv(e){let t=Nv(e),n=Rv(),r=!0;const o=t=>(n,r)=>{var o;const i=vp(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=Pv(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<_v;t++){const h=Tv[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],m=Wh(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||Hh(p)||"boolean"==typeof p)continue;const y=Mv(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)?!Ev(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=Rv(),r=!0}}}function Mv(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Ev(t,e)}function Ov(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Rv(){return{animate:Ov(!0),whileInView:Ov(),whileHover:Ov(),whileTap:Ov(),whileDrag:Ov(),whileFocus:Ov(),exit:Ov()}}class Av{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Lv=0;const Iv={animation:{Feature:class extends Av{constructor(e){super(e),e.animationState||(e.animationState=Dv(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Hh(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 Av{constructor(){super(...arguments),this.id=Lv++}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 Fv(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function $v(e){return{point:{x:e.pageX,y:e.pageY}}}function qv(e,t,n,r){return Fv(e,t,(e=>t=>qp(t)&&e(t,$v(t)))(n),r)}const zv=(e,t)=>Math.abs(e-t);class Uv{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=Kv(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=zv(e.x,t.x),r=zv(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}=Oh;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=Vv(t,this.transformPagePoint),Dh.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=Kv("pointercancel"===e.type?this.lastMoveEventInfo:Vv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!qp(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Vv($v(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Oh;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Kv(i,this.history)),this.removeListeners=Sg(qv(this.contextWindow,"pointermove",this.handlePointerMove),qv(this.contextWindow,"pointerup",this.handlePointerUp),qv(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Mh(this.updatePoint)}}function Vv(e,t){return t?{point:t(e.point)}:e}function Bv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Kv({point:e},t){return{point:e,delta:Bv(e,Wv(t)),offset:Bv(e,Hv(t)),velocity:Gv(t,.1)}}function Hv(e){return e[0]}function Wv(e){return e[e.length-1]}function Gv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Wv(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Eh(t)));)n--;if(!r)return{x:0,y:0};const i=jh(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 Yv(e){return e.max-e.min}function Qv(e,t,n,r=.5){e.origin=r,e.originPoint=pg(t.min,t.max,e.origin),e.scale=Yv(n)/Yv(t),e.translate=pg(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 Xv(e,t,n,r){Qv(e.x,t.x,n.x,r?r.originX:void 0),Qv(e.y,t.y,n.y,r?r.originY:void 0)}function Jv(e,t,n){e.min=n.min+t.min,e.max=e.min+Yv(t)}function Zv(e,t,n){e.min=t.min-n.min,e.max=e.min+Yv(t)}function ey(e,t,n){Zv(e.x,t.x,n.x),Zv(e.y,t.y,n.y)}function ty(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 ny(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 ry=.35;function oy(e,t,n){return{min:iy(e,t),max:iy(e,n)}}function iy(e,t){return"number"==typeof e?e:e[t]||0}const sy=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ay(e){return[e("x"),e("y")]}function ly({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function cy(e){return void 0===e||1===e}function uy({scale:e,scaleX:t,scaleY:n}){return!cy(e)||!cy(t)||!cy(n)}function dy(e){return uy(e)||hy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function hy(e){return fy(e.x)||fy(e.y)}function fy(e){return e&&"0%"!==e}function py(e,t,n){return n+t*(e-n)}function my(e,t,n,r,o){return void 0!==o&&(e=py(e,o,r)),py(e,n,r)+t}function gy(e,t=0,n=1,r,o){e.min=my(e.min,t,n,r,o),e.max=my(e.max,t,n,r,o)}function vy(e,{x:t,y:n}){gy(e.x,t.translate,t.scale,t.originPoint),gy(e.y,n.translate,n.scale,n.originPoint)}const yy=.999999999999,by=1.0000000000001;function xy(e,t){e.min=e.min+t,e.max=e.max+t}function wy(e,t,n,r,o=.5){gy(e,t,n,pg(e.min,e.max,o),r)}function Sy(e,t){wy(e.x,t.x,t.scaleX,t.scale,t.originX),wy(e.y,t.y,t.scaleY,t.scale,t.originY)}function Cy(e,t){return ly(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 ky=({current:e})=>e?e.ownerDocument.defaultView:null,Ey=new WeakMap;class jy{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 Uv(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor($v(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?Ap[i]?null:(Ap[i]=!0,()=>{Ap[i]=!1}):Ap.x||Ap.y?null:(Ap.x=Ap.y=!0,()=>{Ap.x=Ap.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),ay((e=>{let t=this.getAxisMotionValue(e).get()||0;if(_f.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Yv(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&Dh.postRender((()=>o(e,t))),om(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:()=>ay((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:ky(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&&Dh.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||!Py(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?pg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?pg(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&&tf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:ty(e.x,n,o),y:ty(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=ry){return!1===e?e=0:!0===e&&(e=ry),{x:oy(e,"left","right"),y:oy(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ay((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||!tf(e))return!1;const n=e.current;Sh(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=Cy(e,n),{scroll:o}=t;return o&&(xy(r.x,o.offset.x),xy(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:ny(e.x,t.x),y:ny(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=ly(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ay((s=>{if(!Py(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 om(this.visualElement,e),n.start(xv(e,n,0,t,this.visualElement,!1))}stopAnimation(){ay((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){ay((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){ay((t=>{const{drag:n}=this.getProps();if(!Py(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]-pg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!tf(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ay((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=Yv(e),o=Yv(t);return o>r?n=kh(t.min,t.max-r,e.min):r>o&&(n=kh(e.min,e.max-o,t.min)),Cf(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(),ay((t=>{if(!Py(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(pg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Ey.set(this.visualElement,this);const e=qv(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();tf(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()),Dh.read(t);const o=Fv(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ay((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=ry,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Py(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Ty=e=>(t,n)=>{e&&Dh.postRender((()=>e(t,n)))};const _y={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ny(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dy={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Nf.test(e))return e;e=parseFloat(e)}return`${Ny(e,t.target.x)}% ${Ny(e,t.target.y)}%`}},My={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Lm.parse(e);if(o.length>5)return r;const i=Lm.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=pg(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 Oy 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)vf[t]=e[t],ff(t)&&(vf[t].isCSSVariable=!0)}(Ay),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()})),_y.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()||Dh.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),sf.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 Ry(e){const[r,o]=ph(),i=n.useContext(sh);return t.jsx(Oy,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(af),isPresent:r,safeToRemove:o})}const Ay={borderRadius:{...Dy,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dy,borderTopRightRadius:Dy,borderBottomLeftRadius:Dy,borderBottomRightRadius:Dy,boxShadow:My};const Ly=(e,t)=>e.depth-t.depth;class Iy{constructor(){this.children=[],this.isDirty=!1}add(e){Xp(this.children,e),this.isDirty=!0}remove(e){Jp(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ly),this.isDirty=!1,this.children.forEach(e)}}const Fy=["TopLeft","TopRight","BottomLeft","BottomRight"],$y=Fy.length,qy=e=>"string"==typeof e?parseFloat(e):e,zy=e=>"number"==typeof e||Nf.test(e);function Uy(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Vy=Ky(0,.5,mm),By=Ky(.5,.95,xh);function Ky(e,t,n){return r=>r<e?0:r>t?1:n(kh(e,t,r))}function Hy(e,t){e.min=t.min,e.max=t.max}function Wy(e,t){Hy(e.x,t.x),Hy(e.y,t.y)}function Gy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yy(e,t,n,r,o){return e=py(e-=t,1/n,r),void 0!==o&&(e=py(e,1/o,r)),e}function Qy(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){_f.test(t)&&(t=parseFloat(t),t=pg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=pg(i.min,i.max,r);e===i&&(a-=t),e.min=Yy(e.min,t,n,a,o),e.max=Yy(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Xy=["x","scaleX","originX"],Jy=["y","scaleY","originY"];function Zy(e,t,n,r){Qy(e.x,t,Xy,n?n.x:void 0,r?r.x:void 0),Qy(e.y,t,Jy,n?n.y:void 0,r?r.y:void 0)}function eb(e){return 0===e.translate&&1===e.scale}function tb(e){return eb(e.x)&&eb(e.y)}function nb(e,t){return e.min===t.min&&e.max===t.max}function rb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ob(e,t){return rb(e.x,t.x)&&rb(e.y,t.y)}function ib(e){return Yv(e.x)/Yv(e.y)}function sb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ab{constructor(){this.members=[]}add(e){Xp(this.members,e),e.scheduleRender()}remove(e){if(Jp(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 lb=["","X","Y","Z"],cb={visibility:"hidden"};let ub=0;function db(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=im(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Dh,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hb(r)}function fb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=ub++,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(gb),this.nodes.forEach(Cb),this.nodes.forEach(kb),this.nodes.forEach(vb)},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 Iy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Zp),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=Qp.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Mh(r),e(i-t))};return Dh.read(r,!0),()=>Mh(r)}(r,250),_y.hasAnimatedSinceResize&&(_y.hasAnimatedSinceResize=!1,this.nodes.forEach(Sb))}))}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()||Nb,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ob(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={...wp(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Sb(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,Mh(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(Eb),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&&hb(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(bb);this.isUpdating||this.nodes.forEach(xb),this.isUpdating=!1,this.nodes.forEach(wb),this.nodes.forEach(pb),this.nodes.forEach(mb),this.clearAllSnapshots();const e=Qp.now();Oh.delta=Cf(0,1e3/60,e-Oh.timestamp),Oh.timestamp=e,Oh.isProcessing=!0,Rh.update.process(Oh),Rh.preRender.process(Oh),Rh.render.process(Oh),Oh.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yb),this.sharedNodes.forEach(jb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Dh.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Dh.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Yv(this.snapshot.measuredBox.x)||Yv(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&&!tb(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||dy(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)),Ob((r=n).x),Ob(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(Ab))){const{scroll:e}=this.root;e&&(xy(n.x,e.offset.x),xy(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Wy(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&&Wy(n,e),xy(n.x,o.offset.x),xy(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Wy(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&&Sy(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),dy(e.latestValues)&&Sy(n,e.latestValues)}return dy(this.latestValues)&&Sy(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Wy(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!dy(e.latestValues))continue;uy(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Wy(r,e.measurePageBox()),Zy(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return dy(this.latestValues)&&Zy(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!==Oh.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=Oh.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}},ey(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Wy(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(),Jv((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),Jv(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Wy(this.target,this.layout.layoutBox),vy(this.target,this.targetDelta)):Wy(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}},ey(this.relativeTargetOrigin,this.target,e.target),Wy(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!uy(this.parent.latestValues)&&!hy(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===Oh.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;Wy(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&&Sy(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,vy(e,s)),r&&dy(i.latestValues)&&Sy(e,i.latestValues))}t.x<by&&t.x>yy&&(t.x=1),t.y<by&&t.y>yy&&(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?(Gy(this.prevProjectionDelta.x,this.projectionDelta.x),Gy(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Xv(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&sb(this.projectionDelta.x,this.prevProjectionDelta.x)&&sb(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(_b));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,m,g;Pb(i.x,e.x,n),Pb(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ey(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tb((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(m=s).x,g=n),Tb(f.y,p.y,m.y,g),d&&(nb((l=this.relativeTarget).x,(h=d).x)&&nb(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Wy(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=pg(0,void 0!==n.opacity?n.opacity:1,Vy(r)),e.opacityExit=pg(void 0!==t.opacity?t.opacity:1,0,By(r))):i&&(e.opacity=pg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<$y;s++){const o=`border${Fy[s]}Radius`;let i=Uy(t,o),a=Uy(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||zy(i)===zy(a)?(e[o]=Math.max(pg(qy(i),qy(a),r),0),(_f.test(a)||_f.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=pg(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&&(Mh(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dh.update((()=>{_y.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=wf(e)?e:nm(e);return r.start(xv("",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&&Rb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Yv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Yv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wy(t,n),Sy(t,o),Xv(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ab);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&&db("z",e,r,this.animationValues);for(let o=0;o<lb.length;o++)db(`rotate${lb[o]}`,e,r,this.animationValues),db(`skew${lb[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 cb;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=op(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=op(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!dy(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 vf){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=vf[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?op(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(bb),this.root.sharedNodes.clear()}}}function pb(e){e.updateLayout()}function mb(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?ay((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Yv(r);r.min=t[e].min,r.max=r.min+o})):Rb(o,n.layoutBox,t)&&ay((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Yv(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}};Xv(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?Xv(a,e.applyTransform(r,!0),n.measuredBox):Xv(a,t,n.layoutBox);const l=!tb(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}};ey(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ey(a,t,i.layoutBox),ob(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 gb(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 vb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yb(e){e.clearSnapshot()}function bb(e){e.clearMeasurements()}function xb(e){e.isLayoutDirty=!1}function wb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Cb(e){e.resolveTargetDelta()}function kb(e){e.calcProjection()}function Eb(e){e.resetSkewAndRotation()}function jb(e){e.removeLeadSnapshot()}function Pb(e,t,n){e.translate=pg(t.translate,0,n),e.scale=pg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tb(e,t,n,r){e.min=pg(t.min,n.min,r),e.max=pg(t.max,n.max,r)}function _b(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Nb={duration:.45,ease:[.4,0,.1,1]},Db=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Mb=Db("applewebkit/")&&!Db("chrome/")?Math.round:xh;function Ob(e){e.min=Mb(e.min),e.max=Mb(e.max)}function Rb(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=ib(t),o=ib(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function Ab(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Lb=fb({attachResizeListener:(e,t)=>Fv(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ib={current:void 0},Fb=fb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ib.current){const e=new Lb({});e.mount(window),e.setOptions({layoutScroll:!0}),Ib.current=e}return Ib.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),$b={pan:{Feature:class extends Av{constructor(){super(...arguments),this.removePointerDownListener=xh}onPointerDown(e){this.session=new Uv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ky(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ty(e),onStart:Ty(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Dh.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=qv(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 Av{constructor(e){super(e),this.removeGroupControls=xh,this.removeListeners=xh,this.controls=new jy(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:Fb,MeasureLayout:Ry}};function qb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&Dh.postRender((()=>o(t,$v(t))))}function zb(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&&Dh.postRender((()=>o(t,$v(t))))}const Ub=new WeakMap,Vb=new WeakMap,Bb=e=>{const t=Ub.get(e.target);t&&t(e)},Kb=e=>{e.forEach(Bb)};function Hb(e,t,n){const r=function({root:e,...t}){const n=e||document;Vb.has(n)||Vb.set(n,{});const r=Vb.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Kb,{root:e,...t})),r[o]}(t);return Ub.set(e,n),r.observe(e),()=>{Ub.delete(e),r.unobserve(e)}}const Wb={some:0,all:1};const Gb={inView:{Feature:class extends Av{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 Hb(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Wb[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 Av{mount(){const{current:e}=this.node;e&&(this.unmount=Hp(e,((e,t)=>(zb(this.node,t,"Start"),(e,{success:t})=>zb(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Av{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(SY){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=Sg(Fv(this.node.current,"focus",(()=>this.onFocus())),Fv(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Av{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=Ip(e,n),s=e=>{if(!Fp(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{Fp(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)=>(qb(this.node,t,"Start"),e=>qb(this.node,e,"End")))))}unmount(){}}}},Yb={layout:{ProjectionNode:Fb,MeasureLayout:Ry}},Qb={current:null},Xb={current:!1};const Jb=[...ag,Pm,Lm],Zb=new WeakMap;const ex=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tx{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=ng,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=Qp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Dh.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=Qh(t),this.isVariantNode=Xh(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]&&wf(e)&&e.set(a[h],!1)}}mount(e){this.current=e,Zb.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))),Xb.current||function(){if(Xb.current=!0,vh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qb.current=e.matches;e.addListener(t),t()}else Qb.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Qb.current),"production"!==process.env.NODE_ENV&&Vh(!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(),Mh(this.notifyUpdate),Mh(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=bf.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Dh.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 Ih){const t=Ih[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<ex.length;n++){const t=ex[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(wf(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&Vh("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(wf(i))e.addValue(r,nm(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,nm(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=nm(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)||vm(r))?r=parseFloat(r):!Jb.find(sg(r))&&Lm.test(t)&&(r=Vm(e,t)),this.setBaseTarget(e,wf(r)?r.get():r)),wf(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=np(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||wf(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 Zp),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class nx extends tx{constructor(){super(...arguments),this.KeyframeResolver=cg}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;wf(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class rx extends nx{constructor(){super(...arguments),this.type="html",this.renderInstance=up}readValueFromInstance(e,t){if(bf.has(t)){const e=Um(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(ff(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Cy(e,t)}build(e,t,n){qf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ap(e,t,n)}}class ox extends nx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sy,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&cp(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(bf.has(t)){const e=Um(t);return e&&e.default||0}return t=dp.has(t)?t:rf(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return fp(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Dh.postRender(this.updateDimensions)}build(e,t,n){Qf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){hp(e,t,0,r)}mount(e){this.isSVGTag=Jf(e.tagName),super.mount(e)}}const ix=Bh(gp({...Iv,...Gb,...$b,...Yb},((e,t)=>Hf(e)?new ox(t):new rx(t,{allowProjection:e!==n.Fragment})))),sx=({children:e,className:n})=>t.jsx(ix.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}),ax=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),lx=({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(ax,{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 "})]})})},cx="/segments",ux="/automations",dx="/channel/senders",hx="/communication-groups",fx="/stripo",px=async(e,t)=>(await pa(`${ux}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,mx=e=>{const t=ne(),n=ue({queryKey:["automations",e],queryFn:()=>(async e=>(await pa(`${ux}/${e}`)).data)(e)});return{automation:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchAutomation:n.refetch,invalidateAutomation:()=>t.invalidateQueries({queryKey:["automations",e]})}},gx=e=>{const t=ue({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await pa(`${ux}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},vx=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(ux,{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}},yx=e=>{const t=ne(),n=de({mutationFn:t=>px(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]}),t.invalidateQueries({queryKey:["automations",e]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},bx=e=>{const t=ue({queryKey:["automations",e,"statistics"],queryFn:()=>(async e=>{if(e)return(await pa(`${ux}/${e}/statistics`)).data;return(await pa(`${ux}/statistics`)).data})(e)});return{statistics:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error}};var xx=(e=>(e.ONE_TIME="one_time",e))(xx||{}),wx=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(wx||{});const Sx={CloseButton:od,DropdownMenuTrigger:Pu,UserIcon:td,UsersIcon:nd,UserEdit:Zu,ScheduleButton:Eu,SendButton:Yu,BackButton:Tu,NextButton:_u,MergeField:ed,PlusIcon:Wu,AlertCircleIcon:Mu,OneTimeBroadcast:Vu,PatronEntersList:Fu,DateMilestone:Eu,RealtimeActivity:ku,EmailIcon:zu,SmsIcon:Bu,MessagesSent:qu,LinksClicked:Hu,OpenRate:Lu,SpamComplies:Ju,TotalBounceRate:Ju,UnsubscribeRate:Qu},Cx=e=>({...Sx,...e||{}});var kx=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(Px);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(Ex,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(Ex,{...o,ref:n,children:r})}));kx.displayName="Slot";var Ex=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?Ql(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));Ex.displayName="SlotClone";var jx=({children:e})=>t.jsx(t.Fragment,{children:e});function Px(e){return i.isValidElement(e)&&e.type===jx}const Tx=bu(["reach-styles-module__base___gfFyc"],{variants:{variant:{default:"reach-styles-module__default___ny1h7",destructive:"reach-styles-module__destructive___XjBvS",outline:"reach-styles-module__outline___gFp3i",secondary:"reach-styles-module__secondary___Pd-e3",ghost:"reach-styles-module__ghost___GcnJq",link:"reach-styles-module__link___EgS2H"},size:{default:"reach-styles-module__sizeDefault___8kU5A",sm:"reach-styles-module__sizeSm___zPIEh",lg:"reach-styles-module__sizeLg___D2G8z",icon:"reach-styles-module__sizeIcon___5XkYW"}},defaultVariants:{variant:"default",size:"default"}}),_x=i.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?kx:"button",{className:Xd(Tx({variant:n,size:r,className:e})),ref:s,...i})));_x.displayName="Button";var Nx=(e=>(e.ChooseAutomationType="choose-automation-type",e.SetAutomationName="set-automation-name",e))(Nx||{});const Dx=({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(_x,{variant:"secondary",className:"px-4 py-2",onClick:()=>{if(n===Nx.ChooseAutomationType)e?.(!1);else{if(n!==Nx.SetAutomationName)throw new Error("Invalid step");r(Nx.ChooseAutomationType)}},children:n===Nx.ChooseAutomationType?"Cancel":"Back"}),t.jsx(_x,{className:"px-4 py-2",onClick:()=>{o||n!==Nx.SetAutomationName||i()},disabled:o,children:n===Nx.SetAutomationName?"Create":"Next"})]})}),Mx=({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-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]":"border-gray-200 hover:[border-color:hsl(var(--reach-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})]})]}),Ox="text-3xl mb-8",Rx="grid grid-cols-2 gap-6",Ax="relative p-6 rounded-lg",Lx=({onNext:e,iconDefinitions:n})=>t.jsxs("div",{className:Ax,children:[t.jsx("h1",{className:Ox,children:"Choose Your Automation Type"}),t.jsxs("div",{className:Rx,children:[t.jsx(Mx,{onClick:()=>{e(xx.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(Mx,{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(Mx,{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(Mx,{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 Ix(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const Fx="mb-4 flex items-center justify-center",$x="text-lg font-medium mb-2",qx="text-sm text-gray-600",zx=({iconDefinitions:e})=>t.jsxs("div",{children:[t.jsx("div",{className:Fx,children:t.jsx(e.OneTimeBroadcast,{})}),t.jsx("h3",{className:$x,children:"One-Time Broadcast"}),t.jsx("p",{className:qx,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),Ux=({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===xx.ONE_TIME)return t.jsx(zx,{iconDefinitions:o});throw Ix(e,xx)})()}),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"})]})]})]}),Vx=({onClose:e,iconDefinitions:r})=>{const{createAutomation:o,isCreating:i}=vx(),[s,a]=n.useState(!1),l=Cx(r),[c,u]=n.useState(Nx.ChooseAutomationType),[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:Ax,children:t.jsx(lx,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(bh,{mode:"wait",children:[c===Nx.ChooseAutomationType&&t.jsx(sx,{children:t.jsx(Lx,{onNext:e=>{h({...d,type:e}),u(Nx.SetAutomationName)},iconDefinitions:l})},"choose-automation-type"),c===Nx.SetAutomationName&&d.type&&t.jsx(sx,{children:t.jsx(Ux,{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(Dx,{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 Bx={};Object.defineProperty(Bx,"__esModule",{value:!0}),Bx.parse=function(e,t){const n=new Qx,r=e.length;if(r<2)return n;const o=t?.decode||Zx;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=Xx(e,i,t),c=Jx(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=Xx(e,t+1,a),i=Jx(e,a,r);const s=o(e.slice(r,i));n[u]=s}i=a+1}while(i<r);return n},Bx.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!Kx.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!Hx.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(!Wx.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Gx.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]"===Yx.call(e)}
33
+ */function Gc(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=Yc(e))&&(r&&(r+=" "),r+=t);return r}const Yc=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Yc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Qc(e,...t){let n,r,o,i=function(a){const l=t.reduce(((e,t)=>t(e)),e());return n=(e=>({cache:Bc(e.cacheSize),parseClassName:Kc(e),...Ac(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(Wc);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=Hc(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(Gc.apply(null,arguments))}}const Xc=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Jc=/^\[(?:([a-z-]+):)?(.+)\]$/i,Zc=/^\d+\/\d+$/,eu=new Set(["px","full","screen"]),tu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nu=/\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$/,ru=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ou=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,su=e=>lu(e)||eu.has(e)||Zc.test(e),au=e=>wu(e,"length",Su),lu=e=>Boolean(e)&&!Number.isNaN(Number(e)),cu=e=>wu(e,"number",lu),uu=e=>Boolean(e)&&Number.isInteger(Number(e)),du=e=>e.endsWith("%")&&lu(e.slice(0,-1)),hu=e=>Jc.test(e),fu=e=>tu.test(e),pu=new Set(["length","size","percentage"]),mu=e=>wu(e,pu,Cu),gu=e=>wu(e,"position",Cu),vu=new Set(["image","url"]),yu=e=>wu(e,vu,Eu),bu=e=>wu(e,"",ku),xu=()=>!0,wu=(e,t,n)=>{const r=Jc.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Su=e=>nu.test(e)&&!ru.test(e),Cu=()=>!1,ku=e=>ou.test(e),Eu=e=>iu.test(e),ju=Qc((()=>{const e=Xc("colors"),t=Xc("spacing"),n=Xc("blur"),r=Xc("brightness"),o=Xc("borderColor"),i=Xc("borderRadius"),s=Xc("borderSpacing"),a=Xc("borderWidth"),l=Xc("contrast"),c=Xc("grayscale"),u=Xc("hueRotate"),d=Xc("invert"),h=Xc("gap"),f=Xc("gradientColorStops"),p=Xc("gradientColorStopPositions"),m=Xc("inset"),g=Xc("margin"),v=Xc("opacity"),y=Xc("padding"),b=Xc("saturate"),x=Xc("scale"),w=Xc("sepia"),S=Xc("skew"),C=Xc("space"),k=Xc("translate"),E=()=>["auto",hu,t],j=()=>[hu,t],P=()=>["",su,au],T=()=>["auto",lu,hu],_=()=>["","0",hu],N=()=>[lu,hu];return{cacheSize:500,separator:":",theme:{colors:[xu],spacing:[su,au],blur:["none","",fu,hu],brightness:N(),borderColor:[e],borderRadius:["none","","full",fu,hu],borderSpacing:j(),borderWidth:P(),contrast:N(),grayscale:_(),hueRotate:N(),invert:_(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[du,au],inset:E(),margin:E(),opacity:N(),padding:j(),saturate:N(),scale:N(),sepia:_(),skew:N(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",hu]}],container:["container"],columns:[{columns:[fu]}],"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",hu]}],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",uu,hu]}],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",hu]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",uu,hu]}],"grid-cols":[{"grid-cols":[xu]}],"col-start-end":[{col:["auto",{span:["full",uu,hu]},hu]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[xu]}],"row-start-end":[{row:["auto",{span:[uu,hu]},hu]}],"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",hu]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",hu]}],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",hu,t]}],"min-w":[{"min-w":[hu,t,"min","max","fit"]}],"max-w":[{"max-w":[hu,t,"none","full","min","max","fit","prose",{screen:[fu]},fu]}],h:[{h:[hu,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[hu,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[hu,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[hu,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fu,au]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",cu]}],"font-family":[{font:[xu]}],"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",hu]}],"line-clamp":[{"line-clamp":["none",lu,cu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",su,hu]}],"list-image":[{"list-image":["none",hu]}],"list-style-type":[{list:["none","disc","decimal",hu]}],"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",su,au]}],"underline-offset":[{"underline-offset":["auto",su,hu]}],"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",hu]}],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",hu]}],"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",gu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mu]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},yu]}],"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":[su,hu]}],"outline-w":[{outline:[su,au]}],"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":[su,au]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fu,bu]}],"shadow-color":[{shadow:[xu]}],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",fu,hu]}],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",hu]}],duration:[{duration:N()}],ease:[{ease:["linear","in","out","in-out",hu]}],delay:[{delay:N()}],animate:[{animate:["none","spin","ping","pulse","bounce",hu]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[uu,hu]}],"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",hu]}],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",hu]}],"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",hu]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[su,au,cu]}],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 Pu(...e){return ju(Hl(e))}const Tu=Fl,_u=i.forwardRef((({className:e,...n},r)=>t.jsx($l,{ref:r,className:Pu("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})));_u.displayName=$l.displayName;const Nu=Yl("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"}}),Du=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx(ql,{ref:o,className:Pu(Nu({variant:n}),e),...r})));Du.displayName=ql.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(Vl,{ref:r,className:Pu("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=Vl.displayName;const Mu=i.forwardRef((({className:e,...n},r)=>t.jsx(Bl,{ref:r,className:Pu("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(Rc,{className:"h-4 w-4"})})));Mu.displayName=Bl.displayName;const Ou=i.forwardRef((({className:e,...n},r)=>t.jsx(zl,{ref:r,className:Pu("text-sm font-semibold [&+div]:text-xs",e),...n})));Ou.displayName=zl.displayName;const Ru=i.forwardRef((({className:e,...n},r)=>t.jsx(Ul,{ref:r,className:Pu("text-sm opacity-90",e),...n})));function Au(){const{toasts:e}=Ca();return t.jsxs(Tu,{children:[e.map((function({id:e,title:n,description:r,action:o,...i}){return t.jsxs(Du,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Ou,{children:n}),r&&t.jsx(Ru,{children:r})]}),o,t.jsx(Mu,{})]},e)})),t.jsx(_u,{})]})}Ru.displayName=Ul.displayName;const Lu=(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=sa.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})}}},Iu=[{eventName:aa,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!1}),e({type:"SET_REAUTHING",payload:!0})}},{eventName:la,handler:e=>()=>{e({type:"SET_AUTHENTICATED",payload:!0})}}],{Provider:Fu}=Lu(((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},Iu),$u=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}},qu={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%","card-foreground":"240 10% 3.9%",popover:"0 0% 100%","popover-foreground":"240 10% 3.9%",primary:"240 5.9% 10%","primary-foreground":"0 0% 98%",secondary:"240 4.8% 95.9%","secondary-foreground":"240 5.9% 10%",muted:"240 4.8% 95.9%","muted-foreground":"240 3.8% 46.1%",accent:"240 4.8% 95.9%","accent-foreground":"240 5.9% 10%",destructive:"0 84.2% 60.2%","destructive-foreground":"0 0% 98%",border:"240 5.9% 90%",input:"240 5.9% 90%",ring:"240 10% 3.9%","chart-1":"12 76% 61%","chart-2":"173 58% 39%","chart-3":"197 37% 24%","chart-4":"43 74% 66%","chart-5":"27 87% 67%",radius:"0.5rem","font-body":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-heading":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},zu=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(qu).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=$u(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)},{Context:Uu,Provider:Vu}=Lu(((e,t)=>{switch(t.type){case"set_theme":return{...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}),Bu=({initialTheme:e,children:r})=>{const{setTheme:o,setLoading:i}=n.useContext(Uu),s=n.useRef(!1);return n.useEffect((()=>{e&&!s.current?(zu(e.styles),o(e),s.current=!0):i(!1)}),[e,o,i]),t.jsx(t.Fragment,{children:r})},Ku=({initialTheme:e,children:n})=>t.jsx(Vu,{children:t.jsx(Bu,{initialTheme:e,children:n})}),Hu=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Wu={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Gu=e=>Wu[e];let Yu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Hu,Gu)};const Qu={type:"3rdParty",init(e){((e={})=>{Yu={...Yu,...e}})(e.options.react)}},Xu=n.createContext();function Ju({i18n:e,defaultNS:t,children:r}){const o=n.useMemo((()=>({i18n:e,defaultNS:t})),[e,t]);return n.createElement(Xu.Provider,{value:o},r)}const Zu=e=>"string"==typeof e,ed=()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n},td=e=>null==e?"":""+e,nd=/###/g,rd=e=>e&&e.indexOf("###")>-1?e.replace(nd,"."):e,od=e=>!e||Zu(e),id=(e,t,n)=>{const r=Zu(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(od(e))return{};const t=rd(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return od(e)?{}:{obj:e,k:rd(r[o])}},sd=(e,t,n)=>{const{obj:r,k:o}=id(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=id(e,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=id(e,s,Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},ad=(e,t)=>{const{obj:n,k:r}=id(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ld=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?Zu(e[r])||e[r]instanceof String||Zu(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ld(e[r],t[r],n):e[r]=t[r]);return e},cd=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ud={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const dd=e=>Zu(e)?e.replace(/[&<>"'\/]/g,(e=>ud[e])):e;const hd=[" ",",","?","!",";"],fd=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),pd=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},md=e=>e?.replace("_","-"),gd={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class vd{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||gd,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:(Zu(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new vd(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new vd(this.logger,e)}}var yd=new vd;class bd{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 xd extends bd{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):Zu(n)&&o?s.push(...n.split(o)):s.push(n)));const a=ad(this.data,s);return!a&&!t&&!n&&e.indexOf(".")>-1&&(e=s[0],t=s[1],n=s.slice(2).join(".")),!a&&i&&Zu(n)?pd(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),sd(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)(Zu(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=ad(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?ld(a,n,o):a={...a,...n},sd(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 wd={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 Sd={};class Cd extends bd{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=yd.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=hd.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=fd.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:Zu(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:Zu(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=!Zu(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(g&&d&&v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0)||Zu(m)&&Array.isArray(d))if(g&&Zu(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&&!Zu(t.count),h=Cd.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=Zu(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&&!Zu(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=Zu(s)?[s]:s;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=wd.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 Zu(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&&!Zu(s.count),d=u&&!s.ordinal&&0===s.count,h=void 0!==s.context&&(Zu(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,Sd[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(i)||(Sd[`${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&&!Zu(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 kd{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=yd.create("languageUtils")}getScriptPartFromCode(e){if(!(e=md(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=md(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Zu(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)),Zu(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 Zu(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))):Zu(e)&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}const Ed={zero:0,one:1,two:2,few:3,many:4,other:5},jd={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Pd{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=yd.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=md("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!"),jd;if(!e.match(/-|_/))return jd;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)=>Ed[e]-Ed[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 Td=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=ad(e,n);return void 0!==r?r:ad(t,n)})(e,t,n);return!i&&o&&Zu(n)&&(i=pd(e,n,r),void 0===i&&(i=pd(t,n,r))),i},_d=e=>e.replace(/\$/g,"$$$$");class Nd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=yd.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:dd,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?cd(o):i||"{{",this.suffix=s?cd(s):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?cd(d):h||cd("$t("),this.nestingSuffix=f?cd(f):p||cd(")"),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=Td(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(Td(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=>_d(e)},{regex:this.regexp,safeValue:e=>_d(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=Zu(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 Zu(i)||this.useRawValueToEscape||(i=td(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&&!Zu(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&&!Zu(r))return r;Zu(r)||(r=td(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 Dd=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(md(r),o),t[s]=a),a(n)}};class Md{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=yd.create("formatter"),this.options=e,this.formats={number:Dd(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:Dd(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:Dd(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:Dd(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:Dd(((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()]=Dd(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 Od extends bd{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=yd.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}=id(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();Zu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Zu(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 Rd=()=>({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]),Zu(e[1])&&(t.defaultValue=e[1]),Zu(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}}),Ad=e=>(Zu(e.ns)&&(e.ns=[e.ns]),Zu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Zu(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),Ld=()=>{};class Id extends bd{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=Ad(e),this.services={},this.logger=yd,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&&(Zu(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Rd();this.options={...r,...this.options,...Ad(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;yd.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Md;const n=new kd(this.options);this.store=new xd(this.options.resources,this.options);const i=this.services;i.logger=yd,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Pd(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 Nd(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Od(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 Cd(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=Ld),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=ed(),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]:Ld;const n=Zu(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=ed();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=Ld),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&&wd.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=ed();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=Zu(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 Zu(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=ed();return this.options.ns?(Zu(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=ed();Zu(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 kd(Rd());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 Id(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]:Ld;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Id(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 xd(e,r),o.services.resourceStore=o.store}return o.translator=new Cd(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 Fd=Id.createInstance();Fd.createInstance=Id.createInstance;const{slice:$d,forEach:qd}=[];const zd=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ud={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(!zd.test(n.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${n.domain}`}if(n.path){if(!zd.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 Vd={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&"undefined"!=typeof document)return Ud.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&"undefined"!=typeof document&&Ud.create(n,e,r,o,i)}},Bd={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 Kd=null;const Hd=()=>{if(null!==Kd)return Kd;try{Kd="undefined"!==window&&null!==window.localStorage;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){Kd=!1}return Kd};var Wd={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Hd())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Hd()&&window.localStorage.setItem(n,e)}};let Gd=null;const Yd=()=>{if(null!==Gd)return Gd;try{Gd="undefined"!==window&&null!==window.sessionStorage;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Gd=!1}return Gd};var Qd={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Yd())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Yd()&&window.sessionStorage.setItem(n,e)}},Xd={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}},Jd={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}},Zd={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("/","")}},eh={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 th=!1;try{document,th=!0}catch(SY){}const nh=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];th||nh.splice(1,1);class rh{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 qd.call($d.call(arguments,1),(t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])})),e}(e,this.options||{},{order:nh,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(Vd),this.addDetector(Bd),this.addDetector(Wd),this.addDetector(Qd),this.addDetector(Xd),this.addDetector(Jd),this.addDetector(Zd),this.addDetector(eh)}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)})))}}rh.type="languageDetector";const oh={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"}}}}};Fd.use(rh).use(Qu).init({resources:oh,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 ih=({children:e,initialLanguage:r})=>(n.useEffect((()=>{r&&Fd.changeLanguage(r)}),[r]),t.jsx(Ju,{i18n:Fd,children:e})),sh=n.createContext({});function ah(e){const t=n.useRef(null);return null===t.current&&(t.current=e()),t.current}const lh=n.createContext(null),ch=n.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class uh 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 dh({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(ch);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(uh,{isPresent:r,childRef:a,sizeRef:l,children:i.cloneElement(e,{ref:a})})}const hh=({children:e,initial:r,isPresent:o,onExitComplete:s,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const d=ah(fh),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(dh,{isPresent:o,anchorX:u,children:e})),t.jsx(lh.Provider,{value:p,children:e})};function fh(){return new Map}function ph(e=!0){const t=n.useContext(lh);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 mh=e=>e.key||"";function gh(e){const t=[];return n.Children.forEach(e,(e=>{n.isValidElement(e)&&t.push(e)})),t}const vh="undefined"!=typeof window,yh=vh?n.useLayoutEffect:n.useEffect,bh=({children:e,custom:r,initial:o=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,d]=ph(l),h=n.useMemo((()=>gh(e)),[e]),f=l&&!u?[]:h.map(mh),p=n.useRef(!0),m=n.useRef(h),g=ah((()=>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=mh(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=mh(n);f.includes(r)||(e.splice(t,0,n),w.push(n))}return"wait"===a&&w.length&&(e=w),x(gh(e)),y(h),null}process;const{forceRender:S}=n.useContext(sh);return t.jsx(t.Fragment,{children:b.map((e=>{const n=mh(e),v=!(l&&!u)&&(h===b||f.includes(n));return t.jsx(hh,{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 wh=xh,Sh=xh;function Ch(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(wh=(e,t)=>{},Sh=(e,t)=>{if(!e)throw new Error(t)});const kh=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Eh=e=>1e3*e,jh=e=>e/1e3,Ph=!1,Th=["read","resolveKeyframes","update","preRender","render","postRender"],_h={value:null,addProjectionMetrics:null};function Nh(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Th.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&&_h.value&&_h.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:Th.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<Th.length;t++)s[Th[t]].cancel(e)},state:o,steps:s}}const{schedule:Dh,cancel:Mh,state:Oh,steps:Rh}=Nh("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:xh,!0),Ah=n.createContext({strict:!1}),Lh={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"]},Ih={};for(const EY in Lh)Ih[EY]={isEnabled:e=>Lh[EY].some((t=>!!e[t]))};const Fh=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 $h(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Fh.has(e)}let qh=e=>!$h(e);try{(zh=require("@emotion/is-prop-valid").default)&&(qh=e=>e.startsWith("on")?!$h(e):zh(e))}catch(CY){}var zh;const Uh=new Set;function Vh(e,t,n){e||Uh.has(t)||Uh.add(t)}function Bh(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(((...t)=>("production"!==process.env.NODE_ENV&&Vh(!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 Kh=n.createContext({});function Hh(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}function Wh(e){return"string"==typeof e||Array.isArray(e)}const Gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yh=["initial",...Gh];function Qh(e){return Hh(e.animate)||Yh.some((t=>Wh(e[t])))}function Xh(e){return Boolean(Qh(e)||e.variants)}function Jh(e){const{initial:t,animate:r}=function(e,t){if(Qh(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Wh(t)?t:void 0,animate:Wh(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,n.useContext(Kh));return n.useMemo((()=>({initial:t,animate:r})),[Zh(t),Zh(r)])}function Zh(e){return Array.isArray(e)?e.join(" "):e}const ef=Symbol.for("motionComponentSymbol");function tf(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function nf(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):tf(r)&&(r.current=n))}),[t])}const rf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),of="data-"+rf("framerAppearId"),{schedule:sf}=Nh(queueMicrotask,!1),af=n.createContext({});function lf(e,t,r,o,i){var s,a;const{visualElement:l}=n.useContext(Kh),c=n.useContext(Ah),u=n.useContext(lh),d=n.useContext(ch).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(af);!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:cf(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&tf(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[of],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(),sf.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 cf(e){if(e)return!1!==e.options.allowProjection?e.projection:cf(e.parent)}function uf({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:i,Component:s}){var a,l;function c(a,l){let c;const u={...n.useContext(ch),...a,layoutId:df(a)},{isStatic:d}=u,h=Jh(a),f=i(a,d);if(!d&&vh){!function(e,t){const r=n.useContext(Ah).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?wh(!1,t):Sh(!1,t)}}(u,e);const t=function(e){const{drag:t,layout:n}=Ih;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=lf(s,f,u,r,t.ProjectionNode)}return t.jsxs(Kh.Provider,{value:h,children:[c&&h.visualElement?t.jsx(c,{visualElement:h.visualElement,...u}):null,o(s,a,nf(f,h.visualElement,l),f,d,h.visualElement)]})}e&&function(e){for(const t in e)Ih[t]={...Ih[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[ef]=s,u}function df({layoutId:e}){const t=n.useContext(sh).id;return t&&void 0!==e?t+"-"+e:e}const hf=e=>t=>"string"==typeof t&&t.startsWith(e),ff=hf("--"),pf=hf("var(--"),mf=e=>!!pf(e)&&gf.test(e.split("/*")[0].trim()),gf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,vf={};const yf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bf=new Set(yf);function xf(e,{layout:t,layoutId:n}){return bf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!vf[e]||"opacity"===e)}const wf=e=>Boolean(e&&e.getVelocity),Sf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Cf=(e,t,n)=>n>t?t:n<e?e:n,kf={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Ef={...kf,transform:e=>Cf(0,1,e)},jf={...kf,default:1},Pf=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Tf=Pf("deg"),_f=Pf("%"),Nf=Pf("px"),Df=Pf("vh"),Mf=Pf("vw"),Of={..._f,parse:e=>_f.parse(e)/100,transform:e=>_f.transform(100*e)},Rf={borderWidth:Nf,borderTopWidth:Nf,borderRightWidth:Nf,borderBottomWidth:Nf,borderLeftWidth:Nf,borderRadius:Nf,radius:Nf,borderTopLeftRadius:Nf,borderTopRightRadius:Nf,borderBottomRightRadius:Nf,borderBottomLeftRadius:Nf,width:Nf,maxWidth:Nf,height:Nf,maxHeight:Nf,top:Nf,right:Nf,bottom:Nf,left:Nf,padding:Nf,paddingTop:Nf,paddingRight:Nf,paddingBottom:Nf,paddingLeft:Nf,margin:Nf,marginTop:Nf,marginRight:Nf,marginBottom:Nf,marginLeft:Nf,backgroundPositionX:Nf,backgroundPositionY:Nf},Af={rotate:Tf,rotateX:Tf,rotateY:Tf,rotateZ:Tf,scale:jf,scaleX:jf,scaleY:jf,scaleZ:jf,skew:Tf,skewX:Tf,skewY:Tf,distance:Nf,translateX:Nf,translateY:Nf,translateZ:Nf,x:Nf,y:Nf,z:Nf,perspective:Nf,transformPerspective:Nf,opacity:Ef,originX:Of,originY:Of,originZ:Nf},Lf={...kf,transform:Math.round},If={...Rf,...Af,zIndex:Lf,size:Nf,fillOpacity:Ef,strokeOpacity:Ef,numOctaves:Lf},Ff={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$f=yf.length;function qf(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(bf.has(l))s=!0;else if(ff(l))o[l]=e;else{const t=Sf(e,If[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<$f;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=Sf(a,If[s]);l||(o=!1,r+=`${Ff[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 zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Uf(e,t,n){for(const r in t)wf(t[r])||xf(r,n)||(e[r]=t[r])}function Vf(e,t){const r={};return Uf(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t){return n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return qf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),r}function Bf(e,t){const n={},r=Vf(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 Kf=["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 Hf(e){return"string"==typeof e&&!e.includes("-")&&!!(Kf.indexOf(e)>-1||/[A-Z]/u.test(e))}const Wf={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gf={offset:"strokeDashoffset",array:"strokeDasharray"};function Yf(e,t,n){return"string"==typeof e?e:Nf.transform(t+n*e)}function Qf(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(qf(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`${Yf(t,e.x,e.width)} ${Yf(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?Wf:Gf;e[i.offset]=Nf.transform(-r);const s=Nf.transform(t),a=Nf.transform(n);e[i.array]=`${s} ${a}`}(h,s,a,l,!1)}const Xf=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Jf=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Zf(e,t,r,o){const i=n.useMemo((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Qf(n,t,Jf(o),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};Uf(t,e.style,e),i.style={...t,...i.style}}return i}function ep(e=!1){return(t,r,o,{latestValues:i},s)=>{const a=(Hf(t)?Zf:Bf)(r,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(qh(o)||!0===n&&$h(o)||!t&&!$h(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((()=>wf(u)?u.get():u),[u]);return n.createElement(t,{...c,children:d})}}function tp(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function np(e,t,n,r){if("function"==typeof t){const[o,i]=tp(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]=tp(r);t=t(void 0!==n?n:e.custom,o,i)}return t}const rp=e=>Array.isArray(e);function op(e){const t=wf(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const ip=e=>(t,r)=>{const o=n.useContext(Kh),i=n.useContext(lh),s=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const s={latestValues:sp(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():ah(s)};function sp(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=op(i[h]);let{initial:s,animate:a}=e;const l=Qh(e),c=Xh(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&&!Hh(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=np(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 ap(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(wf(o[s])||t.style&&wf(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 lp={useVisualState:ip({scrapeMotionValuesFromProps:ap,createRenderState:zf})};function cp(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(SY){t.dimensions={x:0,y:0,width:0,height:0}}}function up(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 dp=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 hp(e,t,n,r){up(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(dp.has(o)?o:rf(o),t.attrs[o])}function fp(e,t,n){const r=ap(e,t,n);for(const o in e)if(wf(e[o])||wf(t[o])){r[-1!==yf.indexOf(o)?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o]=e[o]}return r}const pp=["x","y","width","height","cx","cy","r"],mp={useVisualState:ip({scrapeMotionValuesFromProps:fp,createRenderState:Xf,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(bf.has(a)){i=!0;break}if(!i)return;let s=!t;if(t)for(let a=0;a<pp.length;a++){const n=pp[a];e[n]!==t[n]&&(s=!0)}s&&Dh.read((()=>{cp(n,r),Dh.render((()=>{Qf(r,o,Jf(n.tagName),e.transformTemplate),hp(n,r)}))}))}})};function gp(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return uf({...Hf(n)?mp:lp,preloadedFeatures:e,useRender:ep(r),createVisualElement:t,Component:n})}}function vp(e,t,n){const r=e.getProps();return np(r,t,void 0!==n?n:r.custom,e)}const yp=Ch((()=>void 0!==window.ScrollTimeline));class bp{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 bp{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function wp(e,t){return e?e[t]||e.default||e:void 0}const Sp=2e4;function Cp(e){let t=0;let n=e.next(t);for(;!n.done&&t<Sp;)t+=50,n=e.next(t);return t>=Sp?1/0:t}function kp(e){return"function"==typeof e}function Ep(e,t){e.timeline=t,e.onfinish=null}const jp=e=>Array.isArray(e)&&"number"==typeof e[0],Pp={linearEasing:void 0};function Tp(e,t){const n=Ch(e);return()=>{var e;return null!==(e=Pp[t])&&void 0!==e?e:n()}}const _p=Tp((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(SY){return!1}return!0}),"linearEasing"),Np=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(kh(0,o-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function Dp(e){return Boolean("function"==typeof e&&_p()||!e||"string"==typeof e&&(e in Op||_p())||jp(e)||Array.isArray(e)&&e.every(Dp))}const Mp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Op={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mp([0,.65,.55,1]),circOut:Mp([.55,0,1,.45]),backIn:Mp([.31,.01,.66,-.59]),backOut:Mp([.33,1.53,.69,.99])};function Rp(e,t){return e?"function"==typeof e&&_p()?Np(e,t):jp(e)?Mp(e):Array.isArray(e)?e.map((e=>Rp(e,t)||Op.easeOut)):Op[e]:void 0}const Ap={x:!1,y:!1};function Lp(){return Ap.x||Ap.y}function Ip(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 Fp(e){return!("touch"===e.pointerType||Lp())}const $p=(e,t)=>!!t&&(e===t||$p(e,t.parentElement)),qp=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,zp=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Up=new WeakSet;function Vp(e){return t=>{"Enter"===t.key&&e(t)}}function Bp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Kp(e){return qp(e)&&!Lp()}function Hp(e,t,n={}){const[r,o,i]=Ip(e,n),s=e=>{const r=e.currentTarget;if(!Kp(e)||Up.has(r))return;Up.add(r);const i=t(r,e),s=(e,t)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Kp(e)&&Up.has(r)&&(Up.delete(r),"function"==typeof i&&i(e,{success:t}))},a=e=>{s(e,n.useGlobalTarget||$p(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 zp.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=Vp((()=>{if(Up.has(n))return;Bp(n,"down");const e=Vp((()=>{Bp(n,"up")}));n.addEventListener("keyup",e,t),n.addEventListener("blur",(()=>Bp(n,"cancel")),t)}));n.addEventListener("keydown",r,t),n.addEventListener("blur",(()=>n.removeEventListener("keydown",r)),t)})(e,o)),o)})),i}const Wp=new Set(["width","height","top","left","right","bottom",...yf]);let Gp;function Yp(){Gp=void 0}const Qp={now:()=>(void 0===Gp&&Qp.set(Oh.isProcessing||Ph?Oh.timestamp:performance.now()),Gp),set:e=>{Gp=e,queueMicrotask(Yp)}};function Xp(e,t){-1===e.indexOf(t)&&e.push(t)}function Jp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Zp{constructor(){this.subscriptions=[]}add(e){return Xp(this.subscriptions,e),()=>Jp(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 em(e,t){return t?e*(1e3/t):0}class tm{constructor(e,t={}){this.version="12.4.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Qp.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=Qp.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&&Vh(!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 Zp);const n=this.events[e].add(t);return"change"===e?()=>{n(),Dh.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=Qp.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return em(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 nm(e,t){return new tm(e,t)}function rm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,nm(n))}function om(e,t){const n=e.getValue("willChange");if(r=n,Boolean(wf(r)&&r.add))return n.add(t);var r}function im(e){return e.props[of]}const sm=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function am(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=sm(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:sm(o(e),t,r)}const lm=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,cm=e=>t=>1-e(1-t),um=am(.33,1.53,.69,.99),dm=cm(um),hm=lm(dm),fm=e=>(e*=2)<1?.5*dm(e):.5*(2-Math.pow(2,-10*(e-1))),pm=e=>1-Math.sin(Math.acos(e)),mm=cm(pm),gm=lm(pm),vm=e=>/^0[^.\s]+$/u.test(e);const ym=e=>Math.round(1e5*e)/1e5,bm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const xm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wm=(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)),Sm=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[o,i,s,a]=r.match(bm);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Cm={...kf,transform:e=>Math.round((e=>Cf(0,255,e))(e))},km={test:wm("rgb","red"),parse:Sm("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Cm.transform(e)+", "+Cm.transform(t)+", "+Cm.transform(n)+", "+ym(Ef.transform(r))+")"};const Em={test:wm("#"),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:km.transform},jm={test:wm("hsl","hue"),parse:Sm("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+_f.transform(ym(t))+", "+_f.transform(ym(n))+", "+ym(Ef.transform(r))+")"},Pm={test:e=>km.test(e)||Em.test(e)||jm.test(e),parse:e=>km.test(e)?km.parse(e):jm.test(e)?jm.parse(e):Em.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?km.transform(e):jm.transform(e)},Tm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const _m="number",Nm="color",Dm=/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 Mm(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Dm,(e=>(Pm.test(e)?(r.color.push(i),o.push(Nm),n.push(Pm.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(_m),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function Om(e){return Mm(e).values}function Rm(e){const{split:t,types:n}=Mm(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===_m?ym(e[i]):t===Nm?Pm.transform(e[i]):e[i]}return o}}const Am=e=>"number"==typeof e?0:e;const Lm={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(bm))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Tm))||void 0===n?void 0:n.length)||0)>0},parse:Om,createTransformer:Rm,getAnimatableNone:function(e){const t=Om(e);return Rm(e)(t.map(Am))}},Im=new Set(["brightness","contrast","saturate","opacity"]);function Fm(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(bm)||[];if(!r)return e;const o=n.replace(r,"");let i=Im.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const $m=/\b([a-z-]*)\(.*?\)/gu,qm={...Lm,getAnimatableNone:e=>{const t=e.match($m);return t?t.map(Fm).join(" "):e}},zm={...If,color:Pm,backgroundColor:Pm,outlineColor:Pm,fill:Pm,stroke:Pm,borderColor:Pm,borderTopColor:Pm,borderRightColor:Pm,borderBottomColor:Pm,borderLeftColor:Pm,filter:qm,WebkitFilter:qm},Um=e=>zm[e];function Vm(e,t){let n=Um(e);return n!==qm&&(n=Lm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bm=new Set(["auto","none","0"]);const Km=e=>e===kf||e===Nf,Hm=(e,t)=>parseFloat(e.split(", ")[t]),Wm=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Hm(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Hm(t[1],e):0}},Gm=new Set(["x","y","z"]),Ym=yf.filter((e=>!Gm.has(e)));const Qm={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:Wm(4,13),y:Wm(5,14)};Qm.translateX=Qm.x,Qm.translateY=Qm.y;const Xm=new Set;let Jm=!1,Zm=!1;function eg(){if(Zm){const e=Array.from(Xm).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 Ym.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)}))}Zm=!1,Jm=!1,Xm.forEach((e=>e.complete())),Xm.clear()}function tg(){Xm.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Zm=!0)}))}class ng{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?(Xm.add(this),Jm||(Jm=!0,Dh.read(tg),Dh.resolveKeyframes(eg))):(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),Xm.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Xm.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const rg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),og=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ig(e,t,n=1){Sh(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=og.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 mf(o)?ig(o,t,n+1):o}const sg=e=>t=>t.test(e),ag=[kf,Nf,_f,Tf,Mf,Df,{test:e=>"auto"===e,parse:e=>e}],lg=e=>ag.find(sg(e));class cg extends ng{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(),mf(n))){const r=ig(n,t.current);void 0!==r&&(e[a]=r),a===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Wp.has(n)||2!==e.length)return;const[r,o]=e,i=lg(r),s=lg(o);if(i!==s)if(Km(i)&&Km(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||vm(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&&!Bm.has(t)&&Mm(t).values.length&&(r=e[o]),o++}if(r&&n)for(const i of t)e[i]=Vm(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=Qm[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]=Qm[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 ug=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Lm.test(e)&&"0"!==e||e.startsWith("url(")));const dg=e=>null!==e;function hg(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(dg),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}class fg{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=Qp.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||(tg(),eg()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Qp.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=ug(o,t),a=ug(i,t);return wh(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||kp(n))&&r)}(e,n,r,o)){if(!i)return a&&a(hg(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 pg=(e,t,n)=>e+(t-e)*n;function mg(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 gg(e,t){return n=>n>0?t:e}const vg=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yg=[Em,km,jm];function bg(e){const t=(n=e,yg.find((e=>e.test(n))));var n;if(wh(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===jm&&(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=mg(a,r,e+1/3),i=mg(a,r,e),s=mg(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=bg(e),r=bg(t);if(!n||!r)return gg(e,t);const o={...n};return e=>(o.red=vg(n.red,r.red,e),o.green=vg(n.green,r.green,e),o.blue=vg(n.blue,r.blue,e),o.alpha=pg(n.alpha,r.alpha,e),km.transform(o))},wg=(e,t)=>n=>t(e(n)),Sg=(...e)=>e.reduce(wg),Cg=new Set(["none","hidden"]);function kg(e,t){return n=>pg(e,t,n)}function Eg(e){return"number"==typeof e?kg:"string"==typeof e?mf(e)?gg:Pm.test(e)?xg:Tg:Array.isArray(e)?jg:"object"==typeof e?Pm.test(e)?xg:Pg:gg}function jg(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Eg(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function Pg(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=Eg(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const Tg=(e,t)=>{const n=Lm.createTransformer(t),r=Mm(e),o=Mm(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?Cg.has(e)&&!o.values.length||Cg.has(t)&&!r.values.length?function(e,t){return Cg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Sg(jg(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):(wh(!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.`),gg(e,t))};function _g(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return pg(e,t,n);return Eg(e)(e,t)}function Ng(e,t,n){const r=Math.max(t-5,0);return em(n-e(r),t-r)}const Dg=100,Mg=10,Og=1,Rg=0,Ag=800,Lg=.3,Ig=.3,Fg={granular:.01,default:2},$g={granular:.005,default:.5},qg=.01,zg=10,Ug=.05,Vg=1,Bg=.001;function Kg({duration:e=Ag,bounce:t=Lg,velocity:n=Rg,mass:r=Og}){let o,i;wh(e<=Eh(zg),"Spring duration must be 10 seconds or less");let s=1-t;s=Cf(Ug,Vg,s),e=Cf(qg,zg,jh(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Wg(t,s),l=Math.exp(-o);return Bg-i/a*l},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=Wg(Math.pow(t,2),s);return(-o(t)+Bg>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<Hg;o++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=Eh(e),isNaN(a))return{stiffness:Dg,damping:Mg,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Hg=12;function Wg(e,t){return e*Math.sqrt(1-t*t)}const Gg=["duration","bounce"],Yg=["stiffness","damping","mass"];function Qg(e,t){return t.some((t=>void 0!==e[t]))}function Xg(e=Ig,t=Lg){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:Rg,stiffness:Dg,damping:Mg,mass:Og,isResolvedFromDuration:!1,...e};if(!Qg(e,Yg)&&Qg(e,Gg))if(e.visualDuration){const n=2*Math.PI/(1.2*e.visualDuration),r=n*n,o=2*Cf(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Og,stiffness:r,damping:o}}else{const n=Kg(e);t={...t,...n,mass:Og},t.isResolvedFromDuration=!0}return t}({...n,velocity:-jh(n.velocity||0)}),p=h||0,m=c/(2*Math.sqrt(l*u)),g=s-i,v=jh(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?Fg.granular:Fg.default),o||(o=y?$g.granular:$g.default),m<1){const e=Wg(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?Eh(p):Ng(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(Cp(x),Sp),t=Np((t=>x.next(e*t).value),e,30);return e+"ms "+t}};return x}function Jg({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=Xg({keyframes:[h.value,f(h.value)],velocity:Ng(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 Zg=am(.42,0,1,1),ev=am(0,0,.58,1),tv=am(.42,0,.58,1),nv={linear:xh,easeIn:Zg,easeInOut:tv,easeOut:ev,circIn:pm,circInOut:gm,circOut:mm,backIn:dm,backInOut:hm,backOut:um,anticipate:fm},rv=e=>{if(jp(e)){Sh(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return am(t,n,r,o)}return"string"==typeof e?(Sh(void 0!==nv[e],`Invalid easing type '${e}'`),nv[e]):e};function ov(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Sh(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||_g,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=Sg(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](kh(e[r],e[r+1],n))};return n?t=>c(Cf(e[0],e[i-1],t)):c}function iv(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++)e.push(pg(n,1,kh(0,t,r)))}(t,e.length-1),t}function sv({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(rv):rv(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:iv(t),e),a=ov(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||tv)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const av=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Dh.update(t,!0),stop:()=>Mh(t),now:()=>Oh.isProcessing?Oh.timestamp:Qp.now()}},lv={decay:Jg,inertia:Jg,tween:sv,keyframes:sv,spring:Xg},cv=e=>e/100;class uv extends fg{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)||ng)(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=kp(t)?t:lv[t]||sv;let a,l;s!==sv&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&Sh(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a=Sg(cv,_g(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=Cp(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=Cf(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=hg(a,this.options,r)),m&&m(x.value),S&&this.finish(),x}get duration(){const{resolved:e}=this;return e?jh(e.calculatedDuration):0}get time(){return jh(this.currentTime)}set time(e){this.currentTime=e=Eh(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=jh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=av,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 dv=new Set(["opacity","clipPath","filter","transform"]);function hv(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=Rp(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 fv=Ch((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const pv={anticipate:fm,backInOut:hm,circInOut:gm};class mv extends fg{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new cg(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&&_p()&&o in pv&&(o=pv[o]),kp((c=this.options).type)||"spring"===c.type||!Dp(c.ease)){const{onComplete:t,onUpdate:s,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new uv({...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=hv(s.owner.current,a,e,{...this.options,duration:n,times:r,ease:o});return u.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(Ep(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:n}=this.options;s.set(hg(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 jh(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return jh(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Eh(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;Ep(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 uv({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Eh(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 fv()&&n&&dv.has(n)&&!a&&!l&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const gv={type:"spring",stiffness:500,damping:25,restSpeed:10},vv={type:"keyframes",duration:.8},yv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bv=(e,{keyframes:t})=>t.length>2?vv:bf.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:gv:yv;const xv=(e,t,n,r={},o,i)=>s=>{const a=wp(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=Eh(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,...bv(e,u)}),u.duration&&(u.duration=Eh(u.duration)),u.repeatDelay&&(u.repeatDelay=Eh(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=hg(u.keyframes,a);if(void 0!==e)return Dh.update((()=>{u.onUpdate(e),u.onComplete()})),new xp([])}return!i&&mv.supports(u)?new mv(u):new uv(u)};function wv({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Sv(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&&wv(u,d))continue;const o={delay:n,...wp(s||{},d)};let a=!1;if(window.MotionHandoffAnimation){const t=im(e);if(t){const e=window.MotionHandoffAnimation(t,d,Dh);null!==e&&(o.startTime=e,a=!0)}}om(e,d),t.start(xv(d,t,r,e.shouldReduceMotion&&Wp.has(d)?{type:!1}:o,e,a));const h=t.animation;h&&c.push(h)}return a&&Promise.all(c).then((()=>{Dh.update((()=>{a&&function(e,t){const n=vp(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 Cv(e,t,n={}){var r;const o=vp(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(Sv(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(kv).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Cv(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 kv(e,t){return e.sortNodePosition(t)}function Ev(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 jv=Yh.length;function Pv(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Pv(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<jv;n++){const r=Yh[n],o=e.props[r];(Wh(o)||!1===o)&&(t[r]=o)}return t}const Tv=[...Gh].reverse(),_v=Gh.length;function Nv(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=>Cv(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Cv(e,t,n);else{const o="function"==typeof t?vp(e,t,n.custom):t;r=Promise.all(Sv(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}function Dv(e){let t=Nv(e),n=Rv(),r=!0;const o=t=>(n,r)=>{var o;const i=vp(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=Pv(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<_v;t++){const h=Tv[t],f=n[h],p=void 0!==s[h]?s[h]:a[h],m=Wh(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||Hh(p)||"boolean"==typeof p)continue;const y=Mv(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)?!Ev(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=Rv(),r=!0}}}function Mv(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Ev(t,e)}function Ov(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Rv(){return{animate:Ov(!0),whileInView:Ov(),whileHover:Ov(),whileTap:Ov(),whileDrag:Ov(),whileFocus:Ov(),exit:Ov()}}class Av{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Lv=0;const Iv={animation:{Feature:class extends Av{constructor(e){super(e),e.animationState||(e.animationState=Dv(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Hh(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 Av{constructor(){super(...arguments),this.id=Lv++}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 Fv(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function $v(e){return{point:{x:e.pageX,y:e.pageY}}}function qv(e,t,n,r){return Fv(e,t,(e=>t=>qp(t)&&e(t,$v(t)))(n),r)}const zv=(e,t)=>Math.abs(e-t);class Uv{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=Kv(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=zv(e.x,t.x),r=zv(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}=Oh;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=Vv(t,this.transformPagePoint),Dh.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=Kv("pointercancel"===e.type?this.lastMoveEventInfo:Vv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!qp(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Vv($v(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Oh;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,Kv(i,this.history)),this.removeListeners=Sg(qv(this.contextWindow,"pointermove",this.handlePointerMove),qv(this.contextWindow,"pointerup",this.handlePointerUp),qv(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Mh(this.updatePoint)}}function Vv(e,t){return t?{point:t(e.point)}:e}function Bv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Kv({point:e},t){return{point:e,delta:Bv(e,Wv(t)),offset:Bv(e,Hv(t)),velocity:Gv(t,.1)}}function Hv(e){return e[0]}function Wv(e){return e[e.length-1]}function Gv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Wv(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Eh(t)));)n--;if(!r)return{x:0,y:0};const i=jh(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 Yv(e){return e.max-e.min}function Qv(e,t,n,r=.5){e.origin=r,e.originPoint=pg(t.min,t.max,e.origin),e.scale=Yv(n)/Yv(t),e.translate=pg(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 Xv(e,t,n,r){Qv(e.x,t.x,n.x,r?r.originX:void 0),Qv(e.y,t.y,n.y,r?r.originY:void 0)}function Jv(e,t,n){e.min=n.min+t.min,e.max=e.min+Yv(t)}function Zv(e,t,n){e.min=t.min-n.min,e.max=e.min+Yv(t)}function ey(e,t,n){Zv(e.x,t.x,n.x),Zv(e.y,t.y,n.y)}function ty(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 ny(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 ry=.35;function oy(e,t,n){return{min:iy(e,t),max:iy(e,n)}}function iy(e,t){return"number"==typeof e?e:e[t]||0}const sy=()=>({x:{min:0,max:0},y:{min:0,max:0}});function ay(e){return[e("x"),e("y")]}function ly({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function cy(e){return void 0===e||1===e}function uy({scale:e,scaleX:t,scaleY:n}){return!cy(e)||!cy(t)||!cy(n)}function dy(e){return uy(e)||hy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function hy(e){return fy(e.x)||fy(e.y)}function fy(e){return e&&"0%"!==e}function py(e,t,n){return n+t*(e-n)}function my(e,t,n,r,o){return void 0!==o&&(e=py(e,o,r)),py(e,n,r)+t}function gy(e,t=0,n=1,r,o){e.min=my(e.min,t,n,r,o),e.max=my(e.max,t,n,r,o)}function vy(e,{x:t,y:n}){gy(e.x,t.translate,t.scale,t.originPoint),gy(e.y,n.translate,n.scale,n.originPoint)}const yy=.999999999999,by=1.0000000000001;function xy(e,t){e.min=e.min+t,e.max=e.max+t}function wy(e,t,n,r,o=.5){gy(e,t,n,pg(e.min,e.max,o),r)}function Sy(e,t){wy(e.x,t.x,t.scaleX,t.scale,t.originX),wy(e.y,t.y,t.scaleY,t.scale,t.originY)}function Cy(e,t){return ly(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 ky=({current:e})=>e?e.ownerDocument.defaultView:null,Ey=new WeakMap;class jy{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 Uv(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor($v(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?Ap[i]?null:(Ap[i]=!0,()=>{Ap[i]=!1}):Ap.x||Ap.y?null:(Ap.x=Ap.y=!0,()=>{Ap.x=Ap.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),ay((e=>{let t=this.getAxisMotionValue(e).get()||0;if(_f.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=Yv(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&Dh.postRender((()=>o(e,t))),om(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:()=>ay((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:ky(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&&Dh.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||!Py(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?pg(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?pg(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&&tf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:ty(e.x,n,o),y:ty(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=ry){return!1===e?e=0:!0===e&&(e=ry),{x:oy(e,"left","right"),y:oy(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ay((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||!tf(e))return!1;const n=e.current;Sh(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=Cy(e,n),{scroll:o}=t;return o&&(xy(r.x,o.offset.x),xy(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:ny(e.x,t.x),y:ny(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=ly(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=ay((s=>{if(!Py(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 om(this.visualElement,e),n.start(xv(e,n,0,t,this.visualElement,!1))}stopAnimation(){ay((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){ay((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){ay((t=>{const{drag:n}=this.getProps();if(!Py(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]-pg(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!tf(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ay((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=Yv(e),o=Yv(t);return o>r?n=kh(t.min,t.max-r,e.min):r>o&&(n=kh(e.min,e.max-o,t.min)),Cf(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(),ay((t=>{if(!Py(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(pg(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Ey.set(this.visualElement,this);const e=qv(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();tf(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()),Dh.read(t);const o=Fv(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ay((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=ry,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Py(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Ty=e=>(t,n)=>{e&&Dh.postRender((()=>e(t,n)))};const _y={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ny(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dy={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Nf.test(e))return e;e=parseFloat(e)}return`${Ny(e,t.target.x)}% ${Ny(e,t.target.y)}%`}},My={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Lm.parse(e);if(o.length>5)return r;const i=Lm.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=pg(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 Oy 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)vf[t]=e[t],ff(t)&&(vf[t].isCSSVariable=!0)}(Ay),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()})),_y.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()||Dh.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),sf.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 Ry(e){const[r,o]=ph(),i=n.useContext(sh);return t.jsx(Oy,{...e,layoutGroup:i,switchLayoutGroup:n.useContext(af),isPresent:r,safeToRemove:o})}const Ay={borderRadius:{...Dy,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dy,borderTopRightRadius:Dy,borderBottomLeftRadius:Dy,borderBottomRightRadius:Dy,boxShadow:My};const Ly=(e,t)=>e.depth-t.depth;class Iy{constructor(){this.children=[],this.isDirty=!1}add(e){Xp(this.children,e),this.isDirty=!0}remove(e){Jp(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ly),this.isDirty=!1,this.children.forEach(e)}}const Fy=["TopLeft","TopRight","BottomLeft","BottomRight"],$y=Fy.length,qy=e=>"string"==typeof e?parseFloat(e):e,zy=e=>"number"==typeof e||Nf.test(e);function Uy(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Vy=Ky(0,.5,mm),By=Ky(.5,.95,xh);function Ky(e,t,n){return r=>r<e?0:r>t?1:n(kh(e,t,r))}function Hy(e,t){e.min=t.min,e.max=t.max}function Wy(e,t){Hy(e.x,t.x),Hy(e.y,t.y)}function Gy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yy(e,t,n,r,o){return e=py(e-=t,1/n,r),void 0!==o&&(e=py(e,1/o,r)),e}function Qy(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){_f.test(t)&&(t=parseFloat(t),t=pg(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=pg(i.min,i.max,r);e===i&&(a-=t),e.min=Yy(e.min,t,n,a,o),e.max=Yy(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Xy=["x","scaleX","originX"],Jy=["y","scaleY","originY"];function Zy(e,t,n,r){Qy(e.x,t,Xy,n?n.x:void 0,r?r.x:void 0),Qy(e.y,t,Jy,n?n.y:void 0,r?r.y:void 0)}function eb(e){return 0===e.translate&&1===e.scale}function tb(e){return eb(e.x)&&eb(e.y)}function nb(e,t){return e.min===t.min&&e.max===t.max}function rb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ob(e,t){return rb(e.x,t.x)&&rb(e.y,t.y)}function ib(e){return Yv(e.x)/Yv(e.y)}function sb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ab{constructor(){this.members=[]}add(e){Xp(this.members,e),e.scheduleRender()}remove(e){if(Jp(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 lb=["","X","Y","Z"],cb={visibility:"hidden"};let ub=0;function db(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function hb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=im(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Dh,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&hb(r)}function fb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=ub++,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(gb),this.nodes.forEach(Cb),this.nodes.forEach(kb),this.nodes.forEach(vb)},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 Iy)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Zp),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=Qp.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Mh(r),e(i-t))};return Dh.read(r,!0),()=>Mh(r)}(r,250),_y.hasAnimatedSinceResize&&(_y.hasAnimatedSinceResize=!1,this.nodes.forEach(Sb))}))}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()||Nb,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ob(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={...wp(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Sb(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,Mh(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(Eb),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&&hb(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(bb);this.isUpdating||this.nodes.forEach(xb),this.isUpdating=!1,this.nodes.forEach(wb),this.nodes.forEach(pb),this.nodes.forEach(mb),this.clearAllSnapshots();const e=Qp.now();Oh.delta=Cf(0,1e3/60,e-Oh.timestamp),Oh.timestamp=e,Oh.isProcessing=!0,Rh.update.process(Oh),Rh.preRender.process(Oh),Rh.render.process(Oh),Oh.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,sf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(yb),this.sharedNodes.forEach(jb)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Dh.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Dh.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Yv(this.snapshot.measuredBox.x)||Yv(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&&!tb(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||dy(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)),Ob((r=n).x),Ob(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(Ab))){const{scroll:e}=this.root;e&&(xy(n.x,e.offset.x),xy(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(Wy(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&&Wy(n,e),xy(n.x,o.offset.x),xy(n.y,o.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Wy(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&&Sy(n,{x:-e.scroll.offset.x,y:-e.scroll.offset.y}),dy(e.latestValues)&&Sy(n,e.latestValues)}return dy(this.latestValues)&&Sy(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Wy(t,e);for(let n=0;n<this.path.length;n++){const e=this.path[n];if(!e.instance)continue;if(!dy(e.latestValues))continue;uy(e.latestValues)&&e.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};Wy(r,e.measurePageBox()),Zy(t,e.latestValues,e.snapshot?e.snapshot.layoutBox:void 0,r)}return dy(this.latestValues)&&Zy(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!==Oh.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=Oh.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}},ey(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Wy(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(),Jv((s=this.target).x,(a=this.relativeTarget).x,(l=this.relativeParent.target).x),Jv(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Wy(this.target,this.layout.layoutBox),vy(this.target,this.targetDelta)):Wy(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}},ey(this.relativeTargetOrigin,this.target,e.target),Wy(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!uy(this.parent.latestValues)&&!hy(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===Oh.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;Wy(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&&Sy(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,vy(e,s)),r&&dy(i.latestValues)&&Sy(e,i.latestValues))}t.x<by&&t.x>yy&&(t.x=1),t.y<by&&t.y>yy&&(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?(Gy(this.prevProjectionDelta.x,this.projectionDelta.x),Gy(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Xv(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&sb(this.projectionDelta.x,this.prevProjectionDelta.x)&&sb(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(_b));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,f,p,m,g;Pb(i.x,e.x,n),Pb(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ey(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tb((f=this.relativeTarget).x,(p=this.relativeTargetOrigin).x,(m=s).x,g=n),Tb(f.y,p.y,m.y,g),d&&(nb((l=this.relativeTarget).x,(h=d).x)&&nb(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Wy(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=pg(0,void 0!==n.opacity?n.opacity:1,Vy(r)),e.opacityExit=pg(void 0!==t.opacity?t.opacity:1,0,By(r))):i&&(e.opacity=pg(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let s=0;s<$y;s++){const o=`border${Fy[s]}Radius`;let i=Uy(t,o),a=Uy(n,o);void 0===i&&void 0===a||(i||(i=0),a||(a=0),0===i||0===a||zy(i)===zy(a)?(e[o]=Math.max(pg(qy(i),qy(a),r),0),(_f.test(a)||_f.test(i))&&(e[o]+="%")):e[o]=a)}(t.rotate||n.rotate)&&(e.rotate=pg(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&&(Mh(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dh.update((()=>{_y.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=wf(e)?e:nm(e);return r.start(xv("",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&&Rb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=Yv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Yv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wy(t,n),Sy(t,o),Xv(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ab);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&&db("z",e,r,this.animationValues);for(let o=0;o<lb.length;o++)db(`rotate${lb[o]}`,e,r,this.animationValues),db(`skew${lb[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 cb;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=op(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=op(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!dy(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 vf){if(void 0===s[c])continue;const{correct:e,applyTo:t,isCSSVariable:n}=vf[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?op(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(bb),this.root.sharedNodes.clear()}}}function pb(e){e.updateLayout()}function mb(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?ay((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=Yv(r);r.min=t[e].min,r.max=r.min+o})):Rb(o,n.layoutBox,t)&&ay((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Yv(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}};Xv(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?Xv(a,e.applyTransform(r,!0),n.measuredBox):Xv(a,t,n.layoutBox);const l=!tb(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}};ey(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};ey(a,t,i.layoutBox),ob(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 gb(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 vb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function yb(e){e.clearSnapshot()}function bb(e){e.clearMeasurements()}function xb(e){e.isLayoutDirty=!1}function wb(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Cb(e){e.resolveTargetDelta()}function kb(e){e.calcProjection()}function Eb(e){e.resetSkewAndRotation()}function jb(e){e.removeLeadSnapshot()}function Pb(e,t,n){e.translate=pg(t.translate,0,n),e.scale=pg(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tb(e,t,n,r){e.min=pg(t.min,n.min,r),e.max=pg(t.max,n.max,r)}function _b(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Nb={duration:.45,ease:[.4,0,.1,1]},Db=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Mb=Db("applewebkit/")&&!Db("chrome/")?Math.round:xh;function Ob(e){e.min=Mb(e.min),e.max=Mb(e.max)}function Rb(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=ib(t),o=ib(n),i=.2,!(Math.abs(r-o)<=i));var r,o,i}function Ab(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const Lb=fb({attachResizeListener:(e,t)=>Fv(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ib={current:void 0},Fb=fb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ib.current){const e=new Lb({});e.mount(window),e.setOptions({layoutScroll:!0}),Ib.current=e}return Ib.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),$b={pan:{Feature:class extends Av{constructor(){super(...arguments),this.removePointerDownListener=xh}onPointerDown(e){this.session=new Uv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ky(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Ty(e),onStart:Ty(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Dh.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=qv(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 Av{constructor(e){super(e),this.removeGroupControls=xh,this.removeListeners=xh,this.controls=new jy(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:Fb,MeasureLayout:Ry}};function qb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const o=r["onHover"+n];o&&Dh.postRender((()=>o(t,$v(t))))}function zb(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&&Dh.postRender((()=>o(t,$v(t))))}const Ub=new WeakMap,Vb=new WeakMap,Bb=e=>{const t=Ub.get(e.target);t&&t(e)},Kb=e=>{e.forEach(Bb)};function Hb(e,t,n){const r=function({root:e,...t}){const n=e||document;Vb.has(n)||Vb.set(n,{});const r=Vb.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Kb,{root:e,...t})),r[o]}(t);return Ub.set(e,n),r.observe(e),()=>{Ub.delete(e),r.unobserve(e)}}const Wb={some:0,all:1};const Gb={inView:{Feature:class extends Av{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 Hb(this.node.current,{root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Wb[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 Av{mount(){const{current:e}=this.node;e&&(this.unmount=Hp(e,((e,t)=>(zb(this.node,t,"Start"),(e,{success:t})=>zb(this.node,e,t?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Av{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(SY){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=Sg(Fv(this.node.current,"focus",(()=>this.onFocus())),Fv(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Av{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,o,i]=Ip(e,n),s=e=>{if(!Fp(e))return;const{target:n}=e,r=t(n,e);if("function"!=typeof r||!n)return;const i=e=>{Fp(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)=>(qb(this.node,t,"Start"),e=>qb(this.node,e,"End")))))}unmount(){}}}},Yb={layout:{ProjectionNode:Fb,MeasureLayout:Ry}},Qb={current:null},Xb={current:!1};const Jb=[...ag,Pm,Lm],Zb=new WeakMap;const ex=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tx{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=ng,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=Qp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Dh.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=Qh(t),this.isVariantNode=Xh(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]&&wf(e)&&e.set(a[h],!1)}}mount(e){this.current=e,Zb.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))),Xb.current||function(){if(Xb.current=!0,vh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Qb.current=e.matches;e.addListener(t),t()}else Qb.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Qb.current),"production"!==process.env.NODE_ENV&&Vh(!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(),Mh(this.notifyUpdate),Mh(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=bf.has(e);n&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Dh.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 Ih){const t=Ih[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<ex.length;n++){const t=ex[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(wf(o))e.addValue(r,o),"development"===process.env.NODE_ENV&&Vh("12.4.0"===o.version,`Attempting to mix Motion versions ${o.version} with 12.4.0 may not work as expected.`);else if(wf(i))e.addValue(r,nm(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,nm(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=nm(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)||vm(r))?r=parseFloat(r):!Jb.find(sg(r))&&Lm.test(t)&&(r=Vm(e,t)),this.setBaseTarget(e,wf(r)?r.get():r)),wf(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=np(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||wf(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 Zp),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class nx extends tx{constructor(){super(...arguments),this.KeyframeResolver=cg}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;wf(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class rx extends nx{constructor(){super(...arguments),this.type="html",this.renderInstance=up}readValueFromInstance(e,t){if(bf.has(t)){const e=Um(t);return e&&e.default||0}{const n=window.getComputedStyle(e),r=(ff(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Cy(e,t)}build(e,t,n){qf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ap(e,t,n)}}class ox extends nx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sy,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&cp(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(bf.has(t)){const e=Um(t);return e&&e.default||0}return t=dp.has(t)?t:rf(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return fp(e,t,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&Dh.postRender(this.updateDimensions)}build(e,t,n){Qf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){hp(e,t,0,r)}mount(e){this.isSVGTag=Jf(e.tagName),super.mount(e)}}const ix=Bh(gp({...Iv,...Gb,...$b,...Yb},((e,t)=>Hf(e)?new ox(t):new rx(t,{allowProjection:e!==n.Fragment})))),sx=({children:e,className:n})=>t.jsx(ix.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}),ax=({children:e})=>t.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight",children:e}),lx=({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(ax,{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 "})]})})},cx="/segments",ux="/automations",dx="/channel/senders",hx="/communication-groups",fx="/stripo",px=async(e,t)=>(await pa(`${ux}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data,mx=e=>{const t=ne(),n=ue({queryKey:["automations",e],queryFn:()=>(async e=>(await pa(`${ux}/${e}`)).data)(e)});return{automation:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchAutomation:n.refetch,invalidateAutomation:()=>t.invalidateQueries({queryKey:["automations",e]})}},gx=e=>{const t=ue({queryKey:["automations",e,"recipients"],queryFn:()=>(async e=>(await pa(`${ux}/${e}/recipients`)).data)(e)});return{recipients:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error,refetchAutomationRecipients:t.refetch}},vx=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(ux,{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}},yx=e=>{const t=ne(),n=de({mutationFn:t=>px(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["automations"]}),t.invalidateQueries({queryKey:["automations",e]})}});return{updateAutomation:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}},bx=e=>{const t=ue({queryKey:["automations",e,"statistics"],queryFn:()=>(async e=>{if(e)return(await pa(`${ux}/${e}/statistics`)).data;return(await pa(`${ux}/statistics`)).data})(e)});return{statistics:t.data,isFetching:t.isFetching,isLoading:t.isLoading,fetchError:t.error}};var xx=(e=>(e.ONE_TIME="one_time",e))(xx||{}),wx=(e=>(e.DRAFT="draft",e.ACTIVE="active",e.RUNNING="running",e.COMPLETED="completed",e.FAILED="failed",e.DEACTIVATED="deactivated",e))(wx||{});const Sx={CloseButton:Rc,DropdownMenuTrigger:rc,UserIcon:Dc,UsersIcon:Mc,UserEdit:_c,ScheduleButton:tc,SendButton:Ec,BackButton:oc,NextButton:ic,MergeField:Nc,PlusIcon:Cc,AlertCircleIcon:lc,OneTimeBroadcast:bc,PatronEntersList:pc,DateMilestone:tc,RealtimeActivity:ec,EmailIcon:vc,SmsIcon:xc,MessagesSent:gc,LinksClicked:Sc,OpenRate:hc,SpamComplies:Tc,TotalBounceRate:Tc,UnsubscribeRate:jc},Cx=e=>({...Sx,...e||{}});var kx=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(Px);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(Ex,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(Ex,{...o,ref:n,children:r})}));kx.displayName="Slot";var Ex=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?ja(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));Ex.displayName="SlotClone";var jx=({children:e})=>t.jsx(t.Fragment,{children:e});function Px(e){return i.isValidElement(e)&&e.type===jx}const Tx=Yl(["reach-styles-module__base___gfFyc"],{variants:{variant:{default:"reach-styles-module__default___ny1h7",destructive:"reach-styles-module__destructive___XjBvS",outline:"reach-styles-module__outline___gFp3i",secondary:"reach-styles-module__secondary___Pd-e3",ghost:"reach-styles-module__ghost___GcnJq",link:"reach-styles-module__link___EgS2H"},size:{default:"reach-styles-module__sizeDefault___8kU5A",sm:"reach-styles-module__sizeSm___zPIEh",lg:"reach-styles-module__sizeLg___D2G8z",icon:"reach-styles-module__sizeIcon___5XkYW"}},defaultVariants:{variant:"default",size:"default"}}),_x=i.forwardRef((({className:e,variant:n,size:r,asChild:o=!1,...i},s)=>t.jsx(o?kx:"button",{className:Pu(Tx({variant:n,size:r,className:e})),ref:s,...i})));_x.displayName="Button";var Nx=(e=>(e.ChooseAutomationType="choose-automation-type",e.SetAutomationName="set-automation-name",e))(Nx||{});const Dx=({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(_x,{variant:"secondary",className:"px-4 py-2",onClick:()=>{if(n===Nx.ChooseAutomationType)e?.(!1);else{if(n!==Nx.SetAutomationName)throw new Error("Invalid step");r(Nx.ChooseAutomationType)}},children:n===Nx.ChooseAutomationType?"Cancel":"Back"}),t.jsx(_x,{className:"px-4 py-2",onClick:()=>{o||n!==Nx.SetAutomationName||i()},disabled:o,children:n===Nx.SetAutomationName?"Create":"Next"})]})}),Mx=({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-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]":"border-gray-200 hover:[border-color:hsl(var(--reach-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})]})]}),Ox="text-3xl mb-8",Rx="grid grid-cols-2 gap-6",Ax="relative p-6 rounded-lg",Lx=({onNext:e,iconDefinitions:n})=>t.jsxs("div",{className:Ax,children:[t.jsx("h1",{className:Ox,children:"Choose Your Automation Type"}),t.jsxs("div",{className:Rx,children:[t.jsx(Mx,{onClick:()=>{e(xx.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(Mx,{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(Mx,{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(Mx,{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 Ix(e,t){throw new Error(`Unreachable case statement: ${JSON.stringify(e)}. Valid values are: ${Object.values(t).join(", ")}`)}const Fx="mb-4 flex items-center justify-center",$x="text-lg font-medium mb-2",qx="text-sm text-gray-600",zx=({iconDefinitions:e})=>t.jsxs("div",{children:[t.jsx("div",{className:Fx,children:t.jsx(e.OneTimeBroadcast,{})}),t.jsx("h3",{className:$x,children:"One-Time Broadcast"}),t.jsx("p",{className:qx,children:"Send a single message to your current list, like announcing a sale or newsletter."})]}),Ux=({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===xx.ONE_TIME)return t.jsx(zx,{iconDefinitions:o});throw Ix(e,xx)})()}),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"})]})]})]}),Vx=({onClose:e,iconDefinitions:r})=>{const{createAutomation:o,isCreating:i}=vx(),[s,a]=n.useState(!1),l=Cx(r),[c,u]=n.useState(Nx.ChooseAutomationType),[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:Ax,children:t.jsx(lx,{text:["Creating Automation","Finishing up"]})}):t.jsxs("div",{className:"relative overflow-hidden",children:[t.jsxs(bh,{mode:"wait",children:[c===Nx.ChooseAutomationType&&t.jsx(sx,{children:t.jsx(Lx,{onNext:e=>{h({...d,type:e}),u(Nx.SetAutomationName)},iconDefinitions:l})},"choose-automation-type"),c===Nx.SetAutomationName&&d.type&&t.jsx(sx,{children:t.jsx(Ux,{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(Dx,{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 Bx={};Object.defineProperty(Bx,"__esModule",{value:!0}),Bx.parse=function(e,t){const n=new Qx,r=e.length;if(r<2)return n;const o=t?.decode||Zx;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=Xx(e,i,t),c=Jx(e,t,l),u=e.slice(l,c);if(void 0===n[u]){let r=Xx(e,t+1,a),i=Jx(e,a,r);const s=o(e.slice(r,i));n[u]=s}i=a+1}while(i<r);return n},Bx.serialize=function(e,t,n){const r=n?.encode||encodeURIComponent;if(!Kx.test(e))throw new TypeError(`argument name is invalid: ${e}`);const o=r(t);if(!Hx.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(!Wx.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);i+="; Domain="+n.domain}if(n.path){if(!Gx.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]"===Yx.call(e)}
34
34
  /**
35
35
  * react-router v7.1.0
36
36
  *
@@ -40,7 +40,7 @@
40
40
  * LICENSE.md file in the root directory of this source tree.
41
41
  *
42
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 Kx=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Hx=/^[\u0021-\u003A\u003C-\u007E]*$/,Wx=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Gx=/^[\u0020-\u003A\u003D-\u007E]*$/,Yx=Object.prototype.toString,Qx=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Xx(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Jx(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Zx(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(SY){return e}}function ew(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?iw(t):t,state:n,key:t&&t.key||r||rw()};return o}(t?c().pathname:"/",e,n,r);return nw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:ow(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?iw(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function tw(e,t){if(!1===e||null==e)throw new Error(t)}function nw(e,t){if(!e)try{throw new Error(t)}catch(SY){}}function rw(){return Math.random().toString(36).substring(2,10)}function ow({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 iw(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 sw(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?iw(t):t,i=xw(o.pathname||"/",n);if(null==i)return null;let s=aw(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=bw(i);a=vw(s[l],e,r)}return a}(e,t,n,!1)}function aw(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("/")&&(tw(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=kw([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(tw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),aw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:gw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of lw(e.path))o(e,t,n);else o(e,t)})),t}function lw(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=lw(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 cw=/^:[\w-]+$/,uw=3,dw=2,hw=1,fw=10,pw=-2,mw=e=>"*"===e;function gw(e,t){let n=e.split("/"),r=n.length;return n.some(mw)&&(r+=pw),t&&(r+=dw),n.filter((e=>!mw(e))).reduce(((e,t)=>e+(cw.test(t)?uw:""===t?hw:fw)),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=yw({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=yw({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:kw([i,u.pathname]),pathnameBase:Ew(kw([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=kw([i,u.pathnameBase]))}return s}function yw(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){nw("*"===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 bw(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return nw(!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 xw(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 ww(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 Sw(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 Cw(e,t,n,r=!1){let o;"string"==typeof e?o=iw(e):(o={...e},tw(!o.pathname||!o.pathname.includes("?"),ww("?","pathname","search",o)),tw(!o.pathname||!o.pathname.includes("#"),ww("#","pathname","hash",o)),tw(!o.search||!o.search.includes("#"),ww("#","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?iw(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:jw(r),hash:Pw(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var kw=e=>e.join("/").replace(/\/\/+/g,"/"),Ew=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jw=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Pw=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var Tw=["POST","PUT","PATCH","DELETE"];new Set(Tw);var _w=["GET",...Tw];new Set(_w);var Nw=i.createContext(null);Nw.displayName="DataRouter";var Dw=i.createContext(null);Dw.displayName="DataRouterState";var Mw=i.createContext({isTransitioning:!1});Mw.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var Ow=i.createContext(null);Ow.displayName="Navigation";var Rw=i.createContext(null);Rw.displayName="Location";var Aw=i.createContext({outlet:null,matches:[],isDataRoute:!1});Aw.displayName="Route";var Lw=i.createContext(null);function Iw(){return null!=i.useContext(Rw)}function Fw(){return tw(Iw(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(Rw).location}Lw.displayName="RouteError";var $w="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qw(e){i.useContext(Ow).static||i.useLayoutEffect(e)}function zw(){let{isDataRoute:e}=i.useContext(Aw);return e?function(){let{router:e}=function(e){let t=i.useContext(Nw);return tw(t,Gw(e)),t}("useNavigate"),t=Yw("useNavigate"),n=i.useRef(!1);return qw((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{nw(n.current,$w),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){tw(Iw(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(Nw),{basename:t,navigator:n}=i.useContext(Ow),{matches:r}=i.useContext(Aw),{pathname:o}=Fw(),s=JSON.stringify(Sw(r)),a=i.useRef(!1);return qw((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(nw(a.current,$w),!a.current)return;if("number"==typeof r)return void n.go(r);let l=Cw(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:kw([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function Uw(e,{relative:t}={}){let{matches:n}=i.useContext(Aw),{pathname:r}=Fw(),o=JSON.stringify(Sw(n));return i.useMemo((()=>Cw(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function Vw(e,t,n,r){tw(Iw(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(Ow),{matches:a}=i.useContext(Aw),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||"";Xw(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=Fw();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=sw(e,{pathname:p});nw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),nw(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]));tw(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||Kw,s&&(a<0&&0===c?(Xw("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(Ww,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(Hw,{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:kw([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:kw([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function Bw(){let e=function(){let e=i.useContext(Lw),t=function(e){let t=i.useContext(Dw);return tw(t,Gw(e)),t}("useRouteError"),n=Yw("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 Kw=i.createElement(Bw,null),Hw=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(Aw.Provider,{value:this.props.routeContext},i.createElement(Lw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ww({routeContext:e,match:t,children:n}){let r=i.useContext(Nw);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(Aw.Provider,{value:e},n)}function Gw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yw(e){let t=function(e){let t=i.useContext(Aw);return tw(t,Gw(e)),t}(e),n=t.matches[t.matches.length-1];return tw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var Qw={};function Xw(e,t,n){t||Qw[e]||(Qw[e]=!0,nw(!1,n))}function Jw({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=ew({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(Zw,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function Zw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){tw(!Iw(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=iw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=xw(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return nw(null!=p,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==p?null:i.createElement(Ow.Provider,{value:l},i.createElement(Rw.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return Vw(e,0,n,t)}));var eS="get",tS="application/x-www-form-urlencoded";function nS(e){return null!=e&&"string"==typeof e.tagName}function rS(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 oS=null;var iS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sS(e){return null==e||iS.has(e)?e:(nw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tS}"`),null)}function aS(e,t){let n,r,o,i,s;if(function(e){return nS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?xw(s,t):null,n=e.getAttribute("method")||eS,o=sS(e.getAttribute("enctype"))||tS,i=new FormData(e)}else if(function(e){return nS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return nS(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?xw(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||eS,o=sS(e.getAttribute("formenctype"))||sS(s.getAttribute("enctype"))||tS,i=new FormData(s,e),!function(){if(null===oS)try{new FormData(document.createElement("form"),0),oS=!1}catch(SY){oS=!0}return oS}()){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(nS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=eS,r=null,o=tS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function lS(e,t){if(!1===e||null==e)throw new Error(t)}function cS(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 uS(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(cS).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function dS(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 hS(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 pS(){let e=i.useContext(fS);return lS(e,"You must render this element inside a <HydratedRouter> element"),e}function mS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function gS({page:e,...t}){let{router:n}=function(){let e=i.useContext(Nw);return lS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>sw(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(vS,{page:e,matches:r,...t}):null}function vS({page:e,matches:t,...n}){let r=Fw(),{manifest:o,routeModules:s}=pS(),{loaderData:a,matches:l}=function(){let e=i.useContext(Dw);return lS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>dS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>dS(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((()=>hS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=pS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return uS(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 yS(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}fS.displayName="FrameworkContext";var bS="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{bS&&(window.__reactRouterVersion="7.1.0")}catch(SY){}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wS=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(Ow),g="string"==typeof c&&xS.test(c),v=!1;if("string"==typeof c&&g&&(p=c,bS))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=xw(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(SY){nw(!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}={}){tw(Iw(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(Ow),{hash:o,pathname:s,search:a}=Uw(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:kw([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:mS(l,p),onBlur:mS(c,m),onMouseEnter:mS(u,p),onMouseLeave:mS(d,m),onTouchStart:mS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=zw(),c=Fw(),u=Uw(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:ow(c)===ow(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:yS(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(gS,{page:y})):C}));function SS(e){let t=i.useContext(Nw);return tw(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 CS(e){nw("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(rS(e)),n=i.useRef(!1),r=Fw(),o=i.useMemo((()=>function(e,t){let n=rS(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=zw(),a=i.useCallback(((e,t)=>{const r=rS("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}wS.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=Uw(s,{relative:c.relative}),h=Fw(),f=i.useContext(Dw),{navigator:p,basename:m}=i.useContext(Ow),g=null!=f&&function(e,t={}){let n=i.useContext(Mw);tw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=SS("useViewTransitionState"),o=Uw(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=xw(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=xw(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=yw(o.pathname,a)||null!=yw(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=xw(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(wS,{...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}=SS("useSubmit"),{basename:t}=i.useContext(Ow),n=Yw("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=aS(r,t);if(!1===o.navigate){let t=o.fetcherKey||ES();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(Ow),r=i.useContext(Aw);tw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Uw(e||".",{relative:t})},a=Fw();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:kw([n,s.pathname]));return ow(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&xS.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 kS=0,ES=()=>`__${String(++kS)}__`;function jS(...e){return Qd(gu(e))}new TextEncoder;const PS=({tabs:e,activeTab:r,onTabChange:o,tabsLocation:i="left",secondaryTabs:s=!1})=>{const a=n.useRef([]),[l,c]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=a.current[e.findIndex((e=>e.id===r))];t&&c({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),t.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[t.jsx("div",{className:"flex items-center justify-between border-b",children:t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===i?"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:`${l.width}px`,left:`${l.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>a.current[n]=e,onClick:()=>o(e.id),className:jS("relative px-1 py-3 transition-all duration-200",r!==e.id&&"text-muted-foreground",s&&"text-sm"),children:e.label},e.id)))]})}),t.jsx("div",{className:"relative min-h-40",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-[-8%]":"translate-x-[8%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})},TS="flex flex-col items-center justify-center h-full";var _S,NS="dismissableLayer.update",DS="dismissableLayer.pointerDownOutside",MS="dismissableLayer.focusOutside",OS=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RS=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(OS),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Xl(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=cc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){LS(DS,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=cc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){LS(MS,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 uc((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&&(_S=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),AS(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_S)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),AS())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(NS,e),()=>document.removeEventListener(NS,e)}),[]),t.jsx(ac.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Gl(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Gl(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Gl(e.onPointerDownCapture,C.onPointerDownCapture)})}));RS.displayName="DismissableLayer";function AS(){const e=new CustomEvent(NS);document.dispatchEvent(e)}function LS(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?lc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(OS),o=i.useRef(null),s=Xl(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(ac.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var IS=i["useId".toString()]||(()=>{}),FS=0;function $S(e){const[t,n]=i.useState(IS());return Sc((()=>{n((e=>e??String(FS++)))}),[e]),t?`radix-${t}`:""}const qS=["top","right","bottom","left"],zS=Math.min,US=Math.max,VS=Math.round,BS=Math.floor,KS=e=>({x:e,y:e}),HS={left:"right",right:"left",bottom:"top",top:"bottom"},WS={start:"end",end:"start"};function GS(e,t,n){return US(e,zS(t,n))}function YS(e,t){return"function"==typeof e?e(t):e}function QS(e){return e.split("-")[0]}function XS(e){return e.split("-")[1]}function JS(e){return"x"===e?"y":"x"}function ZS(e){return"y"===e?"height":"width"}function eC(e){return["top","bottom"].includes(QS(e))?"y":"x"}function tC(e){return JS(eC(e))}function nC(e){return e.replace(/start|end/g,(e=>WS[e]))}function rC(e){return e.replace(/left|right|bottom|top/g,(e=>HS[e]))}function oC(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 iC(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 sC(e,t,n){let{reference:r,floating:o}=e;const i=eC(t),s=tC(t),a=ZS(s),l=QS(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(XS(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function aC(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}=YS(t,e),p=oC(f),m=a[h?"floating"===d?"reference":"floating":d],g=iC(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=iC(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 lC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cC(e){return qS.some((t=>e[t]>=0))}function uC(){return"undefined"!=typeof window}function dC(e){return pC(e)?(e.nodeName||"").toLowerCase():"#document"}function hC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fC(e){var t;return null==(t=(pC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function pC(e){return!!uC()&&(e instanceof Node||e instanceof hC(e).Node)}function mC(e){return!!uC()&&(e instanceof Element||e instanceof hC(e).Element)}function gC(e){return!!uC()&&(e instanceof HTMLElement||e instanceof hC(e).HTMLElement)}function vC(e){return!(!uC()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hC(e).ShadowRoot)}function yC(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bC(e){return["table","td","th"].includes(dC(e))}function xC(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(SY){return!1}}))}function wC(e){const t=SC(),n=mC(e)?kC(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 SC(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function CC(e){return["html","body","#document"].includes(dC(e))}function kC(e){return hC(e).getComputedStyle(e)}function EC(e){return mC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jC(e){if("html"===dC(e))return e;const t=e.assignedSlot||e.parentNode||vC(e)&&e.host||fC(e);return vC(t)?t.host:t}function PC(e){const t=jC(e);return CC(t)?e.ownerDocument?e.ownerDocument.body:e.body:gC(t)&&yC(t)?t:PC(t)}function TC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=PC(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=hC(o);if(i){const e=_C(s);return t.concat(s,s.visualViewport||[],yC(o)?o:[],e&&n?TC(e):[])}return t.concat(o,TC(o,[],n))}function _C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NC(e){const t=kC(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gC(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=VS(n)!==i||VS(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function DC(e){return mC(e)?e:e.contextElement}function MC(e){const t=DC(e);if(!gC(t))return KS(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=NC(t);let s=(i?VS(n.width):n.width)/r,a=(i?VS(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const OC=KS(0);function RC(e){const t=hC(e);return SC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:OC}function AC(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=DC(e);let s=KS(1);t&&(r?mC(r)&&(s=MC(r)):s=MC(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hC(e))&&t}(i,n,r)?RC(i):KS(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=hC(i),t=r&&mC(r)?hC(r):r;let n=e,o=_C(n);for(;o&&r&&t!==n;){const e=MC(o),t=o.getBoundingClientRect(),r=kC(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=hC(o),o=_C(n)}}return iC({width:u,height:d,x:l,y:c})}function LC(e,t){const n=EC(e).scrollLeft;return t?t.left+n:AC(fC(e)).left+n}function IC(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:LC(e,r)),y:r.top+t.scrollTop}}function FC(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=hC(e),r=fC(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=SC();(!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=fC(e),n=EC(e),r=e.ownerDocument.body,o=US(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=US(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+LC(e);const a=-n.scrollTop;return"rtl"===kC(r).direction&&(s+=US(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(fC(e));else if(mC(t))r=function(e,t){const n=AC(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=gC(e)?MC(e):KS(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=RC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return iC(r)}function $C(e,t){const n=jC(e);return!(n===t||!mC(n)||CC(n))&&("fixed"===kC(n).position||$C(n,t))}function qC(e,t,n){const r=gC(t),o=fC(t),i="fixed"===n,s=AC(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=KS(0);if(r||!r&&!i)if(("body"!==dC(t)||yC(o))&&(a=EC(t)),r){const e=AC(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=LC(o));const c=!o||r||i?KS(0):IC(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 zC(e){return"static"===kC(e).position}function UC(e,t){if(!gC(e)||"fixed"===kC(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fC(e)===n&&(n=n.ownerDocument.body),n}function VC(e,t){const n=hC(e);if(xC(e))return n;if(!gC(e)){let t=jC(e);for(;t&&!CC(t);){if(mC(t)&&!zC(t))return t;t=jC(t)}return n}let r=UC(e,t);for(;r&&bC(r)&&zC(r);)r=UC(r,t);return r&&CC(r)&&zC(r)&&!wC(r)?n:r||function(e){let t=jC(e);for(;gC(t)&&!CC(t);){if(wC(t))return t;if(xC(t))return null;t=jC(t)}return null}(e)||n}const BC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=fC(r),a=!!t&&xC(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=KS(1);const u=KS(0),d=gC(r);if((d||!d&&!i)&&(("body"!==dC(r)||yC(s))&&(l=EC(r)),gC(r))){const e=AC(r);c=MC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?KS(0):IC(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:fC,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?xC(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=TC(e,[],!1).filter((e=>mC(e)&&"body"!==dC(e))),o=null;const i="fixed"===kC(e).position;let s=i?jC(e):e;for(;mC(s)&&!CC(s);){const t=kC(s),n=wC(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||yC(s)&&!n&&$C(e,s))?r=r.filter((e=>e!==s)):o=t,s=jC(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=FC(t,n,o);return e.top=US(r.top,e.top),e.right=zS(r.right,e.right),e.bottom=zS(r.bottom,e.bottom),e.left=US(r.left,e.left),e}),FC(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:VC,getElementRects:async function(e){const t=this.getOffsetParent||VC,n=this.getDimensions,r=await n(e.floating);return{reference:qC(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}=NC(e);return{width:t,height:n}},getScale:MC,isElement:mC,isRTL:function(e){return"rtl"===kC(e).direction}};function KC(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=DC(e),u=o||i?[...c?TC(c):[],...TC(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=fC(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:-BS(u)+"px "+-BS(o.clientWidth-(c+d))+"px "+-BS(o.clientHeight-(u+h))+"px "+-BS(c)+"px",threshold:US(0,zS(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(SY){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?AC(e):null;return l&&function t(){const r=AC(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 HC=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=QS(n),a=XS(n),l="y"===eC(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=YS(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}}}}},WC=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}=YS(e,t),c={x:n,y:r},u=await aC(t,l),d=eC(QS(o)),h=JS(d);let f=c[h],p=c[d];if(i){f=GS(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=GS(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}}}}}},GC=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}=YS(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=QS(o),y=eC(a),b=QS(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[rC(a)]:function(e){const t=rC(e);return[nC(e),t,nC(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=XS(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[]}}(QS(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(nC)))),i}(a,m,p,x));const C=[a,...w],k=await aC(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=XS(e),o=tC(e),i=ZS(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=rC(s)),[s,rC(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 _;const e=null==(_=j.filter((e=>{if(S){const t=eC(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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},YC=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}=YS(e,t),u=await aC(t,c),d=QS(o),h=XS(o),f="y"===eC(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=zS(m-u[g],y),w=zS(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=US(u.left,0),t=US(u.right,0),n=US(u.top,0),r=US(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:US(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:US(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}}:{}}}},QC=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=YS(e,t);switch(r){case"referenceHidden":{const e=lC(await aC(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cC(e)}}}case"escaped":{const e=lC(await aC(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cC(e)}}}default:return{}}}}},XC=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}=YS(e,t)||{};if(null==c)return{};const d=oC(u),h={x:n,y:r},f=tC(o),p=ZS(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=zS(d[v],E),P=zS(d[y],E),T=j,_=C-m[p]-P,N=C/2-m[p]/2+k,D=GS(T,N,_),M=!l.arrow&&null!=XS(o)&&N!==D&&i.reference[p]/2-(N<T?j:P)-m[p]/2<0,O=M?N<T?N-T:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),JC=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}=YS(e,t),u={x:n,y:r},d=eC(o),h=JS(d);let f=u[h],p=u[d];const m=YS(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(QS(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}}}},ZC=(e,t,n)=>{const r={platform:BC,...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}=sC(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}=sC(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var ek="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function tk(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(!tk(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)&&!tk(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function nk(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rk(e,t){const n=nk(e);return Math.round(t*n)/n}function ok(e){const t=i.useRef(e);return ek((()=>{t.current=e})),t}const ik=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?XC({element:n.current,padding:r}).fn(t):{}:n?XC({element:n,padding:r}).fn(t):{}}}),sk=(e,t)=>({...WC(e),options:[e,t]}),ak=(e,t)=>({...JC(e),options:[e,t]}),lk=(e,t)=>({...GC(e),options:[e,t]}),ck=(e,t)=>({...YC(e),options:[e,t]}),uk=(e,t)=>({...QC(e),options:[e,t]}),dk=(e,t)=>({...ik(e),options:[e,t]});var hk=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(ac.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"})})}));hk.displayName="Arrow";var fk=hk;function pk(e){const[t,n]=i.useState(void 0);return Sc((()=>{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}var mk="Popper",[gk,vk]=Zl(mk),[yk,bk]=gk(mk),xk=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(yk,{scope:n,anchor:o,onAnchorChange:s,children:r})};xk.displayName=mk;var wk="PopperAnchor",Sk=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=bk(wk,r),l=i.useRef(null),c=Xl(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(ac.div,{...s,ref:c})}));Sk.displayName=wk;var Ck="PopperContent",[kk,Ek]=gk(Ck),jk=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=bk(Ck,r),[x,w]=i.useState(null),S=Xl(n,(e=>w(e))),[C,k]=i.useState(null),E=pk(C),j=E?.width??0,P=E?.height??0,T=o+("center"!==l?"-"+l:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(h)?h:[h],D=N.length>0,M={padding:_,boundary:N.filter(Nk),altBoundary:D},{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);tk(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=ok(u),_=ok(o),N=ok(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),ZC(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!tk(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,_,N]);ek((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);ek((()=>(M.current=!0,()=>{M.current=!1})),[]),ek((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(T.current)return T.current(S,C,D);D()}}),[S,C,D,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=rk(R.floating,h.x),r=rk(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...nk(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:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>KC(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+P,alignmentAxis:c},{...HC(F),options:[F,$]}),d&&sk({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?ak():void 0,...M}),d&&lk({...M}),ck({...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&&dk({element:C,padding:u}),Dk({arrowWidth:j,arrowHeight:P}),m&&uk({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=Mk(A),U=cc(v);Sc((()=>{L&&U?.()}),[L,U]);const V=I.arrow?.x,B=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return Sc((()=>{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(kk,{scope:r,placedSide:q,onArrowChange:k,arrowX:V,arrowY:B,shouldHideArrow:K,children:t.jsx(ac.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));jk.displayName=Ck;var Pk="PopperArrow",Tk={top:"bottom",right:"left",bottom:"top",left:"right"},_k=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=Ek(Pk,r),s=Tk[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(fk,{...o,ref:n,style:{...o.style,display:"block"}})})}));function Nk(e){return null!==e}_k.displayName=Pk;var Dk=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]=Mk(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 Mk(e){const[t,n="center"]=e.split("-");return[t,n]}var Ok=xk,Rk=Sk,Ak=jk,Lk=_k,[Ik,Fk]=Zl("Tooltip",[vk]),$k=vk(),qk="TooltipProvider",zk=700,Uk="tooltip.open",[Vk,Bk]=Ik(qk),Kk=e=>{const{__scopeTooltip:n,delayDuration:r=zk,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(Vk,{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})};Kk.displayName=qk;var Hk="Tooltip",[Wk,Gk]=Ik(Hk),Yk=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=Bk(Hk,e.__scopeTooltip),d=$k(n),[h,f]=i.useState(null),p=$S(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=jc({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Uk))):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(Ok,{...d,children:t.jsx(Wk,{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})})};Yk.displayName=Hk;var Qk="TooltipTrigger",Xk=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=Gk(Qk,r),a=Bk(Qk,r),l=$k(r),c=Xl(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(Rk,{asChild:!0,...l,children:t.jsx(ac.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Gl(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Gl(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Gl(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Gl(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Gl(e.onBlur,s.onClose),onClick:Gl(e.onClick,s.onClose)})})}));Xk.displayName=Qk;var Jk="TooltipPortal",[Zk,eE]=Ik(Jk,{forceMount:void 0}),tE=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=Gk(Jk,n);return t.jsx(Zk,{scope:n,forceMount:r,children:t.jsx(kc,{present:r||s.open,children:t.jsx(Cc,{asChild:!0,container:i,children:o})})})};tE.displayName=Jk;var nE="TooltipContent",rE=i.forwardRef(((e,n)=>{const r=eE(nE,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=Gk(nE,e.__scopeTooltip);return t.jsx(kc,{present:o||a.open,children:t.jsx(a.disableHoverableContent?aE:oE,{side:i,...s,ref:n})})})),oE=i.forwardRef(((e,n)=>{const r=Gk(nE,e.__scopeTooltip),o=Bk(nE,e.__scopeTooltip),s=i.useRef(null),a=Xl(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(aE,{...e,ref:a})})),[iE,sE]=Ik(Hk,{isInside:!1}),aE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=Gk(nE,r),d=$k(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(Uk,h),()=>document.removeEventListener(Uk,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(RS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(Ak,{"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(rc,{children:o}),t.jsx(iE,{scope:r,isInside:!0,children:t.jsx(Tc,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));rE.displayName=nE;var lE="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=$k(r);return sE(lE,r).isInside?null:t.jsx(Lk,{...i,...o,ref:n})})).displayName=lE;var cE=tE,uE=rE;const dE=Kk,hE=Yk,fE=Xk,pE=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(cE,{children:t.jsx(uE,{ref:o,sideOffset:n,className:Xd("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})})));pE.displayName=uE.displayName;const mE=({title:e,alertText:n,Icon:r=Iu,onClick:o})=>t.jsx(dE,{children:t.jsxs(hE,{children:[t.jsx(fE,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(pE,{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})]})})]})}),gE=({icon:e,title:n,value:r,tooltipText:o})=>t.jsx("div",{className:"flex items-center bg-white rounded p-3 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md",children:t.jsxs("div",{className:"flex items-start text-sm leading-none gap-3",children:[t.jsx("div",{className:"rounded-lg p-2 bg-gray-100",children:e}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-center text-muted-foreground gap-1",children:[t.jsx("span",{className:"text-[11px]",children:n}),t.jsx(mE,{title:o})]}),t.jsx("span",{children:r})]})]})}),vE=({activeTab:e,statistics:n,iconDefinitions:r})=>{const o={email:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"Emails Sent",value:n.email.numberSent,tooltipText:"Total number of emails that were successfully sent in this campaign"},{icon:t.jsx(r.OpenRate,{className:"w-4 h-4"}),title:"Open Rate",value:`${n.email.openPercentage.toFixed(2)}%`,tooltipText:"Percentage of recipients who opened the email out of total emails delivered"},{icon:t.jsx(r.TotalBounceRate,{className:"w-4 h-4"}),title:"Total Bounce Rate",value:`${(n.email.softBounceRate+n.email.hardBounceRate).toFixed(2)}%`,tooltipText:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"},{icon:t.jsx(r.LinksClicked,{className:"w-4 h-4"}),title:"Links Clicked",value:n.email.linksClicked,tooltipText:"Total number of times recipients clicked on links within the email"},{icon:t.jsx(r.SpamComplies,{className:"w-4 h-4"}),title:"Spam Complaints",value:`${n.email.spamComplaintRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who marked this email as spam"},{icon:t.jsx(r.UnsubscribeRate,{className:"w-4 h-4"}),title:"Unsubscribe Rate",value:`${n.email.unsubscribedRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who unsubscribed after receiving this email"}],sms:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"SMS Sent",value:n.sms.numberSent,tooltipText:"Total number of SMS messages that were successfully sent in this campaign"}]};return t.jsx("div",{className:"grid gap-2 transition-all duration-300 grid-cols-3",children:o[e].map(((e,n)=>t.jsx(gE,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},yE=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=bx(e);if(a||!s)return t.jsx("div",{className:TS,children:t.jsx(lx,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(PS,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(vE,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(vE,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function bE(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 xE(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const wE=6048e5,SE=43200;let CE={};function kE(){return CE}function EE(e,t){const n=kE(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=bE(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 jE(e){return EE(e,{weekStartsOn:1})}function PE(e){const t=bE(e),n=t.getFullYear(),r=xE(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=jE(r),i=xE(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=jE(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function TE(e){const t=bE(e);return t.setHours(0,0,0,0),t}function _E(e){const t=bE(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 NE(e,t){return function(e,t){return xE(e,+bE(e)+t)}(e,6e4*t)}function DE(e,t){const n=bE(e),r=bE(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function ME(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=bE(e);return!isNaN(Number(n))}function OE(e){const t=bE(e);return+function(e){const t=bE(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=bE(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function RE(e,t){const n=bE(e),r=bE(t),o=DE(n,r),i=Math.abs(function(e,t){const n=bE(e),r=bE(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=DE(n,r)===-o;OE(bE(e))&&1===i&&1===DE(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function AE(e,t,n){const r=function(e,t){return+bE(e)-+bE(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 LE={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 IE(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const FE={date:IE({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:IE({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:IE({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$E={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function qE(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 zE(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 UE;const VE={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=LE[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:FE,formatRelative:(e,t,n,r)=>$E[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:qE({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:qE({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:qE({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:qE({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:qE({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:(UE={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(UE.matchPattern);if(!n)return null;const r=n[0],o=e.match(UE.parsePattern);if(!o)return null;let i=UE.valueCallback?UE.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:zE({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:zE({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:zE({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:zE({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:zE({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 BE(e){const t=bE(e),n=function(e,t){const n=TE(e),r=TE(t),o=+n-_E(n),i=+r-_E(r);return Math.round((o-i)/864e5)}(t,function(e){const t=bE(e),n=xE(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function KE(e){const t=bE(e),n=+jE(t)-+function(e){const t=PE(e),n=xE(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),jE(n)}(t);return Math.round(n/wE)+1}function HE(e,t){const n=bE(e),r=n.getFullYear(),o=kE(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=xE(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=EE(s,t),l=xE(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=EE(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function WE(e,t){const n=bE(e),r=+EE(n,t)-+function(e,t){const n=kE(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=HE(e,t),i=xE(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),EE(i,t)}(n,t);return Math.round(r/wE)+1}function GE(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const YE={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return GE("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):GE(n+1,2)},d:(e,t)=>GE(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)=>GE(e.getHours()%12||12,t.length),H:(e,t)=>GE(e.getHours(),t.length),m:(e,t)=>GE(e.getMinutes(),t.length),s:(e,t)=>GE(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return GE(Math.trunc(r*Math.pow(10,n-3)),t.length)}},QE="midnight",XE="noon",JE="morning",ZE="afternoon",ej="evening",tj="night",nj={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 YE.y(e,t)},Y:function(e,t,n,r){const o=HE(e,r),i=o>0?o:1-o;if("YY"===t){return GE(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):GE(i,t.length)},R:function(e,t){return GE(PE(e),t.length)},u:function(e,t){return GE(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 GE(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 GE(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 YE.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 GE(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=WE(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):GE(o,t.length)},I:function(e,t,n){const r=KE(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):GE(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):YE.d(e,t)},D:function(e,t,n){const r=BE(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):GE(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 GE(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 GE(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 GE(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?XE:0===r?QE: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?ej:r>=12?ZE:r>=4?JE:tj,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 YE.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):YE.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):GE(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):GE(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):YE.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):YE.s(e,t)},S:function(e,t){return YE.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return oj(r);case"XXXX":case"XX":return ij(r);default:return ij(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return oj(r);case"xxxx":case"xx":return ij(r);default:return ij(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rj(r,":");default:return"GMT"+ij(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rj(r,":");default:return"GMT"+ij(r,":")}},t:function(e,t,n){return GE(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return GE(e.getTime(),t.length)}};function rj(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+GE(i,2)}function oj(e,t){if(e%60==0){return(e>0?"-":"+")+GE(Math.abs(e)/60,2)}return ij(e,t)}function ij(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+GE(Math.trunc(r/60),2)+t+GE(r%60,2)}const sj=(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"})}},aj=(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"})}},lj={p:aj,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return sj(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}}",sj(r,t)).replace("{{time}}",aj(o,t))}},cj=/^D+$/,uj=/^Y+$/,dj=["D","DD","YY","YYYY"];const hj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pj=/^'([^]*?)'?$/,mj=/''/g,gj=/[a-zA-Z]/;function vj(e,t,n){const r=kE(),o=r.locale??VE,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=bE(e);if(!ME(a))throw new RangeError("Invalid time value");let l=t.match(fj).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,lj[t])(e,o.formatLong)}return e})).join("").match(hj).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:yj(e)};if(nj[t])return{isToken:!0,value:e};if(t.match(gj))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 uj.test(e)}(r)||function(e){return cj.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(dj.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,nj[r[0]])(a,r,o.localize,c)})).join("")}function yj(e){const t=e.match(pj);return t?t[1].replace(mj,"'"):e}function bj(e,t){return function(e,t,n){const r=kE(),o=n?.locale??r.locale??VE,i=DE(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=bE(t),l=bE(e)):(a=bE(e),l=bE(t));const c=AE(l,a),u=(_E(l)-_E(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<SE){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/SE),o.formatDistance("aboutXMonths",h,s);if(h=RE(l,a),h<12){const e=Math.round(d/SE);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 xE(e,Date.now())}(e),t)}function xj(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var wj="focusScope.autoFocusOnMount",Sj="focusScope.autoFocusOnUnmount",Cj={bubbles:!1,cancelable:!0},kj=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=cc(s),h=cc(a),f=i.useRef(null),p=Xl(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:Tj(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Tj(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Tj(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(wj,Cj);c.addEventListener(wj,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tj(r,{select:t}),document.activeElement!==n)return}((e=Ej(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Tj(c))}return()=>{c.removeEventListener(wj,d),setTimeout((()=>{const e=new CustomEvent(Sj,Cj);c.addEventListener(Sj,h),c.dispatchEvent(e),e.defaultPrevented||Tj(t??document.body,{select:!0}),c.removeEventListener(Sj,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=Ej(e),n=jj(t,e),r=jj(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&Tj(i,{select:!0})):(e.preventDefault(),r&&Tj(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(ac.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function Ej(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 jj(e,t){for(const n of e)if(!Pj(n,{upTo:t}))return n}function Pj(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 Tj(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()}}kj.displayName="FocusScope";var _j=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Nj(e,t),e.unshift(t)},remove(t){e=Nj(e,t),e[0]?.resume()}}}();function Nj(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Dj=0;function Mj(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Oj()),document.body.insertAdjacentElement("beforeend",e[1]??Oj()),Dj++,()=>{1===Dj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Dj--}}),[])}function Oj(){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 Rj=function(){return Rj=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},Rj.apply(this,arguments)};function Aj(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 Lj(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 Ij="right-scroll-bar-position",Fj="width-before-scroll-bar";function $j(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var qj="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,zj=new WeakMap;function Uj(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 $j(e,t)}))}));return qj((function(){var t=zj.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||$j(e,null)})),o.forEach((function(e){n.has(e)||$j(e,i)}))}zj.set(r,e)}),[e]),r}function Vj(e){return e}function Bj(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Vj);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=Rj({async:!0,ssr:!1},e),t}var Kj=function(e){var t=e.sideCar,n=Aj(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,Rj({},n))};function Hj(e,t){return e.useMedium(t),Kj}Kj.isSideCarExport=!0;var Wj=Bj(),Gj=function(){},Yj=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:Gj,onWheelCapture:Gj,onTouchMoveCapture:Gj}),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=Aj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=Uj([n,t]),C=Rj(Rj({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:Wj,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),Rj(Rj({},C),{ref:S})):i.createElement(y,Rj({},C,{className:c,ref:S}),l))}));Yj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yj.classNames={fullWidth:Fj,zeroRight:Ij};function Qj(){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 Xj=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Qj())&&(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)}}},Jj=function(){var e,t=(e=Xj(),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}},Zj={left:0,top:0,right:0,gap:0},eP=function(e){return parseInt(e||"",10)||0},tP=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Zj;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[eP(t["padding"===e?"paddingLeft":"marginLeft"]),eP(n),eP(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])}},nP=Jj(),rP="data-scroll-locked",oP=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(rP,"] {\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(Ij," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Fj," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Ij," .").concat(Ij," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Fj," .").concat(Fj," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(rP,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},iP=function(){var e=parseInt(document.body.getAttribute(rP)||"0",10);return isFinite(e)?e:0},sP=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(rP,(iP()+1).toString()),function(){var e=iP()-1;e<=0?document.body.removeAttribute(rP):document.body.setAttribute(rP,e.toString())}}),[]);var s=i.useMemo((function(){return tP(o)}),[o]);return i.createElement(nP,{styles:oP(s,!t,o,n?"":"!important")})},aP=!1;if("undefined"!=typeof window)try{var lP=Object.defineProperty({},"passive",{get:function(){return aP=!0,!0}});window.addEventListener("test",lP,lP),window.removeEventListener("test",lP,lP)}catch(kY){aP=!1}var cP=!!aP&&{passive:!1},uP=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])},dP=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),hP(e,r)){var o=fP(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hP=function(e,t){return"v"===e?function(e){return uP(e,"overflowY")}(t):function(e){return uP(e,"overflowX")}(t)},fP=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},pP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mP=function(e){return[e.deltaX,e.deltaY]},gP=function(e){return e&&"current"in e?e.current:e},vP=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yP=0,bP=[];function xP(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wP=Hj(Wj,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(yP++)[0],s=i.useState(Jj)[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=Lj([e.lockRef.current],(e.shards||[]).map(gP),!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=pP(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=dP(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=dP(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,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var f=fP(e,a),p=f[0],m=f[1]-f[2]-i*p;(p||m)&&hP(e,a)&&(d+=m,h+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(h)<1)&&o||(c=!0),c}(f,t,e,"h"===f?l:c,!0)}),[]),c=i.useCallback((function(e){var n=e;if(bP.length&&bP[bP.length-1]===s){var r="deltaY"in n?mP(n):pP(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(gP).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:xP(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=pP(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,mP(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,pP(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return bP.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,cP),document.addEventListener("touchmove",c,cP),document.addEventListener("touchstart",d,cP),function(){bP=bP.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,cP),document.removeEventListener("touchmove",c,cP),document.removeEventListener("touchstart",d,cP)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:vP(o)}):null,p?i.createElement(sP,{gapMode:e.gapMode}):null)}));var SP=i.forwardRef((function(e,t){return i.createElement(Yj,Rj({},e,{ref:t,sideCar:wP}))}));SP.classNames=Yj.classNames;var CP=new WeakMap,kP=new WeakMap,EP={},jP=0,PP=function(e){return e&&(e.host||PP(e.parentNode))},TP=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=PP(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);EP[n]||(EP[n]=new WeakMap);var i=EP[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=(CP.get(e)||0)+1,c=(i.get(e)||0)+1;CP.set(e,l),i.set(e,c),s.push(e),1===l&&o&&kP.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(SY){}}))};return u(t),a.clear(),jP++,function(){s.forEach((function(e){var t=CP.get(e)-1,o=i.get(e)-1;CP.set(e,t),i.set(e,o),t||(kP.has(e)||e.removeAttribute(r),kP.delete(e)),o||e.removeAttribute(n)})),--jP||(CP=new WeakMap,CP=new WeakMap,kP=new WeakMap,EP={})}},_P=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]"))),TP(r,o,n,"aria-hidden")):function(){return null}},NP=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(OP);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(DP,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(DP,{...o,ref:n,children:r})}));NP.displayName="Slot";var DP=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,{...RP(r,n.props),ref:t?Ql(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));DP.displayName="SlotClone";var MP=({children:e})=>t.jsx(t.Fragment,{children:e});function OP(e){return i.isValidElement(e)&&e.type===MP}function RP(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}}var AP="Dialog",[LP,IP]=Zl(AP),[FP,$P]=LP(AP),qP=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]=jc({prop:o,defaultProp:s,onChange:a});return t.jsx(FP,{scope:n,triggerRef:c,contentRef:u,contentId:$S(),titleId:$S(),descriptionId:$S(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};qP.displayName=AP;var zP="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(zP,r),s=Xl(n,i.triggerRef);return t.jsx(ac.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sT(i.open),...o,ref:s,onClick:xj(e.onClick,i.onOpenToggle)})})).displayName=zP;var UP="DialogPortal",[VP,BP]=LP(UP,{forceMount:void 0}),KP=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=$P(UP,n);return t.jsx(VP,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(kc,{present:r||a.open,children:t.jsx(Cc,{asChild:!0,container:s,children:e})})))})};KP.displayName=UP;var HP="DialogOverlay",WP=i.forwardRef(((e,n)=>{const r=BP(HP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=$P(HP,e.__scopeDialog);return s.modal?t.jsx(kc,{present:o||s.open,children:t.jsx(GP,{...i,ref:n})}):null}));WP.displayName=HP;var GP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(HP,r);return t.jsx(SP,{as:NP,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(ac.div,{"data-state":sT(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),YP="DialogContent",QP=i.forwardRef(((e,n)=>{const r=BP(YP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=$P(YP,e.__scopeDialog);return t.jsx(kc,{present:o||s.open,children:t.jsx(s.modal?XP:JP,{...i,ref:n})})}));QP.displayName=YP;var XP=i.forwardRef(((e,n)=>{const r=$P(YP,e.__scopeDialog),o=i.useRef(null),s=Xl(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(ZP,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xj(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:xj(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:xj(e.onFocusOutside,(e=>e.preventDefault()))})})),JP=i.forwardRef(((e,n)=>{const r=$P(YP,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(ZP,{...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()}})})),ZP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=$P(YP,r),u=i.useRef(null),d=Xl(n,u);return Mj(),t.jsxs(t.Fragment,{children:[t.jsx(kj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(gc,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":sT(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(uT,{titleId:c.titleId}),t.jsx(dT,{contentRef:u,descriptionId:c.descriptionId})]})]})})),eT="DialogTitle",tT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(eT,r);return t.jsx(ac.h2,{id:i.titleId,...o,ref:n})}));tT.displayName=eT;var nT="DialogDescription",rT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(nT,r);return t.jsx(ac.p,{id:i.descriptionId,...o,ref:n})}));rT.displayName=nT;var oT="DialogClose",iT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(oT,r);return t.jsx(ac.button,{type:"button",...o,ref:n,onClick:xj(e.onClick,(()=>i.onOpenChange(!1)))})}));function sT(e){return e?"open":"closed"}iT.displayName=oT;var aT="DialogTitleWarning",[lT,cT]=Jl(aT,{contentName:YP,titleName:eT,docsSlug:"dialog"}),uT=({titleId:e})=>{const t=cT(aT);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},dT=({contentRef:e,descriptionId:t})=>{const n=cT("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},hT=qP,fT=KP,pT=WP,mT=QP,gT=tT,vT=rT,yT=iT,bT=["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?kx: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}}),{}),xT=i.forwardRef(((e,n)=>t.jsx(bT.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}})));xT.displayName="VisuallyHidden";const wT=hT,ST=({...e})=>t.jsx(fT,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),CT=i.forwardRef((({className:e,...n},r)=>t.jsx(pT,{ref:r,className:jS("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));CT.displayName=pT.displayName;const kT=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(ST,{children:[t.jsx(CT,{}),t.jsxs(mT,{ref:i,className:jS("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(yT,{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(od,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));kT.displayName=mT.displayName;const ET=({className:e,...n})=>t.jsx("div",{className:jS("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});ET.displayName="DialogHeader";const jT=i.forwardRef((({className:e,...n},r)=>t.jsx(gT,{ref:r,className:jS("text-lg font-semibold leading-none tracking-tight",e),...n})));jT.displayName=gT.displayName;const PT=i.forwardRef((({className:e,...n},r)=>t.jsx(vT,{ref:r,className:jS("text-sm text-muted-foreground",e),...n})));PT.displayName=vT.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(xT,{ref:o,className:jS(e),...r,children:n}))).displayName="DialogVisuallyHidden";const TT=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Xd("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})));TT.displayName="Input";const _T=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Xd("w-full caption-bottom text-sm",e),...n})})));_T.displayName="Table";const NT=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Xd("[&_tr]:border-b",e),...n})));NT.displayName="TableHeader";const DT=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Xd("[&_tr:last-child]:border-0",e),...n})));DT.displayName="TableBody";const MT=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Xd("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));MT.displayName="TableRow";const OT=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Xd("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));OT.displayName="TableHead";const RT=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Xd("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));RT.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Xd("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const AT=({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(kY){v(kY instanceof Error?kY.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:Xd(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(_T,{children:[t.jsx(NT,{children:t.jsx(MT,{children:e.map((e=>t.jsx(OT,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(DT,{children:l.map(((n,r)=>t.jsx(MT,{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(RT,{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})]})},LT="reach-styles-module__container___6PQqs",IT=bu(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),FT=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Xd(IT({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));FT.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(LT,e),...n}))).displayName="BadgeContainer";const $T=({status:e})=>{switch(e){case wx.DRAFT:return t.jsx(FT,{variant:"secondary",children:"Draft"});case wx.ACTIVE:return t.jsx(FT,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case wx.RUNNING:return t.jsx(FT,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case wx.COMPLETED:return t.jsx(FT,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case wx.FAILED:return t.jsx(FT,{variant:"destructive",children:"Failed"});case wx.DEACTIVATED:return t.jsx(FT,{variant:"destructive",children:"Cancelled"});default:Ix(e,wx)}},qT=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=Wl(),c=zw(),[u,d]=n.useState(!1),h=e=>t.jsx($T,{status:e}),f=e=>{let n="bg-gray-400";switch(e){case wx.ACTIVE:n="bg-green-500";break;case wx.DRAFT:n="bg-gray-400";break;case wx.DEACTIVATED:n="bg-red-500";break;case wx.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},p=n=>t.jsx(AT,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[f(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),h(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(Sx.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(Sx.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?bj(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const r=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 pa(`${ux}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:o||void 0});return{items:r.data,cursor:r.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"}),m=[{id:"all",label:"All",content:p()},{id:"active",label:"Active",content:p("active")},{id:"draft",label:"Drafts",content:p("draft")}];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Gu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(TT,{placeholder:"Search automations...",value:o,onChange:e=>i(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(_x,{variant:"outline",onClick:()=>d(!0),children:[t.jsx(Wu,{}),"Create New Automation"]})})]}),t.jsx(PS,{tabs:m,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(wT,{open:u,onOpenChange:d,children:t.jsx(kT,{hideCloseButton:!0,children:t.jsx(Vx,{onClose:e=>{"error"===e?(l({title:"Error creating automation",description:"Please try again",variant:"destructive"}),d(!1)):!1===e?d(!1):c(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)},iconDefinitions:r})})})]})},zT=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 pa(`${cx}${t.toString()?`?${t.toString()}`:""}`)).data};var UT=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(UT||{}),VT=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(VT||{}),BT=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(BT||{});const KT=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(cx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await pa(`${cx}/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}},HT=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await pa(`${cx}/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]})}}},WT=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await pa(`${cx}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},GT=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await pa(`${cx}/${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}};var YT=i.forwardRef(((e,n)=>t.jsx(ac.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));YT.displayName="Label";var QT=YT;const XT=bu("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),JT=i.forwardRef((({className:e,...n},r)=>t.jsx(QT,{ref:r,className:Xd(XT(),e),...n})));JT.displayName=QT.displayName;const ZT={[BT.EQUALS]:"Equals",[BT.NOT_EQUALS]:"Not Equals",[BT.GREATER_THAN]:"Greater Than",[BT.LESS_THAN]:"Less Than",[BT.EXISTS]:"Exists"},e_={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"};var t_=.999,n_=/[\\\/_+.#"@\[\(\{&]/,r_=/[\\\/_+.#"@\[\(\{&]/g,o_=/[\s-]/,i_=/[\s-]/g;function s_(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=s_(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:n_.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(r_))&&o>0&&(l*=Math.pow(t_,u.length))):o_.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(i_))&&o>0&&(l*=Math.pow(t_,d.length))):(l*=.17,o>0&&(l*=Math.pow(t_,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=s_(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 a_(e){return e.toLowerCase().replace(i_," ")}function l_(e,t,n){return s_(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,a_(e),a_(t),0,0,{})}var c_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(h_);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(u_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(u_,{...o,ref:n,children:r})}));c_.displayName="Slot";var u_=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?Ql(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));u_.displayName="SlotClone";var d_=({children:e})=>t.jsx(t.Fragment,{children:e});function h_(e){return i.isValidElement(e)&&e.type===d_}var f_=["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?c_: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 p_,m_="dismissableLayer.update",g_="dismissableLayer.pointerDownOutside",v_="dismissableLayer.focusOutside",y_=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b_=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(y_),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Xl(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=cc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){w_(g_,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=cc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){w_(v_,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 uc((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&&(p_=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),x_(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=p_)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),x_())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(m_,e),()=>document.removeEventListener(m_,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Gl(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Gl(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Gl(e.onPointerDownCapture,C.onPointerDownCapture)})}));b_.displayName="DismissableLayer";function x_(){const e=new CustomEvent(m_);document.dispatchEvent(e)}function w_(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(y_),o=i.useRef(null),s=Xl(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var S_="focusScope.autoFocusOnMount",C_="focusScope.autoFocusOnUnmount",k_={bubbles:!1,cancelable:!0},E_=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=cc(s),h=cc(a),f=i.useRef(null),p=Xl(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:__(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||__(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&__(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){N_.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(S_,k_);c.addEventListener(S_,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(__(r,{select:t}),document.activeElement!==n)return}((e=j_(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&__(c))}return()=>{c.removeEventListener(S_,d),setTimeout((()=>{const e=new CustomEvent(C_,k_);c.addEventListener(C_,h),c.dispatchEvent(e),e.defaultPrevented||__(t??document.body,{select:!0}),c.removeEventListener(C_,h),N_.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=j_(e),n=P_(t,e),r=P_(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&__(i,{select:!0})):(e.preventDefault(),r&&__(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(f_.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function j_(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 P_(e,t){for(const n of e)if(!T_(n,{upTo:t}))return n}function T_(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 __(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()}}E_.displayName="FocusScope";var N_=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=D_(e,t),e.unshift(t)},remove(t){e=D_(e,t),e[0]?.resume()}}}();function D_(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var M_=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);Sc((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(f_.div,{...s,ref:n}),c):null}));M_.displayName="Portal";var O_=Bj(),R_=function(){},A_=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:R_,onWheelCapture:R_,onTouchMoveCapture:R_}),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=Aj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=Uj([n,t]),C=Rj(Rj({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:O_,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),Rj(Rj({},C),{ref:S})):i.createElement(y,Rj({},C,{className:c,ref:S}),l))}));A_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},A_.classNames={fullWidth:Fj,zeroRight:Ij};var L_=!1;if("undefined"!=typeof window)try{var I_=Object.defineProperty({},"passive",{get:function(){return L_=!0,!0}});window.addEventListener("test",I_,I_),window.removeEventListener("test",I_,I_)}catch(kY){L_=!1}var F_=!!L_&&{passive:!1},$_=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])},q_=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),z_(e,r)){var o=U_(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},z_=function(e,t){return"v"===e?function(e){return $_(e,"overflowY")}(t):function(e){return $_(e,"overflowX")}(t)},U_=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},V_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},B_=function(e){return[e.deltaX,e.deltaY]},K_=function(e){return e&&"current"in e?e.current:e},H_=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},W_=0,G_=[];function Y_(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Q_=Hj(O_,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(W_++)[0],s=i.useState(Jj)[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=Lj([e.lockRef.current],(e.shards||[]).map(K_),!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=V_(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=q_(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=q_(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,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var f=U_(e,a),p=f[0],m=f[1]-f[2]-i*p;(p||m)&&z_(e,a)&&(d+=m,h+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(h)<1)&&o||(c=!0),c}(f,t,e,"h"===f?l:c,!0)}),[]),c=i.useCallback((function(e){var n=e;if(G_.length&&G_[G_.length-1]===s){var r="deltaY"in n?B_(n):V_(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(K_).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:Y_(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=V_(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,B_(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,V_(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return G_.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,F_),document.addEventListener("touchmove",c,F_),document.addEventListener("touchstart",d,F_),function(){G_=G_.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,F_),document.removeEventListener("touchmove",c,F_),document.removeEventListener("touchstart",d,F_)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:H_(o)}):null,p?i.createElement(sP,{gapMode:e.gapMode}):null)}));var X_=i.forwardRef((function(e,t){return i.createElement(A_,Rj({},e,{ref:t,sideCar:Q_}))}));X_.classNames=A_.classNames;var J_="Dialog",[Z_,eN]=Zl(J_),[tN,nN]=Z_(J_),rN=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]=jc({prop:o,defaultProp:s,onChange:a});return t.jsx(tN,{scope:n,triggerRef:c,contentRef:u,contentId:$S(),titleId:$S(),descriptionId:$S(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};rN.displayName=J_;var oN="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(oN,r),s=Xl(n,i.triggerRef);return t.jsx(f_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xN(i.open),...o,ref:s,onClick:Gl(e.onClick,i.onOpenToggle)})})).displayName=oN;var iN="DialogPortal",[sN,aN]=Z_(iN,{forceMount:void 0}),lN=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=nN(iN,n);return t.jsx(sN,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(kc,{present:r||a.open,children:t.jsx(M_,{asChild:!0,container:s,children:e})})))})};lN.displayName=iN;var cN="DialogOverlay",uN=i.forwardRef(((e,n)=>{const r=aN(cN,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nN(cN,e.__scopeDialog);return s.modal?t.jsx(kc,{present:o||s.open,children:t.jsx(dN,{...i,ref:n})}):null}));uN.displayName=cN;var dN=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(cN,r);return t.jsx(X_,{as:c_,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(f_.div,{"data-state":xN(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),hN="DialogContent",fN=i.forwardRef(((e,n)=>{const r=aN(hN,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nN(hN,e.__scopeDialog);return t.jsx(kc,{present:o||s.open,children:t.jsx(s.modal?pN:mN,{...i,ref:n})})}));fN.displayName=hN;var pN=i.forwardRef(((e,n)=>{const r=nN(hN,e.__scopeDialog),o=i.useRef(null),s=Xl(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(gN,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gl(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Gl(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Gl(e.onFocusOutside,(e=>e.preventDefault()))})})),mN=i.forwardRef(((e,n)=>{const r=nN(hN,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(gN,{...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()}})})),gN=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=nN(hN,r),u=i.useRef(null),d=Xl(n,u);return Mj(),t.jsxs(t.Fragment,{children:[t.jsx(E_,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(b_,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":xN(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(EN,{titleId:c.titleId}),t.jsx(jN,{contentRef:u,descriptionId:c.descriptionId})]})]})})),vN="DialogTitle";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(vN,r);return t.jsx(f_.h2,{id:i.titleId,...o,ref:n})})).displayName=vN;var yN="DialogDescription";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(yN,r);return t.jsx(f_.p,{id:i.descriptionId,...o,ref:n})})).displayName=yN;var bN="DialogClose";function xN(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(bN,r);return t.jsx(f_.button,{type:"button",...o,ref:n,onClick:Gl(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=bN;var wN,SN="DialogTitleWarning",[CN,kN]=Jl(SN,{contentName:hN,titleName:vN,docsSlug:"dialog"}),EN=({titleId:e})=>{const t=kN(SN);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},jN=({contentRef:e,descriptionId:t})=>{const n=kN("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},PN=rN,TN=lN,_N=uN,NN=fN,DN={exports:{}},MN={};var ON,RN={};
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 Kx=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Hx=/^[\u0021-\u003A\u003C-\u007E]*$/,Wx=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Gx=/^[\u0020-\u003A\u003D-\u007E]*$/,Yx=Object.prototype.toString,Qx=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Xx(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Jx(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Zx(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(SY){return e}}function ew(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?iw(t):t,state:n,key:t&&t.key||r||rw()};return o}(t?c().pathname:"/",e,n,r);return nw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:ow(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?iw(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function tw(e,t){if(!1===e||null==e)throw new Error(t)}function nw(e,t){if(!e)try{throw new Error(t)}catch(SY){}}function rw(){return Math.random().toString(36).substring(2,10)}function ow({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 iw(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 sw(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?iw(t):t,i=xw(o.pathname||"/",n);if(null==i)return null;let s=aw(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=bw(i);a=vw(s[l],e,r)}return a}(e,t,n,!1)}function aw(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("/")&&(tw(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=kw([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(tw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),aw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:gw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of lw(e.path))o(e,t,n);else o(e,t)})),t}function lw(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=lw(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 cw=/^:[\w-]+$/,uw=3,dw=2,hw=1,fw=10,pw=-2,mw=e=>"*"===e;function gw(e,t){let n=e.split("/"),r=n.length;return n.some(mw)&&(r+=pw),t&&(r+=dw),n.filter((e=>!mw(e))).reduce(((e,t)=>e+(cw.test(t)?uw:""===t?hw:fw)),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=yw({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=yw({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:kw([i,u.pathname]),pathnameBase:Ew(kw([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=kw([i,u.pathnameBase]))}return s}function yw(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){nw("*"===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 bw(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return nw(!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 xw(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 ww(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 Sw(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 Cw(e,t,n,r=!1){let o;"string"==typeof e?o=iw(e):(o={...e},tw(!o.pathname||!o.pathname.includes("?"),ww("?","pathname","search",o)),tw(!o.pathname||!o.pathname.includes("#"),ww("#","pathname","hash",o)),tw(!o.search||!o.search.includes("#"),ww("#","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?iw(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:jw(r),hash:Pw(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var kw=e=>e.join("/").replace(/\/\/+/g,"/"),Ew=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jw=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Pw=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var Tw=["POST","PUT","PATCH","DELETE"];new Set(Tw);var _w=["GET",...Tw];new Set(_w);var Nw=i.createContext(null);Nw.displayName="DataRouter";var Dw=i.createContext(null);Dw.displayName="DataRouterState";var Mw=i.createContext({isTransitioning:!1});Mw.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var Ow=i.createContext(null);Ow.displayName="Navigation";var Rw=i.createContext(null);Rw.displayName="Location";var Aw=i.createContext({outlet:null,matches:[],isDataRoute:!1});Aw.displayName="Route";var Lw=i.createContext(null);function Iw(){return null!=i.useContext(Rw)}function Fw(){return tw(Iw(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(Rw).location}Lw.displayName="RouteError";var $w="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qw(e){i.useContext(Ow).static||i.useLayoutEffect(e)}function zw(){let{isDataRoute:e}=i.useContext(Aw);return e?function(){let{router:e}=function(e){let t=i.useContext(Nw);return tw(t,Gw(e)),t}("useNavigate"),t=Yw("useNavigate"),n=i.useRef(!1);return qw((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{nw(n.current,$w),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){tw(Iw(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(Nw),{basename:t,navigator:n}=i.useContext(Ow),{matches:r}=i.useContext(Aw),{pathname:o}=Fw(),s=JSON.stringify(Sw(r)),a=i.useRef(!1);return qw((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(nw(a.current,$w),!a.current)return;if("number"==typeof r)return void n.go(r);let l=Cw(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:kw([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function Uw(e,{relative:t}={}){let{matches:n}=i.useContext(Aw),{pathname:r}=Fw(),o=JSON.stringify(Sw(n));return i.useMemo((()=>Cw(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function Vw(e,t,n,r){tw(Iw(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(Ow),{matches:a}=i.useContext(Aw),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||"";Xw(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=Fw();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=sw(e,{pathname:p});nw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),nw(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]));tw(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||Kw,s&&(a<0&&0===c?(Xw("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(Ww,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(Hw,{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:kw([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:kw([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function Bw(){let e=function(){let e=i.useContext(Lw),t=function(e){let t=i.useContext(Dw);return tw(t,Gw(e)),t}("useRouteError"),n=Yw("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 Kw=i.createElement(Bw,null),Hw=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(Aw.Provider,{value:this.props.routeContext},i.createElement(Lw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ww({routeContext:e,match:t,children:n}){let r=i.useContext(Nw);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(Aw.Provider,{value:e},n)}function Gw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yw(e){let t=function(e){let t=i.useContext(Aw);return tw(t,Gw(e)),t}(e),n=t.matches[t.matches.length-1];return tw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var Qw={};function Xw(e,t,n){t||Qw[e]||(Qw[e]=!0,nw(!1,n))}function Jw({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=ew({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(Zw,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function Zw({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){tw(!Iw(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=iw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=xw(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return nw(null!=p,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==p?null:i.createElement(Ow.Provider,{value:l},i.createElement(Rw.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return Vw(e,0,n,t)}));var eS="get",tS="application/x-www-form-urlencoded";function nS(e){return null!=e&&"string"==typeof e.tagName}function rS(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 oS=null;var iS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sS(e){return null==e||iS.has(e)?e:(nw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tS}"`),null)}function aS(e,t){let n,r,o,i,s;if(function(e){return nS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?xw(s,t):null,n=e.getAttribute("method")||eS,o=sS(e.getAttribute("enctype"))||tS,i=new FormData(e)}else if(function(e){return nS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return nS(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?xw(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||eS,o=sS(e.getAttribute("formenctype"))||sS(s.getAttribute("enctype"))||tS,i=new FormData(s,e),!function(){if(null===oS)try{new FormData(document.createElement("form"),0),oS=!1}catch(SY){oS=!0}return oS}()){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(nS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=eS,r=null,o=tS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function lS(e,t){if(!1===e||null==e)throw new Error(t)}function cS(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 uS(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(cS).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function dS(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 hS(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 pS(){let e=i.useContext(fS);return lS(e,"You must render this element inside a <HydratedRouter> element"),e}function mS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function gS({page:e,...t}){let{router:n}=function(){let e=i.useContext(Nw);return lS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>sw(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(vS,{page:e,matches:r,...t}):null}function vS({page:e,matches:t,...n}){let r=Fw(),{manifest:o,routeModules:s}=pS(),{loaderData:a,matches:l}=function(){let e=i.useContext(Dw);return lS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>dS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>dS(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((()=>hS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=pS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return uS(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 yS(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}fS.displayName="FrameworkContext";var bS="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{bS&&(window.__reactRouterVersion="7.1.0")}catch(SY){}var xS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wS=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(Ow),g="string"==typeof c&&xS.test(c),v=!1;if("string"==typeof c&&g&&(p=c,bS))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=xw(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(SY){nw(!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}={}){tw(Iw(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(Ow),{hash:o,pathname:s,search:a}=Uw(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:kw([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:mS(l,p),onBlur:mS(c,m),onMouseEnter:mS(u,p),onMouseLeave:mS(d,m),onTouchStart:mS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=zw(),c=Fw(),u=Uw(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:ow(c)===ow(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:yS(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(gS,{page:y})):C}));function SS(e){let t=i.useContext(Nw);return tw(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 CS(e){nw("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(rS(e)),n=i.useRef(!1),r=Fw(),o=i.useMemo((()=>function(e,t){let n=rS(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=zw(),a=i.useCallback(((e,t)=>{const r=rS("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}wS.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=Uw(s,{relative:c.relative}),h=Fw(),f=i.useContext(Dw),{navigator:p,basename:m}=i.useContext(Ow),g=null!=f&&function(e,t={}){let n=i.useContext(Mw);tw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=SS("useViewTransitionState"),o=Uw(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=xw(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=xw(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=yw(o.pathname,a)||null!=yw(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=xw(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(wS,{...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}=SS("useSubmit"),{basename:t}=i.useContext(Ow),n=Yw("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=aS(r,t);if(!1===o.navigate){let t=o.fetcherKey||ES();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(Ow),r=i.useContext(Aw);tw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Uw(e||".",{relative:t})},a=Fw();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:kw([n,s.pathname]));return ow(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&xS.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 kS=0,ES=()=>`__${String(++kS)}__`;function jS(...e){return ju(Hl(e))}new TextEncoder;const PS=({tabs:e,activeTab:r,onTabChange:o,tabsLocation:i="left",secondaryTabs:s=!1})=>{const a=n.useRef([]),[l,c]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=a.current[e.findIndex((e=>e.id===r))];t&&c({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),t.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[t.jsx("div",{className:"flex items-center justify-between border-b",children:t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===i?"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:`${l.width}px`,left:`${l.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>a.current[n]=e,onClick:()=>o(e.id),className:jS("relative px-1 py-3 transition-all duration-200",r!==e.id&&"text-muted-foreground",s&&"text-sm"),children:e.label},e.id)))]})}),t.jsx("div",{className:"relative min-h-40",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-[-8%]":"translate-x-[8%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})},TS="flex flex-col items-center justify-center h-full";var _S,NS="dismissableLayer.update",DS="dismissableLayer.pointerDownOutside",MS="dismissableLayer.focusOutside",OS=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RS=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(OS),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Pa(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=$a(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){LS(DS,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=$a(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){LS(MS,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 qa((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&&(_S=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),AS(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=_S)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),AS())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(NS,e),()=>document.removeEventListener(NS,e)}),[]),t.jsx(Ia.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ka(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ka(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ka(e.onPointerDownCapture,C.onPointerDownCapture)})}));RS.displayName="DismissableLayer";function AS(){const e=new CustomEvent(NS);document.dispatchEvent(e)}function LS(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?Fa(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(OS),o=i.useRef(null),s=Pa(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Ia.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var IS=i["useId".toString()]||(()=>{}),FS=0;function $S(e){const[t,n]=i.useState(IS());return Ja((()=>{n((e=>e??String(FS++)))}),[e]),t?`radix-${t}`:""}const qS=["top","right","bottom","left"],zS=Math.min,US=Math.max,VS=Math.round,BS=Math.floor,KS=e=>({x:e,y:e}),HS={left:"right",right:"left",bottom:"top",top:"bottom"},WS={start:"end",end:"start"};function GS(e,t,n){return US(e,zS(t,n))}function YS(e,t){return"function"==typeof e?e(t):e}function QS(e){return e.split("-")[0]}function XS(e){return e.split("-")[1]}function JS(e){return"x"===e?"y":"x"}function ZS(e){return"y"===e?"height":"width"}function eC(e){return["top","bottom"].includes(QS(e))?"y":"x"}function tC(e){return JS(eC(e))}function nC(e){return e.replace(/start|end/g,(e=>WS[e]))}function rC(e){return e.replace(/left|right|bottom|top/g,(e=>HS[e]))}function oC(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 iC(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 sC(e,t,n){let{reference:r,floating:o}=e;const i=eC(t),s=tC(t),a=ZS(s),l=QS(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(XS(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function aC(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}=YS(t,e),p=oC(f),m=a[h?"floating"===d?"reference":"floating":d],g=iC(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=iC(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 lC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cC(e){return qS.some((t=>e[t]>=0))}function uC(){return"undefined"!=typeof window}function dC(e){return pC(e)?(e.nodeName||"").toLowerCase():"#document"}function hC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fC(e){var t;return null==(t=(pC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function pC(e){return!!uC()&&(e instanceof Node||e instanceof hC(e).Node)}function mC(e){return!!uC()&&(e instanceof Element||e instanceof hC(e).Element)}function gC(e){return!!uC()&&(e instanceof HTMLElement||e instanceof hC(e).HTMLElement)}function vC(e){return!(!uC()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hC(e).ShadowRoot)}function yC(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function bC(e){return["table","td","th"].includes(dC(e))}function xC(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(SY){return!1}}))}function wC(e){const t=SC(),n=mC(e)?kC(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 SC(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function CC(e){return["html","body","#document"].includes(dC(e))}function kC(e){return hC(e).getComputedStyle(e)}function EC(e){return mC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jC(e){if("html"===dC(e))return e;const t=e.assignedSlot||e.parentNode||vC(e)&&e.host||fC(e);return vC(t)?t.host:t}function PC(e){const t=jC(e);return CC(t)?e.ownerDocument?e.ownerDocument.body:e.body:gC(t)&&yC(t)?t:PC(t)}function TC(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=PC(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=hC(o);if(i){const e=_C(s);return t.concat(s,s.visualViewport||[],yC(o)?o:[],e&&n?TC(e):[])}return t.concat(o,TC(o,[],n))}function _C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NC(e){const t=kC(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=gC(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=VS(n)!==i||VS(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function DC(e){return mC(e)?e:e.contextElement}function MC(e){const t=DC(e);if(!gC(t))return KS(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=NC(t);let s=(i?VS(n.width):n.width)/r,a=(i?VS(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const OC=KS(0);function RC(e){const t=hC(e);return SC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:OC}function AC(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=DC(e);let s=KS(1);t&&(r?mC(r)&&(s=MC(r)):s=MC(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==hC(e))&&t}(i,n,r)?RC(i):KS(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=hC(i),t=r&&mC(r)?hC(r):r;let n=e,o=_C(n);for(;o&&r&&t!==n;){const e=MC(o),t=o.getBoundingClientRect(),r=kC(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=hC(o),o=_C(n)}}return iC({width:u,height:d,x:l,y:c})}function LC(e,t){const n=EC(e).scrollLeft;return t?t.left+n:AC(fC(e)).left+n}function IC(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:LC(e,r)),y:r.top+t.scrollTop}}function FC(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=hC(e),r=fC(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=SC();(!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=fC(e),n=EC(e),r=e.ownerDocument.body,o=US(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=US(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+LC(e);const a=-n.scrollTop;return"rtl"===kC(r).direction&&(s+=US(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(fC(e));else if(mC(t))r=function(e,t){const n=AC(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=gC(e)?MC(e):KS(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=RC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return iC(r)}function $C(e,t){const n=jC(e);return!(n===t||!mC(n)||CC(n))&&("fixed"===kC(n).position||$C(n,t))}function qC(e,t,n){const r=gC(t),o=fC(t),i="fixed"===n,s=AC(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=KS(0);if(r||!r&&!i)if(("body"!==dC(t)||yC(o))&&(a=EC(t)),r){const e=AC(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=LC(o));const c=!o||r||i?KS(0):IC(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 zC(e){return"static"===kC(e).position}function UC(e,t){if(!gC(e)||"fixed"===kC(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fC(e)===n&&(n=n.ownerDocument.body),n}function VC(e,t){const n=hC(e);if(xC(e))return n;if(!gC(e)){let t=jC(e);for(;t&&!CC(t);){if(mC(t)&&!zC(t))return t;t=jC(t)}return n}let r=UC(e,t);for(;r&&bC(r)&&zC(r);)r=UC(r,t);return r&&CC(r)&&zC(r)&&!wC(r)?n:r||function(e){let t=jC(e);for(;gC(t)&&!CC(t);){if(wC(t))return t;if(xC(t))return null;t=jC(t)}return null}(e)||n}const BC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=fC(r),a=!!t&&xC(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=KS(1);const u=KS(0),d=gC(r);if((d||!d&&!i)&&(("body"!==dC(r)||yC(s))&&(l=EC(r)),gC(r))){const e=AC(r);c=MC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?KS(0):IC(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:fC,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?xC(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=TC(e,[],!1).filter((e=>mC(e)&&"body"!==dC(e))),o=null;const i="fixed"===kC(e).position;let s=i?jC(e):e;for(;mC(s)&&!CC(s);){const t=kC(s),n=wC(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||yC(s)&&!n&&$C(e,s))?r=r.filter((e=>e!==s)):o=t,s=jC(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=FC(t,n,o);return e.top=US(r.top,e.top),e.right=zS(r.right,e.right),e.bottom=zS(r.bottom,e.bottom),e.left=US(r.left,e.left),e}),FC(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:VC,getElementRects:async function(e){const t=this.getOffsetParent||VC,n=this.getDimensions,r=await n(e.floating);return{reference:qC(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}=NC(e);return{width:t,height:n}},getScale:MC,isElement:mC,isRTL:function(e){return"rtl"===kC(e).direction}};function KC(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=DC(e),u=o||i?[...c?TC(c):[],...TC(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=fC(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:-BS(u)+"px "+-BS(o.clientWidth-(c+d))+"px "+-BS(o.clientHeight-(u+h))+"px "+-BS(c)+"px",threshold:US(0,zS(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(SY){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?AC(e):null;return l&&function t(){const r=AC(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 HC=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=QS(n),a=XS(n),l="y"===eC(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=YS(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}}}}},WC=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}=YS(e,t),c={x:n,y:r},u=await aC(t,l),d=eC(QS(o)),h=JS(d);let f=c[h],p=c[d];if(i){f=GS(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=GS(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}}}}}},GC=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}=YS(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=QS(o),y=eC(a),b=QS(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[rC(a)]:function(e){const t=rC(e);return[nC(e),t,nC(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=XS(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[]}}(QS(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(nC)))),i}(a,m,p,x));const C=[a,...w],k=await aC(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=XS(e),o=tC(e),i=ZS(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=rC(s)),[s,rC(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 _;const e=null==(_=j.filter((e=>{if(S){const t=eC(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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},YC=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}=YS(e,t),u=await aC(t,c),d=QS(o),h=XS(o),f="y"===eC(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=zS(m-u[g],y),w=zS(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=US(u.left,0),t=US(u.right,0),n=US(u.top,0),r=US(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:US(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:US(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}}:{}}}},QC=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=YS(e,t);switch(r){case"referenceHidden":{const e=lC(await aC(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cC(e)}}}case"escaped":{const e=lC(await aC(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cC(e)}}}default:return{}}}}},XC=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}=YS(e,t)||{};if(null==c)return{};const d=oC(u),h={x:n,y:r},f=tC(o),p=ZS(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=zS(d[v],E),P=zS(d[y],E),T=j,_=C-m[p]-P,N=C/2-m[p]/2+k,D=GS(T,N,_),M=!l.arrow&&null!=XS(o)&&N!==D&&i.reference[p]/2-(N<T?j:P)-m[p]/2<0,O=M?N<T?N-T:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),JC=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}=YS(e,t),u={x:n,y:r},d=eC(o),h=JS(d);let f=u[h],p=u[d];const m=YS(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(QS(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}}}},ZC=(e,t,n)=>{const r={platform:BC,...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}=sC(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}=sC(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var ek="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function tk(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(!tk(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)&&!tk(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function nk(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rk(e,t){const n=nk(e);return Math.round(t*n)/n}function ok(e){const t=i.useRef(e);return ek((()=>{t.current=e})),t}const ik=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?XC({element:n.current,padding:r}).fn(t):{}:n?XC({element:n,padding:r}).fn(t):{}}}),sk=(e,t)=>({...WC(e),options:[e,t]}),ak=(e,t)=>({...JC(e),options:[e,t]}),lk=(e,t)=>({...GC(e),options:[e,t]}),ck=(e,t)=>({...YC(e),options:[e,t]}),uk=(e,t)=>({...QC(e),options:[e,t]}),dk=(e,t)=>({...ik(e),options:[e,t]});var hk=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(Ia.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"})})}));hk.displayName="Arrow";var fk=hk;function pk(e){const[t,n]=i.useState(void 0);return Ja((()=>{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}var mk="Popper",[gk,vk]=_a(mk),[yk,bk]=gk(mk),xk=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(yk,{scope:n,anchor:o,onAnchorChange:s,children:r})};xk.displayName=mk;var wk="PopperAnchor",Sk=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=bk(wk,r),l=i.useRef(null),c=Pa(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(Ia.div,{...s,ref:c})}));Sk.displayName=wk;var Ck="PopperContent",[kk,Ek]=gk(Ck),jk=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=bk(Ck,r),[x,w]=i.useState(null),S=Pa(n,(e=>w(e))),[C,k]=i.useState(null),E=pk(C),j=E?.width??0,P=E?.height??0,T=o+("center"!==l?"-"+l:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(h)?h:[h],D=N.length>0,M={padding:_,boundary:N.filter(Nk),altBoundary:D},{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);tk(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=ok(u),_=ok(o),N=ok(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),ZC(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!tk(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,_,N]);ek((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);ek((()=>(M.current=!0,()=>{M.current=!1})),[]),ek((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(T.current)return T.current(S,C,D);D()}}),[S,C,D,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=rk(R.floating,h.x),r=rk(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...nk(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:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>KC(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+P,alignmentAxis:c},{...HC(F),options:[F,$]}),d&&sk({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?ak():void 0,...M}),d&&lk({...M}),ck({...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&&dk({element:C,padding:u}),Dk({arrowWidth:j,arrowHeight:P}),m&&uk({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=Mk(A),U=$a(v);Ja((()=>{L&&U?.()}),[L,U]);const V=I.arrow?.x,B=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return Ja((()=>{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(kk,{scope:r,placedSide:q,onArrowChange:k,arrowX:V,arrowY:B,shouldHideArrow:K,children:t.jsx(Ia.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));jk.displayName=Ck;var Pk="PopperArrow",Tk={top:"bottom",right:"left",bottom:"top",left:"right"},_k=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=Ek(Pk,r),s=Tk[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(fk,{...o,ref:n,style:{...o.style,display:"block"}})})}));function Nk(e){return null!==e}_k.displayName=Pk;var Dk=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]=Mk(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 Mk(e){const[t,n="center"]=e.split("-");return[t,n]}var Ok=xk,Rk=Sk,Ak=jk,Lk=_k,[Ik,Fk]=_a("Tooltip",[vk]),$k=vk(),qk="TooltipProvider",zk=700,Uk="tooltip.open",[Vk,Bk]=Ik(qk),Kk=e=>{const{__scopeTooltip:n,delayDuration:r=zk,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(Vk,{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})};Kk.displayName=qk;var Hk="Tooltip",[Wk,Gk]=Ik(Hk),Yk=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=Bk(Hk,e.__scopeTooltip),d=$k(n),[h,f]=i.useState(null),p=$S(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=nl({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Uk))):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(Ok,{...d,children:t.jsx(Wk,{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})})};Yk.displayName=Hk;var Qk="TooltipTrigger",Xk=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=Gk(Qk,r),a=Bk(Qk,r),l=$k(r),c=Pa(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(Rk,{asChild:!0,...l,children:t.jsx(Ia.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:ka(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:ka(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:ka(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:ka(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:ka(e.onBlur,s.onClose),onClick:ka(e.onClick,s.onClose)})})}));Xk.displayName=Qk;var Jk="TooltipPortal",[Zk,eE]=Ik(Jk,{forceMount:void 0}),tE=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=Gk(Jk,n);return t.jsx(Zk,{scope:n,forceMount:r,children:t.jsx(el,{present:r||s.open,children:t.jsx(Za,{asChild:!0,container:i,children:o})})})};tE.displayName=Jk;var nE="TooltipContent",rE=i.forwardRef(((e,n)=>{const r=eE(nE,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=Gk(nE,e.__scopeTooltip);return t.jsx(el,{present:o||a.open,children:t.jsx(a.disableHoverableContent?aE:oE,{side:i,...s,ref:n})})})),oE=i.forwardRef(((e,n)=>{const r=Gk(nE,e.__scopeTooltip),o=Bk(nE,e.__scopeTooltip),s=i.useRef(null),a=Pa(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(aE,{...e,ref:a})})),[iE,sE]=Ik(Hk,{isInside:!1}),aE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=Gk(nE,r),d=$k(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(Uk,h),()=>document.removeEventListener(Uk,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(RS,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(Ak,{"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(Oa,{children:o}),t.jsx(iE,{scope:r,isInside:!0,children:t.jsx(ol,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));rE.displayName=nE;var lE="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=$k(r);return sE(lE,r).isInside?null:t.jsx(Lk,{...i,...o,ref:n})})).displayName=lE;var cE=tE,uE=rE;const dE=Kk,hE=Yk,fE=Xk,pE=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(cE,{children:t.jsx(uE,{ref:o,sideOffset:n,className:Pu("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})})));pE.displayName=uE.displayName;const mE=({title:e,alertText:n,Icon:r=fc,onClick:o})=>t.jsx(dE,{children:t.jsxs(hE,{children:[t.jsx(fE,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(pE,{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})]})})]})}),gE=({icon:e,title:n,value:r,tooltipText:o})=>t.jsx("div",{className:"flex items-center bg-white rounded p-3 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md",children:t.jsxs("div",{className:"flex items-start text-sm leading-none gap-3",children:[t.jsx("div",{className:"rounded-lg p-2 bg-gray-100",children:e}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-center text-muted-foreground gap-1",children:[t.jsx("span",{className:"text-[11px]",children:n}),t.jsx(mE,{title:o})]}),t.jsx("span",{children:r})]})]})}),vE=({activeTab:e,statistics:n,iconDefinitions:r})=>{const o={email:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"Emails Sent",value:n.email.numberSent,tooltipText:"Total number of emails that were successfully sent in this campaign"},{icon:t.jsx(r.OpenRate,{className:"w-4 h-4"}),title:"Open Rate",value:`${n.email.openPercentage.toFixed(2)}%`,tooltipText:"Percentage of recipients who opened the email out of total emails delivered"},{icon:t.jsx(r.TotalBounceRate,{className:"w-4 h-4"}),title:"Total Bounce Rate",value:`${(n.email.softBounceRate+n.email.hardBounceRate).toFixed(2)}%`,tooltipText:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"},{icon:t.jsx(r.LinksClicked,{className:"w-4 h-4"}),title:"Links Clicked",value:n.email.linksClicked,tooltipText:"Total number of times recipients clicked on links within the email"},{icon:t.jsx(r.SpamComplies,{className:"w-4 h-4"}),title:"Spam Complaints",value:`${n.email.spamComplaintRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who marked this email as spam"},{icon:t.jsx(r.UnsubscribeRate,{className:"w-4 h-4"}),title:"Unsubscribe Rate",value:`${n.email.unsubscribedRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who unsubscribed after receiving this email"}],sms:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"SMS Sent",value:n.sms.numberSent,tooltipText:"Total number of SMS messages that were successfully sent in this campaign"}]};return t.jsx("div",{className:"grid gap-2 transition-all duration-300 grid-cols-3",children:o[e].map(((e,n)=>t.jsx(gE,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},yE=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=bx(e);if(a||!s)return t.jsx("div",{className:TS,children:t.jsx(lx,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(PS,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(vE,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(vE,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function bE(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 xE(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const wE=6048e5,SE=43200;let CE={};function kE(){return CE}function EE(e,t){const n=kE(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=bE(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 jE(e){return EE(e,{weekStartsOn:1})}function PE(e){const t=bE(e),n=t.getFullYear(),r=xE(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=jE(r),i=xE(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=jE(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function TE(e){const t=bE(e);return t.setHours(0,0,0,0),t}function _E(e){const t=bE(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 NE(e,t){return function(e,t){return xE(e,+bE(e)+t)}(e,6e4*t)}function DE(e,t){const n=bE(e),r=bE(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function ME(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=bE(e);return!isNaN(Number(n))}function OE(e){const t=bE(e);return+function(e){const t=bE(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=bE(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function RE(e,t){const n=bE(e),r=bE(t),o=DE(n,r),i=Math.abs(function(e,t){const n=bE(e),r=bE(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=DE(n,r)===-o;OE(bE(e))&&1===i&&1===DE(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function AE(e,t,n){const r=function(e,t){return+bE(e)-+bE(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 LE={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 IE(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const FE={date:IE({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:IE({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:IE({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$E={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function qE(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 zE(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 UE;const VE={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=LE[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:FE,formatRelative:(e,t,n,r)=>$E[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:qE({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:qE({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:qE({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:qE({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:qE({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:(UE={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(UE.matchPattern);if(!n)return null;const r=n[0],o=e.match(UE.parsePattern);if(!o)return null;let i=UE.valueCallback?UE.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:zE({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:zE({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:zE({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:zE({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:zE({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 BE(e){const t=bE(e),n=function(e,t){const n=TE(e),r=TE(t),o=+n-_E(n),i=+r-_E(r);return Math.round((o-i)/864e5)}(t,function(e){const t=bE(e),n=xE(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function KE(e){const t=bE(e),n=+jE(t)-+function(e){const t=PE(e),n=xE(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),jE(n)}(t);return Math.round(n/wE)+1}function HE(e,t){const n=bE(e),r=n.getFullYear(),o=kE(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=xE(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=EE(s,t),l=xE(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=EE(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function WE(e,t){const n=bE(e),r=+EE(n,t)-+function(e,t){const n=kE(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=HE(e,t),i=xE(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),EE(i,t)}(n,t);return Math.round(r/wE)+1}function GE(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const YE={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return GE("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):GE(n+1,2)},d:(e,t)=>GE(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)=>GE(e.getHours()%12||12,t.length),H:(e,t)=>GE(e.getHours(),t.length),m:(e,t)=>GE(e.getMinutes(),t.length),s:(e,t)=>GE(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return GE(Math.trunc(r*Math.pow(10,n-3)),t.length)}},QE="midnight",XE="noon",JE="morning",ZE="afternoon",ej="evening",tj="night",nj={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 YE.y(e,t)},Y:function(e,t,n,r){const o=HE(e,r),i=o>0?o:1-o;if("YY"===t){return GE(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):GE(i,t.length)},R:function(e,t){return GE(PE(e),t.length)},u:function(e,t){return GE(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 GE(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 GE(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 YE.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 GE(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=WE(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):GE(o,t.length)},I:function(e,t,n){const r=KE(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):GE(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):YE.d(e,t)},D:function(e,t,n){const r=BE(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):GE(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 GE(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 GE(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 GE(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?XE:0===r?QE: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?ej:r>=12?ZE:r>=4?JE:tj,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 YE.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):YE.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):GE(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):GE(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):YE.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):YE.s(e,t)},S:function(e,t){return YE.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return oj(r);case"XXXX":case"XX":return ij(r);default:return ij(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return oj(r);case"xxxx":case"xx":return ij(r);default:return ij(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rj(r,":");default:return"GMT"+ij(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rj(r,":");default:return"GMT"+ij(r,":")}},t:function(e,t,n){return GE(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return GE(e.getTime(),t.length)}};function rj(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+GE(i,2)}function oj(e,t){if(e%60==0){return(e>0?"-":"+")+GE(Math.abs(e)/60,2)}return ij(e,t)}function ij(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+GE(Math.trunc(r/60),2)+t+GE(r%60,2)}const sj=(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"})}},aj=(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"})}},lj={p:aj,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return sj(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}}",sj(r,t)).replace("{{time}}",aj(o,t))}},cj=/^D+$/,uj=/^Y+$/,dj=["D","DD","YY","YYYY"];const hj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pj=/^'([^]*?)'?$/,mj=/''/g,gj=/[a-zA-Z]/;function vj(e,t,n){const r=kE(),o=r.locale??VE,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=bE(e);if(!ME(a))throw new RangeError("Invalid time value");let l=t.match(fj).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,lj[t])(e,o.formatLong)}return e})).join("").match(hj).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:yj(e)};if(nj[t])return{isToken:!0,value:e};if(t.match(gj))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 uj.test(e)}(r)||function(e){return cj.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(dj.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,nj[r[0]])(a,r,o.localize,c)})).join("")}function yj(e){const t=e.match(pj);return t?t[1].replace(mj,"'"):e}function bj(e,t){return function(e,t,n){const r=kE(),o=n?.locale??r.locale??VE,i=DE(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=bE(t),l=bE(e)):(a=bE(e),l=bE(t));const c=AE(l,a),u=(_E(l)-_E(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<SE){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/SE),o.formatDistance("aboutXMonths",h,s);if(h=RE(l,a),h<12){const e=Math.round(d/SE);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 xE(e,Date.now())}(e),t)}function xj(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}var wj="focusScope.autoFocusOnMount",Sj="focusScope.autoFocusOnUnmount",Cj={bubbles:!1,cancelable:!0},kj=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=$a(s),h=$a(a),f=i.useRef(null),p=Pa(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:Tj(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Tj(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Tj(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(wj,Cj);c.addEventListener(wj,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tj(r,{select:t}),document.activeElement!==n)return}((e=Ej(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Tj(c))}return()=>{c.removeEventListener(wj,d),setTimeout((()=>{const e=new CustomEvent(Sj,Cj);c.addEventListener(Sj,h),c.dispatchEvent(e),e.defaultPrevented||Tj(t??document.body,{select:!0}),c.removeEventListener(Sj,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=Ej(e),n=jj(t,e),r=jj(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&Tj(i,{select:!0})):(e.preventDefault(),r&&Tj(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(Ia.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function Ej(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 jj(e,t){for(const n of e)if(!Pj(n,{upTo:t}))return n}function Pj(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 Tj(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()}}kj.displayName="FocusScope";var _j=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Nj(e,t),e.unshift(t)},remove(t){e=Nj(e,t),e[0]?.resume()}}}();function Nj(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Dj=0;function Mj(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Oj()),document.body.insertAdjacentElement("beforeend",e[1]??Oj()),Dj++,()=>{1===Dj&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Dj--}}),[])}function Oj(){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 Rj=function(){return Rj=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},Rj.apply(this,arguments)};function Aj(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 Lj(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 Ij="right-scroll-bar-position",Fj="width-before-scroll-bar";function $j(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var qj="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,zj=new WeakMap;function Uj(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 $j(e,t)}))}));return qj((function(){var t=zj.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||$j(e,null)})),o.forEach((function(e){n.has(e)||$j(e,i)}))}zj.set(r,e)}),[e]),r}function Vj(e){return e}function Bj(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Vj);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=Rj({async:!0,ssr:!1},e),t}var Kj=function(e){var t=e.sideCar,n=Aj(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,Rj({},n))};function Hj(e,t){return e.useMedium(t),Kj}Kj.isSideCarExport=!0;var Wj=Bj(),Gj=function(){},Yj=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:Gj,onWheelCapture:Gj,onTouchMoveCapture:Gj}),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=Aj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=Uj([n,t]),C=Rj(Rj({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:Wj,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),Rj(Rj({},C),{ref:S})):i.createElement(y,Rj({},C,{className:c,ref:S}),l))}));Yj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yj.classNames={fullWidth:Fj,zeroRight:Ij};function Qj(){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 Xj=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Qj())&&(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)}}},Jj=function(){var e,t=(e=Xj(),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}},Zj={left:0,top:0,right:0,gap:0},eP=function(e){return parseInt(e||"",10)||0},tP=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Zj;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[eP(t["padding"===e?"paddingLeft":"marginLeft"]),eP(n),eP(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])}},nP=Jj(),rP="data-scroll-locked",oP=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(rP,"] {\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(Ij," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Fj," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Ij," .").concat(Ij," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Fj," .").concat(Fj," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(rP,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},iP=function(){var e=parseInt(document.body.getAttribute(rP)||"0",10);return isFinite(e)?e:0},sP=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(rP,(iP()+1).toString()),function(){var e=iP()-1;e<=0?document.body.removeAttribute(rP):document.body.setAttribute(rP,e.toString())}}),[]);var s=i.useMemo((function(){return tP(o)}),[o]);return i.createElement(nP,{styles:oP(s,!t,o,n?"":"!important")})},aP=!1;if("undefined"!=typeof window)try{var lP=Object.defineProperty({},"passive",{get:function(){return aP=!0,!0}});window.addEventListener("test",lP,lP),window.removeEventListener("test",lP,lP)}catch(kY){aP=!1}var cP=!!aP&&{passive:!1},uP=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])},dP=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),hP(e,r)){var o=fP(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hP=function(e,t){return"v"===e?function(e){return uP(e,"overflowY")}(t):function(e){return uP(e,"overflowX")}(t)},fP=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},pP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mP=function(e){return[e.deltaX,e.deltaY]},gP=function(e){return e&&"current"in e?e.current:e},vP=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},yP=0,bP=[];function xP(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wP=Hj(Wj,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(yP++)[0],s=i.useState(Jj)[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=Lj([e.lockRef.current],(e.shards||[]).map(gP),!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=pP(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=dP(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=dP(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,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var f=fP(e,a),p=f[0],m=f[1]-f[2]-i*p;(p||m)&&hP(e,a)&&(d+=m,h+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(h)<1)&&o||(c=!0),c}(f,t,e,"h"===f?l:c,!0)}),[]),c=i.useCallback((function(e){var n=e;if(bP.length&&bP[bP.length-1]===s){var r="deltaY"in n?mP(n):pP(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(gP).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:xP(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=pP(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,mP(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,pP(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return bP.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,cP),document.addEventListener("touchmove",c,cP),document.addEventListener("touchstart",d,cP),function(){bP=bP.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,cP),document.removeEventListener("touchmove",c,cP),document.removeEventListener("touchstart",d,cP)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:vP(o)}):null,p?i.createElement(sP,{gapMode:e.gapMode}):null)}));var SP=i.forwardRef((function(e,t){return i.createElement(Yj,Rj({},e,{ref:t,sideCar:wP}))}));SP.classNames=Yj.classNames;var CP=new WeakMap,kP=new WeakMap,EP={},jP=0,PP=function(e){return e&&(e.host||PP(e.parentNode))},TP=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=PP(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);EP[n]||(EP[n]=new WeakMap);var i=EP[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=(CP.get(e)||0)+1,c=(i.get(e)||0)+1;CP.set(e,l),i.set(e,c),s.push(e),1===l&&o&&kP.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(SY){}}))};return u(t),a.clear(),jP++,function(){s.forEach((function(e){var t=CP.get(e)-1,o=i.get(e)-1;CP.set(e,t),i.set(e,o),t||(kP.has(e)||e.removeAttribute(r),kP.delete(e)),o||e.removeAttribute(n)})),--jP||(CP=new WeakMap,CP=new WeakMap,kP=new WeakMap,EP={})}},_P=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]"))),TP(r,o,n,"aria-hidden")):function(){return null}},NP=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(OP);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(DP,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(DP,{...o,ref:n,children:r})}));NP.displayName="Slot";var DP=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,{...RP(r,n.props),ref:t?ja(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));DP.displayName="SlotClone";var MP=({children:e})=>t.jsx(t.Fragment,{children:e});function OP(e){return i.isValidElement(e)&&e.type===MP}function RP(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}}var AP="Dialog",[LP,IP]=_a(AP),[FP,$P]=LP(AP),qP=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]=nl({prop:o,defaultProp:s,onChange:a});return t.jsx(FP,{scope:n,triggerRef:c,contentRef:u,contentId:$S(),titleId:$S(),descriptionId:$S(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};qP.displayName=AP;var zP="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(zP,r),s=Pa(n,i.triggerRef);return t.jsx(Ia.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sT(i.open),...o,ref:s,onClick:xj(e.onClick,i.onOpenToggle)})})).displayName=zP;var UP="DialogPortal",[VP,BP]=LP(UP,{forceMount:void 0}),KP=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=$P(UP,n);return t.jsx(VP,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(el,{present:r||a.open,children:t.jsx(Za,{asChild:!0,container:s,children:e})})))})};KP.displayName=UP;var HP="DialogOverlay",WP=i.forwardRef(((e,n)=>{const r=BP(HP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=$P(HP,e.__scopeDialog);return s.modal?t.jsx(el,{present:o||s.open,children:t.jsx(GP,{...i,ref:n})}):null}));WP.displayName=HP;var GP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(HP,r);return t.jsx(SP,{as:NP,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(Ia.div,{"data-state":sT(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),YP="DialogContent",QP=i.forwardRef(((e,n)=>{const r=BP(YP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=$P(YP,e.__scopeDialog);return t.jsx(el,{present:o||s.open,children:t.jsx(s.modal?XP:JP,{...i,ref:n})})}));QP.displayName=YP;var XP=i.forwardRef(((e,n)=>{const r=$P(YP,e.__scopeDialog),o=i.useRef(null),s=Pa(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(ZP,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xj(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:xj(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:xj(e.onFocusOutside,(e=>e.preventDefault()))})})),JP=i.forwardRef(((e,n)=>{const r=$P(YP,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(ZP,{...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()}})})),ZP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=$P(YP,r),u=i.useRef(null),d=Pa(n,u);return Mj(),t.jsxs(t.Fragment,{children:[t.jsx(kj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(Ha,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":sT(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(uT,{titleId:c.titleId}),t.jsx(dT,{contentRef:u,descriptionId:c.descriptionId})]})]})})),eT="DialogTitle",tT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(eT,r);return t.jsx(Ia.h2,{id:i.titleId,...o,ref:n})}));tT.displayName=eT;var nT="DialogDescription",rT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(nT,r);return t.jsx(Ia.p,{id:i.descriptionId,...o,ref:n})}));rT.displayName=nT;var oT="DialogClose",iT=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=$P(oT,r);return t.jsx(Ia.button,{type:"button",...o,ref:n,onClick:xj(e.onClick,(()=>i.onOpenChange(!1)))})}));function sT(e){return e?"open":"closed"}iT.displayName=oT;var aT="DialogTitleWarning",[lT,cT]=Ta(aT,{contentName:YP,titleName:eT,docsSlug:"dialog"}),uT=({titleId:e})=>{const t=cT(aT);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},dT=({contentRef:e,descriptionId:t})=>{const n=cT("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},hT=qP,fT=KP,pT=WP,mT=QP,gT=tT,vT=rT,yT=iT,bT=["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?kx: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}}),{}),xT=i.forwardRef(((e,n)=>t.jsx(bT.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}})));xT.displayName="VisuallyHidden";const wT=hT,ST=({...e})=>t.jsx(fT,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),CT=i.forwardRef((({className:e,...n},r)=>t.jsx(pT,{ref:r,className:jS("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));CT.displayName=pT.displayName;const kT=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(ST,{children:[t.jsx(CT,{}),t.jsxs(mT,{ref:i,className:jS("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(yT,{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(Rc,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));kT.displayName=mT.displayName;const ET=({className:e,...n})=>t.jsx("div",{className:jS("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});ET.displayName="DialogHeader";const jT=i.forwardRef((({className:e,...n},r)=>t.jsx(gT,{ref:r,className:jS("text-lg font-semibold leading-none tracking-tight",e),...n})));jT.displayName=gT.displayName;const PT=i.forwardRef((({className:e,...n},r)=>t.jsx(vT,{ref:r,className:jS("text-sm text-muted-foreground",e),...n})));PT.displayName=vT.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(xT,{ref:o,className:jS(e),...r,children:n}))).displayName="DialogVisuallyHidden";const TT=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Pu("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})));TT.displayName="Input";const _T=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Pu("w-full caption-bottom text-sm",e),...n})})));_T.displayName="Table";const NT=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Pu("[&_tr]:border-b",e),...n})));NT.displayName="TableHeader";const DT=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Pu("[&_tr:last-child]:border-0",e),...n})));DT.displayName="TableBody";const MT=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Pu("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));MT.displayName="TableRow";const OT=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Pu("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));OT.displayName="TableHead";const RT=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Pu("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));RT.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Pu("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const AT=({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(kY){v(kY instanceof Error?kY.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:Pu(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(_T,{children:[t.jsx(NT,{children:t.jsx(MT,{children:e.map((e=>t.jsx(OT,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(DT,{children:l.map(((n,r)=>t.jsx(MT,{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(RT,{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})]})},LT="reach-styles-module__container___6PQqs",IT=Yl(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),FT=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Pu(IT({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));FT.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(LT,e),...n}))).displayName="BadgeContainer";const $T=({status:e})=>{switch(e){case wx.DRAFT:return t.jsx(FT,{variant:"secondary",children:"Draft"});case wx.ACTIVE:return t.jsx(FT,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case wx.RUNNING:return t.jsx(FT,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case wx.COMPLETED:return t.jsx(FT,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case wx.FAILED:return t.jsx(FT,{variant:"destructive",children:"Failed"});case wx.DEACTIVATED:return t.jsx(FT,{variant:"destructive",children:"Cancelled"});default:Ix(e,wx)}},qT=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=Ca(),c=zw(),[u,d]=n.useState(!1),h=e=>t.jsx($T,{status:e}),f=e=>{let n="bg-gray-400";switch(e){case wx.ACTIVE:n="bg-green-500";break;case wx.DRAFT:n="bg-gray-400";break;case wx.DEACTIVATED:n="bg-red-500";break;case wx.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},p=n=>t.jsx(AT,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[f(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),h(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(Sx.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(Sx.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?bj(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const r=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 pa(`${ux}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:o||void 0});return{items:r.data,cursor:r.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"}),m=[{id:"all",label:"All",content:p()},{id:"active",label:"Active",content:p("active")},{id:"draft",label:"Drafts",content:p("draft")}];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(kc,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(TT,{placeholder:"Search automations...",value:o,onChange:e=>i(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(_x,{variant:"outline",onClick:()=>d(!0),children:[t.jsx(Cc,{}),"Create New Automation"]})})]}),t.jsx(PS,{tabs:m,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(wT,{open:u,onOpenChange:d,children:t.jsx(kT,{hideCloseButton:!0,children:t.jsx(Vx,{onClose:e=>{"error"===e?(l({title:"Error creating automation",description:"Please try again",variant:"destructive"}),d(!1)):!1===e?d(!1):c(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)},iconDefinitions:r})})})]})},zT=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 pa(`${cx}${t.toString()?`?${t.toString()}`:""}`)).data};var UT=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(UT||{}),VT=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(VT||{}),BT=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(BT||{});const KT=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(cx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await pa(`${cx}/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}},HT=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await pa(`${cx}/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]})}}},WT=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await pa(`${cx}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},GT=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await pa(`${cx}/${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}};var YT=i.forwardRef(((e,n)=>t.jsx(Ia.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));YT.displayName="Label";var QT=YT;const XT=Yl("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),JT=i.forwardRef((({className:e,...n},r)=>t.jsx(QT,{ref:r,className:Pu(XT(),e),...n})));JT.displayName=QT.displayName;const ZT={[BT.EQUALS]:"Equals",[BT.NOT_EQUALS]:"Not Equals",[BT.GREATER_THAN]:"Greater Than",[BT.LESS_THAN]:"Less Than",[BT.EXISTS]:"Exists"},e_={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"};var t_=.999,n_=/[\\\/_+.#"@\[\(\{&]/,r_=/[\\\/_+.#"@\[\(\{&]/g,o_=/[\s-]/,i_=/[\s-]/g;function s_(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=s_(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:n_.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(r_))&&o>0&&(l*=Math.pow(t_,u.length))):o_.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(i_))&&o>0&&(l*=Math.pow(t_,d.length))):(l*=.17,o>0&&(l*=Math.pow(t_,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=s_(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 a_(e){return e.toLowerCase().replace(i_," ")}function l_(e,t,n){return s_(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,a_(e),a_(t),0,0,{})}var c_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(h_);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(u_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(u_,{...o,ref:n,children:r})}));c_.displayName="Slot";var u_=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?ja(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));u_.displayName="SlotClone";var d_=({children:e})=>t.jsx(t.Fragment,{children:e});function h_(e){return i.isValidElement(e)&&e.type===d_}var f_=["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?c_: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 p_,m_="dismissableLayer.update",g_="dismissableLayer.pointerDownOutside",v_="dismissableLayer.focusOutside",y_=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b_=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(y_),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Pa(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=$a(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){w_(g_,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=$a(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){w_(v_,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 qa((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&&(p_=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),x_(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=p_)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),x_())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(m_,e),()=>document.removeEventListener(m_,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ka(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ka(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ka(e.onPointerDownCapture,C.onPointerDownCapture)})}));b_.displayName="DismissableLayer";function x_(){const e=new CustomEvent(m_);document.dispatchEvent(e)}function w_(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(y_),o=i.useRef(null),s=Pa(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var S_="focusScope.autoFocusOnMount",C_="focusScope.autoFocusOnUnmount",k_={bubbles:!1,cancelable:!0},E_=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=$a(s),h=$a(a),f=i.useRef(null),p=Pa(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:__(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||__(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&__(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){N_.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(S_,k_);c.addEventListener(S_,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(__(r,{select:t}),document.activeElement!==n)return}((e=j_(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&__(c))}return()=>{c.removeEventListener(S_,d),setTimeout((()=>{const e=new CustomEvent(C_,k_);c.addEventListener(C_,h),c.dispatchEvent(e),e.defaultPrevented||__(t??document.body,{select:!0}),c.removeEventListener(C_,h),N_.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=j_(e),n=P_(t,e),r=P_(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&__(i,{select:!0})):(e.preventDefault(),r&&__(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(f_.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function j_(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 P_(e,t){for(const n of e)if(!T_(n,{upTo:t}))return n}function T_(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 __(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()}}E_.displayName="FocusScope";var N_=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=D_(e,t),e.unshift(t)},remove(t){e=D_(e,t),e[0]?.resume()}}}();function D_(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var M_=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);Ja((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(f_.div,{...s,ref:n}),c):null}));M_.displayName="Portal";var O_=Bj(),R_=function(){},A_=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:R_,onWheelCapture:R_,onTouchMoveCapture:R_}),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=Aj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=Uj([n,t]),C=Rj(Rj({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:O_,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),Rj(Rj({},C),{ref:S})):i.createElement(y,Rj({},C,{className:c,ref:S}),l))}));A_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},A_.classNames={fullWidth:Fj,zeroRight:Ij};var L_=!1;if("undefined"!=typeof window)try{var I_=Object.defineProperty({},"passive",{get:function(){return L_=!0,!0}});window.addEventListener("test",I_,I_),window.removeEventListener("test",I_,I_)}catch(kY){L_=!1}var F_=!!L_&&{passive:!1},$_=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])},q_=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),z_(e,r)){var o=U_(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},z_=function(e,t){return"v"===e?function(e){return $_(e,"overflowY")}(t):function(e){return $_(e,"overflowX")}(t)},U_=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},V_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},B_=function(e){return[e.deltaX,e.deltaY]},K_=function(e){return e&&"current"in e?e.current:e},H_=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},W_=0,G_=[];function Y_(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Q_=Hj(O_,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(W_++)[0],s=i.useState(Jj)[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=Lj([e.lockRef.current],(e.shards||[]).map(K_),!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=V_(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=q_(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=q_(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,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,h=0;do{var f=U_(e,a),p=f[0],m=f[1]-f[2]-i*p;(p||m)&&z_(e,a)&&(d+=m,h+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(h)<1)&&o||(c=!0),c}(f,t,e,"h"===f?l:c,!0)}),[]),c=i.useCallback((function(e){var n=e;if(G_.length&&G_[G_.length-1]===s){var r="deltaY"in n?B_(n):V_(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(K_).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:Y_(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=V_(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,B_(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,V_(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return G_.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,F_),document.addEventListener("touchmove",c,F_),document.addEventListener("touchstart",d,F_),function(){G_=G_.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,F_),document.removeEventListener("touchmove",c,F_),document.removeEventListener("touchstart",d,F_)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:H_(o)}):null,p?i.createElement(sP,{gapMode:e.gapMode}):null)}));var X_=i.forwardRef((function(e,t){return i.createElement(A_,Rj({},e,{ref:t,sideCar:Q_}))}));X_.classNames=A_.classNames;var J_="Dialog",[Z_,eN]=_a(J_),[tN,nN]=Z_(J_),rN=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]=nl({prop:o,defaultProp:s,onChange:a});return t.jsx(tN,{scope:n,triggerRef:c,contentRef:u,contentId:$S(),titleId:$S(),descriptionId:$S(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};rN.displayName=J_;var oN="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(oN,r),s=Pa(n,i.triggerRef);return t.jsx(f_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":xN(i.open),...o,ref:s,onClick:ka(e.onClick,i.onOpenToggle)})})).displayName=oN;var iN="DialogPortal",[sN,aN]=Z_(iN,{forceMount:void 0}),lN=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=nN(iN,n);return t.jsx(sN,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(el,{present:r||a.open,children:t.jsx(M_,{asChild:!0,container:s,children:e})})))})};lN.displayName=iN;var cN="DialogOverlay",uN=i.forwardRef(((e,n)=>{const r=aN(cN,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nN(cN,e.__scopeDialog);return s.modal?t.jsx(el,{present:o||s.open,children:t.jsx(dN,{...i,ref:n})}):null}));uN.displayName=cN;var dN=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(cN,r);return t.jsx(X_,{as:c_,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(f_.div,{"data-state":xN(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),hN="DialogContent",fN=i.forwardRef(((e,n)=>{const r=aN(hN,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=nN(hN,e.__scopeDialog);return t.jsx(el,{present:o||s.open,children:t.jsx(s.modal?pN:mN,{...i,ref:n})})}));fN.displayName=hN;var pN=i.forwardRef(((e,n)=>{const r=nN(hN,e.__scopeDialog),o=i.useRef(null),s=Pa(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(gN,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ka(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:ka(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:ka(e.onFocusOutside,(e=>e.preventDefault()))})})),mN=i.forwardRef(((e,n)=>{const r=nN(hN,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(gN,{...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()}})})),gN=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=nN(hN,r),u=i.useRef(null),d=Pa(n,u);return Mj(),t.jsxs(t.Fragment,{children:[t.jsx(E_,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(b_,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":xN(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(EN,{titleId:c.titleId}),t.jsx(jN,{contentRef:u,descriptionId:c.descriptionId})]})]})})),vN="DialogTitle";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(vN,r);return t.jsx(f_.h2,{id:i.titleId,...o,ref:n})})).displayName=vN;var yN="DialogDescription";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(yN,r);return t.jsx(f_.p,{id:i.descriptionId,...o,ref:n})})).displayName=yN;var bN="DialogClose";function xN(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=nN(bN,r);return t.jsx(f_.button,{type:"button",...o,ref:n,onClick:ka(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=bN;var wN,SN="DialogTitleWarning",[CN,kN]=Ta(SN,{contentName:hN,titleName:vN,docsSlug:"dialog"}),EN=({titleId:e})=>{const t=kN(SN);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},jN=({contentRef:e,descriptionId:t})=>{const n=kN("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},PN=rN,TN=lN,_N=uN,NN=fN,DN={exports:{}},MN={};var ON,RN={};
44
44
  /**
45
45
  * @license React
46
46
  * use-sync-external-store-shim.development.js
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
- */DN.exports="production"===process.env.NODE_ENV?function(){if(wN)return MN;wN=1;var e="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},t=n.useState,r=n.useEffect,o=n.useLayoutEffect,i=n.useDebugValue;function s(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!e(t,r)}catch(o){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,n){var a=n(),l=t({inst:{value:a,getSnapshot:n}}),c=l[0].inst,u=l[1];return o((function(){c.value=a,c.getSnapshot=n,s(c)&&u({inst:c})}),[e,a,n]),r((function(){return s(c)&&u({inst:c}),e((function(){s(c)&&u({inst:c})}))}),[e]),i(a),a};return MN.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:a,MN}():(ON||(ON=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=n,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(n,u){l||void 0===t.startTransition||(l=!0);var d=u();if(!c){var h=u();r(d,h)||(c=!0)}var f=(h=o({inst:{value:d,getSnapshot:u}}))[0].inst,p=h[1];return s((function(){f.value=d,f.getSnapshot=u,e(f)&&p({inst:f})}),[n,d,u]),i((function(){return e(f)&&p({inst:f}),n((function(){e(f)&&p({inst:f})}))}),[n]),a(d),d};RN.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),RN);var AN=DN.exports,LN='[cmdk-group=""]',IN='[cmdk-group-items=""]',FN='[cmdk-item=""]',$N=`${FN}:not([aria-disabled="true"])`,qN="cmdk-item-select",zN="data-value",UN=(e,t,n)=>l_(e,t,n),VN=i.createContext(void 0),BN=()=>i.useContext(VN),KN=i.createContext(void 0),HN=()=>i.useContext(KN),WN=i.createContext(void 0),GN=i.forwardRef(((e,t)=>{let n=lD((()=>{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=lD((()=>new Set)),o=lD((()=>new Map)),s=lD((()=>new Map)),a=lD((()=>new Set)),l=sD(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=$S(),x=$S(),w=$S(),S=i.useRef(null),C=hD();aD((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),aD((()=>{C(6,N)}),[]);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)_(),P(),C(1,T);else if("value"===e&&(r||C(5,N),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,(()=>{_(),P(),n.current.value||T(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{_(),(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"],getDisablePointerSelection:()=>l.current.disablePointerSelection,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:UN;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(IN);t?t.appendChild(e.parentElement===t?e:e.closest(`${IN} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${IN} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{var t;let n=null==(t=S.current)?void 0:t.querySelector(`${LN}[${zN}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)}))}function T(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(zN);k.setState("value",t||void 0)}function _(){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 N(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(LN))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${FN}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll($N))||[])}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(zN))}function R(e){var t;let n=D(),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(zN))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(LN);for(;r&&!t;)r=e>0?oD(r,LN):iD(r,LN),t=null==r?void 0:r.querySelector($N);t?k.setState("value",t.getAttribute(zN)):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(ac.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=D();if(t){let e=new Event(qN);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:pD},c),fD(e,(e=>i.createElement(KN.Provider,{value:k},i.createElement(VN.Provider,{value:E},e)))))})),YN=i.forwardRef(((e,t)=>{var n,r;let o=$S(),s=i.useRef(null),a=i.useContext(WN),l=BN(),c=sD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;aD((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=dD(o,s,[e.value,e.children,s],e.keywords),h=HN(),f=uD((e=>e.value&&e.value===d.current)),p=uD((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(qN,m),()=>t.removeEventListener(qN,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(ac.div,{ref:cD([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)})),QN=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=$S(),l=i.useRef(null),c=i.useRef(null),u=$S(),d=BN(),h=uD((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));aD((()=>d.group(a)),[]),dD(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(ac.div,{ref:cD([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),fD(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(WN.Provider,{value:f},e)))))})),XN=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=uD((e=>!e.search));return n||s?i.createElement(ac.div,{ref:cD([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),JN=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=HN(),a=uD((e=>e.search)),l=uD((e=>e.value)),c=BN(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${FN}[${zN}="${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(ac.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)}})})),ZN=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=BN();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(ac.div,{ref:cD([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},fD(e,(e=>i.createElement("div",{ref:cD([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),eD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(PN,{open:n,onOpenChange:r},i.createElement(TN,{container:a},i.createElement(_N,{"cmdk-overlay":"",className:o}),i.createElement(NN,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(GN,{ref:t,...l}))))})),tD=i.forwardRef(((e,t)=>uD((e=>0===e.filtered.count))?i.createElement(ac.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),nD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(ac.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},fD(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),rD=Object.assign(GN,{List:ZN,Item:YN,Input:JN,Group:QN,Separator:XN,Dialog:eD,Empty:tD,Loading:nD});function oD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function iD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function sD(e){let t=i.useRef(e);return aD((()=>{t.current=e})),t}var aD="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function lD(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function cD(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function uD(e){let t=HN(),n=()=>e(t.snapshot());return AN.useSyncExternalStore(t.subscribe,n,n)}function dD(e,t,n,r=[]){let o=i.useRef(),s=BN();return aD((()=>{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(zN,a),o.current=a})),o}var hD=()=>{let[e,t]=i.useState(),n=lD((()=>new Map));return aD((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function fD({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 pD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD,{ref:r,className:Xd("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));mD.displayName=rD.displayName;const gD=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(Gu,{className:"mr-2 h-4 w-4 shrink-0 opacity-50 "}),t.jsx(rD.Input,{ref:o,className:Xd("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})]})));gD.displayName=rD.Input.displayName;const vD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.List,{ref:r,className:Xd("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));vD.displayName=rD.List.displayName;const yD=i.forwardRef(((e,n)=>t.jsx(rD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));yD.displayName=rD.Empty.displayName;const bD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Group,{ref:r,className:Xd("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})));bD.displayName=rD.Group.displayName;const xD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Separator,{ref:r,className:Xd("-mx-1 h-px bg-border",e),...n})));xD.displayName=rD.Separator.displayName;const wD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Item,{ref:r,className:Xd("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})));wD.displayName=rD.Item.displayName;var SD="Popover",[CD,kD]=Zl(SD,[vk]),ED=vk(),[jD,PD]=CD(SD),TD=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=ED(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=jc({prop:o,defaultProp:s,onChange:a});return t.jsx(Ok,{...c,children:t.jsx(jD,{scope:n,contentId:$S(),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})})};TD.displayName=SD;var _D="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=PD(_D,r),a=ED(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(Rk,{...a,...o,ref:n})})).displayName=_D;var ND="PopoverTrigger",DD=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=PD(ND,r),s=ED(r),a=Xl(n,i.triggerRef),l=t.jsx(ac.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":UD(i.open),...o,ref:a,onClick:Gl(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(Rk,{asChild:!0,...s,children:l})}));DD.displayName=ND;var MD="PopoverPortal",[OD,RD]=CD(MD,{forceMount:void 0}),AD=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=PD(MD,n);return t.jsx(OD,{scope:n,forceMount:r,children:t.jsx(kc,{present:r||s.open,children:t.jsx(Cc,{asChild:!0,container:i,children:o})})})};AD.displayName=MD;var LD="PopoverContent",ID=i.forwardRef(((e,n)=>{const r=RD(LD,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=PD(LD,e.__scopePopover);return t.jsx(kc,{present:o||s.open,children:t.jsx(s.modal?FD:$D,{...i,ref:n})})}));ID.displayName=LD;var FD=i.forwardRef(((e,n)=>{const r=PD(LD,e.__scopePopover),o=i.useRef(null),s=Xl(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(X_,{as:tc,allowPinchZoom:!0,children:t.jsx(qD,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gl(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Gl(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Gl(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),$D=i.forwardRef(((e,n)=>{const r=PD(LD,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(qD,{...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()}})})),qD=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=PD(LD,r),p=ED(r);return Mj(),t.jsx(kj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(gc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(Ak,{"data-state":UD(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)"}})})})})),zD="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=PD(zD,r);return t.jsx(ac.button,{type:"button",...o,ref:n,onClick:Gl(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=zD;function UD(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=ED(r);return t.jsx(Lk,{...i,...o,ref:n})})).displayName="PopoverArrow";var VD=AD,BD=ID;const KD=TD,HD=DD,WD=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(VD,{children:t.jsx(BD,{ref:i,align:n,sideOffset:r,className:Xd("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})));WD.displayName=BD.displayName;const GD=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(KD,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{"aria-expanded":s,className:"w-[200px] justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(Du,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(WD,{className:"w-[200px] p-0",children:t.jsxs(mD,{children:[t.jsx(gD,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(vD,{children:[t.jsxs(yD,{children:["No ",o.toLowerCase()," found."]}),t.jsx(bD,{children:e.map((e=>t.jsxs(wD,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(ju,{className:Xd("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function YD(e){return(YD="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 QD(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 XD(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function JD(e){XD(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===YD(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function ZD(e,t){XD(2,arguments);var n=JD(e),r=QD(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function eM(e,t){XD(2,arguments);var n=JD(e),r=QD(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 tM={};function nM(){return tM}function rM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 oM(e){return XD(1,arguments),rM(e,{weekStartsOn:1})}function iM(e){XD(1,arguments);var t=function(e){XD(1,arguments);var t=JD(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=oM(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=oM(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),oM(n)}function sM(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 aM(e){XD(1,arguments);var t=JD(e);return t.setHours(0,0,0,0),t}function lM(e,t){XD(2,arguments);var n=aM(e),r=aM(t),o=n.getTime()-sM(n),i=r.getTime()-sM(r);return Math.round((o-i)/864e5)}function cM(e,t){return XD(2,arguments),ZD(e,7*QD(t))}function uM(e,t){return XD(2,arguments),eM(e,12*QD(t))}function dM(e,t){XD(2,arguments);var n=aM(e),r=aM(t);return n.getTime()===r.getTime()}function hM(e){return XD(1,arguments),e instanceof Date||"object"===YD(e)&&"[object Date]"===Object.prototype.toString.call(e)}function fM(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function pM(e){XD(1,arguments);var t=JD(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function mM(e){XD(1,arguments);var t=JD(e);return t.setDate(1),t.setHours(0,0,0,0),t}function gM(e){XD(1,arguments);var t=JD(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function vM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 yM(e){return XD(1,arguments),vM(e,{weekStartsOn:1})}function bM(e,t){return XD(2,arguments),function(e,t){XD(2,arguments);var n=JD(e).getTime(),r=QD(t);return new Date(n+r)}(e,-QD(t))}function xM(e){XD(1,arguments);var t=JD(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 wM(e){XD(1,arguments);var t=JD(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=xM(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=xM(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function SM(e){XD(1,arguments);var t=JD(e),n=xM(t).getTime()-function(e){XD(1,arguments);var t=wM(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),xM(n)}(t).getTime();return Math.round(n/6048e5)+1}function CM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 kM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=JD(e),d=u.getUTCFullYear(),h=nM(),f=QD(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=CM(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=CM(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function EM(e,t){XD(1,arguments);var n=JD(e),r=CM(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=kM(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),CM(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function jM(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var PM=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return jM("yy"===t?r%100:r,t.length)},TM=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):jM(n+1,2)},_M=function(e,t){return jM(e.getUTCDate(),t.length)},NM=function(e,t){return jM(e.getUTCHours()%12||12,t.length)},DM=function(e,t){return jM(e.getUTCHours(),t.length)},MM=function(e,t){return jM(e.getUTCMinutes(),t.length)},OM=function(e,t){return jM(e.getUTCSeconds(),t.length)},RM=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return jM(Math.floor(r*Math.pow(10,n-3)),t.length)},AM="midnight",LM="noon",IM="morning",FM="afternoon",$M="evening",qM="night",zM={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 PM(e,t)},Y:function(e,t,n,r){var o=kM(e,r),i=o>0?o:1-o;return"YY"===t?jM(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):jM(i,t.length)},R:function(e,t){return jM(wM(e),t.length)},u:function(e,t){return jM(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 jM(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 jM(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 TM(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 jM(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=EM(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):jM(o,t.length)},I:function(e,t,n){var r=SM(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):jM(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):_M(e,t)},D:function(e,t,n){var r=function(e){XD(1,arguments);var t=JD(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"}):jM(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 jM(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 jM(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 jM(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?LM:0===o?AM: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?$M:o>=12?FM:o>=4?IM:qM,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 NM(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):DM(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):jM(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):jM(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):MM(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):OM(e,t)},S:function(e,t){return RM(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return VM(o);case"XXXX":case"XX":return BM(o);default:return BM(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return VM(o);case"xxxx":case"xx":return BM(o);default:return BM(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UM(o,":");default:return"GMT"+BM(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UM(o,":");default:return"GMT"+BM(o,":")}},t:function(e,t,n,r){return jM(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return jM((r._originalDate||e).getTime(),t.length)}};function UM(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+jM(i,2)}function VM(e,t){return e%60==0?(e>0?"-":"+")+jM(Math.abs(e)/60,2):BM(e,t)}function BM(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+jM(Math.floor(o/60),2)+n+jM(o%60,2)}var KM=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"})}},HM=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"})}},WM={p:HM,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return KM(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}}",KM(o,t)).replace("{{time}}",HM(i,t))}},GM=["D","DD"],YM=["YY","YYYY"];function QM(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 XM={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 JM(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 ZM={date:JM({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:JM({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:JM({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function tO(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 nO={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:tO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:tO({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:tO({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:tO({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:tO({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 rO(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 oO={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:rO({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:rO({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:rO({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:rO({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:rO({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"})},iO={code:"en-US",formatDistance:function(e,t,n){var r,o=XM[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:ZM,formatRelative:function(e,t,n,r){return eO[e]},localize:nO,match:oO,options:{weekStartsOn:0,firstWeekContainsDate:1}},sO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,aO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lO=/^'([^]*?)'?$/,cO=/''/g,uO=/[a-zA-Z]/;function dO(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;XD(2,arguments);var w=String(t),S=nM(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:iO,k=QD(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=QD(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=JD(e);if(!function(e){if(XD(1,arguments),!hM(e)&&"number"!=typeof e)return!1;var t=JD(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var P=bM(j,sM(j)),T={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(aO).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,WM[t])(e,C.formatLong):e})).join("").match(sO).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(lO);if(!t)return e;return t[1].replace(cO,"'")}(r);var i=zM[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===YM.indexOf(r)||QM(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==GM.indexOf(e)}(r)||QM(r,t,String(e)),i(P,r,C.localize,T);if(o.match(uO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function hO(e){return XD(1,arguments),Math.floor(function(e){return XD(1,arguments),JD(e).getTime()}(e)/1e3)}function fO(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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;XD(1,arguments);var u=JD(e),d=u.getFullYear(),h=nM(),f=QD(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=rM(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=rM(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),rM(f,t)}function pO(e,t){return XD(1,arguments),function(e,t,n){XD(2,arguments);var r=rM(e,n),o=rM(t,n),i=r.getTime()-sM(r),s=o.getTime()-sM(o);return Math.round((i-s)/6048e5)}(function(e){XD(1,arguments);var t=JD(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),mM(e),t)+1}function mO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getTime()>r.getTime()}function gO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getTime()<r.getTime()}function vO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function yO(e,t){return XD(2,arguments),ZD(e,-QD(t))}function bO(e,t){XD(2,arguments);var n=JD(e),r=QD(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){XD(1,arguments);var t=JD(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 xO(e,t){XD(2,arguments);var n=JD(e),r=QD(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var wO=function(){return wO=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},wO.apply(this,arguments)};function SO(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 CO(e){return"multiple"===e.mode}function kO(e){return"range"===e.mode}function EO(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var jO={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 PO=Object.freeze({__proto__:null,formatCaption:function(e,t){return dO(e,"LLLL y",t)},formatDay:function(e,t){return dO(e,"d",t)},formatMonthCaption:function(e,t){return dO(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return dO(e,"cccccc",t)},formatYearCaption:function(e,t){return dO(e,"yyyy",t)}}),TO=Object.freeze({__proto__:null,labelDay:function(e,t,n){return dO(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 dO(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var _O=n.createContext(void 0);function NO(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:jO,formatters:PO,labels:TO,locale:iO,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=mM(r):t&&(i=new Date(t,0,1)),o?s=pM(o):n&&(s=new Date(n,11,31)),{fromDate:i?aM(i):void 0,toDate:s?aM(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"),(EO(o)||CO(o)||kO(o))&&(r=o.onSelect);var u=wO(wO(wO({},i),o),{captionLayout:c,classNames:wO(wO({},i.classNames),o.classNames),components:wO({},o.components),formatters:wO(wO({},i.formatters),o.formatters),fromDate:a,labels:wO(wO({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:wO(wO({},i.modifiers),o.modifiers),modifiersClassNames:wO(wO({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:wO(wO({},i.styles),o.styles),toDate:l});return t.jsx(_O.Provider,{value:u,children:e.children})}function DO(){var e=n.useContext(_O);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function MO(e){var n=DO();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 OO(e){return t.jsx("svg",wO({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 RO(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=DO(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:OO;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 AO(e){var n,r=DO(),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){XD(2,arguments);var n=JD(e),r=JD(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=mM(o),p=o.getMonth();p<=i.getMonth();p++)h.push(bO(f,p));else for(f=mM(new Date),p=0;p<=11;p++)h.push(bO(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:RO;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=bO(mM(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 LO(e){var n,r=e.displayMonth,o=DO(),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(xO(gM(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:RO;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=xO(mM(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 IO(){var e=DO(),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&&fM(n,t)<0&&(t=eM(n,-1*(i-1))),r&&fM(t,r)<0&&(t=r),mM(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=mM(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var FO=n.createContext(void 0);function $O(e){var n=DO(),r=IO(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=mM(e),i=fM(mM(eM(o,r)),o),s=[],a=0;a<i;a++){var l=eM(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=mM(e);if(!n)return eM(s,i);if(!(fM(n,e)<o))return eM(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=mM(e);if(!n)return eM(i,-o);if(!(fM(i,n)<=0))return eM(i,-o)}}(o,n),c=function(e){return s.some((function(t){return vO(e,t)}))};return t.jsx(FO.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&gO(e,t)?i(eM(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function qO(){var e=n.useContext(FO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function zO(e){var n,r=DO(),o=r.classNames,i=r.styles,s=r.components,a=qO().goToMonth,l=function(t){a(eM(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:MO,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(AO,{onChange:l,displayMonth:e.displayMonth}),t.jsx(LO,{onChange:l,displayMonth:e.displayMonth})]})}function UO(e){return t.jsx("svg",wO({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 VO(e){return t.jsx("svg",wO({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 BO=n.forwardRef((function(e,n){var r=DO(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=wO(wO({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",wO({},e,{ref:n,type:"button",className:a,style:l}))}));function KO(e){var n,r,o=DO(),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:VO,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:UO;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(BO,{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(BO,{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 HO(e){var n=DO().numberOfMonths,r=qO(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return vO(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(KO,{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 WO(e){var n,r,o=DO(),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:MO;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(zO,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(zO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(HO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(HO,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function GO(e){var n=DO(),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 YO(){var e=DO(),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?oM(new Date):rM(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=ZD(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 QO(){var e,n=DO(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:YO;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function XO(e){var n=DO();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var JO=n.createContext(void 0);function ZO(e){if(!CO(e.initialProps)){return t.jsx(JO.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(eR,{initialProps:e.initialProps,children:e.children})}function eR(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 dM(t,e)}));return Boolean(t&&!n)})),t.jsx(JO.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?SO([],o):[];if(t.selected){var u=c.findIndex((function(t){return dM(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 tR(){var e=n.useContext(JO);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var nR,rR,oR=n.createContext(void 0);function iR(e){if(!kO(e.initialProps)){return t.jsx(oR.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(sR,{initialProps:e.initialProps,children:e.children})}function sR(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],dM(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:yO(s,l-1),before:ZD(s,l-1)}),s&&a&&u.disabled.push({after:s,before:ZD(s,l-1)}),!s&&a&&u.disabled.push({after:yO(a,l-1),before:ZD(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:ZD(s,1-c)}),u.disabled.push({after:ZD(s,c-1)})),s&&a){var d=c-(lM(a,s)+1);u.disabled.push({before:yO(s,d)}),u.disabled.push({after:ZD(a,d)})}!s&&a&&(u.disabled.push({before:ZD(a,1-c)}),u.disabled.push({after:ZD(a,c-1)}))}return t.jsx(oR.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(dM(o,e)&&dM(r,e))return;if(dM(o,e))return{from:o,to:void 0};if(dM(r,e))return;return mO(r,e)?{from:e,to:o}:{from:r,to:e}}return o?mO(e,o)?{from:o,to:e}:{from:e,to:o}:r?gO(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 aR(){var e=n.useContext(oR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function lR(e){return Array.isArray(e)?SO([],e):void 0!==e?[e]:[]}(rR=nR||(nR={})).Outside="outside",rR.Disabled="disabled",rR.Selected="selected",rR.Hidden="hidden",rR.Today="today",rR.RangeStart="range_start",rR.RangeEnd="range_end",rR.RangeMiddle="range_middle";var cR=nR.Selected,uR=nR.Disabled,dR=nR.Hidden,hR=nR.Today,fR=nR.RangeEnd,pR=nR.RangeMiddle,mR=nR.RangeStart,gR=nR.Outside;var vR=n.createContext(void 0);function yR(e){var n=DO(),r=function(e,t,n){var r,o=((r={})[cR]=lR(e.selected),r[uR]=lR(e.disabled),r[dR]=lR(e.hidden),r[hR]=[e.today],r[fR]=[],r[pR]=[],r[mR]=[],r[gR]=[],r);return e.fromDate&&o[uR].push({before:e.fromDate}),e.toDate&&o[uR].push({after:e.toDate}),CO(e)?o[uR]=o[uR].concat(t.modifiers[uR]):kO(e)&&(o[uR]=o[uR].concat(n.modifiers[uR]),o[mR]=n.modifiers[mR],o[pR]=n.modifiers[pR],o[fR]=n.modifiers[fR]),o}(n,tR(),aR()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=lR(e[1])})),t}(n.modifiers),i=wO(wO({},r),o);return t.jsx(vR.Provider,{value:i,children:e.children})}function bR(){var e=n.useContext(vR);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function xR(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(hM(t))return dM(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(hM)}(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?(lM(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),lM(n,i)>=0&&lM(s,n)>=0):s?dM(s,n):!!i&&dM(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=lM(t.before,e)>0,l=lM(t.after,e)<0;return mO(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?lM(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?lM(t.before,e)>0:"function"==typeof t&&t(e)}))}function wR(e,t,n){var r=Object.keys(t).reduce((function(n,r){return xR(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!vO(e,n)&&(o.outside=!0),o}function SR(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:ZD,week:cM,month:eM,year:uM,startOfWeek:function(e){return o.ISOWeek?oM(e):rM(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?yM(e):vM(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(XD(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==YD(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=JD(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(XD(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==YD(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=JD(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=wR(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:SR(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:wO(wO({},a),{count:a.count+1})})}var CR=n.createContext(void 0);function kR(e){var r=qO(),o=bR(),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=mM(e[0]),i=pM(e[e.length-1]),s=o;s<=i;){var a=wR(s,t);if(a.disabled||a.hidden)s=ZD(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=ZD(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=DO(),m=function(e,t){if(s){var n=SR(s,{moveBy:e,direction:t,context:p,modifiers:o});dM(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(CR.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 ER(){var e=n.useContext(CR);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var jR=n.createContext(void 0);function PR(e){if(!EO(e.initialProps)){return t.jsx(jR.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(TR,{initialProps:e.initialProps,children:e.children})}function TR(e){var n=e.initialProps;return t.jsx(jR.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 _R(){var e=n.useContext(jR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function NR(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(nR).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function DR(e,r,o){var i,s,a,l=DO(),c=ER(),u=function(e,t){return wR(e,bR(),t)}(e,r),d=function(e,t){var n=DO(),r=_R(),o=tR(),i=aR(),s=ER(),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;EO(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):CO(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):kO(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=DO(),t=_R(),n=tR(),r=aR();return EO(e)?t.selected:CO(e)?n.selected:kO(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&dM(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=NR(l,u).join(" "),m=function(e,t){var n=wO({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=wO(wO({},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:XO,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&dM(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&dM(c.focusedDay,e),w=wO(wO(wO({},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 MR(e){var r=n.useRef(null),o=DR(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(BO,wO({name:"day",ref:r},o.buttonProps)):t.jsx("div",wO({},o.divProps))}function OR(e){var n=e.number,r=e.dates,o=DO(),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(BO,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function RR(e){var n,r,o,i=DO(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:MR,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:OR;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})},hO(n))}))]})}function AR(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?yM(t):vM(t,n),o=(null==n?void 0:n.ISOWeek)?oM(e):rM(e,n),i=lM(r,o),s=[],a=0;a<=i;a++)s.push(ZD(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){XD(1,arguments);var t=JD(e),n=oM(t).getTime()-iM(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){XD(1,arguments);var n=JD(e),r=rM(n,t).getTime()-fO(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 LR(e){var n,r,o,i=DO(),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=AR(mM(e),pM(e),t);if(null==t?void 0:t.useFixedWeeks){var r=pO(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=cM(i,6-r),a=AR(cM(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:QO,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:RR,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:GO;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 IR="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,FR=!1,$R=0;function qR(){return"react-day-picker-".concat(++$R)}function zR(e){var r,o,i=DO(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=qO().displayMonths,d=function(e){var t,r=null!=e?e:FR?qR():null,o=n.useState(r),i=o[0],s=o[1];return IR((function(){null===i&&s(qR())}),[]),n.useEffect((function(){!1===FR&&(FR=!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=wO(wO({},p),l.caption_start)),g&&(f.push(a.caption_end),p=wO(wO({},p),l.caption_end)),v&&(f.push(a.caption_between),p=wO(wO({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:WO;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(LR,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function UR(e){var n=DO();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function VR(e){var r,o,i=e.initialProps,s=DO(),a=ER(),l=qO(),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=wO(wO({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return wO(wO({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:UR;return t.jsx("div",wO({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(zR,{displayIndex:n,displayMonth:e},n)}))})}))}function BR(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(NO,{initialProps:r,children:t.jsx($O,{children:t.jsx(PR,{initialProps:r,children:t.jsx(ZO,{initialProps:r,children:t.jsx(iR,{initialProps:r,children:t.jsx(yR,{children:t.jsx(kR,{children:n})})})})})})})}function KR(e){return t.jsx(BR,wO({},e,{children:t.jsx(VR,{initialProps:e})}))}function HR({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(KR,{showOutsideDays:r,className:Xd("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:Xd(Tx({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:Xd("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:Xd(Tx({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(Tu,{className:"h-4 w-4"}),IconRight:()=>t.jsx(_u,{className:"h-4 w-4"})},...o})}HR.displayName="Calendar";var WR=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(QR);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(GR,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(GR,{...o,ref:n,children:r})}));WR.displayName="Slot";var GR=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?Ql(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));GR.displayName="SlotClone";var YR=({children:e})=>t.jsx(t.Fragment,{children:e});function QR(e){return i.isValidElement(e)&&e.type===YR}var XR=["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?WR: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}}),{}),JR="horizontal",ZR=["horizontal","vertical"],eA=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=JR,...i}=e,s=function(e){return ZR.includes(e)}(o)?o:JR;return t.jsx(XR.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));eA.displayName="Separator";var tA=eA;const nA=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(tA,{ref:i,decorative:r,orientation:n,className:Xd("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));nA.displayName=tA.displayName;const rA=bu("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"}}),oA=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(Gu,{className:"h-4 w-4 mr-2"}),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(KD,{open:b,onOpenChange:x,modal:l,children:[t.jsx(HD,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Xd("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",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(FT,{className:Xd(w?"animate-bounce":"",rA({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(Ou,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(FT,{className:Xd("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",rA({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(Ou,{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(od,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(nA,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(Pu,{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(Pu,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(WD,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(mD,{children:[t.jsx(gD,{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(vD,{children:[t.jsx(yD,{children:f}),t.jsxs(bD,{children:[t.jsxs(wD,{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:Xd("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(ju,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(wD,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Xd("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(ju,{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(xD,{}),t.jsx(bD,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(wD,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(nA,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(wD,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(rd,{className:Xd("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function iA(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])}oA.displayName="MultiSelect";var sA="Switch",[aA,lA]=Zl(sA),[cA,uA]=aA(sA),dA=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:h,...f}=e,[p,m]=i.useState(null),g=Xl(n,(e=>m(e))),v=i.useRef(!1),y=!p||(h||!!p.closest("form")),[b=!1,x]=jc({prop:s,defaultProp:a,onChange:d});return t.jsxs(cA,{scope:r,checked:b,disabled:c,children:[t.jsx(ac.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":mA(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:Gl(e.onClick,(e=>{x((e=>!e)),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())}))}),y&&t.jsx(pA,{control:p,bubbles:!v.current,name:o,value:u,checked:b,required:l,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})}));dA.displayName=sA;var hA="SwitchThumb",fA=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=uA(hA,r);return t.jsx(ac.span,{"data-state":mA(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));fA.displayName=hA;var pA=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=iA(r),c=pk(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function mA(e){return e?"checked":"unchecked"}var gA=dA,vA=fA;const yA=i.forwardRef((({className:e,...n},r)=>t.jsx(gA,{className:Xd("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:r,children:t.jsx(vA,{className:Xd("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));yA.displayName=gA.displayName;const bA=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const[c,u]=i.useState(e===UT.Date&&r.length>0&&r[0]instanceof Date?r[0]:void 0);if(e===UT.String)return n===BT.EXISTS?null:t.jsx(oA,{maxCount:2,options:(s||[]).map((e=>({label:e,value:e}))),value:r.map((e=>e)),onValueChange:e=>{o(e.map((e=>e)))},selectedValues:r.map((e=>e)),setSelectedValues:e=>{o(e.map((e=>e)))},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case UT.String:return t.length>0;case UT.Number:return!isNaN(Number(t));case UT.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case UT.Boolean:return"true"===t||"false"===t;case UT.Date:case UT.DateTime:return!isNaN(new Date(t).getTime());default:throw Ix(n,UT)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===UT.Date)return t.jsx("div",{className:"grid gap-2",children:t.jsxs(KD,{modal:!0,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",className:Xd("w-[200px] justify-start text-left font-normal",!c&&"text-muted-foreground"),children:[t.jsx(Eu,{className:"mr-2 h-4 w-4"}),c?vj(c,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(WD,{className:"w-auto p-0",align:"start",children:t.jsx(HR,{mode:"single",selected:c,onSelect:e=>{u(e),e&&o([e])},initialFocus:!0})})]})});if(e===UT.Number)return n===BT.EXISTS?null:t.jsx(TT,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===UT.Boolean){if(n===BT.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(yA,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(TT,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]"})},xA=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=Wl(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:UT.String,options:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:e_[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(GD,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:ZT[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case UT.Boolean:l=[!1];break;case UT.Number:l=[0];break;case UT.Date:l=[new Date];break;case UT.String:l=o.options?.length?[o.options[0]]:[""];break;default:l=[""]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(GD,{options:l.map((e=>({value:e,label:ZT[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx("div",{className:"max-w-2xl w-full overflow-hidden",children:t.jsx(bA,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...new Set([...e.value,...a.options])]:a.options,value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c}})})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(_x,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(Au,{className:"h-4 w-4"})}),t.jsx(_x,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Xu,{className:"h-4 w-4"})})]})]})};function wA({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=Wl(),[s,a]=i.useState(!1),[l,c]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:u,isLoading:d}=WT(e||""),{updateSegment:h}=GT(e),{createSegment:f,isCreating:p,segmentsConditions:m}=KT();i.useEffect((()=>{m&&c(u?{version:"1.0",id:u.id,name:u.name,description:u.description,logic:"AND",conditions:u.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})}),[u,m]);if(!m||d)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lx,{})});return t.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8",children:t.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-visible",children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(JT,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(TT,{placeholder:"Segment name",value:l.name,onChange:e=>c({...l,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(JT,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(TT,{placeholder:"Segment description",value:l.description,onChange:e=>c({...l,description:e.target.value})})]})]}),l.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(bh,{mode:"popLayout",children:l.conditions.map(((e,n)=>t.jsxs(ix.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(ix.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(ix.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(ix.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(ix.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(xA,{condition:e,onUpdate:e=>((e,t)=>{const n=[...l.conditions];n[e]=t,c({...l,conditions:n})})(n,e),segmentsConditions:m,onDuplicate:()=>(e=>{const t=[...l.conditions];t.splice(e+1,0,{...l.conditions[e]}),c({...l,conditions:t})})(n),onDelete:()=>(e=>{const t=l.conditions.filter(((t,n)=>n!==e));c({...l,conditions:t})})(n)})]},n)))})})})]})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(_x,{variant:"secondary",onClick:()=>{c({...l,conditions:[...l.conditions,{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})},children:[t.jsx(Wu,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_x,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(_x,{variant:"secondary",onClick:async()=>{if(!l.name||!l.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(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!==BT.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===BT.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}})(l.conditions);if(t){a(!0);try{e&&u?h({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):f({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{a(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:s||p,children:s||p?t.jsxs(t.Fragment,{children:[t.jsx($u,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})}function SA({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(wT,{open:e,onOpenChange:n,children:t.jsxs(kT,{className:"flex max-h-[86vh] flex-col gap-0 p-0 overflow-visible max-w-5xl w-full",hideCloseButton:!0,children:[t.jsx(ET,{className:"p-8 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(jT,{className:"text-3xl font-normal",children:r?"Edit Segment":"Create Segment"}),t.jsx(_x,{variant:"ghost",size:"icon",onClick:()=>n(!1),className:"h-8 w-8",children:t.jsx(od,{className:"h-4 w-4"})})]})}),t.jsx(wA,{segmentId:r,setOpen:e=>{n(e),o?.(!1)},onSegmentUpdated:o})]})})}const CA=()=>{const[e,r]=n.useState(""),{toast:o}=Wl(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[VT.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[VT.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[VT.CUSTOM];return t.jsx(FT,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(SA,{open:i,setOpen:s,segmentId:a??void 0}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Gu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(TT,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2"}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(_x,{variant:"outline",onClick:()=>s(!0),children:[t.jsx(Wu,{}),"Create New Segment"]})})]}),t.jsx(AT,{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}),c(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?bj(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await zT({cursor:t,limit:n,search:e||void 0});return{items:r.data,cursor:r.pagination.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:e=>{e.type===VT.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},kA=({iconDefinitionsPassed:e})=>{const r=zw(),[o,i]=n.useState("automations"),s=Cx(e),a=[{id:"automations",label:"Automations",content:t.jsx(qT,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:s})},{id:"segments",label:"Segments",content:t.jsx(CA,{})}];return t.jsx("div",{className:"h-full container max-w-screen-xl mx-auto",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx(yE,{iconDefinitions:s}),t.jsx("div",{className:"flex-1",children:t.jsx(PS,{tabs:a,activeTab:o,onTabChange:e=>i(e)})})]})})};var EA=i.createContext(void 0);function jA(e){const t=i.useContext(EA);return e||t||"ltr"}var PA="rovingFocusGroup.onEntryFocus",TA={bubbles:!1,cancelable:!0},_A="RovingFocusGroup",[NA,DA,MA]=sc(_A),[OA,RA]=Zl(_A,[MA]),[AA,LA]=OA(_A),IA=i.forwardRef(((e,n)=>t.jsx(NA.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(NA.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(FA,{...e,ref:n})})})));IA.displayName=_A;var FA=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=Xl(n,p),g=jA(a),[v=null,y]=jc({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=cc(d),S=DA(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(PA,w),()=>e.removeEventListener(PA,w)}),[w]),t.jsx(AA,{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(ac.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Gl(e.onMouseDown,(()=>{C.current=!0})),onFocus:Gl(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(PA,TA);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));UA([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Gl(e.onBlur,(()=>x(!1)))})})})),$A="RovingFocusGroupItem",qA=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=$S(),u=a||c,d=LA($A,r),h=d.currentTabStopId===u,f=DA(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(NA.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(ac.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Gl(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Gl(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Gl(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:zA[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((()=>UA(o)))}var n,r}))})})}));qA.displayName=$A;var zA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UA(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 VA=IA,BA=qA,KA="Tabs",[HA,WA]=Zl(KA,[RA]),GA=RA(),[YA,QA]=HA(KA),XA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=jA(l),[h,f]=jc({prop:o,onChange:i,defaultProp:s});return t.jsx(YA,{scope:r,baseId:$S(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(ac.div,{dir:d,"data-orientation":a,...u,ref:n})})}));XA.displayName=KA;var JA="TabsList",ZA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=QA(JA,r),a=GA(r);return t.jsx(VA,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(ac.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));ZA.displayName=JA;var eL="TabsTrigger",tL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=QA(eL,r),l=GA(r),c=oL(a.baseId,o),u=iL(a.baseId,o),d=o===a.value;return t.jsx(BA,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(ac.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:Gl(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Gl(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Gl(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));tL.displayName=eL;var nL="TabsContent",rL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=QA(nL,r),u=oL(c.baseId,o),d=iL(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(kc,{present:s||h,children:({present:r})=>t.jsx(ac.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 oL(e,t){return`${e}-trigger-${t}`}function iL(e,t){return`${e}-content-${t}`}rL.displayName=nL;var sL=ZA,aL=tL,lL=rL;const cL=XA,uL=i.forwardRef((({className:e,...n},r)=>t.jsx(sL,{ref:r,className:Xd("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));uL.displayName=sL.displayName;const dL=i.forwardRef((({className:e,...n},r)=>t.jsx(aL,{ref:r,className:Xd("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})));dL.displayName=aL.displayName;const hL=i.forwardRef((({className:e,...n},r)=>t.jsx(lL,{ref:r,className:Xd("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));hL.displayName=lL.displayName;const fL=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await pa(`${dx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},pL=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await pa(`${dx}/${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}},mL=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(`${hx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},gL=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await pa(`${hx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(px(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}},vL=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await pa(`${hx}/${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}},yL=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await pa(`${hx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},bL=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await pa(`${hx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},xL=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",wL=({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"]})]}),SL=({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 flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(wL,{type:"email"})}),CL=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",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} <${s}>`:s})]}),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:r})]}),o&&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:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(SL,{html:i,height:a.height,width:a.width})})]})},kL=({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})})})})]}),EL=({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(ix.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(_x,{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(ix.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(_x,{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(ix.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(bh,{mode:"wait",children:["email"===i&&e&&t.jsx(ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(CL,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(kL,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},jL=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=mx(e),{getCommunicationGroup:s}=mL(),{channelSenders:a}=fL(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=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((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.data.find((e=>e.id===t));n&&e.email_html_body&&c({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=a.data.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:xL(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(lx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(EL,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}: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. Start by clicking Actions in the top right, and then click Edit!"})]})})},PL=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=gx(e),{isLoading:s}=bx(e);if(o||s)return t.jsx("div",{className:TS,children:t.jsx(lx,{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(Sx.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(yE,{automationId:e,iconDefinitions:n})}),t.jsx(nA,{className:"my-4"}),t.jsxs(_T,{children:[t.jsx(NT,{children:t.jsxs(MT,{children:[t.jsx(OT,{style:{width:a},children:"Name"}),t.jsx(OT,{style:{width:l},children:"Email"}),t.jsx(OT,{style:{width:c},children:"Phone"})]})}),t.jsx(DT,{children:r.recipients.map((e=>t.jsxs(MT,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(RT,{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(RT,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(RT,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var TL,_L="dismissableLayer.update",NL="dismissableLayer.pointerDownOutside",DL="dismissableLayer.focusOutside",ML=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),OL=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(ML),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Xl(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=cc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){AL(NL,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=cc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){AL(DL,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 uc((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&&(TL=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),RL(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=TL)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),RL())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(_L,e),()=>document.removeEventListener(_L,e)}),[]),t.jsx(ac.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Gl(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Gl(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Gl(e.onPointerDownCapture,C.onPointerDownCapture)})}));OL.displayName="DismissableLayer";function RL(){const e=new CustomEvent(_L);document.dispatchEvent(e)}function AL(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?lc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(ML),o=i.useRef(null),s=Xl(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(ac.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var LL=["Enter"," "],IL=["ArrowUp","PageDown","End"],FL=["ArrowDown","PageUp","Home",...IL],$L={ltr:[...LL,"ArrowRight"],rtl:[...LL,"ArrowLeft"]},qL={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zL="Menu",[UL,VL,BL]=sc(zL),[KL,HL]=Zl(zL,[BL,vk,RA]),WL=vk(),GL=RA(),[YL,QL]=KL(zL),[XL,JL]=KL(zL),ZL=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=WL(n),[u,d]=i.useState(null),h=i.useRef(!1),f=cc(a),p=jA(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(Ok,{...c,children:t.jsx(YL,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(XL,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};ZL.displayName=zL;var eI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=WL(r);return t.jsx(Rk,{...i,...o,ref:n})}));eI.displayName="MenuAnchor";var tI="MenuPortal",[nI,rI]=KL(tI,{forceMount:void 0}),oI=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=QL(tI,n);return t.jsx(nI,{scope:n,forceMount:r,children:t.jsx(kc,{present:r||s.open,children:t.jsx(Cc,{asChild:!0,container:i,children:o})})})};oI.displayName=tI;var iI="MenuContent",[sI,aI]=KL(iI),lI=i.forwardRef(((e,n)=>{const r=rI(iI,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=QL(iI,e.__scopeMenu),a=JL(iI,e.__scopeMenu);return t.jsx(UL.Provider,{scope:e.__scopeMenu,children:t.jsx(kc,{present:o||s.open,children:t.jsx(UL.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?cI:uI,{...i,ref:n})})})})})),cI=i.forwardRef(((e,n)=>{const r=QL(iI,e.__scopeMenu),o=i.useRef(null),s=Xl(n,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(dI,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Gl(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),uI=i.forwardRef(((e,n)=>{const r=QL(iI,e.__scopeMenu);return t.jsx(dI,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),dI=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=QL(iI,r),b=JL(iI,r),x=WL(r),w=GL(r),S=VL(r),[C,k]=i.useState(null),E=i.useRef(null),j=Xl(n,E,y.onContentChange),P=i.useRef(0),T=i.useRef(""),_=i.useRef(0),N=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?X_:i.Fragment,R=g?{as:tc,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)),[]),Mj();const L=i.useCallback((e=>D.current===N.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,N.current?.area)),[]);return t.jsx(sI,{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:_,onPointerGraceIntentChange:i.useCallback((e=>{N.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(kj,{asChild:!0,trapped:s,onMountAutoFocus:Gl(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(OL,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(VA,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Gl(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(Ak,{role:"menu","aria-orientation":"vertical","data-state":II(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Gl(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(!FL.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));IL.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:Gl(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),T.current="")})),onPointerMove:Gl(e.onPointerMove,qI((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));lI.displayName=iI;var hI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ac.div,{role:"group",...o,ref:n})}));hI.displayName="MenuGroup";var fI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ac.div,{...o,ref:n})}));fI.displayName="MenuLabel";var pI="MenuItem",mI="menu.itemSelect",gI=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=JL(pI,e.__scopeMenu),c=aI(pI,e.__scopeMenu),u=Xl(n,a),d=i.useRef(!1);return t.jsx(vI,{...s,ref:u,disabled:r,onClick:Gl(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(mI,{bubbles:!0,cancelable:!0});e.addEventListener(mI,(e=>o?.(e)),{once:!0}),lc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Gl(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Gl(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||LL.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));gI.displayName=pI;var vI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=aI(pI,r),c=GL(r),u=i.useRef(null),d=Xl(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(UL.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(BA,{asChild:!0,...c,focusable:!o,children:t.jsx(ac.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Gl(e.onPointerMove,qI((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Gl(e.onPointerLeave,qI((e=>l.onItemLeave(e)))),onFocus:Gl(e.onFocus,(()=>f(!0))),onBlur:Gl(e.onBlur,(()=>f(!1)))})})})})),yI=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(jI,{scope:e.__scopeMenu,checked:r,children:t.jsx(gI,{role:"menuitemcheckbox","aria-checked":FI(r)?"mixed":r,...i,ref:n,"data-state":$I(r),onSelect:Gl(i.onSelect,(()=>o?.(!!FI(r)||!r)),{checkForDefaultPrevented:!1})})})}));yI.displayName="MenuCheckboxItem";var bI="MenuRadioGroup",[xI,wI]=KL(bI,{value:void 0,onValueChange:()=>{}}),SI=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=cc(o);return t.jsx(xI,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(hI,{...i,ref:n})})}));SI.displayName=bI;var CI="MenuRadioItem",kI=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=wI(CI,e.__scopeMenu),s=r===i.value;return t.jsx(jI,{scope:e.__scopeMenu,checked:s,children:t.jsx(gI,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":$I(s),onSelect:Gl(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));kI.displayName=CI;var EI="MenuItemIndicator",[jI,PI]=KL(EI,{checked:!1}),TI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=PI(EI,r);return t.jsx(kc,{present:o||FI(s.checked)||!0===s.checked,children:t.jsx(ac.span,{...i,ref:n,"data-state":$I(s.checked)})})}));TI.displayName=EI;var _I=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(ac.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));_I.displayName="MenuSeparator";var NI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=WL(r);return t.jsx(Lk,{...i,...o,ref:n})}));NI.displayName="MenuArrow";var[DI,MI]=KL("MenuSub"),OI="MenuSubTrigger",RI=i.forwardRef(((e,n)=>{const r=QL(OI,e.__scopeMenu),o=JL(OI,e.__scopeMenu),s=MI(OI,e.__scopeMenu),a=aI(OI,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(eI,{asChild:!0,...d,children:t.jsx(vI,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":II(r.open),...e,ref:Ql(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Gl(e.onPointerMove,qI((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:Gl(e.onPointerLeave,qI((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:Gl(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||$L[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));RI.displayName=OI;var AI="MenuSubContent",LI=i.forwardRef(((e,n)=>{const r=rI(iI,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=QL(iI,e.__scopeMenu),l=JL(iI,e.__scopeMenu),c=MI(AI,e.__scopeMenu),u=i.useRef(null),d=Xl(n,u);return t.jsx(UL.Provider,{scope:e.__scopeMenu,children:t.jsx(kc,{present:o||a.open,children:t.jsx(UL.Slot,{scope:e.__scopeMenu,children:t.jsx(dI,{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:Gl(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Gl(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Gl(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=qL[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function II(e){return e?"open":"closed"}function FI(e){return"indeterminate"===e}function $I(e){return FI(e)?"indeterminate":e?"checked":"unchecked"}function qI(e){return t=>"mouse"===t.pointerType?e(t):void 0}LI.displayName=AI;var zI=ZL,UI=eI,VI=oI,BI=lI,KI=hI,HI=fI,WI=gI,GI=yI,YI=SI,QI=kI,XI=TI,JI=_I,ZI=NI,eF=RI,tF=LI,nF="DropdownMenu",[rF,oF]=Zl(nF,[HL]),iF=HL(),[sF,aF]=rF(nF),lF=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=iF(n),d=i.useRef(null),[h=!1,f]=jc({prop:s,defaultProp:a,onChange:l});return t.jsx(sF,{scope:n,triggerId:$S(),triggerRef:d,contentId:$S(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(zI,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};lF.displayName=nF;var cF="DropdownMenuTrigger",uF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=aF(cF,r),a=iF(r);return t.jsx(UI,{asChild:!0,...a,children:t.jsx(ac.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:Ql(n,s.triggerRef),onPointerDown:Gl(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Gl(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));uF.displayName=cF;var dF=e=>{const{__scopeDropdownMenu:n,...r}=e,o=iF(n);return t.jsx(VI,{...o,...r})};dF.displayName="DropdownMenuPortal";var hF="DropdownMenuContent",fF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=aF(hF,r),a=iF(r),l=i.useRef(!1);return t.jsx(BI,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Gl(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Gl(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)"}})}));fF.displayName=hF;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(KI,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var pF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(HI,{...i,...o,ref:n})}));pF.displayName="DropdownMenuLabel";var mF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(WI,{...i,...o,ref:n})}));mF.displayName="DropdownMenuItem";var gF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(GI,{...i,...o,ref:n})}));gF.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(YI,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var vF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(QI,{...i,...o,ref:n})}));vF.displayName="DropdownMenuRadioItem";var yF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(XI,{...i,...o,ref:n})}));yF.displayName="DropdownMenuItemIndicator";var bF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(JI,{...i,...o,ref:n})}));bF.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(ZI,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var xF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(eF,{...i,...o,ref:n})}));xF.displayName="DropdownMenuSubTrigger";var wF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(tF,{...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)"}})}));wF.displayName="DropdownMenuSubContent";var SF=dF,CF=fF,kF=pF,EF=mF,jF=gF,PF=vF,TF=yF,_F=bF,NF=xF,DF=wF;const MF=lF,OF=uF;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(NF,{ref:i,className:Xd("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(_u,{className:"ml-auto"})]}))).displayName=NF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(DF,{ref:r,className:Xd("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=DF.displayName;const RF=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(SF,{children:t.jsx(CF,{ref:o,sideOffset:n,className:Xd("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})})));RF.displayName=CF.displayName;const AF=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(EF,{ref:o,className:Xd("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})));AF.displayName=EF.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(jF,{ref:i,className:Xd("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(TF,{children:t.jsx(ju,{className:"h-4 w-4"})})}),n]}))).displayName=jF.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(PF,{ref:o,className:Xd("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(TF,{children:t.jsx(Ru,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=PF.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(kF,{ref:o,className:Xd("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=kF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(_F,{ref:r,className:Xd("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=_F.displayName;const LF="reach-styles-module__stepIndicatorContainer___FoKXB",IF="reach-styles-module__iconContainer___Ki-1n",FF="reach-styles-module__checkIcon___-krUS",$F="reach-styles-module__minusIcon___r5cKs",qF="reach-styles-module__minusIconActive___-4JHM",zF="reach-styles-module__minusIconInactive___JtvVB",UF="reach-styles-module__label___tiCMA",VF="reach-styles-module__labelActive___EXydD",BF="reach-styles-module__labelInactive___g-J3r",KF=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:LF,children:[t.jsx("div",n?{className:IF,children:t.jsx(ju,{className:FF})}:{className:IF,children:t.jsx(Ku,{className:Xd($F,r?qF:zF)})}),t.jsx("span",{className:Xd(UF,r?VF:BF),children:e})]}),HF=({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(_x,{onClick:n,disabled:s,variant:"secondary",className:Xd("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(_x,{onClick:u,variant:"secondary",className:Xd("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(_x,{onClick:r,disabled:a,className:Xd("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),WF="reach-styles-module__header___-izE2",GF="reach-styles-module__title___n1hA9",YF="reach-styles-module__description___EvXM-",QF="reach-styles-module__content___okv68",XF="reach-styles-module__footer___YA4U4",JF=bu("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),ZF=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Xd(JF({variant:n}),e),...r})));ZF.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(WF,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(GF,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(YF,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(QF,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Xd(XF,e),...n}))).displayName="CardFooter";const e$=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},t$=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await pa("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var n$=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(n$||{});function r$(e,[t,n]){return Math.min(n,Math.max(t,e))}var o$=[" ","Enter","ArrowUp","ArrowDown"],i$=[" ","Enter"],s$="Select",[a$,l$,c$]=sc(s$),[u$,d$]=Zl(s$,[c$,vk]),h$=vk(),[f$,p$]=u$(s$),[m$,g$]=u$(s$),v$=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=h$(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=jA(d),[E=!1,j]=jc({prop:o,defaultProp:s,onChange:a}),[P,T]=jc({prop:l,defaultProp:c,onChange:u}),_=i.useRef(null),N=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(Ok,{...v,children:t.jsxs(f$,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:$S(),value:P,onValueChange:T,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:_,disabled:p,children:[t.jsx(a$.Provider,{scope:n,children:t.jsx(m$,{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})}),N?t.jsxs(rq,{"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(D)]},O):null]})})};v$.displayName=s$;var y$="SelectTrigger",b$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=h$(r),l=p$(y$,r),c=l.disabled||o,u=Xl(n,l.onTriggerChange),d=l$(r),h=i.useRef("touch"),[f,p,m]=oq((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=iq(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(Rk,{asChild:!0,...a,children:t.jsx(ac.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":nq(l.value)?"":void 0,...s,ref:u,onClick:Gl(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Gl(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:Gl(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||o$.includes(e.key)&&(g(),e.preventDefault())}))})})}));b$.displayName=y$;var x$="SelectValue",w$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=p$(x$,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Xl(n,c.onValueNodeChange);return Sc((()=>{u(d)}),[u,d]),t.jsx(ac.span,{...l,ref:h,style:{pointerEvents:"none"},children:nq(c.value)?t.jsx(t.Fragment,{children:a}):s})}));w$.displayName=x$;var S$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(ac.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));S$.displayName="SelectIcon";var C$=e=>t.jsx(Cc,{asChild:!0,...e});C$.displayName="SelectPortal";var k$="SelectContent",E$=i.forwardRef(((e,n)=>{const r=p$(k$,e.__scopeSelect),[o,a]=i.useState();if(Sc((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(P$,{scope:e.__scopeSelect,children:t.jsx(a$.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(_$,{...e,ref:n})}));E$.displayName=k$;var j$=10,[P$,T$]=u$(k$),_$=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=p$(k$,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Xl(n,(e=>S(e))),[j,P]=i.useState(null),[T,_]=i.useState(null),N=l$(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return _P(w)}),[w]),Mj();const R=i.useCallback((e=>{const[t,...n]=N().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}}),[N,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,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,$]=oq((e=>{const t=N().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=iq(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)&&_(e)}),[x.value]),V="popper"===o?D$:N$,B=V===D$?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(P$,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:T,position:o,isPositioned:D,searchRef:F,children:t.jsx(X_,{as:tc,allowPinchZoom:!0,children:t.jsx(kj,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Gl(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(gc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Gl(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=N().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()}}))})})})})})}));_$.displayName="SelectContentImpl";var N$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=p$(k$,r),l=T$(k$,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Xl(n,(e=>h(e))),p=l$(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-j$,l=r$(o,[j$,Math.max(j$,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-j$,u=r$(o,[j$,Math.max(j$,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*j$,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-j$,j=s-E,P=y.offsetHeight/2,T=h+f+(y.offsetTop+P),_=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+_+"px",v.scrollTop=T-E+v.offsetTop}c.style.margin=`${j$}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]);Sc((()=>w()),[w]);const[S,C]=i.useState();Sc((()=>{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(M$,{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(ac.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));N$.displayName="SelectItemAlignedPosition";var D$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=j$,...s}=e,a=h$(r);return t.jsx(Ak,{...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)"}})}));D$.displayName="SelectPopperPosition";var[M$,O$]=u$(k$,{}),R$="SelectViewport",A$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=T$(R$,r),l=O$(R$,r),c=Xl(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(a$.Slot,{scope:r,children:t.jsx(ac.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Gl(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*j$,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}))})})]})}));A$.displayName=R$;var L$="SelectGroup",[I$,F$]=u$(L$);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=$S();return t.jsx(I$,{scope:r,id:i,children:t.jsx(ac.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=L$;var $$="SelectLabel",q$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=F$($$,r);return t.jsx(ac.div,{id:i.id,...o,ref:n})}));q$.displayName=$$;var z$="SelectItem",[U$,V$]=u$(z$),B$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=p$(z$,r),u=T$(z$,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Xl(n,(e=>u.itemRefCallback?.(e,o,s))),v=$S(),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(U$,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(a$.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(ac.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:Gl(l.onFocus,(()=>m(!0))),onBlur:Gl(l.onBlur,(()=>m(!1))),onClick:Gl(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Gl(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Gl(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Gl(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Gl(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Gl(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(i$.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));B$.displayName=z$;var K$="SelectItemText",H$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=p$(K$,r),u=T$(K$,r),d=V$(K$,r),h=g$(K$,r),[f,p]=i.useState(null),m=Xl(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 Sc((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(ac.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));H$.displayName=K$;var W$="SelectItemIndicator",G$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return V$(W$,r).isSelected?t.jsx(ac.span,{"aria-hidden":!0,...o,ref:n}):null}));G$.displayName=W$;var Y$="SelectScrollUpButton",Q$=i.forwardRef(((e,n)=>{const r=T$(Y$,e.__scopeSelect),o=O$(Y$,e.__scopeSelect),[s,a]=i.useState(!1),l=Xl(n,o.onScrollButtonChange);return Sc((()=>{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(Z$,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Q$.displayName=Y$;var X$="SelectScrollDownButton",J$=i.forwardRef(((e,n)=>{const r=T$(X$,e.__scopeSelect),o=O$(X$,e.__scopeSelect),[s,a]=i.useState(!1),l=Xl(n,o.onScrollButtonChange);return Sc((()=>{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(Z$,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));J$.displayName=X$;var Z$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=T$("SelectScrollButton",r),l=i.useRef(null),c=l$(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),Sc((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(ac.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Gl(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Gl(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Gl(s.onPointerLeave,(()=>{u()}))})})),eq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(ac.div,{"aria-hidden":!0,...o,ref:n})}));eq.displayName="SelectSeparator";var tq="SelectArrow";function nq(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=h$(r),s=p$(tq,r),a=T$(tq,r);return s.open&&"popper"===a.position?t.jsx(Lk,{...i,...o,ref:n}):null})).displayName=tq;var rq=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Xl(n,s),l=iA(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(Pc,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function oq(e){const t=cc(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 iq(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}rq.displayName="BubbleSelect";var sq=b$,aq=S$,lq=C$,cq=E$,uq=A$,dq=q$,hq=B$,fq=H$,pq=G$,mq=Q$,gq=J$,vq=eq;const yq=v$,bq=w$,xq=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(sq,{ref:o,className:Xd("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(aq,{asChild:!0,children:t.jsx(Pu,{className:"h-4 w-4 opacity-50"})})]})));xq.displayName=sq.displayName;const wq=i.forwardRef((({className:e,...n},r)=>t.jsx(mq,{ref:r,className:Xd("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Nu,{className:"h-4 w-4"})})));wq.displayName=mq.displayName;const Sq=i.forwardRef((({className:e,...n},r)=>t.jsx(gq,{ref:r,className:Xd("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Pu,{className:"h-4 w-4"})})));Sq.displayName=gq.displayName;const Cq=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(lq,{children:t.jsxs(cq,{ref:i,className:Xd("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(wq,{}),t.jsx(uq,{className:Xd("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(Sq,{})]})})));Cq.displayName=cq.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(dq,{ref:r,className:Xd("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=dq.displayName;const kq=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(hq,{ref:o,className:Xd("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(pq,{children:t.jsx(ju,{className:"h-4 w-4"})})}),t.jsx(fq,{children:n})]})));kq.displayName=hq.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(vq,{ref:r,className:Xd("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=vq.displayName;const Eq=()=>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://cdn.embedreach.com/assets/engage/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(Mx,{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(Uu,{}),selected:!0})]})]})})]}),jq=({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"]})]}),Pq={all:["stripo"],token:()=>[...Pq.all,"token"],editorData:()=>[...Pq.all,"editorData"],templates:()=>[...Pq.all,"templates"],demoTemplate:()=>[...Pq.templates(),"demo"]},Tq=async()=>(await pa(`${fx}/editor-data`)).data,_q=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await pa(`${fx}/template/${e}`)).data)(e),...ca}),Nq=({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(lx,{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"})]}),Dq="UiEditorScript",Mq=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await pa(`${fx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(Dq))r();else{const e=document.createElement("script");e.id=Dq,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),Oq=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=_q(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:Pq.editorData(),queryFn:Tq,...ca}),invalidateEditorData:()=>e.invalidateQueries({queryKey:Pq.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=vL();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.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,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(Mq({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(lx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(Nq,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},Rq=({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}=mx(e.id),[_,N]=n.useState(!1),D=e$(x,500),M=e$(S,500),{channelSenders:O}=fL(),{channelAccounts:R}=t$(),{getCommunicationGroup:A}=mL(),{createCommunicationForAutomation:L}=gL(e.id,e),{updateCommunicationGroup:I}=vL(),{updateChannelSender:F}=pL(),{updateAutomation:$}=yx(e.id),[q,z]=n.useState({width:0,height:0}),[U,V]=n.useState({width:0,height:0}),B=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{B.current&&requestAnimationFrame((()=>{V({width:B.current?B.current.offsetWidth-100:0,height:B.current?B.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[B]),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=>{K(e)}})}),[r,A,e.action_data,e,o,O?.data]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.data?.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?.data,o,O]),n.useEffect((()=>{if(l){const e=O?.data?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.data?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.data,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?.data?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.data,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),B.current&&V({width:B.current.offsetWidth,height:B.current.offsetHeight})}}),T())}),[g,o,A,T,O?.data]),!R||!O)return t.jsx("div",{children:t.jsx(lx,{text:["Loading..."]})});const H=O.data?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.data?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case n$.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case n$.TWILLIO:return null;default:throw Ix(t.channel_account_metadata.type,n$)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(wT,{open:_,onOpenChange:N,children:t.jsxs(kT,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Email Preview Help"}),t.jsx(PT,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(Eq,{})]})}),t.jsx(wT,{open:g,onOpenChange:v,children:t.jsxs(kT,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Email Editor"}),t.jsx(PT,{children:"Learn more about the email editor and how to use it to create your email."})]}),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(mE,{title:"Click to learn more about email template ",onClick:()=>N(!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(Oq,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),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(JT,{children:"From Email"}),t.jsxs(yq,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(xq,{children:t.jsx(bq,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(Cq,{children:W?.map((e=>t.jsx(kq,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(JT,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(mE,{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(TT,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(JT,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(mE,{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(TT,{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(JT,{children:"Subject"}),t.jsx(TT,{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(JT,{children:"Preview Text"}),t.jsx(mE,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(TT,{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(_x,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.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(jq,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:B,children:t.jsx(SL,{html:p??"",height:U.height,width:U.width})})]})]})]})},Aq=async()=>(await pa("/businesses/me")).data,Lq=["me"],Iq=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Xd("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})));Iq.displayName="Textarea";const Fq=({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}=fL(),{data:k,isLoading:E}=ue({queryKey:Lq,queryFn:Aq,...ca}),{channelAccounts:j}=t$(),{createCommunicationForAutomation:P}=gL(e.id,e),{updateCommunicationGroup:T}=vL(),{getCommunicationGroup:_}=mL(),{getMergeFields:N,isGetting:D}=yL(),M=n.useRef(null),O=e$(m,1e3),R=e$(c,1e3),A=e$(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?T({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):P({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,T,P]),n.useEffect((()=>{v&&_(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,_,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.data?.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))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(lx,{text:["Loading..."]})});const I=C.data?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(wT,{open:w,onOpenChange:S,children:t.jsxs(kT,{children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"SMS Editor"}),t.jsx(PT,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(Iq,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(yq,{value:a,onValueChange:e=>{const t=M.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(xq,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(Cq,{children:N?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(kq,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(mE,{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(JT,{children:"From Number"}),t.jsxs(yq,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(xq,{children:t.jsx(bq,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(Cq,{children:I?.map((e=>t.jsx(kq,{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(JT,{children:"Company Name"}),t.jsx(mE,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(TT,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(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(_x,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(kL,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(wL,{type:"sms"})}):t.jsx(jq,{type:"sms"})})]})]})]})},$q=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Wl(),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(_x,{variant:e.includes("email")?"default":"outline",className:`${a}`,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(_x,{variant:e.includes("sms")?"default":"outline",className:`${a}`,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"]})]})]})},qq=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=mL(),{updateCommunicationGroup:c}=vL(),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(ZF,{className:"p-4 rounded-xl shadow-none",children:t.jsx($q,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(ZF,{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(ix.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(bh,{children:s?.includes("email")&&t.jsx(ix.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(Rq,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(ZF,{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(ix.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(bh,{children:s?.includes("sms")&&t.jsx(ix.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(Fq,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(lx,{text:["Loading..."]})})},zq=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=HT({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(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block 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(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(ix.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card: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 @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(ix.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card: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 @[250px]/card: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)))})]})})})]})},Uq=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(KD,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(Du,{className:"opacity-50"})]})}),t.jsx(WD,{className:"w-[200px] p-0",children:t.jsxs(mD,{children:[t.jsx(gD,{placeholder:r,className:"h-9"}),t.jsxs(vD,{children:[t.jsx(yD,{children:o}),t.jsx(bD,{children:e.map((e=>t.jsxs(wD,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(ju,{className:Xd("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Vq=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):NE(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(vj(o,"HH:mm")),{updateAutomation:d}=yx(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=NE(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:xx.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(KD,{children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",className:Xd("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(Eu,{className:"mr-2 h-4 w-4"}),o?vj(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(WD,{className:"w-auto p-0",children:t.jsx(HR,{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:Xd("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(Uq,{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=NE(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]})]})},Bq=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(ix.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(Mx,{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:xx.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(Mx,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(bh,{children:"schedule"===i&&t.jsx(ix.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(Vq,{automation:r})})})})]}),r.trigger_metadata?.scheduled_at&&t.jsxs(ix.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:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(ix.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(ix.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})})]})]})})})},Kq=({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}=yx(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=mL(),{channelSenders:d}=fL(),{channelAccounts:h}=t$(),[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?.data.find((e=>e.id===t)),o=v?.data.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.data.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case n$.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 n$.TWILLIO:break;default:throw Ix(n.channel_account_metadata.type,n$)}}if(o){const t=v?.data.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:xL(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.data,v?.data,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(lx,{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(EL,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(zq,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(ZF,{className:"p-4 shadow-sm border-none",children:t.jsx(Bq,{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"})})},Hq=({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(Mx,{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(Mx,{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})]})},Wq=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(oA,{selectedValues:l,setSelectedValues:c,options:u,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:[e=>t.jsxs(wD,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Gq=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Wq,{segments:r,allSegments:l?.data||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(_x,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(ix.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(bh,{children:u&&t.jsx(ix.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(Wq,{segments:o,allSegments:l?.data||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},Yq=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>zT()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=yx(r.id),[d,h]=n.useState(r.includeSegmentIds||[]),[f,p]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.data?.find((e=>e.type===VT.ALL_USERS&&e.id===d[0])),[g,v]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u]);const y=n.useCallback((()=>l?.data?.find((e=>e.type===VT.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=y();e&&h([e.id]),p([])}}),[g,l,y]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){v("all");const e=y();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}v(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,y,u,r.includeSegmentIds,r.excludeSegmentIds]),!c&&l&&s?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(wT,{open:o,modal:!0,onOpenChange:i,children:t.jsxs(kT,{hideCloseButton:!0,children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Create Segment"}),t.jsx(PT,{children:"Create a new segment to use in your automation."})]}),t.jsx(SA,{open:o,setOpen:i})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(ix.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Hq,{iconDefinitions:e,onSelectionChange:e=>{v(e)},defaultValue:g}),t.jsx(bh,{mode:"wait",children:"segments"===g&&t.jsx(ix.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(Gq,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?h((t=>[...t,e])):p((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?h((t=>t.filter((t=>t!==e)))):p((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(ix.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(zq,{iconDefinitions:e,includeSegments:d,excludeSegments:f,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(lx,{text:["Fetching segments","Finishing up"]})})},Qq=({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})]}),Xq=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i,onBeforeSchedule:s})=>{const{toast:a}=Wl(),[l,c]=n.useState(0),{automation:u}=mx(e),[d,h]=n.useState(!1),{updateAutomation:f}=yx(e),{getCommunicationGroup:p}=mL(),m=()=>{h(!0),f({status:wx.ACTIVE}),i(!1),a({title:"Automation scheduled!"})},{data:g}=HT({include_segments:u?.includeSegmentIds??[],exclude_segments:u?.excludeSegmentIds??[]}),v=n.useMemo((()=>g?.recipients?g.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}),[g?.recipients]);if(!u)return t.jsx("div",{children:t.jsx(lx,{text:["Fetching Automation data","Finishing up"]})});const y=[{id:"audience",title:"Choose Audience",isValid:()=>!!(u&&u.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!u.action_data?.length&&null!==u.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"})]}),y.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===l?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<l?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(KF,{label:e.title,isActive:n===l,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(bh,{mode:"wait",children:[0===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Choose Audience",content:t.jsx(Yq,{iconDefinitions:r,automation:u})})},"audience"),1===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Edit Content",content:t.jsx(qq,{automation:u,iconDefinitions:r})})},"content"),2===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Preview and Schedule",content:t.jsx(Kq,{automation:u,iconDefinitions:r,loading:d})})},"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(HF,{iconDefinitions:r,handleBack:()=>{c(l-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===l)return{canMove:u.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===l){const e=u.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)=>{p(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"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();if(e)if(2===l)if(s)try{g||await new Promise((e=>setTimeout(e,50)));const e=await s({estimatedEmailRecipients:v.emails,estimatedSmsRecipients:v.phones});!0===e?m():a({title:"Oops!",description:e,variant:"destructive"})}catch(n){a({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else m();else c(l+1);else a({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===l,backText:0===l?"Cancel":"Back",nextText:2===l?"Schedule":"Next",backDisabled:0===l,nextDisabled:2===l&&!(u.trigger_metadata?.scheduled_at&&new Date(u.trigger_metadata.scheduled_at)>new Date&&Boolean(u.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===l?"Save as Draft":void 0,thirdOptionOnClick:()=>{f({status:wx.DRAFT}),i(!1),a({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},Jq=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),Zq=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"))},ez=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=mL(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=bL(),{toast:y}=Wl(),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(TT,{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(_x,{onClick:()=>{if(!("email"===r?Jq(s):Zq(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(lx,{text:["Fetching sender id","Finishing up"]})})},tz=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l})=>{const c=zw(),[u,d]=n.useState(!1),[h,f]=n.useState(!1),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateAutomation:y}=yx(e.id),{invalidateAutomation:b}=mx(e.id),{toast:x}=Wl();n.useEffect((()=>{o&&d(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(wT,{open:u,onOpenChange:e=>{d(e),!1===e&&b()},children:t.jsxs(kT,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Edit Automation"}),t.jsx(PT,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Xq,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:d,logoUrl:s,onBeforeSchedule:l})]})}),t.jsx(wT,{open:p,onOpenChange:m,children:t.jsxs(kT,{className:"sm:max-w-[425px]",children:[t.jsx(jT,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(PT,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(_x,{variant:"outline",onClick:()=>m(!1),children:"Keep Running"}),t.jsx(_x,{variant:"destructive",onClick:()=>{y({status:wx.DEACTIVATED}),m(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(wT,{open:h,onOpenChange:f,children:t.jsxs(kT,{className:"",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Send Preview SMS"}),t.jsx(PT,{children:"Send a preview SMS to the automation."})]}),t.jsx(ez,{automation:e,type:"sms",setOpenSendPreviewPopup:f,iconDefinitions:r})]})}),t.jsx(wT,{open:g,onOpenChange:v,children:t.jsxs(kT,{className:"",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Send Preview Email"}),t.jsx(PT,{children:"Send a preview email to the automation."})]}),t.jsx(ez,{automation:e,type:"email",setOpenSendPreviewPopup:v,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(_x,{onClick:()=>c(-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($T,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(MF,{modal:!1,children:[t.jsx(OF,{asChild:!0,children:t.jsxs(_x,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(RF,{children:[e.status===wx.DRAFT&&t.jsx(AF,{onClick:()=>d(!0),children:"Edit"}),e.status===wx.ACTIVE&&t.jsx(AF,{onClick:()=>{y({status:wx.DRAFT})},children:"Convert to Draft"}),e.status!==wx.COMPLETED&&e.status!==wx.FAILED&&e.status!==wx.DEACTIVATED&&t.jsx(AF,{onClick:()=>m(!0),children:"Cancel"}),t.jsx(AF,{onClick:()=>f(!0),children:"Send Preview SMS"}),t.jsx(AF,{onClick:()=>v(!0),children:"Send Preview Email"}),t.jsx(AF,{onClick:async()=>{const{id:t}=await(async e=>(await pa(`${ux}`,{method:"POST",body:JSON.stringify({duplicate:!0,source_id:e})})).data)(e.id);t?(a&&a(t),x({title:"Automation duplicated!",description:"The automation has been duplicated"})):x({title:"Error duplicating automation",description:"Please try again"})},children:"Duplicate"})]})]})]}),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:vj(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===xx.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===xx.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:vj(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},nz=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l})=>{const c=Cx(e),u=function(){let{matches:e}=i.useContext(Aw),t=e[e.length-1];return t?t.params:{}}(),[d]=CS(),h=r||u?.automationId||d.get("automationId"),f=n||d.get("autoOpenEditPopup"),p="true"===d.get("showBackButton")||o,m=Cx(c),{automation:g,isFetching:v,isLoading:y,fetchError:b}=mx(h||"");return h?g||!v&&!y?b?t.jsxs("div",{children:["Error: ",b.message]}):g?t.jsxs("div",{className:Ax,children:[t.jsx(tz,{automation:g,iconDefinitions:m,autoOpenEditPopup:f,showBackButton:p,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l}),t.jsx("div",{className:"pt-4",children:t.jsxs(cL,{defaultValue:"content",children:[t.jsxs(uL,{children:[t.jsx(dL,{value:"content",children:"Content"}),t.jsx(dL,{value:"recipients",children:"Recipients"})]}),t.jsx(hL,{value:"recipients",children:t.jsx(PL,{automationId:h,iconDefinitions:m})}),t.jsx(hL,{value:"content",children:t.jsx(jL,{automationId:h,iconDefinitions:m})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:Ax,children:t.jsx(lx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var rz=e=>null!=e;var oz=e=>"function"!=typeof e||e.length?e:e(),iz=e=>Array.isArray(e)?e:e?[e]:[];var sz=$e;var az,lz=function(e){const[t,n]=Ne(),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=Ne(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(kY){return r(kY,`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(kY){r(kY,`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(kY){r(kY,`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(kY){r(kY,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(kY){r(kY,`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(kY){r(kY,`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(kY){r(kY,`Error getting all values from ${e.name}`)}}})),t}}]},cz=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},uz=("function"==typeof(az={_cookies:[globalThis.document,"cookie"],getItem:e=>uz._cookies[0][uz._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=uz.getItem(e);uz._cookies[0][uz._cookies[1]]=`${e}=${t}${cz(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:uz});window.dispatchEvent(o)},removeItem:e=>{uz._cookies[0][uz._cookies[1]]=`${e}=deleted${cz({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return uz._cookies[0][uz._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return uz._cookies[0][uz._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(az.clear=()=>{let e;for(;e=az.key(0);)az.removeItem(e)}),az),dz=796,hz="bottom",fz="system",pz=Object.keys(Zn)[0],mz=Object.keys(nr)[0],gz=Ke({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function vz(){return He(gz)}var yz=Ke(void 0),bz=e=>{const[t,n]=Ne(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[Rt]){for(let t of e[Rt].keys())e.removeEventListener(t,Gt);delete e[Rt]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(vz().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(SY){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)}})),It(["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=(vz().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(vz().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 dt(yz.Provider,{value:i,get children(){return e.children}})},xz=()=>Re((()=>{const e=He(yz);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),wz=Ke((()=>"dark"));function Sz(){return He(wz)}var Cz={"À":"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"},kz=Object.keys(Cz).join("|"),Ez=new RegExp(kz,"g");var jz=7,Pz=6,Tz=5,_z=4,Nz=3,Dz=2,Mz=1,Oz=0;function Rz(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:Mz,!n.accessors){const r=Az(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=$z(o),s=Iz(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:Oz,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=Az(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=Mz?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 Az(e,t,n){return e=Lz(e,n),(t=Lz(t,n)).length>e.length?Oz:e===t?jz:(e=e.toLowerCase())===(t=t.toLowerCase())?Pz:e.startsWith(t)?Tz:e.includes(` ${t}`)?_z:e.includes(t)?Nz:1===t.length?Oz:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?Dz: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 Mz+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return Oz;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return Oz}return i(r-s)}(e,t)}function Lz(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(Ez,(e=>Cz[e]))),e}function Iz(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 Fz={maxRanking:1/0,minRanking:-1/0};function $z(e){return"function"==typeof e?Fz:{...Fz,...e}}var qz={data:""},zz=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Uz=/\/\*[^]*?\*\/| +/g,Vz=/\n+/g,Bz=(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]?Bz(s,i):i+"{"+Bz(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=Bz(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+=Bz.p?Bz.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Kz={},Hz=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+Hz(e[n]);return t}return e};function Wz(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=Hz(e),s=Kz[i]||(Kz[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!Kz[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=zz.exec(e.replace(Uz,""));)t[4]?r.shift():t[3]?(n=t[3].replace(Vz," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Vz," ").trim();return r[0]})(e);Kz[s]=Bz(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&Kz.g?Kz.g:null;return n&&(Kz.g=Kz[s]),l=Kz[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?"":Bz(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||qz),t.g,t.o,t.k);var r}function Gz(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=Gz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yz(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Gz(e))&&(r&&(r+=" "),r+=t);return r}Wz.bind({g:1}),Wz.bind({k:1});var Qz=()=>{};function Xz(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ne([],{equals:!1}),[l]=[Ve,ze],c="remove"===t.exitMethod?Qz:e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u="remove"===t.exitMethod?Qz:"keep-index"===t.exitMethod?(e,t,n)=>e.splice(n,0,t):(e,t)=>e.push(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 Jz(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}var Zz=e=>e instanceof Element;function eU(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return eU(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=eU(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function tU(e,t=Zz,n=Zz){const r=Re(e),o=Re((()=>eU(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function nU(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function rU(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()))})),nU((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function oU(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())),nU((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var iU=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 Xz(tU((()=>e.children)).toArray,{appear:e.appear,exitMethod:"keep-index",onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)rU(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)oU(s,e,t,(()=>o([t])))}})},sU=Symbol("fallback");function aU(e){for(const t of e)t.dispose()}function lU(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>aU(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return aU(o.values()),o.clear(),r.fallback?[_e((e=>(o.set(sU,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(sU);if(!o.size||s){s?.dispose(),o.delete(sU);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){_e((s=>{const[a,l]=Ne(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ne(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 cU(e,t,n,r){const o=()=>{iz(oz(e)).forEach((e=>{e&&iz(oz(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),sz(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function uU(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=iz(oz(e)).filter(rz);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 dU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function hU(e){const t={};let n;for(;n=dU.exec(e);)t[n[1]]=n[2];return t}function fU(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=hU(e)}else"string"==typeof t&&(t=hU(t));return{...e,...t}}function pU(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function mU(e){return"[object String]"===Object.prototype.toString.call(e)}function gU(e){return t=>`${e()}-${t}`}function vU(e,t){return!!e&&(e===t||e.contains(t))}function yU(e,t=!1){const{activeElement:n}=bU(e);if(!n?.nodeName)return null;if(xU(n)&&n.contentDocument)return yU(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=bU(n).getElementById(e);if(t)return t}}return n}function bU(e){return e?e.ownerDocument||e:document}function xU(e){return"IFRAME"===e.tagName}var wU=(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))(wU||{});function SU(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function CU(){return SU(/^Mac/i)}function kU(){return SU(/^iPhone/i)||SU(/^iPad/i)||CU()&&navigator.maxTouchPoints>1}function EU(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function jU(e){return t=>{for(const n of e)EU(t,n)}}function PU(e){return CU()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function TU(e){if(e)if(function(){if(null==_U){_U=!1;try{document.createElement("div").focus({get preventScroll(){return _U=!0,!0}})}catch(SY){}}return _U}())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 _U=null;var NU=["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'])"],DU=[...NU,'[tabindex]:not([tabindex="-1"]):not([disabled])'],MU=NU.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",OU=DU.join(':not([hidden]):not([tabindex="-1"]),');function RU(e,t){const n=Array.from(e.querySelectorAll(MU)).filter(AU);return t&&AU(e)&&n.unshift(e),n.forEach(((e,t)=>{if(xU(e)&&e.contentDocument){const r=RU(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function AU(e){return LU(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function LU(e){return e.matches(MU)&&IU(e)}function IU(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||IU(e.parentElement,e))}function FU(e){for(;e&&!$U(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function $U(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qU(){}function zU(e,t){return gt(e,t)}var UU=new Map,VU=new Set;function BU(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=UU.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),UU.delete(t.target)),0===UU.size)){for(const e of VU)e();VU.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=UU.get(t.target);n||(n=new Set,UU.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function KU(e,t){const n=HU(e,t,"left"),r=HU(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 HU(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?BU():document.addEventListener("DOMContentLoaded",BU));var WU={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 GU(e){return t=>(e(t),()=>e(void 0))}function YU(e,t){const[n,r]=Ne(QU(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||QU(t?.()))})),n}function QU(e){return mU(e)?e:void 0}function XU(e){const[t,n]=vt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return dt(tn,gt(n,{get component(){return t.as}}))}var JU=["id","name","validationState","required","disabled","readOnly"];var ZU=Ke();function eV(){const e=He(ZU);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function tV(e){const t=eV(),n=zU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),dt(XU,gt({as:"div"},(()=>t.dataset()),n))}function nV(e){const t=eV(),n=zU({id:t.generateId("error-message")},e),[r,o]=vt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),dt(kt,{get when(){return r.forceMount||i()},get children(){return dt(XU,gt({as:"div"},(()=>t.dataset()),o))}})}function rV(e){let t;const n=eV(),r=zU({id:n.generateId("label")},e),[o,i]=vt(r,["ref"]),s=YU((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),dt(XU,gt({as:"label",ref(e){const n=Jz((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function oV(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 iV(e){const[t,n]=Ne(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 sV(e){const[t,n]=iV(e);return[()=>t()??!1,n]}var aV=Object.defineProperty,lV=(e,t)=>{for(var n in t)aV(e,n,{get:t[n],enumerable:!0})},cV=Ke();function uV(){return He(cV)}function dV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function hV(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?dV(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 fV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{hV(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 bU(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&hV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function pV(e={}){const[t,n]=function(e){const[t,n]=iV(e);return[()=>t()??[],n]}({value:()=>oz(e.items),onChange:t=>e.onItemsChange?.(t)});fV(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&&dV(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=>dt(cV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function mV(e){const t=function(){const e=uV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=zU({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function gV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=mU(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=mU(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(mU(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return mU(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(mU(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=gV({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 vV(e,t=[]){return Re((()=>{const n=gV({dataSource:oz(e.dataSource),getKey:oz(e.getKey),getTextValue:oz(e.getTextValue),getDisabled:oz(e.getDisabled),getSectionChildren:oz(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var yV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function xV(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return yV.has(t)}const t=e.split("-")[0];return bV.has(t)}(e)?"rtl":"ltr"}function wV(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:xV(e)}}var SV=wV(),CV=new Set;function kV(){SV=wV();for(const e of CV)e(SV)}var EV=Ke();function jV(){const e=function(){const[e,t]=Ne(SV),n=Re((()=>e()));return Fe((()=>{0===CV.size&&window.addEventListener("languagechange",kV),CV.add(t),$e((()=>{CV.delete(t),0===CV.size&&window.removeEventListener("languagechange",kV)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return He(EV)||e}var PV=new Map;var TV=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 _V(e){return CU()||kU()?e.altKey:e.ctrlKey}function NV(e){return CU()?e.metaKey:e.ctrlKey}function DV(e){return new TV(e)}function MV(e){const t=zU({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ne(!1),[o,i]=Ne(),s=Re((()=>{const e=oz(t.selectedKeys);return null!=e?DV(e):e})),a=Re((()=>{const e=oz(t.defaultSelectedKeys);return null!=e?DV(e):new TV})),[l,c]=function(e){const[t,n]=iV(e);return[()=>t()??new TV,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ne(oz(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===oz(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d(oz(t.selectionBehavior)??"toggle")})),{selectionMode:()=>oz(t.selectionMode),disallowEmptySelection:()=>oz(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!oz(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 OV(e,t,n){const r=gt({selectOnFocus:()=>"replace"===oz(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=jV();let s={top:0,left:0};cU((()=>oz(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]=Ne(""),[r,o]=Ne(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(oz(e.isDisabled))return;const s=oz(e.keyboardDelegate),a=oz(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:()=>oz(r.disallowTypeAhead),keyboardDelegate:()=>oz(r.keyboardDelegate),selectionManager:()=>oz(r.selectionManager)}),l=()=>oz(r.orientation)??"vertical",c=()=>{const e=oz(r.autoFocus);if(!e)return;const n=oz(r.selectionManager),o=oz(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&&!oz(r.shouldUseVirtualFocus)&&TU(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>oz(r.isVirtualized),()=>oz(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&&KU(t,e)}})));return{tabIndex:Re((()=>{if(!oz(r.shouldUseVirtualFocus))return null==oz(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{EU(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=oz(r.selectionManager),s=oz(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!_V(e)&&o.replaceSelection(t))},u=oz(r.keyboardDelegate),d=oz(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,NV(e));null!=t&&(o.setFocusedKey(t),NV(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,NV(e));null!=t&&(o.setFocusedKey(t),NV(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":NV(e)&&"multiple"===o.selectionMode()&&!0!==oz(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),oz(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!oz(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t,n){const r=t?.tabbable?OU:MU,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(r)||!IU(e)||n||t?.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});return t?.from&&(o.currentNode=t.from),o}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&TU(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=oz(r.selectionManager),n=oz(r.keyboardDelegate),i=oz(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(!oz(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(TU(n),KU(e,n))}}},onFocusOut:e=>{const t=oz(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function RV(e,t){const n=()=>oz(e.selectionManager),r=()=>oz(e.key),o=()=>oz(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()||NV(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>oz(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((()=>oz(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():TU(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||oz(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&oz(e.shouldSelectOnPressUp)&&oz(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(oz(e.shouldSelectOnPressUp)&&!oz(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(_V(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var AV=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 TV(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 TV(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 TV([t],t,t):new TV;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new TV;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 TV)}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}},LV=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 IV,FV=e=>"function"==typeof e?e():e,$V=e=>{const t=Re((()=>{const t=FV(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ne(FV(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=FV(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=FV(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}},qV="data-kb-top-layer",zV=!1,UV=[];function VV(e){return UV.findIndex((t=>t.node===e))}function BV(){return UV.filter((e=>e.isPointerBlocking))}function KV(){return BV().length>0}function HV(e){const t=VV([...BV()].slice(-1)[0]?.node);return VV(e)<t}var WV={layers:UV,isTopMostLayer:function(e){return UV[UV.length-1].node===e},hasPointerBlockingLayer:KV,isBelowPointerBlockingLayer:HV,addLayer:function(e){UV.push(e)},removeLayer:function(e){const t=VV(e);t<0||UV.splice(t,1)},indexOf:VV,find:function(e){return UV[VV(e)]},assignPointerEventToLayers:function(){for(const{node:e}of UV)e.style.pointerEvents=HV(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(KV()&&!zV){const t=bU(e);IV=document.body.style.pointerEvents,t.body.style.pointerEvents="none",zV=!0}},restoreBodyPointerEvents:function(e){if(KV())return;const t=bU(e);t.body.style.pointerEvents=IV,0===t.body.style.length&&t.body.removeAttribute("style"),zV=!1}};lV({},{Button:()=>QV,Root:()=>YV});var GV=["button","color","file","image","reset","submit"];function YV(e){let t;const n=zU({type:"button"},e),[r,o]=vt(n,["ref","type","disabled"]),i=YU((()=>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!==GV.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return dt(XU,gt({as:"button",ref(e){const n=Jz((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 QV=YV,XV=["top","right","bottom","left"],JV=Math.min,ZV=Math.max,eB=Math.round,tB=Math.floor,nB=e=>({x:e,y:e}),rB={left:"right",right:"left",bottom:"top",top:"bottom"},oB={start:"end",end:"start"};function iB(e,t,n){return ZV(e,JV(t,n))}function sB(e,t){return"function"==typeof e?e(t):e}function aB(e){return e.split("-")[0]}function lB(e){return e.split("-")[1]}function cB(e){return"x"===e?"y":"x"}function uB(e){return"y"===e?"height":"width"}function dB(e){return["top","bottom"].includes(aB(e))?"y":"x"}function hB(e){return cB(dB(e))}function fB(e){return e.replace(/start|end/g,(e=>oB[e]))}function pB(e){return e.replace(/left|right|bottom|top/g,(e=>rB[e]))}function mB(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 gB(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 vB(e,t,n){let{reference:r,floating:o}=e;const i=dB(t),s=hB(t),a=uB(s),l=aB(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(lB(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function yB(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}=sB(t,e),p=mB(f),m=a[h?"floating"===d?"reference":"floating":d],g=gB(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=gB(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 bB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xB(e){return XV.some((t=>e[t]>=0))}function wB(e){return kB(e)?(e.nodeName||"").toLowerCase():"#document"}function SB(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function CB(e){var t;return null==(t=(kB(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function kB(e){return e instanceof Node||e instanceof SB(e).Node}function EB(e){return e instanceof Element||e instanceof SB(e).Element}function jB(e){return e instanceof HTMLElement||e instanceof SB(e).HTMLElement}function PB(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof SB(e).ShadowRoot)}function TB(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=RB(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function _B(e){return["table","td","th"].includes(wB(e))}function NB(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(SY){return!1}}))}function DB(e){const t=MB(),n=EB(e)?RB(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 MB(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function OB(e){return["html","body","#document"].includes(wB(e))}function RB(e){return SB(e).getComputedStyle(e)}function AB(e){return EB(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function LB(e){if("html"===wB(e))return e;const t=e.assignedSlot||e.parentNode||PB(e)&&e.host||CB(e);return PB(t)?t.host:t}function IB(e){const t=LB(e);return OB(t)?e.ownerDocument?e.ownerDocument.body:e.body:jB(t)&&TB(t)?t:IB(t)}function FB(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=IB(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=SB(o);return i?t.concat(s,s.visualViewport||[],TB(o)?o:[],s.frameElement&&n?FB(s.frameElement):[]):t.concat(o,FB(o,[],n))}function $B(e){const t=RB(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jB(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=eB(n)!==i||eB(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function qB(e){return EB(e)?e:e.contextElement}function zB(e){const t=qB(e);if(!jB(t))return nB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$B(t);let s=(i?eB(n.width):n.width)/r,a=(i?eB(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var UB=nB(0);function VB(e){const t=SB(e);return MB()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:UB}function BB(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=qB(e);let s=nB(1);t&&(r?EB(r)&&(s=zB(r)):s=zB(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==SB(e))&&t}(i,n,r)?VB(i):nB(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=SB(i),t=r&&EB(r)?SB(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=zB(o),t=o.getBoundingClientRect(),r=RB(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=SB(o),o=n.frameElement}}return gB({width:u,height:d,x:l,y:c})}function KB(e){return BB(CB(e)).left+AB(e).scrollLeft}function HB(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=SB(e),r=CB(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=MB();(!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=CB(e),n=AB(e),r=e.ownerDocument.body,o=ZV(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ZV(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+KB(e);const a=-n.scrollTop;return"rtl"===RB(r).direction&&(s+=ZV(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(CB(e));else if(EB(t))r=function(e,t){const n=BB(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jB(e)?zB(e):nB(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=VB(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return gB(r)}function WB(e,t){const n=LB(e);return!(n===t||!EB(n)||OB(n))&&("fixed"===RB(n).position||WB(n,t))}function GB(e,t,n){const r=jB(t),o=CB(t),i="fixed"===n,s=BB(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=nB(0);if(r||!r&&!i)if(("body"!==wB(t)||TB(o))&&(a=AB(t)),r){const e=BB(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=KB(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function YB(e){return"static"===RB(e).position}function QB(e,t){return jB(e)&&"fixed"!==RB(e).position?t?t(e):e.offsetParent:null}function XB(e,t){const n=SB(e);if(NB(e))return n;if(!jB(e)){let t=LB(e);for(;t&&!OB(t);){if(EB(t)&&!YB(t))return t;t=LB(t)}return n}let r=QB(e,t);for(;r&&_B(r)&&YB(r);)r=QB(r,t);return r&&OB(r)&&YB(r)&&!DB(r)?n:r||function(e){let t=LB(e);for(;jB(t)&&!OB(t);){if(DB(t))return t;if(NB(t))return null;t=LB(t)}return null}(e)||n}var JB={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=CB(r),a=!!t&&NB(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=nB(1);const u=nB(0),d=jB(r);if((d||!d&&!i)&&(("body"!==wB(r)||TB(s))&&(l=AB(r)),jB(r))){const e=BB(r);c=zB(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:CB,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?NB(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=FB(e,[],!1).filter((e=>EB(e)&&"body"!==wB(e))),o=null;const i="fixed"===RB(e).position;let s=i?LB(e):e;for(;EB(s)&&!OB(s);){const t=RB(s),n=DB(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||TB(s)&&!n&&WB(e,s))?r=r.filter((e=>e!==s)):o=t,s=LB(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=HB(t,n,o);return e.top=ZV(r.top,e.top),e.right=JV(r.right,e.right),e.bottom=JV(r.bottom,e.bottom),e.left=ZV(r.left,e.left),e}),HB(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:XB,getElementRects:async function(e){const t=this.getOffsetParent||XB,n=this.getDimensions,r=await n(e.floating);return{reference:GB(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}=$B(e);return{width:t,height:n}},getScale:zB,isElement:EB,isRTL:function(e){return"rtl"===RB(e).direction}};function ZB(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=qB(e),u=o||i?[...c?FB(c):[],...FB(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=CB(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:-tB(u)+"px "+-tB(o.clientWidth-(c+d))+"px "+-tB(o.clientHeight-(u+h))+"px "+-tB(c)+"px",threshold:ZV(0,JV(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(SY){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?BB(e):null;return l&&function t(){const r=BB(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 eK=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=aB(n),a=lB(n),l="y"===dB(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=sB(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}}}}},tK=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}=sB(e,t),c={x:n,y:r},u=await yB(t,l),d=dB(aB(o)),h=cB(d);let f=c[h],p=c[d];if(i){f=iB(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=iB(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}}}}},nK=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}=sB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=aB(o),y=dB(a),b=aB(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[pB(a)]:function(e){const t=pB(e);return[fB(e),t,fB(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=lB(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[]}}(aB(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(fB)))),i}(a,m,p,x));const C=[a,...w],k=await yB(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=lB(e),o=hB(e),i=uB(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pB(s)),[s,pB(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 _;const e=null==(_=j.filter((e=>{if(S){const t=dB(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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},rK=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}=sB(e,t),l=await yB(t,a),c=aB(n),u=lB(n),d="y"===dB(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=JV(f-l[p],g),b=JV(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?JV(b,v):v:w=u||x?JV(y,g):g,x&&!u){const e=ZV(l.left,0),t=ZV(l.right,0),n=ZV(l.top,0),r=ZV(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:ZV(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:ZV(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}}:{}}}},oK=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=sB(e,t);switch(r){case"referenceHidden":{const e=bB(await yB(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:xB(e)}}}case"escaped":{const e=bB(await yB(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:xB(e)}}}default:return{}}}}},iK=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}=sB(e,t)||{};if(null==c)return{};const d=mB(u),h={x:n,y:r},f=hB(o),p=uB(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=JV(d[v],E),P=JV(d[y],E),T=j,_=C-m[p]-P,N=C/2-m[p]/2+k,D=iB(T,N,_),M=!l.arrow&&null!=lB(o)&&N!==D&&i.reference[p]/2-(N<T?j:P)-m[p]/2<0,O=M?N<T?N-T:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),sK=(e,t,n)=>{const r={platform:JB,...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}=vB(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}=vB(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},aK=Ke();function lK(){const e=He(aK);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var cK=Lt('<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">'),uK={top:180,right:-90,bottom:0,left:90};function dK(e){const t=lK(),n=zU({size:30},e),[r,o]=vt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ne();return Oe((()=>{const t=e();var r;t&&n((r=t,bU(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return dt(XU,gt({as:"div",ref(e){const n=Jz(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return fU({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=cK(),t=e.firstChild;return Me((()=>Ft(t,"transform",`rotate(${uK[i()]} 15 15) translate(0 2)`))),e}}))}function hK(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 fK(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var pK={top:"bottom",right:"left",bottom:"top",left:"right"};var mK=Object.assign((function(e){const t=zU({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]=Ne(),[o,i]=Ne(),[s,a]=Ne(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?hK(t):e?e.getBoundingClientRect():hK()}};var e,n},{direction:c}=jV();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=[eK((({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(fK))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(nK({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(tK({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(rK({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(oK({padding:t.detachedPadding})),i&&d.push(iK({element:i,padding:t.arrowPadding}));const h=await sK(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...JB,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=pK[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(ZB(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),dt(aK.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:dK,Context:aK,usePopperContext:lK,Positioner:function(e){const t=lK(),[n,r]=vt(e,["ref","style"]);return dt(XU,gt({as:"div",ref(e){const r=Jz(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return fU({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var gK="interactOutside.pointerDownOutside",vK="interactOutside.focusOutside";var yK=Ke();function bK(e){let t;const n=He(yK),[r,o]=vt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=qU;const o=()=>bU(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(`[${qV}]`)&&!!vU(o(),r)&&!vU(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=jU([i,a]);r.addEventListener(gK,o,{once:!0});const s=new CustomEvent(gK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||PU(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=jU([s,a]);r.addEventListener(vK,o,{once:!0});const i=new CustomEvent(vK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{oz(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=>vU(t(),e)))||[...i].some((t=>vU(t,e)))),onPointerDownOutside:e=>{t&&!WV.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||WV.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===wU.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if(oz(e.isDisabled))return;const n=e.ownerDocument?.()??bU();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>bU(t),onEscapeKeyDown:e=>{t&&WV.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;WV.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);WV.assignPointerEventToLayers(),WV.disableBodyPointerEvents(t),$e((()=>{t&&(WV.removeLayer(t),e?.(),WV.assignPointerEventToLayers(),WV.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=WV.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,WV.assignPointerEventToLayers()),t&&WV.disableBodyPointerEvents(e),$e((()=>{WV.restoreBodyPointerEvents(e)}))}),{defer:!0}));return dt(yK.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function xK(e={}){const[t,n]=sV({value:()=>oz(e.open),defaultValue:()=>!!oz(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 wK={};lV(wK,{Description:()=>tV,ErrorMessage:()=>nV,Item:()=>jK,ItemControl:()=>PK,ItemDescription:()=>TK,ItemIndicator:()=>_K,ItemInput:()=>NK,ItemLabel:()=>DK,Label:()=>MK,RadioGroup:()=>RK,Root:()=>OK});var SK=Ke();function CK(){const e=He(SK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var kK=Ke();function EK(){const e=He(kK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function jK(e){const t=eV(),n=CK(),r=zU({id:`${t.generateId("item")}-${xt()}`},e),[o,i]=vt(r,["value","disabled","onPointerDown"]),[s,a]=Ne(),[l,c]=Ne(),[u,d]=Ne(),[h,f]=Ne(),[p,m]=Ne(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{EU(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:gU((()=>i.id)),registerInput:GU(a),registerLabel:GU(c),registerDescription:GU(d),setIsFocused:m,setInputRef:f};return dt(kK.Provider,{value:x,get children(){return dt(XU,gt({as:"div",role:"group",onPointerDown:y},b,i))}})}function PK(e){const t=EK(),n=zU({id:t.generateId("control")},e),[r,o]=vt(n,["onClick","onKeyDown"]);return dt(XU,gt({as:"div",onClick:e=>{EU(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{EU(e,r.onKeyDown),e.key===wU.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function TK(e){const t=EK(),n=zU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),dt(XU,gt({as:"div"},(()=>t.dataset()),n))}function _K(e){const t=EK(),n=zU({id:t.generateId("indicator")},e),[r,o]=vt(n,["ref","forceMount"]),[i,s]=Ne(),{present:a}=$V({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return dt(kt,{get when(){return a()},get children(){return dt(XU,gt({as:"div",ref(e){const t=Jz(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function NK(e){const t=eV(),n=CK(),r=EK(),o=zU({id:r.generateId("input")},e),[i,s]=vt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ne(!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)))),dt(XU,gt({as:"input",ref(e){const t=Jz(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 fU({...WU},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(EU(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{EU(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{EU(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function DK(e){const t=EK(),n=zU({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),dt(XU,gt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function MK(e){return dt(rV,gt({as:"span"},e))}function OK(e){let t;const n=zU({id:`radiogroup-${xt()}`,orientation:"vertical"},e),[r,o,i]=vt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],JU),[s,a]=iV({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=zU({id:`form-control-${xt()}`},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(),[l,c]=Ne();return{formControlContext:{name:()=>oz(t.name)??oz(t.id),dataset:Re((()=>({"data-valid":"valid"===oz(t.validationState)?"":void 0,"data-invalid":"invalid"===oz(t.validationState)?"":void 0,"data-required":oz(t.required)?"":void 0,"data-disabled":oz(t.disabled)?"":void 0,"data-readonly":oz(t.readOnly)?"":void 0}))),validationState:()=>oz(t.validationState),isRequired:()=>oz(t.required),isDisabled:()=>oz(t.disabled),isReadOnly:()=>oz(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:gU((()=>oz(t.id))),registerLabel:GU(r),registerField:GU(i),registerDescription:GU(a),registerErrorMessage:GU(c)}}}(o);oV((()=>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 dt(ZU.Provider,{value:l,get children(){return dt(SK.Provider,{value:d,get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return oz(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(oz(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var RK=Object.assign(OK,{Description:tV,ErrorMessage:nV,Item:jK,ItemControl:PK,ItemDescription:TK,ItemIndicator:_K,ItemInput:NK,ItemLabel:DK,Label:MK}),AK=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 LK(e,t,n){const r=function(e){const{locale:t}=jV(),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 PV.has(r)&&(o=PV.get(r)),o||(o=new Intl.Collator(t(),e),PV.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return OV({selectionManager:()=>oz(e.selectionManager),keyboardDelegate:Re((()=>{const n=oz(e.keyboardDelegate);return n||new AK(e.collection,t,r)})),autoFocus:()=>oz(e.autoFocus),deferAutoFocus:()=>oz(e.deferAutoFocus),shouldFocusWrap:()=>oz(e.shouldFocusWrap),disallowEmptySelection:()=>oz(e.disallowEmptySelection),selectOnFocus:()=>oz(e.selectOnFocus),disallowTypeAhead:()=>oz(e.disallowTypeAhead),shouldUseVirtualFocus:()=>oz(e.shouldUseVirtualFocus),allowsTabNavigation:()=>oz(e.allowsTabNavigation),isVirtualized:()=>oz(e.isVirtualized),scrollToKey:t=>oz(e.scrollToKey)?.(t),orientation:()=>oz(e.orientation)},t)}var IK="focusScope.autoFocusOnMount",FK="focusScope.autoFocusOnUnmount",$K={bubbles:!1,cancelable:!0},qK={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=pU(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=pU(this.stack,e),this.active()?.resume()}};function zK(e,t){const[n,r]=Ne(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>bU(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,WU),e},u=()=>{const e=t();return e?RU(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;qK.add(o);const n=yU(e);if(!vU(e,n)){const t=new CustomEvent(IK,$K);e.addEventListener(IK,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{TU(d()),yU(e)===n&&TU(e)}),0)}$e((()=>{e.removeEventListener(IK,s),setTimeout((()=>{const r=new CustomEvent(FK,$K);(()=>{const e=t();if(!e)return!1;const n=yU(e);return!!n&&!vU(e,n)&&LU(n)})()&&r.preventDefault(),e.addEventListener(FK,a),e.dispatchEvent(r),r.defaultPrevented||TU(n??l().body),e.removeEventListener(FK,a),qK.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!oz(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${qV}]`)||(vU(r,t)?i=t:TU(i))},s=e=>{const t=e.relatedTarget??yU(r);t?.closest(`[${qV}]`)||vU(r,t)||TU(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!oz(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})();TU(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 UK="data-live-announcer";function VK(e){Oe((()=>{oz(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${UK}], [${qV}]`))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=BK.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),BK.set(e,t+1))};KK.length&&KK[KK.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 KK.push(a),()=>{s.disconnect();for(const e of r){const t=BK.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),BK.delete(e)):BK.set(e,t-1)}a===KK[KK.length-1]?(KK.pop(),KK.length&&KK[KK.length-1].observe()):KK.splice(KK.indexOf(a),1)}}(oz(e.targets),oz(e.root)))}))}var BK=new WeakMap,KK=[];var HK=new Map,WK=e=>{Oe((()=>{const t=FV(e.style)??{},n=FV(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=HK.get(e.key);o?o.activeCount++:HK.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=HK.get(e.key);if(t)if(1===t.activeCount){HK.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--}))}))},GK=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},YK=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[QK,XK]=Ne([]),JK=e=>[e.deltaX,e.deltaY],ZK=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],eH=(e,t,n,r)=>{const o=null!==r&&tH(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]=GK(o,t),u=c-e-r*l;0===l&&0===u||!YK(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)},tH=(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},nH=e=>{const t=gt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=xt();let r=[0,0],o=null,i=null;Oe((()=>{FV(t.enabled)&&(XK((e=>[...e,n])),$e((()=>{XK((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!FV(t.enabled)||!FV(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(FV(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===FV(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;WK({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{FV(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else WK({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,QK().indexOf(e)===QK().length-1&&FV(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=ZK(e),o=null,i=null},a=e=>{const n=e.target,r=FV(t.element),o=JK(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=eH(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!tH(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=FV(t.element),s=e.target;let a;if(2===e.touches.length)a=!FV(t.allowPinchZoom);else{if(null==o||null===i){const t=ZK(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=eH(s,o,i,n);a=!n||!tH(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},rH=Ke();function oH(){return He(rH)}function iH(){const e=oH();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var sH=Ke();function aH(){const e=He(sH);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var lH=Ke();function cH(){const e=He(lH);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function uH(e){let t;const n=cH(),r=iH(),o=zU({id:n.generateId(`item-${xt()}`)},e),[i,s]=vt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ne(),[c,u]=Ne(),[d,h]=Ne(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};mV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=RV({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{EU(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(TU(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{EU(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{EU(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(EU(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:gU((()=>s.id)),registerLabel:GU(l),registerDescription:GU(u)};return dt(sH.Provider,{value:C,get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((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 jU([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return jU([b,g.onPointerUp])},get onClick(){return jU([i.onClick,g.onClick])},get onKeyDown(){return jU([x,g.onKeyDown])},get onMouseDown(){return jU([i.onMouseDown,g.onMouseDown])},get onFocus(){return jU([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function dH(e){const t=zU({closeOnSelect:!1},e),[n,r]=vt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=sV({value:()=>oz(e.isSelected),defaultValue:()=>!!oz(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{oz(e.isReadOnly)||oz(e.isDisabled)||n(t)},toggle:()=>{oz(e.isReadOnly)||oz(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return dt(uH,gt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var hH=Ke();function fH(){return He(hH)}var pH={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>pH.next("ltr"===e?"rtl":"ltr",t)},mH=e=>"horizontal"===e?"ArrowDown":"ArrowRight",gH=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function vH(e){const t=cH(),n=iH(),r=fH(),{direction:o}=jV(),i=zU({id:t.generateId("trigger")},e),[s,a]=vt(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=YU((()=>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)))),dt(YV,gt({ref(e){const t=Jz(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=>{EU(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{EU(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{EU(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(EU(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case mH(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=FU(e);for(;e&&n&&e!==t&&n!==t;)KU(n,e),n=FU(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 gH(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case pH.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case pH.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{EU(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 yH=Ke();function bH(){return He(yH)}function xH(e){let t;const n=cH(),r=iH(),o=fH(),i=bH(),{direction:s}=jV(),a=zU({id:n.generateId(`content-${xt()}`)},e),[l,c]=vt(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=LK({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));zK({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:Jz((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:jU([l.onKeyDown,h.onKeyDown,e=>{if(vU(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case pH.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case pH.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:jU([l.onMouseDown,h.onMouseDown]),onFocusIn:jU([l.onFocusIn,h.onFocusIn]),onFocusOut:jU([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{EU(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(EU(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;vU(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return dt(kt,{get when(){return r.contentPresent()},get children(){return dt(kt,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return dt(XU,gt({as:"div"},(()=>r.dataset()),m,c))},get children(){return dt(mK.Positioner,{get children(){return dt(bK,gt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return fU({"--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 wH(e){let t;const n=cH(),r=iH(),[o,i]=vt(e,["ref"]);return nH({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),dt(xH,gt({ref(e){const n=Jz((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var SH=Ke();function CH(e){const t=zU({id:cH().generateId(`group-${xt()}`)},e),[n,r]=Ne(),o={generateId:gU((()=>t.id)),registerLabelId:GU(r)};return dt(SH.Provider,{value:o,get children(){return dt(XU,gt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function kH(e){const t=function(){const e=He(SH);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=zU({id:t.generateId("label")},e),[r,o]=vt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),dt(XU,gt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function EH(e){const t=iH();return dt(XU,gt({as:"span","aria-hidden":"true"},(()=>t.dataset()),zU({children:"▼"},e)))}function jH(e){return dt(uH,gt({role:"menuitem",closeOnSelect:!0},e))}function PH(e){const t=aH(),n=zU({id:t.generateId("description")},e),[r,o]=vt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),dt(XU,gt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function TH(e){const t=aH(),n=zU({id:t.generateId("indicator")},e),[r,o]=vt(n,["forceMount"]);return dt(kt,{get when(){return r.forceMount||t.isChecked()},get children(){return dt(XU,gt({as:"div"},(()=>t.dataset()),o))}})}function _H(e){const t=aH(),n=zU({id:t.generateId("label")},e),[r,o]=vt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),dt(XU,gt({as:"div",ref(e){const n=Jz(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function NH(e){const t=iH();return dt(kt,{get when(){return t.contentPresent()},get children(){return dt(en,e)}})}var DH=Ke();function MH(e){const t=zU({id:cH().generateId(`radiogroup-${xt()}`)},e),[n,r]=vt(t,["value","defaultValue","onChange","disabled"]),[o,i]=iV({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return dt(DH.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return dt(CH,r)}})}function OH(e){const t=function(){const e=He(DH);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=zU({closeOnSelect:!1},e),[r,o]=vt(n,["value","onSelect"]);return dt(uH,gt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function RH(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 AH(e){const t=cH(),n=uV(),r=oH(),o=fH(),i=bH(),s=zU({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=vt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=Ne(),[p,m]=Ne(),[g,v]=Ne(),[y,b]=Ne(),[x,w]=Ne(!0),[S,C]=Ne(l.placement),[k,E]=Ne([]),[j,P]=Ne([]),{DomCollectionProvider:T}=pV({items:j,onItemsChange:P}),_=xK({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:N}=$V({show:()=>t.forceMount()||_.isOpen(),element:()=>y()??null}),D=function(e){const t=MV(e),n=vV({dataSource:()=>oz(e.dataSource),getKey:()=>oz(e.getKey),getTextValue:()=>oz(e.getTextValue),getDisabled:()=>oz(e.getDisabled),getSectionChildren:()=>oz(e.getSectionChildren),factory:t=>new LV(e.filter?e.filter(t):t)},[()=>e.filter]),r=new AV(n,t);return De((()=>{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),_.open()},O=(e=!1)=>{_.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(TU(e),D.selectionManager().setFocused(!0),D.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};VK({isDisabled:()=>!(null==r&&_.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&&_.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":_.isOpen()?"":void 0,"data-closed":_.isOpen()?void 0:""}))),isOpen:_.isOpen,contentPresent:N,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),_.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=>pU(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:GU(f),registerContentId:GU(m)};return dt(T,{get children(){return dt(rH.Provider,{value:I,get children(){return dt(kt,{when:void 0===i,get fallback(){return l.children},get children(){return dt(mK,gt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function LH(e){const{direction:t}=jV();return dt(AH,gt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var IH=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function FH(e){const t=iH(),n=cH(),[r,o]=vt(e,["onFocusOutside","onKeyDown"]),{direction:i}=jV();return dt(xH,gt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;vU(t.triggerRef(),n)||t.close()},onKeyDown:e=>{EU(e,r.onKeyDown);const o=vU(e.currentTarget,e.target),s=IH(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),TU(t.triggerRef()))}},o))}var $H=["Enter"," "],qH=(e,t)=>"ltr"===e?[...$H,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...$H,"horizontal"===t?"ArrowLeft":"ArrowUp"];function zH(e){let t;const n=cH(),r=iH(),o=zU({id:n.generateId(`sub-trigger-${xt()}`)},e),[i,s]=vt(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}=jV(),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=RV({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{EU(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{EU(e,i.onKeyDown),e.repeat||i.disabled||qH(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()})),dt(XU,gt({as:"div",ref(e){const n=Jz((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 jU([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return jU([i.onPointerUp,h.onPointerUp])},get onClick(){return jU([f,h.onClick])},get onKeyDown(){return jU([p,h.onKeyDown])},get onMouseDown(){return jU([i.onMouseDown,h.onMouseDown])},get onFocus(){return jU([i.onFocus,h.onFocus])},onPointerMove:e=>{if(EU(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)),TU(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(EU(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:RH(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 UH(e){const t=fH(),n=zU({id:`menu-${xt()}`,modal:!0},e),[r,o]=vt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=xK({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:gU((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return dt(lH.Provider,{value:s,get children(){return dt(AH,gt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function VH(e){let t;const n=zU({orientation:"horizontal"},e),[r,o]=vt(n,["ref","orientation"]),i=YU((()=>t),(()=>"hr"));return dt(XU,gt({as:"hr",ref(e){const n=Jz((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))}lV({},{Root:()=>VH,Separator:()=>BH});var BH=VH,KH={};function HH(e){const t=cH(),n=iH(),[r,o]=vt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return dt(wH,gt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||TU(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function WH(e){return dt(UH,zU({id:`dropdownmenu-${xt()}`},e))}lV(KH,{Arrow:()=>dK,CheckboxItem:()=>dH,Content:()=>HH,DropdownMenu:()=>GH,Group:()=>CH,GroupLabel:()=>kH,Icon:()=>EH,Item:()=>jH,ItemDescription:()=>PH,ItemIndicator:()=>TH,ItemLabel:()=>_H,Portal:()=>NH,RadioGroup:()=>MH,RadioItem:()=>OH,Root:()=>WH,Separator:()=>VH,Sub:()=>LH,SubContent:()=>FH,SubTrigger:()=>zH,Trigger:()=>vH});var GH=Object.assign(WH,{Arrow:dK,CheckboxItem:dH,Content:HH,Group:CH,GroupLabel:kH,Icon:EH,Item:jH,ItemDescription:PH,ItemIndicator:TH,ItemLabel:_H,Portal:NH,RadioGroup:MH,RadioItem:OH,Separator:VH,Sub:LH,SubContent:FH,SubTrigger:zH,Trigger:vH}),YH={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:{100:"ff",90:"e5",80:"cc",70:"b3",60:"99",50:"80",40:"66",30:"4d",20:"33",10:"1a",0:"00"},font:{size:{"2xs":"calc(var(--tsqd-font-size) * 0.625)",xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)",lg:"calc(var(--tsqd-font-size) * 1.125)",xl:"calc(var(--tsqd-font-size) * 1.25)","2xl":"calc(var(--tsqd-font-size) * 1.5)","3xl":"calc(var(--tsqd-font-size) * 1.875)","4xl":"calc(var(--tsqd-font-size) * 2.25)","5xl":"calc(var(--tsqd-font-size) * 3)","6xl":"calc(var(--tsqd-font-size) * 3.75)","7xl":"calc(var(--tsqd-font-size) * 4.5)","8xl":"calc(var(--tsqd-font-size) * 6)","9xl":"calc(var(--tsqd-font-size) * 8)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)",lg:"calc(var(--tsqd-font-size) * 1.75)",xl:"calc(var(--tsqd-font-size) * 2)","2xl":"calc(var(--tsqd-font-size) * 2.25)","3xl":"calc(var(--tsqd-font-size) * 2.5)","4xl":"calc(var(--tsqd-font-size) * 2.75)","5xl":"calc(var(--tsqd-font-size) * 3)","6xl":"calc(var(--tsqd-font-size) * 3.25)","7xl":"calc(var(--tsqd-font-size) * 3.5)","8xl":"calc(var(--tsqd-font-size) * 3.75)","9xl":"calc(var(--tsqd-font-size) * 4)"},weight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"}},breakpoints:{xs:"320px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},border:{radius:{none:"0px",xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",md:"calc(var(--tsqd-font-size) * 0.375)",lg:"calc(var(--tsqd-font-size) * 0.5)",xl:"calc(var(--tsqd-font-size) * 0.75)","2xl":"calc(var(--tsqd-font-size) * 1)","3xl":"calc(var(--tsqd-font-size) * 1.5)",full:"9999px"}},size:{0:"0px",.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)",5.5:"calc(var(--tsqd-font-size) * 1.375)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",7:"calc(var(--tsqd-font-size) * 1.75)",8:"calc(var(--tsqd-font-size) * 2)",9:"calc(var(--tsqd-font-size) * 2.25)",10:"calc(var(--tsqd-font-size) * 2.5)",11:"calc(var(--tsqd-font-size) * 2.75)",12:"calc(var(--tsqd-font-size) * 3)",14:"calc(var(--tsqd-font-size) * 3.5)",16:"calc(var(--tsqd-font-size) * 4)",20:"calc(var(--tsqd-font-size) * 5)",24:"calc(var(--tsqd-font-size) * 6)",28:"calc(var(--tsqd-font-size) * 7)",32:"calc(var(--tsqd-font-size) * 8)",36:"calc(var(--tsqd-font-size) * 9)",40:"calc(var(--tsqd-font-size) * 10)",44:"calc(var(--tsqd-font-size) * 11)",48:"calc(var(--tsqd-font-size) * 12)",52:"calc(var(--tsqd-font-size) * 13)",56:"calc(var(--tsqd-font-size) * 14)",60:"calc(var(--tsqd-font-size) * 15)",64:"calc(var(--tsqd-font-size) * 16)",72:"calc(var(--tsqd-font-size) * 18)",80:"calc(var(--tsqd-font-size) * 20)",96:"calc(var(--tsqd-font-size) * 24)"},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"},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800}},QH=Lt('<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>'),XH=Lt('<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>'),JH=Lt('<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>'),ZH=Lt('<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>'),eW=Lt('<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>'),tW=Lt('<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>'),nW=Lt('<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>'),rW=Lt('<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>'),oW=Lt('<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">'),iW=Lt('<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">'),sW=Lt('<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>'),aW=Lt('<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>'),lW=Lt('<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>'),cW=Lt('<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>'),uW=Lt('<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>'),dW=Lt('<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>'),hW=Lt('<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>'),fW=Lt('<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>'),pW=Lt('<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>'),mW=Lt('<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>'),gW=Lt('<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>'),vW=Lt('<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>'),yW=Lt('<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 bW(){return QH()}function xW(){return XH()}function wW(){return JH()}function SW(){return ZH()}function CW(){return eW()}function kW(){return(e=eW()).style.setProperty("transform","rotate(90deg)"),e;var e}function EW(){return(e=eW()).style.setProperty("transform","rotate(-90deg)"),e;var e}function jW(){return tW()}function PW(){return nW()}function TW(){return rW()}function _W(){return oW()}function NW(){return iW()}function DW(){return sW()}function MW(){return aW()}function OW(){return lW()}function RW(){return cW()}function AW(e){return t=uW(),n=t.firstChild,Me((()=>Ft(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function LW(){return dW()}function IW(){return hW()}function FW(e){return[dt(kt,{get when(){return e.checked},get children(){var t=uW(),n=t.firstChild;return Me((()=>Ft(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),dt(kt,{get when(){return!e.checked},get children(){var t=fW(),n=t.firstChild;return Me((()=>Ft(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function $W(){return pW()}function qW(){return mW()}function zW(){return gW()}function UW(){return vW()}function VW(){const e=xt();return t=yW(),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,N=(_=(T=j.nextSibling).nextSibling).firstChild,M=(D=_.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,B=(V=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=V.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=(De=(Ne=(_e=(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,Ft(n,"id",`a-${e}`),Ft(r,"fill",`url(#a-${e})`),Ft(i,"id",`am-${e}`),Ft(s,"id",`b-${e}`),Ft(a,"filter",`url(#am-${e})`),Ft(l,"mask",`url(#b-${e})`),Ft(u,"id",`ah-${e}`),Ft(d,"id",`k-${e}`),Ft(h,"filter",`url(#ah-${e})`),Ft(f,"mask",`url(#k-${e})`),Ft(m,"id",`ae-${e}`),Ft(g,"id",`j-${e}`),Ft(v,"filter",`url(#ae-${e})`),Ft(y,"mask",`url(#j-${e})`),Ft(x,"id",`ai-${e}`),Ft(w,"id",`i-${e}`),Ft(S,"filter",`url(#ai-${e})`),Ft(C,"mask",`url(#i-${e})`),Ft(E,"id",`aj-${e}`),Ft(j,"id",`h-${e}`),Ft(P,"filter",`url(#aj-${e})`),Ft(T,"mask",`url(#h-${e})`),Ft(N,"id",`ag-${e}`),Ft(D,"id",`g-${e}`),Ft(M,"filter",`url(#ag-${e})`),Ft(O,"mask",`url(#g-${e})`),Ft(A,"id",`af-${e}`),Ft(L,"id",`f-${e}`),Ft(I,"filter",`url(#af-${e})`),Ft(F,"mask",`url(#f-${e})`),Ft($,"id",`m-${e}`),Ft(q,"fill",`url(#m-${e})`),Ft(U,"id",`ak-${e}`),Ft(V,"id",`e-${e}`),Ft(B,"filter",`url(#ak-${e})`),Ft(K,"mask",`url(#e-${e})`),Ft(H,"id",`n-${e}`),Ft(W,"fill",`url(#n-${e})`),Ft(G,"id",`r-${e}`),Ft(Y,"fill",`url(#r-${e})`),Ft(Q,"id",`s-${e}`),Ft(X,"fill",`url(#s-${e})`),Ft(J,"id",`q-${e}`),Ft(Z,"fill",`url(#q-${e})`),Ft(ee,"id",`p-${e}`),Ft(te,"fill",`url(#p-${e})`),Ft(ne,"id",`o-${e}`),Ft(re,"fill",`url(#o-${e})`),Ft(oe,"id",`l-${e}`),Ft(ie,"fill",`url(#l-${e})`),Ft(ae,"id",`al-${e}`),Ft(le,"id",`d-${e}`),Ft(ce,"filter",`url(#al-${e})`),Ft(ue,"mask",`url(#d-${e})`),Ft(de,"id",`u-${e}`),Ft(he,"fill",`url(#u-${e})`),Ft(pe,"id",`ad-${e}`),Ft(me,"id",`c-${e}`),Ft(ge,"filter",`url(#ad-${e})`),Ft(ve,"mask",`url(#c-${e})`),Ft(ye,"id",`t-${e}`),Ft(be,"fill",`url(#t-${e})`),Ft(xe,"id",`v-${e}`),Ft(we,"stroke",`url(#v-${e})`),Ft(Se,"id",`aa-${e}`),Ft(Ce,"stroke",`url(#aa-${e})`),Ft(ke,"id",`w-${e}`),Ft(Ee,"stroke",`url(#w-${e})`),Ft(je,"id",`ac-${e}`),Ft(Pe,"stroke",`url(#ac-${e})`),Ft(Te,"id",`ab-${e}`),Ft(_e,"stroke",`url(#ab-${e})`),Ft(Ne,"id",`y-${e}`),Ft(De,"stroke",`url(#y-${e})`),Ft(Me,"id",`x-${e}`),Ft(Oe,"stroke",`url(#x-${e})`),Ft(Re,"id",`z-${e}`),Ft(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,V,B,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,_e,Ne,De,Me,Oe,Re,Ae}var BW=Lt('<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>'),KW=Lt('<button title="Copy object to clipboard">'),HW=Lt('<button title="Remove all items"aria-label="Remove all items">'),WW=Lt('<button title="Delete item"aria-label="Delete item">'),GW=Lt('<button title="Toggle value"aria-label="Toggle value">'),YW=Lt('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),QW=Lt("<div>"),XW=Lt("<div><button> <span></span> <span> "),JW=Lt("<input>"),ZW=Lt("<span>"),eG=Lt("<div><span>:"),tG=Lt("<div><div><button> [<!>...<!>]");var nG=e=>{const t=Sz(),n=vz().shadowDOMTarget?Wz.bind({target:vz().shadowDOMTarget}):Wz,r=Re((()=>"dark"===t()?dG(n):uG(n)));return o=BW(),Me((()=>$t(o,Yz(r().expander,n`
52
+ */DN.exports="production"===process.env.NODE_ENV?function(){if(wN)return MN;wN=1;var e="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},t=n.useState,r=n.useEffect,o=n.useLayoutEffect,i=n.useDebugValue;function s(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!e(t,r)}catch(o){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,n){var a=n(),l=t({inst:{value:a,getSnapshot:n}}),c=l[0].inst,u=l[1];return o((function(){c.value=a,c.getSnapshot=n,s(c)&&u({inst:c})}),[e,a,n]),r((function(){return s(c)&&u({inst:c}),e((function(){s(c)&&u({inst:c})}))}),[e]),i(a),a};return MN.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:a,MN}():(ON||(ON=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=n,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(n,u){l||void 0===t.startTransition||(l=!0);var d=u();if(!c){var h=u();r(d,h)||(c=!0)}var f=(h=o({inst:{value:d,getSnapshot:u}}))[0].inst,p=h[1];return s((function(){f.value=d,f.getSnapshot=u,e(f)&&p({inst:f})}),[n,d,u]),i((function(){return e(f)&&p({inst:f}),n((function(){e(f)&&p({inst:f})}))}),[n]),a(d),d};RN.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),RN);var AN=DN.exports,LN='[cmdk-group=""]',IN='[cmdk-group-items=""]',FN='[cmdk-item=""]',$N=`${FN}:not([aria-disabled="true"])`,qN="cmdk-item-select",zN="data-value",UN=(e,t,n)=>l_(e,t,n),VN=i.createContext(void 0),BN=()=>i.useContext(VN),KN=i.createContext(void 0),HN=()=>i.useContext(KN),WN=i.createContext(void 0),GN=i.forwardRef(((e,t)=>{let n=lD((()=>{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=lD((()=>new Set)),o=lD((()=>new Map)),s=lD((()=>new Map)),a=lD((()=>new Set)),l=sD(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=$S(),x=$S(),w=$S(),S=i.useRef(null),C=hD();aD((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),aD((()=>{C(6,N)}),[]);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)_(),P(),C(1,T);else if("value"===e&&(r||C(5,N),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,(()=>{_(),P(),n.current.value||T(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{_(),(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"],getDisablePointerSelection:()=>l.current.disablePointerSelection,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:UN;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(IN);t?t.appendChild(e.parentElement===t?e:e.closest(`${IN} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${IN} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{var t;let n=null==(t=S.current)?void 0:t.querySelector(`${LN}[${zN}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)}))}function T(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(zN);k.setState("value",t||void 0)}function _(){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 N(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(LN))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${FN}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll($N))||[])}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(zN))}function R(e){var t;let n=D(),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(zN))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(LN);for(;r&&!t;)r=e>0?oD(r,LN):iD(r,LN),t=null==r?void 0:r.querySelector($N);t?k.setState("value",t.getAttribute(zN)):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(Ia.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=D();if(t){let e=new Event(qN);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:pD},c),fD(e,(e=>i.createElement(KN.Provider,{value:k},i.createElement(VN.Provider,{value:E},e)))))})),YN=i.forwardRef(((e,t)=>{var n,r;let o=$S(),s=i.useRef(null),a=i.useContext(WN),l=BN(),c=sD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;aD((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=dD(o,s,[e.value,e.children,s],e.keywords),h=HN(),f=uD((e=>e.value&&e.value===d.current)),p=uD((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(qN,m),()=>t.removeEventListener(qN,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(Ia.div,{ref:cD([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)})),QN=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=$S(),l=i.useRef(null),c=i.useRef(null),u=$S(),d=BN(),h=uD((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));aD((()=>d.group(a)),[]),dD(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(Ia.div,{ref:cD([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),fD(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(WN.Provider,{value:f},e)))))})),XN=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=uD((e=>!e.search));return n||s?i.createElement(Ia.div,{ref:cD([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),JN=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=HN(),a=uD((e=>e.search)),l=uD((e=>e.value)),c=BN(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${FN}[${zN}="${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(Ia.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)}})})),ZN=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=BN();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(Ia.div,{ref:cD([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},fD(e,(e=>i.createElement("div",{ref:cD([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),eD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(PN,{open:n,onOpenChange:r},i.createElement(TN,{container:a},i.createElement(_N,{"cmdk-overlay":"",className:o}),i.createElement(NN,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(GN,{ref:t,...l}))))})),tD=i.forwardRef(((e,t)=>uD((e=>0===e.filtered.count))?i.createElement(Ia.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),nD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(Ia.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},fD(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),rD=Object.assign(GN,{List:ZN,Item:YN,Input:JN,Group:QN,Separator:XN,Dialog:eD,Empty:tD,Loading:nD});function oD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function iD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function sD(e){let t=i.useRef(e);return aD((()=>{t.current=e})),t}var aD="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function lD(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function cD(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function uD(e){let t=HN(),n=()=>e(t.snapshot());return AN.useSyncExternalStore(t.subscribe,n,n)}function dD(e,t,n,r=[]){let o=i.useRef(),s=BN();return aD((()=>{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(zN,a),o.current=a})),o}var hD=()=>{let[e,t]=i.useState(),n=lD((()=>new Map));return aD((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function fD({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 pD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const mD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD,{ref:r,className:Pu("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));mD.displayName=rD.displayName;const gD=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(kc,{className:"mr-2 h-4 w-4 shrink-0 opacity-50 "}),t.jsx(rD.Input,{ref:o,className:Pu("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})]})));gD.displayName=rD.Input.displayName;const vD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.List,{ref:r,className:Pu("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));vD.displayName=rD.List.displayName;const yD=i.forwardRef(((e,n)=>t.jsx(rD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));yD.displayName=rD.Empty.displayName;const bD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Group,{ref:r,className:Pu("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})));bD.displayName=rD.Group.displayName;const xD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Separator,{ref:r,className:Pu("-mx-1 h-px bg-border",e),...n})));xD.displayName=rD.Separator.displayName;const wD=i.forwardRef((({className:e,...n},r)=>t.jsx(rD.Item,{ref:r,className:Pu("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})));wD.displayName=rD.Item.displayName;var SD="Popover",[CD,kD]=_a(SD,[vk]),ED=vk(),[jD,PD]=CD(SD),TD=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=ED(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=nl({prop:o,defaultProp:s,onChange:a});return t.jsx(Ok,{...c,children:t.jsx(jD,{scope:n,contentId:$S(),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})})};TD.displayName=SD;var _D="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=PD(_D,r),a=ED(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(Rk,{...a,...o,ref:n})})).displayName=_D;var ND="PopoverTrigger",DD=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=PD(ND,r),s=ED(r),a=Pa(n,i.triggerRef),l=t.jsx(Ia.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":UD(i.open),...o,ref:a,onClick:ka(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(Rk,{asChild:!0,...s,children:l})}));DD.displayName=ND;var MD="PopoverPortal",[OD,RD]=CD(MD,{forceMount:void 0}),AD=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=PD(MD,n);return t.jsx(OD,{scope:n,forceMount:r,children:t.jsx(el,{present:r||s.open,children:t.jsx(Za,{asChild:!0,container:i,children:o})})})};AD.displayName=MD;var LD="PopoverContent",ID=i.forwardRef(((e,n)=>{const r=RD(LD,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=PD(LD,e.__scopePopover);return t.jsx(el,{present:o||s.open,children:t.jsx(s.modal?FD:$D,{...i,ref:n})})}));ID.displayName=LD;var FD=i.forwardRef(((e,n)=>{const r=PD(LD,e.__scopePopover),o=i.useRef(null),s=Pa(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(X_,{as:Da,allowPinchZoom:!0,children:t.jsx(qD,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ka(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:ka(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:ka(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),$D=i.forwardRef(((e,n)=>{const r=PD(LD,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(qD,{...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()}})})),qD=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=PD(LD,r),p=ED(r);return Mj(),t.jsx(kj,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Ha,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(Ak,{"data-state":UD(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)"}})})})})),zD="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=PD(zD,r);return t.jsx(Ia.button,{type:"button",...o,ref:n,onClick:ka(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=zD;function UD(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=ED(r);return t.jsx(Lk,{...i,...o,ref:n})})).displayName="PopoverArrow";var VD=AD,BD=ID;const KD=TD,HD=DD,WD=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(VD,{children:t.jsx(BD,{ref:i,align:n,sideOffset:r,className:Pu("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})})));WD.displayName=BD.displayName;const GD=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(KD,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{"aria-expanded":s,className:"w-[200px] justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(ac,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(WD,{className:"w-[200px] p-0",children:t.jsxs(mD,{children:[t.jsx(gD,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(vD,{children:[t.jsxs(yD,{children:["No ",o.toLowerCase()," found."]}),t.jsx(bD,{children:e.map((e=>t.jsxs(wD,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(nc,{className:Pu("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function YD(e){return(YD="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 QD(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 XD(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function JD(e){XD(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===YD(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function ZD(e,t){XD(2,arguments);var n=JD(e),r=QD(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function eM(e,t){XD(2,arguments);var n=JD(e),r=QD(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 tM={};function nM(){return tM}function rM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 oM(e){return XD(1,arguments),rM(e,{weekStartsOn:1})}function iM(e){XD(1,arguments);var t=function(e){XD(1,arguments);var t=JD(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=oM(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=oM(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),oM(n)}function sM(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 aM(e){XD(1,arguments);var t=JD(e);return t.setHours(0,0,0,0),t}function lM(e,t){XD(2,arguments);var n=aM(e),r=aM(t),o=n.getTime()-sM(n),i=r.getTime()-sM(r);return Math.round((o-i)/864e5)}function cM(e,t){return XD(2,arguments),ZD(e,7*QD(t))}function uM(e,t){return XD(2,arguments),eM(e,12*QD(t))}function dM(e,t){XD(2,arguments);var n=aM(e),r=aM(t);return n.getTime()===r.getTime()}function hM(e){return XD(1,arguments),e instanceof Date||"object"===YD(e)&&"[object Date]"===Object.prototype.toString.call(e)}function fM(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function pM(e){XD(1,arguments);var t=JD(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function mM(e){XD(1,arguments);var t=JD(e);return t.setDate(1),t.setHours(0,0,0,0),t}function gM(e){XD(1,arguments);var t=JD(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function vM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 yM(e){return XD(1,arguments),vM(e,{weekStartsOn:1})}function bM(e,t){return XD(2,arguments),function(e,t){XD(2,arguments);var n=JD(e).getTime(),r=QD(t);return new Date(n+r)}(e,-QD(t))}function xM(e){XD(1,arguments);var t=JD(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 wM(e){XD(1,arguments);var t=JD(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=xM(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=xM(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function SM(e){XD(1,arguments);var t=JD(e),n=xM(t).getTime()-function(e){XD(1,arguments);var t=wM(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),xM(n)}(t).getTime();return Math.round(n/6048e5)+1}function CM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=JD(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 kM(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=JD(e),d=u.getUTCFullYear(),h=nM(),f=QD(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=CM(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=CM(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function EM(e,t){XD(1,arguments);var n=JD(e),r=CM(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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=kM(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),CM(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function jM(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var PM=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return jM("yy"===t?r%100:r,t.length)},TM=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):jM(n+1,2)},_M=function(e,t){return jM(e.getUTCDate(),t.length)},NM=function(e,t){return jM(e.getUTCHours()%12||12,t.length)},DM=function(e,t){return jM(e.getUTCHours(),t.length)},MM=function(e,t){return jM(e.getUTCMinutes(),t.length)},OM=function(e,t){return jM(e.getUTCSeconds(),t.length)},RM=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return jM(Math.floor(r*Math.pow(10,n-3)),t.length)},AM="midnight",LM="noon",IM="morning",FM="afternoon",$M="evening",qM="night",zM={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 PM(e,t)},Y:function(e,t,n,r){var o=kM(e,r),i=o>0?o:1-o;return"YY"===t?jM(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):jM(i,t.length)},R:function(e,t){return jM(wM(e),t.length)},u:function(e,t){return jM(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 jM(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 jM(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 TM(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 jM(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=EM(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):jM(o,t.length)},I:function(e,t,n){var r=SM(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):jM(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):_M(e,t)},D:function(e,t,n){var r=function(e){XD(1,arguments);var t=JD(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"}):jM(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 jM(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 jM(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 jM(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?LM:0===o?AM: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?$M:o>=12?FM:o>=4?IM:qM,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 NM(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):DM(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):jM(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):jM(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):MM(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):OM(e,t)},S:function(e,t){return RM(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return VM(o);case"XXXX":case"XX":return BM(o);default:return BM(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return VM(o);case"xxxx":case"xx":return BM(o);default:return BM(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UM(o,":");default:return"GMT"+BM(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UM(o,":");default:return"GMT"+BM(o,":")}},t:function(e,t,n,r){return jM(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return jM((r._originalDate||e).getTime(),t.length)}};function UM(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+jM(i,2)}function VM(e,t){return e%60==0?(e>0?"-":"+")+jM(Math.abs(e)/60,2):BM(e,t)}function BM(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+jM(Math.floor(o/60),2)+n+jM(o%60,2)}var KM=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"})}},HM=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"})}},WM={p:HM,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return KM(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}}",KM(o,t)).replace("{{time}}",HM(i,t))}},GM=["D","DD"],YM=["YY","YYYY"];function QM(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 XM={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 JM(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 ZM={date:JM({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:JM({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:JM({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},eO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function tO(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 nO={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:tO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:tO({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:tO({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:tO({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:tO({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 rO(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 oO={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:rO({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:rO({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:rO({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:rO({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:rO({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"})},iO={code:"en-US",formatDistance:function(e,t,n){var r,o=XM[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:ZM,formatRelative:function(e,t,n,r){return eO[e]},localize:nO,match:oO,options:{weekStartsOn:0,firstWeekContainsDate:1}},sO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,aO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lO=/^'([^]*?)'?$/,cO=/''/g,uO=/[a-zA-Z]/;function dO(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;XD(2,arguments);var w=String(t),S=nM(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:iO,k=QD(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=QD(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=JD(e);if(!function(e){if(XD(1,arguments),!hM(e)&&"number"!=typeof e)return!1;var t=JD(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var P=bM(j,sM(j)),T={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(aO).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,WM[t])(e,C.formatLong):e})).join("").match(sO).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(lO);if(!t)return e;return t[1].replace(cO,"'")}(r);var i=zM[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===YM.indexOf(r)||QM(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==GM.indexOf(e)}(r)||QM(r,t,String(e)),i(P,r,C.localize,T);if(o.match(uO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function hO(e){return XD(1,arguments),Math.floor(function(e){return XD(1,arguments),JD(e).getTime()}(e)/1e3)}function fO(e,t){var n,r,o,i,s,a,l,c;XD(1,arguments);var u=nM(),d=QD(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;XD(1,arguments);var u=JD(e),d=u.getFullYear(),h=nM(),f=QD(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=rM(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=rM(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),rM(f,t)}function pO(e,t){return XD(1,arguments),function(e,t,n){XD(2,arguments);var r=rM(e,n),o=rM(t,n),i=r.getTime()-sM(r),s=o.getTime()-sM(o);return Math.round((i-s)/6048e5)}(function(e){XD(1,arguments);var t=JD(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),mM(e),t)+1}function mO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getTime()>r.getTime()}function gO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getTime()<r.getTime()}function vO(e,t){XD(2,arguments);var n=JD(e),r=JD(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function yO(e,t){return XD(2,arguments),ZD(e,-QD(t))}function bO(e,t){XD(2,arguments);var n=JD(e),r=QD(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){XD(1,arguments);var t=JD(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 xO(e,t){XD(2,arguments);var n=JD(e),r=QD(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var wO=function(){return wO=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},wO.apply(this,arguments)};function SO(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 CO(e){return"multiple"===e.mode}function kO(e){return"range"===e.mode}function EO(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var jO={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 PO=Object.freeze({__proto__:null,formatCaption:function(e,t){return dO(e,"LLLL y",t)},formatDay:function(e,t){return dO(e,"d",t)},formatMonthCaption:function(e,t){return dO(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return dO(e,"cccccc",t)},formatYearCaption:function(e,t){return dO(e,"yyyy",t)}}),TO=Object.freeze({__proto__:null,labelDay:function(e,t,n){return dO(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 dO(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var _O=n.createContext(void 0);function NO(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:jO,formatters:PO,labels:TO,locale:iO,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=mM(r):t&&(i=new Date(t,0,1)),o?s=pM(o):n&&(s=new Date(n,11,31)),{fromDate:i?aM(i):void 0,toDate:s?aM(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"),(EO(o)||CO(o)||kO(o))&&(r=o.onSelect);var u=wO(wO(wO({},i),o),{captionLayout:c,classNames:wO(wO({},i.classNames),o.classNames),components:wO({},o.components),formatters:wO(wO({},i.formatters),o.formatters),fromDate:a,labels:wO(wO({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:wO(wO({},i.modifiers),o.modifiers),modifiersClassNames:wO(wO({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:wO(wO({},i.styles),o.styles),toDate:l});return t.jsx(_O.Provider,{value:u,children:e.children})}function DO(){var e=n.useContext(_O);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function MO(e){var n=DO();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 OO(e){return t.jsx("svg",wO({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 RO(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=DO(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:OO;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 AO(e){var n,r=DO(),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){XD(2,arguments);var n=JD(e),r=JD(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=mM(o),p=o.getMonth();p<=i.getMonth();p++)h.push(bO(f,p));else for(f=mM(new Date),p=0;p<=11;p++)h.push(bO(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:RO;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=bO(mM(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 LO(e){var n,r=e.displayMonth,o=DO(),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(xO(gM(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:RO;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=xO(mM(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 IO(){var e=DO(),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&&fM(n,t)<0&&(t=eM(n,-1*(i-1))),r&&fM(t,r)<0&&(t=r),mM(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=mM(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var FO=n.createContext(void 0);function $O(e){var n=DO(),r=IO(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=mM(e),i=fM(mM(eM(o,r)),o),s=[],a=0;a<i;a++){var l=eM(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=mM(e);if(!n)return eM(s,i);if(!(fM(n,e)<o))return eM(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=mM(e);if(!n)return eM(i,-o);if(!(fM(i,n)<=0))return eM(i,-o)}}(o,n),c=function(e){return s.some((function(t){return vO(e,t)}))};return t.jsx(FO.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&gO(e,t)?i(eM(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function qO(){var e=n.useContext(FO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function zO(e){var n,r=DO(),o=r.classNames,i=r.styles,s=r.components,a=qO().goToMonth,l=function(t){a(eM(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:MO,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(AO,{onChange:l,displayMonth:e.displayMonth}),t.jsx(LO,{onChange:l,displayMonth:e.displayMonth})]})}function UO(e){return t.jsx("svg",wO({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 VO(e){return t.jsx("svg",wO({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 BO=n.forwardRef((function(e,n){var r=DO(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=wO(wO({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",wO({},e,{ref:n,type:"button",className:a,style:l}))}));function KO(e){var n,r,o=DO(),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:VO,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:UO;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(BO,{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(BO,{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 HO(e){var n=DO().numberOfMonths,r=qO(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return vO(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(KO,{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 WO(e){var n,r,o=DO(),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:MO;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(zO,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(zO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(HO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(HO,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function GO(e){var n=DO(),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 YO(){var e=DO(),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?oM(new Date):rM(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=ZD(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 QO(){var e,n=DO(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:YO;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function XO(e){var n=DO();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var JO=n.createContext(void 0);function ZO(e){if(!CO(e.initialProps)){return t.jsx(JO.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(eR,{initialProps:e.initialProps,children:e.children})}function eR(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 dM(t,e)}));return Boolean(t&&!n)})),t.jsx(JO.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?SO([],o):[];if(t.selected){var u=c.findIndex((function(t){return dM(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 tR(){var e=n.useContext(JO);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var nR,rR,oR=n.createContext(void 0);function iR(e){if(!kO(e.initialProps)){return t.jsx(oR.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(sR,{initialProps:e.initialProps,children:e.children})}function sR(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],dM(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:yO(s,l-1),before:ZD(s,l-1)}),s&&a&&u.disabled.push({after:s,before:ZD(s,l-1)}),!s&&a&&u.disabled.push({after:yO(a,l-1),before:ZD(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:ZD(s,1-c)}),u.disabled.push({after:ZD(s,c-1)})),s&&a){var d=c-(lM(a,s)+1);u.disabled.push({before:yO(s,d)}),u.disabled.push({after:ZD(a,d)})}!s&&a&&(u.disabled.push({before:ZD(a,1-c)}),u.disabled.push({after:ZD(a,c-1)}))}return t.jsx(oR.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(dM(o,e)&&dM(r,e))return;if(dM(o,e))return{from:o,to:void 0};if(dM(r,e))return;return mO(r,e)?{from:e,to:o}:{from:r,to:e}}return o?mO(e,o)?{from:o,to:e}:{from:e,to:o}:r?gO(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 aR(){var e=n.useContext(oR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function lR(e){return Array.isArray(e)?SO([],e):void 0!==e?[e]:[]}(rR=nR||(nR={})).Outside="outside",rR.Disabled="disabled",rR.Selected="selected",rR.Hidden="hidden",rR.Today="today",rR.RangeStart="range_start",rR.RangeEnd="range_end",rR.RangeMiddle="range_middle";var cR=nR.Selected,uR=nR.Disabled,dR=nR.Hidden,hR=nR.Today,fR=nR.RangeEnd,pR=nR.RangeMiddle,mR=nR.RangeStart,gR=nR.Outside;var vR=n.createContext(void 0);function yR(e){var n=DO(),r=function(e,t,n){var r,o=((r={})[cR]=lR(e.selected),r[uR]=lR(e.disabled),r[dR]=lR(e.hidden),r[hR]=[e.today],r[fR]=[],r[pR]=[],r[mR]=[],r[gR]=[],r);return e.fromDate&&o[uR].push({before:e.fromDate}),e.toDate&&o[uR].push({after:e.toDate}),CO(e)?o[uR]=o[uR].concat(t.modifiers[uR]):kO(e)&&(o[uR]=o[uR].concat(n.modifiers[uR]),o[mR]=n.modifiers[mR],o[pR]=n.modifiers[pR],o[fR]=n.modifiers[fR]),o}(n,tR(),aR()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=lR(e[1])})),t}(n.modifiers),i=wO(wO({},r),o);return t.jsx(vR.Provider,{value:i,children:e.children})}function bR(){var e=n.useContext(vR);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function xR(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(hM(t))return dM(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(hM)}(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?(lM(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),lM(n,i)>=0&&lM(s,n)>=0):s?dM(s,n):!!i&&dM(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=lM(t.before,e)>0,l=lM(t.after,e)<0;return mO(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?lM(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?lM(t.before,e)>0:"function"==typeof t&&t(e)}))}function wR(e,t,n){var r=Object.keys(t).reduce((function(n,r){return xR(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!vO(e,n)&&(o.outside=!0),o}function SR(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:ZD,week:cM,month:eM,year:uM,startOfWeek:function(e){return o.ISOWeek?oM(e):rM(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?yM(e):vM(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(XD(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==YD(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=JD(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(XD(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==YD(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=JD(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=wR(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:SR(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:wO(wO({},a),{count:a.count+1})})}var CR=n.createContext(void 0);function kR(e){var r=qO(),o=bR(),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=mM(e[0]),i=pM(e[e.length-1]),s=o;s<=i;){var a=wR(s,t);if(a.disabled||a.hidden)s=ZD(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=ZD(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=DO(),m=function(e,t){if(s){var n=SR(s,{moveBy:e,direction:t,context:p,modifiers:o});dM(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(CR.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 ER(){var e=n.useContext(CR);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var jR=n.createContext(void 0);function PR(e){if(!EO(e.initialProps)){return t.jsx(jR.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(TR,{initialProps:e.initialProps,children:e.children})}function TR(e){var n=e.initialProps;return t.jsx(jR.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 _R(){var e=n.useContext(jR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function NR(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(nR).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function DR(e,r,o){var i,s,a,l=DO(),c=ER(),u=function(e,t){return wR(e,bR(),t)}(e,r),d=function(e,t){var n=DO(),r=_R(),o=tR(),i=aR(),s=ER(),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;EO(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):CO(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):kO(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=DO(),t=_R(),n=tR(),r=aR();return EO(e)?t.selected:CO(e)?n.selected:kO(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&dM(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=NR(l,u).join(" "),m=function(e,t){var n=wO({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=wO(wO({},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:XO,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&dM(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&dM(c.focusedDay,e),w=wO(wO(wO({},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 MR(e){var r=n.useRef(null),o=DR(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(BO,wO({name:"day",ref:r},o.buttonProps)):t.jsx("div",wO({},o.divProps))}function OR(e){var n=e.number,r=e.dates,o=DO(),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(BO,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function RR(e){var n,r,o,i=DO(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:MR,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:OR;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})},hO(n))}))]})}function AR(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?yM(t):vM(t,n),o=(null==n?void 0:n.ISOWeek)?oM(e):rM(e,n),i=lM(r,o),s=[],a=0;a<=i;a++)s.push(ZD(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){XD(1,arguments);var t=JD(e),n=oM(t).getTime()-iM(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){XD(1,arguments);var n=JD(e),r=rM(n,t).getTime()-fO(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 LR(e){var n,r,o,i=DO(),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=AR(mM(e),pM(e),t);if(null==t?void 0:t.useFixedWeeks){var r=pO(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=cM(i,6-r),a=AR(cM(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:QO,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:RR,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:GO;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 IR="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,FR=!1,$R=0;function qR(){return"react-day-picker-".concat(++$R)}function zR(e){var r,o,i=DO(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=qO().displayMonths,d=function(e){var t,r=null!=e?e:FR?qR():null,o=n.useState(r),i=o[0],s=o[1];return IR((function(){null===i&&s(qR())}),[]),n.useEffect((function(){!1===FR&&(FR=!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=wO(wO({},p),l.caption_start)),g&&(f.push(a.caption_end),p=wO(wO({},p),l.caption_end)),v&&(f.push(a.caption_between),p=wO(wO({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:WO;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(LR,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function UR(e){var n=DO();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function VR(e){var r,o,i=e.initialProps,s=DO(),a=ER(),l=qO(),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=wO(wO({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return wO(wO({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:UR;return t.jsx("div",wO({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(zR,{displayIndex:n,displayMonth:e},n)}))})}))}function BR(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(NO,{initialProps:r,children:t.jsx($O,{children:t.jsx(PR,{initialProps:r,children:t.jsx(ZO,{initialProps:r,children:t.jsx(iR,{initialProps:r,children:t.jsx(yR,{children:t.jsx(kR,{children:n})})})})})})})}function KR(e){return t.jsx(BR,wO({},e,{children:t.jsx(VR,{initialProps:e})}))}function HR({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(KR,{showOutsideDays:r,className:Pu("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:Pu(Tx({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:Pu("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:Pu(Tx({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(oc,{className:"h-4 w-4"}),IconRight:()=>t.jsx(ic,{className:"h-4 w-4"})},...o})}HR.displayName="Calendar";var WR=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(QR);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(GR,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(GR,{...o,ref:n,children:r})}));WR.displayName="Slot";var GR=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?ja(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));GR.displayName="SlotClone";var YR=({children:e})=>t.jsx(t.Fragment,{children:e});function QR(e){return i.isValidElement(e)&&e.type===YR}var XR=["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?WR: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}}),{}),JR="horizontal",ZR=["horizontal","vertical"],eA=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=JR,...i}=e,s=function(e){return ZR.includes(e)}(o)?o:JR;return t.jsx(XR.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));eA.displayName="Separator";var tA=eA;const nA=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(tA,{ref:i,decorative:r,orientation:n,className:Pu("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));nA.displayName=tA.displayName;const rA=Yl("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"}}),oA=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(kc,{className:"h-4 w-4 mr-2"}),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(KD,{open:b,onOpenChange:x,modal:l,children:[t.jsx(HD,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Pu("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",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(FT,{className:Pu(w?"animate-bounce":"",rA({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(cc,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(FT,{className:Pu("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",rA({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(cc,{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(Rc,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(nA,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(rc,{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(rc,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(WD,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(mD,{children:[t.jsx(gD,{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(vD,{children:[t.jsx(yD,{children:f}),t.jsxs(bD,{children:[t.jsxs(wD,{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:Pu("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(nc,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(wD,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Pu("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(nc,{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(xD,{}),t.jsx(bD,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(wD,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(nA,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(wD,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(Oc,{className:Pu("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function iA(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])}oA.displayName="MultiSelect";var sA="Switch",[aA,lA]=_a(sA),[cA,uA]=aA(sA),dA=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:h,...f}=e,[p,m]=i.useState(null),g=Pa(n,(e=>m(e))),v=i.useRef(!1),y=!p||(h||!!p.closest("form")),[b=!1,x]=nl({prop:s,defaultProp:a,onChange:d});return t.jsxs(cA,{scope:r,checked:b,disabled:c,children:[t.jsx(Ia.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":mA(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:ka(e.onClick,(e=>{x((e=>!e)),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())}))}),y&&t.jsx(pA,{control:p,bubbles:!v.current,name:o,value:u,checked:b,required:l,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})}));dA.displayName=sA;var hA="SwitchThumb",fA=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=uA(hA,r);return t.jsx(Ia.span,{"data-state":mA(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));fA.displayName=hA;var pA=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=iA(r),c=pk(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function mA(e){return e?"checked":"unchecked"}var gA=dA,vA=fA;const yA=i.forwardRef((({className:e,...n},r)=>t.jsx(gA,{className:Pu("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:r,children:t.jsx(vA,{className:Pu("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));yA.displayName=gA.displayName;const bA=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const[c,u]=i.useState(e===UT.Date&&r.length>0&&r[0]instanceof Date?r[0]:void 0);if(e===UT.String)return n===BT.EXISTS?null:t.jsx(oA,{maxCount:2,options:(s||[]).map((e=>({label:e,value:e}))),value:r.map((e=>e)),onValueChange:e=>{o(e.map((e=>e)))},selectedValues:r.map((e=>e)),setSelectedValues:e=>{o(e.map((e=>e)))},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case UT.String:return t.length>0;case UT.Number:return!isNaN(Number(t));case UT.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case UT.Boolean:return"true"===t||"false"===t;case UT.Date:case UT.DateTime:return!isNaN(new Date(t).getTime());default:throw Ix(n,UT)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===UT.Date)return t.jsx("div",{className:"grid gap-2",children:t.jsxs(KD,{modal:!0,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",className:Pu("w-[200px] justify-start text-left font-normal",!c&&"text-muted-foreground"),children:[t.jsx(tc,{className:"mr-2 h-4 w-4"}),c?vj(c,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(WD,{className:"w-auto p-0",align:"start",children:t.jsx(HR,{mode:"single",selected:c,onSelect:e=>{u(e),e&&o([e])},initialFocus:!0})})]})});if(e===UT.Number)return n===BT.EXISTS?null:t.jsx(TT,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===UT.Boolean){if(n===BT.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(yA,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(TT,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]"})},xA=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=Ca(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:UT.String,options:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:e_[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(GD,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:ZT[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case UT.Boolean:l=[!1];break;case UT.Number:l=[0];break;case UT.Date:l=[new Date];break;case UT.String:l=o.options?.length?[o.options[0]]:[""];break;default:l=[""]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(GD,{options:l.map((e=>({value:e,label:ZT[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx("div",{className:"max-w-2xl w-full overflow-hidden",children:t.jsx(bA,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...new Set([...e.value,...a.options])]:a.options,value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c}})})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(_x,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(dc,{className:"h-4 w-4"})}),t.jsx(_x,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Pc,{className:"h-4 w-4"})})]})]})};function wA({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=Ca(),[s,a]=i.useState(!1),[l,c]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:u,isLoading:d}=WT(e||""),{updateSegment:h}=GT(e),{createSegment:f,isCreating:p,segmentsConditions:m}=KT();i.useEffect((()=>{m&&c(u?{version:"1.0",id:u.id,name:u.name,description:u.description,logic:"AND",conditions:u.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})}),[u,m]);if(!m||d)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(lx,{})});return t.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8",children:t.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-visible",children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(JT,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(TT,{placeholder:"Segment name",value:l.name,onChange:e=>c({...l,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(JT,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(TT,{placeholder:"Segment description",value:l.description,onChange:e=>c({...l,description:e.target.value})})]})]}),l.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(bh,{mode:"popLayout",children:l.conditions.map(((e,n)=>t.jsxs(ix.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(ix.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(ix.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(ix.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(ix.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(xA,{condition:e,onUpdate:e=>((e,t)=>{const n=[...l.conditions];n[e]=t,c({...l,conditions:n})})(n,e),segmentsConditions:m,onDuplicate:()=>(e=>{const t=[...l.conditions];t.splice(e+1,0,{...l.conditions[e]}),c({...l,conditions:t})})(n),onDelete:()=>(e=>{const t=l.conditions.filter(((t,n)=>n!==e));c({...l,conditions:t})})(n)})]},n)))})})})]})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(_x,{variant:"secondary",onClick:()=>{c({...l,conditions:[...l.conditions,{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})},children:[t.jsx(Cc,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_x,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(_x,{variant:"secondary",onClick:async()=>{if(!l.name||!l.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(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!==BT.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===BT.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}})(l.conditions);if(t){a(!0);try{e&&u?h({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):f({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{a(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:s||p,children:s||p?t.jsxs(t.Fragment,{children:[t.jsx(mc,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})}function SA({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(wT,{open:e,onOpenChange:n,children:t.jsxs(kT,{className:"flex max-h-[86vh] flex-col gap-0 p-0 overflow-visible max-w-5xl w-full",hideCloseButton:!0,children:[t.jsx(ET,{className:"p-8 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(jT,{className:"text-3xl font-normal",children:r?"Edit Segment":"Create Segment"}),t.jsx(_x,{variant:"ghost",size:"icon",onClick:()=>n(!1),className:"h-8 w-8",children:t.jsx(Rc,{className:"h-4 w-4"})})]})}),t.jsx(wA,{segmentId:r,setOpen:e=>{n(e),o?.(!1)},onSegmentUpdated:o})]})})}const CA=()=>{const[e,r]=n.useState(""),{toast:o}=Ca(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[VT.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[VT.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[VT.CUSTOM];return t.jsx(FT,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(SA,{open:i,setOpen:s,segmentId:a??void 0}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(kc,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(TT,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2"}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(_x,{variant:"outline",onClick:()=>s(!0),children:[t.jsx(Cc,{}),"Create New Segment"]})})]}),t.jsx(AT,{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}),c(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?bj(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await zT({cursor:t,limit:n,search:e||void 0});return{items:r.data,cursor:r.pagination.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:e=>{e.type===VT.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},kA=({iconDefinitionsPassed:e})=>{const r=zw(),[o,i]=n.useState("automations"),s=Cx(e),a=[{id:"automations",label:"Automations",content:t.jsx(qT,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:s})},{id:"segments",label:"Segments",content:t.jsx(CA,{})}];return t.jsx("div",{className:"h-full container max-w-screen-xl mx-auto",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx(yE,{iconDefinitions:s}),t.jsx("div",{className:"flex-1",children:t.jsx(PS,{tabs:a,activeTab:o,onTabChange:e=>i(e)})})]})})};var EA=i.createContext(void 0);function jA(e){const t=i.useContext(EA);return e||t||"ltr"}var PA="rovingFocusGroup.onEntryFocus",TA={bubbles:!1,cancelable:!0},_A="RovingFocusGroup",[NA,DA,MA]=La(_A),[OA,RA]=_a(_A,[MA]),[AA,LA]=OA(_A),IA=i.forwardRef(((e,n)=>t.jsx(NA.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(NA.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(FA,{...e,ref:n})})})));IA.displayName=_A;var FA=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=Pa(n,p),g=jA(a),[v=null,y]=nl({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=$a(d),S=DA(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(PA,w),()=>e.removeEventListener(PA,w)}),[w]),t.jsx(AA,{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(Ia.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:ka(e.onMouseDown,(()=>{C.current=!0})),onFocus:ka(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(PA,TA);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));UA([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:ka(e.onBlur,(()=>x(!1)))})})})),$A="RovingFocusGroupItem",qA=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=$S(),u=a||c,d=LA($A,r),h=d.currentTabStopId===u,f=DA(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(NA.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(Ia.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:ka(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:ka(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:ka(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:zA[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((()=>UA(o)))}var n,r}))})})}));qA.displayName=$A;var zA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UA(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 VA=IA,BA=qA,KA="Tabs",[HA,WA]=_a(KA,[RA]),GA=RA(),[YA,QA]=HA(KA),XA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=jA(l),[h,f]=nl({prop:o,onChange:i,defaultProp:s});return t.jsx(YA,{scope:r,baseId:$S(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(Ia.div,{dir:d,"data-orientation":a,...u,ref:n})})}));XA.displayName=KA;var JA="TabsList",ZA=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=QA(JA,r),a=GA(r);return t.jsx(VA,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(Ia.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));ZA.displayName=JA;var eL="TabsTrigger",tL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=QA(eL,r),l=GA(r),c=oL(a.baseId,o),u=iL(a.baseId,o),d=o===a.value;return t.jsx(BA,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(Ia.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:ka(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:ka(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:ka(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));tL.displayName=eL;var nL="TabsContent",rL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=QA(nL,r),u=oL(c.baseId,o),d=iL(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(el,{present:s||h,children:({present:r})=>t.jsx(Ia.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 oL(e,t){return`${e}-trigger-${t}`}function iL(e,t){return`${e}-content-${t}`}rL.displayName=nL;var sL=ZA,aL=tL,lL=rL;const cL=XA,uL=i.forwardRef((({className:e,...n},r)=>t.jsx(sL,{ref:r,className:Pu("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));uL.displayName=sL.displayName;const dL=i.forwardRef((({className:e,...n},r)=>t.jsx(aL,{ref:r,className:Pu("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})));dL.displayName=aL.displayName;const hL=i.forwardRef((({className:e,...n},r)=>t.jsx(lL,{ref:r,className:Pu("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));hL.displayName=lL.displayName;const fL=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await pa(`${dx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},pL=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await pa(`${dx}/${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}},mL=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await pa(`${hx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},gL=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await pa(`${hx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(px(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}},vL=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await pa(`${hx}/${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}},yL=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await pa(`${hx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},bL=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await pa(`${hx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},xL=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",wL=({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"]})]}),SL=({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 flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(wL,{type:"email"})}),CL=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",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} <${s}>`:s})]}),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:r})]}),o&&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:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(SL,{html:i,height:a.height,width:a.width})})]})},kL=({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})})})})]}),EL=({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(ix.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(_x,{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(ix.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(_x,{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(ix.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(bh,{mode:"wait",children:["email"===i&&e&&t.jsx(ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(CL,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(ix.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(kL,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},jL=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=mx(e),{getCommunicationGroup:s}=mL(),{channelSenders:a}=fL(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=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((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.data.find((e=>e.id===t));n&&e.email_html_body&&c({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=a.data.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:xL(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(lx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(EL,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}: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. Start by clicking Actions in the top right, and then click Edit!"})]})})},PL=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=gx(e),{isLoading:s}=bx(e);if(o||s)return t.jsx("div",{className:TS,children:t.jsx(lx,{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(Sx.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(yE,{automationId:e,iconDefinitions:n})}),t.jsx(nA,{className:"my-4"}),t.jsxs(_T,{children:[t.jsx(NT,{children:t.jsxs(MT,{children:[t.jsx(OT,{style:{width:a},children:"Name"}),t.jsx(OT,{style:{width:l},children:"Email"}),t.jsx(OT,{style:{width:c},children:"Phone"})]})}),t.jsx(DT,{children:r.recipients.map((e=>t.jsxs(MT,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(RT,{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(RT,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(RT,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var TL,_L="dismissableLayer.update",NL="dismissableLayer.pointerDownOutside",DL="dismissableLayer.focusOutside",ML=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),OL=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(ML),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Pa(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=$a(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){AL(NL,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=$a(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){AL(DL,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 qa((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&&(TL=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),RL(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=TL)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),RL())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(_L,e),()=>document.removeEventListener(_L,e)}),[]),t.jsx(Ia.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ka(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ka(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ka(e.onPointerDownCapture,C.onPointerDownCapture)})}));OL.displayName="DismissableLayer";function RL(){const e=new CustomEvent(_L);document.dispatchEvent(e)}function AL(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?Fa(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(ML),o=i.useRef(null),s=Pa(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Ia.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var LL=["Enter"," "],IL=["ArrowUp","PageDown","End"],FL=["ArrowDown","PageUp","Home",...IL],$L={ltr:[...LL,"ArrowRight"],rtl:[...LL,"ArrowLeft"]},qL={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zL="Menu",[UL,VL,BL]=La(zL),[KL,HL]=_a(zL,[BL,vk,RA]),WL=vk(),GL=RA(),[YL,QL]=KL(zL),[XL,JL]=KL(zL),ZL=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=WL(n),[u,d]=i.useState(null),h=i.useRef(!1),f=$a(a),p=jA(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(Ok,{...c,children:t.jsx(YL,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(XL,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};ZL.displayName=zL;var eI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=WL(r);return t.jsx(Rk,{...i,...o,ref:n})}));eI.displayName="MenuAnchor";var tI="MenuPortal",[nI,rI]=KL(tI,{forceMount:void 0}),oI=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=QL(tI,n);return t.jsx(nI,{scope:n,forceMount:r,children:t.jsx(el,{present:r||s.open,children:t.jsx(Za,{asChild:!0,container:i,children:o})})})};oI.displayName=tI;var iI="MenuContent",[sI,aI]=KL(iI),lI=i.forwardRef(((e,n)=>{const r=rI(iI,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=QL(iI,e.__scopeMenu),a=JL(iI,e.__scopeMenu);return t.jsx(UL.Provider,{scope:e.__scopeMenu,children:t.jsx(el,{present:o||s.open,children:t.jsx(UL.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?cI:uI,{...i,ref:n})})})})})),cI=i.forwardRef(((e,n)=>{const r=QL(iI,e.__scopeMenu),o=i.useRef(null),s=Pa(n,o);return i.useEffect((()=>{const e=o.current;if(e)return _P(e)}),[]),t.jsx(dI,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ka(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),uI=i.forwardRef(((e,n)=>{const r=QL(iI,e.__scopeMenu);return t.jsx(dI,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),dI=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=QL(iI,r),b=JL(iI,r),x=WL(r),w=GL(r),S=VL(r),[C,k]=i.useState(null),E=i.useRef(null),j=Pa(n,E,y.onContentChange),P=i.useRef(0),T=i.useRef(""),_=i.useRef(0),N=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?X_:i.Fragment,R=g?{as:Da,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)),[]),Mj();const L=i.useCallback((e=>D.current===N.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,N.current?.area)),[]);return t.jsx(sI,{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:_,onPointerGraceIntentChange:i.useCallback((e=>{N.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(kj,{asChild:!0,trapped:s,onMountAutoFocus:ka(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(OL,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(VA,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:ka(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(Ak,{role:"menu","aria-orientation":"vertical","data-state":II(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:ka(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(!FL.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));IL.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:ka(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(P.current),T.current="")})),onPointerMove:ka(e.onPointerMove,qI((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));lI.displayName=iI;var hI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Ia.div,{role:"group",...o,ref:n})}));hI.displayName="MenuGroup";var fI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Ia.div,{...o,ref:n})}));fI.displayName="MenuLabel";var pI="MenuItem",mI="menu.itemSelect",gI=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=JL(pI,e.__scopeMenu),c=aI(pI,e.__scopeMenu),u=Pa(n,a),d=i.useRef(!1);return t.jsx(vI,{...s,ref:u,disabled:r,onClick:ka(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(mI,{bubbles:!0,cancelable:!0});e.addEventListener(mI,(e=>o?.(e)),{once:!0}),Fa(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:ka(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:ka(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||LL.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));gI.displayName=pI;var vI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=aI(pI,r),c=GL(r),u=i.useRef(null),d=Pa(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(UL.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(BA,{asChild:!0,...c,focusable:!o,children:t.jsx(Ia.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:ka(e.onPointerMove,qI((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:ka(e.onPointerLeave,qI((e=>l.onItemLeave(e)))),onFocus:ka(e.onFocus,(()=>f(!0))),onBlur:ka(e.onBlur,(()=>f(!1)))})})})})),yI=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(jI,{scope:e.__scopeMenu,checked:r,children:t.jsx(gI,{role:"menuitemcheckbox","aria-checked":FI(r)?"mixed":r,...i,ref:n,"data-state":$I(r),onSelect:ka(i.onSelect,(()=>o?.(!!FI(r)||!r)),{checkForDefaultPrevented:!1})})})}));yI.displayName="MenuCheckboxItem";var bI="MenuRadioGroup",[xI,wI]=KL(bI,{value:void 0,onValueChange:()=>{}}),SI=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=$a(o);return t.jsx(xI,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(hI,{...i,ref:n})})}));SI.displayName=bI;var CI="MenuRadioItem",kI=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=wI(CI,e.__scopeMenu),s=r===i.value;return t.jsx(jI,{scope:e.__scopeMenu,checked:s,children:t.jsx(gI,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":$I(s),onSelect:ka(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));kI.displayName=CI;var EI="MenuItemIndicator",[jI,PI]=KL(EI,{checked:!1}),TI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=PI(EI,r);return t.jsx(el,{present:o||FI(s.checked)||!0===s.checked,children:t.jsx(Ia.span,{...i,ref:n,"data-state":$I(s.checked)})})}));TI.displayName=EI;var _I=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Ia.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));_I.displayName="MenuSeparator";var NI=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=WL(r);return t.jsx(Lk,{...i,...o,ref:n})}));NI.displayName="MenuArrow";var[DI,MI]=KL("MenuSub"),OI="MenuSubTrigger",RI=i.forwardRef(((e,n)=>{const r=QL(OI,e.__scopeMenu),o=JL(OI,e.__scopeMenu),s=MI(OI,e.__scopeMenu),a=aI(OI,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(eI,{asChild:!0,...d,children:t.jsx(vI,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":II(r.open),...e,ref:ja(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ka(e.onPointerMove,qI((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:ka(e.onPointerLeave,qI((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:ka(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||$L[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));RI.displayName=OI;var AI="MenuSubContent",LI=i.forwardRef(((e,n)=>{const r=rI(iI,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=QL(iI,e.__scopeMenu),l=JL(iI,e.__scopeMenu),c=MI(AI,e.__scopeMenu),u=i.useRef(null),d=Pa(n,u);return t.jsx(UL.Provider,{scope:e.__scopeMenu,children:t.jsx(el,{present:o||a.open,children:t.jsx(UL.Slot,{scope:e.__scopeMenu,children:t.jsx(dI,{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:ka(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:ka(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:ka(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=qL[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function II(e){return e?"open":"closed"}function FI(e){return"indeterminate"===e}function $I(e){return FI(e)?"indeterminate":e?"checked":"unchecked"}function qI(e){return t=>"mouse"===t.pointerType?e(t):void 0}LI.displayName=AI;var zI=ZL,UI=eI,VI=oI,BI=lI,KI=hI,HI=fI,WI=gI,GI=yI,YI=SI,QI=kI,XI=TI,JI=_I,ZI=NI,eF=RI,tF=LI,nF="DropdownMenu",[rF,oF]=_a(nF,[HL]),iF=HL(),[sF,aF]=rF(nF),lF=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=iF(n),d=i.useRef(null),[h=!1,f]=nl({prop:s,defaultProp:a,onChange:l});return t.jsx(sF,{scope:n,triggerId:$S(),triggerRef:d,contentId:$S(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(zI,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};lF.displayName=nF;var cF="DropdownMenuTrigger",uF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=aF(cF,r),a=iF(r);return t.jsx(UI,{asChild:!0,...a,children:t.jsx(Ia.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:ja(n,s.triggerRef),onPointerDown:ka(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:ka(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));uF.displayName=cF;var dF=e=>{const{__scopeDropdownMenu:n,...r}=e,o=iF(n);return t.jsx(VI,{...o,...r})};dF.displayName="DropdownMenuPortal";var hF="DropdownMenuContent",fF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=aF(hF,r),a=iF(r),l=i.useRef(!1);return t.jsx(BI,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:ka(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:ka(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)"}})}));fF.displayName=hF;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(KI,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var pF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(HI,{...i,...o,ref:n})}));pF.displayName="DropdownMenuLabel";var mF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(WI,{...i,...o,ref:n})}));mF.displayName="DropdownMenuItem";var gF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(GI,{...i,...o,ref:n})}));gF.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(YI,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var vF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(QI,{...i,...o,ref:n})}));vF.displayName="DropdownMenuRadioItem";var yF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(XI,{...i,...o,ref:n})}));yF.displayName="DropdownMenuItemIndicator";var bF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(JI,{...i,...o,ref:n})}));bF.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(ZI,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var xF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(eF,{...i,...o,ref:n})}));xF.displayName="DropdownMenuSubTrigger";var wF=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=iF(r);return t.jsx(tF,{...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)"}})}));wF.displayName="DropdownMenuSubContent";var SF=dF,CF=fF,kF=pF,EF=mF,jF=gF,PF=vF,TF=yF,_F=bF,NF=xF,DF=wF;const MF=lF,OF=uF;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(NF,{ref:i,className:Pu("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(ic,{className:"ml-auto"})]}))).displayName=NF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(DF,{ref:r,className:Pu("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=DF.displayName;const RF=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(SF,{children:t.jsx(CF,{ref:o,sideOffset:n,className:Pu("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})})));RF.displayName=CF.displayName;const AF=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(EF,{ref:o,className:Pu("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})));AF.displayName=EF.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(jF,{ref:i,className:Pu("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(TF,{children:t.jsx(nc,{className:"h-4 w-4"})})}),n]}))).displayName=jF.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(PF,{ref:o,className:Pu("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(TF,{children:t.jsx(uc,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=PF.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(kF,{ref:o,className:Pu("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=kF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(_F,{ref:r,className:Pu("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=_F.displayName;const LF="reach-styles-module__stepIndicatorContainer___FoKXB",IF="reach-styles-module__iconContainer___Ki-1n",FF="reach-styles-module__checkIcon___-krUS",$F="reach-styles-module__minusIcon___r5cKs",qF="reach-styles-module__minusIconActive___-4JHM",zF="reach-styles-module__minusIconInactive___JtvVB",UF="reach-styles-module__label___tiCMA",VF="reach-styles-module__labelActive___EXydD",BF="reach-styles-module__labelInactive___g-J3r",KF=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:LF,children:[t.jsx("div",n?{className:IF,children:t.jsx(nc,{className:FF})}:{className:IF,children:t.jsx(wc,{className:Pu($F,r?qF:zF)})}),t.jsx("span",{className:Pu(UF,r?VF:BF),children:e})]}),HF=({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(_x,{onClick:n,disabled:s,variant:"secondary",className:Pu("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(_x,{onClick:u,variant:"secondary",className:Pu("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(_x,{onClick:r,disabled:a,className:Pu("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),WF="reach-styles-module__header___-izE2",GF="reach-styles-module__title___n1hA9",YF="reach-styles-module__description___EvXM-",QF="reach-styles-module__content___okv68",XF="reach-styles-module__footer___YA4U4",JF=Yl("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),ZF=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Pu(JF({variant:n}),e),...r})));ZF.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(WF,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(GF,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(YF,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(QF,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Pu(XF,e),...n}))).displayName="CardFooter";const e$=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},t$=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await pa("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var n$=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(n$||{});function r$(e,[t,n]){return Math.min(n,Math.max(t,e))}var o$=[" ","Enter","ArrowUp","ArrowDown"],i$=[" ","Enter"],s$="Select",[a$,l$,c$]=La(s$),[u$,d$]=_a(s$,[c$,vk]),h$=vk(),[f$,p$]=u$(s$),[m$,g$]=u$(s$),v$=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=h$(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=jA(d),[E=!1,j]=nl({prop:o,defaultProp:s,onChange:a}),[P,T]=nl({prop:l,defaultProp:c,onChange:u}),_=i.useRef(null),N=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(Ok,{...v,children:t.jsxs(f$,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:$S(),value:P,onValueChange:T,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:_,disabled:p,children:[t.jsx(a$.Provider,{scope:n,children:t.jsx(m$,{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})}),N?t.jsxs(rq,{"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(D)]},O):null]})})};v$.displayName=s$;var y$="SelectTrigger",b$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=h$(r),l=p$(y$,r),c=l.disabled||o,u=Pa(n,l.onTriggerChange),d=l$(r),h=i.useRef("touch"),[f,p,m]=oq((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=iq(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(Rk,{asChild:!0,...a,children:t.jsx(Ia.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":nq(l.value)?"":void 0,...s,ref:u,onClick:ka(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:ka(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:ka(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||o$.includes(e.key)&&(g(),e.preventDefault())}))})})}));b$.displayName=y$;var x$="SelectValue",w$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=p$(x$,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Pa(n,c.onValueNodeChange);return Ja((()=>{u(d)}),[u,d]),t.jsx(Ia.span,{...l,ref:h,style:{pointerEvents:"none"},children:nq(c.value)?t.jsx(t.Fragment,{children:a}):s})}));w$.displayName=x$;var S$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(Ia.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));S$.displayName="SelectIcon";var C$=e=>t.jsx(Za,{asChild:!0,...e});C$.displayName="SelectPortal";var k$="SelectContent",E$=i.forwardRef(((e,n)=>{const r=p$(k$,e.__scopeSelect),[o,a]=i.useState();if(Ja((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(P$,{scope:e.__scopeSelect,children:t.jsx(a$.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(_$,{...e,ref:n})}));E$.displayName=k$;var j$=10,[P$,T$]=u$(k$),_$=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=p$(k$,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Pa(n,(e=>S(e))),[j,P]=i.useState(null),[T,_]=i.useState(null),N=l$(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return _P(w)}),[w]),Mj();const R=i.useCallback((e=>{const[t,...n]=N().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}}),[N,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,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,$]=oq((e=>{const t=N().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=iq(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)&&_(e)}),[x.value]),V="popper"===o?D$:N$,B=V===D$?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(P$,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:T,position:o,isPositioned:D,searchRef:F,children:t.jsx(X_,{as:Da,allowPinchZoom:!0,children:t.jsx(kj,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ka(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Ha,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...B,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ka(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=N().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()}}))})})})})})}));_$.displayName="SelectContentImpl";var N$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=p$(k$,r),l=T$(k$,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Pa(n,(e=>h(e))),p=l$(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-j$,l=r$(o,[j$,Math.max(j$,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-j$,u=r$(o,[j$,Math.max(j$,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*j$,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-j$,j=s-E,P=y.offsetHeight/2,T=h+f+(y.offsetTop+P),_=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+_+"px",v.scrollTop=T-E+v.offsetTop}c.style.margin=`${j$}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]);Ja((()=>w()),[w]);const[S,C]=i.useState();Ja((()=>{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(M$,{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(Ia.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));N$.displayName="SelectItemAlignedPosition";var D$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=j$,...s}=e,a=h$(r);return t.jsx(Ak,{...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)"}})}));D$.displayName="SelectPopperPosition";var[M$,O$]=u$(k$,{}),R$="SelectViewport",A$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=T$(R$,r),l=O$(R$,r),c=Pa(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(a$.Slot,{scope:r,children:t.jsx(Ia.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ka(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*j$,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}))})})]})}));A$.displayName=R$;var L$="SelectGroup",[I$,F$]=u$(L$);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=$S();return t.jsx(I$,{scope:r,id:i,children:t.jsx(Ia.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=L$;var $$="SelectLabel",q$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=F$($$,r);return t.jsx(Ia.div,{id:i.id,...o,ref:n})}));q$.displayName=$$;var z$="SelectItem",[U$,V$]=u$(z$),B$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=p$(z$,r),u=T$(z$,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Pa(n,(e=>u.itemRefCallback?.(e,o,s))),v=$S(),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(U$,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(a$.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(Ia.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:ka(l.onFocus,(()=>m(!0))),onBlur:ka(l.onBlur,(()=>m(!1))),onClick:ka(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:ka(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:ka(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:ka(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:ka(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:ka(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(i$.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));B$.displayName=z$;var K$="SelectItemText",H$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=p$(K$,r),u=T$(K$,r),d=V$(K$,r),h=g$(K$,r),[f,p]=i.useState(null),m=Pa(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 Ja((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Ia.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));H$.displayName=K$;var W$="SelectItemIndicator",G$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return V$(W$,r).isSelected?t.jsx(Ia.span,{"aria-hidden":!0,...o,ref:n}):null}));G$.displayName=W$;var Y$="SelectScrollUpButton",Q$=i.forwardRef(((e,n)=>{const r=T$(Y$,e.__scopeSelect),o=O$(Y$,e.__scopeSelect),[s,a]=i.useState(!1),l=Pa(n,o.onScrollButtonChange);return Ja((()=>{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(Z$,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Q$.displayName=Y$;var X$="SelectScrollDownButton",J$=i.forwardRef(((e,n)=>{const r=T$(X$,e.__scopeSelect),o=O$(X$,e.__scopeSelect),[s,a]=i.useState(!1),l=Pa(n,o.onScrollButtonChange);return Ja((()=>{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(Z$,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));J$.displayName=X$;var Z$=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=T$("SelectScrollButton",r),l=i.useRef(null),c=l$(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),Ja((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(Ia.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:ka(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:ka(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:ka(s.onPointerLeave,(()=>{u()}))})})),eq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(Ia.div,{"aria-hidden":!0,...o,ref:n})}));eq.displayName="SelectSeparator";var tq="SelectArrow";function nq(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=h$(r),s=p$(tq,r),a=T$(tq,r);return s.open&&"popper"===a.position?t.jsx(Lk,{...i,...o,ref:n}):null})).displayName=tq;var rq=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Pa(n,s),l=iA(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(rl,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function oq(e){const t=$a(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 iq(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}rq.displayName="BubbleSelect";var sq=b$,aq=S$,lq=C$,cq=E$,uq=A$,dq=q$,hq=B$,fq=H$,pq=G$,mq=Q$,gq=J$,vq=eq;const yq=v$,bq=w$,xq=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(sq,{ref:o,className:Pu("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(aq,{asChild:!0,children:t.jsx(rc,{className:"h-4 w-4 opacity-50"})})]})));xq.displayName=sq.displayName;const wq=i.forwardRef((({className:e,...n},r)=>t.jsx(mq,{ref:r,className:Pu("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(sc,{className:"h-4 w-4"})})));wq.displayName=mq.displayName;const Sq=i.forwardRef((({className:e,...n},r)=>t.jsx(gq,{ref:r,className:Pu("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(rc,{className:"h-4 w-4"})})));Sq.displayName=gq.displayName;const Cq=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(lq,{children:t.jsxs(cq,{ref:i,className:Pu("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(wq,{}),t.jsx(uq,{className:Pu("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(Sq,{})]})})));Cq.displayName=cq.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(dq,{ref:r,className:Pu("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=dq.displayName;const kq=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(hq,{ref:o,className:Pu("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(pq,{children:t.jsx(nc,{className:"h-4 w-4"})})}),t.jsx(fq,{children:n})]})));kq.displayName=hq.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(vq,{ref:r,className:Pu("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=vq.displayName;const Eq=()=>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://cdn.embedreach.com/assets/engage/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(Mx,{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(yc,{}),selected:!0})]})]})})]}),jq=({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"]})]}),Pq={all:["stripo"],token:()=>[...Pq.all,"token"],editorData:()=>[...Pq.all,"editorData"],templates:()=>[...Pq.all,"templates"],demoTemplate:()=>[...Pq.templates(),"demo"]},Tq=async()=>(await pa(`${fx}/editor-data`)).data,_q=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await pa(`${fx}/template/${e}`)).data)(e),...ca}),Nq=({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(lx,{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"})]}),Dq="UiEditorScript",Mq=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await pa(`${fx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(Dq))r();else{const e=document.createElement("script");e.id=Dq,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),Oq=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=_q(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:Pq.editorData(),queryFn:Tq,...ca}),invalidateEditorData:()=>e.invalidateQueries({queryKey:Pq.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=vL();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.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,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(Mq({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(lx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(Nq,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},Rq=({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}=mx(e.id),[_,N]=n.useState(!1),D=e$(x,500),M=e$(S,500),{channelSenders:O}=fL(),{channelAccounts:R}=t$(),{getCommunicationGroup:A}=mL(),{createCommunicationForAutomation:L}=gL(e.id,e),{updateCommunicationGroup:I}=vL(),{updateChannelSender:F}=pL(),{updateAutomation:$}=yx(e.id),[q,z]=n.useState({width:0,height:0}),[U,V]=n.useState({width:0,height:0}),B=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{B.current&&requestAnimationFrame((()=>{V({width:B.current?B.current.offsetWidth-100:0,height:B.current?B.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[B]),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=>{K(e)}})}),[r,A,e.action_data,e,o,O?.data]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.data?.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?.data,o,O]),n.useEffect((()=>{if(l){const e=O?.data?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.data?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.data,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?.data?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.data,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),B.current&&V({width:B.current.offsetWidth,height:B.current.offsetHeight})}}),T())}),[g,o,A,T,O?.data]),!R||!O)return t.jsx("div",{children:t.jsx(lx,{text:["Loading..."]})});const H=O.data?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.data?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case n$.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case n$.TWILLIO:return null;default:throw Ix(t.channel_account_metadata.type,n$)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(wT,{open:_,onOpenChange:N,children:t.jsxs(kT,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Email Preview Help"}),t.jsx(PT,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(Eq,{})]})}),t.jsx(wT,{open:g,onOpenChange:v,children:t.jsxs(kT,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Email Editor"}),t.jsx(PT,{children:"Learn more about the email editor and how to use it to create your email."})]}),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(mE,{title:"Click to learn more about email template ",onClick:()=>N(!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(Oq,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),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(JT,{children:"From Email"}),t.jsxs(yq,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(xq,{children:t.jsx(bq,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(Cq,{children:W?.map((e=>t.jsx(kq,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(JT,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(mE,{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(TT,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(JT,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(mE,{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(TT,{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(JT,{children:"Subject"}),t.jsx(TT,{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(JT,{children:"Preview Text"}),t.jsx(mE,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(TT,{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(_x,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.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(jq,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:B,children:t.jsx(SL,{html:p??"",height:U.height,width:U.width})})]})]})]})},Aq=async()=>(await pa("/businesses/me")).data,Lq=["me"],Iq=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Pu("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})));Iq.displayName="Textarea";const Fq=({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}=fL(),{data:k,isLoading:E}=ue({queryKey:Lq,queryFn:Aq,...ca}),{channelAccounts:j}=t$(),{createCommunicationForAutomation:P}=gL(e.id,e),{updateCommunicationGroup:T}=vL(),{getCommunicationGroup:_}=mL(),{getMergeFields:N,isGetting:D}=yL(),M=n.useRef(null),O=e$(m,1e3),R=e$(c,1e3),A=e$(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?T({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):P({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,T,P]),n.useEffect((()=>{v&&_(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,_,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.data?.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))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(lx,{text:["Loading..."]})});const I=C.data?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(wT,{open:w,onOpenChange:S,children:t.jsxs(kT,{children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"SMS Editor"}),t.jsx(PT,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(Iq,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(yq,{value:a,onValueChange:e=>{const t=M.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(xq,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(Cq,{children:N?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(kq,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(mE,{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(JT,{children:"From Number"}),t.jsxs(yq,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(xq,{children:t.jsx(bq,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(Cq,{children:I?.map((e=>t.jsx(kq,{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(JT,{children:"Company Name"}),t.jsx(mE,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(TT,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(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(_x,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(kL,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(wL,{type:"sms"})}):t.jsx(jq,{type:"sms"})})]})]})]})},$q=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Ca(),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(_x,{variant:e.includes("email")?"default":"outline",className:`${a}`,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(_x,{variant:e.includes("sms")?"default":"outline",className:`${a}`,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"]})]})]})},qq=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=mL(),{updateCommunicationGroup:c}=vL(),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(ZF,{className:"p-4 rounded-xl shadow-none",children:t.jsx($q,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(ZF,{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(ix.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(bh,{children:s?.includes("email")&&t.jsx(ix.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(Rq,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(ZF,{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(ix.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(bh,{children:s?.includes("sms")&&t.jsx(ix.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(Fq,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(lx,{text:["Loading..."]})})},zq=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=HT({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(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block 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(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(ix.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card: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 @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(ix.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:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(ix.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card: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 @[250px]/card: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)))})]})})})]})},Uq=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(KD,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(ac,{className:"opacity-50"})]})}),t.jsx(WD,{className:"w-[200px] p-0",children:t.jsxs(mD,{children:[t.jsx(gD,{placeholder:r,className:"h-9"}),t.jsxs(vD,{children:[t.jsx(yD,{children:o}),t.jsx(bD,{children:e.map((e=>t.jsxs(wD,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(nc,{className:Pu("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Vq=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):NE(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(vj(o,"HH:mm")),{updateAutomation:d}=yx(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=NE(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:xx.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(KD,{children:[t.jsx(HD,{asChild:!0,children:t.jsxs(_x,{variant:"outline",className:Pu("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(tc,{className:"mr-2 h-4 w-4"}),o?vj(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(WD,{className:"w-auto p-0",children:t.jsx(HR,{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:Pu("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(Uq,{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=NE(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]})]})},Bq=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(ix.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(Mx,{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:xx.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(Mx,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(bh,{children:"schedule"===i&&t.jsx(ix.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(Vq,{automation:r})})})})]}),r.trigger_metadata?.scheduled_at&&t.jsxs(ix.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:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(ix.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(ix.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})})]})]})})})},Kq=({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}=yx(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=mL(),{channelSenders:d}=fL(),{channelAccounts:h}=t$(),[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?.data.find((e=>e.id===t)),o=v?.data.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.data.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case n$.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 n$.TWILLIO:break;default:throw Ix(n.channel_account_metadata.type,n$)}}if(o){const t=v?.data.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:xL(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.data,v?.data,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(lx,{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(EL,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(zq,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(ZF,{className:"p-4 shadow-sm border-none",children:t.jsx(Bq,{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"})})},Hq=({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(Mx,{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(Mx,{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})]})},Wq=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(oA,{selectedValues:l,setSelectedValues:c,options:u,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:[e=>t.jsxs(wD,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Gq=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Wq,{segments:r,allSegments:l?.data||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(_x,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(ix.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(bh,{children:u&&t.jsx(ix.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(Wq,{segments:o,allSegments:l?.data||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},Yq=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>zT()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=yx(r.id),[d,h]=n.useState(r.includeSegmentIds||[]),[f,p]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.data?.find((e=>e.type===VT.ALL_USERS&&e.id===d[0])),[g,v]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u]);const y=n.useCallback((()=>l?.data?.find((e=>e.type===VT.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=y();e&&h([e.id]),p([])}}),[g,l,y]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){v("all");const e=y();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}v(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,y,u,r.includeSegmentIds,r.excludeSegmentIds]),!c&&l&&s?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(wT,{open:o,modal:!0,onOpenChange:i,children:t.jsxs(kT,{hideCloseButton:!0,children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Create Segment"}),t.jsx(PT,{children:"Create a new segment to use in your automation."})]}),t.jsx(SA,{open:o,setOpen:i})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(ix.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Hq,{iconDefinitions:e,onSelectionChange:e=>{v(e)},defaultValue:g}),t.jsx(bh,{mode:"wait",children:"segments"===g&&t.jsx(ix.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(Gq,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?h((t=>[...t,e])):p((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?h((t=>t.filter((t=>t!==e)))):p((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(ix.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(zq,{iconDefinitions:e,includeSegments:d,excludeSegments:f,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(lx,{text:["Fetching segments","Finishing up"]})})},Qq=({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})]}),Xq=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i,onBeforeSchedule:s})=>{const{toast:a}=Ca(),[l,c]=n.useState(0),{automation:u}=mx(e),[d,h]=n.useState(!1),{updateAutomation:f}=yx(e),{getCommunicationGroup:p}=mL(),m=()=>{h(!0),f({status:wx.ACTIVE}),i(!1),a({title:"Automation scheduled!"})},{data:g}=HT({include_segments:u?.includeSegmentIds??[],exclude_segments:u?.excludeSegmentIds??[]}),v=n.useMemo((()=>g?.recipients?g.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}),[g?.recipients]);if(!u)return t.jsx("div",{children:t.jsx(lx,{text:["Fetching Automation data","Finishing up"]})});const y=[{id:"audience",title:"Choose Audience",isValid:()=>!!(u&&u.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!u.action_data?.length&&null!==u.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"})]}),y.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===l?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<l?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(KF,{label:e.title,isActive:n===l,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(bh,{mode:"wait",children:[0===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Choose Audience",content:t.jsx(Yq,{iconDefinitions:r,automation:u})})},"audience"),1===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Edit Content",content:t.jsx(qq,{automation:u,iconDefinitions:r})})},"content"),2===l&&t.jsx(sx,{className:"w-full max-w-8xl py-8",children:t.jsx(Qq,{title:"Preview and Schedule",content:t.jsx(Kq,{automation:u,iconDefinitions:r,loading:d})})},"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(HF,{iconDefinitions:r,handleBack:()=>{c(l-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===l)return{canMove:u.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===l){const e=u.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)=>{p(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"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();if(e)if(2===l)if(s)try{g||await new Promise((e=>setTimeout(e,50)));const e=await s({estimatedEmailRecipients:v.emails,estimatedSmsRecipients:v.phones});!0===e?m():a({title:"Oops!",description:e,variant:"destructive"})}catch(n){a({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else m();else c(l+1);else a({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===l,backText:0===l?"Cancel":"Back",nextText:2===l?"Schedule":"Next",backDisabled:0===l,nextDisabled:2===l&&!(u.trigger_metadata?.scheduled_at&&new Date(u.trigger_metadata.scheduled_at)>new Date&&Boolean(u.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===l?"Save as Draft":void 0,thirdOptionOnClick:()=>{f({status:wx.DRAFT}),i(!1),a({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},Jq=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),Zq=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"))},ez=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=mL(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=bL(),{toast:y}=Ca(),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(TT,{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(_x,{onClick:()=>{if(!("email"===r?Jq(s):Zq(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(lx,{text:["Fetching sender id","Finishing up"]})})},tz=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l})=>{const c=zw(),[u,d]=n.useState(!1),[h,f]=n.useState(!1),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateAutomation:y}=yx(e.id),{invalidateAutomation:b}=mx(e.id),{toast:x}=Ca();n.useEffect((()=>{o&&d(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(wT,{open:u,onOpenChange:e=>{d(e),!1===e&&b()},children:t.jsxs(kT,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Edit Automation"}),t.jsx(PT,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Xq,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:d,logoUrl:s,onBeforeSchedule:l})]})}),t.jsx(wT,{open:p,onOpenChange:m,children:t.jsxs(kT,{className:"sm:max-w-[425px]",children:[t.jsx(jT,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(PT,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(_x,{variant:"outline",onClick:()=>m(!1),children:"Keep Running"}),t.jsx(_x,{variant:"destructive",onClick:()=>{y({status:wx.DEACTIVATED}),m(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(wT,{open:h,onOpenChange:f,children:t.jsxs(kT,{className:"",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Send Preview SMS"}),t.jsx(PT,{children:"Send a preview SMS to the automation."})]}),t.jsx(ez,{automation:e,type:"sms",setOpenSendPreviewPopup:f,iconDefinitions:r})]})}),t.jsx(wT,{open:g,onOpenChange:v,children:t.jsxs(kT,{className:"",children:[t.jsxs(xT,{children:[t.jsx(jT,{children:"Send Preview Email"}),t.jsx(PT,{children:"Send a preview email to the automation."})]}),t.jsx(ez,{automation:e,type:"email",setOpenSendPreviewPopup:v,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(_x,{onClick:()=>c(-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($T,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(MF,{modal:!1,children:[t.jsx(OF,{asChild:!0,children:t.jsxs(_x,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(RF,{children:[e.status===wx.DRAFT&&t.jsx(AF,{onClick:()=>d(!0),children:"Edit"}),e.status===wx.ACTIVE&&t.jsx(AF,{onClick:()=>{y({status:wx.DRAFT})},children:"Convert to Draft"}),e.status!==wx.COMPLETED&&e.status!==wx.FAILED&&e.status!==wx.DEACTIVATED&&t.jsx(AF,{onClick:()=>m(!0),children:"Cancel"}),t.jsx(AF,{onClick:()=>f(!0),children:"Send Preview SMS"}),t.jsx(AF,{onClick:()=>v(!0),children:"Send Preview Email"}),t.jsx(AF,{onClick:async()=>{const{id:t}=await(async e=>(await pa(`${ux}`,{method:"POST",body:JSON.stringify({duplicate:!0,source_id:e})})).data)(e.id);t?(a&&a(t),x({title:"Automation duplicated!",description:"The automation has been duplicated"})):x({title:"Error duplicating automation",description:"Please try again"})},children:"Duplicate"})]})]})]}),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:vj(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===xx.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===xx.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:vj(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},nz=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l})=>{const c=Cx(e),u=function(){let{matches:e}=i.useContext(Aw),t=e[e.length-1];return t?t.params:{}}(),[d]=CS(),h=r||u?.automationId||d.get("automationId"),f=n||d.get("autoOpenEditPopup"),p="true"===d.get("showBackButton")||o,m=Cx(c),{automation:g,isFetching:v,isLoading:y,fetchError:b}=mx(h||"");return h?g||!v&&!y?b?t.jsxs("div",{children:["Error: ",b.message]}):g?t.jsxs("div",{className:Ax,children:[t.jsx(tz,{automation:g,iconDefinitions:m,autoOpenEditPopup:f,showBackButton:p,logoUrl:s,onDuplicationCreated:a,onBeforeSchedule:l}),t.jsx("div",{className:"pt-4",children:t.jsxs(cL,{defaultValue:"content",children:[t.jsxs(uL,{children:[t.jsx(dL,{value:"content",children:"Content"}),t.jsx(dL,{value:"recipients",children:"Recipients"})]}),t.jsx(hL,{value:"recipients",children:t.jsx(PL,{automationId:h,iconDefinitions:m})}),t.jsx(hL,{value:"content",children:t.jsx(jL,{automationId:h,iconDefinitions:m})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:Ax,children:t.jsx(lx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var rz=e=>null!=e;var oz=e=>"function"!=typeof e||e.length?e:e(),iz=e=>Array.isArray(e)?e:e?[e]:[];var sz=$e;var az,lz=function(e){const[t,n]=Ne(),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=Ne(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(kY){return r(kY,`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(kY){r(kY,`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(kY){r(kY,`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(kY){r(kY,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(kY){r(kY,`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(kY){r(kY,`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(kY){r(kY,`Error getting all values from ${e.name}`)}}})),t}}]},cz=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},uz=("function"==typeof(az={_cookies:[globalThis.document,"cookie"],getItem:e=>uz._cookies[0][uz._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=uz.getItem(e);uz._cookies[0][uz._cookies[1]]=`${e}=${t}${cz(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:uz});window.dispatchEvent(o)},removeItem:e=>{uz._cookies[0][uz._cookies[1]]=`${e}=deleted${cz({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return uz._cookies[0][uz._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return uz._cookies[0][uz._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(az.clear=()=>{let e;for(;e=az.key(0);)az.removeItem(e)}),az),dz=796,hz="bottom",fz="system",pz=Object.keys(Zn)[0],mz=Object.keys(nr)[0],gz=Ke({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function vz(){return He(gz)}var yz=Ke(void 0),bz=e=>{const[t,n]=Ne(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[Rt]){for(let t of e[Rt].keys())e.removeEventListener(t,Gt);delete e[Rt]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(vz().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(SY){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)}})),It(["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=(vz().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(vz().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 dt(yz.Provider,{value:i,get children(){return e.children}})},xz=()=>Re((()=>{const e=He(yz);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),wz=Ke((()=>"dark"));function Sz(){return He(wz)}var Cz={"À":"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"},kz=Object.keys(Cz).join("|"),Ez=new RegExp(kz,"g");var jz=7,Pz=6,Tz=5,_z=4,Nz=3,Dz=2,Mz=1,Oz=0;function Rz(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:Mz,!n.accessors){const r=Az(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=$z(o),s=Iz(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:Oz,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=Az(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=Mz?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 Az(e,t,n){return e=Lz(e,n),(t=Lz(t,n)).length>e.length?Oz:e===t?jz:(e=e.toLowerCase())===(t=t.toLowerCase())?Pz:e.startsWith(t)?Tz:e.includes(` ${t}`)?_z:e.includes(t)?Nz:1===t.length?Oz:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?Dz: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 Mz+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return Oz;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return Oz}return i(r-s)}(e,t)}function Lz(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(Ez,(e=>Cz[e]))),e}function Iz(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 Fz={maxRanking:1/0,minRanking:-1/0};function $z(e){return"function"==typeof e?Fz:{...Fz,...e}}var qz={data:""},zz=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Uz=/\/\*[^]*?\*\/| +/g,Vz=/\n+/g,Bz=(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]?Bz(s,i):i+"{"+Bz(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=Bz(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+=Bz.p?Bz.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Kz={},Hz=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+Hz(e[n]);return t}return e};function Wz(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=Hz(e),s=Kz[i]||(Kz[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!Kz[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=zz.exec(e.replace(Uz,""));)t[4]?r.shift():t[3]?(n=t[3].replace(Vz," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Vz," ").trim();return r[0]})(e);Kz[s]=Bz(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&Kz.g?Kz.g:null;return n&&(Kz.g=Kz[s]),l=Kz[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?"":Bz(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||qz),t.g,t.o,t.k);var r}function Gz(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=Gz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Yz(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Gz(e))&&(r&&(r+=" "),r+=t);return r}Wz.bind({g:1}),Wz.bind({k:1});var Qz=()=>{};function Xz(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ne([],{equals:!1}),[l]=[Ve,ze],c="remove"===t.exitMethod?Qz:e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u="remove"===t.exitMethod?Qz:"keep-index"===t.exitMethod?(e,t,n)=>e.splice(n,0,t):(e,t)=>e.push(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 Jz(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}var Zz=e=>e instanceof Element;function eU(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return eU(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=eU(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function tU(e,t=Zz,n=Zz){const r=Re(e),o=Re((()=>eU(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function nU(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function rU(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()))})),nU((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function oU(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())),nU((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var iU=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 Xz(tU((()=>e.children)).toArray,{appear:e.appear,exitMethod:"keep-index",onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)rU(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)oU(s,e,t,(()=>o([t])))}})},sU=Symbol("fallback");function aU(e){for(const t of e)t.dispose()}function lU(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>aU(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return aU(o.values()),o.clear(),r.fallback?[_e((e=>(o.set(sU,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(sU);if(!o.size||s){s?.dispose(),o.delete(sU);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){_e((s=>{const[a,l]=Ne(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ne(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 cU(e,t,n,r){const o=()=>{iz(oz(e)).forEach((e=>{e&&iz(oz(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),sz(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function uU(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=iz(oz(e)).filter(rz);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 dU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function hU(e){const t={};let n;for(;n=dU.exec(e);)t[n[1]]=n[2];return t}function fU(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=hU(e)}else"string"==typeof t&&(t=hU(t));return{...e,...t}}function pU(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function mU(e){return"[object String]"===Object.prototype.toString.call(e)}function gU(e){return t=>`${e()}-${t}`}function vU(e,t){return!!e&&(e===t||e.contains(t))}function yU(e,t=!1){const{activeElement:n}=bU(e);if(!n?.nodeName)return null;if(xU(n)&&n.contentDocument)return yU(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=bU(n).getElementById(e);if(t)return t}}return n}function bU(e){return e?e.ownerDocument||e:document}function xU(e){return"IFRAME"===e.tagName}var wU=(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))(wU||{});function SU(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function CU(){return SU(/^Mac/i)}function kU(){return SU(/^iPhone/i)||SU(/^iPad/i)||CU()&&navigator.maxTouchPoints>1}function EU(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function jU(e){return t=>{for(const n of e)EU(t,n)}}function PU(e){return CU()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function TU(e){if(e)if(function(){if(null==_U){_U=!1;try{document.createElement("div").focus({get preventScroll(){return _U=!0,!0}})}catch(SY){}}return _U}())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 _U=null;var NU=["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'])"],DU=[...NU,'[tabindex]:not([tabindex="-1"]):not([disabled])'],MU=NU.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",OU=DU.join(':not([hidden]):not([tabindex="-1"]),');function RU(e,t){const n=Array.from(e.querySelectorAll(MU)).filter(AU);return t&&AU(e)&&n.unshift(e),n.forEach(((e,t)=>{if(xU(e)&&e.contentDocument){const r=RU(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function AU(e){return LU(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function LU(e){return e.matches(MU)&&IU(e)}function IU(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||IU(e.parentElement,e))}function FU(e){for(;e&&!$U(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function $U(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function qU(){}function zU(e,t){return gt(e,t)}var UU=new Map,VU=new Set;function BU(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=UU.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),UU.delete(t.target)),0===UU.size)){for(const e of VU)e();VU.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=UU.get(t.target);n||(n=new Set,UU.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function KU(e,t){const n=HU(e,t,"left"),r=HU(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 HU(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?BU():document.addEventListener("DOMContentLoaded",BU));var WU={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 GU(e){return t=>(e(t),()=>e(void 0))}function YU(e,t){const[n,r]=Ne(QU(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||QU(t?.()))})),n}function QU(e){return mU(e)?e:void 0}function XU(e){const[t,n]=vt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return dt(tn,gt(n,{get component(){return t.as}}))}var JU=["id","name","validationState","required","disabled","readOnly"];var ZU=Ke();function eV(){const e=He(ZU);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function tV(e){const t=eV(),n=zU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),dt(XU,gt({as:"div"},(()=>t.dataset()),n))}function nV(e){const t=eV(),n=zU({id:t.generateId("error-message")},e),[r,o]=vt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),dt(kt,{get when(){return r.forceMount||i()},get children(){return dt(XU,gt({as:"div"},(()=>t.dataset()),o))}})}function rV(e){let t;const n=eV(),r=zU({id:n.generateId("label")},e),[o,i]=vt(r,["ref"]),s=YU((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),dt(XU,gt({as:"label",ref(e){const n=Jz((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function oV(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 iV(e){const[t,n]=Ne(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 sV(e){const[t,n]=iV(e);return[()=>t()??!1,n]}var aV=Object.defineProperty,lV=(e,t)=>{for(var n in t)aV(e,n,{get:t[n],enumerable:!0})},cV=Ke();function uV(){return He(cV)}function dV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function hV(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?dV(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 fV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{hV(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 bU(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&hV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function pV(e={}){const[t,n]=function(e){const[t,n]=iV(e);return[()=>t()??[],n]}({value:()=>oz(e.items),onChange:t=>e.onItemsChange?.(t)});fV(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&&dV(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=>dt(cV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function mV(e){const t=function(){const e=uV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=zU({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function gV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=mU(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=mU(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(mU(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return mU(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(mU(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=gV({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 vV(e,t=[]){return Re((()=>{const n=gV({dataSource:oz(e.dataSource),getKey:oz(e.getKey),getTextValue:oz(e.getTextValue),getDisabled:oz(e.getDisabled),getSectionChildren:oz(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var yV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),bV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function xV(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return yV.has(t)}const t=e.split("-")[0];return bV.has(t)}(e)?"rtl":"ltr"}function wV(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:xV(e)}}var SV=wV(),CV=new Set;function kV(){SV=wV();for(const e of CV)e(SV)}var EV=Ke();function jV(){const e=function(){const[e,t]=Ne(SV),n=Re((()=>e()));return Fe((()=>{0===CV.size&&window.addEventListener("languagechange",kV),CV.add(t),$e((()=>{CV.delete(t),0===CV.size&&window.removeEventListener("languagechange",kV)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return He(EV)||e}var PV=new Map;var TV=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 _V(e){return CU()||kU()?e.altKey:e.ctrlKey}function NV(e){return CU()?e.metaKey:e.ctrlKey}function DV(e){return new TV(e)}function MV(e){const t=zU({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ne(!1),[o,i]=Ne(),s=Re((()=>{const e=oz(t.selectedKeys);return null!=e?DV(e):e})),a=Re((()=>{const e=oz(t.defaultSelectedKeys);return null!=e?DV(e):new TV})),[l,c]=function(e){const[t,n]=iV(e);return[()=>t()??new TV,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ne(oz(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===oz(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d(oz(t.selectionBehavior)??"toggle")})),{selectionMode:()=>oz(t.selectionMode),disallowEmptySelection:()=>oz(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!oz(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 OV(e,t,n){const r=gt({selectOnFocus:()=>"replace"===oz(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=jV();let s={top:0,left:0};cU((()=>oz(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]=Ne(""),[r,o]=Ne(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(oz(e.isDisabled))return;const s=oz(e.keyboardDelegate),a=oz(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:()=>oz(r.disallowTypeAhead),keyboardDelegate:()=>oz(r.keyboardDelegate),selectionManager:()=>oz(r.selectionManager)}),l=()=>oz(r.orientation)??"vertical",c=()=>{const e=oz(r.autoFocus);if(!e)return;const n=oz(r.selectionManager),o=oz(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&&!oz(r.shouldUseVirtualFocus)&&TU(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>oz(r.isVirtualized),()=>oz(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&&KU(t,e)}})));return{tabIndex:Re((()=>{if(!oz(r.shouldUseVirtualFocus))return null==oz(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{EU(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=oz(r.selectionManager),s=oz(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!_V(e)&&o.replaceSelection(t))},u=oz(r.keyboardDelegate),d=oz(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,NV(e));null!=t&&(o.setFocusedKey(t),NV(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,NV(e));null!=t&&(o.setFocusedKey(t),NV(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":NV(e)&&"multiple"===o.selectionMode()&&!0!==oz(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),oz(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!oz(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t,n){const r=t?.tabbable?OU:MU,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(r)||!IU(e)||n||t?.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});return t?.from&&(o.currentNode=t.from),o}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&TU(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=oz(r.selectionManager),n=oz(r.keyboardDelegate),i=oz(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(!oz(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(TU(n),KU(e,n))}}},onFocusOut:e=>{const t=oz(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function RV(e,t){const n=()=>oz(e.selectionManager),r=()=>oz(e.key),o=()=>oz(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()||NV(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>oz(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((()=>oz(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():TU(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||oz(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&oz(e.shouldSelectOnPressUp)&&oz(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(oz(e.shouldSelectOnPressUp)&&!oz(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(_V(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var AV=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 TV(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 TV(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 TV([t],t,t):new TV;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new TV;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 TV)}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}},LV=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 IV,FV=e=>"function"==typeof e?e():e,$V=e=>{const t=Re((()=>{const t=FV(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ne(FV(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=FV(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=FV(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}},qV="data-kb-top-layer",zV=!1,UV=[];function VV(e){return UV.findIndex((t=>t.node===e))}function BV(){return UV.filter((e=>e.isPointerBlocking))}function KV(){return BV().length>0}function HV(e){const t=VV([...BV()].slice(-1)[0]?.node);return VV(e)<t}var WV={layers:UV,isTopMostLayer:function(e){return UV[UV.length-1].node===e},hasPointerBlockingLayer:KV,isBelowPointerBlockingLayer:HV,addLayer:function(e){UV.push(e)},removeLayer:function(e){const t=VV(e);t<0||UV.splice(t,1)},indexOf:VV,find:function(e){return UV[VV(e)]},assignPointerEventToLayers:function(){for(const{node:e}of UV)e.style.pointerEvents=HV(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(KV()&&!zV){const t=bU(e);IV=document.body.style.pointerEvents,t.body.style.pointerEvents="none",zV=!0}},restoreBodyPointerEvents:function(e){if(KV())return;const t=bU(e);t.body.style.pointerEvents=IV,0===t.body.style.length&&t.body.removeAttribute("style"),zV=!1}};lV({},{Button:()=>QV,Root:()=>YV});var GV=["button","color","file","image","reset","submit"];function YV(e){let t;const n=zU({type:"button"},e),[r,o]=vt(n,["ref","type","disabled"]),i=YU((()=>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!==GV.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return dt(XU,gt({as:"button",ref(e){const n=Jz((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 QV=YV,XV=["top","right","bottom","left"],JV=Math.min,ZV=Math.max,eB=Math.round,tB=Math.floor,nB=e=>({x:e,y:e}),rB={left:"right",right:"left",bottom:"top",top:"bottom"},oB={start:"end",end:"start"};function iB(e,t,n){return ZV(e,JV(t,n))}function sB(e,t){return"function"==typeof e?e(t):e}function aB(e){return e.split("-")[0]}function lB(e){return e.split("-")[1]}function cB(e){return"x"===e?"y":"x"}function uB(e){return"y"===e?"height":"width"}function dB(e){return["top","bottom"].includes(aB(e))?"y":"x"}function hB(e){return cB(dB(e))}function fB(e){return e.replace(/start|end/g,(e=>oB[e]))}function pB(e){return e.replace(/left|right|bottom|top/g,(e=>rB[e]))}function mB(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 gB(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 vB(e,t,n){let{reference:r,floating:o}=e;const i=dB(t),s=hB(t),a=uB(s),l=aB(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(lB(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function yB(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}=sB(t,e),p=mB(f),m=a[h?"floating"===d?"reference":"floating":d],g=gB(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=gB(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 bB(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xB(e){return XV.some((t=>e[t]>=0))}function wB(e){return kB(e)?(e.nodeName||"").toLowerCase():"#document"}function SB(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function CB(e){var t;return null==(t=(kB(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function kB(e){return e instanceof Node||e instanceof SB(e).Node}function EB(e){return e instanceof Element||e instanceof SB(e).Element}function jB(e){return e instanceof HTMLElement||e instanceof SB(e).HTMLElement}function PB(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof SB(e).ShadowRoot)}function TB(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=RB(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function _B(e){return["table","td","th"].includes(wB(e))}function NB(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(SY){return!1}}))}function DB(e){const t=MB(),n=EB(e)?RB(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 MB(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function OB(e){return["html","body","#document"].includes(wB(e))}function RB(e){return SB(e).getComputedStyle(e)}function AB(e){return EB(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function LB(e){if("html"===wB(e))return e;const t=e.assignedSlot||e.parentNode||PB(e)&&e.host||CB(e);return PB(t)?t.host:t}function IB(e){const t=LB(e);return OB(t)?e.ownerDocument?e.ownerDocument.body:e.body:jB(t)&&TB(t)?t:IB(t)}function FB(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=IB(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=SB(o);return i?t.concat(s,s.visualViewport||[],TB(o)?o:[],s.frameElement&&n?FB(s.frameElement):[]):t.concat(o,FB(o,[],n))}function $B(e){const t=RB(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jB(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=eB(n)!==i||eB(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function qB(e){return EB(e)?e:e.contextElement}function zB(e){const t=qB(e);if(!jB(t))return nB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=$B(t);let s=(i?eB(n.width):n.width)/r,a=(i?eB(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var UB=nB(0);function VB(e){const t=SB(e);return MB()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:UB}function BB(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=qB(e);let s=nB(1);t&&(r?EB(r)&&(s=zB(r)):s=zB(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==SB(e))&&t}(i,n,r)?VB(i):nB(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=SB(i),t=r&&EB(r)?SB(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=zB(o),t=o.getBoundingClientRect(),r=RB(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=SB(o),o=n.frameElement}}return gB({width:u,height:d,x:l,y:c})}function KB(e){return BB(CB(e)).left+AB(e).scrollLeft}function HB(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=SB(e),r=CB(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=MB();(!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=CB(e),n=AB(e),r=e.ownerDocument.body,o=ZV(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ZV(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+KB(e);const a=-n.scrollTop;return"rtl"===RB(r).direction&&(s+=ZV(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(CB(e));else if(EB(t))r=function(e,t){const n=BB(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jB(e)?zB(e):nB(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=VB(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return gB(r)}function WB(e,t){const n=LB(e);return!(n===t||!EB(n)||OB(n))&&("fixed"===RB(n).position||WB(n,t))}function GB(e,t,n){const r=jB(t),o=CB(t),i="fixed"===n,s=BB(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=nB(0);if(r||!r&&!i)if(("body"!==wB(t)||TB(o))&&(a=AB(t)),r){const e=BB(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=KB(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function YB(e){return"static"===RB(e).position}function QB(e,t){return jB(e)&&"fixed"!==RB(e).position?t?t(e):e.offsetParent:null}function XB(e,t){const n=SB(e);if(NB(e))return n;if(!jB(e)){let t=LB(e);for(;t&&!OB(t);){if(EB(t)&&!YB(t))return t;t=LB(t)}return n}let r=QB(e,t);for(;r&&_B(r)&&YB(r);)r=QB(r,t);return r&&OB(r)&&YB(r)&&!DB(r)?n:r||function(e){let t=LB(e);for(;jB(t)&&!OB(t);){if(DB(t))return t;if(NB(t))return null;t=LB(t)}return null}(e)||n}var JB={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=CB(r),a=!!t&&NB(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=nB(1);const u=nB(0),d=jB(r);if((d||!d&&!i)&&(("body"!==wB(r)||TB(s))&&(l=AB(r)),jB(r))){const e=BB(r);c=zB(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:CB,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?NB(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=FB(e,[],!1).filter((e=>EB(e)&&"body"!==wB(e))),o=null;const i="fixed"===RB(e).position;let s=i?LB(e):e;for(;EB(s)&&!OB(s);){const t=RB(s),n=DB(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||TB(s)&&!n&&WB(e,s))?r=r.filter((e=>e!==s)):o=t,s=LB(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=HB(t,n,o);return e.top=ZV(r.top,e.top),e.right=JV(r.right,e.right),e.bottom=JV(r.bottom,e.bottom),e.left=ZV(r.left,e.left),e}),HB(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:XB,getElementRects:async function(e){const t=this.getOffsetParent||XB,n=this.getDimensions,r=await n(e.floating);return{reference:GB(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}=$B(e);return{width:t,height:n}},getScale:zB,isElement:EB,isRTL:function(e){return"rtl"===RB(e).direction}};function ZB(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=qB(e),u=o||i?[...c?FB(c):[],...FB(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=CB(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:-tB(u)+"px "+-tB(o.clientWidth-(c+d))+"px "+-tB(o.clientHeight-(u+h))+"px "+-tB(c)+"px",threshold:ZV(0,JV(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(SY){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?BB(e):null;return l&&function t(){const r=BB(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 eK=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=aB(n),a=lB(n),l="y"===dB(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=sB(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}}}}},tK=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}=sB(e,t),c={x:n,y:r},u=await yB(t,l),d=dB(aB(o)),h=cB(d);let f=c[h],p=c[d];if(i){f=iB(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=iB(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}}}}},nK=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}=sB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=aB(o),y=dB(a),b=aB(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[pB(a)]:function(e){const t=pB(e);return[fB(e),t,fB(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=lB(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[]}}(aB(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(fB)))),i}(a,m,p,x));const C=[a,...w],k=await yB(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=lB(e),o=hB(e),i=uB(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pB(s)),[s,pB(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 _;const e=null==(_=j.filter((e=>{if(S){const t=dB(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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},rK=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}=sB(e,t),l=await yB(t,a),c=aB(n),u=lB(n),d="y"===dB(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=JV(f-l[p],g),b=JV(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?JV(b,v):v:w=u||x?JV(y,g):g,x&&!u){const e=ZV(l.left,0),t=ZV(l.right,0),n=ZV(l.top,0),r=ZV(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:ZV(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:ZV(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}}:{}}}},oK=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=sB(e,t);switch(r){case"referenceHidden":{const e=bB(await yB(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:xB(e)}}}case"escaped":{const e=bB(await yB(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:xB(e)}}}default:return{}}}}},iK=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}=sB(e,t)||{};if(null==c)return{};const d=mB(u),h={x:n,y:r},f=hB(o),p=uB(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=JV(d[v],E),P=JV(d[y],E),T=j,_=C-m[p]-P,N=C/2-m[p]/2+k,D=iB(T,N,_),M=!l.arrow&&null!=lB(o)&&N!==D&&i.reference[p]/2-(N<T?j:P)-m[p]/2<0,O=M?N<T?N-T:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),sK=(e,t,n)=>{const r={platform:JB,...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}=vB(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}=vB(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},aK=Ke();function lK(){const e=He(aK);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var cK=Lt('<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">'),uK={top:180,right:-90,bottom:0,left:90};function dK(e){const t=lK(),n=zU({size:30},e),[r,o]=vt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ne();return Oe((()=>{const t=e();var r;t&&n((r=t,bU(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return dt(XU,gt({as:"div",ref(e){const n=Jz(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return fU({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=cK(),t=e.firstChild;return Me((()=>Ft(t,"transform",`rotate(${uK[i()]} 15 15) translate(0 2)`))),e}}))}function hK(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 fK(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var pK={top:"bottom",right:"left",bottom:"top",left:"right"};var mK=Object.assign((function(e){const t=zU({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]=Ne(),[o,i]=Ne(),[s,a]=Ne(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?hK(t):e?e.getBoundingClientRect():hK()}};var e,n},{direction:c}=jV();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=[eK((({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(fK))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(nK({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(tK({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(rK({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(oK({padding:t.detachedPadding})),i&&d.push(iK({element:i,padding:t.arrowPadding}));const h=await sK(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...JB,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=pK[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(ZB(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),dt(aK.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:dK,Context:aK,usePopperContext:lK,Positioner:function(e){const t=lK(),[n,r]=vt(e,["ref","style"]);return dt(XU,gt({as:"div",ref(e){const r=Jz(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return fU({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var gK="interactOutside.pointerDownOutside",vK="interactOutside.focusOutside";var yK=Ke();function bK(e){let t;const n=He(yK),[r,o]=vt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=qU;const o=()=>bU(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(`[${qV}]`)&&!!vU(o(),r)&&!vU(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=jU([i,a]);r.addEventListener(gK,o,{once:!0});const s=new CustomEvent(gK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||PU(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=jU([s,a]);r.addEventListener(vK,o,{once:!0});const i=new CustomEvent(vK,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{oz(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=>vU(t(),e)))||[...i].some((t=>vU(t,e)))),onPointerDownOutside:e=>{t&&!WV.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||WV.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===wU.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if(oz(e.isDisabled))return;const n=e.ownerDocument?.()??bU();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>bU(t),onEscapeKeyDown:e=>{t&&WV.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;WV.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);WV.assignPointerEventToLayers(),WV.disableBodyPointerEvents(t),$e((()=>{t&&(WV.removeLayer(t),e?.(),WV.assignPointerEventToLayers(),WV.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=WV.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,WV.assignPointerEventToLayers()),t&&WV.disableBodyPointerEvents(e),$e((()=>{WV.restoreBodyPointerEvents(e)}))}),{defer:!0}));return dt(yK.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function xK(e={}){const[t,n]=sV({value:()=>oz(e.open),defaultValue:()=>!!oz(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 wK={};lV(wK,{Description:()=>tV,ErrorMessage:()=>nV,Item:()=>jK,ItemControl:()=>PK,ItemDescription:()=>TK,ItemIndicator:()=>_K,ItemInput:()=>NK,ItemLabel:()=>DK,Label:()=>MK,RadioGroup:()=>RK,Root:()=>OK});var SK=Ke();function CK(){const e=He(SK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var kK=Ke();function EK(){const e=He(kK);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function jK(e){const t=eV(),n=CK(),r=zU({id:`${t.generateId("item")}-${xt()}`},e),[o,i]=vt(r,["value","disabled","onPointerDown"]),[s,a]=Ne(),[l,c]=Ne(),[u,d]=Ne(),[h,f]=Ne(),[p,m]=Ne(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{EU(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:gU((()=>i.id)),registerInput:GU(a),registerLabel:GU(c),registerDescription:GU(d),setIsFocused:m,setInputRef:f};return dt(kK.Provider,{value:x,get children(){return dt(XU,gt({as:"div",role:"group",onPointerDown:y},b,i))}})}function PK(e){const t=EK(),n=zU({id:t.generateId("control")},e),[r,o]=vt(n,["onClick","onKeyDown"]);return dt(XU,gt({as:"div",onClick:e=>{EU(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{EU(e,r.onKeyDown),e.key===wU.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function TK(e){const t=EK(),n=zU({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),dt(XU,gt({as:"div"},(()=>t.dataset()),n))}function _K(e){const t=EK(),n=zU({id:t.generateId("indicator")},e),[r,o]=vt(n,["ref","forceMount"]),[i,s]=Ne(),{present:a}=$V({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return dt(kt,{get when(){return a()},get children(){return dt(XU,gt({as:"div",ref(e){const t=Jz(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function NK(e){const t=eV(),n=CK(),r=EK(),o=zU({id:r.generateId("input")},e),[i,s]=vt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ne(!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)))),dt(XU,gt({as:"input",ref(e){const t=Jz(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 fU({...WU},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(EU(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{EU(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{EU(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function DK(e){const t=EK(),n=zU({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),dt(XU,gt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function MK(e){return dt(rV,gt({as:"span"},e))}function OK(e){let t;const n=zU({id:`radiogroup-${xt()}`,orientation:"vertical"},e),[r,o,i]=vt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],JU),[s,a]=iV({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=zU({id:`form-control-${xt()}`},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(),[l,c]=Ne();return{formControlContext:{name:()=>oz(t.name)??oz(t.id),dataset:Re((()=>({"data-valid":"valid"===oz(t.validationState)?"":void 0,"data-invalid":"invalid"===oz(t.validationState)?"":void 0,"data-required":oz(t.required)?"":void 0,"data-disabled":oz(t.disabled)?"":void 0,"data-readonly":oz(t.readOnly)?"":void 0}))),validationState:()=>oz(t.validationState),isRequired:()=>oz(t.required),isDisabled:()=>oz(t.disabled),isReadOnly:()=>oz(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:gU((()=>oz(t.id))),registerLabel:GU(r),registerField:GU(i),registerDescription:GU(a),registerErrorMessage:GU(c)}}}(o);oV((()=>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 dt(ZU.Provider,{value:l,get children(){return dt(SK.Provider,{value:d,get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return oz(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(oz(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var RK=Object.assign(OK,{Description:tV,ErrorMessage:nV,Item:jK,ItemControl:PK,ItemDescription:TK,ItemIndicator:_K,ItemInput:NK,ItemLabel:DK,Label:MK}),AK=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 LK(e,t,n){const r=function(e){const{locale:t}=jV(),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 PV.has(r)&&(o=PV.get(r)),o||(o=new Intl.Collator(t(),e),PV.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return OV({selectionManager:()=>oz(e.selectionManager),keyboardDelegate:Re((()=>{const n=oz(e.keyboardDelegate);return n||new AK(e.collection,t,r)})),autoFocus:()=>oz(e.autoFocus),deferAutoFocus:()=>oz(e.deferAutoFocus),shouldFocusWrap:()=>oz(e.shouldFocusWrap),disallowEmptySelection:()=>oz(e.disallowEmptySelection),selectOnFocus:()=>oz(e.selectOnFocus),disallowTypeAhead:()=>oz(e.disallowTypeAhead),shouldUseVirtualFocus:()=>oz(e.shouldUseVirtualFocus),allowsTabNavigation:()=>oz(e.allowsTabNavigation),isVirtualized:()=>oz(e.isVirtualized),scrollToKey:t=>oz(e.scrollToKey)?.(t),orientation:()=>oz(e.orientation)},t)}var IK="focusScope.autoFocusOnMount",FK="focusScope.autoFocusOnUnmount",$K={bubbles:!1,cancelable:!0},qK={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=pU(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=pU(this.stack,e),this.active()?.resume()}};function zK(e,t){const[n,r]=Ne(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>bU(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,WU),e},u=()=>{const e=t();return e?RU(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;qK.add(o);const n=yU(e);if(!vU(e,n)){const t=new CustomEvent(IK,$K);e.addEventListener(IK,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{TU(d()),yU(e)===n&&TU(e)}),0)}$e((()=>{e.removeEventListener(IK,s),setTimeout((()=>{const r=new CustomEvent(FK,$K);(()=>{const e=t();if(!e)return!1;const n=yU(e);return!!n&&!vU(e,n)&&LU(n)})()&&r.preventDefault(),e.addEventListener(FK,a),e.dispatchEvent(r),r.defaultPrevented||TU(n??l().body),e.removeEventListener(FK,a),qK.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!oz(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${qV}]`)||(vU(r,t)?i=t:TU(i))},s=e=>{const t=e.relatedTarget??yU(r);t?.closest(`[${qV}]`)||vU(r,t)||TU(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!oz(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})();TU(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 UK="data-live-announcer";function VK(e){Oe((()=>{oz(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${UK}], [${qV}]`))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=BK.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),BK.set(e,t+1))};KK.length&&KK[KK.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 KK.push(a),()=>{s.disconnect();for(const e of r){const t=BK.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),BK.delete(e)):BK.set(e,t-1)}a===KK[KK.length-1]?(KK.pop(),KK.length&&KK[KK.length-1].observe()):KK.splice(KK.indexOf(a),1)}}(oz(e.targets),oz(e.root)))}))}var BK=new WeakMap,KK=[];var HK=new Map,WK=e=>{Oe((()=>{const t=FV(e.style)??{},n=FV(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=HK.get(e.key);o?o.activeCount++:HK.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=HK.get(e.key);if(t)if(1===t.activeCount){HK.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--}))}))},GK=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},YK=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[QK,XK]=Ne([]),JK=e=>[e.deltaX,e.deltaY],ZK=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],eH=(e,t,n,r)=>{const o=null!==r&&tH(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]=GK(o,t),u=c-e-r*l;0===l&&0===u||!YK(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)},tH=(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},nH=e=>{const t=gt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=xt();let r=[0,0],o=null,i=null;Oe((()=>{FV(t.enabled)&&(XK((e=>[...e,n])),$e((()=>{XK((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!FV(t.enabled)||!FV(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(FV(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===FV(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;WK({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{FV(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else WK({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,QK().indexOf(e)===QK().length-1&&FV(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=ZK(e),o=null,i=null},a=e=>{const n=e.target,r=FV(t.element),o=JK(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=eH(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!tH(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=FV(t.element),s=e.target;let a;if(2===e.touches.length)a=!FV(t.allowPinchZoom);else{if(null==o||null===i){const t=ZK(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=eH(s,o,i,n);a=!n||!tH(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},rH=Ke();function oH(){return He(rH)}function iH(){const e=oH();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var sH=Ke();function aH(){const e=He(sH);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var lH=Ke();function cH(){const e=He(lH);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function uH(e){let t;const n=cH(),r=iH(),o=zU({id:n.generateId(`item-${xt()}`)},e),[i,s]=vt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ne(),[c,u]=Ne(),[d,h]=Ne(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};mV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=RV({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{EU(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(TU(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{EU(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{EU(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(EU(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:gU((()=>s.id)),registerLabel:GU(l),registerDescription:GU(u)};return dt(sH.Provider,{value:C,get children(){return dt(XU,gt({as:"div",ref(e){const n=Jz((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 jU([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return jU([b,g.onPointerUp])},get onClick(){return jU([i.onClick,g.onClick])},get onKeyDown(){return jU([x,g.onKeyDown])},get onMouseDown(){return jU([i.onMouseDown,g.onMouseDown])},get onFocus(){return jU([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function dH(e){const t=zU({closeOnSelect:!1},e),[n,r]=vt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=sV({value:()=>oz(e.isSelected),defaultValue:()=>!!oz(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{oz(e.isReadOnly)||oz(e.isDisabled)||n(t)},toggle:()=>{oz(e.isReadOnly)||oz(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return dt(uH,gt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var hH=Ke();function fH(){return He(hH)}var pH={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>pH.next("ltr"===e?"rtl":"ltr",t)},mH=e=>"horizontal"===e?"ArrowDown":"ArrowRight",gH=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function vH(e){const t=cH(),n=iH(),r=fH(),{direction:o}=jV(),i=zU({id:t.generateId("trigger")},e),[s,a]=vt(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=YU((()=>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)))),dt(YV,gt({ref(e){const t=Jz(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=>{EU(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{EU(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{EU(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(EU(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case mH(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=FU(e);for(;e&&n&&e!==t&&n!==t;)KU(n,e),n=FU(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 gH(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case pH.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case pH.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{EU(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 yH=Ke();function bH(){return He(yH)}function xH(e){let t;const n=cH(),r=iH(),o=fH(),i=bH(),{direction:s}=jV(),a=zU({id:n.generateId(`content-${xt()}`)},e),[l,c]=vt(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=LK({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));zK({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:Jz((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:jU([l.onKeyDown,h.onKeyDown,e=>{if(vU(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case pH.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case pH.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:jU([l.onMouseDown,h.onMouseDown]),onFocusIn:jU([l.onFocusIn,h.onFocusIn]),onFocusOut:jU([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{EU(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(EU(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;vU(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return dt(kt,{get when(){return r.contentPresent()},get children(){return dt(kt,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return dt(XU,gt({as:"div"},(()=>r.dataset()),m,c))},get children(){return dt(mK.Positioner,{get children(){return dt(bK,gt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return fU({"--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 wH(e){let t;const n=cH(),r=iH(),[o,i]=vt(e,["ref"]);return nH({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),dt(xH,gt({ref(e){const n=Jz((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var SH=Ke();function CH(e){const t=zU({id:cH().generateId(`group-${xt()}`)},e),[n,r]=Ne(),o={generateId:gU((()=>t.id)),registerLabelId:GU(r)};return dt(SH.Provider,{value:o,get children(){return dt(XU,gt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function kH(e){const t=function(){const e=He(SH);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=zU({id:t.generateId("label")},e),[r,o]=vt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),dt(XU,gt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function EH(e){const t=iH();return dt(XU,gt({as:"span","aria-hidden":"true"},(()=>t.dataset()),zU({children:"▼"},e)))}function jH(e){return dt(uH,gt({role:"menuitem",closeOnSelect:!0},e))}function PH(e){const t=aH(),n=zU({id:t.generateId("description")},e),[r,o]=vt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),dt(XU,gt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function TH(e){const t=aH(),n=zU({id:t.generateId("indicator")},e),[r,o]=vt(n,["forceMount"]);return dt(kt,{get when(){return r.forceMount||t.isChecked()},get children(){return dt(XU,gt({as:"div"},(()=>t.dataset()),o))}})}function _H(e){const t=aH(),n=zU({id:t.generateId("label")},e),[r,o]=vt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),dt(XU,gt({as:"div",ref(e){const n=Jz(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function NH(e){const t=iH();return dt(kt,{get when(){return t.contentPresent()},get children(){return dt(en,e)}})}var DH=Ke();function MH(e){const t=zU({id:cH().generateId(`radiogroup-${xt()}`)},e),[n,r]=vt(t,["value","defaultValue","onChange","disabled"]),[o,i]=iV({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return dt(DH.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return dt(CH,r)}})}function OH(e){const t=function(){const e=He(DH);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=zU({closeOnSelect:!1},e),[r,o]=vt(n,["value","onSelect"]);return dt(uH,gt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function RH(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 AH(e){const t=cH(),n=uV(),r=oH(),o=fH(),i=bH(),s=zU({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=vt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=Ne(),[p,m]=Ne(),[g,v]=Ne(),[y,b]=Ne(),[x,w]=Ne(!0),[S,C]=Ne(l.placement),[k,E]=Ne([]),[j,P]=Ne([]),{DomCollectionProvider:T}=pV({items:j,onItemsChange:P}),_=xK({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:N}=$V({show:()=>t.forceMount()||_.isOpen(),element:()=>y()??null}),D=function(e){const t=MV(e),n=vV({dataSource:()=>oz(e.dataSource),getKey:()=>oz(e.getKey),getTextValue:()=>oz(e.getTextValue),getDisabled:()=>oz(e.getDisabled),getSectionChildren:()=>oz(e.getSectionChildren),factory:t=>new LV(e.filter?e.filter(t):t)},[()=>e.filter]),r=new AV(n,t);return De((()=>{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),_.open()},O=(e=!1)=>{_.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(TU(e),D.selectionManager().setFocused(!0),D.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};VK({isDisabled:()=>!(null==r&&_.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&&_.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":_.isOpen()?"":void 0,"data-closed":_.isOpen()?void 0:""}))),isOpen:_.isOpen,contentPresent:N,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),_.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=>pU(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:GU(f),registerContentId:GU(m)};return dt(T,{get children(){return dt(rH.Provider,{value:I,get children(){return dt(kt,{when:void 0===i,get fallback(){return l.children},get children(){return dt(mK,gt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function LH(e){const{direction:t}=jV();return dt(AH,gt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var IH=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function FH(e){const t=iH(),n=cH(),[r,o]=vt(e,["onFocusOutside","onKeyDown"]),{direction:i}=jV();return dt(xH,gt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;vU(t.triggerRef(),n)||t.close()},onKeyDown:e=>{EU(e,r.onKeyDown);const o=vU(e.currentTarget,e.target),s=IH(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),TU(t.triggerRef()))}},o))}var $H=["Enter"," "],qH=(e,t)=>"ltr"===e?[...$H,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...$H,"horizontal"===t?"ArrowLeft":"ArrowUp"];function zH(e){let t;const n=cH(),r=iH(),o=zU({id:n.generateId(`sub-trigger-${xt()}`)},e),[i,s]=vt(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}=jV(),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=RV({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{EU(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{EU(e,i.onKeyDown),e.repeat||i.disabled||qH(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()})),dt(XU,gt({as:"div",ref(e){const n=Jz((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 jU([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return jU([i.onPointerUp,h.onPointerUp])},get onClick(){return jU([f,h.onClick])},get onKeyDown(){return jU([p,h.onKeyDown])},get onMouseDown(){return jU([i.onMouseDown,h.onMouseDown])},get onFocus(){return jU([i.onFocus,h.onFocus])},onPointerMove:e=>{if(EU(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)),TU(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(EU(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:RH(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 UH(e){const t=fH(),n=zU({id:`menu-${xt()}`,modal:!0},e),[r,o]=vt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=xK({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:gU((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return dt(lH.Provider,{value:s,get children(){return dt(AH,gt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function VH(e){let t;const n=zU({orientation:"horizontal"},e),[r,o]=vt(n,["ref","orientation"]),i=YU((()=>t),(()=>"hr"));return dt(XU,gt({as:"hr",ref(e){const n=Jz((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))}lV({},{Root:()=>VH,Separator:()=>BH});var BH=VH,KH={};function HH(e){const t=cH(),n=iH(),[r,o]=vt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return dt(wH,gt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||TU(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function WH(e){return dt(UH,zU({id:`dropdownmenu-${xt()}`},e))}lV(KH,{Arrow:()=>dK,CheckboxItem:()=>dH,Content:()=>HH,DropdownMenu:()=>GH,Group:()=>CH,GroupLabel:()=>kH,Icon:()=>EH,Item:()=>jH,ItemDescription:()=>PH,ItemIndicator:()=>TH,ItemLabel:()=>_H,Portal:()=>NH,RadioGroup:()=>MH,RadioItem:()=>OH,Root:()=>WH,Separator:()=>VH,Sub:()=>LH,SubContent:()=>FH,SubTrigger:()=>zH,Trigger:()=>vH});var GH=Object.assign(WH,{Arrow:dK,CheckboxItem:dH,Content:HH,Group:CH,GroupLabel:kH,Icon:EH,Item:jH,ItemDescription:PH,ItemIndicator:TH,ItemLabel:_H,Portal:NH,RadioGroup:MH,RadioItem:OH,Separator:VH,Sub:LH,SubContent:FH,SubTrigger:zH,Trigger:vH}),YH={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:{100:"ff",90:"e5",80:"cc",70:"b3",60:"99",50:"80",40:"66",30:"4d",20:"33",10:"1a",0:"00"},font:{size:{"2xs":"calc(var(--tsqd-font-size) * 0.625)",xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)",lg:"calc(var(--tsqd-font-size) * 1.125)",xl:"calc(var(--tsqd-font-size) * 1.25)","2xl":"calc(var(--tsqd-font-size) * 1.5)","3xl":"calc(var(--tsqd-font-size) * 1.875)","4xl":"calc(var(--tsqd-font-size) * 2.25)","5xl":"calc(var(--tsqd-font-size) * 3)","6xl":"calc(var(--tsqd-font-size) * 3.75)","7xl":"calc(var(--tsqd-font-size) * 4.5)","8xl":"calc(var(--tsqd-font-size) * 6)","9xl":"calc(var(--tsqd-font-size) * 8)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)",lg:"calc(var(--tsqd-font-size) * 1.75)",xl:"calc(var(--tsqd-font-size) * 2)","2xl":"calc(var(--tsqd-font-size) * 2.25)","3xl":"calc(var(--tsqd-font-size) * 2.5)","4xl":"calc(var(--tsqd-font-size) * 2.75)","5xl":"calc(var(--tsqd-font-size) * 3)","6xl":"calc(var(--tsqd-font-size) * 3.25)","7xl":"calc(var(--tsqd-font-size) * 3.5)","8xl":"calc(var(--tsqd-font-size) * 3.75)","9xl":"calc(var(--tsqd-font-size) * 4)"},weight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"}},breakpoints:{xs:"320px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},border:{radius:{none:"0px",xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",md:"calc(var(--tsqd-font-size) * 0.375)",lg:"calc(var(--tsqd-font-size) * 0.5)",xl:"calc(var(--tsqd-font-size) * 0.75)","2xl":"calc(var(--tsqd-font-size) * 1)","3xl":"calc(var(--tsqd-font-size) * 1.5)",full:"9999px"}},size:{0:"0px",.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)",5.5:"calc(var(--tsqd-font-size) * 1.375)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",7:"calc(var(--tsqd-font-size) * 1.75)",8:"calc(var(--tsqd-font-size) * 2)",9:"calc(var(--tsqd-font-size) * 2.25)",10:"calc(var(--tsqd-font-size) * 2.5)",11:"calc(var(--tsqd-font-size) * 2.75)",12:"calc(var(--tsqd-font-size) * 3)",14:"calc(var(--tsqd-font-size) * 3.5)",16:"calc(var(--tsqd-font-size) * 4)",20:"calc(var(--tsqd-font-size) * 5)",24:"calc(var(--tsqd-font-size) * 6)",28:"calc(var(--tsqd-font-size) * 7)",32:"calc(var(--tsqd-font-size) * 8)",36:"calc(var(--tsqd-font-size) * 9)",40:"calc(var(--tsqd-font-size) * 10)",44:"calc(var(--tsqd-font-size) * 11)",48:"calc(var(--tsqd-font-size) * 12)",52:"calc(var(--tsqd-font-size) * 13)",56:"calc(var(--tsqd-font-size) * 14)",60:"calc(var(--tsqd-font-size) * 15)",64:"calc(var(--tsqd-font-size) * 16)",72:"calc(var(--tsqd-font-size) * 18)",80:"calc(var(--tsqd-font-size) * 20)",96:"calc(var(--tsqd-font-size) * 24)"},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"},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800}},QH=Lt('<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>'),XH=Lt('<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>'),JH=Lt('<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>'),ZH=Lt('<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>'),eW=Lt('<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>'),tW=Lt('<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>'),nW=Lt('<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>'),rW=Lt('<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>'),oW=Lt('<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">'),iW=Lt('<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">'),sW=Lt('<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>'),aW=Lt('<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>'),lW=Lt('<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>'),cW=Lt('<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>'),uW=Lt('<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>'),dW=Lt('<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>'),hW=Lt('<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>'),fW=Lt('<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>'),pW=Lt('<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>'),mW=Lt('<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>'),gW=Lt('<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>'),vW=Lt('<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>'),yW=Lt('<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 bW(){return QH()}function xW(){return XH()}function wW(){return JH()}function SW(){return ZH()}function CW(){return eW()}function kW(){return(e=eW()).style.setProperty("transform","rotate(90deg)"),e;var e}function EW(){return(e=eW()).style.setProperty("transform","rotate(-90deg)"),e;var e}function jW(){return tW()}function PW(){return nW()}function TW(){return rW()}function _W(){return oW()}function NW(){return iW()}function DW(){return sW()}function MW(){return aW()}function OW(){return lW()}function RW(){return cW()}function AW(e){return t=uW(),n=t.firstChild,Me((()=>Ft(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function LW(){return dW()}function IW(){return hW()}function FW(e){return[dt(kt,{get when(){return e.checked},get children(){var t=uW(),n=t.firstChild;return Me((()=>Ft(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),dt(kt,{get when(){return!e.checked},get children(){var t=fW(),n=t.firstChild;return Me((()=>Ft(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function $W(){return pW()}function qW(){return mW()}function zW(){return gW()}function UW(){return vW()}function VW(){const e=xt();return t=yW(),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,N=(_=(T=j.nextSibling).nextSibling).firstChild,M=(D=_.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,B=(V=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=V.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=(De=(Ne=(_e=(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,Ft(n,"id",`a-${e}`),Ft(r,"fill",`url(#a-${e})`),Ft(i,"id",`am-${e}`),Ft(s,"id",`b-${e}`),Ft(a,"filter",`url(#am-${e})`),Ft(l,"mask",`url(#b-${e})`),Ft(u,"id",`ah-${e}`),Ft(d,"id",`k-${e}`),Ft(h,"filter",`url(#ah-${e})`),Ft(f,"mask",`url(#k-${e})`),Ft(m,"id",`ae-${e}`),Ft(g,"id",`j-${e}`),Ft(v,"filter",`url(#ae-${e})`),Ft(y,"mask",`url(#j-${e})`),Ft(x,"id",`ai-${e}`),Ft(w,"id",`i-${e}`),Ft(S,"filter",`url(#ai-${e})`),Ft(C,"mask",`url(#i-${e})`),Ft(E,"id",`aj-${e}`),Ft(j,"id",`h-${e}`),Ft(P,"filter",`url(#aj-${e})`),Ft(T,"mask",`url(#h-${e})`),Ft(N,"id",`ag-${e}`),Ft(D,"id",`g-${e}`),Ft(M,"filter",`url(#ag-${e})`),Ft(O,"mask",`url(#g-${e})`),Ft(A,"id",`af-${e}`),Ft(L,"id",`f-${e}`),Ft(I,"filter",`url(#af-${e})`),Ft(F,"mask",`url(#f-${e})`),Ft($,"id",`m-${e}`),Ft(q,"fill",`url(#m-${e})`),Ft(U,"id",`ak-${e}`),Ft(V,"id",`e-${e}`),Ft(B,"filter",`url(#ak-${e})`),Ft(K,"mask",`url(#e-${e})`),Ft(H,"id",`n-${e}`),Ft(W,"fill",`url(#n-${e})`),Ft(G,"id",`r-${e}`),Ft(Y,"fill",`url(#r-${e})`),Ft(Q,"id",`s-${e}`),Ft(X,"fill",`url(#s-${e})`),Ft(J,"id",`q-${e}`),Ft(Z,"fill",`url(#q-${e})`),Ft(ee,"id",`p-${e}`),Ft(te,"fill",`url(#p-${e})`),Ft(ne,"id",`o-${e}`),Ft(re,"fill",`url(#o-${e})`),Ft(oe,"id",`l-${e}`),Ft(ie,"fill",`url(#l-${e})`),Ft(ae,"id",`al-${e}`),Ft(le,"id",`d-${e}`),Ft(ce,"filter",`url(#al-${e})`),Ft(ue,"mask",`url(#d-${e})`),Ft(de,"id",`u-${e}`),Ft(he,"fill",`url(#u-${e})`),Ft(pe,"id",`ad-${e}`),Ft(me,"id",`c-${e}`),Ft(ge,"filter",`url(#ad-${e})`),Ft(ve,"mask",`url(#c-${e})`),Ft(ye,"id",`t-${e}`),Ft(be,"fill",`url(#t-${e})`),Ft(xe,"id",`v-${e}`),Ft(we,"stroke",`url(#v-${e})`),Ft(Se,"id",`aa-${e}`),Ft(Ce,"stroke",`url(#aa-${e})`),Ft(ke,"id",`w-${e}`),Ft(Ee,"stroke",`url(#w-${e})`),Ft(je,"id",`ac-${e}`),Ft(Pe,"stroke",`url(#ac-${e})`),Ft(Te,"id",`ab-${e}`),Ft(_e,"stroke",`url(#ab-${e})`),Ft(Ne,"id",`y-${e}`),Ft(De,"stroke",`url(#y-${e})`),Ft(Me,"id",`x-${e}`),Ft(Oe,"stroke",`url(#x-${e})`),Ft(Re,"id",`z-${e}`),Ft(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,V,B,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,_e,Ne,De,Me,Oe,Re,Ae}var BW=Lt('<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>'),KW=Lt('<button title="Copy object to clipboard">'),HW=Lt('<button title="Remove all items"aria-label="Remove all items">'),WW=Lt('<button title="Delete item"aria-label="Delete item">'),GW=Lt('<button title="Toggle value"aria-label="Toggle value">'),YW=Lt('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),QW=Lt("<div>"),XW=Lt("<div><button> <span></span> <span> "),JW=Lt("<input>"),ZW=Lt("<span>"),eG=Lt("<div><span>:"),tG=Lt("<div><div><button> [<!>...<!>]");var nG=e=>{const t=Sz(),n=vz().shadowDOMTarget?Wz.bind({target:vz().shadowDOMTarget}):Wz,r=Re((()=>"dark"===t()?dG(n):uG(n)));return o=BW(),Me((()=>$t(o,Yz(r().expander,n`
53
53
  transform: rotate(${e.expanded?90:0}deg);
54
54
  `,e.expanded&&n`
55
55
  & svg {
@@ -1248,4 +1248,4 @@
1248
1248
  opacity: 0.6;
1249
1249
  cursor: not-allowed;
1250
1250
  }
1251
- `}},bY=e=>yY("light",e),xY=e=>yY("dark",e);It(["click","mousedown","input"]);const wY=Object.freeze(Object.defineProperty({__proto__:null,default:e=>{const[t,n]=lz({prefix:"TanstackQueryDevtools"}),r=or(),o=Re((()=>{const e=t.theme_preference||fz;return"system"!==e?e:r()}));return dt(gz.Provider,{value:e,get children(){return dt(bz,{localStore:t,setLocalStore:n,get children(){return dt(wz.Provider,{value:o,get children(){return dt(eY,{localStore:t,setLocalStore:n})}})}})}})}},Symbol.toStringTag,{value:"Module"}));Symbol;e.CreateAutomationModal=Vx,e.Engage=({iconDefinitions:e})=>{const n=Cx(e);return t.jsx(kA,{iconDefinitionsPassed:n})},e.ReachProvider=({authToken:e,tenantExternalId:r,language:o,children:i,theme:s,debug:a})=>{const[l]=n.useState((()=>(e&&(ua=e),new G({defaultOptions:{queries:{retry:(e,t)=>!(t instanceof Error&&"Unauthorized"===t.message)&&e<3,...ca}}}))));return t.jsx("div",{"data-reach-root":!0,children:t.jsxs(re,{client:l,children:[t.jsx(ia,{clientSideID:"67a3c277012e1f09c67de499",context:{kind:"user",key:r||"anonymous",custom:{businessId:r}},options:{streaming:!1},timeout:2,reactOptions:{useCamelCaseFlagKeys:!1,sendEventsOnFlagRead:!0},children:t.jsx(Fl,{initialLanguage:o,children:t.jsx(ka,{initialTheme:s,children:t.jsxs(va,{children:[i,t.jsx(ih,{})]})})})}),a&&t.jsx(cr,{})]})})},e.SegmentBuilderDialog=SA,e.ViewAutomationModal=({inRouter:e=!1,...n})=>e?t.jsx(nz,{...n}):t.jsx(Jw,{children:t.jsx(nz,{...n})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
1251
+ `}},bY=e=>yY("light",e),xY=e=>yY("dark",e);It(["click","mousedown","input"]);const wY=Object.freeze(Object.defineProperty({__proto__:null,default:e=>{const[t,n]=lz({prefix:"TanstackQueryDevtools"}),r=or(),o=Re((()=>{const e=t.theme_preference||fz;return"system"!==e?e:r()}));return dt(gz.Provider,{value:e,get children(){return dt(bz,{localStore:t,setLocalStore:n,get children(){return dt(wz.Provider,{value:o,get children(){return dt(eY,{localStore:t,setLocalStore:n})}})}})}})}},Symbol.toStringTag,{value:"Module"}));Symbol;e.CreateAutomationModal=Vx,e.Engage=({iconDefinitions:e})=>{const n=Cx(e);return t.jsx(kA,{iconDefinitionsPassed:n})},e.ReachProvider=({authToken:e,tenantExternalId:r,language:o,children:i,theme:s,debug:a})=>{const[l]=n.useState((()=>(e&&(ua=e),new G({defaultOptions:{queries:{retry:(e,t)=>!(t instanceof Error&&"Unauthorized"===t.message)&&e<3,...ca}}}))));return t.jsx("div",{"data-reach-root":!0,children:t.jsxs(re,{client:l,children:[t.jsx(ia,{clientSideID:"67a3c277012e1f09c67de499",context:{kind:"user",key:r||"anonymous",custom:{businessId:r}},options:{streaming:!1},timeout:2,reactOptions:{useCamelCaseFlagKeys:!1,sendEventsOnFlagRead:!0},children:t.jsx(ih,{initialLanguage:o,children:t.jsx(Ku,{initialTheme:s,children:t.jsxs(Fu,{children:[i,t.jsx(Au,{})]})})})}),a&&t.jsx(cr,{})]})})},e.SegmentBuilderDialog=SA,e.ViewAutomationModal=({inRouter:e=!1,...n})=>e?t.jsx(nz,{...n}):t.jsx(Jw,{children:t.jsx(nz,{...n})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));