@banou/ftube 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +44 -2
- package/__yt_engine__/engine.html +9 -0
- package/app.webmanifest +31 -0
- package/assets/account-BL8Hv7lS.js +157 -0
- package/assets/account-By94iboj.js +1 -0
- package/assets/account-DfiXzypA-YE6OyKjK.js +1 -0
- package/assets/account-generation-BP_-Qyck-BOth6YQ_.js +1 -0
- package/assets/agent-source-E4g0cDzU.js +1 -0
- package/assets/api-1NDCtwel-CAaxX8P1.js +3 -0
- package/assets/binary-encoding-By5K7InN.js +1 -0
- package/assets/build-CNn3bm6X.js +1 -0
- package/assets/busy-C1JPjoZ_-CJ0641jK.js +1 -0
- package/assets/cards-Csel8naI.js +2334 -0
- package/assets/channel-B5f9YTIf.js +1160 -0
- package/assets/client-version-D9kIz6Gz.js +1 -0
- package/assets/comments-CJp9O808.js +612 -0
- package/assets/dislikes-DH5jCVEY.js +1 -0
- package/assets/dist-7VpLCl1k.js +1 -0
- package/assets/dist-BOrL1gYg.js +2 -0
- package/assets/downloads-CMXDjA_E.js +191 -0
- package/assets/egress.worker-DopXr5uP.js +104 -0
- package/assets/engine-B_kFyW7L.js +2 -0
- package/assets/feed-channels-Dg2mvF5x.js +251 -0
- package/assets/feed-groups-CnyR4sOO.js +160 -0
- package/assets/feed-history-BDAGG9N5.js +368 -0
- package/assets/feed-playlists-DcGR2AL6.js +167 -0
- package/assets/feed-subscriptions-Sm3tKz4P.js +165 -0
- package/assets/feed-you-lxbqknXX.js +110 -0
- package/assets/formats-CDwXfKnr.js +1 -0
- package/assets/frame-BrGNSf3s.js +2 -0
- package/assets/fs-CjRTQ7Nu.js +1 -0
- package/assets/fs-CwRtKje1-CBsYhX2-.js +1 -0
- package/assets/fullscreen-view-BLgosU84.js +269 -0
- package/assets/group-C00s0aT7.js +183 -0
- package/assets/groups-button-CvVnqwlu.js +25 -0
- package/assets/hashtag-CCIhITaL.js +115 -0
- package/assets/icons-DKsqNLSs.js +1 -0
- package/assets/index-A5dHbptn.css +1 -0
- package/assets/index-DwsYJ-bu.js +1328 -0
- package/assets/lib-h0P14ZFl.js +70 -0
- package/assets/linkify-B6hdFhsL.js +1 -0
- package/assets/packages-C3w3tSjj-BCtDk0vj.js +1 -0
- package/assets/party-CUcxsJDF.js +180 -0
- package/assets/playlist-DF7wsidw.js +521 -0
- package/assets/playlist-card-Btoc7D8f.js +91 -0
- package/assets/playlist-panel-D97BwT1f.js +199 -0
- package/assets/post-CQ9mfVos.js +39 -0
- package/assets/post-card-ZUQixO1G.js +76 -0
- package/assets/privacy-hkbqXFeB.js +46 -0
- package/assets/protobuf-BXZ2dCCc.js +1 -0
- package/assets/read-more-BhddUSlS.js +20 -0
- package/assets/rich-text-07paR5O3.js +25 -0
- package/assets/roboto-cyrillic-ext-BCp_3N7R.woff2 +0 -0
- package/assets/roboto-cyrillic-fOt7epNf.woff2 +0 -0
- package/assets/roboto-greek-DlT9XTxE.woff2 +0 -0
- package/assets/roboto-greek-ext-Bgw4czJT.woff2 +0 -0
- package/assets/roboto-latin-ccAYIvAh.woff2 +0 -0
- package/assets/roboto-latin-ext-DYIxWhlt.woff2 +0 -0
- package/assets/roboto-math-4a3xuzGk.woff2 +0 -0
- package/assets/roboto-symbols-B7iHSfaG.woff2 +0 -0
- package/assets/roboto-vietnamese-_f1XEJpo.woff2 +0 -0
- package/assets/rooms-B-AvBY-c-FNDqRDHE.js +1 -0
- package/assets/rooms-B91zuirR.js +1 -0
- package/assets/save-menu-DF1WKqSE.js +462 -0
- package/assets/search-Cx5IpDtZ.js +1026 -0
- package/assets/settings-kESE_uBm.js +99 -0
- package/assets/shaka-BwT9pJcV.js +36 -0
- package/assets/share-dialog-Cp0BJ6bg.js +156 -0
- package/assets/shorts-BxDB7m0c.js +686 -0
- package/assets/shorts-grid-Bgbkl5dP.js +11 -0
- package/assets/sign-in-Bx3zmj-m.js +97 -0
- package/assets/signed-out-prompt-CEAx65kq.js +79 -0
- package/assets/signin-DkI8Ogzz.js +18 -0
- package/assets/social-bXt3vmd4.js +1 -0
- package/assets/video-card-compact-r-K4XyDb.js +190 -0
- package/assets/watch-CkxSP1IA.js +1802 -0
- package/assets/web-BNanCsH5.js +43 -0
- package/favicon.ico +0 -0
- package/favicon.svg +5 -0
- package/icons/icon-192.png +0 -0
- package/icons/icon-512.png +0 -0
- package/index-Bj-Q3X8Q.js +4120 -0
- package/index.html +32 -0
- package/package.json +45 -4
- package/store/background.webp +0 -0
- package/store/channel.webp +0 -0
- package/store/cover.webp +0 -0
- package/store/phone.webp +0 -0
- package/store/search.webp +0 -0
- package/store/watch.webp +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/frame-BrGNSf3s.js","assets/dist-BOrL1gYg.js","assets/build-CNn3bm6X.js","assets/formats-CDwXfKnr.js","assets/binary-encoding-By5K7InN.js","assets/web-BNanCsH5.js","assets/client-version-D9kIz6Gz.js","assets/protobuf-BXZ2dCCc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{D as e,N as t,S as n,a as r,d as i,h as a,j as o,k as s,u as c,w as l,x as u}from"./build-CNn3bm6X.js";var d=5e3,f,p=0,m=new Map,h=e=>{f?.close();for(let e of m.values())e.reject(Error(`yt-client agent: the bridge to the FKN page was replaced`));m.clear(),e.addEventListener(`message`,e=>{let t=e.data,n=m.get(t.id);n&&(m.delete(t.id),t.error===void 0?n.resolve(t.result):n.reject(Error(t.error)))}),e.start(),f=e},g=()=>Error(`yt-client agent: the FKN page is not connected`),_=(e,t,n,{timeoutMs:r,signal:i}={})=>new Promise((a,o)=>{if(i?.aborted){o(i.reason);return}let s=++p,c=t=>{m.delete(s)&&(e.postMessage({type:`cancel`,id:s}),o(t))},l=r===void 0?void 0:setTimeout(()=>c(Error(`yt-client agent: ${t} timed out after ${r} ms`)),r),u=()=>c(i.reason);i?.addEventListener(`abort`,u,{once:!0});let d=()=>{clearTimeout(l),i?.removeEventListener(`abort`,u)};m.set(s,{resolve:e=>{d(),a(e)},reject:e=>{d(),o(e)}}),e.postMessage({id:s,method:t,args:n})}),v=()=>{let e=f;if(e)return Object.fromEntries(a.map(t=>[t,(...n)=>_(e,t,n,{timeoutMs:d})]))},ee=async(e,t,n)=>{if(!f)throw g();return await _(f,`fetch`,[e,t],{signal:n})},te=async(e=d)=>{if(!f)throw g();return await _(f,`cookie`,[],{timeoutMs:e})},y=e=>{f?.postMessage({type:`report`,...e})},b=()=>{},x=new Promise(e=>{b=e}),S=new Map,C=0,w=e=>{e.addEventListener(`message`,e=>{let t=e.data,n=S.get(t.id);if(!n){t.response?.body?.cancel();return}S.delete(t.id),t.error?n.reject(Error(t.error)):n.resolve(t.response)}),e.start(),b(e)},T=e=>e?.reason??new DOMException(`The operation was aborted`,`AbortError`),E=async(e,t,n)=>{let r=await x;if(n?.aborted)throw T(n);let i=++C,a,o,s=!1,c=()=>{if(s)return;s=!0;let e=T(n);r.postMessage({type:`cancel`,id:i});let t=S.get(i);S.delete(i),t?.reject(e),o&&o.error(e),a?.cancel(e).catch(()=>{})};n?.addEventListener(`abort`,c,{once:!0});let l=await new Promise((n,a)=>{S.set(i,{resolve:n,reject:a});let o={type:`fetch`,id:i,url:e,options:t};r.postMessage(o,t.body?[t.body]:[])});if(n?.aborted)throw c(),T(n);if(!l.body)return n?.removeEventListener(`abort`,c),new Response(null,{status:l.status,statusText:l.statusText,headers:l.headers});a=l.body.getReader();let u=new ReadableStream({start(e){o=e},async pull(e){try{let t=await a.read();if(s)return;t.done?(n?.removeEventListener(`abort`,c),e.close()):e.enqueue(Uint8Array.from(t.value))}catch(t){s||e.error(t)}},async cancel(e){n?.removeEventListener(`abort`,c),s||(s=!0,r.postMessage({type:`cancel`,id:i})),await a?.cancel(e).catch(()=>{})}});return new Response(u,{status:l.status,statusText:l.statusText,headers:l.headers})},D=e=>{let t=0,n=new Map;return e.addEventListener(`message`,e=>{let t=e.data,r=n.get(t.id);r&&(n.delete(t.id),t.error?r.reject(Error(t.error)):r.resolve(t.response??null))}),e.start(),(r,i,a)=>new Promise((o,s)=>{if(a?.aborted){s(a.reason);return}let c=++t;n.set(c,{resolve:o,reject:s}),a?.addEventListener(`abort`,()=>{n.delete(c)&&(e.postMessage({type:`cancel`,id:c}),s(a.reason))},{once:!0}),e.postMessage({type:`fetch`,id:c,url:r,options:i})})},O=(e,{extFetch:t,remote:n,prefix:r})=>{let i=new Map;e.addEventListener(`message`,a=>{let o=a.data,s=`${r}:${o.id}`;if(o.type===`cancel`){i.get(o.id)?.abort(),i.delete(o.id),n.then(e=>e.cancelLibcurlFetch(s)).catch(()=>{});return}let c=new AbortController;i.set(o.id,c),(async()=>await t(o.url,o.options,c.signal)||(await n).libcurlFetch(s,o.url,o.options))().then(t=>{i.delete(o.id),e.postMessage({id:o.id,response:t},t.body?[t.body]:[])},t=>{i.delete(o.id),e.postMessage({id:o.id,error:t instanceof Error?t.message:String(t)})})}),e.start()},k=(e={},t=navigator.languages)=>Object.keys(e).some(e=>e.toLowerCase()===`accept-language`)?{...e}:{...e,"accept-language":t.map((e,t)=>t===0?e:`${e};q=${Math.max(.1,1-t*.1).toFixed(1)}`).join(`,`)},ne=3e5,A=`https://www.youtube.com`,j=/(^|\.)youtube\.com$/,M=(e,t,n)=>{let r;try{r=new URL(e)}catch{return`media`}return r.protocol!==`https:`||!j.test(r.hostname)?`media`:r.hostname===`www.youtube.com`&&(t===`GET`&&r.pathname===`/api/timedtext`||!n&&t===`POST`&&r.pathname.startsWith(`/youtubei/v1/`))?`direct`:n?`session`:`catalog`},N=e=>{try{return new URL(e).pathname.startsWith(`/youtubei/v1/`)}catch{return!1}},P=(e,t,n)=>({method:e,...e===`POST`&&{headers:{"content-type":`text/plain;charset=UTF-8`},body:t??``},credentials:`omit`,mode:`cors`,redirect:`follow`,signal:n}),re=(e,t)=>{if(!t)return e;try{let n=JSON.parse(e),r=n?.context?.client;return!r||typeof r!=`object`||r.visitorData?e:(r.visitorData=t,JSON.stringify(n))}catch{return e}},ie=[101,204,205,304],F=({status:e,statusText:t,headers:n,body:r})=>ie.includes(e)?(r instanceof ReadableStream&&r.cancel().catch(()=>{}),new Response(null,{status:e,statusText:t,headers:n})):new Response(r,{status:e,statusText:t,headers:n}),I=new TextEncoder,L=async(e,t)=>{let n=e instanceof Request?e:void 0,r=e instanceof Request?e.url:e instanceof URL?e.href:e,i=(t?.method??n?.method??`GET`).toUpperCase(),a=Object.fromEntries(new Headers(t?.headers??n?.headers)),o=t?.body??(n&&i!==`GET`&&i!==`HEAD`?await n.clone().arrayBuffer():void 0),s=typeof o==`string`?o:void 0;return{url:r,method:i,headers:a,body:o==null?void 0:s===void 0?await new Response(o).arrayBuffer():I.encode(s).buffer,text:s,signal:t?.signal??n?.signal??void 0}},R=({signedIn:e,direct:t,catalog:n,session:r,media:i,report:a,now:o=Date.now})=>{let s=0,c,l=e=>{e!==c&&(c=e,a(e))},u=e?r:n;return async(n,r)=>{let{url:a,method:c,headers:d,body:f,text:p,signal:m}=await L(n,r),h={method:c,headers:d,body:f},g=M(a,c,e);if(g===`media`)return i(a,h,m);if(g!==`direct`||!t||c===`POST`&&p===void 0)return N(a)&&(e||!t)&&l(`off`),u(a,h,m);if(o()<s)return u(a,h,m);try{let e=await t(a,c===`POST`?P(`POST`,re(p,d[`x-goog-visitor-id`]),m):P(`GET`,void 0,m));return N(a)&&l(`on`),e}catch(e){if(m?.aborted||e?.name!==`TypeError`)throw e;let t=await u(a,h,m);return t.ok&&(s=o()+ne,l(`skipped`),console.warn(`[yt-client] a direct YouTube request failed and the lane behind it answered, so direct requests pause for 5 minutes:`,String(e.message))),t}}},z=({extFetch:e,relayFetch:t})=>async(n,{method:r,headers:i,body:a},o)=>{let s={method:r,headers:k({...i,referer:`${A}/`,...r===`GET`||r===`HEAD`?{}:{origin:A}}),body:a??null,redirect:`follow`},c=await e(n,s,o)??await t(n,s);if(o?.aborted)throw c.body?.cancel().catch(()=>{}),o.reason;return F(c)},B=`https://www.youtube.com/youtubei/v1/account/accounts_list`,V=/"loggedOut"\s*:\s*true/,H=`/api/stats/playback`,U=new Set([`s.youtube.com`,`www.youtube.com`]),W=e=>{let t;try{t=new URL(e)}catch{return e}return!U.has(t.hostname)||t.pathname!==H?e:(t.hostname=`www.youtube.com`,t.href)},G=e=>e.startsWith(`https://www.youtube.com/youtubei/`)||e.startsWith(`https://www.youtube.com${H}`),K=e=>Array.isArray(e)?e.flatMap(K):!e||typeof e!=`object`?[]:Object.entries(e).flatMap(([e,t])=>e===`accountItem`?[t]:K(t)),q=(e,t)=>{let n;try{n=K(JSON.parse(e))}catch{return!1}return n.length>0&&!n.some(e=>e.isSelected&&e.serviceEndpoint?.selectActiveIdentityEndpoint?.supportedTokens?.some(e=>e.pageIdToken?.pageId===t))},J=(e,t,r)=>{let i=r,a=e=>{i=void 0,n(e)},o=async(t,n,r)=>{let i=await e(t,n,r);return{answer:i,text:t.startsWith(B)?new TextDecoder().decode(i.body):void 0}};return async(e,n,r)=>{let s=W(e),c=i!==void 0&&l()===i&&G(s)?i:void 0,{answer:u,text:d}=c?await o(s,{...n,headers:{...n.headers,"x-goog-pageid":c}},r):await o(s,n,r);return d!==void 0&&c&&(V.test(d)?(a(c),{answer:u,text:d}=await o(s,n,r)):q(d,c)&&a(c)),d!==void 0&&V.test(d)&&t(),F(u)}},Y={fetch:(e,t)=>globalThis.fetch(e,t),anonymousFetch:(e,t)=>globalThis.fetch(e,t),cookie:void 0,signedOut:!1},ae=/(?:^|;\s*)SAPISID=/,oe=async e=>{let t;try{t=await e()}catch{return{signedOut:!1}}return ae.test(t)?{cookie:t,signedOut:!1}:{signedOut:!0}},se=3e4,ce=3e4,X=e=>{document.documentElement.dataset.stage=e},Z=(e,t=[])=>window.parent.postMessage(e,location.origin,t),Q,le=new Promise((e,n)=>{let r=setTimeout(()=>n(Error(`yt-client: engine bootstrap ports never arrived`)),se),a=t=>{if(t.origin!==location.origin||t.source!==window.parent)return;let o=t.data;if(o?.type!==`yt-client-host-bootstrap`)return;if(window.removeEventListener(`message`,a),clearTimeout(r),Q=o.attempt,o.build!==i()){for(let e of t.ports)e.close();n(Error(c));return}let[s,l,u]=t.ports;if(!s||!l||!u){n(Error(`yt-client: engine bootstrap ports are missing`));return}e({egress:s,extFetch:l,agent:u,signedIn:o.signedIn===!0,direct:o.direct!==!1,attempt:o.attempt})};window.addEventListener(`message`,a),Z({type:t,build:i()})}),$=e=>e===void 0?{}:{attempt:e};(async()=>{X(`bootstrap`);let{egress:t,extFetch:n,agent:i,signedIn:a,direct:c,attempt:d}=await le;t.start();let f=r({},{key:s,transport:{receive:t,emit:t}}),p=D(n),m=new MessageChannel;O(m.port2,{extFetch:p,remote:f,prefix:`frame:${crypto.randomUUID().slice(0,8)}`}),w(m.port1),h(i),window.addEventListener(`pagehide`,()=>{for(let e of[t,n,m.port1,m.port2,i])e.close()},{once:!0}),X(`session`);let g=a?await oe(()=>te(ce)):{signedOut:!1};g.signedOut&&u(),Y.cookie=g.cookie;let _=c?(e,t)=>fetch(e,t):void 0,v=z({extFetch:p,relayFetch:async(e,t)=>(await f).fknFetch(e,t)}),b=(e,{method:t,headers:n,body:r},i)=>E(e,{method:t,headers:n,body:r??null,redirect:`follow`},i);Y.fetch=R({signedIn:g.cookie!==void 0,direct:_,catalog:v,session:J(ee,()=>{Y.signedOut=!0,u()},g.cookie===void 0?void 0:l()),media:b,report:e=>y({direct:e})}),Y.anonymousFetch=R({signedIn:!1,direct:_,catalog:v,session:v,media:b,report:()=>{}}),X(`engine`);let{connect:x}=await e(async()=>{let{connect:e}=await import(`./frame-BrGNSf3s.js`);return{connect:e}},__vite__mapDeps([0,1,2,3,4,5,6,7])),S=e=>{let t=new MessageChannel,n=x(t.port1);return Z({type:o,signedIn:Y.cookie!==void 0,...$(e)},[t.port2]),n},C=S(d);window.addEventListener(`message`,e=>{if(e.origin!==location.origin||e.source!==window.parent)return;let t=e.data;if(t?.type!==`yt-client-host-restart`)return;C();let[n]=e.ports;if(!n||t.signedIn!==a){for(let t of e.ports)t.close();Z({type:o,error:`yt-client: the engine frame booted on another jar`,...$(t.attempt)});return}h(n),C=S(t.attempt)}),X(`ready`)})().catch(e=>{X(`error`),Z({type:o,error:e instanceof Error?e.message:String(e),...$(Q)})});export{y as i,E as n,v as r,Y as t};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import{Dt as e,in as t,on as n,sn as r}from"./icons-DKsqNLSs.js";import{D as i,c as a,d as o,g as s,k as c,ot as l,s as u,t as d,y as f}from"./sign-in-Bx3zmj-m.js";import{K as p,Y as m,bn as h,rn as g,vn as _}from"./cards-Csel8naI.js";import{L as v,P as y,R as b,n as x}from"../index-Bj-Q3X8Q.js";import{t as S}from"./groups-button-CvVnqwlu.js";r();var C=864e5,w={"7d":7,"30d":30,"90d":90,"365d":365},T={k:1e3,m:1e6,b:1e9},E=e=>{if(!e)return;let t=e.replace(/,/g,``).match(/(\d+(?:\.\d+)?)\s*([kmb])?\b/i);if(!t)return;let n=Number(t[1]);if(!Number.isFinite(n))return;let r=t[2]?T[t[2].toLowerCase()]??1:1;return Math.round(n*r)},D=e=>{if(!e)return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t},O=(e,{query:t,groupId:n,groups:r,activity:i,sort:a,lastUploadAt:o,now:s=Date.now()})=>{let c=t.trim().toLowerCase(),l=n===`ungrouped`?new Set(r.flatMap(e=>e.channels.map(e=>e.id))):void 0,u=n!==`all`&&n!==`ungrouped`?new Set(y(r,n).map(e=>e.id)):void 0,d=e.filter(e=>{if(c&&!`${e.name} ${e.handle??``} ${e.description??``}`.toLowerCase().includes(c)||l&&l.has(e.id)||u&&!u.has(e.id))return!1;if(i!==`all`){let t=o[e.id];if(t===void 0)return!1;let n=D(t);if(i===`inactive-365d`){if(n!==void 0&&s-n<365*C)return!1}else if(n===void 0||s-n>w[i]*C)return!1}return!0});if(a==="default")return d;let f=[...d];if(a===`name-asc`)return f.sort((e,t)=>e.name.localeCompare(t.name));if(a===`name-desc`)return f.sort((e,t)=>t.name.localeCompare(e.name));if(a===`subscribers`)return f.sort((e,t)=>(E(t.subscriberCountText)??-1)-(E(e.subscriberCountText)??-1));let p=a===`latest-upload`?-1:1;return f.sort((e,t)=>{let n=D(o[e.id]),r=D(o[t.id]);return n===void 0&&r===void 0?0:n===void 0?1:r===void 0?-1:(n-r)*p})},k=s(`
|
|
2
|
+
query AllSubscribedChannels {
|
|
3
|
+
subscribedChannels(all: true) {
|
|
4
|
+
id
|
|
5
|
+
name
|
|
6
|
+
avatar
|
|
7
|
+
handle
|
|
8
|
+
subscriberCountText
|
|
9
|
+
videoCountText
|
|
10
|
+
description
|
|
11
|
+
isSubscribed
|
|
12
|
+
notificationLevel
|
|
13
|
+
isVerified
|
|
14
|
+
isVerifiedArtist
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`),A=s(`
|
|
18
|
+
query ChannelLastUpload($channelId: ID!) {
|
|
19
|
+
channelUploads(channelId: $channelId) {
|
|
20
|
+
id
|
|
21
|
+
publishedAt
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`),j=l`
|
|
25
|
+
max-width: 108rem;
|
|
26
|
+
padding: 2.4rem 1.6rem;
|
|
27
|
+
|
|
28
|
+
.head {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
gap: 1.2rem;
|
|
34
|
+
margin-bottom: 2rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.heading {
|
|
38
|
+
margin: 0;
|
|
39
|
+
font-size: 2rem;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
line-height: 2.8rem;
|
|
42
|
+
color: var(--text-primary);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.count {
|
|
46
|
+
font-size: 1.3rem;
|
|
47
|
+
color: var(--text-secondary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.controls {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 0.8rem 1.2rem;
|
|
55
|
+
margin-bottom: 2rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.search {
|
|
59
|
+
flex: 1 1 22rem;
|
|
60
|
+
height: 3.6rem;
|
|
61
|
+
padding: 0 1.2rem;
|
|
62
|
+
border: 1px solid var(--border-strong);
|
|
63
|
+
border-radius: 0.8rem;
|
|
64
|
+
background: var(--bg-input);
|
|
65
|
+
color: var(--text-primary);
|
|
66
|
+
font-size: 1.4rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.search:focus {
|
|
70
|
+
outline: none;
|
|
71
|
+
border-color: var(--accent-focus);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.select {
|
|
75
|
+
height: 3.6rem;
|
|
76
|
+
padding: 0 1.2rem;
|
|
77
|
+
border: 1px solid var(--border-strong);
|
|
78
|
+
border-radius: 0.8rem;
|
|
79
|
+
background: var(--bg-input);
|
|
80
|
+
color: var(--text-primary);
|
|
81
|
+
font: inherit;
|
|
82
|
+
font-size: 1.3rem;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.check-dates {
|
|
87
|
+
height: 3.6rem;
|
|
88
|
+
padding: 0 1.4rem;
|
|
89
|
+
border: none;
|
|
90
|
+
border-radius: 1.8rem;
|
|
91
|
+
background: var(--bg-chip);
|
|
92
|
+
color: var(--text-primary);
|
|
93
|
+
font-size: 1.3rem;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
transition: background 0.15s ease;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.check-dates:hover:not(:disabled) {
|
|
100
|
+
background: var(--bg-chip-hover);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.check-dates:disabled {
|
|
104
|
+
opacity: 0.6;
|
|
105
|
+
cursor: default;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.list {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.row {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: 1.6rem;
|
|
117
|
+
padding: 1.4rem 0;
|
|
118
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.avatar-link {
|
|
122
|
+
flex: none;
|
|
123
|
+
width: 7.2rem;
|
|
124
|
+
height: 7.2rem;
|
|
125
|
+
border-radius: 50%;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
background: var(--bg-chip);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.avatar-link img {
|
|
131
|
+
display: block;
|
|
132
|
+
width: 100%;
|
|
133
|
+
height: 100%;
|
|
134
|
+
object-fit: cover;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.avatar-link.fallback {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
font-size: 2.8rem;
|
|
142
|
+
font-weight: 500;
|
|
143
|
+
color: var(--text-primary);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.info {
|
|
147
|
+
flex: 1;
|
|
148
|
+
min-width: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.name {
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
max-width: 100%;
|
|
155
|
+
font-size: 1.6rem;
|
|
156
|
+
font-weight: 500;
|
|
157
|
+
line-height: 2.2rem;
|
|
158
|
+
color: var(--text-primary);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.name-text {
|
|
162
|
+
min-width: 0;
|
|
163
|
+
overflow: hidden;
|
|
164
|
+
text-overflow: ellipsis;
|
|
165
|
+
white-space: nowrap;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.meta {
|
|
169
|
+
margin-top: 0.2rem;
|
|
170
|
+
font-size: 1.2rem;
|
|
171
|
+
color: var(--text-secondary);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.description {
|
|
175
|
+
margin: 0.4rem 0 0;
|
|
176
|
+
font-size: 1.2rem;
|
|
177
|
+
line-height: 1.8rem;
|
|
178
|
+
color: var(--text-secondary);
|
|
179
|
+
display: -webkit-box;
|
|
180
|
+
-webkit-line-clamp: 2;
|
|
181
|
+
-webkit-box-orient: vertical;
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.actions {
|
|
186
|
+
flex: none;
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
gap: 0.8rem;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.notice {
|
|
193
|
+
padding: 2.4rem 0;
|
|
194
|
+
font-size: 1.4rem;
|
|
195
|
+
color: var(--text-secondary);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.card {
|
|
199
|
+
max-width: 56rem;
|
|
200
|
+
margin: 4.8rem auto 0;
|
|
201
|
+
padding: 2.4rem;
|
|
202
|
+
border-radius: 1.2rem;
|
|
203
|
+
background: var(--bg-subtle);
|
|
204
|
+
text-align: center;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.card h2 {
|
|
208
|
+
margin: 0;
|
|
209
|
+
font-size: 2rem;
|
|
210
|
+
font-weight: 700;
|
|
211
|
+
color: var(--text-primary);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.sign-in {
|
|
215
|
+
display: inline-flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
gap: 0.8rem;
|
|
218
|
+
height: 3.6rem;
|
|
219
|
+
margin-top: 1.6rem;
|
|
220
|
+
padding: 0 1.5rem;
|
|
221
|
+
border: 1px solid var(--border-strong);
|
|
222
|
+
border-radius: 1.8rem;
|
|
223
|
+
background: transparent;
|
|
224
|
+
color: var(--accent);
|
|
225
|
+
font-size: 1.4rem;
|
|
226
|
+
font-weight: 500;
|
|
227
|
+
cursor: pointer;
|
|
228
|
+
transition: background 0.15s ease, border-color 0.15s ease;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.sign-in:hover {
|
|
232
|
+
background: var(--accent-hover);
|
|
233
|
+
border-color: transparent;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (max-width: 680px) {
|
|
237
|
+
.row {
|
|
238
|
+
flex-wrap: wrap;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.avatar-link {
|
|
242
|
+
width: 4.8rem;
|
|
243
|
+
height: 4.8rem;
|
|
244
|
+
font-size: 2rem;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.actions {
|
|
248
|
+
width: 100%;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
`,M=e=>{let t=null,n=-1/0;for(let r of e){if(!r.publishedAt)continue;let e=Date.parse(r.publishedAt);!Number.isNaN(e)&&e>n&&(n=e,t=r.publishedAt)}return t},N=()=>{x(`All subscriptions`);let{ready:r,signedIn:s}=o(),l=b(),y=i(),[C,w]=n(``),[T,E]=n(`all`),[D,N]=n(`all`),[P,F]=n(`default`),[I,L]=n(!1),[R,z]=n({}),[{data:B,error:V,fetching:H},U]=c({query:k,pause:!r||!s}),W=B?.subscribedChannels??[],G=W.map(e=>e.id).join(`,`),K=I||D!==`all`||P===`latest-upload`||P===`oldest-upload`;if(t(()=>{if(!K||W.length===0)return;let e=!1,t=W.map(e=>e.id),n=0,r=Array.from({length:Math.min(4,t.length)},async()=>{for(;!e&&n<t.length;){let r=t[n++],i=await y.query(A,{channelId:r},{requestPolicy:`cache-first`}).toPromise();if(e)return;let a=i.data?M(i.data.channelUploads):null;z(e=>e[r]===a?e:{...e,[r]:a})}});return Promise.all(r),()=>{e=!0}},[y,K,G]),!r)return a(`main`,{css:j,children:[u(`div`,{className:`head`,children:u(`h1`,{className:`heading`,children:`All subscriptions`})}),u(`p`,{className:`notice`,children:`Loading…`})]});if(!s)return a(`main`,{css:j,children:[u(`div`,{className:`head`,children:u(`h1`,{className:`heading`,children:`All subscriptions`})}),a(`div`,{className:`card`,children:[u(`h2`,{children:`Sign in to see your subscriptions`}),a(`button`,{type:`button`,className:`sign-in`,onClick:d,children:[u(e,{size:24,strokeWidth:1.5}),`Sign in`]})]})]});let q=W.filter(e=>e.id in R).length,J=K&&q<W.length,Y=O(W,{query:C,groupId:T,groups:l,activity:D,sort:P,lastUploadAt:R});return a(`main`,{css:j,children:[a(`div`,{className:`head`,children:[u(`h1`,{className:`heading`,children:`All subscriptions`}),W.length>0?a(`span`,{className:`count`,children:[Y.length===W.length?h(W.length,`channel`):`${Y.length} of ${h(W.length,`channel`)}`,J?` • checking upload dates (${q}/${W.length})`:``]}):void 0]}),a(`div`,{className:`controls`,children:[u(`input`,{className:`search`,type:`search`,value:C,placeholder:`Filter channels by name`,"aria-label":`Filter channels`,onInput:e=>w(e.currentTarget.value)}),a(`select`,{className:`select`,"aria-label":`Filter by group`,value:T,onChange:e=>E(e.currentTarget.value),children:[u(`option`,{value:`all`,children:`All groups`}),u(`option`,{value:`ungrouped`,children:`Not in any group`}),v(l).map(({group:e,depth:t})=>a(`option`,{value:e.id,children:[t>0?`${`\xA0\xA0`.repeat(t)}↳ `:``,e.emoji,` `,e.name]},e.id))]}),a(`select`,{className:`select`,"aria-label":`Filter by last video posted`,value:D,onChange:e=>N(e.currentTarget.value),children:[u(`option`,{value:`all`,children:`Any upload date`}),u(`option`,{value:`7d`,children:`Posted in last 7 days`}),u(`option`,{value:`30d`,children:`Posted in last 30 days`}),u(`option`,{value:`90d`,children:`Posted in last 90 days`}),u(`option`,{value:`365d`,children:`Posted in last year`}),u(`option`,{value:`inactive-365d`,children:`Inactive (1+ year)`})]}),a(`select`,{className:`select`,"aria-label":`Sort channels`,value:P,onChange:e=>F(e.currentTarget.value),children:[u(`option`,{value:`default`,children:`Default order`}),u(`option`,{value:`name-asc`,children:`Name (A to Z)`}),u(`option`,{value:`name-desc`,children:`Name (Z to A)`}),u(`option`,{value:`subscribers`,children:`Most subscribers`}),u(`option`,{value:`latest-upload`,children:`Latest video posted`}),u(`option`,{value:`oldest-upload`,children:`Oldest video posted`})]}),!K&&W.length>0?u(`button`,{type:`button`,className:`check-dates`,onClick:()=>L(!0),children:`Load upload dates`}):void 0]}),H&&W.length===0?u(`p`,{className:`notice`,children:`Loading…`}):void 0,V&&!H?u(m,{error:V,reexecute:U}):void 0,!H&&!V&&W.length>0&&Y.length===0?u(`p`,{className:`notice`,children:J?`Checking channel upload dates…`:`No matching channels`}):void 0,!H&&!V&&B&&W.length===0?u(`p`,{className:`notice`,children:`No subscriptions yet`}):void 0,u(`div`,{className:`list`,children:Y.map(e=>{let t=`/channel/${e.id}`,n=e.handle?e.handle.startsWith(`@`)?e.handle:`@${e.handle}`:void 0,r=R[e.id],i=r?`Last video ${_(r)}`:r===null?`No recent videos`:void 0,o=[n,e.subscriberCountText,e.videoCountText,i].filter(e=>!!e).join(` • `);return a(`div`,{className:`row`,children:[u(f,{href:t,className:e.avatar?`avatar-link`:`avatar-link fallback`,"aria-label":e.name,children:e.avatar?u(`img`,{src:e.avatar,alt:``,loading:`lazy`,referrerpolicy:`no-referrer`}):e.name.slice(0,1).toUpperCase()}),a(`div`,{className:`info`,children:[a(f,{href:t,className:`name`,children:[u(`span`,{className:`name-text`,children:e.name}),u(g,{channel:e})]}),o?u(`div`,{className:`meta`,children:o}):void 0,e.description?u(`p`,{className:`description`,children:e.description}):void 0]}),a(`div`,{className:`actions`,children:[u(S,{channel:{id:e.id,name:e.name,avatar:e.avatar??void 0}}),u(p,{channelId:e.id,subscribed:e.isSubscribed??!0,notificationLevel:e.notificationLevel})]})]},e.id)})})]})};export{N as default};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import{I as e,d as t,ht as n,j as r,on as i,sn as a}from"./icons-DKsqNLSs.js";import{c as o,ot as s,s as c,y as l}from"./sign-in-Bx3zmj-m.js";import{G as u,bn as d}from"./cards-Csel8naI.js";import{F as f,I as p,L as m,M as h,P as g,R as _,j as v,n as y}from"../index-Bj-Q3X8Q.js";a();var b=s`
|
|
2
|
+
max-width: 96rem;
|
|
3
|
+
padding: 2.4rem 1.6rem;
|
|
4
|
+
|
|
5
|
+
/* not .head or .heading: the confirmation Dialog renders inside this page and uses both */
|
|
6
|
+
.bar {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 1.6rem;
|
|
10
|
+
margin-bottom: 1.6rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.page-heading {
|
|
14
|
+
flex: 1;
|
|
15
|
+
margin: 0;
|
|
16
|
+
font-size: 2rem;
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
line-height: 2.8rem;
|
|
19
|
+
color: var(--text-primary);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.new {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.6rem;
|
|
26
|
+
height: 3.6rem;
|
|
27
|
+
padding: 0 1.6rem;
|
|
28
|
+
border: none;
|
|
29
|
+
border-radius: 1.8rem;
|
|
30
|
+
background: var(--bg-inverse);
|
|
31
|
+
color: var(--text-inverse);
|
|
32
|
+
font-size: 1.4rem;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: background 0.15s ease;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.new:hover {
|
|
39
|
+
background: var(--bg-inverse-hover);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.empty {
|
|
43
|
+
font-size: 1.4rem;
|
|
44
|
+
color: var(--text-secondary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.list {
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 0;
|
|
50
|
+
list-style: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.row {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 0.4rem;
|
|
57
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.group {
|
|
61
|
+
flex: 1;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 1.6rem;
|
|
66
|
+
min-height: 5.6rem;
|
|
67
|
+
padding: 0 1.2rem;
|
|
68
|
+
border-radius: 1rem;
|
|
69
|
+
color: var(--text-primary);
|
|
70
|
+
font-size: 1.6rem;
|
|
71
|
+
transition: background 0.15s ease;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.group:hover {
|
|
75
|
+
background: var(--bg-hover);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.emoji {
|
|
79
|
+
flex: none;
|
|
80
|
+
width: 3.2rem;
|
|
81
|
+
font-size: 2.4rem;
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.name {
|
|
86
|
+
min-width: 0;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.count {
|
|
93
|
+
flex: none;
|
|
94
|
+
margin-left: auto;
|
|
95
|
+
padding: 0.2rem 0.8rem;
|
|
96
|
+
border-radius: 0.6rem;
|
|
97
|
+
background: var(--bg-chip);
|
|
98
|
+
color: var(--text-secondary);
|
|
99
|
+
font-size: 1.2rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.icon {
|
|
103
|
+
flex: none;
|
|
104
|
+
width: 4rem;
|
|
105
|
+
height: 4rem;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
border: none;
|
|
110
|
+
border-radius: 50%;
|
|
111
|
+
background: transparent;
|
|
112
|
+
color: var(--text-primary);
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
transition: background 0.15s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.icon:hover {
|
|
118
|
+
background: var(--bg-hover);
|
|
119
|
+
}
|
|
120
|
+
`,x=s`
|
|
121
|
+
.confirm-note {
|
|
122
|
+
margin: 0 0 1.6rem;
|
|
123
|
+
font-size: 1.4rem;
|
|
124
|
+
color: var(--text-secondary);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.confirm-actions {
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: flex-end;
|
|
130
|
+
gap: 0.8rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
button {
|
|
134
|
+
height: 3.6rem;
|
|
135
|
+
padding: 0 1.6rem;
|
|
136
|
+
border: none;
|
|
137
|
+
border-radius: 1.8rem;
|
|
138
|
+
font-size: 1.4rem;
|
|
139
|
+
font-weight: 500;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.cancel {
|
|
144
|
+
background: transparent;
|
|
145
|
+
color: var(--accent);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.cancel:hover {
|
|
149
|
+
background: var(--accent-hover);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.delete {
|
|
153
|
+
background: var(--bg-inverse);
|
|
154
|
+
color: var(--text-inverse);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.delete:hover {
|
|
158
|
+
background: var(--bg-inverse-hover);
|
|
159
|
+
}
|
|
160
|
+
`,S=()=>{y(`Groups`);let a=_(),s=m(a),[S,C]=i(void 0),[w,T]=i(void 0),E=()=>{w&&p.deleteGroup(w.id),T(void 0)},D=w?h(a,w.id).length:0;return o(`main`,{css:b,children:[o(`div`,{className:`bar`,children:[c(`h1`,{className:`page-heading`,children:`Groups`}),o(`button`,{type:`button`,className:`new`,onClick:()=>C({}),children:[c(r,{size:20,strokeWidth:1.5}),`New group`]})]}),s.length===0?c(`p`,{className:`empty`,children:`No groups yet`}):c(`ul`,{className:`list`,children:s.map(({group:r,depth:i})=>{let s=h(a,r.id).length,u=s>0?g(a,r.id).length:r.channels.length,p=s>0?`${d(u,`channel`)} • ${d(s,`subfolder`)}`:d(u,`channel`);return o(`li`,{className:`row`,"data-depth":i,style:i>0?{paddingLeft:`${Math.min(i,5)*2.4}rem`}:void 0,children:[o(l,{href:f(r.id),className:`group`,children:[c(`span`,{className:`emoji`,"aria-hidden":`true`,children:r.emoji}),c(`span`,{className:`name`,children:r.name}),c(`span`,{className:`count`,children:p})]}),c(`button`,{type:`button`,className:`icon`,"aria-label":`New subfolder in ${r.name}`,title:`New subfolder`,onClick:()=>C({parentId:r.id}),children:c(n,{size:20,strokeWidth:1.5})}),c(`button`,{type:`button`,className:`icon`,"aria-label":`Edit ${r.name}`,onClick:()=>C({group:r}),children:c(e,{size:20,strokeWidth:1.5})}),c(`button`,{type:`button`,className:`icon`,"aria-label":`Delete ${r.name}`,onClick:()=>T(r),children:c(t,{size:20,strokeWidth:1.5})})]},r.id)})}),S?c(v,{group:S.group,parentId:S.parentId,onClose:()=>C(void 0)}):void 0,w?c(u,{title:`Delete ${w.name}?`,onClose:()=>T(void 0),children:o(`div`,{css:x,children:[D>0?c(`p`,{className:`confirm-note`,children:`Subfolders will move up one level.`}):void 0,o(`div`,{className:`confirm-actions`,children:[c(`button`,{type:`button`,className:`cancel`,onClick:()=>T(void 0),children:`Cancel`}),c(`button`,{type:`button`,className:`delete`,onClick:E,children:`Delete`})]})]})}):void 0]})};export{S as default};
|