@bluealba/pae-ui-react-core 4.2.3 → 4.3.0-develop-64
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.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.systemjs.js +1 -1
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19,7 +19,7 @@ Check the top-level render call using <`+j+">.")}return A}}function Li(b,A){{if(
|
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,Oo,Bt,df,Bt),ki[Bt+Oo]=!0}}return b===r?sf(fe):of(fe),fe}}function af(b,A,j){return $i(b,A,j,!0)}function cf(b,A,j){return $i(b,A,j,!1)}var lf=cf,uf=af;$n.Fragment=r,$n.jsx=lf,$n.jsxs=uf}(),$n}mc.exports=Cf();var l=mc.exports;const gc=_.createContext(null),vc=({module:e,children:t})=>l.jsx(gc.Provider,{value:e,children:t});vc.displayName="PAEModule";const nr=()=>{const e=_.useContext(gc);if(!e)throw new Error("Module metadata was not setup yet !!");return e};function Ds(){if(!window[zn])throw new Error("PAE Global state not found.");return window[zn]}const Ls=()=>{const{authUser:{applications:e}}=Ds();return e||[]},yc=e=>Ls().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations),bc=()=>{const{application:e}=nr();return _.useMemo(()=>yc(e),[e])},wc=e=>(...t)=>t.every(n=>e.some(r=>r.name===n)),rr=()=>{const[{authUser:e}]=er(),t=bc();return{authUser:e,hasAccess:_.useMemo(()=>wc(t),[t])}},xf=()=>{const{authUser:e}=rr();return!e||e.id==="anon"},Ms=()=>{var e;return((e=nr().ui)==null?void 0:e.customProps)??{}},ks=e=>{const t=tr();return _.useMemo(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])},Cc=e=>{var t,n;return((n=(t=ks(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}},Sf=e=>e.replace(/\/+/g,"/"),Ef=(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:s}=(e==null?void 0:e.commonPaths)||{},i=(a,c="")=>{if(a===void 0&&!c)return;const u=a??c;if(t==="only-base-path")return u;const f=Sf(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:i(n,"/api-docs-json"),healthPath:i(r,"/health"),versionPath:i(o,"/version"),changelogPath:i(s,"/changelog")}};function _f(){window.open(pf,"_self")}const Rf=e=>jr.navigateToUrl(e),Tf=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,Pf=e=>Tf.test(e),Af=(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)},xc=e=>e.type==="app",Of=e=>e.modules.some(xc)&&e.route&&e.route!=="/",Sc=e=>{const{catalog:t}=Ds();return oo(t.filter(n=>n.application===e))},oo=(e=[])=>e.find(t=>{var n;return xc(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),Ec=()=>{const e=tr();return _.useMemo(()=>Ls().map(n=>{var s,i,a;const r=jf(e,n.name),o=oo(r);return{name:n.name,displayName:((i=(s=o==null?void 0:o.ui)==null?void 0:s.customProps)==null?void 0:i.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])},jf=(e,t)=>e.filter(n=>n.application===t)||[],_c=()=>{const e=Ec();return _.useMemo(()=>e.filter(Of),[e])},Rc=e=>_.useMemo(()=>e?Sc(e.name):void 0,[e]),Nt=new Map,If=e=>{try{const{catalog:t}=Ds(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},so=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{(async()=>{if(!e){n(null);return}try{const o=If(e);if(Nt.has(o)){const i=Nt.get(o);n(i);return}const s=await System.import(e);Nt.set(o,s),n(s)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t},Nf=e=>{e?(Array.from(Nt.keys()).filter(n=>n.startsWith(e)).forEach(n=>Nt.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(Nt.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:Nf,getModuleCacheSize:()=>Nt.size,getModuleCacheKeys:()=>Array.from(Nt.keys())});const Tc=e=>{const t=typeof e=="string"?Sc(e):oo(e==null?void 0:e.modules),n=so(t==null?void 0:t.name);return n==null?void 0:n.icon},Pc=e=>{const t=oo(e==null?void 0:e.modules),n=so(t==null?void 0:t.name),[r,o]=_.useState(!1),[s,i]=_.useState({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],c=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const p=Df((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:h,path:v}=g;if(x!=null&&x.length&&!p(x))return null;const y=(h||[]).filter(w=>{var S;return!((S=w==null?void 0:w.operations)!=null&&S.length)||p(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const p=await c();e&&i(m=>({...m,[e.name]:p}))};_.useEffect(()=>{u()},[n==null?void 0:n.menu]);const f=_.useMemo(()=>e?s[e.name]||[]:[],[s,e]);return{loading:r,menu:f}},Df=e=>t=>t.every(n=>e.some(r=>r.name===n)),Lf=e=>Pc(e);function ae(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ut(e){return function t(n){return arguments.length===0||ae(n)?t:e.apply(this,arguments)}}function wt(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return ae(n)?t:Ut(function(o){return e(n,o)});default:return ae(n)&&ae(r)?t:ae(n)?Ut(function(o){return e(o,r)}):ae(r)?Ut(function(o){return e(n,o)}):e(n,r)}}}function $s(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return ae(n)?t:wt(function(s,i){return e(n,s,i)});case 2:return ae(n)&&ae(r)?t:ae(n)?wt(function(s,i){return e(s,r,i)}):ae(r)?wt(function(s,i){return e(n,s,i)}):Ut(function(s){return e(n,r,s)});default:return ae(n)&&ae(r)&&ae(o)?t:ae(n)&&ae(r)?wt(function(s,i){return e(s,i,o)}):ae(n)&&ae(o)?wt(function(s,i){return e(s,r,i)}):ae(r)&&ae(o)?wt(function(s,i){return e(n,s,i)}):ae(n)?Ut(function(s){return e(s,r,o)}):ae(r)?Ut(function(s){return e(n,s,o)}):ae(o)?Ut(function(s){return e(n,r,s)}):e(n,r,o)}}}function fr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ui(e){return Object.prototype.toString.call(e)==="[object Object]"}var Mf=$s(function(t,n,r){var o=t(n),s=t(r);return o>s?-1:o<s?1:0}),kf=$s(function(t,n,r){var o={},s;n=n||{},r=r||{};for(s in n)fr(s,n)&&(o[s]=fr(s,r)?t(s,n[s],r[s]):n[s]);for(s in r)fr(s,r)&&!fr(s,o)&&(o[s]=r[s]);return o}),$f=$s(function e(t,n,r){return kf(function(o,s,i){return Ui(s)&&Ui(i)?e(t,s,i):t(o,s,i)},n,r)}),Ff=wt(function(t,n){return $f(function(r,o,s){return s},t,n)}),Bf=wt(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var s=0,i=0;s===0&&i<t.length;)s=t[i](r,o),i+=1;return s})});const Fs=()=>{const e=pc(),t=_c();return _.useMemo(()=>Uf(e,t),[e,t])},Uf=(e,t)=>Bf([Mf(Wf)],t).find(n=>n.route&&e.startsWith(n.route)),Wf=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Ac=()=>{var e;return(e=Fs())==null?void 0:e.name},Hf=()=>{const e=Fs(),t=Rc(e);return so(t==null?void 0:t.name)},Bs=(e,t)=>{const r=tr().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl},Us=(e,t)=>{const n=Bs(e,!!t)??t;return _.useCallback((r,o)=>{const i={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Vf(`${n}${r}`),{...o,headers:i})},[n])},Vf=e=>e.replace(/\/+/g,"/"),zf=["impersonate","impersonate-display-name","tenant"],Oc=(e,t)=>{const n=Bs(e,t);return _.useMemo(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return zf.forEach(s=>{const i=r.searchParams.get(s);i&&o.searchParams.set(s,i)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])},qf=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),Gf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(qf(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},Kf="@bluealba/pae-habits-service",jc=()=>{const{authUser:e}=rr(),t=nr(),n=Us(Kf);return _.useCallback(Gf(n,e,t),[n,e,t])},Qf=()=>{const e=jc();return _.useCallback((t,n)=>e([{name:t,data:n}]),[e])},Ic=e=>{const t=nr(),n=window[fc],[r,o]=_.useState(null);return _.useEffect(()=>n.defineExtensionPoint(t,e,s=>{o(()=>s)}),[o]),r},Nc=(e,t,n)=>{_.useEffect(()=>window[fc].setExtensionPoint(e,t,n),[])},Dc=(e,t)=>{_.useEffect(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])},Lc=e=>{const{cssCustomizationLoadingDelay:t=1e3}=Ms();_.useEffect(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])},Yf=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},Zf={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},Xf=e=>{const t=Yf(e);return t?Zf[t]:void 0},Jf=(e,t)=>{const n=t??Xf(e);return n?`format(${n})`:""};function Mc(e){const[t,n]=_.useState(!1);return _.useEffect(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:i,variants:a})=>a.map(({path:c,fontWeight:u,format:f})=>`
|
|
22
|
+
<%s key={someKey} {...props} />`,Oo,Bt,df,Bt),ki[Bt+Oo]=!0}}return b===r?sf(fe):of(fe),fe}}function af(b,A,j){return $i(b,A,j,!0)}function cf(b,A,j){return $i(b,A,j,!1)}var lf=cf,uf=af;$n.Fragment=r,$n.jsx=lf,$n.jsxs=uf}(),$n}mc.exports=Cf();var l=mc.exports;const gc=_.createContext(null),vc=({module:e,children:t})=>l.jsx(gc.Provider,{value:e,children:t});vc.displayName="PAEModule";const nr=()=>{const e=_.useContext(gc);if(!e)throw new Error("Module metadata was not setup yet !!");return e};function Ds(){if(!window[zn])throw new Error("PAE Global state not found.");return window[zn]}const Ls=()=>{const{authUser:{applications:e}}=Ds();return e||[]},yc=e=>Ls().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations),bc=()=>{const{application:e}=nr();return _.useMemo(()=>yc(e),[e])},wc=e=>(...t)=>t.every(n=>e.some(r=>r.name===n)),rr=()=>{const[{authUser:e}]=er(),t=bc();return{authUser:e,hasAccess:_.useMemo(()=>wc(t),[t])}},xf=()=>{const{authUser:e}=rr();return!e||e.id==="anon"},Ms=()=>{var e;return((e=nr().ui)==null?void 0:e.customProps)??{}},ks=e=>{const t=tr();return _.useMemo(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])},Cc=e=>{var t,n;return((n=(t=ks(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}},Sf=e=>e.replace(/\/+/g,"/"),Ef=(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:s}=(e==null?void 0:e.commonPaths)||{},i=(a,c="")=>{if(a===void 0&&!c)return;const u=a??c;if(t==="only-base-path")return u;const f=Sf(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:i(n,"/api-docs-json"),healthPath:i(r,"/health"),versionPath:i(o,"/version"),changelogPath:i(s,"/changelog")}};function _f(){window.open(pf,"_self")}const Rf=e=>jr.navigateToUrl(e),Tf=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,Pf=e=>Tf.test(e),Af=(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)},xc=e=>e.type==="app"||e.type==="tool",Of=e=>e.modules.some(xc)&&e.route&&e.route!=="/",Sc=e=>{const{catalog:t}=Ds();return oo(t.filter(n=>n.application===e))},oo=(e=[])=>e.find(t=>{var n;return xc(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),Ec=()=>{const e=tr();return _.useMemo(()=>Ls().map(n=>{var s,i,a;const r=jf(e,n.name),o=oo(r);return{name:n.name,displayName:((i=(s=o==null?void 0:o.ui)==null?void 0:s.customProps)==null?void 0:i.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])},jf=(e,t)=>e.filter(n=>n.application===t)||[],_c=()=>{const e=Ec();return _.useMemo(()=>e.filter(Of),[e])},Rc=e=>_.useMemo(()=>e?Sc(e.name):void 0,[e]),Nt=new Map,If=e=>{try{const{catalog:t}=Ds(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},so=e=>{const[t,n]=_.useState(null);return _.useEffect(()=>{(async()=>{if(!e){n(null);return}try{const o=If(e);if(Nt.has(o)){const i=Nt.get(o);n(i);return}const s=await System.import(e);Nt.set(o,s),n(s)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t},Nf=e=>{e?(Array.from(Nt.keys()).filter(n=>n.startsWith(e)).forEach(n=>Nt.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(Nt.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:Nf,getModuleCacheSize:()=>Nt.size,getModuleCacheKeys:()=>Array.from(Nt.keys())});const Tc=e=>{const t=typeof e=="string"?Sc(e):oo(e==null?void 0:e.modules),n=so(t==null?void 0:t.name);return n==null?void 0:n.icon},Pc=e=>{const t=oo(e==null?void 0:e.modules),n=so(t==null?void 0:t.name),[r,o]=_.useState(!1),[s,i]=_.useState({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],c=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const p=Df((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:h,path:v}=g;if(x!=null&&x.length&&!p(x))return null;const y=(h||[]).filter(w=>{var S;return!((S=w==null?void 0:w.operations)!=null&&S.length)||p(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const p=await c();e&&i(m=>({...m,[e.name]:p}))};_.useEffect(()=>{u()},[n==null?void 0:n.menu]);const f=_.useMemo(()=>e?s[e.name]||[]:[],[s,e]);return{loading:r,menu:f}},Df=e=>t=>t.every(n=>e.some(r=>r.name===n)),Lf=e=>Pc(e);function ae(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ut(e){return function t(n){return arguments.length===0||ae(n)?t:e.apply(this,arguments)}}function wt(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return ae(n)?t:Ut(function(o){return e(n,o)});default:return ae(n)&&ae(r)?t:ae(n)?Ut(function(o){return e(o,r)}):ae(r)?Ut(function(o){return e(n,o)}):e(n,r)}}}function $s(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return ae(n)?t:wt(function(s,i){return e(n,s,i)});case 2:return ae(n)&&ae(r)?t:ae(n)?wt(function(s,i){return e(s,r,i)}):ae(r)?wt(function(s,i){return e(n,s,i)}):Ut(function(s){return e(n,r,s)});default:return ae(n)&&ae(r)&&ae(o)?t:ae(n)&&ae(r)?wt(function(s,i){return e(s,i,o)}):ae(n)&&ae(o)?wt(function(s,i){return e(s,r,i)}):ae(r)&&ae(o)?wt(function(s,i){return e(n,s,i)}):ae(n)?Ut(function(s){return e(s,r,o)}):ae(r)?Ut(function(s){return e(n,s,o)}):ae(o)?Ut(function(s){return e(n,r,s)}):e(n,r,o)}}}function fr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ui(e){return Object.prototype.toString.call(e)==="[object Object]"}var Mf=$s(function(t,n,r){var o=t(n),s=t(r);return o>s?-1:o<s?1:0}),kf=$s(function(t,n,r){var o={},s;n=n||{},r=r||{};for(s in n)fr(s,n)&&(o[s]=fr(s,r)?t(s,n[s],r[s]):n[s]);for(s in r)fr(s,r)&&!fr(s,o)&&(o[s]=r[s]);return o}),$f=$s(function e(t,n,r){return kf(function(o,s,i){return Ui(s)&&Ui(i)?e(t,s,i):t(o,s,i)},n,r)}),Ff=wt(function(t,n){return $f(function(r,o,s){return s},t,n)}),Bf=wt(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var s=0,i=0;s===0&&i<t.length;)s=t[i](r,o),i+=1;return s})});const Fs=()=>{const e=pc(),t=_c();return _.useMemo(()=>Uf(e,t),[e,t])},Uf=(e,t)=>Bf([Mf(Wf)],t).find(n=>n.route&&e.startsWith(n.route)),Wf=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Ac=()=>{var e;return(e=Fs())==null?void 0:e.name},Hf=()=>{const e=Fs(),t=Rc(e);return so(t==null?void 0:t.name)},Bs=(e,t)=>{const r=tr().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl},Us=(e,t)=>{const n=Bs(e,!!t)??t;return _.useCallback((r,o)=>{const i={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Vf(`${n}${r}`),{...o,headers:i})},[n])},Vf=e=>e.replace(/\/+/g,"/"),zf=["impersonate","impersonate-display-name","tenant"],Oc=(e,t)=>{const n=Bs(e,t);return _.useMemo(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return zf.forEach(s=>{const i=r.searchParams.get(s);i&&o.searchParams.set(s,i)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])},qf=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),Gf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(qf(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},Kf="@bluealba/pae-habits-service",jc=()=>{const{authUser:e}=rr(),t=nr(),n=Us(Kf);return _.useCallback(Gf(n,e,t),[n,e,t])},Qf=()=>{const e=jc();return _.useCallback((t,n)=>e([{name:t,data:n}]),[e])},Ic=e=>{const t=nr(),n=window[fc],[r,o]=_.useState(null);return _.useEffect(()=>n.defineExtensionPoint(t,e,s=>{o(()=>s)}),[o]),r},Nc=(e,t,n)=>{_.useEffect(()=>window[fc].setExtensionPoint(e,t,n),[])},Dc=(e,t)=>{_.useEffect(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])},Lc=e=>{const{cssCustomizationLoadingDelay:t=1e3}=Ms();_.useEffect(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])},Yf=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},Zf={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},Xf=e=>{const t=Yf(e);return t?Zf[t]:void 0},Jf=(e,t)=>{const n=t??Xf(e);return n?`format(${n})`:""};function Mc(e){const[t,n]=_.useState(!1);return _.useEffect(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:i,variants:a})=>a.map(({path:c,fontWeight:u,format:f})=>`
|
|
23
23
|
@font-face {
|
|
24
24
|
font-family: "${i}";
|
|
25
25
|
src: url("${c}") ${Jf(c,f)};
|
package/dist/index.esm.js
CHANGED
|
@@ -752,7 +752,7 @@ const wb = (e) => Nd(e), Kd = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)
|
|
|
752
752
|
if (!e) return "";
|
|
753
753
|
const n = e.split(" ");
|
|
754
754
|
return n.length === 1 ? n.join("").slice(0, t) : n.map((r) => r[0]).join("").slice(0, t);
|
|
755
|
-
}, ic = (e) => e.type === "app", Qd = (e) => e.modules.some(ic) && e.route && e.route !== "/", ac = (e) => {
|
|
755
|
+
}, ic = (e) => e.type === "app" || e.type === "tool", Qd = (e) => e.modules.some(ic) && e.route && e.route !== "/", ac = (e) => {
|
|
756
756
|
const { catalog: t } = ks();
|
|
757
757
|
return ao(t.filter((n) => n.application === e));
|
|
758
758
|
}, ao = (e = []) => e.find((t) => {
|
package/dist/index.systemjs.js
CHANGED
|
@@ -20,7 +20,7 @@ Check the top-level render call using <`+I+">.")}return A}}function fd(b,A){{if(
|
|
|
20
20
|
<%s {...props} />
|
|
21
21
|
React keys must be passed directly to JSX without using spread:
|
|
22
22
|
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,ls,gn,v0,gn),hd[gn+ls]=!0}}return b===r?f0(ve):d0(ve),ve}}function p0(b,A,I){return md(b,A,I,!0)}function h0(b,A,I){return md(b,A,I,!1)}var m0=h0,g0=p0;Kn.Fragment=r,Kn.jsx=m0,Kn.jsxs=g0}(),Kn}Es.exports=Ed();var c=Es.exports;const Rs=hr(null),Ps=({module:e,children:t})=>c.jsx(Rs.Provider,{value:e,children:t});Ps.displayName="PAEModule";const br=E("useModuleMetadata",()=>{const e=mr(Rs);if(!e)throw new Error("Module metadata was not setup yet !!");return e});function Lo(){if(!window[qn])throw new Error("PAE Global state not found.");return window[qn]}const As=E("getApplications",()=>{const{authUser:{applications:e}}=Lo();return e||[]}),Td=E("getOperations",e=>As().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations)),Rd=E("useOperations",()=>{const{application:e}=br();return De(()=>Td(e),[e])}),Pd=E("hasAccess",e=>(...t)=>t.every(n=>e.some(r=>r.name===n))),wr=E("useAuth",()=>{const[{authUser:e}]=vr(),t=Rd();return{authUser:e,hasAccess:De(()=>Pd(t),[t])}}),_0=E("useHasNoSession",()=>{const{authUser:e}=wr();return!e||e.id==="anon"}),Os=E("useModuleConfig",()=>{var e;return((e=br().ui)==null?void 0:e.customProps)??{}}),Is=E("useModule",e=>{const t=yr();return De(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])}),Ad=E("useModuleConfigByName",e=>{var t,n;return((n=(t=Is(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}}),Od=e=>e.replace(/\/+/g,"/"),x0=E("useModuleCommonPaths",(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:i}=(e==null?void 0:e.commonPaths)||{},s=(a,l="")=>{if(a===void 0&&!l)return;const u=a??l;if(t==="only-base-path")return u;const f=Od(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:s(n,"/api-docs-json"),healthPath:s(r,"/health"),versionPath:s(o,"/version"),changelogPath:s(i,"/changelog")}});function Id(){window.open(yd,"_self")}const C0=E("navigateTo",e=>ws(e)),jd=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,S0=E("isValidEmail",e=>jd.test(e)),E0=E("getInitials",(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)}),js=e=>e.type==="app",kd=e=>e.modules.some(js)&&e.route&&e.route!=="/",ks=e=>{const{catalog:t}=Lo();return _r(t.filter(n=>n.application===e))},_r=(e=[])=>e.find(t=>{var n;return js(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),Ld=E("useApplications",()=>{const e=yr();return De(()=>As().map(n=>{var i,s,a;const r=Nd(e,n.name),o=_r(r);return{name:n.name,displayName:((s=(i=o==null?void 0:o.ui)==null?void 0:i.customProps)==null?void 0:s.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])}),Nd=(e,t)=>e.filter(n=>n.application===t)||[],Dd=E("useUIApplications",()=>{const e=Ld();return De(()=>e.filter(kd),[e])}),Md=E("useApplicationUIModule",e=>De(()=>e?ks(e.name):void 0,[e])),Ct=new Map,$d=e=>{try{const{catalog:t}=Lo(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},No=E("useApplicationJSModule",e=>{const[t,n]=W(null);return te(()=>{(async()=>{if(!e){n(null);return}try{const o=$d(e);if(Ct.has(o)){const s=Ct.get(o);n(s);return}const i=await System.import(e);Ct.set(o,i),n(i)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t}),Fd=e=>{e?(Array.from(Ct.keys()).filter(n=>n.startsWith(e)).forEach(n=>Ct.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(Ct.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:Fd,getModuleCacheSize:()=>Ct.size,getModuleCacheKeys:()=>Array.from(Ct.keys())});const Bd=E("useApplicationIcon",e=>{const t=typeof e=="string"?ks(e):_r(e==null?void 0:e.modules),n=No(t==null?void 0:t.name);return n==null?void 0:n.icon}),Ud=E("useModuleMenu",e=>{const t=_r(e==null?void 0:e.modules),n=No(t==null?void 0:t.name),[r,o]=W(!1),[i,s]=W({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],l=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const h=Wd((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:p,path:v}=g;if(x!=null&&x.length&&!h(x))return null;const y=(p||[]).filter(w=>{var C;return!((C=w==null?void 0:w.operations)!=null&&C.length)||h(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const h=await l();e&&s(m=>({...m,[e.name]:h}))};te(()=>{u()},[n==null?void 0:n.menu]);const f=De(()=>e?i[e.name]||[]:[],[i,e]);return{loading:r,menu:f}}),Wd=e=>t=>t.every(n=>e.some(r=>r.name===n)),T0=E("useApplicationMenu",e=>Ud(e));function ue(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Kt(e){return function t(n){return arguments.length===0||ue(n)?t:e.apply(this,arguments)}}function St(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return ue(n)?t:Kt(function(o){return e(n,o)});default:return ue(n)&&ue(r)?t:ue(n)?Kt(function(o){return e(o,r)}):ue(r)?Kt(function(o){return e(n,o)}):e(n,r)}}}function Do(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return ue(n)?t:St(function(i,s){return e(n,i,s)});case 2:return ue(n)&&ue(r)?t:ue(n)?St(function(i,s){return e(i,r,s)}):ue(r)?St(function(i,s){return e(n,i,s)}):Kt(function(i){return e(n,r,i)});default:return ue(n)&&ue(r)&&ue(o)?t:ue(n)&&ue(r)?St(function(i,s){return e(i,s,o)}):ue(n)&&ue(o)?St(function(i,s){return e(i,r,s)}):ue(r)&&ue(o)?St(function(i,s){return e(n,i,s)}):ue(n)?Kt(function(i){return e(i,r,o)}):ue(r)?Kt(function(i){return e(n,i,o)}):ue(o)?Kt(function(i){return e(n,r,i)}):e(n,r,o)}}}function xr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ls(e){return Object.prototype.toString.call(e)==="[object Object]"}var Hd=Do(function(t,n,r){var o=t(n),i=t(r);return o>i?-1:o<i?1:0}),Vd=Do(function(t,n,r){var o={},i;n=n||{},r=r||{};for(i in n)xr(i,n)&&(o[i]=xr(i,r)?t(i,n[i],r[i]):n[i]);for(i in r)xr(i,r)&&!xr(i,o)&&(o[i]=r[i]);return o}),zd=Do(function e(t,n,r){return Vd(function(o,i,s){return Ls(i)&&Ls(s)?e(t,i,s):t(o,i,s)},n,r)}),Gd=St(function(t,n){return zd(function(r,o,i){return i},t,n)}),qd=St(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var i=0,s=0;i===0&&s<t.length;)i=t[s](r,o),s+=1;return i})});const Ns=E("useCurrentApplication",()=>{const e=xd(),t=Dd();return De(()=>Kd(e,t),[e,t])}),Kd=(e,t)=>qd([Hd(Qd)],t).find(n=>n.route&&e.startsWith(n.route)),Qd=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Yd=E("useCurrentApplicationName",()=>{var e;return(e=Ns())==null?void 0:e.name}),R0=E("useCurrentJSModule",()=>{const e=Ns(),t=Md(e);return No(t==null?void 0:t.name)}),Ds=E("useServiceBaseURL",(e,t)=>{const r=yr().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl}),Ms=E("useServiceInvoker",(e,t)=>{const n=Ds(e,!!t)??t;return fe((r,o)=>{const s={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Zd(`${n}${r}`),{...o,headers:s})},[n])}),Zd=e=>e.replace(/\/+/g,"/"),Xd=["impersonate","impersonate-display-name","tenant"],Jd=E("useServiceWebSocketURL",(e,t)=>{const n=Ds(e,t);return De(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return Xd.forEach(i=>{const s=r.searchParams.get(i);s&&o.searchParams.set(i,s)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])}),ef=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),tf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(ef(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},nf="@bluealba/pae-habits-service",rf=E("useTrackEvents",()=>{const{authUser:e}=wr(),t=br(),n=Ms(nf);return fe(tf(n,e,t),[n,e,t])}),P0=E("useTrackEvent",()=>{const e=rf();return fe((t,n)=>e([{name:t,data:n}]),[e])}),of=E("useExtensionPoint",e=>{const t=br(),n=window[Cs],[r,o]=W(null);return te(()=>n.defineExtensionPoint(t,e,i=>{o(()=>i)}),[o]),r}),sf=E("useExtendExtensionPoint",(e,t,n)=>{te(()=>window[Cs].setExtensionPoint(e,t,n),[])}),af=E("usePlatformEventListener",(e,t)=>{te(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])}),lf=E("useDynamicStyleSheet",e=>{const{cssCustomizationLoadingDelay:t=1e3}=Os();te(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])}),cf=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},uf={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},df=e=>{const t=cf(e);return t?uf[t]:void 0},ff=(e,t)=>{const n=t??df(e);return n?`format(${n})`:""};function $s(e){const[t,n]=W(!1);return te(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:s,variants:a})=>a.map(({path:l,fontWeight:u,format:f})=>`
|
|
23
|
+
<%s key={someKey} {...props} />`,ls,gn,v0,gn),hd[gn+ls]=!0}}return b===r?f0(ve):d0(ve),ve}}function p0(b,A,I){return md(b,A,I,!0)}function h0(b,A,I){return md(b,A,I,!1)}var m0=h0,g0=p0;Kn.Fragment=r,Kn.jsx=m0,Kn.jsxs=g0}(),Kn}Es.exports=Ed();var c=Es.exports;const Rs=hr(null),Ps=({module:e,children:t})=>c.jsx(Rs.Provider,{value:e,children:t});Ps.displayName="PAEModule";const br=E("useModuleMetadata",()=>{const e=mr(Rs);if(!e)throw new Error("Module metadata was not setup yet !!");return e});function Lo(){if(!window[qn])throw new Error("PAE Global state not found.");return window[qn]}const As=E("getApplications",()=>{const{authUser:{applications:e}}=Lo();return e||[]}),Td=E("getOperations",e=>As().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations)),Rd=E("useOperations",()=>{const{application:e}=br();return De(()=>Td(e),[e])}),Pd=E("hasAccess",e=>(...t)=>t.every(n=>e.some(r=>r.name===n))),wr=E("useAuth",()=>{const[{authUser:e}]=vr(),t=Rd();return{authUser:e,hasAccess:De(()=>Pd(t),[t])}}),_0=E("useHasNoSession",()=>{const{authUser:e}=wr();return!e||e.id==="anon"}),Os=E("useModuleConfig",()=>{var e;return((e=br().ui)==null?void 0:e.customProps)??{}}),Is=E("useModule",e=>{const t=yr();return De(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])}),Ad=E("useModuleConfigByName",e=>{var t,n;return((n=(t=Is(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}}),Od=e=>e.replace(/\/+/g,"/"),x0=E("useModuleCommonPaths",(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:i}=(e==null?void 0:e.commonPaths)||{},s=(a,l="")=>{if(a===void 0&&!l)return;const u=a??l;if(t==="only-base-path")return u;const f=Od(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:s(n,"/api-docs-json"),healthPath:s(r,"/health"),versionPath:s(o,"/version"),changelogPath:s(i,"/changelog")}});function Id(){window.open(yd,"_self")}const C0=E("navigateTo",e=>ws(e)),jd=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,S0=E("isValidEmail",e=>jd.test(e)),E0=E("getInitials",(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)}),js=e=>e.type==="app"||e.type==="tool",kd=e=>e.modules.some(js)&&e.route&&e.route!=="/",ks=e=>{const{catalog:t}=Lo();return _r(t.filter(n=>n.application===e))},_r=(e=[])=>e.find(t=>{var n;return js(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),Ld=E("useApplications",()=>{const e=yr();return De(()=>As().map(n=>{var i,s,a;const r=Nd(e,n.name),o=_r(r);return{name:n.name,displayName:((s=(i=o==null?void 0:o.ui)==null?void 0:i.customProps)==null?void 0:s.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])}),Nd=(e,t)=>e.filter(n=>n.application===t)||[],Dd=E("useUIApplications",()=>{const e=Ld();return De(()=>e.filter(kd),[e])}),Md=E("useApplicationUIModule",e=>De(()=>e?ks(e.name):void 0,[e])),Ct=new Map,$d=e=>{try{const{catalog:t}=Lo(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},No=E("useApplicationJSModule",e=>{const[t,n]=W(null);return te(()=>{(async()=>{if(!e){n(null);return}try{const o=$d(e);if(Ct.has(o)){const s=Ct.get(o);n(s);return}const i=await System.import(e);Ct.set(o,i),n(i)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t}),Fd=e=>{e?(Array.from(Ct.keys()).filter(n=>n.startsWith(e)).forEach(n=>Ct.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(Ct.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:Fd,getModuleCacheSize:()=>Ct.size,getModuleCacheKeys:()=>Array.from(Ct.keys())});const Bd=E("useApplicationIcon",e=>{const t=typeof e=="string"?ks(e):_r(e==null?void 0:e.modules),n=No(t==null?void 0:t.name);return n==null?void 0:n.icon}),Ud=E("useModuleMenu",e=>{const t=_r(e==null?void 0:e.modules),n=No(t==null?void 0:t.name),[r,o]=W(!1),[i,s]=W({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],l=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const h=Wd((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:p,path:v}=g;if(x!=null&&x.length&&!h(x))return null;const y=(p||[]).filter(w=>{var C;return!((C=w==null?void 0:w.operations)!=null&&C.length)||h(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const h=await l();e&&s(m=>({...m,[e.name]:h}))};te(()=>{u()},[n==null?void 0:n.menu]);const f=De(()=>e?i[e.name]||[]:[],[i,e]);return{loading:r,menu:f}}),Wd=e=>t=>t.every(n=>e.some(r=>r.name===n)),T0=E("useApplicationMenu",e=>Ud(e));function ue(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Kt(e){return function t(n){return arguments.length===0||ue(n)?t:e.apply(this,arguments)}}function St(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return ue(n)?t:Kt(function(o){return e(n,o)});default:return ue(n)&&ue(r)?t:ue(n)?Kt(function(o){return e(o,r)}):ue(r)?Kt(function(o){return e(n,o)}):e(n,r)}}}function Do(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return ue(n)?t:St(function(i,s){return e(n,i,s)});case 2:return ue(n)&&ue(r)?t:ue(n)?St(function(i,s){return e(i,r,s)}):ue(r)?St(function(i,s){return e(n,i,s)}):Kt(function(i){return e(n,r,i)});default:return ue(n)&&ue(r)&&ue(o)?t:ue(n)&&ue(r)?St(function(i,s){return e(i,s,o)}):ue(n)&&ue(o)?St(function(i,s){return e(i,r,s)}):ue(r)&&ue(o)?St(function(i,s){return e(n,i,s)}):ue(n)?Kt(function(i){return e(i,r,o)}):ue(r)?Kt(function(i){return e(n,i,o)}):ue(o)?Kt(function(i){return e(n,r,i)}):e(n,r,o)}}}function xr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Ls(e){return Object.prototype.toString.call(e)==="[object Object]"}var Hd=Do(function(t,n,r){var o=t(n),i=t(r);return o>i?-1:o<i?1:0}),Vd=Do(function(t,n,r){var o={},i;n=n||{},r=r||{};for(i in n)xr(i,n)&&(o[i]=xr(i,r)?t(i,n[i],r[i]):n[i]);for(i in r)xr(i,r)&&!xr(i,o)&&(o[i]=r[i]);return o}),zd=Do(function e(t,n,r){return Vd(function(o,i,s){return Ls(i)&&Ls(s)?e(t,i,s):t(o,i,s)},n,r)}),Gd=St(function(t,n){return zd(function(r,o,i){return i},t,n)}),qd=St(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var i=0,s=0;i===0&&s<t.length;)i=t[s](r,o),s+=1;return i})});const Ns=E("useCurrentApplication",()=>{const e=xd(),t=Dd();return De(()=>Kd(e,t),[e,t])}),Kd=(e,t)=>qd([Hd(Qd)],t).find(n=>n.route&&e.startsWith(n.route)),Qd=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Yd=E("useCurrentApplicationName",()=>{var e;return(e=Ns())==null?void 0:e.name}),R0=E("useCurrentJSModule",()=>{const e=Ns(),t=Md(e);return No(t==null?void 0:t.name)}),Ds=E("useServiceBaseURL",(e,t)=>{const r=yr().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl}),Ms=E("useServiceInvoker",(e,t)=>{const n=Ds(e,!!t)??t;return fe((r,o)=>{const s={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Zd(`${n}${r}`),{...o,headers:s})},[n])}),Zd=e=>e.replace(/\/+/g,"/"),Xd=["impersonate","impersonate-display-name","tenant"],Jd=E("useServiceWebSocketURL",(e,t)=>{const n=Ds(e,t);return De(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return Xd.forEach(i=>{const s=r.searchParams.get(i);s&&o.searchParams.set(i,s)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])}),ef=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),tf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(ef(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},nf="@bluealba/pae-habits-service",rf=E("useTrackEvents",()=>{const{authUser:e}=wr(),t=br(),n=Ms(nf);return fe(tf(n,e,t),[n,e,t])}),P0=E("useTrackEvent",()=>{const e=rf();return fe((t,n)=>e([{name:t,data:n}]),[e])}),of=E("useExtensionPoint",e=>{const t=br(),n=window[Cs],[r,o]=W(null);return te(()=>n.defineExtensionPoint(t,e,i=>{o(()=>i)}),[o]),r}),sf=E("useExtendExtensionPoint",(e,t,n)=>{te(()=>window[Cs].setExtensionPoint(e,t,n),[])}),af=E("usePlatformEventListener",(e,t)=>{te(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])}),lf=E("useDynamicStyleSheet",e=>{const{cssCustomizationLoadingDelay:t=1e3}=Os();te(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])}),cf=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},uf={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},df=e=>{const t=cf(e);return t?uf[t]:void 0},ff=(e,t)=>{const n=t??df(e);return n?`format(${n})`:""};function $s(e){const[t,n]=W(!1);return te(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:s,variants:a})=>a.map(({path:l,fontWeight:u,format:f})=>`
|
|
24
24
|
@font-face {
|
|
25
25
|
font-family: "${s}";
|
|
26
26
|
src: url("${l}") ${ff(l,f)};
|
package/dist/index.umd.js
CHANGED
|
@@ -20,7 +20,7 @@ Check the top-level render call using <`+j+">.")}return O}}function Bd(b,O){{if(
|
|
|
20
20
|
<%s {...props} />
|
|
21
21
|
React keys must be passed directly to JSX without using spread:
|
|
22
22
|
let props = %s;
|
|
23
|
-
<%s key={someKey} {...props} />`,wi,dn,F0,dn),Wd[dn+wi]=!0}}return b===r?L0(pe):k0(pe),pe}}function N0(b,O,j){return Hd(b,O,j,!0)}function D0(b,O,j){return Hd(b,O,j,!1)}var M0=D0,$0=N0;Vn.Fragment=r,Vn.jsx=M0,Vn.jsxs=$0}(),Vn}Ni.exports=ef();var c=Ni.exports;const Mi=S.createContext(null),$i=({module:e,children:t})=>c.jsx(Mi.Provider,{value:e,children:t});$i.displayName="PAEModule";const zn=()=>{const e=S.useContext(Mi);if(!e)throw new Error("Module metadata was not setup yet !!");return e};function Io(){if(!window[Un])throw new Error("PAE Global state not found.");return window[Un]}const jo=()=>{const{authUser:{applications:e}}=Io();return e||[]},Fi=e=>jo().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations),Bi=()=>{const{application:e}=zn();return S.useMemo(()=>Fi(e),[e])},Ui=e=>(...t)=>t.every(n=>e.some(r=>r.name===n)),Gn=()=>{const[{authUser:e}]=Wn(),t=Bi();return{authUser:e,hasAccess:S.useMemo(()=>Ui(t),[t])}},tf=()=>{const{authUser:e}=Gn();return!e||e.id==="anon"},ko=()=>{var e;return((e=zn().ui)==null?void 0:e.customProps)??{}},Lo=e=>{const t=Hn();return S.useMemo(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])},Wi=e=>{var t,n;return((n=(t=Lo(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}},nf=e=>e.replace(/\/+/g,"/"),rf=(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:s}=(e==null?void 0:e.commonPaths)||{},i=(a,l="")=>{if(a===void 0&&!l)return;const u=a??l;if(t==="only-base-path")return u;const f=nf(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:i(n,"/api-docs-json"),healthPath:i(r,"/health"),versionPath:i(o,"/version"),changelogPath:i(s,"/changelog")}};function of(){window.open(qd,"_self")}const sf=e=>he.navigateToUrl(e),af=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,lf=e=>af.test(e),cf=(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)},Hi=e=>e.type==="app",uf=e=>e.modules.some(Hi)&&e.route&&e.route!=="/",Vi=e=>{const{catalog:t}=Io();return mr(t.filter(n=>n.application===e))},mr=(e=[])=>e.find(t=>{var n;return Hi(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),zi=()=>{const e=Hn();return S.useMemo(()=>jo().map(n=>{var s,i,a;const r=df(e,n.name),o=mr(r);return{name:n.name,displayName:((i=(s=o==null?void 0:o.ui)==null?void 0:s.customProps)==null?void 0:i.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])},df=(e,t)=>e.filter(n=>n.application===t)||[],Gi=()=>{const e=zi();return S.useMemo(()=>e.filter(uf),[e])},qi=e=>S.useMemo(()=>e?Vi(e.name):void 0,[e]),gt=new Map,ff=e=>{try{const{catalog:t}=Io(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},gr=e=>{const[t,n]=S.useState(null);return S.useEffect(()=>{(async()=>{if(!e){n(null);return}try{const o=ff(e);if(gt.has(o)){const i=gt.get(o);n(i);return}const s=await System.import(e);gt.set(o,s),n(s)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t},pf=e=>{e?(Array.from(gt.keys()).filter(n=>n.startsWith(e)).forEach(n=>gt.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(gt.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:pf,getModuleCacheSize:()=>gt.size,getModuleCacheKeys:()=>Array.from(gt.keys())});const Ki=e=>{const t=typeof e=="string"?Vi(e):mr(e==null?void 0:e.modules),n=gr(t==null?void 0:t.name);return n==null?void 0:n.icon},Qi=e=>{const t=mr(e==null?void 0:e.modules),n=gr(t==null?void 0:t.name),[r,o]=S.useState(!1),[s,i]=S.useState({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],l=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const h=hf((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:p,path:v}=g;if(x!=null&&x.length&&!h(x))return null;const y=(p||[]).filter(w=>{var C;return!((C=w==null?void 0:w.operations)!=null&&C.length)||h(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const h=await l();e&&i(m=>({...m,[e.name]:h}))};S.useEffect(()=>{u()},[n==null?void 0:n.menu]);const f=S.useMemo(()=>e?s[e.name]||[]:[],[s,e]);return{loading:r,menu:f}},hf=e=>t=>t.every(n=>e.some(r=>r.name===n)),mf=e=>Qi(e);function le(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ht(e){return function t(n){return arguments.length===0||le(n)?t:e.apply(this,arguments)}}function vt(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return le(n)?t:Ht(function(o){return e(n,o)});default:return le(n)&&le(r)?t:le(n)?Ht(function(o){return e(o,r)}):le(r)?Ht(function(o){return e(n,o)}):e(n,r)}}}function No(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return le(n)?t:vt(function(s,i){return e(n,s,i)});case 2:return le(n)&&le(r)?t:le(n)?vt(function(s,i){return e(s,r,i)}):le(r)?vt(function(s,i){return e(n,s,i)}):Ht(function(s){return e(n,r,s)});default:return le(n)&&le(r)&&le(o)?t:le(n)&&le(r)?vt(function(s,i){return e(s,i,o)}):le(n)&&le(o)?vt(function(s,i){return e(s,r,i)}):le(r)&&le(o)?vt(function(s,i){return e(n,s,i)}):le(n)?Ht(function(s){return e(s,r,o)}):le(r)?Ht(function(s){return e(n,s,o)}):le(o)?Ht(function(s){return e(n,r,s)}):e(n,r,o)}}}function vr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Yi(e){return Object.prototype.toString.call(e)==="[object Object]"}var gf=No(function(t,n,r){var o=t(n),s=t(r);return o>s?-1:o<s?1:0}),vf=No(function(t,n,r){var o={},s;n=n||{},r=r||{};for(s in n)vr(s,n)&&(o[s]=vr(s,r)?t(s,n[s],r[s]):n[s]);for(s in r)vr(s,r)&&!vr(s,o)&&(o[s]=r[s]);return o}),yf=No(function e(t,n,r){return vf(function(o,s,i){return Yi(s)&&Yi(i)?e(t,s,i):t(o,s,i)},n,r)}),bf=vt(function(t,n){return yf(function(r,o,s){return s},t,n)}),wf=vt(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var s=0,i=0;s===0&&i<t.length;)s=t[i](r,o),i+=1;return s})});const Do=()=>{const e=Li(),t=Gi();return S.useMemo(()=>_f(e,t),[e,t])},_f=(e,t)=>wf([gf(xf)],t).find(n=>n.route&&e.startsWith(n.route)),xf=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Zi=()=>{var e;return(e=Do())==null?void 0:e.name},Cf=()=>{const e=Do(),t=qi(e);return gr(t==null?void 0:t.name)},Mo=(e,t)=>{const r=Hn().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl},$o=(e,t)=>{const n=Mo(e,!!t)??t;return S.useCallback((r,o)=>{const i={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Sf(`${n}${r}`),{...o,headers:i})},[n])},Sf=e=>e.replace(/\/+/g,"/"),Ef=["impersonate","impersonate-display-name","tenant"],Xi=(e,t)=>{const n=Mo(e,t);return S.useMemo(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return Ef.forEach(s=>{const i=r.searchParams.get(s);i&&o.searchParams.set(s,i)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])},Tf=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),Pf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(Tf(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},Af="@bluealba/pae-habits-service",Ji=()=>{const{authUser:e}=Gn(),t=zn(),n=$o(Af);return S.useCallback(Pf(n,e,t),[n,e,t])},Rf=()=>{const e=Ji();return S.useCallback((t,n)=>e([{name:t,data:n}]),[e])},ea=e=>{const t=zn(),n=window[ji],[r,o]=S.useState(null);return S.useEffect(()=>n.defineExtensionPoint(t,e,s=>{o(()=>s)}),[o]),r},ta=(e,t,n)=>{S.useEffect(()=>window[ji].setExtensionPoint(e,t,n),[])},na=(e,t)=>{S.useEffect(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])},ra=e=>{const{cssCustomizationLoadingDelay:t=1e3}=ko();S.useEffect(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])},Of=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},If={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},jf=e=>{const t=Of(e);return t?If[t]:void 0},kf=(e,t)=>{const n=t??jf(e);return n?`format(${n})`:""};function oa(e){const[t,n]=S.useState(!1);return S.useEffect(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:i,variants:a})=>a.map(({path:l,fontWeight:u,format:f})=>`
|
|
23
|
+
<%s key={someKey} {...props} />`,wi,dn,F0,dn),Wd[dn+wi]=!0}}return b===r?L0(pe):k0(pe),pe}}function N0(b,O,j){return Hd(b,O,j,!0)}function D0(b,O,j){return Hd(b,O,j,!1)}var M0=D0,$0=N0;Vn.Fragment=r,Vn.jsx=M0,Vn.jsxs=$0}(),Vn}Ni.exports=ef();var c=Ni.exports;const Mi=S.createContext(null),$i=({module:e,children:t})=>c.jsx(Mi.Provider,{value:e,children:t});$i.displayName="PAEModule";const zn=()=>{const e=S.useContext(Mi);if(!e)throw new Error("Module metadata was not setup yet !!");return e};function Io(){if(!window[Un])throw new Error("PAE Global state not found.");return window[Un]}const jo=()=>{const{authUser:{applications:e}}=Io();return e||[]},Fi=e=>jo().filter(t=>t.isGlobal||t.name===e).flatMap(t=>t.operations),Bi=()=>{const{application:e}=zn();return S.useMemo(()=>Fi(e),[e])},Ui=e=>(...t)=>t.every(n=>e.some(r=>r.name===n)),Gn=()=>{const[{authUser:e}]=Wn(),t=Bi();return{authUser:e,hasAccess:S.useMemo(()=>Ui(t),[t])}},tf=()=>{const{authUser:e}=Gn();return!e||e.id==="anon"},ko=()=>{var e;return((e=zn().ui)==null?void 0:e.customProps)??{}},Lo=e=>{const t=Hn();return S.useMemo(()=>{const n=t.find(r=>r.name===e);if(!n)throw new Error(`Could not find the module [${e}] in the local catalog !`);return n},[t,e])},Wi=e=>{var t,n;return((n=(t=Lo(e))==null?void 0:t.ui)==null?void 0:n.customProps)??{}},nf=e=>e.replace(/\/+/g,"/"),rf=(e,t="only-base-path")=>{const{apiDocs:n,health:r,version:o,changelog:s}=(e==null?void 0:e.commonPaths)||{},i=(a,l="")=>{if(a===void 0&&!l)return;const u=a??l;if(t==="only-base-path")return u;const f=nf(`${e.baseUrl}/${u}`);return t==="with-module-base"?f:`${document.location.origin}${f}`};return{apiDocsPath:i(n,"/api-docs-json"),healthPath:i(r,"/health"),versionPath:i(o,"/version"),changelogPath:i(s,"/changelog")}};function of(){window.open(qd,"_self")}const sf=e=>he.navigateToUrl(e),af=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/,lf=e=>af.test(e),cf=(e,t=2)=>{if(!e)return"";const n=e.split(" ");return n.length===1?n.join("").slice(0,t):n.map(r=>r[0]).join("").slice(0,t)},Hi=e=>e.type==="app"||e.type==="tool",uf=e=>e.modules.some(Hi)&&e.route&&e.route!=="/",Vi=e=>{const{catalog:t}=Io();return mr(t.filter(n=>n.application===e))},mr=(e=[])=>e.find(t=>{var n;return Hi(t)&&((n=t.ui)==null?void 0:n.route)!=="/"}),zi=()=>{const e=Hn();return S.useMemo(()=>jo().map(n=>{var s,i,a;const r=df(e,n.name),o=mr(r);return{name:n.name,displayName:((i=(s=o==null?void 0:o.ui)==null?void 0:s.customProps)==null?void 0:i.overrideApplicationDisplayName)??n.displayName,modules:r,route:(a=o==null?void 0:o.ui)==null?void 0:a.route,roles:[],operations:n.operations}}),[e])},df=(e,t)=>e.filter(n=>n.application===t)||[],Gi=()=>{const e=zi();return S.useMemo(()=>e.filter(uf),[e])},qi=e=>S.useMemo(()=>e?Vi(e.name):void 0,[e]),gt=new Map,ff=e=>{try{const{catalog:t}=Io(),n=t.find(r=>r.name===e);return n!=null&&n.version?`${e}@${n.version}`:e}catch{return e}},gr=e=>{const[t,n]=S.useState(null);return S.useEffect(()=>{(async()=>{if(!e){n(null);return}try{const o=ff(e);if(gt.has(o)){const i=gt.get(o);n(i);return}const s=await System.import(e);gt.set(o,s),n(s)}catch(o){console.error(`Error importing module ${e}: ${o.message}`),n(null)}})()},[e,n]),t},pf=e=>{e?(Array.from(gt.keys()).filter(n=>n.startsWith(e)).forEach(n=>gt.delete(n)),console.log(`[useApplicationJSModule] Cleared cache for module: ${e}`)):(gt.clear(),console.log("[useApplicationJSModule] Cleared all module cache"))};typeof window<"u"&&(window.PAE={...window.PAE,clearModuleCache:pf,getModuleCacheSize:()=>gt.size,getModuleCacheKeys:()=>Array.from(gt.keys())});const Ki=e=>{const t=typeof e=="string"?Vi(e):mr(e==null?void 0:e.modules),n=gr(t==null?void 0:t.name);return n==null?void 0:n.icon},Qi=e=>{const t=mr(e==null?void 0:e.modules),n=gr(t==null?void 0:t.name),[r,o]=S.useState(!1),[s,i]=S.useState({}),a=async()=>(typeof(n==null?void 0:n.menu)=="function"?await n.menu():n==null?void 0:n.menu)||[],l=async()=>{if(!(n!=null&&n.menu))return[];o(!0);const h=hf((e==null?void 0:e.operations)||[]),m=(await a()).map(g=>{const{operations:x,items:p,path:v}=g;if(x!=null&&x.length&&!h(x))return null;const y=(p||[]).filter(w=>{var C;return!((C=w==null?void 0:w.operations)!=null&&C.length)||h(w.operations)});return!y.length&&!v?null:{...g,items:y}}).filter(Boolean);return o(!1),m},u=async()=>{const h=await l();e&&i(m=>({...m,[e.name]:h}))};S.useEffect(()=>{u()},[n==null?void 0:n.menu]);const f=S.useMemo(()=>e?s[e.name]||[]:[],[s,e]);return{loading:r,menu:f}},hf=e=>t=>t.every(n=>e.some(r=>r.name===n)),mf=e=>Qi(e);function le(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ht(e){return function t(n){return arguments.length===0||le(n)?t:e.apply(this,arguments)}}function vt(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return le(n)?t:Ht(function(o){return e(n,o)});default:return le(n)&&le(r)?t:le(n)?Ht(function(o){return e(o,r)}):le(r)?Ht(function(o){return e(n,o)}):e(n,r)}}}function No(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return le(n)?t:vt(function(s,i){return e(n,s,i)});case 2:return le(n)&&le(r)?t:le(n)?vt(function(s,i){return e(s,r,i)}):le(r)?vt(function(s,i){return e(n,s,i)}):Ht(function(s){return e(n,r,s)});default:return le(n)&&le(r)&&le(o)?t:le(n)&&le(r)?vt(function(s,i){return e(s,i,o)}):le(n)&&le(o)?vt(function(s,i){return e(s,r,i)}):le(r)&&le(o)?vt(function(s,i){return e(n,s,i)}):le(n)?Ht(function(s){return e(s,r,o)}):le(r)?Ht(function(s){return e(n,s,o)}):le(o)?Ht(function(s){return e(n,r,s)}):e(n,r,o)}}}function vr(e,t){return Object.prototype.hasOwnProperty.call(t,e)}function Yi(e){return Object.prototype.toString.call(e)==="[object Object]"}var gf=No(function(t,n,r){var o=t(n),s=t(r);return o>s?-1:o<s?1:0}),vf=No(function(t,n,r){var o={},s;n=n||{},r=r||{};for(s in n)vr(s,n)&&(o[s]=vr(s,r)?t(s,n[s],r[s]):n[s]);for(s in r)vr(s,r)&&!vr(s,o)&&(o[s]=r[s]);return o}),yf=No(function e(t,n,r){return vf(function(o,s,i){return Yi(s)&&Yi(i)?e(t,s,i):t(o,s,i)},n,r)}),bf=vt(function(t,n){return yf(function(r,o,s){return s},t,n)}),wf=vt(function(t,n){return Array.prototype.slice.call(n,0).sort(function(r,o){for(var s=0,i=0;s===0&&i<t.length;)s=t[i](r,o),i+=1;return s})});const Do=()=>{const e=Li(),t=Gi();return S.useMemo(()=>_f(e,t),[e,t])},_f=(e,t)=>wf([gf(xf)],t).find(n=>n.route&&e.startsWith(n.route)),xf=e=>{var t;return((t=e==null?void 0:e.route)==null?void 0:t.length)||-1},Zi=()=>{var e;return(e=Do())==null?void 0:e.name},Cf=()=>{const e=Do(),t=qi(e);return gr(t==null?void 0:t.name)},Mo=(e,t)=>{const r=Hn().find(o=>o.name===e);if(!r){if(t)return null;throw new Error(`Service with name [${e}] not available in the catalog`)}return r.baseUrl},$o=(e,t)=>{const n=Mo(e,!!t)??t;return S.useCallback((r,o)=>{const i={Accept:"application/json",...(o==null?void 0:o.body)instanceof FormData?{}:{"Content-Type":"application/json"},...o==null?void 0:o.headers};return fetch(Sf(`${n}${r}`),{...o,headers:i})},[n])},Sf=e=>e.replace(/\/+/g,"/"),Ef=["impersonate","impersonate-display-name","tenant"],Xi=(e,t)=>{const n=Mo(e,t);return S.useMemo(()=>{if(!n)return null;try{const r=new URL(window.location.href),o=new URL(n,window.location.origin);return Ef.forEach(s=>{const i=r.searchParams.get(s);i&&o.searchParams.set(s,i)}),o.toString()}catch(r){return console.error("Error building WebSocket URL:",r),n}},[n])},Tf=(e,t)=>n=>({timestamp:new Date(new Date().toUTCString()).toISOString(),module:t.name,moduleVersion:t.version,application:t.application,user:e.username,...n}),Pf=(e,t,n)=>async r=>{if(r.length===0)throw new Error("Invalid call to trackEvents with an empty array of events!");const o=await e("/event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r.map(Tf(t,n)))});if(!o.ok)throw new Error(`Error publishing habits event ${o.statusText}`)},Af="@bluealba/pae-habits-service",Ji=()=>{const{authUser:e}=Gn(),t=zn(),n=$o(Af);return S.useCallback(Pf(n,e,t),[n,e,t])},Rf=()=>{const e=Ji();return S.useCallback((t,n)=>e([{name:t,data:n}]),[e])},ea=e=>{const t=zn(),n=window[ji],[r,o]=S.useState(null);return S.useEffect(()=>n.defineExtensionPoint(t,e,s=>{o(()=>s)}),[o]),r},ta=(e,t,n)=>{S.useEffect(()=>window[ji].setExtensionPoint(e,t,n),[])},na=(e,t)=>{S.useEffect(()=>(window.addEventListener(e,t),()=>window.removeEventListener(e,t)),[e,t])},ra=e=>{const{cssCustomizationLoadingDelay:t=1e3}=ko();S.useEffect(()=>{if(!e)return;const n=document.createElement("style");return setTimeout(()=>{n.innerHTML=e,document.head.append(n)},t),()=>n&&n.remove()},[e])},Of=e=>{var t;return(t=e.split(/[#?]/)[0].split(".").pop())==null?void 0:t.trim()},If={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype",eot:"embedded-opentype",svg:"svg"},jf=e=>{const t=Of(e);return t?If[t]:void 0},kf=(e,t)=>{const n=t??jf(e);return n?`format(${n})`:""};function oa(e){const[t,n]=S.useState(!1);return S.useEffect(()=>{if(!(e!=null&&e.length))return;const r=document.createElement("style");r.setAttribute("data-generated-fonts","true");const o=e.flatMap(({fontFamily:i,variants:a})=>a.map(({path:l,fontWeight:u,format:f})=>`
|
|
24
24
|
@font-face {
|
|
25
25
|
font-family: "${i}";
|
|
26
26
|
src: url("${l}") ${kf(l,f)};
|
|
@@ -206,7 +206,7 @@ to {
|
|
|
206
206
|
> * {
|
|
207
207
|
pointer-events: auto;
|
|
208
208
|
}
|
|
209
|
-
`,Pr=16,Up=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:l}=mp(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:Pr,left:Pr,right:Pr,bottom:Pr,pointerEvents:"none",...s},className:i,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(u=>{let f=u.position||t,h=l.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=Fp(f,h);return d.createElement($p,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?Bp:"",style:m},u.type==="custom"?Cr(u.message,u):o?o(u):d.createElement(Mp,{toast:u,position:f}))}))},xa=Re;const Qo=()=>({notify:S.useCallback((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?xa(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):xa[n](t,o),r&&console.error(r)},[])});var fn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zt=typeof window>"u"||"Deno"in globalThis;function we(){}function Wp(e,t){return typeof e=="function"?e(t):e}function Yo(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ca(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wt(e,t){return typeof e=="function"?e(t):e}function De(e,t){return typeof e=="function"?e(t):e}function Sa(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Zo(i,t.options))return!1}else if(!Qn(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ea(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Gt(t.options.mutationKey)!==Gt(s))return!1}else if(!Qn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Zo(e,t){return((t==null?void 0:t.queryKeyHashFn)||Gt)(e)}function Gt(e){return JSON.stringify(e,(t,n)=>Jo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Qn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Qn(e[n],t[n])):!1}function Xo(e,t){if(e===t)return e;const n=Ta(e)&&Ta(t);if(n||Jo(e)&&Jo(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=Xo(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function Ar(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ta(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jo(e){if(!Pa(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Pa(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Pa(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hp(e){return new Promise(t=>{setTimeout(t,e)})}function es(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return Xo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Xo(e,t)}return t}function Vp(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Rr=Symbol();function Aa(e,t){return e.queryFn===Rr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Rr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ra(e,t){return typeof e=="function"?e(...t):!!e}var Gp=(xd=class extends fn{constructor(){super();M(this,nn);M(this,Pt);M(this,Tn);I(this,Tn,t=>{if(!zt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Pt)||this.setEventListener(_(this,Tn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Pt))==null||t.call(this),I(this,Pt,void 0))}setEventListener(t){var n;I(this,Tn,t),(n=_(this,Pt))==null||n.call(this),I(this,Pt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,nn)!==t&&(I(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,nn)=="boolean"?_(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Pt=new WeakMap,Tn=new WeakMap,xd),ts=new Gp,qp=(Cd=class extends fn{constructor(){super();M(this,Pn,!0);M(this,At);M(this,An);I(this,An,t=>{if(!zt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,At)||this.setEventListener(_(this,An))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,At))==null||t.call(this),I(this,At,void 0))}setEventListener(t){var n;I(this,An,t),(n=_(this,At))==null||n.call(this),I(this,At,t(this.setOnline.bind(this)))}setOnline(t){_(this,Pn)!==t&&(I(this,Pn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Pn)}},Pn=new WeakMap,At=new WeakMap,An=new WeakMap,Cd),Or=new qp;function ns(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Kp(e){return Math.min(1e3*2**e,3e4)}function Oa(e){return(e??"online")==="online"?Or.isOnline():!0}var Ia=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function rs(e){return e instanceof Ia}function ja(e){let t=!1,n=0,r=!1,o;const s=ns(),i=p=>{var v;r||(m(new Ia(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>ts.isFocused()&&(e.networkMode==="always"||Or.isOnline())&&e.canRun(),f=()=>Oa(e.networkMode)&&e.canRun(),h=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),s.resolve(p))},m=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),s.reject(p))},g=()=>new Promise(p=>{var v;o=y=>{(r||u())&&p(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(h).catch(y=>{var A;if(r)return;const w=e.retry??(zt?0:3),C=e.retryDelay??Kp,E=typeof C=="function"?C(n,y):C,P=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!P){m(y);return}n++,(A=e.onFail)==null||A.call(e,n,y),Hp(E).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?x():g().then(x),s)}}var Qp=e=>setTimeout(e,0);function Yp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Qp;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var me=Yp(),ka=(Sd=class{constructor(){M(this,rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yo(this.gcTime)&&I(this,rn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zt?1/0:5*60*1e3))}clearGcTimeout(){_(this,rn)&&(clearTimeout(_(this,rn)),I(this,rn,void 0))}},rn=new WeakMap,Sd),Zp=(Ed=class extends ka{constructor(t){super();M(this,We);M(this,Rn);M(this,On);M(this,je);M(this,on);M(this,be);M(this,lr);M(this,sn);I(this,sn,!1),I(this,lr,t.defaultOptions),this.setOptions(t.options),this.observers=[],I(this,on,t.client),I(this,je,_(this,on).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,I(this,Rn,Xp(this.options)),this.state=t.state??_(this,Rn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,be))==null?void 0:t.promise}setOptions(t){this.options={..._(this,lr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,je).remove(this)}setData(t,n){const r=es(this.state.data,t,this.options);return V(this,We,mt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){V(this,We,mt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,be))==null?void 0:r.promise;return(o=_(this,be))==null||o.cancel(t),n?n.then(we).catch(we):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Rn))}isActive(){return this.observers.some(t=>De(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ca(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,be))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,be))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,je).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,be)&&(_(this,sn)?_(this,be).cancel({revert:!0}):_(this,be).cancelRetry()),this.scheduleGc()),_(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,We,mt).call(this,{type:"invalidate"})}fetch(t,n){var u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,be))return _(this,be).continueRetry(),_(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(I(this,sn,!0),r.signal)})},s=()=>{const m=Aa(this.options,n),x=(()=>{const p={client:_(this,on),queryKey:this.queryKey,meta:this.meta};return o(p),p})();return I(this,sn,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,on),state:this.state,fetchFn:s};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),I(this,On,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&V(this,We,mt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=m=>{var g,x,p,v;rs(m)&&m.silent||V(this,We,mt).call(this,{type:"error",error:m}),rs(m)||((x=(g=_(this,je).config).onError)==null||x.call(g,m,this),(v=(p=_(this,je).config).onSettled)==null||v.call(p,this.state.data,m,this)),this.scheduleGc()};return I(this,be,ja({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,p,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){l(y);return}(x=(g=_(this,je).config).onSuccess)==null||x.call(g,m,this),(v=(p=_(this,je).config).onSettled)==null||v.call(p,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,g)=>{V(this,We,mt).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{V(this,We,mt).call(this,{type:"pause"})},onContinue:()=>{V(this,We,mt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),_(this,be).start()}},Rn=new WeakMap,On=new WeakMap,je=new WeakMap,on=new WeakMap,be=new WeakMap,lr=new WeakMap,sn=new WeakMap,We=new WeakSet,mt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...La(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return rs(o)&&o.revert&&_(this,On)?{..._(this,On),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),me.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,je).notify({query:this,type:"updated",action:t})})},Ed);function La(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oa(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jp=(Td=class extends fn{constructor(t={}){super();M(this,et);this.config=t,I(this,et,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Zo(o,n);let i=this.get(s);return i||(i=new Zp({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){_(this,et).has(t.queryHash)||(_(this,et).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,et).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,et).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,et).get(t)}getAll(){return[..._(this,et).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Sa(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Sa(t,r)):n}notify(t){me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){me.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){me.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},et=new WeakMap,Td),eh=(Pd=class extends ka{constructor(t){super();M(this,nt);M(this,tt);M(this,_e);M(this,an);this.mutationId=t.mutationId,I(this,_e,t.mutationCache),I(this,tt,[]),this.state=t.state||Na(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,tt).includes(t)||(_(this,tt).push(t),this.clearGcTimeout(),_(this,_e).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){I(this,tt,_(this,tt).filter(n=>n!==t)),this.scheduleGc(),_(this,_e).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,tt).length||(this.state.status==="pending"?this.scheduleGc():_(this,_e).remove(this))}continue(){var t;return((t=_(this,an))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,l,u,f,h,m,g,x,p,v,y,w,C,E,P,A,R,N;const n=()=>{V(this,nt,Ut).call(this,{type:"continue"})};I(this,an,ja({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,D)=>{V(this,nt,Ut).call(this,{type:"failed",failureCount:k,error:D})},onPause:()=>{V(this,nt,Ut).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,_e).canRun(this)}));const r=this.state.status==="pending",o=!_(this,an).canStart();try{if(r)n();else{V(this,nt,Ut).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=_(this,_e).config).onMutate)==null?void 0:i.call(s,t,this));const D=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));D!==this.state.context&&V(this,nt,Ut).call(this,{type:"pending",context:D,variables:t,isPaused:o})}const k=await _(this,an).start();return await((f=(u=_(this,_e).config).onSuccess)==null?void 0:f.call(u,k,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,k,t,this.state.context)),await((x=(g=_(this,_e).config).onSettled)==null?void 0:x.call(g,k,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,k,null,t,this.state.context)),V(this,nt,Ut).call(this,{type:"success",data:k}),k}catch(k){try{throw await((w=(y=_(this,_e).config).onError)==null?void 0:w.call(y,k,t,this.state.context,this)),await((E=(C=this.options).onError)==null?void 0:E.call(C,k,t,this.state.context)),await((A=(P=_(this,_e).config).onSettled)==null?void 0:A.call(P,void 0,k,this.state.variables,this.state.context,this)),await((N=(R=this.options).onSettled)==null?void 0:N.call(R,void 0,k,t,this.state.context)),k}finally{V(this,nt,Ut).call(this,{type:"error",error:k})}}finally{_(this,_e).runNext(this)}}},tt=new WeakMap,_e=new WeakMap,an=new WeakMap,nt=new WeakSet,Ut=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),me.batch(()=>{_(this,tt).forEach(r=>{r.onMutationUpdate(t)}),_(this,_e).notify({mutation:this,type:"updated",action:t})})},Pd);function Na(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var th=(Ad=class extends fn{constructor(t={}){super();M(this,dt);M(this,He);M(this,cr);this.config=t,I(this,dt,new Set),I(this,He,new Map),I(this,cr,0)}build(t,n,r){const o=new eh({mutationCache:this,mutationId:++Po(this,cr)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){_(this,dt).add(t);const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n);r?r.push(t):_(this,He).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,dt).delete(t)){const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&_(this,He).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Ir(t);if(typeof n=="string"){const o=(r=_(this,He).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){me.batch(()=>{_(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,dt).clear(),_(this,He).clear()})}getAll(){return Array.from(_(this,dt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ea(n,r))}findAll(t={}){return this.getAll().filter(n=>Ea(t,n))}notify(t){me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return me.batch(()=>Promise.all(t.map(n=>n.continue().catch(we))))}},dt=new WeakMap,He=new WeakMap,cr=new WeakMap,Ad);function Ir(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Da(e){return{onFetch:(t,n)=>{var f,h,m,g,x;const r=t.options,o=(m=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const v=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},y=Aa(t.options,t.fetchOptions),w=async(C,E,P)=>{if(p)return Promise.reject();if(E==null&&C.pages.length)return Promise.resolve(C);const R=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:E,direction:P?"backward":"forward",meta:t.options.meta};return v(U),U})(),N=await y(R),{maxPages:k}=t.options,D=P?zp:Vp;return{pages:D(C.pages,N,k),pageParams:D(C.pageParams,E,k)}};if(o&&s.length){const C=o==="backward",E=C?nh:Ma,P={pages:s,pageParams:i},A=E(r,P);a=await w(P,A,C)}else{const C=e??s.length;do{const E=l===0?i[0]??r.initialPageParam:Ma(r,a);if(l>0&&E==null)break;a=await w(a,E),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Ma(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var rh=(Rd=class{constructor(e={}){M(this,ue);M(this,Rt);M(this,Ot);M(this,In);M(this,jn);M(this,It);M(this,kn);M(this,Ln);I(this,ue,e.queryCache||new Jp),I(this,Rt,e.mutationCache||new th),I(this,Ot,e.defaultOptions||{}),I(this,In,new Map),I(this,jn,new Map),I(this,It,0)}mount(){Po(this,It)._++,_(this,It)===1&&(I(this,kn,ts.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ue).onFocus())})),I(this,Ln,Or.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ue).onOnline())})))}unmount(){var e,t;Po(this,It)._--,_(this,It)===0&&((e=_(this,kn))==null||e.call(this),I(this,kn,void 0),(t=_(this,Ln))==null||t.call(this),I(this,Ln,void 0))}isFetching(e){return _(this,ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ue).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,ue).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,ue).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,ue).get(r.queryHash),s=o==null?void 0:o.state.data,i=Wp(t,s);if(i!==void 0)return _(this,ue).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return me.batch(()=>_(this,ue).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ue).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,ue);me.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,ue);return me.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=me.batch(()=>_(this,ue).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(we).catch(we)}invalidateQueries(e,t={}){return me.batch(()=>(_(this,ue).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=me.batch(()=>_(this,ue).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(we)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(we)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,ue).build(this,t);return n.isStaleByTime(wt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(we).catch(we)}fetchInfiniteQuery(e){return e.behavior=Da(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(we).catch(we)}ensureInfiniteQueryData(e){return e.behavior=Da(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Or.isOnline()?_(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ue)}getMutationCache(){return _(this,Rt)}getDefaultOptions(){return _(this,Ot)}setDefaultOptions(e){I(this,Ot,e)}setQueryDefaults(e,t){_(this,In).set(Gt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,In).values()],n={};return t.forEach(r=>{Qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,jn).set(Gt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,jn).values()],n={};return t.forEach(r=>{Qn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ot).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Rr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ot).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ue).clear(),_(this,Rt).clear()}},ue=new WeakMap,Rt=new WeakMap,Ot=new WeakMap,In=new WeakMap,jn=new WeakMap,It=new WeakMap,kn=new WeakMap,Ln=new WeakMap,Rd),oh=(Od=class extends fn{constructor(t,n){super();M(this,ee);M(this,Te);M(this,K);M(this,ur);M(this,xe);M(this,ln);M(this,Nn);M(this,jt);M(this,kt);M(this,dr);M(this,Dn);M(this,Mn);M(this,cn);M(this,un);M(this,Lt);M(this,$n,new Set);this.options=n,I(this,Te,t),I(this,kt,null),I(this,jt,ns()),this.options.experimental_prefetchInRender||_(this,jt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,K).addObserver(this),$a(_(this,K),this.options)?V(this,ee,fr).call(this):this.updateResult(),V(this,ee,Ei).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return os(_(this,K),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return os(_(this,K),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,ee,Ti).call(this),V(this,ee,Pi).call(this),_(this,K).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,K);if(this.options=_(this,Te).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof De(this.options.enabled,_(this,K))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,ee,Ai).call(this),_(this,K).setOptions(this.options),n._defaulted&&!Ar(this.options,n)&&_(this,Te).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,K),observer:this});const o=this.hasListeners();o&&Fa(_(this,K),r,this.options,n)&&V(this,ee,fr).call(this),this.updateResult(),o&&(_(this,K)!==r||De(this.options.enabled,_(this,K))!==De(n.enabled,_(this,K))||wt(this.options.staleTime,_(this,K))!==wt(n.staleTime,_(this,K)))&&V(this,ee,xi).call(this);const s=V(this,ee,Ci).call(this);o&&(_(this,K)!==r||De(this.options.enabled,_(this,K))!==De(n.enabled,_(this,K))||s!==_(this,Lt))&&V(this,ee,Si).call(this,s)}getOptimisticResult(t){const n=_(this,Te).getQueryCache().build(_(this,Te),t),r=this.createResult(n,t);return ih(this,r)&&(I(this,xe,r),I(this,Nn,this.options),I(this,ln,_(this,K).state)),r}getCurrentResult(){return _(this,xe)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){_(this,$n).add(t)}getCurrentQuery(){return _(this,K)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Te).defaultQueryOptions(t),r=_(this,Te).getQueryCache().build(_(this,Te),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return V(this,ee,fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,xe)))}createResult(t,n){var k;const r=_(this,K),o=this.options,s=_(this,xe),i=_(this,ln),a=_(this,Nn),u=t!==r?t.state:_(this,ur),{state:f}=t;let h={...f},m=!1,g;if(n._optimisticResults){const D=this.hasListeners(),U=!D&&$a(t,n),W=D&&Fa(t,r,n,o);(U||W)&&(h={...h,...La(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:p,status:v}=h;g=h.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let D;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(D=s.data,y=!0):D=typeof n.placeholderData=="function"?n.placeholderData((k=_(this,Mn))==null?void 0:k.state.data,_(this,Mn)):n.placeholderData,D!==void 0&&(v="success",g=es(s==null?void 0:s.data,D,n),m=!0)}if(n.select&&g!==void 0&&!y)if(s&&g===(i==null?void 0:i.data)&&n.select===_(this,dr))g=_(this,Dn);else try{I(this,dr,n.select),g=n.select(g),g=es(s==null?void 0:s.data,g,n),I(this,Dn,g),I(this,kt,null)}catch(D){I(this,kt,D)}_(this,kt)&&(x=_(this,kt),g=_(this,Dn),p=Date.now(),v="error");const w=h.fetchStatus==="fetching",C=v==="pending",E=v==="error",P=C&&w,A=g!==void 0,N={status:v,fetchStatus:h.fetchStatus,isPending:C,isSuccess:v==="success",isError:E,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:E&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:E&&A,isStale:ss(t,n),refetch:this.refetch,promise:_(this,jt)};if(this.options.experimental_prefetchInRender){const D=H=>{N.status==="error"?H.reject(N.error):N.data!==void 0&&H.resolve(N.data)},U=()=>{const H=I(this,jt,N.promise=ns());D(H)},W=_(this,jt);switch(W.status){case"pending":t.queryHash===r.queryHash&&D(W);break;case"fulfilled":(N.status==="error"||N.data!==W.value)&&U();break;case"rejected":(N.status!=="error"||N.error!==W.reason)&&U();break}}return N}updateResult(){const t=_(this,xe),n=this.createResult(_(this,K),this.options);if(I(this,ln,_(this,K).state),I(this,Nn,this.options),_(this,ln).data!==void 0&&I(this,Mn,_(this,K)),Ar(n,t))return;I(this,xe,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!_(this,$n).size)return!0;const i=new Set(s??_(this,$n));return this.options.throwOnError&&i.add("error"),Object.keys(_(this,xe)).some(a=>{const l=a;return _(this,xe)[l]!==t[l]&&i.has(l)})};V(this,ee,zd).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,ee,Ei).call(this)}},Te=new WeakMap,K=new WeakMap,ur=new WeakMap,xe=new WeakMap,ln=new WeakMap,Nn=new WeakMap,jt=new WeakMap,kt=new WeakMap,dr=new WeakMap,Dn=new WeakMap,Mn=new WeakMap,cn=new WeakMap,un=new WeakMap,Lt=new WeakMap,$n=new WeakMap,ee=new WeakSet,fr=function(t){V(this,ee,Ai).call(this);let n=_(this,K).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(we)),n},xi=function(){V(this,ee,Ti).call(this);const t=wt(this.options.staleTime,_(this,K));if(zt||_(this,xe).isStale||!Yo(t))return;const r=Ca(_(this,xe).dataUpdatedAt,t)+1;I(this,cn,setTimeout(()=>{_(this,xe).isStale||this.updateResult()},r))},Ci=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,K)):this.options.refetchInterval)??!1},Si=function(t){V(this,ee,Pi).call(this),I(this,Lt,t),!(zt||De(this.options.enabled,_(this,K))===!1||!Yo(_(this,Lt))||_(this,Lt)===0)&&I(this,un,setInterval(()=>{(this.options.refetchIntervalInBackground||ts.isFocused())&&V(this,ee,fr).call(this)},_(this,Lt)))},Ei=function(){V(this,ee,xi).call(this),V(this,ee,Si).call(this,V(this,ee,Ci).call(this))},Ti=function(){_(this,cn)&&(clearTimeout(_(this,cn)),I(this,cn,void 0))},Pi=function(){_(this,un)&&(clearInterval(_(this,un)),I(this,un,void 0))},Ai=function(){const t=_(this,Te).getQueryCache().build(_(this,Te),this.options);if(t===_(this,K))return;const n=_(this,K);I(this,K,t),I(this,ur,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zd=function(t){me.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,xe))}),_(this,Te).getQueryCache().notify({query:_(this,K),type:"observerResultsUpdated"})})},Od);function sh(e,t){return De(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $a(e,t){return sh(e,t)||e.state.data!==void 0&&os(e,t,t.refetchOnMount)}function os(e,t,n){if(De(t.enabled,e)!==!1&&wt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ss(e,t)}return!1}function Fa(e,t,n,r){return(e!==t||De(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ss(e,n)}function ss(e,t){return De(t.enabled,e)!==!1&&e.isStaleByTime(wt(t.staleTime,e))}function ih(e,t){return!Ar(e.getCurrentResult(),t)}var ah=(Id=class extends fn{constructor(n,r){super();M(this,pt);M(this,Nt);M(this,Dt);M(this,Pe);M(this,ft);I(this,Nt,n),this.setOptions(r),this.bindMethods(),V(this,pt,Ao).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=_(this,Nt).defaultMutationOptions(n),Ar(this.options,r)||_(this,Nt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Pe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Gt(r.mutationKey)!==Gt(this.options.mutationKey)?this.reset():((o=_(this,Pe))==null?void 0:o.state.status)==="pending"&&_(this,Pe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Pe))==null||n.removeObserver(this)}onMutationUpdate(n){V(this,pt,Ao).call(this),V(this,pt,Ri).call(this,n)}getCurrentResult(){return _(this,Dt)}reset(){var n;(n=_(this,Pe))==null||n.removeObserver(this),I(this,Pe,void 0),V(this,pt,Ao).call(this),V(this,pt,Ri).call(this)}mutate(n,r){var o;return I(this,ft,r),(o=_(this,Pe))==null||o.removeObserver(this),I(this,Pe,_(this,Nt).getMutationCache().build(_(this,Nt),this.options)),_(this,Pe).addObserver(this),_(this,Pe).execute(n)}},Nt=new WeakMap,Dt=new WeakMap,Pe=new WeakMap,ft=new WeakMap,pt=new WeakSet,Ao=function(){var r;const n=((r=_(this,Pe))==null?void 0:r.state)??Na();I(this,Dt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ri=function(n){me.batch(()=>{var r,o,s,i,a,l,u,f;if(_(this,ft)&&this.hasListeners()){const h=_(this,Dt).variables,m=_(this,Dt).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,ft)).onSuccess)==null||o.call(r,n.data,h,m),(i=(s=_(this,ft)).onSettled)==null||i.call(s,n.data,null,h,m)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,ft)).onError)==null||l.call(a,n.error,h,m),(f=(u=_(this,ft)).onSettled)==null||f.call(u,void 0,n.error,h,m))}this.listeners.forEach(h=>{h(_(this,Dt))})})},Id),Ba=d.createContext(void 0),is=e=>{const t=d.useContext(Ba);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lh=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Ba.Provider,{value:e,children:t})),Ua=d.createContext(!1),ch=()=>d.useContext(Ua);Ua.Provider;function uh(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dh=d.createContext(uh()),fh=()=>d.useContext(dh),ph=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hh=e=>{d.useEffect(()=>{e.clearReset()},[e])},mh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Ra(n,[e.error,r])),gh=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},vh=(e,t)=>e.isLoading&&e.isFetching&&!t,yh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Wa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bh(e,t,n){var h,m,g,x,p;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=ch(),o=fh(),s=is(),i=s.defaultQueryOptions(e);(m=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,i),i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),i._optimisticResults=r?"isRestoring":"optimistic",gh(i),ph(i,o),hh(o);const a=!s.getQueryCache().get(i.queryHash),[l]=d.useState(()=>new t(s,i)),u=l.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?l.subscribe(me.batchCalls(v)):we;return l.updateResult(),y},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(i)},[i,l]),yh(i,u))throw Wa(i,l,o);if(mh({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((x=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,i,u),i.experimental_prefetchInRender&&!zt&&vh(u,r)){const v=a?Wa(i,l,o):(p=s.getQueryCache().get(i.queryHash))==null?void 0:p.promise;v==null||v.catch(we).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function Ha(e,t){return bh(e,oh)}function jr(e,t){const n=is(),[r]=d.useState(()=>new ah(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(i=>r.subscribe(me.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=d.useCallback((i,a)=>{r.mutate(i,a).catch(we)},[r]);if(o.error&&Ra(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const kr={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},Va={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:kr.STALE_TIME,gcTime:kr.GC_TIME,retry:kr.RETRY_COUNT,retryDelay:kr.RETRY_DELAY,enable:!0},Lr=e=>e instanceof Error?e.message:String(e),za=(e,t,n)=>{const r=is(),{notify:o}=Qo(),{createFn:s,readFn:i,readByIdFn:a,updateFn:l,deleteFn:u,partialUpdateFn:f}=n,h=()=>{r.invalidateQueries({queryKey:[e]})},m=(E,P,A,R)=>o(R!=null&&R.overrideSuccessMessage?R==null?void 0:R.overrideSuccessMessage(E,P):A,"success"),g=(E,P,A,R)=>o(R!=null&&R.overrideErrorMessage?R==null?void 0:R.overrideErrorMessage(E,P):A,"error");return{useCreate:E=>jr({mutationFn:P=>s(P),onSuccess:P=>{h(),m(t,P,`${t} created successfully`,E)},onError:P=>{g(t,P,`Error creating ${t}: ${Lr(P)}`,E)}}),useReadQuery:E=>Ha({queryKey:[e],queryFn:i,...Va,...E}),useReadByIdQuery:(E,P)=>Ha({queryKey:[e,E],queryFn:()=>a(E),...Va,enabled:!!E,...P}),useUpdate:E=>jr({mutationFn:({id:P,data:A})=>l(P,A),onSuccess:P=>{h(),m(t,P,`${t} updated successfully`,E)},onError:P=>{g(t,P,`Error updating ${t}: ${Lr(P)}`,E)}}),usePartialUpdate:E=>f&&jr({mutationFn:({id:P,data:A})=>f(P,A),onSuccess:P=>{h(),m(t,P,`${t} updated successfully`,E)},onError:P=>{g(t,P,`Error updating ${t}: ${Lr(P)}`,E)}}),useDelete:E=>jr({mutationFn:P=>u(P),onSuccess:()=>{h(),m(t,null,`${t} deleted successfully`,E)},onError:P=>{g(t,P,`Error deleting ${t}: ${Lr(P)}`,E)}}),invalidateQueries:h}},wh=(e,t)=>za(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())}),_h={SINGLE_TENANT:"single-tenant"},xh={COOKIE:"cookie"},as="tenant",Ga="tenant",qa="tenant",Ch=_h.SINGLE_TENANT,Sh=xh.COOKIE,Eh={mode:Ch,clientSideMode:Sh,tenantIDPProvisioningStrategy:"none"};class Th{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(Ga,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(Ga)}}class Ph{setTenant(t,n){sessionStorage.setItem(qa,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(qa)}}/*! js-cookie v3.0.5 | MIT */function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Ah={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ls(e,t){function n(o,s,i){if(!(typeof document>"u")){i=Nr({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in i)i[l]&&(a+="; "+l,i[l]!==!0&&(a+="="+i[l].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var l=s[a].split("="),u=l.slice(1).join("=");try{var f=decodeURIComponent(l[0]);if(i[f]=e.read(u,f),o===f)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",Nr({},s,{expires:-1}))},withAttributes:function(o){return ls(this.converter,Nr({},this.attributes,o))},withConverter:function(o){return ls(Nr({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cs=ls(Ah,{path:"/"});class Rh{setTenant(t,n){t?cs.set(as,t.name):cs.remove(as),window.location.reload()}getCurrentTenantName(){return cs.get(as)}}class Oh{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),s=r.patternValue,i=o.hostname,a=this.getBaseDomain(i),l=s?`${s}.${a}`:a;o.hostname=l,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const Ka={queryParams:new Th,sessionStorage:new Ph,cookie:new Rh,subdomain:new Oh},Ih=e=>{const t=Ka[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:Ka},null,2)}`);return t},jh=(e,t,n)=>{const r=t.find(s=>s.name===n);if(!r)throw Error("No tenant permission");return Ih(e).setTenant(r,e),r},kh=()=>{const[e,t]=Wn(),{tenants:n=[],currentTenant:r,tenantConfig:o=Eh}=e,s=S.useCallback(i=>{const a=jh(o,n,i);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:s}};function Lh(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function Dr(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return Lh(o),o}class Mr{static async get(t,n,r){const s=await Dr(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return s.status===204?null:await s.json()}static async create(t,n,r,o){const s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Dr(t,n,r,s)).json()}static async update(t,n,r,o){const s={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Dr(t,n,r,s)).json()}static async delete(t,n,r){return await Dr(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const Nh=e=>{const t=$o("@bluealba/pae-nestjs-gateway-service"),n=Zi();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=S.useState(null),[s,i]=S.useState(!1),[a,l]=S.useState(!1),[u,f]=S.useState(null),h=(w,C)=>S.useCallback(async({newValue:E,shouldThrowError:P}={})=>{try{l(!0),f(null);const A=await w(t,n,e,E);return o(A),A?A.value:null}catch(A){if(f(A==null?void 0:A.message),console.error(`Failed to ${C} ${e}:`,A),P)throw A;return null}finally{l(!1)}},[t,n,e]),m=h(Mr.get,"fetch"),g=h(Mr.create,"create"),x=h(Mr.update,"update"),p=h(Mr.delete,"delete"),v=S.useCallback(async()=>{try{await m()}finally{i(!0)}},[m]);S.useEffect(()=>{v()},[v]);const y=S.useCallback(async(w,C=!1)=>r==null?await g({newValue:w,shouldThrowError:C}):await x({newValue:w,shouldThrowError:C}),[r,g,x]);return{value:r?r.value:null,hasFetched:s,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:p}},Qa="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",Dh=({module:e,point:t,children:n})=>(ta(e,t,n??Qa),null),Ya=({name:e,children:t,...n})=>{const r=ea(e);if(r===Qa)return null;if(!r)return c.jsx(c.Fragment,{children:t??null});if(Mh(r)){const o=r;return c.jsx(o,{...n})}else return r},Mh=e=>typeof e=="function",$h=(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",c.jsx(Ya,{name:t,...r,children:c.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n},Za="single-spa:app-change";function Fh(){const[e,t]=S.useState(Xa());return S.useEffect(()=>{const n=()=>{t(Xa())};return window.addEventListener(Za,n),()=>{window.removeEventListener(Za,n)}},[]),e}function Xa(){return he.getAppNames().reduce((t,n)=>(he.getAppStatus(n)?t[n]=he.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function Bh(e){const n=Fh()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const Ja=({appName:e})=>c.jsx("div",{children:c.jsxs("p",{children:["Loading ",e,"..."]})});Ja.displayName="BaseLoading";const el=({appName:e})=>c.jsxs("div",{children:[c.jsx("p",{children:"Something went wrong..."}),c.jsxs("p",{children:["Failed to load ",e]})]});el.displayName="BaseError";const Uh={display:"flex",flexDirection:"column",flex:1},tl=S.forwardRef((e,t)=>c.jsx("div",{ref:t,style:Uh,...e}));tl.displayName="BaseContainer";const Wh="pae-app:",nl=S.forwardRef(({appName:e,LoadingComponent:t=Ja,ErrorComponent:n=el,ContainerComponent:r=tl,...o},s)=>{const i=Bh(e);return c.jsxs(r,{ref:s,...o,id:`${Wh}${e}`,children:[i.isLoading&&c.jsx(t,{appName:e}),i.isBroken&&c.jsx(n,{appName:e})]})});nl.displayName="ModulePlaceHolder";const us=({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=Gn();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const s=n;return c.jsx(s,{operations:e})}else return n({operations:e});return S.isValidElement(n)?n:null}return t};us.displayName="Authorized";const Hh=({eventName:e,listener:t})=>(na(e,t),null),Vh=()=>c.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),rl=({applicationName:e})=>{const t=Ki(e);if(t)if(typeof t=="function"){const n=t;return c.jsx(n,{})}else return t;return c.jsx(Vh,{})};rl.displayName="ApplicationIcon";const ol=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});ol.displayName="DarkModeIcon";const sl=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});sl.displayName="LightModeIcon";const ds={container:"container__zBqbk",expanded:"expanded__EbsIr",label:"label__cdMnm"};function il(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=il(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function L(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=il(e))&&(r&&(r+=" "),r+=t);return r}const zh=e=>e.toLowerCase().trim().split(" ").join("-"),Gh=e=>`${zh(e)}-theme`,al=()=>{const{platformName:e="Platform"}=ko(),t=Gh(e),[n,r]=S.useState(()=>{const s=localStorage.getItem(t);return s==="light"||s==="dark"?s:"light"}),o=s=>{localStorage.setItem(t,s),r(s)};return S.useEffect(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}},$r={spinner:"spinner__fakUN","spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:"spinner-rotation__wUmPV",button:"button__8FA9H","button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:"button--contained-primary__stkTx","button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:"button--outlined-primary__KZ1ww","button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:"button--text-primary__GLTfm","button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:"button--contained-danger__L9ehT","button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:"button--outlined-danger__eoYLd","button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:"button--text-danger__Sw-ha",icon:"icon__--umH"},Fr=S.forwardRef(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:s,...i},a)=>{const l=L($r.button,$r[`button--${e}-${t}`],o);return c.jsxs("button",{ref:a,className:l,...i,children:[n?c.jsx("div",{className:$r.spinner}):r&&c.jsx(r,{className:$r.icon}),s]})});Fr.displayName="Button";const Br={Badges:"Badges__5jpum",badges:"Badges__5jpum",Badge:"Badge__95MWM",badge:"Badge__95MWM","Badge--primary":"Badge--primary__Rx-bS",badgePrimary:"Badge--primary__Rx-bS","Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:"Badge--secondary__d92bT","Badge--success":"Badge--success__Kdo98",badgeSuccess:"Badge--success__Kdo98","Badge--warning":"Badge--warning__bf-Nn",badgeWarning:"Badge--warning__bf-Nn","Badge--danger":"Badge--danger__HTj39",badgeDanger:"Badge--danger__HTj39","Badge--small":"Badge--small__y93Pj",badgeSmall:"Badge--small__y93Pj","Badge--regular":"Badge--regular__aT5AL",badgeRegular:"Badge--regular__aT5AL","Badge--large":"Badge--large__wORCH",badgeLarge:"Badge--large__wORCH"},fs={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in fs)Object.freeze(fs[e]);const ll=Object.freeze(fs);var cl={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function qh(e){var f,h;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),ll[e])n=ll[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),i=s.length,a=i<=4;r=1,a?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],i===4&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],i===8&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];o=l.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(cl[m]!==void 0)return cl[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((h=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const Kh=(e,t)=>{const{space:n,values:r}=qh(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},ps=S.forwardRef(({children:e,color:t,className:n,customColor:r,size:o="small",style:s,...i},a)=>{const l=r?{color:r,background:Kh(r,.1)}:{},u=L(Br.Badge,Br[`Badge--${o}`],{[Br[`Badge--${t}`]]:!!t},n);return c.jsx("span",{ref:a,className:u,style:{...s,...l},...i,children:e})});ps.displayName="Badge";const hs=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(Br.Badges,t);return c.jsx("div",{ref:r,className:o,...n,children:e})});hs.displayName="Badges";const ul=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]}),dl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"m9 12 2 2 4-4"})]}),Qh={CopyToClipboardButton:"CopyToClipboardButton__2Nd2m"},Yh=({content:e})=>{const[t,n]=Zh(),{notify:r}=Qo(),o=t?dl:ul,s=S.useCallback(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return c.jsx(o,{className:Qh.CopyToClipboardButton,size:18,onClick:s})},Zh=()=>{const[e,t]=S.useState(!1);return[e,async r=>{var o;try{return await((o=navigator==null?void 0:navigator.clipboard)==null?void 0:o.writeText(r)),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(s){return console.error("Failed to copy text: ",s),!1}}]},fl={FieldGroup:"FieldGroup__Q2JCV",fieldGroup:"FieldGroup__Q2JCV","FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:"FieldGroup--horizontal__kpfL1","FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:"FieldGroup--vertical__FLo-Q"},pl=S.forwardRef(({children:e,className:t,orientation:n="vertical",...r},o)=>{const s=L(fl.FieldGroup,fl[`FieldGroup--${n}`],t);return c.jsx("div",{ref:o,className:s,...r,children:e})});pl.displayName="FieldGroup";const hl={Input:"Input__uS0sb",Error:"Error__-DQpw"},Ur=S.forwardRef(({className:e,error:t,...n},r)=>{const o=L(hl.Input,t&&hl.Error,e);return c.jsx("input",{ref:r,className:o,...n})});Ur.displayName="Input";const Xh={Error:"Error__N4OP5"},ml=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(Xh.Error,t);return c.jsx("span",{ref:r,className:o,...n,children:e})});ml.displayName="InputError";const gl={Label:"Label__VYUvW",Error:"Error__Eu6DI"},vl=S.forwardRef(({children:e,className:t,error:n,...r},o)=>{const s=L(gl.Label,n&&gl.Error,t);return c.jsx("label",{ref:o,className:s,...r,children:e})});vl.displayName="Label";const ms={Select:"Select__giqpe",Chevron:"Chevron__YvhBd"},yl=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(ms.Option,t);return c.jsx("option",{ref:r,className:o,...n,children:e})});yl.displayName="Option";const gs=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(ms.Select,t);return c.jsxs("div",{className:o,children:[c.jsx("select",{ref:r,...n,children:e}),c.jsx("div",{className:ms.Chevron,children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});gs.displayName="Select",gs.Option=yl;function bl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jh(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,l=d.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Yn(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),l=n.length;n=[...n,i];const u=h=>{var y;const{scope:m,children:g,...x}=h,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=d.useMemo(()=>x,Object.values(x));return c.jsx(p.Provider,{value:v,children:g})};u.displayName=s+"Provider";function f(h,m){var p;const g=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,x=d.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,em(o,...t)]}function em(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function wl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=wl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():wl(e[o],null)}}}}function ce(...e){return d.useCallback(pn(...e),e)}function _l(e){const t=tm(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(rm);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function tm(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=sm(o),a=om(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nm=Symbol("radix.slottable");function rm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nm}function om(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function sm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function im(e){const t=e+"CollectionProvider",[n,r]=Yn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:y}=p,w=S.useRef(null),C=S.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:w,children:y})};i.displayName=t;const a=e+"CollectionSlot",l=_l(a),u=S.forwardRef((p,v)=>{const{scope:y,children:w}=p,C=s(a,y),E=ce(v,C.collectionRef);return c.jsx(l,{ref:E,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=_l(f),g=S.forwardRef((p,v)=>{const{scope:y,children:w,...C}=p,E=S.useRef(null),P=ce(v,E),A=s(f,y);return S.useEffect(()=>(A.itemMap.set(E,{ref:E,...C}),()=>void A.itemMap.delete(E))),c.jsx(m,{[h]:"",ref:P,children:w})});g.displayName=f;function x(p){const v=s(e+"CollectionConsumer",p);return S.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((A,R)=>C.indexOf(A.ref.current)-C.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},x,r]}var am=d.createContext(void 0);function lm(e){const t=d.useContext(am);return e||t||"ltr"}function cm(e){const t=um(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(fm);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function um(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=hm(o),a=pm(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dm=Symbol("radix.slottable");function fm(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dm}function pm(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function hm(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=mm.reduce((e,t)=>{const n=cm(`Primitive.${t}`),r=d.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gm(e,t){e&&hr.flushSync(()=>e.dispatchEvent(t))}function qt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vm(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ym="DismissableLayer",vs="dismissableLayer.update",bm="dismissableLayer.pointerDownOutside",wm="dismissableLayer.focusOutside",xl,Cl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=d.useContext(Cl),[f,h]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=ce(t,R=>h(R)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,P=Cm(R=>{const N=R.target,k=[...u.branches].some(D=>D.contains(N));!E||k||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},m),A=Sm(R=>{const N=R.target;[...u.branches].some(D=>D.contains(N))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},m);return vm(R=>{w===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xl=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Sl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=xl)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Sl())},[f,u]),d.useEffect(()=>{const R=()=>g({});return document.addEventListener(vs,R),()=>document.removeEventListener(vs,R)},[]),c.jsx(ie.div,{...l,ref:x,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,P.onPointerDownCapture)})});Wr.displayName=ym;var _m="DismissableLayerBranch",xm=d.forwardRef((e,t)=>{const n=d.useContext(Cl),r=d.useRef(null),o=ce(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(ie.div,{...e,ref:o})});xm.displayName=_m;function Cm(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){El(bm,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Sm(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&El(wm,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sl(){const e=new CustomEvent(vs);document.dispatchEvent(e)}function El(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?gm(o,s):o.dispatchEvent(s)}var ys=0;function Tl(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pl()),document.body.insertAdjacentElement("beforeend",e[1]??Pl()),ys++,()=>{ys===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ys--}},[])}function Pl(){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 bs="focusScope.autoFocusOnMount",ws="focusScope.autoFocusOnUnmount",Al={bubbles:!1,cancelable:!0},Em="FocusScope",_s=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=d.useState(null),u=qt(o),f=qt(s),h=d.useRef(null),m=ce(t,p=>l(p)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let p=function(C){if(g.paused||!a)return;const E=C.target;a.contains(E)?h.current=E:_t(h.current,{select:!0})},v=function(C){if(g.paused||!a)return;const E=C.relatedTarget;E!==null&&(a.contains(E)||_t(h.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){Il.add(g);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(bs,Al);a.addEventListener(bs,u),a.dispatchEvent(y),y.defaultPrevented||(Tm(Im(Rl(a)),{select:!0}),document.activeElement===p&&_t(a))}return()=>{a.removeEventListener(bs,u),setTimeout(()=>{const y=new CustomEvent(ws,Al);a.addEventListener(ws,f),a.dispatchEvent(y),y.defaultPrevented||_t(p??document.body,{select:!0}),a.removeEventListener(ws,f),Il.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[C,E]=Pm(w);C&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&_t(C,{select:!0})):p.shiftKey&&y===C&&(p.preventDefault(),n&&_t(E,{select:!0})):y===w&&p.preventDefault()}},[n,r,g.paused]);return c.jsx(ie.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});_s.displayName=Em;function Tm(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function Pm(e){const t=Rl(e),n=Ol(t,e),r=Ol(t.reverse(),e);return[n,r]}function Rl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ol(e,t){for(const n of e)if(!Am(n,{upTo:t}))return n}function Am(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Rm(e){return e instanceof HTMLInputElement&&"select"in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Rm(e)&&t&&e.select()}}var Il=Om();function Om(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jl(e,t),e.unshift(t)},remove(t){var n;e=jl(e,t),(n=e[0])==null||n.resume()}}}function jl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Im(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},jm=d[" useId ".trim().toString()]||(()=>{}),km=0;function Kt(e){const[t,n]=d.useState(jm());return ve(()=>{n(r=>r??String(km++))},[e]),e||(t?`radix-${t}`:"")}const Lm=["top","right","bottom","left"],xt=Math.min,Oe=Math.max,Hr=Math.round,Vr=Math.floor,qe=e=>({x:e,y:e}),Nm={left:"right",right:"left",bottom:"top",top:"bottom"},Dm={start:"end",end:"start"};function xs(e,t,n){return Oe(e,xt(t,n))}function lt(e,t){return typeof e=="function"?e(t):e}function ct(e){return e.split("-")[0]}function hn(e){return e.split("-")[1]}function Cs(e){return e==="x"?"y":"x"}function Ss(e){return e==="y"?"height":"width"}const Mm=new Set(["top","bottom"]);function Ke(e){return Mm.has(ct(e))?"y":"x"}function Es(e){return Cs(Ke(e))}function $m(e,t,n){n===void 0&&(n=!1);const r=hn(e),o=Es(e),s=Ss(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zr(i)),[i,zr(i)]}function Fm(e){const t=zr(e);return[Ts(e),t,Ts(t)]}function Ts(e){return e.replace(/start|end/g,t=>Dm[t])}const kl=["left","right"],Ll=["right","left"],Bm=["top","bottom"],Um=["bottom","top"];function Wm(e,t,n){switch(e){case"top":case"bottom":return n?t?Ll:kl:t?kl:Ll;case"left":case"right":return t?Bm:Um;default:return[]}}function Hm(e,t,n,r){const o=hn(e);let s=Wm(ct(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ts)))),s}function zr(e){return e.replace(/left|right|bottom|top/g,t=>Nm[t])}function Vm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nl(e){return typeof e!="number"?Vm(e):{top:e,right:e,bottom:e,left:e}}function Gr(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 Dl(e,t,n){let{reference:r,floating:o}=e;const s=Ke(t),i=Es(t),a=Ss(i),l=ct(t),u=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(hn(t)){case"start":g[i]-=m*(n&&u?-1:1);break;case"end":g[i]+=m*(n&&u?-1:1);break}return g}async function zm(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=lt(t,e),x=Nl(g),v=a[m?h==="floating"?"reference":"floating":h],y=Gr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},P=Gr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:l}):w);return{top:(y.top-P.top+x.top)/E.y,bottom:(P.bottom-y.bottom+x.bottom)/E.y,left:(y.left-P.left+x.left)/E.x,right:(P.right-y.right+x.right)/E.x}}const Gm=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Dl(u,r,l),m=r,g={},x=0;for(let v=0;v<a.length;v++){var p;const{name:y,fn:w}=a[v],{x:C,y:E,data:P,reset:A}=await w({x:f,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:zm},elements:{reference:e,floating:t}});f=C??f,h=E??h,g={...g,[y]:{...g[y],...P}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(u=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:f,y:h}=Dl(u,m,l)),v=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:g}},qm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=lt(e,t)||{};if(u==null)return{};const h=Nl(f),m={x:n,y:r},g=Es(o),x=Ss(g),p=await i.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",E=s.reference[x]+s.reference[g]-m[g]-s.floating[x],P=m[g]-s.reference[g],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=A?A[C]:0;(!R||!await(i.isElement==null?void 0:i.isElement(A)))&&(R=a.floating[C]||s.floating[x]);const N=E/2-P/2,k=R/2-p[x]/2-1,D=xt(h[y],k),U=xt(h[w],k),W=D,H=R-p[x]-U,z=R/2-p[x]/2+N,oe=xs(W,z,H),G=!l.arrow&&hn(o)!=null&&z!==oe&&s.reference[x]/2-(z<W?D:U)-p[x]/2<0,Y=G?z<W?z-W:z-H:0;return{[g]:m[g]+Y,data:{[g]:oe,centerOffset:z-oe-Y,...G&&{alignmentOffset:Y}},reset:G}}}),Km=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...v}=lt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ct(o),w=Ke(a),C=ct(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=m||(C||!p?[zr(a)]:Fm(a)),A=x!=="none";!m&&A&&P.push(...Hm(a,p,x,E));const R=[a,...P],N=await l.detectOverflow(t,v),k=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(N[y]),h){const z=$m(o,i,E);k.push(N[z[0]],N[z[1]])}if(D=[...D,{placement:o,overflows:k}],!k.every(z=>z<=0)){var U,W;const z=(((U=s.flip)==null?void 0:U.index)||0)+1,oe=R[z];if(oe&&(!(h==="alignment"?w!==Ke(oe):!1)||D.every(F=>Ke(F.placement)===w?F.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:oe}};let G=(W=D.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:W.placement;if(!G)switch(g){case"bestFit":{var H;const Y=(H=D.filter(F=>{if(A){const se=Ke(F.placement);return se===w||se==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(se=>se>0).reduce((se,ge)=>se+ge,0)]).sort((F,se)=>F[1]-se[1])[0])==null?void 0:H[0];Y&&(G=Y);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ml(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $l(e){return Lm.some(t=>e[t]>=0)}const Qm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=lt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ml(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:$l(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ml(i,n.floating);return{data:{escapedOffsets:a,escaped:$l(a)}}}default:return{}}}}},Fl=new Set(["left","top"]);async function Ym(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ct(n),a=hn(n),l=Ke(n)==="y",u=Fl.has(i)?-1:1,f=s&&l?-1:1,h=lt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),l?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Zm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Ym(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},Xm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=lt(e,t),f={x:n,y:r},h=await s.detectOverflow(t,u),m=Ke(ct(o)),g=Cs(m);let x=f[g],p=f[m];if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=x+h[y],E=x-h[w];x=xs(C,x,E)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",C=p+h[y],E=p-h[w];p=xs(C,p,E)}const v=l.fn({...t,[g]:x,[m]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[m]:a}}}}}},Jm=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=lt(e,t),f={x:n,y:r},h=Ke(o),m=Cs(h);let g=f[m],x=f[h];const p=lt(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const C=m==="y"?"height":"width",E=s.reference[m]-s.floating[C]+v.mainAxis,P=s.reference[m]+s.reference[C]-v.mainAxis;g<E?g=E:g>P&&(g=P)}if(u){var y,w;const C=m==="y"?"width":"height",E=Fl.has(ct(o)),P=s.reference[h]-s.floating[C]+(E&&((y=i.offset)==null?void 0:y[h])||0)+(E?0:v.crossAxis),A=s.reference[h]+s.reference[C]+(E?0:((w=i.offset)==null?void 0:w[h])||0)-(E?v.crossAxis:0);x<P?x=P:x>A&&(x=A)}return{[m]:g,[h]:x}}}},e1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=lt(e,t),f=await i.detectOverflow(t,u),h=ct(o),m=hn(o),g=Ke(o)==="y",{width:x,height:p}=s.floating;let v,y;h==="top"||h==="bottom"?(v=h,y=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,C=x-f.left-f.right,E=xt(p-f[v],w),P=xt(x-f[y],C),A=!t.middlewareData.shift;let R=E,N=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=w),A&&!m){const D=Oe(f.left,0),U=Oe(f.right,0),W=Oe(f.top,0),H=Oe(f.bottom,0);g?N=x-2*(D!==0||U!==0?D+U:Oe(f.left,f.right)):R=p-2*(W!==0||H!==0?W+H:Oe(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:R});const k=await i.getDimensions(a.floating);return x!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function qr(){return typeof window<"u"}function mn(e){return Bl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(Bl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bl(e){return qr()?e instanceof Node||e instanceof Ie(e).Node:!1}function Me(e){return qr()?e instanceof Element||e instanceof Ie(e).Element:!1}function Ye(e){return qr()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Ul(e){return!qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}const t1=new Set(["inline","contents"]);function Zn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!t1.has(o)}const n1=new Set(["table","td","th"]);function r1(e){return n1.has(mn(e))}const o1=[":popover-open",":modal"];function Kr(e){return o1.some(t=>{try{return e.matches(t)}catch{return!1}})}const s1=["transform","translate","scale","rotate","perspective"],i1=["transform","translate","scale","rotate","perspective","filter"],a1=["paint","layout","strict","content"];function Ps(e){const t=As(),n=Me(e)?$e(e):e;return s1.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||i1.some(r=>(n.willChange||"").includes(r))||a1.some(r=>(n.contain||"").includes(r))}function l1(e){let t=Ct(e);for(;Ye(t)&&!gn(t);){if(Ps(t))return t;if(Kr(t))return null;t=Ct(t)}return null}function As(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const c1=new Set(["html","body","#document"]);function gn(e){return c1.has(mn(e))}function $e(e){return Ie(e).getComputedStyle(e)}function Qr(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(mn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ul(e)&&e.host||Qe(e);return Ul(t)?t.host:t}function Wl(e){const t=Ct(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Zn(t)?t:Wl(t)}function Xn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ie(o);if(s){const a=Rs(i);return t.concat(i,i.visualViewport||[],Zn(o)?o:[],a&&n?Xn(a):[])}return t.concat(o,Xn(o,[],n))}function Rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hl(e){const t=$e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ye(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Hr(n)!==s||Hr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Os(e){return Me(e)?e:e.contextElement}function vn(e){const t=Os(e);if(!Ye(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Hl(t);let i=(s?Hr(n.width):n.width)/r,a=(s?Hr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const u1=qe(0);function Vl(e){const t=Ie(e);return!As()||!t.visualViewport?u1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function d1(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Os(e);let i=qe(1);t&&(r?Me(r)&&(i=vn(r)):i=vn(e));const a=d1(s,n,r)?Vl(s):qe(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const m=Ie(s),g=r&&Me(r)?Ie(r):r;let x=m,p=Rs(x);for(;p&&r&&g!==x;){const v=vn(p),y=p.getBoundingClientRect(),w=$e(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,E=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,h*=v.y,l+=C,u+=E,x=Ie(p),p=Rs(x)}}return Gr({width:f,height:h,x:l,y:u})}function Yr(e,t){const n=Qr(e).scrollLeft;return t?t.left+n:Qt(Qe(e)).left+n}function zl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function f1(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qe(r),a=t?Kr(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=qe(1);const f=qe(0),h=Ye(r);if((h||!h&&!s)&&((mn(r)!=="body"||Zn(i))&&(l=Qr(r)),Ye(r))){const g=Qt(r);u=vn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!h&&!s?zl(i,l):qe(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function p1(e){return Array.from(e.getClientRects())}function h1(e){const t=Qe(e),n=Qr(e),r=e.ownerDocument.body,o=Oe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Oe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Yr(e);const a=-n.scrollTop;return $e(r).direction==="rtl"&&(i+=Oe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Gl=25;function m1(e,t){const n=Ie(e),r=Qe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const f=As();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Yr(r);if(u<=0){const f=r.ownerDocument,h=f.body,m=getComputedStyle(h),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-g);x<=Gl&&(s-=x)}else u<=Gl&&(s+=u);return{width:s,height:i,x:a,y:l}}const g1=new Set(["absolute","fixed"]);function v1(e,t){const n=Qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ye(e)?vn(e):qe(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function ql(e,t,n){let r;if(t==="viewport")r=m1(e,n);else if(t==="document")r=h1(Qe(e));else if(Me(t))r=v1(t,n);else{const o=Vl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gr(r)}function Kl(e,t){const n=Ct(e);return n===t||!Me(n)||gn(n)?!1:$e(n).position==="fixed"||Kl(n,t)}function y1(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>Me(a)&&mn(a)!=="body"),o=null;const s=$e(e).position==="fixed";let i=s?Ct(e):e;for(;Me(i)&&!gn(i);){const a=$e(i),l=Ps(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&g1.has(o.position)||Zn(i)&&!l&&Kl(e,i))?r=r.filter(f=>f!==i):o=a,i=Ct(i)}return t.set(e,r),r}function b1(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Kr(t)?[]:y1(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,f)=>{const h=ql(t,f,o);return u.top=Oe(h.top,u.top),u.right=xt(h.right,u.right),u.bottom=xt(h.bottom,u.bottom),u.left=Oe(h.left,u.left),u},ql(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function w1(e){const{width:t,height:n}=Hl(e);return{width:t,height:n}}function _1(e,t,n){const r=Ye(t),o=Qe(t),s=n==="fixed",i=Qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);function u(){l.x=Yr(o)}if(r||!r&&!s)if((mn(t)!=="body"||Zn(o))&&(a=Qr(t)),r){const g=Qt(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&u();s&&!r&&o&&u();const f=o&&!r&&!s?zl(o,a):qe(0),h=i.left+a.scrollLeft-l.x-f.x,m=i.top+a.scrollTop-l.y-f.y;return{x:h,y:m,width:i.width,height:i.height}}function Is(e){return $e(e).position==="static"}function Ql(e,t){if(!Ye(e)||$e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function Yl(e,t){const n=Ie(e);if(Kr(e))return n;if(!Ye(e)){let o=Ct(e);for(;o&&!gn(o);){if(Me(o)&&!Is(o))return o;o=Ct(o)}return n}let r=Ql(e,t);for(;r&&r1(r)&&Is(r);)r=Ql(r,t);return r&&gn(r)&&Is(r)&&!Ps(r)?n:r||l1(e)||n}const x1=async function(e){const t=this.getOffsetParent||Yl,n=this.getDimensions,r=await n(e.floating);return{reference:_1(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function C1(e){return $e(e).direction==="rtl"}const S1={convertOffsetParentRelativeRectToViewportRelativeRect:f1,getDocumentElement:Qe,getClippingRect:b1,getOffsetParent:Yl,getElementRects:x1,getClientRects:p1,getDimensions:w1,getScale:vn,isElement:Me,isRTL:C1};function Zl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function E1(e,t){let n=null,r;const o=Qe(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:h,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=Vr(h),p=Vr(o.clientWidth-(f+m)),v=Vr(o.clientHeight-(h+g)),y=Vr(f),C={rootMargin:-x+"px "+-p+"px "+-v+"px "+-y+"px",threshold:Oe(0,xt(1,l))||1};let E=!0;function P(A){const R=A[0].intersectionRatio;if(R!==l){if(!E)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Zl(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(P,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return i(!0),s}function T1(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Os(e),f=o||s?[...u?Xn(u):[],...Xn(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=u&&a?E1(u,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let x,p=l?Qt(e):null;l&&v();function v(){const y=Qt(e);p&&!Zl(p,y)&&n(),p=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const P1=Zm,A1=Xm,R1=Km,O1=e1,I1=Qm,Xl=qm,j1=Jm,k1=(e,t,n)=>{const r=new Map,o={platform:S1,...n},s={...o.platform,_c:r};return Gm(e,t,{...o,platform:s})};var L1=typeof document<"u",N1=function(){},Zr=L1?S.useLayoutEffect:N1;function Xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xr(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Xr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Jl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ec(e,t){const n=Jl(e);return Math.round(t*n)/n}function js(e){const t=d.useRef(e);return Zr(()=>{t.current=e}),t}function D1(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);Xr(m,r)||g(r);const[x,p]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback(F=>{F!==A.current&&(A.current=F,p(F))},[]),C=d.useCallback(F=>{F!==R.current&&(R.current=F,y(F))},[]),E=s||x,P=i||v,A=d.useRef(null),R=d.useRef(null),N=d.useRef(f),k=l!=null,D=js(l),U=js(o),W=js(u),H=d.useCallback(()=>{if(!A.current||!R.current)return;const F={placement:t,strategy:n,middleware:m};U.current&&(F.platform=U.current),k1(A.current,R.current,F).then(se=>{const ge={...se,isPositioned:W.current!==!1};z.current&&!Xr(N.current,ge)&&(N.current=ge,hr.flushSync(()=>{h(ge)}))})},[m,t,n,U,W]);Zr(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[u]);const z=d.useRef(!1);Zr(()=>(z.current=!0,()=>{z.current=!1}),[]),Zr(()=>{if(E&&(A.current=E),P&&(R.current=P),E&&P){if(D.current)return D.current(E,P,H);H()}},[E,P,H,D,k]);const oe=d.useMemo(()=>({reference:A,floating:R,setReference:w,setFloating:C}),[w,C]),G=d.useMemo(()=>({reference:E,floating:P}),[E,P]),Y=d.useMemo(()=>{const F={position:n,left:0,top:0};if(!G.floating)return F;const se=ec(G.floating,f.x),ge=ec(G.floating,f.y);return a?{...F,transform:"translate("+se+"px, "+ge+"px)",...Jl(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:ge}},[n,a,G.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:H,refs:oe,elements:G,floatingStyles:Y}),[f,H,oe,G,Y])}const M1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Xl({element:r.current,padding:o}).fn(n):{}:r?Xl({element:r,padding:o}).fn(n):{}}}},$1=(e,t)=>({...P1(e),options:[e,t]}),F1=(e,t)=>({...A1(e),options:[e,t]}),B1=(e,t)=>({...j1(e),options:[e,t]}),U1=(e,t)=>({...R1(e),options:[e,t]}),W1=(e,t)=>({...O1(e),options:[e,t]}),H1=(e,t)=>({...I1(e),options:[e,t]}),V1=(e,t)=>({...M1(e),options:[e,t]});var z1="Arrow",tc=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});tc.displayName=z1;var G1=tc;function q1(e){const[t,n]=d.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ks="Popper",[nc,Jr]=Yn(ks),[K1,rc]=nc(ks),oc=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return c.jsx(K1,{scope:t,anchor:r,onAnchorChange:o,children:n})};oc.displayName=ks;var sc="PopperAnchor",ic=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=rc(sc,n),i=d.useRef(null),a=ce(t,i),l=d.useRef(null);return d.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ie.div,{...o,ref:a})});ic.displayName=sc;var Ls="PopperContent",[Q1,Y1]=nc(Ls),ac=d.forwardRef((e,t)=>{var $,te,fe,X,ne,J;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...p}=e,v=rc(Ls,n),[y,w]=d.useState(null),C=ce(t,Ce=>w(Ce)),[E,P]=d.useState(null),A=q1(E),R=(A==null?void 0:A.width)??0,N=(A==null?void 0:A.height)??0,k=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},U=Array.isArray(u)?u:[u],W=U.length>0,H={padding:D,boundary:U.filter(X1),altBoundary:W},{refs:z,floatingStyles:oe,placement:G,isPositioned:Y,middlewareData:F}=D1({strategy:"fixed",placement:k,whileElementsMounted:(...Ce)=>T1(...Ce,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[$1({mainAxis:o+N,alignmentAxis:i}),l&&F1({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?B1():void 0,...H}),l&&U1({...H}),W1({...H,apply:({elements:Ce,rects:Le,availableWidth:ot,availableHeight:ze})=>{const{width:Bt,height:To}=Le.reference,ht=Ce.floating.style;ht.setProperty("--radix-popper-available-width",`${ot}px`),ht.setProperty("--radix-popper-available-height",`${ze}px`),ht.setProperty("--radix-popper-anchor-width",`${Bt}px`),ht.setProperty("--radix-popper-anchor-height",`${To}px`)}}),E&&V1({element:E,padding:a}),J1({arrowWidth:R,arrowHeight:N}),m&&H1({strategy:"referenceHidden",...H})]}),[se,ge]=uc(G),ke=qt(x);ve(()=>{Y&&(ke==null||ke())},[Y,ke]);const Mt=($=F.arrow)==null?void 0:$.x,$t=(te=F.arrow)==null?void 0:te.y,rt=((fe=F.arrow)==null?void 0:fe.centerOffset)!==0,[Ft,Ve]=d.useState();return ve(()=>{y&&Ve(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:Y?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ft,"--radix-popper-transform-origin":[(X=F.transformOrigin)==null?void 0:X.x,(ne=F.transformOrigin)==null?void 0:ne.y].join(" "),...((J=F.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Q1,{scope:n,placedSide:se,onArrowChange:P,arrowX:Mt,arrowY:$t,shouldHideArrow:rt,children:c.jsx(ie.div,{"data-side":se,"data-align":ge,...p,ref:C,style:{...p.style,animation:Y?void 0:"none"}})})})});ac.displayName=Ls;var lc="PopperArrow",Z1={top:"bottom",right:"left",bottom:"top",left:"right"},cc=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Y1(lc,r),i=Z1[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(G1,{...o,ref:n,style:{...o.style,display:"block"}})})});cc.displayName=lc;function X1(e){return e!==null}var J1=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=uc(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",p="";return u==="bottom"?(x=i?h:`${m}px`,p=`${-l}px`):u==="top"?(x=i?h:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(x=`${-l}px`,p=i?h:`${g}px`):u==="left"&&(x=`${r.floating.width+l}px`,p=i?h:`${g}px`),{data:{x,y:p}}}});function uc(e){const[t,n="center"]=e.split("-");return[t,n]}var dc=oc,fc=ic,pc=ac,hc=cc,eg="Portal",Ns=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Wt.createPortal(c.jsx(ie.div,{...r,ref:t}),i):null});Ns.displayName=eg;function tg(e){const t=ng(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(og);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ng(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=ig(o),a=sg(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rg=Symbol("radix.slottable");function og(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rg}function sg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ig(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ag=d[" useInsertionEffect ".trim().toString()]||ve;function eo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=lg({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var h;if(a){const m=cg(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else s(f)},[a,e,s,i]);return[l,u]}function lg({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),s=d.useRef(t);return ag(()=>{s.current=t},[t]),d.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function cg(e){return typeof e=="function"}function ug(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dg="VisuallyHidden",gc=d.forwardRef((e,t)=>c.jsx(ie.span,{...e,ref:t,style:{...mc,...e.style}}));gc.displayName=dg;var fg=gc,pg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,to=new WeakMap,no={},Ds=0,vc=function(e){return e&&(e.host||vc(e.parentNode))},hg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vc(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mg=function(e,t,n,r){var o=hg(t,Array.isArray(e)?e:[e]);no[n]||(no[n]=new WeakMap);var s=no[n],i=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",p=(yn.get(m)||0)+1,v=(s.get(m)||0)+1;yn.set(m,p),s.set(m,v),i.push(m),p===1&&x&&to.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Ds++,function(){i.forEach(function(h){var m=yn.get(h)-1,g=s.get(h)-1;yn.set(h,m),s.set(h,g),m||(to.has(h)||h.removeAttribute(r),to.delete(h)),g||h.removeAttribute(n)}),Ds--,Ds||(yn=new WeakMap,yn=new WeakMap,to=new WeakMap,no={})}},yc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=pg(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mg(r,o,n,"aria-hidden")):function(){return null}},ro="right-scroll-bar-position",oo="width-before-scroll-bar",gg="with-scroll-bars-hidden",vg="--removed-body-scroll-bar-size";function Ms(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yg(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bg=typeof window<"u"?d.useLayoutEffect:d.useEffect,bc=new WeakMap;function wg(e,t){var n=yg(null,function(r){return e.forEach(function(o){return Ms(o,r)})});return bg(function(){var r=bc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ms(a,null)}),s.forEach(function(a){o.has(a)||Ms(a,i)})}bc.set(n,e)},[e]),n}function _g(e){return e}function xg(e,t){t===void 0&&(t=_g);var n=[],r=!1,o={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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return o}function Cg(e){e===void 0&&(e={});var t=xg(null);return t.options=Ge({async:!0,ssr:!1},e),t}var wc=function(e){var t=e.sideCar,n=sa(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 d.createElement(r,Ge({},n))};wc.isSideCarExport=!0;function Sg(e,t){return e.useMedium(t),wc}var _c=Cg(),$s=function(){},so=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:$s,onWheelCapture:$s,onTouchMoveCapture:$s}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,E=sa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=m,A=wg([n,t]),R=Ge(Ge({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(P,{sideCar:_c,removeScrollBar:u,shards:h,noRelative:g,noIsolation:x,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:C}),i?d.cloneElement(d.Children.only(a),Ge(Ge({},R),{ref:A})):d.createElement(w,Ge({},R,{className:l,ref:A}),a))});so.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},so.classNames={fullWidth:oo,zeroRight:ro};var Eg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Eg();return t&&e.setAttribute("nonce",t),e}function Pg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ag(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Rg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tg())&&(Pg(t,n),Ag(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Og=function(){var e=Rg();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xc=function(){var e=Og(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ig={left:0,top:0,right:0,gap:0},Fs=function(e){return parseInt(e||"",10)||0},jg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fs(n),Fs(r),Fs(o)]},kg=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ig;var t=jg(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])}},Lg=xc(),bn="data-scroll-locked",Ng=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
209
|
+
`,Pr=16,Up=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:l}=mp(n);return d.createElement("div",{style:{position:"fixed",zIndex:9999,top:Pr,left:Pr,right:Pr,bottom:Pr,pointerEvents:"none",...s},className:i,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(u=>{let f=u.position||t,h=l.calculateOffset(u,{reverseOrder:e,gutter:r,defaultPosition:t}),m=Fp(f,h);return d.createElement($p,{id:u.id,key:u.id,onHeightUpdate:l.updateHeight,className:u.visible?Bp:"",style:m},u.type==="custom"?Cr(u.message,u):o?o(u):d.createElement(Mp,{toast:u,position:f}))}))},xa=Re;const Qo=()=>({notify:S.useCallback((t,n,r)=>{const o={style:{background:"var(--platform-background-primary-color)",color:"var(--platform-text-primary-color)"}};n==="warning"||n==="info"?xa(t,{...o,icon:n==="warning"?"⚠️":"ℹ️"}):xa[n](t,o),r&&console.error(r)},[])});var fn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zt=typeof window>"u"||"Deno"in globalThis;function we(){}function Wp(e,t){return typeof e=="function"?e(t):e}function Yo(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ca(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wt(e,t){return typeof e=="function"?e(t):e}function De(e,t){return typeof e=="function"?e(t):e}function Sa(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Zo(i,t.options))return!1}else if(!Qn(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Ea(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Gt(t.options.mutationKey)!==Gt(s))return!1}else if(!Qn(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Zo(e,t){return((t==null?void 0:t.queryKeyHashFn)||Gt)(e)}function Gt(e){return JSON.stringify(e,(t,n)=>Jo(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Qn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Qn(e[n],t[n])):!1}function Xo(e,t){if(e===t)return e;const n=Ta(e)&&Ta(t);if(n||Jo(e)&&Jo(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{};let l=0;for(let u=0;u<i;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=Xo(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function Ar(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ta(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jo(e){if(!Pa(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Pa(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Pa(e){return Object.prototype.toString.call(e)==="[object Object]"}function Hp(e){return new Promise(t=>{setTimeout(t,e)})}function es(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){try{return Xo(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Xo(e,t)}return t}function Vp(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zp(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Rr=Symbol();function Aa(e,t){return e.queryFn===Rr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Rr?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ra(e,t){return typeof e=="function"?e(...t):!!e}var Gp=(xd=class extends fn{constructor(){super();M(this,nn);M(this,Pt);M(this,Tn);I(this,Tn,t=>{if(!zt&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Pt)||this.setEventListener(_(this,Tn))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Pt))==null||t.call(this),I(this,Pt,void 0))}setEventListener(t){var n;I(this,Tn,t),(n=_(this,Pt))==null||n.call(this),I(this,Pt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,nn)!==t&&(I(this,nn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,nn)=="boolean"?_(this,nn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},nn=new WeakMap,Pt=new WeakMap,Tn=new WeakMap,xd),ts=new Gp,qp=(Cd=class extends fn{constructor(){super();M(this,Pn,!0);M(this,At);M(this,An);I(this,An,t=>{if(!zt&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,At)||this.setEventListener(_(this,An))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,At))==null||t.call(this),I(this,At,void 0))}setEventListener(t){var n;I(this,An,t),(n=_(this,At))==null||n.call(this),I(this,At,t(this.setOnline.bind(this)))}setOnline(t){_(this,Pn)!==t&&(I(this,Pn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Pn)}},Pn=new WeakMap,At=new WeakMap,An=new WeakMap,Cd),Or=new qp;function ns(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Kp(e){return Math.min(1e3*2**e,3e4)}function Oa(e){return(e??"online")==="online"?Or.isOnline():!0}var Ia=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function rs(e){return e instanceof Ia}function ja(e){let t=!1,n=0,r=!1,o;const s=ns(),i=p=>{var v;r||(m(new Ia(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>ts.isFocused()&&(e.networkMode==="always"||Or.isOnline())&&e.canRun(),f=()=>Oa(e.networkMode)&&e.canRun(),h=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),s.resolve(p))},m=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),s.reject(p))},g=()=>new Promise(p=>{var v;o=y=>{(r||u())&&p(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),x=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(h).catch(y=>{var A;if(r)return;const w=e.retry??(zt?0:3),C=e.retryDelay??Kp,E=typeof C=="function"?C(n,y):C,P=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,y);if(t||!P){m(y);return}n++,(A=e.onFail)==null||A.call(e,n,y),Hp(E).then(()=>u()?void 0:g()).then(()=>{t?m(y):x()})})};return{promise:s,cancel:i,continue:()=>(o==null||o(),s),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?x():g().then(x),s)}}var Qp=e=>setTimeout(e,0);function Yp(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Qp;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var me=Yp(),ka=(Sd=class{constructor(){M(this,rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yo(this.gcTime)&&I(this,rn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(zt?1/0:5*60*1e3))}clearGcTimeout(){_(this,rn)&&(clearTimeout(_(this,rn)),I(this,rn,void 0))}},rn=new WeakMap,Sd),Zp=(Ed=class extends ka{constructor(t){super();M(this,We);M(this,Rn);M(this,On);M(this,je);M(this,on);M(this,be);M(this,lr);M(this,sn);I(this,sn,!1),I(this,lr,t.defaultOptions),this.setOptions(t.options),this.observers=[],I(this,on,t.client),I(this,je,_(this,on).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,I(this,Rn,Xp(this.options)),this.state=t.state??_(this,Rn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,be))==null?void 0:t.promise}setOptions(t){this.options={..._(this,lr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,je).remove(this)}setData(t,n){const r=es(this.state.data,t,this.options);return V(this,We,mt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){V(this,We,mt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,be))==null?void 0:r.promise;return(o=_(this,be))==null||o.cancel(t),n?n.then(we).catch(we):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Rn))}isActive(){return this.observers.some(t=>De(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rr||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>wt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ca(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,be))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,be))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,je).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,be)&&(_(this,sn)?_(this,be).cancel({revert:!0}):_(this,be).cancelRetry()),this.scheduleGc()),_(this,je).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||V(this,We,mt).call(this,{type:"invalidate"})}fetch(t,n){var u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,be))return _(this,be).continueRetry(),_(this,be).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(I(this,sn,!0),r.signal)})},s=()=>{const m=Aa(this.options,n),x=(()=>{const p={client:_(this,on),queryKey:this.queryKey,meta:this.meta};return o(p),p})();return I(this,sn,!1),this.options.persister?this.options.persister(m,x,this):m(x)},a=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,on),state:this.state,fetchFn:s};return o(m),m})();(u=this.options.behavior)==null||u.onFetch(a,this),I(this,On,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&V(this,We,mt).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=m=>{var g,x,p,v;rs(m)&&m.silent||V(this,We,mt).call(this,{type:"error",error:m}),rs(m)||((x=(g=_(this,je).config).onError)==null||x.call(g,m,this),(v=(p=_(this,je).config).onSettled)==null||v.call(p,this.state.data,m,this)),this.scheduleGc()};return I(this,be,ja({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{var g,x,p,v;if(m===void 0){console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(y){l(y);return}(x=(g=_(this,je).config).onSuccess)==null||x.call(g,m,this),(v=(p=_(this,je).config).onSettled)==null||v.call(p,m,this.state.error,this),this.scheduleGc()},onError:l,onFail:(m,g)=>{V(this,We,mt).call(this,{type:"failed",failureCount:m,error:g})},onPause:()=>{V(this,We,mt).call(this,{type:"pause"})},onContinue:()=>{V(this,We,mt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),_(this,be).start()}},Rn=new WeakMap,On=new WeakMap,je=new WeakMap,on=new WeakMap,be=new WeakMap,lr=new WeakMap,sn=new WeakMap,We=new WeakSet,mt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...La(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return rs(o)&&o.revert&&_(this,On)?{..._(this,On),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),me.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,je).notify({query:this,type:"updated",action:t})})},Ed);function La(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Oa(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Xp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jp=(Td=class extends fn{constructor(t={}){super();M(this,et);this.config=t,I(this,et,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Zo(o,n);let i=this.get(s);return i||(i=new Zp({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){_(this,et).has(t.queryHash)||(_(this,et).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,et).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,et).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,et).get(t)}getAll(){return[..._(this,et).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Sa(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Sa(t,r)):n}notify(t){me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){me.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){me.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},et=new WeakMap,Td),eh=(Pd=class extends ka{constructor(t){super();M(this,nt);M(this,tt);M(this,_e);M(this,an);this.mutationId=t.mutationId,I(this,_e,t.mutationCache),I(this,tt,[]),this.state=t.state||Na(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,tt).includes(t)||(_(this,tt).push(t),this.clearGcTimeout(),_(this,_e).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){I(this,tt,_(this,tt).filter(n=>n!==t)),this.scheduleGc(),_(this,_e).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,tt).length||(this.state.status==="pending"?this.scheduleGc():_(this,_e).remove(this))}continue(){var t;return((t=_(this,an))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,l,u,f,h,m,g,x,p,v,y,w,C,E,P,A,R,N;const n=()=>{V(this,nt,Ut).call(this,{type:"continue"})};I(this,an,ja({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,D)=>{V(this,nt,Ut).call(this,{type:"failed",failureCount:k,error:D})},onPause:()=>{V(this,nt,Ut).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,_e).canRun(this)}));const r=this.state.status==="pending",o=!_(this,an).canStart();try{if(r)n();else{V(this,nt,Ut).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=_(this,_e).config).onMutate)==null?void 0:i.call(s,t,this));const D=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));D!==this.state.context&&V(this,nt,Ut).call(this,{type:"pending",context:D,variables:t,isPaused:o})}const k=await _(this,an).start();return await((f=(u=_(this,_e).config).onSuccess)==null?void 0:f.call(u,k,t,this.state.context,this)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,k,t,this.state.context)),await((x=(g=_(this,_e).config).onSettled)==null?void 0:x.call(g,k,null,this.state.variables,this.state.context,this)),await((v=(p=this.options).onSettled)==null?void 0:v.call(p,k,null,t,this.state.context)),V(this,nt,Ut).call(this,{type:"success",data:k}),k}catch(k){try{throw await((w=(y=_(this,_e).config).onError)==null?void 0:w.call(y,k,t,this.state.context,this)),await((E=(C=this.options).onError)==null?void 0:E.call(C,k,t,this.state.context)),await((A=(P=_(this,_e).config).onSettled)==null?void 0:A.call(P,void 0,k,this.state.variables,this.state.context,this)),await((N=(R=this.options).onSettled)==null?void 0:N.call(R,void 0,k,t,this.state.context)),k}finally{V(this,nt,Ut).call(this,{type:"error",error:k})}}finally{_(this,_e).runNext(this)}}},tt=new WeakMap,_e=new WeakMap,an=new WeakMap,nt=new WeakSet,Ut=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),me.batch(()=>{_(this,tt).forEach(r=>{r.onMutationUpdate(t)}),_(this,_e).notify({mutation:this,type:"updated",action:t})})},Pd);function Na(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var th=(Ad=class extends fn{constructor(t={}){super();M(this,dt);M(this,He);M(this,cr);this.config=t,I(this,dt,new Set),I(this,He,new Map),I(this,cr,0)}build(t,n,r){const o=new eh({mutationCache:this,mutationId:++Po(this,cr)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){_(this,dt).add(t);const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n);r?r.push(t):_(this,He).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(_(this,dt).delete(t)){const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&_(this,He).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Ir(t);if(typeof n=="string"){const r=_(this,He).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Ir(t);if(typeof n=="string"){const o=(r=_(this,He).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){me.batch(()=>{_(this,dt).forEach(t=>{this.notify({type:"removed",mutation:t})}),_(this,dt).clear(),_(this,He).clear()})}getAll(){return Array.from(_(this,dt))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ea(n,r))}findAll(t={}){return this.getAll().filter(n=>Ea(t,n))}notify(t){me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return me.batch(()=>Promise.all(t.map(n=>n.continue().catch(we))))}},dt=new WeakMap,He=new WeakMap,cr=new WeakMap,Ad);function Ir(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Da(e){return{onFetch:(t,n)=>{var f,h,m,g,x;const r=t.options,o=(m=(h=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:h.fetchMore)==null?void 0:m.direction,s=((g=t.state.data)==null?void 0:g.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let p=!1;const v=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},y=Aa(t.options,t.fetchOptions),w=async(C,E,P)=>{if(p)return Promise.reject();if(E==null&&C.pages.length)return Promise.resolve(C);const R=(()=>{const U={client:t.client,queryKey:t.queryKey,pageParam:E,direction:P?"backward":"forward",meta:t.options.meta};return v(U),U})(),N=await y(R),{maxPages:k}=t.options,D=P?zp:Vp;return{pages:D(C.pages,N,k),pageParams:D(C.pageParams,E,k)}};if(o&&s.length){const C=o==="backward",E=C?nh:Ma,P={pages:s,pageParams:i},A=E(r,P);a=await w(P,A,C)}else{const C=e??s.length;do{const E=l===0?i[0]??r.initialPageParam:Ma(r,a);if(l>0&&E==null)break;a=await w(a,E),l++}while(l<C)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Ma(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function nh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var rh=(Rd=class{constructor(e={}){M(this,ue);M(this,Rt);M(this,Ot);M(this,In);M(this,jn);M(this,It);M(this,kn);M(this,Ln);I(this,ue,e.queryCache||new Jp),I(this,Rt,e.mutationCache||new th),I(this,Ot,e.defaultOptions||{}),I(this,In,new Map),I(this,jn,new Map),I(this,It,0)}mount(){Po(this,It)._++,_(this,It)===1&&(I(this,kn,ts.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ue).onFocus())})),I(this,Ln,Or.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ue).onOnline())})))}unmount(){var e,t;Po(this,It)._--,_(this,It)===0&&((e=_(this,kn))==null||e.call(this),I(this,kn,void 0),(t=_(this,Ln))==null||t.call(this),I(this,Ln,void 0))}isFetching(e){return _(this,ue).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Rt).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ue).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=_(this,ue).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return _(this,ue).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,ue).get(r.queryHash),s=o==null?void 0:o.state.data,i=Wp(t,s);if(i!==void 0)return _(this,ue).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return me.batch(()=>_(this,ue).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,ue).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,ue);me.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,ue);return me.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=me.batch(()=>_(this,ue).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(we).catch(we)}invalidateQueries(e,t={}){return me.batch(()=>(_(this,ue).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=me.batch(()=>_(this,ue).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(we)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(we)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,ue).build(this,t);return n.isStaleByTime(wt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(we).catch(we)}fetchInfiniteQuery(e){return e.behavior=Da(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(we).catch(we)}ensureInfiniteQueryData(e){return e.behavior=Da(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Or.isOnline()?_(this,Rt).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ue)}getMutationCache(){return _(this,Rt)}getDefaultOptions(){return _(this,Ot)}setDefaultOptions(e){I(this,Ot,e)}setQueryDefaults(e,t){_(this,In).set(Gt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,In).values()],n={};return t.forEach(r=>{Qn(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,jn).set(Gt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,jn).values()],n={};return t.forEach(r=>{Qn(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Ot).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Rr&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Ot).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ue).clear(),_(this,Rt).clear()}},ue=new WeakMap,Rt=new WeakMap,Ot=new WeakMap,In=new WeakMap,jn=new WeakMap,It=new WeakMap,kn=new WeakMap,Ln=new WeakMap,Rd),oh=(Od=class extends fn{constructor(t,n){super();M(this,ee);M(this,Te);M(this,K);M(this,ur);M(this,xe);M(this,ln);M(this,Nn);M(this,jt);M(this,kt);M(this,dr);M(this,Dn);M(this,Mn);M(this,cn);M(this,un);M(this,Lt);M(this,$n,new Set);this.options=n,I(this,Te,t),I(this,kt,null),I(this,jt,ns()),this.options.experimental_prefetchInRender||_(this,jt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,K).addObserver(this),$a(_(this,K),this.options)?V(this,ee,fr).call(this):this.updateResult(),V(this,ee,Ei).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return os(_(this,K),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return os(_(this,K),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,V(this,ee,Ti).call(this),V(this,ee,Pi).call(this),_(this,K).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,K);if(this.options=_(this,Te).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof De(this.options.enabled,_(this,K))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");V(this,ee,Ai).call(this),_(this,K).setOptions(this.options),n._defaulted&&!Ar(this.options,n)&&_(this,Te).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,K),observer:this});const o=this.hasListeners();o&&Fa(_(this,K),r,this.options,n)&&V(this,ee,fr).call(this),this.updateResult(),o&&(_(this,K)!==r||De(this.options.enabled,_(this,K))!==De(n.enabled,_(this,K))||wt(this.options.staleTime,_(this,K))!==wt(n.staleTime,_(this,K)))&&V(this,ee,xi).call(this);const s=V(this,ee,Ci).call(this);o&&(_(this,K)!==r||De(this.options.enabled,_(this,K))!==De(n.enabled,_(this,K))||s!==_(this,Lt))&&V(this,ee,Si).call(this,s)}getOptimisticResult(t){const n=_(this,Te).getQueryCache().build(_(this,Te),t),r=this.createResult(n,t);return ih(this,r)&&(I(this,xe,r),I(this,Nn,this.options),I(this,ln,_(this,K).state)),r}getCurrentResult(){return _(this,xe)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){_(this,$n).add(t)}getCurrentQuery(){return _(this,K)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Te).defaultQueryOptions(t),r=_(this,Te).getQueryCache().build(_(this,Te),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return V(this,ee,fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,xe)))}createResult(t,n){var k;const r=_(this,K),o=this.options,s=_(this,xe),i=_(this,ln),a=_(this,Nn),u=t!==r?t.state:_(this,ur),{state:f}=t;let h={...f},m=!1,g;if(n._optimisticResults){const D=this.hasListeners(),U=!D&&$a(t,n),W=D&&Fa(t,r,n,o);(U||W)&&(h={...h,...La(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:p,status:v}=h;g=h.data;let y=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let D;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(D=s.data,y=!0):D=typeof n.placeholderData=="function"?n.placeholderData((k=_(this,Mn))==null?void 0:k.state.data,_(this,Mn)):n.placeholderData,D!==void 0&&(v="success",g=es(s==null?void 0:s.data,D,n),m=!0)}if(n.select&&g!==void 0&&!y)if(s&&g===(i==null?void 0:i.data)&&n.select===_(this,dr))g=_(this,Dn);else try{I(this,dr,n.select),g=n.select(g),g=es(s==null?void 0:s.data,g,n),I(this,Dn,g),I(this,kt,null)}catch(D){I(this,kt,D)}_(this,kt)&&(x=_(this,kt),g=_(this,Dn),p=Date.now(),v="error");const w=h.fetchStatus==="fetching",C=v==="pending",E=v==="error",P=C&&w,A=g!==void 0,N={status:v,fetchStatus:h.fetchStatus,isPending:C,isSuccess:v==="success",isError:E,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:E&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:E&&A,isStale:ss(t,n),refetch:this.refetch,promise:_(this,jt)};if(this.options.experimental_prefetchInRender){const D=H=>{N.status==="error"?H.reject(N.error):N.data!==void 0&&H.resolve(N.data)},U=()=>{const H=I(this,jt,N.promise=ns());D(H)},W=_(this,jt);switch(W.status){case"pending":t.queryHash===r.queryHash&&D(W);break;case"fulfilled":(N.status==="error"||N.data!==W.value)&&U();break;case"rejected":(N.status!=="error"||N.error!==W.reason)&&U();break}}return N}updateResult(){const t=_(this,xe),n=this.createResult(_(this,K),this.options);if(I(this,ln,_(this,K).state),I(this,Nn,this.options),_(this,ln).data!==void 0&&I(this,Mn,_(this,K)),Ar(n,t))return;I(this,xe,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!_(this,$n).size)return!0;const i=new Set(s??_(this,$n));return this.options.throwOnError&&i.add("error"),Object.keys(_(this,xe)).some(a=>{const l=a;return _(this,xe)[l]!==t[l]&&i.has(l)})};V(this,ee,zd).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&V(this,ee,Ei).call(this)}},Te=new WeakMap,K=new WeakMap,ur=new WeakMap,xe=new WeakMap,ln=new WeakMap,Nn=new WeakMap,jt=new WeakMap,kt=new WeakMap,dr=new WeakMap,Dn=new WeakMap,Mn=new WeakMap,cn=new WeakMap,un=new WeakMap,Lt=new WeakMap,$n=new WeakMap,ee=new WeakSet,fr=function(t){V(this,ee,Ai).call(this);let n=_(this,K).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(we)),n},xi=function(){V(this,ee,Ti).call(this);const t=wt(this.options.staleTime,_(this,K));if(zt||_(this,xe).isStale||!Yo(t))return;const r=Ca(_(this,xe).dataUpdatedAt,t)+1;I(this,cn,setTimeout(()=>{_(this,xe).isStale||this.updateResult()},r))},Ci=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,K)):this.options.refetchInterval)??!1},Si=function(t){V(this,ee,Pi).call(this),I(this,Lt,t),!(zt||De(this.options.enabled,_(this,K))===!1||!Yo(_(this,Lt))||_(this,Lt)===0)&&I(this,un,setInterval(()=>{(this.options.refetchIntervalInBackground||ts.isFocused())&&V(this,ee,fr).call(this)},_(this,Lt)))},Ei=function(){V(this,ee,xi).call(this),V(this,ee,Si).call(this,V(this,ee,Ci).call(this))},Ti=function(){_(this,cn)&&(clearTimeout(_(this,cn)),I(this,cn,void 0))},Pi=function(){_(this,un)&&(clearInterval(_(this,un)),I(this,un,void 0))},Ai=function(){const t=_(this,Te).getQueryCache().build(_(this,Te),this.options);if(t===_(this,K))return;const n=_(this,K);I(this,K,t),I(this,ur,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zd=function(t){me.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,xe))}),_(this,Te).getQueryCache().notify({query:_(this,K),type:"observerResultsUpdated"})})},Od);function sh(e,t){return De(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function $a(e,t){return sh(e,t)||e.state.data!==void 0&&os(e,t,t.refetchOnMount)}function os(e,t,n){if(De(t.enabled,e)!==!1&&wt(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ss(e,t)}return!1}function Fa(e,t,n,r){return(e!==t||De(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ss(e,n)}function ss(e,t){return De(t.enabled,e)!==!1&&e.isStaleByTime(wt(t.staleTime,e))}function ih(e,t){return!Ar(e.getCurrentResult(),t)}var ah=(Id=class extends fn{constructor(n,r){super();M(this,pt);M(this,Nt);M(this,Dt);M(this,Pe);M(this,ft);I(this,Nt,n),this.setOptions(r),this.bindMethods(),V(this,pt,Ao).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=_(this,Nt).defaultMutationOptions(n),Ar(this.options,r)||_(this,Nt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Pe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Gt(r.mutationKey)!==Gt(this.options.mutationKey)?this.reset():((o=_(this,Pe))==null?void 0:o.state.status)==="pending"&&_(this,Pe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Pe))==null||n.removeObserver(this)}onMutationUpdate(n){V(this,pt,Ao).call(this),V(this,pt,Ri).call(this,n)}getCurrentResult(){return _(this,Dt)}reset(){var n;(n=_(this,Pe))==null||n.removeObserver(this),I(this,Pe,void 0),V(this,pt,Ao).call(this),V(this,pt,Ri).call(this)}mutate(n,r){var o;return I(this,ft,r),(o=_(this,Pe))==null||o.removeObserver(this),I(this,Pe,_(this,Nt).getMutationCache().build(_(this,Nt),this.options)),_(this,Pe).addObserver(this),_(this,Pe).execute(n)}},Nt=new WeakMap,Dt=new WeakMap,Pe=new WeakMap,ft=new WeakMap,pt=new WeakSet,Ao=function(){var r;const n=((r=_(this,Pe))==null?void 0:r.state)??Na();I(this,Dt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ri=function(n){me.batch(()=>{var r,o,s,i,a,l,u,f;if(_(this,ft)&&this.hasListeners()){const h=_(this,Dt).variables,m=_(this,Dt).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,ft)).onSuccess)==null||o.call(r,n.data,h,m),(i=(s=_(this,ft)).onSettled)==null||i.call(s,n.data,null,h,m)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,ft)).onError)==null||l.call(a,n.error,h,m),(f=(u=_(this,ft)).onSettled)==null||f.call(u,void 0,n.error,h,m))}this.listeners.forEach(h=>{h(_(this,Dt))})})},Id),Ba=d.createContext(void 0),is=e=>{const t=d.useContext(Ba);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lh=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Ba.Provider,{value:e,children:t})),Ua=d.createContext(!1),ch=()=>d.useContext(Ua);Ua.Provider;function uh(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dh=d.createContext(uh()),fh=()=>d.useContext(dh),ph=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hh=e=>{d.useEffect(()=>{e.clearReset()},[e])},mh=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Ra(n,[e.error,r])),gh=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},vh=(e,t)=>e.isLoading&&e.isFetching&&!t,yh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Wa=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bh(e,t,n){var h,m,g,x,p;if(typeof e!="object"||Array.isArray(e))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=ch(),o=fh(),s=is(),i=s.defaultQueryOptions(e);(m=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,i),i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),i._optimisticResults=r?"isRestoring":"optimistic",gh(i),ph(i,o),hh(o);const a=!s.getQueryCache().get(i.queryHash),[l]=d.useState(()=>new t(s,i)),u=l.getOptimisticResult(i),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(v=>{const y=f?l.subscribe(me.batchCalls(v)):we;return l.updateResult(),y},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(i)},[i,l]),yh(i,u))throw Wa(i,l,o);if(mh({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((x=(g=s.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||x.call(g,i,u),i.experimental_prefetchInRender&&!zt&&vh(u,r)){const v=a?Wa(i,l,o):(p=s.getQueryCache().get(i.queryHash))==null?void 0:p.promise;v==null||v.catch(we).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function Ha(e,t){return bh(e,oh)}function jr(e,t){const n=is(),[r]=d.useState(()=>new ah(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const o=d.useSyncExternalStore(d.useCallback(i=>r.subscribe(me.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=d.useCallback((i,a)=>{r.mutate(i,a).catch(we)},[r]);if(o.error&&Ra(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const kr={STALE_TIME:1e3*60*5,GC_TIME:1e3*60*10,RETRY_COUNT:1,RETRY_DELAY:1e3},Va={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:kr.STALE_TIME,gcTime:kr.GC_TIME,retry:kr.RETRY_COUNT,retryDelay:kr.RETRY_DELAY,enable:!0},Lr=e=>e instanceof Error?e.message:String(e),za=(e,t,n)=>{const r=is(),{notify:o}=Qo(),{createFn:s,readFn:i,readByIdFn:a,updateFn:l,deleteFn:u,partialUpdateFn:f}=n,h=()=>{r.invalidateQueries({queryKey:[e]})},m=(E,P,A,R)=>o(R!=null&&R.overrideSuccessMessage?R==null?void 0:R.overrideSuccessMessage(E,P):A,"success"),g=(E,P,A,R)=>o(R!=null&&R.overrideErrorMessage?R==null?void 0:R.overrideErrorMessage(E,P):A,"error");return{useCreate:E=>jr({mutationFn:P=>s(P),onSuccess:P=>{h(),m(t,P,`${t} created successfully`,E)},onError:P=>{g(t,P,`Error creating ${t}: ${Lr(P)}`,E)}}),useReadQuery:E=>Ha({queryKey:[e],queryFn:i,...Va,...E}),useReadByIdQuery:(E,P)=>Ha({queryKey:[e,E],queryFn:()=>a(E),...Va,enabled:!!E,...P}),useUpdate:E=>jr({mutationFn:({id:P,data:A})=>l(P,A),onSuccess:P=>{h(),m(t,P,`${t} updated successfully`,E)},onError:P=>{g(t,P,`Error updating ${t}: ${Lr(P)}`,E)}}),usePartialUpdate:E=>f&&jr({mutationFn:({id:P,data:A})=>f(P,A),onSuccess:P=>{h(),m(t,P,`${t} updated successfully`,E)},onError:P=>{g(t,P,`Error updating ${t}: ${Lr(P)}`,E)}}),useDelete:E=>jr({mutationFn:P=>u(P),onSuccess:()=>{h(),m(t,null,`${t} deleted successfully`,E)},onError:P=>{g(t,P,`Error deleting ${t}: ${Lr(P)}`,E)}}),invalidateQueries:h}},wh=(e,t)=>za(e,t,{createFn:n=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(r=>r.json()),deleteFn:n=>fetch(`${e}/${n}`,{method:"DELETE"}).then(r=>{if(!r.ok)throw new Error(`Error deleting: ${r.status}`)}),readByIdFn:n=>fetch(`${e}/${n}`).then(r=>r.json()),readFn:()=>fetch(e).then(n=>n.json()),updateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json()),partialUpdateFn:(n,r)=>fetch(`${e}/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then(o=>o.json())}),_h={SINGLE_TENANT:"single-tenant"},xh={COOKIE:"cookie"},as="tenant",Ga="tenant",qa="tenant",Ch=_h.SINGLE_TENANT,Sh=xh.COOKIE,Eh={mode:Ch,clientSideMode:Sh,tenantIDPProvisioningStrategy:"none"};class Th{setTenant(t,n){const r=new URL(window.location.href);r.searchParams.set(Ga,t.name),window.location.href=r.toString()}getCurrentTenantName(){const t=new URL(window.location.href);return new URLSearchParams(t.search).get(Ga)}}class Ph{setTenant(t,n){sessionStorage.setItem(qa,t.name),window.location.reload()}getCurrentTenantName(){return sessionStorage.getItem(qa)}}/*! js-cookie v3.0.5 | MIT */function Nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Ah={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ls(e,t){function n(o,s,i){if(!(typeof document>"u")){i=Nr({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in i)i[l]&&(a+="; "+l,i[l]!==!0&&(a+="="+i[l].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+a}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],i={},a=0;a<s.length;a++){var l=s[a].split("="),u=l.slice(1).join("=");try{var f=decodeURIComponent(l[0]);if(i[f]=e.read(u,f),o===f)break}catch{}}return o?i[o]:i}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",Nr({},s,{expires:-1}))},withAttributes:function(o){return ls(this.converter,Nr({},this.attributes,o))},withConverter:function(o){return ls(Nr({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var cs=ls(Ah,{path:"/"});class Rh{setTenant(t,n){t?cs.set(as,t.name):cs.remove(as),window.location.reload()}getCurrentTenantName(){return cs.get(as)}}class Oh{extractSubdomain(t){if(t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t))return"";const n=t.split(".");if(n.length<2||n.length===2||n[0]==="www"&&n.length===3)return"";const o=(n[0]==="www"?n.slice(1):n).slice(0,-2);return o.length>0?o.join("."):""}getBaseDomain(t){const n=t.split(".");return t==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(t)||n.length<=2?t:n.slice(-2).join(".")}setTenant(t,n){var u;const r=(u=n.urlPatterns)==null?void 0:u.find(f=>f.patternType==="subdomain"&&f.tenantId===t.id&&f.isActive);if(!r)throw new Error(`No active subdomain pattern found for tenant '${t.name}'`);const o=new URL(window.location.href),s=r.patternValue,i=o.hostname,a=this.getBaseDomain(i),l=s?`${s}.${a}`:a;o.hostname=l,window.location.href=o.toString()}getCurrentTenantName(){const t=window.location.hostname;return this.extractSubdomain(t)||null}}const Ka={queryParams:new Th,sessionStorage:new Ph,cookie:new Rh,subdomain:new Oh},Ih=e=>{const t=Ka[e.clientSideMode];if(!t)throw new Error(`Client side tenant mode '${e.clientSideMode}' is not supported ${JSON.stringify({strategies:Ka},null,2)}`);return t},jh=(e,t,n)=>{const r=t.find(s=>s.name===n);if(!r)throw Error("No tenant permission");return Ih(e).setTenant(r,e),r},kh=()=>{const[e,t]=Wn(),{tenants:n=[],currentTenant:r,tenantConfig:o=Eh}=e,s=S.useCallback(i=>{const a=jh(o,n,i);t({...e,currentTenant:a})},[o,e]);return{tenants:n,currentTenant:r,tenantConfig:o,selectTenant:s}};function Lh(e){if(!e.ok)throw console.error(e),new Error(e.statusText)}async function Dr(e,t,n,r){const o=await e(`/user-states/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,r);return Lh(o),o}class Mr{static async get(t,n,r){const s=await Dr(t,n,r,{method:"GET",headers:{"Content-Type":"application/json"}});return s.status===204?null:await s.json()}static async create(t,n,r,o){const s={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Dr(t,n,r,s)).json()}static async update(t,n,r,o){const s={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:o})};return await(await Dr(t,n,r,s)).json()}static async delete(t,n,r){return await Dr(t,n,r,{method:"DELETE",headers:{"Content-Type":"application/json"}}),null}}const Nh=e=>{const t=$o("@bluealba/pae-nestjs-gateway-service"),n=Zi();if(!n)throw new Error("You must call the useUserState hook within a PAE application.");const[r,o]=S.useState(null),[s,i]=S.useState(!1),[a,l]=S.useState(!1),[u,f]=S.useState(null),h=(w,C)=>S.useCallback(async({newValue:E,shouldThrowError:P}={})=>{try{l(!0),f(null);const A=await w(t,n,e,E);return o(A),A?A.value:null}catch(A){if(f(A==null?void 0:A.message),console.error(`Failed to ${C} ${e}:`,A),P)throw A;return null}finally{l(!1)}},[t,n,e]),m=h(Mr.get,"fetch"),g=h(Mr.create,"create"),x=h(Mr.update,"update"),p=h(Mr.delete,"delete"),v=S.useCallback(async()=>{try{await m()}finally{i(!0)}},[m]);S.useEffect(()=>{v()},[v]);const y=S.useCallback(async(w,C=!1)=>r==null?await g({newValue:w,shouldThrowError:C}):await x({newValue:w,shouldThrowError:C}),[r,g,x]);return{value:r?r.value:null,hasFetched:s,loading:a,error:u,setValue:y,createValue:g,updateValue:x,deleteValue:p}},Qa="__PAE_EXTENSION_POINT_REACT_CONTENT_EMPTY__",Dh=({module:e,point:t,children:n})=>(ta(e,t,n??Qa),null),Ya=({name:e,children:t,...n})=>{const r=ea(e);if(r===Qa)return null;if(!r)return c.jsx(c.Fragment,{children:t??null});if(Mh(r)){const o=r;return c.jsx(o,{...n})}else return r},Mh=e=>typeof e=="function",$h=(e,t)=>{const n=r=>(t=t||e.displayName||e.name||"?",c.jsx(Ya,{name:t,...r,children:c.jsx(e,{...r})}));return n.displayName=`extensionPoint(${t})`,n},Za="single-spa:app-change";function Fh(){const[e,t]=S.useState(Xa());return S.useEffect(()=>{const n=()=>{t(Xa())};return window.addEventListener(Za,n),()=>{window.removeEventListener(Za,n)}},[]),e}function Xa(){return he.getAppNames().reduce((t,n)=>(he.getAppStatus(n)?t[n]=he.getAppStatus(n):t[n]="NOT_LOADED",t),{})}function Bh(e){const n=Fh()[e]??"LOAD_ERROR";return{statusName:n,isLoading:n==="LOADING_SOURCE_CODE"||n==="BOOTSTRAPPING"||n==="MOUNTING",isMounted:n==="MOUNTED",isBroken:n==="SKIP_BECAUSE_BROKEN"||n==="LOAD_ERROR"}}const Ja=({appName:e})=>c.jsx("div",{children:c.jsxs("p",{children:["Loading ",e,"..."]})});Ja.displayName="BaseLoading";const el=({appName:e})=>c.jsxs("div",{children:[c.jsx("p",{children:"Something went wrong..."}),c.jsxs("p",{children:["Failed to load ",e]})]});el.displayName="BaseError";const Uh={display:"flex",flexDirection:"column",flex:1},tl=S.forwardRef((e,t)=>c.jsx("div",{ref:t,style:Uh,...e}));tl.displayName="BaseContainer";const Wh="pae-app:",nl=S.forwardRef(({appName:e,LoadingComponent:t=Ja,ErrorComponent:n=el,ContainerComponent:r=tl,...o},s)=>{const i=Bh(e);return c.jsxs(r,{ref:s,...o,id:`${Wh}${e}`,children:[i.isLoading&&c.jsx(t,{appName:e}),i.isBroken&&c.jsx(n,{appName:e})]})});nl.displayName="ModulePlaceHolder";const us=({operations:e,children:t,forbiddenContent:n})=>{var o;const{hasAccess:r}=Gn();if(!r(...e)){if(!n)return null;if(typeof n=="function")if((o=n==null?void 0:n.prototype)!=null&&o.isReactComponent){const s=n;return c.jsx(s,{operations:e})}else return n({operations:e});return S.isValidElement(n)?n:null}return t};us.displayName="Authorized";const Hh=({eventName:e,listener:t})=>(na(e,t),null),Vh=()=>c.jsx("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",children:c.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",d:"M8.737 8.737a21.49 21.49 0 0 1 3.308-2.724m0 0c3.063-2.026 5.99-2.641 7.331-1.3 1.827 1.828.026 6.591-4.023 10.64-4.049 4.049-8.812 5.85-10.64 4.023-1.33-1.33-.736-4.218 1.249-7.253m6.083-6.11c-3.063-2.026-5.99-2.641-7.331-1.3-1.827 1.828-.026 6.591 4.023 10.64m3.308-9.34a21.497 21.497 0 0 1 3.308 2.724m2.775 3.386c1.985 3.035 2.579 5.923 1.248 7.253-1.336 1.337-4.245.732-7.295-1.275M14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})}),rl=({applicationName:e})=>{const t=Ki(e);if(t)if(typeof t=="function"){const n=t;return c.jsx(n,{})}else return t;return c.jsx(Vh,{})};rl.displayName="ApplicationIcon";const ol=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});ol.displayName="DarkModeIcon";const sl=()=>c.jsx("svg",{width:"28",height:"28",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:"matrix(-1,1.2246467991473532e-16,-1.2246467991473532e-16,-1,0,0)",children:c.jsx("path",{d:"M15.9998 29.3337C8.63584 29.3337 2.6665 23.3643 2.6665 16.0003C2.6665 8.63633 8.63584 2.66699 15.9998 2.66699C23.3638 2.66699 29.3332 8.63633 29.3332 16.0003C29.3332 23.3643 23.3638 29.3337 15.9998 29.3337ZM15.9998 26.667C18.8288 26.667 21.5419 25.5432 23.5423 23.5428C25.5427 21.5424 26.6665 18.8293 26.6665 16.0003C26.6665 13.1713 25.5427 10.4582 23.5423 8.45785C21.5419 6.45747 18.8288 5.33366 15.9998 5.33366C13.1709 5.33366 10.4578 6.45747 8.45736 8.45785C6.45698 10.4582 5.33317 13.1713 5.33317 16.0003C5.33317 18.8293 6.45698 21.5424 8.45736 23.5428C10.4578 25.5432 13.1709 26.667 15.9998 26.667ZM9.33317 20.427C12.2066 20.2205 14.9088 18.9833 16.9425 16.943C18.9828 14.9092 20.2201 12.2071 20.4265 9.33366C21.4117 9.99003 22.2389 10.8569 22.8486 11.8716C23.4582 12.8864 23.835 14.0239 23.9519 15.2019C24.0687 16.3799 23.9226 17.5692 23.5242 18.684C23.1257 19.7987 22.4849 20.8112 21.6478 21.6483C20.8107 22.4853 19.7982 23.1262 18.6835 23.5247C17.5687 23.9231 16.3795 24.0692 15.2014 23.9523C14.0234 23.8355 12.8859 23.4587 11.8712 22.8491C10.8564 22.2394 9.98954 21.4122 9.33317 20.427Z",fill:"currentColor"})});sl.displayName="LightModeIcon";const ds={container:"container__zBqbk",expanded:"expanded__EbsIr",label:"label__cdMnm"};function il(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=il(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function L(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=il(e))&&(r&&(r+=" "),r+=t);return r}const zh=e=>e.toLowerCase().trim().split(" ").join("-"),Gh=e=>`${zh(e)}-theme`,al=()=>{const{platformName:e="Platform"}=ko(),t=Gh(e),[n,r]=S.useState(()=>{const s=localStorage.getItem(t);return s==="light"||s==="dark"?s:"light"}),o=s=>{localStorage.setItem(t,s),r(s)};return S.useEffect(()=>{document.documentElement.setAttribute("data-theme",n)},[n]),{theme:n,setTheme:o}},$r={spinner:"spinner__fakUN","spinner-rotation":"spinner-rotation__wUmPV",spinnerRotation:"spinner-rotation__wUmPV",button:"button__8FA9H","button--contained-primary":"button--contained-primary__stkTx",buttonContainedPrimary:"button--contained-primary__stkTx","button--outlined-primary":"button--outlined-primary__KZ1ww",buttonOutlinedPrimary:"button--outlined-primary__KZ1ww","button--text-primary":"button--text-primary__GLTfm",buttonTextPrimary:"button--text-primary__GLTfm","button--contained-danger":"button--contained-danger__L9ehT",buttonContainedDanger:"button--contained-danger__L9ehT","button--outlined-danger":"button--outlined-danger__eoYLd",buttonOutlinedDanger:"button--outlined-danger__eoYLd","button--text-danger":"button--text-danger__Sw-ha",buttonTextDanger:"button--text-danger__Sw-ha",icon:"icon__--umH"},Fr=S.forwardRef(({variant:e="contained",colorScheme:t="primary",loading:n=!1,IconComponent:r,className:o,children:s,...i},a)=>{const l=L($r.button,$r[`button--${e}-${t}`],o);return c.jsxs("button",{ref:a,className:l,...i,children:[n?c.jsx("div",{className:$r.spinner}):r&&c.jsx(r,{className:$r.icon}),s]})});Fr.displayName="Button";const Br={Badges:"Badges__5jpum",badges:"Badges__5jpum",Badge:"Badge__95MWM",badge:"Badge__95MWM","Badge--primary":"Badge--primary__Rx-bS",badgePrimary:"Badge--primary__Rx-bS","Badge--secondary":"Badge--secondary__d92bT",badgeSecondary:"Badge--secondary__d92bT","Badge--success":"Badge--success__Kdo98",badgeSuccess:"Badge--success__Kdo98","Badge--warning":"Badge--warning__bf-Nn",badgeWarning:"Badge--warning__bf-Nn","Badge--danger":"Badge--danger__HTj39",badgeDanger:"Badge--danger__HTj39","Badge--small":"Badge--small__y93Pj",badgeSmall:"Badge--small__y93Pj","Badge--regular":"Badge--regular__aT5AL",badgeRegular:"Badge--regular__aT5AL","Badge--large":"Badge--large__wORCH",badgeLarge:"Badge--large__wORCH"},fs={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in fs)Object.freeze(fs[e]);const ll=Object.freeze(fs);var cl={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function qh(e){var f,h;var t,n=[],r=1,o;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),ll[e])n=ll[e].slice(),o="rgb";else if(e==="transparent")r=0,o="rgb",n=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),i=s.length,a=i<=4;r=1,a?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],i===4&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],i===8&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),o="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];o=l.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=n.shift()),n=n.map(function(m,g){if(m[m.length-1]==="%")return m=parseFloat(m)/100,g===3?m:o==="rgb"?m*255:o[0]==="h"||o[0]==="l"&&!g?m*100:o==="lab"?m*125:o==="lch"?g<2?m*150:m*360:o[0]==="o"&&!g?m:o==="oklab"?m*.4:o==="oklch"?g<2?m*.4:m*360:m;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(cl[m]!==void 0)return cl[m];if(m.endsWith("deg"))return parseFloat(m);if(m.endsWith("turn"))return parseFloat(m)*360;if(m.endsWith("grad"))return parseFloat(m)*360/400;if(m.endsWith("rad"))return parseFloat(m)*180/Math.PI}return m==="none"?0:parseFloat(m)}),r=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(n=e.match(/([0-9]+)/g).map(function(m){return parseFloat(m)}),o=((h=(f=e.match(/([a-z])/ig))==null?void 0:f.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:o,values:n,alpha:r}}const Kh=(e,t)=>{const{space:n,values:r}=qh(e);return n[0]==="h"?`${n}a(${r[0]}, ${r[1]}%, ${r[2]}%, ${t})`:`${n}a(${r}, ${t})`},ps=S.forwardRef(({children:e,color:t,className:n,customColor:r,size:o="small",style:s,...i},a)=>{const l=r?{color:r,background:Kh(r,.1)}:{},u=L(Br.Badge,Br[`Badge--${o}`],{[Br[`Badge--${t}`]]:!!t},n);return c.jsx("span",{ref:a,className:u,style:{...s,...l},...i,children:e})});ps.displayName="Badge";const hs=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(Br.Badges,t);return c.jsx("div",{ref:r,className:o,...n,children:e})});hs.displayName="Badges";const ul=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"})]}),dl=({size:e=24,color:t="currentColor",strokeWidth:n=2,className:r,style:o,...s})=>c.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round",className:r,style:o,...s,children:[c.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"}),c.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),c.jsx("path",{d:"m9 12 2 2 4-4"})]}),Qh={CopyToClipboardButton:"CopyToClipboardButton__2Nd2m"},Yh=({content:e})=>{const[t,n]=Zh(),{notify:r}=Qo(),o=t?dl:ul,s=S.useCallback(async()=>{await n(e)&&r("Copied to the Clipboard !","success")},[e,r]);return c.jsx(o,{className:Qh.CopyToClipboardButton,size:18,onClick:s})},Zh=()=>{const[e,t]=S.useState(!1);return[e,async r=>{var o;try{return await((o=navigator==null?void 0:navigator.clipboard)==null?void 0:o.writeText(r)),t(!0),setTimeout(()=>t(!1),2e3),!0}catch(s){return console.error("Failed to copy text: ",s),!1}}]},fl={FieldGroup:"FieldGroup__Q2JCV",fieldGroup:"FieldGroup__Q2JCV","FieldGroup--horizontal":"FieldGroup--horizontal__kpfL1",fieldGroupHorizontal:"FieldGroup--horizontal__kpfL1","FieldGroup--vertical":"FieldGroup--vertical__FLo-Q",fieldGroupVertical:"FieldGroup--vertical__FLo-Q"},pl=S.forwardRef(({children:e,className:t,orientation:n="vertical",...r},o)=>{const s=L(fl.FieldGroup,fl[`FieldGroup--${n}`],t);return c.jsx("div",{ref:o,className:s,...r,children:e})});pl.displayName="FieldGroup";const hl={Input:"Input__uS0sb",Error:"Error__-DQpw"},Ur=S.forwardRef(({className:e,error:t,...n},r)=>{const o=L(hl.Input,t&&hl.Error,e);return c.jsx("input",{ref:r,className:o,...n})});Ur.displayName="Input";const Xh={Error:"Error__N4OP5"},ml=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(Xh.Error,t);return c.jsx("span",{ref:r,className:o,...n,children:e})});ml.displayName="InputError";const gl={Label:"Label__VYUvW",Error:"Error__Eu6DI"},vl=S.forwardRef(({children:e,className:t,error:n,...r},o)=>{const s=L(gl.Label,n&&gl.Error,t);return c.jsx("label",{ref:o,className:s,...r,children:e})});vl.displayName="Label";const ms={Select:"Select__giqpe",Chevron:"Chevron__YvhBd"},yl=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(ms.Option,t);return c.jsx("option",{ref:r,className:o,...n,children:e})});yl.displayName="Option";const gs=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(ms.Select,t);return c.jsxs("div",{className:o,children:[c.jsx("select",{ref:r,...n,children:e}),c.jsx("div",{className:ms.Chevron,children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});gs.displayName="Select",gs.Option=yl;function bl(e,[t,n]){return Math.min(n,Math.max(t,e))}function Z(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jh(e,t){const n=d.createContext(t),r=s=>{const{children:i,...a}=s,l=d.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=d.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Yn(e,t=[]){let n=[];function r(s,i){const a=d.createContext(i),l=n.length;n=[...n,i];const u=h=>{var y;const{scope:m,children:g,...x}=h,p=((y=m==null?void 0:m[e])==null?void 0:y[l])||a,v=d.useMemo(()=>x,Object.values(x));return c.jsx(p.Provider,{value:v,children:g})};u.displayName=s+"Provider";function f(h,m){var p;const g=((p=m==null?void 0:m[e])==null?void 0:p[l])||a,x=d.useContext(g);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,f]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,e1(o,...t)]}function e1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function wl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pn(...e){return t=>{let n=!1;const r=e.map(o=>{const s=wl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():wl(e[o],null)}}}}function ce(...e){return d.useCallback(pn(...e),e)}function _l(e){const t=t1(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(r1);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function t1(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=s1(o),a=o1(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var n1=Symbol("radix.slottable");function r1(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===n1}function o1(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function s1(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function i1(e){const t=e+"CollectionProvider",[n,r]=Yn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:v,children:y}=p,w=S.useRef(null),C=S.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:C,collectionRef:w,children:y})};i.displayName=t;const a=e+"CollectionSlot",l=_l(a),u=S.forwardRef((p,v)=>{const{scope:y,children:w}=p,C=s(a,y),E=ce(v,C.collectionRef);return c.jsx(l,{ref:E,children:w})});u.displayName=a;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=_l(f),g=S.forwardRef((p,v)=>{const{scope:y,children:w,...C}=p,E=S.useRef(null),P=ce(v,E),A=s(f,y);return S.useEffect(()=>(A.itemMap.set(E,{ref:E,...C}),()=>void A.itemMap.delete(E))),c.jsx(m,{[h]:"",ref:P,children:w})});g.displayName=f;function x(p){const v=s(e+"CollectionConsumer",p);return S.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const C=Array.from(w.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((A,R)=>C.indexOf(A.ref.current)-C.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:u,ItemSlot:g},x,r]}var a1=d.createContext(void 0);function l1(e){const t=d.useContext(a1);return e||t||"ltr"}function c1(e){const t=u1(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(f1);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function u1(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=h1(o),a=p1(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var d1=Symbol("radix.slottable");function f1(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===d1}function p1(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function h1(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var m1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=m1.reduce((e,t)=>{const n=c1(`Primitive.${t}`),r=d.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function g1(e,t){e&&hr.flushSync(()=>e.dispatchEvent(t))}function qt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function v1(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var y1="DismissableLayer",vs="dismissableLayer.update",b1="dismissableLayer.pointerDownOutside",w1="dismissableLayer.focusOutside",xl,Cl=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wr=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=d.useContext(Cl),[f,h]=d.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=d.useState({}),x=ce(t,R=>h(R)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=f?p.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=y,P=C1(R=>{const N=R.target,k=[...u.branches].some(D=>D.contains(N));!E||k||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},m),A=S1(R=>{const N=R.target;[...u.branches].some(D=>D.contains(N))||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},m);return v1(R=>{w===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(xl=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Sl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=xl)}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Sl())},[f,u]),d.useEffect(()=>{const R=()=>g({});return document.addEventListener(vs,R),()=>document.removeEventListener(vs,R)},[]),c.jsx(ie.div,{...l,ref:x,style:{pointerEvents:C?E?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,P.onPointerDownCapture)})});Wr.displayName=y1;var _1="DismissableLayerBranch",x1=d.forwardRef((e,t)=>{const n=d.useContext(Cl),r=d.useRef(null),o=ce(t,r);return d.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(ie.div,{...e,ref:o})});x1.displayName=_1;function C1(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){El(b1,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function S1(e,t=globalThis==null?void 0:globalThis.document){const n=qt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=s=>{s.target&&!r.current&&El(w1,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Sl(){const e=new CustomEvent(vs);document.dispatchEvent(e)}function El(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?g1(o,s):o.dispatchEvent(s)}var ys=0;function Tl(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Pl()),document.body.insertAdjacentElement("beforeend",e[1]??Pl()),ys++,()=>{ys===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ys--}},[])}function Pl(){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 bs="focusScope.autoFocusOnMount",ws="focusScope.autoFocusOnUnmount",Al={bubbles:!1,cancelable:!0},E1="FocusScope",_s=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=d.useState(null),u=qt(o),f=qt(s),h=d.useRef(null),m=ce(t,p=>l(p)),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let p=function(C){if(g.paused||!a)return;const E=C.target;a.contains(E)?h.current=E:_t(h.current,{select:!0})},v=function(C){if(g.paused||!a)return;const E=C.relatedTarget;E!==null&&(a.contains(E)||_t(h.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&_t(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,g.paused]),d.useEffect(()=>{if(a){Il.add(g);const p=document.activeElement;if(!a.contains(p)){const y=new CustomEvent(bs,Al);a.addEventListener(bs,u),a.dispatchEvent(y),y.defaultPrevented||(T1(I1(Rl(a)),{select:!0}),document.activeElement===p&&_t(a))}return()=>{a.removeEventListener(bs,u),setTimeout(()=>{const y=new CustomEvent(ws,Al);a.addEventListener(ws,f),a.dispatchEvent(y),y.defaultPrevented||_t(p??document.body,{select:!0}),a.removeEventListener(ws,f),Il.remove(g)},0)}}},[a,u,f,g]);const x=d.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[C,E]=P1(w);C&&E?!p.shiftKey&&y===E?(p.preventDefault(),n&&_t(C,{select:!0})):p.shiftKey&&y===C&&(p.preventDefault(),n&&_t(E,{select:!0})):y===w&&p.preventDefault()}},[n,r,g.paused]);return c.jsx(ie.div,{tabIndex:-1,...i,ref:m,onKeyDown:x})});_s.displayName=E1;function T1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_t(r,{select:t}),document.activeElement!==n)return}function P1(e){const t=Rl(e),n=Ol(t,e),r=Ol(t.reverse(),e);return[n,r]}function Rl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ol(e,t){for(const n of e)if(!A1(n,{upTo:t}))return n}function A1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function R1(e){return e instanceof HTMLInputElement&&"select"in e}function _t(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&R1(e)&&t&&e.select()}}var Il=O1();function O1(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jl(e,t),e.unshift(t)},remove(t){var n;e=jl(e,t),(n=e[0])==null||n.resume()}}}function jl(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function I1(e){return e.filter(t=>t.tagName!=="A")}var ve=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},j1=d[" useId ".trim().toString()]||(()=>{}),k1=0;function Kt(e){const[t,n]=d.useState(j1());return ve(()=>{n(r=>r??String(k1++))},[e]),e||(t?`radix-${t}`:"")}const L1=["top","right","bottom","left"],xt=Math.min,Oe=Math.max,Hr=Math.round,Vr=Math.floor,qe=e=>({x:e,y:e}),N1={left:"right",right:"left",bottom:"top",top:"bottom"},D1={start:"end",end:"start"};function xs(e,t,n){return Oe(e,xt(t,n))}function lt(e,t){return typeof e=="function"?e(t):e}function ct(e){return e.split("-")[0]}function hn(e){return e.split("-")[1]}function Cs(e){return e==="x"?"y":"x"}function Ss(e){return e==="y"?"height":"width"}const M1=new Set(["top","bottom"]);function Ke(e){return M1.has(ct(e))?"y":"x"}function Es(e){return Cs(Ke(e))}function $1(e,t,n){n===void 0&&(n=!1);const r=hn(e),o=Es(e),s=Ss(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=zr(i)),[i,zr(i)]}function F1(e){const t=zr(e);return[Ts(e),t,Ts(t)]}function Ts(e){return e.replace(/start|end/g,t=>D1[t])}const kl=["left","right"],Ll=["right","left"],B1=["top","bottom"],U1=["bottom","top"];function W1(e,t,n){switch(e){case"top":case"bottom":return n?t?Ll:kl:t?kl:Ll;case"left":case"right":return t?B1:U1;default:return[]}}function H1(e,t,n,r){const o=hn(e);let s=W1(ct(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ts)))),s}function zr(e){return e.replace(/left|right|bottom|top/g,t=>N1[t])}function V1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nl(e){return typeof e!="number"?V1(e):{top:e,right:e,bottom:e,left:e}}function Gr(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 Dl(e,t,n){let{reference:r,floating:o}=e;const s=Ke(t),i=Es(t),a=Ss(i),l=ct(t),u=s==="y",f=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:f,y:r.y-o.height};break;case"bottom":g={x:f,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(hn(t)){case"start":g[i]-=m*(n&&u?-1:1);break;case"end":g[i]+=m*(n&&u?-1:1);break}return g}async function z1(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=lt(t,e),x=Nl(g),v=a[m?h==="floating"?"reference":"floating":h],y=Gr(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),w=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},P=Gr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:C,strategy:l}):w);return{top:(y.top-P.top+x.top)/E.y,bottom:(P.bottom-y.bottom+x.bottom)/E.y,left:(y.left-P.left+x.left)/E.x,right:(P.right-y.right+x.right)/E.x}}const G1=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=Dl(u,r,l),m=r,g={},x=0;for(let v=0;v<a.length;v++){var p;const{name:y,fn:w}=a[v],{x:C,y:E,data:P,reset:A}=await w({x:f,y:h,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:u,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:z1},elements:{reference:e,floating:t}});f=C??f,h=E??h,g={...g,[y]:{...g[y],...P}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(u=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:f,y:h}=Dl(u,m,l)),v=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:g}},q1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=lt(e,t)||{};if(u==null)return{};const h=Nl(f),m={x:n,y:r},g=Es(o),x=Ss(g),p=await i.getDimensions(u),v=g==="y",y=v?"top":"left",w=v?"bottom":"right",C=v?"clientHeight":"clientWidth",E=s.reference[x]+s.reference[g]-m[g]-s.floating[x],P=m[g]-s.reference[g],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let R=A?A[C]:0;(!R||!await(i.isElement==null?void 0:i.isElement(A)))&&(R=a.floating[C]||s.floating[x]);const N=E/2-P/2,k=R/2-p[x]/2-1,D=xt(h[y],k),U=xt(h[w],k),W=D,H=R-p[x]-U,z=R/2-p[x]/2+N,oe=xs(W,z,H),G=!l.arrow&&hn(o)!=null&&z!==oe&&s.reference[x]/2-(z<W?D:U)-p[x]/2<0,Y=G?z<W?z-W:z-H:0;return{[g]:m[g]+Y,data:{[g]:oe,centerOffset:z-oe-Y,...G&&{alignmentOffset:Y}},reset:G}}}),K1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:p=!0,...v}=lt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ct(o),w=Ke(a),C=ct(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=m||(C||!p?[zr(a)]:F1(a)),A=x!=="none";!m&&A&&P.push(...H1(a,p,x,E));const R=[a,...P],N=await l.detectOverflow(t,v),k=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&k.push(N[y]),h){const z=$1(o,i,E);k.push(N[z[0]],N[z[1]])}if(D=[...D,{placement:o,overflows:k}],!k.every(z=>z<=0)){var U,W;const z=(((U=s.flip)==null?void 0:U.index)||0)+1,oe=R[z];if(oe&&(!(h==="alignment"?w!==Ke(oe):!1)||D.every(F=>Ke(F.placement)===w?F.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:oe}};let G=(W=D.filter(Y=>Y.overflows[0]<=0).sort((Y,F)=>Y.overflows[1]-F.overflows[1])[0])==null?void 0:W.placement;if(!G)switch(g){case"bestFit":{var H;const Y=(H=D.filter(F=>{if(A){const se=Ke(F.placement);return se===w||se==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(se=>se>0).reduce((se,ge)=>se+ge,0)]).sort((F,se)=>F[1]-se[1])[0])==null?void 0:H[0];Y&&(G=Y);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ml(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $l(e){return L1.some(t=>e[t]>=0)}const Q1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=lt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ml(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:$l(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ml(i,n.floating);return{data:{escapedOffsets:a,escaped:$l(a)}}}default:return{}}}}},Fl=new Set(["left","top"]);async function Y1(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ct(n),a=hn(n),l=Ke(n)==="y",u=Fl.has(i)?-1:1,f=s&&l?-1:1,h=lt(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(g=a==="end"?x*-1:x),l?{x:g*f,y:m*u}:{x:m*u,y:g*f}}const Z1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await Y1(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},X1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:w,y:C}=y;return{x:w,y:C}}},...u}=lt(e,t),f={x:n,y:r},h=await s.detectOverflow(t,u),m=Ke(ct(o)),g=Cs(m);let x=f[g],p=f[m];if(i){const y=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=x+h[y],E=x-h[w];x=xs(C,x,E)}if(a){const y=m==="y"?"top":"left",w=m==="y"?"bottom":"right",C=p+h[y],E=p-h[w];p=xs(C,p,E)}const v=l.fn({...t,[g]:x,[m]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:i,[m]:a}}}}}},J1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=lt(e,t),f={x:n,y:r},h=Ke(o),m=Cs(h);let g=f[m],x=f[h];const p=lt(a,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const C=m==="y"?"height":"width",E=s.reference[m]-s.floating[C]+v.mainAxis,P=s.reference[m]+s.reference[C]-v.mainAxis;g<E?g=E:g>P&&(g=P)}if(u){var y,w;const C=m==="y"?"width":"height",E=Fl.has(ct(o)),P=s.reference[h]-s.floating[C]+(E&&((y=i.offset)==null?void 0:y[h])||0)+(E?0:v.crossAxis),A=s.reference[h]+s.reference[C]+(E?0:((w=i.offset)==null?void 0:w[h])||0)-(E?v.crossAxis:0);x<P?x=P:x>A&&(x=A)}return{[m]:g,[h]:x}}}},em=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=lt(e,t),f=await i.detectOverflow(t,u),h=ct(o),m=hn(o),g=Ke(o)==="y",{width:x,height:p}=s.floating;let v,y;h==="top"||h==="bottom"?(v=h,y=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=h,v=m==="end"?"top":"bottom");const w=p-f.top-f.bottom,C=x-f.left-f.right,E=xt(p-f[v],w),P=xt(x-f[y],C),A=!t.middlewareData.shift;let R=E,N=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=w),A&&!m){const D=Oe(f.left,0),U=Oe(f.right,0),W=Oe(f.top,0),H=Oe(f.bottom,0);g?N=x-2*(D!==0||U!==0?D+U:Oe(f.left,f.right)):R=p-2*(W!==0||H!==0?W+H:Oe(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:R});const k=await i.getDimensions(a.floating);return x!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function qr(){return typeof window<"u"}function mn(e){return Bl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qe(e){var t;return(t=(Bl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bl(e){return qr()?e instanceof Node||e instanceof Ie(e).Node:!1}function Me(e){return qr()?e instanceof Element||e instanceof Ie(e).Element:!1}function Ye(e){return qr()?e instanceof HTMLElement||e instanceof Ie(e).HTMLElement:!1}function Ul(e){return!qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ie(e).ShadowRoot}const tm=new Set(["inline","contents"]);function Zn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!tm.has(o)}const nm=new Set(["table","td","th"]);function rm(e){return nm.has(mn(e))}const om=[":popover-open",":modal"];function Kr(e){return om.some(t=>{try{return e.matches(t)}catch{return!1}})}const sm=["transform","translate","scale","rotate","perspective"],im=["transform","translate","scale","rotate","perspective","filter"],am=["paint","layout","strict","content"];function Ps(e){const t=As(),n=Me(e)?$e(e):e;return sm.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||im.some(r=>(n.willChange||"").includes(r))||am.some(r=>(n.contain||"").includes(r))}function lm(e){let t=Ct(e);for(;Ye(t)&&!gn(t);){if(Ps(t))return t;if(Kr(t))return null;t=Ct(t)}return null}function As(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cm=new Set(["html","body","#document"]);function gn(e){return cm.has(mn(e))}function $e(e){return Ie(e).getComputedStyle(e)}function Qr(e){return Me(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ct(e){if(mn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ul(e)&&e.host||Qe(e);return Ul(t)?t.host:t}function Wl(e){const t=Ct(e);return gn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ye(t)&&Zn(t)?t:Wl(t)}function Xn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Ie(o);if(s){const a=Rs(i);return t.concat(i,i.visualViewport||[],Zn(o)?o:[],a&&n?Xn(a):[])}return t.concat(o,Xn(o,[],n))}function Rs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hl(e){const t=$e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ye(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Hr(n)!==s||Hr(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Os(e){return Me(e)?e:e.contextElement}function vn(e){const t=Os(e);if(!Ye(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Hl(t);let i=(s?Hr(n.width):n.width)/r,a=(s?Hr(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const um=qe(0);function Vl(e){const t=Ie(e);return!As()||!t.visualViewport?um:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ie(e)?!1:t}function Qt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Os(e);let i=qe(1);t&&(r?Me(r)&&(i=vn(r)):i=vn(e));const a=dm(s,n,r)?Vl(s):qe(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,f=o.width/i.x,h=o.height/i.y;if(s){const m=Ie(s),g=r&&Me(r)?Ie(r):r;let x=m,p=Rs(x);for(;p&&r&&g!==x;){const v=vn(p),y=p.getBoundingClientRect(),w=$e(p),C=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*v.x,E=y.top+(p.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,f*=v.x,h*=v.y,l+=C,u+=E,x=Ie(p),p=Rs(x)}}return Gr({width:f,height:h,x:l,y:u})}function Yr(e,t){const n=Qr(e).scrollLeft;return t?t.left+n:Qt(Qe(e)).left+n}function zl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Yr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qe(r),a=t?Kr(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=qe(1);const f=qe(0),h=Ye(r);if((h||!h&&!s)&&((mn(r)!=="body"||Zn(i))&&(l=Qr(r)),Ye(r))){const g=Qt(r);u=vn(r),f.x=g.x+r.clientLeft,f.y=g.y+r.clientTop}const m=i&&!h&&!s?zl(i,l):qe(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function pm(e){return Array.from(e.getClientRects())}function hm(e){const t=Qe(e),n=Qr(e),r=e.ownerDocument.body,o=Oe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Oe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Yr(e);const a=-n.scrollTop;return $e(r).direction==="rtl"&&(i+=Oe(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Gl=25;function mm(e,t){const n=Ie(e),r=Qe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const f=As();(!f||f&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Yr(r);if(u<=0){const f=r.ownerDocument,h=f.body,m=getComputedStyle(h),g=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-g);x<=Gl&&(s-=x)}else u<=Gl&&(s+=u);return{width:s,height:i,x:a,y:l}}const gm=new Set(["absolute","fixed"]);function vm(e,t){const n=Qt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ye(e)?vn(e):qe(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function ql(e,t,n){let r;if(t==="viewport")r=mm(e,n);else if(t==="document")r=hm(Qe(e));else if(Me(t))r=vm(t,n);else{const o=Vl(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Gr(r)}function Kl(e,t){const n=Ct(e);return n===t||!Me(n)||gn(n)?!1:$e(n).position==="fixed"||Kl(n,t)}function ym(e,t){const n=t.get(e);if(n)return n;let r=Xn(e,[],!1).filter(a=>Me(a)&&mn(a)!=="body"),o=null;const s=$e(e).position==="fixed";let i=s?Ct(e):e;for(;Me(i)&&!gn(i);){const a=$e(i),l=Ps(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&gm.has(o.position)||Zn(i)&&!l&&Kl(e,i))?r=r.filter(f=>f!==i):o=a,i=Ct(i)}return t.set(e,r),r}function bm(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Kr(t)?[]:ym(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,f)=>{const h=ql(t,f,o);return u.top=Oe(h.top,u.top),u.right=xt(h.right,u.right),u.bottom=xt(h.bottom,u.bottom),u.left=Oe(h.left,u.left),u},ql(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function wm(e){const{width:t,height:n}=Hl(e);return{width:t,height:n}}function _m(e,t,n){const r=Ye(t),o=Qe(t),s=n==="fixed",i=Qt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);function u(){l.x=Yr(o)}if(r||!r&&!s)if((mn(t)!=="body"||Zn(o))&&(a=Qr(t)),r){const g=Qt(t,!0,s,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&u();s&&!r&&o&&u();const f=o&&!r&&!s?zl(o,a):qe(0),h=i.left+a.scrollLeft-l.x-f.x,m=i.top+a.scrollTop-l.y-f.y;return{x:h,y:m,width:i.width,height:i.height}}function Is(e){return $e(e).position==="static"}function Ql(e,t){if(!Ye(e)||$e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qe(e)===n&&(n=n.ownerDocument.body),n}function Yl(e,t){const n=Ie(e);if(Kr(e))return n;if(!Ye(e)){let o=Ct(e);for(;o&&!gn(o);){if(Me(o)&&!Is(o))return o;o=Ct(o)}return n}let r=Ql(e,t);for(;r&&rm(r)&&Is(r);)r=Ql(r,t);return r&&gn(r)&&Is(r)&&!Ps(r)?n:r||lm(e)||n}const xm=async function(e){const t=this.getOffsetParent||Yl,n=this.getDimensions,r=await n(e.floating);return{reference:_m(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cm(e){return $e(e).direction==="rtl"}const Sm={convertOffsetParentRelativeRectToViewportRelativeRect:fm,getDocumentElement:Qe,getClippingRect:bm,getOffsetParent:Yl,getElementRects:xm,getClientRects:pm,getDimensions:wm,getScale:vn,isElement:Me,isRTL:Cm};function Zl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Em(e,t){let n=null,r;const o=Qe(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:h,width:m,height:g}=u;if(a||t(),!m||!g)return;const x=Vr(h),p=Vr(o.clientWidth-(f+m)),v=Vr(o.clientHeight-(h+g)),y=Vr(f),C={rootMargin:-x+"px "+-p+"px "+-v+"px "+-y+"px",threshold:Oe(0,xt(1,l))||1};let E=!0;function P(A){const R=A[0].intersectionRatio;if(R!==l){if(!E)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Zl(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(P,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return i(!0),s}function Tm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Os(e),f=o||s?[...u?Xn(u):[],...Xn(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=u&&a?Em(u,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=g)==null||C.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let x,p=l?Qt(e):null;l&&v();function v(){const y=Qt(e);p&&!Zl(p,y)&&n(),p=y,x=requestAnimationFrame(v)}return n(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const Pm=Z1,Am=X1,Rm=K1,Om=em,Im=Q1,Xl=q1,jm=J1,km=(e,t,n)=>{const r=new Map,o={platform:Sm,...n},s={...o.platform,_c:r};return G1(e,t,{...o,platform:s})};var Lm=typeof document<"u",Nm=function(){},Zr=Lm?S.useLayoutEffect:Nm;function Xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xr(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Xr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Jl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ec(e,t){const n=Jl(e);return Math.round(t*n)/n}function js(e){const t=d.useRef(e);return Zr(()=>{t.current=e}),t}function Dm(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,h]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=d.useState(r);Xr(m,r)||g(r);const[x,p]=d.useState(null),[v,y]=d.useState(null),w=d.useCallback(F=>{F!==A.current&&(A.current=F,p(F))},[]),C=d.useCallback(F=>{F!==R.current&&(R.current=F,y(F))},[]),E=s||x,P=i||v,A=d.useRef(null),R=d.useRef(null),N=d.useRef(f),k=l!=null,D=js(l),U=js(o),W=js(u),H=d.useCallback(()=>{if(!A.current||!R.current)return;const F={placement:t,strategy:n,middleware:m};U.current&&(F.platform=U.current),km(A.current,R.current,F).then(se=>{const ge={...se,isPositioned:W.current!==!1};z.current&&!Xr(N.current,ge)&&(N.current=ge,hr.flushSync(()=>{h(ge)}))})},[m,t,n,U,W]);Zr(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(F=>({...F,isPositioned:!1})))},[u]);const z=d.useRef(!1);Zr(()=>(z.current=!0,()=>{z.current=!1}),[]),Zr(()=>{if(E&&(A.current=E),P&&(R.current=P),E&&P){if(D.current)return D.current(E,P,H);H()}},[E,P,H,D,k]);const oe=d.useMemo(()=>({reference:A,floating:R,setReference:w,setFloating:C}),[w,C]),G=d.useMemo(()=>({reference:E,floating:P}),[E,P]),Y=d.useMemo(()=>{const F={position:n,left:0,top:0};if(!G.floating)return F;const se=ec(G.floating,f.x),ge=ec(G.floating,f.y);return a?{...F,transform:"translate("+se+"px, "+ge+"px)",...Jl(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:ge}},[n,a,G.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:H,refs:oe,elements:G,floatingStyles:Y}),[f,H,oe,G,Y])}const Mm=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Xl({element:r.current,padding:o}).fn(n):{}:r?Xl({element:r,padding:o}).fn(n):{}}}},$m=(e,t)=>({...Pm(e),options:[e,t]}),Fm=(e,t)=>({...Am(e),options:[e,t]}),Bm=(e,t)=>({...jm(e),options:[e,t]}),Um=(e,t)=>({...Rm(e),options:[e,t]}),Wm=(e,t)=>({...Om(e),options:[e,t]}),Hm=(e,t)=>({...Im(e),options:[e,t]}),Vm=(e,t)=>({...Mm(e),options:[e,t]});var zm="Arrow",tc=d.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(ie.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});tc.displayName=zm;var Gm=tc;function qm(e){const[t,n]=d.useState(void 0);return ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ks="Popper",[nc,Jr]=Yn(ks),[Km,rc]=nc(ks),oc=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return c.jsx(Km,{scope:t,anchor:r,onAnchorChange:o,children:n})};oc.displayName=ks;var sc="PopperAnchor",ic=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=rc(sc,n),i=d.useRef(null),a=ce(t,i),l=d.useRef(null);return d.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(ie.div,{...o,ref:a})});ic.displayName=sc;var Ls="PopperContent",[Qm,Ym]=nc(Ls),ac=d.forwardRef((e,t)=>{var $,te,fe,X,ne,J;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:x,...p}=e,v=rc(Ls,n),[y,w]=d.useState(null),C=ce(t,Ce=>w(Ce)),[E,P]=d.useState(null),A=qm(E),R=(A==null?void 0:A.width)??0,N=(A==null?void 0:A.height)??0,k=r+(s!=="center"?"-"+s:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},U=Array.isArray(u)?u:[u],W=U.length>0,H={padding:D,boundary:U.filter(Xm),altBoundary:W},{refs:z,floatingStyles:oe,placement:G,isPositioned:Y,middlewareData:F}=Dm({strategy:"fixed",placement:k,whileElementsMounted:(...Ce)=>Tm(...Ce,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[$m({mainAxis:o+N,alignmentAxis:i}),l&&Fm({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Bm():void 0,...H}),l&&Um({...H}),Wm({...H,apply:({elements:Ce,rects:Le,availableWidth:ot,availableHeight:ze})=>{const{width:Bt,height:To}=Le.reference,ht=Ce.floating.style;ht.setProperty("--radix-popper-available-width",`${ot}px`),ht.setProperty("--radix-popper-available-height",`${ze}px`),ht.setProperty("--radix-popper-anchor-width",`${Bt}px`),ht.setProperty("--radix-popper-anchor-height",`${To}px`)}}),E&&Vm({element:E,padding:a}),Jm({arrowWidth:R,arrowHeight:N}),m&&Hm({strategy:"referenceHidden",...H})]}),[se,ge]=uc(G),ke=qt(x);ve(()=>{Y&&(ke==null||ke())},[Y,ke]);const Mt=($=F.arrow)==null?void 0:$.x,$t=(te=F.arrow)==null?void 0:te.y,rt=((fe=F.arrow)==null?void 0:fe.centerOffset)!==0,[Ft,Ve]=d.useState();return ve(()=>{y&&Ve(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...oe,transform:Y?oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ft,"--radix-popper-transform-origin":[(X=F.transformOrigin)==null?void 0:X.x,(ne=F.transformOrigin)==null?void 0:ne.y].join(" "),...((J=F.hide)==null?void 0:J.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Qm,{scope:n,placedSide:se,onArrowChange:P,arrowX:Mt,arrowY:$t,shouldHideArrow:rt,children:c.jsx(ie.div,{"data-side":se,"data-align":ge,...p,ref:C,style:{...p.style,animation:Y?void 0:"none"}})})})});ac.displayName=Ls;var lc="PopperArrow",Zm={top:"bottom",right:"left",bottom:"top",left:"right"},cc=d.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ym(lc,r),i=Zm[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(Gm,{...o,ref:n,style:{...o.style,display:"block"}})})});cc.displayName=lc;function Xm(e){return e!==null}var Jm=e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;const{placement:n,rects:r,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=uc(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let x="",p="";return u==="bottom"?(x=i?h:`${m}px`,p=`${-l}px`):u==="top"?(x=i?h:`${m}px`,p=`${r.floating.height+l}px`):u==="right"?(x=`${-l}px`,p=i?h:`${g}px`):u==="left"&&(x=`${r.floating.width+l}px`,p=i?h:`${g}px`),{data:{x,y:p}}}});function uc(e){const[t,n="center"]=e.split("-");return[t,n]}var dc=oc,fc=ic,pc=ac,hc=cc,eg="Portal",Ns=d.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=d.useState(!1);ve(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Wt.createPortal(c.jsx(ie.div,{...r,ref:t}),i):null});Ns.displayName=eg;function tg(e){const t=ng(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(og);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function ng(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=ig(o),a=sg(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rg=Symbol("radix.slottable");function og(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rg}function sg(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function ig(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ag=d[" useInsertionEffect ".trim().toString()]||ve;function eo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=lg({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const f=d.useRef(e!==void 0);d.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=d.useCallback(f=>{var h;if(a){const m=cg(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else s(f)},[a,e,s,i]);return[l,u]}function lg({defaultProp:e,onChange:t}){const[n,r]=d.useState(e),o=d.useRef(n),s=d.useRef(t);return ag(()=>{s.current=t},[t]),d.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function cg(e){return typeof e=="function"}function ug(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dg="VisuallyHidden",gc=d.forwardRef((e,t)=>c.jsx(ie.span,{...e,ref:t,style:{...mc,...e.style}}));gc.displayName=dg;var fg=gc,pg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yn=new WeakMap,to=new WeakMap,no={},Ds=0,vc=function(e){return e&&(e.host||vc(e.parentNode))},hg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vc(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},mg=function(e,t,n,r){var o=hg(t,Array.isArray(e)?e:[e]);no[n]||(no[n]=new WeakMap);var s=no[n],i=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var f=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(a.has(m))f(m);else try{var g=m.getAttribute(r),x=g!==null&&g!=="false",p=(yn.get(m)||0)+1,v=(s.get(m)||0)+1;yn.set(m,p),s.set(m,v),i.push(m),p===1&&x&&to.set(m,!0),v===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return f(t),a.clear(),Ds++,function(){i.forEach(function(h){var m=yn.get(h)-1,g=s.get(h)-1;yn.set(h,m),s.set(h,g),m||(to.has(h)||h.removeAttribute(r),to.delete(h)),g||h.removeAttribute(n)}),Ds--,Ds||(yn=new WeakMap,yn=new WeakMap,to=new WeakMap,no={})}},yc=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=pg(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),mg(r,o,n,"aria-hidden")):function(){return null}},ro="right-scroll-bar-position",oo="width-before-scroll-bar",gg="with-scroll-bars-hidden",vg="--removed-body-scroll-bar-size";function Ms(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yg(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var bg=typeof window<"u"?d.useLayoutEffect:d.useEffect,bc=new WeakMap;function wg(e,t){var n=yg(null,function(r){return e.forEach(function(o){return Ms(o,r)})});return bg(function(){var r=bc.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Ms(a,null)}),s.forEach(function(a){o.has(a)||Ms(a,i)})}bc.set(n,e)},[e]),n}function _g(e){return e}function xg(e,t){t===void 0&&(t=_g);var n=[],r=!1,o={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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return o}function Cg(e){e===void 0&&(e={});var t=xg(null);return t.options=Ge({async:!0,ssr:!1},e),t}var wc=function(e){var t=e.sideCar,n=sa(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 d.createElement(r,Ge({},n))};wc.isSideCarExport=!0;function Sg(e,t){return e.useMedium(t),wc}var _c=Cg(),$s=function(){},so=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:$s,onWheelCapture:$s,onTouchMoveCapture:$s}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,x=e.noIsolation,p=e.inert,v=e.allowPinchZoom,y=e.as,w=y===void 0?"div":y,C=e.gapMode,E=sa(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=m,A=wg([n,t]),R=Ge(Ge({},E),o);return d.createElement(d.Fragment,null,f&&d.createElement(P,{sideCar:_c,removeScrollBar:u,shards:h,noRelative:g,noIsolation:x,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:C}),i?d.cloneElement(d.Children.only(a),Ge(Ge({},R),{ref:A})):d.createElement(w,Ge({},R,{className:l,ref:A}),a))});so.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},so.classNames={fullWidth:oo,zeroRight:ro};var Eg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tg(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Eg();return t&&e.setAttribute("nonce",t),e}function Pg(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ag(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Rg=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tg())&&(Pg(t,n),Ag(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Og=function(){var e=Rg();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xc=function(){var e=Og(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Ig={left:0,top:0,right:0,gap:0},Fs=function(e){return parseInt(e||"",10)||0},jg=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fs(n),Fs(r),Fs(o)]},kg=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Ig;var t=jg(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])}},Lg=xc(),bn="data-scroll-locked",Ng=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
210
210
|
.`.concat(gg,` {
|
|
211
211
|
overflow: hidden `).concat(r,`;
|
|
212
212
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -246,7 +246,7 @@ to {
|
|
|
246
246
|
`)},Cc=function(){var e=parseInt(document.body.getAttribute(bn)||"0",10);return isFinite(e)?e:0},Dg=function(){d.useEffect(function(){return document.body.setAttribute(bn,(Cc()+1).toString()),function(){var e=Cc()-1;e<=0?document.body.removeAttribute(bn):document.body.setAttribute(bn,e.toString())}},[])},Mg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Dg();var s=d.useMemo(function(){return kg(o)},[o]);return d.createElement(Lg,{styles:Ng(s,!t,o,n?"":"!important")})},Bs=!1;if(typeof window<"u")try{var io=Object.defineProperty({},"passive",{get:function(){return Bs=!0,!0}});window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Bs=!1}var wn=Bs?{passive:!1}:!1,$g=function(e){return e.tagName==="TEXTAREA"},Sc=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$g(e)&&n[t]==="visible")},Fg=function(e){return Sc(e,"overflowY")},Bg=function(e){return Sc(e,"overflowX")},Ec=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Tc(e,r);if(o){var s=Pc(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ug=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wg=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Tc=function(e,t){return e==="v"?Fg(t):Bg(t)},Pc=function(e,t){return e==="v"?Ug(t):Wg(t)},Hg=function(e,t){return e==="h"&&t==="rtl"?-1:1},Vg=function(e,t,n,r,o){var s=Hg(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),u=!1,f=i>0,h=0,m=0;do{if(!a)break;var g=Pc(e,a),x=g[0],p=g[1],v=g[2],y=p-v-s*x;(x||y)&&Tc(e,a)&&(h+=y,m+=x);var w=a.parentNode;a=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(u=!0),u},ao=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ac=function(e){return[e.deltaX,e.deltaY]},Rc=function(e){return e&&"current"in e?e.current:e},zg=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gg=function(e){return`
|
|
247
247
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
248
248
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
249
|
-
`)},qg=0,_n=[];function Kg(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(qg++)[0],s=d.useState(xc)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=yr([e.lockRef.current],(e.shards||[]).map(Rc),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var y=ao(p),w=n.current,C="deltaX"in p?p.deltaX:w[0]-y[0],E="deltaY"in p?p.deltaY:w[1]-y[1],P,A=p.target,R=Math.abs(C)>Math.abs(E)?"h":"v";if("touches"in p&&R==="h"&&A.type==="range")return!1;var N=window.getSelection(),k=N&&N.anchorNode,D=k?k===A||k.contains(A):!1;if(D)return!1;var U=Ec(R,A);if(!U)return!0;if(U?P=R:(P=R==="v"?"h":"v",U=Ec(R,A)),!U)return!1;if(!r.current&&"changedTouches"in p&&(C||E)&&(r.current=P),!P)return!0;var W=r.current||P;return Vg(W,v,p,W==="h"?C:E)},[]),l=d.useCallback(function(p){var v=p;if(!(!_n.length||_n[_n.length-1]!==s)){var y="deltaY"in v?Ac(v):ao(v),w=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&zg(P.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var C=(i.current.shards||[]).map(Rc).filter(Boolean).filter(function(P){return P.contains(v.target)}),E=C.length>0?a(v,C[0]):!i.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),u=d.useCallback(function(p,v,y,w){var C={name:p,delta:v,target:y,should:w,shadowParent:Qg(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(E){return E!==C})},1)},[]),f=d.useCallback(function(p){n.current=ao(p),r.current=void 0},[]),h=d.useCallback(function(p){u(p.type,Ac(p),p.target,a(p,e.lockRef.current))},[]),m=d.useCallback(function(p){u(p.type,ao(p),p.target,a(p,e.lockRef.current))},[]);d.useEffect(function(){return _n.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,wn),document.addEventListener("touchmove",l,wn),document.addEventListener("touchstart",f,wn),function(){_n=_n.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,wn),document.removeEventListener("touchmove",l,wn),document.removeEventListener("touchstart",f,wn)}},[]);var g=e.removeScrollBar,x=e.inert;return d.createElement(d.Fragment,null,x?d.createElement(s,{styles:Gg(o)}):null,g?d.createElement(Mg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qg(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Yg=Sg(_c,Kg);var Us=d.forwardRef(function(e,t){return d.createElement(so,Ge({},e,{ref:t,sideCar:Yg}))});Us.classNames=so.classNames;var Zg=[" ","Enter","ArrowUp","ArrowDown"],Xg=[" ","Enter"],Yt="Select",[lo,co,Jg]=im(Yt),[xn]=Yn(Yt,[Jg,Jr]),uo=Jr(),[ev,St]=xn(Yt),[tv,nv]=xn(Yt),Oc=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:h,disabled:m,required:g,form:x}=e,p=uo(t),[v,y]=d.useState(null),[w,C]=d.useState(null),[E,P]=d.useState(!1),A=lm(u),[R,N]=eo({prop:r,defaultProp:o??!1,onChange:s,caller:Yt}),[k,D]=eo({prop:i,defaultProp:a,onChange:l,caller:Yt}),U=d.useRef(null),W=v?x||!!v.closest("form"):!0,[H,z]=d.useState(new Set),oe=Array.from(H).map(G=>G.props.value).join(";");return c.jsx(dc,{...p,children:c.jsxs(ev,{required:g,scope:t,trigger:v,onTriggerChange:y,valueNode:w,onValueNodeChange:C,valueNodeHasChildren:E,onValueNodeHasChildrenChange:P,contentId:Kt(),value:k,onValueChange:D,open:R,onOpenChange:N,dir:A,triggerPointerDownPosRef:U,disabled:m,children:[c.jsx(lo.Provider,{scope:t,children:c.jsx(tv,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(G=>{z(Y=>new Set(Y).add(G))},[]),onNativeOptionRemove:d.useCallback(G=>{z(Y=>{const F=new Set(Y);return F.delete(G),F})},[]),children:n})}),W?c.jsxs(Yc,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:h,value:k,onChange:G=>D(G.target.value),disabled:m,form:x,children:[k===void 0?c.jsx("option",{value:""}):null,Array.from(H)]},oe):null]})})};Oc.displayName=Yt;var Ic="SelectTrigger",jc=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=uo(n),i=St(Ic,n),a=i.disabled||r,l=ce(t,i.onTriggerChange),u=co(n),f=d.useRef("touch"),[h,m,g]=Xc(p=>{const v=u().filter(C=>!C.disabled),y=v.find(C=>C.value===i.value),w=Jc(v,p,y);w!==void 0&&i.onValueChange(w.value)}),x=p=>{a||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(fc,{asChild:!0,...s,children:c.jsx(ie.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Zc(i.value)?"":void 0,...o,ref:l,onClick:Z(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&x(p)}),onPointerDown:Z(o.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(x(p),p.preventDefault())}),onKeyDown:Z(o.onKeyDown,p=>{const v=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(v&&p.key===" ")&&Zg.includes(p.key)&&(x(),p.preventDefault())})})})});jc.displayName=Ic;var kc="SelectValue",Lc=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=St(kc,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,h=ce(t,l.onValueNodeChange);return ve(()=>{u(f)},[u,f]),c.jsx(ie.span,{...a,ref:h,style:{pointerEvents:"none"},children:Zc(l.value)?c.jsx(c.Fragment,{children:i}):s})});Lc.displayName=kc;var rv="SelectIcon",Nc=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Nc.displayName=rv;var Zt="SelectContent",Dc=d.forwardRef((e,t)=>{const n=St(Zt,e.__scopeSelect),[r,o]=d.useState();if(ve(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?hr.createPortal(c.jsx(Mc,{scope:e.__scopeSelect,children:c.jsx(lo.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx($c,{...e,ref:t})});Dc.displayName=Zt;var Fe=10,[Mc,Et]=xn(Zt),ov="SelectContentImpl",sv=tg("SelectContent.RemoveScroll"),$c=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:p,avoidCollisions:v,...y}=e,w=St(Zt,n),[C,E]=d.useState(null),[P,A]=d.useState(null),R=ce(t,$=>E($)),[N,k]=d.useState(null),[D,U]=d.useState(null),W=co(n),[H,z]=d.useState(!1),oe=d.useRef(!1);d.useEffect(()=>{if(C)return yc(C)},[C]),Tl();const G=d.useCallback($=>{const[te,...fe]=W().map(J=>J.ref.current),[X]=fe.slice(-1),ne=document.activeElement;for(const J of $)if(J===ne||(J==null||J.scrollIntoView({block:"nearest"}),J===te&&P&&(P.scrollTop=0),J===X&&P&&(P.scrollTop=P.scrollHeight),J==null||J.focus(),document.activeElement!==ne))return},[W,P]),Y=d.useCallback(()=>G([N,C]),[G,N,C]);d.useEffect(()=>{H&&Y()},[H,Y]);const{onOpenChange:F,triggerPointerDownPosRef:se}=w;d.useEffect(()=>{if(C){let $={x:0,y:0};const te=X=>{var ne,J;$={x:Math.abs(Math.round(X.pageX)-(((ne=se.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(X.pageY)-(((J=se.current)==null?void 0:J.y)??0))}},fe=X=>{$.x<=10&&$.y<=10?X.preventDefault():C.contains(X.target)||F(!1),document.removeEventListener("pointermove",te),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",fe,{capture:!0})}}},[C,F,se]),d.useEffect(()=>{const $=()=>F(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[F]);const[ge,ke]=Xc($=>{const te=W().filter(ne=>!ne.disabled),fe=te.find(ne=>ne.ref.current===document.activeElement),X=Jc(te,$,fe);X&&setTimeout(()=>X.ref.current.focus())}),Mt=d.useCallback(($,te,fe)=>{const X=!oe.current&&!fe;(w.value!==void 0&&w.value===te||X)&&(k($),X&&(oe.current=!0))},[w.value]),$t=d.useCallback(()=>C==null?void 0:C.focus(),[C]),rt=d.useCallback(($,te,fe)=>{const X=!oe.current&&!fe;(w.value!==void 0&&w.value===te||X)&&U($)},[w.value]),Ft=r==="popper"?Ws:Fc,Ve=Ft===Ws?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(Mc,{scope:n,content:C,viewport:P,onViewportChange:A,itemRefCallback:Mt,selectedItem:N,onItemLeave:$t,itemTextRefCallback:rt,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:H,searchRef:ge,children:c.jsx(Us,{as:sv,allowPinchZoom:!0,children:c.jsx(_s,{asChild:!0,trapped:w.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:Z(o,$=>{var te;(te=w.trigger)==null||te.focus({preventScroll:!0}),$.preventDefault()}),children:c.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:c.jsx(Ft,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:$=>$.preventDefault(),...y,...Ve,onPlaced:()=>z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,$=>{const te=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!te&&$.key.length===1&&ke($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let X=W().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,J=X.indexOf(ne);X=X.slice(J+1)}setTimeout(()=>G(X)),$.preventDefault()}})})})})})})});$c.displayName=ov;var iv="SelectItemAlignedPosition",Fc=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=St(Zt,n),i=Et(Zt,n),[a,l]=d.useState(null),[u,f]=d.useState(null),h=ce(t,R=>f(R)),m=co(n),g=d.useRef(!1),x=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=i,C=d.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&p&&v&&y){const R=s.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),k=s.valueNode.getBoundingClientRect(),D=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=D.left-N.left,J=k.left-ne,Ce=R.left-J,Le=R.width+Ce,ot=Math.max(Le,N.width),ze=window.innerWidth-Fe,Bt=bl(J,[Fe,Math.max(Fe,ze-ot)]);a.style.minWidth=Le+"px",a.style.left=Bt+"px"}else{const ne=N.right-D.right,J=window.innerWidth-k.right-ne,Ce=window.innerWidth-R.right-J,Le=R.width+Ce,ot=Math.max(Le,N.width),ze=window.innerWidth-Fe,Bt=bl(J,[Fe,Math.max(Fe,ze-ot)]);a.style.minWidth=Le+"px",a.style.right=Bt+"px"}const U=m(),W=window.innerHeight-Fe*2,H=p.scrollHeight,z=window.getComputedStyle(u),oe=parseInt(z.borderTopWidth,10),G=parseInt(z.paddingTop,10),Y=parseInt(z.borderBottomWidth,10),F=parseInt(z.paddingBottom,10),se=oe+G+H+F+Y,ge=Math.min(v.offsetHeight*5,se),ke=window.getComputedStyle(p),Mt=parseInt(ke.paddingTop,10),$t=parseInt(ke.paddingBottom,10),rt=R.top+R.height/2-Fe,Ft=W-rt,Ve=v.offsetHeight/2,$=v.offsetTop+Ve,te=oe+G+$,fe=se-te;if(te<=rt){const ne=U.length>0&&v===U[U.length-1].ref.current;a.style.bottom="0px";const J=u.clientHeight-p.offsetTop-p.offsetHeight,Ce=Math.max(Ft,Ve+(ne?$t:0)+J+Y),Le=te+Ce;a.style.height=Le+"px"}else{const ne=U.length>0&&v===U[0].ref.current;a.style.top="0px";const Ce=Math.max(rt,oe+p.offsetTop+(ne?Mt:0)+Ve)+fe;a.style.height=Ce+"px",p.scrollTop=te-rt+p.offsetTop}a.style.margin=`${Fe}px 0`,a.style.minHeight=ge+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,a,u,p,v,y,s.dir,r]);ve(()=>C(),[C]);const[E,P]=d.useState();ve(()=>{u&&P(window.getComputedStyle(u).zIndex)},[u]);const A=d.useCallback(R=>{R&&x.current===!0&&(C(),w==null||w(),x.current=!1)},[C,w]);return c.jsx(lv,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:A,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:c.jsx(ie.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Fc.displayName=iv;var av="SelectPopperPosition",Ws=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Fe,...s}=e,i=uo(n);return c.jsx(pc,{...i,...s,ref:t,align:r,collisionPadding:o,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)"}})});Ws.displayName=av;var[lv,Hs]=xn(Zt,{}),Vs="SelectViewport",Bc=d.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Et(Vs,n),i=Hs(Vs,n),a=ce(t,s.onViewportChange),l=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.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:r}),c.jsx(lo.Slot,{scope:n,children:c.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Z(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const g=Math.abs(l.current-f.scrollTop);if(g>0){const x=window.innerHeight-Fe*2,p=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),y=Math.max(p,v);if(y<x){const w=y+g,C=Math.min(x,w),E=w-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,h.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Bc.displayName=Vs;var Uc="SelectGroup",[cv,uv]=xn(Uc),Wc=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kt();return c.jsx(cv,{scope:n,id:o,children:c.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Wc.displayName=Uc;var Hc="SelectLabel",dv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=uv(Hc,n);return c.jsx(ie.div,{id:o.id,...r,ref:t})});dv.displayName=Hc;var fo="SelectItem",[fv,Vc]=xn(fo),zc=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=St(fo,n),l=Et(fo,n),u=a.value===r,[f,h]=d.useState(s??""),[m,g]=d.useState(!1),x=ce(t,w=>{var C;return(C=l.itemRefCallback)==null?void 0:C.call(l,w,r,o)}),p=Kt(),v=d.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 c.jsx(fv,{scope:n,value:r,disabled:o,textId:p,isSelected:u,onItemTextChange:d.useCallback(w=>{h(C=>C||((w==null?void 0:w.textContent)??"").trim())},[]),children:c.jsx(lo.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:c.jsx(ie.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:Z(i.onFocus,()=>g(!0)),onBlur:Z(i.onBlur,()=>g(!1)),onClick:Z(i.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:Z(i.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:Z(i.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Z(i.onPointerMove,w=>{var C;v.current=w.pointerType,o?(C=l.onItemLeave)==null||C.call(l):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(i.onPointerLeave,w=>{var C;w.currentTarget===document.activeElement&&((C=l.onItemLeave)==null||C.call(l))}),onKeyDown:Z(i.onKeyDown,w=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&w.key===" "||(Xg.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});zc.displayName=fo;var Jn="SelectItemText",Gc=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=St(Jn,n),a=Et(Jn,n),l=Vc(Jn,n),u=nv(Jn,n),[f,h]=d.useState(null),m=ce(t,y=>h(y),l.onItemTextChange,y=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,y,l.value,l.disabled)}),g=f==null?void 0:f.textContent,x=d.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return ve(()=>(p(x),()=>v(x)),[p,v,x]),c.jsxs(c.Fragment,{children:[c.jsx(ie.span,{id:l.textId,...s,ref:m}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?hr.createPortal(s.children,i.valueNode):null]})});Gc.displayName=Jn;var qc="SelectItemIndicator",Kc=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vc(qc,n).isSelected?c.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});Kc.displayName=qc;var zs="SelectScrollUpButton",pv=d.forwardRef((e,t)=>{const n=Et(zs,e.__scopeSelect),r=Hs(zs,e.__scopeSelect),[o,s]=d.useState(!1),i=ce(t,r.onScrollButtonChange);return ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(Qc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});pv.displayName=zs;var Gs="SelectScrollDownButton",hv=d.forwardRef((e,t)=>{const n=Et(Gs,e.__scopeSelect),r=Hs(Gs,e.__scopeSelect),[o,s]=d.useState(!1),i=ce(t,r.onScrollButtonChange);return ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(Qc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});hv.displayName=Gs;var Qc=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Et("SelectScrollButton",n),i=d.useRef(null),a=co(n),l=d.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>l(),[l]),ve(()=>{var f;const u=a().find(h=>h.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),c.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Z(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Z(o.onPointerLeave,()=>{l()})})}),mv="SelectSeparator",gv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});gv.displayName=mv;var qs="SelectArrow",vv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=uo(n),s=St(qs,n),i=Et(qs,n);return s.open&&i.position==="popper"?c.jsx(hc,{...o,...r,ref:t}):null});vv.displayName=qs;var yv="SelectBubbleInput",Yc=d.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=d.useRef(null),s=ce(r,o),i=ug(t);return d.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(h)}},[i,t]),c.jsx(ie.select,{...n,style:{...mc,...n.style},ref:s,defaultValue:t})});Yc.displayName=yv;function Zc(e){return e===""||e===void 0}function Xc(e){const t=qt(e),n=d.useRef(""),r=d.useRef(0),o=d.useCallback(i=>{const a=n.current+i;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Jc(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=bv(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function bv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var wv=Oc,_v=jc,xv=Lc,Cv=Nc,Sv=Dc,Ev=Bc,Tv=Wc,Pv=zc,Av=Gc,Rv=Kc;const Ze={Container:"Container__xcHXp",Label:"Label__0cZB9",HelperText:"HelperText__m1nA9",Trigger:"Trigger__AyFUd",TriggerIcon:"TriggerIcon__aygFG",Content:"Content__llztG",Viewport:"Viewport__COtSL",Item:"Item__XN1-2",ItemIndicatorContainer:"ItemIndicatorContainer__EQH-X",ItemIndicator:"ItemIndicator__bySSc"},eu=S.forwardRef(({label:e,helperText:t,value:n,onValueChange:r,options:o,placeholder:s="Select",disabled:i=!1,className:a,name:l},u)=>c.jsxs("div",{className:L(Ze.Container,a),children:[e&&c.jsx("label",{className:Ze.Label,children:e}),c.jsxs(wv,{value:n,onValueChange:r,disabled:i,name:l,children:[c.jsxs(_v,{ref:u,className:Ze.Trigger,children:[c.jsx(xv,{placeholder:s}),c.jsx(Cv,{className:Ze.TriggerIcon,children:c.jsx(Ov,{})})]}),c.jsx(Sv,{className:Ze.Content,position:"popper",sideOffset:4,children:c.jsx(Ev,{className:Ze.Viewport,children:c.jsx(Tv,{children:o.map(f=>c.jsxs(Pv,{value:f.value,disabled:f.disabled,className:Ze.Item,children:[c.jsx("div",{className:Ze.ItemIndicatorContainer,children:c.jsx(Rv,{className:Ze.ItemIndicator,children:c.jsx(Iv,{})})}),c.jsx(Av,{children:f.label})]},f.value))})})})]}),t&&c.jsx("div",{className:Ze.HelperText,children:t})]}));eu.displayName="Select";const Ov=()=>c.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.52459 12.7746C6.8907 12.4085 7.4843 12.4085 7.85041 12.7746L10 14.9242L12.1496 12.7746C12.5157 12.4085 13.1093 12.4085 13.4754 12.7746C13.8415 13.1407 13.8415 13.7343 13.4754 14.1004L10.6629 16.9129C10.2968 17.279 9.7032 17.279 9.33709 16.9129L6.52459 14.1004C6.15847 13.7343 6.15847 13.1407 6.52459 12.7746Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4754 7.22541C13.1093 7.59153 12.5157 7.59153 12.1496 7.22541L10 5.07583L7.85041 7.22541C7.4843 7.59153 6.8907 7.59153 6.52459 7.22541C6.15847 6.8593 6.15847 6.2657 6.52459 5.89959L9.33709 3.08709C9.7032 2.72097 10.2968 2.72097 10.6629 3.08709L13.4754 5.89959C13.8415 6.2657 13.8415 6.8593 13.4754 7.22541Z",fill:"currentColor"})]}),Iv=()=>c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jv={TextArea:"TextArea__pa-A0"},tu=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(jv.TextArea,t);return c.jsx("textarea",{ref:r,className:o,...n,children:e})});tu.displayName="TextArea";function kv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Cn=e=>{const{present:t,children:n}=e,r=Lv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ce(r.ref,Nv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Cn.displayName="Presence";function Lv(e){const[t,n]=d.useState(),r=d.useRef(null),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,l]=kv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=po(r.current);s.current=a==="mounted"?u:"none"},[a]),ve(()=>{const u=r.current,f=o.current;if(f!==e){const m=s.current,g=po(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ve(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,h=g=>{const p=po(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&p&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=g=>{g.target===t&&(s.current=po(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function po(e){return(e==null?void 0:e.animationName)||"none"}function Nv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dv=Symbol("radix.slottable");function Mv(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Dv,t}var[ho]=Yn("Tooltip",[Jr]),mo=Jr(),nu="TooltipProvider",$v=700,Ks="tooltip.open",[Fv,Qs]=ho(nu),ru=e=>{const{__scopeTooltip:t,delayDuration:n=$v,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=d.useRef(!0),a=d.useRef(!1),l=d.useRef(0);return d.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(Fv,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:d.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};ru.displayName=nu;var er="Tooltip",[Bv,tr]=ho(er),ou=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Qs(er,e.__scopeTooltip),u=mo(t),[f,h]=d.useState(null),m=Kt(),g=d.useRef(0),x=i??l.disableHoverableContent,p=a??l.delayDuration,v=d.useRef(!1),[y,w]=eo({prop:r,defaultProp:o??!1,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ks))):l.onClose(),s==null||s(R)},caller:er}),C=d.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),E=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,w(!0)},[w]),P=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),A=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,w(!0),g.current=0},p)},[p,w]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(dc,{...u,children:c.jsx(Bv,{scope:t,contentId:m,open:y,stateAttribute:C,trigger:f,onTriggerChange:h,onTriggerEnter:d.useCallback(()=>{l.isOpenDelayedRef.current?A():E()},[l.isOpenDelayedRef,A,E]),onTriggerLeave:d.useCallback(()=>{x?P():(window.clearTimeout(g.current),g.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:n})})};ou.displayName=er;var Ys="TooltipTrigger",su=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tr(Ys,n),s=Qs(Ys,n),i=mo(n),a=d.useRef(null),l=ce(t,a,o.onTriggerChange),u=d.useRef(!1),f=d.useRef(!1),h=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(fc,{asChild:!0,...i,children:c.jsx(ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Z(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});su.displayName=Ys;var Zs="TooltipPortal",[Uv,Wv]=ho(Zs,{forceMount:void 0}),iu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=tr(Zs,t);return c.jsx(Uv,{scope:t,forceMount:n,children:c.jsx(Cn,{present:n||s.open,children:c.jsx(Ns,{asChild:!0,container:o,children:r})})})};iu.displayName=Zs;var Sn="TooltipContent",au=d.forwardRef((e,t)=>{const n=Wv(Sn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=tr(Sn,e.__scopeTooltip);return c.jsx(Cn,{present:r||i.open,children:i.disableHoverableContent?c.jsx(lu,{side:o,...s,ref:t}):c.jsx(Hv,{side:o,...s,ref:t})})}),Hv=d.forwardRef((e,t)=>{const n=tr(Sn,e.__scopeTooltip),r=Qs(Sn,e.__scopeTooltip),o=d.useRef(null),s=ce(t,o),[i,a]=d.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:h}=r,m=d.useCallback(()=>{a(null),h(!1)},[h]),g=d.useCallback((x,p)=>{const v=x.currentTarget,y={x:x.clientX,y:x.clientY},w=qv(y,v.getBoundingClientRect()),C=Kv(y,w),E=Qv(p.getBoundingClientRect()),P=Zv([...C,...E]);a(P),h(!0)},[h]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(l&&f){const x=v=>g(v,f),p=v=>g(v,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",p)}}},[l,f,g,m]),d.useEffect(()=>{if(i){const x=p=>{const v=p.target,y={x:p.clientX,y:p.clientY},w=(l==null?void 0:l.contains(v))||(f==null?void 0:f.contains(v)),C=!Yv(y,i);w?m():C&&(m(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,i,u,m]),c.jsx(lu,{...e,ref:s})}),[Vv,zv]=ho(er,{isInside:!1}),Gv=Mv("TooltipContent"),lu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=tr(Sn,n),u=mo(n),{onClose:f}=l;return d.useEffect(()=>(document.addEventListener(Ks,f),()=>document.removeEventListener(Ks,f)),[f]),d.useEffect(()=>{if(l.trigger){const h=m=>{const g=m.target;g!=null&&g.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),c.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(pc,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.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:[c.jsx(Gv,{children:r}),c.jsx(Vv,{scope:n,isInside:!0,children:c.jsx(fg,{id:l.contentId,role:"tooltip",children:o||r})})]})})});au.displayName=Sn;var cu="TooltipArrow",uu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=mo(n);return zv(cu,n).isInside?null:c.jsx(hc,{...o,...r,ref:t})});uu.displayName=cu;function qv(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Kv(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});break}return r}function Qv(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}]}function Yv(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],u=a.x,f=a.y,h=l.x,m=l.y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(o=!o)}return o}function Zv(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Xv(t)}function Xv(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Jv=ru,ey=ou,ty=su,ny=iu,ry=au,oy=uu;const du={tooltip:"tooltip__nUuSh",tooltipArrow:"tooltipArrow__W2w-f"},En=({children:e,open:t,displayName:n,tooltipContent:r,className:o,disabled:s,delayDuration:i=300,side:a="right",sideOffset:l=0})=>{const[u,f]=S.useState(!1),h=t!==void 0,g=s?!1:h?t:u,x=p=>{s||h||f(p)};return c.jsx(Jv,{delayDuration:i,children:c.jsxs(ey,{open:g,onOpenChange:x,children:[c.jsx(ty,{asChild:!0,children:e}),c.jsx(ny,{children:c.jsxs(ry,{className:L(du.tooltip,o),side:a,sideOffset:l,children:[n,r,c.jsx(oy,{className:du.tooltipArrow})]})})]})})};En.displayName="Tooltip";const fu={truncatedText:"truncatedText__Y-jSd",overflowing:"overflowing__o8TC-"},pu=({children:e,className:t,tooltipSide:n="top",tooltipClassName:r})=>{const o=S.useRef(null),[s,i]=S.useState(!1);S.useEffect(()=>{const l=()=>{if(o.current){const u=o.current.scrollWidth>o.current.clientWidth;i(u)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e]);const a=c.jsx("span",{ref:o,className:L(fu.truncatedText,s?fu.overflowing:"",t||""),children:e});return s?c.jsx(En,{tooltipContent:e,side:n,className:r,children:a}):a};pu.displayName="TextWithTooltip";const nr={SearchInput:"SearchInput__4OFyE",SearchIcon:"SearchIcon__YgnQy",ClearIcon:"ClearIcon__ukRVr",SearchInput__ClearIcon:"SearchInput__ClearIcon__uzVoc",SearchInput__SearchIcon:"SearchInput__SearchIcon__zoDG4"},Xs=S.forwardRef(({className:e,placeholder:t="Type to search...",showClearButton:n=!1,showSearchIcon:r=!0,onClear:o,...s},i)=>{const a=L(nr.SearchInput,n&&nr.SearchInput__ClearIcon,r&&nr.SearchInput__SearchIcon,e),l=L(nr.SearchIcon),u=L(nr.ClearIcon);return c.jsxs("div",{className:a,children:[c.jsx(Ur,{ref:i,type:"text",placeholder:t,...s}),r&&c.jsx("svg",{className:l,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M13 13L10.6667 10.6667M12.3333 6.66667C12.3333 9.79628 9.79628 12.3333 6.66667 12.3333C3.53705 12.3333 1 9.79628 1 6.66667C1 3.53705 3.53705 1 6.66667 1C9.79628 1 12.3333 3.53705 12.3333 6.66667Z",stroke:"#A4A4A4",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),n&&c.jsx("svg",{className:u,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:o,children:c.jsx("path",{d:"M7.33334 0.666748L0.666672 7.33341M0.666672 0.666748L7.33334 7.33341",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})]})});Xs.displayName="SearchInput";const Xt={SearchAutocomplete:"SearchAutocomplete__vR9Hk",AutocompleteItem:"AutocompleteItem__YIm7R","AutocompleteItem--canBeSelected":"AutocompleteItem--canBeSelected__jxk4z",AutocompleteHighlighter:"AutocompleteHighlighter__LAFTV",AutocompleteHighlighter__match:"AutocompleteHighlighter__match__Wy1o2",DropdownList:"DropdownList__-fHIk",AutocompleteItemDescription:"AutocompleteItemDescription__4QYN5"},Jt={DropdownList:"DropdownList__QTXXX",dropdownList:"DropdownList__QTXXX","DropdownList--closed":"DropdownList--closed__pdL1Z",dropdownListClosed:"DropdownList--closed__pdL1Z","DropdownList--open":"DropdownList--open__opzc9",dropdownListOpen:"DropdownList--open__opzc9","DropdownList--left":"DropdownList--left__xSwXR",dropdownListLeft:"DropdownList--left__xSwXR"},go=S.forwardRef(({children:e,className:t,open:n,align:r="right",...o},s)=>{const i=L(Jt.DropdownList,{[Jt["DropdownList--open"]]:n,[Jt["DropdownList--closed"]]:!n,[Jt["DropdownList--left"]]:r==="left"},t);return c.jsx("div",{ref:s,className:i,...o,children:e})});go.displayName="DropdownList";const rr=S.forwardRef(({children:e,className:t,canBeSelected:n=!1,...r},o)=>{const s=L(Xt.AutocompleteItem,{[Xt["AutocompleteItem--canBeSelected"]]:n},t);return c.jsx("div",{ref:o,className:s,role:n?"option":void 0,...r,children:e})});rr.displayName="AutocompleteItem";const sy=300,iy={query:"",suggestions:[],loading:!1,error:null},ay=({suggestionFetcher:e,canAdd:t})=>{const[n,r]=S.useState(iy);return S.useEffect(()=>{r(a=>({...a,loading:!0}));const s=async()=>{try{const a=await e(n.query);t&&!a.some(l=>l.value.toLowerCase()===n.query.toLowerCase())&&a.push({label:`Add "${n.query}"`,value:n.query,isNew:!0}),r(l=>({...l,suggestions:a,loading:!1}))}catch(a){r(l=>({...l,suggestions:[],error:a,loading:!1}))}},i=setTimeout(()=>{s()},sy);return()=>{clearTimeout(i)}},[n.query]),{...n,setQuery:s=>{r(i=>({...i,query:s}))}}},hu=S.forwardRef(({text:e,query:t,className:n,...r},o)=>{const s=L(Xt.AutocompleteHighlighter,n),i=(a,l)=>{const u=a.toLowerCase().indexOf(l.toLowerCase());if(u===-1||l.length===0)return a;const f=a.slice(0,u),h=a.slice(u,u+l.length),m=a.slice(u+l.length);return c.jsxs(c.Fragment,{children:[f,c.jsx("span",{className:Xt.AutocompleteHighlighter__match,children:h}),i(m,l)]})};return c.jsx("div",{ref:o,className:s,...r,children:i(e,t)})});hu.displayName="AutocompleteHighlighter";const ly=5,mu=S.forwardRef(({children:e,className:t,canAdd:n,maxSuggestionsShown:r=ly,searchInputProps:o,keepSelectedOption:s,suggestionFetcher:i,onAccept:a,...l},u)=>{const{query:f,setQuery:h,suggestions:m,loading:g}=ay({suggestionFetcher:i,canAdd:n}),[x,p]=S.useState(null),v=f.length>0,y=R=>{h(R.target.value)},w=R=>{a==null||a(R),s?(p(R),h(R.value)):h("")},C=()=>{a==null||a(null),p(null),h("")},E=L(Xt.SearchAutocomplete,t),P=m.slice(0,r),A=m.slice(r);return c.jsxs("div",{ref:u,className:E,...l,children:[c.jsx(Xs,{...o,value:f,onChange:y,showClearButton:!!x,onClear:C}),e,c.jsxs(go,{className:Xt.DropdownList,open:v&&!x,role:"listbox","aria-label":"Suggestions",children:[g?c.jsx(rr,{children:"Loading..."}):P.map(R=>c.jsxs(rr,{canBeSelected:!0,onClick:w.bind(null,R),children:[c.jsx(hu,{text:R.label,query:f}),R.description&&c.jsx("span",{className:Xt.AutocompleteItemDescription,children:R.description})]},R.value)),!g&&A.length>0&&c.jsxs(rr,{children:[A.length," more results"]}),v&&m.length===0&&!g&&c.jsx(rr,{children:"No results found"})]})]})});mu.displayName="SearchAutocomplete";const Tt=e=>{let t=null,n=null;return S.Children.forEach(e.children,r=>{const o=r.props.condition;o===void 0?n=r:!t&&o===!0&&(t=r)}),c.jsx(c.Fragment,{children:t||n})};Tt.displayName="Show",Tt.When=({condition:e,children:t})=>c.jsx(c.Fragment,{children:e&&t}),Tt.Else=({render:e,children:t})=>c.jsx(c.Fragment,{children:e||t});var cy=Symbol.for("react.lazy"),vo=d[" use ".trim().toString()];function uy(e){return typeof e=="object"&&e!==null&&"then"in e}function gu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===cy&&"_payload"in e&&uy(e._payload)}function dy(e){const t=py(e),n=d.forwardRef((r,o)=>{let{children:s,...i}=r;gu(s)&&typeof vo=="function"&&(s=vo(s._payload));const a=d.Children.toArray(s),l=a.find(my);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var fy=dy("Slot");function py(e){const t=d.forwardRef((n,r)=>{let{children:o,...s}=n;if(gu(o)&&typeof vo=="function"&&(o=vo(o._payload)),d.isValidElement(o)){const i=vy(o),a=gy(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hy=Symbol("radix.slottable");function my(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hy}function gy(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function vy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const vu={SkeletonListContainer:"SkeletonListContainer__MKJhE",Skeleton:"Skeleton__Ovpiw"},yo=S.forwardRef((e,t)=>{const{children:n,className:r,loading:o,height:s=48,width:i,borderRadius:a,style:l,...u}=e;if(!o&&n)return n;const f=S.isValidElement(n)?fy:"span";return c.jsx(f,{ref:t,"aria-hidden":!0,className:L(vu.Skeleton,r),style:{...l,width:i,minWidth:i,height:s,borderRadius:a},"data-inline-skeleton":S.isValidElement(n)?void 0:!0,tabIndex:-1,...u,children:n})});yo.displayName="Skeleton";const yu=e=>{const{numberOfItems:t,itemsGap:n=2,itemProps:r}=e,o=Array.from({length:t},(s,i)=>i+1);return c.jsx("div",{className:L(vu.SkeletonListContainer),style:{gap:n},children:o.map(s=>c.jsx(yo,{loading:!0,...r},s))})};yu.displayName="SkeletonList";const bu={spinner:"spinner__qa7F6",rotate:"rotate__EqlXe","spinner-dark":"spinner-dark__9A9-q",spinnerDark:"spinner-dark__9A9-q","spinner-white":"spinner-white__gRbtI",spinnerWhite:"spinner-white__gRbtI","spinner-success":"spinner-success__otWGm",spinnerSuccess:"spinner-success__otWGm","spinner-danger":"spinner-danger__Bq5DM",spinnerDanger:"spinner-danger__Bq5DM","spinner-warning":"spinner-warning__U900K",spinnerWarning:"spinner-warning__U900K"},wu=({className:e,color:t="white",size:n=80,thickness:r})=>{const o=L(bu.spinner,bu[`spinner-${t}`],e),s=r??Math.max(n/12,2);return c.jsx("span",{style:{width:n,height:n,borderWidth:s},className:o})};wu.displayName="Spinner";const bo={switch:"switch__0b2av",disabled:"disabled__KpauE",checked:"checked__2-JV-",thumb:"thumb__fEuKD"},_u=S.forwardRef(({checked:e,defaultChecked:t=!1,onCheckedChange:n,disabled:r=!1,id:o,className:s,name:i,"aria-label":a,"aria-labelledby":l,"aria-describedby":u,...f},h)=>{const[m,g]=S.useState(t),x=e!==void 0,p=x?!!e:m,v=()=>{if(r)return;const w=!p;x||g(w),n==null||n(w)},y=w=>{(w.key===" "||w.key==="Enter")&&(w.preventDefault(),v())};return c.jsx("button",{ref:h,type:"button",role:"switch","aria-checked":p,"aria-label":a,"aria-labelledby":l,"aria-describedby":u,disabled:r,id:o,name:i,className:L(bo.switch,{[bo.checked]:p,[bo.disabled]:r}),onClick:v,onKeyDown:y,...f,children:c.jsx("span",{className:bo.thumb,"aria-hidden":"true"})})});_u.displayName="Switch";const Xe={tabsRoot:"tabs-root__ELmdj",tabsList:"tabs-list__rc10N",tabsListHorizontal:"tabs-list--horizontal__e1YW4",tabsListVertical:"tabs-list--vertical__huK05",tabsTrigger:"tabs-trigger__D8R4R",tabsTriggerDisabled:"tabs-trigger--disabled__ezDWc",tabsTriggerHorizontal:"tabs-trigger--horizontal__4jBFV",tabsTriggerActive:"tabs-trigger--active__S-Z-S",tabsTriggerVertical:"tabs-trigger--vertical__dNVIZ",tabsContent:"tabs-content__1d77o"},xu=S.createContext(null),Js=()=>{const e=S.useContext(xu);if(!e)throw new Error("Tabs components must be used within a Tabs provider");return e},yy=({defaultValue:e,value:t,onValueChange:n,orientation:r="horizontal",className:o="",children:s})=>{const[i,a]=S.useState(e||""),l=t!==void 0,u=l?t:i,f=h=>{l||a(h),n==null||n(h)};return c.jsx(xu.Provider,{value:{value:u,onValueChange:f,orientation:r},children:c.jsx("div",{className:L(Xe.tabsRoot,o),children:s})})},by=({className:e="",children:t})=>{const{orientation:n}=Js(),r=S.useRef(null),o=s=>{var u;const i=(u=r.current)==null?void 0:u.querySelectorAll('[role="tab"]:not([disabled])');if(!i)return;const a=Array.from(i).findIndex(f=>f===document.activeElement);let l=a;switch(s.key){case"ArrowLeft":n==="horizontal"&&(s.preventDefault(),l=a>0?a-1:i.length-1);break;case"ArrowRight":n==="horizontal"&&(s.preventDefault(),l=a<i.length-1?a+1:0);break;case"ArrowUp":n==="vertical"&&(s.preventDefault(),l=a>0?a-1:i.length-1);break;case"ArrowDown":n==="vertical"&&(s.preventDefault(),l=a<i.length-1?a+1:0);break;case"Home":s.preventDefault(),l=0;break;case"End":s.preventDefault(),l=i.length-1;break}if(l!==a){const f=i[l];f.focus(),f.click()}};return c.jsx("div",{ref:r,role:"tablist","aria-orientation":n,onKeyDown:o,className:L(Xe.tabsList,n==="horizontal"?Xe.tabsListHorizontal:Xe.tabsListVertical,e),children:t})},wy=({value:e,disabled:t=!1,className:n="",children:r})=>{const{value:o,onValueChange:s,orientation:i}=Js(),a=o===e,l=()=>{t||s(e)};return c.jsx("button",{role:"tab","aria-selected":a,"aria-controls":`content-${e}`,tabIndex:a?0:-1,disabled:t,onClick:l,className:L(Xe.tabsTrigger,i==="horizontal"?Xe.tabsTriggerHorizontal:Xe.tabsTriggerVertical,a&&Xe.tabsTriggerActive,t&&Xe.tabsTriggerDisabled,n),children:r})},_y=({value:e,className:t="",children:n})=>{const{value:r}=Js();return r===e?c.jsx("div",{role:"tabpanel",id:`content-${e}`,"aria-labelledby":`trigger-${e}`,tabIndex:0,className:L(Xe.tabsContent,t),children:n}):null},Cu=({className:e,state:t="open",onClick:n})=>t==="open"?c.jsxs("svg",{className:e,onClick:n,xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 14 14",fill:"none",children:[c.jsx("path",{d:"M1.41174 7.41635C1.3323 7.29056 1.29257 7.22766 1.27034 7.13065C1.25364 7.05778 1.25364 6.94287 1.27034 6.87C1.29257 6.77299 1.3323 6.71009 1.41174 6.58431C2.06823 5.54482 4.02232 2.91699 7.00024 2.91699C9.97815 2.91699 11.9322 5.54482 12.5887 6.5843C12.6682 6.71009 12.7079 6.77299 12.7301 6.87C12.7468 6.94287 12.7468 7.05778 12.7301 7.13065C12.7079 7.22766 12.6682 7.29056 12.5887 7.41635C11.9322 8.45584 9.97815 11.0837 7.00024 11.0837C4.02232 11.0837 2.06823 8.45584 1.41174 7.41635Z",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.00024 8.75033C7.96673 8.75033 8.75024 7.96682 8.75024 7.00033C8.75024 6.03383 7.96673 5.25033 7.00024 5.25033C6.03374 5.25033 5.25024 6.03383 5.25024 7.00033C5.25024 7.96682 6.03374 8.75033 7.00024 8.75033Z",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"})]}):c.jsx("svg",{className:e,onClick:n,xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 14 14",fill:"none",children:c.jsx("path",{d:"M6.26672 2.97052C6.50379 2.93547 6.74835 2.91667 7.00024 2.91667C9.97816 2.91667 11.9323 5.54449 12.5887 6.58398C12.6682 6.70979 12.7079 6.7727 12.7302 6.86973C12.7469 6.94259 12.7468 7.05755 12.7301 7.13042C12.7079 7.22744 12.6679 7.29077 12.5879 7.41741C12.413 7.69425 12.1463 8.08331 11.793 8.50527M3.92252 3.9171C2.66131 4.77266 1.8051 5.9613 1.41231 6.58308C1.3325 6.70942 1.29259 6.7726 1.27035 6.86961C1.25364 6.94248 1.25363 7.05742 1.27033 7.13029C1.29257 7.22731 1.33229 7.29022 1.41174 7.41602C2.06823 8.45551 4.02232 11.0833 7.00024 11.0833C8.20098 11.0833 9.23526 10.6561 10.0851 10.078M1.75024 1.75L12.2502 12.25M5.76281 5.76256C5.44612 6.07925 5.25024 6.51675 5.25024 7C5.25024 7.9665 6.03374 8.75 7.00024 8.75C7.48349 8.75 7.92099 8.55413 8.23768 8.23744",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"})}),Su={PasswordInput:"PasswordInput__GDJDN",eyeIcon:"eyeIcon__kDExG"},xy=S.forwardRef((e,t)=>{const[n,r]=S.useState("password"),o=S.useCallback(()=>{r(s=>s==="password"?"text":"password")},[r]);return c.jsxs("div",{className:L(Su.PasswordInput,e.className),children:[c.jsx(Ur,{type:n,...e,ref:t}),c.jsx(Cu,{className:Su.eyeIcon,onClick:o,state:n==="password"?"open":"closed"})]})});function Cy(e){const t=Sy(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(Ty);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Sy(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=Ay(o),a=Py(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ey=Symbol("radix.slottable");function Ty(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ey}function Py(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ay(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wo="Dialog",[Eu]=Yn(wo),[Ry,Be]=Eu(wo),Tu=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),l=d.useRef(null),[u,f]=eo({prop:r,defaultProp:o??!1,onChange:s,caller:wo});return c.jsx(Ry,{scope:t,triggerRef:a,contentRef:l,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};Tu.displayName=wo;var Pu="DialogTrigger",Oy=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Pu,n),s=ce(t,o.triggerRef);return c.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ni(o.open),...r,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});Oy.displayName=Pu;var ei="DialogPortal",[Iy,Au]=Eu(ei,{forceMount:void 0}),Ru=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Be(ei,t);return c.jsx(Iy,{scope:t,forceMount:n,children:d.Children.map(r,i=>c.jsx(Cn,{present:n||s.open,children:c.jsx(Ns,{asChild:!0,container:o,children:i})}))})};Ru.displayName=ei;var _o="DialogOverlay",Ou=d.forwardRef((e,t)=>{const n=Au(_o,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Be(_o,e.__scopeDialog);return s.modal?c.jsx(Cn,{present:r||s.open,children:c.jsx(ky,{...o,ref:t})}):null});Ou.displayName=_o;var jy=Cy("DialogOverlay.RemoveScroll"),ky=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(_o,n);return c.jsx(Us,{as:jy,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(ie.div,{"data-state":ni(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),en="DialogContent",Iu=d.forwardRef((e,t)=>{const n=Au(en,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Be(en,e.__scopeDialog);return c.jsx(Cn,{present:r||s.open,children:s.modal?c.jsx(Ly,{...o,ref:t}):c.jsx(Ny,{...o,ref:t})})});Iu.displayName=en;var Ly=d.forwardRef((e,t)=>{const n=Be(en,e.__scopeDialog),r=d.useRef(null),o=ce(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return yc(s)},[]),c.jsx(ju,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),Ny=d.forwardRef((e,t)=>{const n=Be(en,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return c.jsx(ju,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ju=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Be(en,n),l=d.useRef(null),u=ce(t,l);return Tl(),c.jsxs(c.Fragment,{children:[c.jsx(_s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(Wr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ni(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Dy,{titleId:a.titleId}),c.jsx($y,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ti="DialogTitle",ku=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(ti,n);return c.jsx(ie.h2,{id:o.titleId,...r,ref:t})});ku.displayName=ti;var Lu="DialogDescription",Nu=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Lu,n);return c.jsx(ie.p,{id:o.descriptionId,...r,ref:t})});Nu.displayName=Lu;var Du="DialogClose",Mu=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Du,n);return c.jsx(ie.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Mu.displayName=Du;function ni(e){return e?"open":"closed"}var $u="DialogTitleWarning",[x2,Fu]=Jh($u,{contentName:en,titleName:ti,docsSlug:"dialog"}),Dy=({titleId:e})=>{const t=Fu($u),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
249
|
+
`)},qg=0,_n=[];function Kg(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(qg++)[0],s=d.useState(xc)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=yr([e.lockRef.current],(e.shards||[]).map(Rc),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=d.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var y=ao(p),w=n.current,C="deltaX"in p?p.deltaX:w[0]-y[0],E="deltaY"in p?p.deltaY:w[1]-y[1],P,A=p.target,R=Math.abs(C)>Math.abs(E)?"h":"v";if("touches"in p&&R==="h"&&A.type==="range")return!1;var N=window.getSelection(),k=N&&N.anchorNode,D=k?k===A||k.contains(A):!1;if(D)return!1;var U=Ec(R,A);if(!U)return!0;if(U?P=R:(P=R==="v"?"h":"v",U=Ec(R,A)),!U)return!1;if(!r.current&&"changedTouches"in p&&(C||E)&&(r.current=P),!P)return!0;var W=r.current||P;return Vg(W,v,p,W==="h"?C:E)},[]),l=d.useCallback(function(p){var v=p;if(!(!_n.length||_n[_n.length-1]!==s)){var y="deltaY"in v?Ac(v):ao(v),w=t.current.filter(function(P){return P.name===v.type&&(P.target===v.target||v.target===P.shadowParent)&&zg(P.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var C=(i.current.shards||[]).map(Rc).filter(Boolean).filter(function(P){return P.contains(v.target)}),E=C.length>0?a(v,C[0]):!i.current.noIsolation;E&&v.cancelable&&v.preventDefault()}}},[]),u=d.useCallback(function(p,v,y,w){var C={name:p,delta:v,target:y,should:w,shadowParent:Qg(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(E){return E!==C})},1)},[]),f=d.useCallback(function(p){n.current=ao(p),r.current=void 0},[]),h=d.useCallback(function(p){u(p.type,Ac(p),p.target,a(p,e.lockRef.current))},[]),m=d.useCallback(function(p){u(p.type,ao(p),p.target,a(p,e.lockRef.current))},[]);d.useEffect(function(){return _n.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,wn),document.addEventListener("touchmove",l,wn),document.addEventListener("touchstart",f,wn),function(){_n=_n.filter(function(p){return p!==s}),document.removeEventListener("wheel",l,wn),document.removeEventListener("touchmove",l,wn),document.removeEventListener("touchstart",f,wn)}},[]);var g=e.removeScrollBar,x=e.inert;return d.createElement(d.Fragment,null,x?d.createElement(s,{styles:Gg(o)}):null,g?d.createElement(Mg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qg(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Yg=Sg(_c,Kg);var Us=d.forwardRef(function(e,t){return d.createElement(so,Ge({},e,{ref:t,sideCar:Yg}))});Us.classNames=so.classNames;var Zg=[" ","Enter","ArrowUp","ArrowDown"],Xg=[" ","Enter"],Yt="Select",[lo,co,Jg]=i1(Yt),[xn]=Yn(Yt,[Jg,Jr]),uo=Jr(),[ev,St]=xn(Yt),[tv,nv]=xn(Yt),Oc=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:h,disabled:m,required:g,form:x}=e,p=uo(t),[v,y]=d.useState(null),[w,C]=d.useState(null),[E,P]=d.useState(!1),A=l1(u),[R,N]=eo({prop:r,defaultProp:o??!1,onChange:s,caller:Yt}),[k,D]=eo({prop:i,defaultProp:a,onChange:l,caller:Yt}),U=d.useRef(null),W=v?x||!!v.closest("form"):!0,[H,z]=d.useState(new Set),oe=Array.from(H).map(G=>G.props.value).join(";");return c.jsx(dc,{...p,children:c.jsxs(ev,{required:g,scope:t,trigger:v,onTriggerChange:y,valueNode:w,onValueNodeChange:C,valueNodeHasChildren:E,onValueNodeHasChildrenChange:P,contentId:Kt(),value:k,onValueChange:D,open:R,onOpenChange:N,dir:A,triggerPointerDownPosRef:U,disabled:m,children:[c.jsx(lo.Provider,{scope:t,children:c.jsx(tv,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(G=>{z(Y=>new Set(Y).add(G))},[]),onNativeOptionRemove:d.useCallback(G=>{z(Y=>{const F=new Set(Y);return F.delete(G),F})},[]),children:n})}),W?c.jsxs(Yc,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:h,value:k,onChange:G=>D(G.target.value),disabled:m,form:x,children:[k===void 0?c.jsx("option",{value:""}):null,Array.from(H)]},oe):null]})})};Oc.displayName=Yt;var Ic="SelectTrigger",jc=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=uo(n),i=St(Ic,n),a=i.disabled||r,l=ce(t,i.onTriggerChange),u=co(n),f=d.useRef("touch"),[h,m,g]=Xc(p=>{const v=u().filter(C=>!C.disabled),y=v.find(C=>C.value===i.value),w=Jc(v,p,y);w!==void 0&&i.onValueChange(w.value)}),x=p=>{a||(i.onOpenChange(!0),g()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(fc,{asChild:!0,...s,children:c.jsx(ie.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Zc(i.value)?"":void 0,...o,ref:l,onClick:Z(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&x(p)}),onPointerDown:Z(o.onPointerDown,p=>{f.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(x(p),p.preventDefault())}),onKeyDown:Z(o.onKeyDown,p=>{const v=h.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(v&&p.key===" ")&&Zg.includes(p.key)&&(x(),p.preventDefault())})})})});jc.displayName=Ic;var kc="SelectValue",Lc=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=St(kc,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,h=ce(t,l.onValueNodeChange);return ve(()=>{u(f)},[u,f]),c.jsx(ie.span,{...a,ref:h,style:{pointerEvents:"none"},children:Zc(l.value)?c.jsx(c.Fragment,{children:i}):s})});Lc.displayName=kc;var rv="SelectIcon",Nc=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Nc.displayName=rv;var Zt="SelectContent",Dc=d.forwardRef((e,t)=>{const n=St(Zt,e.__scopeSelect),[r,o]=d.useState();if(ve(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?hr.createPortal(c.jsx(Mc,{scope:e.__scopeSelect,children:c.jsx(lo.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx($c,{...e,ref:t})});Dc.displayName=Zt;var Fe=10,[Mc,Et]=xn(Zt),ov="SelectContentImpl",sv=tg("SelectContent.RemoveScroll"),$c=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:p,avoidCollisions:v,...y}=e,w=St(Zt,n),[C,E]=d.useState(null),[P,A]=d.useState(null),R=ce(t,$=>E($)),[N,k]=d.useState(null),[D,U]=d.useState(null),W=co(n),[H,z]=d.useState(!1),oe=d.useRef(!1);d.useEffect(()=>{if(C)return yc(C)},[C]),Tl();const G=d.useCallback($=>{const[te,...fe]=W().map(J=>J.ref.current),[X]=fe.slice(-1),ne=document.activeElement;for(const J of $)if(J===ne||(J==null||J.scrollIntoView({block:"nearest"}),J===te&&P&&(P.scrollTop=0),J===X&&P&&(P.scrollTop=P.scrollHeight),J==null||J.focus(),document.activeElement!==ne))return},[W,P]),Y=d.useCallback(()=>G([N,C]),[G,N,C]);d.useEffect(()=>{H&&Y()},[H,Y]);const{onOpenChange:F,triggerPointerDownPosRef:se}=w;d.useEffect(()=>{if(C){let $={x:0,y:0};const te=X=>{var ne,J;$={x:Math.abs(Math.round(X.pageX)-(((ne=se.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(X.pageY)-(((J=se.current)==null?void 0:J.y)??0))}},fe=X=>{$.x<=10&&$.y<=10?X.preventDefault():C.contains(X.target)||F(!1),document.removeEventListener("pointermove",te),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",fe,{capture:!0})}}},[C,F,se]),d.useEffect(()=>{const $=()=>F(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[F]);const[ge,ke]=Xc($=>{const te=W().filter(ne=>!ne.disabled),fe=te.find(ne=>ne.ref.current===document.activeElement),X=Jc(te,$,fe);X&&setTimeout(()=>X.ref.current.focus())}),Mt=d.useCallback(($,te,fe)=>{const X=!oe.current&&!fe;(w.value!==void 0&&w.value===te||X)&&(k($),X&&(oe.current=!0))},[w.value]),$t=d.useCallback(()=>C==null?void 0:C.focus(),[C]),rt=d.useCallback(($,te,fe)=>{const X=!oe.current&&!fe;(w.value!==void 0&&w.value===te||X)&&U($)},[w.value]),Ft=r==="popper"?Ws:Fc,Ve=Ft===Ws?{side:a,sideOffset:l,align:u,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(Mc,{scope:n,content:C,viewport:P,onViewportChange:A,itemRefCallback:Mt,selectedItem:N,onItemLeave:$t,itemTextRefCallback:rt,focusSelectedItem:Y,selectedItemText:D,position:r,isPositioned:H,searchRef:ge,children:c.jsx(Us,{as:sv,allowPinchZoom:!0,children:c.jsx(_s,{asChild:!0,trapped:w.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:Z(o,$=>{var te;(te=w.trigger)==null||te.focus({preventScroll:!0}),$.preventDefault()}),children:c.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:c.jsx(Ft,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:$=>$.preventDefault(),...y,...Ve,onPlaced:()=>z(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Z(y.onKeyDown,$=>{const te=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!te&&$.key.length===1&&ke($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let X=W().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const ne=$.target,J=X.indexOf(ne);X=X.slice(J+1)}setTimeout(()=>G(X)),$.preventDefault()}})})})})})})});$c.displayName=ov;var iv="SelectItemAlignedPosition",Fc=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=St(Zt,n),i=Et(Zt,n),[a,l]=d.useState(null),[u,f]=d.useState(null),h=ce(t,R=>f(R)),m=co(n),g=d.useRef(!1),x=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:w}=i,C=d.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&p&&v&&y){const R=s.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),k=s.valueNode.getBoundingClientRect(),D=y.getBoundingClientRect();if(s.dir!=="rtl"){const ne=D.left-N.left,J=k.left-ne,Ce=R.left-J,Le=R.width+Ce,ot=Math.max(Le,N.width),ze=window.innerWidth-Fe,Bt=bl(J,[Fe,Math.max(Fe,ze-ot)]);a.style.minWidth=Le+"px",a.style.left=Bt+"px"}else{const ne=N.right-D.right,J=window.innerWidth-k.right-ne,Ce=window.innerWidth-R.right-J,Le=R.width+Ce,ot=Math.max(Le,N.width),ze=window.innerWidth-Fe,Bt=bl(J,[Fe,Math.max(Fe,ze-ot)]);a.style.minWidth=Le+"px",a.style.right=Bt+"px"}const U=m(),W=window.innerHeight-Fe*2,H=p.scrollHeight,z=window.getComputedStyle(u),oe=parseInt(z.borderTopWidth,10),G=parseInt(z.paddingTop,10),Y=parseInt(z.borderBottomWidth,10),F=parseInt(z.paddingBottom,10),se=oe+G+H+F+Y,ge=Math.min(v.offsetHeight*5,se),ke=window.getComputedStyle(p),Mt=parseInt(ke.paddingTop,10),$t=parseInt(ke.paddingBottom,10),rt=R.top+R.height/2-Fe,Ft=W-rt,Ve=v.offsetHeight/2,$=v.offsetTop+Ve,te=oe+G+$,fe=se-te;if(te<=rt){const ne=U.length>0&&v===U[U.length-1].ref.current;a.style.bottom="0px";const J=u.clientHeight-p.offsetTop-p.offsetHeight,Ce=Math.max(Ft,Ve+(ne?$t:0)+J+Y),Le=te+Ce;a.style.height=Le+"px"}else{const ne=U.length>0&&v===U[0].ref.current;a.style.top="0px";const Ce=Math.max(rt,oe+p.offsetTop+(ne?Mt:0)+Ve)+fe;a.style.height=Ce+"px",p.scrollTop=te-rt+p.offsetTop}a.style.margin=`${Fe}px 0`,a.style.minHeight=ge+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[m,s.trigger,s.valueNode,a,u,p,v,y,s.dir,r]);ve(()=>C(),[C]);const[E,P]=d.useState();ve(()=>{u&&P(window.getComputedStyle(u).zIndex)},[u]);const A=d.useCallback(R=>{R&&x.current===!0&&(C(),w==null||w(),x.current=!1)},[C,w]);return c.jsx(lv,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:A,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:c.jsx(ie.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Fc.displayName=iv;var av="SelectPopperPosition",Ws=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Fe,...s}=e,i=uo(n);return c.jsx(pc,{...i,...s,ref:t,align:r,collisionPadding:o,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)"}})});Ws.displayName=av;var[lv,Hs]=xn(Zt,{}),Vs="SelectViewport",Bc=d.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Et(Vs,n),i=Hs(Vs,n),a=ce(t,s.onViewportChange),l=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.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:r}),c.jsx(lo.Slot,{scope:n,children:c.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Z(o.onScroll,u=>{const f=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const g=Math.abs(l.current-f.scrollTop);if(g>0){const x=window.innerHeight-Fe*2,p=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),y=Math.max(p,v);if(y<x){const w=y+g,C=Math.min(x,w),E=w-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,h.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Bc.displayName=Vs;var Uc="SelectGroup",[cv,uv]=xn(Uc),Wc=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kt();return c.jsx(cv,{scope:n,id:o,children:c.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Wc.displayName=Uc;var Hc="SelectLabel",dv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=uv(Hc,n);return c.jsx(ie.div,{id:o.id,...r,ref:t})});dv.displayName=Hc;var fo="SelectItem",[fv,Vc]=xn(fo),zc=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=St(fo,n),l=Et(fo,n),u=a.value===r,[f,h]=d.useState(s??""),[m,g]=d.useState(!1),x=ce(t,w=>{var C;return(C=l.itemRefCallback)==null?void 0:C.call(l,w,r,o)}),p=Kt(),v=d.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 c.jsx(fv,{scope:n,value:r,disabled:o,textId:p,isSelected:u,onItemTextChange:d.useCallback(w=>{h(C=>C||((w==null?void 0:w.textContent)??"").trim())},[]),children:c.jsx(lo.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:c.jsx(ie.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:Z(i.onFocus,()=>g(!0)),onBlur:Z(i.onBlur,()=>g(!1)),onClick:Z(i.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:Z(i.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:Z(i.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Z(i.onPointerMove,w=>{var C;v.current=w.pointerType,o?(C=l.onItemLeave)==null||C.call(l):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(i.onPointerLeave,w=>{var C;w.currentTarget===document.activeElement&&((C=l.onItemLeave)==null||C.call(l))}),onKeyDown:Z(i.onKeyDown,w=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&w.key===" "||(Xg.includes(w.key)&&y(),w.key===" "&&w.preventDefault())})})})})});zc.displayName=fo;var Jn="SelectItemText",Gc=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=St(Jn,n),a=Et(Jn,n),l=Vc(Jn,n),u=nv(Jn,n),[f,h]=d.useState(null),m=ce(t,y=>h(y),l.onItemTextChange,y=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,y,l.value,l.disabled)}),g=f==null?void 0:f.textContent,x=d.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return ve(()=>(p(x),()=>v(x)),[p,v,x]),c.jsxs(c.Fragment,{children:[c.jsx(ie.span,{id:l.textId,...s,ref:m}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?hr.createPortal(s.children,i.valueNode):null]})});Gc.displayName=Jn;var qc="SelectItemIndicator",Kc=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vc(qc,n).isSelected?c.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});Kc.displayName=qc;var zs="SelectScrollUpButton",pv=d.forwardRef((e,t)=>{const n=Et(zs,e.__scopeSelect),r=Hs(zs,e.__scopeSelect),[o,s]=d.useState(!1),i=ce(t,r.onScrollButtonChange);return ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(Qc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});pv.displayName=zs;var Gs="SelectScrollDownButton",hv=d.forwardRef((e,t)=>{const n=Et(Gs,e.__scopeSelect),r=Hs(Gs,e.__scopeSelect),[o,s]=d.useState(!1),i=ce(t,r.onScrollButtonChange);return ve(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(Qc,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});hv.displayName=Gs;var Qc=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Et("SelectScrollButton",n),i=d.useRef(null),a=co(n),l=d.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return d.useEffect(()=>()=>l(),[l]),ve(()=>{var f;const u=a().find(h=>h.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),c.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Z(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Z(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Z(o.onPointerLeave,()=>{l()})})}),mv="SelectSeparator",gv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});gv.displayName=mv;var qs="SelectArrow",vv=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=uo(n),s=St(qs,n),i=Et(qs,n);return s.open&&i.position==="popper"?c.jsx(hc,{...o,...r,ref:t}):null});vv.displayName=qs;var yv="SelectBubbleInput",Yc=d.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=d.useRef(null),s=ce(r,o),i=ug(t);return d.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(a,t),a.dispatchEvent(h)}},[i,t]),c.jsx(ie.select,{...n,style:{...mc,...n.style},ref:s,defaultValue:t})});Yc.displayName=yv;function Zc(e){return e===""||e===void 0}function Xc(e){const t=qt(e),n=d.useRef(""),r=d.useRef(0),o=d.useCallback(i=>{const a=n.current+i;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Jc(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=bv(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function bv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var wv=Oc,_v=jc,xv=Lc,Cv=Nc,Sv=Dc,Ev=Bc,Tv=Wc,Pv=zc,Av=Gc,Rv=Kc;const Ze={Container:"Container__xcHXp",Label:"Label__0cZB9",HelperText:"HelperText__m1nA9",Trigger:"Trigger__AyFUd",TriggerIcon:"TriggerIcon__aygFG",Content:"Content__llztG",Viewport:"Viewport__COtSL",Item:"Item__XN1-2",ItemIndicatorContainer:"ItemIndicatorContainer__EQH-X",ItemIndicator:"ItemIndicator__bySSc"},eu=S.forwardRef(({label:e,helperText:t,value:n,onValueChange:r,options:o,placeholder:s="Select",disabled:i=!1,className:a,name:l},u)=>c.jsxs("div",{className:L(Ze.Container,a),children:[e&&c.jsx("label",{className:Ze.Label,children:e}),c.jsxs(wv,{value:n,onValueChange:r,disabled:i,name:l,children:[c.jsxs(_v,{ref:u,className:Ze.Trigger,children:[c.jsx(xv,{placeholder:s}),c.jsx(Cv,{className:Ze.TriggerIcon,children:c.jsx(Ov,{})})]}),c.jsx(Sv,{className:Ze.Content,position:"popper",sideOffset:4,children:c.jsx(Ev,{className:Ze.Viewport,children:c.jsx(Tv,{children:o.map(f=>c.jsxs(Pv,{value:f.value,disabled:f.disabled,className:Ze.Item,children:[c.jsx("div",{className:Ze.ItemIndicatorContainer,children:c.jsx(Rv,{className:Ze.ItemIndicator,children:c.jsx(Iv,{})})}),c.jsx(Av,{children:f.label})]},f.value))})})})]}),t&&c.jsx("div",{className:Ze.HelperText,children:t})]}));eu.displayName="Select";const Ov=()=>c.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.52459 12.7746C6.8907 12.4085 7.4843 12.4085 7.85041 12.7746L10 14.9242L12.1496 12.7746C12.5157 12.4085 13.1093 12.4085 13.4754 12.7746C13.8415 13.1407 13.8415 13.7343 13.4754 14.1004L10.6629 16.9129C10.2968 17.279 9.7032 17.279 9.33709 16.9129L6.52459 14.1004C6.15847 13.7343 6.15847 13.1407 6.52459 12.7746Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4754 7.22541C13.1093 7.59153 12.5157 7.59153 12.1496 7.22541L10 5.07583L7.85041 7.22541C7.4843 7.59153 6.8907 7.59153 6.52459 7.22541C6.15847 6.8593 6.15847 6.2657 6.52459 5.89959L9.33709 3.08709C9.7032 2.72097 10.2968 2.72097 10.6629 3.08709L13.4754 5.89959C13.8415 6.2657 13.8415 6.8593 13.4754 7.22541Z",fill:"currentColor"})]}),Iv=()=>c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jv={TextArea:"TextArea__pa-A0"},tu=S.forwardRef(({children:e,className:t,...n},r)=>{const o=L(jv.TextArea,t);return c.jsx("textarea",{ref:r,className:o,...n,children:e})});tu.displayName="TextArea";function kv(e,t){return d.useReducer((n,r)=>t[n][r]??n,e)}var Cn=e=>{const{present:t,children:n}=e,r=Lv(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=ce(r.ref,Nv(o));return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Cn.displayName="Presence";function Lv(e){const[t,n]=d.useState(),r=d.useRef(null),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[a,l]=kv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=po(r.current);s.current=a==="mounted"?u:"none"},[a]),ve(()=>{const u=r.current,f=o.current;if(f!==e){const m=s.current,g=po(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ve(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,h=g=>{const p=po(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&p&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=g=>{g.target===t&&(s.current=po(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:d.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function po(e){return(e==null?void 0:e.animationName)||"none"}function Nv(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dv=Symbol("radix.slottable");function Mv(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Dv,t}var[ho]=Yn("Tooltip",[Jr]),mo=Jr(),nu="TooltipProvider",$v=700,Ks="tooltip.open",[Fv,Qs]=ho(nu),ru=e=>{const{__scopeTooltip:t,delayDuration:n=$v,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=d.useRef(!0),a=d.useRef(!1),l=d.useRef(0);return d.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(Fv,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:d.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};ru.displayName=nu;var er="Tooltip",[Bv,tr]=ho(er),ou=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Qs(er,e.__scopeTooltip),u=mo(t),[f,h]=d.useState(null),m=Kt(),g=d.useRef(0),x=i??l.disableHoverableContent,p=a??l.delayDuration,v=d.useRef(!1),[y,w]=eo({prop:r,defaultProp:o??!1,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ks))):l.onClose(),s==null||s(R)},caller:er}),C=d.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),E=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,w(!0)},[w]),P=d.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),A=d.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,w(!0),g.current=0},p)},[p,w]);return d.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),c.jsx(dc,{...u,children:c.jsx(Bv,{scope:t,contentId:m,open:y,stateAttribute:C,trigger:f,onTriggerChange:h,onTriggerEnter:d.useCallback(()=>{l.isOpenDelayedRef.current?A():E()},[l.isOpenDelayedRef,A,E]),onTriggerLeave:d.useCallback(()=>{x?P():(window.clearTimeout(g.current),g.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:n})})};ou.displayName=er;var Ys="TooltipTrigger",su=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tr(Ys,n),s=Qs(Ys,n),i=mo(n),a=d.useRef(null),l=ce(t,a,o.onTriggerChange),u=d.useRef(!1),f=d.useRef(!1),h=d.useCallback(()=>u.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(fc,{asChild:!0,...i,children:c.jsx(ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Z(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Z(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:Z(e.onBlur,o.onClose),onClick:Z(e.onClick,o.onClose)})})});su.displayName=Ys;var Zs="TooltipPortal",[Uv,Wv]=ho(Zs,{forceMount:void 0}),iu=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=tr(Zs,t);return c.jsx(Uv,{scope:t,forceMount:n,children:c.jsx(Cn,{present:n||s.open,children:c.jsx(Ns,{asChild:!0,container:o,children:r})})})};iu.displayName=Zs;var Sn="TooltipContent",au=d.forwardRef((e,t)=>{const n=Wv(Sn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=tr(Sn,e.__scopeTooltip);return c.jsx(Cn,{present:r||i.open,children:i.disableHoverableContent?c.jsx(lu,{side:o,...s,ref:t}):c.jsx(Hv,{side:o,...s,ref:t})})}),Hv=d.forwardRef((e,t)=>{const n=tr(Sn,e.__scopeTooltip),r=Qs(Sn,e.__scopeTooltip),o=d.useRef(null),s=ce(t,o),[i,a]=d.useState(null),{trigger:l,onClose:u}=n,f=o.current,{onPointerInTransitChange:h}=r,m=d.useCallback(()=>{a(null),h(!1)},[h]),g=d.useCallback((x,p)=>{const v=x.currentTarget,y={x:x.clientX,y:x.clientY},w=qv(y,v.getBoundingClientRect()),C=Kv(y,w),E=Qv(p.getBoundingClientRect()),P=Zv([...C,...E]);a(P),h(!0)},[h]);return d.useEffect(()=>()=>m(),[m]),d.useEffect(()=>{if(l&&f){const x=v=>g(v,f),p=v=>g(v,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",p)}}},[l,f,g,m]),d.useEffect(()=>{if(i){const x=p=>{const v=p.target,y={x:p.clientX,y:p.clientY},w=(l==null?void 0:l.contains(v))||(f==null?void 0:f.contains(v)),C=!Yv(y,i);w?m():C&&(m(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,i,u,m]),c.jsx(lu,{...e,ref:s})}),[Vv,zv]=ho(er,{isInside:!1}),Gv=Mv("TooltipContent"),lu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=tr(Sn,n),u=mo(n),{onClose:f}=l;return d.useEffect(()=>(document.addEventListener(Ks,f),()=>document.removeEventListener(Ks,f)),[f]),d.useEffect(()=>{if(l.trigger){const h=m=>{const g=m.target;g!=null&&g.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),c.jsx(Wr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:c.jsxs(pc,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.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:[c.jsx(Gv,{children:r}),c.jsx(Vv,{scope:n,isInside:!0,children:c.jsx(fg,{id:l.contentId,role:"tooltip",children:o||r})})]})})});au.displayName=Sn;var cu="TooltipArrow",uu=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=mo(n);return zv(cu,n).isInside?null:c.jsx(hc,{...o,...r,ref:t})});uu.displayName=cu;function qv(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Kv(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});break}return r}function Qv(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}]}function Yv(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],u=a.x,f=a.y,h=l.x,m=l.y;f>r!=m>r&&n<(h-u)*(r-f)/(m-f)+u&&(o=!o)}return o}function Zv(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Xv(t)}function Xv(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Jv=ru,ey=ou,ty=su,ny=iu,ry=au,oy=uu;const du={tooltip:"tooltip__nUuSh",tooltipArrow:"tooltipArrow__W2w-f"},En=({children:e,open:t,displayName:n,tooltipContent:r,className:o,disabled:s,delayDuration:i=300,side:a="right",sideOffset:l=0})=>{const[u,f]=S.useState(!1),h=t!==void 0,g=s?!1:h?t:u,x=p=>{s||h||f(p)};return c.jsx(Jv,{delayDuration:i,children:c.jsxs(ey,{open:g,onOpenChange:x,children:[c.jsx(ty,{asChild:!0,children:e}),c.jsx(ny,{children:c.jsxs(ry,{className:L(du.tooltip,o),side:a,sideOffset:l,children:[n,r,c.jsx(oy,{className:du.tooltipArrow})]})})]})})};En.displayName="Tooltip";const fu={truncatedText:"truncatedText__Y-jSd",overflowing:"overflowing__o8TC-"},pu=({children:e,className:t,tooltipSide:n="top",tooltipClassName:r})=>{const o=S.useRef(null),[s,i]=S.useState(!1);S.useEffect(()=>{const l=()=>{if(o.current){const u=o.current.scrollWidth>o.current.clientWidth;i(u)}};return l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}},[e]);const a=c.jsx("span",{ref:o,className:L(fu.truncatedText,s?fu.overflowing:"",t||""),children:e});return s?c.jsx(En,{tooltipContent:e,side:n,className:r,children:a}):a};pu.displayName="TextWithTooltip";const nr={SearchInput:"SearchInput__4OFyE",SearchIcon:"SearchIcon__YgnQy",ClearIcon:"ClearIcon__ukRVr",SearchInput__ClearIcon:"SearchInput__ClearIcon__uzVoc",SearchInput__SearchIcon:"SearchInput__SearchIcon__zoDG4"},Xs=S.forwardRef(({className:e,placeholder:t="Type to search...",showClearButton:n=!1,showSearchIcon:r=!0,onClear:o,...s},i)=>{const a=L(nr.SearchInput,n&&nr.SearchInput__ClearIcon,r&&nr.SearchInput__SearchIcon,e),l=L(nr.SearchIcon),u=L(nr.ClearIcon);return c.jsxs("div",{className:a,children:[c.jsx(Ur,{ref:i,type:"text",placeholder:t,...s}),r&&c.jsx("svg",{className:l,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M13 13L10.6667 10.6667M12.3333 6.66667C12.3333 9.79628 9.79628 12.3333 6.66667 12.3333C3.53705 12.3333 1 9.79628 1 6.66667C1 3.53705 3.53705 1 6.66667 1C9.79628 1 12.3333 3.53705 12.3333 6.66667Z",stroke:"#A4A4A4",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),n&&c.jsx("svg",{className:u,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:o,children:c.jsx("path",{d:"M7.33334 0.666748L0.666672 7.33341M0.666672 0.666748L7.33334 7.33341",stroke:"#818181",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})})]})});Xs.displayName="SearchInput";const Xt={SearchAutocomplete:"SearchAutocomplete__vR9Hk",AutocompleteItem:"AutocompleteItem__YIm7R","AutocompleteItem--canBeSelected":"AutocompleteItem--canBeSelected__jxk4z",AutocompleteHighlighter:"AutocompleteHighlighter__LAFTV",AutocompleteHighlighter__match:"AutocompleteHighlighter__match__Wy1o2",DropdownList:"DropdownList__-fHIk",AutocompleteItemDescription:"AutocompleteItemDescription__4QYN5"},Jt={DropdownList:"DropdownList__QTXXX",dropdownList:"DropdownList__QTXXX","DropdownList--closed":"DropdownList--closed__pdL1Z",dropdownListClosed:"DropdownList--closed__pdL1Z","DropdownList--open":"DropdownList--open__opzc9",dropdownListOpen:"DropdownList--open__opzc9","DropdownList--left":"DropdownList--left__xSwXR",dropdownListLeft:"DropdownList--left__xSwXR"},go=S.forwardRef(({children:e,className:t,open:n,align:r="right",...o},s)=>{const i=L(Jt.DropdownList,{[Jt["DropdownList--open"]]:n,[Jt["DropdownList--closed"]]:!n,[Jt["DropdownList--left"]]:r==="left"},t);return c.jsx("div",{ref:s,className:i,...o,children:e})});go.displayName="DropdownList";const rr=S.forwardRef(({children:e,className:t,canBeSelected:n=!1,...r},o)=>{const s=L(Xt.AutocompleteItem,{[Xt["AutocompleteItem--canBeSelected"]]:n},t);return c.jsx("div",{ref:o,className:s,role:n?"option":void 0,...r,children:e})});rr.displayName="AutocompleteItem";const sy=300,iy={query:"",suggestions:[],loading:!1,error:null},ay=({suggestionFetcher:e,canAdd:t})=>{const[n,r]=S.useState(iy);return S.useEffect(()=>{r(a=>({...a,loading:!0}));const s=async()=>{try{const a=await e(n.query);t&&!a.some(l=>l.value.toLowerCase()===n.query.toLowerCase())&&a.push({label:`Add "${n.query}"`,value:n.query,isNew:!0}),r(l=>({...l,suggestions:a,loading:!1}))}catch(a){r(l=>({...l,suggestions:[],error:a,loading:!1}))}},i=setTimeout(()=>{s()},sy);return()=>{clearTimeout(i)}},[n.query]),{...n,setQuery:s=>{r(i=>({...i,query:s}))}}},hu=S.forwardRef(({text:e,query:t,className:n,...r},o)=>{const s=L(Xt.AutocompleteHighlighter,n),i=(a,l)=>{const u=a.toLowerCase().indexOf(l.toLowerCase());if(u===-1||l.length===0)return a;const f=a.slice(0,u),h=a.slice(u,u+l.length),m=a.slice(u+l.length);return c.jsxs(c.Fragment,{children:[f,c.jsx("span",{className:Xt.AutocompleteHighlighter__match,children:h}),i(m,l)]})};return c.jsx("div",{ref:o,className:s,...r,children:i(e,t)})});hu.displayName="AutocompleteHighlighter";const ly=5,mu=S.forwardRef(({children:e,className:t,canAdd:n,maxSuggestionsShown:r=ly,searchInputProps:o,keepSelectedOption:s,suggestionFetcher:i,onAccept:a,...l},u)=>{const{query:f,setQuery:h,suggestions:m,loading:g}=ay({suggestionFetcher:i,canAdd:n}),[x,p]=S.useState(null),v=f.length>0,y=R=>{h(R.target.value)},w=R=>{a==null||a(R),s?(p(R),h(R.value)):h("")},C=()=>{a==null||a(null),p(null),h("")},E=L(Xt.SearchAutocomplete,t),P=m.slice(0,r),A=m.slice(r);return c.jsxs("div",{ref:u,className:E,...l,children:[c.jsx(Xs,{...o,value:f,onChange:y,showClearButton:!!x,onClear:C}),e,c.jsxs(go,{className:Xt.DropdownList,open:v&&!x,role:"listbox","aria-label":"Suggestions",children:[g?c.jsx(rr,{children:"Loading..."}):P.map(R=>c.jsxs(rr,{canBeSelected:!0,onClick:w.bind(null,R),children:[c.jsx(hu,{text:R.label,query:f}),R.description&&c.jsx("span",{className:Xt.AutocompleteItemDescription,children:R.description})]},R.value)),!g&&A.length>0&&c.jsxs(rr,{children:[A.length," more results"]}),v&&m.length===0&&!g&&c.jsx(rr,{children:"No results found"})]})]})});mu.displayName="SearchAutocomplete";const Tt=e=>{let t=null,n=null;return S.Children.forEach(e.children,r=>{const o=r.props.condition;o===void 0?n=r:!t&&o===!0&&(t=r)}),c.jsx(c.Fragment,{children:t||n})};Tt.displayName="Show",Tt.When=({condition:e,children:t})=>c.jsx(c.Fragment,{children:e&&t}),Tt.Else=({render:e,children:t})=>c.jsx(c.Fragment,{children:e||t});var cy=Symbol.for("react.lazy"),vo=d[" use ".trim().toString()];function uy(e){return typeof e=="object"&&e!==null&&"then"in e}function gu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===cy&&"_payload"in e&&uy(e._payload)}function dy(e){const t=py(e),n=d.forwardRef((r,o)=>{let{children:s,...i}=r;gu(s)&&typeof vo=="function"&&(s=vo(s._payload));const a=d.Children.toArray(s),l=a.find(my);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var fy=dy("Slot");function py(e){const t=d.forwardRef((n,r)=>{let{children:o,...s}=n;if(gu(o)&&typeof vo=="function"&&(o=vo(o._payload)),d.isValidElement(o)){const i=vy(o),a=gy(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hy=Symbol("radix.slottable");function my(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hy}function gy(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function vy(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const vu={SkeletonListContainer:"SkeletonListContainer__MKJhE",Skeleton:"Skeleton__Ovpiw"},yo=S.forwardRef((e,t)=>{const{children:n,className:r,loading:o,height:s=48,width:i,borderRadius:a,style:l,...u}=e;if(!o&&n)return n;const f=S.isValidElement(n)?fy:"span";return c.jsx(f,{ref:t,"aria-hidden":!0,className:L(vu.Skeleton,r),style:{...l,width:i,minWidth:i,height:s,borderRadius:a},"data-inline-skeleton":S.isValidElement(n)?void 0:!0,tabIndex:-1,...u,children:n})});yo.displayName="Skeleton";const yu=e=>{const{numberOfItems:t,itemsGap:n=2,itemProps:r}=e,o=Array.from({length:t},(s,i)=>i+1);return c.jsx("div",{className:L(vu.SkeletonListContainer),style:{gap:n},children:o.map(s=>c.jsx(yo,{loading:!0,...r},s))})};yu.displayName="SkeletonList";const bu={spinner:"spinner__qa7F6",rotate:"rotate__EqlXe","spinner-dark":"spinner-dark__9A9-q",spinnerDark:"spinner-dark__9A9-q","spinner-white":"spinner-white__gRbtI",spinnerWhite:"spinner-white__gRbtI","spinner-success":"spinner-success__otWGm",spinnerSuccess:"spinner-success__otWGm","spinner-danger":"spinner-danger__Bq5DM",spinnerDanger:"spinner-danger__Bq5DM","spinner-warning":"spinner-warning__U900K",spinnerWarning:"spinner-warning__U900K"},wu=({className:e,color:t="white",size:n=80,thickness:r})=>{const o=L(bu.spinner,bu[`spinner-${t}`],e),s=r??Math.max(n/12,2);return c.jsx("span",{style:{width:n,height:n,borderWidth:s},className:o})};wu.displayName="Spinner";const bo={switch:"switch__0b2av",disabled:"disabled__KpauE",checked:"checked__2-JV-",thumb:"thumb__fEuKD"},_u=S.forwardRef(({checked:e,defaultChecked:t=!1,onCheckedChange:n,disabled:r=!1,id:o,className:s,name:i,"aria-label":a,"aria-labelledby":l,"aria-describedby":u,...f},h)=>{const[m,g]=S.useState(t),x=e!==void 0,p=x?!!e:m,v=()=>{if(r)return;const w=!p;x||g(w),n==null||n(w)},y=w=>{(w.key===" "||w.key==="Enter")&&(w.preventDefault(),v())};return c.jsx("button",{ref:h,type:"button",role:"switch","aria-checked":p,"aria-label":a,"aria-labelledby":l,"aria-describedby":u,disabled:r,id:o,name:i,className:L(bo.switch,{[bo.checked]:p,[bo.disabled]:r}),onClick:v,onKeyDown:y,...f,children:c.jsx("span",{className:bo.thumb,"aria-hidden":"true"})})});_u.displayName="Switch";const Xe={tabsRoot:"tabs-root__ELmdj",tabsList:"tabs-list__rc10N",tabsListHorizontal:"tabs-list--horizontal__e1YW4",tabsListVertical:"tabs-list--vertical__huK05",tabsTrigger:"tabs-trigger__D8R4R",tabsTriggerDisabled:"tabs-trigger--disabled__ezDWc",tabsTriggerHorizontal:"tabs-trigger--horizontal__4jBFV",tabsTriggerActive:"tabs-trigger--active__S-Z-S",tabsTriggerVertical:"tabs-trigger--vertical__dNVIZ",tabsContent:"tabs-content__1d77o"},xu=S.createContext(null),Js=()=>{const e=S.useContext(xu);if(!e)throw new Error("Tabs components must be used within a Tabs provider");return e},yy=({defaultValue:e,value:t,onValueChange:n,orientation:r="horizontal",className:o="",children:s})=>{const[i,a]=S.useState(e||""),l=t!==void 0,u=l?t:i,f=h=>{l||a(h),n==null||n(h)};return c.jsx(xu.Provider,{value:{value:u,onValueChange:f,orientation:r},children:c.jsx("div",{className:L(Xe.tabsRoot,o),children:s})})},by=({className:e="",children:t})=>{const{orientation:n}=Js(),r=S.useRef(null),o=s=>{var u;const i=(u=r.current)==null?void 0:u.querySelectorAll('[role="tab"]:not([disabled])');if(!i)return;const a=Array.from(i).findIndex(f=>f===document.activeElement);let l=a;switch(s.key){case"ArrowLeft":n==="horizontal"&&(s.preventDefault(),l=a>0?a-1:i.length-1);break;case"ArrowRight":n==="horizontal"&&(s.preventDefault(),l=a<i.length-1?a+1:0);break;case"ArrowUp":n==="vertical"&&(s.preventDefault(),l=a>0?a-1:i.length-1);break;case"ArrowDown":n==="vertical"&&(s.preventDefault(),l=a<i.length-1?a+1:0);break;case"Home":s.preventDefault(),l=0;break;case"End":s.preventDefault(),l=i.length-1;break}if(l!==a){const f=i[l];f.focus(),f.click()}};return c.jsx("div",{ref:r,role:"tablist","aria-orientation":n,onKeyDown:o,className:L(Xe.tabsList,n==="horizontal"?Xe.tabsListHorizontal:Xe.tabsListVertical,e),children:t})},wy=({value:e,disabled:t=!1,className:n="",children:r})=>{const{value:o,onValueChange:s,orientation:i}=Js(),a=o===e,l=()=>{t||s(e)};return c.jsx("button",{role:"tab","aria-selected":a,"aria-controls":`content-${e}`,tabIndex:a?0:-1,disabled:t,onClick:l,className:L(Xe.tabsTrigger,i==="horizontal"?Xe.tabsTriggerHorizontal:Xe.tabsTriggerVertical,a&&Xe.tabsTriggerActive,t&&Xe.tabsTriggerDisabled,n),children:r})},_y=({value:e,className:t="",children:n})=>{const{value:r}=Js();return r===e?c.jsx("div",{role:"tabpanel",id:`content-${e}`,"aria-labelledby":`trigger-${e}`,tabIndex:0,className:L(Xe.tabsContent,t),children:n}):null},Cu=({className:e,state:t="open",onClick:n})=>t==="open"?c.jsxs("svg",{className:e,onClick:n,xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 14 14",fill:"none",children:[c.jsx("path",{d:"M1.41174 7.41635C1.3323 7.29056 1.29257 7.22766 1.27034 7.13065C1.25364 7.05778 1.25364 6.94287 1.27034 6.87C1.29257 6.77299 1.3323 6.71009 1.41174 6.58431C2.06823 5.54482 4.02232 2.91699 7.00024 2.91699C9.97815 2.91699 11.9322 5.54482 12.5887 6.5843C12.6682 6.71009 12.7079 6.77299 12.7301 6.87C12.7468 6.94287 12.7468 7.05778 12.7301 7.13065C12.7079 7.22766 12.6682 7.29056 12.5887 7.41635C11.9322 8.45584 9.97815 11.0837 7.00024 11.0837C4.02232 11.0837 2.06823 8.45584 1.41174 7.41635Z",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M7.00024 8.75033C7.96673 8.75033 8.75024 7.96682 8.75024 7.00033C8.75024 6.03383 7.96673 5.25033 7.00024 5.25033C6.03374 5.25033 5.25024 6.03383 5.25024 7.00033C5.25024 7.96682 6.03374 8.75033 7.00024 8.75033Z",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"})]}):c.jsx("svg",{className:e,onClick:n,xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 14 14",fill:"none",children:c.jsx("path",{d:"M6.26672 2.97052C6.50379 2.93547 6.74835 2.91667 7.00024 2.91667C9.97816 2.91667 11.9323 5.54449 12.5887 6.58398C12.6682 6.70979 12.7079 6.7727 12.7302 6.86973C12.7469 6.94259 12.7468 7.05755 12.7301 7.13042C12.7079 7.22744 12.6679 7.29077 12.5879 7.41741C12.413 7.69425 12.1463 8.08331 11.793 8.50527M3.92252 3.9171C2.66131 4.77266 1.8051 5.9613 1.41231 6.58308C1.3325 6.70942 1.29259 6.7726 1.27035 6.86961C1.25364 6.94248 1.25363 7.05742 1.27033 7.13029C1.29257 7.22731 1.33229 7.29022 1.41174 7.41602C2.06823 8.45551 4.02232 11.0833 7.00024 11.0833C8.20098 11.0833 9.23526 10.6561 10.0851 10.078M1.75024 1.75L12.2502 12.25M5.76281 5.76256C5.44612 6.07925 5.25024 6.51675 5.25024 7C5.25024 7.9665 6.03374 8.75 7.00024 8.75C7.48349 8.75 7.92099 8.55413 8.23768 8.23744",stroke:"#818181",strokeWidth:"1.16667",strokeLinecap:"round",strokeLinejoin:"round"})}),Su={PasswordInput:"PasswordInput__GDJDN",eyeIcon:"eyeIcon__kDExG"},xy=S.forwardRef((e,t)=>{const[n,r]=S.useState("password"),o=S.useCallback(()=>{r(s=>s==="password"?"text":"password")},[r]);return c.jsxs("div",{className:L(Su.PasswordInput,e.className),children:[c.jsx(Ur,{type:n,...e,ref:t}),c.jsx(Cu,{className:Su.eyeIcon,onClick:o,state:n==="password"?"open":"closed"})]})});function Cy(e){const t=Sy(e),n=d.forwardRef((r,o)=>{const{children:s,...i}=r,a=d.Children.toArray(s),l=a.find(Ty);if(l){const u=l.props.children,f=a.map(h=>h===l?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...i,ref:o,children:d.isValidElement(u)?d.cloneElement(u,void 0,f):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Sy(e){const t=d.forwardRef((n,r)=>{const{children:o,...s}=n;if(d.isValidElement(o)){const i=Ay(o),a=Py(s,o.props);return o.type!==d.Fragment&&(a.ref=r?pn(r,i):i),d.cloneElement(o,a)}return d.Children.count(o)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ey=Symbol("radix.slottable");function Ty(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ey}function Py(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ay(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wo="Dialog",[Eu]=Yn(wo),[Ry,Be]=Eu(wo),Tu=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=d.useRef(null),l=d.useRef(null),[u,f]=eo({prop:r,defaultProp:o??!1,onChange:s,caller:wo});return c.jsx(Ry,{scope:t,triggerRef:a,contentRef:l,contentId:Kt(),titleId:Kt(),descriptionId:Kt(),open:u,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};Tu.displayName=wo;var Pu="DialogTrigger",Oy=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Pu,n),s=ce(t,o.triggerRef);return c.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ni(o.open),...r,ref:s,onClick:Z(e.onClick,o.onOpenToggle)})});Oy.displayName=Pu;var ei="DialogPortal",[Iy,Au]=Eu(ei,{forceMount:void 0}),Ru=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Be(ei,t);return c.jsx(Iy,{scope:t,forceMount:n,children:d.Children.map(r,i=>c.jsx(Cn,{present:n||s.open,children:c.jsx(Ns,{asChild:!0,container:o,children:i})}))})};Ru.displayName=ei;var _o="DialogOverlay",Ou=d.forwardRef((e,t)=>{const n=Au(_o,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Be(_o,e.__scopeDialog);return s.modal?c.jsx(Cn,{present:r||s.open,children:c.jsx(ky,{...o,ref:t})}):null});Ou.displayName=_o;var jy=Cy("DialogOverlay.RemoveScroll"),ky=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(_o,n);return c.jsx(Us,{as:jy,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(ie.div,{"data-state":ni(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),en="DialogContent",Iu=d.forwardRef((e,t)=>{const n=Au(en,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Be(en,e.__scopeDialog);return c.jsx(Cn,{present:r||s.open,children:s.modal?c.jsx(Ly,{...o,ref:t}):c.jsx(Ny,{...o,ref:t})})});Iu.displayName=en;var Ly=d.forwardRef((e,t)=>{const n=Be(en,e.__scopeDialog),r=d.useRef(null),o=ce(t,n.contentRef,r);return d.useEffect(()=>{const s=r.current;if(s)return yc(s)},[]),c.jsx(ju,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,s=>s.preventDefault())})}),Ny=d.forwardRef((e,t)=>{const n=Be(en,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return c.jsx(ju,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ju=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Be(en,n),l=d.useRef(null),u=ce(t,l);return Tl(),c.jsxs(c.Fragment,{children:[c.jsx(_s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(Wr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ni(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Dy,{titleId:a.titleId}),c.jsx($y,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ti="DialogTitle",ku=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(ti,n);return c.jsx(ie.h2,{id:o.titleId,...r,ref:t})});ku.displayName=ti;var Lu="DialogDescription",Nu=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Lu,n);return c.jsx(ie.p,{id:o.descriptionId,...r,ref:t})});Nu.displayName=Lu;var Du="DialogClose",Mu=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Be(Du,n);return c.jsx(ie.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>o.onOpenChange(!1))})});Mu.displayName=Du;function ni(e){return e?"open":"closed"}var $u="DialogTitleWarning",[x2,Fu]=Jh($u,{contentName:en,titleName:ti,docsSlug:"dialog"}),Dy=({titleId:e})=>{const t=Fu($u),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
250
250
|
|
|
251
251
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
252
252
|
|