PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/block-directory/index.min.js +4 -1 23.7.2 → trunk View file →
@@ -1,5 +1,6 @@
1 -var wp;(wp||={}).blockDirectory=(()=>{var Af=Object.create;var br=Object.defineProperty;var Nf=Object.getOwnPropertyDescriptor;var Df=Object.getOwnPropertyNames;var Mf=Object.getPrototypeOf,Lf=Object.prototype.hasOwnProperty;var se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=(e,t)=>{for(var o in t)br(e,o,{get:t[o],enumerable:!0})},gi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Df(t))!Lf.call(e,n)&&n!==o&&br(e,n,{get:()=>t[n],enumerable:!(r=Nf(t,n))||r.enumerable});return e};var g=(e,t,o)=>(o=e!=null?Af(Mf(e)):{},gi(t||!e||!e.__esModule?br(o,"default",{value:e,enumerable:!0}):o,e)),Bf=e=>gi(br({},"__esModule",{value:!0}),e);var yi=se((Bg,hi)=>{hi.exports=window.wp.plugins});var bi=se((Fg,xi)=>{xi.exports=window.wp.hooks});var kt=se((jg,wi)=>{wi.exports=window.wp.blocks});var Ge=se((Vg,vi)=>{vi.exports=window.wp.data});var Ue=se((Hg,Ri)=>{Ri.exports=window.wp.element});var In=se((Ug,Ei)=>{Ei.exports=window.wp.editor});var lo=se(($g,Ci)=>{Ci.exports=window.wp.blockEditor});var We=se((Yg,Pi)=>{Pi.exports=window.wp.i18n});var wr=se((zg,Oi)=>{Oi.exports=window.wp.apiFetch});var ki=se((qg,_i)=>{_i.exports=window.wp.notices});var Ai=se((Kg,Ii)=>{Ii.exports=window.wp.url});var qi=se((hh,zi)=>{zi.exports=window.wp.compose});var qt=se((yh,Ki)=>{Ki.exports=window.wp.components});var Fn=se((xh,Gi)=>{Gi.exports=window.wp.coreData});var Zi=se((wh,Ji)=>{Ji.exports=window.wp.htmlEntities});var V=se((vh,Qi)=>{Qi.exports=window.React});var X=se((Oh,ra)=>{ra.exports=window.ReactJSXRuntime});var Dt=se((Ey,Pa)=>{Pa.exports=window.ReactDOM});var Ll=se(Ml=>{"use strict";var To=V();function lm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cm=typeof Object.is=="function"?Object.is:lm,um=To.useState,fm=To.useEffect,dm=To.useLayoutEffect,pm=To.useDebugValue;function mm(e,t){var o=t(),r=um({inst:{value:o,getSnapshot:t}}),n=r[0].inst,s=r[1];return dm(function(){n.value=o,n.getSnapshot=t,vs(n)&&s({inst:n})},[e,o,t]),fm(function(){return vs(n)&&s({inst:n}),e(function(){vs(n)&&s({inst:n})})},[e]),pm(o),o}function vs(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!cm(e,o)}catch{return!0}}function gm(e,t){return t()}var hm=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gm:mm;Ml.useSyncExternalStore=To.useSyncExternalStore!==void 0?To.useSyncExternalStore:hm});var Rs=se((fb,Bl)=>{"use strict";Bl.exports=Ll()});var jl=se(Fl=>{"use strict";var zr=V(),ym=Rs();function xm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bm=typeof Object.is=="function"?Object.is:xm,wm=ym.useSyncExternalStore,vm=zr.useRef,Rm=zr.useEffect,Em=zr.useMemo,Tm=zr.useDebugValue;Fl.useSyncExternalStoreWithSelector=function(e,t,o,r,n){var s=vm(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=Em(function(){function u(m){if(!c){if(c=!0,l=m,m=r(m),n!==void 0&&i.hasValue){var d=i.value;if(n(d,m))return f=d}return f=m}if(d=f,bm(l,m))return d;var h=r(m);return n!==void 0&&n(d,h)?(l=m,d):(l=m,f=h)}var c=!1,l,f,p=o===void 0?null:o;return[function(){return u(t())},p===null?void 0:function(){return u(p())}]},[t,o,r,n]);var a=wm(e,s[0],s[1]);return Rm(function(){i.hasValue=!0,i.value=a},[a]),Tm(a),a}});var Hl=se((pb,Vl)=>{"use strict";Vl.exports=jl()});var ru=se((vT,ou)=>{ou.exports=window.wp.a11y});var dn=se((RT,nu)=>{nu.exports=window.wp.primitives});var au=se((MT,iu)=>{iu.exports=window.wp.theme});var cu=se((LT,lu)=>{lu.exports=window.wp.privateApis});var Mg={};Ke(Mg,{store:()=>me});var Tf=g(yi(),1),Sf=g(bi(),1);var Ui=g(kt(),1),Uo=g(Ge(),1),Wi=g(Ue(),1),$i=g(In(),1);var Tr=g(Ge(),1);var Ti=g(Ge(),1),Ff=(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},jf=(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter(o=>o.name!==t.item.name)};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},Vf=(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":let{[t.blockId]:o,...r}=e;return r}return e},Si=(0,Ti.combineReducers)({downloadableBlocks:Ff,blockManagement:jf,errorNotices:Vf});var An={};Ke(An,{getDownloadableBlocks:()=>Uf,getErrorNoticeForBlock:()=>qf,getErrorNotices:()=>zf,getInstalledBlockTypes:()=>Ho,getNewBlockTypes:()=>Wf,getUnusedBlockTypes:()=>$f,isInstalling:()=>Yf,isRequestingDownloadableBlocks:()=>Hf});var co=g(Ge(),1),jo=g(lo(),1),Vo=[];function Hf(e,t){return e.downloadableBlocks[t]?.isRequesting??!1}function Uf(e,t){return e.downloadableBlocks[t]?.results??Vo}function Ho(e){return e.blockManagement.installedBlockTypes}var Wf=(0,co.createRegistrySelector)(e=>(0,co.createSelector)(t=>{let o=Ho(t);if(!o.length)return Vo;let{getBlockName:r,getClientIdsWithDescendants:n}=e(jo.store),s=o.map(u=>u.name),i=n().flatMap(u=>{let c=r(u);return s.includes(c)?c:[]}),a=o.filter(u=>i.includes(u.name));return a.length>0?a:Vo},t=>[Ho(t),e(jo.store).getClientIdsWithDescendants()])),$f=(0,co.createRegistrySelector)(e=>(0,co.createSelector)(t=>{let o=Ho(t);if(!o.length)return Vo;let{getBlockName:r,getClientIdsWithDescendants:n}=e(jo.store),s=o.map(u=>u.name),i=n().flatMap(u=>{let c=r(u);return s.includes(c)?c:[]}),a=o.filter(u=>!i.includes(u.name));return a.length>0?a:Vo},t=>[Ho(t),e(jo.store).getClientIdsWithDescendants()]));function Yf(e,t){return e.blockManagement.isInstalling[t]||!1}function zf(e){return e.errorNotices}function qf(e,t){return e.errorNotices[t]}var Mn={};Ke(Mn,{addInstalledBlockType:()=>Jf,clearErrorNotice:()=>td,fetchDownloadableBlocks:()=>Dn,installBlockType:()=>Gf,receiveDownloadableBlocks:()=>Er,removeInstalledBlockType:()=>Zf,setErrorNotice:()=>ed,setIsInstalling:()=>Qf,uninstallBlockType:()=>Xf});var Rr=g(kt(),1),wt=g(We(),1),uo=g(wr(),1),vr=g(ki(),1),Mi=g(Ai(),1);var Ni=g(wr(),1),Kf=e=>new Promise((t,o)=>{let r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>o(new Error("Error loading asset.")),document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()});async function Di(){let t=await(await(0,Ni.default)({url:document.location.href,parse:!1})).text(),o=new window.DOMParser().parseFromString(t,"text/html"),r=Array.from(o.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!document.getElementById(n.id));for(let n of r)await Kf(n)}function Nn(e){if(!e)return!1;let t=e.links["wp:plugin"]||e.links.self;return t&&t.length?t[0].href:!1}function Dn(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function Er(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}var Gf=e=>async({registry:t,dispatch:o})=>{let{id:r,name:n}=e,s=!1;o.clearErrorNotice(r);try{o.setIsInstalling(r,!0);let i=Nn(e),a={};i?await(0,uo.default)({method:"PUT",url:i,data:{status:"active"}}):a=(await(0,uo.default)({method:"POST",path:"wp/v2/plugins",data:{slug:r,status:"active"}}))._links,o.addInstalledBlockType({...e,links:{...e.links,...a}});let u=["api_version","title","category","parent","ancestor","icon","description","keywords","attributes","provides_context","uses_context","selectors","supports","styles","example","variations","allowed_blocks","block_hooks"];if(await(0,uo.default)({path:(0,Mi.addQueryArgs)(`/wp/v2/block-types/${n}`,{_fields:u})}).catch(()=>{}).then(l=>{l&&(0,Rr.unstable__bootstrapServerSideBlockDefinitions)({[n]:Object.fromEntries(Object.entries(l).filter(([f])=>u.includes(f)))})}),await Di(),!t.select(Rr.store).getBlockTypes().some(l=>l.name===n))throw new Error((0,wt.__)("Error registering block. Try reloading the page."));t.dispatch(vr.store).createInfoNotice((0,wt.sprintf)((0,wt.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),s=!0}catch(i){let a=i.message||(0,wt.__)("An error occurred."),u=i instanceof Error,c={folder_exists:(0,wt.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,wt.__)("Error installing block. You can reload the page and try again.")};c[i.code]&&(u=!0,a=c[i.code]),o.setErrorNotice(r,a,u),t.dispatch(vr.store).createErrorNotice(a,{speak:!0,isDismissible:!0})}return o.setIsInstalling(r,!1),s},Xf=e=>async({registry:t,dispatch:o})=>{try{let r=Nn(e);await(0,uo.default)({method:"PUT",url:r,data:{status:"inactive"}}),await(0,uo.default)({method:"DELETE",url:r}),o.removeInstalledBlockType(e)}catch(r){t.dispatch(vr.store).createErrorNotice(r.message||(0,wt.__)("An error occurred."))}};function Jf(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function Zf(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function Qf(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function ed(e,t,o=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:o}}function td(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var Bn={};Ke(Bn,{getDownloadableBlocks:()=>sd});var fo=function(){return fo=Object.assign||function(t){for(var o,r=1,n=arguments.length;r<n;r++){o=arguments[r];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},fo.apply(this,arguments)};function Li(e){return e.toLowerCase()}var od=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],rd=/[^A-Z0-9]+/gi;function Fi(e,t){t===void 0&&(t={});for(var o=t.splitRegexp,r=o===void 0?od:o,n=t.stripRegexp,s=n===void 0?rd:n,i=t.transform,a=i===void 0?Li:i,u=t.delimiter,c=u===void 0?" ":u,l=Bi(Bi(e,r,"$1\0$2"),s,"\0"),f=0,p=l.length;l.charAt(f)==="\0";)f++;for(;l.charAt(p-1)==="\0";)p--;return l.slice(f,p).split("\0").map(a).join(c)}function Bi(e,t,o){return t instanceof RegExp?e.replace(t,o):t.reduce(function(r,n){return r.replace(n,o)},e)}function Ln(e,t){var o=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&o>="0"&&o<="9"?"_"+o+r:""+o.toUpperCase()+r}function ji(e,t){return t===void 0&&(t={}),Fi(e,fo({delimiter:"",transform:Ln},t))}function nd(e,t){return t===0?e.toLowerCase():Ln(e,t)}function Vi(e,t){return t===void 0&&(t={}),ji(e,fo({transform:nd},t))}var Hi=g(wr(),1);var sd=e=>async({dispatch:t})=>{if(e)try{t(Dn(e));let r=(await(0,Hi.default)({path:`wp/v2/block-directory/search?term=${e}`})).map(n=>Object.fromEntries(Object.entries(n).map(([s,i])=>[Vi(s),i])));t(Er(r,e))}catch{t(Er([],e))}};var id="core/block-directory",ad={reducer:Si,selectors:An,actions:Mn,resolvers:Bn},me=(0,Tr.createReduxStore)(id,ad);(0,Tr.register)(me);function Yi(){let{uninstallBlockType:e}=(0,Uo.useDispatch)(me),t=(0,Uo.useSelect)(r=>{let{isAutosavingPost:n,isSavingPost:s}=r($i.store);return s()&&!n()},[]),o=(0,Uo.useSelect)(r=>r(me).getUnusedBlockTypes(),[]);return(0,Wi.useEffect)(()=>{t&&o.length&&o.forEach(r=>{e(r),(0,Ui.unregisterBlockType)(r.name)})},[t]),null}var af=g(lo(),1),lf=g(qi(),1),cf=g(Ue(),1);var ef=g(We(),1),tf=g(qt(),1),of=g(Fn(),1),rf=g(Ge(),1),nf=g(kt(),1);var Yu=g(We(),1),zu=g(qt(),1),qu=g(kt(),1),Ku=g(Ge(),1);function Xi(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=Xi(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function ld(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=Xi(e))&&(r&&(r+=" "),r+=t);return r}var po=ld;var Ve=g(We(),1),Rn=g(qt(),1),Hu=g(Ue(),1),Ht=g(Zi(),1),Uu=g(kt(),1),Wu=g(Ge(),1);var cd=g(V(),1),Wo={...cd};var ta=g(V(),1),ea={};function ve(e,t){let o=ta.useRef(ea);return o.current===ea&&(o.current=e(t)),o}var jn=Wo.useInsertionEffect,ud=jn&&jn!==Wo.useLayoutEffect?jn:e=>e();function W(e){let t=ve(fd).current;return t.next=e,ud(t.effect),t.trampoline}function fd(){let e={next:void 0,callback:dd,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dd(){}var oa=g(V(),1),pd=()=>{},F=typeof document<"u"?oa.useLayoutEffect:pd;var Sr=g(V(),1),md=Sr.createContext(void 0);function mo(){return Sr.useContext(md)?.direction??"ltr"}function gd(e,t){return function(r,...n){let s=new URL(e);return s.searchParams.set("code",r.toString()),n.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}var hd=gd("https://base-ui.com/production-error","Base UI"),Ne=hd;var Kt=g(V(),1);function Vn(e,t,o,r){let n=ve(sa).current;return yd(n,e,t,o,r)&&ia(n,[e,t,o,r]),n.callback}function na(e){let t=ve(sa).current;return xd(t,e)&&ia(t,e),t.callback}function sa(){return{callback:null,cleanup:null,refs:[]}}function yd(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function xd(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function ia(e,t){if(e.refs=t,t.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let s=t[n];if(s!=null)switch(typeof s){case"function":{let i=s(o);typeof i=="function"&&(r[n]=i);break}case"object":{s.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let s=t[n];if(s!=null)switch(typeof s){case"function":{let i=r[n];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}default:}}}}}}var la=g(V(),1);var aa=g(V(),1),bd=parseInt(aa.version,10);function go(e){return bd>=e}function Hn(e){if(!la.isValidElement(e))return null;let t=e,o=t.props;return(go(19)?o?.ref:t.ref)??null}function $o(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function It(){}var Bh=Object.freeze([]),fe=Object.freeze({});function ca(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let s=t[r](n);s!=null&&Object.assign(o,s);continue}n===!0?o[`data-${r.toLowerCase()}`]="":n&&(o[`data-${r.toLowerCase()}`]=n.toString())}return o}function ua(e,t){return typeof e=="function"?e(t):e}function fa(e,t){return typeof e=="function"?e(t):e}var Un={};function vt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return Cr(t);let s=Cr(e);return t&&(s=Yo(s,t)),o&&(s=Yo(s,o)),r&&(s=Yo(s,r)),n&&(s=Yo(s,n)),s}function da(e){if(e.length===0)return Un;if(e.length===1)return Cr(e[0]);let t=Cr(e[0]);for(let o=1;o<e.length;o+=1)t=Yo(t,e[o]);return t}function Cr(e){return Wn(e)?{...ma(e,Un)}:wd(e)}function Yo(e,t){return Wn(t)?ma(t,e):vd(e,t)}function wd(e){let t={...e};for(let o in t){let r=t[o];pa(o,r)&&(t[o]=ga(r))}return t}function vd(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=$o(e.style,r);break}case"className":{e[o]=$n(e.className,r);break}default:pa(o,r)?e[o]=Rd(e[o],r):e[o]=r}}return e}function pa(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function Wn(e){return typeof e=="function"}function ma(e,t){return Wn(e)?e(t):e??Un}function Rd(e,t){return t?e?(...o)=>{let r=o[0];if(ya(r)){let s=r;ha(s);let i=t(...o);return s.baseUIHandlerPrevented||e?.(...o),i}let n=t(...o);return e?.(...o),n}:ga(t):e}function ga(e){return e&&((...t)=>{let o=t[0];return ya(o)&&ha(o),e(...t)})}function ha(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function $n(e,t){return t?e?t+" "+e:t:e}function ya(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var Yn=g(V(),1);function De(e,t,o={}){let r=t.render,n=Ed(t,o);if(o.enabled===!1)return null;let s=o.state??fe;return Cd(e,r,n,s)}function Ed(e,t={}){let{className:o,style:r,render:n}=e,{state:s=fe,ref:i,props:a,stateAttributesMapping:u,enabled:c=!0}=t,l=c?ua(o,s):void 0,f=c?fa(r,s):void 0,p=c?ca(s,u):fe,m=c&&a?Td(a):void 0,d=c?$o(p,m)??{}:fe;return typeof document<"u"&&(c?Array.isArray(i)?d.ref=na([d.ref,Hn(n),...i]):d.ref=Vn(d.ref,Hn(n),i):Vn(null,null)),c?(l!==void 0&&(d.className=$n(d.className,l)),f!==void 0&&(d.style=$o(d.style,f)),d):fe}function Td(e){return Array.isArray(e)?da(e):vt(void 0,e)}var Sd=Symbol.for("react.lazy");function Cd(e,t,o,r){if(t){if(typeof t=="function")return t(o,r);let n=vt(o,t.props);n.ref=o.ref;let s=t;return s?.$$typeof===Sd&&(s=Kt.Children.toArray(t)[0]),Kt.cloneElement(s,n)}if(e&&typeof e=="string")return Pd(e,o);throw new Error(Ne(8))}function Pd(e,t){return e==="button"?(0,Yn.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,Yn.createElement)("img",{alt:"",...t,key:t.key}):Kt.createElement(e,t)}var Pr=g(V(),1);var xa=0;function Od(e,t="mui"){let[o,r]=Pr.useState(e),n=e||o;return Pr.useEffect(()=>{o==null&&(xa+=1,r(`${t}-${xa}`))},[o,t]),n}var ba=Wo.useId;function At(e,t){if(ba!==void 0){let o=ba();return e??(t?`${t}-${o}`:o)}return Od(e,t)}function wa(e){return At(e,"base-ui")}var $={};Ke($,{cancelOpen:()=>op,chipRemovePress:()=>Fd,clearPress:()=>Bd,closePress:()=>Md,closeWatcher:()=>Gd,decrementPress:()=>Hd,disabled:()=>np,drag:()=>Qd,escapeKey:()=>Kd,focusOut:()=>qd,imperativeAction:()=>ap,incrementPress:()=>Vd,initial:()=>ip,inputBlur:()=>$d,inputChange:()=>Ud,inputClear:()=>Wd,inputPaste:()=>Yd,inputPress:()=>zd,itemPress:()=>Dd,keyboard:()=>Jd,linkPress:()=>Ld,listNavigation:()=>Xd,missing:()=>sp,none:()=>_d,outsidePress:()=>Nd,pointer:()=>Zd,scrub:()=>tp,siblingOpen:()=>rp,swipe:()=>lp,trackPress:()=>jd,triggerFocus:()=>Ad,triggerHover:()=>Id,triggerPress:()=>kd,wheel:()=>ep,windowResize:()=>cp});var _d="none",kd="trigger-press",Id="trigger-hover",Ad="trigger-focus",Nd="outside-press",Dd="item-press",Md="close-press",Ld="link-press",Bd="clear-press",Fd="chip-remove-press",jd="track-press",Vd="increment-press",Hd="decrement-press",Ud="input-change",Wd="input-clear",$d="input-blur",Yd="input-paste",zd="input-press",qd="focus-out",Kd="escape-key",Gd="close-watcher",Xd="list-navigation",Jd="keyboard",Zd="pointer",Qd="drag",ep="wheel",tp="scrub",op="cancel-open",rp="sibling-open",np="disabled",sp="missing",ip="initial",ap="imperative-action",lp="swipe",cp="window-resize";function J(e,t,o,r){let n=!1,s=!1,i=r??fe;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){s=!0},get isCanceled(){return n},get isPropagationAllowed(){return s},trigger:o,...i}}var qn=g(V(),1);var va=g(V(),1),up=[];function ho(e){va.useEffect(e,up)}var Or=null,uy=globalThis.requestAnimationFrame,zn=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;let o=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let n=0;n<o.length;n+=1)o[n]?.(t)};request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||(this.callbacks[o]=null,this.callbacksCount-=1)}},_r=new zn,dt=class e{static create(){return new e}static request(t){return _r.request(t)}static cancel(t){return _r.cancel(t)}currentId=Or;request(t){this.cancel(),this.currentId=_r.request(()=>{this.currentId=Or,t()})}cancel=()=>{this.currentId!==Or&&(_r.cancel(this.currentId),this.currentId=Or)};disposeEffect=()=>this.cancel};function yo(){let e=ve(dt.create).current;return ho(e.disposeEffect),e}function Ra(e,t=!1,o=!1){let[r,n]=qn.useState(e&&t?"idle":void 0),[s,i]=qn.useState(e);return e&&!s&&(i(!0),n("starting")),!e&&s&&r!=="ending"&&!o&&n("ending"),!e&&!s&&r==="ending"&&n(void 0),F(()=>{if(!e&&s&&r!=="ending"&&o){let a=dt.request(()=>{n("ending")});return()=>{dt.cancel(a)}}},[e,s,r,o]),F(()=>{if(!e||t)return;let a=dt.request(()=>{n(void 0)});return()=>{dt.cancel(a)}},[t,e]),F(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&n("starting");let a=dt.request(()=>{n("idle")});return()=>{dt.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}var Gt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({}),fp={[Gt.startingStyle]:""},dp={[Gt.endingStyle]:""},Ea={transitionStatus(e){return e==="starting"?fp:e==="ending"?dp:null}};function kr(){return typeof window<"u"}function Jt(e){return Ir(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tt(e){var t;return(t=(Ir(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ir(e){return kr()?e instanceof Node||e instanceof le(e).Node:!1}function H(e){return kr()?e instanceof Element||e instanceof le(e).Element:!1}function xe(e){return kr()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function xo(e){return!kr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}function bo(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Ta(e){return/^(table|td|th)$/.test(Jt(e))}function zo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var pp=/transform|translate|scale|rotate|perspective|filter/,mp=/paint|layout|strict|content/,Xt=e=>!!e&&e!=="none",Kn;function Ar(e){let t=H(e)?Te(e):e;return Xt(t.transform)||Xt(t.translate)||Xt(t.scale)||Xt(t.rotate)||Xt(t.perspective)||!Nr()&&(Xt(t.backdropFilter)||Xt(t.filter))||pp.test(t.willChange||"")||mp.test(t.contain||"")}function Sa(e){let t=et(e);for(;xe(t)&&!ot(t);){if(Ar(t))return t;if(zo(t))return null;t=et(t)}return null}function Nr(){return Kn==null&&(Kn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kn}function ot(e){return/^(html|body|#document)$/.test(Jt(e))}function Te(e){return le(e).getComputedStyle(e)}function qo(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function et(e){if(Jt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||xo(e)&&e.host||tt(e);return xo(t)?t.host:t}function Ca(e){let t=et(e);return ot(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&bo(t)?t:Ca(t)}function Nt(e,t,o){var r;t===void 0&&(t=[]),o===void 0&&(o=!0);let n=Ca(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=le(n);if(s){let a=Dr(i);return t.concat(i,i.visualViewport||[],bo(n)?n:[],a&&o?Nt(a):[])}else return t.concat(n,Nt(n,[],o))}function Dr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ee(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Me(e){let t=ve(gp,e).current;return t.next=e,F(t.effect),t}function gp(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function be(e){return e?.ownerDocument||document}var ka=g(V(),1);var _a=g(Dt(),1);function Oa(e){return e==null?e:"current"in e?e.current:e}function wo(e,t=!1,o=!0){let r=yo();return W((n,s=null)=>{r.cancel();let i=Oa(e);if(i==null)return;let a=i,u=()=>{_a.flushSync(n)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function c(){Promise.all(a.getAnimations().map(l=>l.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(o){s?.aborted||u();return}let l=a.getAnimations();!s?.aborted&&l.length>0&&l.some(f=>f.pending||f.playState!=="finished")&&c()})}if(t){let l=Gt.startingStyle;if(!a.hasAttribute(l)){r.request(c);return}let f=new MutationObserver(()=>{a.hasAttribute(l)||(f.disconnect(),c())});f.observe(a,{attributes:!0,attributeFilter:[l]}),s?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}r.request(c)})}function Mr(e){let{enabled:t=!0,open:o,ref:r,onComplete:n}=e,s=W(n),i=wo(r,o,!1);ka.useEffect(()=>{if(!t)return;let a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,o,s,i])}var Ia=g(V(),1);function Aa(e){let t=Ia.useRef(!0);t.current&&(t.current=!1,e())}var Rt={};Ke(Rt,{engine:()=>Qn,env:()=>ts,os:()=>Jn,screenReader:()=>es});var Jn={};Ke(Jn,{android:()=>Ma,apple:()=>Xn,ios:()=>Gn,linux:()=>wp,mac:()=>La,windows:()=>bp});function hp(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:yp,platform:xp,maxTouchPoints:Na}=hp(),Zt=yp.toLowerCase(),Qt=xp.toLowerCase();var Gn=/^i(os$|p)/.test(Qt)||Qt==="macintel"&&Na>1,Da="android",Ma=Qt===Da||Zt.includes(Da),La=!Gn&&Qt.startsWith("mac"),bp=Qt.startsWith("win"),wp=!Ma&&/^(linux|chrome os)/.test(Qt),Xn=La||Gn;var Qn={};Ke(Qn,{blink:()=>Rp,gecko:()=>vp,webkit:()=>Zn});var Zn=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),vp=!Zn&&Zt.includes("firefox"),Rp=!Zn&&Zt.includes("chrom");var es={};Ke(es,{voiceOver:()=>Ep});var Ep=Xn;var ts={};Ke(ts,{jsdom:()=>Tp});var Tp=/jsdom|happydom/.test(Zt);var Ko=0,$e=class e{static create(){return new e}currentId=Ko;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ko,o()},t)}isStarted(){return this.currentId!==Ko}clear=()=>{this.currentId!==Ko&&(clearTimeout(this.currentId),this.currentId=Ko)};disposeEffect=()=>this.clear};function rt(){let e=ve($e.create).current;return ho(e.disposeEffect),e}var Se=g(V(),1);function Ba(e){return"nativeEvent"in e}function Et(e,t){let o=["mouse","pen"];return t||o.push("",void 0),o.includes(e)}function Fa(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var os="data-base-ui-focusable";var rs="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Lr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function te(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&xo(o)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ke(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Mt(e,t){if(!H(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute("data-trigger-disabled");for(let[,r]of t.entries())if(te(r,o))return!r.hasAttribute("data-trigger-disabled");return!1}function Br(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function ja(e){return e.matches("html,body")}function Va(e){return xe(e)&&e.matches(rs)}function ns(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${rs}`)!=null}function Ha(e){if(!e||Rt.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Sp(e,t){return t!=null&&!Et(t)?0:typeof e=="function"?e():e}function Tt(e,t,o){let r=Sp(e,o);return typeof r=="number"?r:r?.[t]}function ss(e){return typeof e=="function"?e():e}function Fr(e,t){return t||e==="click"||e==="mousedown"}function Ua(e){return e?.includes("mouse")&&e!=="mousedown"}var Wa=g(X(),1),$a=Se.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new $e,currentIdRef:{current:null},currentContextRef:{current:null}});function Cp(e,t){e.current=t.current}function is(e){let{children:t,delay:o,timeoutMs:r=0}=e,n=Se.useRef(o),s=Se.useRef(o),i=Se.useRef(null),a=Se.useRef(null),u=rt();return F(()=>{if(s.current=o,!i.current){n.current=o;return}n.current={open:Tt(n.current,"open"),close:Tt(o,"close")}},[o,i,n,s]),(0,Wa.jsx)($a.Provider,{value:Se.useMemo(()=>({hasProvider:!0,delayRef:n,initialDelayRef:s,currentIdRef:i,timeoutMs:r,currentContextRef:a,timeout:u}),[r,u]),children:t})}function as(e,t={open:!1}){let{open:o}=t,r="rootStore"in e?e.rootStore:e,n=r.useState("floatingId"),s=Se.useContext($a),{currentIdRef:i,delayRef:a,timeoutMs:u,initialDelayRef:c,currentContextRef:l,hasProvider:f,timeout:p}=s,[m,d]=Se.useState(!1),h=Se.useRef(o),x=Se.useRef(!1);return F(()=>{h.current=o},[o]),F(()=>()=>{x.current=!0},[]),F(()=>{function b(){x.current||d(!1),l.current?.setIsInstantPhase(!1),i.current=null,l.current=null,a.current=c.current,p.clear()}if(i.current&&!o&&i.current===n){if(d(!1),u){let y=n;return p.start(u,()=>{r.select("open")||i.current&&i.current!==y||b()}),()=>{(h.current||i.current!==y)&&p.clear()}}b()}},[o,n,i,a,u,c,l,p,r]),F(()=>{if(!o)return;let b=l.current,y=i.current;p.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:d},i.current=n,a.current={open:0,close:Tt(c.current,"close")},y!==null&&y!==n?(d(!0),b?.setIsInstantPhase(!0),b?.onOpenChange(!1,J($.none))):(d(!1),b?.setIsInstantPhase(!1))},[o,n,r,i,a,c,l,p]),F(()=>()=>{if(i.current===n){if(l.current=null,!h.current)return;i.current=null,Cp(a,c),p.clear()}},[l,i,a,n,c,p]),Se.useMemo(()=>({hasProvider:f,delayRef:a,isInstantPhase:m}),[f,a,m])}function nt(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];o&&o()}}}var qa=["top","right","bottom","left"];var Lt=Math.min,Ie=Math.max,Bt=Math.round,Xo=Math.floor,st=e=>({x:e,y:e}),Pp={left:"right",right:"left",bottom:"top",top:"bottom"};function Jo(e,t,o){return Ie(e,Lt(t,o))}function it(e,t){return typeof e=="function"?e(t):e}function Re(e){return e.split("-")[0]}function at(e){return e.split("-")[1]}function Vr(e){return e==="x"?"y":"x"}function Zo(e){return e==="y"?"height":"width"}function Le(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Qo(e){return Vr(Le(e))}function Ka(e,t,o){o===void 0&&(o=!1);let r=at(e),n=Qo(e),s=Zo(n),i=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Go(i)),[i,Go(i)]}function Ga(e){let t=Go(e);return[jr(e),t,jr(t)]}function jr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Ya=["left","right"],za=["right","left"],Op=["top","bottom"],_p=["bottom","top"];function kp(e,t,o){switch(e){case"top":case"bottom":return o?t?za:Ya:t?Ya:za;case"left":case"right":return t?Op:_p;default:return[]}}function Xa(e,t,o,r){let n=at(e),s=kp(Re(e),o==="start",r);return n&&(s=s.map(i=>i+"-"+n),t&&(s=s.concat(s.map(jr)))),s}function Go(e){let t=Re(e);return Pp[t]+e.slice(t.length)}function Ip(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hr(e){return typeof e!="number"?Ip(e):{top:e,right:e,bottom:e,left:e}}function eo(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function St(e,t,o=!0){return e.filter(n=>n.parentId===t).flatMap(n=>[...!o||n.context?.open?[n]:[],...St(e,n.id,o)])}function vo(e){return`data-base-ui-${e}`}var Ye=g(V(),1),Qa=g(Dt(),1);var Ja={style:{transition:"none"}};var Ap="data-base-ui-swipe-ignore",Np="data-swipe-ignore",fx=`[${Ap}]`,dx=`[${Np}]`;var Za={fallbackAxisSide:"end"};var el=g(X(),1),Dp=Ye.createContext(null),Mp=()=>Ye.useContext(Dp),Lp=vo("portal");function ls(e={}){let{ref:t,container:o,componentProps:r=fe,elementProps:n}=e,s=At(),a=Mp()?.portalNode,[u,c]=Ye.useState(null),[l,f]=Ye.useState(null),p=W(x=>{x!==null&&f(x)}),m=Ye.useRef(null);F(()=>{if(o===null){m.current&&(m.current=null,f(null),c(null));return}if(s==null)return;let x=(o&&(Ir(o)?o:o.current))??a??document.body;if(x==null){m.current&&(m.current=null,f(null),c(null));return}m.current!==x&&(m.current=x,f(null),c(x))},[o,a,s]);let d=De("div",r,{ref:[t,p],props:[{id:s,[Lp]:""},n]});return{portalNode:l,portalSubtree:u&&d?Qa.createPortal(d,u):null}}var to=g(V(),1);function tl(){let e=new Map;return{emit(t,o){e.get(t)?.forEach(r=>r(o))},on(t,o){e.has(t)||e.set(t,new Set),e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}var Bp=g(X(),1),Fp=to.createContext(null),jp=to.createContext(null),Ro=()=>to.useContext(Fp)?.id||null,Ft=e=>{let t=to.useContext(jp);return e??t};var Be=g(V(),1);function Vp(e,t){let o=null,r=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",c=s.width,l=s.height,f=s.x,p=s.y;return o==null&&t.x&&i&&(o=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),f-=o||0,p-=r||0,c=0,l=0,!n||u?(c=t.axis==="y"?s.width:0,l=t.axis==="x"?s.height:0,f=i&&t.x!=null?t.x:f,p=a&&t.y!=null?t.y:p):n&&!u&&(l=t.axis==="x"?s.height:l,c=t.axis==="y"?s.width:c),n=!0,{width:c,height:l,x:f,y:p,top:p,right:f+c,bottom:p+l,left:f}}}}function ol(e){return e!=null&&e.clientX!=null}function cs(e,t={}){let{enabled:o=!0,axis:r="both"}=t,n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),u=n.context.dataRef,c=Be.useRef(!1),l=Be.useRef(null),[f,p]=Be.useState(),[m,d]=Be.useState([]),h=W(w=>{n.set("positionReference",w)}),x=W((w,T,E)=>{c.current||u.current.openEvent&&!ol(u.current.openEvent)||n.set("positionReference",Vp(E??a,{x:w,y:T,axis:r,dataRef:u,pointerType:f}))}),b=W(w=>{s?l.current||(x(w.clientX,w.clientY,w.currentTarget),d([])):x(w.clientX,w.clientY,w.currentTarget)}),y=Et(f)?i:s;Be.useEffect(()=>{if(!o){h(a);return}if(!y)return;function w(){l.current?.(),l.current=null}let T=le(i);function E(C){let P=ke(C);te(i,P)?w():x(C.clientX,C.clientY)}return!u.current.openEvent||ol(u.current.openEvent)?l.current=ee(T,"mousemove",E):h(a),w},[y,o,i,u,a,n,x,h,m]),Be.useEffect(()=>()=>{n.set("positionReference",null)},[n]),Be.useEffect(()=>{o&&!i&&(c.current=!1)},[o,i]),Be.useEffect(()=>{!o&&s&&(c.current=!0)},[o,s]);let v=Be.useMemo(()=>{function w(T){p(T.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:b,onMouseEnter:b}},[b]);return Be.useMemo(()=>o?{reference:v,trigger:v}:{},[o,v])}var Fe=g(V(),1);function Hp(){return!1}function Up(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function us(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:s="sloppy",referencePress:i=Hp,bubbles:a,externalTree:u}=t,c="rootStore"in e?e.rootStore:e,l=c.useState("open"),f=c.useState("floatingElement"),{dataRef:p}=c.context,m=Ft(u),d=W(typeof n=="function"?n:()=>!1),h=typeof n=="function"?d:n,x=h!==!1,b=W(()=>s),{escapeKey:y,outsidePress:v}=Up(a),w=Fe.useRef(!1),T=Fe.useRef(!1),E=Fe.useRef(!1),C=Fe.useRef(!1),P=Fe.useRef(""),O=Fe.useRef(null),I=rt(),Y=rt(),A=W(()=>{Y.clear(),p.current.insideReactTree=!1}),N=W(U=>{let Q=p.current.floatingContext?.nodeId;return(m?St(m.nodesRef.current,Q):[]).some(ne=>ne.context?.open&&!ne.context.dataRef.current[U])}),L=W(U=>Br(U,c.select("floatingElement"))||Br(U,c.select("domReferenceElement"))),R=W(U=>{i()&&c.setOpen(!1,J($.triggerPress,U.nativeEvent))}),k=W(U=>{if(!l||!o||!r||U.key!=="Escape"||C.current||!y&&N("__escapeKeyBubbles"))return;let Q=Ba(U)?U.nativeEvent:U,Z=J($.escapeKey,Q);c.setOpen(!1,Z),Z.isCanceled||U.preventDefault(),!y&&!Z.isPropagationAllowed&&U.stopPropagation()}),B=W(()=>{p.current.insideReactTree=!0,Y.start(0,A)}),S=W(U=>{if(!l||!o||U.button!==0)return;let Q=ke(U.nativeEvent);te(c.select("floatingElement"),Q)&&(w.current||(w.current=!0,T.current=!1))}),_=W(U=>{!l||!o||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&w.current&&(T.current=!0)});Fe.useEffect(()=>{if(!l||!o)return;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=v;let U=new $e,Q=new $e;function Z(){U.clear(),C.current=!0}function ne(){U.start(Rt.engine.webkit?5:0,()=>{C.current=!1})}function z(){E.current=!0,Q.start(0,()=>{E.current=!1})}function ie(){w.current=!1,T.current=!1}function ae(){let M=P.current,j=M==="pen"||!M?"mouse":M,pe=b(),Ee=typeof pe=="function"?pe():pe;return typeof Ee=="string"?Ee:Ee[j]}function de(M){let j=ae();return j==="intentional"&&M.type!=="click"||j==="sloppy"&&M.type==="click"}function Oe(M){let j=p.current.floatingContext?.nodeId,pe=m&&St(m.nodesRef.current,j).some(Ee=>Br(M,Ee.context?.elements.floating));return L(M)||pe}function we(M){if(de(M)){M.type!=="click"&&!L(M)&&(Q.clear(),E.current=!1),A();return}if(p.current.insideReactTree){A();return}let j=ke(M),pe=`[${vo("inert")}]`,Ee=H(j)?j.getRootNode():null,Pt=Array.from((xo(Ee)?Ee:be(c.select("floatingElement"))).querySelectorAll(pe)),Bo=c.context.triggerElements;if(j&&(Bo.hasElement(j)||Bo.hasMatchingElement(He=>te(He,j))))return;let xt=H(j)?j:null;for(;xt&&!ot(xt);){let He=et(xt);if(ot(He)||!H(He))break;xt=He}if(!(Pt.length&&H(j)&&!ja(j)&&!te(j,c.select("floatingElement"))&&Pt.every(He=>!te(xt,He)))){if(xe(j)&&!("touches"in M)){let He=ot(j),Ot=Te(j),_t=/auto|scroll/,pr=He||_t.test(Ot.overflowX),mr=He||_t.test(Ot.overflowY),gr=pr&&j.clientWidth>0&&j.scrollWidth>j.clientWidth,hr=mr&&j.clientHeight>0&&j.scrollHeight>j.clientHeight,yr=Ot.direction==="rtl",oe=hr&&(yr?M.offsetX<=j.offsetWidth-j.clientWidth:M.offsetX>j.clientWidth),_e=gr&&M.offsetY>j.clientHeight;if(oe||_e)return}if(!Oe(M)){if(ae()==="intentional"&&E.current){Q.clear(),E.current=!1;return}typeof h=="function"&&!h(M)||N("__outsidePressBubbles")||(c.setOpen(!1,J($.outsidePress,M)),A())}}}function K(M){ae()!=="sloppy"||M.pointerType==="touch"||!c.select("open")||!o||L(M)||we(M)}function ce(M){if(ae()!=="sloppy"||!c.select("open")||!o||L(M))return;let j=M.touches[0];j&&(O.current={startTime:Date.now(),startX:j.clientX,startY:j.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},I.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function ue(M,j){let pe=ke(M);if(!pe)return;let Ee=ee(pe,M.type,()=>{j(M),Ee()})}function Yt(M){P.current="touch",ue(M,ce)}function Je(M){I.clear(),M.type==="pointerdown"&&(P.current=M.pointerType),!(M.type==="mousedown"&&O.current&&!O.current.dismissOnMouseDown)&&ue(M,j=>{j.type==="pointerdown"?K(j):we(j)})}function yt(M){if(!w.current)return;let j=T.current;if(ie(),ae()==="intentional"){if(M.type==="pointercancel"){j&&z();return}if(!Oe(M)){if(j){z();return}typeof h=="function"&&!h(M)||(Q.clear(),E.current=!0,A())}}}function Ze(M){if(ae()!=="sloppy"||!O.current||L(M))return;let j=M.touches[0];if(!j)return;let pe=Math.abs(j.clientX-O.current.startX),Ee=Math.abs(j.clientY-O.current.startY),Pt=Math.sqrt(pe*pe+Ee*Ee);Pt>5&&(O.current.dismissOnTouchEnd=!0),Pt>10&&(we(M),I.clear(),O.current=null)}function ut(M){ue(M,Ze)}function fr(M){ae()!=="sloppy"||!O.current||L(M)||(O.current.dismissOnTouchEnd&&we(M),I.clear(),O.current=null)}function dr(M){ue(M,fr)}let ye=be(f),io=nt(r&&nt(ee(ye,"keydown",k),ee(ye,"compositionstart",Z),ee(ye,"compositionend",ne)),x&&nt(ee(ye,"click",Je,!0),ee(ye,"pointerdown",Je,!0),ee(ye,"pointerup",yt,!0),ee(ye,"pointercancel",yt,!0),ee(ye,"mousedown",Je,!0),ee(ye,"mouseup",yt,!0),ee(ye,"touchstart",Yt,!0),ee(ye,"touchmove",ut,!0),ee(ye,"touchend",dr,!0)));return()=>{io(),U.clear(),Q.clear(),ie(),E.current=!1}},[p,f,r,x,h,l,o,y,v,k,A,b,N,L,m,c,I]),Fe.useEffect(A,[h,A]);let D=Fe.useMemo(()=>({onKeyDown:k,onPointerDown:R,onClick:R}),[k,R]),G=Fe.useMemo(()=>({onKeyDown:k,onPointerDown:_,onMouseDown:_,onClickCapture:B,onMouseDownCapture(U){B(),S(U)},onPointerDownCapture(U){B(),S(U)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[k,B,S,_]);return Fe.useMemo(()=>o?{reference:D,floating:G,trigger:D}:{},[o,D,G])}var Ce=g(V(),1);function rl(e,t,o){let{reference:r,floating:n}=e,s=Le(t),i=Qo(t),a=Zo(i),u=Re(t),c=s==="y",l=r.x+r.width/2-n.width/2,f=r.y+r.height/2-n.height/2,p=r[a]/2-n[a]/2,m;switch(u){case"top":m={x:l,y:r.y-n.height};break;case"bottom":m={x:l,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-n.width,y:f};break;default:m={x:r.x,y:r.y}}switch(at(t)){case"start":m[i]-=p*(o&&c?-1:1);break;case"end":m[i]+=p*(o&&c?-1:1);break}return m}async function il(e,t){var o;t===void 0&&(t={});let{x:r,y:n,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=it(t,e),d=Hr(m),x=a[p?f==="floating"?"reference":"floating":f],b=eo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(x)))==null||o?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:l,strategy:u})),y=f==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},T=eo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:u}):y);return{top:(b.top-T.top+d.top)/w.y,bottom:(T.bottom-b.bottom+d.bottom)/w.y,left:(b.left-T.left+d.left)/w.x,right:(T.right-b.right+d.right)/w.x}}var Wp=50,al=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:i}=o,a=i.detectOverflow?i:{...i,detectOverflow:il},u=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:l,y:f}=rl(c,r,u),p=r,m=0,d={};for(let h=0;h<s.length;h++){let x=s[h];if(!x)continue;let{name:b,fn:y}=x,{x:v,y:w,data:T,reset:E}=await y({x:l,y:f,initialPlacement:r,placement:p,strategy:n,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});l=v??l,f=w??f,d[b]={...d[b],...T},E&&m<Wp&&(m++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:n}):E.rects),{x:l,y:f}=rl(c,p,u)),h=-1)}return{x:l,y:f,placement:p,strategy:n,middlewareData:d}};var ll=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:h=!0,...x}=it(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};let b=Re(n),y=Le(a),v=Re(a)===a,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=p||(v||!h?[Go(a)]:Ga(a)),E=d!=="none";!p&&E&&T.push(...Xa(a,h,d,w));let C=[a,...T],P=await u.detectOverflow(t,x),O=[],I=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&O.push(P[b]),f){let L=Ka(n,i,w);O.push(P[L[0]],P[L[1]])}if(I=[...I,{placement:n,overflows:O}],!O.every(L=>L<=0)){var Y,A;let L=(((Y=s.flip)==null?void 0:Y.index)||0)+1,R=C[L];if(R&&(!(f==="alignment"?y!==Le(R):!1)||I.every(S=>Le(S.placement)===y?S.overflows[0]>0:!0)))return{data:{index:L,overflows:I},reset:{placement:R}};let k=(A=I.filter(B=>B.overflows[0]<=0).sort((B,S)=>B.overflows[1]-S.overflows[1])[0])==null?void 0:A.placement;if(!k)switch(m){case"bestFit":{var N;let B=(N=I.filter(S=>{if(E){let _=Le(S.placement);return _===y||_==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(_=>_>0).reduce((_,D)=>_+D,0)]).sort((S,_)=>S[1]-_[1])[0])==null?void 0:N[0];B&&(k=B);break}case"initialPlacement":k=a;break}if(n!==k)return{reset:{placement:k}}}return{}}}};function nl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sl(e){return qa.some(t=>e[t]>=0)}var cl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:o,platform:r}=t,{strategy:n="referenceHidden",...s}=it(e,t);switch(n){case"referenceHidden":{let i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=nl(i,o.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:sl(a)}}}case"escaped":{let i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=nl(i,o.floating);return{data:{escapedOffsets:a,escaped:sl(a)}}}default:return{}}}}};var ul=new Set(["left","top"]);async function $p(e,t){let{placement:o,platform:r,elements:n}=e,s=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Re(o),a=at(o),u=Le(o)==="y",c=ul.has(i)?-1:1,l=s&&u?-1:1,f=it(t,e),{mainAxis:p,crossAxis:m,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof d=="number"&&(m=a==="end"?d*-1:d),u?{x:m*l,y:p*c}:{x:p*c,y:m*l}}var fl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:s,placement:i,middlewareData:a}=t,u=await $p(t,e);return i===((o=a.offset)==null?void 0:o.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:n+u.x,y:s+u.y,data:{...u,placement:i}}}}},dl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:b=>{let{x:y,y:v}=b;return{x:y,y:v}}},...c}=it(e,t),l={x:o,y:r},f=await s.detectOverflow(t,c),p=Le(Re(n)),m=Vr(p),d=l[m],h=l[p];if(i){let b=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=d+f[b],w=d-f[y];d=Jo(v,d,w)}if(a){let b=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=h+f[b],w=h-f[y];h=Jo(v,h,w)}let x=u.fn({...t,[m]:d,[p]:h});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[m]:i,[p]:a}}}}}},pl=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:o,y:r,placement:n,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=it(e,t),l={x:o,y:r},f=Le(n),p=Vr(f),m=l[p],d=l[f],h=it(a,t),x=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let v=p==="y"?"height":"width",w=s.reference[p]-s.floating[v]+x.mainAxis,T=s.reference[p]+s.reference[v]-x.mainAxis;m<w?m=w:m>T&&(m=T)}if(c){var b,y;let v=p==="y"?"width":"height",w=ul.has(Re(n)),T=s.reference[f]-s.floating[v]+(w&&((b=i.offset)==null?void 0:b[f])||0)+(w?0:x.crossAxis),E=s.reference[f]+s.reference[v]+(w?0:((y=i.offset)==null?void 0:y[f])||0)-(w?x.crossAxis:0);d<T?d=T:d>E&&(d=E)}return{[p]:m,[f]:d}}}},ml=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,r;let{placement:n,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=it(e,t),l=await i.detectOverflow(t,c),f=Re(n),p=at(n),m=Le(n)==="y",{width:d,height:h}=s.floating,x,b;f==="top"||f==="bottom"?(x=f,b=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,x=p==="end"?"top":"bottom");let y=h-l.top-l.bottom,v=d-l.left-l.right,w=Lt(h-l[x],y),T=Lt(d-l[b],v),E=!t.middlewareData.shift,C=w,P=T;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(P=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=y),E&&!p){let I=Ie(l.left,0),Y=Ie(l.right,0),A=Ie(l.top,0),N=Ie(l.bottom,0);m?P=d-2*(I!==0||Y!==0?I+Y:Ie(l.left,l.right)):C=h-2*(A!==0||N!==0?A+N:Ie(l.top,l.bottom))}await u({...t,availableWidth:P,availableHeight:C});let O=await i.getDimensions(a.floating);return d!==O.width||h!==O.height?{reset:{rects:!0}}:{}}}};function xl(e){let t=Te(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=xe(e),s=n?e.offsetWidth:o,i=n?e.offsetHeight:r,a=Bt(o)!==s||Bt(r)!==i;return a&&(o=s,r=i),{width:o,height:r,$:a}}function ds(e){return H(e)?e:e.contextElement}function Eo(e){let t=ds(e);if(!xe(t))return st(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:s}=xl(t),i=(s?Bt(o.width):o.width)/r,a=(s?Bt(o.height):o.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}var Yp=st(0);function bl(e){let t=le(e);return!Nr()||!t.visualViewport?Yp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zp(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==le(e)?!1:t}function oo(e,t,o,r){t===void 0&&(t=!1),o===void 0&&(o=!1);let n=e.getBoundingClientRect(),s=ds(e),i=st(1);t&&(r?H(r)&&(i=Eo(r)):i=Eo(e));let a=zp(s,o,r)?bl(s):st(0),u=(n.left+a.x)/i.x,c=(n.top+a.y)/i.y,l=n.width/i.x,f=n.height/i.y;if(s){let p=le(s),m=r&&H(r)?le(r):r,d=p,h=Dr(d);for(;h&&r&&m!==d;){let x=Eo(h),b=h.getBoundingClientRect(),y=Te(h),v=b.left+(h.clientLeft+parseFloat(y.paddingLeft))*x.x,w=b.top+(h.clientTop+parseFloat(y.paddingTop))*x.y;u*=x.x,c*=x.y,l*=x.x,f*=x.y,u+=v,c+=w,d=le(h),h=Dr(d)}}return eo({width:l,height:f,x:u,y:c})}function Ur(e,t){let o=qo(e).scrollLeft;return t?t.left+o:oo(tt(e)).left+o}function wl(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Ur(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function qp(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,s=n==="fixed",i=tt(r),a=t?zo(t.floating):!1;if(r===i||a&&s)return o;let u={scrollLeft:0,scrollTop:0},c=st(1),l=st(0),f=xe(r);if((f||!f&&!s)&&((Jt(r)!=="body"||bo(i))&&(u=qo(r)),f)){let m=oo(r);c=Eo(r),l.x=m.x+r.clientLeft,l.y=m.y+r.clientTop}let p=i&&!f&&!s?wl(i,u):st(0);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-u.scrollLeft*c.x+l.x+p.x,y:o.y*c.y-u.scrollTop*c.y+l.y+p.y}}function Kp(e){return Array.from(e.getClientRects())}function Gp(e){let t=tt(e),o=qo(e),r=e.ownerDocument.body,n=Ie(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Ie(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),i=-o.scrollLeft+Ur(e),a=-o.scrollTop;return Te(r).direction==="rtl"&&(i+=Ie(t.clientWidth,r.clientWidth)-n),{width:n,height:s,x:i,y:a}}var gl=25;function Xp(e,t){let o=le(e),r=tt(e),n=o.visualViewport,s=r.clientWidth,i=r.clientHeight,a=0,u=0;if(n){s=n.width,i=n.height;let l=Nr();(!l||l&&t==="fixed")&&(a=n.offsetLeft,u=n.offsetTop)}let c=Ur(r);if(c<=0){let l=r.ownerDocument,f=l.body,p=getComputedStyle(f),m=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,d=Math.abs(r.clientWidth-f.clientWidth-m);d<=gl&&(s-=d)}else c<=gl&&(s+=c);return{width:s,height:i,x:a,y:u}}function Jp(e,t){let o=oo(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,s=xe(e)?Eo(e):st(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=n*s.x,c=r*s.y;return{width:i,height:a,x:u,y:c}}function hl(e,t,o){let r;if(t==="viewport")r=Xp(e,o);else if(t==="document")r=Gp(tt(e));else if(H(t))r=Jp(t,o);else{let n=bl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eo(r)}function vl(e,t){let o=et(e);return o===t||!H(o)||ot(o)?!1:Te(o).position==="fixed"||vl(o,t)}function Zp(e,t){let o=t.get(e);if(o)return o;let r=Nt(e,[],!1).filter(a=>H(a)&&Jt(a)!=="body"),n=null,s=Te(e).position==="fixed",i=s?et(e):e;for(;H(i)&&!ot(i);){let a=Te(i),u=Ar(i);!u&&a.position==="fixed"&&(n=null),(s?!u&&!n:!u&&a.position==="static"&&!!n&&(n.position==="absolute"||n.position==="fixed")||bo(i)&&!u&&vl(e,i))?r=r.filter(l=>l!==i):n=a,i=et(i)}return t.set(e,r),r}function Qp(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,i=[...o==="clippingAncestors"?zo(t)?[]:Zp(t,this._c):[].concat(o),r],a=hl(t,i[0],n),u=a.top,c=a.right,l=a.bottom,f=a.left;for(let p=1;p<i.length;p++){let m=hl(t,i[p],n);u=Ie(m.top,u),c=Lt(m.right,c),l=Lt(m.bottom,l),f=Ie(m.left,f)}return{width:c-f,height:l-u,x:f,y:u}}function em(e){let{width:t,height:o}=xl(e);return{width:t,height:o}}function tm(e,t,o){let r=xe(t),n=tt(t),s=o==="fixed",i=oo(e,!0,s,t),a={scrollLeft:0,scrollTop:0},u=st(0);function c(){u.x=Ur(n)}if(r||!r&&!s)if((Jt(t)!=="body"||bo(n))&&(a=qo(t)),r){let m=oo(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else n&&c();s&&!r&&n&&c();let l=n&&!r&&!s?wl(n,a):st(0),f=i.left+a.scrollLeft-u.x-l.x,p=i.top+a.scrollTop-u.y-l.y;return{x:f,y:p,width:i.width,height:i.height}}function fs(e){return Te(e).position==="static"}function yl(e,t){if(!xe(e)||Te(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return tt(e)===o&&(o=o.ownerDocument.body),o}function Rl(e,t){let o=le(e);if(zo(e))return o;if(!xe(e)){let n=et(e);for(;n&&!ot(n);){if(H(n)&&!fs(n))return n;n=et(n)}return o}let r=yl(e,t);for(;r&&Ta(r)&&fs(r);)r=yl(r,t);return r&&ot(r)&&fs(r)&&!Ar(r)?o:r||Sa(e)||o}var om=async function(e){let t=this.getOffsetParent||Rl,o=this.getDimensions,r=await o(e.floating);return{reference:tm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rm(e){return Te(e).direction==="rtl"}var ps={convertOffsetParentRelativeRectToViewportRelativeRect:qp,getDocumentElement:tt,getClippingRect:Qp,getOffsetParent:Rl,getElementRects:om,getClientRects:Kp,getDimensions:em,getScale:Eo,isElement:H,isRTL:rm};function El(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nm(e,t){let o=null,r,n=tt(e);function s(){var a;clearTimeout(r),(a=o)==null||a.disconnect(),o=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();let c=e.getBoundingClientRect(),{left:l,top:f,width:p,height:m}=c;if(a||t(),!p||!m)return;let d=Xo(f),h=Xo(n.clientWidth-(l+p)),x=Xo(n.clientHeight-(f+m)),b=Xo(l),v={rootMargin:-d+"px "+-h+"px "+-x+"px "+-b+"px",threshold:Ie(0,Lt(1,u))||1},w=!0;function T(E){let C=E[0].intersectionRatio;if(C!==u){if(!w)return i();C?i(!1,C):r=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!El(c,e.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(T,{...v,root:n.ownerDocument})}catch{o=new IntersectionObserver(T,v)}o.observe(e)}return i(!0),s}function er(e,t,o,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=ds(e),l=n||s?[...c?Nt(c):[],...t?Nt(t):[]]:[];l.forEach(b=>{n&&b.addEventListener("scroll",o,{passive:!0}),s&&b.addEventListener("resize",o)});let f=c&&a?nm(c,o):null,p=-1,m=null;i&&(m=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),o()}),c&&!u&&m.observe(c),t&&m.observe(t));let d,h=u?oo(e):null;u&&x();function x(){let b=oo(e);h&&!El(h,b)&&o(),h=b,d=requestAnimationFrame(x)}return o(),()=>{var b;l.forEach(y=>{n&&y.removeEventListener("scroll",o),s&&y.removeEventListener("resize",o)}),f?.(),(b=m)==null||b.disconnect(),m=null,u&&cancelAnimationFrame(d)}}var Tl=fl;var Sl=dl,Cl=ll,Pl=ml,Ol=cl;var _l=pl,Wr=(e,t,o)=>{let r=new Map,n={platform:ps,...o},s={...n.platform,_c:r};return al(e,t,{...n,platform:s})};var ge=g(V(),1),Il=g(V(),1),Al=g(Dt(),1),im=typeof document<"u",am=function(){},$r=im?Il.useLayoutEffect:am;function Yr(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 o,r,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!Yr(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let s=n[r];if(!(s==="_owner"&&e.$$typeof)&&!Yr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Nl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kl(e,t){let o=Nl(e);return Math.round(t*o)/o}function ms(e){let t=ge.useRef(e);return $r(()=>{t.current=e}),t}function Dl(e){e===void 0&&(e={});let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[l,f]=ge.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=ge.useState(r);Yr(p,r)||m(r);let[d,h]=ge.useState(null),[x,b]=ge.useState(null),y=ge.useCallback(S=>{S!==E.current&&(E.current=S,h(S))},[]),v=ge.useCallback(S=>{S!==C.current&&(C.current=S,b(S))},[]),w=s||d,T=i||x,E=ge.useRef(null),C=ge.useRef(null),P=ge.useRef(l),O=u!=null,I=ms(u),Y=ms(n),A=ms(c),N=ge.useCallback(()=>{if(!E.current||!C.current)return;let S={placement:t,strategy:o,middleware:p};Y.current&&(S.platform=Y.current),Wr(E.current,C.current,S).then(_=>{let D={..._,isPositioned:A.current!==!1};L.current&&!Yr(P.current,D)&&(P.current=D,Al.flushSync(()=>{f(D)}))})},[p,t,o,Y,A]);$r(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(S=>({...S,isPositioned:!1})))},[c]);let L=ge.useRef(!1);$r(()=>(L.current=!0,()=>{L.current=!1}),[]),$r(()=>{if(w&&(E.current=w),T&&(C.current=T),w&&T){if(I.current)return I.current(w,T,N);N()}},[w,T,N,I,O]);let R=ge.useMemo(()=>({reference:E,floating:C,setReference:y,setFloating:v}),[y,v]),k=ge.useMemo(()=>({reference:w,floating:T}),[w,T]),B=ge.useMemo(()=>{let S={position:o,left:0,top:0};if(!k.floating)return S;let _=kl(k.floating,l.x),D=kl(k.floating,l.y);return a?{...S,transform:"translate("+_+"px, "+D+"px)",...Nl(k.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:_,top:D}},[o,a,k.floating,l.x,l.y]);return ge.useMemo(()=>({...l,update:N,refs:R,elements:k,floatingStyles:B}),[l,N,R,k,B])}var gs=(e,t)=>{let o=Tl(e);return{name:o.name,fn:o.fn,options:[e,t]}},hs=(e,t)=>{let o=Sl(e);return{name:o.name,fn:o.fn,options:[e,t]}},ys=(e,t)=>({fn:_l(e).fn,options:[e,t]}),xs=(e,t)=>{let o=Cl(e);return{name:o.name,fn:o.fn,options:[e,t]}},bs=(e,t)=>{let o=Pl(e);return{name:o.name,fn:o.fn,options:[e,t]}};var ws=(e,t)=>{let o=Ol(e);return{name:o.name,fn:o.fn,options:[e,t]}};var Co=g(V(),1),Xl=g(Dt(),1);var Kl=g(V(),1);var q=(e,t,o,r,n,s,...i)=>{if(i.length>0)throw new Error(Ne(1));let a;if(e&&t&&o&&r&&n&&s)a=(u,c,l,f)=>{let p=e(u,c,l,f),m=t(u,c,l,f),d=o(u,c,l,f),h=r(u,c,l,f),x=n(u,c,l,f);return s(p,m,d,h,x,c,l,f)};else if(e&&t&&o&&r&&n)a=(u,c,l,f)=>{let p=e(u,c,l,f),m=t(u,c,l,f),d=o(u,c,l,f),h=r(u,c,l,f);return n(p,m,d,h,c,l,f)};else if(e&&t&&o&&r)a=(u,c,l,f)=>{let p=e(u,c,l,f),m=t(u,c,l,f),d=o(u,c,l,f);return r(p,m,d,c,l,f)};else if(e&&t&&o)a=(u,c,l,f)=>{let p=e(u,c,l,f),m=t(u,c,l,f);return o(p,m,c,l,f)};else if(e&&t)a=(u,c,l,f)=>{let p=e(u,c,l,f);return t(p,c,l,f)};else if(e)a=e;else throw new Error("Missing arguments");return a};var zl=g(V(),1),Cs=g(Rs(),1),ql=g(Hl(),1);var Ul=g(V(),1);var Es=[],Ts;function Wl(){return Ts}function $l(e){Es.push(e)}function Ss(e){let t=(o,r)=>{let n=ve(Sm).current,s;try{Ts=n;for(let i of Es)i.before(n);s=e(o,r);for(let i of Es)i.after(n);n.didInitialize=!0}finally{Ts=void 0}return s};return t.displayName=e.displayName||e.name,t}function Yl(e){return Ul.forwardRef(Ss(e))}function Sm(){return{didInitialize:!1}}var Cm=go(19),Pm=Cm?_m:km;function qr(e,t,o,r,n){return Pm(e,t,o,r,n)}function Om(e,t,o,r,n){let s=zl.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return(0,Cs.useSyncExternalStore)(e.subscribe,s,s)}$l({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,n)||(t=!0,r.value=n)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}}),(0,Cs.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _m(e,t,o,r,n){let s=Wl();if(!s)return Om(e,t,o,r,n);let i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,o)||!Object.is(a.a2,r)||!Object.is(a.a3,n))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=o,a.a2=r,a.a3=n,a.value=t(e.getSnapshot(),o,r,n))):(a={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},s.syncHooks.push(a)),a.value}function km(e,t,o,r,n){return(0,ql.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,o,r,n))}var Kr=class{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;let o=this.updateTick;for(let r of this.listeners){if(o!==this.updateTick)return;r(t)}}update(t){for(let o in t)if(!Object.is(this.state[o],t[o])){this.setState({...this.state,...t});return}}set(t,o){Object.is(this.state[t],o)||this.setState({...this.state,[t]:o})}notifyAll(){let t={...this.state};this.setState(t)}use(t,o,r,n){return qr(this,t,o,r,n)}};var ro=g(V(),1);var So=class extends Kr{constructor(t,o={},r){super(t),this.context=o,this.selectors=r}useSyncedValue(t,o){ro.useDebugValue(t);let r=this;F(()=>{r.state[t]!==o&&r.set(t,o)},[r,t,o])}useSyncedValueWithCleanup(t,o){let r=this;F(()=>(r.state[t]!==o&&r.set(t,o),()=>{r.set(t,void 0)}),[r,t,o])}useSyncedValues(t){let o=this,r=Object.values(t);F(()=>{o.update(t)},[o,...r])}useControlledProp(t,o){ro.useDebugValue(t);let r=this,n=o!==void 0;F(()=>{n&&!Object.is(r.state[t],o)&&r.setState({...r.state,[t]:o})},[r,t,o,n])}select(t,o,r,n){let s=this.selectors[t];return s(this.state,o,r,n)}useState(t,o,r,n){return ro.useDebugValue(t),qr(this,this.selectors[t],o,r,n)}useContextCallback(t,o){ro.useDebugValue(t);let r=W(o??It);this.context[t]=r}useStateSetter(t){let o=ro.useRef(void 0);return o.current===void 0&&(o.current=r=>{this.set(t,r)}),o.current}observe(t,o){let r;typeof t=="function"?r=t:r=this.selectors[t];let n=r(this.state);return o(n,n,this),this.subscribe(s=>{let i=r(s);if(!Object.is(n,i)){let a=n;n=i,o(i,a,this)}})}};var Im={open:q(e=>e.open),transitionStatus:q(e=>e.transitionStatus),domReferenceElement:q(e=>e.domReferenceElement),referenceElement:q(e=>e.positionReference??e.referenceElement),floatingElement:q(e=>e.floatingElement),floatingId:q(e=>e.floatingId)},pt=class extends So{constructor(t){let{syncOnly:o,nested:r,onOpenChange:n,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:tl(),nested:r,triggerElements:s},Im),this.syncOnly=o}syncOpenEvent=(t,o)=>{(!t||!this.state.open||o!=null&&Fa(o))&&(this.context.dataRef.current.openEvent=t?o:void 0)};dispatchOpenChange=(t,o)=>{this.syncOpenEvent(t,o.event);let r={open:t,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)};setOpen=(t,o)=>{if(this.syncOnly){this.context.onOpenChange?.(t,o);return}this.dispatchOpenChange(t,o),this.context.onOpenChange?.(t,o)}};function Gl(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:s,onOpenChange:i}=e,a=t.useState("open"),u=t.useState("activeTriggerElement"),c=t.useState(o?"popupElement":"positionerElement"),l=t.context.triggerElements,f=i,p=Kl.useRef(null);r===void 0&&p.current===null&&(p.current=new pt({open:a,transitionStatus:void 0,referenceElement:u,floatingElement:c,triggerElements:l,onOpenChange:f,floatingId:n,syncOnly:!0,nested:s}));let m=r??p.current;return t.useSyncedValue("floatingId",n),F(()=>{let d={open:a,floatingId:n,referenceElement:u,floatingElement:c};H(u)&&(d.domReferenceElement=u),m.state.positionReference===m.state.referenceElement&&(d.positionReference=u),m.update(d)},[a,n,u,c,m]),m.context.onOpenChange=f,m.context.nested=s,m}var Jl={tabIndex:-1,[os]:""};function Zl(e,t,o=!1){let r=At(),n=Ro()!=null,s=Co.useRef(null);e===void 0&&s.current===null&&(s.current=t(r,n));let i=e??s.current;return Gl({popupStore:i,treatPopupAsFloatingElement:o,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:n,onOpenChange:i.setOpen}),{store:i,internalStore:s.current}}function Am(e,t){let o=Co.useRef(null),r=Co.useRef(null);return Co.useCallback(n=>{if(e===void 0)return;let s=!1;if(o.current!==null){let i=o.current,a=r.current,u=t.context.triggerElements.getById(i);a&&u===a&&(t.context.triggerElements.delete(i),s=!0),o.current=null,r.current=null}if(n!==null&&(o.current=e,r.current=n,t.context.triggerElements.add(e,n),s=!0),s){let i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Nm(e,t,o,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let n=o?.id??null;(n||t)&&(e.activeTriggerId=n,e.activeTriggerElement=o??null)}function Dm(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ql(e,t,o,r={}){let n=o.reason,s=n===$.triggerHover,i=t&&n===$.triggerFocus,a=!t&&(n===$.triggerPress||n===$.escapeKey),u=Dm(o);if(e.context.onOpenChange?.(t,o),o.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,o);let c=()=>{let l={...r.extraState,open:t};i?l.instantType="focus":a?l.instantType="dismiss":s&&(l.instantType=void 0),Nm(l,t,o.trigger,u()),e.update(l)};s?Xl.flushSync(c):c()}function ec(e,t,o,r){Aa(()=>{t===void 0&&e.state.open===!1&&o&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function tc(e,t,o,r){let n=o.useState("isMountedByTrigger",e),s=Am(e,o),i=W(a=>{if(s(a),!a)return;let u=o.select("open"),c=o.select("activeTriggerId");if(c===e){o.update({activeTriggerElement:a,...u?r:null});return}c==null&&u&&o.update({activeTriggerId:e,activeTriggerElement:a,...r})});return F(()=>{n&&o.update({activeTriggerElement:t.current,...r})},[n,o,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:n}}function oc(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=e.useState("open"),n=e.useState("triggerCount");F(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}let s=e.context.triggerElements.size,i={};e.state.triggerCount!==s&&(i.triggerCount=s);let a=e.select("activeTriggerId"),u=null;if(a){let c=e.context.triggerElements.getById(a);c?c!==e.state.activeTriggerElement&&(i.activeTriggerElement=c):u=a}if(!u&&!a&&s===1){let c=e.context.triggerElements.entries().next();if(!c.done){let[l,f]=c.value;i.activeTriggerId=l,i.activeTriggerElement=f}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),u&&o&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===u&&!e.context.triggerElements.getById(u)){let c=J($.none);e.setOpen(!1,c),c.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,n,o])}function rc(e,t,o){let{mounted:r,setMounted:n,transitionStatus:s}=Ra(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:a});let u=W(()=>{n(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)});return Mr({enabled:r&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function nc(e,t){e.useSyncedValues(t),F(()=>()=>{e.update({activeTriggerProps:fe,inactiveTriggerProps:fe,popupProps:fe})},[e])}var jt=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,o){let r=this.idMap.get(t);r!==o&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(o),this.idMap.set(t,o))}delete(t){let o=this.idMap.get(t);o&&(this.elementsSet.delete(o),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(let o of this.elementsSet)if(t(o))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function sc(){return new pt({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jt,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ac(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:sc(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fe,inactiveTriggerProps:fe,popupProps:fe}}function lc(e,t,o=!1){return new pt({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0})}var tr=q(e=>e.triggerIdProp??e.activeTriggerId),Ps=q(e=>e.openProp??e.open),ic=q(e=>(e.popupElement?.id??e.floatingId)||void 0);function cc(e,t){return t!==void 0&&Ps(e)&&tr(e)===t}function Mm(e,t){return cc(e,t)?!0:t!==void 0&&Ps(e)&&tr(e)==null&&e.triggerCount===1}var uc={open:Ps,mounted:q(e=>e.mounted),transitionStatus:q(e=>e.transitionStatus),floatingRootContext:q(e=>e.floatingRootContext),triggerCount:q(e=>e.triggerCount),preventUnmountingOnClose:q(e=>e.preventUnmountingOnClose),payload:q(e=>e.payload),activeTriggerId:tr,activeTriggerElement:q(e=>e.mounted?e.activeTriggerElement:null),popupId:ic,isTriggerActive:q((e,t)=>t!==void 0&&tr(e)===t),isOpenedByTrigger:q((e,t)=>cc(e,t)),isMountedByTrigger:q((e,t)=>t!==void 0&&tr(e)===t&&e.mounted),triggerProps:q((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:q((e,t)=>Mm(e,t)?ic(e):void 0),popupProps:q(e=>e.popupProps),popupElement:q(e=>e.popupElement),positionerElement:q(e=>e.positionerElement)};function fc(e){let{open:t=!1,onOpenChange:o,elements:r={}}=e,n=At(),s=Ro()!=null,i=ve(()=>new pt({open:t,transitionStatus:void 0,onOpenChange:o,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new jt,floatingId:n,syncOnly:!1,nested:s})).current;return F(()=>{let a={open:t,floatingId:n};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=H(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,n,r.reference,r.floating,i]),i.context.onOpenChange=o,i.context.nested=s,i}function Os(e={}){let{nodeId:t,externalTree:o}=e,r=fc(e),n=e.rootContext||r,s=n.useState("referenceElement"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),u=n.useState("open"),c=n.useState("floatingId"),[l,f]=Ce.useState(null),[p,m]=Ce.useState(void 0),[d,h]=Ce.useState(void 0),x=Ce.useRef(null),b=Ft(o),y=Ce.useMemo(()=>({reference:s,floating:i,domReference:a}),[s,i,a]),v=Dl({...e,elements:{...y,...l&&{reference:l}}}),w=H(p)?p:null,T=d===void 0?n.state.floatingElement:d;n.useSyncedValue("referenceElement",p??null),n.useSyncedValue("domReferenceElement",p===void 0?a:w),n.useSyncedValue("floatingElement",T);let E=Ce.useCallback(A=>{let N=H(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;f(N),v.refs.setReference(N)},[v.refs]),C=Ce.useCallback(A=>{(H(A)||A===null)&&(x.current=A,m(A)),(H(v.refs.reference.current)||v.refs.reference.current===null||A!==null&&!H(A))&&v.refs.setReference(A)},[v.refs,m]),P=Ce.useCallback(A=>{h(A),v.refs.setFloating(A)},[v.refs]),O=Ce.useMemo(()=>({...v.refs,setReference:C,setFloating:P,setPositionReference:E,domReference:x}),[v.refs,C,P,E]),I=Ce.useMemo(()=>({...v.elements,domReference:a}),[v.elements,a]),Y=Ce.useMemo(()=>({...v,dataRef:n.context.dataRef,open:u,onOpenChange:n.setOpen,events:n.context.events,floatingId:c,refs:O,elements:I,nodeId:t,rootStore:n}),[v,O,I,t,n,u,c]);return F(()=>{a&&(x.current=a)},[a]),F(()=>{n.context.dataRef.current.floatingContext=Y;let A=b?.nodesRef.current.find(N=>N.id===t);A&&(A.context=Y)}),Ce.useMemo(()=>({...v,context:Y,refs:O,elements:I,rootStore:n}),[v,O,I,Y,n])}var mt=g(V(),1);var _s=Rt.os.mac&&Rt.engine.webkit;function ks(e,t={}){let{enabled:o=!0,delay:r}=t,n="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=n.context,a=mt.useRef(!1),u=mt.useRef(null),c=mt.useRef(!0),l=rt();mt.useEffect(()=>{let p=n.select("domReferenceElement");if(!o)return;let m=le(p);function d(){let b=n.select("domReferenceElement");!n.select("open")&&xe(b)&&b===Lr(be(b))&&(a.current=!0)}function h(){c.current=!0}function x(){c.current=!1}return nt(ee(m,"blur",d),_s&&ee(m,"keydown",h,!0),_s&&ee(m,"pointerdown",x,!0))},[n,o]),mt.useEffect(()=>{if(!o)return;function p(m){if(m.reason===$.triggerPress||m.reason===$.escapeKey){let d=n.select("domReferenceElement");H(d)&&(u.current=d,a.current=!0)}}return s.on("openchange",p),()=>{s.off("openchange",p)}},[s,o,n]);let f=mt.useMemo(()=>{function p(){a.current=!1,u.current=null}return{onMouseLeave(){p()},onFocus(m){let d=m.currentTarget;if(a.current){if(u.current===d)return;p()}let h=ke(m.nativeEvent);if(H(h)){if(_s&&!m.relatedTarget){if(!c.current&&!Va(h))return}else if(!Ha(h))return}let x=Mt(m.relatedTarget,n.context.triggerElements),{nativeEvent:b,currentTarget:y}=m,v=typeof r=="function"?r():r;if(n.select("open")&&x||v===0||v===void 0){n.setOpen(!0,J($.triggerFocus,b,y));return}l.start(v,()=>{a.current||n.setOpen(!0,J($.triggerFocus,b,y))})},onBlur(m){p();let d=m.relatedTarget,h=m.nativeEvent,x=H(d)&&d.hasAttribute(vo("focus-guard"))&&d.getAttribute("data-type")==="outside";l.start(0,()=>{let b=n.select("domReferenceElement"),y=Lr(be(b));!d&&y===b||te(i.current.floatingContext?.refs.floating.current,y)||te(b,y)||x||Mt(d??y,n.context.triggerElements)||n.setOpen(!1,J($.triggerFocus,h))})}}},[i,r,n,l]);return mt.useMemo(()=>o?{reference:f,trigger:f}:{},[o,f])}var As=g(V(),1);var Is=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new $e,this.restTimeout=new $e,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Gr=new WeakMap;function Po(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Gr.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Gr.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Xr(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,s=Gr.get(o);s&&s!==e&&Po(s),Po(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,Gr.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function Oo(e){let t=e.context.dataRef.current,o=ve(()=>t.hoverInteractionState??Is.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=o),ho(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ns(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),u=s.useState("domReferenceElement"),{dataRef:c}=s.context,l=Ft(),f=Ro(),p=Oo(s),m=rt(),d=W(()=>Fr(c.current.openEvent?.type,p.interactedInside)),h=W(()=>Ua(c.current.openEvent?.type)),x=W(()=>{Po(p)});F(()=>{i||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,x())},[i,p,x]),As.useEffect(()=>x,[x]),F(()=>{if(o&&i&&p.handleCloseOptions?.blockPointerEvents&&h()&&H(u)&&a){let b=u,y=a,v=be(a),w=l?.nodesRef.current.find(P=>P.id===f)?.context?.elements.floating;w&&(w.style.pointerEvents="");let T=p.pointerEventsScopeElement!==y?p.pointerEventsScopeElement:null,E=w!==y?w:null,C=p.handleCloseOptions?.getScope?.()??T??E??b.closest("[data-rootownerid]")??v.body;return Xr(p,{scopeElement:C,referenceElement:b,floatingElement:y}),()=>{x()}}},[o,i,u,a,p,h,l,f,x]),As.useEffect(()=>{if(!o)return;function b(){return!!(l&&f&&St(l.nodesRef.current,f).length>0)}function y(P){let O=Tt(r,"close",p.pointerType),I=()=>{s.setOpen(!1,J($.triggerHover,P)),l?.events.emit("floating.closed",P)};O?p.openChangeTimeout.start(O,I):(p.openChangeTimeout.clear(),I())}function v(P){let O=ke(P);if(!ns(O)){p.interactedInside=!1;return}p.interactedInside=O?.closest("[aria-haspopup]")!=null}function w(){p.openChangeTimeout.clear(),m.clear(),l?.events.off("floating.closed",E),x()}function T(P){if(b()&&l){l.events.on("floating.closed",E);return}if(Mt(P.relatedTarget,s.context.triggerElements))return;let O=c.current.floatingContext?.nodeId??n,I=P.relatedTarget;if(!(l&&O&&H(I)&&St(l.nodesRef.current,O,!1).some(A=>te(A.context?.elements.floating,I)))){if(p.handler){p.handler(P);return}x(),h()&&!d()&&y(P)}}function E(P){!l||!f||b()||m.start(0,()=>{l.events.off("floating.closed",E),s.setOpen(!1,J($.triggerHover,P)),l.events.emit("floating.closed",P)})}let C=a;return nt(C&&ee(C,"mouseenter",w),C&&ee(C,"mouseleave",T),C&&ee(C,"pointerdown",v,!0),()=>{l?.events.off("floating.closed",E)})},[o,a,s,c,r,n,h,d,x,p,l,f,m])}var Vt=g(V(),1),dc=g(Dt(),1);var Lm={current:null};function Ds(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:u=Lm,externalTree:c,isActiveTrigger:l=!0,getHandleCloseContext:f,isClosing:p,shouldOpen:m}=t,d="rootStore"in e?e.rootStore:e,{dataRef:h,events:x}=d.context,b=Ft(c),y=Oo(d),v=Vt.useRef(!1),w=Me(n),T=Me(r),E=Me(i),C=Me(o),P=Me(m),O=Me(p),I=W(()=>Fr(h.current.openEvent?.type,y.interactedInside)),Y=W(()=>P.current?.()!==!1),A=W((R,k,B)=>{let S=d.context.triggerElements;if(S.hasElement(k))return!R||!te(R,k);if(!H(B))return!1;let _=B;return S.hasMatchingElement(D=>te(D,_))&&(!R||!te(R,_))}),N=W(()=>{if(!y.handler)return;be(d.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),L=W(()=>{Po(y)});return l&&(y.handleCloseOptions=w.current?.__options),Vt.useEffect(()=>N,[N]),Vt.useEffect(()=>{if(!o)return;function R(k){k.open?v.current=!1:(v.current=k.reason===$.triggerHover,N(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return x.on("openchange",R),()=>{x.off("openchange",R)}},[o,x,y,N]),Vt.useEffect(()=>{if(!o)return;function R(_,D=!0){let G=Tt(T.current,"close",y.pointerType);G?y.openChangeTimeout.start(G,()=>{d.setOpen(!1,J($.triggerHover,_)),b?.events.emit("floating.closed",_)}):D&&(y.openChangeTimeout.clear(),d.setOpen(!1,J($.triggerHover,_)),b?.events.emit("floating.closed",_))}let k=u.current??(l?d.select("domReferenceElement"):null);if(!H(k))return;function B(_){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,s&&!Et(y.pointerType))return;let D=ss(E.current),G=Tt(T.current,"open",y.pointerType),U=ke(_),Q=_.currentTarget??null,Z=d.select("domReferenceElement"),ne=Q;if(H(U)&&!d.context.triggerElements.hasElement(U)){for(let ue of d.context.triggerElements.elements())if(te(ue,U)){ne=ue;break}}H(Q)&&H(Z)&&!d.context.triggerElements.hasElement(Q)&&te(Q,Z)&&(ne=Z);let z=ne==null?!1:A(Z,ne,U),ie=d.select("open"),ae=O.current?.()??d.select("transitionStatus")==="ending",de=!ie&&ae&&v.current,Oe=!z&&H(ne)&&H(Z)&&te(Z,ne)&&de,we=D>0&&!G,K=z&&(ie||de)||Oe,ce=!ie||z;if(K){Y()&&d.setOpen(!0,J($.triggerHover,_,ne));return}we||(G?y.openChangeTimeout.start(G,()=>{ce&&Y()&&d.setOpen(!0,J($.triggerHover,_,ne))}):ce&&Y()&&d.setOpen(!0,J($.triggerHover,_,ne)))}function S(_){if(I()){L();return}N();let D=d.select("domReferenceElement"),G=be(D);y.restTimeout.clear(),y.restTimeoutPending=!1;let U=h.current.floatingContext??f?.();if(Mt(_.relatedTarget,d.context.triggerElements))return;if(w.current&&U){d.select("open")||y.openChangeTimeout.clear();let Z=u.current;y.handler=w.current({...U,tree:b,x:_.clientX,y:_.clientY,onClose(){L(),N(),C.current&&!I()&&Z===d.select("domReferenceElement")&&R(_,!0)}}),G.addEventListener("mousemove",y.handler),y.handler(_);return}(y.pointerType!=="touch"||!te(d.select("floatingElement"),_.relatedTarget))&&R(_)}return a?nt(ee(k,"mousemove",B,{once:!0}),ee(k,"mouseenter",B),ee(k,"mouseleave",S)):nt(ee(k,"mouseenter",B),ee(k,"mouseleave",S))},[N,L,h,T,d,o,w,y,l,A,I,s,a,E,u,b,C,f,O,Y]),Vt.useMemo(()=>{if(!o)return;function R(k){y.pointerType=k.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(k){let{nativeEvent:B}=k,S=k.currentTarget,_=d.select("domReferenceElement"),D=d.select("open"),G=A(_,S,k.target);if(s&&!Et(y.pointerType))return;if(D&&G&&y.handleCloseOptions?.blockPointerEvents){let Z=d.select("floatingElement");if(Z){let ne=y.handleCloseOptions?.getScope?.()??S.ownerDocument.body;Xr(y,{scopeElement:ne,referenceElement:S,floatingElement:Z})}}let U=ss(E.current);if(D&&!G||U===0||!G&&y.restTimeoutPending&&k.movementX**2+k.movementY**2<2)return;y.restTimeout.clear();function Q(){if(y.restTimeoutPending=!1,I())return;let Z=d.select("open");!y.blockMouseMove&&(!Z||G)&&Y()&&d.setOpen(!0,J($.triggerHover,B,S))}y.pointerType==="touch"?dc.flushSync(()=>{Q()}):G&&D?Q():(y.restTimeoutPending=!0,y.restTimeout.start(U,Q))}}},[o,y,I,A,s,d,E,Y])}var pc=.1,Bm=pc*pc,re=.5;function Jr(e,t,o,r,n,s){return r>=t!=s>=t&&e<=(n-o)*(t-r)/(s-r)+o}function Zr(e,t,o,r,n,s,i,a,u,c){let l=!1;return Jr(e,t,o,r,n,s)&&(l=!l),Jr(e,t,n,s,i,a)&&(l=!l),Jr(e,t,i,a,u,c)&&(l=!l),Jr(e,t,u,c,o,r)&&(l=!l),l}function Fm(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function Qr(e,t,o,r,n,s){let i=Math.min(o,n),a=Math.max(o,n),u=Math.min(r,s),c=Math.max(r,s);return e>=i&&e<=a&&t>=u&&t<=c}function Ms(e={}){let{blockPointerEvents:t=!1}=e,o=new $e,r=({x:n,y:s,placement:i,elements:a,onClose:u,nodeId:c,tree:l})=>{let f=i?.split("-")[0],p=!1,m=null,d=null,h=typeof performance<"u"?performance.now():0;function x(y,v){let w=performance.now(),T=w-h;if(m===null||d===null||T===0)return m=y,d=v,h=w,!1;let E=y-m,C=v-d,P=E*E+C*C,O=T*T*Bm;return m=y,d=v,h=w,P<O}function b(){o.clear(),u()}return function(v){o.clear();let w=a.domReference,T=a.floating;if(!w||!T||f==null||n==null||s==null)return;let{clientX:E,clientY:C}=v,P=ke(v),O=v.type==="mouseleave",I=te(T,P),Y=te(w,P);if(I&&(p=!0,!O))return;if(Y&&(p=!1,!O)){p=!0;return}if(O&&H(v.relatedTarget)&&te(T,v.relatedTarget))return;function A(){return!!(l&&St(l.nodesRef.current,c).length>0)}function N(){A()||b()}if(A())return;let L=w.getBoundingClientRect(),R=T.getBoundingClientRect(),k=n>R.right-R.width/2,B=s>R.bottom-R.height/2,S=R.width>L.width,_=R.height>L.height,D=(S?L:R).left,G=(S?L:R).right,U=(_?L:R).top,Q=(_?L:R).bottom;if(f==="top"&&s>=L.bottom-1||f==="bottom"&&s<=L.top+1||f==="left"&&n>=L.right-1||f==="right"&&n<=L.left+1){N();return}let Z=!1;switch(f){case"top":Z=Qr(E,C,D,L.top+1,G,R.bottom-1);break;case"bottom":Z=Qr(E,C,D,R.top+1,G,L.bottom-1);break;case"left":Z=Qr(E,C,R.right-1,Q,L.left+1,U);break;case"right":Z=Qr(E,C,L.right-1,Q,R.left+1,U);break;default:}if(Z)return;if(p&&!Fm(E,C,L)){N();return}if(!O&&x(E,C)){N();return}let ne=!1;switch(f){case"top":{let z=S?re/2:re*4,ie=S||k?n+z:n-z,ae=S?n-z:k?n+z:n-z,de=s+re+1,Oe=k||S?R.bottom-re:R.top,we=k?S?R.bottom-re:R.top:R.bottom-re;ne=Zr(E,C,ie,de,ae,de,R.left,Oe,R.right,we);break}case"bottom":{let z=S?re/2:re*4,ie=S||k?n+z:n-z,ae=S?n-z:k?n+z:n-z,de=s-re,Oe=k||S?R.top+re:R.bottom,we=k?S?R.top+re:R.bottom:R.top+re;ne=Zr(E,C,ie,de,ae,de,R.left,Oe,R.right,we);break}case"left":{let z=_?re/2:re*4,ie=_||B?s+z:s-z,ae=_?s-z:B?s+z:s-z,de=n+re+1,Oe=B||_?R.right-re:R.left,we=B?_?R.right-re:R.left:R.right-re;ne=Zr(E,C,Oe,R.top,we,R.bottom,de,ie,de,ae);break}case"right":{let z=_?re/2:re*4,ie=_||B?s+z:s-z,ae=_?s-z:B?s+z:s-z,de=n-re,Oe=B||_?R.left+re:R.right,we=B?_?R.left+re:R.right:R.left+re;ne=Zr(E,C,de,ie,de,ae,Oe,R.top,we,R.bottom);break}default:}ne?p||o.start(40,N):N()}};return r.__options={...e,blockPointerEvents:t},r}var Ls=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Gt.startingStyle]="startingStyle",e[e.endingStyle=Gt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),or=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({}),jm={[or.popupOpen]:""},_v={[or.popupOpen]:"",[or.pressed]:""},Vm={[Ls.open]:""},Hm={[Ls.closed]:""},Um={[Ls.anchorHidden]:""},mc={open(e){return e?jm:null}};var _o={open(e){return e?Vm:Hm},anchorHidden(e){return e?Um:null}};function gc(e){return go(19)?e:e?"true":void 0}var ze=g(V(),1);var Wm=e=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:l=0,offsetParent:f="real"}=it(e,t)||{};if(c==null)return{};let p=Hr(l),m={x:o,y:r},d=Qo(n),h=Zo(d),x=await i.getDimensions(c),b=d==="y",y=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",T=s.reference[h]+s.reference[d]-m[d]-s.floating[h],E=m[d]-s.reference[d],C=f==="real"?await i.getOffsetParent?.(c):a.floating,P=a.floating[w]||s.floating[h];(!P||!await i.isElement?.(C))&&(P=a.floating[w]||s.floating[h]);let O=T/2-E/2,I=P/2-x[h]/2-1,Y=Math.min(p[y],I),A=Math.min(p[v],I),N=Y,L=P-x[h]-A,R=P/2-x[h]/2+O,k=Jo(N,R,L),B=!u.arrow&&at(n)!=null&&R!==k&&s.reference[h]/2-(R<N?Y:A)-x[h]/2<0,S=B?R<N?R-N:R-L:0;return{[d]:m[d]+S,data:{[d]:k,centerOffset:R-k-S,...B&&{alignmentOffset:S}},reset:B}}}),hc=(e,t)=>({...Wm(e),options:[e,t]});var $m=ws().fn,yc={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,s=t===0&&o===0&&r===0&&n===0;return{data:{referenceHidden:(await $m(e)).data?.referenceHidden||s}}}};var rr={sideX:"left",sideY:"top"},xc={name:"adaptiveOrigin",async fn(e){let{x:t,y:o,rects:{floating:r},elements:{floating:n},platform:s,strategy:i,placement:a}=e,u=le(n),c=u.getComputedStyle(n);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:o,data:rr};let f=await s.getOffsetParent?.(n),p={width:0,height:0};if(i==="fixed"&&u?.visualViewport)p={width:u.visualViewport.width,height:u.visualViewport.height};else if(f===u){let y=be(n);p={width:y.documentElement.clientWidth,height:y.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));let m=Re(a),d=t,h=o;m==="left"&&(d=p.width-(t+r.width)),m==="top"&&(h=p.height-(o+r.height));let x=m==="left"?"right":rr.sideX,b=m==="top"?"bottom":rr.sideY;return{x:d,y:h,data:{sideX:x,sideY:b}}}};function vc(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function bc(e,t,o){let{rects:r,placement:n}=e;return{side:vc(t,Re(n),o),align:at(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Rc(e){let{anchor:t,positionMethod:o="absolute",side:r="bottom",sideOffset:n=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:u=5,sticky:c=!1,arrowPadding:l=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:d,mounted:h,collisionAvoidance:x,shiftCrossAxis:b=!1,nodeId:y,adaptiveOrigin:v,lazyFlip:w=!1,externalTree:T}=e,[E,C]=ze.useState(null);!h&&E!==null&&C(null);let P=x.side||"flip",O=x.align||"flip",I=x.fallbackAxisSide||"end",Y=typeof t=="function"?t:void 0,A=W(Y),N=Y?A:t,L=Me(t),R=Me(h),B=mo()==="rtl",S=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],_=s==="center"?S:`${S}-${s}`,D=u,G=1,U=r==="bottom"?G:0,Q=r==="top"?G:0,Z=r==="right"?G:0,ne=r==="left"?G:0;typeof D=="number"?D={top:D+U,right:D+ne,bottom:D+Q,left:D+Z}:D&&(D={top:(D.top||0)+U,right:(D.right||0)+ne,bottom:(D.bottom||0)+Q,left:(D.left||0)+Z});let z={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:D},ie=ze.useRef(null),ae=Me(n),de=Me(i),Oe=typeof n!="function"?n:0,we=typeof i!="function"?i:0,K=[];p&&K.push(p),K.push(gs(oe=>{let _e=bc(oe,r,B),ft=typeof ae.current=="function"?ae.current(_e):ae.current,qe=typeof de.current=="function"?de.current(_e):de.current;return{mainAxis:ft,crossAxis:qe,alignmentAxis:qe}},[Oe,we,B,r]));let ce=O==="none"&&P!=="shift",ue=!ce&&(c||b||P==="shift"),Yt=P==="none"?null:xs({...z,padding:{top:D.top+G,right:D.right+G,bottom:D.bottom+G,left:D.left+G},mainAxis:!b&&P==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),Je=ce?null:hs(oe=>{let _e=be(oe.elements.floating).documentElement;return{...z,rootBoundary:b?{x:0,y:0,width:_e.clientWidth,height:_e.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:ue,limiter:c||b?void 0:ys(ft=>{if(!ie.current)return{};let{width:qe,height:bt}=ie.current.getBoundingClientRect(),Qe=Le(Re(ft.placement)),zt=Qe==="y"?qe:bt,ao=Qe==="y"?D.left+D.right:D.top+D.bottom;return{offset:zt/2+ao/2}})}},[z,c,b,D,O]);P==="shift"||O==="shift"||s==="center"?K.push(Je,Yt):K.push(Yt,Je),K.push(bs({...z,apply({elements:{floating:oe},availableWidth:_e,availableHeight:ft,rects:qe}){if(!R.current)return;let bt=oe.style;bt.setProperty("--available-width",`${_e}px`),bt.setProperty("--available-height",`${ft}px`);let Qe=le(oe).devicePixelRatio||1,{x:zt,y:ao,width:xr,height:Pn}=qe.reference,On=(Math.round((zt+xr)*Qe)-Math.round(zt*Qe))/Qe,_n=(Math.round((ao+Pn)*Qe)-Math.round(ao*Qe))/Qe;bt.setProperty("--anchor-width",`${On}px`),bt.setProperty("--anchor-height",`${_n}px`)}}),hc(oe=>({element:ie.current||be(oe.elements.floating).createElement("div"),padding:l,offsetParent:"floating"}),[l]),{name:"transformOrigin",fn(oe){let{elements:_e,middlewareData:ft,placement:qe,rects:bt,y:Qe}=oe,zt=Re(qe),ao=Le(zt),xr=ie.current,Pn=ft.arrow?.x||0,On=ft.arrow?.y||0,_n=xr?.clientWidth||0,Cf=xr?.clientHeight||0,kn=Pn+_n/2,mi=On+Cf/2,Pf=Math.abs(ft.shift?.y||0),Of=bt.reference.height/2,Fo=typeof n=="function"?n(bc(oe,r,B)):n,_f=Pf>Fo,kf={top:`${kn}px calc(100% + ${Fo}px)`,bottom:`${kn}px ${-Fo}px`,left:`calc(100% + ${Fo}px) ${mi}px`,right:`${-Fo}px ${mi}px`}[zt],If=`${kn}px ${bt.reference.y+Of-Qe}px`;return _e.floating.style.setProperty("--transform-origin",ue&&ao==="y"&&_f?If:kf),{}}},yc,v),F(()=>{!h&&d&&d.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,d]);let yt=ze.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:Ze,elements:ut,x:fr,y:dr,middlewareData:ye,update:io,placement:M,context:j,isPositioned:pe,floatingStyles:Ee}=Os({rootContext:d,open:m?h:void 0,placement:_,middleware:K,strategy:o,whileElementsMounted:m?void 0:(...oe)=>er(...oe,yt),nodeId:y,externalTree:T}),{sideX:Pt,sideY:Bo}=ye.adaptiveOrigin||rr,xt=pe?o:"fixed",He=ze.useMemo(()=>{let oe=v?{position:xt,[Pt]:fr,[Bo]:dr}:{position:xt,...Ee};return pe||(oe.opacity=0),oe},[v,xt,Pt,fr,Bo,dr,Ee,pe]),Ot=ze.useRef(null);F(()=>{if(!h)return;let oe=L.current,_e=typeof oe=="function"?oe():oe,qe=(wc(_e)?_e.current:_e)||null||null;qe!==Ot.current&&(Ze.setPositionReference(qe),Ot.current=qe)},[h,Ze,N,L]),ze.useEffect(()=>{if(!h)return;let oe=L.current;typeof oe!="function"&&wc(oe)&&oe.current!==Ot.current&&(Ze.setPositionReference(oe.current),Ot.current=oe.current)},[h,Ze,N,L]),ze.useEffect(()=>{if(m&&h&&ut.reference&&ut.floating)return er(ut.reference,ut.floating,io,yt)},[m,h,ut,io,yt]);let _t=Re(M),pr=vc(r,_t,B),mr=at(M)||"center",gr=!!ye.hide?.referenceHidden;F(()=>{w&&h&&pe&&C(_t)},[w,h,pe,_t]);let hr=ze.useMemo(()=>({position:"absolute",top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),yr=ye.arrow?.centerOffset!==0;return ze.useMemo(()=>({positionerStyles:He,arrowStyles:hr,arrowRef:ie,arrowUncentered:yr,side:pr,align:mr,physicalSide:_t,anchorHidden:gr,refs:Ze,context:j,isPositioned:pe,update:io}),[He,hr,ie,yr,pr,mr,_t,gr,Ze,j,pe,io])}function wc(e){return e!=null&&"current"in e}function en(e){return e==="starting"?Ja:fe}function Ec(e,t,{styles:o,transitionStatus:r,props:n,refs:s,hidden:i,inert:a=!1}){let u={...o};return a&&(u.pointerEvents="none"),De("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:u},en(r),n],stateAttributesMapping:_o})}var Pe=g(V(),1),_c=g(Dt(),1);var Tc=g(V(),1);function Sc(e){let[t,o]=Tc.useState({current:e,previous:null});return e!==t.current&&o({current:e,previous:t.current}),t.previous}var ko=g(V(),1);function Bs(e){let t=Te(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=xe(e),s=n?e.offsetWidth:o,i=n?e.offsetHeight:r;return(Bt(o)!==s||Bt(r)!==i)&&(o=s,r=i),{width:o,height:r}}function Pc(e){let{popupElement:t,positionerElement:o,content:r,mounted:n,onMeasureLayout:s,onMeasureLayoutComplete:i,side:a,direction:u}=e,c=wo(t,!0,!1),l=yo(),f=ko.useRef(null),p=ko.useRef(!0),m=ko.useRef(It),d=W(s),h=W(i),x=ko.useMemo(()=>{let b=a==="top",y=a==="left";return u==="rtl"?(b=b||a==="inline-end",y=y||a==="inline-end"):(b=b||a==="inline-start",y=y||a==="inline-start"),b?{position:"absolute",[a==="top"?"bottom":"top"]:"0",[y?"right":"left"]:"0"}:fe},[a,u]);F(()=>{if(!n){m.current=It,p.current=!0,f.current=null;return}if(!t||!o)return;m.current=Cc(t,x),Fs(t,"auto");let b=on(t,"position","static"),y=on(t,"transform","none"),v=on(t,"scale","1"),w=Cc(o,{"--available-width":"max-content","--available-height":"max-content"});function T(){b(),y(),w()}function E(){T(),v()}if(d?.(),p.current||f.current===null){tn(o,"max-content");let I=Bs(t);return f.current=I,tn(o,I),E(),h?.(null,I),p.current=!1,()=>{m.current(),m.current=It}}tn(o,"max-content");let C=f.current,P=Bs(t);f.current=P,Fs(t,C),E(),h?.(C,P),tn(o,P);let O=new AbortController;return l.request(()=>{Fs(t,P),c(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},O.signal)}),()=>{O.abort(),l.cancel(),m.current(),m.current=It}},[r,t,o,c,l,n,d,h,x])}function on(e,t,o){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,r)}}function Cc(e,t){let o=[];for(let[r,n]of Object.entries(t))o.push(on(e,r,n));return o.length?()=>{o.forEach(r=>r())}:It}function Fs(e,t){let o=t==="auto"?"auto":`${t.width}px`,r=t==="auto"?"auto":`${t.height}px`;e.style.setProperty("--popup-width",o),e.style.setProperty("--popup-height",r)}function tn(e,t){let o=t==="max-content"?"max-content":`${t.width}px`,r=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",o),e.style.setProperty("--positioner-height",r)}var Io=g(X(),1);function kc(e){let{store:t,side:o,cssVars:r,children:n}=e,s=mo(),i=t.useState("activeTriggerElement"),a=t.useState("activeTriggerId"),u=t.useState("open"),c=t.useState("payload"),l=t.useState("mounted"),f=t.useState("popupElement"),p=t.useState("positionerElement"),m=Sc(u?i:null),d=qm(a,c),h=Pe.useRef(null),[x,b]=Pe.useState(null),[y,v]=Pe.useState(null),w=Pe.useRef(null),T=Pe.useRef(null),E=wo(w,!0,!1),C=yo(),[P,O]=Pe.useState(null),[I,Y]=Pe.useState(!1);F(()=>(t.set("hasViewport",!0),()=>{t.set("hasViewport",!1)}),[t]);let A=W(()=>{w.current?.style.setProperty("animation","none"),w.current?.style.setProperty("transition","none"),T.current?.style.setProperty("display","none")}),N=W(S=>{w.current?.style.removeProperty("animation"),w.current?.style.removeProperty("transition"),T.current?.style.removeProperty("display"),S&&O(S)}),L=Pe.useRef(null);F(()=>{(!u||!l)&&(L.current=null)},[u,l]),F(()=>{if(i&&m&&i!==m&&L.current!==i&&h.current){b(h.current),Y(!0);let S=zm(m,i);v(S),C.request(()=>{_c.flushSync(()=>{Y(!1)}),E(()=>{b(null),O(null),h.current=null})}),L.current=i}},[i,m,x,E,C]),F(()=>{let S=w.current;if(!S)return;let _=be(S).createElement("div");for(let D of Array.from(S.childNodes))_.appendChild(D.cloneNode(!0));h.current=_});let R=x!=null,k;R?k=(0,Io.jsxs)(Pe.Fragment,{children:[(0,Io.jsx)("div",{"data-previous":!0,inert:gc(!0),ref:T,style:{...P?{[r.popupWidth]:`${P.width}px`,[r.popupHeight]:`${P.height}px`}:null,position:"absolute"},"data-ending-style":I?void 0:""},"previous"),(0,Io.jsx)("div",{"data-current":!0,ref:w,"data-starting-style":I?"":void 0,children:n},d)]}):k=(0,Io.jsx)("div",{"data-current":!0,ref:w,children:n},d),F(()=>{let S=T.current;!S||!x||S.replaceChildren(...Array.from(x.childNodes))},[x]),Pc({popupElement:f,positionerElement:p,mounted:l,content:c,onMeasureLayout:A,onMeasureLayoutComplete:N,side:o,direction:s});let B={activationDirection:Ym(y),transitioning:R};return{children:k,state:B}}function Ym(e){if(e)return`${Oc(e.horizontal,5,"right","left")} ${Oc(e.vertical,5,"down","up")}`}function Oc(e,t,o,r){return e>t?o:e<-t?r:""}function zm(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n={x:o.left+o.width/2,y:o.top+o.height/2},s={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:s.x-n.x,vertical:s.y-n.y}}function qm(e,t){let[o,r]=Pe.useState(0),n=Pe.useRef(e),s=Pe.useRef(t),i=Pe.useRef(!1);return F(()=>{let a=n.current,u=s.current,c=e!==a,l=t!==u;c?(r(f=>f+1),i.current=!l):i.current&&l&&(r(f=>f+1),i.current=!1),n.current=e,s.current=t},[e,t]),`${e??"current"}-${o}`}var rn=g(V(),1),Ic=g(Dt(),1);var Ac=g(X(),1),Nc=rn.forwardRef(function(t,o){let{children:r,container:n,className:s,render:i,style:a,...u}=t,{portalNode:c,portalSubtree:l}=ls({container:n,ref:o,componentProps:t,elementProps:u});return!l&&!c?null:(0,Ac.jsxs)(rn.Fragment,{children:[l,c&&Ic.createPortal(r,c)]})});var je={};Ke(je,{Arrow:()=>Gc,Handle:()=>nr,Popup:()=>qc,Portal:()=>Wc,Positioner:()=>Yc,Provider:()=>Xc,Root:()=>Mc,Trigger:()=>Vc,Viewport:()=>Qc,createHandle:()=>eu});var gt=g(V(),1);var nn=g(V(),1),js=nn.createContext(void 0);function Xe(e){let t=nn.useContext(js);if(t===void 0&&!e)throw new Error(Ne(72));return t}var Dc=g(V(),1);var Km={...uc,disabled:q(e=>e.disabled),instantType:q(e=>e.instantType),isInstantPhase:q(e=>e.isInstantPhase),trackCursorAxis:q(e=>e.trackCursorAxis),disableHoverablePopup:q(e=>e.disableHoverablePopup),lastOpenChangeReason:q(e=>e.openChangeReason),closeOnClick:q(e=>e.closeOnClick),closeDelay:q(e=>e.closeDelay),hasViewport:q(e=>e.hasViewport)},Ao=class e extends So{constructor(t,o,r=!1){let n=new jt,s={...Gm(),...t};s.floatingRootContext=lc(n,o,r),super(s,{popupRef:Dc.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:n},Km)}setOpen=(t,o)=>{Ql(this,t,o,{extraState:{openChangeReason:o.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,J($.triggerPress,t))}static useStore(t,o){return Zl(t,(n,s)=>new e(o,n,s)).store}};function Gm(){return{...ac(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var sn=g(X(),1),Mc=Ss(function(t){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:u,onOpenChangeComplete:c,handle:l,triggerId:f,defaultTriggerId:p=null,children:m}=t,d=Ao.useStore(l?.store,{open:r,openProp:n,activeTriggerId:p,triggerIdProp:f});ec(d,n,r,p),d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",f),d.useContextCallback("onOpenChange",u),d.useContextCallback("onOpenChangeComplete",c);let h=d.useState("open"),x=!o&&h,b=d.useState("activeTriggerId"),y=d.useState("mounted"),v=d.useState("payload");d.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s}),d.useSyncedValue("disabled",o),oc(d,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w,transitionStatus:T}=rc(x,d),E=d.useState("isInstantPhase"),C=d.useState("instantType"),P=d.useState("lastOpenChangeReason"),O=gt.useRef(null);F(()=>{h&&o&&d.setOpen(!1,J($.disabled))},[h,o,d]),F(()=>{T==="ending"&&P===$.none||T!=="ending"&&E?(C!=="delay"&&(O.current=C),d.set("instantType","delay")):O.current!==null&&(d.set("instantType",O.current),O.current=null)},[T,E,P,C,d]),F(()=>{x&&b==null&&d.set("payload",void 0)},[d,b,x]);let I=gt.useCallback(()=>{d.setOpen(!1,J($.imperativeAction))},[d]);gt.useImperativeHandle(a,()=>({unmount:w,close:I}),[w,I]);let Y=x||y||!o&&i!=="none";return(0,sn.jsxs)(js.Provider,{value:d,children:[Y&&(0,sn.jsx)(Xm,{store:d,disabled:o,trackCursorAxis:i}),typeof m=="function"?m({payload:v}):m]})});function Xm({store:e,disabled:t,trackCursorAxis:o}){let r=e.useState("floatingRootContext"),n=us(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=cs(r,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),i=gt.useMemo(()=>vt(s.reference,n.reference),[s.reference,n.reference]),a=gt.useMemo(()=>vt(s.trigger,n.trigger),[s.trigger,n.trigger]),u=gt.useMemo(()=>vt(Jl,s.floating,n.floating),[s.floating,n.floating]);return nc(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:u}),null}var ln=g(V(),1);var an=g(V(),1),Vs=an.createContext(void 0);function Lc(){return an.useContext(Vs)}var Bc=(function(e){return e[e.popupOpen=or.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});var jc="data-base-ui-tooltip-trigger";function Fc(e){if("composedPath"in e){let o=e.composedPath();for(let r=0;r<o.length;r+=1){let n=o[r];if(H(n))return n}}let t=e.target;return H(t)?t:null}function Jm(e){let t=e;for(;t;){if(t.hasAttribute(jc))return t;let o=t.parentElement;if(o){t=o;continue}let r=t.getRootNode();t="host"in r&&H(r.host)?r.host:null}return null}var Vc=Yl(function(t,o){let{render:r,className:n,style:s,handle:i,payload:a,disabled:u,delay:c,closeOnClick:l=!0,closeDelay:f,id:p,...m}=t,d=Xe(!0),h=i?.store??d;if(!h)throw new Error(Ne(82));let x=wa(p),b=h.useState("isTriggerActive",x),y=h.useState("isOpenedByTrigger",x),v=h.useState("floatingRootContext"),w=ln.useRef(null),T=c??600,E=f??0,{registerTrigger:C,isMountedByThisTrigger:P}=tc(x,w,h,{payload:a,closeOnClick:l,closeDelay:E}),O=Lc(),{delayRef:I,isInstantPhase:Y,hasProvider:A}=as(v,{open:y}),N=Oo(v);h.useSyncedValue("isInstantPhase",Y);let L=h.useState("disabled"),R=u??L,k=Me(R),B=h.useState("trackCursorAxis"),S=h.useState("disableHoverablePopup"),_=ln.useRef(!1),D=rt(),G=ln.useRef(void 0);function U(){let K=O?.delay,ce=typeof I.current=="object"?I.current.open:void 0,ue=T;return A&&(ce!==0?ue=c??K??T:ue=0),ue}function Q(K){let ce=w.current;if(!ce||!K)return!1;let ue=Jm(K);return ue!==null&&ue!==ce&&te(ce,ue)}function Z(K){let ce=Q(K);return _.current=ce,ce&&(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1,D.clear()),ce}let ne=Ds(v,{enabled:!R,mouseOnly:!0,move:!1,handleClose:!S&&B!=="both"?Ms():null,restMs:U,delay(){let K=typeof I.current=="object"?I.current.close:void 0,ce=E;return f==null&&A&&(ce=K),{close:ce}},triggerElementRef:w,isActiveTrigger:b,isClosing:()=>h.select("transitionStatus")==="ending",shouldOpen(){return!_.current}}),z=ks(v,{enabled:!R}).reference,ie=K=>{let ce=_.current,ue=Fc(K),Yt=Z(ue),Je=w.current,yt=Je&&ue&&te(Je,ue);if(Yt&&h.select("open")&&h.select("lastOpenChangeReason")===$.triggerHover){h.setOpen(!1,J($.triggerHover,K));return}if(ce&&!Yt&&yt&&!k.current&&!h.select("open")&&Je&&Et(G.current)){let Ze=()=>{!_.current&&!k.current&&!h.select("open")&&h.setOpen(!0,J($.triggerHover,K,Je))},ut=U();ut===0?(D.clear(),Ze()):D.start(ut,Ze)}},ae=h.useState("triggerProps",P);return De("button",t,{state:{open:y},ref:[o,C,w],props:[ne,z,P||B!=="none"?ae:void 0,{onMouseOver(K){ie(K.nativeEvent)},onFocus(K){Q(Fc(K.nativeEvent))&&K.preventBaseUIHandler()},onMouseLeave(){_.current=!1,D.clear(),G.current=void 0},onPointerEnter(K){G.current=K.pointerType},onPointerDown(K){G.current=K.pointerType,h.set("closeOnClick",l),l&&!h.select("open")&&h.cancelPendingOpen(K.nativeEvent)},onClick(K){l&&!h.select("open")&&h.cancelPendingOpen(K.nativeEvent)},id:x,[Bc.triggerDisabled]:R?"":void 0,[jc]:R?void 0:""},m],stateAttributesMapping:mc})});var Uc=g(V(),1);var cn=g(V(),1),Hs=cn.createContext(void 0);function Hc(){let e=cn.useContext(Hs);if(e===void 0)throw new Error(Ne(70));return e}var Us=g(X(),1),Wc=Uc.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t;return Xe().useState("mounted")||r?(0,Us.jsx)(Hs.Provider,{value:r,children:(0,Us.jsx)(Nc,{ref:o,...n})}):null});var fn=g(V(),1);var un=g(V(),1),Ws=un.createContext(void 0);function No(){let e=un.useContext(Ws);if(e===void 0)throw new Error(Ne(71));return e}var $c=g(X(),1),Yc=fn.forwardRef(function(t,o){let{render:r,className:n,anchor:s,positionMethod:i="absolute",side:a="top",align:u="center",sideOffset:c=0,alignOffset:l=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:d=!1,disableAnchorTracking:h=!1,collisionAvoidance:x=Za,style:b,...y}=t,v=Xe(),w=Hc(),T=v.useState("open"),E=v.useState("mounted"),C=v.useState("trackCursorAxis"),P=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),I=v.useState("instantType"),Y=v.useState("transitionStatus"),A=v.useState("hasViewport"),N=Rc({anchor:s,positionMethod:i,floatingRootContext:O,mounted:E,side:a,sideOffset:c,align:u,alignOffset:l,collisionBoundary:f,collisionPadding:p,sticky:d,arrowPadding:m,disableAnchorTracking:h,keepMounted:w,collisionAvoidance:x,adaptiveOrigin:A?xc:void 0}),L=fn.useMemo(()=>({open:T,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:C!=="none"?"tracking-cursor":I}),[T,N.side,N.align,N.anchorHidden,C,I]),R=Ec(t,L,{styles:N.positionerStyles,transitionStatus:Y,props:y,refs:[o,v.useStateSetter("positionerElement")],hidden:!E,inert:!T||C==="both"||P});return(0,$c.jsx)(Ws.Provider,{value:N,children:R})});var zc=g(V(),1);var Zm={..._o,...Ea},qc=zc.forwardRef(function(t,o){let{render:r,className:n,style:s,...i}=t,a=Xe(),{side:u,align:c}=No(),l=a.useState("open"),f=a.useState("instantType"),p=a.useState("transitionStatus"),m=a.useState("popupProps"),d=a.useState("floatingRootContext"),h=a.useState("disabled"),x=a.useState("closeDelay");Mr({open:l,ref:a.context.popupRef,onComplete(){l&&a.context.onOpenChangeComplete?.(!0)}}),Ns(d,{enabled:!h,closeDelay:x});let b=a.useStateSetter("popupElement");return De("div",t,{state:{open:l,side:u,align:c,instant:f,transitionStatus:p},ref:[o,a.context.popupRef,b],props:[m,en(p),i],stateAttributesMapping:Zm})});var Kc=g(V(),1);var Gc=Kc.forwardRef(function(t,o){let{render:r,className:n,style:s,...i}=t,a=Xe(),{arrowRef:u,side:c,align:l,arrowUncentered:f,arrowStyles:p}=No(),m=a.useState("open"),d=a.useState("instantType");return De("div",t,{state:{open:m,side:c,align:l,uncentered:f,instant:d},ref:[o,u],props:[{style:p,"aria-hidden":!0},i],stateAttributesMapping:_o})});var $s=g(V(),1);var Ys=g(X(),1),Xc=function(t){let{delay:o,closeDelay:r,timeout:n=400}=t,s=$s.useMemo(()=>({delay:o,closeDelay:r}),[o,r]),i=$s.useMemo(()=>({open:o,close:r}),[o,r]);return(0,Ys.jsx)(Vs.Provider,{value:s,children:(0,Ys.jsx)(is,{delay:i,timeoutMs:n,children:t.children})})};var Zc=g(V(),1);var Jc=(function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e})({});var Qm={activationDirection:e=>e?{"data-activation-direction":e}:null},Qc=Zc.forwardRef(function(t,o){let{render:r,className:n,style:s,children:i,...a}=t,u=Xe(),c=No(),l=u.useState("instantType"),{children:f,state:p}=kc({store:u,side:c.side,cssVars:Jc,children:i}),m={activationDirection:p.activationDirection,transitioning:p.transitioning,instant:l};return De("div",t,{state:m,ref:o,props:[a,{children:f}],stateAttributesMapping:Qm})});var nr=class{constructor(){this.store=new Ao}open(t){let o=t?this.store.context.triggerElements.getById(t):void 0;if(t&&!o)throw new Error(Ne(81,t));this.store.setOpen(!0,J($.imperativeAction,void 0,o))}close(){this.store.setOpen(!1,J($.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function eu(){return new nr}function tu(e){return De(e.defaultTagName??"div",e,e)}var pn=g(Ue(),1),sr=(0,pn.forwardRef)(({icon:e,size:t=24,...o},r)=>(0,pn.cloneElement)(e,{width:t,height:t,...o,ref:r}));var mn=g(dn(),1),zs=g(X(),1),qs=(0,zs.jsx)(mn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,zs.jsx)(mn.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z"})});var gn=g(dn(),1),Ks=g(X(),1),Gs=(0,Ks.jsx)(gn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Ks.jsx)(gn.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})});var hn=g(dn(),1),Xs=g(X(),1),Js=(0,Xs.jsx)(hn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Xs.jsx)(hn.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})});var su=g(Ue(),1);function Zs(e,t,o){return(0,su.cloneElement)(e??t,{children:o})}var eg=g(au(),1);var uu=g(cu(),1),{lock:BT,unlock:fu}=(0,uu.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/ui");function tg(){let e=eg;if(e.ThemeProvider)return e.ThemeProvider;if(!e.privateApis)throw new Error("@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`.");return fu(e.privateApis).ThemeProvider}var du=tg();var Do={};Ke(Do,{Popup:()=>Su,Portal:()=>yn,Positioner:()=>xn,Provider:()=>Au,Root:()=>ku,Trigger:()=>Ou});var Eu=g(Ue(),1);var yu=g(Ue(),1);var ei="data-wp-hash";function ti(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&rg(document)),e.__wpStyleRuntime}function og(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${ei}]`))if(o.getAttribute(ei)===t)return!0;return!1}function mu(e,t,o){if(!e.head)return;let r=ti(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(og(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(ei,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function rg(e){let t=ti();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)mu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function ng(e,t){let o=ti();o.styles.set(e,t);for(let r of o.documents.keys())mu(r,e,t)}typeof process>"u",ng("be37f31c1e","._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");var pu={slot:"_11fc52b637ff8a7e__slot"},gu="data-wp-compat-overlay-slot";function sg(){return typeof document>"u"?null:document}function ig(){let e;try{e=window.top?.wp}catch{}let t=e??window.wp;return typeof t?.components=="object"&&t.components!==null}var ht=null;function Qs(e){return e.setAttribute("aria-hidden","false"),e}function ag(e){let t=e.createElement("div");return t.setAttribute(gu,""),pu.slot&&t.classList.add(pu.slot),e.body.appendChild(t),t}function hu(){if(typeof window>"u"||!ig()&&window.__wpUiCompatOverlaySlotEnabled!==!0)return;let e=sg();if(!e||!e.body)return;if(ht&&ht.ownerDocument===e&&ht.isConnected)return Qs(ht);let t=e.querySelector(`[${gu}]`);return t instanceof HTMLDivElement?(ht=Qs(t),ht):(ht?.isConnected&&ht.remove(),ht=Qs(ag(e)),ht)}var xu=g(X(),1),yn=(0,yu.forwardRef)(function({container:t,...o},r){return(0,xu.jsx)(je.Portal,{container:t??hu(),...o,ref:r})});var bu=g(Ue(),1),Ru=g(X(),1),oi="data-wp-hash";function ri(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&cg(document)),e.__wpStyleRuntime}function lg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${oi}]`))if(o.getAttribute(oi)===t)return!0;return!1}function wu(e,t,o){if(!e.head)return;let r=ri(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(lg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(oi,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function cg(e){let t=ri();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)wu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function vu(e,t){let o=ri();o.styles.set(e,t);for(let r of o.documents.keys())wu(r,e,t)}typeof process>"u",vu("10f3806643","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");var ug={"box-sizing":"_336cd3e4e743482f__box-sizing"};typeof process>"u",vu("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var fg={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},xn=(0,bu.forwardRef)(function({align:t="center",className:o,side:r="top",sideOffset:n=4,...s},i){return(0,Ru.jsx)(je.Positioner,{ref:i,align:t,side:r,sideOffset:n,...s,className:po(ug["box-sizing"],fg.positioner,o)})});var ir=g(X(),1),ni="data-wp-hash";function si(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&pg(document)),e.__wpStyleRuntime}function dg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${ni}]`))if(o.getAttribute(ni)===t)return!0;return!1}function Tu(e,t,o){if(!e.head)return;let r=si(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(dg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(ni,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function pg(e){let t=si();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)Tu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function mg(e,t){let o=si();o.styles.set(e,t);for(let r of o.documents.keys())Tu(r,e,t)}typeof process>"u",mg("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var gg={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},hg={background:"#1e1e1e"},Su=(0,Eu.forwardRef)(function({portal:t,positioner:o,children:r,className:n,...s},i){let a=(0,ir.jsx)(du,{color:hg,children:(0,ir.jsx)(je.Popup,{ref:i,className:po(gg.popup,n),...s,children:r})}),u=Zs(o,(0,ir.jsx)(xn,{}),a);return Zs(t,(0,ir.jsx)(yn,{}),u)});var Cu=g(Ue(),1),Pu=g(X(),1),Ou=(0,Cu.forwardRef)(function(t,o){return(0,Pu.jsx)(je.Trigger,{ref:o,...t})});var _u=g(X(),1);function ku(e){return(0,_u.jsx)(je.Root,{...e})}var Iu=g(X(),1);function Au({...e}){return(0,Iu.jsx)(je.Provider,{...e})}var Nu=g(Ue(),1),ii="data-wp-hash";function ai(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&xg(document)),e.__wpStyleRuntime}function yg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${ii}]`))if(o.getAttribute(ii)===t)return!0;return!1}function Du(e,t,o){if(!e.head)return;let r=ai(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(yg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(ii,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function xg(e){let t=ai();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)Du(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function bg(e,t){let o=ai();o.styles.set(e,t);for(let r of o.documents.keys())Du(r,e,t)}typeof process>"u",bg("fa606a57ae","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");var wg={"visually-hidden":"f37b9e2e191ebd66__visually-hidden"},li=(0,Nu.forwardRef)(function({render:t,...o},r){return tu({render:t,ref:r,props:vt({className:wg["visually-hidden"]},o,{"data-visually-hidden":""})})});var bn=g(We(),1);var Mo=g(X(),1);function vg({rating:e}){let t=Math.round(e/.5)*.5,o=Math.floor(e),r=Math.ceil(e-o),n=5-(o+r);return(0,Mo.jsxs)("span",{"aria-label":(0,bn.sprintf)((0,bn.__)("%s out of 5 stars"),t),children:[Array.from({length:o}).map((s,i)=>(0,Mo.jsx)(sr,{className:"block-directory-block-ratings__star-full",icon:Gs,size:16},`full_stars_${i}`)),Array.from({length:r}).map((s,i)=>(0,Mo.jsx)(sr,{className:"block-directory-block-ratings__star-half-full",icon:Js,size:16},`half_stars_${i}`)),Array.from({length:n}).map((s,i)=>(0,Mo.jsx)(sr,{className:"block-directory-block-ratings__star-empty",icon:qs,size:16},`empty_stars_${i}`))]})}var Mu=vg;var ci=g(X(),1),Rg=({rating:e})=>(0,ci.jsx)("span",{className:"block-directory-block-ratings",children:(0,ci.jsx)(Mu,{rating:e})}),Lu=Rg;var Bu=g(lo(),1),ui=g(X(),1);function Eg({icon:e}){let t="block-directory-downloadable-block-icon";return e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)!==null?(0,ui.jsx)("img",{className:t,src:e,alt:""}):(0,ui.jsx)(Bu.BlockIcon,{className:t,icon:e,showColors:!0})}var wn=Eg;var Fu=g(We(),1),ju=g(Ge(),1);var vn=g(X(),1),Tg=({block:e})=>{let t=(0,ju.useSelect)(o=>o(me).getErrorNoticeForBlock(e.id),[e]);return t?(0,vn.jsx)("div",{className:"block-directory-downloadable-block-notice",children:(0,vn.jsxs)("div",{className:"block-directory-downloadable-block-notice__content",children:[t.message,t.isFatal?" "+(0,Fu.__)("Try reloading the page."):null]})}):null},Vu=Tg;var he=g(X(),1);function Sg({title:e,rating:t,ratingCount:o},{hasNotice:r,isInstalled:n,isInstalling:s}){let i=Math.round(t/.5)*.5;return!n&&r?(0,Ve.sprintf)("Retry installing %s.",(0,Ht.decodeEntities)(e)):n?(0,Ve.sprintf)("Add %s.",(0,Ht.decodeEntities)(e)):s?(0,Ve.sprintf)("Installing %s.",(0,Ht.decodeEntities)(e)):o<1?(0,Ve.sprintf)("Install %s.",(0,Ht.decodeEntities)(e)):(0,Ve.sprintf)((0,Ve._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,Ht.decodeEntities)(e),i,o)}function Cg({item:e,onClick:t}){let{author:o,description:r,icon:n,rating:s,title:i}=e,a=!!(0,Uu.getBlockType)(e.name),{hasNotice:u,isInstalling:c,isInstallable:l}=(0,Wu.useSelect)(m=>{let{getErrorNoticeForBlock:d,isInstalling:h}=m(me),x=d(e.id),b=x&&x.isFatal;return{hasNotice:!!x,isInstalling:h(e.id),isInstallable:!b}},[e]),f="";a?f=(0,Ve.__)("Installed!"):c&&(f=(0,Ve.__)("Installing\u2026"));let p=Sg(e,{hasNotice:u,isInstalled:a,isInstalling:c});return(0,he.jsxs)(Do.Root,{children:[(0,he.jsx)(Do.Trigger,{render:(0,he.jsxs)(Rn.Composite.Item,{className:po("block-directory-downloadable-block-list-item",c&&"is-installing"),accessibleWhenDisabled:!0,disabled:c||!l,onClick:m=>{m.preventDefault(),t()},"aria-label":p,type:"button",role:"option",children:[(0,he.jsxs)("div",{className:"block-directory-downloadable-block-list-item__icon",children:[(0,he.jsx)(wn,{icon:n,title:i}),c?(0,he.jsx)("span",{className:"block-directory-downloadable-block-list-item__spinner",children:(0,he.jsx)(Rn.Spinner,{})}):(0,he.jsx)(Lu,{rating:s})]}),(0,he.jsxs)("span",{className:"block-directory-downloadable-block-list-item__details",children:[(0,he.jsx)("span",{className:"block-directory-downloadable-block-list-item__title",children:(0,Hu.createInterpolateElement)((0,Ve.sprintf)((0,Ve.__)("%1$s <span>by %2$s</span>"),(0,Ht.decodeEntities)(i),o),{span:(0,he.jsx)("span",{className:"block-directory-downloadable-block-list-item__author"})})}),u?(0,he.jsx)(Vu,{block:e}):(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)("span",{className:"block-directory-downloadable-block-list-item__desc",children:f||(0,Ht.decodeEntities)(r)}),l&&!(a||c)&&(0,he.jsx)(li,{children:(0,Ve.__)("Install block")})]})]})]})}),(0,he.jsx)(Do.Popup,{children:p})]})}var $u=Cg;var fi=g(X(),1),Pg=()=>{};function Og({items:e,onHover:t=Pg,onSelect:o}){let{installBlockType:r}=(0,Ku.useDispatch)(me);return e.length?(0,fi.jsx)(zu.Composite,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,Yu.__)("Blocks available for install"),children:e.map(n=>(0,fi.jsx)($u,{onClick:()=>{(0,qu.getBlockType)(n.name)?o(n):r(n).then(s=>{s&&o(n)}),t(null)},onHover:t,item:n},n.id))}):null}var Gu=Og;var Ut=g(We(),1),Xu=g(Ue(),1),Ju=g(ru(),1),lt=g(X(),1);function _g({children:e,downloadableItems:t,hasLocalBlocks:o}){let r=t.length;return(0,Xu.useEffect)(()=>{(0,Ju.speak)((0,Ut.sprintf)((0,Ut._n)("%d additional block is available to install.","%d additional blocks are available to install.",r),r))},[r]),(0,lt.jsxs)(lt.Fragment,{children:[!o&&(0,lt.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,Ut.__)("No results available from your installed blocks.")}),(0,lt.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,lt.jsxs)("div",{className:"block-directory-downloadable-blocks-panel",children:[(0,lt.jsxs)("div",{className:"block-directory-downloadable-blocks-panel__header",children:[(0,lt.jsx)("h2",{className:"block-directory-downloadable-blocks-panel__title",children:(0,Ut.__)("Available to install")}),(0,lt.jsx)("p",{className:"block-directory-downloadable-blocks-panel__description",children:(0,Ut.__)("Select a block to install and add it to your post.")})]}),e]})]})}var Zu=_g;var En=g(We(),1),Tn=g(qt(),1),ct=g(X(),1);function kg(){return(0,ct.jsxs)(ct.Fragment,{children:[(0,ct.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,ct.jsx)("p",{children:(0,En.__)("No results found.")})}),(0,ct.jsx)("div",{className:"block-editor-inserter__tips",children:(0,ct.jsxs)(Tn.Tip,{children:[(0,En.__)("Interested in creating your own block?"),(0,ct.jsx)("br",{}),(0,ct.jsxs)(Tn.ExternalLink,{href:"https://developer.wordpress.org/block-editor/",children:[(0,En.__)("Get started here"),"."]})]})})]})}var di=kg;var Ae=g(X(),1),Qu=[],Ig=e=>(0,rf.useSelect)(t=>{let{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r,getInstalledBlockTypes:n}=t(me),s=t(of.store).canUser("read","block-directory/search"),i=Qu;if(s){i=o(e);let a=n(),u=i.filter(({name:c})=>{let l=a.some(p=>p.name===c),f=(0,nf.getBlockType)(c);return l||!f});u.length!==i.length&&(i=u),i.length===0&&(i=Qu)}return{hasPermission:s,downloadableBlocks:i,isLoading:r(e)}},[e]);function sf({onSelect:e,onHover:t,hasLocalBlocks:o,isTyping:r,filterValue:n}){let{hasPermission:s,downloadableBlocks:i,isLoading:a}=Ig(n);return s===void 0||a||r?(0,Ae.jsxs)(Ae.Fragment,{children:[s&&!o&&(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,ef.__)("No results available from your installed blocks.")}),(0,Ae.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"})]}),(0,Ae.jsx)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading",children:(0,Ae.jsx)(tf.Spinner,{})})]}):s===!1?o?null:(0,Ae.jsx)(di,{}):i.length===0?o?null:(0,Ae.jsx)(di,{}):(0,Ae.jsx)(Zu,{downloadableItems:i,hasLocalBlocks:o,children:(0,Ae.jsx)(Gu,{items:i,onSelect:e,onHover:t})})}var pi=g(X(),1);function Ag(){let[e,t]=(0,cf.useState)(""),o=(0,lf.debounce)(t,400);return(0,pi.jsx)(af.__unstableInserterMenuExtension,{children:({onSelect:r,onHover:n,filterValue:s,hasItems:i})=>(e!==s&&o(s),e?(0,pi.jsx)(sf,{onSelect:r,onHover:n,filterValue:e,hasLocalBlocks:i,isTyping:s!==e}):null)})}var uf=Ag;var ar=g(We(),1),df=g(Ge(),1),pf=g(In(),1);var Sn=g(We(),1);var Wt=g(X(),1);function ff({items:e}){return e.length?(0,Wt.jsx)("ul",{className:"block-directory-compact-list",children:e.map(({icon:t,id:o,title:r,author:n})=>(0,Wt.jsxs)("li",{className:"block-directory-compact-list__item",children:[(0,Wt.jsx)(wn,{icon:t,title:r}),(0,Wt.jsxs)("div",{className:"block-directory-compact-list__item-details",children:[(0,Wt.jsx)("div",{className:"block-directory-compact-list__item-title",children:r}),(0,Wt.jsx)("div",{className:"block-directory-compact-list__item-author",children:(0,Sn.sprintf)((0,Sn.__)("By %s"),n)})]})]},o))}):null}var lr=g(X(),1);function mf(){let e=(0,df.useSelect)(t=>t(me).getNewBlockTypes(),[]);return e.length?(0,lr.jsxs)(pf.PluginPrePublishPanel,{title:(0,ar.sprintf)((0,ar._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0,children:[(0,lr.jsx)("p",{className:"installed-blocks-pre-publish-panel__copy",children:(0,ar._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)}),(0,lr.jsx)(ff,{items:e})]}):null}var no=g(We(),1),bf=g(qt(),1),wf=g(kt(),1),vf=g(Ue(),1),ur=g(Ge(),1),Rf=g(Fn(),1),so=g(lo(),1);var Cn=g(We(),1),gf=g(qt(),1),Lo=g(kt(),1),cr=g(Ge(),1),hf=g(lo(),1);var yf=g(X(),1);function xf({attributes:e,block:t,clientId:o}){let r=(0,cr.useSelect)(i=>i(me).isInstalling(t.id),[t.id]),{installBlockType:n}=(0,cr.useDispatch)(me),{replaceBlock:s}=(0,cr.useDispatch)(hf.store);return(0,yf.jsx)(gf.Button,{__next40pxDefaultSize:!0,onClick:()=>n(t).then(i=>{if(i){let a=(0,Lo.getBlockType)(t.name),[u]=(0,Lo.parse)(e.originalContent);u&&a&&s(o,(0,Lo.createBlock)(a.name,u.attributes,u.innerBlocks))}}),accessibleWhenDisabled:!0,disabled:r,isBusy:r,variant:"primary",children:(0,Cn.sprintf)((0,Cn.__)("Install %s"),t.title)})}var Ct=g(X(),1),Ng=e=>t=>{let{originalName:o}=t.attributes,{block:r,hasPermission:n}=(0,ur.useSelect)(s=>{let{getDownloadableBlocks:i}=s(me),a=i("block:"+o).filter(({name:u})=>o===u);return{hasPermission:s(Rf.store).canUser("read","block-directory/search"),block:a.length&&a[0]}},[o]);return!n||!r?(0,Ct.jsx)(e,{...t}):(0,Ct.jsx)(Dg,{...t,originalBlock:r})},Dg=({originalBlock:e,...t})=>{let{originalName:o,originalUndelimitedContent:r,clientId:n}=t.attributes,{replaceBlock:s}=(0,ur.useDispatch)(so.store),i=()=>{s(t.clientId,(0,wf.createBlock)("core/html",{},[],[r]))},a=!!r,u=(0,ur.useSelect)(f=>{let{canInsertBlockType:p,getBlockRootClientId:m}=f(so.store);return p("core/html",m(n))},[n]),c=(0,no.sprintf)((0,no.__)("Your site doesn\u2019t include support for the %s block. You can try installing the block or remove it entirely."),e.title||o),l=[(0,Ct.jsx)(xf,{block:e,attributes:t.attributes,clientId:t.clientId},"install")];return a&&u&&(c=(0,no.sprintf)((0,no.__)("Your site doesn\u2019t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||o),l.push((0,Ct.jsx)(bf.Button,{__next40pxDefaultSize:!0,onClick:i,variant:"tertiary",children:(0,no.__)("Keep as HTML")},"convert"))),(0,Ct.jsxs)("div",{...(0,so.useBlockProps)(),children:[(0,Ct.jsx)(so.Warning,{actions:l,children:c}),(0,Ct.jsx)(vf.RawHTML,{children:r})]})},Ef=Ng;var $t=g(X(),1);(0,Tf.registerPlugin)("block-directory",{icon:void 0,render(){return(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(Yi,{}),(0,$t.jsx)(uf,{}),(0,$t.jsx)(mf,{})]})}});(0,Sf.addFilter)("blocks.registerBlockType","block-directory/fallback",(e,t)=>(t!=="core/missing"||(e.edit=Ef(e.edit)),e));return Bf(Mg);})();
1 +(function() {
2 +var wp;(wp||={}).blockDirectory=(()=>{var sd=Object.create;var Tr=Object.defineProperty;var id=Object.getOwnPropertyDescriptor;var ad=Object.getOwnPropertyNames;var ld=Object.getPrototypeOf,cd=Object.prototype.hasOwnProperty;var ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Le=(e,t)=>{for(var o in t)Tr(e,o,{get:t[o],enumerable:!0})},Pi=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ad(t))!cd.call(e,n)&&n!==o&&Tr(e,n,{get:()=>t[n],enumerable:!(r=id(t,n))||r.enumerable});return e};var g=(e,t,o)=>(o=e!=null?sd(ld(e)):{},Pi(t||!e||!e.__esModule?Tr(o,"default",{value:e,enumerable:!0}):o,e)),ud=e=>Pi(Tr({},"__esModule",{value:!0}),e);var _i=ne((dh,Oi)=>{Oi.exports=window.wp.plugins});var Ai=ne((ph,ki)=>{ki.exports=window.wp.hooks});var _t=ne((mh,Ii)=>{Ii.exports=window.wp.blocks});var qe=ne((gh,Di)=>{Di.exports=window.wp.data});var Ue=ne((hh,Ni)=>{Ni.exports=window.wp.element});var $n=ne((yh,Li)=>{Li.exports=window.wp.editor});var io=ne((bh,Fi)=>{Fi.exports=window.wp.blockEditor});var Me=ne((vh,Vi)=>{Vi.exports=window.wp.i18n});var Sr=ne((wh,ji)=>{ji.exports=window.wp.apiFetch});var Wi=ne((Rh,Hi)=>{Hi.exports=window.wp.notices});var $i=ne((Eh,Ui)=>{Ui.exports=window.wp.url});var sa=ne((Yh,na)=>{na.exports=window.wp.compose});var Yt=ne((zh,ia)=>{ia.exports=window.wp.components});var Jn=ne((Kh,aa)=>{aa.exports=window.wp.coreData});var ua=ne((Gh,ca)=>{ca.exports=window.wp.htmlEntities});var F=ne((Xh,fa)=>{fa.exports=window.React});var X=ne((ny,ha)=>{ha.exports=window.ReactJSXRuntime});var It=ne((Jy,Wa)=>{Wa.exports=window.ReactDOM});var Gl=ne(ql=>{"use strict";var vo=F();function Wm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Um=typeof Object.is=="function"?Object.is:Wm,$m=vo.useState,Ym=vo.useEffect,zm=vo.useLayoutEffect,Km=vo.useDebugValue;function qm(e,t){var o=t(),r=$m({inst:{value:o,getSnapshot:t}}),n=r[0].inst,s=r[1];return zm(function(){n.value=o,n.getSnapshot=t,Ls(n)&&s({inst:n})},[e,o,t]),Ym(function(){return Ls(n)&&s({inst:n}),e(function(){Ls(n)&&s({inst:n})})},[e]),Km(o),o}function Ls(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!Um(e,o)}catch{return!0}}function Gm(e,t){return t()}var Xm=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Gm:qm;ql.useSyncExternalStore=vo.useSyncExternalStore!==void 0?vo.useSyncExternalStore:Xm});var rn=ne((qb,Xl)=>{"use strict";Xl.exports=Gl()});var Zl=ne(Jl=>{"use strict";var nn=F(),Jm=rn();function Zm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qm=typeof Object.is=="function"?Object.is:Zm,eg=Jm.useSyncExternalStore,tg=nn.useRef,og=nn.useEffect,rg=nn.useMemo,ng=nn.useDebugValue;Jl.useSyncExternalStoreWithSelector=function(e,t,o,r,n){var s=tg(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=rg(function(){function l(m){if(!c){if(c=!0,u=m,m=r(m),n!==void 0&&i.hasValue){var p=i.value;if(n(p,m))return d=p}return d=m}if(p=d,Qm(u,m))return p;var y=r(m);return n!==void 0&&n(p,y)?(u=m,p):(u=m,d=y)}var c=!1,u,d,f=o===void 0?null:o;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,o,r,n]);var a=eg(e,s[0],s[1]);return og(function(){i.hasValue=!0,i.value=a},[a]),ng(a),a}});var ec=ne((Xb,Ql)=>{"use strict";Ql.exports=Zl()});var Uu=ne((QT,Wu)=>{Wu.exports=window.wp.theme});var Yu=ne((eS,$u)=>{$u.exports=window.wp.privateApis});var In=ne((OS,lf)=>{lf.exports=window.wp.primitives});var df=ne((US,ff)=>{ff.exports=window.wp.a11y});var uh={};Le(uh,{store:()=>pe});var td=g(_i(),1),od=g(Ai(),1);var ea=g(_t(),1),Vo=g(qe(),1),ta=g(Ue(),1),oa=g($n(),1);var _r=g(qe(),1);var Mi=g(qe(),1),fd=(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},dd=(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter(o=>o.name!==t.item.name)};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},pd=(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":let{[t.blockId]:o,...r}=e;return r}return e},Bi=(0,Mi.combineReducers)({downloadableBlocks:fd,blockManagement:dd,errorNotices:pd});var Yn={};Le(Yn,{getDownloadableBlocks:()=>gd,getErrorNoticeForBlock:()=>vd,getErrorNotices:()=>bd,getInstalledBlockTypes:()=>Fo,getNewBlockTypes:()=>hd,getUnusedBlockTypes:()=>yd,isInstalling:()=>xd,isRequestingDownloadableBlocks:()=>md});var ao=g(qe(),1),Mo=g(io(),1),Bo=[];function md(e,t){return e.downloadableBlocks[t]?.isRequesting??!1}function gd(e,t){return e.downloadableBlocks[t]?.results??Bo}function Fo(e){return e.blockManagement.installedBlockTypes}var hd=(0,ao.createRegistrySelector)(e=>(0,ao.createSelector)(t=>{let o=Fo(t);if(!o.length)return Bo;let{getBlockName:r,getClientIdsWithDescendants:n}=e(Mo.store),s=o.map(l=>l.name),i=n().flatMap(l=>{let c=r(l);return s.includes(c)?c:[]}),a=o.filter(l=>i.includes(l.name));return a.length>0?a:Bo},t=>[Fo(t),e(Mo.store).getClientIdsWithDescendants()])),yd=(0,ao.createRegistrySelector)(e=>(0,ao.createSelector)(t=>{let o=Fo(t);if(!o.length)return Bo;let{getBlockName:r,getClientIdsWithDescendants:n}=e(Mo.store),s=o.map(l=>l.name),i=n().flatMap(l=>{let c=r(l);return s.includes(c)?c:[]}),a=o.filter(l=>!i.includes(l.name));return a.length>0?a:Bo},t=>[Fo(t),e(Mo.store).getClientIdsWithDescendants()]));function xd(e,t){return e.blockManagement.isInstalling[t]||!1}function bd(e){return e.errorNotices}function vd(e,t){return e.errorNotices[t]}var qn={};Le(qn,{addInstalledBlockType:()=>Td,clearErrorNotice:()=>Od,fetchDownloadableBlocks:()=>Kn,installBlockType:()=>Rd,receiveDownloadableBlocks:()=>Or,removeInstalledBlockType:()=>Sd,setErrorNotice:()=>Pd,setIsInstalling:()=>Cd,uninstallBlockType:()=>Ed});var Pr=g(_t(),1),xt=g(Me(),1),lo=g(Sr(),1),Cr=g(Wi(),1),Ki=g($i(),1);var Yi=g(Sr(),1),wd=e=>new Promise((t,o)=>{let r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(n=>{e[n]&&(r[n]=e[n])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=()=>t(!0),r.onerror=()=>o(new Error("Error loading asset.")),document.body.appendChild(r),(r.nodeName.toLowerCase()==="link"||r.nodeName.toLowerCase()==="script"&&!r.src)&&t()});async function zi(){let t=await(await(0,Yi.default)({url:document.location.href,parse:!1})).text(),o=new window.DOMParser().parseFromString(t,"text/html"),r=Array.from(o.querySelectorAll('link[rel="stylesheet"],script')).filter(n=>n.id&&!document.getElementById(n.id));for(let n of r)await wd(n)}function zn(e){if(!e)return!1;let t=e.links["wp:plugin"]||e.links.self;return t&&t.length?t[0].href:!1}function Kn(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function Or(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}var Rd=e=>async({registry:t,dispatch:o})=>{let{id:r,name:n}=e,s=!1;o.clearErrorNotice(r);try{o.setIsInstalling(r,!0);let i=zn(e),a={};i?await(0,lo.default)({method:"PUT",url:i,data:{status:"active"}}):a=(await(0,lo.default)({method:"POST",path:"wp/v2/plugins",data:{slug:r,status:"active"}}))._links,o.addInstalledBlockType({...e,links:{...e.links,...a}});let l=["api_version","title","category","parent","ancestor","icon","description","keywords","attributes","provides_context","uses_context","selectors","supports","styles","example","variations","allowed_blocks","block_hooks"];if(await(0,lo.default)({path:(0,Ki.addQueryArgs)(`/wp/v2/block-types/${n}`,{_fields:l})}).catch(()=>{}).then(u=>{u&&(0,Pr.unstable__bootstrapServerSideBlockDefinitions)({[n]:Object.fromEntries(Object.entries(u).filter(([d])=>l.includes(d)))})}),await zi(),!t.select(Pr.store).getBlockTypes().some(u=>u.name===n))throw new Error((0,xt.__)("Error registering block. Try reloading the page."));t.dispatch(Cr.store).createInfoNotice((0,xt.sprintf)((0,xt.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),s=!0}catch(i){let a=i.message||(0,xt.__)("An error occurred."),l=i instanceof Error,c={folder_exists:(0,xt.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,xt.__)("Error installing block. You can reload the page and try again.")};c[i.code]&&(l=!0,a=c[i.code]),o.setErrorNotice(r,a,l),t.dispatch(Cr.store).createErrorNotice(a,{speak:!0,isDismissible:!0})}return o.setIsInstalling(r,!1),s},Ed=e=>async({registry:t,dispatch:o})=>{try{let r=zn(e);await(0,lo.default)({method:"PUT",url:r,data:{status:"inactive"}}),await(0,lo.default)({method:"DELETE",url:r}),o.removeInstalledBlockType(e)}catch(r){t.dispatch(Cr.store).createErrorNotice(r.message||(0,xt.__)("An error occurred."))}};function Td(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function Sd(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function Cd(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function Pd(e,t,o=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:o}}function Od(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var Xn={};Le(Xn,{getDownloadableBlocks:()=>Id});var co=function(){return co=Object.assign||function(t){for(var o,r=1,n=arguments.length;r<n;r++){o=arguments[r];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t},co.apply(this,arguments)};function qi(e){return e.toLowerCase()}var _d=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],kd=/[^A-Z0-9]+/gi;function Xi(e,t){t===void 0&&(t={});for(var o=t.splitRegexp,r=o===void 0?_d:o,n=t.stripRegexp,s=n===void 0?kd:n,i=t.transform,a=i===void 0?qi:i,l=t.delimiter,c=l===void 0?" ":l,u=Gi(Gi(e,r,"$1\0$2"),s,"\0"),d=0,f=u.length;u.charAt(d)==="\0";)d++;for(;u.charAt(f-1)==="\0";)f--;return u.slice(d,f).split("\0").map(a).join(c)}function Gi(e,t,o){return t instanceof RegExp?e.replace(t,o):t.reduce(function(r,n){return r.replace(n,o)},e)}function Gn(e,t){var o=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&o>="0"&&o<="9"?"_"+o+r:""+o.toUpperCase()+r}function Ji(e,t){return t===void 0&&(t={}),Xi(e,co({delimiter:"",transform:Gn},t))}function Ad(e,t){return t===0?e.toLowerCase():Gn(e,t)}function Zi(e,t){return t===void 0&&(t={}),Ji(e,co({transform:Ad},t))}var Qi=g(Sr(),1);var Id=e=>async({dispatch:t})=>{if(e)try{t(Kn(e));let r=(await(0,Qi.default)({path:`wp/v2/block-directory/search?term=${e}`})).map(n=>Object.fromEntries(Object.entries(n).map(([s,i])=>[Zi(s),i])));t(Or(r,e))}catch{t(Or([],e))}};var Dd="core/block-directory",Nd={reducer:Bi,selectors:Yn,actions:qn,resolvers:Xn},pe=(0,_r.createReduxStore)(Dd,Nd);(0,_r.register)(pe);function ra(){let{uninstallBlockType:e}=(0,Vo.useDispatch)(pe),t=(0,Vo.useSelect)(r=>{let{isAutosavingPost:n,isSavingPost:s}=r(oa.store);return s()&&!n()},[]),o=(0,Vo.useSelect)(r=>r(pe).getUnusedBlockTypes(),[]);return(0,ta.useEffect)(()=>{t&&o.length&&o.forEach(r=>{e(r),(0,ea.unregisterBlockType)(r.name)})},[t]),null}var Ff=g(io(),1),Vf=g(sa(),1),jf=g(Ue(),1);var If=g(Me(),1),Df=g(Yt(),1),Nf=g(Jn(),1),Lf=g(qe(),1),Mf=g(_t(),1);var Ef=g(Me(),1),Tf=g(Yt(),1),Sf=g(_t(),1),Cf=g(qe(),1);function la(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=la(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Ld(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=la(e))&&(r&&(r+=" "),r+=t);return r}var uo=Ld;var xe=g(Me(),1),Fn=g(Yt(),1),bf=g(Ue(),1),Vt=g(ua(),1),vf=g(_t(),1),wf=g(qe(),1);var Md=g(F(),1),jo={...Md};var pa=g(F(),1),da={};function be(e,t){let o=pa.useRef(da);return o.current===da&&(o.current=e(t)),o}var Zn=jo.useInsertionEffect,Bd=Zn&&Zn!==jo.useLayoutEffect?Zn:e=>e();function H(e){let t=be(Fd).current;return t.next=e,Bd(t.effect),t.trampoline}function Fd(){let e={next:void 0,callback:Vd,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Vd(){}function $e(){}var ma=Object.freeze([]),ae=Object.freeze({});var ga=g(F(),1),jd=()=>{},V=typeof document<"u"?ga.useLayoutEffect:jd;function Hd(e,t){return function(r,...n){let s=new URL(e);return s.searchParams.set("code",r.toString()),n.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}var Wd=Hd("https://base-ui.com/production-error","Base UI"),Ge=Wd;var kt=g(F(),1);function Qn(e,t,o,r){let n=be(xa).current;return Ud(n,e,t,o,r)&&ba(n,[e,t,o,r]),n.callback}function ya(e){let t=be(xa).current;return $d(t,e)&&ba(t,e),t.callback}function xa(){return{callback:null,cleanup:null,refs:[]}}function Ud(e,t,o,r,n){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==r||e.refs[3]!==n}function $d(e,t){return e.refs.length!==t.length||e.refs.some((o,r)=>o!==t[r])}function ba(e,t){if(e.refs=t,t.every(o=>o==null)){e.callback=null;return}e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),o!=null){let r=Array(t.length).fill(null);for(let n=0;n<t.length;n+=1){let s=t[n];if(s!=null)switch(typeof s){case"function":{let i=s(o);typeof i=="function"&&(r[n]=i);break}case"object":{s.current=o;break}default:}}e.cleanup=()=>{for(let n=0;n<t.length;n+=1){let s=t[n];if(s!=null)switch(typeof s){case"function":{let i=r[n];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}default:}}}}}}var wa=g(F(),1);var va=g(F(),1),Yd=parseInt(va.version,10);function fo(e){return Yd>=e}function es(e){if(!wa.isValidElement(e))return null;let t=e,o=t.props;return(fo(19)?o?.ref:t.ref)??null}function Ho(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Ra(e,t){let o={};for(let r in e){let n=e[r];if(t?.hasOwnProperty(r)){let s=t[r](n);s!=null&&Object.assign(o,s);continue}n===!0?o[`data-${r.toLowerCase()}`]="":n&&(o[`data-${r.toLowerCase()}`]=n.toString())}return o}function Ea(e,t){return typeof e=="function"?e(t):e}function Ta(e,t){return typeof e=="function"?e(t):e}var ts={};function zt(e,t,o,r,n){if(!o&&!r&&!n&&!e)return kr(t);let s=kr(e);return t&&(s=Wo(s,t)),o&&(s=Wo(s,o)),r&&(s=Wo(s,r)),n&&(s=Wo(s,n)),s}function Sa(e){if(e.length===0)return ts;if(e.length===1)return kr(e[0]);let t=kr(e[0]);for(let o=1;o<e.length;o+=1)t=Wo(t,e[o]);return t}function kr(e){return os(e)?{...Pa(e,ts)}:zd(e)}function Wo(e,t){return os(t)?Pa(t,e):Kd(e,t)}function zd(e){let t={...e};for(let o in t){let r=t[o];Ca(o,r)&&(t[o]=Oa(r))}return t}function Kd(e,t){if(!t)return e;for(let o in t){let r=t[o];switch(o){case"style":{e[o]=Ho(e.style,r);break}case"className":{e[o]=rs(e.className,r);break}default:Ca(o,r)?e[o]=qd(e[o],r):e[o]=r}}return e}function Ca(e,t){let o=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2);return o===111&&r===110&&n>=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function os(e){return typeof e=="function"}function Pa(e,t){return os(e)?e(t):e??ts}function qd(e,t){return t?e?(...o)=>{let r=o[0];if(ka(r)){let s=r;_a(s);let i=t(...o);return s.baseUIHandlerPrevented||e?.(...o),i}let n=t(...o);return e?.(...o),n}:Oa(t):e}function Oa(e){return e&&((...t)=>{let o=t[0];return ka(o)&&_a(o),e(...t)})}function _a(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function rs(e,t){return t?e?t+" "+e:t:e}function ka(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var ns=g(F(),1);function Be(e,t,o={}){let r=t.render;o.enabled!==!1&&(r=Zd(r));let n=Gd(t,o,r);if(o.enabled===!1)return null;let s=o.state??ae;return Qd(e,r,n,s)}function Gd(e,t,o){let{className:r,style:n}=e,{state:s=ae,ref:i,props:a,stateAttributesMapping:l,enabled:c=!0}=t,u=c?Ea(r,s):void 0,d=c?Ta(n,s):void 0,f=c?Ra(s,l):ae,m=c&&a?Xd(a):void 0,p=c?Ho(f,m)??{}:ae;return typeof document<"u"&&(c?Array.isArray(i)?p.ref=ya([p.ref,es(o),...i]):p.ref=Qn(p.ref,es(o),i):Qn(null,null)),c?(u!==void 0&&(p.className=rs(p.className,u)),d!==void 0&&(p.style=Ho(p.style,d)),p):ae}function Xd(e){return Array.isArray(e)?Sa(e):zt(void 0,e)}var Jd=Symbol.for("react.lazy");function Zd(e){if(e?.$$typeof!==Jd)return e;let t=kt.Children.toArray(e)[0];return kt.isValidElement(t)?t:e}function Qd(e,t,o,r){if(t){if(typeof t=="function")return t(o,r);let n=zt(o,t.props);return n.ref=o.ref,kt.cloneElement(t,n)}if(e&&typeof e=="string")return ep(e,o);throw new Error(Ge(8))}function ep(e,t){return e==="button"?(0,ns.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,ns.createElement)("img",{alt:"",...t,key:t.key}):kt.createElement(e,t)}var Ar=g(F(),1);var Aa=0;function tp(e,t="mui"){let[o,r]=Ar.useState(e),n=e||o;return Ar.useEffect(()=>{o==null&&(Aa+=1,r(`${t}-${Aa}`))},[o,t]),n}var Ia=jo.useId;function po(e,t){if(Ia!==void 0){let o=Ia();return e??(t?`${t}-${o}`:o)}return tp(e,t)}function Da(e){return po(e,"base-ui")}var Y={};Le(Y,{cancelOpen:()=>_p,chipRemovePress:()=>fp,clearPress:()=>up,closePress:()=>lp,closeWatcher:()=>Rp,decrementPress:()=>mp,disabled:()=>Ap,drag:()=>Cp,escapeKey:()=>wp,focusOut:()=>vp,imperativeAction:()=>Np,incrementPress:()=>pp,initial:()=>Dp,inputBlur:()=>yp,inputChange:()=>gp,inputClear:()=>hp,inputPaste:()=>xp,inputPress:()=>bp,itemPress:()=>ap,keyboard:()=>Tp,linkPress:()=>cp,listNavigation:()=>Ep,missing:()=>Ip,none:()=>op,outsidePress:()=>ip,pointer:()=>Sp,scrub:()=>Op,siblingOpen:()=>kp,swipe:()=>Lp,trackPress:()=>dp,triggerFocus:()=>sp,triggerHover:()=>np,triggerPress:()=>rp,wheel:()=>Pp,windowResize:()=>Mp});var op="none",rp="trigger-press",np="trigger-hover",sp="trigger-focus",ip="outside-press",ap="item-press",lp="close-press",cp="link-press",up="clear-press",fp="chip-remove-press",dp="track-press",pp="increment-press",mp="decrement-press",gp="input-change",hp="input-clear",yp="input-blur",xp="input-paste",bp="input-press",vp="focus-out",wp="escape-key",Rp="close-watcher",Ep="list-navigation",Tp="keyboard",Sp="pointer",Cp="drag",Pp="wheel",Op="scrub",_p="cancel-open",kp="sibling-open",Ap="disabled",Ip="missing",Dp="initial",Np="imperative-action",Lp="swipe",Mp="window-resize";function Z(e,t,o,r){let n=!1,s=!1,i=r??ae;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){s=!0},get isCanceled(){return n},get isPropagationAllowed(){return s},trigger:o,...i}}var is=g(F(),1);var Na=g(F(),1);function mo(e){Na.useEffect(e,ma)}var Ir=null,Fy=globalThis.requestAnimationFrame,ss=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;let o=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let n=0;n<o.length;n+=1)o[n]?.(t)};request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||this.callbacks[o]!==null&&(this.callbacks[o]=null,this.callbacksCount-=1)}},Dr=new ss;var lt=class e{static create(){return new e}static request(t){return Dr.request(t)}static cancel(t){return Dr.cancel(t)}currentId=Ir;request(t){this.cancel(),this.currentId=Dr.request(()=>{this.currentId=Ir,t()})}cancel=()=>{this.currentId!==Ir&&(Dr.cancel(this.currentId),this.currentId=Ir)};disposeEffect=()=>this.cancel};function go(){let e=be(lt.create).current;return mo(e.disposeEffect),e}function La(e,t=!1,o=!1,r=!1){let[n,s]=is.useState(e&&t?"idle":void 0),[i,a]=is.useState(e&&!r);return e&&!i&&(a(!0),s("starting")),!e&&i&&n!=="ending"&&!o&&s("ending"),!e&&!i&&n==="ending"&&s(void 0),V(()=>{if(!e&&i&&n!=="ending"&&o){let l=lt.request(()=>{s("ending")});return()=>{lt.cancel(l)}}},[e,i,n,o]),V(()=>{if(!e||t)return;let l=lt.request(()=>{s(void 0)});return()=>{lt.cancel(l)}},[t,e]),V(()=>{if(!e||!t)return;e&&i&&n!=="idle"&&s("starting");let l=lt.request(()=>{s("idle")});return()=>{lt.cancel(l)}},[t,e,i,n]),{mounted:i,setMounted:a,transitionStatus:n}}var Nr="data-starting-style",Ma="data-ending-style";var Bp={[Nr]:""},Fp={[Ma]:""},Fa={transitionStatus(e){return e==="starting"?Bp:e==="ending"?Fp:null}};function Lr(){return typeof window<"u"}function qt(e){return Mr(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ut(e){var t;return(t=(Mr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mr(e){return Lr()?e instanceof Node||e instanceof le(e).Node:!1}function W(e){return Lr()?e instanceof Element||e instanceof le(e).Element:!1}function ve(e){return Lr()?e instanceof HTMLElement||e instanceof le(e).HTMLElement:!1}function ho(e){return!Lr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}function Uo(e){let{overflow:t,overflowX:o,overflowY:r,display:n}=Oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+o)&&n!=="inline"&&n!=="contents"}function Va(e){return/^(table|td|th)$/.test(qt(e))}function $o(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var Vp=/transform|translate|scale|rotate|perspective|filter/,jp=/paint|layout|strict|content/,Kt=e=>!!e&&e!=="none",as;function Br(e){let t=W(e)?Oe(e):e;return Kt(t.transform)||Kt(t.translate)||Kt(t.scale)||Kt(t.rotate)||Kt(t.perspective)||!Fr()&&(Kt(t.backdropFilter)||Kt(t.filter))||Vp.test(t.willChange||"")||jp.test(t.contain||"")}function ja(e){let t=ct(e);for(;ve(t)&&!ft(t);){if(Br(t))return t;if($o(t))return null;t=ct(t)}return null}function Fr(){return as==null&&(as=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),as}function ft(e){return/^(html|body|#document)$/.test(qt(e))}function Oe(e){return le(e).getComputedStyle(e)}function Yo(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ct(e){if(qt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||ho(e)&&e.host||ut(e);return ho(t)?t.host:t}function Ha(e){let t=ct(e);return ft(t)?(e.ownerDocument||e).body:ve(t)&&Uo(t)?t:Ha(t)}function At(e,t,o){var r;t===void 0&&(t=[]),o===void 0&&(o=!0);let n=Ha(e),s=n===((r=e.ownerDocument)==null?void 0:r.body),i=le(n);if(s){let a=Vr(i);return t.concat(i,i.visualViewport||[],Uo(n)?n:[],a&&o?At(a):[])}else return t.concat(n,At(n,[],o))}function Vr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function we(e){return e?.ownerDocument||document}function Q(e,t,o,r){return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}function Fe(e){let t=be(Hp,e).current;return t.next=e,V(t.effect),t}function Hp(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var $a=g(F(),1);var ls=g(It(),1);function Ua(e){return e==null?e:"current"in e?e.current:e}var jr=null;function Wp(e){if(!jr){let t=[];jr=t,queueMicrotask(()=>{jr=null,ls.flushSync(()=>{for(let o of t)o()})})}jr.push(e)}function yo(e,t=!1,o=!1){let r=go();return H((n,s=null)=>{r.cancel();let i=Ua(e);if(i==null)return;let a=i,l=()=>{if(!o){ls.flushSync(n);return}Wp(()=>{s?.aborted||n()})};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function c(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{s?.aborted||l()},()=>{if(s?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){c();return}l()})}if(t){let u=Nr;if(!a.hasAttribute(u)){r.request(c);return}let d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),c())});d.observe(a,{attributes:!0,attributeFilter:[u]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(c)})}function Hr(e){let{enabled:t=!0,open:o,ref:r,batch:n=!1,onComplete:s}=e,i=H(s),a=yo(r,o,n);$a.useEffect(()=>{if(!t)return;let l=new AbortController;return a(i,l.signal),()=>{l.abort()}},[t,o,i,a])}var Qe={};Le(Qe,{engine:()=>ps,env:()=>gs,mediaQuery:()=>hs,os:()=>fs,screenReader:()=>ms});var fs={};Le(fs,{android:()=>Ka,apple:()=>us,ios:()=>cs,linux:()=>Kp,mac:()=>qa,windows:()=>zp});function Up(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$p,platform:Yp,maxTouchPoints:Ya}=Up(),Gt=$p.toLowerCase(),Xt=Yp.toLowerCase();var cs=/^i(os$|p)/.test(Xt)||Xt==="macintel"&&Ya>1,za="android",Ka=Xt===za||Gt.includes(za),qa=!cs&&Xt.startsWith("mac"),zp=Xt.startsWith("win"),Kp=!Ka&&/^(linux|chrome os)/.test(Xt),us=qa||cs;var ps={};Le(ps,{blink:()=>Gp,gecko:()=>qp,webkit:()=>ds});var ds=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),qp=!ds&&Gt.includes("firefox"),Gp=!ds&&Gt.includes("chrom");var ms={};Le(ms,{voiceOver:()=>Xp});var Xp=us;var gs={};Le(gs,{jsdom:()=>Jp});var Jp=/jsdom|happydom/.test(Gt);var hs={};Le(hs,{iOS:()=>Zp});var Zp="@supports (-webkit-touch-callout: none)";var zo=0,Ye=class e{static create(){return new e}currentId=zo;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zo,o()},t)}isStarted(){return this.currentId!==zo}clear=()=>{this.currentId!==zo&&(clearTimeout(this.currentId),this.currentId=zo)};disposeEffect=()=>this.clear};function et(){let e=be(Ye.create).current;return mo(e.disposeEffect),e}var ke=g(F(),1);function Ga(e){return"nativeEvent"in e}function Xa(e){return e.pointerType===""&&e.isTrusted?!0:Qe.os.android&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bt(e,t){let o=["mouse","pen"];return t||o.push("",void 0),o.includes(e)}function Ja(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Wr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ee(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&ho(o)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _e(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}var ys="data-base-ui-focusable";var xs="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";var Za="data-open",Qa="data-closed";var el="data-anchor-hidden";var $r={};Le($r,{popupOpen:()=>Ur,pressed:()=>bs});var Ur="data-popup-open",bs="data-pressed";var em={[Ur]:""},wx={[Ur]:"",[bs]:""},tm={[Za]:""},om={[Qa]:""},rm={[el]:""},tl={open(e){return e?em:null}};var Ko={open(e){return e?tm:om},anchorHidden(e){return e?rm:null}},ol={...Ko,...Fa};var Tx=$r.popupOpen,qo="data-trigger-disabled";function Dt(e,t){if(!W(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute(qo);for(let[,r]of t.entries())if(ee(r,o))return!r.hasAttribute(qo);return!1}function Yr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}function nl(e){return e.matches("html,body")}function sl(e){return ve(e)&&e.matches(xs)}function vs(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${xs}`)!=null}function il(e){if(!e||Qe.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function nm(e,t){return t!=null&&!bt(t)?0:typeof e=="function"?e():e}function tt(e,t,o){let r=nm(e,o);return typeof r=="number"?r:r?.[t]}function ws(e){return typeof e=="function"?e():e}function zr(e,t){return t||e==="click"||e==="mousedown"}function al(e){return e?.includes("mouse")&&e!=="mousedown"}var ll=g(X(),1),cl=ke.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ye,currentIdRef:{current:null},currentContextRef:{current:null}});function sm(e,t){e.current=t.current}function Rs(e){let{children:t,delay:o,timeoutMs:r=0}=e,n=ke.useRef(o),s=ke.useRef(o),i=ke.useRef(null),a=ke.useRef(null),l=et();return V(()=>{if(s.current=o,!i.current){n.current=o;return}n.current={open:tt(n.current,"open"),close:tt(o,"close")}},[o,i,n,s]),(0,ll.jsx)(cl.Provider,{value:ke.useMemo(()=>({hasProvider:!0,delayRef:n,initialDelayRef:s,currentIdRef:i,timeoutMs:r,currentContextRef:a,timeout:l}),[r,l]),children:t})}function Es(e,t={open:!1}){let{open:o}=t,r="rootStore"in e?e.rootStore:e,n=r.useState("floatingId"),s=ke.useContext(cl),{currentIdRef:i,delayRef:a,timeoutMs:l,initialDelayRef:c,currentContextRef:u,hasProvider:d,timeout:f}=s,[m,p]=ke.useState(!1),y=ke.useRef(o);return V(()=>{y.current=o},[o]),V(()=>{function h(){u.current?.setIsInstantPhase(!1),i.current=null,u.current=null,a.current=c.current,f.clear()}if(i.current&&!o&&i.current===n){if(p(!1),l){let b=n;return f.start(l,()=>{r.select("open")||i.current&&i.current!==b||h()}),()=>{(y.current||i.current!==b)&&f.clear()}}h()}},[o,n,i,a,l,c,u,f,r]),V(()=>{if(!o)return;let h=u.current,b=i.current;f.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:p},i.current=n,a.current={open:0,close:tt(c.current,"close")},b!==null&&b!==n?(p(!0),h?.setIsInstantPhase(!0),h?.onOpenChange(!1,Z(Y.none))):(p(!1),h?.setIsInstantPhase(!1))},[o,n,r,i,a,c,u,f]),V(()=>()=>{if(i.current===n){if(u.current=null,!y.current)return;i.current=null,sm(a,c),f.clear()}},[u,i,a,n,c,f]),ke.useMemo(()=>({activeIdRef:i,hasProvider:d,delayRef:a,isInstantPhase:m}),[i,d,a,m])}function ot(...e){return()=>{for(let t=0;t<e.length;t+=1){let o=e[t];o&&o()}}}var Nt=Math.min,rt=Math.max,Lt=Math.round,Xo=Math.floor,dt=e=>({x:e,y:e}),im={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(e,t,o){return rt(e,Nt(t,o))}function pt(e,t){return typeof e=="function"?e(t):e}function Te(e){return e.split("-")[0]}function Xe(e){return e.split("-")[1]}function Gr(e){return e==="x"?"y":"x"}function Jo(e){return e==="y"?"height":"width"}function Ve(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Zo(e){return Gr(Ve(e))}function dl(e,t,o){o===void 0&&(o=!1);let r=Xe(e),n=Zo(e),s=Jo(n),i=n==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Go(i)),[i,Go(i)]}function pl(e){let t=Go(e);return[Kr(e),t,Kr(t)]}function Kr(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var ul=["left","right"],fl=["right","left"],am=["top","bottom"],lm=["bottom","top"];function cm(e,t,o){switch(e){case"top":case"bottom":return o?t?fl:ul:t?ul:fl;case"left":case"right":return t?am:lm;default:return[]}}function ml(e,t,o,r){let n=Xe(e),s=cm(Te(e),o==="start",r);return n&&(s=s.map(i=>i+"-"+n),t&&(s=s.concat(s.map(Kr)))),s}function Go(e){let t=Te(e);return im[t]+e.slice(t.length)}function um(e){var t,o,r,n;return{top:(t=e.top)!=null?t:0,right:(o=e.right)!=null?o:0,bottom:(r=e.bottom)!=null?r:0,left:(n=e.left)!=null?n:0}}function Xr(e){return typeof e!="number"?um(e):{top:e,right:e,bottom:e,left:e}}function Jt(e){let{x:t,y:o,width:r,height:n}=e;return{width:r,height:n,top:o,left:t,right:t+r,bottom:o+n,x:t,y:o}}function vt(e,t,o=!0){return e.filter(n=>n.parentId===t).flatMap(n=>[...!o||n.context?.open?[n]:[],...vt(e,n.id,o)])}function xo(e){return`data-base-ui-${e}`}var Ae=g(F(),1),yl=g(It(),1);var gl={style:{transition:"none"}};var fm="data-base-ui-swipe-ignore",dm="data-swipe-ignore",Ux=`[${fm}]`,$x=`[${dm}]`;var hl={fallbackAxisSide:"end"};var xl=g(X(),1),pm=Ae.createContext(null),mm=()=>Ae.useContext(pm),gm=xo("portal");function bl(e={}){let{ref:t,container:o,componentProps:r=ae,elementProps:n}=e,s=po(),a=mm()?.portalNode,[l,c]=Ae.useState(null),[u,d]=Ae.useState(null),f=H(h=>{h!==null&&d(h)}),m=Ae.useRef(null);V(()=>{if(o===null){m.current&&(m.current=null,d(null),c(null));return}let h=(o&&(Mr(o)?o:o.current))??a??document.body;if(h==null){m.current&&(m.current=null,d(null),c(null));return}m.current!==h&&(m.current=h,d(null),c(h))},[o,a]);let p=Be("div",r,{ref:[t,f],props:[{id:s,[gm]:""},n]}),y=l&&p?yl.createPortal(p,l):null;return{node:u,nodeId:Ae.isValidElement(p)?p.props.id:void 0,subtree:y}}var Zt=g(F(),1);function vl(){let e=new Map;return{emit(t,o){e.get(t)?.forEach(r=>r(o))},on(t,o){e.has(t)||e.set(t,new Set),e.get(t).add(o)},off(t,o){e.get(t)?.delete(o)}}}var hm=g(X(),1),ym=Zt.createContext(null),xm=Zt.createContext(null),Jr=()=>Zt.useContext(ym)?.id||null,Mt=e=>{let t=Zt.useContext(xm);return e??t};var je=g(F(),1);function bm(e,t){let o=null,r=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",l=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",c=s.width,u=s.height,d=s.x,f=s.y;return o==null&&t.x&&i&&(o=s.x-t.x),r==null&&t.y&&a&&(r=s.y-t.y),d-=o||0,f-=r||0,c=0,u=0,!n||l?(c=t.axis==="y"?s.width:0,u=t.axis==="x"?s.height:0,d=i&&t.x!=null?t.x:d,f=a&&t.y!=null?t.y:f):n&&!l&&(u=t.axis==="x"?s.height:u,c=t.axis==="y"?s.width:c),n=!0,{width:c,height:u,x:d,y:f,top:f,right:d+c,bottom:f+u,left:d}}}}function wl(e){return e!=null&&e.clientX!=null}function Ts(e,t={}){let{enabled:o=!0,axis:r="both"}=t,n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),l=n.context.dataRef,c=je.useRef(!1),u=je.useRef(null),[d,f]=je.useState(),[m,p]=je.useState([]),y=H(w=>{n.set("positionReference",w)}),h=H((w,T,R)=>{c.current||l.current.openEvent&&!wl(l.current.openEvent)||n.set("positionReference",bm(R??a,{x:w,y:T,axis:r,dataRef:l,pointerType:d}))}),b=H(w=>{s?u.current||(h(w.clientX,w.clientY,w.currentTarget),p([])):h(w.clientX,w.clientY,w.currentTarget)}),v=bt(d)?i:s;je.useEffect(()=>{if(!o){y(a);return}if(!v)return;function w(){u.current?.(),u.current=null}let T=le(i);function R(E){let S=_e(E);ee(i,S)?w():h(E.clientX,E.clientY)}return!l.current.openEvent||wl(l.current.openEvent)?u.current=Q(T,"mousemove",R):y(a),w},[v,o,i,l,a,n,h,y,m]),je.useEffect(()=>()=>{n.set("positionReference",null)},[n]),je.useEffect(()=>{o&&!i&&(c.current=!1)},[o,i]),je.useEffect(()=>{!o&&s&&(c.current=!0)},[o,s]);let x=je.useMemo(()=>{function w(T){f(T.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:b,onMouseEnter:b}},[b]);return je.useMemo(()=>o?{reference:x,trigger:x}:{},[o,x])}var Ie=g(F(),1);function vm(){return!1}function wm(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Ss(e,t={}){let{enabled:o=!0,escapeKey:r=!0,outsidePress:n=!0,outsidePressEvent:s="sloppy",referencePress:i=vm,bubbles:a,externalTree:l}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),d=c.useState("floatingElement"),{dataRef:f,events:m}=c.context,p=Mt(l),y=H(typeof n=="function"?n:()=>!1),h=typeof n=="function"?y:n,b=h!==!1,v=H(()=>s),{escapeKey:x,outsidePress:w}=wm(a),T=Ie.useRef(!1),R=Ie.useRef(!1),E=Ie.useRef(!1),S=Ie.useRef(!1),N=Ie.useRef(!1),M=Ie.useRef(""),O=Ie.useRef(null),U=et(),$=et(),L=H(()=>{$.clear(),f.current.insideReactTree=!1}),C=H(D=>{let G=f.current.floatingContext?.nodeId;return(p?vt(p.nodesRef.current,G):[]).some(se=>se.context?.open&&!se.context.dataRef.current[D])}),I=H(D=>Yr(D,c.select("floatingElement"))||Yr(D,c.select("domReferenceElement"))),A=H(D=>{i()&&c.setOpen(!1,Z(Y.triggerPress,D.nativeEvent))}),P=H(D=>{if(!u||!o||!r||D.key!=="Escape"||N.current||!x&&C("__escapeKeyBubbles"))return;let G=Ga(D)?D.nativeEvent:D,B=Z(Y.escapeKey,G);c.setOpen(!1,B),B.isCanceled||D.preventDefault(),!x&&!B.isPropagationAllowed&&D.stopPropagation()}),_=H(()=>{f.current.insideReactTree=!0,$.start(0,L)}),q=H(D=>{if(!u||!o||D.button!==0)return;let G=_e(D.nativeEvent);ee(c.select("floatingElement"),G)&&(T.current||(T.current=!0,R.current=!1))}),oe=H(D=>{!u||!o||(D.defaultPrevented||D.nativeEvent.defaultPrevented)&&T.current&&(R.current=!0)});Ie.useEffect(()=>{function D(G){G.open||(S.current=!1)}return m.on("openchange",D),()=>{m.off("openchange",D)}},[m]),Ie.useEffect(()=>{if(!u||!o)return u||(S.current=!1),L;f.current.__escapeKeyBubbles=x,f.current.__outsidePressBubbles=w;let D=new Ye,G=new Ye,B=we(d);function se(){D.clear(),N.current=!0}function ce(){D.start(Qe.engine.webkit?5:0,()=>{N.current=!1})}function ie(){E.current=!0,G.start(0,()=>{E.current=!1})}function ue(){T.current=!1,R.current=!1}function fe(){let k=M.current,j=k==="pen"||!k?"mouse":k,Ee=v(),de=typeof Ee=="function"?Ee():Ee;return typeof de=="string"?de:de[j]}function ht(k){let j=fe();return j==="intentional"&&k.type!=="click"||j==="sloppy"&&k.type==="click"}function re(k){let j=f.current.floatingContext?.nodeId,Ee=p&&vt(p.nodesRef.current,j).some(de=>Yr(k,de.context?.elements.floating));return I(k)||Ee}function he(k){if(ht(k)){k.type!=="click"&&!I(k)&&(G.clear(),E.current=!1),L();return}if(f.current.insideReactTree){L();return}let j=_e(k),Ee=`[${xo("inert")}]`,de=W(j)?j.getRootNode():null,Tt=Array.from((ho(de)?de:we(c.select("floatingElement"))).querySelectorAll(Ee)),Do=c.context.triggerElements;if(j&&(Do.hasElement(j)||Do.hasMatchingElement(Pe=>ee(Pe,j))))return;let St=W(j)?j:null;for(;St&&!ft(St);){let Pe=ct(St);if(ft(Pe)||!W(Pe))break;St=Pe}if(!(Tt.length&&W(j)&&!nl(j)&&!ee(j,c.select("floatingElement"))&&Tt.every(Pe=>!ee(St,Pe)))){if(ve(j)&&!("touches"in k)){let Pe=ft(j),no=Oe(j),$t=/auto|scroll/,Ct=Pe||$t.test(no.overflowX),hr=Pe||$t.test(no.overflowY),yr=Ct&&j.clientWidth>0&&j.scrollWidth>j.clientWidth,xr=hr&&j.clientHeight>0&&j.scrollHeight>j.clientHeight,br=no.direction==="rtl",vr=xr&&(br?k.offsetX<=j.offsetWidth-j.clientWidth:k.offsetX>j.clientWidth),J=yr&&k.offsetY>j.clientHeight;if(vr||J)return}if(!re(k)){if(fe()==="intentional"){if(k.detail!==0&&!Xa(k)&&!S.current)return;if(E.current){G.clear(),E.current=!1;return}}typeof h=="function"&&!h(k)||C("__outsidePressBubbles")||(c.setOpen(!1,Z(Y.outsidePress,k)),L())}}}function ye(k){fe()!=="sloppy"||k.pointerType==="touch"||!c.select("open")||!o||I(k)||he(k)}function it(k){if(fe()!=="sloppy"||!c.select("open")||!o||I(k))return;let j=k.touches[0];j&&(O.current={startTime:Date.now(),startX:j.clientX,startY:j.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},U.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function Ce(k,j){let Ee=_e(k);if(!Ee)return;let de=Q(Ee,k.type,()=>{j(k),de()})}function ro(k){M.current="touch",Ce(k,it)}function yt(k){U.clear(),k.type==="pointerdown"&&(k.button===0&&(S.current=!0),M.current=k.pointerType),!(k.type==="mousedown"&&O.current&&!O.current.dismissOnMouseDown)&&Ce(k,j=>{j.type==="pointerdown"?ye(j):he(j)})}function at(k){if(k.type==="pointercancel"&&(S.current=!1),!T.current)return;let j=R.current;if(ue(),fe()==="intentional"){if(k.type==="pointercancel"){j&&ie();return}if(!re(k)){if(j){ie();return}typeof h=="function"&&!h(k)||(G.clear(),E.current=!0,L())}}}function Rt(k){if(fe()!=="sloppy"||!O.current||I(k))return;let j=k.touches[0];if(!j)return;let Ee=Math.abs(j.clientX-O.current.startX),de=Math.abs(j.clientY-O.current.startY),Tt=Math.sqrt(Ee*Ee+de*de);Tt>5&&(O.current.dismissOnTouchEnd=!0),Tt>10&&(he(k),U.clear(),O.current=null)}function Ut(k){Ce(k,Rt)}function mr(k){fe()!=="sloppy"||!O.current||I(k)||(O.current.dismissOnTouchEnd&&he(k),U.clear(),O.current=null)}function gr(k){Ce(k,mr)}let Et=ot(r&&ot(Q(B,"keydown",P),Q(B,"compositionstart",se),Q(B,"compositionend",ce)),b&&ot(Q(B,"click",yt,!0),Q(B,"pointerdown",yt,!0),Q(B,"pointerup",at,!0),Q(B,"pointercancel",at,!0),Q(B,"mousedown",yt,!0),Q(B,"mouseup",at,!0),Q(B,"touchstart",ro,{capture:!0,passive:!0}),Q(B,"touchmove",Ut,{capture:!0,passive:!0}),Q(B,"touchend",gr,{capture:!0,passive:!0})));return()=>{Et(),D.clear(),G.clear(),ue(),E.current=!1,L()}},[f,d,r,b,h,u,o,x,w,P,L,v,C,I,p,c,U]);let z=Ie.useMemo(()=>({onKeyDown:P,onPointerDown:A,onClick:A}),[P,A]),K=Ie.useMemo(()=>({onKeyDown:P,onPointerDown:oe,onMouseDown:oe,onClickCapture:_,onMouseDownCapture(D){_(),q(D)},onPointerDownCapture(D){_(),q(D)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[P,_,q,oe]);return Ie.useMemo(()=>o?{reference:z,floating:K,trigger:z}:{},[o,z,K])}var Se=g(F(),1);function Rl(e,t,o){let{reference:r,floating:n}=e,s=Ve(t),i=Zo(t),a=Jo(i),l=Te(t),c=s==="y",u=r.x+r.width/2-n.width/2,d=r.y+r.height/2-n.height/2,f=r[a]/2-n[a]/2,m;switch(l){case"top":m={x:u,y:r.y-n.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-n.width,y:d};break;default:m={x:r.x,y:r.y}}let p=Xe(t);return p&&(m[i]+=f*(p==="end"?1:-1)*(o&&c?-1:1)),m}async function El(e,t){var o;t===void 0&&(t={});let{x:r,y:n,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=pt(t,e),p=Xr(m),h=a[f?d==="floating"?"reference":"floating":d],b=Jt(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(h)))==null||o?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=d==="floating"?{x:r,y:n,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},T=Jt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:x,strategy:l}):v);return{top:(b.top-T.top+p.top)/w.y,bottom:(T.bottom-b.bottom+p.bottom)/w.y,left:(b.left-T.left+p.left)/w.x,right:(T.right-b.right+p.right)/w.x}}var Rm=50,Tl=async(e,t,o)=>{let{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:i}=o,a=i.detectOverflow?i:{...i,detectOverflow:El},l=await(i.isRTL==null?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=Rl(c,r,l),f=r,m=0,p={};for(let y=0;y<s.length;y++){let h=s[y];if(!h)continue;let{name:b,fn:v}=h,{x,y:w,data:T,reset:R}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:n,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=x??u,d=w??d,p[b]={...p[b],...T},R&&m<Rm&&(m++,typeof R=="object"&&(R.placement&&(f=R.placement),R.rects&&(c=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:n}):R.rects),{x:u,y:d}=Rl(c,f,l)),y=-1)}return{x:u,y:d,placement:f,strategy:n,middlewareData:p}};var Sl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,r;let{placement:n,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:y=!0,...h}=pt(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};let b=Te(n),v=Ve(a),x=Te(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=f||(x||!y?[Go(a)]:pl(a)),R=p!=="none";!f&&R&&T.push(...ml(a,y,p,w));let E=[a,...T],S=await l.detectOverflow(t,h),N=[],M=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&N.push(S[b]),d){let L=dl(n,i,w);N.push(S[L[0]],S[L[1]])}if(M=[...M,{placement:n,overflows:N}],!N.every(L=>L<=0)){var O,U;let L=(((O=s.flip)==null?void 0:O.index)||0)+1,C=E[L];if(C&&(!(d==="alignment"?v!==Ve(C):!1)||M.every(P=>Ve(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:L,overflows:M},reset:{placement:C}};let I=(U=M.filter(A=>A.overflows[0]<=0).sort((A,P)=>A.overflows[1]-P.overflows[1])[0])==null?void 0:U.placement;if(!I)switch(m){case"bestFit":{var $;let A=($=M.filter(P=>{if(R){let _=Ve(P.placement);return _===v||_==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(_=>_>0).reduce((_,q)=>_+q,0)]).sort((P,_)=>P[1]-_[1])[0])==null?void 0:$[0];A&&(I=A);break}case"initialPlacement":I=a;break}if(n!==I)return{reset:{placement:I}}}return{}}}};var Cl=new Set(["left","top"]);async function Em(e,t){let{placement:o,platform:r,elements:n}=e,s=await(r.isRTL==null?void 0:r.isRTL(n.floating)),i=Te(o),a=Xe(o),l=Ve(o)==="y",c=Cl.has(i)?-1:1,u=s&&l?-1:1,d=pt(t,e),{mainAxis:f,crossAxis:m,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}var Pl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,r;let{x:n,y:s,placement:i,middlewareData:a}=t,l=await Em(t,e);return i===((o=a.offset)==null?void 0:o.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:n+l.x,y:s+l.y,data:{...l,placement:i}}}}},Ol=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:r,placement:n,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=pt(e,t),u={x:o,y:r},d=await s.detectOverflow(t,c),f=Ve(n),m=Gr(f),p=u[m],y=u[f],h=(v,x)=>qr(x+d[v==="y"?"top":"left"],x,x-d[v==="y"?"bottom":"right"]);i&&(p=h(m,p)),a&&(y=h(f,y));let b=l.fn({...t,[m]:p,[f]:y});return{...b,data:{x:b.x-o,y:b.y-r,enabled:{[m]:i,[f]:a}}}}}},_l=function(e){return e===void 0&&(e={}),{options:e,fn(t){var o,r;let{x:n,y:s,placement:i,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=pt(e,t),f={x:n,y:s},m=Ve(i),p=Gr(m),y=f[p],h=f[m],b=pt(c,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(o=b.mainAxis)!=null?o:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(u){let T=p==="y"?"height":"width",R=a.reference[p]-a.floating[T]+v.mainAxis,E=a.reference[p]+a.reference[T]-v.mainAxis;y<R?y=R:y>E&&(y=E)}if(d){var x,w;let T=p==="y"?"width":"height",R=Cl.has(Te(i)),E=a.reference[m]-a.floating[T]+(R&&((x=l.offset)==null?void 0:x[m])||0)+(R?0:v.crossAxis),S=a.reference[m]+a.reference[T]+(R?0:((w=l.offset)==null?void 0:w[m])||0)-(R?v.crossAxis:0);h<E?h=E:h>S&&(h=S)}return{[p]:y,[m]:h}}}},kl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:o,rects:r,platform:n,elements:s}=t,{apply:i=()=>{},...a}=pt(e,t),l=await n.detectOverflow(t,a),c=Te(o),u=Xe(o),d=Ve(o)==="y",{width:f,height:m}=r.floating,p,y;c==="top"||c==="bottom"?(p=c,y=u===(await(n.isRTL==null?void 0:n.isRTL(s.floating))?"start":"end")?"left":"right"):(y=c,p=u==="end"?"top":"bottom");let h=m-l.top-l.bottom,b=f-l.left-l.right,v=Nt(m-l[p],h),x=Nt(f-l[y],b),w=t.middlewareData.shift,T=!w,R=v,E=x;w!=null&&w.enabled.x&&(E=b),w!=null&&w.enabled.y&&(R=h),T&&!u&&(d?E=f-2*rt(l.left,l.right):R=m-2*rt(l.top,l.bottom)),await i({...t,availableWidth:E,availableHeight:R});let S=await n.getDimensions(s.floating);return f!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}};function Dl(e){let t=Oe(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=ve(e),s=n?e.offsetWidth:o,i=n?e.offsetHeight:r,a=Lt(o)!==s||Lt(r)!==i;return a&&(o=s,r=i),{width:o,height:r,$:a}}function Ps(e){return W(e)?e:e.contextElement}function bo(e){let t=Ps(e);if(!ve(t))return dt(1);let o=t.getBoundingClientRect(),{width:r,height:n,$:s}=Dl(t),i=(s?Lt(o.width):o.width)/r,a=(s?Lt(o.height):o.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}var Tm=dt(0);function Nl(e){let t=le(e);return!Fr()||!t.visualViewport?Tm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sm(e,t,o){return t===void 0&&(t=!1),!!o&&t&&o===le(e)}function Qt(e,t,o,r){t===void 0&&(t=!1),o===void 0&&(o=!1);let n=e.getBoundingClientRect(),s=Ps(e),i=dt(1);t&&(r?W(r)&&(i=bo(r)):i=bo(e));let a=Sm(s,o,r)?Nl(s):dt(0),l=(n.left+a.x)/i.x,c=(n.top+a.y)/i.y,u=n.width/i.x,d=n.height/i.y;if(s&&r){let f=le(s),m=W(r)?le(r):r,p=f,y=Vr(p);for(;y&&m!==p;){let h=bo(y),b=y.getBoundingClientRect(),v=Oe(y),x=b.left+(y.clientLeft+parseFloat(v.paddingLeft))*h.x,w=b.top+(y.clientTop+parseFloat(v.paddingTop))*h.y;l*=h.x,c*=h.y,u*=h.x,d*=h.y,l+=x,c+=w,p=le(y),y=Vr(p)}}return Jt({width:u,height:d,x:l,y:c})}function Zr(e,t){let o=Yo(e).scrollLeft;return t?t.left+o:Qt(ut(e)).left+o}function Ll(e,t){let o=e.getBoundingClientRect(),r=o.left+t.scrollLeft-Zr(e,o),n=o.top+t.scrollTop;return{x:r,y:n}}function Cm(e){let{elements:t,rect:o,offsetParent:r,strategy:n}=e,s=n==="fixed",i=ut(r),a=t?$o(t.floating):!1;if(r===i||a&&s)return o;let l={scrollLeft:0,scrollTop:0},c=dt(1),u=dt(0),d=ve(r);if((d||!s)&&((qt(r)!=="body"||Uo(i))&&(l=Yo(r)),d)){let m=Qt(r);c=bo(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}let f=i&&!d&&!s?Ll(i,l):dt(0);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:o.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Pm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Om(e){let t=Yo(e),o=e.ownerDocument.body,r=rt(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=rt(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-t.scrollLeft+Zr(e),i=-t.scrollTop;return Oe(o).direction==="rtl"&&(s+=rt(e.clientWidth,o.clientWidth)-r),{width:r,height:n,x:s,y:i}}var _m=25;function km(e,t,o){o===void 0&&(o="viewport");let r=o==="layoutViewport",n=le(e),s=ut(e),i=n.visualViewport,a=s.clientWidth,l=s.clientHeight,c=0,u=0;if(i){let f=!Fr()||t==="fixed";r?f||(c=-i.offsetLeft,u=-i.offsetTop):(a=i.width,l=i.height,f&&(c=i.offsetLeft,u=i.offsetTop))}if(Zr(s)<=0){let f=s.ownerDocument,m=f.body,p=getComputedStyle(m),y=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(s.clientWidth-m.clientWidth-y),b=getComputedStyle(s).scrollbarGutter==="stable both-edges"?h/2:h;b<=_m&&(a-=b)}return{width:a,height:l,x:c,y:u}}function Am(e,t){let o=Qt(e,!0,t==="fixed"),r=o.top+e.clientTop,n=o.left+e.clientLeft,s=bo(e),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=n*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Al(e,t,o){let r;if(t==="viewport"||t==="layoutViewport")r=km(e,o,t);else if(t==="document")r=Om(ut(e));else if(W(t))r=Am(t,o);else{let n=Nl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jt(r)}function Im(e,t){let o=t.get(e);if(o)return o;let r=At(e,[],!1).filter(a=>W(a)&&qt(a)!=="body"),n=null,s=Oe(e).position==="fixed",i=s?ct(e):e;for(;W(i)&&!ft(i);){let a=Oe(i),l=Br(i),c=n?n.position:s?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?r=r.filter(d=>d!==i):n=a,i=ct(i)}return t.set(e,r),r}function Dm(e){let{element:t,boundary:o,rootBoundary:r,strategy:n}=e,i=[...o==="clippingAncestors"?$o(t)?[]:Im(t,this._c):[].concat(o),r],a=Al(t,i[0],n),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){let m=Al(t,i[f],n);l=rt(m.top,l),c=Nt(m.right,c),u=Nt(m.bottom,u),d=rt(m.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function Nm(e){let{width:t,height:o}=Dl(e);return{width:t,height:o}}function Lm(e,t,o){let r=ve(t),n=ut(t),s=o==="fixed",i=Qt(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=dt(0);if((r||!s)&&((qt(t)!=="body"||Uo(n))&&(a=Yo(t)),r)){let f=Qt(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}!r&&n&&(l.x=Zr(n));let c=n&&!r&&!s?Ll(n,a):dt(0),u=i.left+a.scrollLeft-l.x-c.x,d=i.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:i.width,height:i.height}}function Cs(e){return Oe(e).position==="static"}function Il(e,t){if(!ve(e)||Oe(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return ut(e)===o&&(o=o.ownerDocument.body),o}function Ml(e,t){let o=le(e);if($o(e))return o;if(!ve(e)){let n=ct(e);for(;n&&!ft(n);){if(W(n)&&!Cs(n))return n;n=ct(n)}return o}let r=Il(e,t);for(;r&&Va(r)&&Cs(r);)r=Il(r,t);return r&&ft(r)&&Cs(r)&&!Br(r)?o:r||ja(e)||o}var Mm=async function(e){let t=this.getOffsetParent||Ml,o=this.getDimensions,r=await o(e.floating);return{reference:Lm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bm(e){return Oe(e).direction==="rtl"}var Os={convertOffsetParentRelativeRectToViewportRelativeRect:Cm,getDocumentElement:ut,getClippingRect:Dm,getOffsetParent:Ml,getElementRects:Mm,getClientRects:Pm,getDimensions:Nm,getScale:bo,isElement:W,isRTL:Bm};function Bl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Fm(e,t,o){let r=null,n,s=ut(e);function i(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function a(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();let f=e.getBoundingClientRect(),{left:m,top:p,width:y,height:h}=f;if(u||t(),!y||!h)return;let b=Xo(p),v=Xo(s.clientWidth-(m+y)),x=Xo(s.clientHeight-(p+h)),w=Xo(m),R={rootMargin:-b+"px "+-v+"px "+-x+"px "+-w+"px",threshold:rt(0,Nt(1,d))||1},E=!0;function S(N){let M=N[0].intersectionRatio;if(!Bl(f,e.getBoundingClientRect()))return a();if(M!==d){if(!E)return a();M?a(!1,M):n=setTimeout(()=>{a(!1,1e-7)},1e3)}E=!1}try{r=new IntersectionObserver(S,{...R,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,R)}r.observe(e)}let l=le(e),c=()=>a(o);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),i()}}function Qo(e,t,o,r){r===void 0&&(r={});let{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ps(e),u=n||s?[...c?At(c):[],...t?At(t):[]]:[];u.forEach(b=>{n&&b.addEventListener("scroll",o),s&&b.addEventListener("resize",o)});let d=c&&a?Fm(c,o,s):null,f=-1,m=null;i&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),o()}),c&&!l&&m.observe(c),t&&m.observe(t));let p,y=l?Qt(e):null;l&&h();function h(){let b=Qt(e);y&&!Bl(y,b)&&o(),y=b,p=requestAnimationFrame(h)}return o(),()=>{var b;u.forEach(v=>{n&&v.removeEventListener("scroll",o),s&&v.removeEventListener("resize",o)}),d?.(),(b=m)==null||b.disconnect(),m=null,l&&cancelAnimationFrame(p)}}var Fl=Pl;var Vl=Ol,jl=Sl,Hl=kl;var Wl=_l,Qr=(e,t,o)=>{let r=new Map,n=o??{},s={...Os,...n.platform,_c:r};return Tl(e,t,{...n,platform:s})};var me=g(F(),1),$l=g(F(),1),Yl=g(It(),1),jm=typeof document<"u",Hm=function(){},en=jm?$l.useLayoutEffect:Hm;function tn(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 o,r,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(r=o;r--!==0;)if(!tn(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),o=n.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=o;r--!==0;){let s=n[r];if(!(s==="_owner"&&e.$$typeof)&&!tn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ul(e,t){let o=zl(e);return Math.round(t*o)/o}function _s(e){let t=me.useRef(e);return en(()=>{t.current=e}),t}function Kl(e){e===void 0&&(e={});let{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:n,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=me.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=me.useState(r);tn(f,r)||m(r);let[p,y]=me.useState(null),[h,b]=me.useState(null),v=me.useCallback(P=>{P!==R.current&&(R.current=P,y(P))},[]),x=me.useCallback(P=>{P!==E.current&&(E.current=P,b(P))},[]),w=s||p,T=i||h,R=me.useRef(null),E=me.useRef(null),S=me.useRef(u),N=l!=null,M=_s(l),O=_s(n),U=_s(c),$=me.useCallback(()=>{if(!R.current||!E.current)return;let P={placement:t,strategy:o,middleware:f};O.current&&(P.platform=O.current),Qr(R.current,E.current,P).then(_=>{let q={..._,isPositioned:U.current!==!1};L.current&&!tn(S.current,q)&&(S.current=q,Yl.flushSync(()=>{d(q)}))})},[f,t,o,O,U]);en(()=>{c===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[c]);let L=me.useRef(!1);en(()=>(L.current=!0,()=>{L.current=!1}),[]),en(()=>{if(w&&(R.current=w),T&&(E.current=T),w&&T){if(M.current)return M.current(w,T,$);$()}},[w,T,$,M,N]);let C=me.useMemo(()=>({reference:R,floating:E,setReference:v,setFloating:x}),[v,x]),I=me.useMemo(()=>({reference:w,floating:T}),[w,T]),A=me.useMemo(()=>{let P={position:o,left:0,top:0};if(!I.floating)return P;let _=Ul(I.floating,u.x),q=Ul(I.floating,u.y);return a?{...P,transform:"translate("+_+"px, "+q+"px)",...zl(I.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:_,top:q}},[o,a,I.floating,u.x,u.y]);return me.useMemo(()=>({...u,update:$,refs:C,elements:I,floatingStyles:A}),[u,$,C,I,A])}var ks=(e,t)=>{let o=Fl(e);return{name:o.name,fn:o.fn,options:[e,t]}},As=(e,t)=>{let o=Vl(e);return{name:o.name,fn:o.fn,options:[e,t]}},Is=(e,t)=>({fn:Wl(e).fn,options:[e,t]}),Ds=(e,t)=>{let o=jl(e);return{name:o.name,fn:o.fn,options:[e,t]}},Ns=(e,t)=>{let o=Hl(e);return{name:o.name,fn:o.fn,options:[e,t]}};var on=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(t,o,r=!0){this.fallbackStore=t,this.componentName=o,this.throwOnMissingTrigger=r}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(t){return this.storeListeners.add(t),()=>{this.storeListeners.delete(t)}}attachStore(t){return this.attachedStores.push(t),this.setActiveStore(t),()=>{let o=this.attachedStores.lastIndexOf(t);o!==-1&&this.attachedStores.splice(o,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(t){this.attachedStoreValue!==t&&(this.attachedStoreValue=t,this.storeListeners.forEach(o=>{o()}))}openByTrigger(t){let o=this.attachedStore;if(o===null)return;let r;if(t){for(let n=this.attachedStores.length-1;n>=0&&!r;n-=1)r=this.attachedStores[n].context.triggerElements.getById(t);r??=this.fallbackStore.context.triggerElements.getById(t)}if(t&&!r&&this.throwOnMissingTrigger)throw new Error(Ge(99,this.componentName,t,this.componentName));o.setOpen(!0,Z(Y.imperativeAction,void 0,r))}closePopup(){let t=this.attachedStore;t!==null&&t.setOpen(!1,Z(Y.imperativeAction))}};var js=g(F(),1),uc=g(It(),1);var ac=g(F(),1);var sc=g(F(),1),Vs=g(rn(),1),ic=g(ec(),1);var tc=g(F(),1);var Ms=[],Bs;function oc(){return Bs}function rc(e){Ms.push(e)}function Fs(e){let t=(o,r)=>{let n=be(sg).current,s;try{Bs=n;for(let i of Ms)i.before(n);s=e(o,r);for(let i of Ms)i.after(n);n.didInitialize=!0}finally{Bs=void 0}return s};return t.displayName=e.displayName||e.name,t}function nc(e){return tc.forwardRef(Fs(e))}function sg(){return{didInitialize:!1}}var ig=fo(19),ag=ig?cg:ug;function sn(e,t,o,r,n){return ag(e,t,o,r,n)}function lg(e,t,o,r,n){let s=sc.useCallback(()=>t(e.getSnapshot(),o,r,n),[e,t,o,r,n]);return(0,Vs.useSyncExternalStore)(e.subscribe,s,s)}rc({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let o=0;o<e.syncHooks.length;o+=1){let r=e.syncHooks[o],n=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,n)||(t=!0,r.value=n)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let o=new Set;for(let n of e.syncHooks)o.add(n.store);let r=[];for(let n of o)r.push(n.subscribe(t));return()=>{for(let n of r)n()}}),(0,Vs.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function cg(e,t,o,r,n){let s=oc();if(!s)return lg(e,t,o,r,n);let i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,o)||!Object.is(a.a2,r)||!Object.is(a.a3,n))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=o,a.a2=r,a.a3=n,a.value=t(e.getSnapshot(),o,r,n))):(a={store:e,selector:t,a1:o,a2:r,a3:n,value:t(e.getSnapshot(),o,r,n)},s.syncHooks.push(a)),a.value}function ug(e,t,o,r,n){return(0,ic.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,o,r,n))}var an=class{static create(t){return new this(t)}constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;let o=this.updateTick;for(let r of this.listeners){if(o!==this.updateTick)return;r(t)}}update(t){for(let o in t)if(!Object.is(this.state[o],t[o])){this.setState({...this.state,...t});return}}set(t,o){Object.is(this.state[t],o)||this.setState({...this.state,[t]:o})}notifyAll(){let t={...this.state};this.setState(t)}use(t,o,r,n){return sn(this,t,o,r,n)}};var eo=g(F(),1);var Bt=class extends an{constructor(t,o={},r){super(t),this.context=o,this.selectors=r}useSyncedValue(t,o){eo.useDebugValue(t);let r=this;V(()=>{r.state[t]!==o&&r.set(t,o)},[r,t,o])}useSyncedValueWithCleanup(t,o){let r=this;V(()=>(r.state[t]!==o&&r.set(t,o),()=>{r.set(t,void 0)}),[r,t,o])}useSyncedValues(t){let o=this,r=Object.values(t);V(()=>{o.update(t)},[o,...r])}useControlledProp(t,o){eo.useDebugValue(t);let r=this,n=o!==void 0;V(()=>{n&&!Object.is(r.state[t],o)&&r.setState({...r.state,[t]:o})},[r,t,o,n])}select(t,o,r,n){let s=this.selectors[t];return s(this.state,o,r,n)}useState(t,o,r,n){return eo.useDebugValue(t),sn(this,this.selectors[t],o,r,n)}useContextCallback(t,o){eo.useDebugValue(t);let r=H(o??$e);this.context[t]=r}useStateSetter(t){let o=eo.useRef(void 0);return o.current===void 0&&(o.current=r=>{this.set(t,r)}),o.current}observe(t,o){let r;typeof t=="function"?r=t:r=this.selectors[t];let n=r(this.state);return o(n,n,this),this.subscribe(s=>{let i=r(s);if(!Object.is(n,i)){let a=n;n=i,o(i,a,this)}})}};var fg={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},wo=class extends Bt{constructor(t){let{syncOnly:o,nested:r,onOpenChange:n,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:vl(),nested:r,triggerElements:s},fg),this.syncOnly=o}syncOpenEvent=(t,o)=>{(!t||!this.state.open||o!=null&&Ja(o))&&(this.context.dataRef.current.openEvent=t?o:void 0)};dispatchOpenChange=(t,o)=>{this.syncOpenEvent(t,o.event);let r={open:t,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)};setOpen=(t,o)=>{if(this.syncOnly){this.context.onOpenChange?.(t,o);return}this.dispatchOpenChange(t,o),this.context.onOpenChange?.(t,o)}};function lc(e){let{popupStore:t,treatPopupAsFloatingElement:o=!1,floatingRootContext:r,floatingId:n,nested:s,onOpenChange:i}=e,a=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,d=i,f=ac.useRef(null);r===void 0&&f.current===null&&(f.current=new wo({open:a,transitionStatus:void 0,referenceElement:l,floatingElement:c,triggerElements:u,onOpenChange:d,floatingId:n,syncOnly:!0,nested:s}));let m=r??f.current;return t.useSyncedValue("floatingId",n),V(()=>{let p={open:a,floatingId:n,referenceElement:l,floatingElement:c};W(l)&&(p.domReferenceElement=l),m.state.positionReference===m.state.referenceElement&&(p.positionReference=l),m.update(p)},[a,n,l,c,m]),m.context.onOpenChange=d,m.context.nested=s,m}var fc={tabIndex:-1,[ys]:""};function dc(e,t=!1){let o=po(),r=Jr()!=null,n=be(()=>e(o,r)).current;return lc({popupStore:n,treatPopupAsFloatingElement:t,floatingRootContext:n.state.floatingRootContext,floatingId:o,nested:r,onOpenChange:n.setOpen}),n}function pc({handle:e,store:t}){return V(()=>e.attachStore(t),[e,t]),null}function cc(e){let t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function dg(e,t){let o=js.useRef(null);return H(r=>{let n=o.current;if(n!==null){if(n.element===r&&n.store===t&&n.id===e)return;o.current=null;let s=n.store;s.context.triggerElements.getById(n.id)===n.element&&(s.context.triggerElements.delete(n.id),cc(s))}r!==null&&e!==void 0&&(o.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),cc(t))})}function pg(e,t,o,r=!1){let n=e.preventUnmountingOnClose;t?n=!1:r&&(n=!0);let s=o?.id??null,i=e.activeTriggerId,a=e.activeTriggerElement;return(s||t)&&(i=s,a=o??null),{open:t,preventUnmountingOnClose:n,activeTriggerId:i,activeTriggerElement:a}}function mg(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function mc(e,t,o,r={}){let n=o.reason,s=n===Y.triggerHover,i=t&&n===Y.triggerFocus,a=!t&&(n===Y.triggerPress||n===Y.escapeKey),l=mg(o);if(e.context.onOpenChange?.(t,o),o.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,o);let c=()=>{let u=pg(e.state,t,o.trigger,l()),d={...r.extraState,...u};i?d.instantType="focus":a?d.instantType="dismiss":s&&(d.instantType=void 0),e.update(d)};s?uc.flushSync(c):c()}function gc(e,t,o,r){let n=o.useState("isMountedByTrigger",e),s=dg(e,o),i=H(l=>{let c=o.select("open"),u=o.select("activeTriggerId");if(u===e){let d={activeTriggerElement:l,...c?r:null};o.update(d);return}if(u==null&&c){let d={activeTriggerId:e??null,activeTriggerElement:l,...r};o.update(d)}}),a=H(l=>{s(l),l&&i(l)});return V(()=>(a(t.current),()=>a(null)),[a,t,o,e]),V(()=>{if(n){let l={activeTriggerElement:t.current,...r};o.update(l)}},[n,o,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:n}}function hc(e,t={}){let{closeOnActiveTriggerUnmount:o=!1}=t,r=js.useRef(null),n=e.useState("open"),s=e.useState("triggerCount"),i=e.useState("activeTriggerId"),a=e.useState("activeTriggerElement");V(()=>{if(!n){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}let l=e.context.triggerElements.size,c={};e.state.triggerCount!==l&&(c.triggerCount=l);let u=e.select("activeTriggerId"),d=null;if(u){let f=e.context.triggerElements.getById(u);if(f)r.current=u,f!==e.state.activeTriggerElement&&(c.activeTriggerElement=f);else{for(let[m,p]of e.context.triggerElements.entries())if(p===e.state.activeTriggerElement){c.activeTriggerId=m,c.activeTriggerElement=p,r.current=m;break}c.activeTriggerId===void 0&&(r.current===u?d=u:r.current=null)}}else r.current=null;if(!d&&!u&&l===1){let f=e.context.triggerElements.entries().next();if(!f.done){let[m,p]=f.value;c.activeTriggerId=m,c.activeTriggerElement=p,r.current=m}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),d&&o&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){let f=Z(Y.none);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[n,e,s,i,a,o])}function yc(e,t,o,r){let{mounted:n,setMounted:s,transitionStatus:i}=La(e,!1,!1,r),a=t.useState("preventUnmountingOnClose"),l=e?!1:a;t.useSyncedValues({mounted:n,transitionStatus:i,preventUnmountingOnClose:l});let c=H(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),o?.(),t.context.onOpenChangeComplete?.(!1)});return Hr({enabled:n&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}function xc(e,t){e.useSyncedValues(t),V(()=>()=>{e.update({activeTriggerProps:ae,inactiveTriggerProps:ae,popupProps:ae})},[e])}var er=class{constructor(){this.idMap=new Map}add(t,o){this.idMap.set(t,o)}delete(t){this.idMap.delete(t)}hasElement(t){for(let o of this.idMap.values())if(o===t)return!0;return!1}hasMatchingElement(t){for(let o of this.idMap.values())if(t(o))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function vc(e,t,o=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new wo({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:o,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ae,inactiveTriggerProps:ae,popupProps:ae}}var tr=e=>e.triggerIdProp??e.activeTriggerId,Hs=e=>e.openProp??e.open,bc=e=>(e.popupElement?.id??e.floatingId)||void 0;function wc(e,t){return t!==void 0&&Hs(e)&&tr(e)===t}function gg(e,t){return wc(e,t)?!0:t!==void 0&&Hs(e)&&tr(e)==null&&e.triggerCount===1}var Rc={open:Hs,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:tr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:bc,isTriggerActive:(e,t)=>t!==void 0&&tr(e)===t,isOpenedByTrigger:(e,t)=>wc(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&tr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>gg(e,t)?bc(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};var Ws=g(F(),1),Ec=g(rn(),1);function Tc(e){let t=Ws.useCallback(r=>e===void 0?$e:e.subscribeStore(r),[e]),o=Ws.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Ec.useSyncExternalStore)(t,o,()=>e?.serverStore)}function Sc(e){return hg(e,e.rootContext)}function hg(e,t){let{nodeId:o,externalTree:r}=e,n=t.useState("referenceElement"),s=t.useState("floatingElement"),i=t.useState("domReferenceElement"),a=t.useState("open"),l=t.useState("floatingId"),[c,u]=Se.useState(null),[d,f]=Se.useState(void 0),[m,p]=Se.useState(void 0),y=Se.useRef(null),h=Mt(r),b=Se.useMemo(()=>({reference:n,floating:s,domReference:i}),[n,s,i]),v=Kl({...e,elements:{...b,...c&&{reference:c}}}),x=W(d)?d:null,w=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",d??null),t.useSyncedValue("domReferenceElement",d===void 0?i:x),t.useSyncedValue("floatingElement",w);let T=Se.useCallback(O=>{let U=W(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;u(U),v.refs.setReference(U)},[v.refs]),R=Se.useCallback(O=>{(W(O)||O===null)&&(y.current=O,f(O)),(W(v.refs.reference.current)||v.refs.reference.current===null||O!==null&&!W(O))&&v.refs.setReference(O)},[v.refs,f]),E=Se.useCallback(O=>{p(O),v.refs.setFloating(O)},[v.refs]),S=Se.useMemo(()=>({...v.refs,setReference:R,setFloating:E,setPositionReference:T,domReference:y}),[v.refs,R,E,T]),N=Se.useMemo(()=>({...v.elements,domReference:i}),[v.elements,i]),M=Se.useMemo(()=>({...v,dataRef:t.context.dataRef,open:a,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:S,elements:N,nodeId:o,rootStore:t}),[v,S,N,o,t,a,l]);return V(()=>{i&&(y.current=i)},[i]),V(()=>{t.context.dataRef.current.floatingContext=M;let O=h?.nodesRef.current.find(U=>U.id===o);O&&(O.context=M)}),Se.useMemo(()=>({...v,context:M,refs:S,elements:N,rootStore:t}),[v,S,N,M,t])}var mt=g(F(),1);var Us=Qe.os.mac&&Qe.engine.webkit;function $s(e,t={}){let{enabled:o=!0,delay:r}=t,n="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=n.context,a=mt.useRef(!1),l=mt.useRef(null),c=mt.useRef(!0),u=et();mt.useEffect(()=>{let f=n.select("domReferenceElement");if(!o)return;let m=le(f);function p(){let b=n.select("domReferenceElement");!n.select("open")&&ve(b)&&b===Wr(we(b))&&(a.current=!0,l.current=b)}function y(){c.current=!0}function h(){c.current=!1}return ot(Q(m,"blur",p),Us&&Q(m,"keydown",y,!0),Us&&Q(m,"pointerdown",h,!0))},[n,o]),mt.useEffect(()=>{if(!o)return;function f(m){if(m.reason===Y.triggerPress||m.reason===Y.escapeKey){let p=n.select("domReferenceElement");W(p)&&(l.current=p,a.current=!0)}}return s.on("openchange",f),()=>{s.off("openchange",f)}},[s,o,n]);let d=mt.useMemo(()=>{function f(){a.current=!1,l.current=null}return{onMouseLeave(){f()},onFocus(m){let p=m.currentTarget;if(a.current){if(l.current===p)return;f()}let y=_e(m.nativeEvent);if(W(y)){if(Us&&!m.relatedTarget){if(!c.current&&!sl(y))return}else if(!il(y))return}let h=Dt(m.relatedTarget,n.context.triggerElements),{nativeEvent:b,currentTarget:v}=m,x=typeof r=="function"?r():r;if(n.select("open")&&h||x===0||x===void 0){n.setOpen(!0,Z(Y.triggerFocus,b,v));return}u.start(x,()=>{a.current||n.setOpen(!0,Z(Y.triggerFocus,b,v))})},onBlur(m){f();let p=m.relatedTarget,y=m.nativeEvent,h=W(p)&&p.hasAttribute(xo("focus-guard"))&&p.getAttribute("data-type")==="outside";u.start(0,()=>{let b=n.select("domReferenceElement"),v=Wr(we(b));!p&&v===b||ee(i.current.floatingContext?.refs.floating.current,v)||ee(b,v)||h||Dt(p??v,n.context.triggerElements)||n.setOpen(!1,Z(Y.triggerFocus,y))})}}},[i,r,n,u]);return mt.useMemo(()=>o?{reference:d,trigger:d}:{},[o,d])}var zs=g(F(),1);var Ys=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Ye,this.restTimeout=new Ye,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ln=new WeakMap;function Ro(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ln.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ln.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function cn(e,t){let{scopeElement:o,referenceElement:r,floatingElement:n}=t,s=ln.get(o);s&&s!==e&&Ro(s),Ro(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=o,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=n,ln.set(o,e),o.style.pointerEvents="none",r.style.pointerEvents="auto",n.style.pointerEvents="auto"}function Eo(e){let t=e.context.dataRef.current,o=be(()=>t.hoverInteractionState??Ys.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=o),mo(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ks(e,t={}){let{enabled:o=!0,closeDelay:r=0,nodeId:n}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),l=s.useState("domReferenceElement"),{dataRef:c}=s.context,u=Mt(),d=Jr(),f=Eo(s),m=et(),p=H(()=>zr(c.current.openEvent?.type,f.interactedInside)),y=H(()=>al(c.current.openEvent?.type)),h=H(()=>{Ro(f)});V(()=>{i||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,h())},[i,f,h]),zs.useEffect(()=>h,[h]),V(()=>{if(o&&i&&f.handleCloseOptions?.blockPointerEvents&&y()&&W(l)&&a){let b=l,v=a,x=we(a),w=u?.nodesRef.current.find(S=>S.id===d)?.context?.elements.floating;w&&(w.style.pointerEvents="");let T=f.pointerEventsScopeElement!==v?f.pointerEventsScopeElement:null,R=w!==v?w:null,E=f.handleCloseOptions?.getScope?.()??T??R??b.closest("[data-rootownerid]")??x.body;return cn(f,{scopeElement:E,referenceElement:b,floatingElement:v}),()=>{h()}}},[o,i,l,a,f,y,u,d,h]),zs.useEffect(()=>{if(!o)return;function b(){return!!(u&&d&&vt(u.nodesRef.current,d).length>0)}function v(S){let N=tt(r,"close",f.pointerType),M=()=>{s.setOpen(!1,Z(Y.triggerHover,S)),u?.events.emit("floating.closed",S)};N?f.openChangeTimeout.start(N,M):(f.openChangeTimeout.clear(),M())}function x(S){let N=_e(S);if(!vs(N)){f.interactedInside=!1;return}f.interactedInside=N?.closest("[aria-haspopup]")!=null}function w(){f.openChangeTimeout.clear(),m.clear(),u?.events.off("floating.closed",R),h()}function T(S){if(b()&&u){u.events.on("floating.closed",R);return}if(Dt(S.relatedTarget,s.context.triggerElements))return;let N=c.current.floatingContext?.nodeId??n,M=S.relatedTarget;if(!(u&&N&&W(M)&&vt(u.nodesRef.current,N,!1).some(U=>ee(U.context?.elements.floating,M)))){if(f.handler){f.handler(S);return}h(),y()&&!p()&&v(S)}}function R(S){!u||!d||b()||m.start(0,()=>{u.events.off("floating.closed",R),s.setOpen(!1,Z(Y.triggerHover,S)),u.events.emit("floating.closed",S)})}let E=a;return ot(E&&Q(E,"mouseenter",w),E&&Q(E,"mouseleave",T),E&&Q(E,"pointerdown",x,!0),()=>{u?.events.off("floating.closed",R)})},[o,a,s,c,r,n,y,p,h,f,u,d,m])}var Ft=g(F(),1),Cc=g(It(),1);var yg={current:null};function qs(e,t={}){let{enabled:o=!0,delay:r=0,handleClose:n=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:l=yg,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:m,guardStaleOpen:p=!1}=t,y="rootStore"in e?e.rootStore:e,{dataRef:h,events:b}=y.context,v=Mt(c),x=Eo(y),w=Ft.useRef(!1),T=Fe(n),R=Fe(r),E=Fe(i),S=Fe(o),N=Fe(m),M=Fe(f),O=H(()=>zr(h.current.openEvent?.type,x.interactedInside)),U=H(()=>N.current?.()!==!1),$=H((I,A,P)=>{let _=y.context.triggerElements;if(_.hasElement(A))return!I||!ee(I,A);if(!W(P))return!1;let q=P;return _.hasMatchingElement(oe=>ee(oe,q))&&(!I||!ee(I,q))}),L=H(()=>{if(!x.handler)return;we(y.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),C=H(()=>{Ro(x)});return u&&(x.handleCloseOptions=n?.__options),Ft.useEffect(()=>L,[L]),Ft.useEffect(()=>{if(!o)return;function I(A){A.open?w.current=!1:(w.current=A.reason===Y.triggerHover,L(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return b.on("openchange",I),()=>{b.off("openchange",I)}},[o,b,x,L]),Ft.useEffect(()=>{if(!o)return;function I(z,K=!0){let D=tt(R.current,"close",x.pointerType);D?x.openChangeTimeout.start(D,()=>{y.setOpen(!1,Z(Y.triggerHover,z)),v?.events.emit("floating.closed",z)}):K&&(x.openChangeTimeout.clear(),y.setOpen(!1,Z(Y.triggerHover,z)),v?.events.emit("floating.closed",z))}let A=l.current??(u?y.select("domReferenceElement"):null);if(!W(A))return;function P(z){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!bt(x.pointerType))return;let K=ws(E.current),D=tt(R.current,"open",x.pointerType),G=_e(z),B=z.currentTarget??null,se=y.select("domReferenceElement"),ce=B;if(W(G)&&!y.context.triggerElements.hasElement(G)){for(let Ce of y.context.triggerElements.elements())if(ee(Ce,G)){ce=Ce;break}}W(B)&&W(se)&&!y.context.triggerElements.hasElement(B)&&ee(B,se)&&(ce=se);let ie=ce==null?!1:$(se,ce,G),ue=y.select("open"),fe=M.current?.()??y.select("transitionStatus")==="ending",ht=!ue&&fe&&w.current,re=!ie&&W(ce)&&W(se)&&ee(se,ce)&&ht,he=K>0&&!D,ye=ie&&(ue||ht)||re,it=!ue||ie;if(ye){U()&&y.setOpen(!0,Z(Y.triggerHover,z,ce));return}he||(D?x.openChangeTimeout.start(D,()=>{it&&U()&&y.setOpen(!0,Z(Y.triggerHover,z,ce))}):it&&U()&&y.setOpen(!0,Z(Y.triggerHover,z,ce)))}function _(z){if(O()){C();return}L();let K=y.select("domReferenceElement"),D=we(K);x.restTimeout.clear(),x.restTimeoutPending=!1;let G=h.current.floatingContext??d?.();if(Dt(z.relatedTarget,y.context.triggerElements))return;if(T.current&&G){y.select("open")||x.openChangeTimeout.clear();let se=l.current;x.handler=T.current({...G,tree:v,x:z.clientX,y:z.clientY,onClose(){C(),L(),S.current&&!O()&&se===y.select("domReferenceElement")&&I(z,!0)}}),D.addEventListener("mousemove",x.handler),x.handler(z);return}(x.pointerType!=="touch"||!ee(y.select("floatingElement"),z.relatedTarget))&&I(z)}function q(z){ee(A,z.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}let oe=p?Q(A,"mouseout",q):void 0;return a?ot(Q(A,"mousemove",P,{once:!0}),Q(A,"mouseenter",P),Q(A,"mouseleave",_),oe):ot(Q(A,"mouseenter",P),Q(A,"mouseleave",_),oe)},[L,C,h,R,y,o,T,x,u,$,O,s,a,E,l,v,S,d,M,U,p]),Ft.useMemo(()=>{if(!o)return;function I(A){x.pointerType=A.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(A){let{nativeEvent:P}=A,_=A.currentTarget,q=y.select("domReferenceElement"),oe=y.select("open"),z=$(q,_,A.target);if(s&&!bt(x.pointerType))return;if(oe&&z&&x.handleCloseOptions?.blockPointerEvents){let G=y.select("floatingElement");if(G){let B=x.handleCloseOptions?.getScope?.()??_.ownerDocument.body;cn(x,{scopeElement:B,referenceElement:_,floatingElement:G})}}let K=ws(E.current);if(oe&&!z||K===0||!z&&x.restTimeoutPending&&A.movementX**2+A.movementY**2<2)return;x.restTimeout.clear();function D(){if(x.restTimeoutPending=!1,O())return;let G=y.select("open");!x.blockMouseMove&&(!G||z)&&U()&&y.setOpen(!0,Z(Y.triggerHover,P,_))}x.pointerType==="touch"?Cc.flushSync(()=>{D()}):z&&oe?D():(x.restTimeoutPending=!0,x.restTimeout.start(K,D))}}},[o,x,O,$,s,y,E,U])}var Pc=.1,xg=Pc*Pc,te=.5;function un(e,t,o,r,n,s){return r>=t!=s>=t&&e<=(n-o)*(t-r)/(s-r)+o}function fn(e,t,o,r,n,s,i,a,l,c){let u=!1;return un(e,t,o,r,n,s)&&(u=!u),un(e,t,n,s,i,a)&&(u=!u),un(e,t,i,a,l,c)&&(u=!u),un(e,t,l,c,o,r)&&(u=!u),u}function bg(e,t,o){return e>=o.x&&e<=o.x+o.width&&t>=o.y&&t<=o.y+o.height}function dn(e,t,o,r,n,s){let i=Math.min(o,n),a=Math.max(o,n),l=Math.min(r,s),c=Math.max(r,s);return e>=i&&e<=a&&t>=l&&t<=c}function Gs(e={}){let{blockPointerEvents:t=!1}=e,o=new Ye,r=({x:n,y:s,placement:i,elements:a,onClose:l,nodeId:c,tree:u})=>{let d=i?.split("-")[0],f=!1,m=null,p=null,y=typeof performance<"u"?performance.now():0;function h(v,x){let w=performance.now(),T=w-y;if(m===null||p===null||T===0)return m=v,p=x,y=w,!1;let R=v-m,E=x-p,S=R*R+E*E,N=T*T*xg;return m=v,p=x,y=w,S<N}function b(){o.clear(),l()}return function(x){o.clear();let w=a.domReference,T=a.floating;if(!w||!T||d==null||n==null||s==null)return;let{clientX:R,clientY:E}=x,S=_e(x),N=x.type==="mouseleave",M=ee(T,S),O=ee(w,S);if(M&&(f=!0,!N))return;if(O&&(f=!1,!N)){f=!0;return}if(N&&W(x.relatedTarget)&&ee(T,x.relatedTarget))return;function U(){return!!(u&&vt(u.nodesRef.current,c).length>0)}function $(){U()||b()}if(U())return;let L=w.getBoundingClientRect(),C=T.getBoundingClientRect(),I=n>C.right-C.width/2,A=s>C.bottom-C.height/2,P=C.width>L.width,_=C.height>L.height,q=(P?L:C).left,oe=(P?L:C).right,z=(_?L:C).top,K=(_?L:C).bottom;if(d==="top"&&s>=L.bottom-1||d==="bottom"&&s<=L.top+1||d==="left"&&n>=L.right-1||d==="right"&&n<=L.left+1){$();return}let D=!1;switch(d){case"top":D=dn(R,E,q,L.top+1,oe,C.bottom-1);break;case"bottom":D=dn(R,E,q,C.top+1,oe,L.bottom-1);break;case"left":D=dn(R,E,C.right-1,K,L.left+1,z);break;case"right":D=dn(R,E,L.right-1,K,C.left+1,z);break;default:}if(D)return;if(f&&!bg(R,E,L)){$();return}if(!N&&h(R,E)){$();return}let G=!1;switch(d){case"top":{let B=P?te/2:te*4,se=P||I?n+B:n-B,ce=P?n-B:I?n+B:n-B,ie=s+te+1,ue=I||P?C.bottom-te:C.top,fe=I?P?C.bottom-te:C.top:C.bottom-te;G=fn(R,E,se,ie,ce,ie,C.left,ue,C.right,fe);break}case"bottom":{let B=P?te/2:te*4,se=P||I?n+B:n-B,ce=P?n-B:I?n+B:n-B,ie=s-te,ue=I||P?C.top+te:C.bottom,fe=I?P?C.top+te:C.bottom:C.top+te;G=fn(R,E,se,ie,ce,ie,C.left,ue,C.right,fe);break}case"left":{let B=_?te/2:te*4,se=_||A?s+B:s-B,ce=_?s-B:A?s+B:s-B,ie=n+te+1,ue=A||_?C.right-te:C.left,fe=A?_?C.right-te:C.left:C.right-te;G=fn(R,E,ue,C.top,fe,C.bottom,ie,se,ie,ce);break}case"right":{let B=_?te/2:te*4,se=_||A?s+B:s-B,ce=_?s-B:A?s+B:s-B,ie=n-te,ue=A||_?C.left+te:C.right,fe=A?_?C.left+te:C.right:C.left+te;G=fn(R,E,ie,se,ie,ce,ue,C.top,fe,C.bottom);break}default:}G?f||o.start(40,$):$()}};return r.__options={...e,blockPointerEvents:t},r}var pn=class extends Bt{setState(t){}update(t){}set(t,o){}notifyAll(){}};function Oc(e){return fo(19)?e:e?"true":void 0}var mn=g(F(),1),Xs=mn.createContext(void 0);function To(){return mn.useContext(Xs)?.direction??"ltr"}var ze=g(F(),1);var vg=e=>({name:"arrow",options:e,async fn(t){let{x:o,y:r,placement:n,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0,offsetParent:d="real"}=pt(e,t)||{};if(c==null)return{};let f=Xr(u),m={x:o,y:r},p=Zo(n),y=Jo(p),h=await i.getDimensions(c),b=p==="y",v=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",T=s.reference[y]+s.reference[p]-m[p]-s.floating[y],R=m[p]-s.reference[p],E=d==="real"?await i.getOffsetParent?.(c):a.floating,S=a.floating[w]||s.floating[y];(!S||!await i.isElement?.(E))&&(S=a.floating[w]||s.floating[y]);let N=T/2-R/2,M=S/2-h[y]/2-1,O=Math.min(f[v],M),U=Math.min(f[x],M),$=O,L=S-h[y]-U,C=S/2-h[y]/2+N,I=qr($,C,L),A=!l.arrow&&Xe(n)!=null&&C!==I&&s.reference[y]/2-(C<$?O:U)-h[y]/2<0,P=A?C<$?C-$:C-L:0;return{[p]:m[p]+P,data:{[p]:I,centerOffset:C-I-P,...A&&{alignmentOffset:P}},reset:A}}}),_c=(e,t)=>{let{name:o,fn:r}=vg(e);return{name:o,fn:r,options:[e,t]}};var kc={name:"hide",async fn(e){let{width:t,height:o,x:r,y:n}=e.rects.reference,s=t===0&&o===0&&r===0&&n===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-o>=0||i.right-t>=0||i.bottom-o>=0||i.left-t>=0||s}}}};var So={sideX:"left",sideY:"top"};var gn="--available-width",hn="--available-height",Ac="--anchor-width",Ic="--anchor-height",Dc="--transform-origin",Nc="--positioner-width",Lc="--positioner-height";var Bc=gn,Fc=hn;function Hc(e,t,o){let r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?o?"inline-start":"inline-end":"right",bottom:"bottom",left:r?o?"inline-end":"inline-start":"left"}[t]}function Vc(e,t,o){let{rects:r,placement:n}=e;return{side:Hc(t,Te(n),o),align:Xe(n)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Wc(e){return wg(e,Sc)}function wg(e,t){let{anchor:o,positionMethod:r="absolute",side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,collisionBoundary:l,collisionPadding:c=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:p=!1,floatingRootContext:y,mounted:h,collisionAvoidance:b,shift:v,nodeId:x,adaptiveOrigin:w,lazyFlip:T=!1,externalTree:R}=e,[E,S]=ze.useState(null);!h&&E!==null&&S(null);let N=b.side||"flip",M=b.align||"flip",O=b.fallbackAxisSide||"end",U=v?.crossAxis??!1,$=v?.rootBoundary,L=typeof o=="function"?o:void 0,C=H(L),I=L?C:o,A=Fe(o),P=Fe(h),q=To()==="rtl",oe=E||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":q?"left":"right","inline-start":q?"right":"left"}[n],z=i==="center"?oe:`${oe}-${i}`,K=c;typeof K=="number"?K={top:K,right:K,bottom:K,left:K}:K&&(K={top:K.top||0,right:K.right||0,bottom:K.bottom||0,left:K.left||0});let D=1,G=n==="bottom"?D:0,B=n==="top"?D:0,se=n==="right"?D:0,ce=n==="left"?D:0,ie={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:K},ue=ze.useRef(null),fe=Fe(s),ht=Fe(a),re=typeof s!="function"?s:0,he=typeof a!="function"?a:0,ye=[];m&&ye.push(m),ye.push(ks(J=>{let We=Vc(J,n,q),Ke=typeof fe.current=="function"?fe.current(We):fe.current,Ne=typeof ht.current=="function"?ht.current(We):ht.current;return{mainAxis:Ke,crossAxis:Ne,alignmentAxis:Ne}},[re,he,q,n]));let it=M==="none"&&N!=="shift",Ce=!it&&(u||U||N==="shift"),ro=N==="none"?null:Ds({...ie,padding:{top:K.top+D+G,right:K.right+D+ce,bottom:K.bottom+D+B,left:K.left+D+se},mainAxis:!U&&N==="flip",crossAxis:M==="flip"?"alignment":!1,fallbackAxisSideDirection:O}),yt=it?null:As({...ie,rootBoundary:$,mainAxis:M!=="none",crossAxis:Ce,limiter:u||U?void 0:Is(J=>{if(!ue.current)return{};let{width:We,height:Ke}=ue.current.getBoundingClientRect(),Ne=Ve(Te(J.placement)),Pt=Ne==="y"?We:Ke,Ze=Ne==="y"?K.left+K.right:K.top+K.bottom;return{offset:Pt/2+Ze/2}})},[ie,u,U,$,K,M]);N==="shift"||M==="shift"||i==="center"?ye.push(yt,ro):ye.push(ro,yt),ye.push(Ns({...ie,apply({elements:{floating:J},availableWidth:We,availableHeight:Ke,rects:Ne}){if(!P.current)return;let Pt=J.style;Pt.setProperty(Bc,`${We}px`),Pt.setProperty(Fc,`${Ke}px`);let Ze=le(J).devicePixelRatio||1,{x:wr,y:so,width:Rr,height:Ot}=Ne.reference,No=(Math.round((wr+Rr)*Ze)-Math.round(wr*Ze))/Ze,Lo=(Math.round((so+Ot)*Ze)-Math.round(so*Ze))/Ze;Pt.setProperty(Ac,`${No}px`),Pt.setProperty(Ic,`${Lo}px`)}}),_c(J=>({element:ue.current||we(J.elements.floating).createElement("div"),padding:ue.current?d:0,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(J){let{elements:{floating:We},middlewareData:Ke,placement:Ne,platform:Pt,rects:Ze,y:wr}=J,so=Te(Ne),Rr=Xe(Ne),Ot=Ve(so)==="y",No=ue.current,Lo=typeof s=="function"?s(Vc(J,n,q)):s,Er;if(!No&&Rr&&Math.abs(Ot?Ke.shift?.x||0:Ke.shift?.y||0)<=1)Er=Rr==="start"===(Ot&&Pt.isRTL?.(We)===!0)?"100%":"0%";else{let rd=Ot?Ke.arrow?.x||0:Ke.arrow?.y||0,nd=Ot?No?.clientWidth||0:No?.clientHeight||0;Er=`${rd+nd/2}px`}let Un=so==="top"||so==="left"?`calc(100% + ${Lo}px)`:`${-Lo}px`;return Ce&&Ot&&Math.abs(Ke.shift?.y||0)>Lo&&(Un=`${Ze.reference.y+Ze.reference.height/2-wr}px`),We.style.setProperty(Dc,Ot?`${Er} ${Un}`:`${Un} ${Er}`),{}}},kc,w),V(()=>{!h&&y&&y.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,y]);let at=ze.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:Rt,elements:Ut,x:mr,y:gr,middlewareData:Et,update:k,placement:j,context:Ee,isPositioned:de,floatingStyles:Tt}=t({rootContext:y,open:p?h:void 0,placement:z,middleware:ye,strategy:r,whileElementsMounted:p?void 0:(...J)=>Qo(...J,at),nodeId:x,externalTree:R}),{sideX:Do,sideY:St}=Et.adaptiveOrigin||So,Pe=de?r:"fixed",no=ze.useMemo(()=>{let J;return de?w?J={position:Pe,[Do]:mr,[St]:gr}:J={...Tt,position:Pe}:J={position:Pe,top:0,left:0},J[Bc]="100vw",J[Fc]="100vh",de||(J.opacity=0),J},[w,Pe,Do,mr,St,gr,Tt,de]),$t=ze.useRef(null);V(()=>{if(!h)return;let J=A.current,We=typeof J=="function"?J():J,Ne=(jc(We)?We.current:We)||null||null;Ne!==$t.current&&(Rt.setPositionReference(Ne),$t.current=Ne)},[h,Rt,I,A]),ze.useEffect(()=>{if(!h)return;let J=A.current;typeof J!="function"&&jc(J)&&J.current!==$t.current&&(Rt.setPositionReference(J.current),$t.current=J.current)},[h,Rt,I,A]),ze.useEffect(()=>{if(p&&h&&Ut.reference&&Ut.floating)return Qo(Ut.reference,Ut.floating,k,at)},[p,h,Ut,k,at]);let Ct=Te(j),hr=Hc(n,Ct,q),yr=Xe(j)||"center",xr=!!Et.hide?.referenceHidden;V(()=>{T&&h&&de&&Ct!==oe&&S(Ct)},[T,h,de,Ct,oe]);let br=ze.useMemo(()=>({position:"absolute",top:Et.arrow?.y,left:Et.arrow?.x}),[Et.arrow]),vr=Et.arrow?.centerOffset!==0;return ze.useMemo(()=>({positionerStyles:no,arrowStyles:br,arrowRef:ue,arrowUncentered:vr,side:hr,align:yr,physicalSide:Ct,anchorHidden:xr,refs:Rt,context:Ee,isPositioned:de,update:k}),[no,br,ue,vr,hr,yr,Ct,xr,Rt,Ee,de,k])}function jc(e){return e!=null&&"current"in e}function yn(e){return e==="starting"?gl:ae}function Uc(e,t,{styles:o,transitionStatus:r,props:n,refs:s,hidden:i,inert:a=!1}){let l={...o};return a&&(l.pointerEvents="none"),Be("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:l},yn(r),n],stateAttributesMapping:Ko})}var Re=g(F(),1),eu=g(It(),1);var $c=g(F(),1);function Yc(e){let[t,o]=$c.useState({current:e,previous:null});return Object.is(e,t.current)||o({current:e,previous:t.current}),t.previous}var Co=g(F(),1);function Js(e){let t=Oe(e),o=parseFloat(t.width)||0,r=parseFloat(t.height)||0,n=ve(e),s=n?e.offsetWidth:o,i=n?e.offsetHeight:r;return(Lt(o)!==s||Lt(r)!==i)&&(o=s,r=i),{width:o,height:r}}var or="--popup-width",rr="--popup-height";function qc(e){let{popupElement:t,positionerElement:o,content:r,mounted:n,onMeasureLayout:s,onMeasureLayoutComplete:i,side:a,direction:l}=e,c=yo(t,!0),u=go(),d=Co.useRef(null),f=Co.useRef(!0),m=Co.useRef($e),p=H(s),y=H(i),h=Co.useMemo(()=>Rg(a,l),[a,l]);V(()=>{if(!n){m.current=$e,f.current=!0,d.current=null;return}if(!t||!o)return;m.current=Kc(t,h),Zs(t,"auto");let b=bn(t,"position","static"),v=bn(t,"transform","none"),x=bn(t,"scale","1"),w=Kc(o,{[gn]:"max-content",[hn]:"max-content"});function T(){b(),v(),w()}function R(){T(),x()}if(p?.(),f.current||d.current===null){xn(o,"max-content");let M=Js(t);return d.current=M,xn(o,M),R(),y?.(null,M),f.current=!1,()=>{m.current(),m.current=$e}}xn(o,"max-content");let E=d.current,S=Js(t);d.current=S,Zs(t,E),R(),y?.(E,S),xn(o,S);let N=new AbortController;return u.request(()=>{Zs(t,S),c(()=>{t.style.setProperty(or,"auto"),t.style.setProperty(rr,"auto")},N.signal)}),()=>{N.abort(),u.cancel(),m.current(),m.current=$e}},[r,t,o,c,u,n,p,y,h])}function Rg(e,t){let o=e==="top",r=e==="left"||e===(t==="rtl"?"inline-end":"inline-start");return!o&&!r?ae:{position:"absolute",[o?"bottom":"top"]:"0",[r?"right":"left"]:"0"}}function bn(e,t,o){let r=e.style.getPropertyValue(t);return e.style.setProperty(t,o),()=>{e.style.setProperty(t,r)}}function Kc(e,t){let o=[];for(let[r,n]of Object.entries(t))o.push(bn(e,r,n));return o.length?()=>{o.forEach(r=>r())}:$e}function Zs(e,t){let o=t==="auto"?"auto":`${t.width}px`,r=t==="auto"?"auto":`${t.height}px`;e.style.setProperty(or,o),e.style.setProperty(rr,r)}function xn(e,t){let o=t==="max-content"?"max-content":`${t.width}px`,r=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty(Nc,o),e.style.setProperty(Lc,r)}var Gc=g(F(),1);var Xc=g(X(),1),vn=function(t){let{direction:o="ltr"}=t,r=Gc.useMemo(()=>({direction:o}),[o]);return(0,Xc.jsx)(Xs.Provider,{value:r,children:t.children})};var Jc={name:"adaptiveOrigin",async fn(e){let{x:t,y:o,rects:{floating:r},elements:{floating:n},platform:s,strategy:i,placement:a}=e,l=le(n),c=l.getComputedStyle(n);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:o,data:So};let d=await s.getOffsetParent?.(n),f={width:0,height:0};if(i==="fixed"&&l?.visualViewport)f={width:l.visualViewport.width,height:l.visualViewport.height};else if(d===l){let v=we(n);f={width:v.documentElement.clientWidth,height:v.documentElement.clientHeight}}else await s.isElement?.(d)&&(f=await s.getDimensions(d));let m=Te(a),p=t,y=o;m==="left"&&(p=f.width-(t+r.width)),m==="top"&&(y=f.height-(o+r.height));let h=m==="left"?"right":So.sideX,b=m==="top"?"bottom":So.sideY;return{x:p,y,data:{sideX:h,sideY:b}}}};var Zc="data-activation-direction";var Po=g(X(),1),tu={activationDirection:e=>e?{[Zc]:e}:null};function ou(e){let{store:t,side:o,children:r}=e,n=To(),s=t.useState("activeTriggerElement"),i=t.useState("activeTriggerId"),a=t.useState("open"),l=t.useState("payload"),c=t.useState("mounted"),u=t.useState("popupElement"),d=t.useState("positionerElement"),f=Yc(a?s:null),m=Cg(i,l),p=Re.useRef(null),[y,h]=Re.useState(null),[b,v]=Re.useState(null),x=Re.useRef(null),w=Re.useRef(null),T=yo(x,!0),R=go(),E=Re.useRef(null),[S,N]=Re.useState(null),[M,O]=Re.useState(!1);V(()=>(t.set("adaptiveOrigin",Jc),()=>{t.set("adaptiveOrigin",void 0)}),[t]);let U=H(()=>{x.current?.style.setProperty("animation","none"),x.current?.style.setProperty("transition","none"),w.current?.style.setProperty("display","none")}),$=H(_=>{x.current?.style.removeProperty("animation"),x.current?.style.removeProperty("transition"),w.current?.style.removeProperty("display"),_&&N(_)}),L=H(()=>{E.current?.abort();let _=new AbortController;E.current=_,T(()=>{h(null),N(null),p.current=null},_.signal)}),C=Re.useRef(null);V(()=>{(!a||!c)&&(C.current=null)},[a,c]),V(()=>{if(s&&f&&s!==f&&C.current!==s&&p.current){h(p.current),O(!0);let _=Sg(f,s);v(_),C.current=s}},[s,f]),V(()=>{y!=null&&(E.current?.abort(),O(!0),R.request(()=>{eu.flushSync(()=>{O(!1)}),L()}))},[m,y,L,R]),V(()=>{let _=x.current;if(!_)return;let q=we(_).createElement("div");for(let oe of Array.from(_.childNodes))q.appendChild(oe.cloneNode(!0));p.current=q});let I=y!=null,A;I?A=(0,Po.jsxs)(Re.Fragment,{children:[(0,Po.jsx)("div",{"data-previous":!0,inert:Oc(!0),ref:w,style:{...S?{[or]:`${S.width}px`,[rr]:`${S.height}px`}:null,position:"absolute"},"data-ending-style":M?void 0:""},"previous"),(0,Po.jsx)("div",{"data-current":!0,ref:x,"data-starting-style":M?"":void 0,children:r},m)]}):A=(0,Po.jsx)("div",{"data-current":!0,ref:x,children:r},m),V(()=>{let _=w.current;!_||!y||_.replaceChildren(...Array.from(y.childNodes))},[y]),qc({popupElement:u,positionerElement:d,mounted:c,content:l,onMeasureLayout:U,onMeasureLayoutComplete:$,side:o,direction:n});let P={activationDirection:Tg(b),transitioning:I};return{children:A,state:P}}function Tg(e){if(e)return`${Qc(e.horizontal,5,"right","left")} ${Qc(e.vertical,5,"down","up")}`}function Qc(e,t,o,r){return e>t?o:e<-t?r:""}function Sg(e,t){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n={x:o.left+o.width/2,y:o.top+o.height/2},s={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:s.x-n.x,vertical:s.y-n.y}}function Cg(e,t){let[o,r]=Re.useState(0),n=Re.useRef(e),s=Re.useRef(t),i=Re.useRef(!1);return V(()=>{let a=n.current,l=s.current,c=e!==a,u=t!==l;c?(r(d=>d+1),i.current=!u):i.current&&u&&(r(d=>d+1),i.current=!1),n.current=e,s.current=t},[e,t]),`${e??"current"}-${o}`}var wn=g(F(),1),ru=g(It(),1);var nu=g(X(),1),su=wn.forwardRef(function(t,o){let{children:r,container:n,className:s,render:i,style:a,...l}=t,{node:c,subtree:u}=bl({container:n,ref:o,componentProps:t,elementProps:l});return!u&&!c?null:(0,nu.jsxs)(wn.Fragment,{children:[u,c&&ru.createPortal(r,c)]})});var He={};Le(He,{Arrow:()=>Tu,Handle:()=>sr,Popup:()=>Ru,Portal:()=>xu,Positioner:()=>vu,Provider:()=>Cu,Root:()=>fu,Trigger:()=>gu,Viewport:()=>Ou,createHandle:()=>_u});var Oo=g(F(),1);var Rn=g(F(),1),Qs=Rn.createContext(void 0);function Je(e){let t=Rn.useContext(Qs);if(t===void 0&&!e)throw new Error(Ge(72));return t}var iu=g(F(),1);var au={...Rc,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},En=class extends Bt{constructor(t,o,r){let n=new er;super(cu(t,n,o,r),uu(n),au)}setOpen=(t,o)=>{mc(this,t,o,{extraState:{openChangeReason:o.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,Z(Y.triggerPress,t))}};function lu(){let e=new er,t=new pn(Object.freeze(cu(void 0,e)),Object.freeze(uu(e)),au);return Object.assign(t,{setOpen:$e,cancelPendingOpen:$e})}function cu(e,t,o,r=!1){return{...vc(t,o,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function uu(e){return{popupRef:iu.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var nr=g(X(),1),fu=Fs(function(t){let{disabled:o=!1,defaultOpen:r=!1,open:n,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:l,onOpenChangeComplete:c,handle:u,triggerId:d,defaultTriggerId:f=null,children:m}=t,p=dc((O,U)=>new En({open:r,openProp:n,activeTriggerId:f,triggerIdProp:d},O,U));p.useControlledProp("openProp",n),p.useControlledProp("triggerIdProp",d),p.useContextCallback("onOpenChange",l),p.useContextCallback("onOpenChangeComplete",c);let y=p.useState("open"),h=!o&&y,b=p.useState("activeTriggerId"),v=p.useState("mounted"),x=p.useState("payload");p.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:o}),hc(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:w,transitionStatus:T}=yc(h,p),R=p.useState("isInstantPhase"),E=p.useState("instantType"),S=p.useState("lastOpenChangeReason"),N=Oo.useRef(null);V(()=>{y&&o&&p.setOpen(!1,Z(Y.disabled))},[y,o,p]),V(()=>{T==="ending"&&S===Y.none||T!=="ending"&&R?(E!=="delay"&&(N.current=E),p.set("instantType","delay")):N.current!==null&&(p.set("instantType",N.current),N.current=null)},[T,R,S,E,p]),V(()=>{h&&b==null&&p.set("payload",void 0)},[p,b,h]),Oo.useImperativeHandle(a,()=>({unmount:w,close:()=>p.setOpen(!1,Z(Y.imperativeAction))}),[w,p]);let M=h||v||!o&&i!=="none";return(0,nr.jsxs)(Qs.Provider,{value:p,children:[u&&(0,nr.jsx)(pc,{handle:u,store:p}),M&&(0,nr.jsx)(Pg,{store:p,disabled:o,trackCursorAxis:i}),typeof m=="function"?m({payload:x}):m]})});function Pg({store:e,disabled:t,trackCursorAxis:o}){let r=e.useState("floatingRootContext"),n=Ss(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=Ts(r,{enabled:!t&&o!=="none",axis:o==="none"?void 0:o}),i=Oo.useMemo(()=>zt(s.reference,n.reference),[s.reference,n.reference]);return xc(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:n.floating??ae}),null}var Sn=g(F(),1);var Tn=g(F(),1),ei=Tn.createContext(void 0);function du(){return Tn.useContext(ei)}var mu="data-base-ui-tooltip-trigger";function pu(e){if("composedPath"in e){let o=e.composedPath();for(let r=0;r<o.length;r+=1){let n=o[r];if(W(n))return n}}let t=e.target;return W(t)?t:null}function Og(e){let t=e;for(;t;){let o=t.closest(`[${mu}]`);if(o)return o;let r=t.getRootNode();t="host"in r&&W(r.host)?r.host:null}return null}var gu=nc(function(t,o){let{render:r,className:n,style:s,handle:i,payload:a,disabled:l,delay:c,closeOnClick:u=!0,closeDelay:d,id:f,...m}=t,p=Je(!0),h=Tc(i)??p;if(!h)throw new Error(Ge(82));let b=Da(f),v=h.useState("isTriggerActive",b),x=h.useState("isOpenedByTrigger",b),w=h.useState("floatingRootContext"),T=Sn.useRef(null),R=d??0,{registerTrigger:E,isMountedByThisTrigger:S}=gc(b,T,h,{payload:a,closeOnClick:u,closeDelay:R}),N=du(),{activeIdRef:M,delayRef:O,isInstantPhase:U,hasProvider:$}=Es(w,{open:x}),L=Eo(w);h.useSyncedValue("isInstantPhase",U);let C=h.useState("disabled"),I=l??C,A=Fe(I),P=h.useState("trackCursorAxis"),_=h.useState("disableHoverablePopup"),q=Sn.useRef(!1),oe=et(),z=Sn.useRef(void 0);function K(){return $&&M.current!=null?0:c??N??600}function D(re){let he=T.current;if(!he||!re)return!1;let ye=Og(re);return ye!==null&&ye!==he&&ee(he,ye)}function G(re){let he=D(re);return q.current=he,he&&(L.openChangeTimeout.clear(),L.restTimeout.clear(),L.restTimeoutPending=!1,oe.clear()),he}let B=qs(w,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!_&&P!=="both"?Gs():null,restMs:K,delay(){return d==null&&$?{close:tt(O.current,"close")}:{close:R}},triggerElementRef:T,isActiveTrigger:v,isClosing:()=>h.select("transitionStatus")==="ending",shouldOpen(){return!q.current}}),se=$s(w,{enabled:!I}).reference,ce=re=>{let he=q.current,ye=pu(re),it=G(ye),Ce=T.current,ro=Ce&&ye&&ee(Ce,ye);if(it&&h.select("open")&&h.select("lastOpenChangeReason")===Y.triggerHover){h.setOpen(!1,Z(Y.triggerHover,re));return}if(he&&!it&&ro&&!A.current&&!h.select("open")&&Ce&&bt(z.current)){let yt=()=>{!q.current&&!A.current&&!h.select("open")&&h.setOpen(!0,Z(Y.triggerHover,re,Ce))},at=K();at===0?(oe.clear(),yt()):oe.start(at,yt)}},ie=h.useState("triggerProps",S);return Be("button",t,{state:{open:x},ref:[o,E,T],props:[B,se,S||P!=="none"?ie:void 0,{onMouseOver(re){ce(re.nativeEvent)},onFocus(re){D(pu(re.nativeEvent))&&re.preventBaseUIHandler()},onMouseLeave(){q.current=!1,oe.clear(),z.current=void 0},onPointerEnter(re){z.current=re.pointerType},onPointerDown(re){z.current=re.pointerType,h.set("closeOnClick",u),u&&!h.select("open")&&h.cancelPendingOpen(re.nativeEvent)},onClick(re){u&&!h.select("open")&&h.cancelPendingOpen(re.nativeEvent)},id:b,[qo]:I?"":void 0,[mu]:I?void 0:""},m],stateAttributesMapping:tl})});var yu=g(F(),1);var Cn=g(F(),1),ti=Cn.createContext(void 0);function hu(){let e=Cn.useContext(ti);if(e===void 0)throw new Error(Ge(70));return e}var oi=g(X(),1),xu=yu.forwardRef(function(t,o){let{keepMounted:r=!1,...n}=t;return Je().useState("mounted")||r?(0,oi.jsx)(ti.Provider,{value:r,children:(0,oi.jsx)(su,{ref:o,...n})}):null});var On=g(F(),1);var Pn=g(F(),1),ri=Pn.createContext(void 0);function _o(){let e=Pn.useContext(ri);if(e===void 0)throw new Error(Ge(71));return e}var bu=g(X(),1),vu=On.forwardRef(function(t,o){let{render:r,className:n,anchor:s,positionMethod:i="absolute",side:a="top",align:l="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:y=!1,collisionAvoidance:h=hl,style:b,...v}=t,x=Je(),w=hu(),T=x.useState("open"),R=x.useState("mounted"),E=x.useState("trackCursorAxis"),S=x.useState("disableHoverablePopup"),N=x.useState("floatingRootContext"),M=x.useState("instantType"),O=x.useState("transitionStatus"),U=x.useState("adaptiveOrigin"),$=Wc({anchor:s,positionMethod:i,floatingRootContext:N,mounted:R,side:a,sideOffset:c,align:l,alignOffset:u,collisionBoundary:d,collisionPadding:f,sticky:p,arrowPadding:m,disableAnchorTracking:y,keepMounted:w,collisionAvoidance:h,adaptiveOrigin:U}),L=On.useMemo(()=>({open:T,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:E!=="none"?"tracking-cursor":M}),[T,$.side,$.align,$.anchorHidden,E,M]),C=Uc(t,L,{styles:$.positionerStyles,transitionStatus:O,props:v,refs:[o,x.useStateSetter("positionerElement")],hidden:!R,inert:!T||E==="both"||S});return(0,bu.jsx)(ri.Provider,{value:$,children:C})});var wu=g(F(),1);var Ru=wu.forwardRef(function(t,o){let{render:r,className:n,style:s,...i}=t,a=Je(),{side:l,align:c}=_o(),u=a.useState("open"),d=a.useState("instantType"),f=a.useState("transitionStatus"),m=a.useState("popupProps"),p=a.useState("floatingRootContext"),y=a.useState("disabled"),h=a.useState("closeDelay");Hr({open:u,ref:a.context.popupRef,onComplete(){u&&a.context.onOpenChangeComplete?.(!0)}}),Ks(p,{enabled:!y,closeDelay:h});let b=a.useStateSetter("popupElement");return Be("div",t,{state:{open:u,side:l,align:c,instant:d,transitionStatus:f},ref:[o,a.context.popupRef,b],props:[fc,m,yn(f),i],stateAttributesMapping:ol})});var Eu=g(F(),1);var Tu=Eu.forwardRef(function(t,o){let{render:r,className:n,style:s,...i}=t,a=Je(),{arrowRef:l,side:c,align:u,arrowUncentered:d,arrowStyles:f}=_o(),m=a.useState("open"),p=a.useState("instantType");return Be("div",t,{state:{open:m,side:c,align:u,uncentered:d,instant:p},ref:[o,l],props:[{style:f,"aria-hidden":!0},i],stateAttributesMapping:Ko})});var Su=g(F(),1);var ni=g(X(),1),Cu=function(t){let{delay:o,closeDelay:r,timeout:n=400}=t,s=Su.useMemo(()=>({open:o,close:r}),[o,r]);return(0,ni.jsx)(ei.Provider,{value:o,children:(0,ni.jsx)(Rs,{delay:s,timeoutMs:n,children:t.children})})};var Pu=g(F(),1);var Ou=Pu.forwardRef(function(t,o){let{render:r,className:n,style:s,children:i,...a}=t,l=Je(),c=_o(),u=l.useState("instantType"),{children:d,state:f}=ou({store:l,side:c.side,children:i}),m={activationDirection:f.activationDirection,transitioning:f.transitioning,instant:u};return Be("div",t,{state:m,ref:o,props:[a,{children:d}],stateAttributesMapping:tu})});var sr=class extends on{constructor(){super(lu(),"Tooltip")}open(t){this.openByTrigger(t)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}};function _u(){return new sr}function ku(e){return Be(e.defaultTagName??"div",e,e)}var ko={};Le(ko,{Popup:()=>Ju,Portal:()=>_n,Positioner:()=>kn,Provider:()=>af,Root:()=>nf,Trigger:()=>ef});var Gu=g(Ue(),1);var Lu=g(Ue(),1);var ii="data-wp-hash";function ai(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&kg(document)),e.__wpStyleRuntime}function _g(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${ii}]`))if(o.getAttribute(ii)===t)return!0;return!1}function Iu(e,t,o){if(!e.head)return;let r=ai(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(_g(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(ii,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function kg(e){let t=ai();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)Iu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function Ag(e,t){let o=ai();o.styles.set(e,t);for(let r of o.documents.keys())Iu(r,e,t)}typeof process>"u",Ag("be37f31c1e","._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");var Au={slot:"_11fc52b637ff8a7e__slot"},Du="data-wp-compat-overlay-slot";function Ig(){return typeof document>"u"?null:document}function Dg(){let e;try{e=window.top?.wp}catch{}let t=e??window.wp;return typeof t?.components=="object"&&t.components!==null}var gt=null;function si(e){return e.setAttribute("aria-hidden","false"),e}function Ng(e){let t=e.createElement("div");return t.setAttribute(Du,""),Au.slot&&t.classList.add(Au.slot),e.body.appendChild(t),t}function Nu(){if(typeof window>"u"||!Dg()&&window.__wpUiCompatOverlaySlotEnabled!==!0)return;let e=Ig();if(!e||!e.body)return;if(gt&&gt.ownerDocument===e&&gt.isConnected)return si(gt);let t=e.querySelector(`[${Du}]`);return t instanceof HTMLDivElement?(gt=si(t),gt):(gt?.isConnected&&gt.remove(),gt=si(Ng(e)),gt)}var Mu=g(X(),1),_n=(0,Lu.forwardRef)(function({container:t,...o},r){return(0,Mu.jsx)(He.Portal,{container:t??Nu(),...o,ref:r})});var Bu=g(Ue(),1),ju=g(X(),1),li="data-wp-hash";function ci(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&Mg(document)),e.__wpStyleRuntime}function Lg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${li}]`))if(o.getAttribute(li)===t)return!0;return!1}function Fu(e,t,o){if(!e.head)return;let r=ci(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(Lg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(li,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function Mg(e){let t=ci();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)Fu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function Vu(e,t){let o=ci();o.styles.set(e,t);for(let r of o.documents.keys())Fu(r,e,t)}typeof process>"u",Vu("10f3806643","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");var Bg={"box-sizing":"_336cd3e4e743482f__box-sizing"};typeof process>"u",Vu("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var Fg={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},kn=(0,Bu.forwardRef)(function({align:t="center",className:o,side:r="top",sideOffset:n=4,...s},i){return(0,ju.jsx)(He.Positioner,{ref:i,align:t,side:r,sideOffset:n,...s,className:uo(Bg["box-sizing"],Fg.positioner,o)})});var Hu=g(Ue(),1);function ui(e,t,o){return(0,Hu.cloneElement)(e??t,{children:o})}var Vg=g(Uu(),1);var zu=g(Yu(),1),{lock:tS,unlock:Ku}=(0,zu.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/ui");function jg(){let e=Vg;if(e.ThemeProvider)return e.ThemeProvider;if(!e.privateApis)throw new Error("@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`.");return Ku(e.privateApis).ThemeProvider}var qu=jg();var ir=g(X(),1),fi="data-wp-hash";function di(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&Wg(document)),e.__wpStyleRuntime}function Hg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${fi}]`))if(o.getAttribute(fi)===t)return!0;return!1}function Xu(e,t,o){if(!e.head)return;let r=di(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(Hg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(fi,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function Wg(e){let t=di();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)Xu(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function Ug(e,t){let o=di();o.styles.set(e,t);for(let r of o.documents.keys())Xu(r,e,t)}typeof process>"u",Ug("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var $g={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},Yg={background:"#1e1e1e"},Ju=(0,Gu.forwardRef)(function({portal:t,positioner:o,children:r,className:n,...s},i){let a=(0,ir.jsx)(qu,{color:Yg,children:(0,ir.jsx)(He.Popup,{ref:i,className:uo($g.popup,n),...s,children:r})}),l=ui(o,(0,ir.jsx)(kn,{}),a);return ui(t,(0,ir.jsx)(_n,{}),l)});var Zu=g(Ue(),1),Qu=g(X(),1),ef=(0,Zu.forwardRef)(function(t,o){return(0,Qu.jsx)(He.Trigger,{ref:o,...t})});var tf=g(Me(),1),of=g(X(),1);function rf({children:e}){return(0,of.jsx)(vn,{direction:(0,tf.isRTL)()?"rtl":"ltr",children:e})}var pi=g(X(),1);function nf(e){return(0,pi.jsx)(rf,{children:(0,pi.jsx)(He.Root,{...e})})}var sf=g(X(),1);function af({...e}){return(0,sf.jsx)(He.Provider,{...e})}var An=g(Ue(),1),ar=(0,An.forwardRef)(({icon:e,size:t=24,style:o,...r},n)=>{let s=e.props.style,i=s||o?{...s,...o}:void 0;return(0,An.cloneElement)(e,{width:t,height:t,...r,...i?{style:i}:{},ref:n})});var Dn=g(In(),1),mi=g(X(),1),gi=(0,mi.jsx)(Dn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,mi.jsx)(Dn.Path,{d:"M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z",vectorEffect:"non-scaling-stroke"})});var Nn=g(In(),1),hi=g(X(),1),yi=(0,hi.jsx)(Nn.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,hi.jsx)(Nn.Path,{d:"M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z",fill:"currentColor",vectorEffect:"non-scaling-stroke"})});var lr=g(In(),1),cr=g(X(),1),xi=(0,cr.jsxs)(lr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,cr.jsx)(lr.Path,{d:"M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z",vectorEffect:"non-scaling-stroke"}),(0,cr.jsx)(lr.Path,{d:"M11.4653 15.4048C11.7941 15.232 12 14.8912 12 14.5197V5.71576L10.3894 8.97924C10.2437 9.27438 9.96215 9.47895 9.63644 9.52628L6.03497 10.0496L8.64102 12.5899C8.8767 12.8196 8.98425 13.1506 8.92861 13.475L8.31341 17.0619L11.4653 15.4048Z",fill:"currentColor",stroke:"none"})]});var cf=g(Ue(),1),bi="data-wp-hash";function vi(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&Kg(document)),e.__wpStyleRuntime}function zg(e,t){if(!e.head)return!1;for(let o of e.head.querySelectorAll(`style[${bi}]`))if(o.getAttribute(bi)===t)return!0;return!1}function uf(e,t,o){if(!e.head)return;let r=vi(),n=r.injectedStyles.get(e);if(n||(n=new Set,r.injectedStyles.set(e,n)),n.has(t))return;if(zg(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(bi,t),s.appendChild(e.createTextNode(o)),e.head.appendChild(s),n.add(t)}function Kg(e){let t=vi();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[o,r]of t.styles)uf(e,o,r);return()=>{let o=t.documents.get(e);if(o!==void 0){if(o<=1){t.documents.delete(e);return}t.documents.set(e,o-1)}}}function qg(e,t){let o=vi();o.styles.set(e,t);for(let r of o.documents.keys())uf(r,e,t)}typeof process>"u",qg("f4df7461e9","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");var Gg={"visually-hidden":"f37b9e2e191ebd66__visually-hidden"},wi=(0,cf.forwardRef)(function({render:t,...o},r){return ku({render:t,ref:r,props:zt({className:Gg["visually-hidden"]},o,{"data-visually-hidden":""})})});var Ln=g(Me(),1);var Ao=g(X(),1);function Xg({rating:e}){let t=Math.round(e/.5)*.5,o=Math.floor(e),r=Math.ceil(e-o),n=5-(o+r);return(0,Ao.jsxs)("span",{"aria-label":(0,Ln.sprintf)((0,Ln.__)("%s out of 5 stars"),t),children:[Array.from({length:o}).map((s,i)=>(0,Ao.jsx)(ar,{className:"block-directory-block-ratings__star-full",icon:yi,size:16},`full_stars_${i}`)),Array.from({length:r}).map((s,i)=>(0,Ao.jsx)(ar,{className:"block-directory-block-ratings__star-half-full",icon:xi,size:16},`half_stars_${i}`)),Array.from({length:n}).map((s,i)=>(0,Ao.jsx)(ar,{className:"block-directory-block-ratings__star-empty",icon:gi,size:16},`empty_stars_${i}`))]})}var pf=Xg;var Ri=g(X(),1),Jg=({rating:e})=>(0,Ri.jsx)("span",{className:"block-directory-block-ratings",children:(0,Ri.jsx)(pf,{rating:e})}),mf=Jg;var gf=g(io(),1),Ei=g(X(),1);function Zg({icon:e}){let t="block-directory-downloadable-block-icon";return e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)!==null?(0,Ei.jsx)("img",{className:t,src:e,alt:""}):(0,Ei.jsx)(gf.BlockIcon,{className:t,icon:e,showColors:!0})}var Mn=Zg;var hf=g(Me(),1),yf=g(qe(),1);var Bn=g(X(),1),Qg=({block:e})=>{let t=(0,yf.useSelect)(o=>o(pe).getErrorNoticeForBlock(e.id),[e]);return t?(0,Bn.jsx)("div",{className:"block-directory-downloadable-block-notice",children:(0,Bn.jsxs)("div",{className:"block-directory-downloadable-block-notice__content",children:[t.message,t.isFatal?" "+(0,hf.__)("Try reloading the page."):null]})}):null},xf=Qg;var ge=g(X(),1);function eh({title:e,rating:t,ratingCount:o},{hasNotice:r,isInstalled:n,isInstalling:s}){let i=Math.round(t/.5)*.5;return!n&&r?(0,xe.sprintf)((0,xe.__)("Retry installing %s."),(0,Vt.decodeEntities)(e)):n?(0,xe.sprintf)((0,xe.__)("Add %s."),(0,Vt.decodeEntities)(e)):s?(0,xe.sprintf)((0,xe.__)("Installing %s."),(0,Vt.decodeEntities)(e)):o<1?(0,xe.sprintf)((0,xe.__)("Install %s."),(0,Vt.decodeEntities)(e)):(0,xe.sprintf)((0,xe._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,Vt.decodeEntities)(e),i,o)}function th({item:e,onClick:t}){let{author:o,description:r,icon:n,rating:s,title:i}=e,a=!!(0,vf.getBlockType)(e.name),{hasNotice:l,isInstalling:c,isInstallable:u}=(0,wf.useSelect)(m=>{let{getErrorNoticeForBlock:p,isInstalling:y}=m(pe),h=p(e.id),b=h&&h.isFatal;return{hasNotice:!!h,isInstalling:y(e.id),isInstallable:!b}},[e]),d="";a?d=(0,xe.__)("Installed!"):c&&(d=(0,xe.__)("Installing\u2026"));let f=eh(e,{hasNotice:l,isInstalled:a,isInstalling:c});return(0,ge.jsxs)(ko.Root,{children:[(0,ge.jsx)(ko.Trigger,{render:(0,ge.jsxs)(Fn.Composite.Item,{className:uo("block-directory-downloadable-block-list-item",c&&"is-installing"),accessibleWhenDisabled:!0,disabled:c||!u,onClick:m=>{m.preventDefault(),t()},"aria-label":f,type:"button",role:"option",children:[(0,ge.jsxs)("div",{className:"block-directory-downloadable-block-list-item__icon",children:[(0,ge.jsx)(Mn,{icon:n,title:i}),c?(0,ge.jsx)("span",{className:"block-directory-downloadable-block-list-item__spinner",children:(0,ge.jsx)(Fn.Spinner,{})}):(0,ge.jsx)(mf,{rating:s})]}),(0,ge.jsxs)("span",{className:"block-directory-downloadable-block-list-item__details",children:[(0,ge.jsx)("span",{className:"block-directory-downloadable-block-list-item__title",children:(0,bf.createInterpolateElement)((0,xe.sprintf)((0,xe.__)("%1$s <span>by %2$s</span>"),(0,Vt.decodeEntities)(i),o),{span:(0,ge.jsx)("span",{className:"block-directory-downloadable-block-list-item__author"})})}),l?(0,ge.jsx)(xf,{block:e}):(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("span",{className:"block-directory-downloadable-block-list-item__desc",children:d||(0,Vt.decodeEntities)(r)}),u&&!(a||c)&&(0,ge.jsx)(wi,{children:(0,xe.__)("Install block")})]})]})]})}),(0,ge.jsx)(ko.Popup,{children:f})]})}var Rf=th;var Ti=g(X(),1),oh=()=>{};function rh({items:e,onHover:t=oh,onSelect:o}){let{installBlockType:r}=(0,Cf.useDispatch)(pe);return e.length?(0,Ti.jsx)(Tf.Composite,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,Ef.__)("Blocks available for install"),children:e.map(n=>(0,Ti.jsx)(Rf,{onClick:()=>{(0,Sf.getBlockType)(n.name)?o(n):r(n).then(s=>{s&&o(n)}),t(null)},onHover:t,item:n},n.id))}):null}var Pf=rh;var jt=g(Me(),1),Of=g(Ue(),1),_f=g(df(),1),nt=g(X(),1);function nh({children:e,downloadableItems:t,hasLocalBlocks:o}){let r=t.length;return(0,Of.useEffect)(()=>{(0,_f.speak)((0,jt.sprintf)((0,jt._n)("%d additional block is available to install.","%d additional blocks are available to install.",r),r))},[r]),(0,nt.jsxs)(nt.Fragment,{children:[!o&&(0,nt.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,jt.__)("No results available from your installed blocks.")}),(0,nt.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,nt.jsxs)("div",{className:"block-directory-downloadable-blocks-panel",children:[(0,nt.jsxs)("div",{className:"block-directory-downloadable-blocks-panel__header",children:[(0,nt.jsx)("h2",{className:"block-directory-downloadable-blocks-panel__title",children:(0,jt.__)("Available to install")}),(0,nt.jsx)("p",{className:"block-directory-downloadable-blocks-panel__description",children:(0,jt.__)("Select a block to install and add it to your post.")})]}),e]})]})}var kf=nh;var Vn=g(Me(),1),jn=g(Yt(),1),st=g(X(),1);function sh(){return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,st.jsx)("p",{children:(0,Vn.__)("No results found.")})}),(0,st.jsx)("div",{className:"block-editor-inserter__tips",children:(0,st.jsxs)(jn.Tip,{children:[(0,Vn.__)("Interested in creating your own block?"),(0,st.jsx)("br",{}),(0,st.jsxs)(jn.ExternalLink,{href:"https://developer.wordpress.org/block-editor/",children:[(0,Vn.__)("Get started here"),"."]})]})})]})}var Si=sh;var De=g(X(),1),Af=[],ih=e=>(0,Lf.useSelect)(t=>{let{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r,getInstalledBlockTypes:n}=t(pe),s=t(Nf.store).canUser("read","block-directory/search"),i=Af;if(s){i=o(e);let a=n(),l=i.filter(({name:c})=>{let u=a.some(f=>f.name===c),d=(0,Mf.getBlockType)(c);return u||!d});l.length!==i.length&&(i=l),i.length===0&&(i=Af)}return{hasPermission:s,downloadableBlocks:i,isLoading:r(e)}},[e]);function Bf({onSelect:e,onHover:t,hasLocalBlocks:o,isTyping:r,filterValue:n}){let{hasPermission:s,downloadableBlocks:i,isLoading:a}=ih(n);return s===void 0||a||r?(0,De.jsxs)(De.Fragment,{children:[s&&!o&&(0,De.jsxs)(De.Fragment,{children:[(0,De.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,If.__)("No results available from your installed blocks.")}),(0,De.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"})]}),(0,De.jsx)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading",children:(0,De.jsx)(Df.Spinner,{})})]}):s===!1?o?null:(0,De.jsx)(Si,{}):i.length===0?o?null:(0,De.jsx)(Si,{}):(0,De.jsx)(kf,{downloadableItems:i,hasLocalBlocks:o,children:(0,De.jsx)(Pf,{items:i,onSelect:e,onHover:t})})}var Ci=g(X(),1);function ah(){let[e,t]=(0,jf.useState)(""),o=(0,Vf.debounce)(t,400);return(0,Ci.jsx)(Ff.__unstableInserterMenuExtension,{children:({onSelect:r,onHover:n,filterValue:s,hasItems:i})=>(e!==s&&o(s),e?(0,Ci.jsx)(Bf,{onSelect:r,onHover:n,filterValue:e,hasLocalBlocks:i,isTyping:s!==e}):null)})}var Hf=ah;var ur=g(Me(),1),Uf=g(qe(),1),$f=g($n(),1);var Hn=g(Me(),1);var Ht=g(X(),1);function Wf({items:e}){return e.length?(0,Ht.jsx)("ul",{className:"block-directory-compact-list",children:e.map(({icon:t,id:o,title:r,author:n})=>(0,Ht.jsxs)("li",{className:"block-directory-compact-list__item",children:[(0,Ht.jsx)(Mn,{icon:t,title:r}),(0,Ht.jsxs)("div",{className:"block-directory-compact-list__item-details",children:[(0,Ht.jsx)("div",{className:"block-directory-compact-list__item-title",children:r}),(0,Ht.jsx)("div",{className:"block-directory-compact-list__item-author",children:(0,Hn.sprintf)((0,Hn.__)("By %s"),n)})]})]},o))}):null}var fr=g(X(),1);function Yf(){let e=(0,Uf.useSelect)(t=>t(pe).getNewBlockTypes(),[]);return e.length?(0,fr.jsxs)($f.PluginPrePublishPanel,{title:(0,ur.sprintf)((0,ur._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0,children:[(0,fr.jsx)("p",{className:"installed-blocks-pre-publish-panel__copy",children:(0,ur._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)}),(0,fr.jsx)(Wf,{items:e})]}):null}var to=g(Me(),1),Xf=g(Yt(),1),Jf=g(_t(),1),Zf=g(Ue(),1),pr=g(qe(),1),Qf=g(Jn(),1),oo=g(io(),1);var Wn=g(Me(),1),zf=g(Yt(),1),Io=g(_t(),1),dr=g(qe(),1),Kf=g(io(),1);var qf=g(X(),1);function Gf({attributes:e,block:t,clientId:o}){let r=(0,dr.useSelect)(i=>i(pe).isInstalling(t.id),[t.id]),{installBlockType:n}=(0,dr.useDispatch)(pe),{replaceBlock:s}=(0,dr.useDispatch)(Kf.store);return(0,qf.jsx)(zf.Button,{__next40pxDefaultSize:!0,onClick:()=>n(t).then(i=>{if(i){let a=(0,Io.getBlockType)(t.name),[l]=(0,Io.parse)(e.originalContent);l&&a&&s(o,(0,Io.createBlock)(a.name,l.attributes,l.innerBlocks))}}),accessibleWhenDisabled:!0,disabled:r,isBusy:r,variant:"primary",children:(0,Wn.sprintf)((0,Wn.__)("Install %s"),t.title)})}var wt=g(X(),1),lh=e=>t=>{let{originalName:o}=t.attributes,{block:r,hasPermission:n}=(0,pr.useSelect)(s=>{let{getDownloadableBlocks:i}=s(pe),a=i("block:"+o).filter(({name:l})=>o===l);return{hasPermission:s(Qf.store).canUser("read","block-directory/search"),block:a.length&&a[0]}},[o]);return!n||!r?(0,wt.jsx)(e,{...t}):(0,wt.jsx)(ch,{...t,originalBlock:r})},ch=({originalBlock:e,...t})=>{let{originalName:o,originalUndelimitedContent:r,clientId:n}=t.attributes,{replaceBlock:s}=(0,pr.useDispatch)(oo.store),i=()=>{s(t.clientId,(0,Jf.createBlock)("core/html",{},[],[r]))},a=!!r,l=(0,pr.useSelect)(d=>{let{canInsertBlockType:f,getBlockRootClientId:m}=d(oo.store);return f("core/html",m(n))},[n]),c=(0,to.sprintf)((0,to.__)("Your site doesn\u2019t include support for the %s block. You can try installing the block or remove it entirely."),e.title||o),u=[(0,wt.jsx)(Gf,{block:e,attributes:t.attributes,clientId:t.clientId},"install")];return a&&l&&(c=(0,to.sprintf)((0,to.__)("Your site doesn\u2019t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||o),u.push((0,wt.jsx)(Xf.Button,{__next40pxDefaultSize:!0,onClick:i,variant:"tertiary",children:(0,to.__)("Keep as HTML")},"convert"))),(0,wt.jsxs)("div",{...(0,oo.useBlockProps)(),children:[(0,wt.jsx)(oo.Warning,{actions:u,children:c}),(0,wt.jsx)(Zf.RawHTML,{children:r})]})},ed=lh;var Wt=g(X(),1);(0,td.registerPlugin)("block-directory",{icon:void 0,render(){return(0,Wt.jsxs)(Wt.Fragment,{children:[(0,Wt.jsx)(ra,{}),(0,Wt.jsx)(Hf,{}),(0,Wt.jsx)(Yf,{})]})}});(0,od.addFilter)("blocks.registerBlockType","block-directory/fallback",(e,t)=>(t!=="core/missing"||(e.edit=ed(e.edit)),e));return ud(uh);})();
2 3 /*! Bundled license information:
3 4
4 5 use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
5 6 (**
@@ -22,5 +23,7 @@
22 23 * This source code is licensed under the MIT license found in the
23 24 * LICENSE file in the root directory of this source tree.
24 25 *)
25 26 */
27 +(window.wp ||= {}).blockDirectory = wp.blockDirectory;
28 +})();
26 29 //# sourceMappingURL=index.min.js.map