spiracha 1.3.2 → 1.3.3

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 (89) hide show
  1. package/apps/ui/dist/client/assets/{analytics-B_hYz65v.js → analytics-C83LcWNb.js} +1 -1
  2. package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DkY8EEpK.js +1 -0
  3. package/apps/ui/dist/client/assets/{antigravity-conversations._conversationId-z1SQC2Kg.js → antigravity-conversations._conversationId-OraHuz8j.js} +1 -1
  4. package/apps/ui/dist/client/assets/{antigravity-keychain-panel-dYuRWtCf.js → antigravity-keychain-panel-DnDcq1ge.js} +1 -1
  5. package/apps/ui/dist/client/assets/{antigravity._workspaceKey-CliqUr7o.js → antigravity._workspaceKey-CQaZscA5.js} +1 -1
  6. package/apps/ui/dist/client/assets/antigravity._workspaceKey-DTs99obU.js +1 -0
  7. package/apps/ui/dist/client/assets/antigravity.index-DbJa715k.js +1 -0
  8. package/apps/ui/dist/client/assets/{antigravity.index-CakfZz_E.js → antigravity.index-P-rs6w5X.js} +1 -1
  9. package/apps/ui/dist/client/assets/{badge-aHE9ETVe.js → badge-wgTVp-aq.js} +1 -1
  10. package/apps/ui/dist/client/assets/{checkbox-DN3XnJaA.js → checkbox-BUx0Gkuf.js} +1 -1
  11. package/apps/ui/dist/client/assets/{cursor-threads._composerId-BMQyx8qG.js → cursor-threads._composerId-D0DFXt8t.js} +1 -1
  12. package/apps/ui/dist/client/assets/cursor-threads._composerId-tFa6Cf6A.js +1 -0
  13. package/apps/ui/dist/client/assets/{cursor._workspaceKey-bYS2syGL.js → cursor._workspaceKey-Df4PfA2k.js} +1 -1
  14. package/apps/ui/dist/client/assets/cursor._workspaceKey-DwrzEtnV.js +1 -0
  15. package/apps/ui/dist/client/assets/cursor.index-CNBf4ZiR.js +1 -0
  16. package/apps/ui/dist/client/assets/{cursor.index-Clsz4E_e.js → cursor.index-DP9Hy8X6.js} +1 -1
  17. package/apps/ui/dist/client/assets/{data-table-Cj-v-uyB.js → data-table-DeQq8xdt.js} +1 -1
  18. package/apps/ui/dist/client/assets/{delete-confirm-dialog-DTpzBiNK.js → delete-confirm-dialog-CPlNsLhM.js} +1 -1
  19. package/apps/ui/dist/client/assets/{dist-BNAn99Pu.js → dist-Ds3kS91l.js} +1 -1
  20. package/apps/ui/dist/client/assets/{download-P3Rp23Ad.js → download-DLuPnxpV.js} +1 -1
  21. package/apps/ui/dist/client/assets/{dropdown-menu-3qB5j9nt.js → dropdown-menu-lFk6zjoL.js} +1 -1
  22. package/apps/ui/dist/client/assets/{es2015-Dwm_turD.js → es2015-D-H_iZF6.js} +1 -1
  23. package/apps/ui/dist/client/assets/{export-dialog-CazdrASq.js → export-dialog-CyqyvwiP.js} +1 -1
  24. package/apps/ui/dist/client/assets/{formatters-BdnWuM1z.js → formatters-DbCKP02D.js} +1 -1
  25. package/apps/ui/dist/client/assets/index-C-ZPpKJ0.js +22 -0
  26. package/apps/ui/dist/client/assets/{json-panel-DLkS30sQ.js → json-panel-BsngvucB.js} +1 -1
  27. package/apps/ui/dist/client/assets/{metadata-section-jnIkB7dB.js → metadata-section-Dtl8dNag.js} +1 -1
  28. package/apps/ui/dist/client/assets/{metric-card-CBZuWLzQ.js → metric-card-DNzR1Rne.js} +1 -1
  29. package/apps/ui/dist/client/assets/{page-header-CnD21cPn.js → page-header-dha_O7ZL.js} +1 -1
  30. package/apps/ui/dist/client/assets/{projects._project-BLszwvYL.js → projects._project-B7HBhbXv.js} +1 -1
  31. package/apps/ui/dist/client/assets/{projects._project-DvLxYbvk.js → projects._project-DHVvuT7A.js} +1 -1
  32. package/apps/ui/dist/client/assets/{projects.index-COn8woBR.js → projects.index-BUUtx2AZ.js} +1 -1
  33. package/apps/ui/dist/client/assets/{projects.index-DYs98skV.js → projects.index-BojAe1Y4.js} +1 -1
  34. package/apps/ui/dist/client/assets/{refresh-ccw-BDrYXjtD.js → refresh-ccw-B-ASKHtx.js} +1 -1
  35. package/apps/ui/dist/client/assets/{reload-error-panel-DLAg0AW2.js → reload-error-panel-DD8M1BIY.js} +1 -1
  36. package/apps/ui/dist/client/assets/{routes-BtF5-coe.js → routes-q7bzFp35.js} +1 -1
  37. package/apps/ui/dist/client/assets/{scroll-text-CqaFm9by.js → scroll-text-TvHyiJ_N.js} +1 -1
  38. package/apps/ui/dist/client/assets/{select-DbnpwqL6.js → select-BFv1HMiT.js} +1 -1
  39. package/apps/ui/dist/client/assets/{settings-CGX3VleN.js → settings-CvegTo4F.js} +1 -1
  40. package/apps/ui/dist/client/assets/{text-document-panel-DPleOmmq.js → text-document-panel-D7Rws41o.js} +1 -1
  41. package/apps/ui/dist/client/assets/{text-filter-7M6wRo-t.js → text-filter-2q5pEoZh.js} +1 -1
  42. package/apps/ui/dist/client/assets/{threads._threadId-D5w76IB-.js → threads._threadId-LpZVUlPq.js} +1 -1
  43. package/apps/ui/dist/client/assets/{threads._threadId-Dx85sI9P.js → threads._threadId-MSmNIBkq.js} +1 -1
  44. package/apps/ui/dist/client/assets/{useMutation-MZ3Hr9h9.js → useMutation-BOPJU9e0.js} +1 -1
  45. package/apps/ui/dist/client/assets/useQuery-CbxZiVGF.js +1 -0
  46. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-zvGzK-Yx.js +229 -0
  47. package/apps/ui/dist/server/assets/{analytics-CBNOYZwJ.js → analytics-Dc_QDZZC.js} +1 -1
  48. package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-BIdYNy68.js → antigravity-conversations._conversationId-C9z4AeN-.js} +2 -2
  49. package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-B9Rm4EXh.js → antigravity-conversations._conversationId-JEhx-f2R.js} +4 -4
  50. package/apps/ui/dist/server/assets/{antigravity-keychain-panel-DcLyBBwd.js → antigravity-keychain-panel-bpPoxhyp.js} +1 -1
  51. package/apps/ui/dist/server/assets/{antigravity-queries-CgQhlQ7J.js → antigravity-queries-DVIKyOXi.js} +2 -2
  52. package/apps/ui/dist/server/assets/{antigravity-server-DFUx4Khk.js → antigravity-server-Cp1lc8fp.js} +1 -1
  53. package/apps/ui/dist/server/assets/{antigravity._workspaceKey-D42ixtzp.js → antigravity._workspaceKey-BAoa4izU.js} +4 -4
  54. package/apps/ui/dist/server/assets/{antigravity._workspaceKey-DnSlSC-C.js → antigravity._workspaceKey-Dl8o1ptg.js} +2 -2
  55. package/apps/ui/dist/server/assets/{antigravity.index-DZVT-cac.js → antigravity.index-BOlrJasZ.js} +2 -2
  56. package/apps/ui/dist/server/assets/{codex-queries-eOJGfHQj.js → codex-queries-ev_mRUzr.js} +2 -2
  57. package/apps/ui/dist/server/assets/{codex-server-nrETIF--.js → codex-server-DIYFLozB.js} +2 -2
  58. package/apps/ui/dist/server/assets/{createServerRpc-BtXIw2iP.js → createServerRpc-Cg-Zr1rq.js} +1 -1
  59. package/apps/ui/dist/server/assets/{createSsrRpc-COf5Zuye.js → createSsrRpc-DVnVQhGx.js} +1 -1
  60. package/apps/ui/dist/server/assets/{cursor-queries-BMhuJeUO.js → cursor-queries-f7DjBKSD.js} +2 -2
  61. package/apps/ui/dist/server/assets/{cursor-server-BgylIFgn.js → cursor-server-nPzojHN3.js} +1 -1
  62. package/apps/ui/dist/server/assets/{cursor-threads._composerId-DXffY_CK.js → cursor-threads._composerId-B3qcsh9C.js} +2 -2
  63. package/apps/ui/dist/server/assets/{cursor-threads._composerId-BsxFKzoJ.js → cursor-threads._composerId-BK3iW-3e.js} +2 -2
  64. package/apps/ui/dist/server/assets/{cursor._workspaceKey-BP2J1x_x.js → cursor._workspaceKey-BL_CQyHQ.js} +2 -2
  65. package/apps/ui/dist/server/assets/{cursor._workspaceKey-BQd0e-Pd.js → cursor._workspaceKey-BhQeepXB.js} +2 -2
  66. package/apps/ui/dist/server/assets/{cursor.index-CQVxtCm8.js → cursor.index-CsrdckZD.js} +1 -1
  67. package/apps/ui/dist/server/assets/empty-plugin-adapters-D3qLMPfC.js +5 -0
  68. package/apps/ui/dist/server/assets/{projects._project-DUN3iWfg.js → projects._project-CqqUFr4l.js} +2 -2
  69. package/apps/ui/dist/server/assets/{projects._project-Dim9Y0kD.js → projects._project-DahGqNYS.js} +2 -2
  70. package/apps/ui/dist/server/assets/{projects.index-DjSQK5dm.js → projects.index-CkTeFWNU.js} +1 -1
  71. package/apps/ui/dist/server/assets/{router-DrDgc-LD.js → router-K0m7dK4T.js} +14 -14
  72. package/apps/ui/dist/server/assets/{routes-CNHAUMwo.js → routes-0x1U0IHq.js} +2 -2
  73. package/apps/ui/dist/server/assets/{routes-B-GlEe2C.js → routes-Xix3ZeSo.js} +2 -2
  74. package/apps/ui/dist/server/assets/{start-HeKLHD9b.js → start-bX7bXjzw.js} +1 -1
  75. package/apps/ui/dist/server/assets/{threads._threadId-CJzm4KrZ.js → threads._threadId-BLCkGW--.js} +2 -2
  76. package/apps/ui/dist/server/assets/{threads._threadId-DODTYddm.js → threads._threadId-LjgsGUh-.js} +3 -3
  77. package/apps/ui/dist/server/server.js +319 -207
  78. package/package.json +1 -1
  79. package/src/spiracha.ts +20 -1
  80. package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-qiyygB7e.js +0 -1
  81. package/apps/ui/dist/client/assets/antigravity._workspaceKey-CnoBzyX6.js +0 -1
  82. package/apps/ui/dist/client/assets/antigravity.index-DY7M1KhG.js +0 -1
  83. package/apps/ui/dist/client/assets/cursor-threads._composerId-BTlaA-tV.js +0 -1
  84. package/apps/ui/dist/client/assets/cursor._workspaceKey-CrgrfevV.js +0 -1
  85. package/apps/ui/dist/client/assets/cursor.index-CTqZMPYU.js +0 -1
  86. package/apps/ui/dist/client/assets/index-BVFnfS78.js +0 -22
  87. package/apps/ui/dist/client/assets/useQuery-Cb4V0AT0.js +0 -1
  88. package/apps/ui/dist/server/assets/__23tanstack-start-plugin-adapters-BzCA6dXo.js +0 -5
  89. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CBbkUXw6.js +0 -227
