@kizenapps/cli 1.6.2-43e7a52 → 1.6.3-ab1f449

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 (42) hide show
  1. package/dist/index.js +18 -18
  2. package/dist/index.js.map +1 -1
  3. package/dist/viewer/assets/{AppDetailPage-RmQ6eFrs.js → AppDetailPage-BTSBtvJb.js} +1 -1
  4. package/dist/viewer/assets/{BootstrapContext-BLyrI7bs.js → BootstrapContext-Caqxm0pS.js} +1 -1
  5. package/dist/viewer/assets/Card-CKKHGdG4.js +1 -0
  6. package/dist/viewer/assets/CodeStepsPage-Krgx1XWT.js +1 -0
  7. package/dist/viewer/assets/{CodeViewer-BbZIh-MU.js → CodeViewer-BdEsrhvR.js} +3 -3
  8. package/dist/viewer/assets/{ConfigurationPage-BqOmyoQr.js → ConfigurationPage-BNA5KrGT.js} +1 -1
  9. package/dist/viewer/assets/{DevSidebar-CUs-cHq1.js → DevSidebar-BBRPcthT.js} +1 -1
  10. package/dist/viewer/assets/{Dialog-BtHSr4rf.js → Dialog-D6sZ1i69.js} +1 -1
  11. package/dist/viewer/assets/{IconReferencePage-DrDFi3ph.js → IconReferencePage-B4ayBaGk.js} +1 -1
  12. package/dist/viewer/assets/SandboxPage-CYnP7ZzD.js +1 -0
  13. package/dist/viewer/assets/SidebarContext-g2Wqf-42.js +1 -0
  14. package/dist/viewer/assets/{SourceBrowserPage-C7hAR6YZ.js → SourceBrowserPage-H2pFRVF1.js} +1 -1
  15. package/dist/viewer/assets/{Tooltip-D9Le4Lgo.js → Tooltip-4dV1-FIG.js} +1 -1
  16. package/dist/viewer/assets/{VersionsPage-BOapKeT8.js → VersionsPage-l_9K0iyg.js} +1 -1
  17. package/dist/viewer/assets/{WhenBadge-DWsoo8Rf.js → WhenBadge-BTCs-6JK.js} +1 -1
  18. package/dist/viewer/assets/api-LYugLsE_.js +11 -0
  19. package/dist/viewer/assets/{bundleQuery-Bjqi6ox2.js → bundleQuery-DnoDprqO.js} +1 -1
  20. package/dist/viewer/assets/{calendarSource.worker-Cg0e7QEm.js → calendarSource.worker-D3Z5_7_3.js} +4 -4
  21. package/dist/viewer/assets/{configStorage-DcCxzQCu.js → configStorage-Db8RcPNR.js} +1 -1
  22. package/dist/viewer/assets/{fa-core-B7dAyAZA.js → fa-core-DteucspK.js} +1 -1
  23. package/dist/viewer/assets/{floatingFrame.worker-CAm1NVPN.js → floatingFrame.worker-Cehe8grH.js} +6 -6
  24. package/dist/viewer/assets/{generic.worker-NxsWBKFc.js → generic.worker-XzKOvCnC.js} +4 -4
  25. package/dist/viewer/assets/index-BCe-a4I_.css +2 -0
  26. package/dist/viewer/assets/{index-ByyMep3r.js → index-BN2If3Zu.js} +3 -3
  27. package/dist/viewer/assets/{react-j0eBFjQW.js → react-CGXpNBH3.js} +1 -1
  28. package/dist/viewer/assets/{recordDetail.worker-Cz1r24RX.js → recordDetail.worker-Cbp2XubL.js} +6 -6
  29. package/dist/viewer/assets/{storageKeys-CSWy3aiP.js → storageKeys-Dv0AbTSJ.js} +1 -1
  30. package/dist/viewer/assets/useCriticalExceptionDialog-DNmzdRI0.js +40 -0
  31. package/dist/viewer/assets/{useLocalStorage-oRuCYBcL.js → useLocalStorage-gLSTo_Vv.js} +1 -1
  32. package/dist/viewer/assets/{useNavigate-AMIImip9.js → useNavigate-EsATq4C7.js} +1 -1
  33. package/dist/viewer/assets/{useQuery-CHCkzQbK.js → useQuery-DLOWDn8s.js} +1 -1
  34. package/dist/viewer/index.html +13 -13
  35. package/package.json +2 -2
  36. package/dist/viewer/assets/Card-D66xMN4f.js +0 -1
  37. package/dist/viewer/assets/CodeStepsPage-BT2DWChv.js +0 -1
  38. package/dist/viewer/assets/SandboxPage-zjGzf2BO.js +0 -1
  39. package/dist/viewer/assets/SidebarContext-CENlTk-2.js +0 -1
  40. package/dist/viewer/assets/api-MJ8ypvzo.js +0 -11
  41. package/dist/viewer/assets/index-B39IGo54.css +0 -2
  42. package/dist/viewer/assets/useCriticalExceptionDialog-D82vwJ1-.js +0 -40
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,O as n,a as r,j as i,k as a,r as o}from"./fa-core-B7dAyAZA.js";import{p as s,t as c}from"./storageKeys-CSWy3aiP.js";import{n as l,t as u}from"./Dialog-BtHSr4rf.js";import{t as d}from"./Tooltip-D9Le4Lgo.js";var f=e(i(),1),p=t(),m=`integration:route-change`,h=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,g=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`;function _(e){return e.toTimeString().slice(0,8)}var v=()=>{let[e,t]=(0,f.useState)(`/`),[n,r]=(0,f.useState)(``),[i,a]=(0,f.useState)(``),[o,s]=(0,f.useState)([]),c=(0,f.useRef)(null);(0,f.useEffect)(()=>{c.current?.scrollIntoView({behavior:`smooth`})},[o]),(0,f.useEffect)(()=>{let e=e=>{let t=e;s(e=>[...e,{time:new Date,location:t.detail.location}].slice(-50))};return window.addEventListener(m,e),()=>{window.removeEventListener(m,e)}},[]);let l=()=>{let t=n&&!n.startsWith(`?`)?`?${n}`:n,r=i&&!i.startsWith(`#`)?`#${i}`:i,a={host:window.location.host,origin:window.location.origin,port:window.location.port,protocol:window.location.protocol,pathname:e,search:t,hash:r,href:`${window.location.origin}${e}${t}${r}`};window.dispatchEvent(new CustomEvent(m,{detail:{location:a}}))},u=e=>{e.key===`Enter`&&l()};return(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 pb-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Search`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:n,onChange:e=>{r(e.target.value)},onKeyDown:u,placeholder:`?tab=notes`,spellCheck:!1})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Hash`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:i,onChange:e=>{a(e.target.value)},onKeyDown:u,placeholder:`#section`,spellCheck:!1})]})]}),(0,p.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Pathname`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:e,onChange:e=>{t(e.target.value)},onKeyDown:u,placeholder:`/client/abc-123/overview`,spellCheck:!1})]}),(0,p.jsx)(`button`,{onClick:l,className:`rounded bg-neutral-700 px-3 py-1.5 text-[12px] font-semibold text-neutral-200 hover:bg-neutral-600 active:bg-neutral-500`,children:`Dispatch`})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800 pt-2`,children:[(0,p.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:`Navigation Event Stream`}),o.length>0&&(0,p.jsx)(`button`,{onClick:()=>{s([])},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),(0,p.jsxs)(`div`,{className:`max-h-40 overflow-y-auto`,children:[o.length===0?(0,p.jsx)(`p`,{className:`text-[12px] text-neutral-600`,children:`No events yet.`}):o.map((e,t)=>(0,p.jsxs)(`div`,{className:`px-2 py-0.5 font-mono text-[11px] leading-5 ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:[(0,p.jsx)(`span`,{className:`text-neutral-600`,children:_(e.time)}),(0,p.jsx)(`span`,{className:`ml-2 text-neutral-300`,children:e.location.pathname}),e.location.search&&(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.location.search}),e.location.hash&&(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.location.hash})]},t)),(0,p.jsx)(`div`,{ref:c})]})]})]})},y=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,b=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`,x=`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,S={log:`text-neutral-400`,info:`text-blue-400`,warn:`text-yellow-400`,error:`text-red-400`};function C(e){try{let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return`${n.toString()}n`;if(typeof n==`function`)return`[Function: ${n.name||`anonymous`}]`;if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2);return typeof n==`string`?n:`[unserializable]`}catch{return`[unserializable]`}}function w(e,t=16){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t)}…`}function T(e){if(typeof e==`function`){let t=e,n=t.toString();return{label:`ƒ ${t.name||`anonymous`}`,preview:w(n),full:n}}if(Array.isArray(e)){let t=C(e);return{label:`Array(${String(e.length)})`,preview:w(t),full:t}}if(e instanceof Error){let t=`${e.name}: ${e.message}`;return{label:e.name||`Error`,preview:w(e.message),full:e.stack?`${t}\n${e.stack}`:t}}if(e instanceof Date){let t=e.toISOString();return{label:`Date`,preview:w(t,20),full:t}}if(e instanceof Map){let t=C(Object.fromEntries(e));return{label:`Map(${String(e.size)})`,preview:w(t),full:t}}if(e instanceof Set){let t=C([...e]);return{label:`Set(${String(e.size)})`,preview:w(t),full:t}}if(typeof Node<`u`&&e instanceof Node){let t=e.nodeName.toLowerCase(),n=(e instanceof Element?e.outerHTML:e.textContent)??`<${t}>`;return{label:`<${t}>`,preview:w(n),full:n}}let t=e.constructor?.name,n=t&&t!==`Object`?t:`Object`,r=C(e);return{label:n,preview:w(r),full:r}}var E=({value:e})=>{let[t,n]=(0,f.useState)(!1);if(e===null)return(0,p.jsx)(`span`,{className:`italic text-neutral-500`,children:`null`});if(e===void 0)return(0,p.jsx)(`span`,{className:`italic text-neutral-500`,children:`undefined`});if(typeof e==`string`)return(0,p.jsx)(`span`,{children:e});if(typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`||typeof e==`symbol`)return(0,p.jsx)(`span`,{children:String(e)});let{label:r,preview:i,full:a}=T(e);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>{n(!0)},className:`inline-block rounded bg-neutral-700/70 px-1.5 py-0 align-baseline text-[11px] font-mono text-neutral-200 hover:bg-neutral-600`,children:[r,i!==``&&(0,p.jsx)(`span`,{className:`ml-1.5 font-normal text-neutral-400`,children:i})]}),(0,p.jsx)(u,{open:t,size:`xl`,onBackdropClick:()=>{n(!1)},header:(0,p.jsx)(l,{title:r,onClose:()=>{n(!1)}}),children:(0,p.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto whitespace-pre px-5 py-3 text-[12px] leading-5 text-neutral-800`,children:a})})]})},D=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`whitespace-pre px-4 py-0.5 text-[12px] leading-5 ${S[e.level]} ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.args.map((e,t)=>(0,p.jsxs)(`span`,{children:[t>0&&` `,(0,p.jsx)(E,{value:e})]},t))},t)),(0,p.jsx)(`div`,{ref:n})]})},O=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`whitespace-pre px-4 text-[12px] leading-5 text-neutral-500`,children:e},t)),(0,p.jsx)(`div`,{ref:n})]})};function k(e){switch(e.toUpperCase()){case`GET`:return`bg-blue-900/60 text-blue-300`;case`POST`:return`bg-green-900/60 text-green-300`;case`PUT`:return`bg-amber-900/60 text-amber-300`;case`PATCH`:return`bg-orange-900/60 text-orange-300`;case`DELETE`:return`bg-red-900/60 text-red-300`;default:return`bg-neutral-800 text-neutral-400`}}function A(e){return e===0?`bg-neutral-800 text-neutral-400`:e<300?`bg-green-900/60 text-green-300`:e<400?`bg-yellow-900/60 text-yellow-300`:e<500?`bg-orange-900/60 text-orange-300`:`bg-red-900/60 text-red-300`}var j=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-0.5 text-[11px] ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.kind===`info`?(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.message}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`span`,{className:`w-12 shrink-0 rounded text-center font-mono font-semibold ${k(e.method)}`,children:e.method}),(0,p.jsx)(`span`,{className:`w-8 shrink-0 rounded text-center font-mono font-semibold ${A(e.status)}`,children:e.status===0?`ERR`:e.status}),e.upstreamStatus!==void 0&&(0,p.jsx)(d,{text:`Third-party API returned ${String(e.upstreamStatus)} (the proxy call itself returned ${String(e.status)})`,children:(0,p.jsxs)(`span`,{className:`flex w-12 shrink-0 cursor-default items-center justify-center gap-1.5 rounded text-center font-mono font-semibold ${A(e.upstreamStatus)}`,children:[(0,p.jsx)(`span`,{className:`text-neutral-500`,children:`→`}),e.upstreamStatus]})}),(0,p.jsx)(`span`,{className:`w-14 shrink-0 rounded text-center font-mono font-semibold ${e.fromCache?`bg-violet-900/60 text-violet-300`:`bg-neutral-800 text-neutral-400`}`,children:e.fromCache?`cache`:`network`}),(0,p.jsx)(d,{text:e.url,children:(0,p.jsx)(`span`,{className:`min-w-0 truncate cursor-default font-mono text-neutral-400`,children:e.url})})]})},t)),(0,p.jsx)(`div`,{ref:n})]})})},M=({onClose:e,buildLogs:t,proxyLogs:i,consoleLogs:l,onClearConsole:u,credentials:d,onCredentialsChange:m,width:h=416,onWidthChange:g})=>{let[_,S]=(0,f.useState)(()=>{let e=localStorage.getItem(c.credsPanelOpen);return e===null?!(d.apiKey&&d.userId&&d.businessId):e!==`false`}),[C,w]=(0,f.useState)([]),[T,E]=(0,f.useState)(void 0),k=(0,f.useCallback)(async()=>{try{let e=await fetch(`/api/credential-profiles`);if(!e.ok)return;let t=await e.json();w(t.profiles),E(t.active)}catch{}},[]);(0,f.useEffect)(()=>{k()},[k]);let A=(0,f.useCallback)(async e=>{let t=e===``?void 0:e;try{await fetch(`/api/credentials/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({profile:t})}),await fetch(`/api/proxy-cache/clear`),E(t)}catch{}},[]),[M,N]=(0,f.useState)(()=>localStorage.getItem(c.routesPanelOpen)!==`false`),[P,F]=(0,f.useState)(()=>localStorage.getItem(c.consolePanelOpen)!==`false`),[I,L]=(0,f.useState)(()=>localStorage.getItem(c.proxyPanelOpen)!==`false`),[R,z]=(0,f.useState)(()=>localStorage.getItem(c.buildPanelOpen)!==`false`),B=(e,t)=>{t(t=>{let n=!t;return localStorage.setItem(e,String(n)),n})},V=(0,f.useRef)(!1),H=(0,f.useCallback)(e=>{e.preventDefault(),V.current=!0;let t=e=>{if(!V.current)return;let t=Math.min(800,Math.max(280,window.innerWidth-e.clientX));g?.(t)},n=()=>{V.current=!1,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n)};document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n)},[g]);return(0,p.jsxs)(`aside`,{className:`relative flex shrink-0 flex-col border-l border-neutral-800 bg-neutral-900 text-neutral-100`,style:{width:h},children:[(0,p.jsx)(`div`,{onMouseDown:H,className:`absolute left-0 top-0 z-10 h-full w-1 cursor-col-resize transition-colors hover:bg-neutral-600`}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,p.jsx)(`span`,{className:`text-[12px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Dev Tools`}),(0,p.jsx)(`button`,{onClick:e,className:`text-neutral-500 hover:text-neutral-200`,"aria-label":`Close dev tools`,children:(0,p.jsx)(a,{icon:n,size:`sm`})})]}),(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:[(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-b border-neutral-800`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.credsPanelOpen,S),k()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:x,children:`Credentials`}),!_&&(0,p.jsx)(`span`,{className:`text-[11px] font-mono text-neutral-400`,children:d.environment})]}),(0,p.jsx)(a,{icon:_?o:r,className:`text-neutral-600`,size:`xs`})]}),_&&(0,p.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pb-3`,children:[C.length>1&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:b,children:`Profile`}),(0,p.jsx)(`select`,{className:y,value:T??``,onChange:e=>{A(e.target.value)},children:C.map(e=>(0,p.jsx)(`option`,{value:e.isDefault?``:e.name,children:e.isDefault?`Default`:e.name},e.name))})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`Environment`}),(0,p.jsx)(`select`,{className:y,value:d.environment,onChange:e=>{m({...d,environment:e.target.value})},children:s.map(e=>(0,p.jsx)(`option`,{value:e,children:e},e))})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`Business ID`}),(0,p.jsx)(`input`,{type:`text`,className:y,value:d.businessId,onChange:e=>{m({...d,businessId:e.target.value})},placeholder:`x-business-id`,autoComplete:`off`})]})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`User ID`}),(0,p.jsx)(`input`,{type:`text`,className:y,value:d.userId,onChange:e=>{m({...d,userId:e.target.value})},placeholder:`x-user-id`,autoComplete:`off`})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`API Key`}),(0,p.jsx)(`input`,{type:`password`,className:y,value:d.apiKey,onChange:e=>{m({...d,apiKey:e.target.value})},placeholder:`x-api-key`,autoComplete:`off`})]})]}),(0,p.jsx)(`button`,{onClick:()=>{localStorage.clear(),window.location.reload()},className:`text-[11px] text-neutral-600 hover:text-red-400 self-start`,children:`clear storage`})]})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800 overflow-hidden`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.routesPanelOpen,N)},children:[(0,p.jsx)(`span`,{className:x,children:`Routes`}),(0,p.jsx)(a,{icon:M?o:r,className:`text-neutral-600`,size:`xs`})]}),M&&(0,p.jsx)(v,{})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800`,children:[(0,p.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,p.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{B(c.consolePanelOpen,F)},children:[(0,p.jsx)(`span`,{className:x,children:`Browser Console`}),(0,p.jsx)(a,{icon:P?o:r,className:`text-neutral-600`,size:`xs`})]}),P&&l.length>0&&(0,p.jsx)(`button`,{onClick:u,className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),P&&(0,p.jsx)(D,{logs:l,height:`min-h-32 max-h-64`})]}),(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0 border-t border-neutral-800`,children:[(0,p.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,p.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{B(c.proxyPanelOpen,L)},children:[(0,p.jsx)(`span`,{className:x,children:`Network Requests`}),(0,p.jsx)(a,{icon:I?o:r,className:`text-neutral-600`,size:`xs`})]}),I&&(0,p.jsx)(`button`,{onClick:()=>{fetch(`/api/proxy-cache/clear`)},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear cache`})]}),I&&(0,p.jsx)(j,{logs:i,height:`flex-1 min-h-0`})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.buildPanelOpen,z)},children:[(0,p.jsx)(`span`,{className:x,children:`Build Log`}),(0,p.jsx)(a,{icon:R?o:r,className:`text-neutral-600`,size:`xs`})]}),R&&(0,p.jsx)(O,{logs:t,height:`max-h-[60px]`})]})]})]})};export{M as DevSidebar};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,M as n,N as r,a as i,j as a,s as o}from"./fa-core-DteucspK.js";import{p as s,t as c}from"./storageKeys-Dv0AbTSJ.js";import{n as l,t as u}from"./Dialog-D6sZ1i69.js";import{t as d}from"./Tooltip-4dV1-FIG.js";var f=e(r(),1),p=n(),m=`integration:route-change`,h=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,g=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`;function _(e){return e.toTimeString().slice(0,8)}var v=()=>{let[e,t]=(0,f.useState)(`/`),[n,r]=(0,f.useState)(``),[i,a]=(0,f.useState)(``),[o,s]=(0,f.useState)([]),c=(0,f.useRef)(null);(0,f.useEffect)(()=>{c.current?.scrollIntoView({behavior:`smooth`})},[o]),(0,f.useEffect)(()=>{let e=e=>{let t=e;s(e=>[...e,{time:new Date,location:t.detail.location}].slice(-50))};return window.addEventListener(m,e),()=>{window.removeEventListener(m,e)}},[]);let l=()=>{let t=n&&!n.startsWith(`?`)?`?${n}`:n,r=i&&!i.startsWith(`#`)?`#${i}`:i,a={host:window.location.host,origin:window.location.origin,port:window.location.port,protocol:window.location.protocol,pathname:e,search:t,hash:r,href:`${window.location.origin}${e}${t}${r}`};window.dispatchEvent(new CustomEvent(m,{detail:{location:a}}))},u=e=>{e.key===`Enter`&&l()};return(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 pb-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Search`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:n,onChange:e=>{r(e.target.value)},onKeyDown:u,placeholder:`?tab=notes`,spellCheck:!1})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Hash`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:i,onChange:e=>{a(e.target.value)},onKeyDown:u,placeholder:`#section`,spellCheck:!1})]})]}),(0,p.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:g,children:`Pathname`}),(0,p.jsx)(`input`,{type:`text`,className:h,value:e,onChange:e=>{t(e.target.value)},onKeyDown:u,placeholder:`/client/abc-123/overview`,spellCheck:!1})]}),(0,p.jsx)(`button`,{onClick:l,className:`rounded bg-neutral-700 px-3 py-1.5 text-[12px] font-semibold text-neutral-200 hover:bg-neutral-600 active:bg-neutral-500`,children:`Dispatch`})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800 pt-2`,children:[(0,p.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:`Navigation Event Stream`}),o.length>0&&(0,p.jsx)(`button`,{onClick:()=>{s([])},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),(0,p.jsxs)(`div`,{className:`max-h-40 overflow-y-auto`,children:[o.length===0?(0,p.jsx)(`p`,{className:`text-[12px] text-neutral-600`,children:`No events yet.`}):o.map((e,t)=>(0,p.jsxs)(`div`,{className:`px-2 py-0.5 font-mono text-[11px] leading-5 ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:[(0,p.jsx)(`span`,{className:`text-neutral-600`,children:_(e.time)}),(0,p.jsx)(`span`,{className:`ml-2 text-neutral-300`,children:e.location.pathname}),e.location.search&&(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.location.search}),e.location.hash&&(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.location.hash})]},t)),(0,p.jsx)(`div`,{ref:c})]})]})]})},y=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,b=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`,x=`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,S={log:`text-neutral-400`,info:`text-blue-400`,warn:`text-yellow-400`,error:`text-red-400`};function C(e){try{let t=new WeakSet,n=JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return`${n.toString()}n`;if(typeof n==`function`)return`[Function: ${n.name||`anonymous`}]`;if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2);return typeof n==`string`?n:`[unserializable]`}catch{return`[unserializable]`}}function w(e,t=16){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t)}…`}function T(e){if(typeof e==`function`){let t=e,n=t.toString();return{label:`ƒ ${t.name||`anonymous`}`,preview:w(n),full:n}}if(Array.isArray(e)){let t=C(e);return{label:`Array(${String(e.length)})`,preview:w(t),full:t}}if(e instanceof Error){let t=`${e.name}: ${e.message}`;return{label:e.name||`Error`,preview:w(e.message),full:e.stack?`${t}\n${e.stack}`:t}}if(e instanceof Date){let t=e.toISOString();return{label:`Date`,preview:w(t,20),full:t}}if(e instanceof Map){let t=C(Object.fromEntries(e));return{label:`Map(${String(e.size)})`,preview:w(t),full:t}}if(e instanceof Set){let t=C([...e]);return{label:`Set(${String(e.size)})`,preview:w(t),full:t}}if(typeof Node<`u`&&e instanceof Node){let t=e.nodeName.toLowerCase(),n=(e instanceof Element?e.outerHTML:e.textContent)??`<${t}>`;return{label:`<${t}>`,preview:w(n),full:n}}let t=e.constructor?.name,n=t&&t!==`Object`?t:`Object`,r=C(e);return{label:n,preview:w(r),full:r}}var E=({value:e})=>{let[t,n]=(0,f.useState)(!1);if(e===null)return(0,p.jsx)(`span`,{className:`italic text-neutral-500`,children:`null`});if(e===void 0)return(0,p.jsx)(`span`,{className:`italic text-neutral-500`,children:`undefined`});if(typeof e==`string`)return(0,p.jsx)(`span`,{children:e});if(typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`||typeof e==`symbol`)return(0,p.jsx)(`span`,{children:String(e)});let{label:r,preview:i,full:a}=T(e);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>{n(!0)},className:`inline-block rounded bg-neutral-700/70 px-1.5 py-0 align-baseline text-[11px] font-mono text-neutral-200 hover:bg-neutral-600`,children:[r,i!==``&&(0,p.jsx)(`span`,{className:`ml-1.5 font-normal text-neutral-400`,children:i})]}),(0,p.jsx)(u,{open:t,size:`xl`,onBackdropClick:()=>{n(!1)},header:(0,p.jsx)(l,{title:r,onClose:()=>{n(!1)}}),children:(0,p.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto whitespace-pre px-5 py-3 text-[12px] leading-5 text-neutral-800`,children:a})})]})},D=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`whitespace-pre px-4 py-0.5 text-[12px] leading-5 ${S[e.level]} ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.args.map((e,t)=>(0,p.jsxs)(`span`,{children:[t>0&&` `,(0,p.jsx)(E,{value:e})]},t))},t)),(0,p.jsx)(`div`,{ref:n})]})},O=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`whitespace-pre px-4 text-[12px] leading-5 text-neutral-500`,children:e},t)),(0,p.jsx)(`div`,{ref:n})]})};function k(e){switch(e.toUpperCase()){case`GET`:return`bg-blue-900/60 text-blue-300`;case`POST`:return`bg-green-900/60 text-green-300`;case`PUT`:return`bg-amber-900/60 text-amber-300`;case`PATCH`:return`bg-orange-900/60 text-orange-300`;case`DELETE`:return`bg-red-900/60 text-red-300`;default:return`bg-neutral-800 text-neutral-400`}}function A(e){return e===0?`bg-neutral-800 text-neutral-400`:e<300?`bg-green-900/60 text-green-300`:e<400?`bg-yellow-900/60 text-yellow-300`:e<500?`bg-orange-900/60 text-orange-300`:`bg-red-900/60 text-red-300`}var j=({logs:e,height:t})=>{let n=(0,f.useRef)(null);return(0,f.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,p.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,p.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-0.5 text-[11px] ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.kind===`info`?(0,p.jsx)(`span`,{className:`text-neutral-500`,children:e.message}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`span`,{className:`w-12 shrink-0 rounded text-center font-mono font-semibold ${k(e.method)}`,children:e.method}),(0,p.jsx)(`span`,{className:`w-8 shrink-0 rounded text-center font-mono font-semibold ${A(e.status)}`,children:e.status===0?`ERR`:e.status}),e.upstreamStatus!==void 0&&(0,p.jsx)(d,{text:`Third-party API returned ${String(e.upstreamStatus)} (the proxy call itself returned ${String(e.status)})`,children:(0,p.jsxs)(`span`,{className:`flex w-12 shrink-0 cursor-default items-center justify-center gap-1.5 rounded text-center font-mono font-semibold ${A(e.upstreamStatus)}`,children:[(0,p.jsx)(`span`,{className:`text-neutral-500`,children:`→`}),e.upstreamStatus]})}),(0,p.jsx)(`span`,{className:`w-14 shrink-0 rounded text-center font-mono font-semibold ${e.fromCache?`bg-violet-900/60 text-violet-300`:`bg-neutral-800 text-neutral-400`}`,children:e.fromCache?`cache`:`network`}),(0,p.jsx)(d,{text:e.url,children:(0,p.jsx)(`span`,{className:`min-w-0 truncate cursor-default font-mono text-neutral-400`,children:e.url})})]})},t)),(0,p.jsx)(`div`,{ref:n})]})})},M=({onClose:e,buildLogs:n,proxyLogs:r,consoleLogs:l,onClearConsole:u,credentials:d,onCredentialsChange:m,width:h=416,onWidthChange:g})=>{let[_,S]=(0,f.useState)(()=>{let e=localStorage.getItem(c.credsPanelOpen);return e===null?!(d.apiKey&&d.userId&&d.businessId):e!==`false`}),[C,w]=(0,f.useState)([]),[T,E]=(0,f.useState)(void 0),k=(0,f.useCallback)(async()=>{try{let e=await fetch(`/api/credential-profiles`);if(!e.ok)return;let t=await e.json();w(t.profiles),E(t.active)}catch{}},[]);(0,f.useEffect)(()=>{k()},[k]);let A=(0,f.useCallback)(async e=>{let t=e===``?void 0:e;try{await fetch(`/api/credentials/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({profile:t})}),await fetch(`/api/proxy-cache/clear`),E(t)}catch{}},[]),[M,N]=(0,f.useState)(()=>localStorage.getItem(c.routesPanelOpen)!==`false`),[P,F]=(0,f.useState)(()=>localStorage.getItem(c.consolePanelOpen)!==`false`),[I,L]=(0,f.useState)(()=>localStorage.getItem(c.proxyPanelOpen)!==`false`),[R,z]=(0,f.useState)(()=>localStorage.getItem(c.buildPanelOpen)!==`false`),B=(e,t)=>{t(t=>{let n=!t;return localStorage.setItem(e,String(n)),n})},V=(0,f.useRef)(!1),H=(0,f.useCallback)(e=>{e.preventDefault(),V.current=!0;let t=e=>{if(!V.current)return;let t=Math.min(800,Math.max(280,window.innerWidth-e.clientX));g?.(t)},n=()=>{V.current=!1,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n)};document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n)},[g]);return(0,p.jsxs)(`aside`,{className:`relative flex shrink-0 flex-col border-l border-neutral-800 bg-neutral-900 text-neutral-100`,style:{width:h},children:[(0,p.jsx)(`div`,{onMouseDown:H,className:`absolute left-0 top-0 z-10 h-full w-1 cursor-col-resize transition-colors hover:bg-neutral-600`}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,p.jsx)(`span`,{className:`text-[12px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Dev Tools`}),(0,p.jsx)(`button`,{onClick:e,className:`text-neutral-500 hover:text-neutral-200`,"aria-label":`Close dev tools`,children:(0,p.jsx)(a,{icon:t,size:`sm`})})]}),(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:[(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-b border-neutral-800`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.credsPanelOpen,S),k()},children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:x,children:`Credentials`}),!_&&(0,p.jsx)(`span`,{className:`text-[11px] font-mono text-neutral-400`,children:d.environment})]}),(0,p.jsx)(a,{icon:_?i:o,className:`text-neutral-600`,size:`xs`})]}),_&&(0,p.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pb-3`,children:[C.length>1&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:b,children:`Profile`}),(0,p.jsx)(`select`,{className:y,value:T??``,onChange:e=>{A(e.target.value)},children:C.map(e=>(0,p.jsx)(`option`,{value:e.isDefault?``:e.name,children:e.isDefault?`Default`:e.name},e.name))})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`Environment`}),(0,p.jsx)(`select`,{className:y,value:d.environment,onChange:e=>{m({...d,environment:e.target.value})},children:s.map(e=>(0,p.jsx)(`option`,{value:e,children:e},e))})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`Business ID`}),(0,p.jsx)(`input`,{type:`text`,className:y,value:d.businessId,onChange:e=>{m({...d,businessId:e.target.value})},placeholder:`x-business-id`,autoComplete:`off`})]})]}),(0,p.jsxs)(`div`,{className:`flex gap-2`,children:[(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`User ID`}),(0,p.jsx)(`input`,{type:`text`,className:y,value:d.userId,onChange:e=>{m({...d,userId:e.target.value})},placeholder:`x-user-id`,autoComplete:`off`})]}),(0,p.jsxs)(`div`,{className:`flex-1`,children:[(0,p.jsx)(`label`,{className:b,children:`API Key`}),(0,p.jsx)(`input`,{type:`password`,className:y,value:d.apiKey,onChange:e=>{m({...d,apiKey:e.target.value})},placeholder:`x-api-key`,autoComplete:`off`})]})]}),(0,p.jsx)(`button`,{onClick:()=>{localStorage.clear(),window.location.reload()},className:`text-[11px] text-neutral-600 hover:text-red-400 self-start`,children:`clear storage`})]})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800 overflow-hidden`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.routesPanelOpen,N)},children:[(0,p.jsx)(`span`,{className:x,children:`Routes`}),(0,p.jsx)(a,{icon:M?i:o,className:`text-neutral-600`,size:`xs`})]}),M&&(0,p.jsx)(v,{})]}),(0,p.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800`,children:[(0,p.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,p.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{B(c.consolePanelOpen,F)},children:[(0,p.jsx)(`span`,{className:x,children:`Browser Console`}),(0,p.jsx)(a,{icon:P?i:o,className:`text-neutral-600`,size:`xs`})]}),P&&l.length>0&&(0,p.jsx)(`button`,{onClick:u,className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),P&&(0,p.jsx)(D,{logs:l,height:`min-h-32 max-h-64`})]}),(0,p.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0 border-t border-neutral-800`,children:[(0,p.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,p.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{B(c.proxyPanelOpen,L)},children:[(0,p.jsx)(`span`,{className:x,children:`Network Requests`}),(0,p.jsx)(a,{icon:I?i:o,className:`text-neutral-600`,size:`xs`})]}),I&&(0,p.jsx)(`button`,{onClick:()=>{fetch(`/api/proxy-cache/clear`)},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear cache`})]}),I&&(0,p.jsx)(j,{logs:r,height:`flex-1 min-h-0`})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800`,children:[(0,p.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{B(c.buildPanelOpen,z)},children:[(0,p.jsx)(`span`,{className:x,children:`Build Log`}),(0,p.jsx)(a,{icon:R?i:o,className:`text-neutral-600`,size:`xs`})]}),R&&(0,p.jsx)(O,{logs:n,height:`max-h-[60px]`})]})]})]})};export{M as DevSidebar};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,O as n,j as r,k as i}from"./fa-core-B7dAyAZA.js";var a=e(r(),1),o=t(),s={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-xl`,xl:`max-w-2xl`},c=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,l=({open:e,onBackdropClick:t,size:n=`md`,maxWidth:r,height:i,ariaModal:l=!0,fontMono:u=!0,header:d,footer:f,children:p})=>{let m=(0,a.useRef)(null),h=(0,a.useRef)(t);return(0,a.useEffect)(()=>{h.current=t},[t]),(0,a.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=m.current;if(n===null)return;(n.querySelector(c)??n).focus();let r=e=>{if(e.key===`Escape`){h.current?.();return}if(e.key!==`Tab`)return;let t=n.querySelectorAll(c);if(t.length===0){e.preventDefault();return}let r=t[0],i=t[t.length-1],a=document.activeElement;r===void 0||i===void 0||(e.shiftKey&&(a===r||a===n)?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus()))};return document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`keydown`,r),(document.activeElement===document.body||n.contains(document.activeElement))&&t?.focus()}},[e]),e?(0,o.jsx)(`div`,{role:`dialog`,"aria-modal":l||void 0,className:`fixed inset-0 z-[99999] flex items-start justify-center overflow-y-auto bg-black/30 px-4 py-12`,onClick:t,children:(0,o.jsxs)(`div`,{ref:m,tabIndex:-1,className:`w-full ${r===void 0?s[n]:``} rounded-lg border border-black/10 bg-white ${u?`font-mono`:``} shadow-xl focus:outline-none${i?` flex flex-col overflow-hidden`:``}`,style:{...i?{height:i}:null,...r===void 0?null:{maxWidth:typeof r==`number`?`${String(r)}px`:r}},onClick:e=>{e.stopPropagation()},children:[d,p,f!=null&&(0,o.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-black/8 px-5 py-3`,children:f})]})}):null},u={red:`bg-red-500`,green:`bg-green-500`,"blue-pulse":`bg-blue-500 animate-pulse`},d=({title:e,statusDot:t,onClose:r})=>{let a=t!==void 0,s=r!==void 0;return(0,o.jsxs)(`div`,{className:`${s?`flex items-center justify-between`:a?`flex items-center gap-2`:``} border-b border-black/8 px-5 py-3`,children:[a&&(0,o.jsx)(`span`,{className:`h-2 w-2 rounded-full ${u[t]}`}),(0,o.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-900`,children:e}),s&&(0,o.jsx)(`button`,{onClick:r,className:`text-[12px] text-neutral-400 hover:text-neutral-700`,"aria-label":`Close`,children:(0,o.jsx)(i,{icon:n})})]})};export{d as n,l as t};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,M as n,N as r,j as i}from"./fa-core-DteucspK.js";var a=e(r(),1),o=n(),s={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-xl`,xl:`max-w-2xl`},c=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,l=({open:e,onBackdropClick:t,size:n=`md`,maxWidth:r,height:i,ariaModal:l=!0,fontMono:u=!0,header:d,footer:f,children:p})=>{let m=(0,a.useRef)(null),h=(0,a.useRef)(t);return(0,a.useEffect)(()=>{h.current=t},[t]),(0,a.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=m.current;if(n===null)return;(n.querySelector(c)??n).focus();let r=e=>{if(e.key===`Escape`){h.current?.();return}if(e.key!==`Tab`)return;let t=n.querySelectorAll(c);if(t.length===0){e.preventDefault();return}let r=t[0],i=t[t.length-1],a=document.activeElement;r===void 0||i===void 0||(e.shiftKey&&(a===r||a===n)?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),r.focus()))};return document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`keydown`,r),(document.activeElement===document.body||n.contains(document.activeElement))&&t?.focus()}},[e]),e?(0,o.jsx)(`div`,{role:`dialog`,"aria-modal":l||void 0,className:`fixed inset-0 z-[99999] flex items-start justify-center overflow-y-auto bg-black/30 px-4 py-12`,onClick:t,children:(0,o.jsxs)(`div`,{ref:m,tabIndex:-1,className:`w-full ${r===void 0?s[n]:``} rounded-lg border border-black/10 bg-white ${u?`font-mono`:``} shadow-xl focus:outline-none${i?` flex flex-col overflow-hidden`:``}`,style:{...i?{height:i}:null,...r===void 0?null:{maxWidth:typeof r==`number`?`${String(r)}px`:r}},onClick:e=>{e.stopPropagation()},children:[d,p,f!=null&&(0,o.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-black/8 px-5 py-3`,children:f})]})}):null},u={red:`bg-red-500`,green:`bg-green-500`,"blue-pulse":`bg-blue-500 animate-pulse`},d=({title:e,statusDot:n,onClose:r})=>{let a=n!==void 0,s=r!==void 0;return(0,o.jsxs)(`div`,{className:`${s?`flex items-center justify-between`:a?`flex items-center gap-2`:``} border-b border-black/8 px-5 py-3`,children:[a&&(0,o.jsx)(`span`,{className:`h-2 w-2 rounded-full ${u[n]}`}),(0,o.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-900`,children:e}),s&&(0,o.jsx)(`button`,{onClick:r,className:`text-[12px] text-neutral-400 hover:text-neutral-700`,"aria-label":`Close`,children:(0,o.jsx)(i,{icon:t})})]})};export{d as n,l as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{A as t,j as n,k as r}from"./fa-core-B7dAyAZA.js";import{t as i}from"./Card-D66xMN4f.js";import{i as a,n as o,t as s}from"./iconMap-BotklELY.js";var c=e(n(),1),l=t(),u=()=>{let[e,t]=(0,c.useState)(null),n=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]);let u=e=>{navigator.clipboard.writeText(e),t(e),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(null)},1200)};return(0,l.jsx)(`div`,{className:`space-y-4 text-[13px]`,children:(0,l.jsxs)(i,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[(0,l.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:[`Icon Reference (`,a.length,` icons)`]}),(0,l.jsx)(`div`,{className:`text-[11px] text-neutral-400`,children:`Click an icon to copy its name`})]}),(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:a.map(t=>{let n=e===t;return(0,l.jsxs)(`button`,{type:`button`,onClick:()=>{u(t)},className:`flex w-32 cursor-pointer items-center gap-1.5 rounded px-1.5 py-1 text-left transition-colors ${n?`bg-emerald-100`:`hover:bg-black/5`}`,title:t,children:[s[t]?(0,l.jsx)(r,{icon:s[t],className:`w-3.5 shrink-0 text-[13px] text-neutral-500`}):o.has(t)?(0,l.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-[9px] text-neutral-400`,children:`K`}):null,(0,l.jsx)(`span`,{className:`truncate font-mono text-[10px] text-neutral-500`,children:n?`Copied!`:t})]},t)})})]})})};export{u as IconReferencePage};
1
+ import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{M as t,N as n,j as r}from"./fa-core-DteucspK.js";import{t as i}from"./Card-CKKHGdG4.js";import{i as a,n as o,t as s}from"./iconMap-BotklELY.js";var c=e(n(),1),l=t(),u=()=>{let[e,t]=(0,c.useState)(null),n=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]);let u=e=>{navigator.clipboard.writeText(e),t(e),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{t(null)},1200)};return(0,l.jsx)(`div`,{className:`space-y-4 text-[13px]`,children:(0,l.jsxs)(i,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[(0,l.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:[`Icon Reference (`,a.length,` icons)`]}),(0,l.jsx)(`div`,{className:`text-[11px] text-neutral-400`,children:`Click an icon to copy its name`})]}),(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:a.map(t=>{let n=e===t;return(0,l.jsxs)(`button`,{type:`button`,onClick:()=>{u(t)},className:`flex w-32 cursor-pointer items-center gap-1.5 rounded px-1.5 py-1 text-left transition-colors ${n?`bg-emerald-100`:`hover:bg-black/5`}`,title:t,children:[s[t]?(0,l.jsx)(r,{icon:s[t],className:`w-3.5 shrink-0 text-[13px] text-neutral-500`}):o.has(t)?(0,l.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-[9px] text-neutral-400`,children:`K`}):null,(0,l.jsx)(`span`,{className:`truncate font-mono text-[10px] text-neutral-500`,children:n?`Copied!`:t})]},t)})})]})})};export{u as IconReferencePage};