@pg-boss/dashboard 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +393 -0
- package/bin/cli.js +21 -0
- package/build/client/assets/MenuTrigger-SThQHnlb.js +1 -0
- package/build/client/assets/_index-Bcg_-XSd.js +1 -0
- package/build/client/assets/badge-Cd8v3tl3.js +1 -0
- package/build/client/assets/button-BaXUPm8v.js +1 -0
- package/build/client/assets/chevron-down-xu6Uceu-.js +1 -0
- package/build/client/assets/chunk-JZWAC4HX-DC8i-F7r.js +26 -0
- package/build/client/assets/createLucideIcon-BXGwbdrh.js +1 -0
- package/build/client/assets/db-link-CtPnIrIr.js +1 -0
- package/build/client/assets/dialog-Bl8T588f.js +1 -0
- package/build/client/assets/entry.client-COnaNoy-.js +13 -0
- package/build/client/assets/error-card-DmoxS3Ao.js +1 -0
- package/build/client/assets/filter-select-mMC79WOR.js +1 -0
- package/build/client/assets/index-DhMkYPMa.js +1 -0
- package/build/client/assets/jobs-DtmTCs8I.js +1 -0
- package/build/client/assets/manifest-25954681.js +1 -0
- package/build/client/assets/pagination-NfhvsUbp.js +1 -0
- package/build/client/assets/queues._index-Cw1B49mg.js +1 -0
- package/build/client/assets/queues._name-D0cG_qDX.js +1 -0
- package/build/client/assets/queues._name.jobs._jobId-uJ3dfM3J.js +1 -0
- package/build/client/assets/queues.create-BGXDhJ3m.js +1 -0
- package/build/client/assets/root-DJRlbyb5.css +1 -0
- package/build/client/assets/root-NWrBrGvr.js +35 -0
- package/build/client/assets/schedules-DzgBEayh.js +1 -0
- package/build/client/assets/schedules._name._key-i42S9kw2.js +1 -0
- package/build/client/assets/schedules.new-Dt78KptL.js +1 -0
- package/build/client/assets/send-0eWgiWNl.js +1 -0
- package/build/client/assets/table-CTo0I5HG.js +1 -0
- package/build/client/assets/useOpenInteractionType-C_L8nZ_l.js +12 -0
- package/build/client/assets/warnings-BhQM6lFV.js +1 -0
- package/build/server/assets/config.server-CARiqCUE.js +54 -0
- package/build/server/assets/node-DzjK5u9i.js +176 -0
- package/build/server/assets/server-build.js +9684 -0
- package/build/server/index.js +26 -0
- package/package.json +85 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{a as f,I as sn,p as z,r as an}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{j as xe,g as cn,m as Jn,l as Ft,E as Ee,i as Zn,h as Dt,n as un,N as ln}from"./db-link-CtPnIrIr.js";import{a as Pt}from"./index-DhMkYPMa.js";const ms=500,bs=500,vs={style:{transition:"none"}},Qn="data-base-ui-click-trigger",ys={fallbackAxisSide:"none"},Es={fallbackAxisSide:"end"},er={clipPath:"inset(50%)",position:"fixed",top:0,left:0};let Ve=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const tr={[Ve.startingStyle]:""},nr={[Ve.endingStyle]:""},Ss={transitionStatus(e){return e==="starting"?tr:e==="ending"?nr:null}};let At=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ve.startingStyle]="startingStyle",e[e.endingStyle=Ve.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Vt=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const rr={[Vt.popupOpen]:"",[Vt.pressed]:""},or={[At.open]:""},sr={[At.closed]:""},ir={[At.anchorHidden]:""},Rs={open(e){return e?rr:null}},ws={open(e){return e?or:sr},anchorHidden(e){return e?ir:null}},ar="none",Wt="trigger-press",cr="trigger-hover",Ts="trigger-focus",fn="outside-press",xs="item-press",Cs="close-press",dn="focus-out",ur="escape-key",Is="list-navigation",Os="cancel-open",ks="sibling-open",Ps="imperative-action",gt=sn[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],lr=gt&>!==f.useLayoutEffect?gt:e=>e();function N(e){const t=xe(fr).current;return t.next=e,lr(t.effect),t.trampoline}function fr(){const e={next:void 0,callback:dr,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dr(){}function at(){return typeof window<"u"}function We(e){return Mt(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pr(e){var t;return(t=(Mt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mt(e){return at()?e instanceof Node||e instanceof re(e).Node:!1}function ae(e){return at()?e instanceof Element||e instanceof re(e).Element:!1}function ne(e){return at()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Tt(e){return!at()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}const hr=new Set(["inline","contents"]);function ct(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!hr.has(o)}const gr=new Set(["table","td","th"]);function As(e){return gr.has(We(e))}const mr=[":popover-open",":modal"];function br(e){return mr.some(t=>{try{return e.matches(t)}catch{return!1}})}const vr=["transform","translate","scale","rotate","perspective"],yr=["transform","translate","scale","rotate","perspective","filter"],Er=["paint","layout","strict","content"];function Sr(e){const t=pn(),n=ae(e)?ut(e):e;return vr.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||yr.some(r=>(n.willChange||"").includes(r))||Er.some(r=>(n.contain||"").includes(r))}function Ms(e){let t=Ze(e);for(;ne(t)&&!Ne(t);){if(Sr(t))return t;if(br(t))return null;t=Ze(t)}return null}function pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Rr=new Set(["html","body","#document"]);function Ne(e){return Rr.has(We(e))}function ut(e){return re(e).getComputedStyle(e)}function Ns(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ze(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tt(e)&&e.host||pr(e);return Tt(t)?t.host:t}function hn(e){const t=Ze(e);return Ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&ct(t)?t:hn(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=hn(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=re(o);if(s){const c=wr(i);return t.concat(i,i.visualViewport||[],ct(o)?o:[],c&&n?Le(c):[])}return t.concat(o,Le(o,[],n))}function wr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Tr=()=>{},B=typeof document<"u"?f.useLayoutEffect:Tr,xr=f.createContext(void 0);function Cr(e=!1){const t=f.useContext(xr);if(t===void 0&&!e)throw new Error(cn(16));return t}function Ir(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,c=r&&t===!1;return{props:f.useMemo(()=>{const a={onKeyDown(h){n&&t&&h.key!=="Tab"&&h.preventDefault()}};return r||(a.tabIndex=o,!s&&n&&(a.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(a["aria-disabled"]=n),s&&(!t||c)&&(a.disabled=n),a},[r,n,t,i,c,s,o])}}function Ls(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=f.useRef(null),i=Cr(!0)!==void 0,c=N(()=>{const d=s.current;return!!(d?.tagName==="A"&&d?.href)}),{props:l}=Ir({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:o}),a=f.useCallback(()=>{const d=s.current;Or(d)&&i&&t&&l.disabled===void 0&&d.disabled&&(d.disabled=!1)},[t,l.disabled,i]);B(a,[a]);const h=f.useCallback((d={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:O,onPointerDown:x,...S}=d;return Jn({type:o?"button":void 0,onClick(E){if(t){E.preventDefault();return}g?.(E)},onMouseDown(E){t||b?.(E)},onKeyDown(E){if(t||(Ft(E),O?.(E)),E.baseUIHandlerPrevented)return;const P=E.target===E.currentTarget&&!o&&!c()&&!t,A=E.key==="Enter",V=E.key===" ";P&&((V||A)&&E.preventDefault(),A&&g?.(E))},onKeyUp(E){t||(Ft(E),v?.(E)),!E.baseUIHandlerPrevented&&E.target===E.currentTarget&&!o&&!t&&E.key===" "&&g?.(E)},onPointerDown(E){if(t){E.preventDefault();return}x?.(E)}},o?void 0:{role:"button"},l,S)},[t,l,o,c]),p=N(d=>{s.current=d,a()});return{getButtonProps:h,buttonRef:p}}function Or(e){return ne(e)&&e.tagName==="BUTTON"}const kr={...sn};let Bt=0;function Pr(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(Bt+=1,r(`${t}-${Bt}`))},[n,t]),o}const _t=kr.useId;function Be(e,t){if(_t!==void 0){const n=_t();return e??(t?`${t}-${n}`:n)}return Pr(e,t)}function Fs(e){return Be(e,"base-ui")}function de(e,t,n,r){let o=!1,s=!1;const i=Ee;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}const Ar=[];function gn(e){f.useEffect(e,Ar)}const Ye=null;class Mr{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ue=new Mr;class ee{static create(){return new ee}static request(t){return Ue.request(t)}static cancel(t){return Ue.cancel(t)}currentId=Ye;request(t){this.cancel(),this.currentId=Ue.request(()=>{this.currentId=Ye,t()})}cancel=()=>{this.currentId!==Ye&&(Ue.cancel(this.currentId),this.currentId=Ye)};disposeEffect=()=>this.cancel}function mn(){const e=xe(ee.create).current;return gn(e.disposeEffect),e}function Nr(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,i]=f.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),B(()=>{if(!e&&s&&r!=="ending"&&n){const c=ee.request(()=>{o("ending")});return()=>{ee.cancel(c)}}},[e,s,r,n]),B(()=>{if(!e||t)return;const c=ee.request(()=>{o(void 0)});return()=>{ee.cancel(c)}},[t,e]),B(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ee.request(()=>{o("idle")});return()=>{ee.cancel(c)}},[t,e,s,o,r]),f.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}function ie(e){return e==null?e:"current"in e?e.current:e}function Lr(e,t=!1,n=!0){const r=mn();return N((o,s=null)=>{r.cancel();function i(){Pt.flushSync(o)}const c=ie(e);if(c==null)return;const l=c;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let a=function(){const p=Ve.startingStyle;if(!l.hasAttribute(p)){r.request(h);return}const d=new MutationObserver(()=>{l.hasAttribute(p)||(d.disconnect(),h())});d.observe(l,{attributes:!0,attributeFilter:[p]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0})},h=function(){Promise.all(l.getAnimations().map(p=>p.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const p=l.getAnimations();if(n){if(s?.aborted)return;i()}else p.length>0&&p.some(d=>d.pending||d.playState!=="finished")&&h()})};if(t){a();return}r.request(h)}})}function Fr(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=N(o),i=Lr(r,n,!1);f.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}const Me=0;class we{static create(){return new we}currentId=Me;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Me,n()},t)}isStarted(){return this.currentId!==Me}clear=()=>{this.currentId!==Me&&(clearTimeout(this.currentId),this.currentId=Me)};disposeEffect=()=>this.clear}function Qe(){const e=xe(we.create).current;return gn(e.disposeEffect),e}function He(e){const t=xe(Dr,e).current;return t.next=e,B(t.effect),t}function Dr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Ce=typeof navigator<"u",mt=Br(),bn=jr(),vn=_r(),Vr=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),yn=mt.platform==="MacIntel"&&mt.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(mt.platform),Wr=Ce&&/apple/i.test(navigator.vendor),xt=Ce&&/android/i.test(bn)||/android/i.test(vn),Ds=Ce&&bn.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,En=vn.includes("jsdom/");function Br(){if(!Ce)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function _r(){if(!Ce)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function jr(){if(!Ce)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Ct="data-base-ui-focusable",Sn="active",Rn="selected",$r="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Vs="ArrowLeft",Ws="ArrowRight",Bs="ArrowUp",_s="ArrowDown";function ye(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function _(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Tt(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function te(e){return"composedPath"in e?e.composedPath()[0]:e.target}function J(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function qr(e){return e.matches("html,body")}function K(e){return e?.ownerDocument||document}function Kr(e){return ne(e)&&e.matches($r)}function jt(e){return e?e.getAttribute("role")==="combobox"&&Kr(e):!1}function js(e){if(!e||En)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function It(e){return e?e.hasAttribute(Ct)?e:e.querySelector(`[${Ct}]`)||e:null}function Se(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Se(e,o.id,n)])}function $t(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Yr(e){e.preventDefault(),e.stopPropagation()}function Ur(e){return"nativeEvent"in e}function Hr(e){return e.mozInputSource===0&&e.isTrusted?!0:xt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gr(e){return En?!1:!xt&&e.width===0&&e.height===0||xt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function $s(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function zr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var Xr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],et=Xr.join(","),wn=typeof Element>"u",Te=wn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,tt=!wn&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},nt=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):nt(t.parentNode));return i},Jr=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Tn=function(t,n,r){if(nt(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(et));return n&&Te.call(t,et)&&o.unshift(t),o=o.filter(r),o},rt=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!nt(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),l=c.length?c:i.children,a=rt(l,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:i,candidates:a})}else{var h=Te.call(i,et);h&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var p=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),d=!nt(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(p&&d){var g=rt(p===!0?i.children:p.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return o},xn=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Cn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Jr(t))&&!xn(t)?0:t.tabIndex},Zr=function(t,n){var r=Cn(t);return r<0&&n&&!xn(t)?0:r},Qr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},In=function(t){return t.tagName==="INPUT"},eo=function(t){return In(t)&&t.type==="hidden"},to=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},no=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},ro=function(t){if(!t.name)return!0;var n=t.form||tt(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=no(o,t.form);return!s||s===t},oo=function(t){return In(t)&&t.type==="radio"},so=function(t){return oo(t)&&!ro(t)},io=function(t){var n,r=t&&tt(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,c,l;for(s=!!((i=o)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var a,h,p;r=tt(o),o=(a=r)===null||a===void 0?void 0:a.host,s=!!((h=o)!==null&&h!==void 0&&(p=h.ownerDocument)!==null&&p!==void 0&&p.contains(o))}}return s},qt=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ao=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Te.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(Te.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var a=t.parentElement,h=tt(t);if(a&&!a.shadowRoot&&o(a)===!0)return qt(t);t.assignedSlot?t=t.assignedSlot:!a&&h!==t.ownerDocument?t=h.host:t=a}t=l}if(io(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return qt(t);return!1},co=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Te.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ot=function(t,n){return!(n.disabled||eo(n)||ao(n,t)||to(n)||co(n))},kt=function(t,n){return!(so(n)||Cn(n)<0||!Ot(t,n))},uo=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},On=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,c=i?o.scopeParent:o,l=Zr(c,i),a=i?On(o.candidates):c;l===0?i?n.push.apply(n,a):n.push(c):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:a})}),r.sort(Qr).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},_e=function(t,n){n=n||{};var r;return n.getShadowRoot?r=rt([t],n.includeContainer,{filter:kt.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:uo}):r=Tn(t,n.includeContainer,kt.bind(null,n)),On(r)},lo=function(t,n){n=n||{};var r;return n.getShadowRoot?r=rt([t],n.includeContainer,{filter:Ot.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Tn(t,n.includeContainer,Ot.bind(null,n)),r},kn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Te.call(t,et)===!1?!1:kt(n,t)};const Ie=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Pn(e,t){const n=_e(e,Ie()),r=n.length;if(r===0)return;const o=ye(K(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function An(e){return Pn(K(e).body,1)||e}function Mn(e){return Pn(K(e).body,-1)||e}function Nn(e,t){if(!e)return null;const n=_e(K(e).body,Ie()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function qs(e){return Nn(e,1)}function Ks(e){return Nn(e,-1)}function Fe(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function fo(e){_e(e,Ie()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Kt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ln(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class po{nodesRef={current:[]};events=Ln();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Fn=f.createContext(null),Dn=f.createContext(null),lt=()=>f.useContext(Fn)?.id||null,Nt=e=>{const t=f.useContext(Dn);return e??t};function Ys(e){const t=Be(),n=Nt(e),r=lt();return B(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Us(e){const{children:t,id:n}=e,r=lt();return z.jsx(Fn.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Hs(e){const{children:t,externalTree:n}=e,r=xe(()=>n??new po).current;return z.jsx(Dn.Provider,{value:r,children:t})}function ot(e){return`data-base-ui-${e}`}const ho={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Vn={...ho,position:"fixed",top:0,left:0};function je(e){return e?.ownerDocument||document}const st=f.forwardRef(function(t,n){const[r,o]=f.useState();B(()=>{Wr&&o("button")},[]);const s={tabIndex:0,role:r};return z.jsx("span",{...t,ref:n,style:Vn,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Yt=0;function bt(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Yt);const s=()=>e?.focus({preventScroll:n});o?s():Yt=requestAnimationFrame(s)}const Re={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ut(e){return e==="inert"?Re.inert:e==="aria-hidden"?Re["aria-hidden"]:Re.none}let Ge=new WeakSet,ze={},vt=0;const Wn=e=>e&&(e.host||Wn(e.parentNode)),go=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Wn(n);return e.contains(r)?r:null}).filter(n=>n!=null);function mo(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,i=go(t,e),c=new Set,l=new Set(i),a=[];ze[o]||(ze[o]=new WeakMap);const h=ze[o];i.forEach(p),d(t),c.clear();function p(g){!g||c.has(g)||(c.add(g),g.parentNode&&p(g.parentNode))}function d(g){!g||l.has(g)||[].forEach.call(g.children,b=>{if(We(b)!=="script")if(c.has(b))d(b);else{const v=s?b.getAttribute(s):null,O=v!==null&&v!=="false",x=Ut(s),S=(x.get(b)||0)+1,R=(h.get(b)||0)+1;x.set(b,S),h.set(b,R),a.push(b),S===1&&O&&Ge.add(b),R===1&&b.setAttribute(o,""),!O&&s&&b.setAttribute(s,s==="inert"?"":"true")}})}return vt+=1,()=>{a.forEach(g=>{const b=Ut(s),O=(b.get(g)||0)-1,x=(h.get(g)||0)-1;b.set(g,O),h.set(g,x),O||(!Ge.has(g)&&s&&g.removeAttribute(s),Ge.delete(g)),x||g.removeAttribute(o)}),vt-=1,vt||(Re.inert=new WeakMap,Re["aria-hidden"]=new WeakMap,Re.none=new WeakMap,Ge=new WeakSet,ze={})}}function bo(e,t=!1,n=!1){const r=K(e[0]).body;return mo(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Bn=f.createContext(null),_n=()=>f.useContext(Bn),vo=ot("portal");function yo(e={}){const{ref:t,container:n,componentProps:r=Ee,elementProps:o,elementState:s}=e,i=Be(),l=_n()?.portalNode,[a,h]=f.useState(null),[p,d]=f.useState(null),g=N(x=>{x!==null&&d(x)}),b=f.useRef(null);B(()=>{if(n===null){b.current&&(b.current=null,d(null),h(null));return}if(i==null)return;const x=(n&&(Mt(n)?n:n.current))??l??document.body;if(x==null){b.current&&(b.current=null,d(null),h(null));return}b.current!==x&&(b.current=x,d(null),h(x))},[n,l,i]);const v=Zn("div",r,{ref:[t,g],state:s,props:[{id:i,[vo]:""},o]});return{portalNode:p,portalSubtree:a&&v?Pt.createPortal(v,a):null}}const Gs=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:c,...l}=t,{portalNode:a,portalSubtree:h}=yo({container:o,ref:n,componentProps:t,elementProps:l}),p=f.useRef(null),d=f.useRef(null),g=f.useRef(null),b=f.useRef(null),[v,O]=f.useState(null),x=v?.modal,S=v?.open,R=typeof c=="boolean"?c:!!v&&!v.modal&&v.open&&!!a;f.useEffect(()=>{if(!a||x)return;function P(A){a&&A.relatedTarget&&Fe(A)&&(A.type==="focusin"?Kt:fo)(a)}return a.addEventListener("focusin",P,!0),a.addEventListener("focusout",P,!0),()=>{a.removeEventListener("focusin",P,!0),a.removeEventListener("focusout",P,!0)}},[a,x]),f.useEffect(()=>{!a||S||Kt(a)},[S,a]);const E=f.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:d,beforeInsideRef:g,afterInsideRef:b,portalNode:a,setFocusManagerState:O}),[a]);return z.jsxs(f.Fragment,{children:[h,z.jsxs(Bn.Provider,{value:E,children:[R&&a&&z.jsx(st,{"data-type":"outside",ref:p,onFocus:P=>{if(Fe(P,a))g.current?.focus();else{const A=v?v.domReference:null;Mn(A)?.focus()}}}),R&&a&&z.jsx("span",{"aria-owns":a.id,style:er}),a&&Pt.createPortal(r,a),R&&a&&z.jsx(st,{"data-type":"outside",ref:d,onFocus:P=>{if(Fe(P,a))b.current?.focus();else{const A=v?v.domReference:null;An(A)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,de(dn,P.nativeEvent))}}})]})]})});function Eo(e,t){const n=re(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Ht=20;let ue=[];function Lt(){ue=ue.filter(e=>e.isConnected)}function So(e){Lt(),e&&We(e)!=="body"&&(ue.push(e),ue.length>Ht&&(ue=ue.slice(-Ht)))}function yt(){return Lt(),ue[ue.length-1]}function Ro(e){if(!e)return null;const t=Ie();return kn(e,t)?e:_e(e,t)[0]||e}function wo(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():ut(e).display!=="none"}function Gt(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Ie(),o=lo(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return kn(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function zs(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:h="",getInsideElements:p=()=>[],nextFocusableElement:d,previousFocusableElement:g,beforeContentFocusGuardRef:b,externalTree:v}=e,O="rootStore"in t?t.rootStore:t,x=O.useState("open"),S=O.useState("domReferenceElement"),R=O.useState("floatingElement"),{events:E,dataRef:P}=O.context,A=N(()=>P.current.floatingContext?.nodeId),V=N(p),F=s===!1,$=jt(S)&&F,Z=He(o),oe=He(s),ce=He(i),Oe=He(h),Y=Nt(v),M=_n(),se=f.useRef(null),ft=f.useRef(null),j=f.useRef(!1),Q=f.useRef(!1),pe=f.useRef(!1),$e=f.useRef(-1),he=f.useRef(""),X=f.useRef(""),ke=f.useRef(null),le=f.useRef(null),dt=Dt(ke,b,M?.beforeInsideRef),Pe=Dt(le,M?.afterInsideRef),ge=Qe(),fe=Qe(),me=mn(),be=M!=null,u=It(R),I=N((m=u)=>m?_e(m,Ie()):[]),y=N(m=>{const T=I(m);return Z.current.map(()=>T).filter(Boolean).flat()});f.useEffect(()=>{if(r||!l)return;function m(k){k.key==="Tab"&&_(u,ye(K(u)))&&I().length===0&&!$&&Yr(k)}const T=K(u);return T.addEventListener("keydown",m),()=>{T.removeEventListener("keydown",m)}},[r,S,u,l,Z,$,I,y]),f.useEffect(()=>{if(r||!R)return;function m(T){const k=te(T),D=I().indexOf(k);D!==-1&&($e.current=D)}return R.addEventListener("focusin",m),()=>{R.removeEventListener("focusin",m)}},[r,R,I]),f.useEffect(()=>{if(r||!x)return;const m=K(u);function T(){pe.current=!1}function k(D){const C=te(D),w=_(R,C)||_(S,C)||_(M?.portalNode,C);pe.current=!w,X.current=D.pointerType||"keyboard"}function L(){X.current="keyboard"}return m.addEventListener("pointerdown",k,!0),m.addEventListener("pointerup",T,!0),m.addEventListener("pointercancel",T,!0),m.addEventListener("keydown",L,!0),()=>{m.removeEventListener("pointerdown",k,!0),m.removeEventListener("pointerup",T,!0),m.removeEventListener("pointercancel",T,!0),m.removeEventListener("keydown",L,!0)}},[r,R,S,u,x,M]),f.useEffect(()=>{if(r||!a)return;function m(){Q.current=!0,fe.start(0,()=>{Q.current=!1})}function T(C){const w=C.relatedTarget,H=C.currentTarget,U=te(C);queueMicrotask(()=>{const ve=A(),qe=O.context.triggerElements,pt=w?.hasAttribute(ot("focus-guard"))&&[ke.current,le.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ie(g),ie(d)].includes(w),ht=!(_(S,w)||_(R,w)||_(w,R)||_(M?.portalNode,w)||w!=null&&qe.hasElement(w)||qe.hasMatchingElement(G=>_(G,w))||pt||Y&&(Se(Y.nodesRef.current,ve).find(G=>_(G.context?.elements.floating,w)||_(G.context?.elements.domReference,w))||$t(Y.nodesRef.current,ve).find(G=>[G.context?.elements.floating,It(G.context?.elements.floating)].includes(w)||G.context?.elements.domReference===w)));if(H===S&&u&&Gt(u,Z),c&&H!==S&&!wo(U)&&ye(K(u))===K(u).body){if(ne(u)&&(u.focus(),c==="popup")){me.request(()=>{u.focus()});return}const G=$e.current,Ae=I(),Ke=Ae[G]||Ae[Ae.length-1]||u;ne(Ke)&&Ke.focus()}if(P.current.insideReactTree){P.current.insideReactTree=!1;return}($||!l)&&w&&ht&&!Q.current&&($||w!==yt())&&(j.current=!0,O.setOpen(!1,de(dn,C)))})}function k(){pe.current||(P.current.insideReactTree=!0,ge.start(0,()=>{P.current.insideReactTree=!1}))}const L=ne(S)?S:null,D=[];if(!(!R&&!L))return L&&(L.addEventListener("focusout",T),L.addEventListener("pointerdown",m),D.push(()=>{L.removeEventListener("focusout",T),L.removeEventListener("pointerdown",m)})),R&&(R.addEventListener("focusout",T),M&&(R.addEventListener("focusout",k,!0),D.push(()=>{R.removeEventListener("focusout",k,!0)})),D.push(()=>{R.removeEventListener("focusout",T)})),()=>{D.forEach(C=>{C()})}},[r,S,R,u,l,Y,M,O,a,c,I,$,A,Z,P,ge,fe,me,d,g]),f.useEffect(()=>{if(r||!R||!x)return;const m=Array.from(M?.portalNode?.querySelectorAll(`[${ot("portal")}]`)||[]),k=(Y?$t(Y.nodesRef.current,A()):[]).find(C=>jt(C.context?.elements.domReference||null))?.context?.elements.domReference,L=[R,k,...m,...V(),se.current,ft.current,ke.current,le.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,ie(g),ie(d),$?S:null].filter(C=>C!=null),D=bo(L,l||$);return()=>{D()}},[x,r,S,R,l,Z,M,$,Y,A,V,d,g]),B(()=>{if(!x||r||!ne(u))return;const m=K(u),T=ye(m);queueMicrotask(()=>{const k=y(u),L=oe.current,D=typeof L=="function"?L(Oe.current||""):L;if(D===void 0||D===!1)return;let C;D===!0||D===null?C=k[0]||u:C=ie(D),C=C||k[0]||u,!_(u,T)&&bt(C,{preventScroll:C===u})})},[r,x,u,F,y,oe,Oe]),B(()=>{if(r||!u)return;const m=K(u),T=ye(m);So(T);function k(C){if(C.open||(he.current=Eo(C.nativeEvent,X.current)),C.reason===cr&&C.nativeEvent.type==="mouseleave"&&(j.current=!0),C.reason===fn)if(C.nested)j.current=!1;else if(Hr(C.nativeEvent)||Gr(C.nativeEvent))j.current=!1;else{let w=!1;document.createElement("div").focus({get preventScroll(){return w=!0,!1}}),w?j.current=!1:j.current=!0}}E.on("openchange",k);const L=m.createElement("span");L.setAttribute("tabindex","-1"),L.setAttribute("aria-hidden","true"),Object.assign(L.style,Vn),be&&S&&S.insertAdjacentElement("afterend",L);function D(){const C=ce.current;let w=typeof C=="function"?C(he.current):C;if(w===void 0||w===!1)return null;if(w===null&&(w=!0),typeof w=="boolean"){const U=S||yt();return U&&U.isConnected?U:L}const H=S||yt()||L;return ie(w)||H}return()=>{E.off("openchange",k);const C=ye(m),w=_(R,C)||Y&&Se(Y.nodesRef.current,A(),!1).some(U=>_(U.context?.elements.floating,C)),H=D();queueMicrotask(()=>{const U=Ro(H),ve=typeof ce.current!="boolean";ce.current&&!j.current&&ne(U)&&(!(!ve&&U!==C&&C!==m.body)||w)&&U.focus({preventScroll:!0}),L.remove()})}},[r,R,u,ce,P,E,Y,be,S,A]),f.useEffect(()=>{queueMicrotask(()=>{j.current=!1})},[r]),f.useEffect(()=>{if(r||!x)return;function m(k){te(k)?.closest(`[${Qn}]`)&&(Q.current=!0)}const T=K(u);return T.addEventListener("pointerdown",m,!0),()=>{T.removeEventListener("pointerdown",m,!0)}},[r,x,u]),B(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:a,open:x,onOpenChange:O.setOpen,domReference:S}),()=>{M.setFocusManagerState(null)}},[r,M,l,x,O,a,S]),B(()=>{if(!(r||!u))return Gt(u,Z),()=>{queueMicrotask(Lt)}},[r,u,Z]);const q=!r&&(l?!$:!0)&&(be||l);return z.jsxs(f.Fragment,{children:[q&&z.jsx(st,{"data-type":"inside",ref:dt,onFocus:m=>{if(l){const T=y();bt(T[T.length-1])}else M?.portalNode&&(j.current=!1,Fe(m,M.portalNode)?An(S)?.focus():ie(g??M.beforeOutsideRef)?.focus())}}),n,q&&z.jsx(st,{"data-type":"inside",ref:Pe,onFocus:m=>{l?bt(y()[0]):M?.portalNode&&(a&&(j.current=!0),Fe(m,M.portalNode)?Mn(S)?.focus():ie(d??M.afterOutsideRef)?.focus())}})]})}const To={intentional:"onClick",sloppy:"onPointerDown"};function xo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Xs(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:l}=n.context,{enabled:a=!0,escapeKey:h=!0,outsidePress:p=!0,outsidePressEvent:d="sloppy",referencePress:g=!1,referencePressEvent:b="sloppy",ancestorScroll:v=!1,bubbles:O,externalTree:x}=t,S=Nt(x),R=N(typeof p=="function"?p:()=>!1),E=typeof p=="function"?R:p,P=f.useRef(!1),{escapeKey:A,outsidePress:V}=xo(O),F=f.useRef(null),$=Qe(),Z=Qe(),oe=N(()=>{Z.clear(),l.current.insideReactTree=!1}),ce=f.useRef(!1),Oe=f.useRef(""),Y=N(u=>{Oe.current=u.pointerType}),M=N(()=>{const u=Oe.current,I=u==="pen"||!u?"mouse":u,y=typeof d=="function"?d():d;return typeof y=="string"?y:y[I]}),se=N(u=>{if(!r||!a||!h||u.key!=="Escape"||ce.current)return;const I=l.current.floatingContext?.nodeId,y=S?Se(S.nodesRef.current,I):[];if(!A&&y.length>0){let T=!0;if(y.forEach(k=>{k.context?.open&&!k.context.dataRef.current.__escapeKeyBubbles&&(T=!1)}),!T)return}const q=Ur(u)?u.nativeEvent:u,m=de(ur,q);n.setOpen(!1,m),!A&&!m.isPropagationAllowed&&u.stopPropagation()}),ft=N(u=>{const I=M();return I==="intentional"&&u.type!=="click"||I==="sloppy"&&u.type==="click"}),j=N(()=>{l.current.insideReactTree=!0,Z.start(0,oe)}),Q=N((u,I=!1)=>{if(ft(u)){oe();return}if(l.current.insideReactTree){oe();return}if(M()==="intentional"&&I||typeof E=="function"&&!E(u))return;const y=te(u),q=`[${ot("inert")}]`,m=K(n.select("floatingElement")).querySelectorAll(q),T=n.context.triggerElements;if(y&&(T.hasElement(y)||T.hasMatchingElement(w=>_(w,y))))return;let k=ae(y)?y:null;for(;k&&!Ne(k);){const w=Ze(k);if(Ne(w)||!ae(w))break;k=w}if(m.length&&ae(y)&&!qr(y)&&!_(y,n.select("floatingElement"))&&Array.from(m).every(w=>!_(k,w)))return;if(ne(y)&&!("touches"in u)){const w=Ne(y),H=ut(y),U=/auto|scroll/,ve=w||U.test(H.overflowX),qe=w||U.test(H.overflowY),pt=ve&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,ht=qe&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,G=H.direction==="rtl",Ae=ht&&(G?u.offsetX<=y.offsetWidth-y.clientWidth:u.offsetX>y.clientWidth),Ke=pt&&u.offsetY>y.clientHeight;if(Ae||Ke)return}const L=l.current.floatingContext?.nodeId,D=S&&Se(S.nodesRef.current,L).some(w=>J(u,w.context?.elements.floating));if(J(u,n.select("floatingElement"))||J(u,n.select("domReferenceElement"))||D)return;const C=S?Se(S.nodesRef.current,L):[];if(C.length>0){let w=!0;if(C.forEach(H=>{H.context?.open&&!H.context.dataRef.current.__outsidePressBubbles&&(w=!1)}),!w)return}n.setOpen(!1,de(fn,u)),oe()}),pe=N(u=>{M()!=="sloppy"||u.pointerType==="touch"||!n.select("open")||!a||J(u,n.select("floatingElement"))||J(u,n.select("domReferenceElement"))||Q(u)}),$e=N(u=>{if(M()!=="sloppy"||!n.select("open")||!a||J(u,n.select("floatingElement"))||J(u,n.select("domReferenceElement")))return;const I=u.touches[0];I&&(F.current={startTime:Date.now(),startX:I.clientX,startY:I.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}),he=N(u=>{const I=te(u);function y(){$e(u),I?.removeEventListener(u.type,y)}I?.addEventListener(u.type,y)}),X=N(u=>{const I=P.current;if(P.current=!1,$.clear(),u.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)return;const y=te(u);function q(){u.type==="pointerdown"?pe(u):Q(u,I),y?.removeEventListener(u.type,q)}y?.addEventListener(u.type,q)}),ke=N(u=>{if(M()!=="sloppy"||!F.current||J(u,n.select("floatingElement"))||J(u,n.select("domReferenceElement")))return;const I=u.touches[0];if(!I)return;const y=Math.abs(I.clientX-F.current.startX),q=Math.abs(I.clientY-F.current.startY),m=Math.sqrt(y*y+q*q);m>5&&(F.current.dismissOnTouchEnd=!0),m>10&&(Q(u),$.clear(),F.current=null)}),le=N(u=>{const I=te(u);function y(){ke(u),I?.removeEventListener(u.type,y)}I?.addEventListener(u.type,y)}),dt=N(u=>{M()!=="sloppy"||!F.current||J(u,n.select("floatingElement"))||J(u,n.select("domReferenceElement"))||(F.current.dismissOnTouchEnd&&Q(u),$.clear(),F.current=null)}),Pe=N(u=>{const I=te(u);function y(){dt(u),I?.removeEventListener(u.type,y)}I?.addEventListener(u.type,y)});f.useEffect(()=>{if(!r||!a)return;l.current.__escapeKeyBubbles=A,l.current.__outsidePressBubbles=V;const u=new we;function I(k){n.setOpen(!1,de(ar,k))}function y(){u.clear(),ce.current=!0}function q(){u.start(pn()?5:0,()=>{ce.current=!1})}const m=K(o);m.addEventListener("pointerdown",Y,!0),h&&(m.addEventListener("keydown",se),m.addEventListener("compositionstart",y),m.addEventListener("compositionend",q)),E&&(m.addEventListener("click",X,!0),m.addEventListener("pointerdown",X,!0),m.addEventListener("touchstart",he,!0),m.addEventListener("touchmove",le,!0),m.addEventListener("touchend",Pe,!0),m.addEventListener("mousedown",X,!0));let T=[];return v&&(ae(i)&&(T=Le(i)),ae(o)&&(T=T.concat(Le(o))),!ae(s)&&s&&s.contextElement&&(T=T.concat(Le(s.contextElement)))),T=T.filter(k=>k!==m.defaultView?.visualViewport),T.forEach(k=>{k.addEventListener("scroll",I,{passive:!0})}),()=>{m.removeEventListener("pointerdown",Y,!0),h&&(m.removeEventListener("keydown",se),m.removeEventListener("compositionstart",y),m.removeEventListener("compositionend",q)),E&&(m.removeEventListener("click",X,!0),m.removeEventListener("pointerdown",X,!0),m.removeEventListener("touchstart",he,!0),m.removeEventListener("touchmove",le,!0),m.removeEventListener("touchend",Pe,!0),m.removeEventListener("mousedown",X,!0)),T.forEach(k=>{k.removeEventListener("scroll",I)}),u.clear(),P.current=!1}},[l,o,s,i,h,E,r,c,v,a,A,V,se,Q,X,pe,he,le,Pe,Y,n]),f.useEffect(oe,[E,oe]);const ge=f.useMemo(()=>({onKeyDown:se,...g&&{[To[b]]:u=>{n.setOpen(!1,de(Wt,u.nativeEvent))},...b!=="intentional"&&{onClick(u){n.setOpen(!1,de(Wt,u.nativeEvent))}}}}),[se,n,g,b]),fe=N(u=>{const I=te(u.nativeEvent);!_(n.select("floatingElement"),I)||u.button!==0||(P.current=!0)}),me=N(u=>{!r||!a||u.button!==0||(P.current=!0)}),be=f.useMemo(()=>({onKeyDown:se,onPointerDown:fe,onMouseDown:fe,onMouseUp:fe,onClickCapture:j,onMouseDownCapture(u){j(),me(u)},onPointerDownCapture(u){j(),me(u)},onMouseUpCapture:j,onTouchEndCapture:j,onTouchMoveCapture:j}),[se,fe,j,me]);return f.useMemo(()=>a?{reference:ge,floating:be,trigger:ge}:{},[a,ge,be])}var it=Symbol("NOT_FOUND");function Co(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Io(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Oo(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var zt=e=>Array.isArray(e)?e:[e];function ko(e){const t=Array.isArray(e[0])?e[0]:e;return Oo(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Po(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function Ao(e){let t;return{get(n){return t&&e(t.key,n)?t.value:it},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Mo(e,t){let n=[];function r(c){const l=n.findIndex(a=>t(c,a.key));if(l>-1){const a=n[l];return l>0&&(n.splice(l,1),n.unshift(a)),a.value}return it}function o(c,l){r(c)===it&&(n.unshift({key:c,value:l}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var No=(e,t)=>e===t;function Lo(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function Fo(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=No,maxSize:o=1,resultEqualityCheck:s}=n,i=Lo(r);let c=0;const l=o<=1?Ao(i):Mo(o,i);function a(){let h=l.get(arguments);if(h===it){if(h=e.apply(null,arguments),c++,s){const d=l.getEntries().find(g=>s(g.value,h));d&&(h=d.value,c!==0&&c--)}l.put(arguments,h)}return h}return a.clearCache=()=>{l.clear(),a.resetResultsCount()},a.resultsCount=()=>c,a.resetResultsCount=()=>{c=0},a}var Do=class{constructor(e){this.value=e}deref(){return this.value}},Vo=typeof WeakRef<"u"?WeakRef:Do,Wo=0,Xt=1;function Xe(){return{s:Wo,v:void 0,o:null,p:null}}function jn(e,t={}){let n=Xe();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let c=n;const{length:l}=arguments;for(let p=0,d=l;p<d;p++){const g=arguments[p];if(typeof g=="function"||typeof g=="object"&&g!==null){let b=c.o;b===null&&(c.o=b=new WeakMap);const v=b.get(g);v===void 0?(c=Xe(),b.set(g,c)):c=v}else{let b=c.p;b===null&&(c.p=b=new Map);const v=b.get(g);v===void 0?(c=Xe(),b.set(g,c)):c=v}}const a=c;let h;if(c.s===Xt)h=c.v;else if(h=e.apply(null,arguments),s++,r){const p=o?.deref?.()??o;p!=null&&r(p,h)&&(h=p,s!==0&&s--),o=typeof h=="object"&&h!==null||typeof h=="function"?new Vo(h):h}return a.s=Xt,a.v=h,h}return i.clearCache=()=>{n=Xe(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function $n(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,c,l={},a=o.pop();typeof a=="object"&&(l=a,a=o.pop()),Co(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const h={...n,...l},{memoize:p,memoizeOptions:d=[],argsMemoize:g=jn,argsMemoizeOptions:b=[]}=h,v=zt(d),O=zt(b),x=ko(o),S=p(function(){return s++,a.apply(null,arguments)},...v),R=g(function(){i++;const P=Po(x,arguments);return c=S.apply(null,P),c},...O);return Object.assign(R,{resultFunc:a,memoizedResultFunc:S,dependencies:x,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>c,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:p,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var Bo=$n(jn),_o=Object.assign((e,t=Bo)=>{Io(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,c,l)=>(i[n[l]]=c,i),{}))},{withTypes:()=>_o});$n({memoize:Fo,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const W=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(cn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var Et={exports:{}},St={};var Jt;function jo(){if(Jt)return St;Jt=1;var e=an();function t(p,d){return p===d&&(p!==0||1/p===1/d)||p!==p&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function c(p,d){var g=d(),b=r({inst:{value:g,getSnapshot:d}}),v=b[0].inst,O=b[1];return s(function(){v.value=g,v.getSnapshot=d,l(v)&&O({inst:v})},[p,g,d]),o(function(){return l(v)&&O({inst:v}),p(function(){l(v)&&O({inst:v})})},[p]),i(g),g}function l(p){var d=p.getSnapshot;p=p.value;try{var g=d();return!n(p,g)}catch{return!0}}function a(p,d){return d()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:c;return St.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,St}var Zt;function qn(){return Zt||(Zt=1,Et.exports=jo()),Et.exports}var $o=qn(),Rt={exports:{}},wt={};var Qt;function qo(){if(Qt)return wt;Qt=1;var e=an(),t=qn();function n(a,h){return a===h&&(a!==0||1/a===1/h)||a!==a&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,c=e.useMemo,l=e.useDebugValue;return wt.useSyncExternalStoreWithSelector=function(a,h,p,d,g){var b=s(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=c(function(){function x(A){if(!S){if(S=!0,R=A,A=d(A),g!==void 0&&v.hasValue){var V=v.value;if(g(V,A))return E=V}return E=A}if(V=E,r(R,A))return V;var F=d(A);return g!==void 0&&g(V,F)?(R=A,V):(R=A,E=F)}var S=!1,R,E,P=p===void 0?null:p;return[function(){return x(h())},P===null?void 0:function(){return x(P())}]},[h,p,d,g]);var O=o(a,b[0],b[1]);return i(function(){v.hasValue=!0,v.value=O},[O]),l(O),O},wt}var en;function Ko(){return en||(en=1,Rt.exports=qo()),Rt.exports}var Yo=Ko();const Uo=un(19),Ho=Uo?zo:Xo;function Go(e,t,n,r,o){return Ho(e,t,n,r,o)}function zo(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return $o.useSyncExternalStore(e.subscribe,s,s)}function Xo(e,t,n,r,o){return Yo.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class De{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;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){De.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||De.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};De.prototype.setState.call(this,t)}}class Jo extends De{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}controlledValues=new Map;useSyncedValue(t,n){f.useDebugValue(t),B(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;B(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);B(()=>{n.update(t)},[n,...r])}useControlledProp(t,n,r){f.useDebugValue(t);const o=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),B(()=>{s&&!Object.is(o.state[t],n)&&super.setState({...o.state,[t]:n})},[o,t,n,r,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.update(n)}setState(t){const n={...t};for(const r in n)if(Object.hasOwn(n,r)&&this.controlledValues.get(r)===!0){delete n[r];continue}super.setState({...this.state,...n})}select=(t,n,r,o)=>{const s=this.selectors[t];return s(this.state,n,r,o)};useState=(t,n,r,o)=>{f.useDebugValue(t);const s=this.selectors[t];return Go(this,s,n,r,o)};useContextCallback(t,n){f.useDebugValue(t);const r=N(n??ln);this.context[t]=r}useStateSetter(t){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const c=o;o=i,n(i,c,this)}})}}const Zo={open:W(e=>e.open),domReferenceElement:W(e=>e.domReferenceElement),referenceElement:W(e=>e.positionReference??e.referenceElement),floatingElement:W(e=>e.floatingElement),floatingId:W(e=>e.floatingId)};class Kn extends Jo{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Ln(),nested:n,noEmit:r,triggerElements:s},Zo)}setOpen=(t,n)=>{if((!t||!this.state.open||zr(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Qo(e,t){const n=f.useRef(null),r=f.useRef(null);return f.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,c=t.context.triggerElements.getById(s);i&&c===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function Js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Qo(e,n),i=N(c=>{if(s(c),!c||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:c,...r});return}l==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return B(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function Zs(e){const t=e.useState("open");B(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Qs(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=N(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),c=t.useState("preventUnmountingOnClose");return Fr({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class es{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elements.delete(r),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function ts(){return new Kn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new es,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function ei(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:ts(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:Ee,inactiveTriggerProps:Ee,popupProps:Ee}}const ti={open:W(e=>e.open),mounted:W(e=>e.mounted),transitionStatus:W(e=>e.transitionStatus),floatingRootContext:W(e=>e.floatingRootContext),preventUnmountingOnClose:W(e=>e.preventUnmountingOnClose),payload:W(e=>e.payload),activeTriggerId:W(e=>e.activeTriggerId),activeTriggerElement:W(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:W((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:W((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:W((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:W((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:W(e=>e.popupProps),popupElement:W(e=>e.popupElement),positionerElement:W(e=>e.positionerElement)};function ni(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=Be(),i=lt()!=null,c=t.useState("open"),l=t.useState("activeTriggerElement"),a=t.useState(r?"popupElement":"positionerElement"),h=t.context.triggerElements,p=xe(()=>new Kn({open:c,referenceElement:l,floatingElement:a,triggerElements:h,onOpenChange:o,floatingId:s,nested:i,noEmit:n})).current;return B(()=>{const d={open:c,floatingId:s,referenceElement:l,floatingElement:a};ae(l)&&(d.domReferenceElement=l),p.state.positionReference===p.state.referenceElement&&(d.positionReference=l),p.update(d)},[c,s,l,a,p]),p.context.onOpenChange=o,p.context.nested=i,p.context.noEmit=n,p}function ri(e=[]){const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=e.map(a=>a?.trigger),s=f.useCallback(a=>Je(a,e,"reference"),t),i=f.useCallback(a=>Je(a,e,"floating"),n),c=f.useCallback(a=>Je(a,e,"item"),r),l=f.useCallback(a=>Je(a,e,"trigger"),o);return f.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:l}),[s,i,c,l])}function Je(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Ct]="");for(const i in e)o&&e&&(i===Sn||i===Rn)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const l=t[i]?.[n];typeof l=="function"?c=e?l(e):null:c=l,c&&tn(s,c,o,r)}return tn(s,e,o,r),s}function tn(e,t,n,r){for(const o in t){const s=t[o];n&&(o===Sn||o===Rn)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(c=>c(...i)).find(c=>c!==void 0))):e[o]=s)}}const ns=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function oi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:c=!0,role:l="dialog"}=t,a=Be(),h=s?.id||a,p=f.useMemo(()=>It(i)?.id||o,[i,o]),d=ns.get(l)??l,b=lt()!=null,v=f.useMemo(()=>d==="tooltip"||l==="label"?Ee:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&b&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,b,l]),O=f.useMemo(()=>d==="tooltip"||l==="label"?{[`aria-${l==="label"?"labelledby":"describedby"}`]:r?p:void 0}:{...v,"aria-expanded":r?"true":"false","aria-controls":r?p:void 0,...d==="menu"&&{id:h}},[d,p,r,h,l,v]),x=f.useMemo(()=>{const R={id:p,...d&&{role:d}};return d==="tooltip"||l==="label"?R:{...R,...d==="menu"&&{"aria-labelledby":h}}},[d,p,h,l]),S=f.useCallback(({active:R,selected:E})=>{const P={role:"option",...R&&{id:`${p}-fui-option`}};switch(l){case"select":case"combobox":return{...P,"aria-selected":E}}return{}},[p,l]);return f.useMemo(()=>c?{reference:O,floating:x,item:S,trigger:v}:{},[c,O,x,v,S])}const Yn="ArrowUp",Un="ArrowDown",Hn="ArrowLeft",Gn="ArrowRight",zn="Home",Xn="End",rs=new Set([Hn,Gn]),os=new Set([Yn,Un]),ss=new Set([...rs,...os]);[...ss];const si=new Set([Yn,Un,Hn,Gn,zn,Xn]);function ii(e){return un(19)?e:e?"true":void 0}const ai=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r?.getBoundingClientRect();s=`polygon(
|
|
2
|
+
0% 0%,
|
|
3
|
+
100% 0%,
|
|
4
|
+
100% 100%,
|
|
5
|
+
0% 100%,
|
|
6
|
+
0% 0%,
|
|
7
|
+
${i.left}px ${i.top}px,
|
|
8
|
+
${i.left}px ${i.bottom}px,
|
|
9
|
+
${i.right}px ${i.bottom}px,
|
|
10
|
+
${i.right}px ${i.top}px,
|
|
11
|
+
${i.left}px ${i.top}px
|
|
12
|
+
)`}return z.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let nn={},rn={},on="";function is(e){if(typeof document>"u")return!1;const t=je(e);return re(t).innerWidth-t.documentElement.clientWidth>0}function as(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=je(e).documentElement,o={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY};r.style.scrollbarGutter="stable",r.style.overflowY="scroll";const s=r.offsetWidth;r.style.overflowY="hidden";const i=r.offsetWidth;return Object.assign(r.style,o),s===i}function cs(e){const t=je(e),n=t.documentElement,r=t.body,o=ct(n)?n:r,s=o.style.overflow;return o.style.overflow="hidden",()=>{o.style.overflow=s}}function us(e){const t=je(e),n=t.documentElement,r=t.body,o=re(n);let s=0,i=0,c=!1;const l=ee.create();if(Vr&&(o.visualViewport?.scale??1)!==1)return()=>{};function a(){const d=o.getComputedStyle(n),g=o.getComputedStyle(r),O=(d.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,nn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},on=n.style.scrollBehavior,rn={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,R=d.overflowY==="scroll"||g.overflowY==="scroll",E=d.overflowX==="scroll"||g.overflowX==="scroll",P=Math.max(0,o.innerWidth-r.clientWidth),A=Math.max(0,o.innerHeight-r.clientHeight),V=parseFloat(g.marginTop)+parseFloat(g.marginBottom),F=parseFloat(g.marginLeft)+parseFloat(g.marginRight),$=ct(n)?n:r;if(c=as(e),c){n.style.scrollbarGutter=O,$.style.overflowY="hidden",$.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:O,overflowY:"hidden",overflowX:"hidden"}),(x||R)&&(n.style.overflowY="scroll"),(S||E)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:V||A?`calc(100dvh - ${V+A}px)`:"100dvh",width:F||P?`calc(100vw - ${F+P}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,nn),Object.assign(r.style,rn),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=on)}function p(){h(),l.request(a)}return a(),o.addEventListener("resize",p),()=>{l.cancel(),h(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",p)}}class ls{lockCount=0;restore=null;timeoutLock=we.create();timeoutUnlock=we.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=je(t).documentElement,o=re(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=ln;return}const s=yn||!is(t);this.restore=s?cs(t):us(t)}}const fs=new ls;function ci(e=!0,t=null){B(()=>{if(e)return fs.acquire(t)},[e,t])}function ds(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function ui(e){const[t,n]=f.useState(null),r=N((c,l)=>{e||n(l||(yn?"touch":""))}),o=f.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=ds(r);return f.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:s,onPointerDown:i}}),[t,o,s,i])}export{jt as $,Bs as A,As as B,Sr as C,Ms as D,We as E,ct as F,Ns as G,Be as H,lt as I,Kn as J,Nt as K,ot as L,ye as M,_ as N,Ts as O,es as P,te as Q,js as R,K as S,Ds as T,Wr as U,ur as V,$r as W,N as X,cr as Y,He as Z,It as _,B as a,bt as a0,Is as a1,dn as a2,Hr as a3,Gr as a4,we as a5,Se as a6,vs as a7,Fr as a8,fn as a9,ri as aA,Hs as aB,ms as aC,Cr as aD,Js as aE,Os as aF,Ks as aG,Fe as aH,qs as aI,An as aJ,Rs as aK,st as aL,bs as aM,Cs as aN,At as aO,zs as aa,ws as ab,Ss as ac,si as ad,Gs as ae,je as af,ys as ag,Es as ah,ai,ii as aj,Us as ak,ks as al,Jo as am,ti as an,W as ao,po as ap,ei as aq,Ys as ar,ui as as,Zs as at,Qs as au,ci as av,Ps as aw,ni as ax,Xs as ay,oi as az,Fs as b,_s as c,Vs as d,Ws as e,$s as f,mn as g,Qe as h,xs as i,zr as j,de as k,Kr as l,Le as m,ae as n,pr as o,re as p,wr as q,ut as r,Yr as s,Wt as t,Ls as u,ne as v,pn as w,br as x,Ze as y,Ne as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as f,B as N,t as P,p as a}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{C as u,a as T,b,c as w}from"./button-BaXUPm8v.js";import{B as C}from"./badge-Cd8v3tl3.js";import{T as S,a as E,b as l,c as o,d as W,e as r}from"./table-CTo0I5HG.js";import{P as B}from"./pagination-NfhvsUbp.js";import{F as R}from"./filter-select-mMC79WOR.js";import{E as k}from"./error-card-DmoxS3Ao.js";import{o as A,p as _,q as D,W as F,b as I}from"./db-link-CtPnIrIr.js";const M=N(function(){return a.jsx(k,{title:"Failed to load warnings",backTo:{href:"/",label:"Back to Dashboard"}})}),V=f(function({loaderData:p}){const{warnings:d,totalCount:x,page:i,totalPages:m,typeFilter:c}=p,[h,g]=P(),j=(e,s)=>{const n=new URLSearchParams(h);s?n.set(e,s):n.delete(e),n.delete("page"),g(n)},y=e=>{const s=new URLSearchParams(h);s.set("page",e.toString()),g(s)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Warnings"}),a.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[x.toLocaleString()," warning",x!==1?"s":""," recorded"]})]}),a.jsxs(u,{children:[a.jsxs(T,{className:"flex flex-row items-center justify-between",children:[a.jsx(b,{children:"Warning History"}),a.jsx(R,{value:c,options:A,onChange:e=>j("type",e)})]}),a.jsx(w,{className:"p-0",children:a.jsxs(S,{children:[a.jsx(E,{children:a.jsxs(l,{children:[a.jsx(o,{children:"Type"}),a.jsx(o,{children:"Message"}),a.jsx(o,{children:"Details"}),a.jsx(o,{children:"Time"})]})}),a.jsx(W,{children:d.length===0?a.jsx(l,{children:a.jsx(r,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:4,children:c?`No ${c.replace("_"," ")} warnings found`:"No warnings recorded. Enable persistWarnings in pg-boss config to capture warnings."})}):d.map(e=>a.jsxs(l,{children:[a.jsx(r,{children:a.jsx(L,{type:e.type})}),a.jsx(r,{className:"text-gray-900 dark:text-gray-100 max-w-md truncate",children:e.message}),a.jsx(r,{className:"font-mono text-xs text-gray-500 dark:text-gray-400 max-w-xs truncate",children:_(e.data)}),a.jsx(r,{className:"text-gray-500 dark:text-gray-400 whitespace-nowrap",children:D(new Date(e.createdOn))})]},e.id))})]})}),a.jsx(B,{page:i,totalPages:m,hasNextPage:i<m,hasPrevPage:i>1,onPageChange:y})]})]})});function L({type:t}){return a.jsx(C,{variant:I[t],size:"sm",children:F[t]})}export{M as ErrorBoundary,V as default};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const SEPARATOR = "|";
|
|
2
|
+
const DEFAULT_SCHEMA = "pgboss";
|
|
3
|
+
function parseDatabaseConfig() {
|
|
4
|
+
const dbUrlEnv = process.env.DATABASE_URL || "postgres://localhost/pgboss";
|
|
5
|
+
const schemaEnv = process.env.PGBOSS_SCHEMA || DEFAULT_SCHEMA;
|
|
6
|
+
const urlParts = dbUrlEnv.split(SEPARATOR).map((s) => s.trim()).filter(Boolean);
|
|
7
|
+
const schemaParts = schemaEnv.split(SEPARATOR).map((s) => s.trim()).filter(Boolean);
|
|
8
|
+
return urlParts.map((part, index) => {
|
|
9
|
+
const equalsIndex = part.indexOf("=");
|
|
10
|
+
let name;
|
|
11
|
+
let url;
|
|
12
|
+
const protocolIndex = part.indexOf("://");
|
|
13
|
+
if (equalsIndex > 0 && (protocolIndex === -1 || equalsIndex < protocolIndex)) {
|
|
14
|
+
name = part.substring(0, equalsIndex).trim();
|
|
15
|
+
url = part.substring(equalsIndex + 1).trim();
|
|
16
|
+
} else {
|
|
17
|
+
url = part;
|
|
18
|
+
name = extractDatabaseName(url) || `Database ${index + 1}`;
|
|
19
|
+
}
|
|
20
|
+
const schema = schemaParts[index] || DEFAULT_SCHEMA;
|
|
21
|
+
const id = generateId(name, index);
|
|
22
|
+
return { id, name, url, schema };
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function extractDatabaseName(url) {
|
|
26
|
+
try {
|
|
27
|
+
const match = url.match(/\/([^/?]+)(?:\?|$)/);
|
|
28
|
+
if (match) {
|
|
29
|
+
return match[1];
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function generateId(name, index) {
|
|
37
|
+
const sanitized = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
38
|
+
return sanitized || `db-${index}`;
|
|
39
|
+
}
|
|
40
|
+
function findDatabaseById(configs, id) {
|
|
41
|
+
if (!id) return configs[0] || null;
|
|
42
|
+
return configs.find((c) => c.id === id) || configs[0] || null;
|
|
43
|
+
}
|
|
44
|
+
let cachedConfig = null;
|
|
45
|
+
function getDatabaseConfigs() {
|
|
46
|
+
if (!cachedConfig) {
|
|
47
|
+
cachedConfig = parseDatabaseConfig();
|
|
48
|
+
}
|
|
49
|
+
return cachedConfig;
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
findDatabaseById as f,
|
|
53
|
+
getDatabaseConfigs as g
|
|
54
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createMiddleware } from "hono/factory";
|
|
2
|
+
import { serve } from "@hono/node-server";
|
|
3
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
4
|
+
import { Hono } from "hono";
|
|
5
|
+
import { logger } from "hono/logger";
|
|
6
|
+
import { createRequestHandler } from "react-router";
|
|
7
|
+
var defaultWebSocket = {
|
|
8
|
+
upgradeWebSocket: (() => {
|
|
9
|
+
}),
|
|
10
|
+
injectWebSocket: (server) => server
|
|
11
|
+
};
|
|
12
|
+
async function createWebSocket({ app, enabled }) {
|
|
13
|
+
if (!enabled) {
|
|
14
|
+
return defaultWebSocket;
|
|
15
|
+
}
|
|
16
|
+
process.env.NODE_ENV === "development" ? "development" : "production";
|
|
17
|
+
{
|
|
18
|
+
const { createNodeWebSocket } = await import("@hono/node-ws");
|
|
19
|
+
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({ app });
|
|
20
|
+
return {
|
|
21
|
+
upgradeWebSocket,
|
|
22
|
+
injectWebSocket(server) {
|
|
23
|
+
injectWebSocket(server);
|
|
24
|
+
return server;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function cleanUpgradeListeners(httpServer) {
|
|
30
|
+
const upgradeListeners = httpServer.listeners("upgrade").filter((listener) => listener.name !== "hmrServerWsListener");
|
|
31
|
+
for (const listener of upgradeListeners) {
|
|
32
|
+
httpServer.removeListener(
|
|
33
|
+
"upgrade",
|
|
34
|
+
/* @ts-expect-error - we don't care */
|
|
35
|
+
listener
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function patchUpgradeListener(httpServer) {
|
|
40
|
+
const upgradeListeners = httpServer.listeners("upgrade").filter((listener) => listener.name !== "hmrServerWsListener");
|
|
41
|
+
for (const listener of upgradeListeners) {
|
|
42
|
+
httpServer.removeListener(
|
|
43
|
+
"upgrade",
|
|
44
|
+
/* @ts-expect-error - we don't care */
|
|
45
|
+
listener
|
|
46
|
+
);
|
|
47
|
+
httpServer.on("upgrade", (request, ...rest) => {
|
|
48
|
+
if (request.headers["sec-websocket-protocol"] === "vite-hmr") {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
return listener(request, ...rest);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function bindIncomingRequestSocketInfo() {
|
|
56
|
+
return createMiddleware((c, next) => {
|
|
57
|
+
c.env.server = {
|
|
58
|
+
incoming: {
|
|
59
|
+
socket: {
|
|
60
|
+
remoteAddress: c.req.raw.headers.get("x-remote-address") || void 0,
|
|
61
|
+
remotePort: Number(c.req.raw.headers.get("x-remote-port")) || void 0,
|
|
62
|
+
remoteFamily: c.req.raw.headers.get("x-remote-family") || void 0
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return next();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async function importBuild() {
|
|
70
|
+
return await import(
|
|
71
|
+
// @ts-expect-error - Virtual module provided by React Router at build time
|
|
72
|
+
"./server-build.js"
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function getBuildMode() {
|
|
76
|
+
return process.env.NODE_ENV === "development" ? "development" : "production";
|
|
77
|
+
}
|
|
78
|
+
function cache(seconds) {
|
|
79
|
+
return createMiddleware(async (c, next) => {
|
|
80
|
+
if (!c.req.path.match(/\.[a-zA-Z0-9]+$/) || c.req.path.endsWith(".data")) {
|
|
81
|
+
return next();
|
|
82
|
+
}
|
|
83
|
+
await next();
|
|
84
|
+
if (!c.res.ok || c.res.headers.has("cache-control")) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
c.res.headers.set("cache-control", `public, max-age=${seconds}`);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
async function createHonoServer(options) {
|
|
91
|
+
const startTime = Date.now();
|
|
92
|
+
const build = await importBuild();
|
|
93
|
+
const basename = "/";
|
|
94
|
+
const mergedOptions = {
|
|
95
|
+
...options,
|
|
96
|
+
listeningListener: options?.listeningListener || ((info) => {
|
|
97
|
+
console.log(`🚀 Server started on port ${info.port}`);
|
|
98
|
+
console.log(`🌍 http://127.0.0.1:${info.port}`);
|
|
99
|
+
console.log(`🏎️ Server started in ${Date.now() - startTime}ms`);
|
|
100
|
+
}),
|
|
101
|
+
port: options?.port || Number(process.env.PORT) || 3e3,
|
|
102
|
+
defaultLogger: options?.defaultLogger ?? true,
|
|
103
|
+
overrideGlobalObjects: options?.overrideGlobalObjects ?? false
|
|
104
|
+
};
|
|
105
|
+
const mode = getBuildMode();
|
|
106
|
+
const PRODUCTION = mode === "production";
|
|
107
|
+
const clientBuildPath = `${"build"}/client`;
|
|
108
|
+
const app = new Hono(mergedOptions.app);
|
|
109
|
+
const { upgradeWebSocket, injectWebSocket } = await createWebSocket({
|
|
110
|
+
app,
|
|
111
|
+
enabled: mergedOptions.useWebSocket ?? false
|
|
112
|
+
});
|
|
113
|
+
if (!PRODUCTION) {
|
|
114
|
+
app.use(bindIncomingRequestSocketInfo());
|
|
115
|
+
}
|
|
116
|
+
await mergedOptions.beforeAll?.(app);
|
|
117
|
+
app.use(
|
|
118
|
+
`/${"assets"}/*`,
|
|
119
|
+
cache(60 * 60 * 24 * 365),
|
|
120
|
+
// 1 year
|
|
121
|
+
serveStatic({ root: clientBuildPath, ...mergedOptions.serveStaticOptions?.clientAssets })
|
|
122
|
+
);
|
|
123
|
+
app.use(
|
|
124
|
+
"*",
|
|
125
|
+
cache(60 * 60),
|
|
126
|
+
// 1 hour
|
|
127
|
+
serveStatic({ root: PRODUCTION ? clientBuildPath : "./public", ...mergedOptions.serveStaticOptions?.publicAssets })
|
|
128
|
+
);
|
|
129
|
+
if (mergedOptions.defaultLogger) {
|
|
130
|
+
app.use("*", logger());
|
|
131
|
+
}
|
|
132
|
+
if (mergedOptions.useWebSocket) {
|
|
133
|
+
await mergedOptions.configure(app, { upgradeWebSocket });
|
|
134
|
+
} else {
|
|
135
|
+
await mergedOptions.configure?.(app);
|
|
136
|
+
}
|
|
137
|
+
const reactRouterApp = new Hono({
|
|
138
|
+
strict: false
|
|
139
|
+
});
|
|
140
|
+
reactRouterApp.use((c, next) => {
|
|
141
|
+
return createMiddleware(async (c2) => {
|
|
142
|
+
const requestHandler = createRequestHandler(build, mode);
|
|
143
|
+
const loadContext = mergedOptions.getLoadContext?.(c2, { build, mode });
|
|
144
|
+
return requestHandler(c2.req.raw, loadContext instanceof Promise ? await loadContext : loadContext);
|
|
145
|
+
})(c, next);
|
|
146
|
+
});
|
|
147
|
+
app.route(`${basename}`, reactRouterApp);
|
|
148
|
+
{
|
|
149
|
+
app.route(`${basename}.data`, reactRouterApp);
|
|
150
|
+
}
|
|
151
|
+
if (PRODUCTION) {
|
|
152
|
+
const server = serve(
|
|
153
|
+
{
|
|
154
|
+
...app,
|
|
155
|
+
...mergedOptions.customNodeServer,
|
|
156
|
+
port: mergedOptions.port,
|
|
157
|
+
overrideGlobalObjects: mergedOptions.overrideGlobalObjects,
|
|
158
|
+
hostname: mergedOptions.hostname
|
|
159
|
+
},
|
|
160
|
+
mergedOptions.listeningListener
|
|
161
|
+
);
|
|
162
|
+
mergedOptions.onServe?.(server);
|
|
163
|
+
injectWebSocket(server);
|
|
164
|
+
} else if (globalThis.__viteDevServer?.httpServer) {
|
|
165
|
+
const httpServer = globalThis.__viteDevServer.httpServer;
|
|
166
|
+
cleanUpgradeListeners(httpServer);
|
|
167
|
+
mergedOptions.onServe?.(httpServer);
|
|
168
|
+
injectWebSocket(httpServer);
|
|
169
|
+
patchUpgradeListener(httpServer);
|
|
170
|
+
console.log("🚧 Dev server started");
|
|
171
|
+
}
|
|
172
|
+
return app;
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
createHonoServer as c
|
|
176
|
+
};
|