birdclaw 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +6 -2
- package/dist/cli/birdclaw.js +3267 -2991
- package/dist/client/assets/{SavedTimelineView-4QYaZ4CU.js → SavedTimelineView-CFgHR6di.js} +1 -1
- package/dist/client/assets/{TimelineRouteFrame-DJdUR7DX.js → TimelineRouteFrame-DcipwBqo.js} +1 -1
- package/dist/client/assets/{blocks-C84MpzHq.js → blocks-GWWj1dXr.js} +1 -1
- package/dist/client/assets/blocks-qrevFiNI.js +2 -0
- package/dist/client/assets/{bookmarks-Gy6MvAc9.js → bookmarks-BMf6Ytua.js} +1 -1
- package/dist/client/assets/{discuss-DKC6H1fN.js → discuss-BeFPn8mN.js} +2 -2
- package/dist/client/assets/{discuss-C0CUMn6v.js → discuss-ZvGdSAmA.js} +1 -1
- package/dist/client/assets/dms-CMp6bAR_.js +1 -0
- package/dist/client/assets/{dms-Q1a1kZ_P.js → dms-DBexFtGg.js} +2 -2
- package/dist/client/assets/{inbox-C9zFrQ76.js → inbox-CeGwsGo_.js} +1 -1
- package/dist/client/assets/{inbox-DjlVjj3K.js → inbox-DvSRkOiH.js} +2 -2
- package/dist/client/assets/{index-B8hO98gL.js → index-Bz8aYylW.js} +3 -3
- package/dist/client/assets/{likes-BXANVRCj.js → likes-BaljrAHC.js} +1 -1
- package/dist/client/assets/{links-6tWeHun_.js → links-CbC-fX7T.js} +2 -2
- package/dist/client/assets/{links-D3Ut-aUB.js → links-DMGuDd-B.js} +1 -1
- package/dist/client/assets/{mentions-BKO40XiK.js → mentions-TFNyR9F4.js} +1 -1
- package/dist/client/assets/{network-map-DUpppygD.js → network-map-1fXIqI3Y.js} +1 -1
- package/dist/client/assets/{network-map-2EPsbMIT.js → network-map-CKiXfloJ.js} +2 -2
- package/dist/client/assets/{routes-ARIEjgq-.js → routes-P7NzOusD.js} +1 -1
- package/dist/client/assets/{today-DNAg-wnA.js → today-DOUIqDPa.js} +2 -2
- package/dist/client/assets/{today-Q3xFx4cl.js → today-Dq8qoGhX.js} +1 -1
- package/dist/client/assets/{useTimelineRouteData-DYhYLZY4.js → useTimelineRouteData-2v9TVG9L.js} +1 -1
- package/dist/server/assets/{SavedTimelineView-Ern3q7LW.js → SavedTimelineView-lVz_ZZnh.js} +1 -1
- package/dist/server/assets/{TimelineRouteFrame-CYD-qMuy.js → TimelineRouteFrame-Dj1TeYrD.js} +1 -1
- package/dist/server/assets/{_tanstack-start-manifest_v-CHtuH75x.js → _tanstack-start-manifest_v-DQT-Q-zz.js} +28 -28
- package/dist/server/assets/{blocks-VXmcBqKD.js → blocks-BSvPOa_E.js} +2 -2
- package/dist/server/assets/{blocks-DWZAKPAX.js → blocks-Cv7I4iVs.js} +2 -2
- package/dist/server/assets/{bookmarks-DVCjWQPu.js → bookmarks-BcFpV8qD.js} +1 -1
- package/dist/server/assets/{discuss-4b2z14mT.js → discuss-BuLhalye.js} +2 -2
- package/dist/server/assets/{discuss-CJ_vThu8.js → discuss-D1q_L77A.js} +2 -2
- package/dist/server/assets/{dms-DbJk33XB.js → dms-C-s5l0cs.js} +3 -3
- package/dist/server/assets/{dms-Cr5heLhm.js → dms-OtbAd5nR.js} +2 -2
- package/dist/server/assets/{inbox-D607zrwZ.js → inbox-Wf8xGIjq.js} +2 -2
- package/dist/server/assets/{inbox-BJzEE8Aa.js → inbox-wLir608r.js} +1 -1
- package/dist/server/assets/{likes-C3EpsPbF.js → likes-BfFIyEbU.js} +1 -1
- package/dist/server/assets/{links-BU_FRxcz.js → links-BWt4ORY4.js} +2 -2
- package/dist/server/assets/{links-Dz-6bmkg.js → links-_ePW92kI.js} +2 -2
- package/dist/server/assets/{mentions-BHd6N_OL.js → mentions-oO4uv0Ju.js} +1 -1
- package/dist/server/assets/{router-BMfpBcBM.js → router-DY-ahyjD.js} +14588 -14521
- package/dist/server/assets/{routes-Cyokiwx1.js → routes-CYJ-dTi6.js} +1 -1
- package/dist/server/assets/start-CHdfdlfD.js +4 -0
- package/dist/server/assets/{today-CRa6Y-Tg.js → today-BLDqhLvT.js} +2 -2
- package/dist/server/assets/{today-CScZDxQx.js → today-D8zExFWH.js} +2 -2
- package/dist/server/server.js +4 -4
- package/package.json +89 -91
- package/dist/client/assets/blocks-BpjvGwYq.js +0 -2
- package/dist/client/assets/dms-DWA5tvJS.js +0 -1
- package/dist/server/assets/start-P4i55asu.js +0 -4
- package/dist/server/assets/{useTimelineRouteData-BWxx9yQl.js → useTimelineRouteData-wthflgOe.js} +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/network-map-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as i}from"./schemas-CMQMhQXI.js";import{t as a}from"./createLucideIcon-CMLcIxOz.js";import{a as o,b as s,g as c,n as l,r as u}from"./query-client-CA-do_IS.js";import{t as d}from"./useQuery-CL_NXLnc.js";import{i as f,r as p}from"./account-selection-h7m9xmzU.js";import{o as m}from"./route-search-CmZT7pGD.js";import{n as h,t as g}from"./preload-helper-MpqUbZCn.js";var _=a(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),v=e(t(),1);i();var y=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],b=1,x=8,S=new Uint32Array(96),C=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==b)throw Error(`Got v${i} data when expected v${b}.`);let a=y[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,n=Float64Array,r=ArrayBuffer,i){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=y.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,x,e),this.coords=new n(i,x+s+c,e*2),this._pos=e*2,this._finished=!0;else{let i=this.data=new r(x+o+s+c);this.ids=new this.IndexArrayType(i,x,e),this.coords=new n(i,x+s+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(i,0,2).set([219,(b<<4)+a]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return w(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;S[0]=0,S[1]=i.length-1,S[2]=0;let s=3,c=[];for(;s>0;){let l=S[--s],u=S[--s],d=S[--s];if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(S[s++]=d,S[s++]=f-1,S[s++]=1-l),(l===0?n>=p:r>=m)&&(S[s++]=f+1,S[s++]=u,S[s++]=1-l)}return c}within(e,t,n){let r=[];return this.withinInto(e,t,n,r),r}withinInto(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;S[0]=0,S[1]=i.length-1,S[2]=0;let s=3,c=0,l=n*n;for(;s>0;){let u=S[--s],d=S[--s],f=S[--s];if(d-f<=o){for(let n=f;n<=d;n++)O(a[2*n],a[2*n+1],e,t)<=l&&(r[c++]=i[n]);continue}let p=f+d>>1,m=a[2*p],h=a[2*p+1];O(m,h,e,t)<=l&&(r[c++]=i[p]),(u===0?e-n<=m:t-n<=h)&&(S[s++]=f,S[s++]=p-1,S[s++]=1-u),(u===0?e+n>=m:t+n>=h)&&(S[s++]=p+1,S[s++]=d,S[s++]=1-u)}return c}};function w(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;T(e,t,o,r,i,a),w(e,t,n,r,o-1,1-a),w(e,t,n,o+1,i,1-a)}function T(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);T(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(E(e,t,r,n),t[2*i+a]>o&&E(e,t,r,i);s<c;){for(E(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?E(e,t,r,c):(c++,E(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function E(e,t,n,r){D(e,n,r),D(t,2*n,2*r),D(t,2*n+1,2*r+1)}function D(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function O(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var k={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},A=Math.fround||(e=>(t=>(e[0]=+t,e[0])))(new Float32Array(1)),j=2,M=3,N=4,P=5,F=6,I=class{constructor(e){this.options=Object.assign(Object.create(k),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n.geometry)continue;let[r,i]=n.geometry.coordinates,o=A(z(r)),s=A(B(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(z(n),B(a),z(i),B(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+P]>1?L(c,t,this.clusterProps):this.points[c[t+M]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=a[t*this.stride],c=a[t*this.stride+1],l=i.within(s,c,o),u=[];for(let t of l){let n=t*this.stride;a[n+N]===e&&u.push(a[n+P]>1?L(a,n,this.clusterProps):this.points[a[n+M]])}if(u.length===0)throw Error(r);return u}getLeaves(e,t,n){t||=10,n||=0;let r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(e){let t=new C(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+P]>1,c,l,u;if(s)c=R(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+M]];c=n.properties;let[r,i]=n.geometry.coordinates;l=z(r),u=B(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+M]:this.points[t[e+M]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+j]<=t)continue;s[n+j]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+P],p=f;for(let e of d){let n=e*l;s[n+j]>t&&(p+=s[n+P])}if(p>f&&p>=a){let e=r*f,a=u*f,o,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+j]<=t)continue;s[c+j]=t;let u=s[c+P];e+=s[c]*u,a+=s[c+1]*u,s[c+N]=h,i&&(o||(o=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(o)),i(o,this._map(s,c)))}s[n+N]=h,c.push(e/p,a/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+j]<=t)){s[n+j]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+P]>1){let r=this.clusterProps[e[t+F]];return n?Object.assign({},r):r}let r=this.points[e[t+M]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}};function L(e,t,n){return{type:`Feature`,id:e[t+M],properties:R(e,t,n),geometry:{type:`Point`,coordinates:[V(e[t]),H(e[t+1])]}}}function R(e,t,n){let r=e[t+P],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,a=e[t+F],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+M],point_count:r,point_count_abbreviated:i})}function z(e){return e/360+.5}function B(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function V(e){return(e-.5)*360}function H(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var U=[{value:`all`,label:`All`},{value:`followers`,label:`Followers`},{value:`following`,label:`Following`},{value:`mutual`,label:`Mutual`}],W={bounds:[-180,-85,180,85],zoom:1.15};async function G(e,t,n,r){let i=new URL(`/api/network-map`,window.location.origin);return i.searchParams.set(`type`,e),i.searchParams.set(`limit`,`50000`),i.searchParams.set(`geocodeLimit`,t?`80`:`12`),n&&i.searchParams.set(`account`,n),t&&i.searchParams.set(`refresh`,`true`),u(i,{signal:r},c,`Map request failed`)}function K(e){return new Intl.NumberFormat().format(e)}function q(e){return e===`mutual`?`mutual`:e===`following`?`following`:`follower`}function J(e){return e===`mutual`?`#22c55e`:e===`following`?`#f59e0b`:`#1d9bf0`}function Y(e){return(e.properties.name||e.properties.handle||`?`).slice(0,1).toUpperCase()}function X(e){return e.properties.avatarUrl?`/api/avatar?${new URLSearchParams({profileId:e.properties.profileId,v:e.properties.avatarUrl}).toString()}`:null}function Z(e){let t=Math.max(1,e.followers+e.following+e.mutual),n=e.mutual/t*100,r=n+e.following/t*100;return`conic-gradient(#22c55e 0 ${n}%, #f59e0b ${n}% ${r}%, #1d9bf0 ${r}% 100%)`}function Q(e){let t=e.map((e,t)=>({type:`Feature`,geometry:e.geometry,properties:{featureIndex:t,handle:e.properties.handle,name:e.properties.name,avatarUrl:e.properties.avatarUrl,relationship:e.properties.relationship,followersCount:e.properties.followersCount}}));return new I({maxZoom:18,minPoints:2,radius:64,map:e=>({followers:+(e.relationship===`followers`),following:+(e.relationship===`following`),mutual:+(e.relationship===`mutual`)}),reduce:(e,t)=>{e.followers+=t.followers,e.following+=t.following,e.mutual+=t.mutual}}).load(t)}function $(e){return`cluster`in e.properties&&e.properties.cluster===!0}function ee(e,t){return t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)}function te(e,t){let n=new Map;for(let t of e){let[e,r]=t.geometry.coordinates,i=`${e.toFixed(4)},${r.toFixed(4)}`,a=n.get(i);a?(a.count+=1,a.followers+=t.properties.followersCount):n.set(i,{coordinates:[e,r],count:1,followers:t.properties.followersCount})}return[...n.values()].sort((e,t)=>t.count-e.count||t.followers-e.followers)[0]?.coordinates??t}function ne(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.getBounds!=`function`||typeof t.getZoom!=`function`)return null;let n=t.getBounds();return{bounds:[n.getWest(),n.getSouth(),n.getEast(),n.getNorth()],zoom:t.getZoom()}}function re(e,t){let[n,r,i,a]=e,[o,s]=t.geometry.coordinates,c=(n+540)%360-180,l=(i+540)%360-180,u=s>=Math.max(-85,r)&&s<=Math.min(85,a),d=i-n>=360?!0:c<=l?o>=c&&o<=l:o>=c||o<=l;return u&&d}function ie(e,t){let n=t.trim().toLowerCase();return!n||[e.properties.name,e.properties.handle,e.properties.location,e.properties.resolvedLocation??``,q(e.properties.relationship)].join(` `).toLowerCase().includes(n)}function ae(e,t){let n=s(),{type:r,q:i}=e,[a,c]=(0,v.useState)(W),u=p(d({queryKey:l.status,queryFn:({signal:e})=>o({signal:e})}).data?.accounts),m=[...l.networkMap,{type:r,selectedAccountId:u??null}],h=d({queryKey:m,queryFn:({signal:e})=>G(r,!1,u,e),staleTime:5*6e4}),g=f({mutationFn:()=>G(r,!0,u),onSuccess:e=>{n.setQueryData(m,e)}}),_=h.data??null,y=h.isPending||g.isPending,b=g.error??h.error,x=(0,v.useMemo)(()=>(_?.features??[]).slice().filter(e=>re(a.bounds,e)).sort((e,t)=>t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)),[_,a]),S=(0,v.useMemo)(()=>x.filter(e=>ie(e,i)).slice(0,160),[x,i]);return{type:r,setType:n=>t({...e,type:n}),viewport:a,setViewport:c,visibleSearch:i,setVisibleSearch:n=>t({...e,q:n},{replace:!0}),data:_,loading:y,error:b?b instanceof Error?b.message:`Map unavailable`:null,refresh:g.mutate,visibleFeatures:x,filteredVisibleFeatures:S,mapTypes:U}}h();var oe=n(`/network-map`)({component:r(()=>g(()=>import(`./network-map-DUpppygD.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:m});export{X as a,ee as c,te as d,$ as f,_ as h,Y as i,K as l,J as m,ae as n,Q as o,ne as p,W as r,Z as s,oe as t,q as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/network-map-1fXIqI3Y.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/createLucideIcon-CMLcIxOz.js","assets/refresh-cw-IUfM9D_1.js","assets/search-C_LqodNa.js","assets/users-DI3w8Mol.js","assets/preload-helper-MpqUbZCn.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as i}from"./schemas-CMQMhQXI.js";import{t as a}from"./createLucideIcon-CMLcIxOz.js";import{a as o,b as s,g as c,n as l,r as u}from"./query-client-CA-do_IS.js";import{t as d}from"./useQuery-CL_NXLnc.js";import{i as f,r as p}from"./account-selection-h7m9xmzU.js";import{n as m,t as h}from"./preload-helper-MpqUbZCn.js";import{o as g}from"./route-search-CmZT7pGD.js";var _=a(`earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),v=e(t(),1);i();var y=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],b=1,x=8,S=new Uint32Array(96),C=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==b)throw Error(`Got v${i} data when expected v${b}.`);let a=y[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,n=Float64Array,r=ArrayBuffer,i){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=y.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,x,e),this.coords=new n(i,x+s+c,e*2),this._pos=e*2,this._finished=!0;else{let i=this.data=new r(x+o+s+c);this.ids=new this.IndexArrayType(i,x,e),this.coords=new n(i,x+s+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(i,0,2).set([219,(b<<4)+a]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return w(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;S[0]=0,S[1]=i.length-1,S[2]=0;let s=3,c=[];for(;s>0;){let l=S[--s],u=S[--s],d=S[--s];if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(S[s++]=d,S[s++]=f-1,S[s++]=1-l),(l===0?n>=p:r>=m)&&(S[s++]=f+1,S[s++]=u,S[s++]=1-l)}return c}within(e,t,n){let r=[];return this.withinInto(e,t,n,r),r}withinInto(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;S[0]=0,S[1]=i.length-1,S[2]=0;let s=3,c=0,l=n*n;for(;s>0;){let u=S[--s],d=S[--s],f=S[--s];if(d-f<=o){for(let n=f;n<=d;n++)O(a[2*n],a[2*n+1],e,t)<=l&&(r[c++]=i[n]);continue}let p=f+d>>1,m=a[2*p],h=a[2*p+1];O(m,h,e,t)<=l&&(r[c++]=i[p]),(u===0?e-n<=m:t-n<=h)&&(S[s++]=f,S[s++]=p-1,S[s++]=1-u),(u===0?e+n>=m:t+n>=h)&&(S[s++]=p+1,S[s++]=d,S[s++]=1-u)}return c}};function w(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;T(e,t,o,r,i,a),w(e,t,n,r,o-1,1-a),w(e,t,n,o+1,i,1-a)}function T(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);T(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(E(e,t,r,n),t[2*i+a]>o&&E(e,t,r,i);s<c;){for(E(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?E(e,t,r,c):(c++,E(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function E(e,t,n,r){D(e,n,r),D(t,2*n,2*r),D(t,2*n+1,2*r+1)}function D(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function O(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var k={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},A=Math.fround||(e=>(t=>(e[0]=+t,e[0])))(new Float32Array(1)),j=2,M=3,N=4,P=5,F=6,I=class{constructor(e){this.options=Object.assign(Object.create(k),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n.geometry)continue;let[r,i]=n.geometry.coordinates,o=A(z(r)),s=A(B(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(z(n),B(a),z(i),B(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+P]>1?L(c,t,this.clusterProps):this.points[c[t+M]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=a[t*this.stride],c=a[t*this.stride+1],l=i.within(s,c,o),u=[];for(let t of l){let n=t*this.stride;a[n+N]===e&&u.push(a[n+P]>1?L(a,n,this.clusterProps):this.points[a[n+M]])}if(u.length===0)throw Error(r);return u}getLeaves(e,t,n){t||=10,n||=0;let r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(e){let t=new C(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+P]>1,c,l,u;if(s)c=R(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+M]];c=n.properties;let[r,i]=n.geometry.coordinates;l=z(r),u=B(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+M]:this.points[t[e+M]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+j]<=t)continue;s[n+j]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+P],p=f;for(let e of d){let n=e*l;s[n+j]>t&&(p+=s[n+P])}if(p>f&&p>=a){let e=r*f,a=u*f,o,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+j]<=t)continue;s[c+j]=t;let u=s[c+P];e+=s[c]*u,a+=s[c+1]*u,s[c+N]=h,i&&(o||(o=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(o)),i(o,this._map(s,c)))}s[n+N]=h,c.push(e/p,a/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+j]<=t)){s[n+j]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+P]>1){let r=this.clusterProps[e[t+F]];return n?Object.assign({},r):r}let r=this.points[e[t+M]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}};function L(e,t,n){return{type:`Feature`,id:e[t+M],properties:R(e,t,n),geometry:{type:`Point`,coordinates:[V(e[t]),H(e[t+1])]}}}function R(e,t,n){let r=e[t+P],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,a=e[t+F],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+M],point_count:r,point_count_abbreviated:i})}function z(e){return e/360+.5}function B(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function V(e){return(e-.5)*360}function H(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var U=[{value:`all`,label:`All`},{value:`followers`,label:`Followers`},{value:`following`,label:`Following`},{value:`mutual`,label:`Mutual`}],W={bounds:[-180,-85,180,85],zoom:1.15};async function G(e,t,n,r){let i=new URL(`/api/network-map`,window.location.origin);return i.searchParams.set(`type`,e),i.searchParams.set(`limit`,`50000`),i.searchParams.set(`geocodeLimit`,t?`80`:`12`),n&&i.searchParams.set(`account`,n),t&&i.searchParams.set(`refresh`,`true`),u(i,{signal:r},c,`Map request failed`)}function K(e){return new Intl.NumberFormat().format(e)}function q(e){return e===`mutual`?`mutual`:e===`following`?`following`:`follower`}function J(e){return e===`mutual`?`#22c55e`:e===`following`?`#f59e0b`:`#1d9bf0`}function Y(e){return(e.properties.name||e.properties.handle||`?`).slice(0,1).toUpperCase()}function X(e){return e.properties.avatarUrl?`/api/avatar?${new URLSearchParams({profileId:e.properties.profileId,v:e.properties.avatarUrl}).toString()}`:null}function Z(e){let t=Math.max(1,e.followers+e.following+e.mutual),n=e.mutual/t*100,r=n+e.following/t*100;return`conic-gradient(#22c55e 0 ${n}%, #f59e0b ${n}% ${r}%, #1d9bf0 ${r}% 100%)`}function Q(e){let t=e.map((e,t)=>({type:`Feature`,geometry:e.geometry,properties:{featureIndex:t,handle:e.properties.handle,name:e.properties.name,avatarUrl:e.properties.avatarUrl,relationship:e.properties.relationship,followersCount:e.properties.followersCount}}));return new I({maxZoom:18,minPoints:2,radius:64,map:e=>({followers:+(e.relationship===`followers`),following:+(e.relationship===`following`),mutual:+(e.relationship===`mutual`)}),reduce:(e,t)=>{e.followers+=t.followers,e.following+=t.following,e.mutual+=t.mutual}}).load(t)}function $(e){return`cluster`in e.properties&&e.properties.cluster===!0}function ee(e,t){return t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)}function te(e,t){let n=new Map;for(let t of e){let[e,r]=t.geometry.coordinates,i=`${e.toFixed(4)},${r.toFixed(4)}`,a=n.get(i);a?(a.count+=1,a.followers+=t.properties.followersCount):n.set(i,{coordinates:[e,r],count:1,followers:t.properties.followersCount})}return[...n.values()].sort((e,t)=>t.count-e.count||t.followers-e.followers)[0]?.coordinates??t}function ne(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.getBounds!=`function`||typeof t.getZoom!=`function`)return null;let n=t.getBounds();return{bounds:[n.getWest(),n.getSouth(),n.getEast(),n.getNorth()],zoom:t.getZoom()}}function re(e,t){let[n,r,i,a]=e,[o,s]=t.geometry.coordinates,c=(n+540)%360-180,l=(i+540)%360-180,u=s>=Math.max(-85,r)&&s<=Math.min(85,a),d=i-n>=360?!0:c<=l?o>=c&&o<=l:o>=c||o<=l;return u&&d}function ie(e,t){let n=t.trim().toLowerCase();return!n||[e.properties.name,e.properties.handle,e.properties.location,e.properties.resolvedLocation??``,q(e.properties.relationship)].join(` `).toLowerCase().includes(n)}function ae(e,t){let n=s(),{type:r,q:i}=e,[a,c]=(0,v.useState)(W),u=p(d({queryKey:l.status,queryFn:({signal:e})=>o({signal:e})}).data?.accounts),m=[...l.networkMap,{type:r,selectedAccountId:u??null}],h=d({queryKey:m,queryFn:({signal:e})=>G(r,!1,u,e),staleTime:5*6e4}),g=f({mutationFn:()=>G(r,!0,u),onSuccess:e=>{n.setQueryData(m,e)}}),_=h.data??null,y=h.isPending||g.isPending,b=g.error??h.error,x=(0,v.useMemo)(()=>(_?.features??[]).slice().filter(e=>re(a.bounds,e)).sort((e,t)=>t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)),[_,a]),S=(0,v.useMemo)(()=>x.filter(e=>ie(e,i)).slice(0,160),[x,i]);return{type:r,setType:n=>t({...e,type:n}),viewport:a,setViewport:c,visibleSearch:i,setVisibleSearch:n=>t({...e,q:n},{replace:!0}),data:_,loading:y,error:b?b instanceof Error?b.message:`Map unavailable`:null,refresh:g.mutate,visibleFeatures:x,filteredVisibleFeatures:S,mapTypes:U}}m();var oe=n(`/network-map`)({component:r(()=>h(()=>import(`./network-map-1fXIqI3Y.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:g});export{X as a,ee as c,te as d,$ as f,_ as h,Y as i,K as l,J as m,ae as n,Q as o,ne as p,W as r,Z as s,oe as t,q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./TimelineRouteFrame-
|
|
1
|
+
import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./TimelineRouteFrame-DcipwBqo.js";var n=e();function r(e){return e?`${String(e.stats.home)} items · ${String(e.stats.needsReply)} waiting · ${e.transport.statusText}`:`Loading local context...`}function i(){return(0,n.jsx)(t,{emptyDetail:`Try a different filter or sync the timeline again.`,emptyLabel:`No posts in this view`,errorFallback:`Timeline unavailable`,errorTitle:`Could not load posts`,initialReplyFilter:`all`,loadingDetail:`Reading the local timeline store`,loadingLabel:`Loading posts`,resource:`home`,searchPlaceholder:`Search local timeline`,subtitle:r,syncKind:`timeline`,syncLabel:`Sync timeline`,title:`Home`})}export{i as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/today-
|
|
2
|
-
import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as r}from"./schemas-CMQMhQXI.js";import"./client-stream-contracts-CNz2FSrQ.js";import"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/today-Dq8qoGhX.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/createLucideIcon-CMLcIxOz.js","assets/circle-check-BCK_qvXt.js","assets/client-stream-contracts-CNz2FSrQ.js","assets/AvatarChip-DsHj3LT7.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/refresh-cw-IUfM9D_1.js","assets/sparkles-Gx_BHkDX.js","assets/query-client-CA-do_IS.js","assets/route-search-CmZT7pGD.js","assets/profile-hydration-client-DoFW3yKH.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as r}from"./schemas-CMQMhQXI.js";import"./client-stream-contracts-CNz2FSrQ.js";import{n as i,t as a}from"./preload-helper-MpqUbZCn.js";import{s as o}from"./route-search-CmZT7pGD.js";import"./profile-hydration-client-DoFW3yKH.js";r(),e(),i();var s=t(`/today`)({component:n(()=>a(()=>import(`./today-Dq8qoGhX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),`component`),validateSearch:o});export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Ht as r,Kt as i,M as a,Rn as o,Ut as s,Wt as c,cn as l,dn as u,dt as d,fn as f}from"./schemas-CMQMhQXI.js";import{t as p}from"./createLucideIcon-CMLcIxOz.js";import{t as m}from"./circle-check-BCK_qvXt.js";import{a as h,n as g,o as _,s as v,t as y}from"./client-stream-contracts-CNz2FSrQ.js";import{t as b}from"./refresh-cw-IUfM9D_1.js";import{t as x}from"./sparkles-Gx_BHkDX.js";import{b as S}from"./query-client-CA-do_IS.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Ht as r,Kt as i,M as a,Rn as o,Ut as s,Wt as c,cn as l,dn as u,dt as d,fn as f}from"./schemas-CMQMhQXI.js";import{t as p}from"./createLucideIcon-CMLcIxOz.js";import{t as m}from"./circle-check-BCK_qvXt.js";import{a as h,n as g,o as _,s as v,t as y}from"./client-stream-contracts-CNz2FSrQ.js";import{t as b}from"./refresh-cw-IUfM9D_1.js";import{t as x}from"./sparkles-Gx_BHkDX.js";import{b as S}from"./query-client-CA-do_IS.js";import{s as C}from"./route-search-CmZT7pGD.js";import{n as w,t as T}from"./profile-hydration-client-DoFW3yKH.js";import{t as E}from"./today-DOUIqDPa.js";var D=p(`file-down`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]),O=e(t()),k=o(),A=12,j=300,M={524:`Digest startup timed out at Cloudflare (524). Retry to open a new stream.`},N=[{value:`today`,label:`Today`},{value:`24h`,label:`24h`},{value:`yesterday`,label:`Yesterday`},{value:`week`,label:`Week`}];function P(e){return N.find(t=>t.value===e)?.label??`Digest`}function F(e){let t=document.title,n=!1,r=()=>{n||(n=!0,document.title=t,window.removeEventListener(`afterprint`,r))};document.title=e,window.addEventListener(`afterprint`,r,{once:!0}),window.setTimeout(r,3e3),window.print()}function I(e,t,n){let r=new URL(`/api/period-digest`,window.location.origin);return r.searchParams.set(`period`,e),r.searchParams.set(`includeDms`,String(t)),r.searchParams.set(`maxTweets`,`5000`),r.searchParams.set(`maxLinks`,`20`),r.searchParams.set(`liveSync`,`false`),n&&r.searchParams.set(`refresh`,`true`),r}function L(e,t){let n=e instanceof Error?e.message:String(e);return e instanceof TypeError&&/network error|failed to fetch|load failed/i.test(n)?`Digest connection was interrupted while ${t.toLowerCase()}. Retry to continue.`:e instanceof SyntaxError?`Digest stream returned invalid data while ${t.toLowerCase()}. Retry to continue.`:n||`Digest failed`}function R(e){if(!e)return`Local Twitter memory, summarized as it streams.`;let t=e.counts;return[`${String(t.home)} home`,`${String(t.mentions)} mentions`,`${String(t.links)} links`,e.includeDms?`${String(t.dms)} DMs`:null].filter(Boolean).join(` · `)}function z(e){let t=new Set,n=new Set;for(let t of e.digest.sourceTweetIds)n.add(t);for(let t of e.digest.keyTopics)for(let e of t.tweetIds)n.add(e);for(let t of e.digest.notableLinks)for(let e of t.sourceTweetIds)n.add(e);for(let t of e.digest.actionItems)t.tweetId&&n.add(t.tweetId);let r=new Map(e.context.tweets.flatMap(e=>[[e.id,e],[`tweet_${e.id}`,e]]));for(let e of n){let n=r.get(e);if(!n)continue;let i=w(n.author);i&&t.add(i)}for(let n of e.context.tweets){let e=w(n.author);e&&t.add(e)}return[...t]}function B(e,t){let n=!1,r=e.tweets.map(e=>{let r=t.get(w(e.author));return!r||r===e.authorProfile?e:(n=!0,{...e,author:r.handle,name:r.displayName,authorProfile:r})});return n?{...e,tweets:r}:e}function V(e,t){let n=new Map(t.map(e=>[w(e.handle),e]));if(n.size===0)return e;let r=B(e.context,n);return r===e.context?e:{...e,context:r}}function H(e,t){let n=S(),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(`Starting digest`),d=(0,O.useRef)(`Starting digest`),f=(0,O.useCallback)(()=>{i(``),o(null),c(null),u(`Starting digest`),d.current=`Starting digest`},[]),{error:p,loading:m,run:_}=h({schema:g,request:(0,O.useCallback)((n,r)=>fetch(I(e,t,r),{cache:`no-store`,signal:n}),[t,e]),onStart:f,onEvent:(0,O.useCallback)(e=>{if(e.type===`status`)d.current=e.detail?`${e.label} · ${e.detail}`:e.label,u(d.current);else if(e.type===`start`)o(e.context);else if(e.type===`delta`)d.current=`Streaming AI summary`,u(d.current),i(t=>t+e.delta);else if(e.type===`done`)c(e.result),o(e.result.context),i(e.result.markdown),u(e.result.cached?`Loaded cached report`:`Ready`);else if(e.type===`error`)throw Error(e.error)},[]),onError:(0,O.useCallback)(()=>u(`Digest failed`),[]),isTerminal:y,errorLabel:`Digest request failed`,emptyBodyMessage:`Digest request failed: empty response body`,prematureEofError:(0,O.useCallback)(()=>Error(`Digest connection closed while ${d.current.toLowerCase()}. Retry to continue.`),[]),formatError:(0,O.useCallback)(e=>L(e,d.current),[]),statusMessages:M});return(0,O.useEffect)(()=>{_(!1)},[_]),(0,O.useEffect)(()=>{if(!s)return;let e=z(s);if(e.length===0)return;let t=!0,r=null,i=()=>{T(n,e,{limit:A}).then(e=>{if(!t)return;let{profiles:n}=e;if(n.length===0)return;c(e=>e&&V(e,n));let r=new Map(n.map(e=>[w(e.handle),e]));o(e=>e&&B(e,r))}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},j);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[n,s]),{context:a,error:p,loading:m,markdown:r,result:s,run:_,status:l}}function U(){let e=E.useSearch(),t=E.useNavigate();return(0,k.jsx)(W,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function W({searchState:e,onSearchChange:t}={}){let[o,p]=(0,O.useState)(()=>C({})),h=e??o,g=(e,n)=>t?t(e,n):p(e),{period:y,includeDms:S}=h,{context:w,error:T,loading:E,markdown:A,result:j,run:M,status:I}=H(y,S);(0,O.useEffect)(()=>{let e=document.documentElement;return e.classList.add(`today-pdf-route`),()=>e.classList.remove(`today-pdf-route`)},[]);let L=(0,O.useMemo)(()=>R(j?.context??w),[w,j]),z=j?.context.window.label??w?.window.label??P(y),B=!!j?.markdown.trim()&&!E,V=`BirdClaw ${z} digest`,U=j?new Date(j.updatedAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null,W=(0,O.useCallback)(()=>{B&&F(V)},[B,V]);return(0,k.jsxs)(`div`,{className:`today-pdf-root flex min-h-screen flex-col`,children:[(0,k.jsxs)(`header`,{className:a(`today-pdf-header`,s),children:[(0,k.jsxs)(`div`,{className:c,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`h1`,{className:i,children:`What happened`}),(0,k.jsx)(`p`,{className:n,children:L})]}),(0,k.jsxs)(`div`,{className:a(`today-screen-only`,r),children:[B?(0,k.jsxs)(`button`,{type:`button`,className:l,onClick:W,children:[(0,k.jsx)(D,{className:`size-4`,"aria-hidden":`true`}),`Export PDF`]}):null,(0,k.jsxs)(`button`,{type:`button`,className:l,onClick:()=>M(!0),disabled:E,children:[(0,k.jsx)(b,{className:a(`size-4`,E&&`animate-spin`),"aria-hidden":`true`}),`Refresh`]})]})]}),(0,k.jsxs)(`div`,{className:`today-pdf-meta`,"aria-hidden":`true`,children:[(0,k.jsx)(`span`,{children:z}),(0,k.jsx)(`span`,{children:`·`}),(0,k.jsxs)(`span`,{children:[`Sources: `,L]}),U?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{children:`·`}),(0,k.jsxs)(`span`,{children:[`Generated `,U]})]}):null]}),(0,k.jsxs)(`div`,{className:`today-screen-only flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,k.jsx)(`div`,{className:f,"aria-label":`Digest period`,children:N.map(e=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":y===e.value,className:a(u,y===e.value&&`bg-[var(--accent-soft)]! text-[var(--accent)]! shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--accent)_36%,transparent)]`),onClick:()=>g({...h,period:e.value}),children:e.label},e.value))}),(0,k.jsxs)(`label`,{className:`inline-flex items-center gap-2 rounded-full border border-[var(--line)] px-3 py-1 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:S,onChange:e=>g({...h,includeDms:e.currentTarget.checked})}),`DMs`]})]})]}),T?(0,k.jsxs)(`div`,{className:a(d,`flex items-center justify-between gap-3`),role:`alert`,children:[(0,k.jsx)(`span`,{children:T}),(0,k.jsx)(`button`,{className:`shrink-0 font-semibold underline underline-offset-2`,onClick:()=>M(!0),type:`button`,children:`Retry`})]}):null,(0,k.jsx)(`div`,{className:`today-screen-only border-b border-[var(--line)] px-4 py-2 text-[13px] text-[var(--ink-soft)]`,children:(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[E?(0,k.jsx)(v,{className:`size-4 animate-spin`,"aria-hidden":`true`}):A?(0,k.jsx)(m,{className:`size-4`,"aria-hidden":`true`}):(0,k.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),E?I:j?`${j.cached?`Cached`:`Ready`} · ${j.context.window.label}`:T?`Digest failed`:`Ready`]})}),A?(0,k.jsx)(_,{context:j?.context??w,markdown:A}):(0,k.jsx)(`div`,{className:`px-4 py-5 text-[14px] text-[var(--ink-soft)]`,children:E?I:T?`No digest was generated. Retry to start a new run.`:`Waiting for the first tokens...`})]})}export{W as TodayRouteView,U as component};
|
package/dist/client/assets/{useTimelineRouteData-DYhYLZY4.js → useTimelineRouteData-2v9TVG9L.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{At as n,Ct as r,Dt as i,Et as a,Fn as o,Gt as s,In as c,Kt as l,M as u,Mt as d,Rn as f,St as p,Tt as m,Ut as h,Wt as g,_t as _,an as v,at as y,bt as b,ct as x,ft as S,gt as C,ht as w,it as T,jt as E,kt as D,lt as O,mt as k,on as ee,ot as te,pt as A,rt as ne,sn as re,st as ie,vt as ae,wt as j,xt as oe,yt as se}from"./schemas-CMQMhQXI.js";import{t as M}from"./createLucideIcon-CMLcIxOz.js";import{t as ce}from"./circle-check-BCK_qvXt.js";import{t as le}from"./circle-DiJUdlek.js";import{t as ue}from"./external-link-CfdTAkvn.js";import{t as de}from"./heart-D-ERjZPN.js";import{t as N}from"./message-circle-79LZr2oN.js";import{t as fe}from"./repeat-2-CQ0lek01.js";import{t as pe}from"./search-C_LqodNa.js";import{t as me}from"./user-search-DL5_6EZd.js";import{C as he,a as ge,b as P,i as _e,l as ve,m as ye,n as F,o as be,r as xe,s as Se,v as Ce,w as we}from"./query-client-CA-do_IS.js";import{n as Te,r as Ee,t as I}from"./useQuery-CL_NXLnc.js";import{i as De,r as Oe}from"./account-selection-h7m9xmzU.js";import{r as L,t as R}from"./AvatarChip-DsHj3LT7.js";import{a as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe}from"./FeedState-DhMv4zXD.js";import{c as Fe,i as z,s as Ie,t as B}from"./ProfilePreview-CaaMHV2N.js";import{t as V}from"./SmartTimestamp-CXaNLqN7.js";import{t as Le}from"./useDebouncedValue-BJLRInUq.js";import{t as H}from"./TweetRichText-D-amgcEl.js";var Re=M(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),ze=M(`bookmark-check`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}],[`path`,{d:`m9 10 2 2 4-4`,key:`1gnqz4`}]]),Be=M(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ve=M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),He=class extends Ee{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:he(t,n.data),hasPreviousPage:we(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function Ue(e){return e}function We(e,t){return Te(e,He,t)}var U=e(t(),1),Ge=(0,U.createContext)(null);function Ke(e){return Ue({queryKey:[...F.conversations,e],queryFn:()=>ve(_e(`/api/conversation?tweetId=${encodeURIComponent(e)}`,void 0,Ce,`Conversation unavailable`)).then(e=>e.items),staleTime:1/0})}function qe({children:e}){let[t,n]=(0,U.useState)(null),r=(0,U.useMemo)(()=>({expandedSurfaceId:t,setExpandedSurfaceId:n}),[t]);return(0,U.createElement)(Ge.Provider,{value:r},e)}function Je(e,t=e){let n=(0,U.useContext)(Ge),[r,i]=(0,U.useState)(null),a=n?.expandedSurfaceId??r,o=n?.setExpandedSurfaceId??i,s=a===e,c=P(),l=I({...Ke(t),enabled:s}),u=(0,U.useCallback)(()=>{o(s?null:e)},[s,o,e]),d=(0,U.useCallback)(()=>{c.prefetchQuery(Ke(t))},[c,t]),f=l.isError?`error`:l.isFetching?`loading`:l.data?`ready`:`idle`;return{error:l.error instanceof Error?l.error.message:null,isOpen:s,items:l.data??[],loading:l.isFetching,prefetch:d,status:f,toggle:u}}var W=f();function Ye(e){let t=z(e);if(!t)return null;try{return new URL(t).hostname===`pbs.twimg.com`?t:null}catch{return null}}function G({article:e}){let t=z(e.url);if(!t)return null;let r=Ye(e.coverImageUrl);return(0,W.jsxs)(`a`,{"aria-label":`Read article: ${e.title}`,className:D,"data-perf":`tweet-article-card`,href:t,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(Re,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)]`,strokeWidth:1.8}),(0,W.jsx)(`span`,{className:E,children:`Article on X`}),(0,W.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:e.title}),e.previewText?(0,W.jsx)(`span`,{className:n,children:e.previewText}):null]}),r?(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:(0,W.jsx)(`img`,{alt:``,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,src:r})}):null]})}function K({items:e}){let[t,n]=(0,U.useState)(null);if(e.length===0)return null;let r=e.slice(0,4),i=t===null?null:r[t]??null,a=i?.type===`video`||i?.type===`gif`?i.variants?.[0]?.url??Ze(i.url):null,s=r.length===1&&r[0]?.type===`image`?r[0]:null;return(0,W.jsxs)(W.Fragment,{children:[s?(0,W.jsx)(`button`,{"aria-label":`Open tweet media 1`,className:u(`tweet-media-single mt-2 max-w-full overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)] p-0 text-left`,s.width&&s.height?`block`:`inline-block align-top`),onClick:e=>{e.stopPropagation(),n(0)},style:Xe(s),type:`button`,children:(0,W.jsx)(`img`,{alt:s.altText??`Tweet media 1`,className:u(`tweet-media-image block max-h-[720px] max-w-full`,s.width&&s.height?`size-full object-cover`:`h-auto w-auto object-contain`),height:s.height,loading:`lazy`,src:s.thumbnailUrl??s.url,width:s.width})}):(0,W.jsx)(`div`,{className:o(Math.min(e.length,4)),children:r.map((t,i)=>(0,W.jsx)(`button`,{"aria-label":`Open tweet media ${String(i+1)}`,className:c(i,Math.min(e.length,4)),onClick:e=>{e.stopPropagation(),n(i)},style:r.length===1&&t.width&&t.height?{aspectRatio:`${String(t.width)} / ${String(t.height)}`}:void 0,type:`button`,children:t.type===`image`?(0,W.jsx)(`img`,{alt:t.altText??`Tweet media ${String(i+1)}`,className:`tweet-media-image block size-full object-contain`,loading:`lazy`,src:t.thumbnailUrl??t.url}):(0,W.jsx)(`span`,{className:`tweet-media-fallback grid min-h-40 place-items-center font-semibold text-[var(--ink-soft)]`,children:t.type===`video`?`Video`:t.type===`gif`?`GIF`:`Media`})},t.url+String(i)))}),i?(0,W.jsxs)(`div`,{"aria-modal":`true`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/85 p-4`,onClick:e=>{e.stopPropagation(),n(null)},role:`dialog`,children:[(0,W.jsx)(`button`,{"aria-label":`Close media viewer`,className:`absolute right-4 top-4 grid size-10 place-items-center rounded-full bg-white/10 text-white transition-colors hover:bg-white/20`,onClick:e=>{e.stopPropagation(),n(null)},type:`button`,children:(0,W.jsx)(Ve,{className:`size-5`,strokeWidth:1.8})}),i.type===`image`?(0,W.jsx)(`img`,{alt:i.altText??`Tweet media`,className:`max-h-[92vh] max-w-[92vw] object-contain`,onClick:e=>e.stopPropagation(),src:i.url}):a?(0,W.jsx)(`video`,{autoPlay:i.type===`gif`,className:`max-h-[92vh] max-w-[92vw]`,controls:!0,loop:i.type===`gif`,muted:i.type===`gif`,onClick:e=>e.stopPropagation(),playsInline:!0,poster:i.thumbnailUrl,src:a}):(0,W.jsxs)(`div`,{className:`grid min-h-64 min-w-80 place-items-center gap-3 rounded-2xl border border-white/20 bg-black p-6 text-white`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`span`,{children:i.type===`video`?`Video`:i.type===`gif`?`GIF`:`Media`}),(0,W.jsx)(`a`,{className:`rounded-full bg-white/10 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-white/20`,href:i.url,rel:`noreferrer`,target:`_blank`,children:`Open media`})]})]}):null]})}function Xe(e){if(!e.width||!e.height)return;let t=Math.min(e.width,Math.round(e.width/e.height*720));return{aspectRatio:`${String(e.width)} / ${String(e.height)}`,width:`${String(t)}px`}}function Ze(e){try{let t=new URL(e);return t.hostname===`video.twimg.com`||/\.(?:mp4|m3u8)(?:$|[?#])/i.test(t.pathname)?e:void 0}catch{return/\.(?:mp4|m3u8)(?:$|[?#])/i.test(e)?e:void 0}}function Qe({anchorId:e,error:t,items:n,loading:r}){return r?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:(0,W.jsx)(Ne,{detail:`Finding archived replies around this post`,label:`Loading conversation`})}):t?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--alert)] bg-[var(--alert-soft)] px-4 py-3 text-[14px] text-[var(--alert)]`,children:t}):n.length<=1?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)]`,children:(0,W.jsx)(je,{detail:`This post has no other archived replies locally.`,label:`No thread context yet`})}):(0,W.jsxs)(`section`,{"aria-label":`Conversation`,className:`mt-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--line)] px-4 py-2.5 text-[13px] font-bold text-[var(--ink)]`,children:[(0,W.jsx)(N,{className:A,strokeWidth:1.8}),(0,W.jsxs)(`span`,{children:[n.length,` tweets in conversation`]})]}),(0,W.jsx)(`div`,{className:`flex flex-col`,children:n.map((t,r)=>{let a=t.id===e;return(0,W.jsxs)(`div`,{className:u(`flex gap-3 px-4 py-3`,r>0&&`border-t border-[var(--line)]`,a&&`bg-[var(--accent-soft)]`),children:[(0,W.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,W.jsx)(R,{avatarUrl:t.author.avatarUrl,hue:t.author.avatarHue,name:t.author.displayName,profileId:t.author.id,size:`small`}),r<n.length-1?(0,W.jsx)(`span`,{className:`mt-2 w-px flex-1 bg-[var(--line)]`}):null]}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`header`,{className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,W.jsx)(B,{profile:t.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:t.author.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,t.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(V,{className:i,value:t.createdAt}),a?(0,W.jsx)(`span`,{className:`ml-auto rounded-full bg-[var(--accent)] px-2 py-0.5 text-[11px] font-bold text-white`,children:`selected`}):null]}),(0,W.jsx)(H,{className:`mt-1 whitespace-pre-wrap break-words text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,entities:t.entities,text:t.text}),(0,W.jsx)(K,{items:t.media}),t.entities.article?(0,W.jsx)(G,{article:t.entities.article}):null]})]},t.id)})})]})}function q({item:e,label:t}){return(0,W.jsxs)(`section`,{className:ne,children:[(0,W.jsx)(`p`,{className:x,children:t}),(0,W.jsxs)(`header`,{className:ie,children:[(0,W.jsx)(B,{profile:e.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:O,children:e.author.displayName}),(0,W.jsxs)(`span`,{className:te,children:[`@`,e.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(V,{className:i,value:e.createdAt})]}),(0,W.jsx)(H,{className:y,entities:e.entities,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null]})}var $e=2,J=0,Y=[];function et(e){let t=e.expandedUrl||``;return e.imageUrl&&e.siteName&&e.title&&it(t)?!1:!e.imageUrl||!e.title||!e.description||e.title===e.displayUrl||e.description===e.displayUrl}function tt(){for(;J<$e&&Y.length>0;)Y.shift()?.()}function nt(e){return new Promise((t,n)=>{Y.push(()=>{J+=1,e().then(t).catch(n).finally(()=>{J=Math.max(0,J-1),tt()})}),tt()})}function rt(e){let t=new URLSearchParams({url:e});return Ue({queryKey:[...F.linkPreviews,e],queryFn:()=>nt(()=>xe(`/api/link-preview?${t.toString()}`,void 0,ye,`Link preview unavailable`).then(e=>e.preview)),staleTime:30*6e4})}function X(e,t){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return t}}function it(e){try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))}catch{return!1}}function at(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))?t.toString():null}catch{return null}}function ot({entry:e,index:t}){let r=z(e.expandedUrl||e.url),i=r??``,a=e.displayUrl||(r?X(r,r):``),o=r&&it(r)?r:null,s=(0,U.useMemo)(()=>({expandedUrl:i,displayUrl:a,title:e.title??(o?X(i,a):void 0),description:e.description??(o?a:void 0),imageUrl:e.imageUrl??o,siteName:e.siteName??(o?X(i,a):void 0)}),[o,a,e.description,e.imageUrl,e.siteName,e.title,i]),[c,l]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),g=(0,U.useRef)(null),_=!!(r&&et(s)),v=I({...rt(r??``),enabled:_&&f&&m}),y=(0,U.useMemo)(()=>{let e=v.data;return e?{expandedUrl:z(e.url)??s.expandedUrl,displayUrl:s.displayUrl,title:e.title??s.title,description:e.description??s.description,imageUrl:e.imageUrl??s.imageUrl,siteName:e.siteName??s.siteName}:s},[s,v.data]);if((0,U.useEffect)(()=>{l(!1),p(!1),h(!1)},[s]),(0,U.useEffect)(()=>{if(!r||!_)return;let e=g.current;if(!e||typeof IntersectionObserver>`u`){p(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(p(!0),t.disconnect())},{rootMargin:`320px 0px`});return t.observe(e),()=>t.disconnect()},[_,r]),(0,U.useEffect)(()=>{if(!r||!f||!_)return;let e=window.setTimeout(()=>{h(!0)},100);return()=>window.clearTimeout(e)},[f,_,r]),!r)return null;let b=y.title||e.displayUrl,x=y.description&&y.description!==b?y.description:y.siteName||X(y.expandedUrl,e.displayUrl),S=y.siteName||X(y.expandedUrl,e.displayUrl),C=at(y.imageUrl),w=!!(C&&!c);return(0,W.jsxs)(`a`,{className:D,"data-perf":`link-preview-card`,href:z(y.expandedUrl)??r,ref:g,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:E,children:S}),(0,W.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:b}),(0,W.jsx)(`span`,{className:n,children:x}),(0,W.jsx)(`span`,{className:u(E,`text-[12px]`),children:e.displayUrl})]}),(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 items-center justify-center overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:w?(0,W.jsx)(`img`,{alt:b,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,onError:()=>l(!0),src:C??``}):(0,W.jsx)(Be,{"aria-hidden":`true`,className:`size-8 text-[var(--ink-soft)]`,strokeWidth:1.7})})]},`${e.expandedUrl}-${String(t)}`)}function st(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.hostname}${t.pathname}`}catch{return e.split(`?`)[0]??e}}function ct(e){let t=new Set;for(let n of e)for(let e of[n.url,n.thumbnailUrl]){let n=st(e);n&&t.add(n)}return t}function lt(e,t,n){if(t.size>0&&ft(e.expandedUrl,n))return!0;for(let n of[e.url,e.expandedUrl,e.displayUrl]){let e=st(n);if(e&&t.has(e))return!0}return!1}function Z(e){if(!e)return!1;try{let t=e.includes(`://`)?e:`https://${e}`;return new URL(t).hostname.replace(/^www\./,``)===`t.co`}catch{return!1}}function Q(e){return Z(e.expandedUrl)?!0:e.expandedUrl?!1:Z(e.displayUrl)?!0:!e.displayUrl&&Z(e.url)}function ut(e,t){return(t.urls??[]).filter(Q).map(t=>Fe(e,t))}function dt(e,t){let n=0,r=``;for(let i of[...t].sort((e,t)=>e.start-t.start))i.start<n||i.end<=i.start||i.end>e.length||(r+=e.slice(n,i.start),n=i.end);return r+=e.slice(n),r}function $(e,t,n){if(n.size===0)return!1;let r=ut(e,t);return r.length!==0&&dt(e,r).trim().length===0}function ft(e,t){if(!e)return!1;try{let n=new URL(e),r=n.hostname.replace(/^www\./,``);if(r!==`x.com`&&r!==`twitter.com`)return!1;let i=n.pathname.split(`/`).filter(Boolean),a=i.indexOf(`status`);if(a<0||i[a+1]!==t)return!1;let o=i[a+2];return o===`photo`||o===`video`}catch{return!1}}function pt(e,t,n,r){let i=ct(t);if(i.size===0)return e;let a=$(r,e,i);return{...e,urls:(e.urls??[]).filter(e=>!lt(e,i,n)&&!(a&&Q(e)))}}function mt(e,t,n,r){let i=ct(t);if(i.size===0)return[];let a=$(r,e,i);return(e.urls??[]).filter(e=>lt(e,i,n)||a&&Q(e)).map(e=>Fe(r,e))}function ht(e,t){return(e.urls??[]).filter(n=>Q(n)||e.article&&Ie(n,e.article)?!1:!t||!n.expandedUrl.includes(t))}function gt(e){return e instanceof Element&&!!e.closest(`a,button,input,textarea,select,[role='button']`)}function _t({tweet:e,hiddenUrlRanges:t,visibleUrlCards:n,replyToTweet:r,quotedTweet:i}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{className:a,entities:e.entities,hiddenUrlRanges:t,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null,r?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:r,label:`In reply to`})}):null,i?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:i,label:`Quoted tweet`})}):null,n.map((e,t)=>(0,W.jsx)(ot,{entry:e,index:t},`${e.expandedUrl}-${String(t)}`))]})}function vt({item:e,onReply:t,showReplyControls:n=!0}){let a=n&&e.kind!==`like`&&e.kind!==`bookmark`,o=e.retweetedTweet??e,s=o.id,c=e.retweetedTweet&&s===`${e.id}:retweeted`?e.id:s,l=o.author,d=Je(e.id,c),f=pt(o.entities,o.media,o.id,o.text),h=mt(o.entities,o.media,o.id,o.text),g=ht(f,e.retweetedTweet?null:e.quotedTweet?.id??null),v=e.retweetedTweet?o.mediaCount??o.media.length:e.mediaCount,y=o.isReplied??e.isReplied,x=o.likeCount??e.likeCount,w=o.bookmarked??e.bookmarked,T=o.liked??e.liked,E=T||x>0,D=v>0,O=!!(e.retweetedTweet?o.replyToId:e.replyToTweet||e.replyToId);return(0,W.jsxs)(`article`,{className:u(ae,`cursor-pointer [content-visibility:auto] [contain-intrinsic-size:auto_280px]`),"data-perf":`timeline-card`,onFocus:d.prefetch,onMouseEnter:d.prefetch,onClick:e=>{gt(e.target)||d.toggle()},children:[(0,W.jsx)(R,{avatarUrl:l.avatarUrl,hue:l.avatarHue,name:l.displayName,profileId:l.id}),(0,W.jsxs)(`div`,{className:_,children:[e.retweetedTweet?(0,W.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,W.jsx)(fe,{className:`size-4`,strokeWidth:1.8}),(0,W.jsx)(B,{profile:e.author,children:(0,W.jsxs)(`span`,{children:[e.author.displayName,` reposted`]})})]}):null,(0,W.jsxs)(`header`,{className:oe,children:[(0,W.jsx)(B,{profile:l,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:l.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,l.handle]})]})}),(0,W.jsx)(`span`,{className:se,children:`·`}),(0,W.jsx)(V,{className:i,value:o.createdAt}),a||O?(0,W.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1`,children:[O?(0,W.jsxs)(`span`,{"aria-label":`Part of a conversation`,className:u(j,r),title:`Part of a conversation`,children:[(0,W.jsx)(N,{className:`size-3.5`,strokeWidth:2}),`thread`]}):null,a?(0,W.jsxs)(`span`,{"aria-label":y?`We replied`:`Reply open`,className:u(j,y?r:m),title:y?`We replied`:`Reply open`,children:[y?(0,W.jsx)(ce,{className:`size-3.5`,strokeWidth:2}):(0,W.jsx)(le,{className:`size-3`,strokeWidth:2.2}),y?`replied`:`open`]}):null]}):null]}),(0,W.jsx)(_t,{hiddenUrlRanges:h,quotedTweet:e.retweetedTweet?null:e.quotedTweet,replyToTweet:e.retweetedTweet?null:e.replyToTweet,tweet:o,visibleUrlCards:g}),(0,W.jsx)(`footer`,{className:C,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,W.jsxs)(`button`,{"aria-expanded":d.isOpen,"aria-label":d.isOpen?`Hide conversation`:`Show conversation`,className:S,onClick:e=>{e.stopPropagation(),d.toggle()},type:`button`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(N,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:d.isOpen?`Hide thread`:`Thread`})]}),a?(0,W.jsxs)(`button`,{className:S,onClick:e=>{e.stopPropagation(),t(c)},type:`button`,"aria-label":`Reply`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(N,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Reply`})]}):null,(0,W.jsxs)(`a`,{"aria-label":`Analyse @${l.handle}`,className:S,href:`/profiles/${encodeURIComponent(l.handle)}`,onClick:e=>{e.stopPropagation()},title:`Analyse @${l.handle}`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(me,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Analyse`})]}),E?(0,W.jsxs)(`span`,{"aria-label":`${L(x)} likes`,className:u(`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,T&&`text-[var(--like)]`),title:`${L(x)} likes`,children:[(0,W.jsx)(de,{className:A,strokeWidth:1.7,fill:T?`currentColor`:`none`}),(0,W.jsx)(`span`,{children:L(x)})]}):null,w?(0,W.jsx)(`span`,{"aria-label":`Bookmarked`,className:`inline-flex items-center px-2 py-1`,title:`Bookmarked`,children:(0,W.jsx)(ze,{className:A,strokeWidth:1.7})}):null,D?(0,W.jsxs)(`span`,{"aria-label":`${String(v)} media attachments`,className:`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,title:`${String(v)} media attachments`,children:[(0,W.jsx)(Be,{className:A,strokeWidth:1.7}),(0,W.jsx)(`span`,{children:v})]}):null]})}),d.isOpen?(0,W.jsx)(Qe,{anchorId:c,error:d.error,items:d.items,loading:d.loading}):null]})]})}function yt({title:e,subtitles:t,action:n,controls:r}){return(0,W.jsxs)(`header`,{className:h,children:[(0,W.jsxs)(`div`,{className:`${g} flex-wrap`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`h1`,{className:l,children:e}),t]}),n]}),r]})}function bt({children:e}){return(0,W.jsx)(`p`,{className:s,children:e})}function xt({value:e,onChange:t,placeholder:n}){return(0,W.jsx)(`div`,{className:`px-4 pb-3`,children:(0,W.jsxs)(`label`,{className:re,children:[(0,W.jsx)(pe,{className:v,strokeWidth:2}),(0,W.jsx)(`input`,{className:ee,onChange:e=>t(e.target.value),placeholder:n,value:e})]})})}function St({header:e,notice:t,loading:n,loadingLabel:r,loadingDetail:i,error:a,errorTitle:o,onRetry:s,empty:c,emptyLabel:l,emptyDetail:u,children:d,hasMore:f,loadingMore:p,onLoadMore:m}){return(0,W.jsxs)(W.Fragment,{children:[e,t,(0,W.jsx)(qe,{children:(0,W.jsxs)(`section`,{className:w,children:[n?(0,W.jsx)(Me,{detail:i,label:r,children:(0,W.jsx)(ke,{})}):a?(0,W.jsx)(Ae,{action:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:s,type:`button`,children:`Retry`}),message:a,title:o}):c?(0,W.jsx)(Pe,{detail:u,label:l}):null,d,!n&&!a&&f?(0,W.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-5 py-1.5 text-[14px] font-bold text-white disabled:opacity-60`,disabled:p,onClick:m,type:`button`,children:p?`Loading…`:`Load more`})}):null]})})]})}var Ct=50,wt=5*6e4;function Tt({resource:e,search:t,replyFilter:n,likedOnly:r,bookmarkedOnly:i,selectedAccountId:a,pageParam:o}){let s=new URLSearchParams({resource:e,limit:String(Ct)});a&&s.set(`account`,a),n&&s.set(`replyFilter`,n),r&&s.set(`liked`,`true`),i&&s.set(`bookmarked`,`true`),t.trim()&&s.set(`search`,t.trim()),o&&(s.set(`until`,o.until),s.set(`untilId`,o.untilId)),s.sort();let c=typeof window>`u`?`http://birdclaw.local`:window.location.origin;return new URL(`/api/query?${s.toString()}`,c).toString()}function Et({resource:e,search:t,errorFallback:n,replyFilter:r,likedOnly:i=!1,bookmarkedOnly:a=!1}){let o=P(),s=I({queryKey:F.status,queryFn:({signal:e})=>ge({signal:e})}).data??null,c=Oe(s?.accounts),l=Le(t,180),u=[...F.timelines,{resource:e,search:l,replyFilter:r??`all`,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c??null}],d=We({queryKey:u,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>be(Tt({resource:e,search:l,replyFilter:r,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c,pageParam:t}),{signal:n}),getNextPageParam:e=>{if(e.resource===`dms`)return;let t=e.items,n=t.at(-1);return t.length>=Ct&&n?{until:n.createdAt,untilId:n.id}:void 0},staleTime:wt}),f=(0,U.useMemo)(()=>{let e=new Set,t=[];for(let n of d.data?.pages??[])if(n.resource!==`dms`)for(let r of n.items)e.has(r.id)||(e.add(r.id),t.push(r));return t},[d.data]),p=De({mutationFn:({tweetId:e,text:t})=>Se({kind:`replyTweet`,accountId:c??`acct_primary`,tweetId:e,text:t}),onSuccess:()=>o.invalidateQueries({queryKey:u})});function m(){d.refetch()}function h(){Promise.all([o.invalidateQueries({queryKey:F.timelines}),o.invalidateQueries({queryKey:F.status})])}async function g(e){let t=window.prompt(`Reply text`);t?.trim()&&await p.mutateAsync({tweetId:e,text:t.trim()}).catch(()=>{})}let _=d.error;return{meta:s,items:f,loading:d.isPending,error:_?_ instanceof Error?_.message:n:null,replyError:p.error?p.error instanceof Error?p.error.message:`Reply failed`:null,retry:m,refreshLocalView:h,replyToTweet:g,selectedAccountId:c,hasMore:d.hasNextPage,loadingMore:d.isFetchingNextPage,loadMore:()=>d.fetchNextPage().then(()=>void 0)}}export{xt as a,bt as i,yt as n,vt as o,St as r,Et as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{At as n,Ct as r,Dt as i,Et as a,Fn as o,Gt as s,In as c,Kt as l,M as u,Mt as d,Rn as f,St as p,Tt as m,Ut as h,Wt as g,_t as _,an as v,at as y,bt as b,ct as x,ft as S,gt as C,ht as w,it as T,jt as E,kt as D,lt as O,mt as k,on as ee,ot as te,pt as A,rt as ne,sn as re,st as ie,vt as ae,wt as j,xt as oe,yt as se}from"./schemas-CMQMhQXI.js";import{t as M}from"./createLucideIcon-CMLcIxOz.js";import{t as ce}from"./circle-check-BCK_qvXt.js";import{t as le}from"./circle-DiJUdlek.js";import{t as ue}from"./external-link-CfdTAkvn.js";import{t as de}from"./heart-D-ERjZPN.js";import{t as N}from"./message-circle-79LZr2oN.js";import{t as fe}from"./repeat-2-CQ0lek01.js";import{t as pe}from"./search-C_LqodNa.js";import{t as me}from"./user-search-DL5_6EZd.js";import{C as he,a as ge,b as P,i as _e,l as ve,m as ye,n as F,o as be,r as xe,s as Se,v as Ce,w as we}from"./query-client-CA-do_IS.js";import{n as Te,r as Ee,t as I}from"./useQuery-CL_NXLnc.js";import{i as De,r as Oe}from"./account-selection-h7m9xmzU.js";import{r as L,t as R}from"./AvatarChip-DsHj3LT7.js";import{a as ke,n as Ae,o as je,r as Me,s as Ne,t as Pe}from"./FeedState-DhMv4zXD.js";import{t as Fe}from"./useDebouncedValue-BJLRInUq.js";import{c as Ie,i as z,s as Le,t as B}from"./ProfilePreview-CaaMHV2N.js";import{t as V}from"./SmartTimestamp-CXaNLqN7.js";import{t as H}from"./TweetRichText-D-amgcEl.js";var Re=M(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),ze=M(`bookmark-check`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}],[`path`,{d:`m9 10 2 2 4-4`,key:`1gnqz4`}]]),Be=M(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Ve=M(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),He=class extends Ee{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:he(t,n.data),hasPreviousPage:we(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function Ue(e){return e}function We(e,t){return Te(e,He,t)}var U=e(t(),1),Ge=(0,U.createContext)(null);function Ke(e){return Ue({queryKey:[...F.conversations,e],queryFn:()=>ve(_e(`/api/conversation?tweetId=${encodeURIComponent(e)}`,void 0,Ce,`Conversation unavailable`)).then(e=>e.items),staleTime:1/0})}function qe({children:e}){let[t,n]=(0,U.useState)(null),r=(0,U.useMemo)(()=>({expandedSurfaceId:t,setExpandedSurfaceId:n}),[t]);return(0,U.createElement)(Ge.Provider,{value:r},e)}function Je(e,t=e){let n=(0,U.useContext)(Ge),[r,i]=(0,U.useState)(null),a=n?.expandedSurfaceId??r,o=n?.setExpandedSurfaceId??i,s=a===e,c=P(),l=I({...Ke(t),enabled:s}),u=(0,U.useCallback)(()=>{o(s?null:e)},[s,o,e]),d=(0,U.useCallback)(()=>{c.prefetchQuery(Ke(t))},[c,t]),f=l.isError?`error`:l.isFetching?`loading`:l.data?`ready`:`idle`;return{error:l.error instanceof Error?l.error.message:null,isOpen:s,items:l.data??[],loading:l.isFetching,prefetch:d,status:f,toggle:u}}var W=f();function Ye(e){let t=z(e);if(!t)return null;try{return new URL(t).hostname===`pbs.twimg.com`?t:null}catch{return null}}function G({article:e}){let t=z(e.url);if(!t)return null;let r=Ye(e.coverImageUrl);return(0,W.jsxs)(`a`,{"aria-label":`Read article: ${e.title}`,className:D,"data-perf":`tweet-article-card`,href:t,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(Re,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)]`,strokeWidth:1.8}),(0,W.jsx)(`span`,{className:E,children:`Article on X`}),(0,W.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:e.title}),e.previewText?(0,W.jsx)(`span`,{className:n,children:e.previewText}):null]}),r?(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:(0,W.jsx)(`img`,{alt:``,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,src:r})}):null]})}function K({items:e}){let[t,n]=(0,U.useState)(null);if(e.length===0)return null;let r=e.slice(0,4),i=t===null?null:r[t]??null,a=i?.type===`video`||i?.type===`gif`?i.variants?.[0]?.url??Ze(i.url):null,s=r.length===1&&r[0]?.type===`image`?r[0]:null;return(0,W.jsxs)(W.Fragment,{children:[s?(0,W.jsx)(`button`,{"aria-label":`Open tweet media 1`,className:u(`tweet-media-single mt-2 max-w-full overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)] p-0 text-left`,s.width&&s.height?`block`:`inline-block align-top`),onClick:e=>{e.stopPropagation(),n(0)},style:Xe(s),type:`button`,children:(0,W.jsx)(`img`,{alt:s.altText??`Tweet media 1`,className:u(`tweet-media-image block max-h-[720px] max-w-full`,s.width&&s.height?`size-full object-cover`:`h-auto w-auto object-contain`),height:s.height,loading:`lazy`,src:s.thumbnailUrl??s.url,width:s.width})}):(0,W.jsx)(`div`,{className:o(Math.min(e.length,4)),children:r.map((t,i)=>(0,W.jsx)(`button`,{"aria-label":`Open tweet media ${String(i+1)}`,className:c(i,Math.min(e.length,4)),onClick:e=>{e.stopPropagation(),n(i)},style:r.length===1&&t.width&&t.height?{aspectRatio:`${String(t.width)} / ${String(t.height)}`}:void 0,type:`button`,children:t.type===`image`?(0,W.jsx)(`img`,{alt:t.altText??`Tweet media ${String(i+1)}`,className:`tweet-media-image block size-full object-contain`,loading:`lazy`,src:t.thumbnailUrl??t.url}):(0,W.jsx)(`span`,{className:`tweet-media-fallback grid min-h-40 place-items-center font-semibold text-[var(--ink-soft)]`,children:t.type===`video`?`Video`:t.type===`gif`?`GIF`:`Media`})},t.url+String(i)))}),i?(0,W.jsxs)(`div`,{"aria-modal":`true`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/85 p-4`,onClick:e=>{e.stopPropagation(),n(null)},role:`dialog`,children:[(0,W.jsx)(`button`,{"aria-label":`Close media viewer`,className:`absolute right-4 top-4 grid size-10 place-items-center rounded-full bg-white/10 text-white transition-colors hover:bg-white/20`,onClick:e=>{e.stopPropagation(),n(null)},type:`button`,children:(0,W.jsx)(Ve,{className:`size-5`,strokeWidth:1.8})}),i.type===`image`?(0,W.jsx)(`img`,{alt:i.altText??`Tweet media`,className:`max-h-[92vh] max-w-[92vw] object-contain`,onClick:e=>e.stopPropagation(),src:i.url}):a?(0,W.jsx)(`video`,{autoPlay:i.type===`gif`,className:`max-h-[92vh] max-w-[92vw]`,controls:!0,loop:i.type===`gif`,muted:i.type===`gif`,onClick:e=>e.stopPropagation(),playsInline:!0,poster:i.thumbnailUrl,src:a}):(0,W.jsxs)(`div`,{className:`grid min-h-64 min-w-80 place-items-center gap-3 rounded-2xl border border-white/20 bg-black p-6 text-white`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`span`,{children:i.type===`video`?`Video`:i.type===`gif`?`GIF`:`Media`}),(0,W.jsx)(`a`,{className:`rounded-full bg-white/10 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-white/20`,href:i.url,rel:`noreferrer`,target:`_blank`,children:`Open media`})]})]}):null]})}function Xe(e){if(!e.width||!e.height)return;let t=Math.min(e.width,Math.round(e.width/e.height*720));return{aspectRatio:`${String(e.width)} / ${String(e.height)}`,width:`${String(t)}px`}}function Ze(e){try{let t=new URL(e);return t.hostname===`video.twimg.com`||/\.(?:mp4|m3u8)(?:$|[?#])/i.test(t.pathname)?e:void 0}catch{return/\.(?:mp4|m3u8)(?:$|[?#])/i.test(e)?e:void 0}}function Qe({anchorId:e,error:t,items:n,loading:r}){return r?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:(0,W.jsx)(Ne,{detail:`Finding archived replies around this post`,label:`Loading conversation`})}):t?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--alert)] bg-[var(--alert-soft)] px-4 py-3 text-[14px] text-[var(--alert)]`,children:t}):n.length<=1?(0,W.jsx)(`section`,{className:`mt-3 rounded-2xl border border-[var(--line)]`,children:(0,W.jsx)(je,{detail:`This post has no other archived replies locally.`,label:`No thread context yet`})}):(0,W.jsxs)(`section`,{"aria-label":`Conversation`,className:`mt-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-card)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--line)] px-4 py-2.5 text-[13px] font-bold text-[var(--ink)]`,children:[(0,W.jsx)(N,{className:A,strokeWidth:1.8}),(0,W.jsxs)(`span`,{children:[n.length,` tweets in conversation`]})]}),(0,W.jsx)(`div`,{className:`flex flex-col`,children:n.map((t,r)=>{let a=t.id===e;return(0,W.jsxs)(`div`,{className:u(`flex gap-3 px-4 py-3`,r>0&&`border-t border-[var(--line)]`,a&&`bg-[var(--accent-soft)]`),children:[(0,W.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,W.jsx)(R,{avatarUrl:t.author.avatarUrl,hue:t.author.avatarHue,name:t.author.displayName,profileId:t.author.id,size:`small`}),r<n.length-1?(0,W.jsx)(`span`,{className:`mt-2 w-px flex-1 bg-[var(--line)]`}):null]}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`header`,{className:`flex min-w-0 items-center gap-1.5 text-[14px]`,children:[(0,W.jsx)(B,{profile:t.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:t.author.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,t.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(V,{className:i,value:t.createdAt}),a?(0,W.jsx)(`span`,{className:`ml-auto rounded-full bg-[var(--accent)] px-2 py-0.5 text-[11px] font-bold text-white`,children:`selected`}):null]}),(0,W.jsx)(H,{className:`mt-1 whitespace-pre-wrap break-words text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,entities:t.entities,text:t.text}),(0,W.jsx)(K,{items:t.media}),t.entities.article?(0,W.jsx)(G,{article:t.entities.article}):null]})]},t.id)})})]})}function q({item:e,label:t}){return(0,W.jsxs)(`section`,{className:ne,children:[(0,W.jsx)(`p`,{className:x,children:t}),(0,W.jsxs)(`header`,{className:ie,children:[(0,W.jsx)(B,{profile:e.author,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:O,children:e.author.displayName}),(0,W.jsxs)(`span`,{className:te,children:[`@`,e.author.handle]})]})}),(0,W.jsx)(`span`,{className:`text-[var(--ink-soft)]`,children:`·`}),(0,W.jsx)(V,{className:i,value:e.createdAt})]}),(0,W.jsx)(H,{className:y,entities:e.entities,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null]})}var $e=2,J=0,Y=[];function et(e){let t=e.expandedUrl||``;return e.imageUrl&&e.siteName&&e.title&&it(t)?!1:!e.imageUrl||!e.title||!e.description||e.title===e.displayUrl||e.description===e.displayUrl}function tt(){for(;J<$e&&Y.length>0;)Y.shift()?.()}function nt(e){return new Promise((t,n)=>{Y.push(()=>{J+=1,e().then(t).catch(n).finally(()=>{J=Math.max(0,J-1),tt()})}),tt()})}function rt(e){let t=new URLSearchParams({url:e});return Ue({queryKey:[...F.linkPreviews,e],queryFn:()=>nt(()=>xe(`/api/link-preview?${t.toString()}`,void 0,ye,`Link preview unavailable`).then(e=>e.preview)),staleTime:30*6e4})}function X(e,t){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return t}}function it(e){try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))}catch{return!1}}function at(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`pbs.twimg.com`&&(t.pathname.startsWith(`/media/`)||t.pathname.startsWith(`/amplify_video_thumb/`))?t.toString():null}catch{return null}}function ot({entry:e,index:t}){let r=z(e.expandedUrl||e.url),i=r??``,a=e.displayUrl||(r?X(r,r):``),o=r&&it(r)?r:null,s=(0,U.useMemo)(()=>({expandedUrl:i,displayUrl:a,title:e.title??(o?X(i,a):void 0),description:e.description??(o?a:void 0),imageUrl:e.imageUrl??o,siteName:e.siteName??(o?X(i,a):void 0)}),[o,a,e.description,e.imageUrl,e.siteName,e.title,i]),[c,l]=(0,U.useState)(!1),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),g=(0,U.useRef)(null),_=!!(r&&et(s)),v=I({...rt(r??``),enabled:_&&f&&m}),y=(0,U.useMemo)(()=>{let e=v.data;return e?{expandedUrl:z(e.url)??s.expandedUrl,displayUrl:s.displayUrl,title:e.title??s.title,description:e.description??s.description,imageUrl:e.imageUrl??s.imageUrl,siteName:e.siteName??s.siteName}:s},[s,v.data]);if((0,U.useEffect)(()=>{l(!1),p(!1),h(!1)},[s]),(0,U.useEffect)(()=>{if(!r||!_)return;let e=g.current;if(!e||typeof IntersectionObserver>`u`){p(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(p(!0),t.disconnect())},{rootMargin:`320px 0px`});return t.observe(e),()=>t.disconnect()},[_,r]),(0,U.useEffect)(()=>{if(!r||!f||!_)return;let e=window.setTimeout(()=>{h(!0)},100);return()=>window.clearTimeout(e)},[f,_,r]),!r)return null;let b=y.title||e.displayUrl,x=y.description&&y.description!==b?y.description:y.siteName||X(y.expandedUrl,e.displayUrl),S=y.siteName||X(y.expandedUrl,e.displayUrl),C=at(y.imageUrl),w=!!(C&&!c);return(0,W.jsxs)(`a`,{className:D,"data-perf":`link-preview-card`,href:z(y.expandedUrl)??r,ref:g,rel:`noreferrer`,target:`_blank`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col justify-center gap-1 px-3.5 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:E,children:S}),(0,W.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-[var(--ink-soft)] opacity-0 transition-opacity group-hover/link-preview:opacity-100`,strokeWidth:1.8})]}),(0,W.jsx)(`span`,{className:d,children:b}),(0,W.jsx)(`span`,{className:n,children:x}),(0,W.jsx)(`span`,{className:u(E,`text-[12px]`),children:e.displayUrl})]}),(0,W.jsx)(`div`,{className:`flex aspect-[1.45] w-40 shrink-0 items-center justify-center overflow-hidden border-l border-[var(--line)] bg-[var(--bg-soft)] max-[720px]:w-28`,children:w?(0,W.jsx)(`img`,{alt:b,className:`size-full object-cover transition-transform duration-200 group-hover/link-preview:scale-[1.03]`,loading:`lazy`,onError:()=>l(!0),src:C??``}):(0,W.jsx)(Be,{"aria-hidden":`true`,className:`size-8 text-[var(--ink-soft)]`,strokeWidth:1.7})})]},`${e.expandedUrl}-${String(t)}`)}function st(e){if(!e)return null;try{let t=new URL(e);return`${t.protocol}//${t.hostname}${t.pathname}`}catch{return e.split(`?`)[0]??e}}function ct(e){let t=new Set;for(let n of e)for(let e of[n.url,n.thumbnailUrl]){let n=st(e);n&&t.add(n)}return t}function lt(e,t,n){if(t.size>0&&ft(e.expandedUrl,n))return!0;for(let n of[e.url,e.expandedUrl,e.displayUrl]){let e=st(n);if(e&&t.has(e))return!0}return!1}function Z(e){if(!e)return!1;try{let t=e.includes(`://`)?e:`https://${e}`;return new URL(t).hostname.replace(/^www\./,``)===`t.co`}catch{return!1}}function Q(e){return Z(e.expandedUrl)?!0:e.expandedUrl?!1:Z(e.displayUrl)?!0:!e.displayUrl&&Z(e.url)}function ut(e,t){return(t.urls??[]).filter(Q).map(t=>Ie(e,t))}function dt(e,t){let n=0,r=``;for(let i of[...t].sort((e,t)=>e.start-t.start))i.start<n||i.end<=i.start||i.end>e.length||(r+=e.slice(n,i.start),n=i.end);return r+=e.slice(n),r}function $(e,t,n){if(n.size===0)return!1;let r=ut(e,t);return r.length!==0&&dt(e,r).trim().length===0}function ft(e,t){if(!e)return!1;try{let n=new URL(e),r=n.hostname.replace(/^www\./,``);if(r!==`x.com`&&r!==`twitter.com`)return!1;let i=n.pathname.split(`/`).filter(Boolean),a=i.indexOf(`status`);if(a<0||i[a+1]!==t)return!1;let o=i[a+2];return o===`photo`||o===`video`}catch{return!1}}function pt(e,t,n,r){let i=ct(t);if(i.size===0)return e;let a=$(r,e,i);return{...e,urls:(e.urls??[]).filter(e=>!lt(e,i,n)&&!(a&&Q(e)))}}function mt(e,t,n,r){let i=ct(t);if(i.size===0)return[];let a=$(r,e,i);return(e.urls??[]).filter(e=>lt(e,i,n)||a&&Q(e)).map(e=>Ie(r,e))}function ht(e,t){return(e.urls??[]).filter(n=>Q(n)||e.article&&Le(n,e.article)?!1:!t||!n.expandedUrl.includes(t))}function gt(e){return e instanceof Element&&!!e.closest(`a,button,input,textarea,select,[role='button']`)}function _t({tweet:e,hiddenUrlRanges:t,visibleUrlCards:n,replyToTweet:r,quotedTweet:i}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{className:a,entities:e.entities,hiddenUrlRanges:t,text:e.text}),(0,W.jsx)(K,{items:e.media}),e.entities.article?(0,W.jsx)(G,{article:e.entities.article}):null,r?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:r,label:`In reply to`})}):null,i?(0,W.jsx)(`div`,{className:T,children:(0,W.jsx)(q,{item:i,label:`Quoted tweet`})}):null,n.map((e,t)=>(0,W.jsx)(ot,{entry:e,index:t},`${e.expandedUrl}-${String(t)}`))]})}function vt({item:e,onReply:t,showReplyControls:n=!0}){let a=n&&e.kind!==`like`&&e.kind!==`bookmark`,o=e.retweetedTweet??e,s=o.id,c=e.retweetedTweet&&s===`${e.id}:retweeted`?e.id:s,l=o.author,d=Je(e.id,c),f=pt(o.entities,o.media,o.id,o.text),h=mt(o.entities,o.media,o.id,o.text),g=ht(f,e.retweetedTweet?null:e.quotedTweet?.id??null),v=e.retweetedTweet?o.mediaCount??o.media.length:e.mediaCount,y=o.isReplied??e.isReplied,x=o.likeCount??e.likeCount,w=o.bookmarked??e.bookmarked,T=o.liked??e.liked,E=T||x>0,D=v>0,O=!!(e.retweetedTweet?o.replyToId:e.replyToTweet||e.replyToId);return(0,W.jsxs)(`article`,{className:u(ae,`cursor-pointer [content-visibility:auto] [contain-intrinsic-size:auto_280px]`),"data-perf":`timeline-card`,onFocus:d.prefetch,onMouseEnter:d.prefetch,onClick:e=>{gt(e.target)||d.toggle()},children:[(0,W.jsx)(R,{avatarUrl:l.avatarUrl,hue:l.avatarHue,name:l.displayName,profileId:l.id}),(0,W.jsxs)(`div`,{className:_,children:[e.retweetedTweet?(0,W.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,W.jsx)(fe,{className:`size-4`,strokeWidth:1.8}),(0,W.jsx)(B,{profile:e.author,children:(0,W.jsxs)(`span`,{children:[e.author.displayName,` reposted`]})})]}):null,(0,W.jsxs)(`header`,{className:oe,children:[(0,W.jsx)(B,{profile:l,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,W.jsx)(`span`,{className:p,children:l.displayName}),(0,W.jsxs)(`span`,{className:b,children:[`@`,l.handle]})]})}),(0,W.jsx)(`span`,{className:se,children:`·`}),(0,W.jsx)(V,{className:i,value:o.createdAt}),a||O?(0,W.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1`,children:[O?(0,W.jsxs)(`span`,{"aria-label":`Part of a conversation`,className:u(j,r),title:`Part of a conversation`,children:[(0,W.jsx)(N,{className:`size-3.5`,strokeWidth:2}),`thread`]}):null,a?(0,W.jsxs)(`span`,{"aria-label":y?`We replied`:`Reply open`,className:u(j,y?r:m),title:y?`We replied`:`Reply open`,children:[y?(0,W.jsx)(ce,{className:`size-3.5`,strokeWidth:2}):(0,W.jsx)(le,{className:`size-3`,strokeWidth:2.2}),y?`replied`:`open`]}):null]}):null]}),(0,W.jsx)(_t,{hiddenUrlRanges:h,quotedTweet:e.retweetedTweet?null:e.quotedTweet,replyToTweet:e.retweetedTweet?null:e.replyToTweet,tweet:o,visibleUrlCards:g}),(0,W.jsx)(`footer`,{className:C,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,W.jsxs)(`button`,{"aria-expanded":d.isOpen,"aria-label":d.isOpen?`Hide conversation`:`Show conversation`,className:S,onClick:e=>{e.stopPropagation(),d.toggle()},type:`button`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(N,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:d.isOpen?`Hide thread`:`Thread`})]}),a?(0,W.jsxs)(`button`,{className:S,onClick:e=>{e.stopPropagation(),t(c)},type:`button`,"aria-label":`Reply`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(N,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Reply`})]}):null,(0,W.jsxs)(`a`,{"aria-label":`Analyse @${l.handle}`,className:S,href:`/profiles/${encodeURIComponent(l.handle)}`,onClick:e=>{e.stopPropagation()},title:`Analyse @${l.handle}`,children:[(0,W.jsx)(`span`,{className:k,children:(0,W.jsx)(me,{className:A,strokeWidth:1.7})}),(0,W.jsx)(`span`,{className:`text-[13px]`,children:`Analyse`})]}),E?(0,W.jsxs)(`span`,{"aria-label":`${L(x)} likes`,className:u(`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,T&&`text-[var(--like)]`),title:`${L(x)} likes`,children:[(0,W.jsx)(de,{className:A,strokeWidth:1.7,fill:T?`currentColor`:`none`}),(0,W.jsx)(`span`,{children:L(x)})]}):null,w?(0,W.jsx)(`span`,{"aria-label":`Bookmarked`,className:`inline-flex items-center px-2 py-1`,title:`Bookmarked`,children:(0,W.jsx)(ze,{className:A,strokeWidth:1.7})}):null,D?(0,W.jsxs)(`span`,{"aria-label":`${String(v)} media attachments`,className:`inline-flex items-center gap-1 px-2 py-1 text-[13px]`,title:`${String(v)} media attachments`,children:[(0,W.jsx)(Be,{className:A,strokeWidth:1.7}),(0,W.jsx)(`span`,{children:v})]}):null]})}),d.isOpen?(0,W.jsx)(Qe,{anchorId:c,error:d.error,items:d.items,loading:d.loading}):null]})]})}function yt({title:e,subtitles:t,action:n,controls:r}){return(0,W.jsxs)(`header`,{className:h,children:[(0,W.jsxs)(`div`,{className:`${g} flex-wrap`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,W.jsx)(`h1`,{className:l,children:e}),t]}),n]}),r]})}function bt({children:e}){return(0,W.jsx)(`p`,{className:s,children:e})}function xt({value:e,onChange:t,placeholder:n}){return(0,W.jsx)(`div`,{className:`px-4 pb-3`,children:(0,W.jsxs)(`label`,{className:re,children:[(0,W.jsx)(pe,{className:v,strokeWidth:2}),(0,W.jsx)(`input`,{className:ee,onChange:e=>t(e.target.value),placeholder:n,value:e})]})})}function St({header:e,notice:t,loading:n,loadingLabel:r,loadingDetail:i,error:a,errorTitle:o,onRetry:s,empty:c,emptyLabel:l,emptyDetail:u,children:d,hasMore:f,loadingMore:p,onLoadMore:m}){return(0,W.jsxs)(W.Fragment,{children:[e,t,(0,W.jsx)(qe,{children:(0,W.jsxs)(`section`,{className:w,children:[n?(0,W.jsx)(Me,{detail:i,label:r,children:(0,W.jsx)(ke,{})}):a?(0,W.jsx)(Ae,{action:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:s,type:`button`,children:`Retry`}),message:a,title:o}):c?(0,W.jsx)(Pe,{detail:u,label:l}):null,d,!n&&!a&&f?(0,W.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,W.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-5 py-1.5 text-[14px] font-bold text-white disabled:opacity-60`,disabled:p,onClick:m,type:`button`,children:p?`Loading…`:`Load more`})}):null]})})]})}var Ct=50,wt=5*6e4;function Tt({resource:e,search:t,replyFilter:n,likedOnly:r,bookmarkedOnly:i,selectedAccountId:a,pageParam:o}){let s=new URLSearchParams({resource:e,limit:String(Ct)});a&&s.set(`account`,a),n&&s.set(`replyFilter`,n),r&&s.set(`liked`,`true`),i&&s.set(`bookmarked`,`true`),t.trim()&&s.set(`search`,t.trim()),o&&(s.set(`until`,o.until),s.set(`untilId`,o.untilId)),s.sort();let c=typeof window>`u`?`http://birdclaw.local`:window.location.origin;return new URL(`/api/query?${s.toString()}`,c).toString()}function Et({resource:e,search:t,errorFallback:n,replyFilter:r,likedOnly:i=!1,bookmarkedOnly:a=!1}){let o=P(),s=I({queryKey:F.status,queryFn:({signal:e})=>ge({signal:e})}).data??null,c=Oe(s?.accounts),l=Fe(t,180),u=[...F.timelines,{resource:e,search:l,replyFilter:r??`all`,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c??null}],d=We({queryKey:u,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>be(Tt({resource:e,search:l,replyFilter:r,likedOnly:i,bookmarkedOnly:a,selectedAccountId:c,pageParam:t}),{signal:n}),getNextPageParam:e=>{if(e.resource===`dms`)return;let t=e.items,n=t.at(-1);return t.length>=Ct&&n?{until:n.createdAt,untilId:n.id}:void 0},staleTime:wt}),f=(0,U.useMemo)(()=>{let e=new Set,t=[];for(let n of d.data?.pages??[])if(n.resource!==`dms`)for(let r of n.items)e.has(r.id)||(e.add(r.id),t.push(r));return t},[d.data]),p=De({mutationFn:({tweetId:e,text:t})=>Se({kind:`replyTweet`,accountId:c??`acct_primary`,tweetId:e,text:t}),onSuccess:()=>o.invalidateQueries({queryKey:u})});function m(){d.refetch()}function h(){Promise.all([o.invalidateQueries({queryKey:F.timelines}),o.invalidateQueries({queryKey:F.status})])}async function g(e){let t=window.prompt(`Reply text`);t?.trim()&&await p.mutateAsync({tweetId:e,text:t.trim()}).catch(()=>{})}let _=d.error;return{meta:s,items:f,loading:d.isPending,error:_?_ instanceof Error?_.message:n:null,replyError:p.error?p.error instanceof Error?p.error.message:`Reply failed`:null,retry:m,refreshLocalView:h,replyToTweet:g,selectedAccountId:c,hasMore:d.hasNextPage,loadingMore:d.isFetchingNextPage,loadMore:()=>d.fetchNextPage().then(()=>void 0)}}export{xt as a,bt as i,yt as n,vt as o,St as r,Et as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as SyncNowButton } from "./SyncNowButton-C3OQghU4.js";
|
|
2
|
-
import { a as TimelineSearchField, i as TimelineHeaderSubtitle, n as TimelineFeedHeader, o as TimelineCard, r as TimelineFeedShell, t as useTimelineRouteData } from "./useTimelineRouteData-
|
|
2
|
+
import { a as TimelineSearchField, i as TimelineHeaderSubtitle, n as TimelineFeedHeader, o as TimelineCard, r as TimelineFeedShell, t as useTimelineRouteData } from "./useTimelineRouteData-wthflgOe.js";
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/SavedTimelineView.tsx
|
package/dist/server/assets/{TimelineRouteFrame-CYD-qMuy.js → TimelineRouteFrame-Dj1TeYrD.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dn as tabStripClass, ln as tabButtonClass, m as cx, mn as timestampClass, un as tabButtonIndicatorClass } from "./ui-CL21-Ku0.js";
|
|
2
2
|
import { t as SyncNowButton } from "./SyncNowButton-C3OQghU4.js";
|
|
3
|
-
import { a as TimelineSearchField, i as TimelineHeaderSubtitle, n as TimelineFeedHeader, o as TimelineCard, r as TimelineFeedShell, t as useTimelineRouteData } from "./useTimelineRouteData-
|
|
3
|
+
import { a as TimelineSearchField, i as TimelineHeaderSubtitle, n as TimelineFeedHeader, o as TimelineCard, r as TimelineFeedShell, t as useTimelineRouteData } from "./useTimelineRouteData-wthflgOe.js";
|
|
4
4
|
import { useMemo, useState } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/TimelineRouteFrame.tsx
|
|
@@ -38,7 +38,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
38
38
|
],
|
|
39
39
|
css: ["/assets/network-map-CrXvY--k.css"],
|
|
40
40
|
preloads: [
|
|
41
|
-
"/assets/index-
|
|
41
|
+
"/assets/index-Bz8aYylW.js",
|
|
42
42
|
"/assets/rolldown-runtime-B-9mzPXz.js",
|
|
43
43
|
"/assets/react-BwGzW7mM.js",
|
|
44
44
|
"/assets/react-dom-DEMAB80t.js",
|
|
@@ -47,7 +47,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
47
47
|
"/assets/createLucideIcon-CMLcIxOz.js",
|
|
48
48
|
"/assets/chevron-down-e-c5H12y.js",
|
|
49
49
|
"/assets/database-Dl3XWRaa.js",
|
|
50
|
-
"/assets/network-map-
|
|
50
|
+
"/assets/network-map-CKiXfloJ.js",
|
|
51
51
|
"/assets/gauge-DP2ku9zz.js",
|
|
52
52
|
"/assets/heart-D-ERjZPN.js",
|
|
53
53
|
"/assets/user-search-DL5_6EZd.js",
|
|
@@ -57,39 +57,39 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
57
57
|
"/assets/AvatarChip-DsHj3LT7.js",
|
|
58
58
|
"/assets/FeedState-DhMv4zXD.js",
|
|
59
59
|
"/assets/preload-helper-MpqUbZCn.js",
|
|
60
|
-
"/assets/
|
|
60
|
+
"/assets/blocks-qrevFiNI.js",
|
|
61
|
+
"/assets/discuss-BeFPn8mN.js",
|
|
62
|
+
"/assets/dms-DBexFtGg.js",
|
|
63
|
+
"/assets/inbox-DvSRkOiH.js",
|
|
64
|
+
"/assets/links-CbC-fX7T.js",
|
|
61
65
|
"/assets/profile-analyze-B5Rr41WP.js",
|
|
62
|
-
"/assets/
|
|
63
|
-
"/assets/inbox-DjlVjj3K.js",
|
|
64
|
-
"/assets/dms-Q1a1kZ_P.js",
|
|
65
|
-
"/assets/discuss-DKC6H1fN.js",
|
|
66
|
-
"/assets/blocks-BpjvGwYq.js",
|
|
66
|
+
"/assets/today-DOUIqDPa.js",
|
|
67
67
|
"/assets/profiles._handle-DdZ9wAT-.js"
|
|
68
68
|
],
|
|
69
69
|
scripts: [{ attrs: {
|
|
70
70
|
type: "module",
|
|
71
71
|
async: !0,
|
|
72
|
-
src: "/assets/index-
|
|
72
|
+
src: "/assets/index-Bz8aYylW.js"
|
|
73
73
|
} }]
|
|
74
74
|
},
|
|
75
75
|
"/": {
|
|
76
76
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/index.tsx",
|
|
77
77
|
children: void 0,
|
|
78
|
-
preloads: ["/assets/routes-
|
|
78
|
+
preloads: ["/assets/routes-P7NzOusD.js", "/assets/TimelineRouteFrame-DcipwBqo.js"]
|
|
79
79
|
},
|
|
80
80
|
"/blocks": {
|
|
81
81
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/blocks.tsx",
|
|
82
82
|
children: void 0,
|
|
83
83
|
preloads: [
|
|
84
|
-
"/assets/blocks-
|
|
85
|
-
"/assets/
|
|
86
|
-
"/assets/
|
|
84
|
+
"/assets/blocks-GWWj1dXr.js",
|
|
85
|
+
"/assets/useDebouncedValue-BJLRInUq.js",
|
|
86
|
+
"/assets/route-search-CmZT7pGD.js"
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"/bookmarks": {
|
|
90
90
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/bookmarks.tsx",
|
|
91
91
|
children: void 0,
|
|
92
|
-
preloads: ["/assets/bookmarks-
|
|
92
|
+
preloads: ["/assets/bookmarks-BMf6Ytua.js", "/assets/SavedTimelineView-CFgHR6di.js"]
|
|
93
93
|
},
|
|
94
94
|
"/data-sources": {
|
|
95
95
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/data-sources.tsx",
|
|
@@ -105,7 +105,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
105
105
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/discuss.tsx",
|
|
106
106
|
children: void 0,
|
|
107
107
|
preloads: [
|
|
108
|
-
"/assets/discuss-
|
|
108
|
+
"/assets/discuss-ZvGdSAmA.js",
|
|
109
109
|
"/assets/circle-check-BCK_qvXt.js",
|
|
110
110
|
"/assets/client-stream-contracts-CNz2FSrQ.js",
|
|
111
111
|
"/assets/refresh-cw-IUfM9D_1.js",
|
|
@@ -118,18 +118,18 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
118
118
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/dms.tsx",
|
|
119
119
|
children: void 0,
|
|
120
120
|
preloads: [
|
|
121
|
-
"/assets/dms-
|
|
121
|
+
"/assets/dms-CMp6bAR_.js",
|
|
122
122
|
"/assets/search-C_LqodNa.js",
|
|
123
|
+
"/assets/useDebouncedValue-BJLRInUq.js",
|
|
123
124
|
"/assets/route-search-CmZT7pGD.js",
|
|
124
|
-
"/assets/SyncNowButton-DDYT2jQT.js"
|
|
125
|
-
"/assets/useDebouncedValue-BJLRInUq.js"
|
|
125
|
+
"/assets/SyncNowButton-DDYT2jQT.js"
|
|
126
126
|
]
|
|
127
127
|
},
|
|
128
128
|
"/inbox": {
|
|
129
129
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/inbox.tsx",
|
|
130
130
|
children: void 0,
|
|
131
131
|
preloads: [
|
|
132
|
-
"/assets/inbox-
|
|
132
|
+
"/assets/inbox-CeGwsGo_.js",
|
|
133
133
|
"/assets/sparkles-Gx_BHkDX.js",
|
|
134
134
|
"/assets/route-search-CmZT7pGD.js"
|
|
135
135
|
]
|
|
@@ -137,33 +137,33 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
137
137
|
"/likes": {
|
|
138
138
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/likes.tsx",
|
|
139
139
|
children: void 0,
|
|
140
|
-
preloads: ["/assets/likes-
|
|
140
|
+
preloads: ["/assets/likes-BaljrAHC.js", "/assets/SavedTimelineView-CFgHR6di.js"]
|
|
141
141
|
},
|
|
142
142
|
"/links": {
|
|
143
143
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/links.tsx",
|
|
144
144
|
children: void 0,
|
|
145
145
|
preloads: [
|
|
146
|
-
"/assets/links-
|
|
146
|
+
"/assets/links-DMGuDd-B.js",
|
|
147
147
|
"/assets/external-link-CfdTAkvn.js",
|
|
148
148
|
"/assets/message-circle-79LZr2oN.js",
|
|
149
149
|
"/assets/repeat-2-CQ0lek01.js",
|
|
150
150
|
"/assets/search-C_LqodNa.js",
|
|
151
151
|
"/assets/users-DI3w8Mol.js",
|
|
152
|
+
"/assets/route-search-CmZT7pGD.js",
|
|
152
153
|
"/assets/ProfilePreview-CaaMHV2N.js",
|
|
153
|
-
"/assets/SmartTimestamp-CXaNLqN7.js"
|
|
154
|
-
"/assets/route-search-CmZT7pGD.js"
|
|
154
|
+
"/assets/SmartTimestamp-CXaNLqN7.js"
|
|
155
155
|
]
|
|
156
156
|
},
|
|
157
157
|
"/mentions": {
|
|
158
158
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/mentions.tsx",
|
|
159
159
|
children: void 0,
|
|
160
|
-
preloads: ["/assets/mentions-
|
|
160
|
+
preloads: ["/assets/mentions-TFNyR9F4.js", "/assets/TimelineRouteFrame-DcipwBqo.js"]
|
|
161
161
|
},
|
|
162
162
|
"/network-map": {
|
|
163
163
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/network-map.tsx",
|
|
164
164
|
children: void 0,
|
|
165
165
|
preloads: [
|
|
166
|
-
"/assets/network-map-
|
|
166
|
+
"/assets/network-map-1fXIqI3Y.js",
|
|
167
167
|
"/assets/refresh-cw-IUfM9D_1.js",
|
|
168
168
|
"/assets/search-C_LqodNa.js",
|
|
169
169
|
"/assets/users-DI3w8Mol.js",
|
|
@@ -194,13 +194,13 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
194
194
|
filePath: "/Users/steipete/Projects/birdclaw/src/routes/today.tsx",
|
|
195
195
|
children: void 0,
|
|
196
196
|
preloads: [
|
|
197
|
-
"/assets/today-
|
|
197
|
+
"/assets/today-Dq8qoGhX.js",
|
|
198
198
|
"/assets/circle-check-BCK_qvXt.js",
|
|
199
199
|
"/assets/client-stream-contracts-CNz2FSrQ.js",
|
|
200
200
|
"/assets/refresh-cw-IUfM9D_1.js",
|
|
201
201
|
"/assets/sparkles-Gx_BHkDX.js",
|
|
202
|
-
"/assets/
|
|
203
|
-
"/assets/
|
|
202
|
+
"/assets/route-search-CmZT7pGD.js",
|
|
203
|
+
"/assets/profile-hydration-client-DoFW3yKH.js"
|
|
204
204
|
]
|
|
205
205
|
},
|
|
206
206
|
"/profiles/$handle": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, K as emptyStateClass, Mt as primaryButtonClass, Ot as pageTitleClass, Tt as pageHeaderClass, Wt as secondaryButtonClass, Yt as selectFieldClass, _t as mutedDotClass, a as blockRowClass, fn as textFieldClass, h as dangerButtonClass, i as blockRowBodyClass, m as cx, mn as timestampClass, pn as textFieldShortClass, q as errorCopyClass, sn as statusCopyClass } from "./ui-CL21-Ku0.js";
|
|
2
2
|
import { _ as blockListResponseSchema, a as fetchQueryEnvelope, n as queryKeys, r as fetchJson, s as postAction } from "./query-client-BdauHBgd.js";
|
|
3
3
|
import { r as formatCompactNumber, t as AvatarChip } from "./AvatarChip-B5ASnpQ4.js";
|
|
4
|
-
import { t as validateBlocksSearch } from "./route-search-BUlQ5lGM.js";
|
|
5
4
|
import { t as useDebouncedValue } from "./useDebouncedValue-DOnA6Xcy.js";
|
|
6
|
-
import { t as
|
|
5
|
+
import { t as validateBlocksSearch } from "./route-search-BUlQ5lGM.js";
|
|
6
|
+
import { t as Route } from "./blocks-Cv7I4iVs.js";
|
|
7
7
|
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { keepPreviousData, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import "./ui-CL21-Ku0.js";
|
|
2
2
|
import "./query-client-BdauHBgd.js";
|
|
3
3
|
import "./AvatarChip-B5ASnpQ4.js";
|
|
4
|
-
import { t as validateBlocksSearch } from "./route-search-BUlQ5lGM.js";
|
|
5
4
|
import "./useDebouncedValue-DOnA6Xcy.js";
|
|
5
|
+
import { t as validateBlocksSearch } from "./route-search-BUlQ5lGM.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
10
|
//#region src/routes/blocks.tsx
|
|
11
|
-
var $$splitComponentImporter = () => import("./blocks-
|
|
11
|
+
var $$splitComponentImporter = () => import("./blocks-BSvPOa_E.js");
|
|
12
12
|
var Route = createFileRoute("/blocks")({
|
|
13
13
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
14
14
|
validateSearch: validateBlocksSearch
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SavedTimelineView } from "./SavedTimelineView-
|
|
1
|
+
import { t as SavedTimelineView } from "./SavedTimelineView-lVz_ZZnh.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/routes/bookmarks.tsx?tsr-split=component
|
|
4
4
|
function BookmarksRoute() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, Ht as searchFieldInputClass, Mt as primaryButtonClass, Ot as pageTitleClass, Tt as pageHeaderClass, Ut as searchFieldShellClass, Vt as searchFieldIconClass, Wt as secondaryButtonClass, Yt as selectFieldClass, fn as textFieldClass, m as cx, q as errorCopyClass, wt as pageHeaderActionsClass } from "./ui-CL21-Ku0.js";
|
|
2
|
-
import { a as useNdjsonRun, i as searchDiscussionStreamEventSchema, o as MarkdownViewer, t as isTerminalStreamEvent } from "./client-stream-contracts-DVzk8DzM.js";
|
|
3
2
|
import { n as validateDiscussSearch } from "./route-search-BUlQ5lGM.js";
|
|
4
|
-
import { t as
|
|
3
|
+
import { a as useNdjsonRun, i as searchDiscussionStreamEventSchema, o as MarkdownViewer, t as isTerminalStreamEvent } from "./client-stream-contracts-DVzk8DzM.js";
|
|
4
|
+
import { t as Route$1 } from "./discuss-D1q_L77A.js";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { CheckCircle2, ChevronDown, Loader2, RefreshCw, Search, Sparkles } from "lucide-react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./ui-CL21-Ku0.js";
|
|
2
|
-
import "./client-stream-contracts-DVzk8DzM.js";
|
|
3
2
|
import { n as validateDiscussSearch } from "./route-search-BUlQ5lGM.js";
|
|
3
|
+
import "./client-stream-contracts-DVzk8DzM.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "lucide-react";
|
|
8
8
|
//#region src/routes/discuss.tsx
|
|
9
|
-
var $$splitComponentImporter = () => import("./discuss-
|
|
9
|
+
var $$splitComponentImporter = () => import("./discuss-BuLhalye.js");
|
|
10
10
|
var Route$1 = createFileRoute("/discuss")({
|
|
11
11
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
12
12
|
validateSearch: validateDiscussSearch
|
|
@@ -3,10 +3,10 @@ import "./query-client-BdauHBgd.js";
|
|
|
3
3
|
import { r as formatCompactNumber, t as AvatarChip } from "./AvatarChip-B5ASnpQ4.js";
|
|
4
4
|
import "./account-selection-CTdFGWRk.js";
|
|
5
5
|
import { o as BirdclawEmpty } from "./FeedState-YrMZ10Gf.js";
|
|
6
|
-
import
|
|
6
|
+
import "./useDebouncedValue-DOnA6Xcy.js";
|
|
7
7
|
import { r as validateDmsSearch } from "./route-search-BUlQ5lGM.js";
|
|
8
|
+
import { t as SmartTimestamp } from "./SmartTimestamp-sxGoy8Uj.js";
|
|
8
9
|
import "./SyncNowButton-C3OQghU4.js";
|
|
9
|
-
import "./useDebouncedValue-DOnA6Xcy.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -231,7 +231,7 @@ function DmWorkspace({ conversations, selectedConversation, selectedMessages, on
|
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/routes/dms.tsx
|
|
234
|
-
var $$splitComponentImporter = () => import("./dms-
|
|
234
|
+
var $$splitComponentImporter = () => import("./dms-OtbAd5nR.js");
|
|
235
235
|
var Route$1 = createFileRoute("/dms")({
|
|
236
236
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
237
237
|
validateSearch: validateDmsSearch
|
|
@@ -2,10 +2,10 @@ import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, Ht as searchFieldInp
|
|
|
2
2
|
import { a as fetchQueryEnvelope, n as queryKeys, r as fetchJson, s as postAction, v as dmQueryResponseSchema } from "./query-client-BdauHBgd.js";
|
|
3
3
|
import { r as useSelectedAccountId } from "./account-selection-CTdFGWRk.js";
|
|
4
4
|
import { n as FeedError, r as FeedLoading, t as FeedEmpty } from "./FeedState-YrMZ10Gf.js";
|
|
5
|
+
import { t as useDebouncedValue } from "./useDebouncedValue-DOnA6Xcy.js";
|
|
5
6
|
import { r as validateDmsSearch } from "./route-search-BUlQ5lGM.js";
|
|
6
|
-
import { n as DmWorkspace, t as Route$1 } from "./dms-
|
|
7
|
+
import { n as DmWorkspace, t as Route$1 } from "./dms-C-s5l0cs.js";
|
|
7
8
|
import { t as SyncNowButton } from "./SyncNowButton-C3OQghU4.js";
|
|
8
|
-
import { t as useDebouncedValue } from "./useDebouncedValue-DOnA6Xcy.js";
|
|
9
9
|
import { useEffect, useMemo, useState } from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Search } from "lucide-react";
|
|
@@ -2,8 +2,8 @@ import { $ as feedRowBodyClass, At as pillClass, Mt as primaryButtonClass, Wt as
|
|
|
2
2
|
import "./query-client-BdauHBgd.js";
|
|
3
3
|
import { r as formatCompactNumber, t as AvatarChip } from "./AvatarChip-B5ASnpQ4.js";
|
|
4
4
|
import "./account-selection-CTdFGWRk.js";
|
|
5
|
-
import { t as SmartTimestamp } from "./SmartTimestamp-sxGoy8Uj.js";
|
|
6
5
|
import { i as validateInboxSearch } from "./route-search-BUlQ5lGM.js";
|
|
6
|
+
import { t as SmartTimestamp } from "./SmartTimestamp-sxGoy8Uj.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { Link, createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -137,7 +137,7 @@ function InboxCard({ item, isReplying, replyDraft, onReplyChange, onReplyToggle,
|
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region src/routes/inbox.tsx
|
|
140
|
-
var $$splitComponentImporter = () => import("./inbox-
|
|
140
|
+
var $$splitComponentImporter = () => import("./inbox-wLir608r.js");
|
|
141
141
|
var Route$1 = createFileRoute("/inbox")({
|
|
142
142
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
143
143
|
validateSearch: validateInboxSearch
|
|
@@ -2,7 +2,7 @@ import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, K as emptyStateClass
|
|
|
2
2
|
import { a as fetchQueryEnvelope, n as queryKeys, r as fetchJson, s as postAction, y as inboxResponseSchema } from "./query-client-BdauHBgd.js";
|
|
3
3
|
import { r as useSelectedAccountId } from "./account-selection-CTdFGWRk.js";
|
|
4
4
|
import { i as validateInboxSearch } from "./route-search-BUlQ5lGM.js";
|
|
5
|
-
import { n as InboxCard, t as Route$1 } from "./inbox-
|
|
5
|
+
import { n as InboxCard, t as Route$1 } from "./inbox-Wf8xGIjq.js";
|
|
6
6
|
import { useMemo, useState } from "react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Sparkles } from "lucide-react";
|
|
@@ -2,10 +2,10 @@ import "./ui-CL21-Ku0.js";
|
|
|
2
2
|
import { b as linkInsightResponseSchema, n as queryKeys, r as fetchJson } from "./query-client-BdauHBgd.js";
|
|
3
3
|
import { r as formatCompactNumber } from "./AvatarChip-B5ASnpQ4.js";
|
|
4
4
|
import "./FeedState-YrMZ10Gf.js";
|
|
5
|
+
import { a as validateLinksSearch } from "./route-search-BUlQ5lGM.js";
|
|
5
6
|
import "./ProfilePreview-Dk2CdOOS.js";
|
|
6
7
|
import "./SmartTimestamp-sxGoy8Uj.js";
|
|
7
8
|
import { t as hydrateProfileHandles } from "./profile-hydration-client-GJ4kwJS8.js";
|
|
8
|
-
import { a as validateLinksSearch } from "./route-search-BUlQ5lGM.js";
|
|
9
9
|
import { useEffect, useMemo } from "react";
|
|
10
10
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
11
11
|
import "react/jsx-runtime";
|
|
@@ -231,7 +231,7 @@ function useLinksController(filters, onFiltersChange) {
|
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/routes/links.tsx
|
|
234
|
-
var $$splitComponentImporter = () => import("./links-
|
|
234
|
+
var $$splitComponentImporter = () => import("./links-_ePW92kI.js");
|
|
235
235
|
var Route$1 = createFileRoute("/links")({
|
|
236
236
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
237
237
|
validateSearch: validateLinksSearch
|