@@ -1,4 +1,4 @@
1
- import{Bt as e,Lt as t,Z as n,ft as r,it as i,lt as a,ot as o,zt as s}from"./index-BVFnfS78.js";var c=e(s(),1),l=t();function u(e){let t=e+`CollectionProvider`,[n,o]=i(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=a(f),m=c.forwardRef((e,t)=>{let{scope:n,children:i}=e;return(0,l.jsx)(p,{ref:r(t,u(f,n).collectionRef),children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=a(h),v=c.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=c.useRef(null),s=r(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,o]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}var p=`focusScope.autoFocusOnMount`,m=`focusScope.autoFocusOnUnmount`,h={bubbles:!1,cancelable:!0},g=`FocusScope`,_=c.forwardRef((e,t)=>{let{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:u,...d}=e,[f,g]=c.useState(null),_=n(s),x=n(u),S=c.useRef(null),C=r(t,e=>g(e)),E=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(E.paused||!f)return;let t=e.target;f.contains(t)?S.current=t:w(S.current,{select:!0})},t=function(e){if(E.paused||!f)return;let t=e.relatedTarget;t!==null&&(f.contains(t)||w(S.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&w(f)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return f&&r.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[a,f,E.paused]),c.useEffect(()=>{if(f){T.add(E);let e=document.activeElement;if(!f.contains(e)){let t=new CustomEvent(p,h);f.addEventListener(p,_),f.dispatchEvent(t),t.defaultPrevented||(v(ee(b(f)),{select:!0}),document.activeElement===e&&w(f))}return()=>{f.removeEventListener(p,_),setTimeout(()=>{let t=new CustomEvent(m,h);f.addEventListener(m,x),f.dispatchEvent(t),t.defaultPrevented||w(e??document.body,{select:!0}),f.removeEventListener(m,x),T.remove(E)},0)}}},[f,_,x,E]);let D=c.useCallback(e=>{if(!i&&!a||E.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,a]=y(t);r&&a?!e.shiftKey&&n===a?(e.preventDefault(),i&&w(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),i&&w(a,{select:!0})):n===t&&e.preventDefault()}},[i,a,E.paused]);return(0,l.jsx)(o.div,{tabIndex:-1,...d,ref:C,onKeyDown:D})});_.displayName=g;function v(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(w(r,{select:t}),document.activeElement!==n)return}function y(e){let t=b(e);return[x(t,e),x(t.reverse(),e)]}function b(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x(e,t){for(let n of e)if(!S(n,{upTo:t}))return n}function S(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function C(e){return e instanceof HTMLInputElement&&`select`in e}function w(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C(e)&&t&&e.select()}}var T=E();function E(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=D(e,t),e.unshift(t)},remove(t){e=D(e,t),e[0]?.resume()}}}function D(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ee(e){return e.filter(e=>e.tagName!==`A`)}var O=0;function te(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??k()),document.body.insertAdjacentElement(`beforeend`,e[1]??k()),O++,()=>{O===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),O--}},[])}function k(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var A=function(){return A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},A.apply(this,arguments)};function j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ne(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var M=`right-scroll-bar-position`,N=`width-before-scroll-bar`,re=`with-scroll-bars-hidden`,ie=`--removed-body-scroll-bar-size`;function P(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ae(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var oe=typeof window<`u`?c.useLayoutEffect:c.useEffect,se=new WeakMap;function ce(e,t){var n=ae(t||null,function(t){return e.forEach(function(e){return P(e,t)})});return oe(function(){var t=se.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||P(e,null)}),i.forEach(function(e){r.has(e)||P(e,a)})}se.set(n,e)},[e]),n}function le(e){return e}function ue(e,t){t===void 0&&(t=le);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function de(e){e===void 0&&(e={});var t=ue(null);return t.options=A({async:!0,ssr:!1},e),t}var F=function(e){var t=e.sideCar,n=j(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,A({},n))};F.isSideCarExport=!0;function fe(e,t){return e.useMedium(t),F}var I=de(),L=function(){},R=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:L,onWheelCapture:L,onTouchMoveCapture:L}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=j(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ce([n,t]),w=A(A({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:I,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),A(A({},w),{ref:C})):c.createElement(y,A({},w,{className:l,ref:C}),s))});R.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},R.classNames={fullWidth:N,zeroRight:M};var z,pe=function(){if(z)return z;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function me(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pe();return t&&e.setAttribute(`nonce`,t),e}function he(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ge(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=me())&&(he(t,n),ge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ve=function(){var e=_e();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},B=function(){var e=ve();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ye={left:0,top:0,right:0,gap:0},V=function(e){return parseInt(e||``,10)||0},be=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[V(n),V(r),V(i)]},xe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ye;var t=be(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Se=B(),H=`data-scroll-locked`,Ce=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{Bt as e,Lt as t,Z as n,ft as r,it as i,lt as a,ot as o,zt as s}from"./index-C-ZPpKJ0.js";var c=e(s(),1),l=t();function u(e){let t=e+`CollectionProvider`,[n,o]=i(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=a(f),m=c.forwardRef((e,t)=>{let{scope:n,children:i}=e;return(0,l.jsx)(p,{ref:r(t,u(f,n).collectionRef),children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=a(h),v=c.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=c.useRef(null),s=r(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,o]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}var p=`focusScope.autoFocusOnMount`,m=`focusScope.autoFocusOnUnmount`,h={bubbles:!1,cancelable:!0},g=`FocusScope`,_=c.forwardRef((e,t)=>{let{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:u,...d}=e,[f,g]=c.useState(null),_=n(s),x=n(u),S=c.useRef(null),C=r(t,e=>g(e)),E=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(a){let e=function(e){if(E.paused||!f)return;let t=e.target;f.contains(t)?S.current=t:w(S.current,{select:!0})},t=function(e){if(E.paused||!f)return;let t=e.relatedTarget;t!==null&&(f.contains(t)||w(S.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&w(f)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return f&&r.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[a,f,E.paused]),c.useEffect(()=>{if(f){T.add(E);let e=document.activeElement;if(!f.contains(e)){let t=new CustomEvent(p,h);f.addEventListener(p,_),f.dispatchEvent(t),t.defaultPrevented||(v(ee(b(f)),{select:!0}),document.activeElement===e&&w(f))}return()=>{f.removeEventListener(p,_),setTimeout(()=>{let t=new CustomEvent(m,h);f.addEventListener(m,x),f.dispatchEvent(t),t.defaultPrevented||w(e??document.body,{select:!0}),f.removeEventListener(m,x),T.remove(E)},0)}}},[f,_,x,E]);let D=c.useCallback(e=>{if(!i&&!a||E.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[r,a]=y(t);r&&a?!e.shiftKey&&n===a?(e.preventDefault(),i&&w(r,{select:!0})):e.shiftKey&&n===r&&(e.preventDefault(),i&&w(a,{select:!0})):n===t&&e.preventDefault()}},[i,a,E.paused]);return(0,l.jsx)(o.div,{tabIndex:-1,...d,ref:C,onKeyDown:D})});_.displayName=g;function v(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(w(r,{select:t}),document.activeElement!==n)return}function y(e){let t=b(e);return[x(t,e),x(t.reverse(),e)]}function b(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x(e,t){for(let n of e)if(!S(n,{upTo:t}))return n}function S(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function C(e){return e instanceof HTMLInputElement&&`select`in e}function w(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&C(e)&&t&&e.select()}}var T=E();function E(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=D(e,t),e.unshift(t)},remove(t){e=D(e,t),e[0]?.resume()}}}function D(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ee(e){return e.filter(e=>e.tagName!==`A`)}var O=0;function te(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??k()),document.body.insertAdjacentElement(`beforeend`,e[1]??k()),O++,()=>{O===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),O--}},[])}function k(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var A=function(){return A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},A.apply(this,arguments)};function j(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ne(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var M=`right-scroll-bar-position`,N=`width-before-scroll-bar`,re=`with-scroll-bars-hidden`,ie=`--removed-body-scroll-bar-size`;function P(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ae(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var oe=typeof window<`u`?c.useLayoutEffect:c.useEffect,se=new WeakMap;function ce(e,t){var n=ae(t||null,function(t){return e.forEach(function(e){return P(e,t)})});return oe(function(){var t=se.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||P(e,null)}),i.forEach(function(e){r.has(e)||P(e,a)})}se.set(n,e)},[e]),n}function le(e){return e}function ue(e,t){t===void 0&&(t=le);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function de(e){e===void 0&&(e={});var t=ue(null);return t.options=A({async:!0,ssr:!1},e),t}var F=function(e){var t=e.sideCar,n=j(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,A({},n))};F.isSideCarExport=!0;function fe(e,t){return e.useMedium(t),F}var I=de(),L=function(){},R=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:L,onWheelCapture:L,onTouchMoveCapture:L}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=j(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ce([n,t]),w=A(A({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:I,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),A(A({},w),{ref:C})):c.createElement(y,A({},w,{className:l,ref:C}),s))});R.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},R.classNames={fullWidth:N,zeroRight:M};var z,pe=function(){if(z)return z;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function me(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pe();return t&&e.setAttribute(`nonce`,t),e}function he(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ge(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=me())&&(he(t,n),ge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ve=function(){var e=_e();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},B=function(){var e=ve();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ye={left:0,top:0,right:0,gap:0},V=function(e){return parseInt(e||``,10)||0},be=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[V(n),V(r),V(i)]},xe=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ye;var t=be(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Se=B(),H=`data-scroll-locked`,Ce=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${re} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1 +1 @@
1
- import{t as e}from"./checkbox-DN3XnJaA.js";import{a as t,i as n,n as r,r as i,t as a}from"./select-DbnpwqL6.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f}from"./delete-confirm-dialog-DTpzBiNK.js";import{Bt as p,H as m,Lt as h,gt as g,mt as _,zt as v}from"./index-BVFnfS78.js";var y=g(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),b=p(v(),1),x=h();function S({...e}){return(0,x.jsx)(f,{"data-slot":`dialog`,...e})}function C({...e}){return(0,x.jsx)(u,{"data-slot":`dialog-portal`,...e})}function w({className:e,...t}){return(0,x.jsx)(o,{"data-slot":`dialog-overlay`,className:_(`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t})}function T({className:e,children:t,showCloseButton:n=!0,...r}){return(0,x.jsxs)(C,{"data-slot":`dialog-portal`,children:[(0,x.jsx)(w,{}),(0,x.jsxs)(d,{"data-slot":`dialog-content`,className:_(`data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg`,e),...r,children:[t,n&&(0,x.jsxs)(l,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,children:[(0,x.jsx)(y,{}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function E({className:e,...t}){return(0,x.jsx)(`div`,{"data-slot":`dialog-header`,className:_(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function D({className:e,showCloseButton:t=!1,children:n,...r}){return(0,x.jsxs)(`div`,{"data-slot":`dialog-footer`,className:_(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,x.jsx)(l,{asChild:!0,children:(0,x.jsx)(m,{variant:`outline`,children:`Close`})})]})}function O({className:e,...t}){return(0,x.jsx)(s,{"data-slot":`dialog-title`,className:_(`font-semibold text-lg leading-none`,e),...t})}function k({className:e,...t}){return(0,x.jsx)(c,{"data-slot":`dialog-description`,className:_(`text-muted-foreground text-sm`,e),...t})}function A({open:o,pending:s=!1,title:c=`Export thread`,onExport:l,onOpenChange:u}){let[d,f]=(0,b.useState)(`md`),[p,h]=(0,b.useState)(!0),[g,_]=(0,b.useState)(!1),[v,y]=(0,b.useState)(!0);return(0,x.jsx)(S,{open:o,onOpenChange:u,children:(0,x.jsxs)(T,{className:`border-[var(--border)] bg-[var(--panel)] text-[var(--foreground)]`,children:[(0,x.jsxs)(E,{children:[(0,x.jsx)(O,{children:c}),(0,x.jsx)(k,{className:`text-[var(--muted-foreground)]`,children:`Choose the transcript format and whether the export includes tool calls.`})]}),(0,x.jsxs)(`div`,{className:`space-y-5 py-2`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`label`,{className:`font-medium text-sm`,htmlFor:`output-format`,children:`Output format`}),(0,x.jsxs)(a,{value:d,onValueChange:e=>f(e),children:[(0,x.jsx)(n,{id:`output-format`,className:`border-[var(--border)] bg-[var(--panel-secondary)]`,children:(0,x.jsx)(t,{placeholder:`Choose a format`})}),(0,x.jsxs)(r,{children:[(0,x.jsx)(i,{value:`md`,children:`Markdown (.md)`}),(0,x.jsx)(i,{value:`txt`,children:`Plain text (.txt)`})]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include metadata`,checked:p,onCheckedChange:e=>h(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include metadata`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes the chat metadata section at the top of the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include commentary`,checked:g,onCheckedChange:e=>_(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include commentary`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes assistant commentary-phase updates in the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include tool calls`,checked:v,onCheckedChange:e=>y(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include tool calls`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes tool-call summaries and tool-output summaries in the export.`})]})]})]}),(0,x.jsxs)(D,{children:[(0,x.jsx)(m,{className:`rounded-full`,variant:`outline`,onClick:()=>u(!1),children:`Cancel`}),(0,x.jsx)(m,{className:`rounded-full`,disabled:s,onClick:()=>l({includeCommentary:g,includeMetadata:p,includeTools:v,outputFormat:d}),children:s?`Exporting...`:`Download export`})]})]})})}export{y as n,A as t};
1
+ import{t as e}from"./checkbox-BUx0Gkuf.js";import{a as t,i as n,n as r,r as i,t as a}from"./select-BFv1HMiT.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f}from"./delete-confirm-dialog-CPlNsLhM.js";import{Bt as p,H as m,Lt as h,gt as g,mt as _,zt as v}from"./index-C-ZPpKJ0.js";var y=g(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),b=p(v(),1),x=h();function S({...e}){return(0,x.jsx)(f,{"data-slot":`dialog`,...e})}function C({...e}){return(0,x.jsx)(u,{"data-slot":`dialog-portal`,...e})}function w({className:e,...t}){return(0,x.jsx)(o,{"data-slot":`dialog-overlay`,className:_(`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t})}function T({className:e,children:t,showCloseButton:n=!0,...r}){return(0,x.jsxs)(C,{"data-slot":`dialog-portal`,children:[(0,x.jsx)(w,{}),(0,x.jsxs)(d,{"data-slot":`dialog-content`,className:_(`data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg`,e),...r,children:[t,n&&(0,x.jsxs)(l,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,children:[(0,x.jsx)(y,{}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function E({className:e,...t}){return(0,x.jsx)(`div`,{"data-slot":`dialog-header`,className:_(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function D({className:e,showCloseButton:t=!1,children:n,...r}){return(0,x.jsxs)(`div`,{"data-slot":`dialog-footer`,className:_(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,x.jsx)(l,{asChild:!0,children:(0,x.jsx)(m,{variant:`outline`,children:`Close`})})]})}function O({className:e,...t}){return(0,x.jsx)(s,{"data-slot":`dialog-title`,className:_(`font-semibold text-lg leading-none`,e),...t})}function k({className:e,...t}){return(0,x.jsx)(c,{"data-slot":`dialog-description`,className:_(`text-muted-foreground text-sm`,e),...t})}function A({open:o,pending:s=!1,title:c=`Export thread`,onExport:l,onOpenChange:u}){let[d,f]=(0,b.useState)(`md`),[p,h]=(0,b.useState)(!0),[g,_]=(0,b.useState)(!1),[v,y]=(0,b.useState)(!0);return(0,x.jsx)(S,{open:o,onOpenChange:u,children:(0,x.jsxs)(T,{className:`border-[var(--border)] bg-[var(--panel)] text-[var(--foreground)]`,children:[(0,x.jsxs)(E,{children:[(0,x.jsx)(O,{children:c}),(0,x.jsx)(k,{className:`text-[var(--muted-foreground)]`,children:`Choose the transcript format and whether the export includes tool calls.`})]}),(0,x.jsxs)(`div`,{className:`space-y-5 py-2`,children:[(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsx)(`label`,{className:`font-medium text-sm`,htmlFor:`output-format`,children:`Output format`}),(0,x.jsxs)(a,{value:d,onValueChange:e=>f(e),children:[(0,x.jsx)(n,{id:`output-format`,className:`border-[var(--border)] bg-[var(--panel-secondary)]`,children:(0,x.jsx)(t,{placeholder:`Choose a format`})}),(0,x.jsxs)(r,{children:[(0,x.jsx)(i,{value:`md`,children:`Markdown (.md)`}),(0,x.jsx)(i,{value:`txt`,children:`Plain text (.txt)`})]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include metadata`,checked:p,onCheckedChange:e=>h(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include metadata`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes the chat metadata section at the top of the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include commentary`,checked:g,onCheckedChange:e=>_(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include commentary`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes assistant commentary-phase updates in the exported transcript.`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3`,children:[(0,x.jsx)(e,{"aria-label":`Include tool calls`,checked:v,onCheckedChange:e=>y(e===!0)}),(0,x.jsxs)(`span`,{className:`space-y-1`,children:[(0,x.jsx)(`span`,{className:`block font-medium text-sm`,children:`Include tool calls`}),(0,x.jsx)(`span`,{className:`block text-[var(--muted-foreground)] text-sm`,children:`Includes tool-call summaries and tool-output summaries in the export.`})]})]})]}),(0,x.jsxs)(D,{children:[(0,x.jsx)(m,{className:`rounded-full`,variant:`outline`,onClick:()=>u(!1),children:`Cancel`}),(0,x.jsx)(m,{className:`rounded-full`,disabled:s,onClick:()=>l({includeCommentary:g,includeMetadata:p,includeTools:v,outputFormat:d}),children:s?`Exporting...`:`Download export`})]})]})})}export{y as n,A as t};
@@ -1 +1 @@
1
- import{At as e,Bt as t,Dt as n,Et as r,Lt as i,Mt as a,Nt as o,Ot as s,Pt as c,St as l,Tt as u,_t as d,bt as f,jt as p,kt as m,wt as h,xt as g,yt as _,zt as v}from"./index-BVFnfS78.js";var y=class extends c{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof n(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&C(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(l.isServer()||this.#r.isStale||!h(e))return;let t=p(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l.isServer()||n(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(a.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(a.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let i=this.#t,a=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===i?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let n=this.hasListeners(),r=!n&&x(e,t),o=n&&C(e,i,t,a);(r||o)&&(d={...d,..._(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=r(o?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=r(o?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:n(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,n=O.status===`error`&&!t,r=e=>{n?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{r(this.#o=O.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===i.queryHash&&r(o);break;case`fulfilled`:(n||O.data!==o.value)&&a();break;case`rejected`:(!n||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){f.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return n(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&n(t.retryOnMount,e)===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,r){if(n(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let n=typeof r==`function`?r(e):r;return n===`always`||n!==!1&&w(e,t)}return!1}function C(e,t,r,i){return(e!==t||n(i.enabled,e)===!1)&&(!r.suspense||e.state.status!==`error`)&&w(e,r)}function w(e,t){return n(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function T(e,t){return!m(e.getCurrentResult(),t)}i();var E=t(v(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider;function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(t,n,r)=>{let i=r?.state.error&&typeof t.throwOnError==`function`?e(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(n.isReset()||(t.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:t,errorResetBoundary:n,throwOnError:r,query:i,suspense:a})=>t.isError&&!n.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||e(r,[t.error,i])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=d(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,I(o),M(o,i,s),N(i);let p=!a.getQueryCache().get(o.queryHash),[m]=E.useState(()=>new t(a,o)),h=m.getOptimisticResult(o),g=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=g?m.subscribe(f.batchCalls(e)):u;return m.updateResult(),t},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),E.useEffect(()=>{m.setOptions(o)},[o,m]),R(o,h))throw z(o,m,i);if(P({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw h.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,h),o.experimental_prefetchInRender&&!l.isServer()&&L(h,r)&&(p?z(o,m,i):s?.promise)?.catch(u).finally(()=>{m.updateResult()}),o.notifyOnChangeProps?h:m.trackResult(h)}function V(e,t){return B({...e,enabled:!0,suspense:!0,throwOnError:F,placeholderData:void 0},y,t)}var H=e=>e?e.split(/[-_\s]+/u).filter(Boolean).map(e=>{let t=e.toLowerCase();return t===`gpt`?`GPT`:/^[a-z]\d$/u.test(t)?t.toUpperCase():/^\d+(\.\d+)*$/u.test(e)?e:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}).join(` `):`Assistant`,U=new Map,W=e=>{let t=e??`local`,n=U.get(t);if(n)return n;let r={dayKeyFormatter:new Intl.DateTimeFormat(`en-CA`,{day:`2-digit`,month:`2-digit`,timeZone:e,year:`numeric`}),timePartsFormatter:new Intl.DateTimeFormat(`en-US`,{day:`numeric`,hour:`numeric`,hour12:!0,minute:`2-digit`,month:`short`,timeZone:e,year:`numeric`})};return U.set(t,r),r},G=(e,t)=>W(t).dayKeyFormatter.format(e),K=(e,t)=>{let n=W(t).timePartsFormatter.formatToParts(e),r=new Map(n.map(e=>[e.type,e.value])),i=r.get(`hour`),a=r.get(`minute`),o=r.get(`dayPeriod`);return!i||!a||!o?null:{day:r.get(`day`)??``,month:r.get(`month`)??``,time:`${i}:${a} ${o}`.trim(),year:r.get(`year`)??``}},q=e=>new Intl.NumberFormat(`en-US`).format(e),J=e=>`${q(e)} tokens`,Y=e=>{if(!e||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=100||r===0?0:1;return`${n.toFixed(i)} ${t[r]}`},X=(e,t={})=>{if(e==null||e===``)return`n/a`;let n=new Date(e);if(Number.isNaN(n.getTime()))return`n/a`;let r=t.now??new Date,i=K(n,t.timeZone);if(!i)return`n/a`;let{day:a,month:o,time:s,year:c}=i;if(G(n,t.timeZone)===G(r,t.timeZone))return s;let l=K(r,t.timeZone)?.year;return c&&l&&c!==l?`${o} ${a}, ${c} · ${s}`:`${o} ${a} · ${s}`},Z=e=>e.length===0?`n/a`:e.join(`, `),Q=e=>e?`Yes`:`No`,$=H;export{$ as a,V as c,Z as i,B as l,Y as n,q as o,X as r,J as s,Q as t,y as u};
1
+ import{At as e,Bt as t,Dt as n,Et as r,Lt as i,Mt as a,Nt as o,Ot as s,Pt as c,St as l,Tt as u,_t as d,bt as f,jt as p,kt as m,wt as h,xt as g,yt as _,zt as v}from"./index-C-ZPpKJ0.js";var y=class extends c{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=g(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof n(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&C(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||s(this.options.staleTime,this.#t)!==s(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==r||n(this.options.enabled,this.#t)!==n(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=s(this.options.staleTime,this.#t);if(l.isServer()||this.#r.isStale||!h(e))return;let t=p(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(l.isServer()||n(this.options.enabled,this.#t)===!1||!h(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(a.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(a.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let i=this.#t,a=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===i?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let n=this.hasListeners(),r=!n&&x(e,t),o=n&&C(e,i,t,a);(r||o)&&(d={...d,..._(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:v}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&v===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,p=r(o?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(o&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=r(o?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,h=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,S=v===`pending`,T=v===`error`,E=S&&b,D=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:n(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,n=O.status===`error`&&!t,r=e=>{n?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{r(this.#o=O.promise=g())},o=this.#o;switch(o.status){case`pending`:e.queryHash===i.queryHash&&r(o);break;case`fulfilled`:(n||O.data!==o.value)&&a();break;case`rejected`:(!n||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){f.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return n(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&n(t.retryOnMount,e)===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,r){if(n(t.enabled,e)!==!1&&s(t.staleTime,e)!==`static`){let n=typeof r==`function`?r(e):r;return n===`always`||n!==!1&&w(e,t)}return!1}function C(e,t,r,i){return(e!==t||n(i.enabled,e)===!1)&&(!r.suspense||e.state.status!==`error`)&&w(e,r)}function w(e,t){return n(t.enabled,e)!==!1&&e.isStaleByTime(s(t.staleTime,e))}function T(e,t){return!m(e.getCurrentResult(),t)}i();var E=t(v(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider;function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(t,n,r)=>{let i=r?.state.error&&typeof t.throwOnError==`function`?e(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||i)&&(n.isReset()||(t.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:t,errorResetBoundary:n,throwOnError:r,query:i,suspense:a})=>t.isError&&!n.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||e(r,[t.error,i])),F=(e,t)=>t.state.data===void 0,I=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=d(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,I(o),M(o,i,s),N(i);let p=!a.getQueryCache().get(o.queryHash),[m]=E.useState(()=>new t(a,o)),h=m.getOptimisticResult(o),g=!r&&c;if(E.useSyncExternalStore(E.useCallback(e=>{let t=g?m.subscribe(f.batchCalls(e)):u;return m.updateResult(),t},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),E.useEffect(()=>{m.setOptions(o)},[o,m]),R(o,h))throw z(o,m,i);if(P({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw h.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,h),o.experimental_prefetchInRender&&!l.isServer()&&L(h,r)&&(p?z(o,m,i):s?.promise)?.catch(u).finally(()=>{m.updateResult()}),o.notifyOnChangeProps?h:m.trackResult(h)}function V(e,t){return B({...e,enabled:!0,suspense:!0,throwOnError:F,placeholderData:void 0},y,t)}var H=e=>e?e.split(/[-_\s]+/u).filter(Boolean).map(e=>{let t=e.toLowerCase();return t===`gpt`?`GPT`:/^[a-z]\d$/u.test(t)?t.toUpperCase():/^\d+(\.\d+)*$/u.test(e)?e:`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}).join(` `):`Assistant`,U=new Map,W=e=>{let t=e??`local`,n=U.get(t);if(n)return n;let r={dayKeyFormatter:new Intl.DateTimeFormat(`en-CA`,{day:`2-digit`,month:`2-digit`,timeZone:e,year:`numeric`}),timePartsFormatter:new Intl.DateTimeFormat(`en-US`,{day:`numeric`,hour:`numeric`,hour12:!0,minute:`2-digit`,month:`short`,timeZone:e,year:`numeric`})};return U.set(t,r),r},G=(e,t)=>W(t).dayKeyFormatter.format(e),K=(e,t)=>{let n=W(t).timePartsFormatter.formatToParts(e),r=new Map(n.map(e=>[e.type,e.value])),i=r.get(`hour`),a=r.get(`minute`),o=r.get(`dayPeriod`);return!i||!a||!o?null:{day:r.get(`day`)??``,month:r.get(`month`)??``,time:`${i}:${a} ${o}`.trim(),year:r.get(`year`)??``}},q=e=>new Intl.NumberFormat(`en-US`).format(e),J=e=>`${q(e)} tokens`,Y=e=>{if(!e||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=100||r===0?0:1;return`${n.toFixed(i)} ${t[r]}`},X=(e,t={})=>{if(e==null||e===``)return`n/a`;let n=new Date(e);if(Number.isNaN(n.getTime()))return`n/a`;let r=t.now??new Date,i=K(n,t.timeZone);if(!i)return`n/a`;let{day:a,month:o,time:s,year:c}=i;if(G(n,t.timeZone)===G(r,t.timeZone))return s;let l=K(r,t.timeZone)?.year;return c&&l&&c!==l?`${o} ${a}, ${c} · ${s}`:`${o} ${a} · ${s}`},Z=e=>e.length===0?`n/a`:e.join(`, `),Q=e=>e?`Yes`:`No`,$=H;export{$ as a,V as c,Z as i,B as l,Y as n,q as o,X as r,J as s,Q as t,y as u};