@cartanova/qgrid-cli 2.10.9 → 2.10.10

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.
Files changed (49) hide show
  1. package/bundle/dist/application/qgrid/qgrid-response-format.js +2 -2
  2. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +4 -2
  3. package/bundle/dist/application/request-log/request-log.model.js +2 -1
  4. package/bundle/dist/application/request-log/request-log.types.js +8 -2
  5. package/bundle/dist/application/sonamu.generated.js +9 -1
  6. package/bundle/dist/application/sonamu.generated.sso.js +2 -1
  7. package/bundle/dist/i18n/sd.generated.js +2 -1
  8. package/bundle/dist/migrations/20261018215031_alter_request_logs_add1_alter1.js +15 -0
  9. package/bundle/src/application/qgrid/qgrid-response-format.ts +1 -1
  10. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +14 -0
  11. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +3 -0
  12. package/bundle/src/application/request-log/request-log.entity.json +8 -0
  13. package/bundle/src/application/request-log/request-log.model.ts +3 -0
  14. package/bundle/src/application/request-log/request-log.types.ts +11 -0
  15. package/bundle/src/application/sonamu.generated.http +2 -0
  16. package/bundle/src/application/sonamu.generated.sso.ts +1 -0
  17. package/bundle/src/application/sonamu.generated.ts +14 -0
  18. package/bundle/src/i18n/sd.generated.ts +1 -0
  19. package/bundle/src/migrations/20261018215031_alter_request_logs_add1_alter1.ts +15 -0
  20. package/bundle/web-dist/client/assets/{index-CrXKu_J8.js → index-DZwzUfI-.js} +4 -4
  21. package/bundle/web-dist/client/assets/{logs-B2SmWJXA.js → logs-Cog79DU5.js} +1 -1
  22. package/bundle/web-dist/client/assets/{monit-D-JwXXoA.js → monit-2auznBys.js} +1 -1
  23. package/bundle/web-dist/client/assets/{routes-C5r4gTvY.js → routes-B0lTeLK-.js} +1 -1
  24. package/bundle/web-dist/client/assets/{services.generated-BsieU37H.js → services.generated-NP-ValHd.js} +1 -1
  25. package/bundle/web-dist/client/assets/{settings-D3tDSAck.js → settings-D8ZxZGSJ.js} +1 -1
  26. package/bundle/web-dist/client/assets/{show-Cah_kUKC.js → show-CFSERlnM.js} +2 -2
  27. package/bundle/web-dist/client/assets/{tokens-DU2Iyxxd.js → tokens-CZXUyI7O.js} +1 -1
  28. package/bundle/web-dist/client/assets/{use-oauth-login-flow-D0UaR9_e.js → use-oauth-login-flow-hboOs3wG.js} +1 -1
  29. package/bundle/web-dist/client/assets/{use-update-token-mutation-DAq0F8p-.js → use-update-token-mutation-BQHS0byG.js} +1 -1
  30. package/bundle/web-dist/client/index.html +2 -2
  31. package/bundle/web-dist/server/assets/{lazyRouteComponent-Dtd0NR4r.js → lazyRouteComponent-CgBdabgd.js} +2 -2
  32. package/bundle/web-dist/server/assets/{logs-l91avYif.js → logs-BMyR98rU.js} +4 -4
  33. package/bundle/web-dist/server/assets/{monit-DvzribSE.js → monit-ZPt66W5M.js} +3 -3
  34. package/bundle/web-dist/server/assets/{plus-KZrECewT.js → plus-BZ9I0VgC.js} +1 -1
  35. package/bundle/web-dist/server/assets/{react-dom-B4a6-uuR.js → react-dom-Ds75e4Jl.js} +1 -1
  36. package/bundle/web-dist/server/assets/{refresh-cw-BND93JrF.js → refresh-cw-CztCFis-.js} +1 -1
  37. package/bundle/web-dist/server/assets/{request-model-CbqfnQOJ.js → request-model-DjGldb-h.js} +1 -1
  38. package/bundle/web-dist/server/assets/{routes-BAPWTizT.js → routes-Ct-k7nBA.js} +4 -4
  39. package/bundle/web-dist/server/assets/{services.generated-CEbGjsI0.js → services.generated-BA4AcAf5.js} +1 -0
  40. package/bundle/web-dist/server/assets/{settings-BZR5HSAL.js → settings-CBUZ47Xx.js} +3 -3
  41. package/bundle/web-dist/server/assets/{show-CxVZTAdv.js → show-LSFIzvO2.js} +11 -7
  42. package/bundle/web-dist/server/assets/{tokens-D1hb4eKk.js → tokens-DxrBW512.js} +4 -4
  43. package/bundle/web-dist/server/assets/{use-oauth-login-flow-Cvdy0zF8.js → use-oauth-login-flow-Gn8flMK5.js} +1 -1
  44. package/bundle/web-dist/server/assets/{use-update-token-mutation-CfYmk_4_.js → use-update-token-mutation-pkArIzCP.js} +1 -1
  45. package/bundle/web-dist/server/entry-server.generated.js +18 -10
  46. package/package.json +1 -1
  47. package/skills/qgrid/references/decision-rationale.md +1 -1
  48. package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
  49. package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{a as i,o as a}from"./services.generated-BsieU37H.js";import{l as o}from"./index-CrXKu_J8.js";import{t as s}from"./use-update-token-mutation-DAq0F8p-.js";import{t as c}from"./plus-B62CuqT8.js";var l=e(n()),u=r(),d=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0`}),(0,u.jsx)(`circle`,{cx:12,cy:12,r:3})]})}),f=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242`}),(0,u.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20`})]})}),p=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14`})}),m={qgrid:`Qgrid`,slack:`Slack 알림`,slackConnection:`Slack 연결`};function h(e){return e?e.length<=12?`•`.repeat(e.length):`${e.slice(0,8)}${`•`.repeat(12)}${e.slice(-4)}`:``}function g({value:e,min:t,max:n,step:r,disabled:i,onChange:a}){let o=Number(e),s=Number.isFinite(o),l=t??-1/0,d=n??1/0,f=e=>{let n=Math.min(Math.max((s?o:t??0)+e,l),d);a(String(Number(n.toFixed(2))))};return(0,u.jsxs)(`div`,{className:`inline-flex items-center rounded-lg border border-sand-200/80 bg-white overflow-hidden`,children:[(0,u.jsx)(`button`,{type:`button`,"aria-label":`감소`,onClick:()=>f(-r),disabled:i||s&&o<=l,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(p,{className:`size-3`})}),(0,u.jsx)(`input`,{value:e,onChange:e=>a(e.target.value),disabled:i,inputMode:`decimal`,className:`w-12 text-center text-[12px] tabular-nums text-sand-800 bg-transparent border-x border-sand-200/80 py-1 focus:outline-none focus:bg-sand-50`}),(0,u.jsx)(`button`,{type:`button`,"aria-label":`증가`,onClick:()=>f(r),disabled:i||s&&o>=d,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(c,{className:`size-3`})})]})}function _({value:e,presets:t,disabled:n,onChange:r}){let i=Number(e);return(0,u.jsx)(`div`,{className:`segmented-control inline-flex`,children:t.map(e=>(0,u.jsx)(`button`,{type:`button`,disabled:n,"data-active":i===e,onClick:()=>r(String(e)),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium tabular-nums text-sand-500 transition-colors hover:text-sand-800 disabled:opacity-50 data-[active=true]:text-sand-900`,children:e>=60?`${e/60}시간`:`${e}분`},e))})}function v({source:e}){return(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded ${e===`db`?`bg-sienna-50 text-sienna-600`:`bg-sand-100 text-sand-500`}`,children:e===`db`?`저장값`:e===`env`?`환경변수`:`기본값`})}function y({on:e,disabled:t,onChange:n}){return(0,u.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:t,onClick:()=>n(!e),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 disabled:opacity-50 ${e?`bg-sage-400`:`bg-sand-300`}`,children:(0,u.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e?`translate-x-4.5`:`translate-x-0.5`}`})})}function b({item:e,disabled:n=!1}){let[r,a]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),b=t(),x=i.useUpdateSettingMutation(),S=i.useResetSettingMutation(),C=n||x.isPending||S.isPending,w=r??e.value,T=r!==null&&r!==e.value,E=()=>b.invalidateQueries({queryKey:i.getSettingListQueryOptions().queryKey}),D=async t=>{m(null);try{await x.mutateAsync({key:e.key,value:t}),await E(),a(null)}catch(e){m(e.message)}},O=async()=>{m(null);try{await S.mutateAsync({key:e.key}),await E(),a(null)}catch(e){m(e.message)}},k=e.kind===`secret`;return(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[13px] text-sand-800`,children:e.label}),(0,u.jsx)(v,{source:e.source}),e.applies===`restart`&&(0,u.jsx)(`span`,{className:`text-[10px] text-caution-500`,title:`저장해도 다음 재시작부터 반영됩니다`,children:`재시작 필요`})]}),e.help&&(0,u.jsx)(`p`,{className:`mt-0.5 text-[11px] text-sand-500`,children:e.help})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.kind===`boolean`&&(0,u.jsx)(y,{on:w===`true`,disabled:C,onChange:e=>void D(String(e))}),e.kind===`preset`&&(0,u.jsx)(_,{value:w,presets:e.presets,disabled:C,onChange:e=>void D(e)}),(e.kind===`integer`||e.kind===`number`)&&(0,u.jsx)(g,{value:w,min:e.min,max:e.max,step:e.kind===`integer`?1:.5,disabled:C,onChange:a}),(e.kind===`string`||k)&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`input`,{value:k&&!s?h(w):w,onChange:e=>a(e.target.value),onFocus:()=>k&&c(!0),disabled:C,className:`w-48 sm:w-64 rounded-lg border border-sand-200/80 bg-white py-1.5 pl-2.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 ${k?`pr-8 font-mono`:`pr-2.5`}`}),k&&(0,u.jsx)(`button`,{type:`button`,"aria-label":s?`값 숨기기`:`값 보기`,onClick:()=>c(e=>!e),className:`absolute right-1.5 top-1/2 -translate-y-1/2 size-6 grid place-items-center text-sand-400 hover:text-sand-600 transition-colors duration-150`,children:s?(0,u.jsx)(f,{className:`size-3.5`}):(0,u.jsx)(d,{className:`size-3.5`})})]}),T&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>void D(w),disabled:C,className:`px-2.5 py-1.5 text-[11px] font-medium rounded-lg bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,children:x.isPending?`저장 중`:`저장`}),!T&&e.source===`db`&&(0,u.jsx)(`button`,{type:`button`,title:`저장값을 지웁니다 — 환경변수 또는 기본값으로 돌아갑니다`,onClick:()=>void O(),disabled:C,className:`size-7 grid place-items-center rounded-lg text-sand-400 hover:text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:(0,u.jsx)(o,{className:`size-3.5`})})]})]}),p&&(0,u.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p})]})}function x({runnerEnabled:e}){let n=t(),[r,i]=(0,l.useState)(null),o=a.useTokens(`A`,{orderBy:`ord-asc`,num:100}),c=s(),d=(o.data?.rows??[]).filter(e=>e.provider===`anthropic`),f=async(e,t)=>{i(null);try{await c.mutateAsync({id:e,keepaliveEnabled:t}),await n.invalidateQueries({queryKey:[`Token`,`getTokens`]})}catch(e){i(e.message)}};return(0,u.jsxs)(`div`,{className:`border-t border-sand-100/80 bg-sand-50/40 px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-medium text-sand-600`,children:`토큰별 keepalive`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[10px] text-sand-400`,children:e?`켜진 활성 Anthropic 토큰만 5시간 윈도우를 유지합니다`:`이 인스턴스는 keepalive runner로 지정되지 않았습니다`})]}),(0,u.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] ${e?`bg-sage-50 text-sage-600`:`bg-sand-100 text-sand-500`}`,children:e?`runner`:`실행 안 함`})]}),o.isLoading?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`토큰을 불러오는 중…`}):d.length===0?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`등록된 Anthropic 토큰이 없습니다`}):(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-sand-200/70 bg-white`,children:d.map(t=>(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b border-sand-100/80 px-3 py-2 last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`span`,{className:`block truncate text-[12px] text-sand-700`,children:t.name}),!t.active&&(0,u.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`토큰 비활성`})]}),(0,u.jsx)(y,{on:t.keepalive_enabled,disabled:!e||c.isPending,onChange:e=>void f(t.id,e)})]},t.id))}),r&&(0,u.jsx)(`p`,{className:`mt-2 text-[11px] text-red-500`,children:r})]})}function S(){let[e,t]=(0,l.useState)(null),n=i.useTriggerExpiryReminderMutation(),r=async()=>{t(null);try{let{sent:e}=await n.mutateAsync();t(e===0?`재로그인이 필요한 토큰이 없습니다`:`${e}건 발송`)}catch(e){t(e.message)}};return(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e&&(0,u.jsx)(`span`,{className:`text-[11px] text-sand-500`,children:e}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:n.isPending,className:`px-2 py-1 text-[11px] rounded-lg border border-sand-200/80 text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:n.isPending?`보내는 중`:`지금 보내기`})]})}function C(){let e=i.useSettingList(),{data:t,isLoading:n}=e;if(n)return(0,u.jsx)(`div`,{className:`space-y-4`,children:[0,1].map(e=>(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsx)(`div`,{className:`panel-header px-4 py-2.5 sm:px-5`,children:(0,u.jsx)(`div`,{className:`h-3 w-24 rounded bg-sand-200 animate-pulse`})}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:[0,1,2].map(e=>(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5 flex items-center justify-between gap-4`,children:[(0,u.jsx)(`div`,{className:`h-3 w-40 rounded bg-sand-100 animate-pulse`}),(0,u.jsx)(`div`,{className:`h-7 w-24 rounded-lg bg-sand-100 animate-pulse`})]},e))})]},e))});if(e.isError&&!t)return(0,u.jsxs)(`div`,{className:`panel px-5 py-6 text-center`,children:[(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-sand-800`,children:`설정을 불러오지 못했습니다`}),(0,u.jsx)(`p`,{className:`mt-1 text-[11px] text-red-500`,children:e.error.message}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void e.refetch(),disabled:e.isFetching,className:`mt-3 px-3 py-1.5 text-[12px] rounded-lg border border-sand-200 text-sand-600 hover:bg-sand-100 disabled:opacity-50`,children:e.isFetching?`다시 불러오는 중`:`다시 시도`})]});let r=t?.settings??[],a=t?.runtime??[],o=[...new Set(r.map(e=>e.group))];return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`환경`}),(0,u.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`기동 시점 값`})]}),(0,u.jsx)(`dl`,{className:`px-4 py-3 sm:px-5 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5`,children:a.map(e=>(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 min-w-0`,children:[(0,u.jsx)(`dt`,{className:`text-[11px] text-sand-500 shrink-0`,children:e.label}),(0,u.jsx)(`dd`,{className:`text-[12px] font-mono text-sand-700 truncate`,children:e.value})]},e.label))})]}),o.map(e=>{let n=r.filter(t=>t.group===e);return(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:m[e]??e}),e===`slack`&&(0,u.jsx)(S,{})]}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:n.map(e=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(b,{item:e,disabled:e.key===`qgrid.tokenWindowKeepaliveEnabled`&&!t?.keepaliveRunnerEnabled}),e.key===`qgrid.tokenWindowKeepaliveEnabled`&&(0,u.jsx)(x,{runnerEnabled:t?.keepaliveRunnerEnabled??!1})]},e.key))})]},e)})]})}function w(){return(0,u.jsx)(`div`,{className:`max-w-4xl mx-auto`,children:(0,u.jsx)(C,{})})}export{w as component};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{a as i,o as a}from"./services.generated-NP-ValHd.js";import{l as o}from"./index-DZwzUfI-.js";import{t as s}from"./use-update-token-mutation-BQHS0byG.js";import{t as c}from"./plus-B62CuqT8.js";var l=e(n()),u=r(),d=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0`}),(0,u.jsx)(`circle`,{cx:12,cy:12,r:3})]})}),f=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242`}),(0,u.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20`})]})}),p=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14`})}),m={qgrid:`Qgrid`,slack:`Slack 알림`,slackConnection:`Slack 연결`};function h(e){return e?e.length<=12?`•`.repeat(e.length):`${e.slice(0,8)}${`•`.repeat(12)}${e.slice(-4)}`:``}function g({value:e,min:t,max:n,step:r,disabled:i,onChange:a}){let o=Number(e),s=Number.isFinite(o),l=t??-1/0,d=n??1/0,f=e=>{let n=Math.min(Math.max((s?o:t??0)+e,l),d);a(String(Number(n.toFixed(2))))};return(0,u.jsxs)(`div`,{className:`inline-flex items-center rounded-lg border border-sand-200/80 bg-white overflow-hidden`,children:[(0,u.jsx)(`button`,{type:`button`,"aria-label":`감소`,onClick:()=>f(-r),disabled:i||s&&o<=l,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(p,{className:`size-3`})}),(0,u.jsx)(`input`,{value:e,onChange:e=>a(e.target.value),disabled:i,inputMode:`decimal`,className:`w-12 text-center text-[12px] tabular-nums text-sand-800 bg-transparent border-x border-sand-200/80 py-1 focus:outline-none focus:bg-sand-50`}),(0,u.jsx)(`button`,{type:`button`,"aria-label":`증가`,onClick:()=>f(r),disabled:i||s&&o>=d,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(c,{className:`size-3`})})]})}function _({value:e,presets:t,disabled:n,onChange:r}){let i=Number(e);return(0,u.jsx)(`div`,{className:`segmented-control inline-flex`,children:t.map(e=>(0,u.jsx)(`button`,{type:`button`,disabled:n,"data-active":i===e,onClick:()=>r(String(e)),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium tabular-nums text-sand-500 transition-colors hover:text-sand-800 disabled:opacity-50 data-[active=true]:text-sand-900`,children:e>=60?`${e/60}시간`:`${e}분`},e))})}function v({source:e}){return(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded ${e===`db`?`bg-sienna-50 text-sienna-600`:`bg-sand-100 text-sand-500`}`,children:e===`db`?`저장값`:e===`env`?`환경변수`:`기본값`})}function y({on:e,disabled:t,onChange:n}){return(0,u.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:t,onClick:()=>n(!e),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 disabled:opacity-50 ${e?`bg-sage-400`:`bg-sand-300`}`,children:(0,u.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e?`translate-x-4.5`:`translate-x-0.5`}`})})}function b({item:e,disabled:n=!1}){let[r,a]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),b=t(),x=i.useUpdateSettingMutation(),S=i.useResetSettingMutation(),C=n||x.isPending||S.isPending,w=r??e.value,T=r!==null&&r!==e.value,E=()=>b.invalidateQueries({queryKey:i.getSettingListQueryOptions().queryKey}),D=async t=>{m(null);try{await x.mutateAsync({key:e.key,value:t}),await E(),a(null)}catch(e){m(e.message)}},O=async()=>{m(null);try{await S.mutateAsync({key:e.key}),await E(),a(null)}catch(e){m(e.message)}},k=e.kind===`secret`;return(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[13px] text-sand-800`,children:e.label}),(0,u.jsx)(v,{source:e.source}),e.applies===`restart`&&(0,u.jsx)(`span`,{className:`text-[10px] text-caution-500`,title:`저장해도 다음 재시작부터 반영됩니다`,children:`재시작 필요`})]}),e.help&&(0,u.jsx)(`p`,{className:`mt-0.5 text-[11px] text-sand-500`,children:e.help})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.kind===`boolean`&&(0,u.jsx)(y,{on:w===`true`,disabled:C,onChange:e=>void D(String(e))}),e.kind===`preset`&&(0,u.jsx)(_,{value:w,presets:e.presets,disabled:C,onChange:e=>void D(e)}),(e.kind===`integer`||e.kind===`number`)&&(0,u.jsx)(g,{value:w,min:e.min,max:e.max,step:e.kind===`integer`?1:.5,disabled:C,onChange:a}),(e.kind===`string`||k)&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`input`,{value:k&&!s?h(w):w,onChange:e=>a(e.target.value),onFocus:()=>k&&c(!0),disabled:C,className:`w-48 sm:w-64 rounded-lg border border-sand-200/80 bg-white py-1.5 pl-2.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 ${k?`pr-8 font-mono`:`pr-2.5`}`}),k&&(0,u.jsx)(`button`,{type:`button`,"aria-label":s?`값 숨기기`:`값 보기`,onClick:()=>c(e=>!e),className:`absolute right-1.5 top-1/2 -translate-y-1/2 size-6 grid place-items-center text-sand-400 hover:text-sand-600 transition-colors duration-150`,children:s?(0,u.jsx)(f,{className:`size-3.5`}):(0,u.jsx)(d,{className:`size-3.5`})})]}),T&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>void D(w),disabled:C,className:`px-2.5 py-1.5 text-[11px] font-medium rounded-lg bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,children:x.isPending?`저장 중`:`저장`}),!T&&e.source===`db`&&(0,u.jsx)(`button`,{type:`button`,title:`저장값을 지웁니다 — 환경변수 또는 기본값으로 돌아갑니다`,onClick:()=>void O(),disabled:C,className:`size-7 grid place-items-center rounded-lg text-sand-400 hover:text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:(0,u.jsx)(o,{className:`size-3.5`})})]})]}),p&&(0,u.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p})]})}function x({runnerEnabled:e}){let n=t(),[r,i]=(0,l.useState)(null),o=a.useTokens(`A`,{orderBy:`ord-asc`,num:100}),c=s(),d=(o.data?.rows??[]).filter(e=>e.provider===`anthropic`),f=async(e,t)=>{i(null);try{await c.mutateAsync({id:e,keepaliveEnabled:t}),await n.invalidateQueries({queryKey:[`Token`,`getTokens`]})}catch(e){i(e.message)}};return(0,u.jsxs)(`div`,{className:`border-t border-sand-100/80 bg-sand-50/40 px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-medium text-sand-600`,children:`토큰별 keepalive`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[10px] text-sand-400`,children:e?`켜진 활성 Anthropic 토큰만 5시간 윈도우를 유지합니다`:`이 인스턴스는 keepalive runner로 지정되지 않았습니다`})]}),(0,u.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] ${e?`bg-sage-50 text-sage-600`:`bg-sand-100 text-sand-500`}`,children:e?`runner`:`실행 안 함`})]}),o.isLoading?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`토큰을 불러오는 중…`}):d.length===0?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`등록된 Anthropic 토큰이 없습니다`}):(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-sand-200/70 bg-white`,children:d.map(t=>(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b border-sand-100/80 px-3 py-2 last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`span`,{className:`block truncate text-[12px] text-sand-700`,children:t.name}),!t.active&&(0,u.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`토큰 비활성`})]}),(0,u.jsx)(y,{on:t.keepalive_enabled,disabled:!e||c.isPending,onChange:e=>void f(t.id,e)})]},t.id))}),r&&(0,u.jsx)(`p`,{className:`mt-2 text-[11px] text-red-500`,children:r})]})}function S(){let[e,t]=(0,l.useState)(null),n=i.useTriggerExpiryReminderMutation(),r=async()=>{t(null);try{let{sent:e}=await n.mutateAsync();t(e===0?`재로그인이 필요한 토큰이 없습니다`:`${e}건 발송`)}catch(e){t(e.message)}};return(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e&&(0,u.jsx)(`span`,{className:`text-[11px] text-sand-500`,children:e}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:n.isPending,className:`px-2 py-1 text-[11px] rounded-lg border border-sand-200/80 text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:n.isPending?`보내는 중`:`지금 보내기`})]})}function C(){let e=i.useSettingList(),{data:t,isLoading:n}=e;if(n)return(0,u.jsx)(`div`,{className:`space-y-4`,children:[0,1].map(e=>(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsx)(`div`,{className:`panel-header px-4 py-2.5 sm:px-5`,children:(0,u.jsx)(`div`,{className:`h-3 w-24 rounded bg-sand-200 animate-pulse`})}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:[0,1,2].map(e=>(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5 flex items-center justify-between gap-4`,children:[(0,u.jsx)(`div`,{className:`h-3 w-40 rounded bg-sand-100 animate-pulse`}),(0,u.jsx)(`div`,{className:`h-7 w-24 rounded-lg bg-sand-100 animate-pulse`})]},e))})]},e))});if(e.isError&&!t)return(0,u.jsxs)(`div`,{className:`panel px-5 py-6 text-center`,children:[(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-sand-800`,children:`설정을 불러오지 못했습니다`}),(0,u.jsx)(`p`,{className:`mt-1 text-[11px] text-red-500`,children:e.error.message}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void e.refetch(),disabled:e.isFetching,className:`mt-3 px-3 py-1.5 text-[12px] rounded-lg border border-sand-200 text-sand-600 hover:bg-sand-100 disabled:opacity-50`,children:e.isFetching?`다시 불러오는 중`:`다시 시도`})]});let r=t?.settings??[],a=t?.runtime??[],o=[...new Set(r.map(e=>e.group))];return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`환경`}),(0,u.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`기동 시점 값`})]}),(0,u.jsx)(`dl`,{className:`px-4 py-3 sm:px-5 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5`,children:a.map(e=>(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 min-w-0`,children:[(0,u.jsx)(`dt`,{className:`text-[11px] text-sand-500 shrink-0`,children:e.label}),(0,u.jsx)(`dd`,{className:`text-[12px] font-mono text-sand-700 truncate`,children:e.value})]},e.label))})]}),o.map(e=>{let n=r.filter(t=>t.group===e);return(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:m[e]??e}),e===`slack`&&(0,u.jsx)(S,{})]}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:n.map(e=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(b,{item:e,disabled:e.key===`qgrid.tokenWindowKeepaliveEnabled`&&!t?.keepaliveRunnerEnabled}),e.key===`qgrid.tokenWindowKeepaliveEnabled`&&(0,u.jsx)(x,{runnerEnabled:t?.keepaliveRunnerEnabled??!1})]},e.key))})]},e)})]})}function w(){return(0,u.jsx)(`div`,{className:`max-w-4xl mx-auto`,children:(0,u.jsx)(C,{})})}export{w as component};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,l as n}from"./vendor-tanstack-DJRQAbrY.js";import{i as r,r as i}from"./vendor-react-DH4kUfK2.js";import{i as a,r as o,u as s}from"./services.generated-BsieU37H.js";import{c,d as l,t as u,u as d}from"./index-CrXKu_J8.js";import{n as f,t as p}from"./cost-DH2jZbrw.js";import{n as m,t as h}from"./request-model-CojtinqK.js";function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(null,arguments)}function _(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var v=e(r()),y=i(),b={},x=(0,v.createContext)(b),S=(e,t)=>g({},e,t),C=()=>(0,v.useContext)(x),w=(0,v.createContext)(()=>{});w.displayName=`JVR.DispatchShowTools`;function T(){return(0,v.useReducer)(S,b)}function E(){return(0,v.useContext)(w)}var D=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(x.Provider,{value:t,children:(0,y.jsx)(w.Provider,{value:n,children:r})})};D.displayName=`JVR.ShowTools`;var ee={},te=(0,v.createContext)(ee),ne=(e,t)=>g({},e,t),O=()=>(0,v.useContext)(te),k=(0,v.createContext)(()=>{});k.displayName=`JVR.DispatchExpands`;function re(){return(0,v.useReducer)(ne,ee)}function ie(){return(0,v.useContext)(k)}var ae=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(te.Provider,{value:t,children:(0,y.jsx)(k.Provider,{value:n,children:r})})};ae.displayName=`JVR.Expands`;var oe={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},se=(0,v.createContext)(oe),ce=(e,t)=>g({},e,t),A=()=>(0,v.useContext)(se),le=(0,v.createContext)(()=>{});le.displayName=`JVR.DispatchTypes`;function ue(){return(0,v.useReducer)(ce,oe)}function de(){return(0,v.useContext)(le)}function fe(e){var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(se.Provider,{value:t,children:(0,y.jsx)(le.Provider,{value:n,children:r})})}fe.displayName=`JVR.Types`;var pe=[`style`];function me(e){var{style:t}=e,n=_(e,pe);return(0,y.jsx)(`svg`,g({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:g({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,y.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}me.displayName=`JVR.TriangleArrow`;var he={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,y.jsx)(me,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},ge=(0,v.createContext)(he),_e=(e,t)=>g({},e,t),j=()=>(0,v.useContext)(ge),M=(0,v.createContext)(()=>{});M.displayName=`JVR.DispatchSymbols`;function ve(){return(0,v.useReducer)(_e,he)}function ye(){return(0,v.useContext)(M)}var be=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(ge.Provider,{value:t,children:(0,y.jsx)(M.Provider,{value:n,children:r})})};be.displayName=`JVR.Symbols`;var xe={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Se=(0,v.createContext)(xe),Ce=(e,t)=>g({},e,t),N=()=>(0,v.useContext)(Se),P=(0,v.createContext)(()=>{});P.displayName=`JVR.DispatchSection`;function we(){return(0,v.useReducer)(Ce,xe)}function Te(){return(0,v.useContext)(P)}var Ee=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(Se.Provider,{value:t,children:(0,y.jsx)(P.Provider,{value:n,children:r})})};Ee.displayName=`JVR.Section`;var De={objectSortKeys:!1,indentWidth:15},F=(0,v.createContext)(De);F.displayName=`JVR.Context`;var Oe=(0,v.createContext)(()=>{});Oe.displayName=`JVR.DispatchContext`;function ke(e,t){return g({},e,t)}var I=()=>(0,v.useContext)(F),Ae=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,v.useReducer)(ke,Object.assign({},De,n)),[o,s]=T(),[c,l]=re(),[u,d]=ue(),[f,p]=ve(),[m,h]=we();return(0,v.useEffect)(()=>a(g({},n)),[n]),(0,y.jsx)(F.Provider,{value:i,children:(0,y.jsx)(Oe.Provider,{value:a,children:(0,y.jsx)(D,{initial:o,dispatch:s,children:(0,y.jsx)(ae,{initial:c,dispatch:l,children:(0,y.jsx)(fe,{initial:g({},u,r),dispatch:d,children:(0,y.jsx)(be,{initial:f,dispatch:p,children:(0,y.jsx)(Ee,{initial:m,dispatch:h,children:t})})})})})})})};Ae.displayName=`JVR.Provider`;function je(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Me=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Ne=[`as`,`render`],Pe=[`as`,`render`],Fe=[`as`,`render`],Ie=[`as`,`style`,`render`],Le=[`as`,`render`],Re=[`as`,`render`],ze=[`as`,`render`],Be=[`as`,`render`],Ve=e=>{var{Quote:t={}}=j(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=_(e,Me);if(n)return null;var{as:c,render:l}=t,u=_(t,Ne),d=c||`span`,f=g({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,y.jsx)(d,g({},f))};Ve.displayName=`JVR.Quote`;var L=e=>{var{ValueQuote:t={}}=j(),n=g({},(je(e),e)),{as:r,render:i}=t,a=_(t,Pe),o=r||`span`,s=g({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,y.jsx)(o,g({},s))};L.displayName=`JVR.ValueQuote`;var He=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=j(),{as:o,render:s}=a,c=_(a,Fe),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,y.jsx)(l,g({},c))};He.displayName=`JVR.Colon`;var Ue=e=>{var{Arrow:t={}}=j(),n=O(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=_(t,Ie),m=u||`span`,h=f&&typeof f==`function`,v=g({},p,{"data-expanded":l,style:g({},d,i)});return h&&f(v,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,y.jsx)(m,g({},p,{style:g({},d,i)}))};Ue.displayName=`JVR.Arrow`;var We=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=j(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=_(o,Le),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,y.jsx)(f,g({},d))}var{as:p,render:m}=s,h=_(s,Re),v=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,y.jsx)(v,g({},h))};We.displayName=`JVR.BracketsOpen`;var Ge=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=j();if(t){var{as:u,render:d}=c,f=_(c,ze),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,y.jsx)(p,g({},f))}var{as:m,render:h}=l,v=_(l,Be),b=m||`span`;return h&&typeof h==`function`&&h(v,s)||(0,y.jsx)(b,g({},v))};Ge.displayName=`JVR.BracketsClose`;var Ke=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=O(),{collapsed:c,shouldExpandNodeInitially:l}=I(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},_=Array.isArray(n),v=n instanceof Set;return(0,y.jsx)(`div`,{style:m,children:(0,y.jsx)(Ge,g({isBrackets:_||v},h,{isVisiable:!0}))})};Ke.displayName=`JVR.NestedClose`;var qe=[`as`,`render`],Je=[`as`,`render`],Ye=[`as`,`render`],Xe=[`as`,`render`],Ze=[`as`,`render`],Qe=[`as`,`render`],$e=[`as`,`render`],et=[`as`,`render`],tt=[`as`,`render`],nt=[`as`,`render`],rt=[`as`,`render`],it=[`as`,`render`],at=[`as`,`render`],ot=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},st=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=A();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=_(r,qe);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,y.jsx)(a||`span`,g({},s))};st.displayName=`JVR.SetComp`;var ct=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=A();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=_(r,Je);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,y.jsx)(a||`span`,g({},s))};ct.displayName=`JVR.MapComp`;var R={opacity:.75,paddingRight:4},lt=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=A(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=I(),{as:c,render:l}=i,u=_(i,Ye),d=t,[f,p]=(0,v.useState)(o&&d.length>o);(0,v.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=g({},R,i.style||{});o>0&&(u.style=g({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var b=f?``+d.slice(0,o)+s:d,x=l&&typeof l==`function`,S=x&&l(g({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),C=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,w=x&&l(g({},u,{children:b,className:C}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(S||(0,y.jsx)(m,g({},u,{style:h}))),w||(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(L,{}),(0,y.jsx)(m,g({},u,{className:C,children:b})),(0,y.jsx)(L,{})]})]})};lt.displayName=`JVR.TypeString`;var ut=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Xe),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ut.displayName=`JVR.TypeTrue`;var dt=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Ze),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};dt.displayName=`JVR.TypeFalse`;var ft=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Qe),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ft.displayName=`JVR.TypeFloat`;var pt=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,$e),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};pt.displayName=`JVR.TypeInt`;var mt=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,et),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:ot(t?.toString())}))]})};mt.displayName=`JVR.TypeFloat`;var ht=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,tt),l=o||`span`,u=g({},R,i.style),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsxs)(`a`,g({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,y.jsx)(L,{}),t?.href,(0,y.jsx)(L,{})]}))]})};ht.displayName=`JVR.TypeUrl`;var gt=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,nt),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(g({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),m||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:p}))]})};gt.displayName=`JVR.TypeDate`;var _t=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,rt),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};_t.displayName=`JVR.TypeUndefined`;var vt=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,it),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};vt.displayName=`JVR.TypeNull`;var yt=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,at),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};yt.displayName=`JVR.TypeNan`;var bt=e=>Number(e)===e&&e%1!=0||isNaN(e),xt=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,y.jsx)(ht,g({},i,{children:t})):typeof t==`string`?(0,y.jsx)(lt,g({},i,{children:t})):t===!0?(0,y.jsx)(ut,g({},i,{children:t})):t===!1?(0,y.jsx)(dt,g({},i,{children:t})):t===null?(0,y.jsx)(vt,g({},i,{children:t})):t===void 0?(0,y.jsx)(_t,g({},i,{children:t})):t instanceof Date?(0,y.jsx)(gt,g({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,y.jsx)(yt,g({},i,{children:t})):typeof t==`number`&&bt(t)?(0,y.jsx)(ft,g({},i,{children:t})):typeof t==`bigint`?(0,y.jsx)(mt,g({},i,{children:t})):typeof t==`number`?(0,y.jsx)(pt,g({},i,{children:t})):null};xt.displayName=`JVR.Value`;function z(e,t,n){var r=ye(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}function B(e,t,n){var r=de(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}function V(e,t,n){var r=Te(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}var St=[`as`,`render`],Ct=e=>{var{KeyName:t={}}=N();return V(t,e,`KeyName`),null};Ct.displayName=`JVR.KeyName`;var wt=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=N(),{as:c,render:l}=s,u=_(s,St);u.style=g({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(g({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,y.jsx)(d,g({},u,{children:t}))};wt.displayName=`JVR.KeyNameComp`;var Tt=[`children`,`value`,`parentValue`,`keyName`,`keys`],Et=[`as`,`render`,`children`],Dt=e=>{var{Row:t={}}=N();return V(t,e,`Row`),null};Dt.displayName=`JVR.Row`;var Ot=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=_(e,Tt),{Row:s={}}=N(),{as:c,render:l}=s,u=_(s,Et),d=c||`div`;return l&&typeof l==`function`&&l(g({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,y.jsx)(d,g({},o,u,{children:t}))};Ot.displayName=`JVR.RowComp`;function kt(e){var t=(0,v.useRef)();return(0,v.useEffect)(()=>{t.current=e}),t.current}function At(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=kt(t),a=(0,v.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,v.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var jt=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],Mt=[`as`,`render`],H=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=_(e,jt),{onCopied:c,enableClipboard:l,beforeCopy:u}=I(),d=C()[i],[f,p]=(0,v.useState)(!1),{Copied:m={}}=N(),h=m?.beforeCopy;if(l===!1||!d)return null;var b={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?ot(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?ot(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:x}=m,S=_(m,Mt),w=g({},S,s,b,{style:g({},S.style,s.style,b.style)});return x&&typeof x==`function`&&x(g({},w,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,y.jsx)(`svg`,g({viewBox:`0 0 32 36`},w,{children:(0,y.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,y.jsx)(`svg`,g({viewBox:`0 0 32 36`},w,{children:(0,y.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};H.displayName=`JVR.Copied`;function Nt(){var e=(0,v.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Pt=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=O(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=I(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,y.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,y.jsx)(Ft,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Pt.displayName=`JVR.KeyValues`;var U=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=I(),o=typeof t==`number`,s=(0,v.useRef)(null);At({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsxs)(`span`,{ref:s,children:[(0,y.jsx)(Ve,g({isNumber:o,"data-placement":`left`},c)),(0,y.jsx)(wt,g({},c,{children:t})),(0,y.jsx)(Ve,g({isNumber:o,"data-placement":`right`},c))]}),(0,y.jsx)(He,g({},c))]})};U.displayName=`JVR.KayName`;var Ft=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=E(),s=Nt(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,y.jsx)(W,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,y.jsxs)(Ot,g({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,y.jsx)(U,{keyName:t,value:n,keys:a,parentValue:r}),(0,y.jsx)(xt,{keyName:t,value:n,keys:a}),(0,y.jsx)(H,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Ft.displayName=`JVR.KeyValuesItem`;var It=[`value`,`keyName`],Lt=[`as`,`render`],Rt=e=>{var{CountInfoExtra:t={}}=N();return V(t,e,`CountInfoExtra`),null};Rt.displayName=`JVR.CountInfoExtra`;var zt=e=>{var{value:t={},keyName:n}=e,r=_(e,It),{CountInfoExtra:i={}}=N(),{as:a,render:o}=i,s=_(i,Lt);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=g({},s,r);return l&&o(u,{value:t,keyName:n})||(0,y.jsx)(c,g({},u))};zt.displayName=`JVR.CountInfoExtraComps`;var Bt=[`value`,`keyName`],Vt=[`as`,`render`],Ht=e=>{var{CountInfo:t={}}=N();return V(t,e,`CountInfo`),null};Ht.displayName=`JVR.CountInfo`;var Ut=e=>{var{value:t={},keyName:n}=e,r=_(e,Bt),{displayObjectSize:i}=I(),{CountInfo:a={}}=N();if(!i)return null;var{as:o,render:s}=a,c=_(a,Vt),l=o||`span`;c.style=g({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=g({},c,r);return s&&typeof s==`function`&&s(g({},d,{"data-length":u}),{value:t,keyName:n})||(0,y.jsx)(l,g({},d))};Ut.displayName=`JVR.CountInfoComp`;var Wt=[`as`,`render`],Gt=e=>{var{Ellipsis:t={}}=N();return V(t,e,`Ellipsis`),null};Gt.displayName=`JVR.Ellipsis`;var Kt=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=N(),{as:a,render:o}=i,s=_(i,Wt),c=a||`span`;return o&&typeof o==`function`&&o(g({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,y.jsx)(c,g({},s)))};Kt.displayName=`JVR.EllipsisComp`;var qt=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=O(),l=ie(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=I(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var _=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},v={display:`inline-flex`,alignItems:`center`},b={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},x=Object.keys(a).length,S=typeof a==`object`,C=Array.isArray(a),w=a instanceof Set,T=x!==0&&(C||w||S),E={style:v};T&&(E.onClick=_);var D={keyName:t,value:a,keys:r,parentValue:o};return(0,y.jsxs)(`span`,g({},E,{children:[T&&(0,y.jsx)(Ue,g({style:b,expandKey:n},D)),(t||typeof t==`number`)&&(0,y.jsx)(U,g({},D)),(0,y.jsx)(st,{value:i,keyName:t}),(0,y.jsx)(ct,{value:i,keyName:t}),(0,y.jsx)(We,g({isBrackets:C||w},D)),(0,y.jsx)(Kt,{keyName:t,value:a,isExpanded:m}),(0,y.jsx)(Ge,g({isVisiable:m||!T,isBrackets:C||w},D)),(0,y.jsx)(Ut,{value:a,keyName:t}),(0,y.jsx)(zt,{value:a,keyName:t}),(0,y.jsx)(H,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};qt.displayName=`JVR.NestedOpen`;var Jt=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],W=(0,v.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=_(e,Jt),u=E(),d=Nt();return(0,y.jsxs)(`div`,g({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,y.jsx)(qt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,y.jsx)(Pt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,y.jsx)(Ke,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});W.displayName=`JVR.Container`;var Yt=e=>{var{BraceLeft:t={}}=j();return z(t,e,`BraceLeft`),null};Yt.displayName=`JVR.BraceLeft`;var Xt=e=>{var{BraceRight:t={}}=j();return z(t,e,`BraceRight`),null};Xt.displayName=`JVR.BraceRight`;var Zt=e=>{var{BracketsLeft:t={}}=j();return z(t,e,`BracketsLeft`),null};Zt.displayName=`JVR.BracketsLeft`;var Qt=e=>{var{BracketsRight:t={}}=j();return z(t,e,`BracketsRight`),null};Qt.displayName=`JVR.BracketsRight`;var $t=e=>{var{Arrow:t={}}=j();return z(t,e,`Arrow`),null};$t.displayName=`JVR.Arrow`;var en=e=>{var{Colon:t={}}=j();return z(t,e,`Colon`),null};en.displayName=`JVR.Colon`;var tn=e=>{var{Quote:t={}}=j();return z(t,e,`Quote`),null};tn.displayName=`JVR.Quote`;var nn=e=>{var{ValueQuote:t={}}=j();return z(t,e,`ValueQuote`),null};nn.displayName=`JVR.ValueQuote`;var rn=e=>{var{Bigint:t={}}=A();return B(t,e,`Bigint`),null};rn.displayName=`JVR.Bigint`;var an=e=>{var{Date:t={}}=A();return B(t,e,`Date`),null};an.displayName=`JVR.Date`;var on=e=>{var{False:t={}}=A();return B(t,e,`False`),null};on.displayName=`JVR.False`;var sn=e=>{var{Float:t={}}=A();return B(t,e,`Float`),null};sn.displayName=`JVR.Float`;var cn=e=>{var{Int:t={}}=A();return B(t,e,`Int`),null};cn.displayName=`JVR.Int`;var ln=e=>{var{Map:t={}}=A();return B(t,e,`Map`),null};ln.displayName=`JVR.Map`;var un=e=>{var{Nan:t={}}=A();return B(t,e,`Nan`),null};un.displayName=`JVR.Nan`;var dn=e=>{var{Null:t={}}=A();return B(t,e,`Null`),null};dn.displayName=`JVR.Null`;var fn=e=>{var{Set:t={}}=A();return B(t,e,`Set`),null};fn.displayName=`JVR.Set`;var pn=e=>{var{Str:t={}}=A();return B(t,e,`Str`),null};pn.displayName=`JVR.StringText`;var mn=e=>{var{True:t={}}=A();return B(t,e,`True`),null};mn.displayName=`JVR.True`;var hn=e=>{var{Undefined:t={}}=A();return B(t,e,`Undefined`),null};hn.displayName=`JVR.Undefined`;var gn=e=>{var{Url:t={}}=A();return B(t,e,`Url`),null};gn.displayName=`JVR.Url`;var _n=e=>{var{Copied:t={}}=N();return V(t,e,`Copied`),null};_n.displayName=`JVR.Copied`;var vn=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,v.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:v,onCopied:b,beforeCopy:x}=e,S=_(e,vn),C=g({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),w=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,y.jsxs)(Ae,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:b,onExpand:v,beforeCopy:x},initialTypes:{displayDataTypes:m},children:[(0,y.jsx)(W,g({value:i},S,{ref:t,className:w,style:C})),a]})});G.Bigint=rn,G.Date=an,G.False=on,G.Float=sn,G.Int=cn,G.Map=ln,G.Nan=un,G.Null=dn,G.Set=fn,G.String=pn,G.True=mn,G.Undefined=hn,G.Url=gn,G.ValueQuote=nn,G.Arrow=$t,G.Colon=en,G.Quote=tn,G.Ellipsis=Gt,G.BraceLeft=Yt,G.BraceRight=Xt,G.BracketsLeft=Zt,G.BracketsRight=Qt,G.Copied=_n,G.CountInfo=Ht,G.CountInfoExtra=Rt,G.KeyName=Ct,G.Row=Dt,G.displayName=`JVR.JsonView`;var yn={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#002b36`,"--w-rjv-key-string":`#002b36`,"--w-rjv-background-color":`#ffffff`,"--w-rjv-line-color":`#ebebeb`,"--w-rjv-arrow-color":`var(--w-rjv-color)`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#0000004d`,"--w-rjv-update-color":`#ebcb8b`,"--w-rjv-copied-color":`#002b36`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#236a7c`,"--w-rjv-colon-color":`#002b36`,"--w-rjv-brackets-color":`#236a7c`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#cb4b16`,"--w-rjv-type-int-color":`#268bd2`,"--w-rjv-type-float-color":`#859900`,"--w-rjv-type-bigint-color":`#268bd2`,"--w-rjv-type-boolean-color":`#2aa198`,"--w-rjv-type-date-color":`#586e75`,"--w-rjv-type-url-color":`#0969da`,"--w-rjv-type-null-color":`#d33682`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#586e75`},bn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 19l-7-7l7-7m7 7H5`})}),xn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),K=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),Sn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,y.jsx)(`rect`,{width:14,height:14,x:8,y:8,rx:2,ry:2}),(0,y.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})});function Cn(){let{id:e}=u.useSearch();return(0,y.jsx)(ur,{id:e})}function q(e){return e.toLocaleString()}var wn=new Set;function Tn(e){try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function J(e){if(!e)return{};try{return JSON.parse(e)}catch{return e}}function Y({text:e,dark:t}){let[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,y.jsx)(`button`,{type:`button`,className:`absolute top-2 right-2 p-1 rounded transition-colors ${t?`text-sand-500 hover:text-sand-300`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>{navigator.clipboard.writeText(e),r(!0)},children:n?(0,y.jsx)(xn,{className:`size-3.5 text-sage-500`}):(0,y.jsx)(Sn,{className:`size-3.5`})})}var En=/<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;function Dn(e){let t=[],n=0;for(let r of e.matchAll(En)){let i=r.index??0;i>n&&t.push({type:`text`,text:e.slice(n,i)}),t.push({type:`image`,src:r[1],alt:r[2]??`generated image`}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,text:e.slice(n)}),t.filter(e=>e.type===`image`||e.text.trim().length>0)}function On({text:e,markdown:t}){let[n,r]=(0,v.useState)(null),i=Dn(e);return i.some(e=>e.type===`image`)?(0,y.jsxs)(`div`,{className:`space-y-3`,children:[i.map((e,n)=>e.type===`text`?t?(0,y.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,y.jsx)(l,{remarkPlugins:[d],children:e.text})},`text-${n}`):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e.text},`text-${n}`):(0,y.jsx)(`button`,{type:`button`,className:`block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors`,onClick:()=>r(e.src),title:`Open image`,children:(0,y.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] max-w-full object-contain`,loading:`lazy`})},`image-${n}`)),n&&(0,y.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center`,onClick:()=>r(null),children:[(0,y.jsx)(`button`,{type:`button`,className:`absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white`,onClick:()=>r(null),title:`Close image`,children:(0,y.jsx)(c,{className:`size-5`})}),(0,y.jsx)(`img`,{src:n,alt:`generated preview`,className:`max-h-full max-w-full object-contain rounded-md bg-white`,onClick:e=>e.stopPropagation()})]})]}):t?(0,y.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,y.jsx)(l,{remarkPlugins:[d],children:e})}):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e})}function X({text:e,markdown:t}){let n=Tn(e),[r,i]=(0,v.useState)(`pretty`),a=n.ok&&n.value!==null&&(Array.isArray(n.value)||typeof n.value==`object`);return!n.ok||!a?t?(0,y.jsx)(On,{text:e,markdown:!0}):(0,y.jsx)(On,{text:n.ok?JSON.stringify(n.value,null,2):e}):(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`flex gap-1 mb-2`,children:[(0,y.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`plain`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`plain`),children:`Plain`}),(0,y.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`pretty`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`pretty`),children:`Pretty`})]}),r===`pretty`?(0,y.jsx)(G,{value:n.value,style:yn,displayDataTypes:!1,enableClipboard:!0,collapsed:!1}):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:JSON.stringify(n.value,null,2)})]})}function Z({title:e,defaultOpen:t=!0,headerMetadata:n,onOpenChange:r,children:i}){let[a,o]=(0,v.useState)(t);return(0,y.jsxs)(`details`,{open:a,className:`group panel overflow-hidden`,onToggle:e=>{let t=e.currentTarget.open;o(t),r?.(t)},children:[(0,y.jsxs)(`summary`,{className:`panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5`,children:[(0,y.jsx)(K,{className:`size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90`}),(0,y.jsx)(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:e}),n&&(0,y.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400`,children:n})]}),(0,y.jsx)(`div`,{className:`p-4`,children:i})]})}function Q({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,y.jsx)(`dd`,{className:`text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate`,children:t})]})}var kn={running:`bg-blue-100 text-blue-600`,succeeded:`bg-sage-100 text-sage-600`,error:`bg-red-100 text-red-600`,aborted:`bg-caution-400/15 text-caution-500`};function An({message:e}){return(0,y.jsxs)(`div`,{className:`panel overflow-hidden border border-red-200 bg-red-50/60`,children:[(0,y.jsx)(`div`,{className:`px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5`,children:(0,y.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-red-600 font-medium`,children:`Error`})}),(0,y.jsx)(`div`,{className:`p-4`,children:(0,y.jsx)(`pre`,{className:`text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto`,children:e})})]})}function jn({data:e}){let t=e.status===`running`,n=h({status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method}),r=!t&&e.requested_model_name!==null&&e.model_name===null;return(0,y.jsxs)(`div`,{className:`panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5`,children:[(0,y.jsx)(`span`,{className:`text-[15px] font-semibold text-sand-900 break-all`,children:n.label===`—`?`Unknown model`:n.label}),r&&(0,y.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`요청`}),e.service_tier===`fast`&&(0,y.jsx)(`span`,{title:`Fast 모드`,className:`inline-flex shrink-0`,children:(0,y.jsx)(m,{"aria-label":`Fast 모드`,className:`size-3.5 text-[#1877F2] [&_path]:fill-current`})}),!t&&(e.fallback_count??0)>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:[`fallback ×`,e.fallback_count]}),!t&&e.status!==`succeeded`&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${kn[e.status]??`bg-sand-100 text-sand-500`}`,children:e.status}),e.response_json_ok===!1&&(0,y.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:`broken json`}),e.effort&&(0,y.jsxs)(`span`,{className:`text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono`,children:[`effort=`,e.effort]}),e.project_name&&(0,y.jsxs)(`span`,{className:`text-[12px] text-sand-400`,children:[`· project=`,e.project_name]}),(0,y.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400`,children:e.token_name})]})}function Mn({data:e,toolCallCount:t}){let n=In(e);return(0,y.jsxs)(`div`,{className:`panel overflow-hidden px-5 py-3 space-y-3`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,y.jsx)(Q,{label:`Duration`,value:`${(e.duration_ms/1e3).toFixed(1)}s`}),(0,y.jsx)(Q,{label:`TTFT`,value:Pn(e.ttft_ms)}),(0,y.jsx)(Q,{label:`Tokens/sec`,value:Ln(e.output_tokens,e.duration_ms,e.ttft_ms,n)}),(0,y.jsx)(Q,{label:`Driver`,value:e.cost_usd===null?`—`:f(e.cost_usd)}),(0,y.jsx)(Q,{label:`Image`,value:e.image_cost_usd===null?`—`:f(e.image_cost_usd)}),(0,y.jsx)(Q,{label:`Tool Calls`,value:`${t}회`})]}),(0,y.jsxs)(`div`,{className:`border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,y.jsx)(Q,{label:`Input`,value:q(e.input_tokens)}),(0,y.jsx)(Q,{label:`Output`,value:q(e.output_tokens)}),(0,y.jsx)(Q,{label:`Cache Read`,value:q(e.cache_read_tokens)}),(0,y.jsx)(Q,{label:`Cache Write`,value:q(e.cache_creation_tokens)}),(0,y.jsx)(Q,{label:`Cache Write (5m)`,value:e.cache_creation_5m_tokens===null?`—`:q(e.cache_creation_5m_tokens)}),(0,y.jsx)(Q,{label:`Cache Write (1h)`,value:e.cache_creation_1h_tokens===null?`—`:q(e.cache_creation_1h_tokens)}),(0,y.jsx)(Q,{label:`Cache Hit`,value:p(e)})]})]})}function Nn(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Pn(e){return e==null||e<=0?`—`:Nn(e)}function Fn(e){let t=e.model_name?.trim().toLowerCase();if(t){let e=t.includes(`/`)?t.split(`/`).pop():t;if(e.startsWith(`claude-`))return`anthropic`;if(/^(gpt-|codex-|o\d)/.test(e))return`openai`}let n=e.token_name?.trim().toLowerCase();return n?.startsWith(`anthropic/`)?`anthropic`:n?.startsWith(`openai/`)?`openai`:null}function In(e){let t=Fn(e);return t!==null&&wn.has(t)}function Ln(e,t,n,r){if(!r||e==null||t==null||n==null||n<=0)return`—`;let i=t-n;return e<=0||i<=0?`—`:`${Math.round(e/(i/1e3)).toLocaleString()} tok/s`}function $({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`min-w-0 self-end`,children:[e&&(0,y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,y.jsx)(`div`,{className:`mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate`,children:t})]})}function Rn(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.inputImages;return Array.isArray(t)?t:void 0}function zn(e){return(Rn(e)??[]).filter(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.url==`string`&&t.url.length>0||typeof t.data==`string`&&t.data.length>0})}function Bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=Rn(t);return n?{...t,inputImages:n.map(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=typeof t.url==`string`&&t.url.toLowerCase().startsWith(`data:`)?`[data-url ${t.url.length} chars]`:t.url;return{mediaType:t.mediaType,byteSize:t.byteSize,...n?{url:n}:{},...t.data?{data:`[base64 ${t.data.length} chars]`}:{}}})}:e}function Vn({images:e}){let t=e.map((e,t)=>{let n=e.url&&!e.url.startsWith(`[`)?e.url:void 0,r=e.data?`data:${e.mediaType??`image/png`};base64,${e.data}`:``,i=n??r;return i?{image:e,index:t,src:i}:null}).filter(e=>e!==null);return t.length===0?null:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Input Images`}),(0,y.jsx)(`div`,{className:`mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2`,children:t.map(({image:e,index:t,src:n})=>(0,y.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-white overflow-hidden`,children:[(0,y.jsx)(`img`,{src:n,alt:`reference ${t+1}`,className:`max-h-64 w-full object-contain bg-white`,loading:`lazy`}),(0,y.jsxs)(`div`,{className:`px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100`,children:[e.mediaType??`image`,` ·`,` `,e.byteSize===void 0?`url`:`${e.byteSize.toLocaleString()} bytes`]})]},`${e.mediaType??`image`}-${t}`))})]})}function Hn({stepId:e}){let{data:t}=a.useRequestLogStep(`I`,e??0,{enabled:e!==null});return(0,y.jsx)(Vn,{images:zn(t?J(t.tool_args):null)})}function Un({entry:e}){let t=!!e.error,[n,r]=(0,v.useState)(!1),{data:i}=a.useRequestLogStep(`A`,e.id,{enabled:n}),o=Bn(i?J(i.tool_args):null),s=i?J(i.tool_result):null,c=i?.error??e.error;return(0,y.jsxs)(`details`,{className:`group/tool`,onToggle:e=>r(e.currentTarget.open),children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md`,children:[(0,y.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0`}),(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:[`call `,e.callIndex+1]}),(0,y.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 font-mono truncate`,children:e.toolName}),t&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:`error`}),(0,y.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:Nn(e.durationMs)})]}),n&&(0,y.jsxs)(`div`,{className:`mt-1 mx-1 mb-3 space-y-2`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Request`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:i?JSON.stringify(o):`Loading...`})})]}),c&&(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-red-500 font-medium px-2`,children:`Error`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:c})})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Response`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:i?typeof s==`string`?s:JSON.stringify(s):`Loading...`,markdown:!0})})]})]})]})}function Wn({stepId:e}){let[t,n]=(0,v.useState)(!1),{data:r}=a.useRequestLogStep(`A`,e,{enabled:t}),i=r?.reasoning_text??null;return(0,y.jsxs)(`details`,{className:`group/reason mt-3`,onToggle:e=>n(e.currentTarget.open),children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 cursor-pointer select-none list-none`,children:[(0,y.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0`}),(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Reasoning`})]}),t&&(0,y.jsx)(`div`,{className:`mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto`,children:i?(0,y.jsx)(X,{text:i,markdown:!0}):r?(0,y.jsx)(`p`,{className:`text-sm text-sand-400`,children:`No reasoning text captured.`}):(0,y.jsx)(`p`,{className:`text-sm text-sand-400`,children:`Loading...`})})]})}function Gn({entry:e,tokensPerSecEnabled:t}){let n=e.generate,r=n!==null&&n.reasoningTokens!==null&&n.reasoningTokens!==void 0&&n.reasoningTokens>0,i=e.toolCalls.filter(e=>e.error).length;return(0,y.jsxs)(`details`,{open:!0,className:`group/step border-l border-sand-200 pl-3`,children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 py-2 cursor-pointer select-none list-none`,children:[(0,y.jsx)(K,{className:`size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0`}),(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0`,children:[`step `,e.stepIndex+1]}),(0,y.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-900`,children:`LLM call`}),n?.finishReason&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:n.finishReason}),n&&(n.fallbackCount??0)>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0`,children:[n.requestedModelName,` → `,n.modelName]}),r&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0`,children:`reasoning`}),i>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:[i,` error`]}),(0,y.jsxs)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:[e.toolCalls.length,` tools`]})]}),(0,y.jsxs)(`div`,{className:`ml-4 mb-4 space-y-3`,children:[n&&(0,y.jsxs)(`div`,{className:`rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3`,children:[(0,y.jsx)($,{label:`Duration`,value:Nn(n.durationMs)}),(0,y.jsx)($,{label:`TTFT`,value:Pn(n.ttftMs)}),(0,y.jsx)($,{label:`Tokens/sec`,value:Ln(n.outputTokens,n.durationMs,n.ttftMs,t)}),(0,y.jsx)($,{label:`Input`,value:q(n.inputTokens??0)}),(0,y.jsx)($,{label:`Output`,value:q(n.outputTokens??0)}),(0,y.jsx)($,{label:`Cache Read`,value:q(n.cacheReadTokens??0)}),(0,y.jsx)($,{label:`Cache Write`,value:q(n.cacheCreationTokens??0)}),(0,y.jsx)($,{label:`Cache 5m / 1h`,value:`${n.cacheCreation5mTokens===null?`—`:q(n.cacheCreation5mTokens)} / ${n.cacheCreation1hTokens===null?`—`:q(n.cacheCreation1hTokens)}`}),(0,y.jsx)($,{value:n.costUsd===null?`—`:f(n.costUsd)}),(0,y.jsx)($,{label:`Reasoning`,value:n.reasoningTokens!==null&&n.reasoningTokens!==void 0?q(n.reasoningTokens):`—`})]}),r&&(0,y.jsx)(Wn,{stepId:n.id})]}),e.toolCalls.length>0&&(0,y.jsx)(`div`,{className:`space-y-0.5`,children:e.toolCalls.map(e=>(0,y.jsx)(Un,{entry:e},`${e.stepIndex}-${e.callIndex}-${e.toolCallId}`))})]})]})}function Kn({steps:e,tokensPerSecEnabled:t}){let n=e.reduce((e,t)=>e+t.toolCalls.length,0);return(0,y.jsx)(Z,{title:`Steps (${e.length} steps · ${n} tool calls)`,defaultOpen:!0,children:(0,y.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,y.jsx)(Gn,{entry:e,tokensPerSecEnabled:t},e.stepIndex))})})}function qn(e){let t=new Map;function n(e){let n=t.get(e);if(n)return n;let r={stepIndex:e,generate:null,toolCalls:[]};return t.set(e,r),r}for(let t of e){let e=n(t.step_index);if(t.type===`generate`){e.generate={id:t.id,stepIndex:t.step_index,modelName:t.model_name,requestedModelName:t.requested_model_name,fallbackCount:t.fallback_count,inputTokens:t.input_tokens,outputTokens:t.output_tokens,cacheReadTokens:t.cache_read_tokens,cacheCreationTokens:t.cache_creation_tokens,cacheCreation5mTokens:t.cache_creation_5m_tokens,cacheCreation1hTokens:t.cache_creation_1h_tokens,costUsd:t.cost_usd,durationMs:t.duration_ms,ttftMs:t.ttft_ms,finishReason:t.finish_reason,reasoningTokens:t.reasoning_tokens};continue}t.type===`tool_call`&&e.toolCalls.push({id:t.id,stepIndex:t.step_index,callIndex:t.tool_call_index??e.toolCalls.length,toolCallId:t.tool_call_id??``,toolName:t.tool_name??``,durationMs:t.tool_duration_ms??0,error:t.error})}return[...t.values()].map(e=>({...e,toolCalls:e.toolCalls.toSorted((e,t)=>e.callIndex-t.callIndex)})).toSorted((e,t)=>e.stepIndex-t.stepIndex)}function Jn(e){return e.type===`function_call`||e.type===`function_call_output`?`bg-caution-400/10`:e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}function Yn(e){return e.type===`function_call`?`fn: ${e.name??`unknown`}`:e.type===`function_call_output`?`fn result`:e.role??e.type}function Xn(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>typeof e==`object`&&e&&`text`in e?e.text:JSON.stringify(e)).join(`
2
- `):JSON.stringify(e)}function Zn({className:e,children:t}){return(0,y.jsx)(`pre`,{className:`text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${e??``}`,children:t})}function Qn({history:e}){return(0,y.jsx)(Z,{title:`History`,defaultOpen:!1,children:(0,y.jsx)(`div`,{className:`space-y-1.5`,children:e.map((e,t)=>(0,y.jsxs)(`div`,{className:`rounded-md px-3 py-2 ${Jn(e)}`,children:[(0,y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1`,children:Yn(e)}),e.content!==null&&e.content!==void 0&&(0,y.jsx)(Zn,{children:Xn(e.content)}),e.arguments&&(0,y.jsx)(Zn,{children:e.arguments}),e.output&&(0,y.jsx)(Zn,{children:e.output})]},`hist-${t}`))})})}var $n=60,er=30,tr=18;function nr(e,t=$n){let n=[];for(let r of e){if([...n,r.name].join(`, `).length>t)break;n.push(r.name)}return{names:n,omittedCount:e.length-n.length}}function rr({tools:e}){let t=nr(e),n=nr(e,er),r=nr(e,tr);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`shrink-0`,children:`·`}),t.names.length>0&&(0,y.jsx)(`span`,{className:`hidden shrink-0 xl:inline`,children:t.names.join(`, `)}),t.omittedCount>0&&(0,y.jsxs)(`span`,{className:`hidden shrink-0 xl:inline`,children:[`+`,t.omittedCount]}),n.names.length>0&&(0,y.jsx)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:n.names.join(`, `)}),n.omittedCount>0&&(0,y.jsxs)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:[`+`,n.omittedCount]}),r.names.length>0&&(0,y.jsx)(`span`,{className:`shrink-0 sm:hidden`,children:r.names.join(`, `)}),r.omittedCount>0&&(0,y.jsxs)(`span`,{className:`shrink-0 sm:hidden`,children:[`+`,r.omittedCount]})]})}function ir({code:e,fullCode:t}){let n=(0,v.useMemo)(()=>cr(e),[e]);return(0,y.jsx)(`pre`,{"data-zod-parameter-shape":!0,className:`max-h-64 overflow-auto rounded-md bg-sand-900 px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre text-sand-200 ${t?`cursor-help outline-none focus-visible:ring-2 focus-visible:ring-sienna-300`:``}`,tabIndex:t?0:void 0,title:t,children:t?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,y.jsx)(`span`,{className:`sr-only`,children:t})]}):n})}function ar({tool:e}){return(0,y.jsxs)(`div`,{className:`min-w-0 rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,y.jsx)(`div`,{className:`break-all font-mono text-[13px] font-semibold text-sand-900`,children:e.name}),e.description&&(0,y.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-sand-700`,children:e.description}),(0,y.jsxs)(`div`,{className:`mt-3`,children:[(0,y.jsxs)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase tracking-wider text-sand-400`,children:[`Parameters (`,e.parameterCount,`)`]}),(0,y.jsx)(ir,{code:e.inputZod,fullCode:e.fullInputZod})]})]})}function or({id:e,tools:n}){let[r,i]=(0,v.useState)(!1),a=t({...o.toolsViewQueryOptions(e),enabled:r,staleTime:e=>e.state.data&&e.state.data.length>0?1/0:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),s=a.data!==void 0&&a.data.length>0;return(0,y.jsx)(Z,{title:`Tools (${n.length})`,defaultOpen:!1,headerMetadata:(0,y.jsx)(rr,{tools:n}),onOpenChange:i,children:a.isFetching&&!s?(0,y.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Loading tool contracts…`}):a.isError||!s?(0,y.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Tool contracts could not be loaded.`}):(0,y.jsx)(`div`,{className:`space-y-2`,children:a.data.map((e,t)=>(0,y.jsx)(ar,{tool:e},`${e.name}-${t}`))})})}var sr=/("(?:[^"\\]|\\.)*")|(\b\d+(?:\.\d+)?\b)|(\btype\b|\bz\b(?=\.))|(\b(?:string|number|boolean|null|unknown|Record)\b)|([{}[\]()<>|?:,.=])|([A-Za-z_$][\w$]*)|(\s+|.)/g;function cr(e){let t=[],n=!1;for(let r of e.matchAll(sr)){let[e,i,a,o,s,c,l]=r,u=`${r.index}-${e}`;i||a?t.push((0,y.jsx)(`span`,{className:`text-sage-400`,children:e},u)):o?(n=e===`type`,t.push((0,y.jsx)(`span`,{className:`text-sienna-400`,children:e},u))):s?t.push((0,y.jsx)(`span`,{className:`text-blue-300`,children:e},u)):c?t.push((0,y.jsx)(`span`,{className:`text-sand-500`,children:e},u)):l&&n?(n=!1,t.push((0,y.jsx)(`span`,{className:`font-semibold text-sand-50`,children:e},u))):t.push(e)}return t}function lr({id:e}){let{data:t}=o.useResponseTypeTs(e),[n,r]=(0,v.useState)(`zod`),{zod:i=null,typescript:a=null}=t??{},s=n===`zod`?i??a:a??i,c=(0,v.useMemo)(()=>s===null?null:cr(s),[s]);return!t||s===null||c===null?null:(0,y.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`panel-header flex items-center px-4 py-2`,children:[(0,y.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:`Response Type`}),(0,y.jsx)(`div`,{className:`ml-auto flex gap-1`,children:[{value:`zod`,label:`zod`,available:i!==null},{value:`ts`,label:`ts`,available:a!==null}].map(e=>(0,y.jsx)(`button`,{type:`button`,disabled:!e.available,className:`px-3 py-1 text-[12px] font-mono rounded-md transition-colors ${n===e.value?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600 disabled:text-sand-300 disabled:cursor-not-allowed`}`,onClick:()=>r(e.value),children:e.label},e.value))})]}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:s,dark:!0}),(0,y.jsx)(`pre`,{className:`bg-sand-900 px-4 py-3 text-[12px] text-sand-200 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-64 overflow-auto`,children:c})]})]})}function ur({id:e}){let{data:t,isLoading:r,error:i,isError:c}=o.useRequestLog(`A`,e),{data:l,isLoading:u,isError:d}=a.useRequestLogSteps(`T`,{request_log_id:e,num:0,page:1,orderBy:`id-asc`}),f=qn(l?.rows??[]);if(r||u)return(0,y.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,y.jsx)(`div`,{className:`h-4 w-32 bg-sand-200 rounded animate-pulse`}),(0,y.jsx)(`div`,{className:`h-40 panel animate-pulse`}),(0,y.jsx)(`div`,{className:`h-32 panel animate-pulse`})]});if(c||d||!t)return(0,y.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,y.jsxs)(n,{to:`/logs`,className:`flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4`,children:[(0,y.jsx)(bn,{className:`size-3.5`}),`Back to Logs`]}),(0,y.jsx)(`p`,{role:`alert`,className:`text-danger-500 text-sm`,children:c?s(i)&&i.code===404?`Request not found.`:`Failed to load request.`:d?`Failed to load request steps.`:`Request not found.`})]});let p=f.flatMap(e=>e.toolCalls),m=p.find(e=>e.toolName===`image_generation`)?.id??null,h=f.length>0,g=In(t),_=t.history??null,v=_!==null&&_.length>0,b=t.tools??null,x=b!==null&&b.length>0,S=t.is_structured?(0,y.jsx)(lr,{id:e}):null,C=(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(Z,{title:`System`,children:(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.system_prompt??`null`}),(0,y.jsx)(X,{text:t.system_prompt??`null`,markdown:!0})]})}),(0,y.jsx)(Z,{title:`User`,children:(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.user_prompt??`null`}),(0,y.jsx)(X,{text:t.user_prompt??`null`,markdown:!0})]}),(0,y.jsx)(Hn,{stepId:m})]})})]});return(0,y.jsxs)(`div`,{className:`mx-auto space-y-4 ${h?`max-w-[120rem]`:`max-w-6xl`}`,children:[(0,y.jsxs)(n,{to:`/logs`,className:`inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors`,children:[(0,y.jsx)(bn,{className:`size-3.5`}),`Back to Logs`]}),(0,y.jsx)(jn,{data:t}),t.error_message&&(0,y.jsx)(An,{message:t.error_message}),v&&(0,y.jsx)(Qn,{history:_}),h?(0,y.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4 items-stretch lg:items-start`,children:[(0,y.jsxs)(`div`,{className:`order-1 lg:order-2 flex-1 min-w-0 space-y-4`,children:[S,x&&(0,y.jsx)(or,{id:e,tools:b}),(0,y.jsx)(Kn,{steps:f,tokensPerSecEnabled:g})]}),(0,y.jsx)(`div`,{className:`order-2 lg:order-1 flex-1 min-w-0`,children:C})]}):(0,y.jsxs)(y.Fragment,{children:[S,x&&(0,y.jsx)(or,{id:e,tools:b}),C]}),(0,y.jsx)(Z,{title:`Response`,children:(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.response}),(0,y.jsx)(X,{text:t.response,markdown:!0})]})}),(0,y.jsx)(Mn,{data:t,toolCallCount:p.length}),(0,y.jsx)(`div`,{className:`pb-8`})]})}export{Cn as component};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,l as n}from"./vendor-tanstack-DJRQAbrY.js";import{i as r,r as i}from"./vendor-react-DH4kUfK2.js";import{i as a,r as o,u as s}from"./services.generated-NP-ValHd.js";import{c,d as l,t as u,u as d}from"./index-DZwzUfI-.js";import{n as f,t as p}from"./cost-DH2jZbrw.js";import{n as m,t as h}from"./request-model-CojtinqK.js";function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(null,arguments)}function _(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var v=e(r()),y=i(),b={},x=(0,v.createContext)(b),S=(e,t)=>g({},e,t),C=()=>(0,v.useContext)(x),w=(0,v.createContext)(()=>{});w.displayName=`JVR.DispatchShowTools`;function T(){return(0,v.useReducer)(S,b)}function E(){return(0,v.useContext)(w)}var D=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(x.Provider,{value:t,children:(0,y.jsx)(w.Provider,{value:n,children:r})})};D.displayName=`JVR.ShowTools`;var ee={},te=(0,v.createContext)(ee),ne=(e,t)=>g({},e,t),O=()=>(0,v.useContext)(te),k=(0,v.createContext)(()=>{});k.displayName=`JVR.DispatchExpands`;function re(){return(0,v.useReducer)(ne,ee)}function ie(){return(0,v.useContext)(k)}var ae=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(te.Provider,{value:t,children:(0,y.jsx)(k.Provider,{value:n,children:r})})};ae.displayName=`JVR.Expands`;var oe={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},se=(0,v.createContext)(oe),ce=(e,t)=>g({},e,t),A=()=>(0,v.useContext)(se),le=(0,v.createContext)(()=>{});le.displayName=`JVR.DispatchTypes`;function ue(){return(0,v.useReducer)(ce,oe)}function de(){return(0,v.useContext)(le)}function fe(e){var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(se.Provider,{value:t,children:(0,y.jsx)(le.Provider,{value:n,children:r})})}fe.displayName=`JVR.Types`;var pe=[`style`];function me(e){var{style:t}=e,n=_(e,pe);return(0,y.jsx)(`svg`,g({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:g({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,y.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}me.displayName=`JVR.TriangleArrow`;var he={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,y.jsx)(me,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},ge=(0,v.createContext)(he),_e=(e,t)=>g({},e,t),j=()=>(0,v.useContext)(ge),M=(0,v.createContext)(()=>{});M.displayName=`JVR.DispatchSymbols`;function ve(){return(0,v.useReducer)(_e,he)}function ye(){return(0,v.useContext)(M)}var be=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(ge.Provider,{value:t,children:(0,y.jsx)(M.Provider,{value:n,children:r})})};be.displayName=`JVR.Symbols`;var xe={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Se=(0,v.createContext)(xe),Ce=(e,t)=>g({},e,t),N=()=>(0,v.useContext)(Se),P=(0,v.createContext)(()=>{});P.displayName=`JVR.DispatchSection`;function we(){return(0,v.useReducer)(Ce,xe)}function Te(){return(0,v.useContext)(P)}var Ee=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,y.jsx)(Se.Provider,{value:t,children:(0,y.jsx)(P.Provider,{value:n,children:r})})};Ee.displayName=`JVR.Section`;var De={objectSortKeys:!1,indentWidth:15},F=(0,v.createContext)(De);F.displayName=`JVR.Context`;var Oe=(0,v.createContext)(()=>{});Oe.displayName=`JVR.DispatchContext`;function ke(e,t){return g({},e,t)}var I=()=>(0,v.useContext)(F),Ae=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,v.useReducer)(ke,Object.assign({},De,n)),[o,s]=T(),[c,l]=re(),[u,d]=ue(),[f,p]=ve(),[m,h]=we();return(0,v.useEffect)(()=>a(g({},n)),[n]),(0,y.jsx)(F.Provider,{value:i,children:(0,y.jsx)(Oe.Provider,{value:a,children:(0,y.jsx)(D,{initial:o,dispatch:s,children:(0,y.jsx)(ae,{initial:c,dispatch:l,children:(0,y.jsx)(fe,{initial:g({},u,r),dispatch:d,children:(0,y.jsx)(be,{initial:f,dispatch:p,children:(0,y.jsx)(Ee,{initial:m,dispatch:h,children:t})})})})})})})};Ae.displayName=`JVR.Provider`;function je(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Me=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Ne=[`as`,`render`],Pe=[`as`,`render`],Fe=[`as`,`render`],Ie=[`as`,`style`,`render`],Le=[`as`,`render`],Re=[`as`,`render`],ze=[`as`,`render`],Be=[`as`,`render`],Ve=e=>{var{Quote:t={}}=j(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=_(e,Me);if(n)return null;var{as:c,render:l}=t,u=_(t,Ne),d=c||`span`,f=g({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,y.jsx)(d,g({},f))};Ve.displayName=`JVR.Quote`;var L=e=>{var{ValueQuote:t={}}=j(),n=g({},(je(e),e)),{as:r,render:i}=t,a=_(t,Pe),o=r||`span`,s=g({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,y.jsx)(o,g({},s))};L.displayName=`JVR.ValueQuote`;var He=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=j(),{as:o,render:s}=a,c=_(a,Fe),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,y.jsx)(l,g({},c))};He.displayName=`JVR.Colon`;var Ue=e=>{var{Arrow:t={}}=j(),n=O(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=_(t,Ie),m=u||`span`,h=f&&typeof f==`function`,v=g({},p,{"data-expanded":l,style:g({},d,i)});return h&&f(v,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,y.jsx)(m,g({},p,{style:g({},d,i)}))};Ue.displayName=`JVR.Arrow`;var We=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=j(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=_(o,Le),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,y.jsx)(f,g({},d))}var{as:p,render:m}=s,h=_(s,Re),v=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,y.jsx)(v,g({},h))};We.displayName=`JVR.BracketsOpen`;var Ge=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=j();if(t){var{as:u,render:d}=c,f=_(c,ze),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,y.jsx)(p,g({},f))}var{as:m,render:h}=l,v=_(l,Be),b=m||`span`;return h&&typeof h==`function`&&h(v,s)||(0,y.jsx)(b,g({},v))};Ge.displayName=`JVR.BracketsClose`;var Ke=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=O(),{collapsed:c,shouldExpandNodeInitially:l}=I(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},_=Array.isArray(n),v=n instanceof Set;return(0,y.jsx)(`div`,{style:m,children:(0,y.jsx)(Ge,g({isBrackets:_||v},h,{isVisiable:!0}))})};Ke.displayName=`JVR.NestedClose`;var qe=[`as`,`render`],Je=[`as`,`render`],Ye=[`as`,`render`],Xe=[`as`,`render`],Ze=[`as`,`render`],Qe=[`as`,`render`],$e=[`as`,`render`],et=[`as`,`render`],tt=[`as`,`render`],nt=[`as`,`render`],rt=[`as`,`render`],it=[`as`,`render`],at=[`as`,`render`],ot=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},st=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=A();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=_(r,qe);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,y.jsx)(a||`span`,g({},s))};st.displayName=`JVR.SetComp`;var ct=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=A();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=_(r,Je);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,y.jsx)(a||`span`,g({},s))};ct.displayName=`JVR.MapComp`;var R={opacity:.75,paddingRight:4},lt=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=A(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=I(),{as:c,render:l}=i,u=_(i,Ye),d=t,[f,p]=(0,v.useState)(o&&d.length>o);(0,v.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=g({},R,i.style||{});o>0&&(u.style=g({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var b=f?``+d.slice(0,o)+s:d,x=l&&typeof l==`function`,S=x&&l(g({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),C=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,w=x&&l(g({},u,{children:b,className:C}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(S||(0,y.jsx)(m,g({},u,{style:h}))),w||(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(L,{}),(0,y.jsx)(m,g({},u,{className:C,children:b})),(0,y.jsx)(L,{})]})]})};lt.displayName=`JVR.TypeString`;var ut=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Xe),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ut.displayName=`JVR.TypeTrue`;var dt=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Ze),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};dt.displayName=`JVR.TypeFalse`;var ft=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,Qe),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ft.displayName=`JVR.TypeFloat`;var pt=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,$e),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};pt.displayName=`JVR.TypeInt`;var mt=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,et),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:ot(t?.toString())}))]})};mt.displayName=`JVR.TypeFloat`;var ht=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,tt),l=o||`span`,u=g({},R,i.style),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p||(0,y.jsxs)(`a`,g({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,y.jsx)(L,{}),t?.href,(0,y.jsx)(L,{})]}))]})};ht.displayName=`JVR.TypeUrl`;var gt=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,nt),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(g({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),m||(0,y.jsx)(l,g({},c,{className:`w-rjv-value`,children:p}))]})};gt.displayName=`JVR.TypeDate`;var _t=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,rt),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};_t.displayName=`JVR.TypeUndefined`;var vt=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,it),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};vt.displayName=`JVR.TypeNull`;var yt=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=A(),{as:o,render:s}=i,c=_(i,at),l=o||`span`,u=g({},R,i.style||{}),d=s&&typeof s==`function`,f=d&&s(g({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(g({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,y.jsxs)(v.Fragment,{children:[a&&(f||(0,y.jsx)(l,g({},c,{style:u}))),p]})};yt.displayName=`JVR.TypeNan`;var bt=e=>Number(e)===e&&e%1!=0||isNaN(e),xt=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,y.jsx)(ht,g({},i,{children:t})):typeof t==`string`?(0,y.jsx)(lt,g({},i,{children:t})):t===!0?(0,y.jsx)(ut,g({},i,{children:t})):t===!1?(0,y.jsx)(dt,g({},i,{children:t})):t===null?(0,y.jsx)(vt,g({},i,{children:t})):t===void 0?(0,y.jsx)(_t,g({},i,{children:t})):t instanceof Date?(0,y.jsx)(gt,g({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,y.jsx)(yt,g({},i,{children:t})):typeof t==`number`&&bt(t)?(0,y.jsx)(ft,g({},i,{children:t})):typeof t==`bigint`?(0,y.jsx)(mt,g({},i,{children:t})):typeof t==`number`?(0,y.jsx)(pt,g({},i,{children:t})):null};xt.displayName=`JVR.Value`;function z(e,t,n){var r=ye(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}function B(e,t,n){var r=de(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}function V(e,t,n){var r=Te(),i=g({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:g({},e.style,t.style),children:t.children||e.children});(0,v.useEffect)(()=>r({[n]:i}),[t])}var St=[`as`,`render`],Ct=e=>{var{KeyName:t={}}=N();return V(t,e,`KeyName`),null};Ct.displayName=`JVR.KeyName`;var wt=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=N(),{as:c,render:l}=s,u=_(s,St);u.style=g({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(g({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,y.jsx)(d,g({},u,{children:t}))};wt.displayName=`JVR.KeyNameComp`;var Tt=[`children`,`value`,`parentValue`,`keyName`,`keys`],Et=[`as`,`render`,`children`],Dt=e=>{var{Row:t={}}=N();return V(t,e,`Row`),null};Dt.displayName=`JVR.Row`;var Ot=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=_(e,Tt),{Row:s={}}=N(),{as:c,render:l}=s,u=_(s,Et),d=c||`div`;return l&&typeof l==`function`&&l(g({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,y.jsx)(d,g({},o,u,{children:t}))};Ot.displayName=`JVR.RowComp`;function kt(e){var t=(0,v.useRef)();return(0,v.useEffect)(()=>{t.current=e}),t.current}function At(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=kt(t),a=(0,v.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,v.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var jt=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],Mt=[`as`,`render`],H=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=_(e,jt),{onCopied:c,enableClipboard:l,beforeCopy:u}=I(),d=C()[i],[f,p]=(0,v.useState)(!1),{Copied:m={}}=N(),h=m?.beforeCopy;if(l===!1||!d)return null;var b={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?ot(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?ot(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:x}=m,S=_(m,Mt),w=g({},S,s,b,{style:g({},S.style,s.style,b.style)});return x&&typeof x==`function`&&x(g({},w,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,y.jsx)(`svg`,g({viewBox:`0 0 32 36`},w,{children:(0,y.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,y.jsx)(`svg`,g({viewBox:`0 0 32 36`},w,{children:(0,y.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};H.displayName=`JVR.Copied`;function Nt(){var e=(0,v.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Pt=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=O(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=I(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,y.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,y.jsx)(Ft,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Pt.displayName=`JVR.KeyValues`;var U=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=I(),o=typeof t==`number`,s=(0,v.useRef)(null);At({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsxs)(`span`,{ref:s,children:[(0,y.jsx)(Ve,g({isNumber:o,"data-placement":`left`},c)),(0,y.jsx)(wt,g({},c,{children:t})),(0,y.jsx)(Ve,g({isNumber:o,"data-placement":`right`},c))]}),(0,y.jsx)(He,g({},c))]})};U.displayName=`JVR.KayName`;var Ft=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=E(),s=Nt(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,y.jsx)(W,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,y.jsxs)(Ot,g({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,y.jsx)(U,{keyName:t,value:n,keys:a,parentValue:r}),(0,y.jsx)(xt,{keyName:t,value:n,keys:a}),(0,y.jsx)(H,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Ft.displayName=`JVR.KeyValuesItem`;var It=[`value`,`keyName`],Lt=[`as`,`render`],Rt=e=>{var{CountInfoExtra:t={}}=N();return V(t,e,`CountInfoExtra`),null};Rt.displayName=`JVR.CountInfoExtra`;var zt=e=>{var{value:t={},keyName:n}=e,r=_(e,It),{CountInfoExtra:i={}}=N(),{as:a,render:o}=i,s=_(i,Lt);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=g({},s,r);return l&&o(u,{value:t,keyName:n})||(0,y.jsx)(c,g({},u))};zt.displayName=`JVR.CountInfoExtraComps`;var Bt=[`value`,`keyName`],Vt=[`as`,`render`],Ht=e=>{var{CountInfo:t={}}=N();return V(t,e,`CountInfo`),null};Ht.displayName=`JVR.CountInfo`;var Ut=e=>{var{value:t={},keyName:n}=e,r=_(e,Bt),{displayObjectSize:i}=I(),{CountInfo:a={}}=N();if(!i)return null;var{as:o,render:s}=a,c=_(a,Vt),l=o||`span`;c.style=g({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=g({},c,r);return s&&typeof s==`function`&&s(g({},d,{"data-length":u}),{value:t,keyName:n})||(0,y.jsx)(l,g({},d))};Ut.displayName=`JVR.CountInfoComp`;var Wt=[`as`,`render`],Gt=e=>{var{Ellipsis:t={}}=N();return V(t,e,`Ellipsis`),null};Gt.displayName=`JVR.Ellipsis`;var Kt=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=N(),{as:a,render:o}=i,s=_(i,Wt),c=a||`span`;return o&&typeof o==`function`&&o(g({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,y.jsx)(c,g({},s)))};Kt.displayName=`JVR.EllipsisComp`;var qt=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=O(),l=ie(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=I(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var _=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},v={display:`inline-flex`,alignItems:`center`},b={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},x=Object.keys(a).length,S=typeof a==`object`,C=Array.isArray(a),w=a instanceof Set,T=x!==0&&(C||w||S),E={style:v};T&&(E.onClick=_);var D={keyName:t,value:a,keys:r,parentValue:o};return(0,y.jsxs)(`span`,g({},E,{children:[T&&(0,y.jsx)(Ue,g({style:b,expandKey:n},D)),(t||typeof t==`number`)&&(0,y.jsx)(U,g({},D)),(0,y.jsx)(st,{value:i,keyName:t}),(0,y.jsx)(ct,{value:i,keyName:t}),(0,y.jsx)(We,g({isBrackets:C||w},D)),(0,y.jsx)(Kt,{keyName:t,value:a,isExpanded:m}),(0,y.jsx)(Ge,g({isVisiable:m||!T,isBrackets:C||w},D)),(0,y.jsx)(Ut,{value:a,keyName:t}),(0,y.jsx)(zt,{value:a,keyName:t}),(0,y.jsx)(H,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};qt.displayName=`JVR.NestedOpen`;var Jt=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],W=(0,v.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=_(e,Jt),u=E(),d=Nt();return(0,y.jsxs)(`div`,g({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,y.jsx)(qt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,y.jsx)(Pt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,y.jsx)(Ke,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});W.displayName=`JVR.Container`;var Yt=e=>{var{BraceLeft:t={}}=j();return z(t,e,`BraceLeft`),null};Yt.displayName=`JVR.BraceLeft`;var Xt=e=>{var{BraceRight:t={}}=j();return z(t,e,`BraceRight`),null};Xt.displayName=`JVR.BraceRight`;var Zt=e=>{var{BracketsLeft:t={}}=j();return z(t,e,`BracketsLeft`),null};Zt.displayName=`JVR.BracketsLeft`;var Qt=e=>{var{BracketsRight:t={}}=j();return z(t,e,`BracketsRight`),null};Qt.displayName=`JVR.BracketsRight`;var $t=e=>{var{Arrow:t={}}=j();return z(t,e,`Arrow`),null};$t.displayName=`JVR.Arrow`;var en=e=>{var{Colon:t={}}=j();return z(t,e,`Colon`),null};en.displayName=`JVR.Colon`;var tn=e=>{var{Quote:t={}}=j();return z(t,e,`Quote`),null};tn.displayName=`JVR.Quote`;var nn=e=>{var{ValueQuote:t={}}=j();return z(t,e,`ValueQuote`),null};nn.displayName=`JVR.ValueQuote`;var rn=e=>{var{Bigint:t={}}=A();return B(t,e,`Bigint`),null};rn.displayName=`JVR.Bigint`;var an=e=>{var{Date:t={}}=A();return B(t,e,`Date`),null};an.displayName=`JVR.Date`;var on=e=>{var{False:t={}}=A();return B(t,e,`False`),null};on.displayName=`JVR.False`;var sn=e=>{var{Float:t={}}=A();return B(t,e,`Float`),null};sn.displayName=`JVR.Float`;var cn=e=>{var{Int:t={}}=A();return B(t,e,`Int`),null};cn.displayName=`JVR.Int`;var ln=e=>{var{Map:t={}}=A();return B(t,e,`Map`),null};ln.displayName=`JVR.Map`;var un=e=>{var{Nan:t={}}=A();return B(t,e,`Nan`),null};un.displayName=`JVR.Nan`;var dn=e=>{var{Null:t={}}=A();return B(t,e,`Null`),null};dn.displayName=`JVR.Null`;var fn=e=>{var{Set:t={}}=A();return B(t,e,`Set`),null};fn.displayName=`JVR.Set`;var pn=e=>{var{Str:t={}}=A();return B(t,e,`Str`),null};pn.displayName=`JVR.StringText`;var mn=e=>{var{True:t={}}=A();return B(t,e,`True`),null};mn.displayName=`JVR.True`;var hn=e=>{var{Undefined:t={}}=A();return B(t,e,`Undefined`),null};hn.displayName=`JVR.Undefined`;var gn=e=>{var{Url:t={}}=A();return B(t,e,`Url`),null};gn.displayName=`JVR.Url`;var _n=e=>{var{Copied:t={}}=N();return V(t,e,`Copied`),null};_n.displayName=`JVR.Copied`;var vn=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,v.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:v,onCopied:b,beforeCopy:x}=e,S=_(e,vn),C=g({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),w=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,y.jsxs)(Ae,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:b,onExpand:v,beforeCopy:x},initialTypes:{displayDataTypes:m},children:[(0,y.jsx)(W,g({value:i},S,{ref:t,className:w,style:C})),a]})});G.Bigint=rn,G.Date=an,G.False=on,G.Float=sn,G.Int=cn,G.Map=ln,G.Nan=un,G.Null=dn,G.Set=fn,G.String=pn,G.True=mn,G.Undefined=hn,G.Url=gn,G.ValueQuote=nn,G.Arrow=$t,G.Colon=en,G.Quote=tn,G.Ellipsis=Gt,G.BraceLeft=Yt,G.BraceRight=Xt,G.BracketsLeft=Zt,G.BracketsRight=Qt,G.Copied=_n,G.CountInfo=Ht,G.CountInfoExtra=Rt,G.KeyName=Ct,G.Row=Dt,G.displayName=`JVR.JsonView`;var yn={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#002b36`,"--w-rjv-key-string":`#002b36`,"--w-rjv-background-color":`#ffffff`,"--w-rjv-line-color":`#ebebeb`,"--w-rjv-arrow-color":`var(--w-rjv-color)`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#0000004d`,"--w-rjv-update-color":`#ebcb8b`,"--w-rjv-copied-color":`#002b36`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#236a7c`,"--w-rjv-colon-color":`#002b36`,"--w-rjv-brackets-color":`#236a7c`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#cb4b16`,"--w-rjv-type-int-color":`#268bd2`,"--w-rjv-type-float-color":`#859900`,"--w-rjv-type-bigint-color":`#268bd2`,"--w-rjv-type-boolean-color":`#2aa198`,"--w-rjv-type-date-color":`#586e75`,"--w-rjv-type-url-color":`#0969da`,"--w-rjv-type-null-color":`#d33682`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#586e75`},bn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 19l-7-7l7-7m7 7H5`})}),xn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),K=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),Sn=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,y.jsx)(`rect`,{width:14,height:14,x:8,y:8,rx:2,ry:2}),(0,y.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})});function Cn(){let{id:e}=u.useSearch();return(0,y.jsx)(ur,{id:e})}function q(e){return e.toLocaleString()}var wn=new Set;function Tn(e){try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function J(e){if(!e)return{};try{return JSON.parse(e)}catch{return e}}function Y({text:e,dark:t}){let[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,y.jsx)(`button`,{type:`button`,className:`absolute top-2 right-2 p-1 rounded transition-colors ${t?`text-sand-500 hover:text-sand-300`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>{navigator.clipboard.writeText(e),r(!0)},children:n?(0,y.jsx)(xn,{className:`size-3.5 text-sage-500`}):(0,y.jsx)(Sn,{className:`size-3.5`})})}var En=/<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;function Dn(e){let t=[],n=0;for(let r of e.matchAll(En)){let i=r.index??0;i>n&&t.push({type:`text`,text:e.slice(n,i)}),t.push({type:`image`,src:r[1],alt:r[2]??`generated image`}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,text:e.slice(n)}),t.filter(e=>e.type===`image`||e.text.trim().length>0)}function On({text:e,markdown:t}){let[n,r]=(0,v.useState)(null),i=Dn(e);return i.some(e=>e.type===`image`)?(0,y.jsxs)(`div`,{className:`space-y-3`,children:[i.map((e,n)=>e.type===`text`?t?(0,y.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,y.jsx)(l,{remarkPlugins:[d],children:e.text})},`text-${n}`):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e.text},`text-${n}`):(0,y.jsx)(`button`,{type:`button`,className:`block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors`,onClick:()=>r(e.src),title:`Open image`,children:(0,y.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] max-w-full object-contain`,loading:`lazy`})},`image-${n}`)),n&&(0,y.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center`,onClick:()=>r(null),children:[(0,y.jsx)(`button`,{type:`button`,className:`absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white`,onClick:()=>r(null),title:`Close image`,children:(0,y.jsx)(c,{className:`size-5`})}),(0,y.jsx)(`img`,{src:n,alt:`generated preview`,className:`max-h-full max-w-full object-contain rounded-md bg-white`,onClick:e=>e.stopPropagation()})]})]}):t?(0,y.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,y.jsx)(l,{remarkPlugins:[d],children:e})}):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e})}function X({text:e,markdown:t}){let n=Tn(e),[r,i]=(0,v.useState)(`pretty`),a=n.ok&&n.value!==null&&(Array.isArray(n.value)||typeof n.value==`object`);return!n.ok||!a?t?(0,y.jsx)(On,{text:e,markdown:!0}):(0,y.jsx)(On,{text:n.ok?JSON.stringify(n.value,null,2):e}):(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`flex gap-1 mb-2`,children:[(0,y.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`plain`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`plain`),children:`Plain`}),(0,y.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`pretty`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`pretty`),children:`Pretty`})]}),r===`pretty`?(0,y.jsx)(G,{value:n.value,style:yn,displayDataTypes:!1,enableClipboard:!0,collapsed:!1}):(0,y.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:JSON.stringify(n.value,null,2)})]})}function Z({title:e,defaultOpen:t=!0,headerMetadata:n,onOpenChange:r,children:i}){let[a,o]=(0,v.useState)(t);return(0,y.jsxs)(`details`,{open:a,className:`group panel overflow-hidden`,onToggle:e=>{let t=e.currentTarget.open;o(t),r?.(t)},children:[(0,y.jsxs)(`summary`,{className:`panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5`,children:[(0,y.jsx)(K,{className:`size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90`}),(0,y.jsx)(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:e}),n&&(0,y.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400`,children:n})]}),(0,y.jsx)(`div`,{className:`p-4`,children:i})]})}function Q({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,y.jsx)(`dd`,{className:`text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate`,children:t})]})}var kn={running:`bg-blue-100 text-blue-600`,succeeded:`bg-sage-100 text-sage-600`,error:`bg-red-100 text-red-600`,aborted:`bg-caution-400/15 text-caution-500`};function An({message:e}){return(0,y.jsxs)(`div`,{className:`panel overflow-hidden border border-red-200 bg-red-50/60`,children:[(0,y.jsx)(`div`,{className:`px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5`,children:(0,y.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-red-600 font-medium`,children:`Error`})}),(0,y.jsx)(`div`,{className:`p-4`,children:(0,y.jsx)(`pre`,{className:`text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto`,children:e})})]})}function jn({data:e}){let t=e.status===`running`,n=h({status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method}),r=!t&&e.requested_model_name!==null&&e.model_name===null;return(0,y.jsxs)(`div`,{className:`panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5`,children:[(0,y.jsx)(`span`,{className:`text-[15px] font-semibold text-sand-900 break-all`,children:n.label===`—`?`Unknown model`:n.label}),r&&(0,y.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`요청`}),e.service_tier===`fast`&&(0,y.jsx)(`span`,{title:`Fast 모드`,className:`inline-flex shrink-0`,children:(0,y.jsx)(m,{"aria-label":`Fast 모드`,className:`size-3.5 text-[#1877F2] [&_path]:fill-current`})}),!t&&(e.fallback_count??0)>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:[`fallback ×`,e.fallback_count]}),!t&&e.status!==`succeeded`&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${kn[e.status]??`bg-sand-100 text-sand-500`}`,children:e.status}),e.response_json_ok===!1&&(0,y.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:`broken json`}),e.effort&&(0,y.jsxs)(`span`,{className:`text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono`,children:[`effort=`,e.effort]}),e.project_name&&(0,y.jsxs)(`span`,{className:`text-[12px] text-sand-400`,children:[`· project=`,e.project_name]}),(0,y.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400`,children:e.token_name})]})}function Mn({data:e,toolCallCount:t}){let n=In(e);return(0,y.jsxs)(`div`,{className:`panel overflow-hidden px-5 py-3 space-y-3`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,y.jsx)(Q,{label:`Duration`,value:`${(e.duration_ms/1e3).toFixed(1)}s`}),(0,y.jsx)(Q,{label:`TTFT`,value:Pn(e.ttft_ms)}),(0,y.jsx)(Q,{label:`Tokens/sec`,value:Ln(e.output_tokens,e.duration_ms,e.ttft_ms,n)}),(0,y.jsx)(Q,{label:`Driver`,value:e.cost_usd===null?`—`:f(e.cost_usd)}),(0,y.jsx)(Q,{label:`Image`,value:e.image_cost_usd===null?`—`:f(e.image_cost_usd)}),(0,y.jsx)(Q,{label:`Tool Calls`,value:`${t}회`})]}),(0,y.jsxs)(`div`,{className:`border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,y.jsx)(Q,{label:`Input`,value:q(e.input_tokens)}),(0,y.jsx)(Q,{label:`Output`,value:q(e.output_tokens)}),(0,y.jsx)(Q,{label:`Cache Read`,value:q(e.cache_read_tokens)}),(0,y.jsx)(Q,{label:`Cache Write`,value:q(e.cache_creation_tokens)}),(0,y.jsx)(Q,{label:`Cache Write (5m)`,value:e.cache_creation_5m_tokens===null?`—`:q(e.cache_creation_5m_tokens)}),(0,y.jsx)(Q,{label:`Cache Write (1h)`,value:e.cache_creation_1h_tokens===null?`—`:q(e.cache_creation_1h_tokens)}),(0,y.jsx)(Q,{label:`Cache Hit`,value:p(e)})]})]})}function Nn(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Pn(e){return e==null||e<=0?`—`:Nn(e)}function Fn(e){let t=e.model_name?.trim().toLowerCase();if(t){let e=t.includes(`/`)?t.split(`/`).pop():t;if(e.startsWith(`claude-`))return`anthropic`;if(/^(gpt-|codex-|o\d)/.test(e))return`openai`}let n=e.token_name?.trim().toLowerCase();return n?.startsWith(`anthropic/`)?`anthropic`:n?.startsWith(`openai/`)?`openai`:null}function In(e){let t=Fn(e);return t!==null&&wn.has(t)}function Ln(e,t,n,r){if(!r||e==null||t==null||n==null||n<=0)return`—`;let i=t-n;return e<=0||i<=0?`—`:`${Math.round(e/(i/1e3)).toLocaleString()} tok/s`}function $({label:e,value:t}){return(0,y.jsxs)(`div`,{className:`min-w-0 self-end`,children:[e&&(0,y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,y.jsx)(`div`,{className:`mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate`,children:t})]})}function Rn(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.inputImages;return Array.isArray(t)?t:void 0}function zn(e){return(Rn(e)??[]).filter(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.url==`string`&&t.url.length>0||typeof t.data==`string`&&t.data.length>0})}function Bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=Rn(t);return n?{...t,inputImages:n.map(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=typeof t.url==`string`&&t.url.toLowerCase().startsWith(`data:`)?`[data-url ${t.url.length} chars]`:t.url;return{mediaType:t.mediaType,byteSize:t.byteSize,...n?{url:n}:{},...t.data?{data:`[base64 ${t.data.length} chars]`}:{}}})}:e}function Vn({images:e}){let t=e.map((e,t)=>{let n=e.url&&!e.url.startsWith(`[`)?e.url:void 0,r=e.data?`data:${e.mediaType??`image/png`};base64,${e.data}`:``,i=n??r;return i?{image:e,index:t,src:i}:null}).filter(e=>e!==null);return t.length===0?null:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Input Images`}),(0,y.jsx)(`div`,{className:`mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2`,children:t.map(({image:e,index:t,src:n})=>(0,y.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-white overflow-hidden`,children:[(0,y.jsx)(`img`,{src:n,alt:`reference ${t+1}`,className:`max-h-64 w-full object-contain bg-white`,loading:`lazy`}),(0,y.jsxs)(`div`,{className:`px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100`,children:[e.mediaType??`image`,` ·`,` `,e.byteSize===void 0?`url`:`${e.byteSize.toLocaleString()} bytes`]})]},`${e.mediaType??`image`}-${t}`))})]})}function Hn({images:e,stepId:t}){let{data:n}=a.useRequestLogStep(`I`,t??0,{enabled:e===null&&t!==null}),r=n?J(n.tool_args):null;return(0,y.jsx)(Vn,{images:e??zn(r)})}function Un({entry:e}){let t=!!e.error,[n,r]=(0,v.useState)(!1),{data:i}=a.useRequestLogStep(`A`,e.id,{enabled:n}),o=Bn(i?J(i.tool_args):null),s=i?J(i.tool_result):null,c=i?.error??e.error;return(0,y.jsxs)(`details`,{className:`group/tool`,onToggle:e=>r(e.currentTarget.open),children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md`,children:[(0,y.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0`}),(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:[`call `,e.callIndex+1]}),(0,y.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 font-mono truncate`,children:e.toolName}),t&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:`error`}),(0,y.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:Nn(e.durationMs)})]}),n&&(0,y.jsxs)(`div`,{className:`mt-1 mx-1 mb-3 space-y-2`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Request`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:i?JSON.stringify(o):`Loading...`})})]}),c&&(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-red-500 font-medium px-2`,children:`Error`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:c})})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Response`}),(0,y.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,y.jsx)(X,{text:i?typeof s==`string`?s:JSON.stringify(s):`Loading...`,markdown:!0})})]})]})]})}function Wn({stepId:e}){let[t,n]=(0,v.useState)(!1),{data:r}=a.useRequestLogStep(`A`,e,{enabled:t}),i=r?.reasoning_text??null;return(0,y.jsxs)(`details`,{className:`group/reason mt-3`,onToggle:e=>n(e.currentTarget.open),children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 cursor-pointer select-none list-none`,children:[(0,y.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0`}),(0,y.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Reasoning`})]}),t&&(0,y.jsx)(`div`,{className:`mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto`,children:i?(0,y.jsx)(X,{text:i,markdown:!0}):r?(0,y.jsx)(`p`,{className:`text-sm text-sand-400`,children:`No reasoning text captured.`}):(0,y.jsx)(`p`,{className:`text-sm text-sand-400`,children:`Loading...`})})]})}function Gn({entry:e,tokensPerSecEnabled:t}){let n=e.generate,r=n!==null&&n.reasoningTokens!==null&&n.reasoningTokens!==void 0&&n.reasoningTokens>0,i=e.toolCalls.filter(e=>e.error).length;return(0,y.jsxs)(`details`,{open:!0,className:`group/step border-l border-sand-200 pl-3`,children:[(0,y.jsxs)(`summary`,{className:`flex items-center gap-2 py-2 cursor-pointer select-none list-none`,children:[(0,y.jsx)(K,{className:`size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0`}),(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0`,children:[`step `,e.stepIndex+1]}),(0,y.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-900`,children:`LLM call`}),n?.finishReason&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:n.finishReason}),n&&(n.fallbackCount??0)>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0`,children:[n.requestedModelName,` → `,n.modelName]}),r&&(0,y.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0`,children:`reasoning`}),i>0&&(0,y.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:[i,` error`]}),(0,y.jsxs)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:[e.toolCalls.length,` tools`]})]}),(0,y.jsxs)(`div`,{className:`ml-4 mb-4 space-y-3`,children:[n&&(0,y.jsxs)(`div`,{className:`rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3`,children:[(0,y.jsx)($,{label:`Duration`,value:Nn(n.durationMs)}),(0,y.jsx)($,{label:`TTFT`,value:Pn(n.ttftMs)}),(0,y.jsx)($,{label:`Tokens/sec`,value:Ln(n.outputTokens,n.durationMs,n.ttftMs,t)}),(0,y.jsx)($,{label:`Input`,value:q(n.inputTokens??0)}),(0,y.jsx)($,{label:`Output`,value:q(n.outputTokens??0)}),(0,y.jsx)($,{label:`Cache Read`,value:q(n.cacheReadTokens??0)}),(0,y.jsx)($,{label:`Cache Write`,value:q(n.cacheCreationTokens??0)}),(0,y.jsx)($,{label:`Cache 5m / 1h`,value:`${n.cacheCreation5mTokens===null?`—`:q(n.cacheCreation5mTokens)} / ${n.cacheCreation1hTokens===null?`—`:q(n.cacheCreation1hTokens)}`}),(0,y.jsx)($,{value:n.costUsd===null?`—`:f(n.costUsd)}),(0,y.jsx)($,{label:`Reasoning`,value:n.reasoningTokens!==null&&n.reasoningTokens!==void 0?q(n.reasoningTokens):`—`})]}),r&&(0,y.jsx)(Wn,{stepId:n.id})]}),e.toolCalls.length>0&&(0,y.jsx)(`div`,{className:`space-y-0.5`,children:e.toolCalls.map(e=>(0,y.jsx)(Un,{entry:e},`${e.stepIndex}-${e.callIndex}-${e.toolCallId}`))})]})]})}function Kn({steps:e,tokensPerSecEnabled:t}){let n=e.reduce((e,t)=>e+t.toolCalls.length,0);return(0,y.jsx)(Z,{title:`Steps (${e.length} steps · ${n} tool calls)`,defaultOpen:!0,children:(0,y.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,y.jsx)(Gn,{entry:e,tokensPerSecEnabled:t},e.stepIndex))})})}function qn(e){let t=new Map;function n(e){let n=t.get(e);if(n)return n;let r={stepIndex:e,generate:null,toolCalls:[]};return t.set(e,r),r}for(let t of e){let e=n(t.step_index);if(t.type===`generate`){e.generate={id:t.id,stepIndex:t.step_index,modelName:t.model_name,requestedModelName:t.requested_model_name,fallbackCount:t.fallback_count,inputTokens:t.input_tokens,outputTokens:t.output_tokens,cacheReadTokens:t.cache_read_tokens,cacheCreationTokens:t.cache_creation_tokens,cacheCreation5mTokens:t.cache_creation_5m_tokens,cacheCreation1hTokens:t.cache_creation_1h_tokens,costUsd:t.cost_usd,durationMs:t.duration_ms,ttftMs:t.ttft_ms,finishReason:t.finish_reason,reasoningTokens:t.reasoning_tokens};continue}t.type===`tool_call`&&e.toolCalls.push({id:t.id,stepIndex:t.step_index,callIndex:t.tool_call_index??e.toolCalls.length,toolCallId:t.tool_call_id??``,toolName:t.tool_name??``,durationMs:t.tool_duration_ms??0,error:t.error})}return[...t.values()].map(e=>({...e,toolCalls:e.toolCalls.toSorted((e,t)=>e.callIndex-t.callIndex)})).toSorted((e,t)=>e.stepIndex-t.stepIndex)}function Jn(e){return e.type===`function_call`||e.type===`function_call_output`?`bg-caution-400/10`:e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}function Yn(e){return e.type===`function_call`?`fn: ${e.name??`unknown`}`:e.type===`function_call_output`?`fn result`:e.role??e.type}function Xn(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>typeof e==`object`&&e&&`text`in e?e.text:JSON.stringify(e)).join(`
2
+ `):JSON.stringify(e)}function Zn({className:e,children:t}){return(0,y.jsx)(`pre`,{className:`text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${e??``}`,children:t})}function Qn({history:e}){return(0,y.jsx)(Z,{title:`History`,defaultOpen:!1,children:(0,y.jsx)(`div`,{className:`space-y-1.5`,children:e.map((e,t)=>(0,y.jsxs)(`div`,{className:`rounded-md px-3 py-2 ${Jn(e)}`,children:[(0,y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1`,children:Yn(e)}),e.content!==null&&e.content!==void 0&&(0,y.jsx)(Zn,{children:Xn(e.content)}),e.arguments&&(0,y.jsx)(Zn,{children:e.arguments}),e.output&&(0,y.jsx)(Zn,{children:e.output})]},`hist-${t}`))})})}var $n=60,er=30,tr=18;function nr(e,t=$n){let n=[];for(let r of e){if([...n,r.name].join(`, `).length>t)break;n.push(r.name)}return{names:n,omittedCount:e.length-n.length}}function rr({tools:e}){let t=nr(e),n=nr(e,er),r=nr(e,tr);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`shrink-0`,children:`·`}),t.names.length>0&&(0,y.jsx)(`span`,{className:`hidden shrink-0 xl:inline`,children:t.names.join(`, `)}),t.omittedCount>0&&(0,y.jsxs)(`span`,{className:`hidden shrink-0 xl:inline`,children:[`+`,t.omittedCount]}),n.names.length>0&&(0,y.jsx)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:n.names.join(`, `)}),n.omittedCount>0&&(0,y.jsxs)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:[`+`,n.omittedCount]}),r.names.length>0&&(0,y.jsx)(`span`,{className:`shrink-0 sm:hidden`,children:r.names.join(`, `)}),r.omittedCount>0&&(0,y.jsxs)(`span`,{className:`shrink-0 sm:hidden`,children:[`+`,r.omittedCount]})]})}function ir({code:e,fullCode:t}){let n=(0,v.useMemo)(()=>cr(e),[e]);return(0,y.jsx)(`pre`,{"data-zod-parameter-shape":!0,className:`max-h-64 overflow-auto rounded-md bg-sand-900 px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre text-sand-200 ${t?`cursor-help outline-none focus-visible:ring-2 focus-visible:ring-sienna-300`:``}`,tabIndex:t?0:void 0,title:t,children:t?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,y.jsx)(`span`,{className:`sr-only`,children:t})]}):n})}function ar({tool:e}){return(0,y.jsxs)(`div`,{className:`min-w-0 rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,y.jsx)(`div`,{className:`break-all font-mono text-[13px] font-semibold text-sand-900`,children:e.name}),e.description&&(0,y.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-sand-700`,children:e.description}),(0,y.jsxs)(`div`,{className:`mt-3`,children:[(0,y.jsxs)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase tracking-wider text-sand-400`,children:[`Parameters (`,e.parameterCount,`)`]}),(0,y.jsx)(ir,{code:e.inputZod,fullCode:e.fullInputZod})]})]})}function or({id:e,tools:n}){let[r,i]=(0,v.useState)(!1),a=t({...o.toolsViewQueryOptions(e),enabled:r,staleTime:e=>e.state.data&&e.state.data.length>0?1/0:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),s=a.data!==void 0&&a.data.length>0;return(0,y.jsx)(Z,{title:`Tools (${n.length})`,defaultOpen:!1,headerMetadata:(0,y.jsx)(rr,{tools:n}),onOpenChange:i,children:a.isFetching&&!s?(0,y.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Loading tool contracts…`}):a.isError||!s?(0,y.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Tool contracts could not be loaded.`}):(0,y.jsx)(`div`,{className:`space-y-2`,children:a.data.map((e,t)=>(0,y.jsx)(ar,{tool:e},`${e.name}-${t}`))})})}var sr=/("(?:[^"\\]|\\.)*")|(\b\d+(?:\.\d+)?\b)|(\btype\b|\bz\b(?=\.))|(\b(?:string|number|boolean|null|unknown|Record)\b)|([{}[\]()<>|?:,.=])|([A-Za-z_$][\w$]*)|(\s+|.)/g;function cr(e){let t=[],n=!1;for(let r of e.matchAll(sr)){let[e,i,a,o,s,c,l]=r,u=`${r.index}-${e}`;i||a?t.push((0,y.jsx)(`span`,{className:`text-sage-400`,children:e},u)):o?(n=e===`type`,t.push((0,y.jsx)(`span`,{className:`text-sienna-400`,children:e},u))):s?t.push((0,y.jsx)(`span`,{className:`text-blue-300`,children:e},u)):c?t.push((0,y.jsx)(`span`,{className:`text-sand-500`,children:e},u)):l&&n?(n=!1,t.push((0,y.jsx)(`span`,{className:`font-semibold text-sand-50`,children:e},u))):t.push(e)}return t}function lr({id:e}){let{data:t}=o.useResponseTypeTs(e),[n,r]=(0,v.useState)(`zod`),{zod:i=null,typescript:a=null}=t??{},s=n===`zod`?i??a:a??i,c=(0,v.useMemo)(()=>s===null?null:cr(s),[s]);return!t||s===null||c===null?null:(0,y.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`panel-header flex items-center px-4 py-2`,children:[(0,y.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:`Response Type`}),(0,y.jsx)(`div`,{className:`ml-auto flex gap-1`,children:[{value:`zod`,label:`zod`,available:i!==null},{value:`ts`,label:`ts`,available:a!==null}].map(e=>(0,y.jsx)(`button`,{type:`button`,disabled:!e.available,className:`px-3 py-1 text-[12px] font-mono rounded-md transition-colors ${n===e.value?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600 disabled:text-sand-300 disabled:cursor-not-allowed`}`,onClick:()=>r(e.value),children:e.label},e.value))})]}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:s,dark:!0}),(0,y.jsx)(`pre`,{className:`bg-sand-900 px-4 py-3 text-[12px] text-sand-200 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-64 overflow-auto`,children:c})]})]})}function ur({id:e}){let{data:t,isLoading:r,error:i,isError:c}=o.useRequestLog(`A`,e),{data:l,isLoading:u,isError:d}=a.useRequestLogSteps(`T`,{request_log_id:e,num:0,page:1,orderBy:`id-asc`}),f=qn(l?.rows??[]);if(r||u)return(0,y.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,y.jsx)(`div`,{className:`h-4 w-32 bg-sand-200 rounded animate-pulse`}),(0,y.jsx)(`div`,{className:`h-40 panel animate-pulse`}),(0,y.jsx)(`div`,{className:`h-32 panel animate-pulse`})]});if(c||d||!t)return(0,y.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,y.jsxs)(n,{to:`/logs`,className:`flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4`,children:[(0,y.jsx)(bn,{className:`size-3.5`}),`Back to Logs`]}),(0,y.jsx)(`p`,{role:`alert`,className:`text-danger-500 text-sm`,children:c?s(i)&&i.code===404?`Request not found.`:`Failed to load request.`:d?`Failed to load request steps.`:`Request not found.`})]});let p=f.flatMap(e=>e.toolCalls),m=p.find(e=>e.toolName===`image_generation`)?.id??null,h=f.length>0,g=In(t),_=t.history??null,v=_!==null&&_.length>0,b=t.tools??null,x=b!==null&&b.length>0,S=t.is_structured?(0,y.jsx)(lr,{id:e}):null,C=(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(Z,{title:`System`,children:(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.system_prompt??`null`}),(0,y.jsx)(X,{text:t.system_prompt??`null`,markdown:!0})]})}),(0,y.jsx)(Z,{title:`User`,children:(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.user_prompt??`null`}),(0,y.jsx)(X,{text:t.user_prompt??`null`,markdown:!0})]}),(0,y.jsx)(Hn,{images:t.input_images,stepId:m})]})})]});return(0,y.jsxs)(`div`,{className:`mx-auto space-y-4 ${h?`max-w-[120rem]`:`max-w-6xl`}`,children:[(0,y.jsxs)(n,{to:`/logs`,className:`inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors`,children:[(0,y.jsx)(bn,{className:`size-3.5`}),`Back to Logs`]}),(0,y.jsx)(jn,{data:t}),t.error_message&&(0,y.jsx)(An,{message:t.error_message}),v&&(0,y.jsx)(Qn,{history:_}),h?(0,y.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4 items-stretch lg:items-start`,children:[(0,y.jsxs)(`div`,{className:`order-1 lg:order-2 flex-1 min-w-0 space-y-4`,children:[S,x&&(0,y.jsx)(or,{id:e,tools:b}),(0,y.jsx)(Kn,{steps:f,tokensPerSecEnabled:g})]}),(0,y.jsx)(`div`,{className:`order-2 lg:order-1 flex-1 min-w-0`,children:C})]}):(0,y.jsxs)(y.Fragment,{children:[S,x&&(0,y.jsx)(or,{id:e,tools:b}),C]}),(0,y.jsx)(Z,{title:`Response`,children:(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(Y,{text:t.response}),(0,y.jsx)(X,{text:t.response,markdown:!0})]})}),(0,y.jsx)(Mn,{data:t,toolCallCount:p.length}),(0,y.jsx)(`div`,{className:`pb-8`})]})}export{Cn as component};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-BsieU37H.js";import{f as o,o as s}from"./index-CrXKu_J8.js";import{t as c}from"./use-update-token-mutation-DAq0F8p-.js";import{n as l,t as u}from"./use-oauth-login-flow-D0UaR9_e.js";import{t as d}from"./plus-B62CuqT8.js";var f=e(n(),1),p=r();function m(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(``),i=u(),a=()=>{t(!1),r(``),i.reset()},c=async e=>{await i.submitCode(e)&&a()};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,className:`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm`,onClick:()=>t(!0),children:[(0,p.jsx)(d,{className:`size-3.5`}),`Add Token`]}),e&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:a,onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/50`,children:(0,p.jsx)(`h2`,{className:`text-base font-medium text-sand-900`,children:`Add Token`})}),(0,p.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name *`}),(0,p.jsx)(s,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. your-token-name`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]}),i.codeEntryProvider?(0,p.jsx)(l,{provider:i.codeEntryProvider,isPending:i.completeMutation.isPending,isError:i.completeMutation.isError,onSubmit:e=>void c(e),onRestart:i.reset}):(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`openai`,n),children:i.loadingProvider===`openai`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with OpenAI`]})}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`}),(0,p.jsx)(`span`,{className:`text-[10px] text-sand-400 uppercase`,children:`or`}),(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`})]}),(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`anthropic`,n),children:i.loadingProvider===`anthropic`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with Claude`]})})]})]}),(0,p.jsx)(`div`,{className:`px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2`,children:(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:a,children:`Cancel`})})]})]})]})}var h=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`})}),g=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})});function _(e){if(!e||typeof e!=`object`)return`—`;if(`authSource`in e&&e.authSource===`system-keychain`)return`System Keychain`;let t=`accessToken`in e?e.accessToken:void 0;return typeof t!=`string`||!t?`—`:t.length<=12?t:`${t.slice(0,8)}...${t.slice(-4)}`}function v(e){let t=e.credentials;return`expiresAt`in t&&typeof t.expiresAt==`number`?t.expiresAt:`accessTokenExpiresAt`in t&&typeof t.accessTokenExpiresAt==`number`?t.accessTokenExpiresAt:null}function y(e){if(!e)return{text:``,color:``};let t=e-Date.now();if(t<=0)return{text:`expired`,color:`text-red-500`};let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=n>0?`${n}h ${r}m`:`${r}m`;return t<36e5?{text:i,color:`text-amber-500`}:{text:i,color:`text-sand-400`}}function b({data:e,isLoading:n}){let[r,a]=(0,f.useState)(null),[o,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),m=t(),b=i.useRemoveTokenMutation(),x=c(),S=i.useToggleTokenMutation(),C=()=>Promise.all([m.invalidateQueries({queryKey:[`Token`]}),m.invalidateQueries({queryKey:[`Qgrid`]})]),w=async e=>{await S.mutateAsync({id:e.id}),await C()},T=async()=>{r&&(await b.mutateAsync({id:r.id}),await C(),a(null))},E=e=>{l(e),d(e.name??``)},D=async()=>{o&&(await x.mutateAsync({id:o.id,name:u.trim()}),await C(),l(null))};if(n)return(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsx)(`div`,{className:`h-12 bg-sand-100 rounded-md animate-pulse`},`skeleton-${t}`))});let O=e??[];return O.length===0?(0,p.jsxs)(`div`,{className:`text-sand-400 text-center py-16 text-sm`,children:[`No tokens registered. Click `,(0,p.jsx)(`strong`,{className:`text-sand-600`,children:`Add Token`}),` to get started.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`panel overflow-hidden`,children:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full min-w-[640px] text-[13px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`panel-header`,children:[(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Provider`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Name`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Token`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Expires`}),(0,p.jsx)(`th`,{className:`w-20 px-3 py-2.5`})]})}),(0,p.jsx)(`tbody`,{className:`divide-y divide-sand-100/80`,children:O.map(e=>{let t=y(v(e));return(0,p.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 ${e.active?``:`opacity-50`}`,children:[(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`span`,{className:`text-xs font-medium text-sand-500 uppercase`,children:e.provider})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:e.name?(0,p.jsx)(`span`,{className:`text-sm text-sand-700`,children:e.name}):(0,p.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`—`})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(e.credentials)})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`button`,{type:`button`,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${e.active?`bg-sage-400`:`bg-sand-300`}`,onClick:()=>w(e),disabled:S.isPending||!e.active&&e.reauth_required,title:!e.active&&e.reauth_required?`재로그인이 필요한 토큰입니다`:void 0,children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e.active?`translate-x-4.5`:`translate-x-0.5`}`})})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:t.text&&(0,p.jsx)(`span`,{className:`text-xs ${t.color}`,children:t.text})}),(0,p.jsx)(`td`,{className:`px-3 py-3`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150`,onClick:()=>E(e),children:(0,p.jsx)(h,{className:`size-4`})}),(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150`,onClick:()=>a(e),children:(0,p.jsx)(g,{className:`size-4`})})]})})]},e.id)})})]})})}),o&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>l(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Edit Token`})}),(0,p.jsx)(`div`,{className:`px-5 py-4 space-y-3`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name`}),(0,p.jsx)(s,{value:u,onChange:e=>d(e.target.value),placeholder:`e.g. prod, dev, team-a`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]})}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>l(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:x.isPending,onClick:D,children:x.isPending?`Saving...`:`Save`})]})]})]}),r&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>a(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Remove Token`}),(0,p.jsxs)(`p`,{className:`text-sm text-sand-700 mt-2`,children:[`Are you sure you want to remove`,` `,(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(r.credentials)}),r.name&&(0,p.jsxs)(`span`,{className:`text-sand-500`,children:[` (`,r.name,`)`]}),`?`]})]}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>a(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150`,disabled:b.isPending,onClick:T,children:b.isPending?`Removing...`:`Remove`})]})]})]})]})}function x(){let{data:e,isLoading:t}=a.useTokens(`A`);return(0,p.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,p.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,p.jsx)(m,{})}),(0,p.jsx)(b,{data:e?.rows,isLoading:t})]})}export{x as component};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-NP-ValHd.js";import{f as o,o as s}from"./index-DZwzUfI-.js";import{t as c}from"./use-update-token-mutation-BQHS0byG.js";import{n as l,t as u}from"./use-oauth-login-flow-hboOs3wG.js";import{t as d}from"./plus-B62CuqT8.js";var f=e(n(),1),p=r();function m(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(``),i=u(),a=()=>{t(!1),r(``),i.reset()},c=async e=>{await i.submitCode(e)&&a()};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,className:`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm`,onClick:()=>t(!0),children:[(0,p.jsx)(d,{className:`size-3.5`}),`Add Token`]}),e&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:a,onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/50`,children:(0,p.jsx)(`h2`,{className:`text-base font-medium text-sand-900`,children:`Add Token`})}),(0,p.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name *`}),(0,p.jsx)(s,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. your-token-name`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]}),i.codeEntryProvider?(0,p.jsx)(l,{provider:i.codeEntryProvider,isPending:i.completeMutation.isPending,isError:i.completeMutation.isError,onSubmit:e=>void c(e),onRestart:i.reset}):(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`openai`,n),children:i.loadingProvider===`openai`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with OpenAI`]})}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`}),(0,p.jsx)(`span`,{className:`text-[10px] text-sand-400 uppercase`,children:`or`}),(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`})]}),(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`anthropic`,n),children:i.loadingProvider===`anthropic`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with Claude`]})})]})]}),(0,p.jsx)(`div`,{className:`px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2`,children:(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:a,children:`Cancel`})})]})]})]})}var h=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`})}),g=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})});function _(e){if(!e||typeof e!=`object`)return`—`;if(`authSource`in e&&e.authSource===`system-keychain`)return`System Keychain`;let t=`accessToken`in e?e.accessToken:void 0;return typeof t!=`string`||!t?`—`:t.length<=12?t:`${t.slice(0,8)}...${t.slice(-4)}`}function v(e){let t=e.credentials;return`expiresAt`in t&&typeof t.expiresAt==`number`?t.expiresAt:`accessTokenExpiresAt`in t&&typeof t.accessTokenExpiresAt==`number`?t.accessTokenExpiresAt:null}function y(e){if(!e)return{text:``,color:``};let t=e-Date.now();if(t<=0)return{text:`expired`,color:`text-red-500`};let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=n>0?`${n}h ${r}m`:`${r}m`;return t<36e5?{text:i,color:`text-amber-500`}:{text:i,color:`text-sand-400`}}function b({data:e,isLoading:n}){let[r,a]=(0,f.useState)(null),[o,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),m=t(),b=i.useRemoveTokenMutation(),x=c(),S=i.useToggleTokenMutation(),C=()=>Promise.all([m.invalidateQueries({queryKey:[`Token`]}),m.invalidateQueries({queryKey:[`Qgrid`]})]),w=async e=>{await S.mutateAsync({id:e.id}),await C()},T=async()=>{r&&(await b.mutateAsync({id:r.id}),await C(),a(null))},E=e=>{l(e),d(e.name??``)},D=async()=>{o&&(await x.mutateAsync({id:o.id,name:u.trim()}),await C(),l(null))};if(n)return(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsx)(`div`,{className:`h-12 bg-sand-100 rounded-md animate-pulse`},`skeleton-${t}`))});let O=e??[];return O.length===0?(0,p.jsxs)(`div`,{className:`text-sand-400 text-center py-16 text-sm`,children:[`No tokens registered. Click `,(0,p.jsx)(`strong`,{className:`text-sand-600`,children:`Add Token`}),` to get started.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`panel overflow-hidden`,children:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full min-w-[640px] text-[13px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`panel-header`,children:[(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Provider`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Name`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Token`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Expires`}),(0,p.jsx)(`th`,{className:`w-20 px-3 py-2.5`})]})}),(0,p.jsx)(`tbody`,{className:`divide-y divide-sand-100/80`,children:O.map(e=>{let t=y(v(e));return(0,p.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 ${e.active?``:`opacity-50`}`,children:[(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`span`,{className:`text-xs font-medium text-sand-500 uppercase`,children:e.provider})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:e.name?(0,p.jsx)(`span`,{className:`text-sm text-sand-700`,children:e.name}):(0,p.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`—`})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(e.credentials)})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`button`,{type:`button`,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${e.active?`bg-sage-400`:`bg-sand-300`}`,onClick:()=>w(e),disabled:S.isPending||!e.active&&e.reauth_required,title:!e.active&&e.reauth_required?`재로그인이 필요한 토큰입니다`:void 0,children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e.active?`translate-x-4.5`:`translate-x-0.5`}`})})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:t.text&&(0,p.jsx)(`span`,{className:`text-xs ${t.color}`,children:t.text})}),(0,p.jsx)(`td`,{className:`px-3 py-3`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150`,onClick:()=>E(e),children:(0,p.jsx)(h,{className:`size-4`})}),(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150`,onClick:()=>a(e),children:(0,p.jsx)(g,{className:`size-4`})})]})})]},e.id)})})]})})}),o&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>l(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Edit Token`})}),(0,p.jsx)(`div`,{className:`px-5 py-4 space-y-3`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name`}),(0,p.jsx)(s,{value:u,onChange:e=>d(e.target.value),placeholder:`e.g. prod, dev, team-a`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]})}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>l(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:x.isPending,onClick:D,children:x.isPending?`Saving...`:`Save`})]})]})]}),r&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>a(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Remove Token`}),(0,p.jsxs)(`p`,{className:`text-sm text-sand-700 mt-2`,children:[`Are you sure you want to remove`,` `,(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(r.credentials)}),r.name&&(0,p.jsxs)(`span`,{className:`text-sand-500`,children:[` (`,r.name,`)`]}),`?`]})]}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>a(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150`,disabled:b.isPending,onClick:T,children:b.isPending?`Removing...`:`Remove`})]})]})]})]})}function x(){let{data:e,isLoading:t}=a.useTokens(`A`);return(0,p.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,p.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,p.jsx)(m,{})}),(0,p.jsx)(b,{data:e?.rows,isLoading:t})]})}export{x as component};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-BsieU37H.js";import{o}from"./index-CrXKu_J8.js";var s=e(n(),1),c=r();function l({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,l]=(0,s.useState)(``),u=e===`openai`;return(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:u?`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`}),(0,c.jsx)(o,{value:a,onChange:e=>l(e.target.value),placeholder:u?`http://localhost:1455/auth/callback?code=...&state=...`:`code#state`,className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,c.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,c.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{l(``),i()},children:`처음부터 다시 시작`})]})}var u=3e3,d=3e5;async function f(e,t){let{rows:n}=await a.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function p(){let[e,n]=(0,s.useState)(null),[r,a]=(0,s.useState)(null),o=t(),c=i.useOauthStartMutation(),l=i.useOauthStartOpenAIMutation(),p=i.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}};(0,s.useEffect)(()=>g,[]);let _=()=>Promise.all([o.invalidateQueries({queryKey:[`Token`]}),o.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:r,start:async(e,t)=>{let r=t.trim();if(!r)return;g();let i=h.current,o=window.open(`about:blank`,`_blank`);n(e);try{if(e===`openai`){let t=await f(e,r);if(i!==h.current){o?.close();return}let{authUrl:s,mode:c}=await l.mutateAsync({name:r});if(i!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){a(e),n(null);return}m.current.interval=window.setInterval(()=>{f(e,r).then(e=>{i===h.current&&[...e].some(e=>!t.has(e))&&(g(),n(null),_())}).catch(()=>{})},u),m.current.timeout=window.setTimeout(()=>{i===h.current&&(g(),n(null))},d);return}let{authUrl:t,mode:s}=await c.mutateAsync({name:r});if(i!==h.current){o?.close();return}s===`code`?(o?o.location.href=t:window.open(t,`_blank`),a(e),n(null)):(o?.close(),window.location.href=t)}catch(e){if(o?.close(),i!==h.current)return;console.error(`OAuth start failed:`,e),n(null)}},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),n(null),a(null),p.reset()},completeMutation:p}}export{l as n,p as t};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-NP-ValHd.js";import{o}from"./index-DZwzUfI-.js";var s=e(n(),1),c=r();function l({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,l]=(0,s.useState)(``),u=e===`openai`;return(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:u?`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`}),(0,c.jsx)(o,{value:a,onChange:e=>l(e.target.value),placeholder:u?`http://localhost:1455/auth/callback?code=...&state=...`:`code#state`,className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,c.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,c.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{l(``),i()},children:`처음부터 다시 시작`})]})}var u=3e3,d=3e5;async function f(e,t){let{rows:n}=await a.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function p(){let[e,n]=(0,s.useState)(null),[r,a]=(0,s.useState)(null),o=t(),c=i.useOauthStartMutation(),l=i.useOauthStartOpenAIMutation(),p=i.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}};(0,s.useEffect)(()=>g,[]);let _=()=>Promise.all([o.invalidateQueries({queryKey:[`Token`]}),o.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:r,start:async(e,t)=>{let r=t.trim();if(!r)return;g();let i=h.current,o=window.open(`about:blank`,`_blank`);n(e);try{if(e===`openai`){let t=await f(e,r);if(i!==h.current){o?.close();return}let{authUrl:s,mode:c}=await l.mutateAsync({name:r});if(i!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){a(e),n(null);return}m.current.interval=window.setInterval(()=>{f(e,r).then(e=>{i===h.current&&[...e].some(e=>!t.has(e))&&(g(),n(null),_())}).catch(()=>{})},u),m.current.timeout=window.setTimeout(()=>{i===h.current&&(g(),n(null))},d);return}let{authUrl:t,mode:s}=await c.mutateAsync({name:r});if(i!==h.current){o?.close();return}s===`code`?(o?o.location.href=t:window.open(t,`_blank`),a(e),n(null)):(o?.close(),window.location.href=t)}catch(e){if(o?.close(),i!==h.current)return;console.error(`OAuth start failed:`,e),n(null)}},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),n(null),a(null),p.reset()},completeMutation:p}}export{l as n,p as t};
@@ -1 +1 @@
1
- import{m as e}from"./vendor-tanstack-DJRQAbrY.js";import{n as t}from"./services.generated-BsieU37H.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
1
+ import{m as e}from"./vendor-tanstack-DJRQAbrY.js";import{n as t}from"./services.generated-NP-ValHd.js";function n(){return e({mutationFn:({id:e,name:n,quotaThreshold:r,weight:i,keepaliveEnabled:a})=>t.updateToken(e,n,r,i,a)})}export{n as t};
@@ -5,12 +5,12 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/sonamu.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Qgrid</title>
8
- <script type="module" crossorigin src="/assets/index-CrXKu_J8.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DZwzUfI-.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dw2cE7zH.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-DH4kUfK2.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/vendor-tanstack-DJRQAbrY.js">
13
- <link rel="modulepreload" crossorigin href="/assets/services.generated-BsieU37H.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/services.generated-NP-ValHd.js">
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-Bw2s88Ot.css">
15
15
  </head>
16
16
  <body>
@@ -1,5 +1,5 @@
1
- import { A as require_react, X as __toESM, k as require_jsx_runtime, q as __commonJSMin } from "./services.generated-CEbGjsI0.js";
2
- import { n as require_shim, t as require_react_dom } from "./react-dom-B4a6-uuR.js";
1
+ import { A as require_react, X as __toESM, k as require_jsx_runtime, q as __commonJSMin } from "./services.generated-BA4AcAf5.js";
2
+ import { n as require_shim, t as require_react_dom } from "./react-dom-Ds75e4Jl.js";
3
3
  //#region ../../node_modules/.pnpm/@tanstack+router-core@1.143.6/node_modules/@tanstack/router-core/dist/esm/utils.js
4
4
  function last(arr) {
5
5
  return arr[arr.length - 1];
@@ -1,9 +1,9 @@
1
- import { A as require_react, S as string, k as require_jsx_runtime, n as QgridService, o as TokenService, r as RequestLogService, x as object } from "./services.generated-CEbGjsI0.js";
2
- import { a as Link, o as useNavigate } from "./lazyRouteComponent-Dtd0NR4r.js";
1
+ import { A as require_react, S as string, k as require_jsx_runtime, n as QgridService, o as TokenService, r as RequestLogService, x as object } from "./services.generated-BA4AcAf5.js";
2
+ import { a as Link, o as useNavigate } from "./lazyRouteComponent-CgBdabgd.js";
3
3
  import { i as RequestLogOrderBy, n as Route, r as RequestLogBaseListParams } from "../entry-server.generated.js";
4
4
  import { i as formatUsd, r as formatRequestCost, t as cacheHitRate } from "./cost-eEHeTRT5.js";
5
- import { t as lucideRefreshCw } from "./refresh-cw-BND93JrF.js";
6
- import { n as lucideZap, t as requestModelDisplay } from "./request-model-CbqfnQOJ.js";
5
+ import { t as lucideRefreshCw } from "./refresh-cw-CztCFis-.js";
6
+ import { n as lucideZap, t as requestModelDisplay } from "./request-model-DjGldb-h.js";
7
7
  require_react();
8
8
  var import_jsx_runtime = require_jsx_runtime();
9
9
  var lucideChevronLeft = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
@@ -1,8 +1,8 @@
1
- import { A as require_react, E as useQuery, X as __toESM, k as require_jsx_runtime, m as _enum, t as MonitService, x as object } from "./services.generated-CEbGjsI0.js";
2
- import { t as require_react_dom } from "./react-dom-B4a6-uuR.js";
1
+ import { A as require_react, E as useQuery, X as __toESM, k as require_jsx_runtime, m as _enum, t as MonitService, x as object } from "./services.generated-BA4AcAf5.js";
2
+ import { t as require_react_dom } from "./react-dom-Ds75e4Jl.js";
3
3
  import { a as Route, s as clsx } from "../entry-server.generated.js";
4
4
  import { t as cacheHitRate } from "./cost-eEHeTRT5.js";
5
- import { t as lucideRefreshCw } from "./refresh-cw-BND93JrF.js";
5
+ import { t as lucideRefreshCw } from "./refresh-cw-CztCFis-.js";
6
6
  //#region ../../node_modules/.pnpm/@tanstack+virtual-core@3.17.4/node_modules/@tanstack/virtual-core/dist/esm/lazy-measurements.js
7
7
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
8
  var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
@@ -1,4 +1,4 @@
1
- import { A as require_react, k as require_jsx_runtime } from "./services.generated-CEbGjsI0.js";
1
+ import { A as require_react, k as require_jsx_runtime } from "./services.generated-BA4AcAf5.js";
2
2
  require_react();
3
3
  var import_jsx_runtime = require_jsx_runtime();
4
4
  var lucidePlus = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
@@ -1,4 +1,4 @@
1
- import { A as require_react, q as __commonJSMin } from "./services.generated-CEbGjsI0.js";
1
+ import { A as require_react, q as __commonJSMin } from "./services.generated-BA4AcAf5.js";
2
2
  //#region ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.4/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
3
3
  /**
4
4
  * @license React
@@ -1,4 +1,4 @@
1
- import { A as require_react, k as require_jsx_runtime } from "./services.generated-CEbGjsI0.js";
1
+ import { A as require_react, k as require_jsx_runtime } from "./services.generated-BA4AcAf5.js";
2
2
  require_react();
3
3
  var import_jsx_runtime = require_jsx_runtime();
4
4
  var lucideRefreshCw = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
@@ -1,4 +1,4 @@
1
- import { A as require_react, k as require_jsx_runtime } from "./services.generated-CEbGjsI0.js";
1
+ import { A as require_react, k as require_jsx_runtime } from "./services.generated-BA4AcAf5.js";
2
2
  require_react();
3
3
  var import_jsx_runtime = require_jsx_runtime();
4
4
  var lucideZap = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
@@ -1,9 +1,9 @@
1
- import { A as require_react, O as useQueryClient, X as __toESM, k as require_jsx_runtime, n as QgridService, o as TokenService } from "./services.generated-CEbGjsI0.js";
2
- import { t as require_react_dom } from "./react-dom-B4a6-uuR.js";
1
+ import { A as require_react, O as useQueryClient, X as __toESM, k as require_jsx_runtime, n as QgridService, o as TokenService } from "./services.generated-BA4AcAf5.js";
2
+ import { t as require_react_dom } from "./react-dom-Ds75e4Jl.js";
3
3
  import { o as Q } from "../entry-server.generated.js";
4
4
  import { i as formatUsd } from "./cost-eEHeTRT5.js";
5
- import { t as useUpdateTokenMutation } from "./use-update-token-mutation-CfYmk_4_.js";
6
- import { n as OAuthCodeEntry, t as useOAuthLoginFlow } from "./use-oauth-login-flow-Cvdy0zF8.js";
5
+ import { t as useUpdateTokenMutation } from "./use-update-token-mutation-pkArIzCP.js";
6
+ import { n as OAuthCodeEntry, t as useOAuthLoginFlow } from "./use-oauth-login-flow-Gn8flMK5.js";
7
7
  //#region ../../node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
8
8
  var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom());
9
9
  var import_react = /* @__PURE__ */ __toESM(require_react());
@@ -22570,6 +22570,7 @@ var entityLabels = {
22570
22570
  "entity.RequestLog.service_tier": "Requested OpenAI service tier",
22571
22571
  "entity.RequestLog.effort": "effort level",
22572
22572
  "entity.RequestLog.history": "inject_items 히스토리",
22573
+ "entity.RequestLog.input_images": "현재 user turn 입력 이미지",
22573
22574
  "entity.RequestLog.tools": "요청에 장착된 tool 정의 목록",
22574
22575
  "entity.RequestLog.json_schema": "structured output 요청의 JSON Schema 원문 (detail 의 response 타입 표시용)",
22575
22576
  "entity.RequestLog.status": "실행 상태",
@@ -1,7 +1,7 @@
1
- import { A as require_react, O as useQueryClient, X as __toESM, a as SettingService, k as require_jsx_runtime, o as TokenService } from "./services.generated-CEbGjsI0.js";
1
+ import { A as require_react, O as useQueryClient, X as __toESM, a as SettingService, k as require_jsx_runtime, o as TokenService } from "./services.generated-BA4AcAf5.js";
2
2
  import { l as lucideRotateCcw } from "../entry-server.generated.js";
3
- import { t as useUpdateTokenMutation } from "./use-update-token-mutation-CfYmk_4_.js";
4
- import { t as lucidePlus } from "./plus-KZrECewT.js";
3
+ import { t as useUpdateTokenMutation } from "./use-update-token-mutation-pkArIzCP.js";
4
+ import { t as lucidePlus } from "./plus-BZ9I0VgC.js";
5
5
  //#region ~icons/lucide/eye.jsx
6
6
  var import_react = /* @__PURE__ */ __toESM(require_react());
7
7
  var import_jsx_runtime = require_jsx_runtime();