PageSourceSearch

https://smry.ai/_next/static/chunks/003f2u4ve_8tz.js?dpl=5cb6504fd3cb

js smry.ai collected 2026-09-24 10:05:40 UTC 38,439 bytes, 54 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0d2c8-6b7d-0000-f70a-d8c4c3e4bcf2";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="0cc7cbe3-fbd5-5d9a-9b64-5ef65966350b")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,804148,t=>{"use strict";var e=t.i(843476),a=t.i(647163);t.s(["Kbd",0,function({className:t,...n}){return(0,e.jsx)("kbd",{className:(0,a.cn)("pointer-events-none inline-flex h-5 min-w-5 shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap rounded bg-muted px-1 font-medium font-sans text-muted-foreground text-xs leading-none [&_svg:not([class*='size-'])]:size-3",t),"data-slot":"kbd",...n})},"KbdGroup",0,function({className:t,...n}){return(0,e.jsx)("kbd",{className:(0,a.cn)("inline-flex items-center gap-1",t),"data-slot":"kbd-group",...n})},"tooltipKbdClassName",0,"h-4 min-w-4 border border-background/15 bg-background/10 px-1 text-[10px] text-background"])},905979,t=>{"use strict";async function e(t,e){let a=new AbortController,n=[];try{for(let e of t){if(!e)continue;if(e.aborted){a.abort(e.reason);break}let t=()=>a.abort(e.reason);e.addEventListener("abort",t,{once:!0}),n.push(()=>e.removeEventListener("abort",t))}a.signal.throwIfAborted();let i=await e(a.signal);return a.signal.throwIfAborted(),i}finally{for(let t of n)t()}}t.s(["withAbortSignals",0,e])},524042,376946,709133,t=>{"use strict";var e=t.i(340830),a=t.i(566533),n=t.i(435682);let i=/^\d{1,32}$/;function r(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function l(t,e=2048){if("string"!=typeof t)return;let a=t.replace(/\u0000/g,"").trim();return a?a.slice(0,e).toWellFormed():void 0}function o(t){let e=l(t,2048);if(e)try{let t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol?t.toString():void 0}catch{return}}function s(t){return"number"==typeof t&&Number.isSafeInteger(t)&&t>=0?t:void 0}function d(t){return"number"==typeof t&&Number.isSafeInteger(t)&&t>0&&t<=1e5?t:void 0}function u(t){if(!Array.isArray(t)||2!==t.length)return;let[e,a]=t;return Number.isSafeInteger(e)&&Number.isSafeInteger(a)&&e>=0&&a>e?[e,a]:void 0}function c(t){let e=r(t)?t:null;if(!e)return null;let a=u(e.indices),n=o(e.url),i=o(e.expanded_url),s=l(e.display_url);return a&&(n||i||s)?{indices:a,...n?{url:n}:{},...i?{expanded_url:i}:{},...s?{display_url:s}:{}}:null}function p(t){let e=r(t)?t:null;if(!e)return null;let a=l(e.type,30),n=o(e.media_url_https),i=o(e.expanded_url),u=l(e.ext_alt_text,2048),c=r(e.original_info)?e.original_info:null,p=d(c?.width),m=d(c?.height),_=r(e.video_info)?e.video_info:null,f=s(_?.duration_millis),g=(Array.isArray(_?.variants)?_.variants:[]).slice(0,12).flatMap(t=>{let e=r(t)?t:null,a=l(e?.content_type,100),n=o(e?.url);if("video/mp4"!==a||!n)return[];let i=s(e?.bitrate);return[{content_type:a,...void 0!==i?{bitrate:i}:{},url:n}]});return n||0!==g.length?{...a?{type:a}:{},...n?{media_url_https:n}:{},...i?{expanded_url:i}:{},...u?{ext_alt_text:u}:{},...p||m?{original_info:{...p?{width:p}:{},...m?{height:m}:{}}}:{},...void 0!==f||g.length?{video_info:{...void 0!==f?{duration_millis:f}:{},...g.length?{variants:g}:{}}}:{}}:null}function m(t){let e=r(t)?t:null;if(e?.version!==1)return null;let a=function t(e,a){let n=r(e)?e:null,m=l(n?.id_str,32);if(!n||!m||!i.test(m))return null;let _=r(n.user)?n.user:null,f=l(_?.name,500),g=l(_?.screen_name,100)?.replace(/^@/,""),h=o(_?.profile_image_url_https),x=l(_?.verified_type,100),y=_&&(f||g||h||!0===_.verified||!0===_.is_blue_verified||x)?{...f?{name:f}:{},...g?{screen_name:g}:{},...h?{profile_image_url_https:h}:{},...!0===_.verified?{verified:!0}:{},...!0===_.is_blue_verified?{is_blue_verified:!0}:{},...x?{verified_type:x}:{}}:void 0,v=l(n.text,204800),b=l(n.lang,10),E=l(n.created_at,100),w=u(n.display_text_range),$=function(t){let e=r(t)?t:null;if(!e)return;let a=(Array.isArray(e.urls)?e.urls:[]).slice(0,64).map(c).filter(t=>null!==t),n=(Array.isArray(e.media)?e.media:[]).slice(0,64).map(c).filter(t=>null!==t),i=(Array.isArray(e.user_mentions)?e.user_mentions:[]).slice(0,64).flatMap(t=>{let e=r(t)?t:null,a=u(e?.indices),n=l(e?.screen_name,100)?.replace(/^@/,"");if(!a||!n)return[];let i=l(e?.name,500);return[{indices:a,screen_name:n,...i?{name:i}:{}}]}),o=(Array.isArray(e.hashtags)?e.hashtags:[]).slice(0,64).flatMap(t=>{let e=r(t)?t:null,a=u(e?.indices),n=l(e?.text,200)?.replace(/^#/,"");return a&&n?[{indices:a,text:n}]:[]});if(a.length||n.length||i.length||o.length)return{...a.length?{urls:a}:{},...n.length?{media:n}:{},...i.length?{user_mentions:i}:{},...o.length?{hashtags:o}:{}}}(n.entities),S=(Array.isArray(n.mediaDetails)?n.mediaDetails:[]).slice(0,4).map(p).filter(t=>null!==t),A=function(t){let e=r(t)?t:null,a=r(e?.binding_values)?e.binding_values:null;if(!e||!a)return;let n={};for(let[t,e]of Object.entries(a).slice(0,32)){if(!/^[a-zA-Z0-9_]{1,100}$/.test(t)||!r(e))continue;let a=l(e.type,50),i="card_url"===t||"player_url"===t?o(e.string_value):l(e.string_value,16384),s="boolean"==typeof e.boolean_value?e.boolean_value:void 0,u=r(e.image_value)?e.image_value:null,c=o(u?.url),p=d(u?.width),m=d(u?.height),_=l(u?.alt,2048);(a||i||void 0!==s||c)&&(n[t]={...a?{type:a}:{},...i?{string_value:i}:{},...void 0!==s?{boolean_value:s}:{},...c?{image_value:{url:c,...p?{width:p}:{},...m?{height:m}:{},..._?{alt:_}:{}}}:{}})}if(0===Object.keys(n).length)return;let i=l(e.name,200);return{...i?{name:i}:{},binding_values:n}}(n.card),T=r(n.article)?n.article:null,I=l(T?.rest_id,32),N=l(T?.title,500),R=l(T?.preview_text,16384),L=r(T?.cover_media)?T.cover_media:null,k=r(L?.media_info)?L.media_info:null,U=o(k?.original_img_url),O=T&&(I||N||R||U)?{...I?{rest_id:I}:{}
1,...N?{title:N}:{},...R?{preview_text:R}:{},...U?{cover_media:{media_info:{original_img_url:U}}}:{}}:void 0,D=a<1?t(n.parent,a+1):null,z=a<1?t(n.quoted_tweet,a+1):null;return{id_str:m,...v?{text:v}:{},...b?{lang:b}:{},...E?{created_at:E}:{},...w?{display_text_range:w}:{},...void 0!==s(n.favorite_count)?{favorite_count:s(n.favorite_count)}:{},...void 0!==s(n.conversation_count)?{conversation_count:s(n.conversation_count)}:{},...void 0!==s(n.retweet_count)?{retweet_count:s(n.retweet_count)}:{},...void 0!==s(n.quote_count)?{quote_count:s(n.quote_count)}:{},...void 0!==s(n.bookmark_count)?{bookmark_count:s(n.bookmark_count)}:{},...y?{user:y}:{},...$?{entities:$}:{},...S.length?{mediaDetails:S}:{},...A?{card:A}:{},...O?{article:O}:{},...D?{parent:D}:{},...z?{quoted_tweet:z}:{}}}(e,0);if(!a)return null;let n={version:1,...a};return new TextEncoder().encode(JSON.stringify(n)).byteLength<=98304?n:null}function _(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function f(t){let e=t.user?.name,a=t.user?.screen_name;return e&&a?`${e} (@${a})`:e||(a?`@${a}`:null)}function g(t,e){return t.user?.screen_name?`https://x.com/${encodeURIComponent(t.user.screen_name)}/status/${t.id_str}`:e}function h(t,e){let a=t.charCodeAt(e-1),n=t.charCodeAt(e);return!(a>=55296&&a<=56319&&n>=56320&&n<=57343)}function x(t){let e=t.text??"";if(!e)return{html:"",text:""};let[a,n]=t.display_text_range??[0,e.length],i=Math.max(0,Math.min(a,e.length)),r=Math.max(i,Math.min(n,e.length));h(e,i)||(i-=1),h(e,r)||(r+=1);let l=(function(t){let e=[];for(let a of t.entities?.urls??[]){if(!a.indices)continue;let t=a.expanded_url||a.url,n=a.display_url||a.expanded_url||a.url;t&&n&&e.push({start:a.indices[0],end:a.indices[1],html:`<a href="${_(t)}">${_(n)}</a>`,text:n})}for(let a of t.entities?.user_mentions??[])a.indices&&a.screen_name&&e.push({start:a.indices[0],end:a.indices[1],html:`<a href="https://x.com/${encodeURIComponent(a.screen_name)}">@${_(a.screen_name)}</a>`,text:`@${a.screen_name}`});for(let a of t.entities?.hashtags??[])a.indices&&a.text&&e.push({start:a.indices[0],end:a.indices[1],html:`<a href="https://x.com/hashtag/${encodeURIComponent(a.text)}">#${_(a.text)}</a>`,text:`#${a.text}`});for(let a of t.entities?.media??[])a.indices&&e.push({start:a.indices[0],end:a.indices[1],html:"",text:""});return e})(t).filter(t=>t.start>=i&&t.end<=r&&h(e,t.start)&&h(e,t.end)).sort((t,e)=>e.start-t.start),o=[],s=[],d=r;for(let t of l)if(!(t.end>d)&&!(t.start<i)){if(t.end<d){let a=e.slice(t.end,d);o.unshift(_(a)),s.unshift(a)}o.unshift(t.html),s.unshift(t.text),d=t.start}if(d>i){let t=e.slice(i,d);o.unshift(_(t)),s.unshift(t)}return{html:o.join("").replace(/\n/g,"<br>").replace(/(?:<br>\s*)+$/g,"").trim(),text:s.join("").trim()}}function y(t,e="Media"){let a=t.mediaDetails??[];if(0===a.length)return{html:"",text:[],image:null};let i=[e],r=a.map((t,e)=>{let r=(0,n.selectXReaderVideoUrl)(t.video_info?.variants??[]),l=r?(0,n.xVideoPlaybackUrl)(r):null,o="animated_gif"===t.type?"GIF":"video"===t.type?"Video":"Image",s=`${o}${a.length>1?` ${e+1}`:""}`;i.push([s,t.ext_alt_text,r?`Video URL: ${r}`:null,t.media_url_https?`Image URL: ${t.media_url_https}`:null].filter(Boolean).join(" - "));let d=`${t.original_info?.width?` width="${t.original_info.width}"`:""}${t.original_info?.height?` height="${t.original_info.height}"`:""}`,u=t.media_url_https?`<img src="${_(t.media_url_https)}" alt="${_(t.ext_alt_text||o)}"${t.original_info?.width?` width="${t.original_info.width}"`:""}${t.original_info?.height?` height="${t.original_info.height}"`:""} loading="lazy">`:"",c=r&&l?`<video controls playsinline preload="metadata"${t.media_url_https?` poster="${_(t.media_url_https)}"`:""}${d} aria-label="${_(t.ext_alt_text||o)}" src="${_(l)}"><a href="${_(r)}">Open video</a></video>`:"",p=r?` - <a href="${_(r)}">Open video</a>`:"";return`<figure>${c||u}<figcaption>${_(s)}${t.ext_alt_text?`: ${_(t.ext_alt_text)}`:""}${p}</figcaption></figure>`}).join("");return{html:`<section data-smry-twitter-section="media"><h2>${_(e)}</h2>${r}</section>`,text:i,image:a.find(t=>t.media_url_https)?.media_url_https??null}}
1function v(t,e){return t.card?.binding_values?.[e]?.string_value??null}function b(t,e,a){let n=f(t),i=g(t,e),r=y(t,"Attached media"),l=x(t);return{html:`<section data-smry-twitter-section="${_(a.toLowerCase().replace(/\s+/g,"-"))}" data-smry-x-post-context><h2>${_(a)}</h2><blockquote data-smry-x-post-context-card>${n?`<p data-smry-x-context-author><strong>${_(n)}</strong></p>`:""}${l.html?`<p>${l.html}</p>`:""}${r.html}<p data-smry-x-context-link><a href="${_(i)}">Open post</a></p></blockquote></section>`,text:[a,n?`Post by ${n}`:null,l.text,...r.text].filter(t=>!!t),image:r.image}}t.s(["normalizeXPostSnapshot",0,m,"renderXPostSnapshot",0,function(t,e){var a;let n,i,r,l,o=f(t),s=t.user?.name||(t.user?.screen_name?`@${t.user.screen_name}`:"X user"),d=o?`Post by ${o}`:"X post",u=g(t,e),c=t.user?.profile_image_url_https?`<img data-smry-x-post-avatar src="${_(t.user.profile_image_url_https.replace(/_normal(?=\.[a-z0-9]+(?:\?|$))/i,"_x96"))}" alt="" width="48" height="48" loading="eager" referrerpolicy="no-referrer">`:`<span data-smry-x-post-avatar-fallback aria-hidden="true">${_(Array.from(s)[0]||"X")}</span>`,p=t.user?.screen_name?`https://x.com/${encodeURIComponent(t.user.screen_name)}`:null,m=t.user?.verified||t.user?.is_blue_verified||t.user?.verified_type,h=y(t),E=function(t){if(t.article){let e=t.article.rest_id?`https://x.com/i/article/${t.article.rest_id}`:null,a=t.article.title||"X Article",n=t.article.preview_text??null,i=t.article.cover_media?.media_info?.original_img_url??null;return{html:`<section data-smry-twitter-section="card"><h2>${_(a)}</h2>${i?`<figure><img src="${_(i)}" alt="" loading="lazy"></figure>`:""}${n?`<p>${_(n)}</p>`:""}${e?`<p><a href="${_(e)}">Open the X Article</a></p>`:""}</section>`,text:["X Article",a,n,e,i?`Image URL: ${i}`:null].filter(t=>!!t),image:i}}let e=t.card;if(!e)return{html:"",text:[],image:null};let a=e.binding_values??{};if(e.name?.startsWith("poll")){let t=[1,2,3,4].flatMap(t=>{let e=a[`choice${t}_label`]?.string_value;if(!e)return[];let n=a[`choice${t}_count`]?.string_value;return[{label:e,count:n&&/^\d+$/.test(n)?Number(n):null}]});if(!t.length)return{html:"",text:[],image:null};let e=t.map(t=>`${t.label}${null===t.count?"":` - ${t.count.toLocaleString("en-US")} votes`}`),n=a.is_final?.boolean_value===!0;return{html:`<section data-smry-twitter-section="poll"><h2>Poll</h2><ul>${t.map(t=>`<li>${_(t.label)}${null===t.count?"":` — ${t.count.toLocaleString("en-US")} votes`}</li>`).join("")}</ul>${n?"<p>Final results</p>":""}</section>`,text:["Poll",...e,...n?["final results"]:[]],image:null}}let n=v(t,"title"),i=v(t,"description"),r=v(t,"card_url")||v(t,"player_url"),l=v(t,"vanity_url")||v(t,"domain")||r,o=Object.values(a).find(t=>t.image_value?.url)?.image_value?.url??null;return n||i||r||o?{html:`<section data-smry-twitter-section="card"><h2>${_(n||"Link card")}</h2>${o?`<figure><img src="${_(o)}" alt="" loading="lazy"></figure>`:""}${i?`<p>${_(i)}</p>`:""}${r&&l?`<p><a href="${_(r)}">${_(l)}</a></p>`:""}</section>`,text:["Link card",n,i,l,o?`Image URL: ${o}`:null].filter(t=>!!t),image:o}:{html:"",text:[],image:null}}(t),w=t.parent?b(t.parent,u,"In reply to"):null,$=t.quoted_tweet?b(t.quoted_tweet,u,"Quoted post"):null,S=x(t),A=t.created_at&&!Number.isNaN(Date.parse(t.created_at))?new Date(t.created_at).toISOString():null,T=['<article data-smry-source="x-post">',`<h1 data-smry-x-post-sr-title>${_(d)}</h1>`,"<header data-smry-x-post-author>",p?`<a data-smry-x-post-avatar-link href="${_(p)}">${c}</a>`:`<span data-smry-x-post-avatar-link>${c}</span>`,`<div data-smry-x-post-author-copy><p data-smry-x-post-name>${p?`<a href="${_(p)}">${_(s)}</a>`:_(s)}${m?'<span data-smry-x-post-verified role="img" aria-label="Verified account">✓</span>':""}</p>${t.user?.screen_name?`<p data-smry-x-post-meta><a data-smry-x-post-handle href="${_(p||u)}">@${_(t.user.screen_name)}</a></p>`:""}</div>`,`<a data-smry-x-post-brand href="${_(u)}" aria-label="Open post on X">𝕏</a></header>`,S.html?`<div data-smry-x-post-text><p>${S.html}</p></div>`:"",h.html,E.html,w?.html??"",$?.html??"",(n=t.favorite_count,i=t.conversation_count,r=`https://x.com/intent/like?tweet_id=${encodeURIComponent(t.id_str)}`,l=`https://x.com/intent/tweet?in_reply_to=${encodeURIComponent(t.id_str)}`,"<footer data-smry-x-post-footer>"+(A?`<a data-smry-x-post-timestamp href="${_(u)}"><time datetime="${_(A)}">${_(A)}</time></a>`:"")+'<nav data-smry-x-post-actions aria-label="Post actions">'+`<a data-smry-x-post-action="like" href="${_(r)}" aria-label="${void 0===n?"Like this post on X":`Like. This post has ${n.toLocaleStr
1ing("en-US")} likes`}"><span aria-hidden="true" data-smry-x-post-action-icon>♡</span><span>${void 0===n?"Like":_(void 0===n?"":new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(n))}</span></a>`+`<a data-smry-x-post-action="reply" href="${_(l)}" aria-label="${void 0===i?"Reply to this post on X":`Reply. This post has ${i.toLocaleString("en-US")} replies`}"><span aria-hidden="true" data-smry-x-post-action-icon>↩</span><span>Reply</span></a>`+`<a data-smry-x-post-action="open" href="${_(u)}"><span aria-hidden="true" data-smry-x-post-action-icon>↗</span><span>Open on X</span></a>`+"</nav>"+(i&&i>0?`<a data-smry-x-post-replies href="${_(u)}">Read ${i.toLocaleString("en-US")} ${1===i?"reply":"replies"}</a>`:"")+"</footer>"),"</article>"].join(""),I=[d,S.text,...h.text,...E.text,...w?.text??[],...$?.text??[],`Open on X: ${u}`].filter(t=>!!t).join("\n\n");return{title:d,byline:o,siteName:"X",publishedTime:A,lang:t.lang??null,dir:(a=t.lang,a&&/^(ar|fa|he|ur)(?:-|$)/i.test(a)||/[\u0590-\u08ff]/.test(I)?"rtl":"ltr"),content:T,textContent:I,image:h.image||E.image||$?.image||null}}],376946);var E=t.i(21139),w=t.i(321521);function $(t,e,a){return null!=a||"upload"===t&&null!==(0,w.getCanonicalLocalFileUrl)(e??"")}t.s(["requiresPermanentLibraryDeletion",0,$],709133);var S=t.i(624017),A=t.i(640777);function T(t){let e=(0,E.getLibraryOwnerUserId)(t);if(!e)throw Error("library_account_required");return e}function I(t){return(0,E.getLibraryOwnerUserId)(t)??""}function N(t){return{id:t.id,url:t.url??"",originalUrl:t.original_url,title:t.title??"",domain:t.domain??"",contentKind:t.content_kind??void 0,contentKindMethod:t.content_kind_method??void 0,contentKindConfidence:t.content_kind_confidence??void 0,contentKindVersion:t.content_kind_version??void 0,contentKindUpdatedAt:t.content_kind_updated_at,captureMethod:t.capture_method??void 0,format:t.format??void 0,mimeType:t.mime_type,fileName:t.file_name,assetSize:t.asset_size,assetChecksum:t.asset_checksum,assetUpdatedAt:t.asset_updated_at,assetScanStatus:t.asset_scan_status??null,triageStatus:t.triage_status??"later",starredAt:t.starred_at??null,starUpdatedAt:t.star_updated_at??null,savedAt:t.saved_at??new Date().toISOString(),statusUpdatedAt:t.status_updated_at??t.saved_at??new Date().toISOString(),lastReadAt:t.last_read_at,readProgress:t.read_progress,articleStatus:t.article_status??null,articleStatusUpdatedAt:t.article_status_updated_at,source:t.source??"reader",integration:function(t){if(!t)return null;try{let e=JSON.parse(t),a=e?.integration;if(!a||"object"!=typeof a||Array.isArray(a))return null;let n=m(a.xPost);return{...a,...n?{xPost:n}:{xPost:void 0}}}catch{return null}}(t.metadata),tags:L(t.tags),tagsUpdatedAt:t.tags_updated_at,syncState:"idle"}}function R(t){return{id:t.id,url:t.article_url??"",title:t.article_title??"",domain:t.article_domain??"",savedAt:t.read_at??new Date().toISOString(),...t.is_pinned?{pinned:!0}:{}}}function L(t){if(!t)return[];try{return(0,a.normalizeLibraryTags)(JSON.parse(t))}catch{return[]}}function k(t){if(t?.()===!1)throw Error("library_owner_changed")}async function U(t,e,a){return e?t.writeTransaction(async t=>{k(e);let n=await a(t);return k(e),n}):a(t)}async function O(t,e,a){return(await t.getAll("SELECT * FROM library_items WHERE url = ? AND user_id = ? LIMIT 1",[e,a]))[0]??null}async function D(t,e,a,n,i,r,l){if(!e.content?.trim())return;let o=await t.getAll("SELECT id FROM articles WHERE url = ? AND user_id = ? LIMIT 1",[n,a]);o[0]?await t.execute(`UPDATE articles
2          SET title = ?, text_content = ?, domain = ?, cached_at = ?
3        WHERE id = ?`,[i,e.content,r||null,l,o[0].id]):await t.execute(`INSERT INTO articles
4       (id, user_id, url, title, text_content, domain, cached_at)
5     VALUES (?, ?, ?, ?, ?, ?, ?)`,[crypto.randomUUID(),a,n,i,e.content,r||null,l])}async function z(t,e,a=null,n){await U(t,n,async t=>{let i=(0,A.normalizeCacheUrl)(e.url),r=T(a),l=new Date().toISOString(),o=await O(t,i,r),s=(0,S.buildLibraryItemRecord)(e,o?N(o):void 0,l);k(n),o?await t.execute(`UPDATE library_items SET
6           url = ?, original_url = ?, title = ?, domain = ?,
7           content_kind = ?, content_kind_method = ?, content_kind_confidence = ?,
8           content_kind_version = ?, content_kind_updated_at = ?, capture_method = ?,
9           format = ?, mime_type = ?, file_name = ?, triage_status = ?,
10           status_updated_at = ?, source = ?, tags = ?, tags_updated_at = ?,
11           last_read_at = ?, read_progress = ?, article_status = ?,
12           article_status_updated_at = ?, saved_at = ?,
13           starred_at = ?, star_updated_at = ?,
14           updated_at = ?
15         WHERE id = ?`,[s.url,s.originalUrl??null,s.title,s.domain,s.contentKind??null,s.contentKindMethod??null,s.contentKindConfidence??null,s.contentKindVersion??null,s.contentKindUpdatedAt??null,s.captureMethod??null,s.format??null,s.mimeType??null,s.fileName??null,s.triageStatus,s.statusUpdatedAt,s.source,JSON.stringify(s.tags??[]),s.tagsUpdatedAt??null,s.lastReadAt??null,s.readProgress??null,s.articleStatus??null,s.articleStatusUpdatedAt??null,s.savedAt,s.starredAt??null,s.starUpdatedAt??null,l,o.id]):await t.execute(`INSERT INTO library_items
16           (id, user_id, url, original_url, title, domain, content_kind,
17            content_kind_method, content_kind_confidence, content_kind_version,
18            content_kind_updated_at, capture_method, format, mime_type, file_name,
19            triage_status, source, tags, tags_updated_at, read_progress, article_status,
20            article_status_updated_at, saved_at, status_updated_at, last_read_at,
21            starred_at, star_updated_at, updated_at)
22         VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,[crypto.randomUUID(),r,s.url,s.originalUrl??null,s.title,s.domain,s.contentKind??null,s.contentKindMethod??null,s.contentKindConfidence??null,s.contentKindVersion??null,s.contentKindUpdatedAt??null,s.captureMethod??null,s.format??null,s.mimeType??null,s.fileName??null,s.triageStatus,s.source,JSON.stringify(s.tags??[]),s.tagsUpdatedAt??null,s.readProgress??null,s.articleStatus??null,s.articleStatusUpdatedAt??null,s.savedAt,s.statusUpdatedAt,s.lastReadAt??null,s.starredAt??null,s.starUpdatedAt??null,l]),k(n),await D(t,e,r,s.url,s.title,s.domain,l)})}async function C(t,e,a,n=null,i){let r=T(n);return U(t,i,async t=>{let n=await O(t,(0,A.normalizeCacheUrl)(e),r);if(!n)return{previousStatus:null,existed:!1};let l=new Date().toISOString();
22return k(i),await t.execute("UPDATE library_items SET triage_status = ?, status_updated_at = ?, updated_at = ? WHERE id = ?",[a,l,l,n.id]),{previousStatus:n.triage_status??null,existed:!0}})}async function M(t,e,a,n=null,i){let r=T(n);return U(t,i,async t=>{let n=await O(t,(0,A.normalizeCacheUrl)(e),r);if(!n)return{existed:!1,wasStarred:!1};let l=new Date().toISOString();return k(i),await t.execute("UPDATE library_items SET starred_at = ?, star_updated_at = ?, updated_at = ? WHERE id = ?",[a?l:null,l,l,n.id]),{existed:!0,wasStarred:!!n.starred_at}})}async function F(t,e,n,i=null){let r=await O(t,(0,A.normalizeCacheUrl)(e),T(i));if(!r)return;let l=new Date().toISOString();await t.execute("UPDATE library_items SET tags = ?, tags_updated_at = ?, updated_at = ? WHERE id = ?",[JSON.stringify((0,a.normalizeLibraryTags)(n)),l,l,r.id])}async function P(t,e,n,i=[],r=null){let l=(0,a.normalizeLibraryTags)(n);if(0===l.length)return!0;let o=new Set((0,a.normalizeLibraryTags)(i)),s=(0,A.normalizeCacheUrl)(e);return t.writeTransaction(async t=>{let e=await t.getOptional("SELECT * FROM library_items WHERE user_id = ? AND url = ? LIMIT 1",[T(r),s]);if(!e)return!1;let n=L(e.tags),i=new Set(n),d=l.filter(t=>!o.has(t)||i.has(t)),u=(0,a.normalizeLibraryTags)([...n,...d]);if(u.length===n.length&&u.every((t,e)=>t===n[e]))return!0;let c=new Date().toISOString();return await t.execute("UPDATE library_items SET tags = ?, tags_updated_at = ?, updated_at = ? WHERE id = ?",[JSON.stringify(u),c,c,e.id]),!0})}async function j(t,a,n,i=null){let r=await O(t,(0,A.normalizeCacheUrl)(a),T(i));if(!r)return;let l=new Date().toISOString();await t.execute(`UPDATE library_items
23        SET content_kind = ?,
24            content_kind_method = 'user',
25            content_kind_confidence = 100,
26            content_kind_version = ?,
27            content_kind_updated_at = ?,
28            updated_at = ?
29      WHERE id = ?`,[n,e.CONTENT_KIND_CLASSIFIER_VERSION,l,l,r.id])}async function K(t,e,a=null){let n=(0,A.normalizeCacheUrl)(e),i=T(a),r=await O(t,n,i);if(!r)throw Error("library_item_missing");if($(r.capture_method,r.url,r.asset_size))throw Error("permanent_deletion_required");return await t.execute("DELETE FROM library_items WHERE id = ?",[r.id]),{settled:Promise.resolve(),undo:async()=>{await t.execute(`INSERT INTO library_items
30           (id, user_id, url, original_url, title, domain, content_kind,
31            content_kind_method, content_kind_confidence, content_kind_version,
32            content_kind_updated_at, capture_method, format, mime_type, file_name,
33            metadata, asset_size, asset_checksum, asset_updated_at, asset_scan_status,
34            triage_status, source, tags, tags_updated_at, read_progress,
35            article_status, article_status_updated_at, saved_at, status_updated_at,
36            last_read_at, starred_at, star_updated_at, updated_at)
37         VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,[r.id,r.user_id??i,r.url,r.original_url,r.title,r.domain,r.content_kind,r.content_kind_method,r.content_kind_confidence,r.content_kind_version,r.content_kind_updated_at,r.capture_method,r.format,r.mime_type,r.file_name,r.metadata,r.asset_size,r.asset_checksum,r.asset_updated_at,r.asset_scan_status,r.triage_status,r.source,r.tags,r.tags_updated_at,r.read_progress,r.article_status,r.article_status_updated_at,r.saved_at,r.status_updated_at,r.last_read_at,r.starred_at??null,r.star_updated_at??null,new Date().toISOString()])}}}async function W(t,e,a,n=null,i){let r=(0,E.getLibraryOwnerUserId)(n);return r&&Number.isFinite(a)?U(t,i,async t=>{let n=await O(t,(0,A.normalizeCacheUrl)(e),r);if(!n)return null;k(i);let l=new Date().toISOString(),o=Math.max(n.read_progress??0,Math.min(100,Math.max(0,Math.round(a))));return o===n.read_progress&&n.last_read_at?n:(await t.execute("UPDATE library_items SET read_progress = ?, last_read_at = ?, updated_at = ? WHERE id = ? AND user_id = ?",[o,l,l,n.id,r]),{...n,read_progress:o,last_read_at:l})}):null}async function H(t,e,a,n,i,r,l){await U(t,l,async t=>{let o=(0,A.normalizeCacheUrl)(e),s=I(r),d=await t.getAll("SELECT id, article_title FROM reading_history WHERE article_url = ? AND user_id = ? L
37IMIT 1",[o,s]);if(k(l),d.length>0){d[0].article_title!==a&&await t.execute("UPDATE reading_history SET article_title = ? WHERE id = ?",[a,d[0].id]);return}await t.execute(`INSERT INTO reading_history
38         (id, user_id, article_url, article_title, article_domain, device_id, read_at, progress, is_pinned)
39       VALUES (?, ?, ?, ?, ?, ?, ?, NULL, 0)`,[crypto.randomUUID(),s,o,a,n,i,new Date().toISOString()])})}async function X(t,e,a,n,i){await U(t,i,async t=>{await t.execute("UPDATE reading_history SET is_pinned = ? WHERE id = ? AND user_id = ?",[+!!a,e,I(n)])})}async function V(t,e,a,n){return U(t,n,async t=>{let i=I(a),r=(0,A.normalizeCacheUrl)(e.url),l=[i,e.id,r],o=await t.getAll("SELECT * FROM reading_history WHERE user_id = ? AND (id = ? OR article_url = ?)",l);return 0===o.length?[]:(k(n),await t.execute("DELETE FROM reading_history WHERE user_id = ? AND (id = ? OR article_url = ?)",l),o.map(R))})}async function q(t,e,a,n){await U(t,n,async t=>{let n=I(a);for(let a of e)await t.execute(`INSERT INTO reading_history
40           (id, user_id, article_url, article_title, article_domain, device_id, read_at, progress, is_pinned)
41         VALUES (?, ?, ?, ?, ?, NULL, ?, NULL, ?)`,[a.id,n,a.url,a.title,a.domain,a.savedAt,+!!a.pinned])})}t.s(["addLibraryItemTags",0,P,"deleteLibraryItem",0,K,"moveLibraryItem",0,C,"recordHistoryVisit",0,H,"removeHistoryEntry",0,V,"restoreHistoryEntries",0,q,"rowToHistoryRecord",0,R,"rowToLibraryItem",0,N,"setHistoryEntryPinned",0,X,"setLibraryItemContentKind",0,j,"setLibraryItemStarred",0,M,"setLibraryItemTags",0,F,"updateReadingProgress",0,W,"upsertLibraryItem",0,z],524042)},58307,t=>{"use strict";let e=["jpeg","jpg","png","webp","svg","gif","bmp"],a=["mp3","m4a","wav"],n=["txt","text","md","markdown","csv","tsv","rtf","srt","eml","pdf","docx","docm","doc","xlsx","xlsm","xlsb","xltx","xltm","xls","pptx","pptm","ppsx","ppsm","potx","potm","ppt","pps","pot","epub","odt","ods","odp","html","htm","xml","numbers","et",...e,...a],i=n.map(t=>`.${t}`),r=new Set(n),l=new Set(e),o=new Set(a),s=new Set(["epub"]),d=new Set(["eml"]),u=new Set(["docx","docm","doc","rtf","odt","html","htm","xml"]),c=new Set(["xlsx","xlsm","xlsb","xltx","xltm","xls","ods","csv","tsv","numbers","et"]),p=new Set(["pptx","pptm","ppsx","ppsm","potx","potm","ppt","pps","pot","odp"]);function m(t){let e=t.trim().toLowerCase().match(/\.([a-z0-9]+)$/)?.[1];return e&&r.has(e)?e:null}t.s(["AUDIO_FILE_EXTENSIONS",0,a,"IMAGE_FILE_EXTENSIONS",0,e,"MAX_PARSE_FILE_BYTES",0,0x1900000,"MAX_UPLOAD_FILE_BYTES",0,0x6400000,"PARSE_FILE_ACCEPT",0,{"application/octet-stream":i,"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.ms-word.document.macroenabled.12":[".docm"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx",".docm"],"application/vnd.ms-excel":[".xls",".xlsb",".xlsm",".xltm",".et"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx",".xltx"],"application/vnd.ms-powerpoint":[".ppt",".pps",".pot",".pptm",".ppsm",".potm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx",".ppsx",".potx"],"application/epub+zip":[".epub"],"message/rfc822":[".eml"],"application/vnd.oasis.opendocument.text":[".odt"],"application/vnd.oasis.opendocument.spreadsheet":[".ods"],"application/vnd.oasis.opendocument.presentation":[".odp"],"application/vnd.apple.numbers":[".numbers"],"application/xml":[".xml"],"text/html":[".html",".htm"],"text/xml":[".xml"],"image/jpeg":[".jpeg",".jpg"],"image/png":[".png"],"image/webp":[".webp"],"image/svg+xml":[".svg"],"image/gif":[".gif"],"image/bmp":[".bmp"],"audio/mpeg":[".mp3"],"audio/mp4":[".m4a"],"audio/x-m4a":[".m4a"],"audio/wav":[".wav"],"audio/x-wav":[".wav"],"text/*":[".txt",".text",".md",".markdown",".csv",".tsv",".rtf",".srt",".html",".htm",".xml"]},"PARSE_FILE_EXTENSIONS",0,n,"getDocumentCategory",0,function(t){return"pdf"===t?"pdf":"book"===t?"epub":"email"===t?"email":"note"},"getFileExtension",0,m,"getLocalFileKind",0,function(t){return"pdf"===t?"pdf":s.has(t)?"book":d.has(t)?"email":u.has(t)?"document":c.has(t)?"spreadsheet":p.has(t)?"presentation":l.has(t)?"image":o.has(t)?"audio":"text"},"getMaxParseFileBytes",0,function(t){return o.has(t)?0x6400000:0x1900000},"stripSupportedFileExtension",0,function(t){let e=m(t);return e?t.slice(0,-(e.length+1)).trim()||t:t.trim()||"Imported file"}])},340222,t=>{"use strict";var e=t.i(58307);let a={html:"document",pdf:"pdf",epub:"book",markdown:"text",plain_text:"text",document:"document",spreadsheet:"spreadsheet",presentation:"presentation",audio:"audio",video:null,unknown:null},n={article:null,website:null,book:"book",email:"email",pdf:"pdf",social_post:null,video:null,podcast_episode:null,document:"document",unknown:null};function i(t){let e=t?.split(";",1)[0]?.trim().toLowerCase()??"";return e?"application/pdf"===e?"pdf":"application/epub+zip"===e?"book":"message/rfc822"===e?"email":e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":"text/csv"===e||"text/tab-separated-values"===e||e.includes("spreadsheet")||e.includes("excel")?"spreadsheet":e.includes("presentation")||e.includes("powerpoint")?"presentation":e.includes("wordprocessing")||e.includes("msword")||e.includes("opendocument.text")?"document":"text/markdown"===e||"text/plain"===e||"application/rtf"===e?"text":"text/html"===e||"application/xml"===e||"text/xml"===e?"document":null:null}t.s(["getLibraryFileIconKind",0,function(t){var r,l;let o=t.fileName?.trim()??"";if(o){let l=(0,e.getFileExtension)(o);return l?(0,e.getLocalFileKind)(l):i(t.mimeType)??(t.format?a[t.format]:null)??((r=t.contentKind)?n[r]:null)??"document"}return"upload"===t.captureMethod?i(t.mimeType)??(t.format?a[t.format]:null)??((l=t.contentKind)?n[l]:null)??"document":"pdf"===t.contentKind?"pdf":"book"===t.contentKind?"book":"email"===t.contentKind?"email":null}])},267629,t=>{"use strict";let e;var a=t.i(271645);let n="smry.dashboard.firstPaint.",i=new Map;function r(){if(void 0!==e)return e;try{return window.localStorage}catch{return null}}let l=t=>`${n}${t}`;function o(t,e=r()){if(!t||!e)return null;let a=l(t);if(i.has(a))return i.get(a)??null;let n=null;try{let t=e.getItem(a);if(t){let e=JSON.parse(t);e?.version===2&&(n=e)}}catch{n=null}return i.set(a,n),n}function s(t){return t.metadata&&t.metadata.length>2e3?{...t,metadata:null}:t}function d(t,e,a=r()){if(!t||!a)return;let n=l(t),u=o(t,a),c={version:2,savedAt:new Date().toISOString(),counts:e.counts??u?.counts,historyCount:e.historyCount??u?.historyCount,views:{...u?.views}};e.view&&(c.views[e.view.status]={rows:e.view.rows.slice(0,24).map(s),total:e.view.total});try{a.setItem(n,JSON.stringify(c)),i.set(n,c)}catch{}}let u=new Map,c=null,p=new Set;function m(){for(let t of p)t()}function _(t){return p.add(t),()=>{p.delete(t)}}let f=()=>null;t.s(["clearDashboardSnapshots",0,function(t=r()){if(i.clear(),u.clear(),t){let e=[];for(let a=0;a<t.length;a+=1){let i=t.key(a);i?.startsWith(n)&&e.push(i)}for(let a of e)t.removeItem(a)}m()},"queueDashboardSnapshotWrite",0,function(t,e){if(!t)return;let a=u.get(t)??{views:new Map};e.counts&&(a.counts=e.counts),void 0!==e.historyCount&&(a.historyCount=e.historyCount),e.view&&a.views.set(e.view.status,e.view),u.set(t,a),null===c&&(c=setTimeout(()=>{c=null;let t=[...u.entries()];
41for(let[e,a]of(u.clear(),t))for(let t of(d(e,{counts:a.counts,historyCount:a.historyCount}),a.views.values()))d(e,{view:t});m()},400))},"usableSnapshotView",0,function(t,e){if(!t||!e)return null;let a=t.views?.[e];return a&&a.rows.length>0?a:null},"useDashboardSnapshot",0,function(t){return(0,a.useSyncExternalStore)(_,()=>o(t),f)}])},613798,t=>{"use strict";var e=t.i(50270),a=t.i(340830);let n=["x","youtube","reddit","github","instagram","tiktok","threads","bluesky","linkedin","web"],i=e.z.array(e.z.string().trim().min(1).max(253)),r={platforms:10,authors:30,media:3,sites:30,tags:30,kinds:10,formats:12,captureMethods:7,statuses:3,processing:3},l={platforms:e.z.array(e.z.enum(n)).max(r.platforms).optional(),authors:e.z.array(e.z.string().trim().min(1).max(500)).max(r.authors).optional(),media:e.z.array(e.z.enum(["image","video","audio"])).max(r.media).optional(),sites:i.max(r.sites).optional(),tags:i.max(r.tags).optional(),kinds:e.z.array(e.z.enum(a.LIBRARY_CONTENT_KINDS)).max(r.kinds).optional(),formats:e.z.array(e.z.enum(a.LIBRARY_CONTENT_FORMATS)).max(r.formats).optional(),captureMethods:e.z.array(e.z.enum(["reader","extension","upload","rss","email_inbox","api","import"])).max(r.captureMethods).optional(),statuses:e.z.array(e.z.enum(["later","archive"])).max(r.statuses).optional(),processing:e.z.array(e.z.enum(["pending","ready","failed"])).max(r.processing).optional()},o=e.z.object(l).strict(),s=Object.keys(l),d=e.z.object({...l,starred:e.z.boolean().optional(),hasNote:e.z.boolean().optional(),hasHighlight:e.z.boolean().optional(),hasTags:e.z.boolean().optional(),hasFile:e.z.boolean().optional(),read:e.z.boolean().optional(),after:e.z.string().datetime({offset:!0}).optional(),before:e.z.string().datetime({offset:!0}).optional(),exclude:o.optional()}).strict().refine(t=>!t.after||!t.before||Date.parse(t.after)<Date.parse(t.before),{message:"Start must precede end",path:["before"]}),u=t=>Array.isArray(t)?t.length>0:void 0!==t;e.z.object({facet:e.z.enum(["authors","sites","tags"]),query:e.z.string().trim().max(253)}
41).strict(),t.s(["EXCLUDABLE_FILTERS",0,s,"PALETTE_VALUE_LIMITS",0,r,"PaletteFilters",0,d,"SEARCH_PLATFORMS",0,n,"countPaletteFilters",0,function(t){return t?Object.entries(t).reduce((t,[e,a])=>t+("exclude"===e?Object.values(a??{}).filter(u).length:Number(u(a))),0):0},"excludedFilters",0,function(t){let e=t?.exclude;return e?Object.fromEntries(Object.entries(e).filter(([,t])=>u(t))):{}},"hasPaletteFilterTokens",0,function(t){return!!t&&Object.entries(t).some(([t,e])=>"exclude"===t?Object.values(e??{}).some(t=>void 0!==t):void 0!==e)},"hasPaletteFilters",0,function(t){return!!(t&&Object.entries(t).some(([t,e])=>"exclude"===t?Object.values(e??{}).some(u):u(e)))}])},3481,t=>{"use strict";let e=[{table:"library_items",indexed:["title","url","domain","tags","content_kind","capture_method","format","file_name","mime_type",{name:"source_topics",path:"metadata.integration.sourceTopics"}]},{table:"articles",indexed:["title","text_content"],unindexed:["url"]},{table:"highlights",indexed:["text","note"],unindexed:["article_url"]},{table:"notes",indexed:["title","body"],unindexed:["article_url","deleted_at"]},{table:"reading_history",indexed:["article_title","article_url","article_domain"]}],a=t=>"string"==typeof t?t:t.name,n=t=>[...t.unindexed??[],...t.indexed];function i(t,e){return e.map(e=>`json_extract(${t}.data, '$.${"string"==typeof e?e:e.path}')`).join(", ")}function r(t){let e=["id UNINDEXED",...(t.unindexed??[]).map(t=>`${t} UNINDEXED`),...t.indexed.map(a)].join(", ");return`CREATE VIRTUAL TABLE fts_${t.table} USING fts5(${e}, tokenize='unicode61 remove_diacritics 2')`}function l(t,e){let a=[e,`local_${e}`].map(e=>t.get(e)).find(t=>t?.viewName===e);if(!a)throw Error(`No active table for FTS source "${e}"`);return a}function o(t){let a=new Map(t.schema.tables.map(t=>[t.name,t]));return{byName:a,fingerprint:e.map(t=>l(a,t.table).internalName).join("\0")}}async function s(t){for(let s=0;s<3;s+=1){let s=o(t),d=new Map((await t.getAll(`SELECT name, sql FROM sqlite_master
42           WHERE type IN ('table', 'trigger') AND name LIKE 'fts_%'`)).map(t=>[t.name,t.sql??""])),u=e.filter(t=>{let e=`fts_${t.table}`,a=l(s.byName,t.table);return d.get(e)!==r(t)||["ai","au","ad"].some(t=>{let n=d.get(`${e}_${t}`);return!n||!n.includes(` ON ${a.internalName} `)})});if(u.length>0&&await t.writeTransaction(async t=>{for(let e of u){let o=l(s.byName,e.table),d=`fts_${e.table}`,u=o.internalName,c=n(e),p=c.map(a).join(", ");for(let e of["ai","au","ad"])await t.execute(`DROP TRIGGER IF EXISTS ${d}_${e}`);await t.execute(`DROP TABLE IF EXISTS ${d}`),await t.execute(r(e)),await t.execute(`INSERT INTO ${d}(rowid, id, ${p})
43             SELECT rowid, id, ${i("t",c)} FROM ${u} t`),await t.execute(`CREATE TRIGGER ${d}_ai AFTER INSERT ON ${u} BEGIN
44               INSERT INTO ${d}(rowid, id, ${p})
45               VALUES (NEW.rowid, NEW.id, ${i("NEW",c)});
46             END`),await t.execute(`CREATE TRIGGER ${d}_au AFTER UPDATE ON ${u} BEGIN
47               DELETE FROM ${d} WHERE rowid = OLD.rowid;
48               INSERT INTO ${d}(rowid, id, ${p})
49               VALUES (NEW.rowid, NEW.id, ${i("NEW",c)});
50             END`),await t.execute(`CREATE TRIGGER ${d}_ad AFTER DELETE ON ${u} BEGIN
51               DELETE FROM ${d} WHERE rowid = OLD.rowid;
52             END`)}}),o(t).fingerprint===s.fingerprint)return}throw Error("FTS schema changed repeatedly during configuration")}t.s(["configureFts",0,s,"toMatchQuery",0,function(t){let e=t.replace(/["^*:()]/g," ").split(/\s+/).filter(Boolean);return!e.length||t.trim().length<2?null:e.map((t,a)=>a===e.length-1?`"${t}"*`:`"${t}"`).join(" AND ")}])}]);
53
54//# chunkId=0cc7cbe3-fbd5-5d9a-9b64-5ef65966350b

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.