ownledger 2.4.0 → 2.4.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/CHANGELOG.md +6 -0
- package/assets/index.html +10 -10
- package/assets/static/{Account-DIDz6cXc.js → Account-CsYM8gHF.js} +1 -1
- package/assets/static/{Accounts-BHqMr96X.js → Accounts-lS6XAdaj.js} +1 -1
- package/assets/static/{Attention-DW0iYViO.js → Attention-BenmtPd7.js} +1 -1
- package/assets/static/{ByCategory-BcC8nC5_.js → ByCategory-JX6VL0r5.js} +1 -1
- package/assets/static/CardBudgets-D6pSYb4p.js +1 -0
- package/assets/static/{CardDetail-C-EWPz9U.js → CardDetail-DauEkok4.js} +1 -1
- package/assets/static/{Cards-CXuGLYDb.js → Cards-BPdfO3mX.js} +1 -1
- package/assets/static/{Cards-2bB7IrMZ.js → Cards-CJ6D_yWD.js} +1 -1
- package/assets/static/{CardsValue-CBP2-s79.js → CardsValue-BJ7TcmzC.js} +1 -1
- package/assets/static/{Cashback-BRHegG4o.js → Cashback-C4cG7mgh.js} +1 -1
- package/assets/static/{CategoryIcon-DZf6uKtg.js → CategoryIcon-DIqlujCD.js} +1 -1
- package/assets/static/{CategoryPicker-CIgSXytj.js → CategoryPicker-X4mud6cY.js} +1 -1
- package/assets/static/{ChartWidget-B5oybW6u.js → ChartWidget-BFvDbLgz.js} +1 -1
- package/assets/static/{Combobox-CK6B8Keq.js → Combobox-CAP3wl4l.js} +1 -1
- package/assets/static/{Deposits-Ddy3xcdL.js → Deposits-RX3YoIZZ.js} +1 -1
- package/assets/static/{DrillLink-CaBCVQQj.js → DrillLink-yroQT8gZ.js} +1 -1
- package/assets/static/{Field-rwl1eTQR.js → Field-C2-VycnC.js} +1 -1
- package/assets/static/{HomeEditor-Or4bvFoV.js → HomeEditor-Bxu25He1.js} +1 -1
- package/assets/static/{Import-CPpOHxfR.js → Import-C4HY1ABv.js} +1 -1
- package/assets/static/{IncomeSpending-Dw_YhoO_.js → IncomeSpending-B2I7znyM.js} +1 -1
- package/assets/static/{KV-Cpfsyhnb.js → KV-D0yMpiyZ.js} +1 -1
- package/assets/static/{Left-BiuU811i.js → Left-ZqQxfEIH.js} +1 -1
- package/assets/static/{Money-DFHYuv5m.js → Money-NpAKIj6n.js} +1 -1
- package/assets/static/{NetWorth-B9uU7Ope.js → NetWorth-CxAiM-YK.js} +1 -1
- package/assets/static/{Pace-BbOf0yAs.js → Pace-DLtERmT4.js} +1 -1
- package/assets/static/{Panel-tOE_I4OD.js → Panel-B3szLNCa.js} +1 -1
- package/assets/static/{PinDialog-Dj4j0jcD.js → PinDialog-CI2hlJTi.js} +1 -1
- package/assets/static/{Plans-COJrKjSX.js → Plans-Cjtbl3jy.js} +1 -1
- package/assets/static/{Recent-BJrdjtMv.js → Recent-CLidi89q.js} +1 -1
- package/assets/static/{Reports-ByrhmAQv.js → Reports-De-UPdvX.js} +1 -1
- package/assets/static/{Settings-BunM2dfp.js → Settings-DTqQmDcd.js} +1 -1
- package/assets/static/{Transactions-DVJDPqHI.js → Transactions-DOs7gcHH.js} +1 -1
- package/assets/static/{TxRow-CZJ_C-Cp.js → TxRow-BDwN3FU8.js} +1 -1
- package/assets/static/{Unusual-ChtSsnCm.js → Unusual-Cl_nAUxh.js} +1 -1
- package/assets/static/{Upcoming-D6ab7_fA.js → Upcoming-C8qpBQsr.js} +1 -1
- package/assets/static/{WhichCard-BlBXpqMn.js → WhichCard-CHIiyqNI.js} +1 -1
- package/assets/static/{arrow-up-7r2T_P3U.js → arrow-up-7Upl0C9g.js} +1 -1
- package/assets/static/{bits-CayEEXaW.js → bits-93kCxLrY.js} +1 -1
- package/assets/static/{button-DQvRPLIv.js → button-C7t0bIbi.js} +1 -1
- package/assets/static/{cards-BP4EqCQY.js → cards-Chi71C59.js} +1 -1
- package/assets/static/{charts-DzDF8ihe.js → charts-qUKGFulK.js} +1 -1
- package/assets/static/chevron-down-D8cJv15D.js +1 -0
- package/assets/static/chevron-right-BoH5yblW.js +1 -0
- package/assets/static/{createLucideIcon-DI8vbiOO.js → createLucideIcon-IIIDTtW8.js} +1 -1
- package/assets/static/{dialog-B6000kEK.js → dialog-BVeS01WF.js} +1 -1
- package/assets/static/{dist-CqPSw3yk.js → dist-AcCk2mm3.js} +1 -1
- package/assets/static/{dist-DiXEmDmz.js → dist-BbQYk9ka.js} +1 -1
- package/assets/static/{dist-Cb1_dp0K.js → dist-C6_xObjc.js} +1 -1
- package/assets/static/{dist-DabFVUs-.js → dist-Cpod2XMH.js} +1 -1
- package/assets/static/{es2015-ConR4hgR.js → es2015-CM_WSWcu.js} +1 -1
- package/assets/static/{index-DvdDpUvS.js → index-CXJ1Qnlx.js} +4 -4
- package/assets/static/{queries-Dr6hPr4g.js → queries-fhKGsTGv.js} +1 -1
- package/assets/static/{react-dom-DKhzijWz.js → react-dom-ybupEBHK.js} +1 -1
- package/assets/static/{select-5FcHJXrC.js → select-CnfPMAV_.js} +1 -1
- package/assets/static/{shared-C3-t8uIq.js → shared-BvrPq08n.js} +1 -1
- package/assets/static/{triangle-exclamation-point-B4sQZqpa.js → triangle-exclamation-point-l1kwARXk.js} +1 -1
- package/assets/static/{useMutation-Bf1MT3Q_.js → useMutation-DFgEN5Dk.js} +1 -1
- package/dist/modules/cards/index.d.ts +6 -0
- package/dist/modules/cards/index.js +10 -2
- package/dist/worker/mcp.js +1 -0
- package/dist/worker/version.d.ts +1 -1
- package/dist/worker/version.js +1 -1
- package/package.json +1 -1
- package/assets/static/CardBudgets-CaXHjpKv.js +0 -1
- package/assets/static/chevron-down-wODISwBd.js +0 -1
- package/assets/static/chevron-right-CRhYK7Bh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,R as t}from"./queries-
|
|
1
|
+
import{I as e,R as t}from"./queries-fhKGsTGv.js";var n=t((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.browser=function(e){return{$$typeof:s,_reason:e}},t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},t.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},t.useFormStatus=function(){return u.H.useHostTransitionStatus()},t.version=`19.3.1`})),r=t(((e,t)=>{function r(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,I as t,L as n,T as r}from"./queries-Dr6hPr4g.js";import{t as i}from"./react-dom-DKhzijWz.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-DiXEmDmz.js";import{n as f,t as p}from"./dist-DabFVUs-.js";import{i as m,s as h}from"./button-DQvRPLIv.js";import{a as g,i as _,l as v,n as y,r as b,t as x}from"./es2015-ConR4hgR.js";import{_t as S,at as C,ct as w,ot as T,st as E,tt as D}from"./index-DvdDpUvS.js";import{t as O}from"./dist-Cb1_dp0K.js";import{t as k}from"./chevron-down-wODISwBd.js";import{t as A}from"./createLucideIcon-DI8vbiOO.js";var j=e(t(),1),M=e(i(),1),N=Object.defineProperty,P=(e,t)=>N(e,`name`,{value:t,configurable:!0});function F(e,[t,n]){return Math.min(n,Math.max(t,e))}P(F,`clamp`);var I=n(),L=Object.defineProperty,R=(e,t)=>L(e,`name`,{value:t,configurable:!0}),ee={ItemAligned:`item-aligned`,Popper:`popper`},z={LTR:`ltr`,RTL:`rtl`},te=[` `,`Enter`,`ArrowUp`,`ArrowDown`],B=[` `,`Enter`],V=`Select`,[H,U,W]=f(V),[G,K]=c(V,[W,w]),q=w(),[ne,J]=G(V),[re,Y]=G(V);function ie(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:h,required:g,form:_,internal_do_not_use_render:v}=e,y=q(t),[b,x]=j.useState(null),[S,w]=j.useState(null),[T,E]=j.useState(!1),D=p(d),[O,k]=l({prop:r,defaultProp:i??!1,onChange:a,caller:V}),[A,M]=l({prop:o,defaultProp:c,onChange:u,caller:V}),N=j.useRef(null),P=j.useRef(!1),[F,L]=j.useState(null),ee=R(e=>{L({value:e,hasConsumerStoppedPropagation:P.current}),M(e)},`handleUserSelect`),z=j.useRef(A);j.useEffect(()=>{let e=_?b?.ownerDocument.getElementById(_):b?.form;if(e instanceof HTMLFormElement){let t=R(()=>M(z.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[_,b,M]);let te=!b||!!_||!!b.closest(`form`),[B,U]=j.useState(new Set),W=s(),G=Array.from(B).map(e=>e.props.value).join(`;`),K=j.useCallback(e=>{U(t=>new Set(t).add(e))},[]),J=j.useCallback(e=>{U(t=>{let n=new Set(t);return n.delete(e),n})},[]),Y={required:g,trigger:b,onTriggerChange:x,valueNode:S,onValueNodeChange:w,valueNodeHasChildren:T,onValueNodeHasChildrenChange:E,contentId:W,value:A,onValueChange:M,hasConsumerStoppedPropagationRef:P,userSelection:F,onUserSelect:ee,open:O,onOpenChange:k,dir:D,triggerPointerDownPosRef:N,disabled:h,name:f,autoComplete:m,form:_,nativeOptions:B,nativeSelectKey:G,isFormControl:te};return(0,I.jsx)(C,{...y,children:(0,I.jsx)(ne,{scope:t,...Y,children:(0,I.jsx)(H.Provider,{scope:t,children:(0,I.jsx)(re,{scope:t,onNativeOptionAdd:K,onNativeOptionRemove:J,children:He(v)?v(Y):n})})})})}R(ie,`SelectProvider`);var ae=R(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(ie,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(Ve,{__scopeSelect:t}):null]})})},`Select`),oe=`SelectTrigger`,se=j.forwardRef(R(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=q(n),s=J(oe,n),c=s.disabled||r,l=h(t,s.onTriggerChange),d=U(n),f=j.useRef(`touch`),[p,m,g]=Ue(e=>{let t=d().filter(e=>!e.disabled),n=We(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onUserSelect(n.value)}),_=R(e=>{c||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,I.jsx)(T,{asChild:!0,...a,children:(0,I.jsx)(u.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...i,ref:l,onClick:o(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:o(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:o(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),m(e.key)),t&&e.key===` `||te.includes(e.key)&&(_(),e.preventDefault())})})})},`SelectTrigger`)),ce=`SelectValue`,le=j.forwardRef(R(function(e,t){let{__scopeSelect:n,className:r,style:i,children:o,placeholder:s=``,...c}=e,l=J(ce,n),{onValueNodeHasChildrenChange:d}=l,f=o!==void 0,p=h(t,l.onValueNodeChange);a(()=>{d(f)},[d,f]);let m=$(l.value);return(0,I.jsx)(u.span,{...c,asChild:!m&&c.asChild,ref:p,style:{pointerEvents:`none`},children:(0,I.jsx)(j.Fragment,{children:m?s:o},m?`placeholder`:`value`)})},`SelectValue`)),ue=j.forwardRef(R(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(u.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[de,fe]=G(`SelectPortal`,{forceMount:void 0}),pe=R(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(de,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(_,{asChild:!0,...r})})},`SelectPortal`),X=`SelectContent`,me=j.forwardRef(R(function(e,t){let n=fe(X,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=J(X,e.__scopeSelect),[s,c]=j.useState();return a(()=>{c(new DocumentFragment)},[]),(0,I.jsx)(O,{present:r||o.open,children:({present:e})=>e?(0,I.jsx)(ve,{...i,ref:t}):(0,I.jsx)(he,{...i,fragment:s})})},`SelectContent`)),he=j.forwardRef(R(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?M.createPortal((0,I.jsx)(ge,{scope:n,children:(0,I.jsx)(H.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Z=10,[ge,Q]=G(X),_e=m(`SelectContent.RemoveScroll`),ve=j.forwardRef(R(function(e,t){let{__scopeSelect:n}=e,{position:r=ee.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:_,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=J(X,n),[E,D]=j.useState(null),[O,k]=j.useState(null),A=h(t,D),[M,N]=j.useState(null),[P,F]=j.useState(null),L=U(n),[z,te]=j.useState(!1),B=j.useRef(!1),V=j.useRef(!1),H=j.useRef(!1);j.useEffect(()=>{if(E)return x(E)},[E]),b();let W=j.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),G=j.useCallback(()=>W([M,E]),[W,M,E]);j.useEffect(()=>{z&&G()},[z,G]);let{onOpenChange:K,triggerPointerDownPosRef:q}=T;j.useEffect(()=>{if(E){let e={x:0,y:0},t=R(t=>{e={x:Math.abs(Math.round(t.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(q.current?.y??0))}},`handlePointerMove`),n=R(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||K(!1),document.removeEventListener(`pointermove`,t),q.current=null},`handlePointerUp`);return q.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,K,q]),j.useEffect(()=>{let e=R(()=>K(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[K]);let[ne,re]=Ue(e=>{let t=L().filter(e=>!e.disabled),n=We(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),Y=j.useCallback((e,t,n)=>{let r=!V.current;r&&(V.current=!0);let i=!B.current&&!n;T.value!==void 0&&T.value===t||i?(N(e),i&&(B.current=!0)):r&&N(e)},[T.value]),ie=j.useCallback(()=>E?.focus(),[E]),ae=j.useCallback((e,t,n)=>{if(!e)return;let r=!H.current;r&&(H.current=!0);let i=!B.current&&!n;(T.value!==void 0&&T.value===t||i||r)&&F(e)},[T.value]),oe=r===ee.Popper?be:ye,se=oe===be?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:_,hideWhenDetached:S,avoidCollisions:C}:{};return(0,I.jsx)(ge,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:Y,selectedItem:M,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:G,selectedItemText:P,position:r,isPositioned:z,searchRef:ne,children:(0,I.jsx)(y,{as:_e,allowPinchZoom:!0,children:(0,I.jsx)(g,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:o(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(oe,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...se,onPlaced:()=>te(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:o(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>W(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ye=j.forwardRef(R(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,o=J(X,n),s=Q(X,n),[c,l]=j.useState(null),[d,f]=j.useState(null),p=h(t,f),m=U(n),g=j.useRef(!1),_=j.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=j.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==z.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=F(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=F(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-Z*2,l=v.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),h=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=f+p+l+_+h,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Z,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+h);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,c,d,v,y,b,o.dir,r]);a(()=>S(),[S]);let[C,w]=j.useState();a(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);let T=j.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]);return(0,I.jsx)(xe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:(0,I.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(u.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),be=j.forwardRef(R(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Z,...a}=e,o=q(n);return(0,I.jsx)(E,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[xe,Se]=G(X,{}),Ce=`SelectViewport`,we=j.forwardRef(R(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Q(Ce,n),s=Se(Ce,n),c=h(t,a.onViewportChange),l=j.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(H.Slot,{scope:n,children:(0,I.jsx)(u.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:o(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Z*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[Te,Ee]=G(`SelectGroup`),De=`SelectItem`,[Oe,ke]=G(De),Ae=j.forwardRef(R(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...c}=e,l=J(De,n),f=Q(De,n),p=l.value===r,[m,g]=j.useState(a??``),[_,v]=j.useState(!1),y=d(e=>f.itemRefCallback?.(e,r,i)),b=h(t,y),x=s(),S=j.useRef(`touch`);function C(e){l.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),l.onUserSelect(r),l.onOpenChange(!1)}return R(C,`handleSelect`),(0,I.jsx)(Oe,{scope:n,value:r,disabled:i,textId:x,isSelected:p,onItemTextChange:j.useCallback(e=>{g(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(H.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(u.div,{role:`option`,"aria-labelledby":x,"data-highlighted":_?``:void 0,"aria-selected":p&&_,"data-state":p?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...c,ref:b,onFocus:o(c.onFocus,()=>v(!0)),onBlur:o(c.onBlur,()=>v(!1)),onClick:o(c.onClick,e=>{i||S.current!==`mouse`&&C(e)}),onPointerUp:o(c.onPointerUp,e=>{i||S.current===`mouse`&&C(e)}),onPointerDown:o(c.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:o(c.onPointerMove,e=>{S.current=e.pointerType,i?f.onItemLeave?.():S.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:o(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:o(c.onKeyDown,e=>{i||e.target!==e.currentTarget||(f.searchRef?.current===``||e.key!==` `)&&(B.includes(e.key)&&C(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),je=`SelectItemText`,Me=j.forwardRef(R(function(e,t){let{__scopeSelect:n,className:r,style:i,...o}=e,s=J(je,n),c=Q(je,n),l=ke(je,n),f=Y(je,n),[p,m]=j.useState(null),g=d(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=h(t,m,l.onItemTextChange,g),v=p?.textContent,y=j.useMemo(()=>(0,I.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return a(()=>(b(y),()=>x(y)),[b,x,y]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.span,{id:l.textId,...o,ref:_}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?M.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),Ne=`SelectItemIndicator`,Pe=j.forwardRef(R(function(e,t){let{__scopeSelect:n,...r}=e;return ke(Ne,n).isSelected?(0,I.jsx)(u.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Fe=`SelectScrollUpButton`,Ie=j.forwardRef(R(function(e,t){let n=Q(Fe,e.__scopeSelect),r=Se(Fe,e.__scopeSelect),[i,o]=j.useState(!1),s=h(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)};R(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Le=`SelectScrollDownButton`,Re=j.forwardRef(R(function(e,t){let n=Q(Le,e.__scopeSelect),r=Se(Le,e.__scopeSelect),[i,o]=j.useState(!1),s=h(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};R(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),ze=j.forwardRef(R(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Q(`SelectScrollButton`,n),c=j.useRef(null),l=U(n),d=j.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return j.useEffect(()=>()=>d(),[d]),a(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(u.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:o(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:o(i.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:o(i.onPointerLeave,()=>{d()})})},`SelectScrollButtonImpl`)),Be=`SelectBubbleInput`,Ve=j.forwardRef(R(function({__scopeSelect:e,...t},n){let r=J(Be,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:d,userSelection:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,g=j.useRef(null),_=h(n,g),v=i??``,y=j.useRef(v),b=j.useRef(f),x=j.useRef(!1),C=Array.from(p).some(e=>(e.props.value??``)===``);return j.useEffect(()=>{let e=g.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f!==null&&f!==b.current;b.current=f;let i=y.current!==v;y.current=v;let a=r&&i;if(r&&!i&&f.value!==v&&!f.hasConsumerStoppedPropagation&&n){x.current=!0;try{n.call(e,f.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{x.current=!1,n.call(e,v)}return}let o=a&&!f.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,v),e.dispatchEvent(t)}},[v,f]),(0,I.jsxs)(u.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:d,onChange:e=>{x.current||a(e.target.value)},...t,style:{...S,...t.style},ref:_,defaultValue:v,children:[$(i)&&!C?(0,I.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function He(e){return typeof e==`function`}R(He,`isFunction`);function $(e){return e===``||e===void 0}R($,`shouldShowPlaceholder`);function Ue(e){let t=d(e),n=j.useRef(``),r=j.useRef(0),i=j.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}R(a,`updateSearch`),a(i)},[t]),a=j.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}R(Ue,`useTypeaheadSearch`);function We(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ge(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}R(We,`findNextItem`);function Ge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}R(Ge,`wrapArray`);var Ke={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ke.node;var qe=A(Ke);function Je({...e}){return(0,I.jsx)(ae,{"data-slot":`select`,...e})}function Ye({...e}){return(0,I.jsx)(le,{"data-slot":`select-value`,...e})}function Xe({className:e,size:t=`default`,children:n,...i}){return(0,I.jsxs)(se,{"data-slot":`select-trigger`,"data-size":t,className:r(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[n,(0,I.jsx)(ue,{asChild:!0,children:(0,I.jsx)(k,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Ze({className:e,children:t,position:n=`item-aligned`,align:i=`center`,...a}){return(0,I.jsx)(pe,{children:(0,I.jsxs)(me,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:r(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:i,...a,children:[(0,I.jsx)($e,{}),(0,I.jsx)(we,{"data-position":n,className:r(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,I.jsx)(et,{})]})})}function Qe({className:e,children:t,...n}){return(0,I.jsxs)(Ae,{"data-slot":`select-item`,className:r(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,I.jsx)(Pe,{children:(0,I.jsx)(D,{className:`pointer-events-none`})})}),(0,I.jsx)(Me,{children:t})]})}function $e({className:e,...t}){return(0,I.jsx)(Ie,{"data-slot":`select-scroll-up-button`,className:r(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,I.jsx)(qe,{})})}function et({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`select-scroll-down-button`,className:r(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,I.jsx)(k,{})})}export{Ye as a,Xe as i,Ze as n,Qe as r,Je as t};
|
|
1
|
+
import{B as e,I as t,L as n,T as r}from"./queries-fhKGsTGv.js";import{t as i}from"./react-dom-ybupEBHK.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-BbQYk9ka.js";import{n as f,t as p}from"./dist-Cpod2XMH.js";import{i as m,s as h}from"./button-C7t0bIbi.js";import{a as g,i as _,l as v,n as y,r as b,t as x}from"./es2015-CM_WSWcu.js";import{_t as S,at as C,ct as w,ot as T,st as E,tt as D}from"./index-CXJ1Qnlx.js";import{t as O}from"./dist-C6_xObjc.js";import{t as k}from"./chevron-down-D8cJv15D.js";import{t as A}from"./createLucideIcon-IIIDTtW8.js";var j=e(t(),1),M=e(i(),1),N=Object.defineProperty,P=(e,t)=>N(e,`name`,{value:t,configurable:!0});function F(e,[t,n]){return Math.min(n,Math.max(t,e))}P(F,`clamp`);var I=n(),L=Object.defineProperty,R=(e,t)=>L(e,`name`,{value:t,configurable:!0}),ee={ItemAligned:`item-aligned`,Popper:`popper`},z={LTR:`ltr`,RTL:`rtl`},te=[` `,`Enter`,`ArrowUp`,`ArrowDown`],B=[` `,`Enter`],V=`Select`,[H,U,W]=f(V),[G,K]=c(V,[W,w]),q=w(),[ne,J]=G(V),[re,Y]=G(V);function ie(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:u,dir:d,name:f,autoComplete:m,disabled:h,required:g,form:_,internal_do_not_use_render:v}=e,y=q(t),[b,x]=j.useState(null),[S,w]=j.useState(null),[T,E]=j.useState(!1),D=p(d),[O,k]=l({prop:r,defaultProp:i??!1,onChange:a,caller:V}),[A,M]=l({prop:o,defaultProp:c,onChange:u,caller:V}),N=j.useRef(null),P=j.useRef(!1),[F,L]=j.useState(null),ee=R(e=>{L({value:e,hasConsumerStoppedPropagation:P.current}),M(e)},`handleUserSelect`),z=j.useRef(A);j.useEffect(()=>{let e=_?b?.ownerDocument.getElementById(_):b?.form;if(e instanceof HTMLFormElement){let t=R(()=>M(z.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[_,b,M]);let te=!b||!!_||!!b.closest(`form`),[B,U]=j.useState(new Set),W=s(),G=Array.from(B).map(e=>e.props.value).join(`;`),K=j.useCallback(e=>{U(t=>new Set(t).add(e))},[]),J=j.useCallback(e=>{U(t=>{let n=new Set(t);return n.delete(e),n})},[]),Y={required:g,trigger:b,onTriggerChange:x,valueNode:S,onValueNodeChange:w,valueNodeHasChildren:T,onValueNodeHasChildrenChange:E,contentId:W,value:A,onValueChange:M,hasConsumerStoppedPropagationRef:P,userSelection:F,onUserSelect:ee,open:O,onOpenChange:k,dir:D,triggerPointerDownPosRef:N,disabled:h,name:f,autoComplete:m,form:_,nativeOptions:B,nativeSelectKey:G,isFormControl:te};return(0,I.jsx)(C,{...y,children:(0,I.jsx)(ne,{scope:t,...Y,children:(0,I.jsx)(H.Provider,{scope:t,children:(0,I.jsx)(re,{scope:t,onNativeOptionAdd:K,onNativeOptionRemove:J,children:He(v)?v(Y):n})})})})}R(ie,`SelectProvider`);var ae=R(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,I.jsx)(ie,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[n,e?(0,I.jsx)(Ve,{__scopeSelect:t}):null]})})},`Select`),oe=`SelectTrigger`,se=j.forwardRef(R(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=q(n),s=J(oe,n),c=s.disabled||r,l=h(t,s.onTriggerChange),d=U(n),f=j.useRef(`touch`),[p,m,g]=Ue(e=>{let t=d().filter(e=>!e.disabled),n=We(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onUserSelect(n.value)}),_=R(e=>{c||(s.onOpenChange(!0),g()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,I.jsx)(T,{asChild:!0,...a,children:(0,I.jsx)(u.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":$(s.value)?``:void 0,...i,ref:l,onClick:o(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:o(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:o(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),m(e.key)),t&&e.key===` `||te.includes(e.key)&&(_(),e.preventDefault())})})})},`SelectTrigger`)),ce=`SelectValue`,le=j.forwardRef(R(function(e,t){let{__scopeSelect:n,className:r,style:i,children:o,placeholder:s=``,...c}=e,l=J(ce,n),{onValueNodeHasChildrenChange:d}=l,f=o!==void 0,p=h(t,l.onValueNodeChange);a(()=>{d(f)},[d,f]);let m=$(l.value);return(0,I.jsx)(u.span,{...c,asChild:!m&&c.asChild,ref:p,style:{pointerEvents:`none`},children:(0,I.jsx)(j.Fragment,{children:m?s:o},m?`placeholder`:`value`)})},`SelectValue`)),ue=j.forwardRef(R(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(u.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[de,fe]=G(`SelectPortal`,{forceMount:void 0}),pe=R(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,I.jsx)(de,{scope:e.__scopeSelect,forceMount:n,children:(0,I.jsx)(_,{asChild:!0,...r})})},`SelectPortal`),X=`SelectContent`,me=j.forwardRef(R(function(e,t){let n=fe(X,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,o=J(X,e.__scopeSelect),[s,c]=j.useState();return a(()=>{c(new DocumentFragment)},[]),(0,I.jsx)(O,{present:r||o.open,children:({present:e})=>e?(0,I.jsx)(ve,{...i,ref:t}):(0,I.jsx)(he,{...i,fragment:s})})},`SelectContent`)),he=j.forwardRef(R(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?M.createPortal((0,I.jsx)(ge,{scope:n,children:(0,I.jsx)(H.Slot,{scope:n,children:(0,I.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Z=10,[ge,Q]=G(X),_e=m(`SelectContent.RemoveScroll`),ve=j.forwardRef(R(function(e,t){let{__scopeSelect:n}=e,{position:r=ee.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:_,hideWhenDetached:S,avoidCollisions:C,...w}=e,T=J(X,n),[E,D]=j.useState(null),[O,k]=j.useState(null),A=h(t,D),[M,N]=j.useState(null),[P,F]=j.useState(null),L=U(n),[z,te]=j.useState(!1),B=j.useRef(!1),V=j.useRef(!1),H=j.useRef(!1);j.useEffect(()=>{if(E)return x(E)},[E]),b();let W=j.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),G=j.useCallback(()=>W([M,E]),[W,M,E]);j.useEffect(()=>{z&&G()},[z,G]);let{onOpenChange:K,triggerPointerDownPosRef:q}=T;j.useEffect(()=>{if(E){let e={x:0,y:0},t=R(t=>{e={x:Math.abs(Math.round(t.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(q.current?.y??0))}},`handlePointerMove`),n=R(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||K(!1),document.removeEventListener(`pointermove`,t),q.current=null},`handlePointerUp`);return q.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,K,q]),j.useEffect(()=>{let e=R(()=>K(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[K]);let[ne,re]=Ue(e=>{let t=L().filter(e=>!e.disabled),n=We(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),Y=j.useCallback((e,t,n)=>{let r=!V.current;r&&(V.current=!0);let i=!B.current&&!n;T.value!==void 0&&T.value===t||i?(N(e),i&&(B.current=!0)):r&&N(e)},[T.value]),ie=j.useCallback(()=>E?.focus(),[E]),ae=j.useCallback((e,t,n)=>{if(!e)return;let r=!H.current;r&&(H.current=!0);let i=!B.current&&!n;(T.value!==void 0&&T.value===t||i||r)&&F(e)},[T.value]),oe=r===ee.Popper?be:ye,se=oe===be?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:_,hideWhenDetached:S,avoidCollisions:C}:{};return(0,I.jsx)(ge,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:Y,selectedItem:M,onItemLeave:ie,itemTextRefCallback:ae,focusSelectedItem:G,selectedItemText:P,position:r,isPositioned:z,searchRef:ne,children:(0,I.jsx)(y,{as:_e,allowPinchZoom:!0,children:(0,I.jsx)(g,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:o(i,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(oe,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...se,onPlaced:()=>te(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:o(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>W(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ye=j.forwardRef(R(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,o=J(X,n),s=Q(X,n),[c,l]=j.useState(null),[d,f]=j.useState(null),p=h(t,f),m=U(n),g=j.useRef(!1),_=j.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=j.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(o.dir!==z.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=F(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Z,d=F(a,[Z,Math.max(Z,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-Z*2,l=v.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),h=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=f+p+l+_+h,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Z,D=s-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&y===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+h);c.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,c,d,v,y,b,o.dir,r]);a(()=>S(),[S]);let[C,w]=j.useState();a(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);let T=j.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]);return(0,I.jsx)(xe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:(0,I.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(u.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),be=j.forwardRef(R(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Z,...a}=e,o=q(n);return(0,I.jsx)(E,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[xe,Se]=G(X,{}),Ce=`SelectViewport`,we=j.forwardRef(R(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Q(Ce,n),s=Se(Ce,n),c=h(t,a.onViewportChange),l=j.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(H.Slot,{scope:n,children:(0,I.jsx)(u.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:o(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Z*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[Te,Ee]=G(`SelectGroup`),De=`SelectItem`,[Oe,ke]=G(De),Ae=j.forwardRef(R(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...c}=e,l=J(De,n),f=Q(De,n),p=l.value===r,[m,g]=j.useState(a??``),[_,v]=j.useState(!1),y=d(e=>f.itemRefCallback?.(e,r,i)),b=h(t,y),x=s(),S=j.useRef(`touch`);function C(e){l.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),l.onUserSelect(r),l.onOpenChange(!1)}return R(C,`handleSelect`),(0,I.jsx)(Oe,{scope:n,value:r,disabled:i,textId:x,isSelected:p,onItemTextChange:j.useCallback(e=>{g(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(H.ItemSlot,{scope:n,value:r,disabled:i,textValue:m,children:(0,I.jsx)(u.div,{role:`option`,"aria-labelledby":x,"data-highlighted":_?``:void 0,"aria-selected":p&&_,"data-state":p?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...c,ref:b,onFocus:o(c.onFocus,()=>v(!0)),onBlur:o(c.onBlur,()=>v(!1)),onClick:o(c.onClick,e=>{i||S.current!==`mouse`&&C(e)}),onPointerUp:o(c.onPointerUp,e=>{i||S.current===`mouse`&&C(e)}),onPointerDown:o(c.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:o(c.onPointerMove,e=>{S.current=e.pointerType,i?f.onItemLeave?.():S.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:o(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:o(c.onKeyDown,e=>{i||e.target!==e.currentTarget||(f.searchRef?.current===``||e.key!==` `)&&(B.includes(e.key)&&C(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),je=`SelectItemText`,Me=j.forwardRef(R(function(e,t){let{__scopeSelect:n,className:r,style:i,...o}=e,s=J(je,n),c=Q(je,n),l=ke(je,n),f=Y(je,n),[p,m]=j.useState(null),g=d(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),_=h(t,m,l.onItemTextChange,g),v=p?.textContent,y=j.useMemo(()=>(0,I.jsx)(`option`,{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return a(()=>(b(y),()=>x(y)),[b,x,y]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(u.span,{id:l.textId,...o,ref:_}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!$(s.value)?M.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),Ne=`SelectItemIndicator`,Pe=j.forwardRef(R(function(e,t){let{__scopeSelect:n,...r}=e;return ke(Ne,n).isSelected?(0,I.jsx)(u.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Fe=`SelectScrollUpButton`,Ie=j.forwardRef(R(function(e,t){let n=Q(Fe,e.__scopeSelect),r=Se(Fe,e.__scopeSelect),[i,o]=j.useState(!1),s=h(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;o(e)};R(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Le=`SelectScrollDownButton`,Re=j.forwardRef(R(function(e,t){let n=Q(Le,e.__scopeSelect),r=Se(Le,e.__scopeSelect),[i,o]=j.useState(!1),s=h(t,r.onScrollButtonChange);return a(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;o(n)};R(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(ze,{...e,ref:s,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),ze=j.forwardRef(R(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Q(`SelectScrollButton`,n),c=j.useRef(null),l=U(n),d=j.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return j.useEffect(()=>()=>d(),[d]),a(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(u.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:o(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:o(i.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:o(i.onPointerLeave,()=>{d()})})},`SelectScrollButtonImpl`)),Be=`SelectBubbleInput`,Ve=j.forwardRef(R(function({__scopeSelect:e,...t},n){let r=J(Be,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:d,userSelection:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,g=j.useRef(null),_=h(n,g),v=i??``,y=j.useRef(v),b=j.useRef(f),x=j.useRef(!1),C=Array.from(p).some(e=>(e.props.value??``)===``);return j.useEffect(()=>{let e=g.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=f!==null&&f!==b.current;b.current=f;let i=y.current!==v;y.current=v;let a=r&&i;if(r&&!i&&f.value!==v&&!f.hasConsumerStoppedPropagation&&n){x.current=!0;try{n.call(e,f.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{x.current=!1,n.call(e,v)}return}let o=a&&!f.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,v),e.dispatchEvent(t)}},[v,f]),(0,I.jsxs)(u.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:d,onChange:e=>{x.current||a(e.target.value)},...t,style:{...S,...t.style},ref:_,defaultValue:v,children:[$(i)&&!C?(0,I.jsx)(`option`,{value:``}):null,Array.from(p)]},m)},`SelectBubbleInput`));function He(e){return typeof e==`function`}R(He,`isFunction`);function $(e){return e===``||e===void 0}R($,`shouldShowPlaceholder`);function Ue(e){let t=d(e),n=j.useRef(``),r=j.useRef(0),i=j.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}R(a,`updateSearch`),a(i)},[t]),a=j.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return j.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}R(Ue,`useTypeaheadSearch`);function We(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ge(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}R(We,`findNextItem`);function Ge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}R(Ge,`wrapArray`);var Ke={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ke.node;var qe=A(Ke);function Je({...e}){return(0,I.jsx)(ae,{"data-slot":`select`,...e})}function Ye({...e}){return(0,I.jsx)(le,{"data-slot":`select-value`,...e})}function Xe({className:e,size:t=`default`,children:n,...i}){return(0,I.jsxs)(se,{"data-slot":`select-trigger`,"data-size":t,className:r(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[n,(0,I.jsx)(ue,{asChild:!0,children:(0,I.jsx)(k,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Ze({className:e,children:t,position:n=`item-aligned`,align:i=`center`,...a}){return(0,I.jsx)(pe,{children:(0,I.jsxs)(me,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:r(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:i,...a,children:[(0,I.jsx)($e,{}),(0,I.jsx)(we,{"data-position":n,className:r(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,I.jsx)(et,{})]})})}function Qe({className:e,children:t,...n}){return(0,I.jsxs)(Ae,{"data-slot":`select-item`,className:r(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,I.jsx)(Pe,{children:(0,I.jsx)(D,{className:`pointer-events-none`})})}),(0,I.jsx)(Me,{children:t})]})}function $e({className:e,...t}){return(0,I.jsx)(Ie,{"data-slot":`select-scroll-up-button`,className:r(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,I.jsx)(qe,{})})}function et({className:e,...t}){return(0,I.jsx)(Re,{"data-slot":`select-scroll-down-button`,className:r(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,I.jsx)(k,{})})}export{Ye as a,Xe as i,Ze as n,Qe as r,Je as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./arrow-up-
|
|
1
|
+
import{n as e,t}from"./arrow-up-7Upl0C9g.js";import{L as n,T as r,w as i}from"./queries-fhKGsTGv.js";var a=n();function o(e,t){let{t:n}=i();return e.title?.trim()||n(t)}function s({pct:n,goodWhenDown:o=!0,className:s}){let{t:c}=i(),l=n>0,u=l!==o,d=l?t:e;return(0,a.jsxs)(`span`,{className:r(`inline-flex items-center gap-0.5 whitespace-nowrap text-sm font-medium tabular-nums`,n===0?`text-muted-foreground`:u?`text-positive`:`text-critical`,s),children:[n!==0&&(0,a.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),(0,a.jsx)(`span`,{className:`sr-only`,children:l?c(`delta.up`):n<0?c(`delta.down`):``}),Math.abs(Math.round(n)),`%`]})}export{o as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-IIIDTtW8.js";var t={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,B as t,D as n,F as r,I as i,M as a,N as o,O as s,j as c,k as l}from"./queries-
|
|
1
|
+
import{A as e,B as t,D as n,F as r,I as i,M as a,N as o,O as s,j as c,k as l}from"./queries-fhKGsTGv.js";var u=class extends o{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),c(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??n();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=t(i(),1);function f(t,n){let i=r(n),[o]=d.useState(()=>new u(i,t));d.useEffect(()=>{o.setOptions(t)},[o,t]);let c=d.useSyncExternalStore(d.useCallback(e=>o.subscribe(s.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),l=d.useCallback((...t)=>{o.mutate(t[0],t[1]).catch(e)},[o]);if(c.error&&a(o.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:l,mutateAsync:c.mutate}}export{f as t};
|
|
@@ -19,6 +19,12 @@ export interface CardSummary {
|
|
|
19
19
|
daysToDue: number | null;
|
|
20
20
|
cashback: CashbackPeriod | null;
|
|
21
21
|
points: PointsStatus | null;
|
|
22
|
+
/** the open statement's close and the last day a purchase is sure to land on it (needs statement_day; margin from the cashback terms, else 3) */
|
|
23
|
+
safe: {
|
|
24
|
+
closesOn: ISODate;
|
|
25
|
+
safeUntil: ISODate;
|
|
26
|
+
daysLeft: number;
|
|
27
|
+
} | null;
|
|
22
28
|
missing: string[];
|
|
23
29
|
}
|
|
24
30
|
export declare function cardList(l: Ledger, asOf: ISODate, o?: {
|
|
@@ -2,8 +2,8 @@ import { parse as parseYaml } from "yaml";
|
|
|
2
2
|
import { holdingsAt } from "../../engine/balances.js";
|
|
3
3
|
import { addDays, daysBetween, isDate } from "../../engine/dates.js";
|
|
4
4
|
import { isOpen } from "../util.js";
|
|
5
|
-
import { cashback, cardValues, feeWaiver, isAnnualFee, points, statements } from "./statements.js";
|
|
6
|
-
import { CARDS_FILE, STATEMENTS_FILE, cardsData, recordFor, termsOf, validMargin } from "./terms.js";
|
|
5
|
+
import { cashback, cardValues, feeWaiver, isAnnualFee, openClose, points, statements } from "./statements.js";
|
|
6
|
+
import { CARDS_FILE, STATEMENTS_FILE, cardsData, recordFor, termsOf, validMargin, DEFAULT_POST_MARGIN } from "./terms.js";
|
|
7
7
|
import { CARD_TYPES } from "./types.js";
|
|
8
8
|
const KINDS = new Set(["credit", "debit", "atm"]);
|
|
9
9
|
const STATUSES = new Set(["active", "locked", "inactive", "cancelled"]);
|
|
@@ -207,12 +207,20 @@ export function cardList(l, asOf, o = {}) {
|
|
|
207
207
|
daysToDue: last?.due ? daysBetween(asOf, last.due) : null,
|
|
208
208
|
cashback: cb,
|
|
209
209
|
points: points(l, a.id, asOf),
|
|
210
|
+
safe: safeDay(t, asOf),
|
|
210
211
|
missing,
|
|
211
212
|
});
|
|
212
213
|
}
|
|
213
214
|
const key = (c) => (c.toPay > 0 && c.due ? c.due : "9999-99-99");
|
|
214
215
|
return out.sort((x, y) => (key(x) < key(y) ? -1 : key(x) > key(y) ? 1 : y.owed - x.owed));
|
|
215
216
|
}
|
|
217
|
+
function safeDay(t, asOf) {
|
|
218
|
+
if (!t.statementDay)
|
|
219
|
+
return null;
|
|
220
|
+
const closesOn = openClose(asOf, t.statementDay);
|
|
221
|
+
const safeUntil = addDays(closesOn, -(t.cashback?.postMargin ?? DEFAULT_POST_MARGIN));
|
|
222
|
+
return { closesOn, safeUntil, daysLeft: daysBetween(asOf, safeUntil) };
|
|
223
|
+
}
|
|
216
224
|
/* ------------------------------------------------------------------ Needs you */
|
|
217
225
|
function cardAttention(l, asOf) {
|
|
218
226
|
const out = [];
|
package/dist/worker/mcp.js
CHANGED
|
@@ -274,6 +274,7 @@ export function buildServer(env, props, src = sourceFor(env), deps = {}) {
|
|
|
274
274
|
...(c.cashback.incomplete ? { note: "some rates not set" } : {}),
|
|
275
275
|
}
|
|
276
276
|
: null,
|
|
277
|
+
...(c.safe ? { safe_until: c.safe.safeUntil, safe_days_left: c.safe.daysLeft } : {}),
|
|
277
278
|
...(c.points ? { points: { balance: c.points.balance, pending: c.points.pending, redeem_min: c.points.redeemMin, can_redeem: c.points.canRedeem, expiring: c.points.lots.filter((x) => x.expires).slice(0, 3), expired: c.points.expired } } : {}),
|
|
278
279
|
...(c.bank ? { bank: c.bank } : {}),
|
|
279
280
|
...(per.get(c.account)?.product ? { product: per.get(c.account).product } : {}),
|
package/dist/worker/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.4.
|
|
1
|
+
export declare const VERSION = "2.4.1";
|
package/dist/worker/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by scripts/version.mjs
|
|
2
|
-
export const VERSION = "2.4.
|
|
2
|
+
export const VERSION = "2.4.1";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as e,s as t,u as n}from"./index-DvdDpUvS.js";import{L as r,T as i,a,u as o,w as s}from"./queries-Dr6hPr4g.js";import{t as c}from"./cards-BP4EqCQY.js";import{n as l}from"./shared-C3-t8uIq.js";var u=r();function d({value:e,max:t,label:n}){let r=t>0?Math.min(1,e/t):0;return(0,u.jsx)(`div`,{role:`progressbar`,"aria-label":n,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r*100),className:`h-1.5 w-full rounded-full bg-muted`,children:(0,u.jsx)(`div`,{className:`h-1.5 rounded-full bg-[var(--chart-1)]`,style:{width:`${Math.max(r?2:0,r*100)}%`}})})}var f=e=>{let t=e.cashback?.daysLeft;return t===void 0?1e6:t<0?1e5+t:t};function p({widget:r,menu:p}){let{t:m,lang:h}=s(),g=l(r,`widget.card_budgets`),_=!!o().data?.features?.cards,{data:v,error:y,isLoading:b}=a(_),x=(v?.cards??[]).filter(e=>e.status!==`cancelled`&&e.cashback?.safeUntil).sort((e,t)=>f(e)-f(t));return(0,u.jsx)(e,{title:g,titleHref:`#/cards`,menu:p,loading:_&&b,error:_?y?.message:void 0,empty:!_||v&&x.length===0?m(`budgets.empty`):void 0,children:(0,u.jsx)(`ul`,{className:`flex flex-col divide-y`,children:x.map(e=>{let r=e.cashback,a=r.daysLeft??0,o=(r.groups??[]).filter(e=>e.cap!==null);return(0,u.jsxs)(`li`,{className:`flex flex-col gap-1.5 py-2`,children:[(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,u.jsx)(`a`,{href:c(e.account),className:`min-w-0 truncate rounded-md text-sm font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50`,children:e.name}),(0,u.jsx)(`span`,{className:i(`shrink-0 text-xs tabular-nums`,a<0?`text-muted-foreground`:a<=3?`font-medium text-warning`:`text-muted-foreground`),children:a<0?m(`budgets.nextPeriod`):m(`budgets.safe`,{date:t(r.safeUntil,h,{day:`2-digit`,month:`2-digit`}),n:a})})]}),r.minSpend!==null&&!r.minMet&&(0,u.jsx)(`p`,{className:`text-xs text-warning`,children:m(`cards.minNeed`,{amount:n(r.needForMin,h),min:n(r.minSpend,h)})}),o.map(e=>(0,u.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,u.jsxs)(`span`,{className:`min-w-0 truncate`,children:[e.label,e.rate!==null&&(0,u.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.rate,`%`]}),e.inStore&&(0,u.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,m(`cards.inStore`)]})]}),(0,u.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:e.room?m(`budgets.room`,{amount:n(e.room,h)}):m(`budgets.full`)})]}),(0,u.jsx)(d,{value:e.earned,max:e.cap,label:e.label})]},e.label)),!o.length&&r.roomSpend!=null&&(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.roomSpend>0?m(r.roomEstimate?`cards.roomEstimate`:`cards.room`,{amount:n(r.roomSpend,h)}):m(`budgets.full`)}),e.points?.canRedeem&&e.points.redeemMin!==null&&(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:m(`budgets.points`,{points:n(e.points.balance,h)})})]},e.account)})})})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DI8vbiOO.js";var t={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-DI8vbiOO.js";var t={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};t.node;var n=e(t);export{n as t};
|