tokentracker-cli 1.3.6 → 1.3.8
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/THIRD_PARTY_NOTICES.md +39 -0
- package/dashboard/dist/THIRD_PARTY_NOTICES.txt +39 -0
- package/dashboard/dist/assets/{AchievementBadge-CHDt55IP.js → AchievementBadge-BqLeP5y3.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-DpbRHmb8.js → AchievementsPage-BwVkM45R.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-Ck5CiX4P.js → AchievementsSection-CglgOcQ1.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-BVPqlh0X.js → BadgeDetailModal-IurF0cmo.js} +1 -1
- package/dashboard/dist/assets/BotAnimated-C4_NxPuy.js +1 -0
- package/dashboard/dist/assets/{Card-C9FjyAwh.js → Card-C-UuIN42.js} +1 -1
- package/dashboard/dist/assets/{CloudCheckoutPage-ChkjId9l.js → CloudCheckoutPage-CrMDquLi.js} +1 -1
- package/dashboard/dist/assets/CloudPage-D6xTPnMs.js +2 -0
- package/dashboard/dist/assets/{CommandPalette-DFnEeZzc.js → CommandPalette-8LFLY-LQ.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-CZDS8gPA.js → CommunityStatsModal-DYTjxABN.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DRhgBoGE.js → ConfirmModal-St89kP59.js} +1 -1
- package/dashboard/dist/assets/{Controls-BmT6-x_L.js → Controls-BJAwM2gB.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-BvGqFvP7.js +1 -0
- package/dashboard/dist/assets/{DateRangePopover-DuqNLatr.js → DateRangePopover-Cbd1idiF.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-BtI0bWyg.js → DevicePage-BcSU0xgf.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-DjnC3P4V.js → DialogClose-Cb1-Hd8P.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DQvYzWMp.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-B9NNSz5p.js → DialogTitle-VXrHY7H0.js} +1 -1
- package/dashboard/dist/assets/ElectricLogo-D0wiAojj.css +1 -0
- package/dashboard/dist/assets/ElectricLogo-DmQqYnSD.js +282 -0
- package/dashboard/dist/assets/{FadeIn-fsVQmJGa.js → FadeIn-BEieTXMD.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-Cg-f1iZc.js → HeaderGithubStar-BlYC_PSb.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-DRIRlzXH.js → HoverTooltip-C5Pe7iBz.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-DaAubaJQ.js → IpCheckPage-Diln3EdG.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-DjBGIjHk.js → LandingPage-BzGYuAO7.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardPage-BkCXqhz7.js → LeaderboardPage-Bn-ehU5S.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProBadge-Ds-wiWcN.js → LeaderboardProBadge-SovdGwYs.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfileModal-X_rfSQT5.js → LeaderboardProfileModal-BhxmTcHh.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-rpl1Ozwj.js → LeaderboardProfilePage-3iAYvoTb.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-BUvDBmgD.js → LimitsPage-DHxFAdqK.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-LBH1DBrs.js → LocalOnlyNotice-HlGfiiI3.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-B0vRJEcg.js → LoginCard-CamUYmiF.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-DdzgP43f.js → LoginModal-CcmYUJ45.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-B4VCQxzn.js → LoginPage-DMNNmZwr.js} +1 -1
- package/dashboard/dist/assets/PetPage-D6xFX8QA.js +2 -0
- package/dashboard/dist/assets/PopoverPopup-CKKgItAT.js +1 -0
- package/dashboard/dist/assets/{ProviderIcon-ClHXNkQ0.js → ProviderIcon-B-uS3pJ3.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-BeUpNt_6.js → ResetPasswordPage-DX4RJjX0.js} +1 -1
- package/dashboard/dist/assets/{Select-BHEXdYHu.js → Select-Dcg7FYAt.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-aaQK_QIt.js → SelectItemText-4vuj6xMs.js} +1 -1
- package/dashboard/dist/assets/{SelfHostPage-ClNhKnlP.js → SelfHostPage-ButVBgE7.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-Byd_s6FS.js → ServiceStatusPage-DJDDO6lV.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-u3_b4PO7.js → SessionsPage-CiUirFMD.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-CB4CML8u.js +5 -0
- package/dashboard/dist/assets/{SkillsPage-Bb-PVfux.js → SkillsPage-D2tfFFY8.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-CubA3PXu.js → TokenGalaxy-TQ-eWK8P.js} +1 -1
- package/dashboard/dist/assets/TooltipPopup-BhSCJqFR.js +1 -0
- package/dashboard/dist/assets/{TrendMonitor-as8idaOy.js → TrendMonitor-CP6ZZ53c.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-DDPR4v0R.js → WidgetsPage-BdeR7P8D.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-zZzgYz6s.js → WrappedPage-OqcqupRE.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-BXwSXUpN.js +45 -0
- package/dashboard/dist/assets/__vite-browser-external-DvNSoTb8.css +1 -0
- package/dashboard/dist/assets/{agent-logos-CoNhCm9-.js → agent-logos-E6GfkcgD.js} +1 -1
- package/dashboard/dist/assets/{arrow-left-C5hDp7fc.js → arrow-left-D_ufthLH.js} +1 -1
- package/dashboard/dist/assets/{arrow-right-DEvMmSiA.js → arrow-right-CgV_OrFz.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DxY0neJ4.js → arrow-up-right-CzeEeXRz.js} +1 -1
- package/dashboard/dist/assets/{calendar-days-bzh7-lab.js → calendar-days-BQdTF7ec.js} +1 -1
- package/dashboard/dist/assets/{check-CSZvcC3X.js → check-C--D8Lze.js} +1 -1
- package/dashboard/dist/assets/{chevron-down-CsiGcG0G.js → chevron-down-BzkceD4z.js} +1 -1
- package/dashboard/dist/assets/{cloud-checkout-z_eDVwm6.js → cloud-checkout-m1Yllbij.js} +1 -1
- package/dashboard/dist/assets/{composite-Cq0CmNAv.js → composite-7DhFi6TA.js} +1 -1
- package/dashboard/dist/assets/{download-DqLpubIF.js → download-BSyGLtfW.js} +1 -1
- package/dashboard/dist/assets/{external-link-B8E8tbB3.js → external-link-KzFbueBT.js} +1 -1
- package/dashboard/dist/assets/{flame-CrJDlnro.js → flame-DlPM_oaj.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-DPIGGOlt.js → format-tokens-BHBaWyA3.js} +1 -1
- package/dashboard/dist/assets/{gift-CCp4Hh50.js → gift-BhWBQnun.js} +1 -1
- package/dashboard/dist/assets/{host-mode-xzpMLcwP.js → host-mode--iIPGrkN.js} +1 -1
- package/dashboard/dist/assets/{icons-CbB9Y-eV.js → icons-COEaSBYi.js} +1 -1
- package/dashboard/dist/assets/{index-BiK5-tQp.js → index-Bo8CSxCq.js} +1 -1
- package/dashboard/dist/assets/{index-DX7nYrHb.js → index-CW6A_Ff_.js} +1 -1
- package/dashboard/dist/assets/{index-zuC7FU-t.js → index-Cf4HcmLp.js} +1 -1
- package/dashboard/dist/assets/{info-B3NKYwWG.js → info-D1gOdsM_.js} +1 -1
- package/dashboard/dist/assets/{link-2-BRc8d8M9.js → link-2-CXDnDOK4.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-Cm5Nsgp-.js → loader-circle-DWeQPecG.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-CYLYBECB.js → modifiers.esm-BljqMT7V.js} +1 -1
- package/dashboard/dist/assets/{monitor-smartphone--IZ4D84F.js → monitor-smartphone-DpkdtOjk.js} +1 -1
- package/dashboard/dist/assets/{play-CUrMOLtq.js → play-BlGNrekI.js} +1 -1
- package/dashboard/dist/assets/{plus-0hrCDl4r.js → plus-CpYVQ_t-.js} +1 -1
- package/dashboard/dist/assets/{provider-display-CNK0FN3Q.js → provider-display-D6Blvktj.js} +1 -1
- package/dashboard/dist/assets/{react-CCNSVHEA.js → react-BMJ2wuz1.js} +1 -1
- package/dashboard/dist/assets/{safePolygon-DsolkMUX.js → safePolygon-BFHXICk1.js} +1 -1
- package/dashboard/dist/assets/{search-DYmYb9xY.js → search-0NxXkytY.js} +1 -1
- package/dashboard/dist/assets/{server-CYcqzdSW.js → server-GHkrUKSI.js} +1 -1
- package/dashboard/dist/assets/{shield-check-5zABLIr6.js → shield-check-C16cbx1z.js} +1 -1
- package/dashboard/dist/assets/{skills-api-CD-ojBGj.js → skills-api-DAm1fFB4.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-BCn2Ms6R.js → sortable.esm-CkOax8h0.js} +1 -1
- package/dashboard/dist/assets/{store-B22kwLs0.js → store-DR444-5P.js} +1 -1
- package/dashboard/dist/assets/{terminal-CTv-oTU2.js → terminal-BpvNaIz9.js} +1 -1
- package/dashboard/dist/assets/{trash-C5MAh3GO.js → trash-DX8LwOmN.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-BrgrxUD2.js → use-community-stats-BFW4-DYG.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-B1_rbvgH.js → use-latest-request-guard-Cpcl08EJ.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-BOk5f-HM.js → use-limits-display-prefs-BqixyeAa.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-B2gc_m9W.js → use-native-settings-BSx7lGEK.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-N3sGpJ0u.js → use-ordered-list-UCjB0_zK.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-C6zOHbfR.js +1 -0
- package/dashboard/dist/assets/use-session-efficiency-pref-BgOJaGEy.js +1 -0
- package/dashboard/dist/assets/{use-transform-BsaLmw46.js → use-transform-Y98QifnQ.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-wL7v-S0r.js → use-usage-limits-DJGO-Kxv.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-CbCnjf-N.js → useCurrency-DL458pqS.js} +1 -1
- package/dashboard/dist/assets/{usePositioner-MepYlL0A.js → usePositioner-DnCQwlVT.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-Bq-rwuKa.js → useTokenFormat-CYLt9pgs.js} +1 -1
- package/dashboard/dist/assets/{zap-1ah5e11g.js → zap-BW6E_Jv3.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/dashboard/dist/token-tracker-bolt-outline.svg +3 -0
- package/dashboard/dist/token-tracker-bolt.svg +3 -0
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/BotAnimated-CVsv6kxT.js +0 -1
- package/dashboard/dist/assets/CloudPage-D1nrt3MG.js +0 -1
- package/dashboard/dist/assets/CloudUsageExport-jXdoiD0e.js +0 -4
- package/dashboard/dist/assets/DashboardPage-DfwwXZBo.js +0 -1
- package/dashboard/dist/assets/DialogDescription-yy_QHg7O.js +0 -1
- package/dashboard/dist/assets/PetPage-Cmf6aXc9.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-BzfELnIC.js +0 -1
- package/dashboard/dist/assets/SettingsPage-DweCAbsy.js +0 -2
- package/dashboard/dist/assets/TooltipPopup-DMliWhoK.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-DWN9Fb-H.js +0 -45
- package/dashboard/dist/assets/__vite-browser-external-LpFw4zXh.css +0 -1
- package/dashboard/dist/assets/skins-Mc0sI20C.js +0 -1
- package/dashboard/dist/assets/use-pet-settings-sWFXgR3m.js +0 -2
- package/dashboard/dist/assets/use-reduced-motion-C3MBYVqm.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as L,al as q,r as n,c as a,j as e,y as g,bb as le,bc as V,X as ne}from"./__vite-browser-external-DWN9Fb-H.js";import{T as $,S as de}from"./Controls-BmT6-x_L.js";import{P as ce}from"./ProviderIcon-ClHXNkQ0.js";import{u as pe,p as me,C as W,B as xe,a as be,b as ue}from"./use-pet-settings-sWFXgR3m.js";import{u as ge}from"./use-native-settings-B2gc_m9W.js";import{C as A}from"./skins-Mc0sI20C.js";import{F}from"./FadeIn-fsVQmJGa.js";import{L as he}from"./link-2-BRc8d8M9.js";import{L as X}from"./loader-circle-Cm5Nsgp-.js";import{Z as fe}from"./zap-1ah5e11g.js";import{T as ye}from"./trash-C5MAh3GO.js";import{D as ke,a as ve,b as je,c as we,d as Ne,e as Ce}from"./DialogTitle-B9NNSz5p.js";import{D as Se}from"./DialogDescription-yy_QHg7O.js";import{D as Ie}from"./DialogClose-DjnC3P4V.js";import"./Card-C9FjyAwh.js";import"./react-CCNSVHEA.js";import"./use-reduced-motion-C3MBYVqm.js";import"./composite-Cq0CmNAv.js";import"./store-B22kwLs0.js";const Y={name:"file-archive",size:24,node:[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]]};Y.node;const Pe=L(Y);const Z={name:"monitor-up",size:24,node:[["path",{d:"m9 10 3-3 3 3",key:"11gsxs"}],["path",{d:"M12 13V7",key:"h0r20n"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]};Z.node;const De=L(Z);const G={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};G.node;const ze=L(G),v=[{id:"clawd",displayName:"Clawd",nameKey:"pet.character.clawd",spriteVersionNumber:1,custom:!1},{id:"bot",displayName:"Bot",nameKey:"pet.character.bot",spriteVersionNumber:1,custom:!1},{id:"sprout",displayName:"Sprout",nameKey:"pet.character.sprout",spriteVersionNumber:1,custom:!1,assetUrl:"/pets/sprout/spritesheet.webp"},{id:"byte",displayName:"Byte",nameKey:"pet.character.byte",spriteVersionNumber:1,custom:!1,assetUrl:"/pets/byte/spritesheet.webp"},{id:"ember",displayName:"Ember",nameKey:"pet.character.ember",spriteVersionNumber:1,custom:!1,assetUrl:"/pets/ember/spritesheet.webp"}];async function P(t){const r=await t.json().catch(()=>null);if(!t.ok||r?.ok===!1)throw new Error(r?.error||`Pet request failed with HTTP ${t.status}`);return r}async function Te(){const t=await fetch("/functions/tokentracker-pets",{headers:{Accept:"application/json"},cache:"no-store"}),r=await P(t),o=new Set(Array.isArray(r.hiddenBuiltinIds)?r.hiddenBuiltinIds:[]);return[...v.filter(s=>!s.assetUrl||!o.has(s.id)),...Array.isArray(r.pets)?r.pets:[]]}async function O(t){const r=await q();return P(await fetch("/functions/tokentracker-pets",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...r},cache:"no-store",body:JSON.stringify(t)}))}function _e(t){return O({action:"install_url",url:t})}async function H(t){const r=await q();return P(await fetch("/api/pets/import",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/zip",...r},cache:"no-store",body:t}))}function Ae(t){return O({action:"remove",id:t})}async function Be(){const t=await fetch("/functions/tokentracker-pets?scope=codex",{headers:{Accept:"application/json"},cache:"no-store"}),r=await P(t);return{importable:Array.isArray(r.importable)?r.importable:[],codexDetected:r.codexDetected===!0}}function Le(t){return O({action:"import_codex",ids:t})}let B=v;function Oe(){const[t,r]=n.useState(B),[o,s]=n.useState(!0),[x,d]=n.useState(!1),b=n.useCallback(async()=>{s(!0);try{const m=await Te();return B=m,r(m),d(!0),m}catch{return B=v,r(v),d(!1),v}finally{s(!1)}},[]);return n.useEffect(()=>{b()},[b]),{pets:t,loading:o,available:x,refresh:b}}const Ee={clawd:"from-oai-amber-50 dark:from-orange-950/70",bot:"from-oai-brand-50 dark:from-teal-950/70",sprout:"from-oai-brand-100 dark:from-emerald-950/70",byte:"from-oai-gray-200 dark:from-slate-800/70",ember:"from-orange-100 dark:from-orange-950/80"};function Me(){const t=a("pet.import.subtitle"),r="codex-pets.net",o=t.indexOf(r);return o<0?t:e.jsxs(e.Fragment,{children:[t.slice(0,o),e.jsx("a",{href:"https://codex-pets.net",target:"_blank",rel:"noreferrer",className:"underline decoration-oai-gray-400 underline-offset-2 transition-colors hover:text-oai-black dark:decoration-oai-gray-500 dark:hover:text-white",children:r}),t.slice(o+r.length)]})}const j=[{id:"idle-living",labelKey:"pet.state.calm"},{id:"working-thinking",labelKey:"pet.state.focus"},{id:"working-juggling",labelKey:"pet.state.multitask"},{id:"working-wizard",labelKey:"pet.state.streak"},{id:"happy",labelKey:"pet.state.celebrate"},{id:"sleeping",labelKey:"pet.state.rest"}];function J({character:t,selected:r,onSelect:o,onRemove:s,removeDisabled:x}){const d=t.nameKey?a(t.nameKey):t.displayName;return e.jsxs("div",{className:"group relative",children:[e.jsxs("button",{type:"button",onClick:o,"aria-pressed":r,className:g("relative w-full overflow-hidden rounded-xl border p-2.5 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",r?"border-oai-brand-500/40 bg-white dark:border-oai-brand-500/25 dark:bg-oai-gray-900/80":"border-oai-gray-200/80 bg-white/55 hover:border-oai-gray-400 dark:border-oai-gray-800 dark:bg-oai-gray-950/55 dark:hover:border-oai-gray-600"),children:[e.jsx("div",{className:g("absolute inset-0 bg-gradient-to-br to-transparent opacity-80 dark:opacity-55",Ee[t.id]||"from-oai-gray-200/80 dark:from-oai-gray-800/70")}),e.jsxs("div",{className:"relative flex items-center gap-2.5",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center",children:e.jsx(W,{state:"idle-living",character:t.id,pet:t,size:44})}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-oai-black dark:text-white",children:d}),t.spriteVersionNumber===2?e.jsx("span",{className:"shrink-0 rounded border border-oai-gray-300/80 px-1 text-[9px] font-semibold text-oai-gray-500 dark:border-oai-gray-600 dark:text-oai-gray-400",children:a("pet.format.v2")}):null,r?e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-oai-brand-500","aria-hidden":!0}):null]})]})]}),s?e.jsx("button",{type:"button",disabled:x,onClick:s,"aria-label":`${a("pet.import.remove")} · ${d}`,className:g("absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded-md border border-oai-gray-200/90 bg-white/95 text-oai-gray-500 transition-opacity hover:text-red-600 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-40 dark:border-oai-gray-700 dark:bg-oai-gray-900/95 dark:text-oai-gray-400 dark:hover:text-red-400","opacity-0 group-hover:opacity-100"),children:e.jsx(ye,{className:"h-3 w-3","aria-hidden":!0})}):null]})}function Ke({value:t,onChange:r}){const o={auto:a("pet.bot.color.auto"),bleu:a("pet.bot.color.bleu"),turquoise:a("pet.bot.color.turquoise"),vert:a("pet.bot.color.vert"),ambre:a("pet.bot.color.ambre"),rose:a("pet.bot.color.rose"),violet:a("pet.bot.color.violet")};return e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-1.5 rounded-full border border-black/5 bg-white/65 px-2.5 py-1.5 backdrop-blur-md dark:border-white/10 dark:bg-black/20",role:"radiogroup","aria-label":a("pet.bot.color"),children:xe.map(s=>{const x=(t||"auto")===s;return e.jsx("button",{type:"button",role:"radio","aria-checked":x,"aria-label":o[s],title:o[s],onClick:()=>r(s),className:g("h-4 w-4 rounded-full border transition-transform duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",x?"scale-125 border-oai-black shadow-sm dark:border-white":"border-black/15 hover:scale-110 dark:border-white/25"),style:s==="auto"?{background:`linear-gradient(135deg, ${A.get(be).hex} 0 50%, ${A.get(ue).hex} 50% 100%)`}:{background:A.get(s)?.hex}},s)})})}function Re({pet:t,state:r,onStateChange:o,botColor:s,onBotColorChange:x}){const[d,b]=n.useState(null),m=n.useRef(null),h=j.find(function(l){return l.id===r}),c=a(h?.labelKey||"pet.state.calm");return e.jsxs("section",{className:"relative flex min-h-[400px] flex-col overflow-hidden bg-oai-gray-50 dark:bg-oai-gray-950 sm:min-h-[440px] lg:min-h-[480px]",onPointerMove:p=>{if(t?.spriteVersionNumber!==2||!m.current)return;const l=m.current.getBoundingClientRect(),w=p.clientX-(l.left+l.width/2),N=p.clientY-(l.top+l.height/2),y=(Math.atan2(w,-N)*180/Math.PI+360)%360;b(Math.round(y/22.5)%16)},onPointerLeave:()=>b(null),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.16] dark:opacity-[0.12]",style:{backgroundImage:"radial-gradient(currentColor 0.7px, transparent 0.7px)",backgroundSize:"14px 14px"},"aria-hidden":!0}),e.jsxs("div",{className:"relative flex items-center justify-between gap-3 px-5 pt-5",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-oai-gray-500 dark:text-oai-gray-400",children:a("pet.preview.states")}),e.jsxs("div",{className:"flex items-center gap-2",children:[me(t?.id)==="vector"?e.jsx(Ke,{value:s,onChange:x}):null,e.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-black/5 bg-white/65 px-3 py-1.5 text-[11px] font-medium text-oai-gray-600 backdrop-blur-md dark:border-white/10 dark:bg-black/20 dark:text-oai-gray-300",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500","aria-hidden":!0}),c]})]})]}),e.jsx("div",{className:"relative flex flex-1 items-center justify-center px-6 py-5",children:e.jsx("div",{ref:m,className:"relative flex h-52 w-52 items-center justify-center sm:h-56 sm:w-56 lg:h-64 lg:w-64",children:e.jsx("div",{className:"origin-bottom lg:scale-[1.18]",children:e.jsx(W,{state:r,character:t?.id||"clawd",pet:t,size:190,lookDirectionIndex:d,botColor:s})})})}),e.jsx("div",{className:"relative border-t border-oai-gray-200/70 bg-white/85 px-3 py-2 dark:border-oai-gray-800 dark:bg-oai-gray-950/85",children:e.jsx("div",{className:"grid grid-cols-3 gap-1","aria-label":a("pet.preview.states"),children:j.map(p=>e.jsxs("button",{type:"button",onClick:()=>o(p.id),"aria-pressed":r===p.id,className:g("flex min-h-10 flex-col items-center justify-center gap-1 rounded-lg px-1.5 text-xs transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-oai-brand-500",r===p.id?"font-semibold text-oai-black dark:text-white":"font-medium text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:[e.jsx("span",{children:a(p.labelKey)}),e.jsx("span",{className:g("h-1 w-1 rounded-full transition-colors duration-200",r===p.id?"bg-oai-black dark:bg-white":"bg-transparent"),"aria-hidden":!0})]},p.id))})})]})}function Ue({pets:t,busy:r,error:o,onImport:s,onClose:x}){const[d,b]=n.useState(()=>new Set),m=c=>b(p=>{const l=new Set(p);return l.has(c)?l.delete(c):l.add(c),l}),h=t.length!==0&&d.size===t.length;return e.jsx(ke,{open:!0,onOpenChange:c=>{!c&&!r&&x()},children:e.jsxs(ve,{children:[e.jsx(je,{className:"fixed inset-0 z-50 bg-black/15 backdrop-blur-md dark:bg-black/40 animate-tt-fade-in"}),e.jsx(we,{className:"fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6",children:e.jsxs(Ne,{className:"relative flex max-h-[86vh] w-full max-w-2xl flex-col overflow-hidden rounded-2xl border border-oai-gray-200/50 bg-white/95 shadow-2xl backdrop-blur-2xl dark:border-white/10 dark:bg-oai-gray-900/95 animate-tt-modal",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-oai-gray-200/70 px-5 py-4 dark:border-oai-gray-800",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(Ce,{className:"text-base font-semibold",children:a("pet.codex.title")}),e.jsx(Se,{className:"mt-0.5 text-xs leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a("pet.codex.subtitle")})]}),e.jsx(Ie,{type:"button",disabled:r,"aria-label":a("pet.codex.close"),className:"shrink-0 rounded-full border border-oai-gray-200/60 p-1.5 text-oai-gray-500 transition-colors hover:text-oai-black disabled:opacity-40 dark:border-oai-gray-800/60 dark:text-oai-gray-400 dark:hover:text-white",children:e.jsx(ne,{size:16})})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:[t.length===0?e.jsx("p",{className:"py-8 text-center text-sm text-oai-gray-400 dark:text-oai-gray-500",children:a("pet.codex.empty")}):e.jsx("div",{className:"grid grid-cols-2 gap-2.5 sm:grid-cols-3",children:t.map(c=>e.jsx(J,{character:c,selected:d.has(c.id),onSelect:()=>m(c.id)},c.id))}),o?e.jsx("p",{role:"alert",className:"mt-3 text-xs text-red-600 dark:text-red-400",children:o}):null]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-oai-gray-200/70 px-5 py-3 dark:border-oai-gray-800",children:[e.jsx("button",{type:"button",disabled:r||t.length===0,onClick:()=>b(h?new Set:new Set(t.map(c=>c.id))),className:"text-xs font-medium text-oai-gray-500 underline-offset-2 hover:underline disabled:opacity-40 dark:text-oai-gray-400",children:a("pet.codex.select_all")}),e.jsxs("button",{type:"button",disabled:r||d.size===0,onClick:()=>s([...d]),className:"flex h-9 items-center gap-1.5 rounded-lg bg-oai-black px-4 text-xs font-semibold text-white transition-colors disabled:bg-oai-gray-200 disabled:text-oai-gray-400 dark:bg-white dark:text-black dark:disabled:bg-oai-gray-800 dark:disabled:text-oai-gray-500",children:[r?e.jsx(X,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):null,d.size>0?`${a("pet.codex.import")} · ${d.size}`:a("pet.codex.import")]})]})]})})]})})}function lt(){const{available:t,settings:r,setSetting:o}=pe(),{pets:s,loading:x,available:d,refresh:b}=Oe(),[m,h]=n.useState(""),[c,p]=n.useState(""),[l,w]=n.useState(!1),[N,y]=n.useState([]),[Q,D]=n.useState(!1),[C,E]=n.useState(!1),[ee,z]=n.useState(""),[te,M]=n.useState("idle-living"),[K,ae]=n.useState(!0),k=r.character||"clawd",T=ge(),R=T.settings?.menuBarIconStyle==="pet",re=s.find(i=>i.id===k)||s[0],S=l?{kind:"busy",text:a("pet.import.busy")}:c?{kind:"error",text:c}:null,U=N.length!==0;n.useEffect(()=>{!x&&s.length>0&&!s.some(i=>i.id===k)&&o("character","clawd")},[x,s,k,o]);async function I(i,u=a("pet.import.success")){w(!0),p("");try{const f=await i();await b(),le(),f?.pet?.id&&o("character",f.pet.id),V({title:u,timeout:4e3}),h("")}catch(f){p(f?.message||a("pet.import.failed"))}finally{w(!1)}}const _=n.useCallback(async()=>{if(!d){y([]);return}try{const i=await Be();y(i.importable)}catch{y([])}},[d]);n.useEffect(()=>{_()},[_]);async function ie(i){E(!0),z("");try{return await Le(i),await b(),await _(),V({title:a("pet.codex.imported"),timeout:4e3}),!0}catch(u){return z(u?.message||a("pet.import.failed")),!1}finally{E(!1)}}n.useEffect(()=>{if(!K)return;const i=window.setInterval(()=>{M(u=>{const f=j.findIndex(oe=>oe.id===u);return j[(f+1)%j.length].id})},5e3);return()=>window.clearInterval(i)},[K]);const se=[{value:"small",label:a("pet.size.small")},{value:"medium",label:a("pet.size.medium")},{value:"large",label:a("pet.size.large")}];return e.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:e.jsx("main",{className:"flex-1 pb-14 pt-8 sm:pt-10",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(F,{y:12,children:e.jsxs("header",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight sm:text-4xl",children:a("pet.page.title")}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a("pet.page.subtitle")})]})}),e.jsx(F,{y:12,delay:.04,children:e.jsxs("div",{className:"overflow-hidden rounded-[28px] border border-oai-gray-200 bg-white/75 dark:border-oai-gray-800 dark:bg-oai-gray-900/60 lg:grid lg:grid-cols-[1.12fr_0.88fr]",children:[e.jsx(Re,{pet:re,state:te,onStateChange:i=>{ae(!1),M(i)},botColor:r.botColor,onBotColorChange:i=>o("botColor",i)}),e.jsxs("aside",{className:"flex flex-col border-t border-oai-gray-200 p-5 dark:border-oai-gray-800 lg:min-h-[480px] lg:border-l lg:border-t-0",children:[e.jsxs("section",{"aria-labelledby":"pet-character-title",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"pet-character-title",className:"text-sm font-semibold",children:a("pet.characters.title")}),e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a("pet.characters.subtitle")})]}),e.jsx("div",{className:"mt-4 grid max-h-72 grid-cols-2 gap-2 overflow-y-auto pr-1 -mr-1",children:s.map(i=>e.jsx(J,{character:i,selected:k===i.id,onSelect:()=>o("character",i.id),removeDisabled:l,onRemove:d&&i.id!=="clawd"&&i.id!=="bot"?()=>I(async()=>(await Ae(i.id),k===i.id&&o("character","clawd"),null),a("pet.import.removed")):void 0},i.id))}),T.available?e.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 rounded-xl border border-oai-gray-200/70 bg-oai-gray-50/60 px-3 py-2.5 dark:border-oai-gray-800 dark:bg-oai-gray-900/40",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold",children:a("pet.menubar.title")}),e.jsx("p",{className:"mt-0.5 text-[11px] leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a("pet.menubar.hint")})]}),e.jsx($,{checked:R,onChange:()=>T.setSetting("menuBarIconStyle",R?"clawd":"pet"),ariaLabel:a("pet.menubar.title")})]}):null]}),d?e.jsxs("section",{className:"mt-6 border-t border-oai-gray-200/70 pt-5 dark:border-oai-gray-800","aria-labelledby":"pet-import-title",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-4 w-4 shrink-0 text-oai-gray-500","aria-hidden":!0}),e.jsx("h2",{id:"pet-import-title",className:"text-sm font-semibold",children:a("pet.import.title")})]}),e.jsx("p",{className:"mt-1 text-xs leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:e.jsx(Me,{})}),e.jsxs("form",{className:"mt-3 flex gap-2",onSubmit:i=>{i.preventDefault(),!l&&m.trim()&&I(()=>_e(m))},children:[e.jsxs("label",{className:"relative flex min-w-0 flex-1 items-center",children:[e.jsx(he,{className:"pointer-events-none absolute left-3 h-3.5 w-3.5 text-oai-gray-400","aria-hidden":!0}),e.jsx("input",{value:m,onChange:i=>h(i.target.value),"aria-label":a("pet.import.url_label"),placeholder:"codex-pets.net/#/pets/…",className:"h-9 w-full rounded-lg border border-oai-gray-200 bg-white pl-9 pr-3 text-xs outline-none focus:border-oai-brand-500 dark:border-oai-gray-700 dark:bg-oai-gray-950"})]}),e.jsxs("button",{type:"submit",disabled:l||!m.trim(),className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg bg-oai-black px-3.5 text-xs font-semibold text-white transition-colors disabled:bg-oai-gray-200 disabled:text-oai-gray-400 dark:bg-white dark:text-black dark:disabled:bg-oai-gray-800 dark:disabled:text-oai-gray-500",children:[l?e.jsx(X,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":!0}):null,a("pet.import.add")]})]}),e.jsxs("div",{className:g("mt-2 grid gap-2",U?"grid-cols-2":"grid-cols-1"),children:[U?e.jsxs("button",{type:"button",disabled:l||C,onClick:()=>{z(""),D(!0)},className:g("flex h-9 cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-dashed border-oai-gray-300 text-xs font-medium text-oai-gray-500 transition-colors hover:border-oai-gray-500 hover:text-oai-black dark:border-oai-gray-600 dark:text-oai-gray-400 dark:hover:border-oai-gray-400 dark:hover:text-white",(l||C)&&"pointer-events-none opacity-40"),children:[e.jsx(ce,{provider:"codex",size:14,className:"fill-current"}),a("pet.codex.browse")]}):null,e.jsxs("label",{onDragOver:i=>i.preventDefault(),onDrop:i=>{if(i.preventDefault(),l)return;const u=i.dataTransfer?.files?.[0];u&&I(()=>H(u))},className:g("flex h-9 cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-dashed border-oai-gray-300 text-xs font-medium text-oai-gray-500 transition-colors hover:border-oai-gray-500 hover:text-oai-black dark:border-oai-gray-600 dark:text-oai-gray-400 dark:hover:border-oai-gray-400 dark:hover:text-white",l&&"pointer-events-none opacity-40"),children:[e.jsx(Pe,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("pet.import.zip"),e.jsx("input",{type:"file",accept:".zip,.codex-pet.zip,application/zip",className:"sr-only",disabled:l,onChange:i=>{const u=i.target.files?.[0];u&&I(()=>H(u)),i.target.value=""}})]})]}),S?e.jsx("p",{role:S.kind==="error"?"alert":"status",className:g("mt-2 text-xs",S.kind==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400"),children:S.text}):null,Q?e.jsx(Ue,{pets:N,busy:C,error:ee,onClose:()=>{C||D(!1)},onImport:async i=>{await ie(i)&&D(!1)}}):null]}):null,e.jsxs("section",{className:"mt-6 border-t border-oai-gray-200/70 pt-5 dark:border-oai-gray-800",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4 text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75,"aria-hidden":!0}),e.jsx("h2",{className:"text-sm font-semibold",children:a("pet.controls.title")})]}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-sm font-medium",children:a("pet.controls.show")}),e.jsx($,{checked:r.visible,onChange:()=>o("visible",!r.visible),disabled:!t,ariaLabel:a("pet.controls.show")})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-sm font-medium",children:a("pet.controls.size")}),e.jsx("div",{className:"shrink-0",children:e.jsx(de,{options:se,value:r.size,onChange:i=>o("size",i),disabled:!t})})]})]})]}),t?null:e.jsxs("div",{className:"mt-6 flex gap-2 rounded-xl bg-oai-gray-100 p-3 text-xs leading-relaxed text-oai-gray-500 dark:bg-oai-gray-800/70 dark:text-oai-gray-400",children:[e.jsx(fe,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),a("pet.controls.native_only")]})]})]})})]})})})}export{lt as PetPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,bi as V,bx as re,b6 as X,by as q,bz as ae,O as ie,bA as ce,ax as z,bB as Q,a_ as ue,j as d,bC as le,N as W,bD as pe,bE as de,bF as ge,ba as fe,bG as me,bH as he,bh as Pe,M as Ce,J as te,bj as Se,bI as $,bJ as be,bK as Te,bL as xe,b1 as ve,bM as Re,b0 as Ie,bN as Ee,bO as Oe}from"./__vite-browser-external-DWN9Fb-H.js";import{p as ye,c as Fe}from"./store-B22kwLs0.js";import{e as Me,f as ke,P as Ae,h as je,j as we,k as He,l as Ne,m as Be,n as Ge,o as Le,p as _e,u as Ke,d as Ue,q as De,t as Ve,r as Je,I as Ye,s as qe,v as ze,w as Qe,x as We,C as Xe,y as Ze}from"./composite-Cq0CmNAv.js";import{k as $e,l as et,m as tt,n as ot}from"./SelectItemText-aaQK_QIt.js";import{u as nt,a as st,s as rt,b as at}from"./safePolygon-DsolkMUX.js";import{u as it,a as ct,g as ut}from"./usePositioner-MepYlL0A.js";const oe=a.createContext(void 0);function K(e){const o=a.useContext(oe);if(o===void 0&&!e)throw new Error(V(47));return o}const lt={...ye,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class pt extends re{constructor(o,t,i){const s=new Ae;super(dt(o,s,t,i),gt(s),lt)}setOpen=(o,t)=>{const i=t.reason===X,s=t.reason===q&&t.event.detail===0,g=!o&&(t.reason===ae||t.reason==null),l=Me(t),c=this.select("activeTriggerId");if(!o&&t.reason===ie&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(o,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(o,t);const f=()=>{const m=ke(this.state,o,t.trigger,l());m.openChangeReason=t.reason,this.update(m)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(ce,()=>{this.set("stickIfOpen",!1)}),z.flushSync(f)):f();let n;s?n="click":g?n="dismiss":t.reason===Q&&(n="focus"),this.set("instantType",n)}}function dt(e,o,t,i=!1){const s={...Fe(o,t,i),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&e?.mounted===void 0&&(s.mounted=!0),s}function gt(e){return{popupRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:a.createRef(),beforeContentFocusGuardRef:a.createRef(),stickIfOpenTimeout:new ue,triggerElements:e}}const ee=le(function({props:o}){const{children:t,open:i,defaultOpen:s=!1,onOpenChange:g,onOpenChangeComplete:l,modal:c=!1,handle:f,triggerId:n,defaultTriggerId:m=null}=o,r=ft(f,{modal:c,open:s,openProp:i,activeTriggerId:m,triggerIdProp:n});r.useControlledProp("openProp",i),r.useControlledProp("triggerIdProp",n);const h=r.useState("open"),I=r.useState("mounted"),b=r.useState("payload");r.useContextCallback("onOpenChange",g),r.useContextCallback("onOpenChangeComplete",l),we(r,h),He(r);const{forceUnmount:x}=Ne(h,r,()=>{r.update({stickIfOpen:!0,openChangeReason:null})});r.useSyncedValues({modal:c}),a.useEffect(()=>{h||r.context.stickIfOpenTimeout.clear()},[r,h]),a.useImperativeHandle(o.actionsRef,()=>({unmount:x,close:()=>r.setOpen(!1,W(pe))}),[x,r]);const y=h||I;return d.jsxs(oe.Provider,{value:r,children:[f&&d.jsx(Be,{handle:f,store:r}),y&&d.jsx(mt,{store:r,modal:c}),typeof t=="function"?t({payload:b}):t]})});function yt(e){return K(!0)?d.jsx(ee,{props:e}):d.jsx(je,{children:d.jsx(ee,{props:e})})}function ft(e,o){const t=Ge((i,s)=>new pt(o,i,s));return a.useEffect(()=>t.context.stickIfOpenTimeout.disposeEffect(),[t]),t}function mt({store:e,modal:o}){const t=e.useState("floatingRootContext"),i=Le(t,{outsidePressEvent:{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=i.reference,g=i.floating;return _e(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:g}),null}const ht=300;function Pt(e,o){const t=a.useRef(null);function i(g){z.flushSync(()=>{e.setOpen(!1,W(Q,g.nativeEvent,g.currentTarget))}),he(t.current)?.focus()}function s(g){const l=e.select("positionerElement");if(l&&de(g,l))e.context.beforeContentFocusGuardRef.current?.focus();else{z.flushSync(()=>{e.setOpen(!1,W(Q,g.nativeEvent,g.currentTarget))});let c=ge(e.context.triggerFocusTargetRef.current||o.current);for(;c!==null&&fe(l,c);){const f=c;if(c=me(c),c===f)break}c?.focus()}}return{preFocusGuardRef:t,handlePreFocusGuardFocus:i,handleFocusTargetFocus:s}}const Ft=Pe(function(o,t){const{render:i,className:s,style:g,disabled:l=!1,nativeButton:c=!0,handle:f,payload:n,openOnHover:m=!1,delay:r=ht,closeDelay:h=0,id:I,...b}=o,x=K(!0),u=nt(f)??x;if(!u)throw new Error(V(74));const P=Ke(I),p=u.useState("isTriggerActive",P),F=u.useState("floatingRootContext"),E=u.useState("isOpenedByTrigger",P),M=u.useState("triggerPopupId",P),C=a.useRef(null),{registerTrigger:T,isMountedByThisTrigger:v}=Ue(P,C,u,{payload:n,disabled:l,openOnHover:m,closeDelay:h}),O=u.useState("openChangeReason"),N=u.useState("stickIfOpen"),B=u.useState("openMethod"),k=u.useState("focusManagerModal"),G=st(F,{enabled:!l&&m&&(B!=="touch"||O!==q),mouseOnly:!0,move:!1,handleClose:rt(),restMs:r,delay:{close:h},triggerElementRef:C,isActiveTrigger:p,isClosing:()=>u.select("transitionStatus")==="ending"}),A=$e(F,{stickIfOpen:N}),L=et(()=>u.select("open"),R=>{u.set("openMethod",R)}),j=u.useState("triggerProps",v),{getButtonProps:w,buttonRef:S}=Ce({disabled:l,native:c}),U={open(R){return R&&O===q?De.open(R):Ve.open(R)}},{preFocusGuardRef:D,handlePreFocusGuardFocus:J,handleFocusTargetFocus:Y}=Pt(u,C),H=te("button",o,{state:{disabled:l,open:E},ref:[S,t,T,C],props:[A.reference,G,j,L,{[Se]:"",id:P,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":M},b,w],stateAttributesMapping:U}),_=d.jsx(a.Fragment,{children:H},P);return v&&!k?d.jsxs(a.Fragment,{children:[d.jsx($,{ref:D,onFocus:J}),_,d.jsx($,{ref:u.context.triggerFocusTargetRef,onFocus:Y})]}):_}),ne=a.createContext(void 0);function Ct(){const e=a.useContext(ne);if(e===void 0)throw new Error(V(45));return e}const Mt=a.forwardRef(function(o,t){const{keepMounted:i=!1,...s}=o;return K().useState("mounted")||i?d.jsx(ne.Provider,{value:i,children:d.jsx(be,{ref:t,...s})}):null}),se=a.createContext(void 0);function St(){const e=a.useContext(se);if(!e)throw new Error(V(46));return e}const kt=a.forwardRef(function(o,t){const{render:i,className:s,style:g,anchor:l,positionMethod:c,side:f,align:n,sideOffset:m,alignOffset:r,collisionBoundary:h="clipping-ancestors",collisionPadding:I,arrowPadding:b,sticky:x,disableAnchorTracking:y=!1,collisionAvoidance:u=Te,...P}=o,p=K(),F=Ct(),E=Je(),M=p.useState("floatingRootContext"),C=p.useState("mounted"),T=p.useState("open"),v=p.useState("openChangeReason"),O=p.useState("activeTriggerElement"),N=p.useState("modal"),B=p.useState("openMethod"),k=p.useState("positionerElement"),G=p.useState("instantType"),A=p.useState("transitionStatus"),L=p.useState("adaptiveOrigin"),j=a.useRef(null),w=xe(k),S=it({anchor:l,floatingRootContext:M,positionMethod:c,mounted:C,side:f,sideOffset:m,align:n,alignOffset:r,arrowPadding:b,collisionBoundary:h,collisionPadding:I,sticky:x,disableAnchorTracking:y,keepMounted:F,nodeId:E,collisionAvoidance:u,adaptiveOrigin:L}),U=M.useState("domReferenceElement");ve(()=>{const H=U,_=j.current;if(H&&(j.current=H),_&&H&&H!==_){p.set("instantType",void 0);const R=new AbortController;return w(()=>{p.set("instantType","trigger-change")},R.signal),()=>{R.abort()}}},[U,w,p]);const D=N===!0&&v!==X;tt(T&&D,B==="touch",k,O);const J=p.useStateSetter("positionerElement"),Y={open:T,side:S.side,align:S.align,anchorHidden:S.anchorHidden,instant:G},Z=ct(o,Y,{styles:S.positionerStyles,transitionStatus:A,props:P,refs:[t,J],hidden:!C,inert:!T});return d.jsxs(se.Provider,{value:S,children:[C&&D&&d.jsx(Ye,{inert:Re(!T),cutout:O}),d.jsx(qe,{id:E,children:Z})]})}),bt=a.createContext(void 0);function Tt(){const[e,o]=a.useState(0),t=Ie(()=>(o(s=>s+1),()=>{o(s=>Math.max(0,s-1))}));return{context:a.useMemo(()=>({register:t}),[t]),hasClosePart:e>0}}const At=a.forwardRef(function(o,t){const{render:i,className:s,style:g,initialFocus:l,finalFocus:c,...f}=o,n=K(),m=St(),r=ot()!=null,{context:h,hasClosePart:I}=Tt(),b=n.useState("open"),x=n.useState("openMethod"),y=n.useState("instantType"),u=n.useState("transitionStatus"),P=n.useState("popupProps"),p=n.useState("titleElementId"),F=n.useState("descriptionElementId"),E=n.useState("modal"),M=n.useState("mounted"),C=n.useState("openChangeReason"),T=n.useState("activeTriggerElement"),v=n.useState("floatingRootContext"),O=v.useState("floatingId"),N=n.useState("disabled"),B=n.useState("openOnHover"),k=n.useState("closeDelay");Ee({open:b,ref:n.context.popupRef,onComplete(){b&&n.context.onOpenChangeComplete?.(!0)}}),at(v,{enabled:B&&!N,closeDelay:k});const G=l===void 0?ze(n.context.popupRef):l,A=E!==!1&&I;n.useSyncedValue("focusManagerModal",A);const L=n.useStateSetter("popupElement"),j={open:b,side:m.side,align:m.align,instant:y,transitionStatus:u},w=te("div",o,{state:j,ref:[t,n.context.popupRef,L],props:[P,{id:O,role:"dialog",...We,"aria-labelledby":p,"aria-describedby":F,onKeyDown(S){r&&Xe.has(S.key)&&S.stopPropagation()}},ut(u),f],stateAttributesMapping:Ze});return d.jsx(Qe,{context:v,openInteractionType:x,modal:A,disabled:!M||C===X,initialFocus:G,returnFocus:c,restoreFocus:"popup",previousFocusableElement:Oe(T)?T:void 0,nextFocusableElement:n.context.triggerFocusTargetRef,beforeContentFocusGuardRef:n.context.beforeContentFocusGuardRef,children:d.jsx(bt.Provider,{value:h,children:w})})});export{yt as P,Ft as a,Mt as b,kt as c,At as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-DWN9Fb-H.js","assets/__vite-browser-external-LpFw4zXh.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as W,j as e,c as a,y as B,a as mt,r as l,cm as gt,cn as pt,co as ht,cp as ft,a7 as X,cq as we,bu as xt,cr as bt,bt as Ne,cs as de,aP as $e,ct as yt,cu as vt,ag as ze,u as Fe,V as fe,x as jt,B as R,a8 as G,cv as kt,a9 as z,ax as wt,cw as ue,a5 as Y,aB as Nt,a1 as _t,af as St,at as se,R as be,cx as Ct,L as ne,aM as Et,au as Pt,al as Ot,am as ye,ac as At,d as He,aa as xe,ab as Be,cy as _e,cz as Se,cA as Ce,cB as Lt,cC as Tt,ao as It,Z as Ve,l as me,cD as Ee,k as Pe,cE as Rt,cF as Dt,cG as Gt,z as Ut,cH as Mt,cI as $t,cJ as zt,cK as Ft,cL as Ht,cM as Bt,cN as Vt,v as Ke,cO as Kt,cP as qt,bc as Oe,_ as Wt,e as Yt,cQ as Zt,cR as Jt,bw as Qt}from"./__vite-browser-external-DWN9Fb-H.js";import{a as Xt,b as Ae,s as ea,K as ta,P as aa,D as sa,c as na,S as ia,v as ra,u as oa,C as la}from"./sortable.esm-BCn2Ms6R.js";import{a as ca}from"./modifiers.esm-CYLYBECB.js";import{d as Le,l as Te,u as da,b as Ie}from"./use-limits-display-prefs-BOk5f-HM.js";import{P as ua}from"./ProviderIcon-ClHXNkQ0.js";import{a as E,S as q,b as V,T as D}from"./Controls-BmT6-x_L.js";import{m as qe}from"./react-CCNSVHEA.js";import{P as ma,C as We,a as ga,u as pa,b as ha}from"./CloudUsageExport-jXdoiD0e.js";import{C as fa}from"./check-CSZvcC3X.js";import{C as xa,i as ba}from"./host-mode-xzpMLcwP.js";import{A as Ye}from"./index-DX7nYrHb.js";import{r as ya,C as ge,o as va}from"./cloud-checkout-z_eDVwm6.js";import{G as Re}from"./gift-CCp4Hh50.js";import{C as ja}from"./chevron-down-CsiGcG0G.js";import{C as pe}from"./Card-C9FjyAwh.js";import{E as De}from"./external-link-B8E8tbB3.js";import{a as ka,P as wa}from"./play-CUrMOLtq.js";import{I as Ze}from"./info-B3NKYwWG.js";import{a as Na,b as _a,c as Sa,d as Ca,e as Ea}from"./TooltipPopup-DMliWhoK.js";import{L as Pa}from"./loader-circle-Cm5Nsgp-.js";import{u as Oa}from"./useCurrency-CbCnjf-N.js";import{u as Aa}from"./useTokenFormat-Bq-rwuKa.js";import{S as ve}from"./Select-BHEXdYHu.js";import{u as ie}from"./use-native-settings-B2gc_m9W.js";import{C as La}from"./ConfirmModal-DRhgBoGE.js";import{A as Ta}from"./arrow-up-right-DxY0neJ4.js";import{D as Ia}from"./download-DqLpubIF.js";import"./DialogTitle-B9NNSz5p.js";import"./composite-Cq0CmNAv.js";import"./store-B22kwLs0.js";import"./SelectItemText-aaQK_QIt.js";import"./usePositioner-MepYlL0A.js";import"./safePolygon-DsolkMUX.js";import"./DialogClose-DjnC3P4V.js";import"./DateRangePopover-DuqNLatr.js";import"./calendar-days-bzh7-lab.js";import"./PopoverPopup-BzfELnIC.js";import"./DialogDescription-yy_QHg7O.js";const Je={name:"credit-card",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}],["path",{d:"M6 14h2",key:"mk7k0u"}]]};Je.node;const Ra=W(Je);const Qe={name:"flask-conical",size:24,node:[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]};Qe.node;const Da=W(Qe);const Xe={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};Xe.node;const Ga=W(Xe);const et={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};et.node;const Ua=W(et);const tt={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};tt.node;const Ma=W(tt);const at={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};at.node;const $a=W(at);const st={name:"user-round",size:24,node:[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],aliases:["user-2"]};st.node;const za=W(st),Fa="shrink-0 text-oai-gray-900 dark:text-oai-gray-200";function Ha({checked:t,onChange:s,ariaLabel:n}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":n,onClick:s,className:B("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:e.jsx("span",{className:B("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",t?"translate-x-[18px]":"translate-x-[3px]")})})}function Ba({id:t,visible:s,onToggle:n}){const{attributes:i,listeners:r,setNodeRef:c,transform:g,transition:o,isDragging:d}=oa({id:t}),y={transform:la.Transform.toString(g)||void 0,transition:o,zIndex:d?20:void 0};return e.jsxs("div",{ref:c,style:y,className:B("flex items-center gap-3 py-2 rounded-md select-none touch-none","cursor-grab active:cursor-grabbing","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",d&&"relative bg-oai-gray-100 dark:bg-oai-gray-800"),...i,...r,children:[e.jsx(Ga,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),Le(t)?e.jsx(ua,{provider:Le(t),size:18,className:B("pointer-events-none",Fa)}):null,e.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200",children:Te(t)}),e.jsx("div",{onPointerDown:p=>p.stopPropagation(),children:e.jsx(Ha,{checked:s,onChange:n,ariaLabel:`${a("limits.settings.toggle_visible")}: ${Te(t)}`})})]})}function Va({prefs:t}){const{order:s,visibility:n,toggle:i,setAllVisible:r,moveToward:c}=t,g=s.every(u=>n[u]!==!1),o=s.every(u=>n[u]===!1),d=s.filter(u=>n[u]!==!1).length,y=Xt(Ae(aa,{activationConstraint:{distance:6}}),Ae(ta,{coordinateGetter:ea})),p=({active:u,over:x})=>{x&&u.id!==x.id&&c(u.id,x.id)};return e.jsxs(e.Fragment,{children:[e.jsx(E,{label:a("limits.settings.bulk_visibility"),hint:a("limits.settings.enabled_count",{enabled:d,total:s.length}),control:e.jsx(q,{options:[{value:"enabled",label:a("limits.settings.enable_all")},{value:"disabled",label:a("limits.settings.disable_all")}],value:g?"enabled":o?"disabled":null,onChange:u=>r(u==="enabled")})}),e.jsx(sa,{sensors:y,collisionDetection:na,modifiers:[ca],onDragEnd:p,children:e.jsx(ia,{items:s,strategy:ra,children:e.jsx("div",{className:"flex flex-col",children:s.map(u=>e.jsx(Ba,{id:u,visible:n[u]!==!1,onToggle:()=>i(u)},u))})})})]})}function Ka(t){if(!t||typeof t!="object")return"";const s=t.user_metadata&&typeof t.user_metadata=="object"?t.user_metadata:{},n=t.profile&&typeof t.profile=="object"?t.profile:{},i=s.full_name||s.name||n.name||s.user_name||s.preferred_username;return typeof i=="string"&&i.trim()?i.trim():typeof t.email=="string"&&t.email.includes("@")?t.email.split("@")[0].trim()||t.email.trim():typeof t.email=="string"?t.email.trim():""}function qa(t){return!t||typeof t!="object"?"":typeof t.email=="string"?t.email.trim():""}function Wa(t){const s=typeof t=="string"?t.trim():"";if(!s)return null;const n=s.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),i=s.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),r=n?.[1]||i?.[1];return r?`https://github.com/${r}`:null}function je(t,s){console.warn(`[tokentracker] settings ${t}:`,s)}function Ya(t,s,n,i){const[r,c]=l.useState(()=>X()),g=s&&n&&ze(),o=l.useMemo(()=>({active:!0,busy:!1}),[t,s,n,i]),d=l.useRef(o);d.current=o;const[y,p]=l.useState(null),u=y?.scope===o?y:null;l.useEffect(()=>{o.active=!0;const j=()=>{const m=X();c(m),m||p(k=>k?.scope===o?{...k,error:null}:k)},h=()=>{p(m=>m?.scope===o?{...m,error:null}:m),de(i,"cloud-sync")};return j(),window.addEventListener("tt.cloudSyncChanged",j),window.addEventListener("storage",j),window.addEventListener(we,h),()=>{o.active=!1,window.removeEventListener("tt.cloudSyncChanged",j),window.removeEventListener("storage",j),window.removeEventListener(we,h)}},[o,i]);const x=l.useCallback(async()=>{if(!g||!X()||o.busy||!o.active||d.current!==o)return;o.busy=!0,p({scope:o,pending:!0,error:null});const j=()=>o.active&&d.current===o&&X();try{await xt(()=>t())}catch(h){if(!j())return;["cloud_membership_required","cloud_read_only_expired","cloud_history_window_exceeded","cloud_machine_limit","machine_limit_exceeded","cloud_machine_paused"].includes(h?.code)?bt(i,h.code,h.membership,"cloud-sync"):p({scope:o,pending:!0,error:{code:"billing_network_error"}}),je("cloud sync",h)}finally{o.busy=!1,o.active&&d.current===o&&p(h=>h?.scope===o?{...h,pending:!1}:h)}},[g,o,t,i]),v=l.useCallback(async()=>{if(!g||o.busy||!o.active||d.current!==o)return;const j=!X();p({scope:o,pending:!1,error:null}),Ne(j),c(j),j?await x():de(i,"cloud-sync")},[g,o,x,i]),N=l.useCallback(()=>{!g||!o.active||d.current!==o||(Ne(!1),c(!1),p(j=>j?.scope===o?{...j,error:null}:j),de(i,"cloud-sync"))},[g,o,i]);return{cloudSyncOn:r,cloudSyncPending:!!u?.pending,cloudSyncError:u?.error,handleCloudSyncToggle:v,handleCloudSyncRetry:x,handleCloudSyncDisable:N,showLocalCloudSync:g}}function Za(t){const[s,n]=l.useState(!1),[i,r]=l.useState(!1),[c,g]=l.useState(!1),[o,d]=l.useState(!1),[y,p]=l.useState(null),[u,x]=l.useState(!1),[v,N]=l.useState(""),[j,h]=l.useState(!1),[m,k]=l.useState(""),[C,f]=l.useState(""),[S,_]=l.useState(!1),[w,A]=l.useState(null),T=l.useMemo(()=>Ka(t),[t]),b=l.useMemo(()=>qa(t),[t]),P=l.useMemo(()=>typeof t?.id=="string"?t.id.trim():"",[t]),U=l.useMemo(()=>({setAnonymousOn:r,setCustomDisplayName:p,setGithubUrl:k,setProfileLoading:g,setPublicProfileOn:n,setShowGithubOn:h}),[]);return{anonymousOn:i,customDisplayName:y,displayName:T,editingGithub:S,editingName:u,email:b,githubError:w,githubInput:C,githubUrl:m,loadSetters:U,nameInput:v,profileLoading:c,profileSaving:o,publicProfileOn:s,setAnonymousOn:r,setCustomDisplayName:p,setEditingGithub:_,setEditingName:x,setGithubError:A,setGithubInput:f,setGithubUrl:k,setNameInput:N,setProfileLoading:g,setProfileSaving:d,setPublicProfileOn:n,setShowGithubOn:h,showGithubOn:j,userId:P}}function Ja(t,s,n){l.useEffect(()=>{if(!s)return;let i=!0;return n.setProfileLoading(!0),(async()=>{try{const r=await $e({getAccessToken:t});if(!i||!r)return;const c=await yt({accessToken:r});if(!i)return;n.setPublicProfileOn(!!c?.enabled),n.setAnonymousOn(!!c?.anonymous),c?.display_name&&n.setCustomDisplayName(c.display_name),n.setShowGithubOn(!!c?.show_github_url),n.setGithubUrl(c?.github_url||"")}catch(r){je("load public profile",r)}finally{i&&n.setProfileLoading(!1)}})(),()=>{i=!1}},[t,s,n])}function Qa(t,s,n){return l.useCallback(async(i,{label:r,onError:c,onSuccess:g}={})=>{if(!n||s.profileSaving)return!1;s.setProfileSaving(!0);try{const o=await $e({getAccessToken:t});if(!o)return!1;const d=await vt({accessToken:o,...i});return g?.(d),!0}catch(o){return c?c(o):je(r||"mutate profile",o),!1}finally{s.setProfileSaving(!1)}},[t,s,n])}function Xa(t,s){return{anonymousOn:t.anonymousOn,customDisplayName:t.customDisplayName,displayName:t.displayName,editingName:t.editingName,handleAnonymousToggle:s.handleAnonymousToggle,handleSaveName:s.handleSaveName,nameInput:t.nameInput,profileLoading:t.profileLoading,profileSaving:t.profileSaving,setEditingName:t.setEditingName,setNameInput:t.setNameInput,startEditingName:s.startEditingName}}function es(t,s){return{editingGithub:t.editingGithub,githubError:t.githubError,githubInput:t.githubInput,githubUrl:t.githubUrl,handleSaveGithub:s.handleSaveGithub,handleShowGithubToggle:s.handleShowGithubToggle,profileLoading:t.profileLoading,profileSaving:t.profileSaving,setEditingGithub:t.setEditingGithub,setGithubError:t.setGithubError,setGithubInput:t.setGithubInput,showGithubOn:t.showGithubOn,startEditingGithub:s.startEditingGithub}}function ts(t,s){const n=l.useCallback(async()=>{const r=!t.publicProfileOn;await s({enabled:r},{label:"toggle public profile",onSuccess:()=>t.setPublicProfileOn(r)})},[s,t]);return{handleAnonymousToggle:l.useCallback(async()=>{const r=!t.anonymousOn;await s({anonymous:r},{label:"toggle anonymous",onSuccess:()=>t.setAnonymousOn(r)})},[s,t]),handlePublicProfileToggle:n}}function as(t,s,n){const i=l.useCallback(async()=>{const c=t.nameInput.trim().slice(0,50);c&&await s({display_name:c},{label:"save display name",onSuccess:()=>{t.setCustomDisplayName(c),t.setEditingName(!1),n?.()}})},[s,t,n]),r=l.useCallback(()=>{t.setNameInput(t.customDisplayName||t.displayName),t.setEditingName(!0)},[t]);return{handleSaveName:i,startEditingName:r}}function ss(t,s){const n=l.useCallback(async()=>{if(!t.showGithubOn&&!t.githubUrl){t.setEditingGithub(!0),t.setGithubInput(""),t.setGithubError(null);return}const c=!t.showGithubOn;await s({show_github_url:c},{label:"toggle GitHub profile",onSuccess:()=>t.setShowGithubOn(c)})},[s,t]),i=l.useCallback(async()=>{const c=Wa(t.githubInput);if(t.githubInput.trim()&&!c){t.setGithubError(a("settings.account.githubUrlInvalid"));return}t.setGithubError(null),await s({github_url:c,show_github_url:!!c},{label:"save GitHub profile",onError:g=>t.setGithubError(g?.message||a("settings.account.githubUrlInvalid")),onSuccess:g=>{t.setGithubUrl(g?.github_url||c||""),t.setShowGithubOn(!!c),t.setEditingGithub(!1)}})},[s,t]),r=l.useCallback(()=>{t.setGithubInput(t.githubUrl),t.setGithubError(null),t.setEditingGithub(!0)},[t]);return{handleSaveGithub:i,handleShowGithubToggle:n,startEditingGithub:r}}function ke(){const t=mt();l.useSyncExternalStore(gt,pt,()=>0);const s=ht(t.user?.id),i=!(s.membership?.status==="self_hosted"||s.catalog?.policy?.hosting_mode==="self_hosted")&&(ft()||s.membership?.hosting_mode==="hosted"),r=Za(t.user),c=Ya(t.getAccessToken,t.enabled,t.signedIn,t.user?.id);Ja(t.getAccessToken,t.signedIn&&i,r.loadSetters);const g=Qa(t.getAccessToken,r,i),o=ts(r,g),d=as(r,g,t.refreshDisplayName),y=ss(r,g);return{...t,...c,email:r.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:r.userId,name:Xa(r,{...o,...d}),github:es(r,y),profileLoading:r.profileLoading,profileSaving:r.profileSaving,publicProfileOn:i&&r.publicProfileOn,publicProfileAvailable:i}}function nt({disabled:t,onCancel:s,onSave:n,saveLabel:i=a("settings.account.save")}){return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:n,disabled:t,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:i}),e.jsx("button",{type:"button",onClick:s,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:a("settings.account.cancel")})]})}function ns({nameInput:t,setEditingName:s,setNameInput:n,profileSaving:i,handleSaveName:r}){return e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsx("input",{type:"text",value:t,onChange:c=>n(c.target.value),onKeyDown:c=>{c.key==="Enter"&&r(),c.key==="Escape"&&s(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:a("settings.account.displayName")}),e.jsx(nt,{disabled:i||!t.trim(),onCancel:()=>s(!1),onSave:r,saveLabel:i?a("settings.account.saving"):void 0})]})}function is({githubError:t,githubInput:s,handleSaveGithub:n,profileSaving:i,setEditingGithub:r,setGithubError:c,setGithubInput:g}){return e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:s,onChange:o=>{g(o.target.value),t&&c(null)},onKeyDown:o=>{o.key==="Enter"&&n(),o.key==="Escape"&&(r(!1),c(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:a("settings.account.githubUrlPlaceholder")}),e.jsx(nt,{disabled:i,onCancel:()=>{r(!1),c(null)},onSave:n,saveLabel:i?a("settings.account.saving"):void 0})]}),t?e.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:t}):null]})}function it({disabled:t=!1,label:s,onClick:n,title:i}){return e.jsxs("button",{type:"button",onClick:n,disabled:t,title:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[e.jsx(ma,{className:"h-3.5 w-3.5","aria-hidden":!0}),s]})}function rt({actions:t,editing:s,editor:n,hint:i,label:r}){return e.jsx("div",{className:"py-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:r}),s?n:e.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i})]}),s?null:t]})})}function rs({name:t}){const s=t.anonymousOn?a("settings.account.displayNameDisabledWhileAnon"):void 0;return e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(it,{disabled:t.anonymousOn,label:a("settings.account.edit"),onClick:t.startEditingName,title:s}),e.jsx(D,{checked:!t.anonymousOn,onChange:t.handleAnonymousToggle,disabled:t.profileLoading||t.profileSaving,ariaLabel:a("settings.account.displayName")})]})}function os({name:t}){const{anonymousOn:s,customDisplayName:n,displayName:i,editingName:r,handleAnonymousToggle:c,handleSaveName:g,nameInput:o,profileLoading:d,profileSaving:y,setEditingName:p,setNameInput:u,startEditingName:x}=t,v=s?a("settings.account.displayNameAnonymousHint"):n||i;return e.jsx(rt,{label:a("settings.account.displayName"),editing:r,hint:v,editor:e.jsx(ns,{nameInput:o,setEditingName:p,setNameInput:u,profileSaving:y,handleSaveName:g}),actions:e.jsx(rs,{name:t})})}function ls({github:t}){const{editingGithub:s,githubError:n,githubInput:i,githubUrl:r,handleSaveGithub:c,handleShowGithubToggle:g,profileLoading:o,profileSaving:d,setEditingGithub:y,setGithubError:p,setGithubInput:u,showGithubOn:x,startEditingGithub:v}=t;return e.jsx(e.Fragment,{children:e.jsx(rt,{label:a("settings.account.githubUrl"),editing:s,hint:r||a("settings.account.githubUrlHint"),editor:e.jsx(is,{githubError:n,githubInput:i,handleSaveGithub:c,profileSaving:d,setEditingGithub:y,setGithubError:p,setGithubInput:u}),actions:e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(it,{label:a("settings.account.edit"),onClick:v}),e.jsx(D,{checked:x,onChange:g,disabled:o||d,ariaLabel:a("settings.account.githubUrl")})]})})})}function cs(){const{openLoginModal:t}=Fe();return e.jsx(V,{title:a("settings.section.account"),children:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.account.signedOutHint")}),e.jsx("button",{type:"button",onClick:t,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:a("settings.account.signIn")})]})})}function ds({name:t,github:s}){return e.jsxs(e.Fragment,{children:[e.jsx(os,{name:t}),e.jsx(ls,{github:s})]})}function us({settings:t}={}){return t?e.jsx(ot,{settings:t}):e.jsx(ms,{})}function ms(){const t=ke();return e.jsx(ot,{settings:t})}function ot({settings:t}){return t.enabled?t.signedIn?e.jsxs(V,{title:a("settings.section.account"),subtitle:t.email||t.name.customDisplayName||t.name.displayName,action:e.jsx(ps,{onSignOut:t.signOut}),children:[e.jsx(gs,{userId:t.userId}),e.jsx(hs,{checked:t.publicProfileOn,disabled:t.profileLoading||t.profileSaving||t.publicProfileAvailable===!1,onChange:t.handlePublicProfileToggle,unavailable:t.publicProfileAvailable===!1}),e.jsx(fs,{visible:t.publicProfileOn,name:t.name,github:t.github})]}):e.jsx(cs,{}):null}function gs({userId:t}){const[s,n]=fe.useState(!1);if(!t)return null;const i=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(t),n(!0),globalThis.setTimeout(()=>n(!1),1200)}catch{n(!1)}};return e.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:a("settings.account.userId")}),e.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t})]}),e.jsxs("button",{type:"button",onClick:i,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":a("settings.account.copyUserId"),children:[s?e.jsx(fa,{className:"h-3.5 w-3.5","aria-hidden":!0}):e.jsx(xa,{className:"h-3.5 w-3.5","aria-hidden":!0}),s?a("settings.account.copied"):a("settings.account.copy")]})]})}function ps({onSignOut:t}){return e.jsxs("button",{type:"button",onClick:()=>t(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[e.jsx(Ma,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.account.signOut")]})}function hs({checked:t,disabled:s,onChange:n,unavailable:i}){return e.jsx(E,{label:a("settings.account.publicProfile"),hint:a(i?"cloud.self_host.public_profile_disabled":"settings.account.publicProfileHint"),control:e.jsx(D,{checked:t,onChange:n,disabled:s,ariaLabel:a("settings.account.publicProfile")})})}function fs({visible:t,name:s,github:n}){return e.jsx(Ye,{initial:!1,children:t?e.jsx(qe.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:e.jsx(ds,{name:s,github:n})},"public-profile-fields"):null})}function ae(t){return t.replace(/[\t\n\r\f\v -]/g,"").toUpperCase()}function xs({account:t,auth:s,refresh:n,compact:i=!1,panelContainer:r=null,layout:c="default",dialogOpen:g,onDialogOpenChange:o}){const d=c==="settings-row",[y,p]=l.useState(!1),u=d&&typeof g=="boolean"?g:y,[x,v]=l.useState(""),[N,j]=l.useState(!1),[h,m]=l.useState(null),[k,C]=l.useState(null),[f,S]=l.useState(!1),_=l.useId(),w=l.useRef(null),A=l.useRef(null),T=l.useRef(!1),b=l.useRef(!1),P=l.useRef(0),U=`${jt()}.${t?.environment||"unknown"}.${s?.signedIn?s.user?.id:""}`,F=l.useRef(U);F.current=U,l.useEffect(()=>(b.current=!0,P.current+=1,A.current=null,T.current=!1,p(!1),v(""),j(!1),m(null),C(null),S(!1),()=>{b.current=!1,P.current+=1}),[U]);const K=t?.membership?.status==="self_hosted"||t?.membership?.hosting_mode==="self_hosted",$=t?.gift_redemption_available===!0,Z=d?t?.gifts||[]:[];if(!s?.signedIn||K||!$&&!Z.length)return null;const J=t.redemption_restriction,re=O=>{!O&&T.current||(typeof g!="boolean"&&p(O),o?.(O))},L=async(O,oe)=>{const le=await n();oe()&&S(!!le?.gifts?.some(H=>H.id===O?.id))},ee=async O=>{if(T.current||O&&(!$||!x.trim()))return;if(O&&J){m(new ue(J));return}T.current=!0;const oe=++P.current,le=U,H=()=>b.current&&P.current===oe&&F.current===le;j(!0),m(null);try{if(O){const te=x.trim();(!A.current||ae(A.current.code)!==ae(te))&&(A.current={code:te,request_id:crypto.randomUUID()});const ce=await Y("redeem-gift",{auth:async()=>{const ut=await Nt(s.getAccessToken);if(!H())throw new ue("authentication_required",401);return ut},body:A.current});if(!H())return;if(!ce?.gift?.id)throw new ue("billing_operation_failed");C(ce),S(!1),v(""),A.current=null,await L(ce.gift,H)}else await L(k?.gift,H)}catch(te){H()&&m(te)}finally{H()&&(T.current=!1,j(!1))}};let Q=null;return(d||u)&&(Q=e.jsxs("div",{id:`${_}-panel`,className:d?"space-y-3":i?"w-full space-y-3 rounded-lg bg-oai-gray-50 p-4 dark:bg-oai-gray-950/50":"mt-3 space-y-3",children:[$?e.jsxs(e.Fragment,{children:[e.jsx("p",{id:`${_}-detail`,className:d?"sr-only":"text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.gift.detail")}),k?e.jsxs("div",{role:"status",className:"space-y-2 text-sm leading-6",children:[e.jsx("p",{children:a(f?k.already_redeemed?"cloud.gift.already_redeemed":"cloud.gift.redeemed":"cloud.gift.refresh_needed")}),k.gift?e.jsx("p",{className:"text-xs text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.gift.term",{days:k.gift.duration_days,start:G(k.gift.starts_at),end:G(k.gift.ends_at)})}):null,f?e.jsx(R,{type:"button",variant:"ghost",onClick:()=>{C(null),S(!1)},children:a("cloud.gift.redeem_another")}):e.jsx(R,{type:"button",variant:"secondary",disabled:N,onClick:()=>{ee(!1)},children:a("cloud.action.refresh_membership")})]}):e.jsxs("form",{onSubmit:O=>{O.preventDefault(),ee(!0)},"aria-busy":N,children:[e.jsx("label",{htmlFor:_,className:d?"sr-only":"text-sm font-medium",children:a("cloud.gift.code_label")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:_,ref:w,value:x,disabled:N,maxLength:128,autoComplete:"off",spellCheck:!1,autoCapitalize:"characters","data-ph-no-capture":"true","aria-describedby":`${_}-detail${h?` ${_}-error`:""}`,"aria-invalid":!!h,onChange:O=>{ae(O.target.value)!==ae(x)&&(A.current=null),v(O.target.value),m(null)},className:"min-h-10 min-w-0 flex-1 rounded-md border border-oai-gray-300 bg-transparent px-3 font-mono text-sm outline-none focus:border-oai-brand focus:ring-2 focus:ring-inset focus:ring-oai-brand/30 dark:border-oai-gray-700"}),e.jsx(R,{type:"submit",variant:"secondary",disabled:N||!x.trim(),children:a(N?"cloud.gift.redeeming":"cloud.gift.confirm")})]})]}),h?e.jsx("div",{id:`${_}-error`,children:["gift_checkout_pending","gift_requires_renewal_cancel"].includes(h.code)?e.jsx("p",{role:"alert",className:"text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:kt(h,"gift")}):e.jsx(z,{error:h,context:"gift"})}):null]}):null,Z.length?e.jsx("ul",{"aria-label":a("cloud.gift.history_title"),className:"divide-y divide-oai-gray-200 dark:divide-oai-gray-800",children:Z.map(O=>e.jsxs("li",{className:"py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[e.jsx("span",{children:a("cloud.gift.duration",{days:O.duration_days})}),e.jsx("span",{children:a(["active","pending","expired","revoked"].includes(O.state)?`cloud.gift.state_${O.state}`:"cloud.status.unknown")})]}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.history.term",{start:G(O.starts_at),end:G(O.ends_at)})})]},O.id))}):null]})),d?e.jsx(We,{open:u,onOpenChange:re,title:a($?"cloud.gift.redeem_action":"cloud.gift.history_title"),icon:Re,preventClose:N,initialFocus:$&&!k?w:void 0,children:Q}):e.jsxs("div",{className:d?void 0:i?"contents":"mt-4",children:[e.jsxs(R,{type:"button",variant:"ghost",size:i||d?"sm":"md",className:d?"!h-11 !w-full !justify-start !px-0 !text-oai-black dark:!text-oai-white hover:!bg-oai-gray-100 dark:hover:!bg-oai-gray-800 active:!scale-100":i?"!h-10 !px-0":void 0,"aria-expanded":u,"aria-controls":d||u?`${_}-panel`:void 0,onClick:()=>p(O=>!O),disabled:N,children:[i||d?e.jsx(Re,{size:16,className:`${d?"mr-3":"mr-2"} shrink-0`,"aria-hidden":!0}):null,a($?"cloud.gift.redeem_action":"cloud.gift.history_title"),d?e.jsx(ja,{size:16,className:`ml-auto shrink-0 transition-transform motion-reduce:transition-none ${u?"rotate-180":""}`,"aria-hidden":!0}):null]}),!d&&r&&Q?wt.createPortal(Q,r):Q]})}function bs({text:t,label:s}){const[n,i]=l.useState(!1);return e.jsxs(Na,{open:n,onOpenChange:i,children:[e.jsx(_a,{delay:0,closeOnClick:!1,"aria-label":s,onClick:()=>i(!0),className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-gray-500/40 dark:hover:bg-oai-gray-800 dark:hover:text-oai-gray-200",children:e.jsx(Ze,{size:14,"aria-hidden":!0})}),e.jsx(Sa,{children:e.jsx(Ca,{side:"bottom",sideOffset:6,className:"z-[110]",children:e.jsx(Ea,{role:"tooltip",className:"max-w-[min(320px,calc(100vw-2rem))] rounded-lg border border-oai-gray-200 bg-white px-3 py-2 text-xs leading-5 text-oai-gray-600 shadow-lg dark:border-oai-gray-700 dark:bg-oai-gray-900 dark:text-oai-gray-300",children:t})})})]})}function ys(t){return typeof t!="string"||!t.trim()?a("cloud.devices.platform_unknown"):/^(mac|darwin)/i.test(t)?a("leaderboard.community.modal.platform.darwin"):/^win/i.test(t)?a("leaderboard.community.modal.platform.win32"):/^linux/i.test(t)?a("leaderboard.community.modal.platform.linux"):t}function vs(t,s){if(!t)return null;const n=t.status==="active"&&t.access_source==="gift";if(s&&Number.isFinite(Date.parse(s))){const i=t.status==="transition"?"cloud.membership.transition_until":t.status==="trial"?"cloud.membership.trial_until":t.status==="active"?n?"cloud.membership.gift_until":"cloud.membership.active_until":t.status==="expired"&&Date.parse(s)<=Date.now()?"cloud.membership.expired_on":null;if(i)return a(i,{date:G(s)})}return n?a("cloud.gift.membership_label"):Pt(t.status)}function js({auth:t,machineLimit:s,accountRevision:n,selfHosted:i=!1}){const[r,c]=l.useState(null),[g,o]=l.useState(null),[d,y]=l.useState(null),[p,u]=l.useState(!1),[x,v]=l.useState(null),N=l.useRef(!1),j=l.useRef(0),h=l.useRef(!0),m=t?.user?.id,k=t?.getAccessToken,C=l.useCallback(async()=>{const b=++j.current;try{let P;if(ze())try{const F=await Ot(),K=await fetch("/functions/tokentracker-machine-id",{headers:F});K.ok&&(P=(await K.json())?.machineId)}catch{}const U=await Y("devices",{auth:k,params:P?{current_machine_id:P}:{}});b===j.current&&(c(U),o(null))}catch(P){b===j.current&&o({...P,code:"billing_devices_unavailable"})}},[k,m]);l.useEffect(()=>(h.current=!0,C(),()=>{h.current=!1,j.current+=1}),[C,n]);const f=async b=>{if(!N.current){N.current=!0,u(!0),o(null),v(null);try{if(await Y("remove-device",{auth:k,body:{machine_id:b}}),!h.current)return;r?.machines?.find(P=>P.machine_id===b)?.is_current&&Se(),y(null),await C()}catch(P){h.current&&o(P)}finally{N.current=!1,u(!1)}}},S=async b=>{if(!N.current){N.current=!0,u(!0),o(null),v(null);try{if(await Y("resume-device",{auth:k,body:{machine_id:b.machine_id}}),!h.current)return;b.is_current&&Se(),v(a("cloud.devices.resumed")),await C()}catch(P){h.current&&o(P)}finally{N.current=!1,u(!1)}}},_=r?.machines||[],w=r?.machine_count??_.filter(b=>b.status!=="paused").length,A=r?.machine_limit??s,T=A==null||w<A;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:a("cloud.devices.title")}),e.jsx(bs,{label:a("cloud.devices.detail"),text:a("cloud.devices.detail")})]}),e.jsx("span",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 tabular-nums",children:r?A==null?a(i?"cloud.devices.unlimited_self_hosted":"cloud.devices.unlimited",{count:w}):a("cloud.devices.count",{count:w,limit:A}):g?a("cloud.devices.count_unknown"):a("cloud.catalog.loading")})]}),r?.over_machine_limit||A!=null&&A<w?e.jsx("div",{className:"mb-4",children:e.jsx(z,{children:a("cloud.devices.over_limit")})}):null,g?e.jsx(z,{error:g,onRetry:C,context:"account"}):null,x?e.jsx("div",{className:"mb-3",children:e.jsx(z,{children:x})}):null,!g&&r&&_.length===0?e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.devices.empty")}):null,_.length!==0?e.jsx("ul",{className:"divide-y divide-oai-gray-200 dark:divide-oai-gray-800",children:_.map(b=>e.jsxs("li",{className:"py-1.5",children:[e.jsxs("div",{className:"grid grid-cols-[17px_minmax(0,1fr)_auto] items-center gap-x-3 gap-y-1",children:[e.jsx(ye,{size:17,className:"col-start-1 row-start-1 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0}),e.jsx("p",{title:b.name||a("cloud.devices.unnamed"),className:"col-start-2 row-start-1 min-w-0 truncate text-sm font-medium",children:b.name||a("cloud.devices.unnamed")}),e.jsxs("div",{className:"col-span-2 col-start-2 row-start-2 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-oai-gray-500 dark:text-oai-gray-400 sm:col-span-1 sm:col-start-2",children:[e.jsx("span",{children:ys(b.platform)}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:b.last_seen_at?a("cloud.devices.last_seen",{date:At(b.last_seen_at)}):a("cloud.devices.last_seen_unknown")}),b.is_current?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:a("cloud.devices.current")})]}):null,b.status==="paused"?e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:a("cloud.devices.paused")})]}):null]}),b.status==="paused"&&!T?e.jsx("p",{className:"col-start-2 row-start-3 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.devices.no_slot")}):null,e.jsxs(R,{variant:"ghost",size:"sm",className:"col-start-3 row-start-1 !min-h-10 !px-2 sm:row-span-2","aria-expanded":b.status!=="paused"?d===b.machine_id:void 0,"aria-controls":d===b.machine_id?`cloud-machine-confirm-${b.machine_id}`:void 0,onClick:()=>b.status==="paused"?S(b):y(P=>P===b.machine_id?null:b.machine_id),disabled:p||b.status==="paused"&&!T,children:[b.status==="paused"?e.jsx(ka,{size:14,className:"mr-1.5 shrink-0","aria-hidden":!0}):e.jsx(wa,{size:14,className:"mr-1.5 shrink-0","aria-hidden":!0}),b.status==="paused"?a("cloud.devices.resume"):a("cloud.devices.remove")]})]}),d===b.machine_id?e.jsxs("div",{id:`cloud-machine-confirm-${b.machine_id}`,className:"mt-3 rounded-lg bg-oai-gray-50 p-3 dark:bg-oai-gray-800",children:[e.jsx("p",{className:"text-xs leading-5",children:a("cloud.devices.remove_detail")}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(R,{variant:"secondary",onClick:()=>f(b.machine_id),disabled:p,children:a("cloud.devices.confirm_remove")}),e.jsx(R,{variant:"ghost",onClick:()=>y(null),disabled:p,children:a("cloud.action.keep")})]})]}):null]},b.machine_id))}):null]})}function ks({recent:t,pendingOrders:s,conflictOrders:n,userId:i,payments:r=[],footerActions:c}){const g=He(),[o,d]=l.useState(t?.order_id&&ge.test(t.order_id)?t.order_id:""),[y,p]=l.useState(!1),[u,x]=l.useState(!1),v=l.useId(),N=l.useRef(null);l.useEffect(()=>{u&&N.current?.focus()},[u]);const j=new Set([...r.map(m=>m.order_id).filter(m=>typeof m=="string"),...(s||[]).filter(m=>m.status==="paid"||["paid","partially_refunded","refunded"].includes(m.payment_state)).map(m=>m.id)].map(m=>m.toLowerCase())),h=[...n||[],...(s||[]).filter(m=>m.retry_payment_conflict_at||!j.has(m.id.toLowerCase()))].filter((m,k,C)=>C.findIndex(f=>f.id===m.id)===k);return e.jsxs("div",{className:"mt-2 space-y-3",children:[t?.request_id&&!t.order_id?e.jsx(ne,{to:`/billing/checkout?sku=${encodeURIComponent(t.sku)}`,className:"mt-3 inline-flex min-h-10 items-center text-sm text-oai-brand underline underline-offset-4",children:a("cloud.action.resume_purchase")}):null,h.length||r.length?e.jsxs("div",{className:"sm:grid sm:grid-cols-[minmax(0,1fr)_auto_minmax(7rem,auto)] sm:gap-x-4",children:[e.jsxs("div",{"aria-hidden":!0,className:"hidden gap-x-4 pb-1 text-xs text-oai-gray-500 dark:text-oai-gray-400 sm:col-span-3 sm:grid sm:grid-cols-subgrid",children:[e.jsx("span",{children:a("cloud.history.date")}),e.jsx("span",{className:"text-right",children:a("cloud.history.amount")}),e.jsx("span",{className:"text-right",children:a("cloud.history.status")})]}),e.jsxs("ul",{className:"divide-y divide-oai-gray-200 dark:divide-oai-gray-800 sm:col-span-3 sm:grid sm:grid-cols-subgrid",children:[h.map(m=>{const k=typeof m.created_at=="string"&&Number.isFinite(Date.parse(m.created_at))?G(m.created_at):null;let C=null;Number.isInteger(m.amount_cents)&&m.amount_cents>=0&&["USD","CNY"].includes(m.currency)&&(C=xe(m.amount_cents,m.currency));const f=a(m.retry_payment_conflict_at?"cloud.action.review_duplicate_payment":"cloud.history.pending");return e.jsxs("li",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1 py-3 sm:col-span-3 sm:grid-cols-subgrid",children:[e.jsx("p",{className:"col-start-1 row-start-1 text-sm tabular-nums",children:k||f}),e.jsx("p",{className:"col-start-2 row-start-1 text-right text-sm font-medium tabular-nums",children:C}),m.provider||k?e.jsxs("div",{className:"col-start-1 row-start-2 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[m.provider?e.jsx("span",{children:Be(m.provider)}):null,k?e.jsxs(e.Fragment,{children:[m.provider?e.jsx("span",{"aria-hidden":!0,children:"·"}):null,e.jsx("span",{children:f})]}):null]}):null,e.jsx(ne,{to:`/billing/checkout?order=${encodeURIComponent(m.id)}`,onClick:S=>{m.retry_payment_conflict_at||S.button!==0||S.metaKey||S.ctrlKey||S.shiftKey||S.altKey||!ge.test(m.id)||(S.preventDefault(),g(_e({orderId:m.id,userId:i})))},className:"col-start-2 row-start-2 inline-flex min-h-10 items-center justify-end rounded-sm text-right text-sm underline-offset-4 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 sm:col-start-3 sm:row-span-2 sm:row-start-1 sm:self-start sm:items-start",children:e.jsx("span",{children:m.retry_payment_conflict_at?a("cloud.action.review_duplicate_payment"):a("cloud.action.resume_order")})})]},m.id)}),e.jsx(ws,{payments:r})]})]}):e.jsx(e.Fragment,{children:(!t?.request_id||t.order_id)&&e.jsx("p",{className:"py-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.history.empty")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[e.jsx(R,{variant:"ghost",size:"sm",className:"!h-10 !px-0","aria-expanded":u,"aria-controls":`${v}-panel`,onClick:()=>x(m=>!m),children:a("cloud.restore.title")}),c]}),u?e.jsxs("div",{id:`${v}-panel`,className:"mt-2",children:[e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.restore.detail")}),e.jsxs("form",{className:"mt-4",onSubmit:m=>{if(m.preventDefault(),!ge.test(o.trim())){p(!0);return}const k=o.trim(),C=h.some(f=>f.id.toLowerCase()===k.toLowerCase()&&f.retry_payment_conflict_at);g(C?`/billing/checkout?order=${encodeURIComponent(k)}`:_e({orderId:k,userId:i}))},children:[e.jsx("label",{htmlFor:`${v}-input`,className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.checkout.order_id")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:`${v}-input`,ref:N,value:o,onChange:m=>{d(m.target.value),p(!1)},placeholder:a("cloud.restore.placeholder"),className:"min-h-10 min-w-0 flex-1 rounded-md border border-oai-gray-300 bg-transparent px-3 text-sm outline-none focus:border-oai-brand focus:ring-2 focus:ring-inset focus:ring-oai-brand/30 dark:border-oai-gray-700","aria-invalid":y,"aria-describedby":y?`${v}-error`:void 0}),e.jsx(R,{type:"submit",variant:"secondary",children:a("cloud.action.restore")})]}),y?e.jsx("p",{id:`${v}-error`,role:"alert",className:"mt-2 text-xs text-red-600 dark:text-red-400",children:a("cloud.restore.invalid")}):null]})]}):null]})]})}function ws({payments:t}){return e.jsx(e.Fragment,{children:t.map(s=>e.jsxs("li",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1 py-3 sm:col-span-3 sm:grid-cols-subgrid",children:[e.jsx("p",{className:"col-start-1 row-start-1 text-sm tabular-nums",children:G(s.paid_at)}),e.jsx("p",{className:"col-start-2 row-start-1 text-right text-sm font-medium tabular-nums",children:xe(s.amount_cents,s.currency)}),e.jsxs("div",{className:"col-start-1 row-start-2 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx("span",{children:Be(s.provider)}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:a("cloud.history.term",{start:G(s.starts_at),end:G(s.ends_at)})})]}),e.jsx("p",{className:`col-start-2 row-start-2 text-right text-sm font-medium sm:col-start-3 sm:row-span-1 sm:row-start-1 sm:self-start ${s.refunded_cents>0?"text-amber-700 dark:text-amber-400":"text-oai-gray-600 dark:text-oai-gray-300"}`,children:s.refunded_cents>0?a("cloud.history.refunded",{amount:xe(s.refunded_cents,s.currency)}):a("cloud.history.paid")})]},s.id))})}function Ns({showTitle:t=!0,heading:s,syncControl:n,active:i=!0}){const r=_t();return e.jsx(_s,{showTitle:t,heading:s,syncControl:n,active:i,...r},r.auth?.signedIn?r.auth.user?.id:"signed-out")}function _s({account:t,auth:s,loading:n,error:i,refresh:r,showTitle:c,heading:g,syncControl:o,active:d=!0}){const{openLoginModal:y}=Fe(),[p,u]=l.useState(null),[x,v]=l.useState(null),[N,j]=l.useState(!1),[h,m]=l.useState(null),k=l.useRef(!1),C=l.useRef(!0);l.useEffect(()=>{d||u(null)},[d]),l.useEffect(()=>(C.current=!0,()=>{C.current=!1}),[]);const f=t?.membership,S=f?.status==="self_hosted"||f?.hosting_mode==="self_hosted",_=[...t?.conflict_orders||[],...t?.pending_orders||[]].some(L=>L.retry_payment_conflict_at),w=!S&&t?.subscriptions?.find(L=>["active","trialing","past_due","paused","canceling"].includes(L.status)),A=!S&&(w?w.provider==="waffo":t?.payments?.some(L=>L.provider==="waffo")),T=w&&!w.cancel_at_period_end&&w.status!=="canceling",b=T&&w.status!=="paused",P=w?.next_billed_at,U=P&&Number.isFinite(Date.parse(P));l.useEffect(()=>{h&&t&&!T&&(m(null),v(null))},[t,h,T]);const F=S?null:f?.status==="trial"?f.trial_ends_at:f?.status==="transition"?f.transition_ends_at:f?.expires_at,K=async L=>{if(!k.current){k.current=!0,j(!0),v(null);try{await L()}catch(ee){C.current&&v(ee)}finally{k.current=!1,j(!1)}}},$=()=>K(async()=>{const L=await Y("portal",{auth:s.getAccessToken,body:w?{subscription_id:w.provider_subscription_id}:{}});C.current&&await va(L.url||L.portal_url)}),Z=()=>K(async()=>{await Y("cancel",{auth:s.getAccessToken,body:{subscription_id:h}}),C.current&&(m(null),await r())}),J=vs(f,F),re=A&&!w||f?.can_read_cloud||!S&&t?.gift_redemption_available===!0;return s?.signedIn?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("section",{"aria-label":a("cloud.membership.title"),className:"tt-cloud-theme space-y-3",children:[t?.environment==="sandbox"?e.jsx(z,{children:a("cloud.catalog.sandbox")}):null,_?e.jsx(St,{showBillingLink:!1}):null,e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-2",children:[g?e.jsx("h2",{className:"shrink-0 !text-2xl font-semibold",children:g}):null,!g&&c?e.jsxs("h2",{className:"inline-flex items-center gap-2 text-base font-semibold",children:[e.jsx(se,{size:18,className:"text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0}),a("cloud.membership.title")]}):null,J?e.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:J}):null]}),e.jsx(R,{onClick:r,variant:"ghost",size:"sm",className:"!size-10 shrink-0 !p-0",disabled:n,"aria-label":a("cloud.action.refresh_membership"),children:e.jsx(be,{size:15,className:n?"motion-safe:animate-spin":void 0,"aria-hidden":!0})})]}),f?.status==="expired"?e.jsx("p",{className:"mt-3 max-w-2xl text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:f.can_read_cloud?a("cloud.membership.read_only",{date:G(f.read_only_until)}):a("cloud.membership.expired_detail")}):null,f?e.jsx(Ct,{userId:s.user?.id,membership:f,subscriptions:t?.subscriptions,className:"mt-3"}):null,!f&&n?e.jsx("p",{role:"status",className:"mt-3 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.catalog.loading")}):null,w?e.jsx("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:w?e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1",children:[e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:w.status==="paused"?a("cloud.membership.renewal_paused"):w.status==="past_due"?a("cloud.membership.payment_due"):b?U?a("cloud.membership.renews",{date:G(P)}):a("cloud.membership.renewal_unknown"):a("cloud.membership.renewal_off")}),T?e.jsx(R,{"aria-expanded":!!h,"aria-controls":h?"cloud-cancel-confirm":void 0,onClick:()=>m(L=>L===w.provider_subscription_id?null:w.provider_subscription_id),variant:"ghost",size:"sm",className:"!h-10 !px-2",disabled:N,children:a("cloud.action.cancel_renewal")}):null]}):null}):null,h?e.jsxs("div",{id:"cloud-cancel-confirm",className:"mt-4 rounded-lg border border-oai-gray-200 p-4 dark:border-oai-gray-800",children:[e.jsx("p",{className:"text-sm leading-6",children:F?a("cloud.cancel.detail",{date:G(F)}):a("cloud.cancel.no_term")}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(R,{onClick:Z,variant:"secondary",disabled:N,children:a("cloud.cancel.confirm")}),e.jsx(R,{onClick:()=>m(null),variant:"ghost",disabled:N,children:a("cloud.action.keep")})]})]}):null,i?e.jsx("div",{className:"mt-4",children:e.jsx(z,{error:i,onRetry:r,context:"account"})}):null,x&&p!=="billing"?e.jsx("div",{className:"mt-4",children:e.jsx(z,{error:x,context:"account"})}):null]})]}),f?e.jsx(pe,{className:"tt-cloud-theme !rounded-lg",bodyClassName:"!py-3",children:e.jsx(js,{auth:s,machineLimit:f.machine_limit,accountRevision:t,selfHosted:S})}):null,re||t&&!S||o?e.jsx(pe,{className:"tt-cloud-theme !rounded-lg",bodyClassName:"!py-2",children:e.jsxs("section",{"aria-label":a("cloud.membership.tools_title"),className:"divide-y divide-oai-gray-200 dark:divide-oai-gray-800",children:[S?null:w?e.jsxs("button",{type:"button",onClick:$,disabled:N,className:"inline-flex h-11 w-full items-center gap-3 rounded-md border-0 bg-transparent p-0 text-left text-sm font-medium text-oai-black transition-colors hover:bg-oai-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-oai-gray-500 disabled:opacity-50 dark:text-oai-white dark:hover:bg-oai-gray-800",children:[e.jsx(se,{size:16,className:"shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1",children:a("cloud.action.manage_subscription")}),e.jsx(De,{size:16,className:"shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]}):e.jsxs(ne,{to:"/cloud",className:"inline-flex h-11 w-full items-center gap-3 rounded-md border-0 bg-transparent p-0 text-left text-sm font-medium text-oai-black transition-colors hover:bg-oai-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-oai-gray-500 dark:text-oai-white dark:hover:bg-oai-gray-800",children:[e.jsx(se,{size:16,className:"shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1",children:a("cloud.action.subscribe")}),e.jsx(Et,{size:16,className:"shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]}),t&&!S?e.jsxs(We,{open:p==="billing",onOpenChange:L=>u(L?"billing":null),title:a("cloud.billing.title"),icon:Ra,wide:!0,children:[x?e.jsx("div",{className:"mb-3",children:e.jsx(z,{error:x,context:"account"})}):null,e.jsx(ks,{userId:s.user?.id,recent:ya(s.user?.id),pendingOrders:t?.pending_orders,conflictOrders:t?.conflict_orders,payments:t.payments,footerActions:A&&!w?e.jsx("div",{className:"flex items-center gap-0.5",children:e.jsxs(R,{onClick:$,variant:"ghost",size:"sm",className:"!h-10 !px-0",disabled:N,children:[a("cloud.action.view_bills"),e.jsx(De,{size:14,className:"ml-2","aria-hidden":!0})]})}):null})]}):null,f?.can_read_cloud?e.jsx(ga,{auth:s,layout:"settings-row",dialogOpen:p==="export",onDialogOpenChange:L=>u(L?"export":null)}):null,e.jsx(xs,{account:t,auth:s,refresh:r,layout:"settings-row",dialogOpen:p==="redeem",onDialogOpenChange:L=>u(L?"redeem":null)}),o?e.jsx("section",{children:o}):null]})}):null]}):e.jsxs("div",{className:"space-y-4",children:[g?e.jsx("h2",{className:"shrink-0 !text-2xl font-semibold",children:g}):null,e.jsxs(pe,{className:"tt-cloud-theme",children:[!g&&c?e.jsx("h2",{className:"text-base font-semibold",children:a("cloud.membership.title")}):null,e.jsx("p",{className:`${!g&&c?"mt-2 ":""}text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400`,children:a("cloud.membership.signed_out")}),e.jsx("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:e.jsx(R,{onClick:()=>y({subtitle:a("cloud.membership.signed_out")}),children:a("cloud.action.sign_in_continue")})})]})]})}function Ss({settings:t,active:s=!0}={}){return t?e.jsx(lt,{settings:t,active:s}):e.jsx(Cs,{active:s})}function Cs({active:t}){const s=ke();return e.jsx(lt,{settings:s,active:t})}function lt({settings:t,active:s}){return e.jsx(Ns,{showTitle:!1,heading:a("settings.section.cloud"),active:s,syncControl:t.showLocalCloudSync?e.jsx(Es,{settings:t}):null})}function Es({settings:t}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex min-h-11 items-center justify-between gap-3",children:[e.jsxs("span",{className:"inline-flex min-w-0 items-center gap-3 text-sm font-medium",children:[e.jsx(be,{size:16,className:"shrink-0","aria-hidden":!0}),a("settings.account.cloudSync")]}),e.jsx("span",{className:"tt-cloud-theme tt-cloud-sync-control inline-flex","aria-busy":t.cloudSyncPending||void 0,children:e.jsx(D,{checked:t.cloudSyncOn,disabled:t.cloudSyncPending,onChange:()=>(t.cloudSyncOn?Ce(t.userId):Lt(t.userId,"sync"),t.handleCloudSyncToggle()),ariaLabel:a("settings.account.cloudSync")})})]}),t.cloudSyncOn&&t.cloudSyncPending?e.jsxs("p",{role:"status",className:"flex items-center gap-2 py-3 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx(Pa,{size:14,className:"motion-safe:animate-spin","aria-hidden":!0}),a("settings.account.cloudSyncPending")]}):null,t.cloudSyncOn&&t.cloudSyncError&&!t.cloudSyncPending?e.jsx("div",{className:"tt-cloud-theme py-3",children:e.jsx(z,{role:"alert",onRetry:t.handleCloudSyncRetry,children:a("settings.account.cloudSyncError")})}):null,e.jsx(Tt,{userId:t.userId,panel:"sync",localHost:!0,className:"py-3",onContinueLocal:()=>{Ce(t.userId),t.cloudSyncOn&&t.handleCloudSyncDisable()}})]})}function Ps(){return[{value:"light",label:a("settings.appearance.theme.light"),Icon:Rt},{value:"dark",label:a("settings.appearance.theme.dark"),Icon:Dt},{value:"system",label:a("settings.appearance.theme.system"),Icon:ye}]}function Os(){return[{value:Mt,label:a("settings.appearance.language.system")},{value:$t,label:a("settings.appearance.language.english")},{value:zt,label:a("settings.appearance.language.chinese")},{value:Ft,label:a("settings.appearance.language.traditional_chinese")},{value:Ht,label:a("settings.appearance.language.japanese")},{value:Bt,label:a("settings.appearance.language.korean")},{value:Vt,label:a("settings.appearance.language.german")}]}function As(t){if(!t)return null;try{const s=new Date(t);return Number.isNaN(s.getTime())?null:s.toLocaleString()}catch{return null}}function Ls(t,s){const n=a(`settings.appearance.currency.rate_source.${t}`),i=As(s),r=i?a("settings.appearance.currency.rate_updated",{when:i}):a("settings.appearance.currency.rate_never");return`${n} · ${r}`}function Ts({locale:t,setLocale:s}){const n=Os();return e.jsx(ve,{value:t,onValueChange:s,options:n,ariaLabel:a("settings.appearance.language.label"),className:"px-2.5 py-1.5 text-xs font-medium",leadingIcon:e.jsx(Ua,{className:"h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})})}function Is({currency:t,setCurrency:s}){const n=Gt().map(i=>({value:i.code,label:a(i.labelKey)}));return e.jsx(ve,{value:t,onValueChange:s,options:n,ariaLabel:a("settings.appearance.currency.label"),className:"px-3 py-1.5 text-xs font-medium"})}function Rs({currency:t,rate:s,rateSource:n,rateFetchedAt:i}){if(t===Ut)return e.jsx(e.Fragment,{children:a("settings.appearance.currency.hint")});const r=Ls(n,i);return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("span",{children:`1 USD = ${s.toFixed(4)} ${t}`}),e.jsx("span",{role:"img","aria-label":r,title:r,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:e.jsx(Ze,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function Ds(){const{theme:t,setTheme:s}=It(),{locale:n,setLocale:i}=Ve(),{currency:r,rate:c,rateSource:g,rateFetchedAt:o,setCurrency:d}=Oa(),{mode:y,setMode:p,unitSystem:u,setUnitSystem:x,grouping:v,setGrouping:N}=Aa();return e.jsxs(V,{title:a("settings.section.appearance"),children:[e.jsx(E,{label:a("settings.appearance.theme.label"),hint:a("settings.appearance.theme.hint"),control:e.jsx(q,{options:Ps(),value:t,onChange:s})}),e.jsx(E,{label:a("settings.appearance.language.label"),hint:a("settings.appearance.language.hint"),control:e.jsx(Ts,{locale:n,setLocale:i})}),e.jsx(E,{label:a("settings.appearance.currency.label"),hint:e.jsx(Rs,{currency:r,rate:c,rateSource:g,rateFetchedAt:o}),control:e.jsx(Is,{currency:r,setCurrency:d})}),e.jsx(E,{label:a("settings.appearance.token_format.label"),hint:a("settings.appearance.token_format.hint"),control:e.jsx(q,{options:[{value:me.COMPACT,label:a("settings.appearance.token_format.compact")},{value:me.FULL,label:a("settings.appearance.token_format.full")}],value:y,onChange:p})}),e.jsx(E,{label:a("settings.appearance.token_unit.label"),hint:a("settings.appearance.token_unit.hint"),control:e.jsx(q,{disabled:y!==me.COMPACT,options:[{value:Ee.ENGLISH,label:a("settings.appearance.token_unit.english")},{value:Ee.CHINESE,label:a("settings.appearance.token_unit.chinese")}],value:u,onChange:x})}),e.jsx(E,{label:a("settings.appearance.token_grouping.label"),hint:a("settings.appearance.token_grouping.hint"),control:e.jsx(q,{options:[{value:Pe.THOUSAND,label:a("settings.appearance.token_grouping.thousand")},{value:Pe.WAN,label:a("settings.appearance.token_grouping.wan")}],value:v,onChange:N})})]})}function he({labelKey:t}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:a(t)}),e.jsx("span",{className:"px-1.5 py-0.5 text-[8px] font-semibold tracking-wider text-oai-gray-500 bg-oai-gray-100 dark:text-oai-gray-400 dark:bg-oai-gray-800/80 rounded uppercase scale-90 origin-left",children:a("qpd.card.badge")})]})}function Gs(){const{enabled:t,toggle:s}=pa(),{enabled:n,toggle:i}=ha(),{available:r,settings:c,setSetting:g}=ie(),o=r&&!!c?.dynamicIslandSupported,d=!!c?.dynamicIslandEnabled;return e.jsxs(V,{title:a("settings.section.labs"),children:[o&&e.jsxs(e.Fragment,{children:[e.jsx(E,{label:e.jsx(he,{labelKey:"settings.labs.island.label"}),hint:a("settings.labs.island.hint"),control:e.jsx(D,{checked:d,onChange:()=>g("dynamicIslandEnabled",!d),ariaLabel:a("settings.labs.island.aria")})}),d&&e.jsx(E,{label:a("settings.labs.island_hide_menubar.label"),hint:a("settings.labs.island_hide_menubar.hint"),control:e.jsx(D,{checked:!!c?.hideMenuBarIcon,onChange:()=>g("hideMenuBarIcon",!c?.hideMenuBarIcon),ariaLabel:a("settings.labs.island_hide_menubar.aria")})})]}),e.jsx(E,{label:e.jsx(he,{labelKey:"settings.labs.qpd.label"}),hint:a("settings.labs.qpd.hint"),control:e.jsx(D,{checked:t,onChange:s,ariaLabel:a("settings.labs.qpd.aria")})}),e.jsx(E,{label:e.jsx(he,{labelKey:"settings.labs.sessions.label"}),hint:a("settings.labs.sessions.hint"),control:e.jsx(D,{checked:n,onChange:i,ariaLabel:a("settings.labs.sessions.aria")})})]})}function Us(){const{available:t,settings:s,setSetting:n,runAction:i}=ie();if(!t)return null;const r=Ke(),c=!!s?.launchAtLogin,g=s?.toastOnReset!==!1,o=s?.confettiOnReset!==!1,d=s?.launchAtLoginSupported!==!1,y=s?.autoUpdateEnabled!==!1,p=s?.updateStatus||null,u=!!s?.updateBusy,x=!!s?.isSyncing;return e.jsxs(V,{title:a("settings.section.menubar"),children:[r?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{label:a("settings.menubar.appearance"),hint:a("settings.menubar.appearanceHint"),control:e.jsxs(ne,{to:"/widgets",className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 no-underline transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[a("settings.menubar.appearanceLink"),e.jsx(Ta,{className:"h-3.5 w-3.5","aria-hidden":!0})]})}),e.jsx(E,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),control:e.jsx(D,{checked:g,onChange:()=>n("toastOnReset",!g),ariaLabel:a("settings.menubar.toastOnReset")})}),e.jsx(E,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),control:e.jsx(D,{checked:o,onChange:()=>n("confettiOnReset",!o),ariaLabel:a("settings.menubar.confettiOnReset")})})]}),d?e.jsx(E,{label:a("settings.menubar.launchAtLogin"),hint:a("settings.menubar.launchAtLoginHint"),control:e.jsx(D,{checked:c,onChange:()=>n("launchAtLogin",!c),ariaLabel:a("settings.menubar.launchAtLogin")})}):null,e.jsx(E,{label:a("settings.menubar.syncNow"),hint:a("settings.menubar.syncNowHint"),control:e.jsxs("button",{type:"button",onClick:()=>i("syncNow"),disabled:x,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[e.jsx(be,{className:B("h-3.5 w-3.5",x&&"animate-spin"),"aria-hidden":!0}),x?a("settings.menubar.syncing"):a("settings.menubar.syncNow")]})}),e.jsx(E,{label:a("settings.menubar.autoUpdate"),hint:a("settings.menubar.autoUpdateHint"),control:e.jsx(D,{checked:y,onChange:()=>n("autoUpdateEnabled",!y),ariaLabel:a("settings.menubar.autoUpdate")})}),e.jsx(E,{label:a("settings.menubar.updates"),hint:p||void 0,control:e.jsxs("button",{type:"button",onClick:()=>i("checkForUpdates"),disabled:u,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[e.jsx(Ia,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.menubar.checkUpdates")]})})]})}function Ms(t,s){function n(c){return c.replace(/^v/,"").split(".").map(Number)}const i=n(t),r=n(s);for(let c=0;c<Math.max(i.length,r.length);c++){const g=i[c]||0,o=r[c]||0;if(g<o)return!0;if(g>o)return!1}return!1}function $s(){const{available:t,settings:s,runAction:n}=ie(),i=t&&s?.version,r=s?.platform||"macos",[c,g]=fe.useState(!1),[o,d]=fe.useState({open:!1,latestVersion:"",htmlUrl:""}),{resolvedLocale:y}=Ve(),p="1.3.6",u=async()=>{g(!0);try{const h=await fetch("https://api.github.com/repos/xiufengsun/TokenTracker/releases/latest");if(!h.ok)throw new Error("Failed to fetch");const m=await h.json(),k=m.tag_name;Ms(p,k)?d({open:!0,latestVersion:k,htmlUrl:m.html_url}):Oe({title:a("settings.menubar.updates.upToDate")})}catch(h){console.error("Check updates failed:",h),Oe({title:a("settings.menubar.updates.failed")})}finally{g(!1)}},x=a("settings.menubar.updates.modalTitle"),v=a("settings.menubar.updates.modalDescription",{version:o.latestVersion}),N=a("settings.menubar.updates.modalConfirm"),j=a("settings.menubar.updates.modalCancel");return e.jsxs("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-xs text-oai-gray-500 dark:text-oai-gray-500",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[i?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:r==="windows"?a("settings.menubar.updates.footerCore",{version:s.version}):a("settings.menubar.updates.footerCombined",{barVersion:s.version,coreVersion:p})}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("button",{type:"button",onClick:()=>n("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"}),e.jsx("span",{"aria-hidden":!0,children:"·"})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a("settings.menubar.updates.footerCore",{version:p})}),e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("button",{type:"button",onClick:u,disabled:c,className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300 disabled:opacity-50",children:c?a("settings.menubar.updates.checking"):a("settings.menubar.checkUpdates")}),e.jsx("span",{"aria-hidden":!0,children:"·"})]}),e.jsxs("a",{href:Kt,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:[e.jsx(qt,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.footer.statusPage")]})]}),e.jsx(La,{open:o.open,title:x,description:v,confirmLabel:N,cancelLabel:j,onConfirm:()=>{window.open(o.htmlUrl,"_blank"),d(h=>({...h,open:!1}))},onCancel:()=>d(h=>({...h,open:!1}))})]})}const zs=()=>[{value:"system",label:a("settings.network.mode.system")},{value:"manual",label:a("settings.network.mode.manual")},{value:"off",label:a("settings.network.mode.off")}],Fs=()=>[{value:"http",label:a("settings.network.protocol.http")},{value:"https",label:a("settings.network.protocol.https")},{value:"socks5",label:a("settings.network.protocol.socks5")}],Ge="w-full rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white";function Ue(t){const s={},n=String(t.host||"").trim();(!n||/:\/\//.test(n)||n.includes("/"))&&(s.host=a("settings.network.error.host"));const i=String(t.port??"").trim(),r=Number(i);return(!i||!/^\d+$/.test(i)||!Number.isInteger(r)||r<1||r>65535)&&(s.port=a("settings.network.error.port")),s}function Hs({proxySettings:t}){const{config:s,save:n,testConnection:i}=t,[r,c]=l.useState(()=>({mode:s.mode,protocol:s.protocol||"http",host:s.host||"",port:s.port||""})),[g,o]=l.useState({}),[d,y]=l.useState(!1),[p,u]=l.useState(""),[x,v]=l.useState(null),[N,j]=l.useState(!1),[h,m]=l.useState(null);l.useEffect(()=>{c({mode:s.mode,protocol:s.protocol||"http",host:s.host||"",port:s.port||""})},[s.mode,s.protocol,s.host,s.port]);const k=l.useMemo(()=>s.effective==="manual"?a("settings.network.effective.manual"):s.effective==="env"?a("settings.network.effective.env"):s.effective==="system"?a("settings.network.effective.system"):s.effective==="blocked"?a("settings.network.effective.blocked"):a("settings.network.effective.none"),[s.effective]),C=_=>{c(w=>({...w,..._})),o({}),u(""),v(null),m(null)},f=async()=>{if(r.mode==="manual"){const _=Ue(r);if(Object.keys(_).length){o(_);return}}y(!0),u(""),v(null);try{await n(r),u("saved")}catch(_){u("error"),v(_)}finally{y(!1)}},S=async()=>{const _=Ue(r);if(Object.keys(_).length){o(_);return}j(!0),m(null);try{const w=await i(r);m(w)}catch(w){m({ok:!1,error:w?.message||String(w)})}finally{j(!1)}};return e.jsxs(V,{title:a("settings.section.network"),subtitle:k,children:[s.applyError?e.jsx("p",{role:"alert",className:"mb-3 text-xs text-red-600 dark:text-red-400",children:a("settings.network.apply_error",{error:s.applyError})}):null,e.jsx(E,{label:a("settings.network.mode.label"),hint:a("settings.network.mode.hint"),control:e.jsx(q,{options:zs(),value:r.mode,onChange:_=>C({mode:_})})}),e.jsx(Ye,{initial:!1,children:r.mode==="manual"?e.jsxs(qe.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:[e.jsx(E,{label:a("settings.network.protocol.label"),control:e.jsx(ve,{value:r.protocol,onValueChange:_=>C({protocol:_}),options:Fs(),ariaLabel:a("settings.network.protocol.label"),className:"px-2.5 py-1.5 text-xs font-medium"})}),e.jsx(E,{label:a("settings.network.host.label"),hint:g.host,control:e.jsx("input",{type:"text",value:r.host,onChange:_=>C({host:_.target.value}),placeholder:a("settings.network.host.placeholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":g.host?!0:void 0,"aria-label":a("settings.network.host.label"),className:Ge})}),e.jsx(E,{label:a("settings.network.port.label"),hint:g.port,control:e.jsx("input",{type:"text",inputMode:"numeric",value:r.port,onChange:_=>C({port:_.target.value}),placeholder:a("settings.network.port.placeholder"),autoComplete:"off",spellCheck:!1,"aria-invalid":g.port?!0:void 0,"aria-label":a("settings.network.port.label"),className:Ge})}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2 py-3",children:[e.jsx("button",{type:"button",onClick:S,disabled:N||d,className:"rounded-md border border-oai-gray-200 px-3 py-1.5 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:N?a("settings.network.test.testing"):a("settings.network.test")}),e.jsx("button",{type:"button",onClick:f,disabled:d||N,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:d?a("settings.network.saving"):a("settings.network.save")})]}),h?e.jsx("p",{className:"py-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:h.ok?a("settings.network.test.ok",{status:String(h.status??"")}):a("settings.network.test.fail",{error:h.error||""})}):null]},"manual-proxy-fields"):e.jsx("div",{className:"flex justify-end py-3",children:e.jsx("button",{type:"button",onClick:f,disabled:d,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:d?a("settings.network.saving"):a("settings.network.save")})},"non-manual-save")}),p==="saved"?e.jsx("p",{className:"py-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.network.saved")}):null,p==="error"?e.jsx("p",{role:"alert",className:"py-2 text-xs text-red-600 dark:text-red-400",children:x?.unprotected?a("settings.network.save_error_unprotected",{error:x?.message||String(x||"")}):a("settings.network.save_error",{error:x?.message||String(x||"")})}):null]})}const ct="/functions/tokentracker-proxy-config",Bs="/functions/tokentracker-proxy-test",Vs={mode:"system",protocol:"http",host:"",port:"",effective:"none",applyError:null};function dt(t){return!t||typeof t.mode!="string"?null:{mode:t.mode,protocol:typeof t.protocol=="string"?t.protocol:"http",host:typeof t.host=="string"?t.host:"",port:t.port==null||t.port===0?"":String(t.port),effective:typeof t.effective=="string"?t.effective:"none",applyError:typeof t.applyError=="string"&&t.applyError.trim()?t.applyError:null}}async function Ks(){const t=await fetch(ct,{method:"GET",headers:{Accept:"application/json"},cache:"no-store"});if(!t.ok)return null;const s=await t.json().catch(()=>null);return dt(s)}async function Me(){const{getLocalApiAuthHeaders:t}=await Wt(async()=>{const{getLocalApiAuthHeaders:s}=await import("./__vite-browser-external-DWN9Fb-H.js").then(n=>n.dZ);return{getLocalApiAuthHeaders:s}},__vite__mapDeps([0,1]));return t()}function qs(){const[t,s]=l.useState(!1),[n,i]=l.useState(!0),[r,c]=l.useState(Vs);l.useEffect(()=>{if(!ba()){s(!1),i(!1);return}let d=!1;return(async()=>{try{const y=await Ks();if(d)return;if(!y){s(!1),i(!1);return}c(y),s(!0),i(!1)}catch{d||(s(!1),i(!1))}})(),()=>{d=!0}},[]);const g=l.useCallback(async d=>{const y=await Me(),p=await fetch(ct,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...y},cache:"no-store",body:JSON.stringify({mode:d.mode,protocol:d.protocol,host:d.host,port:d.port===""?0:Number(d.port)})}),u=await p.json().catch(()=>null);if(!p.ok){const v=u&&typeof u.error=="string"?u.error:`HTTP ${p.status}`;throw new Error(v)}const x=dt(u);if(x&&c(x),u&&u.ok===!1){const v=u&&typeof u.applyError=="string"&&u.applyError||u&&typeof u.error=="string"&&u.error||`HTTP ${p.status}`,N=new Error(v);throw u.unprotected===!0&&(N.unprotected=!0),N}return x||u},[]),o=l.useCallback(async d=>{const y=await Me(),p=await fetch(Bs,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...y},cache:"no-store",body:JSON.stringify({protocol:d.protocol,host:d.host,port:d.port===""?0:Number(d.port)})}),u=await p.json().catch(()=>null);if(!u||typeof u.ok!="boolean")throw new Error(u&&typeof u.error=="string"?u.error:`HTTP ${p.status}`);return u},[]);return{available:t,loading:n,config:r,save:g,testConnection:o}}const I={APPEARANCE:"appearance",NATIVE_APP:"native-app",NETWORK:"network",ACCOUNT:"account",CLOUD:"cloud",LIMITS:"limits",LABS:"labs"},M={PERSONAL:"personal",APP:"app",DEVELOPER:"developer"};function Ws({prefs:t}){return e.jsx(q,{options:[{value:Ie.USED,label:a("limits.settings.display_mode_used")},{value:Ie.REMAINING,label:a("limits.settings.display_mode_remaining")}],value:t.displayMode,onChange:t.setDisplayMode})}function In(){const t=ke(),s=da(),{available:n,settings:i,setSetting:r}=ie(),c=qs(),{available:g}=c,o=i?.toastOnReset!==!1,d=i?.confettiOnReset!==!1,y=Ke()||i?.platform==="windows",[p,u]=Yt(),x=He(),v=p.get("section"),j=Object.values(I).includes(v)&&(v!==I.NATIVE_APP||n)&&(v!==I.NETWORK||g)?v:I.APPEARANCE,h=f=>{const S=new URLSearchParams(p);f===I.APPEARANCE?S.delete("section"):S.set("section",f),u(S,{replace:!0})},m=[{id:I.APPEARANCE,label:a("settings.section.appearance"),description:a("settings.section.appearance.description"),group:M.PERSONAL,Icon:$a,content:e.jsx(Ds,{})},...n?[{id:I.NATIVE_APP,label:a("settings.section.menubar"),description:a("settings.section.menubar.description"),group:M.APP,Icon:ye,content:e.jsx(Us,{})}]:[],...g?[{id:I.NETWORK,label:a("settings.section.network"),description:a("settings.section.network.description"),group:M.APP,Icon:Zt,content:e.jsx(Hs,{proxySettings:c})}]:[],{id:I.ACCOUNT,label:a("settings.section.account"),description:a("settings.section.account.description"),group:M.PERSONAL,Icon:za,content:e.jsx(us,{settings:t})},{id:I.CLOUD,label:a("settings.section.cloud"),description:a("settings.section.cloud.description"),group:M.PERSONAL,Icon:se,content:e.jsx(Ss,{settings:t,active:j===I.CLOUD})},{id:I.LIMITS,label:a("settings.section.limits"),description:a("settings.section.limits.description"),group:M.APP,Icon:Jt,content:e.jsxs("div",{className:"space-y-4",children:[e.jsxs(V,{title:a("settings.section.limits"),children:[e.jsx(E,{label:a("limits.settings.display_mode_label"),control:e.jsx(Ws,{prefs:s})}),y?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),control:e.jsx(D,{checked:o,disabled:!n,onChange:()=>r("toastOnReset",!o),ariaLabel:a("settings.menubar.toastOnReset")})}),e.jsx(E,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),control:e.jsx(D,{checked:d,disabled:!n,onChange:()=>r("confettiOnReset",!d),ariaLabel:a("settings.menubar.confettiOnReset")})})]}),e.jsx(E,{label:a("settings.limits.showSubscriptions"),hint:a("settings.limits.showSubscriptionsHint"),control:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>x("/limits?openSubscriptions=1"),"aria-label":a("limits.page.openSubscriptions"),title:a("limits.page.openSubscriptions"),className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-oai-gray-200 dark:border-oai-gray-700 bg-white dark:bg-oai-gray-900 text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:e.jsx(Qt,{size:14,"aria-hidden":!0})}),e.jsx(D,{checked:s.showSubscriptions!==!1,onChange:()=>s.setShowSubscriptions(!s.showSubscriptions),ariaLabel:a("settings.limits.showSubscriptions")})]})})]}),e.jsx(V,{title:a("settings.limits.providers"),children:e.jsx(Va,{prefs:s})})]})},{id:I.LABS,label:a("settings.section.labs"),description:a("settings.section.labs.description"),group:M.DEVELOPER,Icon:Da,content:e.jsx(Gs,{})}],k=[{id:M.PERSONAL,label:a("settings.nav.group.personal")},{id:M.APP,label:a("settings.nav.group.app")},{id:M.DEVELOPER,label:a("settings.nav.group.developer")}].map(f=>({...f,sections:m.filter(S=>S.group===f.id)})).filter(f=>f.sections.length>0);let C=m[0];for(const f of m)if(f.id===j){C=f;break}return e.jsx("div",{className:B("flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",j===I.CLOUD&&"tt-cloud-settings"),children:e.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:e.jsxs("div",{className:"mx-auto w-full max-w-5xl px-4 sm:px-6",children:[e.jsxs("div",{className:"mb-7 max-w-2xl",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:a("settings.page.title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400 sm:text-base",children:a("settings.page.subtitle")})]}),e.jsxs("div",{className:"tt-settings-sections grid min-w-0 gap-6 md:grid-cols-[11rem_minmax(0,1fr)] md:gap-8",children:[e.jsx("aside",{className:"min-w-0 rounded-xl border border-oai-gray-200 bg-oai-gray-50/70 p-2 dark:border-oai-gray-800 dark:bg-oai-gray-900/60 md:border-0 md:bg-transparent md:p-0 md:dark:bg-transparent",children:e.jsx("nav",{"aria-label":a("settings.page.title"),className:"flex gap-1 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden md:sticky md:top-6 md:flex-col md:gap-4 md:overflow-visible",children:k.map(({id:f,label:S,sections:_})=>e.jsxs("div",{className:"flex shrink-0 gap-1 md:block",children:[e.jsx("div",{className:"hidden px-3 pb-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-oai-gray-400 dark:text-oai-gray-500 md:block",children:S}),e.jsx("div",{className:"flex gap-1 md:flex-col",children:_.map(({id:w,label:A,Icon:T})=>{const b=j===w;return e.jsxs("button",{id:`settings-nav-${w}`,type:"button","aria-current":b?"page":void 0,"aria-controls":`settings-panel-${w}`,onClick:()=>h(w),className:B("inline-flex min-h-10 min-w-max shrink-0 items-center gap-1.5 rounded-md px-2 py-2 text-left text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-oai-brand-500 md:w-full md:min-w-0 md:gap-2 md:px-3",b?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-500 hover:bg-oai-gray-50 hover:text-oai-gray-900 dark:text-oai-gray-400 dark:hover:bg-oai-gray-900 dark:hover:text-oai-gray-200"),children:[e.jsx(T,{className:B("h-4 w-4 shrink-0",b?"text-oai-black dark:text-white":"text-oai-gray-400 dark:text-oai-gray-500"),"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:A})]},w)})})]},f))})}),e.jsxs("div",{className:"min-w-0",children:[j!==I.CLOUD?e.jsxs("div",{className:"mb-4 border-b border-oai-gray-200 pb-4 dark:border-oai-gray-800",children:[e.jsx("h2",{className:"text-xl font-semibold tracking-tight text-oai-black dark:text-white",children:C.label}),e.jsx("p",{className:"mt-1 text-sm leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:C.description})]}):null,m.map(({id:f,label:S,content:_})=>e.jsx("section",{id:`settings-panel-${f}`,"aria-labelledby":`settings-nav-${f}`,"aria-label":S,"data-settings-panel":f,hidden:j!==f,children:_},f)),e.jsx($s,{})]})]})]})})})}export{In as SettingsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,a$ as ee,b1 as w,j as k,a_ as we,N as M,c3 as de,b0 as z,bR as ge,b5 as X,b7 as he,ba as _,b4 as Ae,c4 as ke,c5 as He,b2 as F,c6 as Fe,c7 as ce,b3 as ue,b9 as le,c8 as q,c9 as Le,ca as Ne,bO as Be,by as me,bz as je,bi as $,bx as Ue,bC as _e,cb as Ve,K as Ye,cc as Ge,bD as Xe,bh as Ke,J as Te,cd as $e,b6 as Q,ce as Je,bK as We,bN as ze}from"./__vite-browser-external-DWN9Fb-H.js";import{i as Re,A as qe,P as Qe,n as Ze,k as et,l as tt,m as nt,o as ot,p as rt,u as st,d as it,c as at,t as ct,x as ut,y as lt}from"./composite-Cq0CmNAv.js";import{p as pt,c as ft}from"./store-B22kwLs0.js";import{g as K,u as dt,c as gt,a as ht,s as mt,b as Tt}from"./safePolygon-DsolkMUX.js";import{u as Rt,a as Pt,g as Ct}from"./usePositioner-MepYlL0A.js";const Pe=a.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new we,currentIdRef:{current:null},currentContextRef:{current:null}});function vt(e,n){e.current=n.current}function Xt(e){const{children:n,delay:t,timeoutMs:u=0}=e,o=a.useRef(t),p=a.useRef(t),i=a.useRef(null),c=a.useRef(null),h=ee();return w(()=>{if(p.current=t,!i.current){o.current=t;return}o.current={open:K(o.current,"open"),close:K(t,"close")}},[t,i,o,p]),k.jsx(Pe.Provider,{value:a.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:p,currentIdRef:i,timeoutMs:u,currentContextRef:c,timeout:h}),[u,h]),children:n})}function yt(e,n={open:!1}){const{open:t}=n,u="rootStore"in e?e.rootStore:e,o=u.useState("floatingId"),p=a.useContext(Pe),{currentIdRef:i,delayRef:c,timeoutMs:h,initialDelayRef:m,currentContextRef:l,hasProvider:T,timeout:f}=p,[g,r]=a.useState(!1),P=a.useRef(t);return w(()=>{P.current=t},[t]),w(()=>{function s(){l.current?.setIsInstantPhase(!1),i.current=null,l.current=null,c.current=m.current,f.clear()}if(i.current&&!t&&i.current===o){if(r(!1),h){const d=o;return f.start(h,()=>{u.select("open")||i.current&&i.current!==d||s()}),()=>{(P.current||i.current!==d)&&f.clear()}}s()}},[t,o,i,c,h,m,l,f,u]),w(()=>{if(!t)return;const s=l.current,d=i.current;f.clear(),l.current={onOpenChange:u.setOpen,setIsInstantPhase:r},i.current=o,c.current={open:0,close:K(m.current,"close")},d!==null&&d!==o?(r(!0),s?.setIsInstantPhase(!0),s?.onOpenChange(!1,M(de))):(r(!1),s?.setIsInstantPhase(!1))},[t,o,u,i,c,m,l,f]),w(()=>()=>{if(i.current===o){if(l.current=null,!P.current)return;i.current=null,vt(c,m),f.clear()}},[l,i,c,o,m,f]),a.useMemo(()=>({activeIdRef:i,hasProvider:T,delayRef:c,isInstantPhase:g}),[i,T,c,g])}function bt(e,n){let t=null,u=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const p=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=n.axis==="x"||n.axis==="both",c=n.axis==="y"||n.axis==="both",h=["mouseenter","mousemove"].includes(n.dataRef.current.openEvent?.type||"")&&n.pointerType!=="touch";let m=p.width,l=p.height,T=p.x,f=p.y;return t==null&&n.x&&i&&(t=p.x-n.x),u==null&&n.y&&c&&(u=p.y-n.y),T-=t||0,f-=u||0,m=0,l=0,!o||h?(m=n.axis==="y"?p.width:0,l=n.axis==="x"?p.height:0,T=i&&n.x!=null?n.x:T,f=c&&n.y!=null?n.y:f):o&&!h&&(l=n.axis==="x"?p.height:l,m=n.axis==="y"?p.width:m),o=!0,{width:m,height:l,x:T,y:f,top:f,right:T+m,bottom:f+l,left:T}}}}function pe(e){return e!=null&&e.clientX!=null}function xt(e,n={}){const{enabled:t=!0,axis:u="both"}=n,o="rootStore"in e?e.rootStore:e,p=o.useState("open"),i=o.useState("floatingElement"),c=o.useState("domReferenceElement"),h=o.context.dataRef,m=a.useRef(!1),l=a.useRef(null),[T,f]=a.useState(),[g,r]=a.useState([]),P=z(R=>{o.set("positionReference",R)}),s=z((R,y,S)=>{m.current||h.current.openEvent&&!pe(h.current.openEvent)||o.set("positionReference",bt(S??c,{x:R,y,axis:u,dataRef:h,pointerType:T}))}),d=z(R=>{p?l.current||(s(R.clientX,R.clientY,R.currentTarget),r([])):s(R.clientX,R.clientY,R.currentTarget)}),b=Re(T)?i:p;a.useEffect(()=>{if(!t){P(c);return}if(!b)return;function R(){l.current?.(),l.current=null}const y=ge(i);function S(x){const O=he(x);_(i,O)?R():s(x.clientX,x.clientY)}return!h.current.openEvent||pe(h.current.openEvent)?l.current=X(y,"mousemove",S):P(c),R},[b,t,i,h,c,o,s,P,g]),a.useEffect(()=>()=>{o.set("positionReference",null)},[o]),a.useEffect(()=>{t&&!i&&(m.current=!1)},[t,i]),a.useEffect(()=>{!t&&p&&(m.current=!0)},[t,p]);const C=a.useMemo(()=>{function R(y){f(y.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:d,onMouseEnter:d}},[d]);return a.useMemo(()=>t?{reference:C,trigger:C}:{},[t,C])}const Z=ke&&He;function St(e,n={}){const{enabled:t=!0,delay:u}=n,o="rootStore"in e?e.rootStore:e,{events:p,dataRef:i}=o.context,c=a.useRef(!1),h=a.useRef(null),m=a.useRef(!0),l=ee();a.useEffect(()=>{const f=o.select("domReferenceElement");if(!t)return;const g=ge(f);function r(){const d=o.select("domReferenceElement");!o.select("open")&&Be(d)&&d===ce(ue(d))&&(c.current=!0,h.current=d)}function P(){m.current=!0}function s(){m.current=!1}return Ae(X(g,"blur",r),Z&&X(g,"keydown",P,!0),Z&&X(g,"pointerdown",s,!0))},[o,t]),a.useEffect(()=>{if(!t)return;function f(g){if(g.reason===me||g.reason===je){const r=o.select("domReferenceElement");F(r)&&(h.current=r,c.current=!0)}}return p.on("openchange",f),()=>{p.off("openchange",f)}},[p,t,o]);const T=a.useMemo(()=>{function f(){c.current=!1,h.current=null}return{onMouseLeave(){f()},onFocus(g){const r=g.currentTarget;if(c.current){if(h.current===r)return;f()}const P=he(g.nativeEvent);if(F(P)){if(Z&&!g.relatedTarget){if(!m.current&&!Le(P))return}else if(!Ne(P))return}const s=le(g.relatedTarget,o.context.triggerElements),{nativeEvent:d,currentTarget:b}=g,C=typeof u=="function"?u():u;if(o.select("open")&&s||C===0||C===void 0){o.setOpen(!0,M(q,d,b));return}l.start(C,()=>{c.current||o.setOpen(!0,M(q,d,b))})},onBlur(g){f();const r=g.relatedTarget,P=g.nativeEvent,s=F(r)&&r.hasAttribute(Fe("focus-guard"))&&r.getAttribute("data-type")==="outside";l.start(0,()=>{const d=o.select("domReferenceElement"),b=ce(ue(d));!r&&b===d||_(i.current.floatingContext?.refs.floating.current,b)||_(d,b)||s||le(r??b,o.context.triggerElements)||o.setOpen(!1,M(q,P))})}}},[i,u,o,l]);return a.useMemo(()=>t?{reference:T,trigger:T}:{},[t,T])}const Ce=a.createContext(void 0);function J(e){const n=a.useContext(Ce);if(n===void 0&&!e)throw new Error($(72));return n}const Et={...pt,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class Ot extends Ue{constructor(n,t,u){const o=new Qe;super(It(n,o,t,u),Mt(o),Et)}setOpen=(n,t)=>{qe(this,n,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,M(me,n))}}function It(e,n,t,u=!1){return{...ft(n,t,u),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Mt(e){return{popupRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Kt=_e(function(n){const{disabled:t=!1,defaultOpen:u=!1,open:o,disableHoverablePopup:p=!1,trackCursorAxis:i="none",actionsRef:c,onOpenChange:h,onOpenChangeComplete:m,handle:l,triggerId:T,defaultTriggerId:f=null,children:g}=n,r=Ze((L,N)=>new Ot({open:u,openProp:o,activeTriggerId:f,triggerIdProp:T},L,N));r.useControlledProp("openProp",o),r.useControlledProp("triggerIdProp",T),r.useContextCallback("onOpenChange",h),r.useContextCallback("onOpenChangeComplete",m);const P=r.useState("open"),s=!t&&P,d=r.useState("activeTriggerId"),b=r.useState("mounted"),C=r.useState("payload");r.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:p,disabled:t}),et(r,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:y}=tt(s,r),S=r.useState("isInstantPhase"),x=r.useState("instantType"),O=r.useState("lastOpenChangeReason"),D=a.useRef(null);w(()=>{P&&t&&r.setOpen(!1,M(Ge))},[P,t,r]),w(()=>{y==="ending"&&O===de||y!=="ending"&&S?(x!=="delay"&&(D.current=x),r.set("instantType","delay")):D.current!==null&&(r.set("instantType",D.current),D.current=null)},[y,S,O,x,r]),w(()=>{s&&d==null&&r.set("payload",void 0)},[r,d,s]),a.useImperativeHandle(c,()=>({unmount:R,close:()=>r.setOpen(!1,M(Xe))}),[R,r]);const H=s||b||!t&&i!=="none";return k.jsxs(Ce.Provider,{value:r,children:[l&&k.jsx(nt,{handle:l,store:r}),H&&k.jsx(Dt,{store:r,disabled:t,trackCursorAxis:i}),typeof g=="function"?g({payload:C}):g]})});function Dt({store:e,disabled:n,trackCursorAxis:t}){const u=e.useState("floatingRootContext"),o=ot(u,{enabled:!n,referencePress:()=>e.select("closeOnClick")}),p=xt(u,{enabled:!n&&t!=="none",axis:t==="none"?void 0:t}),i=a.useMemo(()=>Ve(p.reference,o.reference),[p.reference,o.reference]);return rt(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??Ye}),null}const wt=a.createContext(void 0);function At(){return a.useContext(wt)}const kt=600,ve="data-base-ui-tooltip-trigger";function fe(e){if("composedPath"in e){const t=e.composedPath();for(let u=0;u<t.length;u+=1){const o=t[u];if(F(o))return o}}const n=e.target;return F(n)?n:null}function Ht(e){let n=e;for(;n;){const t=n.closest(`[${ve}]`);if(t)return t;const u=n.getRootNode();n="host"in u&&F(u.host)?u.host:null}return null}const $t=Ke(function(n,t){const{render:u,className:o,style:p,handle:i,payload:c,disabled:h,delay:m,closeOnClick:l=!0,closeDelay:T,id:f,...g}=n,r=J(!0),s=dt(i)??r;if(!s)throw new Error($(82));const d=st(f),b=s.useState("isTriggerActive",d),C=s.useState("isOpenedByTrigger",d),R=s.useState("floatingRootContext"),y=a.useRef(null),S=T??0,{registerTrigger:x,isMountedByThisTrigger:O}=it(d,y,s,{payload:c,closeOnClick:l,closeDelay:S}),D=At(),{activeIdRef:H,delayRef:L,isInstantPhase:N,hasProvider:E}=yt(R,{open:C}),B=gt(R);s.useSyncedValue("isInstantPhase",N);const W=s.useState("disabled"),j=h??W,te=at(j),ne=s.useState("trackCursorAxis"),xe=s.useState("disableHoverablePopup"),U=a.useRef(!1),V=ee(),Y=a.useRef(void 0);function oe(){return E&&H.current!=null?0:m??D??kt}function re(v){const I=y.current;if(!I||!v)return!1;const A=Ht(v);return A!==null&&A!==I&&_(I,A)}function Se(v){const I=re(v);return U.current=I,I&&(B.openChangeTimeout.clear(),B.restTimeout.clear(),B.restTimeoutPending=!1,V.clear()),I}const Ee=ht(R,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!xe&&ne!=="both"?mt():null,restMs:oe,delay(){return T==null&&E?{close:K(L.current,"close")}:{close:S}},triggerElementRef:y,isActiveTrigger:b,isClosing:()=>s.select("transitionStatus")==="ending",shouldOpen(){return!U.current}}),Oe=St(R,{enabled:!j}).reference,Ie=v=>{const I=U.current,A=fe(v),se=Se(A),G=y.current,De=G&&A&&_(G,A);if(se&&s.select("open")&&s.select("lastOpenChangeReason")===Q){s.setOpen(!1,M(Q,v));return}if(I&&!se&&De&&!te.current&&!s.select("open")&&G&&Re(Y.current)){const ie=()=>{!U.current&&!te.current&&!s.select("open")&&s.setOpen(!0,M(Q,v,G))},ae=oe();ae===0?(V.clear(),ie()):V.start(ae,ie)}},Me=s.useState("triggerProps",O);return Te("button",n,{state:{open:C},ref:[t,x,y],props:[Ee,Oe,O||ne!=="none"?Me:void 0,{onMouseOver(v){Ie(v.nativeEvent)},onFocus(v){re(fe(v.nativeEvent))&&v.preventBaseUIHandler()},onMouseLeave(){U.current=!1,V.clear(),Y.current=void 0},onPointerEnter(v){Y.current=v.pointerType},onPointerDown(v){Y.current=v.pointerType,s.set("closeOnClick",l),l&&!s.select("open")&&s.cancelPendingOpen(v.nativeEvent)},onClick(v){l&&!s.select("open")&&s.cancelPendingOpen(v.nativeEvent)},id:d,[$e]:j?"":void 0,[ve]:j?void 0:""},g],stateAttributesMapping:ct})}),ye=a.createContext(void 0);function Ft(){const e=a.useContext(ye);if(e===void 0)throw new Error($(70));return e}const Jt=a.forwardRef(function(n,t){const{keepMounted:u=!1,...o}=n;return J().useState("mounted")||u?k.jsx(ye.Provider,{value:u,children:k.jsx(Je,{ref:t,...o})}):null}),be=a.createContext(void 0);function Lt(){const e=a.useContext(be);if(e===void 0)throw new Error($(71));return e}const Wt=a.forwardRef(function(n,t){const{render:u,className:o,anchor:p,positionMethod:i="absolute",side:c="top",align:h="center",sideOffset:m=0,alignOffset:l=0,collisionBoundary:T="clipping-ancestors",collisionPadding:f=5,arrowPadding:g=5,sticky:r=!1,disableAnchorTracking:P=!1,collisionAvoidance:s=We,style:d,...b}=n,C=J(),R=Ft(),y=C.useState("open"),S=C.useState("mounted"),x=C.useState("trackCursorAxis"),O=C.useState("disableHoverablePopup"),D=C.useState("floatingRootContext"),H=C.useState("instantType"),L=C.useState("transitionStatus"),N=C.useState("adaptiveOrigin"),E=Rt({anchor:p,positionMethod:i,floatingRootContext:D,mounted:S,side:c,sideOffset:m,align:h,alignOffset:l,collisionBoundary:T,collisionPadding:f,sticky:r,arrowPadding:g,disableAnchorTracking:P,keepMounted:R,collisionAvoidance:s,adaptiveOrigin:N}),B=a.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x!=="none"?"tracking-cursor":H}),[y,E.side,E.align,E.anchorHidden,x,H]),W=Pt(n,B,{styles:E.positionerStyles,transitionStatus:L,props:b,refs:[t,C.useStateSetter("positionerElement")],hidden:!S,inert:!y||x==="both"||O});return k.jsx(be.Provider,{value:E,children:W})}),zt=a.forwardRef(function(n,t){const{render:u,className:o,style:p,...i}=n,c=J(),{side:h,align:m}=Lt(),l=c.useState("open"),T=c.useState("instantType"),f=c.useState("transitionStatus"),g=c.useState("popupProps"),r=c.useState("floatingRootContext"),P=c.useState("disabled"),s=c.useState("closeDelay");ze({open:l,ref:c.context.popupRef,onComplete(){l&&c.context.onOpenChangeComplete?.(!0)}}),Tt(r,{enabled:!P,closeDelay:s});const d=c.useStateSetter("popupElement");return Te("div",n,{state:{open:l,side:h,align:m,instant:T,transitionStatus:f},ref:[t,c.context.popupRef,d],props:[ut,g,Ct(f),i],stateAttributesMapping:lt})});export{Xt as F,wt as T,Kt as a,$t as b,Jt as c,Wt as d,zt as e};
|