ccdash
Version:
Claude Code Dashboard - A comprehensive monitoring dashboard for Claude Code
1 lines • 29.6 kB
JavaScript
;(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[972],{154:(e,t,s)=>{s.d(t,{YS:()=>o,r6:()=>r,rI:()=>n,sC:()=>function e(t,s){let i=s.split("."),r=a[t];for(let a of i)if(r&&"object"==typeof r&&a in r)r=r[a];else{if("ja"!==t)return e("ja",s);return s}return"string"==typeof r?r:s}});let a={ja:{common:{refresh:"更新",back:"戻る",loading:"読み込み中...",error:"エラー",copy:"コピー",copied:"コピー済み",settings:"設定",overview:"概要",sessions:"セッション"},header:{title:"CCDash",subtitle:"Claude Code ダッシュボード",nav:{dashboard:"ダッシュボード",dashboardDesc:"トークン使用量とプロジェクト概要",sessions:"セッション",sessionsDesc:"Claude Codeセッションの詳細",scheduler:"スケジューラー",schedulerDesc:"タスクの自動スケジューリング",resources:"リソース",claudeCodeDesc:"Claude Codeの公式ドキュメント",github:"GitHub",githubDesc:"ソースコードを確認",issues:"課題",issuesDesc:"バグ報告や機能要求",documentation:"ドキュメント",documentationDesc:"使い方とガイド"}},tokenUsage:{title:"トークン使用量",available:"使用可能",tokens:"トークン",estimate:"(見積もり)",excess:"超過分",usageRate:"使用率",resetIn:"リセットまで",hours:"時間",minutes:"分"},p90Prediction:{title:"消費量(P90予測)",tokenLimit:"トークンリミット",messageLimit:"メッセージリミット",costLimit:"コストリミット",confidence:"信頼度",burnRate:"消費率",timeToLimit:"予測到達時間",resetIn:"リセットまで",tokensPerHour:"トークン/時",ofPredictedLimit:"予測値",alreadyReached:"超過",resetSoon:"リセット予定",lastPredicted:"最終予測",at:"時刻"},session:{status:"ステータス",sessionId:"セッションID",startTime:"開始時刻",duration:"実行時間",tokenUsage:"トークン使用量",messageCount:"メッセージ数",project:"プロジェクト",cost:"コスト",messages:"メッセージ",active:"実行中",completed:"完了",paused:"停止中",failed:"失敗",unknown:"不明",detail:"セッション詳細",info:"セッション情報",lastActivity:"最終活動",messageHistory:"メッセージ履歴",user:"ユーザー",assistant:"アシスタント",codeGenerated:"生成されたコード",codeBlocks:"コードブロック",input:"入力",output:"出力",total:"合計",thinking:"内部思考",toolResult:"Tool Result",page:"ページ",noContent:"No content",rawObjectContent:"Raw object content:",unknownItemType:"Unknown item type:"},errors:{tokenUsageFetch:"トークン使用量の取得に失敗しました",sessionsFetch:"セッション情報の取得に失敗しました",sessionNotFound:"セッションが見つかりません",sessionDetailFetch:"セッション詳細を読み込み中..."},empty:{noSessions:"セッションがありません",noSessionsDesc:"Claude Codeを使用してセッションが作成されると、ここに表示されます",noProjects:"プロジェクトがありません",noProjectsDesc:"Claude Codeを使用してプロジェクトが作成されると、ここに表示されます"},project:{totalTokenUsage:"総トークン使用量",sessionCount:"セッション数",recentSessions:"最近のセッション",running:"実行中",completed:"完了",others:"他",sessionsText:"セッション",messages:"メッセージ",tokensLabel:"tokens"},job:{title:"ジョブ詳細",history:"ジョブ履歴",execution:"タスク実行",command:"コマンド",output:"出力",error:"エラー",logs:"ログ",status:{running:"実行中",completed:"完了",pending:"待機中",failed:"失敗",cancelled:"キャンセル済み"},schedule:{immediate:"即時実行",afterReset:"リセット後",delayed:"遅延実行",scheduled:"時刻指定"},duration:"実行時間",executionTime:"実行時間",completedAt:"完了日時",scheduledAt:"予定実行時刻",timeUntil:"実行まで",hoursAfter:"時間後",minutesAfter:"分後",daysAfter:"日後",create:"ジョブを作成",cancel:"キャンセル",delete:"削除",executing:"実行中...",created:"ジョブが正常に作成されました",notFound:"ジョブが見つかりません",loading:"ジョブ詳細を読み込み中...",confirmDelete:"このジョブを削除しますか?",outputLog:"出力ログ",errorLog:"エラーログ",standardOutput:"標準出力",standardError:"標準エラー出力",noOutputLog:"出力ログがありません",noErrorLog:"エラーログがありません",validation:{futureTime:"スケジュール日時は現在時刻より後に設定してください",withinYear:"スケジュール日時は1年以内に設定してください"},description:"Claude Codeタスクを実行します。プロジェクトを選択してコマンドを入力してください。",resetDescription:"セッションウィンドウがリセットされた後に実行されます。",delayDescription:"時間後に実行されます。",scheduleDescription:"に実行されます。",totalJobs:"件のジョブを表示",scheduleHeader:"スケジュール",createdAt:"作成日時",actions:"アクション",form:{selectProject:"プロジェクトを選択してください",loadingProjects:"読み込み中...",errorProjects:"エラー",noProjects:"プロジェクトがありません",executionDirectory:"実行ディレクトリ",commandPlaceholder:"例: 新しい機能を実装して...",commandHelp:"Claude Codeに実行させたいタスクを自然言語で記述してください。",yoloMode:"YOLOモード",yoloModeDescription:"(確認なしで変更を実行)",executionTiming:"実行タイミング",executionDate:"実行日",executionTime:"実行時刻",executionScheduled:"実行予定",dateTimeRequired:"日付と時刻を両方指定してください"},security:{warningTitle:"セキュリティ警告",yoloWarning:"YOLOモードは全てのコマンドを安全性チェックなしで実行します。悪意のあるコマンドによってシステムが損傷する可能性があります。",safeExecutionTitle:"安全な実行のために:",safeExecutionText:"Claude Codeの設定ファイルでコマンドの許可を適切に行ってください。",settingsGuide:"設定方法を確認する →"}},settings:{title:"設定",description:"タイムゾーン、自動更新間隔、使用量表示モードを設定してください。",timezone:"タイムゾーン",timezonePlaceholder:"タイムゾーンを選択",refreshInterval:"自動更新間隔",refreshPlaceholder:"更新間隔を選択",usageMode:"使用量表示モード",usageModePlaceholder:"表示モードを選択",p90Prediction:"P90予測",fixedLimits:"固定値",fixedLimitsConfig:"固定値設定",preset:"プリセット",tokenLimit:"トークン制限",messageLimit:"メッセージ制限",costLimit:"コスト制限",cancel:"キャンセル",save:"保存"},footer:{description:"Web application for monitoring Claude Code usage and task scheduling",sponsor:"Sponsor",sections:{product:"Product",resources:"Resources",support:"Support"},links:{dashboard:"Dashboard",sessions:"Sessions",scheduler:"Scheduler",documentation:"Documentation",claudeCode:"Claude Code",github:"GitHub",issues:"Issues & Bug Reports",discussions:"Discussions",contribute:"Contribute",privacy:"Privacy",terms:"Terms"},rights:"All rights reserved.",madeWith:"Made with",forCommunity:"for the community",builtWith:"Built with",status:"Status",statusOperational:"Operational"},auth:{title:"API認証",apiKey:"APIキー",apiKeyPlaceholder:"APIキーを入力してください",description:"CCDashにアクセスするためのAPIキーを入力してください",authenticate:"認証",authenticating:"検証中...",logout:"ログアウト",status:{authenticated:"認証済み",unauthenticated:"未認証",checking:"認証確認中...",apiKeyRequired:"APIキーが必要です",apiKeySet:"APIキーが設定されています"},errors:{required:"APIキーを入力してください",invalid:"無効なAPIキーです。正しいAPIキーを入力してください。"},securityNote:"APIキーはブラウザのセッションストレージに安全に保存されます"}},en:{common:{refresh:"Refresh",back:"Back",loading:"Loading...",error:"Error",copy:"Copy",copied:"Copied",settings:"Settings",overview:"Overview",sessions:"Sessions"},header:{title:"CCDash",subtitle:"Claude Code Dashboard",nav:{dashboard:"Dashboard",dashboardDesc:"Token usage and project overview",sessions:"Sessions",sessionsDesc:"Claude Code session details",scheduler:"Scheduler",schedulerDesc:"Automatic task scheduling",resources:"Resources",claudeCodeDesc:"Official Claude Code documentation",github:"GitHub",githubDesc:"View source code",issues:"Issues",issuesDesc:"Bug reports and feature requests",documentation:"Documentation",documentationDesc:"Usage guides and documentation"}},tokenUsage:{title:"Token Usage",available:"Available",tokens:"tokens",estimate:"(estimate)",excess:"Excess",usageRate:"Usage Rate",resetIn:"Reset in",hours:"hours",minutes:"minutes"},p90Prediction:{title:"P90 Usage Predictions",tokenLimit:"Token Prediction Limit",messageLimit:"Message Prediction Limit",costLimit:"Cost Prediction Limit",confidence:"Confidence",burnRate:"Burn Rate",timeToLimit:"Time to Limit",resetIn:"Reset In",tokensPerHour:"tokens/hour",ofPredictedLimit:"of predicted limit",alreadyReached:"Already reached",resetSoon:"Reset soon",lastPredicted:"Last predicted",at:"at"},session:{status:"Status",sessionId:"Session ID",startTime:"Start Time",duration:"Duration",tokenUsage:"Token Usage",messageCount:"Messages",project:"Project",cost:"Cost",messages:"Messages",active:"Active",completed:"Completed",paused:"Paused",failed:"Failed",unknown:"Unknown",detail:"Session Detail",info:"Session Information",lastActivity:"Last Activity",messageHistory:"Message History",user:"User",assistant:"Assistant",codeGenerated:"Generated Code",codeBlocks:"code blocks",input:"Input",output:"Output",total:"Total",thinking:"Internal Thinking",toolResult:"Tool Result",page:"Page",noContent:"No content",rawObjectContent:"Raw object content:",unknownItemType:"Unknown item type:"},errors:{tokenUsageFetch:"Failed to fetch token usage",sessionsFetch:"Failed to fetch session information",sessionNotFound:"Session not found",sessionDetailFetch:"Loading session details..."},empty:{noSessions:"No sessions",noSessionsDesc:"Sessions will appear here when you use Claude Code",noProjects:"No projects",noProjectsDesc:"Projects will appear here when you use Claude Code"},project:{totalTokenUsage:"Total Token Usage",sessionCount:"Sessions",recentSessions:"Recent Sessions",running:"Running",completed:"Completed",others:"others",sessionsText:"sessions",messages:"messages",tokensLabel:"tokens"},job:{title:"Job Details",history:"Job History",execution:"Task Execution",command:"Command",output:"Output",error:"Error",logs:"Logs",status:{running:"Running",completed:"Completed",pending:"Pending",failed:"Failed",cancelled:"Cancelled"},schedule:{immediate:"Immediate",afterReset:"After Reset",delayed:"Delayed",scheduled:"Scheduled"},duration:"Duration",executionTime:"Execution Time",completedAt:"Completed At",scheduledAt:"Scheduled At",timeUntil:"Time Until",hoursAfter:"hours later",minutesAfter:"minutes later",daysAfter:"days later",create:"Create Job",cancel:"Cancel",delete:"Delete",executing:"Executing...",created:"Job created successfully",notFound:"Job not found",loading:"Loading job details...",confirmDelete:"Are you sure you want to delete this job?",outputLog:"Output Log",errorLog:"Error Log",standardOutput:"Standard Output",standardError:"Standard Error",noOutputLog:"No output log available",noErrorLog:"No error log available",validation:{futureTime:"Schedule time must be set in the future",withinYear:"Schedule time must be within one year"},description:"Execute Claude Code tasks. Select a project and enter a command.",resetDescription:"Will be executed after the session window is reset.",delayDescription:"Will be executed after the specified hours.",scheduleDescription:" will be executed.",totalJobs:"jobs displayed",scheduleHeader:"Schedule",createdAt:"Created At",actions:"Actions",form:{selectProject:"Select a project",loadingProjects:"Loading...",errorProjects:"Error",noProjects:"No projects available",executionDirectory:"Execution Directory",commandPlaceholder:"e.g., Implement a new feature...",commandHelp:"Describe the task you want Claude Code to execute in natural language.",yoloMode:"YOLO Mode",yoloModeDescription:"(Execute changes without confirmation)",executionTiming:"Execution Timing",executionDate:"Execution Date",executionTime:"Execution Time",executionScheduled:"Scheduled for",dateTimeRequired:"Please specify both date and time"},security:{warningTitle:"Security Warning",yoloWarning:"YOLO mode executes all commands without safety checks. Malicious commands could damage your system.",safeExecutionTitle:"For safe execution:",safeExecutionText:"Configure command permissions appropriately in the Claude Code settings file.",settingsGuide:"View configuration guide →"}},settings:{title:"Settings",description:"Configure timezone, auto-refresh interval, and usage display mode.",timezone:"Timezone",timezonePlaceholder:"Select timezone",refreshInterval:"Auto Refresh Interval",refreshPlaceholder:"Select refresh interval",usageMode:"Usage Display Mode",usageModePlaceholder:"Select display mode",p90Prediction:"P90 Prediction",fixedLimits:"Fixed Limits",fixedLimitsConfig:"Fixed Limits Configuration",preset:"Preset",tokenLimit:"Token Limit",messageLimit:"Message Limit",costLimit:"Cost Limit",cancel:"Cancel",save:"Save"},footer:{description:"Web application for monitoring Claude Code usage and task scheduling",sponsor:"Sponsor",sections:{product:"Product",resources:"Resources",support:"Support"},links:{dashboard:"Dashboard",sessions:"Sessions",scheduler:"Scheduler",documentation:"Documentation",claudeCode:"Claude Code",github:"GitHub",issues:"Issues & Bug Reports",discussions:"Discussions",contribute:"Contribute",privacy:"Privacy",terms:"Terms"},rights:"All rights reserved.",madeWith:"Made with",forCommunity:"for the community",builtWith:"Built with",status:"Status",statusOperational:"Operational"},auth:{title:"API Authentication",apiKey:"API Key",apiKeyPlaceholder:"Enter your API key",description:"Enter your API key to access CCDash",authenticate:"Authenticate",authenticating:"Validating...",logout:"Logout",status:{authenticated:"Authenticated",unauthenticated:"Unauthenticated",checking:"Checking authentication...",apiKeyRequired:"API key required",apiKeySet:"API key is set"},errors:{required:"Please enter an API key",invalid:"Invalid API key. Please enter a valid API key."},securityNote:"API key is securely stored in browser session storage"}}};function i(e){switch(e){case"ja":default:return"ja-JP";case"en":return"en-US"}}function r(e,t){let s=i(e);return t.toLocaleString(s,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function o(e,t){let s=i(e);return t.toLocaleString(s,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function n(){{let e=localStorage.getItem("ccdash-language");if(e&&("ja"===e||"en"===e))return e}return"ja"}},557:(e,t,s)=>{s.d(t,{AuthStatus:()=>m});var a=s(5155),i=s(2115),r=s(7168),o=s(8145),n=s(5339),c=s(9803),u=s(4835),l=s(1886),d=s(2261);function m(e){let{className:t="",showFullStatus:s=!0}=e,{t:m}=(0,d.s)(),[g,h]=(0,i.useState)(!1),[p,f]=(0,i.useState)(!0);return((0,i.useEffect)(()=>{let e=()=>{h(l.u.hasApiKey()),f(!1)};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]),p)?(0,a.jsxs)("div",{className:"flex items-center gap-2 ".concat(t),children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500"}),s&&(0,a.jsx)("span",{className:"text-sm text-gray-500",children:m("auth.status.checking")})]}):g?(0,a.jsxs)("div",{className:"flex items-center gap-2 ".concat(t),children:[(0,a.jsxs)(o.E,{variant:"secondary",className:"bg-green-100 text-green-800",children:[(0,a.jsx)(c.A,{className:"w-3 h-3 mr-1"}),m("auth.status.authenticated")]}),s&&(0,a.jsxs)(r.$,{onClick:()=>{l.u.clearApiKey(),h(!1),window.location.reload()},variant:"ghost",size:"sm",className:"h-8 px-2 text-xs",children:[(0,a.jsx)(u.A,{className:"w-3 h-3 mr-1"}),m("auth.logout")]})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 ".concat(t),children:[(0,a.jsxs)(o.E,{variant:"destructive",className:"bg-red-100 text-red-800",children:[(0,a.jsx)(n.A,{className:"w-3 h-3 mr-1"}),m("auth.status.unauthenticated")]}),s&&(0,a.jsx)("span",{className:"text-sm text-gray-500",children:m("auth.status.apiKeyRequired")})]})}},1741:(e,t,s)=>{s.d(t,{ApiKeyAuth:()=>y});var a=s(5155),i=s(2115),r=s(7168),o=s(9852),n=s(8482),c=s(9026),u=s(8145),l=s(5196),d=s(4835),m=s(9803),g=s(8749),h=s(2657),p=s(1886),f=s(2261);function y(e){let{onAuthStateChange:t}=e,{t:s}=(0,f.s)(),[y,x]=(0,i.useState)(""),[b,v]=(0,i.useState)(!1),[j,C]=(0,i.useState)(!1),[P,k]=(0,i.useState)(""),[S,A]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=p.u.hasApiKey();C(e),null==t||t(e)},[t]);let w=async e=>{if(e.preventDefault(),k(""),A(!0),!y.trim()){k(s("auth.errors.required")),A(!1);return}try{p.u.setApiKey(y.trim()),await p.u.getTokenUsage(),C(!0),x(""),null==t||t(!0)}catch(e){k(s("auth.errors.invalid")),p.u.clearApiKey(),C(!1),null==t||t(!1)}finally{A(!1)}};return j?(0,a.jsxs)(n.Zp,{className:"w-full max-w-md",children:[(0,a.jsxs)(n.aR,{className:"text-center",children:[(0,a.jsx)("div",{className:"flex items-center justify-center gap-2",children:(0,a.jsxs)(u.E,{variant:"secondary",className:"bg-green-100 text-green-800",children:[(0,a.jsx)(l.A,{className:"w-3 h-3 mr-1"}),s("auth.status.authenticated")]})}),(0,a.jsx)(n.ZB,{className:"text-lg",children:s("auth.title")}),(0,a.jsx)(n.BT,{children:s("auth.status.apiKeySet")})]}),(0,a.jsx)(n.Wu,{className:"space-y-4",children:(0,a.jsxs)(r.$,{onClick:()=>{p.u.clearApiKey(),C(!1),x(""),k(""),null==t||t(!1)},variant:"outline",className:"w-full",children:[(0,a.jsx)(d.A,{className:"w-4 h-4 mr-2"}),s("auth.logout")]})})]}):(0,a.jsxs)(n.Zp,{className:"w-full max-w-md",children:[(0,a.jsxs)(n.aR,{className:"text-center",children:[(0,a.jsx)("div",{className:"flex justify-center mb-2",children:(0,a.jsx)(m.A,{className:"w-8 h-8 text-blue-500"})}),(0,a.jsx)(n.ZB,{className:"text-xl",children:s("auth.title")}),(0,a.jsx)(n.BT,{children:s("auth.description")})]}),(0,a.jsxs)(n.Wu,{children:[(0,a.jsxs)("form",{onSubmit:w,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"apiKey",className:"text-sm font-medium",children:s("auth.apiKey")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(o.p,{id:"apiKey",type:b?"text":"password",value:y,onChange:e=>x(e.target.value),placeholder:s("auth.apiKeyPlaceholder"),className:"pr-10",disabled:S}),(0,a.jsx)(r.$,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>v(!b),disabled:S,children:b?(0,a.jsx)(g.A,{className:"w-4 h-4"}):(0,a.jsx)(h.A,{className:"w-4 h-4"})})]})]}),P&&(0,a.jsx)(c.Fc,{variant:"destructive",children:(0,a.jsx)(c.TN,{children:P})}),(0,a.jsx)(r.$,{type:"submit",className:"w-full",disabled:S,children:S?s("auth.authenticating"):s("auth.authenticate")})]}),(0,a.jsx)("div",{className:"mt-6 pt-4 border-t text-center",children:(0,a.jsx)("p",{className:"text-xs text-gray-500",children:s("auth.securityNote")})})]})]})}},1886:(e,t,s)=>{s.d(t,{F:()=>o,u:()=>r});var a=s(9509);class i{setApiKey(e){this.apiKey=e,sessionStorage.setItem("ccdash_api_key",e)}getApiKey(){if(this.apiKey)return this.apiKey;{let e=sessionStorage.getItem("ccdash_api_key");if(e)return this.apiKey=e,e}return a.env.NEXT_PUBLIC_API_KEY,null}clearApiKey(){this.apiKey=null,sessionStorage.removeItem("ccdash_api_key")}hasApiKey(){return null!==this.getApiKey()}async request(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s="".concat(this.baseURL).concat(e),a={"Content-Type":"application/json",...t.headers},i=this.getApiKey(),r=i?{...a,"X-API-Key":i}:a,o=await fetch(s,{headers:r,...t});if(!o.ok){if(401===o.status)throw this.clearApiKey(),Error("Authentication required. Please provide a valid API key.");throw Error("HTTP error! status: ".concat(o.status))}return o.json()}async getTokenUsage(){return this.request("/token-usage")}async getSessions(){return this.request("/claude/sessions/recent")}async getSessionDetail(e,t,s){let a="/sessions/".concat(e);if(void 0!==t||void 0!==s){let e=new URLSearchParams;void 0!==t&&e.append("page",t.toString()),void 0!==s&&e.append("page_size",s.toString()),a+="?".concat(e.toString())}return this.request(a)}async getAvailableTokens(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pro";return this.request("/claude/available-tokens?plan=".concat(e))}async getCurrentMonthCosts(){return this.request("/costs/current-month")}async getTasks(){return this.request("/tasks")}async syncLogs(){return this.request("/sync-logs",{method:"POST"})}async getP90Predictions(){return this.request("/predictions/p90")}async getP90PredictionsByProject(e){return this.request("/predictions/p90/project/".concat(encodeURIComponent(e)))}async getBurnRateHistory(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:24;return this.request("/predictions/burn-rate-history?hours=".concat(e))}async getInitializationStatus(){return this.request("/initialization-status")}async getProjects(){return this.request("/projects")}async getProject(e){return this.request("/projects/".concat(e))}async createJob(e){return this.request("/jobs",{method:"POST",body:JSON.stringify(e)})}async getJobs(e){let t="/jobs";if(e){let s=new URLSearchParams;e.project_id&&s.append("project_id",e.project_id),e.status&&s.append("status",e.status),e.limit&&s.append("limit",e.limit.toString()),e.offset&&s.append("offset",e.offset.toString()),s.toString()&&(t+="?".concat(s.toString()))}return this.request(t)}async getJob(e){return this.request("/jobs/".concat(e))}async cancelJob(e){return this.request("/jobs/".concat(e,"/cancel"),{method:"POST"})}async deleteJob(e){return this.request("/jobs/".concat(e),{method:"DELETE"})}async getJobQueueStatus(){return this.request("/jobs/queue/status")}constructor(e){this.apiKey=null,this.baseURL=e}}let r=new i("http://localhost:6060/api"),o={tokenUsage:{getCurrent:()=>r.getTokenUsage(),getAvailable:e=>r.getAvailableTokens(e)},sessions:{getAll:()=>r.getSessions(),getById:(e,t,s)=>r.getSessionDetail(e,t,s)},costs:{getCurrentMonth:()=>r.getCurrentMonthCosts()},tasks:{getAll:()=>r.getTasks()},sync:{logs:()=>r.syncLogs()},predictions:{getP90:()=>r.getP90Predictions(),getP90ByProject:e=>r.getP90PredictionsByProject(e),getBurnRateHistory:e=>r.getBurnRateHistory(e)},initialization:{getStatus:()=>r.getInitializationStatus()},projects:{getAll:()=>r.getProjects(),getById:e=>r.getProject(e)},jobs:{create:e=>r.createJob(e),getAll:e=>r.getJobs(e),getById:e=>r.getJob(e),cancel:e=>r.cancelJob(e),delete:e=>r.deleteJob(e),getQueueStatus:()=>r.getJobQueueStatus()}}},2261:(e,t,s)=>{s.d(t,{s:()=>o});var a=s(2115),i=s(5695),r=s(154);function o(){let e=(0,i.useRouter)(),t=(0,i.useSearchParams)(),[s,o]=(0,a.useState)("ja");(0,a.useEffect)(()=>{let e=null==t?void 0:t.get("locale");"en"===e||"ja"===e?o(e):o((0,r.rI)())},[t]);let n=(0,a.useCallback)(e=>(0,r.sC)(s,e),[s]),c=(0,a.useCallback)(t=>{o(t),localStorage.setItem("ccdash-language",t);let s=new URL(window.location.href);"ja"===t?s.searchParams.delete("locale"):s.searchParams.set("locale",t),e.push(s.pathname+s.search)},[e]),u=(0,a.useCallback)(e=>(0,r.r6)(s,e),[s]),l=(0,a.useCallback)(e=>(0,r.YS)(s,e),[s]);return{language:s,t:n,changeLanguage:c,formatDate:u,formatFullDate:l}}},3999:(e,t,s)=>{s.d(t,{cn:()=>r});var a=s(2596),i=s(9688);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,i.QP)((0,a.$)(t))}},5157:(e,t,s)=>{s.d(t,{AuthGuard:()=>n});var a=s(5155),i=s(2115),r=s(1886),o=s(1741);function n(e){let{children:t,fallback:s}=e,[n,c]=(0,i.useState)(!1),[u,l]=(0,i.useState)(!0);return((0,i.useEffect)(()=>{(async()=>{try{r.u.hasApiKey()?(await r.u.getTokenUsage(),c(!0)):c(!1)}catch(e){r.u.clearApiKey(),c(!1)}finally{l(!1)}})()},[]),u)?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto mb-4"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"認証状態を確認中..."})]})}):n?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-gray-50",children:(0,a.jsx)("div",{className:"w-full max-w-md px-4",children:s||(0,a.jsx)(o.ApiKeyAuth,{onAuthStateChange:e=>{c(e)}})})})}},7168:(e,t,s)=>{s.d(t,{$:()=>u,r:()=>c});var a=s(5155),i=s(2115),r=s(9708),o=s(2085),n=s(3999);let c=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),u=i.forwardRef((e,t)=>{let{className:s,variant:i,size:o,asChild:u=!1,...l}=e,d=u?r.DX:"button";return(0,a.jsx)(d,{className:(0,n.cn)(c({variant:i,size:o,className:s})),ref:t,...l})});u.displayName="Button"},8145:(e,t,s)=>{s.d(t,{E:()=>n});var a=s(5155);s(2115);var i=s(2085),r=s(3999);let o=(0,i.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function n(e){let{className:t,variant:s,...i}=e;return(0,a.jsx)("div",{className:(0,r.cn)(o({variant:s}),t),...i})}},8482:(e,t,s)=>{s.d(t,{BT:()=>u,Wu:()=>l,ZB:()=>c,Zp:()=>o,aR:()=>n});var a=s(5155),i=s(2115),r=s(3999);let o=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...i})});o.displayName="Card";let n=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex flex-col space-y-1.5 p-6",s),...i})});n.displayName="CardHeader";let c=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-2xl font-semibold leading-none tracking-tight",s),...i})});c.displayName="CardTitle";let u=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-sm text-muted-foreground",s),...i})});u.displayName="CardDescription";let l=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("p-6 pt-0",s),...i})});l.displayName="CardContent",i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex items-center p-6 pt-0",s),...i})}).displayName="CardFooter"},9026:(e,t,s)=>{s.d(t,{Fc:()=>c,TN:()=>u});var a=s(5155),i=s(2115),r=s(2085),o=s(3999);let n=(0,r.F)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),c=i.forwardRef((e,t)=>{let{className:s,variant:i,...r}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:(0,o.cn)(n({variant:i}),s),...r})});c.displayName="Alert",i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("h5",{ref:t,className:(0,o.cn)("mb-1 font-medium leading-none tracking-tight",s),...i})}).displayName="AlertTitle";let u=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,o.cn)("text-sm [&_p]:leading-relaxed",s),...i})});u.displayName="AlertDescription"},9852:(e,t,s)=>{s.d(t,{p:()=>o});var a=s(5155),i=s(2115),r=s(3999);let o=i.forwardRef((e,t)=>{let{className:s,type:i,...o}=e;return(0,a.jsx)("input",{type:i,className:(0,r.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...o})});o.displayName="Input"}}]);