tokentracker-cli 0.87.1 → 0.87.2
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/dashboard/dist/assets/{AchievementBadge-HMyiDgSW.js → AchievementBadge-C468-Rsw.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-CvSRglOk.js → AchievementsPage-CZWzSdiH.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-C5EttnRJ.js → AchievementsSection-DXt6VbwH.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-CMrIWtRh.js → BadgeDetailModal-BtGvpqQm.js} +1 -1
- package/dashboard/dist/assets/{Card-j0PoKNVi.js → Card-DZ-_fXkw.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-CpMXIDm6.js → ClawdAnimated-9rXaHo1-.js} +1 -1
- package/dashboard/dist/assets/{CommandPalette-BQVCHqxf.js → CommandPalette-sqIvZNsH.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-K8Jfw2Sp.js → CommunityStatsModal-c8VohIqQ.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-Ci8UM9GC.js → ConfirmModal-Ct2HLdds.js} +1 -1
- package/dashboard/dist/assets/{Controls-CzqxI8mV.js → Controls-DPtXGUGi.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-C65hbl8o.js +1 -0
- package/dashboard/dist/assets/{DevicePage-iLtjOHbK.js → DevicePage-Ds4GEuqY.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-DpqbOjK1.js → DialogClose-B2IAbJG4.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DeRza-LI.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-CHvX9I6f.js → DialogTitle-BIwLH6gA.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-PYu_vYZJ.js → FadeIn-DPS7_DOB.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-BgaN38HY.js → HeaderGithubStar-CsSgr9Hd.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-DIGWJnwA.js → HoverTooltip-CLGZW2d-.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-CAgOfnQK.js → IpCheckPage-DEM_uk69.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-DBAozV9A.js → LandingPage-BQ3YzZ68.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-Bcz1JUbC.js → LeaderboardAvatar-ySznr4Ml.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BnzlsgL5.js → LeaderboardPage-Br4JCoVE.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-D9Ohzup_.js → LeaderboardProfileModal-Drvsb5xF.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-Dly5CxZA.js → LeaderboardProfilePage-BD0P-zZF.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-r3SxrYQZ.js → LimitsPage-Mbn2mj6S.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-BO4X70A3.js → LocalOnlyNotice-BsKgtoVa.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-Clafry4p.js → LoginCard-CTQDdHcx.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-C5rEYAEU.js → LoginModal-BxCyLDEW.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-CT27nQAo.js → LoginPage-ftxnX8g1.js} +1 -1
- package/dashboard/dist/assets/{PetPage-CX7uXP3E.js → PetPage-CQsfqsm8.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-C9z-Tti_.js → PopoverPopup-C16r8jQC.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-C7KoQJF1.js → ProviderIcon-7Tkq9_m6.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-CxpERa5n.js → ResetPasswordPage-D-MPpQd1.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-CxNTG8xY.js → SegmentedControl-CYFrzu9w.js} +1 -1
- package/dashboard/dist/assets/{Select-CeqMgH_w.js → Select-Dp4V9p6t.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-C0xexMQo.js → SelectItemText-CxhBeoxx.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-Du-c3oKi.js → ServiceStatusPage-BT6hvvLW.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-BoxarCQo.js → SessionsPage-BopeZBiH.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-C21iHQrS.js → SettingsPage-D03GJJBd.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-CNFg35-t.js → SkillsPage-Cr8O6eOH.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-C66WkuEi.js → TokenGalaxy-BoUsrUEs.js} +1 -1
- package/dashboard/dist/assets/{ToolbarRootContext-DEJ2rZnD.js → ToolbarRootContext-CwRaHhMN.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-CRo_dn81.js → TrendMonitor-BV2ugEsw.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CUWKRjBX.js → WidgetsPage-B7r4mvrw.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-BbcgPrhv.js → WrappedPage-CFU9l22i.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-Bnwhf2Ay.js → __vite-browser-external-Db9onipF.js} +2 -2
- package/dashboard/dist/assets/{agent-logos-CdqF_ZVu.js → agent-logos-DSSn_SPi.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-Bo-mycRz.js → arrow-up-right-COvrArNz.js} +1 -1
- package/dashboard/dist/assets/{check-D1cxLlaS.js → check-CasSqiev.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-Cqu6YRtu.js → chevron-right-B1PMeNoD.js} +1 -1
- package/dashboard/dist/assets/{copy-DdFT4OsA.js → copy-D67vycfp.js} +1 -1
- package/dashboard/dist/assets/{download-BaGijNSk.js → download-adOCFO2v.js} +1 -1
- package/dashboard/dist/assets/{external-link-BDXdiGgV.js → external-link-DVanKEuy.js} +1 -1
- package/dashboard/dist/assets/{flame-nWYIAJO7.js → flame-RbiHZM9b.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DKoNQugI.js → format-tokens-DhMp1e1L.js} +1 -1
- package/dashboard/dist/assets/{icons-DUVL4ucb.js → icons-BC0p_aGr.js} +1 -1
- package/dashboard/dist/assets/{index-BfR-FhBV.js → index-A41xjc83.js} +1 -1
- package/dashboard/dist/assets/{index-hwecSjsn.js → index-CaRyTJ6K.js} +1 -1
- package/dashboard/dist/assets/{index-B8orqoRS.js → index-DrgBqR3o.js} +1 -1
- package/dashboard/dist/assets/{info-D8dPbHW_.js → info-D9LwqlnC.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-aVihEk9O.js → limits-providers-CRHpXhmW.js} +1 -1
- package/dashboard/dist/assets/{link-2-BPrWtheW.js → link-2-B5f4qFR0.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-R8Mc26Py.js → loader-circle-DCmwZEdS.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-CDdVCGkE.js → maximize-2-BMalEDCZ.js} +1 -1
- package/dashboard/dist/assets/{provider-display-DjIxT1Tj.js → provider-display-qMFRUZHm.js} +1 -1
- package/dashboard/dist/assets/{react-CPpseYXr.js → react-BnaPNGj8.js} +1 -1
- package/dashboard/dist/assets/{search-CwXFsVWP.js → search-BrqBkLs2.js} +1 -1
- package/dashboard/dist/assets/{skills-api-BaWEPqAA.js → skills-api-vo3iM6yD.js} +1 -1
- package/dashboard/dist/assets/{store-Dvj7C_TU.js → store-BwMVXuz3.js} +1 -1
- package/dashboard/dist/assets/{terminal-HFPAmRVo.js → terminal-BiyUh_8k.js} +1 -1
- package/dashboard/dist/assets/{trash-2-BlMMnsHP.js → trash-2-DAr4sqkX.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-BnQkgDNp.js → use-community-stats-Cg48Zphy.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-CyRX2tSS.js → use-limits-display-prefs-DfKtH1Zn.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-D5J9JQc3.js → use-ordered-list-CnXfrWeF.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BIgYrbON.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-CfCTFOw1.js → use-session-efficiency-pref-CMDTCAAd.js} +1 -1
- package/dashboard/dist/assets/{use-transform-Cb0xIsIA.js → use-transform-B2d9Txt5.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-Bcr5Rvg1.js → use-usage-limits-CJbTUl9W.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-DePNHGhs.js → useCurrency-B0hJte5f.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-hvMIIQdN.js → useScrollLock-DuosKdSB.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-D0HGlu5w.js → useTokenFormat-DB8pKLFM.js} +1 -1
- package/dashboard/dist/assets/{zap-BYcuWUXQ.js → zap-rbzC4XgP.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/ip-check.html +1 -1
- package/dashboard/dist/leaderboard.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/commands/device-login.js +12 -7
- package/src/commands/init.js +3 -0
- package/src/commands/sync.js +115 -20
- package/src/lib/grok-context-breakdown.js +124 -19
- package/src/lib/grok-limits.js +374 -9
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/runtime-config.js +23 -3
- package/dashboard/dist/assets/DashboardPage-CYT2z3MQ.js +0 -1
- package/dashboard/dist/assets/DialogDescription-Cjk1aws-.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-Bb_7eQY5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as c}from"./__vite-browser-external-
|
|
1
|
+
import{m as c}from"./__vite-browser-external-Db9onipF.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as l}from"./__vite-browser-external-
|
|
1
|
+
import{x as l}from"./__vite-browser-external-Db9onipF.js";const i="tokentracker-skills";async function r(t){const e=new URL(`/functions/${i}`,window.location.origin);if(t)for(const[c,s]of Object.entries(t))s!=null&&s!==""&&e.searchParams.set(c,String(s));const o=await fetch(e.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),a=await o.json().catch(()=>null);if(!o.ok)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}async function n(t){const e=await l(),o=await fetch(`/functions/${i}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e},cache:"no-store",body:JSON.stringify(t)}),a=await o.json().catch(()=>null);if(!o.ok||a?.ok===!1)throw new Error(a?.error||`Request failed with HTTP ${o.status}`);return a}function f(){return r({mode:"installed"})}function d(t={}){return r({mode:"discover",...t.force?{force:1}:{}})}function p(t,e=0,o=20){return r({mode:"search",q:t,offset:e,limit:o})}function k(){return r({mode:"repos"})}function S(t,e){return n({action:"install",skill:t,targets:e})}function h(t){return n({action:"uninstall",id:t})}function g(t){return n({action:"restore",id:t})}function m(t,e){return n({action:"set_targets",id:t,targets:e})}function w(t,e){return n({action:"import_local",directory:t,targets:e})}function y(t,e){return n({action:"delete_local",directory:t,targets:e||[]})}function j(t){return n({action:"add_repo",repo:t})}function T(t,e){return n({action:"remove_repo",owner:t,name:e})}function R(t={}){return r({mode:"popular",...t.force?{force:1}:{}})}function _(t={}){return r({mode:"updates",...t.force?{force:1}:{}})}function v(t={}){return r({mode:"skill_usage",...t.force?{force:1}:{}})}export{k as a,R as b,_ as c,d,v as e,y as f,f as g,m as h,S as i,w as j,T as k,j as l,g as r,p as s,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as o,Y as r}from"./__vite-browser-external-
|
|
1
|
+
import{W as o,Y as r}from"./__vite-browser-external-Db9onipF.js";import{F as u,P as d}from"./useScrollLock-DuosKdSB.js";function a(){return new u({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new d,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function m(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:a(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r}}function P(e,n,g=!1){return new u({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:g,onOpenChange:void 0})}const t=o(e=>e.triggerIdProp??e.activeTriggerId),i=o(e=>e.openProp??e.open),p=o(e=>(e.popupElement?.id??e.floatingId)||void 0);function l(e,n){return n!==void 0&&i(e)&&t(e)===n}function s(e,n){return l(e,n)?!0:n!==void 0&&i(e)&&t(e)==null&&e.triggerCount===1}const E={open:i,mounted:o(e=>e.mounted),transitionStatus:o(e=>e.transitionStatus),floatingRootContext:o(e=>e.floatingRootContext),triggerCount:o(e=>e.triggerCount),preventUnmountingOnClose:o(e=>e.preventUnmountingOnClose),payload:o(e=>e.payload),activeTriggerId:t,activeTriggerElement:o(e=>e.mounted?e.activeTriggerElement:null),popupId:p,isTriggerActive:o((e,n)=>n!==void 0&&t(e)===n),isOpenedByTrigger:o((e,n)=>l(e,n)),isMountedByTrigger:o((e,n)=>n!==void 0&&t(e)===n&&e.mounted),triggerProps:o((e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:o((e,n)=>s(e,n)?p(e):void 0),popupProps:o(e=>e.popupProps),popupElement:o(e=>e.popupElement),positionerElement:o(e=>e.positionerElement)};export{m as a,P as c,E as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e}from"./__vite-browser-external-
|
|
1
|
+
import{m as e}from"./__vite-browser-external-Db9onipF.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a}from"./__vite-browser-external-
|
|
1
|
+
import{m as a}from"./__vite-browser-external-Db9onipF.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
|
package/dashboard/dist/assets/{use-community-stats-BnQkgDNp.js → use-community-stats-Cg48Zphy.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,g as N,b as M}from"./__vite-browser-external-
|
|
1
|
+
import{r as p,g as N,b as M}from"./__vite-browser-external-Db9onipF.js";const D=6e3,S=2500,E=100;function h(t,r){let o;const n=new Promise((a,i)=>{o=setTimeout(()=>i(new Error("landing stats timeout")),r)});return Promise.race([t,n]).finally(()=>{o!=null&&clearTimeout(o)})}const A=5*6e4,P=1440*6e4,k="tokentracker:community-stats:v2";let s=null;function C(t){const r=Number(t?.tokenFloor)||0,o=Number(t?.totalEntries)||0;return!(r>0)||!(o>0)?null:{tokenFloor:r,totalEntries:o,top:Array.isArray(t?.top)?t.top:[],topModels:Array.isArray(t?.topModels)?t.topModels:[],providers:Array.isArray(t?.providers)?t.providers:[],dailyGrowth:Array.isArray(t?.dailyGrowth)?t.dailyGrowth:[],tokenMix:Array.isArray(t?.tokenMix)?t.tokenMix:[],userDistribution:Array.isArray(t?.userDistribution)?t.userDistribution:[],platforms:Array.isArray(t?.platforms)?t.platforms:[],activeDevelopersTotal:Number(t?.activeDevelopersTotal)||0,activeDevelopers30d:Number(t?.activeDevelopers30d)||0,tokens30d:Number(t?.tokens30d)||0,tokenGrowthPct:t?.tokenGrowthPct!=null&&Number.isFinite(Number(t.tokenGrowthPct))?Number(t.tokenGrowthPct):null,developerGrowthPct:t?.developerGrowthPct!=null&&Number.isFinite(Number(t.developerGrowthPct))?Number(t.developerGrowthPct):null,generatedAt:typeof t?.generatedAt=="string"?t.generatedAt:null}}function G(){if(typeof window>"u"||!window.localStorage)return null;try{const t=JSON.parse(window.localStorage.getItem(k)||"null"),r=Number(t?.cachedAt)||0,o=C(t?.data),n=Date.now()-r;return!o||n<0||n>P?null:{data:o,isFresh:n<A}}catch{return null}}function I(t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k,JSON.stringify({cachedAt:Date.now(),data:t}))}catch{}}function F(){if(s&&Date.now()-s.at<A)return s.promise;const t=Promise.all([h(N({period:"total",limit:E,offset:0}),D),h(M(),S).catch(()=>null)]);return s={at:Date.now(),promise:t},t.catch(()=>{s?.promise===t&&(s=null)}),t}function O({enabled:t=!0}={}){const[r]=p.useState(()=>G()),[o,n]=p.useState(()=>r?{status:"ready",...r.data}:{status:"loading",tokenFloor:null,totalEntries:null,top:[]});return p.useEffect(()=>{if(!t||r?.isFresh)return;let a=!1,i=null,u=null;const y=async()=>{try{const[l,e]=await F();if(a)return;const c=Array.isArray(l?.entries)?l.entries:[],b=c.reduce((m,T)=>m+(Number(T?.total_tokens)||0),0),d=Number(e?.total_tokens)||0;d>0||(s=null);const w=Number(r?.data?.tokenFloor)||0,f=d>0?d:w>0?w:b;if(!c.length||!(f>0)){n(m=>({...m,status:"error"}));return}const g=Array.isArray(e?.top_models)?e.top_models:r?.data?.topModels||[],_={tokenFloor:f,totalEntries:Number(l?.total_entries)||c.length,top:c.slice(0,3),topModels:g,providers:Array.isArray(e?.providers)?e.providers:[],dailyGrowth:Array.isArray(e?.daily_growth)?e.daily_growth:[],tokenMix:Array.isArray(e?.token_mix)?e.token_mix:[],userDistribution:Array.isArray(e?.user_distribution)?e.user_distribution:[],platforms:Array.isArray(e?.platforms)?e.platforms:[],activeDevelopersTotal:Number(e?.active_developers_total)||0,activeDevelopers30d:Number(e?.active_developers_30d)||0,tokens30d:Number(e?.tokens_30d)||0,tokenGrowthPct:e?.token_growth_pct==null?null:Number(e.token_growth_pct),developerGrowthPct:e?.developer_growth_pct==null?null:Number(e.developer_growth_pct),generatedAt:typeof e?.generated_at=="string"?e.generated_at:null};n({status:"ready",..._}),d>0&&I(_)}catch{a||n(e=>e.status==="ready"?e:{...e,status:"error"})}};return typeof window<"u"&&"requestIdleCallback"in window?i=window.requestIdleCallback(y,{timeout:1500}):u=setTimeout(y,400),()=>{a=!0,i!=null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(i),u!=null&&clearTimeout(u)}},[t,r]),o}export{O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,q as D,t as K,v as j,w as J}from"./__vite-browser-external-
|
|
1
|
+
import{r as a,q as D,t as K,v as j,w as J}from"./__vite-browser-external-Db9onipF.js";import{L as q}from"./limits-providers-CRHpXhmW.js";const p=q,g="tt.limits.providerOrder",E="tt.limits.providerVisibility",h="tt.limits.displayMode",O="tt.limits.updatedAt",M="limitsPreferences",B="limitsDisplayMode",w=Object.freeze({USED:"used",REMAINING:"remaining"}),v=new Set(Object.values(w)),L=new Set([g,E,h,O]);function A(){return[...p]}function b(){return Object.fromEntries(p.map(e=>[e,!0]))}function _(e){const t=[];if(Array.isArray(e))for(const n of e)p.includes(n)&&!t.includes(n)&&t.push(n);for(const n of p)t.includes(n)||t.push(n);return t}function N(e){const t=b();if(!e||typeof e!="object"||Array.isArray(e))return t;for(const n of p)typeof e[n]=="boolean"&&(t[n]=e[n]);return t}function G(e){return v.has(e)?e:w.USED}function y(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const t=e.trim();if(t==="")return;const n=Number(t);return Number.isSafeInteger(n)?n:void 0}}}function m(e={}){const t=e&&typeof e=="object"?e:{};return{displayMode:G(t.displayMode),providerOrder:_(t.providerOrder),providerVisibility:N(t.providerVisibility),updatedAt:y(t.updatedAt)}}function F(){if(typeof window>"u")return A();try{const e=window.localStorage.getItem(g);return _(e?JSON.parse(e):void 0)}catch{return A()}}function H(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(E);return N(e?JSON.parse(e):void 0)}catch{return b()}}function Q(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(h);return v.has(e)?e:w.USED}catch{return w.USED}}function W(){if(!(typeof window>"u"))try{return y(window.localStorage.getItem(O))}catch{return}}function X(){if(typeof window>"u")return!1;try{for(const e of L)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function S(){return m({displayMode:Q(),providerOrder:F(),providerVisibility:H(),updatedAt:W()})}function Z(e){if(typeof window>"u")return;const t=m(e);try{window.localStorage.setItem(g,JSON.stringify(t.providerOrder)),window.localStorage.setItem(E,JSON.stringify(t.providerVisibility)),window.localStorage.setItem(h,t.displayMode),t.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(t.updatedAt))}catch(n){console.warn("[tokentracker] limits preferences localStorage write failed:",n)}}function $(e){const t=m(e);return{displayMode:t.displayMode,providerOrder:[...t.providerOrder],providerVisibility:{...t.providerVisibility},updatedAt:t.updatedAt??null}}function ee(...e){let t;for(const s of e){const c=y(s);c!==void 0&&(t=t===void 0?c:Math.max(t,c))}const n=Date.now();return t!==void 0&&n<=t?t+1:n}function te(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function re(e,t){return p.every(n=>e[n]===t[n])}function k(e,t){return e.displayMode===t.displayMode&&te(e.providerOrder,t.providerOrder)&&re(e.providerVisibility,t.providerVisibility)}function ie(e,t){return k(e,t)&&y(e.updatedAt)===y(t.updatedAt)}function V(e,t){const n=y(e.updatedAt),s=y(t.updatedAt);return n!==void 0&&(s===void 0||n>s)}function de(){const[e,t]=a.useState(S),n=a.useRef(e),s=a.useCallback((o,r={})=>{const i=m(o);return n.current=i,t(i),r.writeLocal&&Z(i),i},[]),c=a.useCallback(o=>{D()&&K(M,$(o))},[]),u=a.useCallback(o=>{const r=S(),i=V(r,n.current)?s(r):n.current,d=m(o(i));if(k(i,d))return;const f=ee(r.updatedAt,i.updatedAt),l=s({...d,updatedAt:f},{writeLocal:!0});c(l)},[s,c]),P=a.useCallback(o=>{v.has(o)&&u(r=>({...r,displayMode:o}))},[u]),I=a.useCallback(o=>{if(!v.has(o))return;const r=S();if(r.updatedAt!==void 0){s(r);return}s({...r,displayMode:o,updatedAt:void 0},{writeLocal:!0})},[s]);a.useEffect(()=>{if(!D())return;const o=j(r=>{const i=r?.[M];if(i&&typeof i=="object"){const d=m(i);if(!X()){s(d,{writeLocal:!0});return}const f=S();if(V(d,f))s(d,{writeLocal:!0});else{const l=s(f);ie(d,f)||c(l)}return}I(r?.[B])});return J(),o},[I,s,c]),a.useEffect(()=>{if(typeof window>"u")return;const o=r=>{(r.key===null||L.has(r.key))&&s(S())};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[s]);const U=a.useCallback(o=>{p.includes(o)&&u(r=>({...r,providerVisibility:{...r.providerVisibility,[o]:!r.providerVisibility[o]}}))},[u]),x=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<=0)return r;const d=[...r.providerOrder];return[d[i-1],d[i]]=[d[i],d[i-1]],{...r,providerOrder:d}})},[u]),C=a.useCallback(o=>{u(r=>{const i=r.providerOrder.indexOf(o);if(i<0||i>=r.providerOrder.length-1)return r;const d=[...r.providerOrder];return[d[i],d[i+1]]=[d[i+1],d[i]],{...r,providerOrder:d}})},[u]),R=a.useCallback((o,r)=>{o!==r&&u(i=>{const d=i.providerOrder.indexOf(o),f=i.providerOrder.indexOf(r);if(d<0||f<0)return i;const l=[...i.providerOrder],[z]=l.splice(d,1);return l.splice(f,0,z),{...i,providerOrder:l}})},[u]),Y=a.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:A(),providerVisibility:b()}))},[u]),T=a.useMemo(()=>e.providerOrder.filter(o=>e.providerVisibility[o]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,setDisplayMode:P,visibleOrdered:T,toggle:U,moveUp:x,moveDown:C,moveToward:R,reset:Y}}export{w as L,de as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,d as P,a2 as Oe}from"./__vite-browser-external-
|
|
1
|
+
import{r as c,d as P,a2 as Oe}from"./__vite-browser-external-Db9onipF.js";function In(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:wt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Vt(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:wt(e)?mt(e)?e:Be(e)||Vt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function yt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Mn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ke(e){const t=yt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ht(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function qt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,a)=>{const s=Object.entries(a);for(const[l,u]of s){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=qt(1),ze=qt(-1);function An(e){return"clientX"in e&&"clientY"in e}function xt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function On(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function gt(e){if(On(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return An(e)?{x:e.clientX,y:e.clientY}:null}const _e=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Nt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tn(e){return e.matches(Nt)?e:e.querySelector(Nt)}const Nn={display:"none"};function Ln(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:Nn},n)}function kn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gt=c.createContext(null);function Pn(e){const t=c.useContext(Gt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Bn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(a=>{var s;return(s=a[o])==null?void 0:s.call(a,i)})},[e]),t]}const Fn={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o}from"./__vite-browser-external-Db9onipF.js";import{h as r,i as t,p as s}from"./react-BnaPNGj8.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as u,r as n}from"./__vite-browser-external-
|
|
1
|
+
import{m as u,r as n}from"./__vite-browser-external-Db9onipF.js";const f=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E=u("pencil",f),i="tt.qualityPerDollar.enabled";function l(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(i)==="1"}catch{return!1}}function y(){const[r,o]=n.useState(l);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===i)&&o(l())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(i,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!l()),[a]);return{enabled:r,setEnabled:a,toggle:s}}const d="tt.sessionEfficiency.enabled";function c(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(d)==="1"}catch{return!1}}function g(){const[r,o]=n.useState(c);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===d)&&o(c())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(d,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!c()),[a]);return{enabled:r,setEnabled:a,toggle:s}}export{E as P,g as a,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-
|
|
1
|
+
import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-BnaPNGj8.js";import{r as f}from"./__vite-browser-external-Db9onipF.js";function x(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],s=t[1+n],c=t[2+n],r=t[3+n],a=y(s,c,r);return e?a(o):a}function E(t){const e=l(()=>A(t)),{isStatic:n}=f.useContext(p);if(n){const[,o]=f.useState(t);f.useEffect(()=>e.on("change",o),[])}return e}function m(t,e){const n=E(e()),o=()=>n.set(e());return o(),h(()=>{const s=()=>V.preRender(o,!1,!0),c=t.map(r=>r.on("change",s));return()=>{c.forEach(r=>r()),C(o)}}),n}function L(t){u.current=[],t();const e=m(u.current,t);return u.current=void 0,e}function g(t,e,n,o){if(typeof t=="function")return L(t);const c=typeof e=="function"?e:x(e,n,o),r=Array.isArray(t)?i(t,c):i([t],([d])=>c(d)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(r.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),r}function i(t,e){const n=l(()=>[]);return m(t,()=>{n.length=0;const o=t.length;for(let s=0;s<o;s++)n[s]=t[s].get();return e(n)})}export{g as a,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as _,ae as K,r as w,c as g,af as F,ag as x,ah as b}from"./__vite-browser-external-
|
|
1
|
+
import{q as _,ae as K,r as w,c as g,af as F,ag as x,ah as b}from"./__vite-browser-external-Db9onipF.js";import{l as M}from"./limits-providers-CRHpXhmW.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function v(){return _()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function L(e){if(typeof window>"u")return()=>{};const i=t=>{const a=t?.detail?.status;typeof a=="string"&&(E=a),e(v())};return window.addEventListener(S,i),e(v()),_()&&K({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function I(){if(_()){K({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function O(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function U(){const[e,i]=w.useState(O),[t,a]=w.useState("unknown");w.useEffect(()=>L(a),[]);const y=w.useCallback(async n=>{const l=!!n;l&&await I();try{window.localStorage.setItem(p,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:t==="denied"}}function A(e,i){if(!(e>0))return null;const t=(e-i)/e;return Number.isFinite(t)?Math.min(Math.max(t,0),1):null}function z(e,i,t=.03){return e>i+t}function D(e){const i=Math.max(0,Math.floor(e)),t=Math.floor(i/3600);return t>24?`${Math.floor(t/24)}d`:t>0?`${t}h`:`${Math.floor(i/60)}m`}function j(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const t=i[e.windowSecondsField];return typeof t=="number"&&t>0?t:null}return null}function R(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function C({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:y=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return l;const r=Math.max(0,(t-y)/1e3),s=A(i,r);if(s==null)return l;if(l.expectedPercent=Math.round(s*100),l.paceOver=z(n,s),n>=.05){const u=a==="remaining"?1-s:s;l.pacePercent=u*100}if(s>.02&&n>0){const u=i*s,c=n/u,m=n/s;m>=1&&c>0?l.runsOutEta=D((1-n)/c):l.projectedEnd=Math.round(Math.min(m,1)*100)}return l}const T={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(t=>({key:`scoped-${t.label}`,label:t.label,window:t,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{extra:"kiro_credits",windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,t=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:t,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}},qoder:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_ultimate",window:e.secondary_window,timeKind:"expiry"}]}}},P="tt.limitAlerts.cycles.v1";function q(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function $(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function B(e,{now:i=Date.now()}={}){const t=[],a=T;for(const[y,n]of Object.entries(e||{})){const l=a[y];if(!(!n?.configured||n.error||!l))for(const r of l.windows(n)){if(!r.window)continue;const s=Number(r.pctField==="utilization"?r.window.utilization:r.window.used_percent),u=r.resetField==="resets_at"?r.window.resets_at:r.window.reset_at,c=R(u),m=C({usedPercent:s,windowSeconds:j(r,r.window),resetMs:c,mode:"used",now:i});!m.runsOutEta||!m.paceOver||s<20||!(c>i)||t.push({id:`${y}:${r.key}:${c}`,providerId:y,windowKey:r.key,resetMs:c,usedPercent:s,runsOutEta:m.runsOutEta})}}return t}function V(e){const i=q(),t=B(e);for(const n of t){if(i[n.id])continue;const l=M(n.providerId),r=g("limits.alert.title",{provider:l}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let u=F({title:r,body:s,id:n.id});!u&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(r,{body:s,tag:n.id}),u=!0),u&&(i[n.id]=Date.now())}const a=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([n,l])=>{const r=Number(n.split(":").at(-1));return Number.isFinite(r)?r>=a:Number(l)>=a}).slice(-100));return $(y),t.length}function W(e){const i=!!e?.initialState,[t,a]=w.useState(()=>i?e?.initialState?.data??null:null),[y,n]=w.useState(()=>i?e?.initialState?.error??null:null),[l,r]=w.useState(!i),s=!!e?.initialRefresh,u=!!e?.publishToPreloadCache;w.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&V(t)}catch{}},[t]);const c=w.useCallback((o,d)=>{!u||!o||typeof o!="object"||x(o,{source:d})},[u]),m=w.useCallback(async()=>{try{const o=await b({refresh:!0}),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"manual-refresh")}catch(o){n(o?.message||String(o))}},[c]),k=w.useCallback(async()=>{try{const o=await b(),d=o&&typeof o=="object"?o:null;a(d),n(null),c(d,"page-load")}catch(o){n(o?.message||String(o))}},[c]);return w.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const o=15e3;let d=Date.now();const f=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-d<o||(d=h,k())};return window.addEventListener("focus",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("focus",f),document.removeEventListener("visibilitychange",f)}},[k]),w.useEffect(()=>{if(i&&!s)return;let o=!1;return(async()=>{try{const d=await b();if(o)return;const f=d&&typeof d=="object"?d:null;a(f),n(null),c(f,"page-load")}catch(d){if(o)return;n(d?.message||String(d))}finally{o||r(!1)}})(),()=>{o=!0}},[i,s,c]),{data:t,error:y,isLoading:l,refresh:m}}export{T as P,j as a,U as b,C as c,R as r,V as s,W as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,C as t,D as r,y as c}from"./__vite-browser-external-
|
|
1
|
+
import{r as e,C as t,D as r,y as c}from"./__vite-browser-external-Db9onipF.js";const s=Object.freeze({currency:c,rate:1,symbol:"$",rates:{...r},rateSource:"default",rateFetchedAt:null,setCurrency:()=>{}});function a(){return e.useContext(t)??s}export{a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bM as Xe,bN as _t,aI as Ot,aH as H,aJ as wt,aV as K,bO as Ct,bE as je,j as Se,bJ as ze,r as g,Q as V,bP as ot,bQ as Gt,aK as it,aT as Ne,bt as Dt,bR as ct,bS as xt,aX as x,aW as ke,bb as he,bT as Ve,bU as le,bV as ae,aF as C,a_ as Ut,bW as It,bX as Je,bu as Kt,b8 as ut,b3 as lt,b5 as Xt,bY as Vt,aE as be,b7 as $t,bZ as qt,E as Pe,b2 as jt,b_ as Qe,aM as Ye,b$ as zt,c0 as He,a$ as Jt,aS as Le,b0 as Qt,aU as Ie,bA as _e,bz as Zt,c1 as en,bx as tn,aG as nn,W as Te,c2 as me,c3 as rn,aP as sn,aA as on,Y as Ge,c4 as at,bL as cn,bF as Ze}from"./__vite-browser-external-Bnwhf2Ay.js";function Fe(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Fe(e,s.id,n)])}function ft(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function un(e){e.preventDefault(),e.stopPropagation()}function ln(e){return"nativeEvent"in e}function an(e){return e.pointerType===""&&e.isTrusted?!0:Xe&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fn(e){return _t?!1:!Xe&&e.width===0&&e.height===0||Xe&&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 qn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function dn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=Ot(pn,e).current;return t.next=e,H(t.effect),t}function pn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let We=0;function De(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(We);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),wt;const i=requestAnimationFrame(o);return We=i,()=>{We===i&&(cancelAnimationFrame(i),We=0)}}const Ue={inert:new WeakMap,"aria-hidden":new WeakMap},dt="data-base-ui-inert",$e={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ke=0;function gn(e){return $e[e]}function kt(e){return e?Ct(e)?e.host:kt(e.parentNode):null}const pt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),gt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},ht=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{je(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function hn(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const h=pt(t,e),f=s?ht(t,gt(h),new Set(h)):[],k=[],L=[];if(o){const b=Ue[o],T=gn(o);u=T,i=b;const A=pt(t,Array.from(t.querySelectorAll("[aria-live]"))),P=h.concat(A);ht(t,gt(P),new Set(P)).forEach(y=>{const E=y.getAttribute(o),Q=E!==null&&E!=="false",B=(b.get(y)||0)+1;b.set(y,B),k.push(y),B===1&&Q&&T.add(y),Q||y.setAttribute(o,o==="inert"?"":"true")})}return s&&f.forEach(b=>{const T=(xe.get(b)||0)+1;xe.set(b,T),L.push(b),T===1&&b.setAttribute(dt,"")}),Ke+=1,()=>{i&&k.forEach(b=>{const A=(i.get(b)||0)-1;i.set(b,A),A||(!u?.has(b)&&o&&b.removeAttribute(o),u?.delete(b))}),s&&L.forEach(b=>{const T=(xe.get(b)||0)-1;xe.set(b,T),T||b.removeAttribute(dt)}),Ke-=1,Ke||(Ue.inert=new WeakMap,Ue["aria-hidden"]=new WeakMap,$e.inert=new WeakSet,$e["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function mt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=K(e[0]).body;return hn(e,o,n,r,{mark:s})}function Pt(){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 mn{nodesRef={current:[]};events=Pt();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 Ft=g.createContext(null),Mt=g.createContext(null),et=()=>g.useContext(Ft)?.id||null,tt=e=>{const t=g.useContext(Mt);return e??t};function jn(e){const t=ze(),n=tt(e),r=et();return H(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function zn(e){const{children:t,id:n}=e,r=et();return Se.jsx(Ft.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Jn(e){const{children:t,externalTree:n}=e,r=Ot(()=>n??new mn).current;return Se.jsx(Mt.Provider,{value:r,children:t})}function bn(e,t){const n=Ye(be(e));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 bt=20;let fe=[];function nt(){fe=fe.filter(e=>e.deref()?.isConnected)}function Et(e){nt(),e&&je(e)!=="body"&&(fe.push(new WeakRef(e)),fe.length>bt&&(fe=fe.slice(-bt)))}function yt(){return nt(),fe[fe.length-1]?.deref()}function En(e){return e?Qe(e)?e:xt(e)[0]||e:null}function Rt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Qe(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Qn(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:k,previousFocusableElement:L,beforeContentFocusGuardRef:b,externalTree:T,getInsideElements:A}=e,P="rootStore"in t?t.rootStore:t,_=P.useState("open"),y=P.useState("domReferenceElement"),E=P.useState("floatingElement"),{events:Q,dataRef:B}=P.context,$=V(()=>B.current.floatingContext?.nodeId),J=s===!1,G=ot(y)&&J,se=Ae(s),F=Ae(o),q=Ae(f),ve=Ae(_),W=tt(T),R=Gt(),Y=g.useRef(!1),oe=g.useRef(!1),ee=g.useRef(!1),te=g.useRef(null),Ee=g.useRef(""),de=g.useRef(""),pe=g.useRef(null),ye=g.useRef(null),S=it(pe,b,R?.beforeInsideRef),j=it(ye,R?.afterInsideRef),ie=Ne(),ce=Ne(),Oe=Dt(),Me=R!=null,p=ct(E),ne=V((m=p)=>m?xt(m):[]),Z=V(()=>A?.().filter(m=>m!=null)??[]);g.useEffect(()=>{if(r||!u)return;function m(N){N.key==="Tab"&&C(p,ae(K(p)))&&ne().length===0&&!G&&un(N)}const I=K(p);return x(I,"keydown",m)},[r,p,u,G,ne]),g.useEffect(()=>{if(r||!_)return;const m=K(p);function I(){ee.current=!1}function N(z){const a=be(z),O=Z(),d=C(E,a)||C(y,a)||C(R?.portalNode,a)||O.some(M=>M===a||C(M,a));ee.current=!d,de.current=z.pointerType||"keyboard",a?.closest(`[${$t}]`)&&(oe.current=!0,ce.start(0,()=>{oe.current=!1}))}function D(){de.current="keyboard"}return ke(x(m,"pointerdown",N,!0),x(m,"pointerup",I,!0),x(m,"pointercancel",I,!0),x(m,"keydown",D,!0),I)},[r,E,y,p,_,R,ce,Z]),g.useEffect(()=>{if(r||!h)return;const m=K(p);function I(){oe.current=!0,ce.start(0,()=>{oe.current=!1})}function N(O){const d=be(O);Qe(d)&&(te.current=d)}function D(O){const d=O.relatedTarget,M=O.currentTarget,U=be(O);u&&d==null&&U!=null&&C(E,U)&&Et(U),queueMicrotask(()=>{const w=$(),Re=P.context.triggerElements,c=Z(),l=d?.hasAttribute(Ve("focus-guard"))&&[pe.current,ye.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,le(L),le(k)].includes(d),X=!(C(y,d)||C(E,d)||C(d,E)||C(R?.portalNode,d)||c.some(v=>v===d||C(v,d))||d!=null&&Re.hasElement(d)||Re.hasMatchingElement(v=>C(v,d))||l||W&&(Fe(W.nodesRef.current,w).find(v=>C(v.context?.elements.floating,d)||C(v.context?.elements.domReference,d))||ft(W.nodesRef.current,w).find(v=>[v.context?.elements.floating,ct(v.context?.elements.floating)].includes(d)||v.context?.elements.domReference===d)));if(M===y&&p&&Rt(p),i&&M!==y&&!qt(U)&&ae(m)===m.body){if(he(p)&&(p.focus(),i==="popup")){Oe.request(()=>{p.focus()});return}const v=ne(),ue=te.current,we=(ue&&v.includes(ue)?ue:null)||v[v.length-1]||p;he(we)&&we.focus()}if(B.current.insideReactTree){B.current.insideReactTree=!1;return}(G||!u)&&d&&X&&!oe.current&&(G||d!==yt())&&(Y.current=!0,P.setOpen(!1,Pe(jt,O)))})}function z(){ee.current||(B.current.insideReactTree=!0,ie.start(0,()=>{B.current.insideReactTree=!1}))}const a=he(y)?y:null;if(!(!E&&!a))return ke(a&&x(a,"focusout",D),a&&x(a,"pointerdown",I),E&&x(E,"focusin",N),E&&x(E,"focusout",D),E&&R&&x(E,"focusout",z,!0))},[r,y,E,p,u,W,R,P,h,i,ne,G,$,B,ie,ce,Oe,k,L,Z]),g.useEffect(()=>{if(r||!E||!_)return;const m=Array.from(R?.portalNode?.querySelectorAll(`[${Ve("portal")}]`)||[]),N=(W?ft(W.nodesRef.current,$()):[]).find(M=>ot(M.context?.elements.domReference||null))?.context?.elements.domReference,z=[...[E,...m,pe.current,ye.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Z()],N,le(L),le(k),G?y:null].filter(M=>M!=null),a=mt(z,{ariaHidden:u||G,mark:!1}),O=[E,...m].filter(M=>M!=null),d=mt(O);return()=>{d(),a()}},[_,r,y,E,u,R,G,W,$,k,L,Z]),H(()=>{if(!_||r||!he(p))return;const m=K(p),I=ae(m);queueMicrotask(()=>{const N=se.current,D=typeof N=="function"?N(q.current||""):N;if(D===void 0||D===!1||C(p,I))return;let a=null;const O=()=>(a==null&&(a=ne(p)),a[0]||p);let d;D===!0||D===null?d=O():d=le(D),d=d||O();const M=C(p,ae(m));De(d,{preventScroll:d===p,shouldFocus(){if(!ve.current)return!1;if(M)return!0;const U=ae(m);return!(U!==d&&C(p,U))}})})},[r,_,p,ne,se,q,ve]),H(()=>{if(r||!p)return;const m=K(p),I=ae(m),N=q.current==null;Et(I);function D(a){if(a.open||(Ee.current=bn(a.nativeEvent,de.current)),a.reason===Ut&&a.nativeEvent.type==="mouseleave"&&(Y.current=!0),a.reason===It)if(a.nested)Y.current=!1;else if(an(a.nativeEvent)||fn(a.nativeEvent))Y.current=!1;else{let O=!1;K(p).createElement("div").focus({get preventScroll(){return O=!0,!1}}),O?Y.current=!1:Y.current=!0}}Q.on("openchange",D);function z(){const a=F.current;let O=typeof a=="function"?a(Ee.current):a;if(O===void 0||O===!1)return null;O===null&&(O=!0);const d=y?.isConnected?y:null,M=I?.isConnected&&je(I)!=="body"?I:null;let U=N?M||d:d||M;return U||(U=yt()||null),typeof O=="boolean"?U:le(O)||U||null}return()=>{Q.off("openchange",D);const a=ae(m),O=Z(),d=C(E,a)||O.some(w=>w===a||C(w,a))||W&&Fe(W.nodesRef.current,$(),!1).some(w=>C(w.context?.elements.floating,a)),M=F.current,U=z();queueMicrotask(()=>{const w=En(U),Re=typeof M!="boolean";M&&!Y.current&&he(w)&&(!(!Re&&w!==a&&a!==m.body)||d)&&w.focus({preventScroll:!0}),Y.current=!1})}},[r,E,p,F,q,Q,W,y,$,Z]),H(()=>{if(!Je||_||!E)return;const m=ae(K(E));!he(m)||!Kt(m)||C(E,m)&&m.blur()},[_,E]),H(()=>{if(!(r||!R))return R.setFocusManagerState({modal:u,closeOnFocusOut:h,open:_,onOpenChange:P.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,u,_,P,h,y]),H(()=>{if(!(r||!p))return Rt(p),()=>{queueMicrotask(nt)}},[r,p]);const ge=!r&&(u?!G:!0)&&(Me||u);return Se.jsxs(g.Fragment,{children:[ge&&Se.jsx(ut,{"data-type":"inside",ref:S,onFocus:m=>{if(u){const I=ne();De(I[I.length-1])}else R?.portalNode&&(Y.current=!1,lt(m,R.portalNode)?Xt(y)?.focus():le(L??R.beforeOutsideRef)?.focus())}}),n,ge&&Se.jsx(ut,{"data-type":"inside",ref:j,onFocus:m=>{u?De(ne()[0]):R?.portalNode&&(h&&(Y.current=!0),lt(m,R.portalNode)?Vt(y)?.focus():le(k??R.afterOutsideRef)?.focus())}})]})}function yn(){return!1}function Rn(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Zn(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yn,bubbles:u,externalTree:h}=t,f="rootStore"in e?e.rootStore:e,k=f.useState("open"),L=f.useState("floatingElement"),{dataRef:b}=f.context,T=tt(h),A=V(typeof s=="function"?s:()=>!1),P=typeof s=="function"?A:s,_=P!==!1,y=V(()=>o),{escapeKey:E,outsidePress:Q}=Rn(u),B=g.useRef(!1),$=g.useRef(!1),J=g.useRef(!1),G=g.useRef(!1),se=g.useRef(""),F=g.useRef(null),q=Ne(),ve=Ne(),W=V(()=>{ve.clear(),b.current.insideReactTree=!1}),R=V(S=>{const j=b.current.floatingContext?.nodeId;return(T?Fe(T.nodesRef.current,j):[]).some(ce=>ce.context?.open&&!ce.context.dataRef.current[S])}),Y=V(S=>He(S,f.select("floatingElement"))||He(S,f.select("domReferenceElement"))),oe=V(S=>{i()&&f.setOpen(!1,Pe(Jt,S.nativeEvent))}),ee=V(S=>{if(!k||!n||!r||S.key!=="Escape"||G.current||!E&&R("__escapeKeyBubbles"))return;const j=ln(S)?S.nativeEvent:S,ie=Pe(Qt,j);f.setOpen(!1,ie),ie.isCanceled||S.preventDefault(),!E&&!ie.isPropagationAllowed&&S.stopPropagation()}),te=V(()=>{b.current.insideReactTree=!0,ve.start(0,W)}),Ee=V(S=>{if(!k||!n||S.button!==0)return;const j=be(S.nativeEvent);C(f.select("floatingElement"),j)&&(B.current||(B.current=!0,$.current=!1))}),de=V(S=>{!k||!n||(S.defaultPrevented||S.nativeEvent.defaultPrevented)&&B.current&&($.current=!0)});g.useEffect(()=>{if(!k||!n)return;b.current.__escapeKeyBubbles=E,b.current.__outsidePressBubbles=Q;const S=new Le,j=new Le;function ie(){S.clear(),G.current=!0}function ce(){S.start(Je?5:0,()=>{G.current=!1})}function Oe(){J.current=!0,j.start(0,()=>{J.current=!1})}function Me(){B.current=!1,$.current=!1}function p(){const c=se.current,l=c==="pen"||!c?"mouse":c,X=y(),v=typeof X=="function"?X():X;return typeof v=="string"?v:v[l]}function ne(c){const l=p();return l==="intentional"&&c.type!=="click"||l==="sloppy"&&c.type==="click"}function Z(c){const l=b.current.floatingContext?.nodeId,X=T&&Fe(T.nodesRef.current,l).some(v=>He(c,v.context?.elements.floating));return Y(c)||X}function ge(c){if(ne(c)){c.type!=="click"&&!Y(c)&&(j.clear(),J.current=!1),W();return}if(b.current.insideReactTree){W();return}const l=be(c),X=`[${Ve("inert")}]`,v=Ie(l)?l.getRootNode():null,ue=Array.from((Ct(v)?v:K(f.select("floatingElement"))).querySelectorAll(X)),we=f.context.triggerElements;if(l&&(we.hasElement(l)||we.hasMatchingElement(re=>C(re,l))))return;let Ce=Ie(l)?l:null;for(;Ce&&!_e(Ce);){const re=Zt(Ce);if(_e(re)||!Ie(re))break;Ce=re}if(!(ue.length&&Ie(l)&&!en(l)&&!C(l,f.select("floatingElement"))&&ue.every(re=>!C(Ce,re)))){if(he(l)&&!("touches"in c)){const re=_e(l),Be=tn(l),st=/auto|scroll/,At=re||st.test(Be.overflowX),Wt=re||st.test(Be.overflowY),Nt=At&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,Lt=Wt&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,Yt=Be.direction==="rtl",Bt=Lt&&(Yt?c.offsetX<=l.offsetWidth-l.clientWidth:c.offsetX>l.clientWidth),Ht=Nt&&c.offsetY>l.clientHeight;if(Bt||Ht)return}if(!Z(c)){if(p()==="intentional"&&J.current){j.clear(),J.current=!1;return}typeof P=="function"&&!P(c)||R("__outsidePressBubbles")||(f.setOpen(!1,Pe(It,c)),W())}}}function m(c){p()!=="sloppy"||c.pointerType==="touch"||!f.select("open")||!n||Y(c)||ge(c)}function I(c){if(p()!=="sloppy"||!f.select("open")||!n||Y(c))return;const l=c.touches[0];l&&(F.current={startTime:Date.now(),startX:l.clientX,startY:l.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function N(c,l){const X=be(c);if(!X)return;const v=x(X,c.type,()=>{l(c),v()})}function D(c){se.current="touch",N(c,I)}function z(c){q.clear(),c.type==="pointerdown"&&(se.current=c.pointerType),!(c.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&N(c,l=>{l.type==="pointerdown"?m(l):ge(l)})}function a(c){if(!B.current)return;const l=$.current;if(Me(),p()==="intentional"){if(c.type==="pointercancel"){l&&Oe();return}if(!Z(c)){if(l){Oe();return}typeof P=="function"&&!P(c)||(j.clear(),J.current=!0,W())}}}function O(c){if(p()!=="sloppy"||!F.current||Y(c))return;const l=c.touches[0];if(!l)return;const X=Math.abs(l.clientX-F.current.startX),v=Math.abs(l.clientY-F.current.startY),ue=Math.sqrt(X*X+v*v);ue>5&&(F.current.dismissOnTouchEnd=!0),ue>10&&(ge(c),q.clear(),F.current=null)}function d(c){N(c,O)}function M(c){p()!=="sloppy"||!F.current||Y(c)||(F.current.dismissOnTouchEnd&&ge(c),q.clear(),F.current=null)}function U(c){N(c,M)}const w=K(L),Re=ke(r&&ke(x(w,"keydown",ee),x(w,"compositionstart",ie),x(w,"compositionend",ce)),_&&ke(x(w,"click",z,!0),x(w,"pointerdown",z,!0),x(w,"pointerup",a,!0),x(w,"pointercancel",a,!0),x(w,"mousedown",z,!0),x(w,"mouseup",a,!0),x(w,"touchstart",D,!0),x(w,"touchmove",d,!0),x(w,"touchend",U,!0)));return()=>{Re(),S.clear(),j.clear(),Me(),J.current=!1}},[b,L,r,_,P,k,n,E,Q,ee,W,y,R,Y,T,f,q]),g.useEffect(W,[P,W]);const pe=g.useMemo(()=>({onKeyDown:ee,onPointerDown:oe,onClick:oe}),[ee,oe]),ye=g.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onClickCapture:te,onMouseDownCapture(S){te(),Ee(S)},onPointerDownCapture(S){te(),Ee(S)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[ee,te,Ee,de]);return g.useMemo(()=>n?{reference:pe,floating:ye,trigger:pe}:{},[n,pe,ye])}function Tn(e){const t=g.useRef(!0);t.current&&(t.current=!1,e())}const Sn={open:Te(e=>e.open),transitionStatus:Te(e=>e.transitionStatus),domReferenceElement:Te(e=>e.domReferenceElement),referenceElement:Te(e=>e.positionReference??e.referenceElement),floatingElement:Te(e=>e.floatingElement),floatingId:Te(e=>e.floatingId)};class vn extends nn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Pt(),nested:r,triggerElements:o},Sn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&dn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function On(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),k=t.context.triggerElements,L=i,b=g.useRef(null);r===void 0&&b.current===null&&(b.current=new vn({open:u,transitionStatus:void 0,referenceElement:h,floatingElement:f,triggerElements:k,onOpenChange:L,floatingId:s,syncOnly:!0,nested:o}));const T=r??b.current;return t.useSyncedValue("floatingId",s),H(()=>{const A={open:u,floatingId:s,referenceElement:h,floatingElement:f};Ie(h)&&(A.domReferenceElement=h),T.state.positionReference===T.state.referenceElement&&(A.positionReference=h),T.update(A)},[u,s,h,f,T]),T.context.onOpenChange=L,T.context.nested=o,T}function wn(e,t=!1,n=!1){const[r,s]=g.useState(e&&t?"idle":void 0),[o,i]=g.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),H(()=>{if(!e&&o&&r!=="ending"&&n){const u=me.request(()=>{s("ending")});return()=>{me.cancel(u)}}},[e,o,r,n]),H(()=>{if(!e||t)return;const u=me.request(()=>{s(void 0)});return()=>{me.cancel(u)}},[t,e]),H(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=me.request(()=>{s("idle")});return()=>{me.cancel(u)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}const er={tabIndex:-1,[rn]:""};function tr(e){return t=>t==="touch"?e.current:!0}function nr(e,t,n=!1){const r=ze(),s=et()!=null,o=g.useRef(null);e===void 0&&o.current===null&&(o.current=t(r,s));const i=e??o.current;return On({popupStore:i,treatPopupAsFloatingElement:n,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:i.setOpen}),{store:i,internalStore:o.current}}function Cn(e,t){const n=g.useRef(null),r=g.useRef(null);return g.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,h=t.context.triggerElements.getById(i);u&&h===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function rr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function sr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function or(e,t,n,r){Tn(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ir(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Cn(e,n),i=V(u=>{if(o(u),!u)return;const h=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:u,...h?r:null});return}f==null&&h&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return H(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function cr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");H(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const o=e.context.triggerElements.size,i={};e.state.triggerCount!==o&&(i.triggerCount=o);const u=e.select("activeTriggerId");let h=null;if(u){const f=e.context.triggerElements.getById(u);f?f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f):h=u}if(!h&&!u&&o===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[k,L]=f.value;i.activeTriggerId=k,i.activeTriggerElement=L}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const f=Pe(sn);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function ur(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=wn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const h=V(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return on({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:o}}function lr(e,t){e.useSyncedValues(t),H(()=>()=>{e.update({activeTriggerProps:Ge,inactiveTriggerProps:Ge,popupProps:Ge})},[e])}function ar(e,t){H(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),H(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class fr{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let rt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=at.startingStyle]="startingStyle",e[e.endingStyle=at.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),qe=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xn={[qe.popupOpen]:""},In={[qe.popupOpen]:"",[qe.pressed]:""},kn={[rt.open]:""},Pn={[rt.closed]:""},Fn={[rt.anchorHidden]:""},dr={open(e){return e?xn:null}},pr={open(e){return e?In:null}},gr={open(e){return e?kn:Pn},anchorHidden(e){return e?Fn:null}};function hr(e){return ze(e,"base-ui")}const Mn="ArrowUp",An="ArrowDown",Wn="ArrowLeft",Nn="ArrowRight",Ln="Home",Yn="End",Bn=new Set([Wn,Nn]),Hn=new Set([Mn,An]),_n=new Set([...Bn,...Hn]),mr=new Set([..._n,Ln,Yn]),br=g.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Se.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Tt={},St={},vt="";function Gn(e){if(typeof document>"u")return!1;const t=K(e);return Ye(t).innerWidth-t.documentElement.clientWidth>0}function Dn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=K(e),r=n.documentElement,s=n.body,o=Ze(r)?r:s,i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const h=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,h===f}function Un(e){const t=K(e),n=t.documentElement,r=t.body,s=Ze(n)?n:r,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Kn(e){const t=K(e),n=t.documentElement,r=t.body,s=Ye(n);let o=0,i=0,u=!1;const h=me.create();if(Je&&(s.visualViewport?.scale??1)!==1)return()=>{};function f(){const T=s.getComputedStyle(n),A=s.getComputedStyle(r),y=(T.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Tt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vt=n.style.scrollBehavior,St={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 E=n.scrollHeight>n.clientHeight,Q=n.scrollWidth>n.clientWidth,B=T.overflowY==="scroll"||A.overflowY==="scroll",$=T.overflowX==="scroll"||A.overflowX==="scroll",J=Math.max(0,s.innerWidth-r.clientWidth),G=Math.max(0,s.innerHeight-r.clientHeight),se=parseFloat(A.marginTop)+parseFloat(A.marginBottom),F=parseFloat(A.marginLeft)+parseFloat(A.marginRight),q=Ze(n)?n:r;if(u=Dn(e),u){n.style.scrollbarGutter=y,q.style.overflowY="hidden",q.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||B)&&(n.style.overflowY="scroll"),(Q||$)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:se||G?`calc(100dvh - ${se+G}px)`:"100dvh",width:F||J?`calc(100vw - ${F+J}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function k(){Object.assign(n.style,Tt),Object.assign(r.style,St),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=vt)}function L(){k(),h.request(f)}f();const b=x(s,"resize",L);return()=>{h.cancel(),k(),typeof s.removeEventListener=="function"&&b()}}class Xn{lockCount=0;restore=null;timeoutLock=Le.create();timeoutUnlock=Le.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=K(t).documentElement,s=Ye(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=wt;return}const o=cn||!Gn(t);this.restore=o?Un(t):Kn(t)}}const Vn=new Xn;function Er(e=!0,t=null){H(()=>{if(e)return Vn.acquire(t)},[e,t])}export{pr as A,jn as B,rt as C,zn as D,De as E,vn as F,un as G,an as H,br as I,fn as J,fr as P,er as a,mr as b,tr as c,Qn as d,ar as e,cr as f,ur as g,Zn as h,Er as i,lr as j,nr as k,Tn as l,wn as m,qn as n,tt as o,gr as p,et as q,Fe as r,rr as s,dr as t,hr as u,Ae as v,sr as w,Jn as x,or as y,ir as z};
|
|
1
|
+
import{bM as Xe,bN as _t,aI as Ot,aH as H,aJ as wt,aV as K,bO as Ct,bE as je,j as Se,bJ as ze,r as g,Q as V,bP as ot,bQ as Gt,aK as it,aT as Ne,bt as Dt,bR as ct,bS as xt,aX as x,aW as ke,bb as he,bT as Ve,bU as le,bV as ae,aF as C,a_ as Ut,bW as It,bX as Je,bu as Kt,b8 as ut,b3 as lt,b5 as Xt,bY as Vt,aE as be,b7 as $t,bZ as qt,E as Pe,b2 as jt,b_ as Qe,aM as Ye,b$ as zt,c0 as He,a$ as Jt,aS as Le,b0 as Qt,aU as Ie,bA as _e,bz as Zt,c1 as en,bx as tn,aG as nn,W as Te,c2 as me,c3 as rn,aP as sn,aA as on,Y as Ge,c4 as at,bL as cn,bF as Ze}from"./__vite-browser-external-Db9onipF.js";function Fe(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Fe(e,s.id,n)])}function ft(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(o=>o.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function un(e){e.preventDefault(),e.stopPropagation()}function ln(e){return"nativeEvent"in e}function an(e){return e.pointerType===""&&e.isTrusted?!0:Xe&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fn(e){return _t?!1:!Xe&&e.width===0&&e.height===0||Xe&&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 qn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function dn(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ae(e){const t=Ot(pn,e).current;return t.next=e,H(t.effect),t}function pn(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let We=0;function De(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(We);function o(){s&&!s()||e?.focus({preventScroll:n})}if(r)return o(),wt;const i=requestAnimationFrame(o);return We=i,()=>{We===i&&(cancelAnimationFrame(i),We=0)}}const Ue={inert:new WeakMap,"aria-hidden":new WeakMap},dt="data-base-ui-inert",$e={inert:new WeakSet,"aria-hidden":new WeakSet};let xe=new WeakMap,Ke=0;function gn(e){return $e[e]}function kt(e){return e?Ct(e)?e.host:kt(e.parentNode):null}const pt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kt(n);return e.contains(r)?r:null}).filter(n=>n!=null),gt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},ht=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{je(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function hn(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,u=null;const h=pt(t,e),f=s?ht(t,gt(h),new Set(h)):[],k=[],L=[];if(o){const b=Ue[o],T=gn(o);u=T,i=b;const A=pt(t,Array.from(t.querySelectorAll("[aria-live]"))),P=h.concat(A);ht(t,gt(P),new Set(P)).forEach(y=>{const E=y.getAttribute(o),Q=E!==null&&E!=="false",B=(b.get(y)||0)+1;b.set(y,B),k.push(y),B===1&&Q&&T.add(y),Q||y.setAttribute(o,o==="inert"?"":"true")})}return s&&f.forEach(b=>{const T=(xe.get(b)||0)+1;xe.set(b,T),L.push(b),T===1&&b.setAttribute(dt,"")}),Ke+=1,()=>{i&&k.forEach(b=>{const A=(i.get(b)||0)-1;i.set(b,A),A||(!u?.has(b)&&o&&b.removeAttribute(o),u?.delete(b))}),s&&L.forEach(b=>{const T=(xe.get(b)||0)-1;xe.set(b,T),T||b.removeAttribute(dt)}),Ke-=1,Ke||(Ue.inert=new WeakMap,Ue["aria-hidden"]=new WeakMap,$e.inert=new WeakSet,$e["aria-hidden"]=new WeakSet,xe=new WeakMap)}}function mt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=K(e[0]).body;return hn(e,o,n,r,{mark:s})}function Pt(){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 mn{nodesRef={current:[]};events=Pt();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 Ft=g.createContext(null),Mt=g.createContext(null),et=()=>g.useContext(Ft)?.id||null,tt=e=>{const t=g.useContext(Mt);return e??t};function jn(e){const t=ze(),n=tt(e),r=et();return H(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function zn(e){const{children:t,id:n}=e,r=et();return Se.jsx(Ft.Provider,{value:g.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Jn(e){const{children:t,externalTree:n}=e,r=Ot(()=>n??new mn).current;return Se.jsx(Mt.Provider,{value:r,children:t})}function bn(e,t){const n=Ye(be(e));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 bt=20;let fe=[];function nt(){fe=fe.filter(e=>e.deref()?.isConnected)}function Et(e){nt(),e&&je(e)!=="body"&&(fe.push(new WeakRef(e)),fe.length>bt&&(fe=fe.slice(-bt)))}function yt(){return nt(),fe[fe.length-1]?.deref()}function En(e){return e?Qe(e)?e:xt(e)[0]||e:null}function Rt(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=zt(e).filter(s=>{const o=s.getAttribute("data-tabindex")||"";return Qe(s)||s.hasAttribute("data-tabindex")&&!o.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Qn(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:u=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:k,previousFocusableElement:L,beforeContentFocusGuardRef:b,externalTree:T,getInsideElements:A}=e,P="rootStore"in t?t.rootStore:t,_=P.useState("open"),y=P.useState("domReferenceElement"),E=P.useState("floatingElement"),{events:Q,dataRef:B}=P.context,$=V(()=>B.current.floatingContext?.nodeId),J=s===!1,G=ot(y)&&J,se=Ae(s),F=Ae(o),q=Ae(f),ve=Ae(_),W=tt(T),R=Gt(),Y=g.useRef(!1),oe=g.useRef(!1),ee=g.useRef(!1),te=g.useRef(null),Ee=g.useRef(""),de=g.useRef(""),pe=g.useRef(null),ye=g.useRef(null),S=it(pe,b,R?.beforeInsideRef),j=it(ye,R?.afterInsideRef),ie=Ne(),ce=Ne(),Oe=Dt(),Me=R!=null,p=ct(E),ne=V((m=p)=>m?xt(m):[]),Z=V(()=>A?.().filter(m=>m!=null)??[]);g.useEffect(()=>{if(r||!u)return;function m(N){N.key==="Tab"&&C(p,ae(K(p)))&&ne().length===0&&!G&&un(N)}const I=K(p);return x(I,"keydown",m)},[r,p,u,G,ne]),g.useEffect(()=>{if(r||!_)return;const m=K(p);function I(){ee.current=!1}function N(z){const a=be(z),O=Z(),d=C(E,a)||C(y,a)||C(R?.portalNode,a)||O.some(M=>M===a||C(M,a));ee.current=!d,de.current=z.pointerType||"keyboard",a?.closest(`[${$t}]`)&&(oe.current=!0,ce.start(0,()=>{oe.current=!1}))}function D(){de.current="keyboard"}return ke(x(m,"pointerdown",N,!0),x(m,"pointerup",I,!0),x(m,"pointercancel",I,!0),x(m,"keydown",D,!0),I)},[r,E,y,p,_,R,ce,Z]),g.useEffect(()=>{if(r||!h)return;const m=K(p);function I(){oe.current=!0,ce.start(0,()=>{oe.current=!1})}function N(O){const d=be(O);Qe(d)&&(te.current=d)}function D(O){const d=O.relatedTarget,M=O.currentTarget,U=be(O);u&&d==null&&U!=null&&C(E,U)&&Et(U),queueMicrotask(()=>{const w=$(),Re=P.context.triggerElements,c=Z(),l=d?.hasAttribute(Ve("focus-guard"))&&[pe.current,ye.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,le(L),le(k)].includes(d),X=!(C(y,d)||C(E,d)||C(d,E)||C(R?.portalNode,d)||c.some(v=>v===d||C(v,d))||d!=null&&Re.hasElement(d)||Re.hasMatchingElement(v=>C(v,d))||l||W&&(Fe(W.nodesRef.current,w).find(v=>C(v.context?.elements.floating,d)||C(v.context?.elements.domReference,d))||ft(W.nodesRef.current,w).find(v=>[v.context?.elements.floating,ct(v.context?.elements.floating)].includes(d)||v.context?.elements.domReference===d)));if(M===y&&p&&Rt(p),i&&M!==y&&!qt(U)&&ae(m)===m.body){if(he(p)&&(p.focus(),i==="popup")){Oe.request(()=>{p.focus()});return}const v=ne(),ue=te.current,we=(ue&&v.includes(ue)?ue:null)||v[v.length-1]||p;he(we)&&we.focus()}if(B.current.insideReactTree){B.current.insideReactTree=!1;return}(G||!u)&&d&&X&&!oe.current&&(G||d!==yt())&&(Y.current=!0,P.setOpen(!1,Pe(jt,O)))})}function z(){ee.current||(B.current.insideReactTree=!0,ie.start(0,()=>{B.current.insideReactTree=!1}))}const a=he(y)?y:null;if(!(!E&&!a))return ke(a&&x(a,"focusout",D),a&&x(a,"pointerdown",I),E&&x(E,"focusin",N),E&&x(E,"focusout",D),E&&R&&x(E,"focusout",z,!0))},[r,y,E,p,u,W,R,P,h,i,ne,G,$,B,ie,ce,Oe,k,L,Z]),g.useEffect(()=>{if(r||!E||!_)return;const m=Array.from(R?.portalNode?.querySelectorAll(`[${Ve("portal")}]`)||[]),N=(W?ft(W.nodesRef.current,$()):[]).find(M=>ot(M.context?.elements.domReference||null))?.context?.elements.domReference,z=[...[E,...m,pe.current,ye.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...Z()],N,le(L),le(k),G?y:null].filter(M=>M!=null),a=mt(z,{ariaHidden:u||G,mark:!1}),O=[E,...m].filter(M=>M!=null),d=mt(O);return()=>{d(),a()}},[_,r,y,E,u,R,G,W,$,k,L,Z]),H(()=>{if(!_||r||!he(p))return;const m=K(p),I=ae(m);queueMicrotask(()=>{const N=se.current,D=typeof N=="function"?N(q.current||""):N;if(D===void 0||D===!1||C(p,I))return;let a=null;const O=()=>(a==null&&(a=ne(p)),a[0]||p);let d;D===!0||D===null?d=O():d=le(D),d=d||O();const M=C(p,ae(m));De(d,{preventScroll:d===p,shouldFocus(){if(!ve.current)return!1;if(M)return!0;const U=ae(m);return!(U!==d&&C(p,U))}})})},[r,_,p,ne,se,q,ve]),H(()=>{if(r||!p)return;const m=K(p),I=ae(m),N=q.current==null;Et(I);function D(a){if(a.open||(Ee.current=bn(a.nativeEvent,de.current)),a.reason===Ut&&a.nativeEvent.type==="mouseleave"&&(Y.current=!0),a.reason===It)if(a.nested)Y.current=!1;else if(an(a.nativeEvent)||fn(a.nativeEvent))Y.current=!1;else{let O=!1;K(p).createElement("div").focus({get preventScroll(){return O=!0,!1}}),O?Y.current=!1:Y.current=!0}}Q.on("openchange",D);function z(){const a=F.current;let O=typeof a=="function"?a(Ee.current):a;if(O===void 0||O===!1)return null;O===null&&(O=!0);const d=y?.isConnected?y:null,M=I?.isConnected&&je(I)!=="body"?I:null;let U=N?M||d:d||M;return U||(U=yt()||null),typeof O=="boolean"?U:le(O)||U||null}return()=>{Q.off("openchange",D);const a=ae(m),O=Z(),d=C(E,a)||O.some(w=>w===a||C(w,a))||W&&Fe(W.nodesRef.current,$(),!1).some(w=>C(w.context?.elements.floating,a)),M=F.current,U=z();queueMicrotask(()=>{const w=En(U),Re=typeof M!="boolean";M&&!Y.current&&he(w)&&(!(!Re&&w!==a&&a!==m.body)||d)&&w.focus({preventScroll:!0}),Y.current=!1})}},[r,E,p,F,q,Q,W,y,$,Z]),H(()=>{if(!Je||_||!E)return;const m=ae(K(E));!he(m)||!Kt(m)||C(E,m)&&m.blur()},[_,E]),H(()=>{if(!(r||!R))return R.setFocusManagerState({modal:u,closeOnFocusOut:h,open:_,onOpenChange:P.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,u,_,P,h,y]),H(()=>{if(!(r||!p))return Rt(p),()=>{queueMicrotask(nt)}},[r,p]);const ge=!r&&(u?!G:!0)&&(Me||u);return Se.jsxs(g.Fragment,{children:[ge&&Se.jsx(ut,{"data-type":"inside",ref:S,onFocus:m=>{if(u){const I=ne();De(I[I.length-1])}else R?.portalNode&&(Y.current=!1,lt(m,R.portalNode)?Xt(y)?.focus():le(L??R.beforeOutsideRef)?.focus())}}),n,ge&&Se.jsx(ut,{"data-type":"inside",ref:j,onFocus:m=>{u?De(ne()[0]):R?.portalNode&&(h&&(Y.current=!0),lt(m,R.portalNode)?Vt(y)?.focus():le(k??R.afterOutsideRef)?.focus())}})]})}function yn(){return!1}function Rn(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Zn(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=yn,bubbles:u,externalTree:h}=t,f="rootStore"in e?e.rootStore:e,k=f.useState("open"),L=f.useState("floatingElement"),{dataRef:b}=f.context,T=tt(h),A=V(typeof s=="function"?s:()=>!1),P=typeof s=="function"?A:s,_=P!==!1,y=V(()=>o),{escapeKey:E,outsidePress:Q}=Rn(u),B=g.useRef(!1),$=g.useRef(!1),J=g.useRef(!1),G=g.useRef(!1),se=g.useRef(""),F=g.useRef(null),q=Ne(),ve=Ne(),W=V(()=>{ve.clear(),b.current.insideReactTree=!1}),R=V(S=>{const j=b.current.floatingContext?.nodeId;return(T?Fe(T.nodesRef.current,j):[]).some(ce=>ce.context?.open&&!ce.context.dataRef.current[S])}),Y=V(S=>He(S,f.select("floatingElement"))||He(S,f.select("domReferenceElement"))),oe=V(S=>{i()&&f.setOpen(!1,Pe(Jt,S.nativeEvent))}),ee=V(S=>{if(!k||!n||!r||S.key!=="Escape"||G.current||!E&&R("__escapeKeyBubbles"))return;const j=ln(S)?S.nativeEvent:S,ie=Pe(Qt,j);f.setOpen(!1,ie),ie.isCanceled||S.preventDefault(),!E&&!ie.isPropagationAllowed&&S.stopPropagation()}),te=V(()=>{b.current.insideReactTree=!0,ve.start(0,W)}),Ee=V(S=>{if(!k||!n||S.button!==0)return;const j=be(S.nativeEvent);C(f.select("floatingElement"),j)&&(B.current||(B.current=!0,$.current=!1))}),de=V(S=>{!k||!n||(S.defaultPrevented||S.nativeEvent.defaultPrevented)&&B.current&&($.current=!0)});g.useEffect(()=>{if(!k||!n)return;b.current.__escapeKeyBubbles=E,b.current.__outsidePressBubbles=Q;const S=new Le,j=new Le;function ie(){S.clear(),G.current=!0}function ce(){S.start(Je?5:0,()=>{G.current=!1})}function Oe(){J.current=!0,j.start(0,()=>{J.current=!1})}function Me(){B.current=!1,$.current=!1}function p(){const c=se.current,l=c==="pen"||!c?"mouse":c,X=y(),v=typeof X=="function"?X():X;return typeof v=="string"?v:v[l]}function ne(c){const l=p();return l==="intentional"&&c.type!=="click"||l==="sloppy"&&c.type==="click"}function Z(c){const l=b.current.floatingContext?.nodeId,X=T&&Fe(T.nodesRef.current,l).some(v=>He(c,v.context?.elements.floating));return Y(c)||X}function ge(c){if(ne(c)){c.type!=="click"&&!Y(c)&&(j.clear(),J.current=!1),W();return}if(b.current.insideReactTree){W();return}const l=be(c),X=`[${Ve("inert")}]`,v=Ie(l)?l.getRootNode():null,ue=Array.from((Ct(v)?v:K(f.select("floatingElement"))).querySelectorAll(X)),we=f.context.triggerElements;if(l&&(we.hasElement(l)||we.hasMatchingElement(re=>C(re,l))))return;let Ce=Ie(l)?l:null;for(;Ce&&!_e(Ce);){const re=Zt(Ce);if(_e(re)||!Ie(re))break;Ce=re}if(!(ue.length&&Ie(l)&&!en(l)&&!C(l,f.select("floatingElement"))&&ue.every(re=>!C(Ce,re)))){if(he(l)&&!("touches"in c)){const re=_e(l),Be=tn(l),st=/auto|scroll/,At=re||st.test(Be.overflowX),Wt=re||st.test(Be.overflowY),Nt=At&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,Lt=Wt&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,Yt=Be.direction==="rtl",Bt=Lt&&(Yt?c.offsetX<=l.offsetWidth-l.clientWidth:c.offsetX>l.clientWidth),Ht=Nt&&c.offsetY>l.clientHeight;if(Bt||Ht)return}if(!Z(c)){if(p()==="intentional"&&J.current){j.clear(),J.current=!1;return}typeof P=="function"&&!P(c)||R("__outsidePressBubbles")||(f.setOpen(!1,Pe(It,c)),W())}}}function m(c){p()!=="sloppy"||c.pointerType==="touch"||!f.select("open")||!n||Y(c)||ge(c)}function I(c){if(p()!=="sloppy"||!f.select("open")||!n||Y(c))return;const l=c.touches[0];l&&(F.current={startTime:Date.now(),startX:l.clientX,startY:l.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function N(c,l){const X=be(c);if(!X)return;const v=x(X,c.type,()=>{l(c),v()})}function D(c){se.current="touch",N(c,I)}function z(c){q.clear(),c.type==="pointerdown"&&(se.current=c.pointerType),!(c.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&N(c,l=>{l.type==="pointerdown"?m(l):ge(l)})}function a(c){if(!B.current)return;const l=$.current;if(Me(),p()==="intentional"){if(c.type==="pointercancel"){l&&Oe();return}if(!Z(c)){if(l){Oe();return}typeof P=="function"&&!P(c)||(j.clear(),J.current=!0,W())}}}function O(c){if(p()!=="sloppy"||!F.current||Y(c))return;const l=c.touches[0];if(!l)return;const X=Math.abs(l.clientX-F.current.startX),v=Math.abs(l.clientY-F.current.startY),ue=Math.sqrt(X*X+v*v);ue>5&&(F.current.dismissOnTouchEnd=!0),ue>10&&(ge(c),q.clear(),F.current=null)}function d(c){N(c,O)}function M(c){p()!=="sloppy"||!F.current||Y(c)||(F.current.dismissOnTouchEnd&&ge(c),q.clear(),F.current=null)}function U(c){N(c,M)}const w=K(L),Re=ke(r&&ke(x(w,"keydown",ee),x(w,"compositionstart",ie),x(w,"compositionend",ce)),_&&ke(x(w,"click",z,!0),x(w,"pointerdown",z,!0),x(w,"pointerup",a,!0),x(w,"pointercancel",a,!0),x(w,"mousedown",z,!0),x(w,"mouseup",a,!0),x(w,"touchstart",D,!0),x(w,"touchmove",d,!0),x(w,"touchend",U,!0)));return()=>{Re(),S.clear(),j.clear(),Me(),J.current=!1}},[b,L,r,_,P,k,n,E,Q,ee,W,y,R,Y,T,f,q]),g.useEffect(W,[P,W]);const pe=g.useMemo(()=>({onKeyDown:ee,onPointerDown:oe,onClick:oe}),[ee,oe]),ye=g.useMemo(()=>({onKeyDown:ee,onPointerDown:de,onMouseDown:de,onClickCapture:te,onMouseDownCapture(S){te(),Ee(S)},onPointerDownCapture(S){te(),Ee(S)},onMouseUpCapture:te,onTouchEndCapture:te,onTouchMoveCapture:te}),[ee,te,Ee,de]);return g.useMemo(()=>n?{reference:pe,floating:ye,trigger:pe}:{},[n,pe,ye])}function Tn(e){const t=g.useRef(!0);t.current&&(t.current=!1,e())}const Sn={open:Te(e=>e.open),transitionStatus:Te(e=>e.transitionStatus),domReferenceElement:Te(e=>e.domReferenceElement),referenceElement:Te(e=>e.positionReference??e.referenceElement),floatingElement:Te(e=>e.floatingElement),floatingId:Te(e=>e.floatingId)};class vn extends nn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:o,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:Pt(),nested:r,triggerElements:o},Sn),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&dn(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function On(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,u=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),k=t.context.triggerElements,L=i,b=g.useRef(null);r===void 0&&b.current===null&&(b.current=new vn({open:u,transitionStatus:void 0,referenceElement:h,floatingElement:f,triggerElements:k,onOpenChange:L,floatingId:s,syncOnly:!0,nested:o}));const T=r??b.current;return t.useSyncedValue("floatingId",s),H(()=>{const A={open:u,floatingId:s,referenceElement:h,floatingElement:f};Ie(h)&&(A.domReferenceElement=h),T.state.positionReference===T.state.referenceElement&&(A.positionReference=h),T.update(A)},[u,s,h,f,T]),T.context.onOpenChange=L,T.context.nested=o,T}function wn(e,t=!1,n=!1){const[r,s]=g.useState(e&&t?"idle":void 0),[o,i]=g.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),H(()=>{if(!e&&o&&r!=="ending"&&n){const u=me.request(()=>{s("ending")});return()=>{me.cancel(u)}}},[e,o,r,n]),H(()=>{if(!e||t)return;const u=me.request(()=>{s(void 0)});return()=>{me.cancel(u)}},[t,e]),H(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const u=me.request(()=>{s("idle")});return()=>{me.cancel(u)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}const er={tabIndex:-1,[rn]:""};function tr(e){return t=>t==="touch"?e.current:!0}function nr(e,t,n=!1){const r=ze(),s=et()!=null,o=g.useRef(null);e===void 0&&o.current===null&&(o.current=t(r,s));const i=e??o.current;return On({popupStore:i,treatPopupAsFloatingElement:n,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:i.setOpen}),{store:i,internalStore:o.current}}function Cn(e,t){const n=g.useRef(null),r=g.useRef(null);return g.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,u=r.current,h=t.context.triggerElements.getById(i);u&&h===u&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function rr(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function sr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function or(e,t,n,r){Tn(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function ir(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=Cn(e,n),i=V(u=>{if(o(u),!u)return;const h=n.select("open"),f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:u,...h?r:null});return}f==null&&h&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return H(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:s}}function cr(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");H(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const o=e.context.triggerElements.size,i={};e.state.triggerCount!==o&&(i.triggerCount=o);const u=e.select("activeTriggerId");let h=null;if(u){const f=e.context.triggerElements.getById(u);f?f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f):h=u}if(!h&&!u&&o===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[k,L]=f.value;i.activeTriggerId=k,i.activeTriggerElement=L}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),h&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const f=Pe(sn);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function ur(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=wn(e),i=t.useState("preventUnmountingOnClose"),u=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:u});const h=V(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return on({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||h()}}),{forceUnmount:h,transitionStatus:o}}function lr(e,t){e.useSyncedValues(t),H(()=>()=>{e.update({activeTriggerProps:Ge,inactiveTriggerProps:Ge,popupProps:Ge})},[e])}function ar(e,t){H(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),H(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class fr{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let rt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=at.startingStyle]="startingStyle",e[e.endingStyle=at.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),qe=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const xn={[qe.popupOpen]:""},In={[qe.popupOpen]:"",[qe.pressed]:""},kn={[rt.open]:""},Pn={[rt.closed]:""},Fn={[rt.anchorHidden]:""},dr={open(e){return e?xn:null}},pr={open(e){return e?In:null}},gr={open(e){return e?kn:Pn},anchorHidden(e){return e?Fn:null}};function hr(e){return ze(e,"base-ui")}const Mn="ArrowUp",An="ArrowDown",Wn="ArrowLeft",Nn="ArrowRight",Ln="Home",Yn="End",Bn=new Set([Wn,Nn]),Hn=new Set([Mn,An]),_n=new Set([...Bn,...Hn]),mr=new Set([..._n,Ln,Yn]),br=g.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return Se.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});let Tt={},St={},vt="";function Gn(e){if(typeof document>"u")return!1;const t=K(e);return Ye(t).innerWidth-t.documentElement.clientWidth>0}function Dn(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=K(e),r=n.documentElement,s=n.body,o=Ze(r)?r:s,i=o.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const h=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=u,h===f}function Un(e){const t=K(e),n=t.documentElement,r=t.body,s=Ze(n)?n:r,o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function Kn(e){const t=K(e),n=t.documentElement,r=t.body,s=Ye(n);let o=0,i=0,u=!1;const h=me.create();if(Je&&(s.visualViewport?.scale??1)!==1)return()=>{};function f(){const T=s.getComputedStyle(n),A=s.getComputedStyle(r),y=(T.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Tt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},vt=n.style.scrollBehavior,St={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 E=n.scrollHeight>n.clientHeight,Q=n.scrollWidth>n.clientWidth,B=T.overflowY==="scroll"||A.overflowY==="scroll",$=T.overflowX==="scroll"||A.overflowX==="scroll",J=Math.max(0,s.innerWidth-r.clientWidth),G=Math.max(0,s.innerHeight-r.clientHeight),se=parseFloat(A.marginTop)+parseFloat(A.marginBottom),F=parseFloat(A.marginLeft)+parseFloat(A.marginRight),q=Ze(n)?n:r;if(u=Dn(e),u){n.style.scrollbarGutter=y,q.style.overflowY="hidden",q.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(E||B)&&(n.style.overflowY="scroll"),(Q||$)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:se||G?`calc(100dvh - ${se+G}px)`:"100dvh",width:F||J?`calc(100vw - ${F+J}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function k(){Object.assign(n.style,Tt),Object.assign(r.style,St),u||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=vt)}function L(){k(),h.request(f)}f();const b=x(s,"resize",L);return()=>{h.cancel(),k(),typeof s.removeEventListener=="function"&&b()}}class Xn{lockCount=0;restore=null;timeoutLock=Le.create();timeoutUnlock=Le.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=K(t).documentElement,s=Ye(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=wt;return}const o=cn||!Gn(t);this.restore=o?Un(t):Kn(t)}}const Vn=new Xn;function Er(e=!0,t=null){H(()=>{if(e)return Vn.acquire(t)},[e,t])}export{pr as A,jn as B,rt as C,zn as D,De as E,vn as F,un as G,an as H,br as I,fn as J,fr as P,er as a,mr as b,tr as c,Qn as d,ar as e,cr as f,ur as g,Zn as h,Er as i,lr as j,nr as k,Tn as l,wn as m,qn as n,tt as o,gr as p,et as q,Fe as r,rr as s,dr as t,hr as u,Ae as v,sr as w,Jn as x,or as y,ir as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,T as r,n,o as a,p as s}from"./__vite-browser-external-
|
|
1
|
+
import{r as e,T as r,n,o as a,p as s}from"./__vite-browser-external-Db9onipF.js";const T=Object.freeze({mode:n.COMPACT,setMode:()=>{},formatTokens:(o,t={})=>s(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function f(){return e.useContext(r)??T}export{f as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a}from"./__vite-browser-external-
|
|
1
|
+
import{m as a}from"./__vite-browser-external-Db9onipF.js";const o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],e=a("zap",o);export{e as Z};
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
]
|
|
260
260
|
}
|
|
261
261
|
</script>
|
|
262
|
-
<script type="module" crossorigin src="/assets/__vite-browser-external-
|
|
262
|
+
<script type="module" crossorigin src="/assets/__vite-browser-external-Db9onipF.js"></script>
|
|
263
263
|
<link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CzQk3FUc.css">
|
|
264
264
|
</head>
|
|
265
265
|
<body>
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
]
|
|
166
166
|
}
|
|
167
167
|
</script>
|
|
168
|
-
<script type="module" crossorigin src="/assets/__vite-browser-external-
|
|
168
|
+
<script type="module" crossorigin src="/assets/__vite-browser-external-Db9onipF.js"></script>
|
|
169
169
|
<link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CzQk3FUc.css">
|
|
170
170
|
</head>
|
|
171
171
|
<body>
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
138
|
</script>
|
|
139
|
-
<script type="module" crossorigin src="/assets/__vite-browser-external-
|
|
139
|
+
<script type="module" crossorigin src="/assets/__vite-browser-external-Db9onipF.js"></script>
|
|
140
140
|
<link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CzQk3FUc.css">
|
|
141
141
|
</head>
|
|
142
142
|
<body>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"description": "Shareable Token Tracker dashboard snapshot."
|
|
76
76
|
}
|
|
77
77
|
</script>
|
|
78
|
-
<script type="module" crossorigin src="/assets/__vite-browser-external-
|
|
78
|
+
<script type="module" crossorigin src="/assets/__vite-browser-external-Db9onipF.js"></script>
|
|
79
79
|
<link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CzQk3FUc.css">
|
|
80
80
|
</head>
|
|
81
81
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tokentracker-cli",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.2",
|
|
4
4
|
"description": "Local-first AI coding token usage and cost tracker for 29 tools, with a dashboard, desktop pet, widgets, achievements, and native macOS/Windows apps.",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -6,18 +6,23 @@ const fs = require("node:fs/promises");
|
|
|
6
6
|
|
|
7
7
|
const { readJson, writeJson } = require("../lib/fs");
|
|
8
8
|
const { resolveTrackerPaths } = require("../lib/tracker-paths");
|
|
9
|
+
const { resolveRuntimeConfig } = require("../lib/runtime-config");
|
|
9
10
|
|
|
10
|
-
const DEFAULT_BASE_URL = "https://srctyff5.us-east.insforge.app";
|
|
11
11
|
const POLL_INTERVAL_MS = 5_000;
|
|
12
12
|
const ABSOLUTE_TIMEOUT_MS = 16 * 60 * 1000; // matches the 15-min server window with a small buffer
|
|
13
13
|
|
|
14
14
|
function readBaseUrl(config) {
|
|
15
|
-
return (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
return resolveRuntimeConfig({
|
|
16
|
+
// Preserve device-login's explicit legacy override names and precedence,
|
|
17
|
+
// while routing persisted config through the shared retired-host filter.
|
|
18
|
+
cli: {
|
|
19
|
+
baseUrl:
|
|
20
|
+
process.env.TOKENTRACKER_BASE_URL ||
|
|
21
|
+
process.env.TOKENTRACKER_API_URL,
|
|
22
|
+
},
|
|
23
|
+
config: config || {},
|
|
24
|
+
env: {},
|
|
25
|
+
}).baseUrl;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
async function authorize({ baseUrl, clientInfo, machineId }) {
|
package/src/commands/init.js
CHANGED
|
@@ -342,6 +342,9 @@ async function runSetup({
|
|
|
342
342
|
const config = {
|
|
343
343
|
...existingPlainConfig,
|
|
344
344
|
installedAt,
|
|
345
|
+
// Keep a persisted legacy URL until the first sync. sync owns the migration
|
|
346
|
+
// lock and must reset the upload offset/backoff before removing this marker;
|
|
347
|
+
// rewriting it here would skip the historical replay permanently.
|
|
345
348
|
baseUrl: opts.baseUrl || existingPlainConfig.baseUrl || DEFAULT_BASE_URL,
|
|
346
349
|
};
|
|
347
350
|
if (opts.dashboardUrl) {
|