@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,43 @@
|
|
|
1
|
+
import{F as e}from"./dist-BOrL1gYg.js";import{n as t,t as n}from"./binary-encoding-By5K7InN.js";var r=`YOUTUBEJS`,i={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},a={[i.ERROR]:(...e)=>console.error(...e),[i.WARNING]:(...e)=>console.warn(...e),[i.INFO]:(...e)=>console.info(...e),[i.DEBUG]:(...e)=>console.debug(...e)},o=[i.WARNING];function s(e,t,n){if(!a[e]||!o.includes(e))return;let i=[`[${r}]`];t&&i.push(`[${t}]`),a[e](`${i.join(``)}:`,...n||[])}var c=(e,...t)=>s(i.WARNING,e,t),l=(e,...t)=>s(i.ERROR,e,t),u=(e,...t)=>s(i.INFO,e,t),d=(e,...t)=>s(i.DEBUG,e,t),f=Symbol(`ObservedArray.isObserved`),p=class{static type=`YTNode`;type;constructor(){this.type=this.constructor.type}is(...e){return e.some(e=>this.type===e.type)}as(...e){if(!this.is(...e))throw new Hb(`Cannot cast ${this.type} to one of ${e.map(e=>e.type).join(`, `)}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new Hb(`Missing key ${e}`);return new h(this[e])}},m=`Maybe`,h=class e{#e;constructor(e){this.#e=e}#t(e){return typeof this.#e===e}#n(e){if(!this.#t(e))throw TypeError(`Expected ${e}, got ${this.typeof}`);return this.#e}get typeof(){return typeof this.#e}string(){return this.#n(`string`)}isString(){return this.#t(`string`)}number(){return this.#n(`number`)}isNumber(){return this.#t(`number`)}bigint(){return this.#n(`bigint`)}isBigint(){return this.#t(`bigint`)}boolean(){return this.#n(`boolean`)}isBoolean(){return this.#t(`boolean`)}symbol(){return this.#n(`symbol`)}isSymbol(){return this.#t(`symbol`)}undefined(){return this.#n(`undefined`)}isUndefined(){return this.#t(`undefined`)}null(){if(this.#e!==null)throw TypeError(`Expected null, got ${typeof this.#e}`);return this.#e}isNull(){return this.#e===null}object(){return this.#n(`object`)}isObject(){return this.#t(`object`)}function(){return this.#n(`function`)}isFunction(){return this.#t(`function`)}array(){if(!Array.isArray(this.#e))throw TypeError(`Expected array, got ${typeof this.#e}`);return this.#e}arrayOfMaybe(){let t=[];return new Proxy(this.array(),{get(n,r){return Reflect.has(t,r)?Reflect.get(n,r):new e(Reflect.get(n,r))}})}isArray(){return Array.isArray(this.#e)}node(){if(!(this.#e instanceof p))throw TypeError(`Expected YTNode, got ${this.#e.constructor.name}`);return this.#e}isNode(){return this.#e instanceof p}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw TypeError(`Expected ObservedArray, got ${typeof this.#e}`);return this.#e}isObserved(){return this.#e?.[f]}parsed(){if(!(this.#e instanceof g))throw TypeError(`Expected SuperParsedResult, got ${typeof this.#e}`);return this.#e}isParsed(){return this.#e instanceof g}any(){return c(m,`This call is not meant to be used outside of debugging. Please use the specific type getter instead.`),this.#e}instanceof(e){if(!this.isInstanceof(e))throw TypeError(`Expected instance of ${e.name}, got ${this.#e.constructor.name}`);return this.#e}isInstanceof(e){return this.#e instanceof e}},g=class{#e;constructor(e){this.#e=e}get is_null(){return this.#e===null}get is_array(){return!this.is_null&&Array.isArray(this.#e)}get is_node(){return!this.is_array}array(){if(!this.is_array)throw TypeError(`Expected an array, got a node`);return this.#e}item(){if(!this.is_node)throw TypeError(`Expected a node, got an array`);return this.#e}};function _(e){return new Proxy(e,{get(e,t){return t==`get`?(t,n)=>e.find((r,i)=>{let a=Jb(t,r);return a&&n&&e.splice(i,1),a}):t==f?!0:t==`getAll`?(t,n)=>e.filter((r,i)=>{let a=Jb(t,r);return a&&n&&e.splice(i,1),a}):t==`matchCondition`?t=>e.find(e=>t(e)):t==`filterType`?(...t)=>_(e.filter(e=>!!e.is(...t))):t==`firstOfType`?(...t)=>e.find(e=>!!e.is(...t)):t==`first`?()=>e[0]:t==`as`?(...t)=>_(e.map(e=>{if(e.is(...t))return e;throw new Hb(`Expected node of any type ${t.map(e=>e.type).join(`, `)}, got ${e.type}`)})):t==`remove`?t=>e.splice(t,1):Reflect.get(e,t)}})}var v=class extends Map{getType(...e){return e=e.flat(),_(e.flatMap(e=>this.get(e.type)||[]))}},ee=class{label;constructor(e){this.label=e.label}},y=class{accessibility_identifier;identifier;label;constructor(e){`accessibilityIdentifier`in e&&(this.accessibility_identifier=e.accessibilityIdentifier),`identifier`in e&&(this.identifier={accessibility_id_type:e.identifier.accessibilityIdType}),`label`in e&&(this.label=e.label)}},b=class{#e;constructor(e,t){this.#e=new Z.shim.Cache(e,t)}get cache_dir(){return this.#e.cache_dir}get(e){return this.#e.get(e)}set(e,t){return this.#e.set(e,t)}remove(e){return this.#e.remove(e)}},x={YT_BASE:`https://www.youtube.com`,YT_MUSIC_BASE:`https://music.youtube.com`,YT_SUGGESTIONS:`https://suggestqueries-clients6.youtube.com`,YT_UPLOAD:`https://upload.youtube.com/`,API:{BASE:`https://youtubei.googleapis.com`,PRODUCTION_1:`https://www.youtube.com/youtubei/`,PRODUCTION_2:`https://youtubei.googleapis.com/youtubei/`,STAGING:`https://green-youtubei.sandbox.googleapis.com/youtubei/`,RELEASE:`https://release-youtubei.sandbox.googleapis.com/youtubei/`,TEST:`https://test-youtubei.sandbox.googleapis.com/youtubei/`,CAMI:`http://cami-youtubei.sandbox.googleapis.com/youtubei/`,UYTFE:`https://uytfe.sandbox.google.com/youtubei/`},GOOGLE_SEARCH_BASE:`https://www.google.com/`},te={REGEX:{TV_SCRIPT:RegExp(`<script\\s+id="base-js"\\s+src="([^"]+)"[^>]*><\\/script>`),CLIENT_IDENTITY:RegExp(`clientId:"(?<client_id>[^"]+)",[^"]*?:"(?<client_secret>[^"]+)"`)}},S={IOS:{NAME:`iOS`,VERSION:`20.11.6`,USER_AGENT:`com.google.ios.youtube/20.11.6 (iPhone10,4; U; CPU iOS 16_7_7 like Mac OS X)`,DEVICE_MODEL:`iPhone10,4`,OS_NAME:`iOS`,OS_VERSION:`16.7.7.20H330`},WEB:{NAME:`WEB`,VERSION:`2.20260623.01.00`,API_KEY:`AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`,API_VERSION:`v1`,STATIC_VISITOR_ID:`6zpwvWUNAco`,SUGG_EXP_ID:`ytzpb5_e2,ytpo.bo.lqp.elu=1,ytpo.bo.lqp.ecsc=1,ytpo.bo.lqp.mcsc=3,ytpo.bo.lqp.mec=1,ytpo.bo.lqp.rw=0.8,ytpo.bo.lqp.fw=0.2,ytpo.bo.lqp.szp=1,ytpo.bo.lqp.mz=3,ytpo.bo.lqp.al=en_us,ytpo.bo.lqp.zrm=1,ytpo.bo.lqp.er=1,ytpo.bo.ro.erl=1,ytpo.bo.ro.mlus=3,ytpo.bo.ro.erls=3,ytpo.bo.qfo.mlus=3,ytzprp.ppp.e=1,ytzprp.ppp.st=772,ytzprp.ppp.p=5`},MWEB:{NAME:`MWEB`,VERSION:`2.20260205.04.01`,API_VERSION:`v1`},WEB_KIDS:{NAME:`WEB_KIDS`,VERSION:`2.20260205.00.00`},YTMUSIC:{NAME:`WEB_REMIX`,VERSION:`1.20250219.01.00`},ANDROID:{NAME:`ANDROID`,VERSION:`21.03.36`,SDK_VERSION:36,USER_AGENT:`com.google.android.youtube/21.03.36(Linux; U; Android 16; en_US; SM-S908E Build/TP1A.220624.014) gzip`},ANDROID_VR:{NAME:`ANDROID_VR`,VERSION:`1.65.10`,SDK_VERSION:32,DEVICE_MAKE:`Oculus`,DEVICE_MODEL:`Quest 3`,USER_AGENT:`com.google.android.apps.youtube.vr.oculus/1.65.10 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip`},VISIONOS:{NAME:`VISIONOS`,VERSION:`1.02`,DEVICE_MAKE:`Apple`,DEVICE_MODEL:`RealityDevice17,1`,OS_NAME:`visionOS`,OS_VERSION:`26.5.23O471`,USER_AGENT:`Mozilla/5.0 (Macintosh; Intel Mac OS X 15_7_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15`},YTSTUDIO_ANDROID:{NAME:`ANDROID_CREATOR`,VERSION:`22.43.101`},YTMUSIC_ANDROID:{NAME:`ANDROID_MUSIC`,VERSION:`5.34.51`},TV:{NAME:`TVHTML5`,VERSION:`7.20260311.12.00`,USER_AGENT:`Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version`},TV_SIMPLY:{NAME:`TVHTML5_SIMPLY`,VERSION:`1.0`},TV_EMBEDDED:{NAME:`TVHTML5_SIMPLY_EMBEDDED_PLAYER`,VERSION:`2.0`},WEB_EMBEDDED:{NAME:`WEB_EMBEDDED_PLAYER`,VERSION:`1.20260206.01.00`,API_KEY:`AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`,API_VERSION:`v1`,STATIC_VISITOR_ID:`6zpwvWUNAco`},WEB_CREATOR:{NAME:`WEB_CREATOR`,VERSION:`1.20241203.01.00`,API_KEY:`AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`,API_VERSION:`v1`,STATIC_VISITOR_ID:`6zpwvWUNAco`}},C={iOS:`5`,WEB:`1`,MWEB:`2`,WEB_KIDS:`76`,WEB_REMIX:`67`,ANDROID:`3`,ANDROID_CREATOR:`14`,ANDROID_MUSIC:`21`,ANDROID_VR:`28`,VISIONOS:`101`,TVHTML5:`7`,TVHTML5_SIMPLY:`74`,TVHTML5_SIMPLY_EMBEDDED_PLAYER:`85`,WEB_EMBEDDED_PLAYER:`56`,WEB_CREATOR:`62`},w={accept:`*/*`,origin:`https://www.youtube.com`,referer:`https://www.youtube.com`,DNT:`?1`},ne=[`IOS`,`WEB`,`MWEB`,`YTKIDS`,`YTMUSIC`,`ANDROID`,`ANDROID_VR`,`VISIONOS`,`YTSTUDIO_ANDROID`,`YTMUSIC_ANDROID`,`TV`,`TV_SIMPLY`,`TV_EMBEDDED`,`WEB_EMBEDDED`,`WEB_CREATOR`],re=class{listeners=new Map;onceWrappers=new Map;emit(e,...t){let n=this.listeners.get(e);if(n&&n.size!==0)for(let e of[...n])e(...t)}on(e,t){let n=this.listeners.get(e);n||(n=new Set,this.listeners.set(e,n)),n.add(t)}once(e,t){let n=(...n)=>{this.off(e,t),t(...n)},r=this.onceWrappers.get(t);r||(r=new Map,this.onceWrappers.set(t,r)),r.set(e,n),this.on(e,n)}off(e,t){let n=this.listeners.get(e);if(!n)return;let r=t,i=this.onceWrappers.get(t);if(i){let n=i.get(e);n&&(r=n,i.delete(e),i.size===0&&this.onceWrappers.delete(t))}n.delete(r),n.size===0&&this.listeners.delete(e)}removeAllListeners(e){if(!e){this.listeners.clear(),this.onceWrappers.clear();return}this.listeners.delete(e);for(let[t,n]of this.onceWrappers.entries())n.delete(e),n.size===0&&this.onceWrappers.delete(t)}},ie={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`};function ae(e){return e.replace(/([&"<>'])/g,(e,t)=>ie[t])}function oe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function T(e,t,...n){let r=n.flat();return typeof e==`function`?e({...t,children:r}):{type:oe(e),props:{...t,children:r}}}async function se(e){if(typeof e==`string`)return ae(e);let t=`<${e.type}`;if(e.props)for(let n of Object.keys(e.props))n!==`children`&&e.props[n]!==void 0&&(t+=` ${n}="${ae(`${e.props[n]}`)}"`);if(e.props.children){let n=await Promise.all((await Promise.all(e.props.children.flat())).flat().filter(e=>!!e).map(e=>se(e)));if(n.length>0)return t+=`>${n.join(``)}</${e.type}>`,t}return`${t}/>`}async function ce(e){return`<?xml version="1.0" encoding="utf-8"?>${await se(await e)}`}function le(e){return e.children}var ue=class extends p{static type=`PlayerStoryboardSpec`;boards=[];constructor(e){super();let t=e.spec?.split(`|`),n=t?.shift();if(!n||!n.startsWith(`http`))return;let r=new URL(n);this.boards=t?.map((e,t)=>{let[n,i,a,o,s,c,l,u]=e.split(`#`);r.searchParams.set(`sigh`,u);let d=Math.ceil(parseInt(a,10)/(parseInt(o,10)*parseInt(s,10)));return{type:`vod`,template_url:r.toString().replace(`$L`,t).replace(`$N`,l),thumbnail_width:parseInt(n,10),thumbnail_height:parseInt(i,10),thumbnail_count:parseInt(a,10),interval:parseInt(c,10),columns:parseInt(o,10),rows:parseInt(s,10),storyboard_count:d}})||[]}},E={name:`youtubei.js`,version:`18.3.0`,description:`A JavaScript client for YouTube's private API, known as InnerTube.`,type:`module`,types:`./dist/src/platform/lib.d.ts`,typesVersions:{"*":{agnostic:[`./dist/src/platform/lib.d.ts`],web:[`./dist/src/platform/lib.d.ts`],"react-native":[`./dist/src/platform/lib.d.ts`],"web.bundle":[`./dist/src/platform/lib.d.ts`],"cf-worker":[`./dist/src/platform/lib.d.ts`]}},exports:{".":{deno:`./dist/src/platform/deno.js`,node:{import:`./dist/src/platform/node.js`,default:`./dist/src/platform/node.js`},types:`./dist/src/platform/lib.d.ts`,browser:`./dist/src/platform/web.js`,"react-native":`./dist/src/platform/react-native.js`,default:`./dist/src/platform/web.js`},"./package.json":`./package.json`,"./agnostic":{types:`./dist/src/platform/lib.d.ts`,default:`./dist/src/platform/lib.js`},"./web":{types:`./dist/src/platform/lib.d.ts`,default:`./dist/src/platform/web.js`},"./react-native":{types:`./dist/src/platform/lib.d.ts`,default:`./dist/src/platform/react-native.js`},"./web.bundle":{types:`./dist/src/platform/lib.d.ts`,default:`./bundle/browser.js`},"./cf-worker":{types:`./dist/src/platform/lib.d.ts`,default:`./dist/src/platform/cf-worker.js`}},author:`LuanRT <luan.lrt4@gmail.com> (https://github.com/LuanRT)`,funding:[`https://github.com/sponsors/LuanRT`],contributors:[`Wykerd (https://github.com/wykerd/)`,`MasterOfBob777 (https://github.com/MasterOfBob777)`,`patrickkfkan (https://github.com/patrickkfkan)`,`akkadaska (https://github.com/akkadaska)`,`Absidue (https://github.com/absidue)`],scripts:{test:`vitest run --reporter verbose`,lint:`eslint ./src`,"lint:fix":`eslint --fix ./src`,"clean:source-maps":`rimraf ./bundle/browser.js.map ./bundle/cf-worker.js.map ./bundle/react-native.js.map`,"clean:build-output":`rimraf ./dist ./bundle/browser.js ./bundle/cf-worker.js ./bundle/react-native.js ./deno`,build:`npm run clean:build-output && npm run clean:source-maps && npm run build:parser-map && npm run build:esm && npm run bundle:browser && npm run bundle:cf-worker && npm run bundle:react-native`,"build:esm":`tspc`,"build:deno":`cpy ./src ./deno && cpy ./protos ./deno && esbuild ./src/utils/DashManifest.tsx --keep-names --format=esm --platform=neutral --target=es2020 --outfile=./deno/src/utils/DashManifest.js && cpy ./package.json ./deno && replace ".js';" ".ts';" ./deno -r && replace '.js";' '.ts";' ./deno -r && replace "'./DashManifest.ts';" "'./DashManifest.js';" ./deno -r && replace "'jintr';" "'jsr:@luanrt/jintr';" ./deno -r && replace "@bufbuild/protobuf/wire" "https://esm.sh/@bufbuild/protobuf@2.0.0/wire" ./deno -r`,"build:proto":`rimraf ./protos/generated && node ./dev-scripts/generate-proto.mjs`,"build:parser-map":`node ./dev-scripts/gen-parser-map.mjs`,"bundle:browser":`esbuild ./dist/src/platform/web.js --banner:js="/* eslint-disable */" --bundle --sourcemap --target=chrome70 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/browser.js --platform=browser`,"bundle:react-native":`esbuild ./dist/src/platform/react-native.js --bundle --sourcemap --target=es2020 --keep-names --format=esm --platform=neutral --define:global=globalThis --conditions=module --outfile=./bundle/react-native.js`,"bundle:cf-worker":`esbuild ./dist/src/platform/cf-worker.js --banner:js="/* eslint-disable */" --bundle --sourcemap --target=es2020 --keep-names --format=esm --define:global=globalThis --conditions=module --outfile=./bundle/cf-worker.js --platform=node`,"build:docs":`typedoc`,prepare:`npm run build`,watch:`tspc --watch`},repository:{type:`git`,url:`git+https://github.com/LuanRT/YouTube.js.git`},files:[`dist/`,`bundle/`,`package.json`,`README.md`,`LICENSE`],license:`MIT`,dependencies:{"@bufbuild/protobuf":`^2.0.0`,fflate:`^0.8.2`,meriyah:`^7.3.1`},devDependencies:{"@eslint/js":`^9.37.0`,"@types/estree":`^1.0.6`,"@types/node":`^26.6.2`,"@typescript-eslint/eslint-plugin":`^8.46.0`,"@typescript-eslint/parser":`^8.46.0`,"cpy-cli":`^7.0.0`,esbuild:`^0.28.0`,eslint:`^10.8.0`,globals:`^17.0.0`,replace:`^1.2.2`,rimraf:`^6.0.1`,"ts-patch":`^3.0.2`,"ts-proto":`^2.2.0`,typedoc:`^0.28.14`,"typedoc-plugin-markdown":`^4.9.0`,typescript:`^6.0.3`,"typescript-eslint":`^8.46.0`,vitest:`^5.0.1`},bugs:{url:`https://github.com/LuanRT/YouTube.js/issues`},homepage:`https://github.com/LuanRT/YouTube.js#readme`,keywords:[`api`,`youtube`,`innertube`,`livechat`,`youtube-music`,`ytdl`,`youtube-studio`,`downloader`,`ytmusic`]},de=`StreamingInfo`;function fe(e,t){let n=new Map,r=e.some(e=>!!e.audio_track);for(let r of e){if((!r.index_range||!r.init_range)&&!r.is_type_otf&&!t)continue;let e=`${r.mime_type.split(`;`)[0]}-${Yb(r.mime_type,`codecs="`,`"`)?.split(`.`)[0]}-${r.color_info?Object.values(r.color_info).join(`-`):``}-${r.audio_track?.id||``}-${r.is_drc?`drc`:``}-${r.is_vb?`vb`:``}`;n.has(e)||n.set(e,[]),n.get(e)?.push(r)}return{groups:Array.from(n.values()),has_multiple_audio_tracks:r}}function pe(e,t){if(e.length>1&&new Set(e.map(e=>Yb(e.mime_type,`codecs="`,`"`))).size===1)return t.push(`codecs`),Yb(e[0].mime_type,`codecs="`,`"`)}function D(e,t,n){if(e.length>1&&new Set(e.map(e=>e.fps)).size===1)return n.push(t),Number(e[0][t])}function me(e,t){if(e.length>1&&new Set(e.map(e=>e.audio_channels||2)).size===1)return t.push(`AudioChannelConfiguration`),e[0].audio_channels}async function he(e,t){let n=await t.session.http.fetch_function(`${e}&rn=0&sq=0`,{method:`GET`,headers:w,redirect:`follow`}),r=n.url.replace(`&rn=0`,``).replace(`&sq=0`,``),i=Yb(await n.text(),`Segment-Durations-Ms:`,`\r
|
|
2
|
+
`)?.split(`,`);if(!i)throw new Q(`Failed to extract the segment durations from this OTF stream`,{url:e});let a=[];for(let e of i){let t=e.trim();if(t.length===0)continue;let n,r=Yb(t,`(r=`,`)`);r&&(n=parseInt(r)),a.push({duration:parseInt(t),repeat_count:n})}return{init_url:`${r}&sq=0`,media_url:`${r}&sq=$Number$`,timeline:a}}async function ge(e,t){let n=await t.session.http.fetch_function(`${e}&rn=0&sq=0`,{method:`HEAD`,headers:w,redirect:`follow`}),r=parseInt(n.headers.get(`X-Head-Time-Millis`)||``),i=parseInt(n.headers.get(`X-Head-Seqnum`)||``);if(isNaN(r)||isNaN(i))throw new Q(`Failed to extract the duration or segment count for this Post Live DVR video`);return{duration:r/1e3,segment_count:i}}async function _e(e,t,n,r,i,a){if(!e.item){let o=new URL(await t.decipher(i));o.searchParams.set(`cpn`,a||``),e.item=await ge(n(o).toString(),r)}return e.item.duration}async function ve(e,t,n,r,i,a,o){let s=``;if(o){let t=`${e.itag||``}:${e.xtags||``}`;s=`sabr://${e.has_video?`video`:`audio`}?key=${t}`}else{let n=new URL(await e.decipher(r));n.searchParams.set(`cpn`,i||``),s=t(n).toString()}if(e.is_type_otf){if(!n)throw new Q(`Unable to get segment durations for this OTF stream without an Actions instance`,{format:e});return{is_oft:!0,is_post_live_dvr:!1,getSegmentTemplate(){return he(s,n)}}}if(a){if(!n)throw new Q(`Unable to get segment count for this Post Live DVR video without an Actions instance`,{format:e});let t=e.target_duration_sec;if(typeof t!=`number`)throw new Q(`Format is missing target_duration_sec`,{format:e});return{is_oft:!1,is_post_live_dvr:!0,async getSegmentTemplate(){return a.item||=await ge(s,n),{media_url:`${s}&sq=$Number$`,timeline:[{duration:t*1e3,repeat_count:a.item.segment_count}]}}}}if(!e.index_range||!e.init_range)throw new Q(`Index and init ranges not available`,{format:e});return{is_oft:!1,is_post_live_dvr:!1,base_url:s,index_range:e.index_range,init_range:e.init_range}}async function ye(e,t,n,r,i,a,o,s){let c=[e.itag.toString()];return e.audio_track&&c.push(e.audio_track.id),e.is_drc&&c.push(`drc`),e.is_vb&&c.push(`vb`),{uid:c.join(`-`),bitrate:e.bitrate,codecs:t.includes(`codecs`)?void 0:Yb(e.mime_type,`codecs="`,`"`),audio_sample_rate:t.includes(`audio_sample_rate`)?void 0:e.audio_sample_rate,channels:t.includes(`AudioChannelConfiguration`)?void 0:e.audio_channels||2,segment_info:await ve(e,n,r,i,a,o,s)}}function be(e,t){if(!e.audio_track&&!t)return;let n=[e.is_original?`main`:`alternate`];return(e.is_dubbed||e.is_auto_dubbed)&&n.push(`dub`),e.is_descriptive&&n.push(`description`),(e.is_drc||e.is_vb)&&n.push(`enhanced-audio-intelligibility`),n}async function xe(e,t,n,r,i,a,o,s,c){let l=e[0],{audio_track:u}=l,d=[],f=!!o,p=!!s,m;return u?m=f&&l.is_drc?o.label_drc_multiple(u.display_name):p&&l.is_vb?s.label_vb_multiple(u.display_name):u.display_name:(f||p)&&(m=f&&l.is_drc?o.label_drc:p&&l.is_vb?s.label_vb:(o||s)?.label_original),{mime_type:l.mime_type.split(`;`)[0],language:l.language??void 0,codecs:pe(e,d),audio_sample_rate:D(e,`audio_sample_rate`,d),track_name:m,track_roles:be(l,f),channels:me(e,d),drm_families:l.drm_families,drm_track_type:l.drm_track_type,representations:await Promise.all(e.map(e=>ye(e,d,t,n,r,i,a,c)))}}var Se={BT709:`1`,BT2020:`9`},Ce={BT709:`1`,BT2020_10:`14`,SMPTEST2084:`16`,ARIB_STD_B67:`18`},we={BT709:`1`,BT2020_NCL:`14`};function Te(e){let t=e.color_info,n,r,i;if(t){if(t.primaries&&(n=Se[t.primaries]),t.transfer_characteristics&&(r=Ce[t.transfer_characteristics]),t.matrix_coefficients&&(i=we[t.matrix_coefficients],!i)){let n=new URL(e.url),r=JSON.parse(JSON.stringify(e));r.url=`REDACTED`,r.signature_cipher=`REDACTED`,r.cipher=`REDACTED`,c(de,`Unknown matrix coefficients "${t.matrix_coefficients}". The DASH manifest is still usable without this.\nPlease report it at ${E.bugs.url} so we can add support for it.\nInnerTube client: ${n.searchParams.get(`c`)}\nformat:`,r)}}else Yb(e.mime_type,`codecs="`,`"`)?.startsWith(`avc1`)&&(r=Ce.BT709);return{primaries:n,transfer_characteristics:r,matrix_coefficients:i}}async function Ee(e,t,n,r,i,a,o,s){return{uid:e.itag.toString(),bitrate:e.bitrate,width:e.width,height:e.height,codecs:n.includes(`codecs`)?void 0:Yb(e.mime_type,`codecs="`,`"`),fps:n.includes(`fps`)?void 0:e.fps,segment_info:await ve(e,t,i,r,a,o,s)}}async function De(e,t,n,r,i,a,o){let s=e[0],c=Te(s),l=[];return{mime_type:s.mime_type.split(`;`)[0],color_info:c,codecs:pe(e,l),fps:D(e,`fps`,l),drm_families:s.drm_families,drm_track_type:s.drm_track_type,representations:await Promise.all(e.map(e=>Ee(e,t,l,n,r,i,a,o)))}}function Oe(e){let t=new Map,n=e.is(ue)?e.boards:[e.board];for(let e of n){let n=new URL(e.template_url).pathname.split(`.`).pop(),r=`image/${n===`jpg`?`jpeg`:n}`;t.has(r)||t.set(r,[]),t.get(r)?.push(e)}return t}async function ke(e,t,n,r,i){let a=t.template_url,o=n(new URL(a.replace(`$M`,`0`))),s=i.response?i.response:e.session.http.fetch_function(o,{method:`HEAD`,headers:w});return i.response=s,(await s).headers.get(`Content-Type`)||r}async function Ae(e,t,n){let r=t.template_url,i=[],a=Math.min(t.type===`vod`?t.storyboard_count:5,10);for(let t=0;t<a;t++){let a=new URL(r.replace(`$M`,t.toString())),o=t===0&&n.response?n.response:e.session.http.fetch_function(a,{method:`HEAD`,headers:w});t===0&&(n.response=o),i.push(o)}let o=await Promise.all(i),s=[];for(let e of o)s.push(parseInt(e.headers.get(`Content-Length`)||`0`));return Math.ceil(Math.max(...s)/(t.rows*t.columns)*8)}function je(e,t,n,r,i){let a=n.template_url,o=new URL(a.replace(`$M`,`$Number$`)),s;return s=n.type===`vod`?e/n.storyboard_count:e*n.columns*n.rows,{uid:`thumbnails_${n.thumbnail_width}x${n.thumbnail_height}`,getBitrate(){return Ae(t,n,i)},sheet_width:n.thumbnail_width*n.columns,sheet_height:n.thumbnail_height*n.rows,thumbnail_height:n.thumbnail_height,thumbnail_width:n.thumbnail_width,rows:n.rows,columns:n.columns,template_duration:Math.round(s),template_url:r(o).toString(),getURL(e){return o.toString().replace(`$Number$`,e.toString())}}}function Me(e,t,n,r){let i=Oe(n),a={};return Array.from(i.entries()).map(([n,i])=>({probable_mime_type:n,getMimeType(){return ke(t,i[0],r,n,a)},representations:i.map(n=>je(e,t,n,r,a))}))}function Ne(e,t,n){let r=t===`vtt`?`text/vtt`:`application/ttml+xml`;return e.map(e=>{let i=new URL(e.base_url);i.searchParams.set(`fmt`,t);let a=[`caption`];return i.searchParams.has(`tlang`)&&a.push(`dub`),{mime_type:r,language:e.language_code,track_name:e.name.toString(),track_roles:a,representation:{uid:`text-${e.vss_id}`,base_url:n(i).toString()}}})}async function Pe(e,t=!1,n=e=>e,r,i,a,o,s,c,l){if(!e)throw new Q(`Streaming data not available`);let u=r?e.adaptive_formats.filter(e=>!r(e)):e.adaptive_formats,d,f;if(t){if(f={},!o)throw new Q(`Unable to get duration or segment count for this Post Live DVR video without an Actions instance`);d=()=>f?_e(f,u[0],n,o,a,i):Promise.resolve(0)}else{let e=u[0].approx_duration_ms/1e3;d=()=>Promise.resolve(e)}let{groups:p,has_multiple_audio_tracks:m}=fe(u,t),{video_groups:h,audio_groups:g}=p.reduce((e,t)=>t[0].has_audio?(m&&!t[0].audio_track||e.audio_groups.push(t),e):(e.video_groups.push(t),e),{video_groups:[],audio_groups:[]}),_,v,ee=!1,y=!1;for(let e of g.flat())ee===!1&&e.is_drc&&(ee=!0),y===!1&&e.is_vb&&(y=!0);ee&&(_={label_original:l?.label_original||`Original`,label_drc:l?.label_drc||`Stable Volume`,label_drc_multiple:l?.label_drc_multiple||(e=>`${e} (Stable Volume)`)}),y&&(v={label_original:l?.label_original||`Original`,label_vb:l?.label_vb||`Voice Boost`,label_vb_multiple:l?.label_vb_multiple||(e=>`${e} (Voice Boost)`)});let b=await Promise.all(g.map(e=>xe(e,n,o,a,i,f,_,v,l?.is_sabr))),x=await Promise.all(h.map(e=>De(e,n,a,o,i,f,l?.is_sabr))),te=[];if(s&&o){let e;if(s.is(ue))e=u[0].approx_duration_ms/1e3;else{let t=u[0].target_duration_sec;if(t===void 0)throw new Q(`Format is missing target_duration_sec`,{format:u[0]});e=t}te=Me(e,o,s,n)}let S=[];if(c&&l?.captions_format){if(l.captions_format!==`vtt`&&l.captions_format!==`ttml`)throw new Q(`Invalid captions format`,l.captions_format);S=Ne(c,l.captions_format,n)}return{getDuration:d,audio_sets:b,video_sets:x,image_sets:te,text_sets:S}}async function Fe({info:e}){if(!e.is_oft&&!e.is_post_live_dvr)return null;let t=await e.getSegmentTemplate();return T(`segmentTemplate`,{startNumber:t.init_url?`1`:`0`,timescale:`1000`,initialization:t.init_url,media:t.media_url},T(`segmentTimeline`,null,t.timeline.map(e=>T(`s`,{d:e.duration,r:e.repeat_count}))))}function Ie({info:e}){return e.is_oft||e.is_post_live_dvr?T(Fe,{info:e}):T(le,null,T(`baseURL`,null,e.base_url),T(`segmentBase`,{indexRange:`${e.index_range.start}-${e.index_range.end}`},T(`initialization`,{range:`${e.init_range.start}-${e.init_range.end}`})))}function Le(e){switch(e){case`WIDEVINE`:return`edef8ba9-79d6-4ace-a3c8-27dcd51d21ed`;case`PLAYREADY`:return`9a04f079-9840-4286-ab92-e65be0885f95`;default:return null}}async function Re({streamingData:e,isPostLiveDvr:t,transformURL:n,rejectFormat:r,cpn:i,player:a,actions:o,storyboards:s,captionTracks:c,options:l}){let{getDuration:u,audio_sets:d,video_sets:f,image_sets:p,text_sets:m}=await Pe(e,t,n,r,i,a,o,s,c,l);return T(`mPD`,{xmlns:`urn:mpeg:dash:schema:mpd:2011`,minBufferTime:`PT1.500S`,profiles:`urn:mpeg:dash:profile:isoff-main:2011`,type:`static`,mediaPresentationDuration:`PT${await u()}S`,"xmlns:xsi":`http://www.w3.org/2001/XMLSchema-instance`,"xsi:schemaLocation":`urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd`},T(`period`,null,d.map((e,t)=>T(`adaptationSet`,{id:t,mimeType:e.mime_type,startWithSAP:`1`,subsegmentAlignment:`true`,lang:e.language,codecs:e.codecs,audioSamplingRate:e.audio_sample_rate,contentType:`audio`},e.drm_families&&e.drm_families.map(e=>T(`contentProtection`,{schemeIdUri:`urn:uuid:${Le(e)}`})),e.track_roles&&e.track_roles.map(e=>T(`role`,{schemeIdUri:`urn:mpeg:dash:role:2011`,value:e})),e.track_name&&T(`label`,{id:t},e.track_name),e.channels&&T(`audioChannelConfiguration`,{schemeIdUri:`urn:mpeg:dash:23003:3:audio_channel_configuration:2011`,value:e.channels}),e.representations.map(e=>T(`representation`,{id:e.uid,bandwidth:e.bitrate,codecs:e.codecs,audioSamplingRate:e.audio_sample_rate},e.channels&&T(`audioChannelConfiguration`,{schemeIdUri:`urn:mpeg:dash:23003:3:audio_channel_configuration:2011`,value:e.channels}),T(Ie,{info:e.segment_info}))))),f.map((e,t)=>T(`adaptationSet`,{id:t+d.length,mimeType:e.mime_type,startWithSAP:`1`,subsegmentAlignment:`true`,codecs:e.codecs,maxPlayoutRate:`1`,frameRate:e.fps,contentType:`video`},e.drm_families&&e.drm_families.map(e=>T(`contentProtection`,{schemeIdUri:`urn:uuid:${Le(e)}`})),e.color_info.primaries&&T(`supplementalProperty`,{schemeIdUri:`urn:mpeg:mpegB:cicp:ColourPrimaries`,value:e.color_info.primaries}),e.color_info.transfer_characteristics&&T(`supplementalProperty`,{schemeIdUri:`urn:mpeg:mpegB:cicp:TransferCharacteristics`,value:e.color_info.transfer_characteristics}),e.color_info.matrix_coefficients&&T(`supplementalProperty`,{schemeIdUri:`urn:mpeg:mpegB:cicp:MatrixCoefficients`,value:e.color_info.matrix_coefficients}),e.representations.map(e=>T(`representation`,{id:e.uid,bandwidth:e.bitrate,width:e.width,height:e.height,codecs:e.codecs,frameRate:e.fps},T(Ie,{info:e.segment_info}))))),p.map(async(e,t)=>T(`adaptationSet`,{id:t+d.length+f.length,mimeType:await e.getMimeType(),contentType:`image`},e.representations.map(async e=>T(`representation`,{id:`thumbnails_${e.thumbnail_width}x${e.thumbnail_height}`,bandwidth:await e.getBitrate(),width:e.sheet_width,height:e.sheet_height},T(`essentialProperty`,{schemeIdUri:`http://dashif.org/thumbnail_tile`,value:`${e.columns}x${e.rows}`}),T(`segmentTemplate`,{media:e.template_url,duration:e.template_duration,startNumber:`0`}))))),m.map((e,t)=>T(`adaptationSet`,{id:t+d.length+f.length+p.length,mimeType:e.mime_type,lang:e.language,contentType:`text`},e.track_roles.map(e=>T(`role`,{schemeIdUri:`urn:mpeg:dash:role:2011`,value:e})),T(`label`,{id:t+d.length},e.track_name),T(`representation`,{id:e.representation.uid,bandwidth:`0`},T(`baseURL`,null,e.representation.base_url))))))}function ze(e,t=!1,n=e=>e,r,i,a,o,s,c,l){if(!e)throw new Q(`Streaming data not available`);return ce(T(Re,{streamingData:e,isPostLiveDvr:t,transformURL:n,options:l,rejectFormat:r,cpn:i,player:a,actions:o,storyboards:s,captionTracks:c}))}async function Be(e,t,n,r,i,a){if(n?.status===`UNPLAYABLE`)throw new Q(`Video is unplayable`,{error_type:`UNPLAYABLE`});if(n?.status===`LOGIN_REQUIRED`)throw new Q(`Video is login required`,{error_type:`LOGIN_REQUIRED`});if(!r)throw new Q(`Streaming data not available.`,{error_type:`NO_STREAMING_DATA`});let o={quality:`360p`,type:`video+audio`,format:`mp4`,range:void 0,...e},s=Ve(o,r),c=await s.decipher(i);if(o.type===`video+audio`&&!e.range){let e=await t.session.http.fetch_function(`${c}&cpn=${a}`,{method:`GET`,headers:w,redirect:`follow`});if(!e.ok)throw new Q(`The server responded with a non 2xx status code`,{error_type:`FETCH_FAILED`,response:e});let n=e.body;if(!n)throw new Q(`Could not get ReadableStream from fetch Response.`,{error_type:`FETCH_FAILED`,response:e});return n}let l=10485760,u=e.range?e.range.start:0,d=e.range?e.range.end:l,f=!1,p;return new Z.shim.ReadableStream({start(){},pull:async n=>{if(f){n.close();return}return(d>=(s.content_length?s.content_length:0)||e.range)&&(f=!0),new Promise(async(e,r)=>{try{p=new AbortController;let r=await t.session.http.fetch_function(`${c}&cpn=${a}&range=${u}-${d||``}`,{method:`GET`,headers:{...w},signal:p.signal});if(!r.ok)throw new Q(`The server responded with a non 2xx status code`,{error_type:`FETCH_FAILED`,response:r});let i=r.body;if(!i)throw new Q(`Could not get ReadableStream from fetch Response.`,{error_type:`FETCH_FAILED`,response:r});for await(let e of nx(i))n.enqueue(e);u=d+1,d+=l,e()}catch(e){r(e)}})},async cancel(e){p.abort(e)}},{highWaterMark:1,size(e){return e.byteLength}})}function Ve(e,t){if(!t)throw new Q(`Streaming data not available`);let n=[...t.formats||[],...t.adaptive_formats||[]];if(e.itag){let t=n.filter(t=>t.itag===e.itag);if(!t.length)throw new Q(`No matching formats found`,{options:e});return t[0]}let r=!e.type||e.type.includes(`audio`),i=!e.type||e.type.includes(`video`),a=e.language||`original`,o=e.quality||`best`,s=-1,c=[`best`,`bestefficiency`].includes(o),l=o!==`best`,u=n.filter(t=>r&&!t.has_audio||i&&!t.has_video||e.codec&&!t.mime_type.includes(e.codec)||e.format!==`any`&&!t.mime_type.includes(e.format||`mp4`)||!c&&t.quality_label!==o?!1:(t.width&&s<t.width&&(s=t.width),!0));if(!u.length)throw new Q(`No matching formats found`,{options:e});if(c&&i&&(u=u.filter(e=>e.width===s)),r&&!i){let e=u.filter(e=>a===`original`?!e.has_video&&!e.has_text&&e.is_original:!e.has_video&&!e.has_text&&e.language===a);e.length>0&&(u=e)}return l?u.sort((e,t)=>e.bitrate-t.bitrate):u.sort((e,t)=>t.bitrate-e.bitrate),u[0]}var He=class{#e;#t;#n;constructor(e,t,n){this.#e=e,this.#t=t,this.#n=n||Z.shim.fetch}get fetch_function(){return this.#n}async fetch(e,t){let n=this.#e,r=x.API.PRODUCTION_1+n.api_version,i=t?.baseURL||r,a=typeof e==`string`?new URL(`${i}${i.endsWith(`/`)||e.startsWith(`/`)?``:`/`}${e}`):e instanceof URL?e:new URL(e.url,i),o=t?.headers||(e instanceof Z.shim.Request?e.headers:new Z.shim.Headers)||new Z.shim.Headers,s=t?.body||(e instanceof Z.shim.Request?e.body:void 0),c=new Z.shim.Headers(o);this.#i(c,n,a),a.searchParams.set(`prettyPrint`,`false`),a.searchParams.set(`alt`,`json`);let l=c.get(`Content-Type`),u=s,d=!1,f=i===r||i===x.YT_UPLOAD;if(l===`application/json`&&f&&typeof s==`string`){let{newBody:e,isWebKids:t,clientVersion:r,clientNameId:i,adjustedClientName:a}=this.#r(s,n);u=e,d=t,r&&c.set(`X-Youtube-Client-Version`,r),i&&c.set(`X-Youtube-Client-Name`,i),a===S.ANDROID.NAME||a===S.YTMUSIC_ANDROID.NAME?(c.set(`User-Agent`,S.ANDROID.USER_AGENT),c.set(`X-GOOG-API-FORMAT-VERSION`,`2`)):a===S.IOS.NAME?c.set(`User-Agent`,S.IOS.USER_AGENT):a===S.ANDROID_VR.NAME?c.set(`User-Agent`,S.ANDROID_VR.USER_AGENT):a===S.VISIONOS.NAME&&c.set(`User-Agent`,S.VISIONOS.USER_AGENT)}else l===`application/x-protobuf`&&Z.shim.server&&(c.set(`User-Agent`,S.ANDROID.USER_AGENT),c.set(`X-GOOG-API-FORMAT-VERSION`,`2`),c.delete(`X-Youtube-Client-Version`));if(n.logged_in&&f&&!d){let e=n.oauth;e.oauth2_tokens&&(e.shouldRefreshToken()&&await e.refreshAccessToken(),c.set(`Authorization`,`Bearer ${e.oauth2_tokens.access_token}`));let t=this.#t;if(t){let e=ox(t,`SAPISID`);e&&(c.set(`Authorization`,await Qb(e)),c.set(`X-Goog-Authuser`,n.account_index.toString()),n.context.user.onBehalfOfUser&&c.set(`X-Goog-PageId`,n.context.user.onBehalfOfUser)),c.set(`Cookie`,t)}}let p=new Z.shim.Request(a,e instanceof Z.shim.Request?e:t),m=await this.#n(p,{body:u,headers:c,redirect:e instanceof Z.shim.Request?e.redirect:t?.redirect||`follow`,...Z.shim.runtime===`cf-worker`?{}:{credentials:`include`}});if(m.ok)return m;throw new Q(`Request to ${m.url} failed with status code ${m.status}`,await m.text())}#r(e,t){let n=JSON.parse(e),r=JSON.parse(JSON.stringify(t.context));this.#a(r,n.client);let i={...n,context:r},a=i.context.client.clientVersion,o=C[i.context.client.clientName];delete i.client;let s=i.context.client.clientName===S.WEB_KIDS.NAME;return{newBody:JSON.stringify(i),isWebKids:s,clientVersion:a,clientNameId:o,adjustedClientName:i.context.client.clientName}}#i(e,t,n){e.set(`Accept`,`*/*`),e.set(`Accept-Language`,`*`),e.set(`X-Goog-Visitor-Id`,t.context.client.visitorData||``),e.set(`X-Youtube-Client-Version`,t.context.client.clientVersion||``);let r=C[t.context.client.clientName];r&&e.set(`X-Youtube-Client-Name`,r),Z.shim.server&&(e.set(`User-Agent`,t.user_agent||``),e.set(`Origin`,n.origin))}#a(e,t){if(!t)return;let n=t.toUpperCase();if(!ne.includes(n))throw new Q(`Invalid client: ${t}`,{available_innertube_clients:ne});switch(n!==`WEB`&&delete e.client.configInfo,(n===`ANDROID`||n===`YTMUSIC_ANDROID`||n===`YTSTUDIO_ANDROID`)&&(e.client.androidSdkVersion=S.ANDROID.SDK_VERSION,e.client.userAgent=S.ANDROID.USER_AGENT,e.client.osName=`Android`,e.client.osVersion=`13`,e.client.platform=`MOBILE`),n){case`MWEB`:e.client.clientVersion=S.MWEB.VERSION,e.client.clientName=S.MWEB.NAME,e.client.clientFormFactor=`SMALL_FORM_FACTOR`,e.client.platform=`MOBILE`;break;case`IOS`:e.client.deviceMake=`Apple`,e.client.deviceModel=S.IOS.DEVICE_MODEL,e.client.clientVersion=S.IOS.VERSION,e.client.clientName=S.IOS.NAME,e.client.platform=`MOBILE`,e.client.osName=S.IOS.OS_NAME,e.client.osVersion=S.IOS.OS_VERSION,delete e.client.browserName,delete e.client.browserVersion;break;case`YTMUSIC`:e.client.clientVersion=S.YTMUSIC.VERSION,e.client.clientName=S.YTMUSIC.NAME;break;case`ANDROID`:e.client.clientVersion=S.ANDROID.VERSION,e.client.clientFormFactor=`SMALL_FORM_FACTOR`,e.client.clientName=S.ANDROID.NAME;break;case`ANDROID_VR`:e.client.androidSdkVersion=32,e.client.osName=`Android`,e.client.osVersion=`12L`,e.client.platform=`MOBILE`,e.client.userAgent=S.ANDROID_VR.USER_AGENT,e.client.deviceMake=S.ANDROID_VR.DEVICE_MAKE,e.client.deviceModel=S.ANDROID_VR.DEVICE_MODEL,e.client.clientVersion=S.ANDROID_VR.VERSION,e.client.clientFormFactor=`SMALL_FORM_FACTOR`,e.client.clientName=S.ANDROID_VR.NAME;break;case`VISIONOS`:e.client.deviceMake=S.VISIONOS.DEVICE_MAKE,e.client.deviceModel=S.VISIONOS.DEVICE_MODEL,e.client.clientVersion=S.VISIONOS.VERSION,e.client.clientName=S.VISIONOS.NAME,e.client.platform=`MOBILE`,e.client.osName=S.VISIONOS.OS_NAME,e.client.osVersion=S.VISIONOS.OS_VERSION,e.client.userAgent=S.VISIONOS.USER_AGENT,delete e.client.browserName,delete e.client.browserVersion;break;case`YTMUSIC_ANDROID`:e.client.clientVersion=S.YTMUSIC_ANDROID.VERSION,e.client.clientFormFactor=`SMALL_FORM_FACTOR`,e.client.clientName=S.YTMUSIC_ANDROID.NAME;break;case`YTSTUDIO_ANDROID`:e.client.clientVersion=S.YTSTUDIO_ANDROID.VERSION,e.client.clientFormFactor=`SMALL_FORM_FACTOR`,e.client.clientName=S.YTSTUDIO_ANDROID.NAME;break;case`TV`:e.client.clientVersion=S.TV.VERSION,e.client.clientName=S.TV.NAME,e.client.userAgent=S.TV.USER_AGENT;break;case`TV_SIMPLY`:e.client.clientVersion=S.TV_SIMPLY.VERSION,e.client.clientName=S.TV_SIMPLY.NAME;break;case`TV_EMBEDDED`:e.client.clientName=S.TV_EMBEDDED.NAME,e.client.clientVersion=S.TV_EMBEDDED.VERSION,e.client.clientScreen=`EMBED`,e.thirdParty={embedUrl:x.YT_BASE};break;case`YTKIDS`:e.client.clientVersion=S.WEB_KIDS.VERSION,e.client.clientName=S.WEB_KIDS.NAME,e.client.kidsAppInfo={categorySettings:{enabledCategories:[`approved_for_you`,`black_joy`,`camp`,`collections`,`earth`,`explore`,`favorites`,`gaming`,`halloween`,`hero`,`learning`,`move`,`music`,`reading`,`shared_by_parents`,`shows`,`soccer`,`sports`,`spotlight`,`winter`]},contentSettings:{corpusPreference:`KIDS_CORPUS_PREFERENCE_YOUNGER`,kidsNoSearchMode:`YT_KIDS_NO_SEARCH_MODE_OFF`}};break;case`WEB_EMBEDDED`:e.client.clientName=S.WEB_EMBEDDED.NAME,e.client.clientVersion=S.WEB_EMBEDDED.VERSION,e.client.clientScreen=`EMBED`,e.thirdParty={embedUrl:x.GOOGLE_SEARCH_BASE};break;case`WEB_CREATOR`:e.client.clientName=S.WEB_CREATOR.NAME,e.client.clientVersion=S.WEB_CREATOR.VERSION}}},Ue=Uint8Array,We=Uint16Array,Ge=Int32Array,Ke=new Ue([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qe=new Ue([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Je=new Ue([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ye=function(e,t){for(var n=new We(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new Ge(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},Xe=Ye(Ke,2),Ze=Xe.b,Qe=Xe.r;Ze[28]=258,Qe[258]=28;for(var $e=Ye(qe,0),et=$e.b,tt=$e.r,nt=new We(32768),rt=0;rt<32768;++rt){var it=(rt&43690)>>1|(rt&21845)<<1;it=(it&52428)>>2|(it&13107)<<2,it=(it&61680)>>4|(it&3855)<<4,nt[rt]=((it&65280)>>8|(it&255)<<8)>>1}for(var at=(function(e,t,n){for(var r=e.length,i=0,a=new We(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new We(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new We(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=o[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)s[nt[d]>>c]=l}else for(s=new We(r),i=0;i<r;++i)e[i]&&(s[i]=nt[o[e[i]-1]++]>>15-e[i]);return s}),ot=new Ue(288),rt=0;rt<144;++rt)ot[rt]=8;for(var rt=144;rt<256;++rt)ot[rt]=9;for(var rt=256;rt<280;++rt)ot[rt]=7;for(var rt=280;rt<288;++rt)ot[rt]=8;for(var st=new Ue(32),rt=0;rt<32;++rt)st[rt]=5;var ct=at(ot,9,0),lt=at(ot,9,1),ut=at(st,5,0),dt=at(st,5,1),ft=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},pt=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},mt=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},ht=function(e){return(e+7)/8|0},gt=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new Ue(e.subarray(t,n))},_t=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],vt=function(e,t,n){var r=Error(t||_t[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,vt),!n)throw r;return r},yt=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new Ue(0);var o=!n,s=o||t.i!=2,c=t.i;o&&(n=new Ue(i*3));var l=function(e){var t=n.length;if(e>t){var r=new Ue(Math.max(t*2,e));r.set(n),n=r}},u=t.f||0,d=t.p||0,f=t.b||0,p=t.l,m=t.d,h=t.m,g=t.n,_=i*8;do{if(!p){u=pt(e,d,1);var v=pt(e,d+1,3);if(d+=3,!v){var ee=ht(d)+4,y=e[ee-4]|e[ee-3]<<8,b=ee+y;if(b>i){c&&vt(0);break}s&&l(f+y),n.set(e.subarray(ee,b),f),t.b=f+=y,t.p=d=b*8,t.f=u;continue}if(v==1)p=lt,m=dt,h=9,g=5;else if(v==2){var x=pt(e,d,31)+257,te=pt(e,d+10,15)+4,S=x+pt(e,d+5,31)+1;d+=14;for(var C=new Ue(S),w=new Ue(19),ne=0;ne<te;++ne)w[Je[ne]]=pt(e,d+ne*3,7);d+=te*3;for(var re=ft(w),ie=(1<<re)-1,ae=at(w,re,1),ne=0;ne<S;){var oe=ae[pt(e,d,ie)];d+=oe&15;var ee=oe>>4;if(ee<16)C[ne++]=ee;else{var T=0,se=0;for(ee==16?(se=3+pt(e,d,3),d+=2,T=C[ne-1]):ee==17?(se=3+pt(e,d,7),d+=3):ee==18&&(se=11+pt(e,d,127),d+=7);se--;)C[ne++]=T}}var ce=C.subarray(0,x),le=C.subarray(x);h=ft(ce),g=ft(le),p=at(ce,h,1),m=at(le,g,1)}else vt(1);if(d>_){c&&vt(0);break}}s&&l(f+131072);for(var ue=(1<<h)-1,E=(1<<g)-1,de=d;;de=d){var T=p[mt(e,d)&ue],fe=T>>4;if(d+=T&15,d>_){c&&vt(0);break}if(T||vt(2),fe<256)n[f++]=fe;else if(fe==256){de=d,p=null;break}else{var pe=fe-254;if(fe>264){var ne=fe-257,D=Ke[ne];pe=pt(e,d,(1<<D)-1)+Ze[ne],d+=D}var me=m[mt(e,d)&E],he=me>>4;me||vt(3),d+=me&15;var le=et[he];if(he>3){var D=qe[he];le+=mt(e,d)&(1<<D)-1,d+=D}if(d>_){c&&vt(0);break}s&&l(f+131072);var ge=f+pe;if(f<le){var _e=a-le,ve=Math.min(le,ge);for(_e+f<0&&vt(3);f<ve;++f)n[f]=r[_e+f]}for(;f<ge;++f)n[f]=n[f-le]}}t.l=p,t.p=de,t.b=f,t.f=u,p&&(u=1,t.m=h,t.d=m,t.n=g)}while(!u);return f!=n.length&&o?gt(n,0,f):n.subarray(0,f)},bt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},xt=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},St=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return{t:kt,l:0};if(i==1){var o=new Ue(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};for(var f=a[0].s,r=1;r<i;++r)a[r].s>f&&(f=a[r].s);var p=new We(f+1),m=Ct(n[u-1],p,0);if(m>t){var r=0,h=0,g=m-t,_=1<<g;for(a.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<i;++r){var v=a[r].s;if(p[v]>t)h+=_-(1<<m-p[v]),p[v]=t;else break}for(h>>=g;h>0;){var ee=a[r].s;p[ee]<t?h-=1<<t-p[ee]++-1:++r}for(;r>=0&&h;--r){var y=a[r].s;p[y]==t&&(--p[y],++h)}m=t}return{t:new Ue(p),l:m}},Ct=function(e,t,n){return e.s==-1?Math.max(Ct(e.l,t,n+1),Ct(e.r,t,n+1)):t[e.s]=n},wt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new We(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return{c:n.subarray(0,r),n:t}},Tt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Et=function(e,t,n){var r=n.length,i=ht(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<r;++a)e[i+a+4]=n[a];return(i+4+r)*8},Dt=function(e,t,n,r,i,a,o,s,c,l,u){bt(t,u++,n),++i[256];for(var d=St(i,15),f=d.t,p=d.l,m=St(a,15),h=m.t,g=m.l,_=wt(f),v=_.c,ee=_.n,y=wt(h),b=y.c,x=y.n,te=new We(19),S=0;S<v.length;++S)++te[v[S]&31];for(var S=0;S<b.length;++S)++te[b[S]&31];for(var C=St(te,7),w=C.t,ne=C.l,re=19;re>4&&!w[Je[re-1]];--re);var ie=l+5<<3,ae=Tt(i,ot)+Tt(a,st)+o,oe=Tt(i,f)+Tt(a,h)+o+14+3*re+Tt(te,w)+2*te[16]+3*te[17]+7*te[18];if(c>=0&&ie<=ae&&ie<=oe)return Et(t,u,e.subarray(c,c+l));var T,se,ce,le;if(bt(t,u,1+(oe<ae)),u+=2,oe<ae){T=at(f,p,0),se=f,ce=at(h,g,0),le=h;var ue=at(w,ne,0);bt(t,u,ee-257),bt(t,u+5,x-1),bt(t,u+10,re-4),u+=14;for(var S=0;S<re;++S)bt(t,u+3*S,w[Je[S]]);u+=3*re;for(var E=[v,b],de=0;de<2;++de)for(var fe=E[de],S=0;S<fe.length;++S){var pe=fe[S]&31;bt(t,u,ue[pe]),u+=w[pe],pe>15&&(bt(t,u,fe[S]>>5&127),u+=fe[S]>>12)}}else T=ct,se=ot,ce=ut,le=st;for(var S=0;S<s;++S){var D=r[S];if(D>255){var pe=D>>18&31;xt(t,u,T[pe+257]),u+=se[pe+257],pe>7&&(bt(t,u,D>>23&31),u+=Ke[pe]);var me=D&31;xt(t,u,ce[me]),u+=le[me],me>3&&(xt(t,u,D>>5&8191),u+=qe[me])}else xt(t,u,T[D]),u+=se[D]}return xt(t,u,T[256]),u+se[256]},Ot=new Ge([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kt=new Ue(0),At=function(e,t,n,r,i,a){var o=a.z||e.length,s=new Ue(r+o+5*(1+Math.ceil(o/7e3))+i),c=s.subarray(r,s.length-i),l=a.l,u=(a.r||0)&7;if(t){u&&(c[0]=a.r>>3);for(var d=Ot[t-1],f=d>>13,p=d&8191,m=(1<<n)-1,h=a.p||new We(32768),g=a.h||new We(m+1),_=Math.ceil(n/3),v=2*_,ee=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<v)&m},y=new Ge(25e3),b=new We(288),x=new We(32),te=0,S=0,C=a.i||0,w=0,ne=a.w||0,re=0;C+2<o;++C){var ie=ee(C),ae=C&32767,oe=g[ie];if(h[ae]=oe,g[ie]=ae,ne<=C){var T=o-C;if((te>7e3||w>24576)&&(T>423||!l)){u=Dt(e,c,0,y,b,x,S,w,re,C-re,u),w=te=S=0,re=C;for(var se=0;se<286;++se)b[se]=0;for(var se=0;se<30;++se)x[se]=0}var ce=2,le=0,ue=p,E=ae-oe&32767;if(T>2&&ie==ee(C-E))for(var de=Math.min(f,T)-1,fe=Math.min(32767,C),pe=Math.min(258,T);E<=fe&&--ue&&ae!=oe;){if(e[C+ce]==e[C+ce-E]){for(var D=0;D<pe&&e[C+D]==e[C+D-E];++D);if(D>ce){if(ce=D,le=E,D>de)break;for(var me=Math.min(E,D-2),he=0,se=0;se<me;++se){var ge=C-E+se&32767,_e=ge-h[ge]&32767;_e>he&&(he=_e,oe=ge)}}}ae=oe,oe=h[ae],E+=ae-oe&32767}if(le){y[w++]=268435456|Qe[ce]<<18|tt[le];var ve=Qe[ce]&31,ye=tt[le]&31;S+=Ke[ve]+qe[ye],++b[257+ve],++x[ye],ne=C+ce,++te}else y[w++]=e[C],++b[e[C]]}}for(C=Math.max(C,ne);C<o;++C)y[w++]=e[C],++b[e[C]];u=Dt(e,c,l,y,b,x,S,w,re,C-re,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=g,a.p=h,a.i=C,a.w=ne)}else{for(var C=a.w||0;C<o+l;C+=65535){var be=C+65535;be>=o&&(c[u/8|0]=l,be=o),u=Et(c,u+1,e.subarray(C,be))}a.i=o}return gt(s,0,r+ht(u)+i)},jt=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(n&1&&-306674912)^n>>>1;e[t]=n}return e})(),Mt=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=jt[n&255^t[r]]^n>>>8;e=n},d:function(){return~e}}},Nt=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new Ue(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return At(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Pt=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Ft=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Pt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},It=function(e){(e[0]!=31||e[1]!=139||e[2]!=8)&&vt(6,`invalid gzip data`);var t=e[3],n=10;t&4&&(n+=(e[10]|e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(t&2)},Lt=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Rt=function(e){return 10+(e.filename?e.filename.length+1:0)};function zt(e,t){t||={};var n=Mt(),r=e.length;n.p(e);var i=Nt(e,t,Rt(t),8),a=i.length;return Ft(i,t),Pt(i,a-8,n.d()),Pt(i,a-4,r),i}function Bt(e,t){var n=It(e);return n+8>e.length&&vt(6,`invalid gzip data`),yt(e.subarray(n,-8),{i:2},t&&t.out||new Ue(Lt(e)),t&&t.dictionary)}var Vt=typeof TextDecoder<`u`&&new TextDecoder;try{Vt.decode(kt,{stream:!0})}catch{}var Ht=5849684;function Ut(e){let t=JSON.stringify(e),n=zt(new TextEncoder().encode(t)),r=new ArrayBuffer(12+n.byteLength),i=new DataView(r);return i.setUint32(0,Ht,!0),i.setUint32(4,2,!0),i.setUint32(8,n.byteLength,!0),new Uint8Array(r).set(n,12),r}function Wt(e){if(e.byteLength<12)throw Error(`Invalid binary format: buffer too short`);let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==5849684)throw Error(`Invalid binary format: magic header mismatch`);let n=t.getUint32(4,!0);if(n!==2)throw Error(`Unsupported binary format version: ${n}`);let r=t.getUint32(8,!0);if(12+r>e.byteLength)throw Error(`Invalid binary format: data length out of bounds`);let i=Bt(e.subarray(12,12+r)),a=new TextDecoder().decode(i);return JSON.parse(a)}var Gt={RELEVANCE:0,0:`RELEVANCE`,POPULARITY:3,3:`POPULARITY`,UNRECOGNIZED:-1,"-1":`UNRECOGNIZED`},Kt={ANY_DATE:0,0:`ANY_DATE`,TODAY:2,2:`TODAY`,WEEK:3,3:`WEEK`,MONTH:4,4:`MONTH`,YEAR:5,5:`YEAR`,UNRECOGNIZED:-1,"-1":`UNRECOGNIZED`},qt={ANY_TYPE:0,0:`ANY_TYPE`,VIDEO:1,1:`VIDEO`,CHANNEL:2,2:`CHANNEL`,PLAYLIST:3,3:`PLAYLIST`,MOVIE:4,4:`MOVIE`,SHORTS:9,9:`SHORTS`,UNRECOGNIZED:-1,"-1":`UNRECOGNIZED`},Jt={ANY_DURATION:0,0:`ANY_DURATION`,OVER_TWENTY_MINS:2,2:`OVER_TWENTY_MINS`,UNDER_THREE_MINS:4,4:`UNDER_THREE_MINS`,THREE_TO_TWENTY_MINS:5,5:`THREE_TO_TWENTY_MINS`,UNRECOGNIZED:-1,"-1":`UNRECOGNIZED`};function Yt(){return{id:``,timestamp:0}}var Xt={encode(e,n=new t){return e.id!==``&&n.uint32(10).string(e.id),e.timestamp!==0&&n.uint32(40).int32(e.timestamp),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Yt();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.id=r.string();continue;case 5:if(e!==40)break;a.timestamp=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Zt(){return{prioritize:void 0,filters:void 0}}var Qt={encode(e,n=new t){return e.prioritize!==void 0&&n.uint32(8).int32(e.prioritize),e.filters!==void 0&&en.encode(e.filters,n.uint32(18).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Zt();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.prioritize=r.int32();continue;case 2:if(e!==18)break;a.filters=en.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function $t(){return{uploadDate:void 0,type:void 0,duration:void 0,musicSearchType:void 0,featuresHd:void 0,featuresSubtitles:void 0,featuresCreativeCommons:void 0,features3d:void 0,featuresLive:void 0,featuresPurchased:void 0,features4k:void 0,features360:void 0,featuresLocation:void 0,featuresHdr:void 0,featuresVr180:void 0}}var en={encode(e,n=new t){return e.uploadDate!==void 0&&n.uint32(8).int32(e.uploadDate),e.type!==void 0&&n.uint32(16).int32(e.type),e.duration!==void 0&&n.uint32(24).int32(e.duration),e.musicSearchType!==void 0&&nn.encode(e.musicSearchType,n.uint32(138).fork()).join(),e.featuresHd!==void 0&&n.uint32(32).bool(e.featuresHd),e.featuresSubtitles!==void 0&&n.uint32(40).bool(e.featuresSubtitles),e.featuresCreativeCommons!==void 0&&n.uint32(48).bool(e.featuresCreativeCommons),e.features3d!==void 0&&n.uint32(56).bool(e.features3d),e.featuresLive!==void 0&&n.uint32(64).bool(e.featuresLive),e.featuresPurchased!==void 0&&n.uint32(72).bool(e.featuresPurchased),e.features4k!==void 0&&n.uint32(112).bool(e.features4k),e.features360!==void 0&&n.uint32(120).bool(e.features360),e.featuresLocation!==void 0&&n.uint32(184).bool(e.featuresLocation),e.featuresHdr!==void 0&&n.uint32(200).bool(e.featuresHdr),e.featuresVr180!==void 0&&n.uint32(208).bool(e.featuresVr180),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=$t();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.uploadDate=r.int32();continue;case 2:if(e!==16)break;a.type=r.int32();continue;case 3:if(e!==24)break;a.duration=r.int32();continue;case 17:if(e!==138)break;a.musicSearchType=nn.decode(r,r.uint32());continue;case 4:if(e!==32)break;a.featuresHd=r.bool();continue;case 5:if(e!==40)break;a.featuresSubtitles=r.bool();continue;case 6:if(e!==48)break;a.featuresCreativeCommons=r.bool();continue;case 7:if(e!==56)break;a.features3d=r.bool();continue;case 8:if(e!==64)break;a.featuresLive=r.bool();continue;case 9:if(e!==72)break;a.featuresPurchased=r.bool();continue;case 14:if(e!==112)break;a.features4k=r.bool();continue;case 15:if(e!==120)break;a.features360=r.bool();continue;case 23:if(e!==184)break;a.featuresLocation=r.bool();continue;case 25:if(e!==200)break;a.featuresHdr=r.bool();continue;case 26:if(e!==208)break;a.featuresVr180=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function tn(){return{song:void 0,video:void 0,album:void 0,artist:void 0,playlist:void 0}}var nn={encode(e,n=new t){return e.song!==void 0&&n.uint32(8).bool(e.song),e.video!==void 0&&n.uint32(16).bool(e.video),e.album!==void 0&&n.uint32(24).bool(e.album),e.artist!==void 0&&n.uint32(32).bool(e.artist),e.playlist!==void 0&&n.uint32(40).bool(e.playlist),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=tn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.song=r.bool();continue;case 2:if(e!==16)break;a.video=r.bool();continue;case 3:if(e!==24)break;a.album=r.bool();continue;case 4:if(e!==32)break;a.artist=r.bool();continue;case 5:if(e!==40)break;a.playlist=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function rn(){return{channelId:``,prefId:void 0,number0:void 0,number1:void 0}}var an={encode(e,n=new t){return e.channelId!==``&&n.uint32(10).string(e.channelId),e.prefId!==void 0&&sn.encode(e.prefId,n.uint32(18).fork()).join(),e.number0!==void 0&&n.uint32(24).int32(e.number0),e.number1!==void 0&&n.uint32(32).int32(e.number1),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=rn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.channelId=r.string();continue;case 2:if(e!==18)break;a.prefId=sn.decode(r,r.uint32());continue;case 3:if(e!==24)break;a.number0=r.int32();continue;case 4:if(e!==32)break;a.number1=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function on(){return{index:0}}var sn={encode(e,n=new t){return e.index!==0&&n.uint32(8).int32(e.index),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=on();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.index=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function cn(){return{params:void 0,number0:void 0,number1:void 0}}var ln={encode(e,n=new t){return e.params!==void 0&&dn.encode(e.params,n.uint32(10).fork()).join(),e.number0!==void 0&&n.uint32(16).int32(e.number0),e.number1!==void 0&&n.uint32(24).int32(e.number1),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=cn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.params=dn.decode(r,r.uint32());continue;case 2:if(e!==16)break;a.number0=r.int32();continue;case 3:if(e!==24)break;a.number1=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function un(){return{ids:void 0}}var dn={encode(e,n=new t){return e.ids!==void 0&&pn.encode(e.ids,n.uint32(42).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=un();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 5:if(e!==42)break;a.ids=pn.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function fn(){return{channelId:``,videoId:``}}var pn={encode(e,n=new t){return e.channelId!==``&&n.uint32(10).string(e.channelId),e.videoId!==``&&n.uint32(18).string(e.videoId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=fn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.channelId=r.string();continue;case 2:if(e!==18)break;a.videoId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function mn(){return{ctx:void 0,unkParam:0,params:void 0}}var hn={encode(e,n=new t){return e.ctx!==void 0&&_n.encode(e.ctx,n.uint32(18).fork()).join(),e.unkParam!==0&&n.uint32(24).int32(e.unkParam),e.params!==void 0&&yn.encode(e.params,n.uint32(50).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=mn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.ctx=_n.decode(r,r.uint32());continue;case 3:if(e!==24)break;a.unkParam=r.int32();continue;case 6:if(e!==50)break;a.params=yn.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function gn(){return{videoId:``}}var _n={encode(e,n=new t){return e.videoId!==``&&n.uint32(18).string(e.videoId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=gn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.videoId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function vn(){return{unkToken:void 0,opts:void 0,repliesOpts:void 0,page:void 0,target:``}}var yn={encode(e,n=new t){return e.unkToken!==void 0&&n.uint32(10).string(e.unkToken),e.opts!==void 0&&xn.encode(e.opts,n.uint32(34).fork()).join(),e.repliesOpts!==void 0&&Cn.encode(e.repliesOpts,n.uint32(26).fork()).join(),e.page!==void 0&&n.uint32(40).int32(e.page),e.target!==``&&n.uint32(66).string(e.target),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=vn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.unkToken=r.string();continue;case 4:if(e!==34)break;a.opts=xn.decode(r,r.uint32());continue;case 3:if(e!==26)break;a.repliesOpts=Cn.decode(r,r.uint32());continue;case 5:if(e!==40)break;a.page=r.int32();continue;case 8:if(e!==66)break;a.target=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function bn(){return{videoId:``,sortBy:0,type:0,commentId:void 0}}var xn={encode(e,n=new t){return e.videoId!==``&&n.uint32(34).string(e.videoId),e.sortBy!==0&&n.uint32(48).int32(e.sortBy),e.type!==0&&n.uint32(120).int32(e.type),e.commentId!==void 0&&n.uint32(130).string(e.commentId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=bn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 4:if(e!==34)break;a.videoId=r.string();continue;case 6:if(e!==48)break;a.sortBy=r.int32();continue;case 15:if(e!==120)break;a.type=r.int32();continue;case 16:if(e!==130)break;a.commentId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Sn(){return{commentId:``,unkopts:void 0,channelId:void 0,videoId:``,unkParam1:0,unkParam2:0}}var Cn={encode(e,n=new t){return e.commentId!==``&&n.uint32(18).string(e.commentId),e.unkopts!==void 0&&Tn.encode(e.unkopts,n.uint32(34).fork()).join(),e.channelId!==void 0&&n.uint32(42).string(e.channelId),e.videoId!==``&&n.uint32(50).string(e.videoId),e.unkParam1!==0&&n.uint32(64).int32(e.unkParam1),e.unkParam2!==0&&n.uint32(72).int32(e.unkParam2),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Sn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.commentId=r.string();continue;case 4:if(e!==34)break;a.unkopts=Tn.decode(r,r.uint32());continue;case 5:if(e!==42)break;a.channelId=r.string();continue;case 6:if(e!==50)break;a.videoId=r.string();continue;case 8:if(e!==64)break;a.unkParam1=r.int32();continue;case 9:if(e!==72)break;a.unkParam2=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function wn(){return{unkParam:0}}var Tn={encode(e,n=new t){return e.unkParam!==0&&n.uint32(8).int32(e.unkParam),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=wn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.unkParam=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function En(){return{videoId:``,params:void 0,number:0}}var Dn={encode(e,n=new t){return e.videoId!==``&&n.uint32(18).string(e.videoId),e.params!==void 0&&kn.encode(e.params,n.uint32(42).fork()).join(),e.number!==0&&n.uint32(80).int32(e.number),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=En();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.videoId=r.string();continue;case 5:if(e!==42)break;a.params=kn.decode(r,r.uint32());continue;case 10:if(e!==80)break;a.number=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function On(){return{index:0}}var kn={encode(e,n=new t){return e.index!==0&&n.uint32(8).int32(e.index),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=On();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.index=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function An(){return{type:0,commentId:``,videoId:``,unkNum:void 0,channelId:void 0,translateCommentParams:void 0}}var jn={encode(e,n=new t){return e.type!==0&&n.uint32(8).int32(e.type),e.commentId!==``&&n.uint32(26).string(e.commentId),e.videoId!==``&&n.uint32(42).string(e.videoId),e.unkNum!==void 0&&n.uint32(16).int32(e.unkNum),e.channelId!==void 0&&n.uint32(186).string(e.channelId),e.translateCommentParams!==void 0&&Nn.encode(e.translateCommentParams,n.uint32(250).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=An();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.type=r.int32();continue;case 3:if(e!==26)break;a.commentId=r.string();continue;case 5:if(e!==42)break;a.videoId=r.string();continue;case 2:if(e!==16)break;a.unkNum=r.int32();continue;case 23:if(e!==186)break;a.channelId=r.string();continue;case 31:if(e!==250)break;a.translateCommentParams=Nn.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Mn(){return{params:void 0,commentId:``,targetLanguage:``}}var Nn={encode(e,n=new t){return e.params!==void 0&&Fn.encode(e.params,n.uint32(26).fork()).join(),e.commentId!==``&&n.uint32(18).string(e.commentId),e.targetLanguage!==``&&n.uint32(34).string(e.targetLanguage),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Mn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 3:if(e!==26)break;a.params=Fn.decode(r,r.uint32());continue;case 2:if(e!==18)break;a.commentId=r.string();continue;case 4:if(e!==34)break;a.targetLanguage=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Pn(){return{comment:void 0}}var Fn={encode(e,n=new t){return e.comment!==void 0&&Ln.encode(e.comment,n.uint32(10).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Pn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.comment=Ln.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function In(){return{text:``}}var Ln={encode(e,n=new t){return e.text!==``&&n.uint32(10).string(e.text),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=In();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.text=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Rn(){return{params:void 0}}var zn={encode(e,n=new t){return e.params!==void 0&&Vn.encode(e.params,n.uint32(746).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Rn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 93:if(e!==746)break;a.params=Vn.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Bn(){return{hashtag:``,type:0}}var Vn={encode(e,n=new t){return e.hashtag!==``&&n.uint32(10).string(e.hashtag),e.type!==0&&n.uint32(24).int32(e.type),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Bn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.hashtag=r.string();continue;case 3:if(e!==24)break;a.type=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Hn(){return{shortId:``,params:void 0,feature2:0,feature3:0}}var Un={encode(e,n=new t){return e.shortId!==``&&n.uint32(10).string(e.shortId),e.params!==void 0&&Gn.encode(e.params,n.uint32(42).fork()).join(),e.feature2!==0&&n.uint32(80).int32(e.feature2),e.feature3!==0&&n.uint32(104).int32(e.feature3),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Hn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.shortId=r.string();continue;case 5:if(e!==42)break;a.params=Gn.decode(r,r.uint32());continue;case 10:if(e!==80)break;a.feature2=r.int32();continue;case 13:if(e!==104)break;a.feature3=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Wn(){return{number:0}}var Gn={encode(e,n=new t){return e.number!==0&&n.uint32(24).int32(e.number),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Wn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 3:if(e!==24)break;a.number=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Kn(){return{f1:void 0}}var qn={encode(e,n=new t){return e.f1!==void 0&&Yn.encode(e.f1,n.uint32(450).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Kn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 56:if(e!==450)break;a.f1=Yn.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Jn(){return{ucid1:``,postId:``,ucid2:``}}var Yn={encode(e,n=new t){return e.ucid1!==``&&n.uint32(18).string(e.ucid1),e.postId!==``&&n.uint32(26).string(e.postId),e.ucid2!==``&&n.uint32(90).string(e.ucid2),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Jn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.ucid1=r.string();continue;case 3:if(e!==26)break;a.postId=r.string();continue;case 11:if(e!==90)break;a.ucid2=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Xn(){return{f0:void 0}}var Zn={encode(e,n=new t){return e.f0!==void 0&&$n.encode(e.f0,n.uint32(641815778).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Xn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 80226972:if(e!==641815778)break;a.f0=$n.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Qn(){return{location:``,protoData:``}}var $n={encode(e,n=new t){return e.location!==``&&n.uint32(18).string(e.location),e.protoData!==``&&n.uint32(26).string(e.protoData),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Qn();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.location=r.string();continue;case 3:if(e!==26)break;a.protoData=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function er(){return{title:``,commentDataContainer:void 0}}var tr={encode(e,n=new t){return e.title!==``&&n.uint32(18).string(e.title),e.commentDataContainer!==void 0&&rr.encode(e.commentDataContainer,n.uint32(426).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=er();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.title=r.string();continue;case 53:if(e!==426)break;a.commentDataContainer=rr.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function nr(){return{commentData:void 0,f0:0,title:``}}var rr={encode(e,n=new t){return e.commentData!==void 0&&ar.encode(e.commentData,n.uint32(34).fork()).join(),e.f0!==0&&n.uint32(56).int32(e.f0),e.title!==``&&n.uint32(66).string(e.title),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=nr();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 4:if(e!==34)break;a.commentData=ar.decode(r,r.uint32());continue;case 7:if(e!==56)break;a.f0=r.int32();continue;case 8:if(e!==66)break;a.title=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function ir(){return{sortBy:0,f0:0,f1:0,postId:``,channelId:``}}var ar={encode(e,n=new t){return e.sortBy!==0&&n.uint32(48).int32(e.sortBy),e.f0!==0&&n.uint32(120).int32(e.f0),e.f1!==0&&n.uint32(200).int32(e.f1),e.postId!==``&&n.uint32(234).string(e.postId),e.channelId!==``&&n.uint32(242).string(e.channelId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=ir();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 6:if(e!==48)break;a.sortBy=r.int32();continue;case 15:if(e!==120)break;a.f0=r.int32();continue;case 25:if(e!==200)break;a.f1=r.int32();continue;case 29:if(e!==234)break;a.postId=r.string();continue;case 30:if(e!==242)break;a.channelId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function or(e,t){let n=Xt.encode({id:e,timestamp:t});return encodeURIComponent(rx(n.finish()).replace(/\+/g,`-`).replace(/\//g,`_`))}function sr(e){return Xt.decode(ix(decodeURIComponent(e).replace(/-/g,`+`).replace(/_/g,`/`)))}function cr(e,t={}){let n={type:e,commentId:t.comment_id||` `,videoId:t.video_id||` `,channelId:` `,unkNum:2};if(t.hasOwnProperty(`text`)){if(typeof t.target_language!=`string`)throw Error(`target_language must be a string`);t.comment_id&&delete n.unkNum,n.translateCommentParams={params:{comment:{text:t.text}},commentId:t.comment_id||` `,targetLanguage:t.target_language}}let r=jn.encode(n);return encodeURIComponent(rx(r.finish()))}var lr=Symbol(`WALK_STOP`),ur=new Set(`AbortController.AbortSignal.Array.ArrayBuffer.AsyncContext.Atomics.AudioContext.BigInt.BigInt64Array.BigUint64Array.Blob.Boolean.BroadcastChannel.Buffer.CanvasRenderingContext2D.clearImmediate.clearInterval.clearTimeout.confirm.console.Crypto.CustomEvent.DataView.Date.decodeURI.decodeURIComponent.document.Element.encodeURI.encodeURIComponent.Error.escape.eval.Event.EventTarget.fetch.File.FileReader.Float32Array.Float64Array.FormData.function.global.globalThis.hasOwnProperty.Headers.History.HTMLElement.HTMLCollection.IDBKeyRange.Infinity.Int16Array.Int32Array.Int8Array.Intl.IntersectionObserver.isFinite.isNaN.isPrototypeOf.JSON.location.log.Map.Math.MediaRecorder.MediaSource.MediaStream.MemberExpression.MutationObserver.NaN.navigator.Node.NodeList.Number.Object.OfflineAudioContext.parse.parseFloat.parseInt.Performance.process.Promise.prompt.prototype.Proxy.ReadableStream.Reflect.RegExp.requestAnimationFrame.requestIdleCallback.Request.Response.ResizeObserver.Screen.setImmediate.setInterval.setTimeout.SharedArrayBuffer.SharedWorker.SourceBuffer.split.String.stringify.structuredClone.SubtleCrypto.Symbol.TextDecoder.TextEncoder.this.toString.TransformStream.Uint16Array.Uint32Array.Uint8Array.Uint8ClampedArray.undefined.unescape.URL.URLSearchParams.valueOf.WeakMap.WeakSet.WebAssembly.WebGLRenderingContext.window.Worker.WritableStream.XMLHttpRequest.alert.arguments.atob.btoa.cancelAnimationFrame.cancelIdleCallback.queueMicrotask`.split(`.`));function dr(e,t){if(!e||typeof e!=`object`)return;let n=[{node:e,parent:null,exit:!1}],r=[],i=typeof t==`function`?t:t.enter??null,a=typeof t==`function`?null:t.leave??null,o=!1;for(;!o&&n.length>0;){let{node:e,parent:t,exit:s}=n.pop();if(s){r.pop(),a&&a(e,t,r)===lr&&(o=!0);continue}if(!e||typeof e.type!=`string`)continue;let c=i?i(e,t,r):void 0;if(c===lr){o=!0;continue}if(c!==!0){n.push({node:e,parent:t,exit:!0}),r.push(e);for(let t in e){if(t===`loc`||t===`range`||t===`start`||t===`end`||!Object.prototype.hasOwnProperty.call(e,t))continue;let r=e[t];if(r){if(Array.isArray(r))for(let t=r.length-1;t>=0;t--){let i=r[t];i&&typeof i.type==`string`&&n.push({node:i,parent:e,exit:!1})}else typeof r==`object`&&typeof r.type==`string`&&n.push({node:r,parent:e,exit:!1})}}}}}function fr(e){return e?Array.isArray(e.range)?e.range:typeof e.start==`number`&&typeof e.end==`number`?[e.start,e.end]:null:null}function pr(e,t){let n=fr(e);return n?t.slice(n[0],n[1]):null}function mr(e,t){if(e.type!==`MemberExpression`)return null;let n=[],r=e;for(;r&&r.type===`MemberExpression`;){let e=r,i=e.property;if(!i)return null;if(e.computed){let e=pr(i,t);if(!e)return null;n.unshift(`[${e.trim()}]`)}else{if(i.type!==`Identifier`)return null;n.unshift(`.${i.name}`)}r=e.object}let i=null;return r?.type===`Identifier`?i=r.name:r?.type===`ThisExpression`&&(i=`this`),i?i+n.join(``):null}function hr(e,t){let n=e.object;for(;n&&n.type===`MemberExpression`;){let e=mr(n,t);if(e)return e;n=n.object}return n?.type===`Identifier`?n.name:n?.type===`ThisExpression`?`this`:null}function gr(e,t,n){if(n.type===`CallExpression`&&n.callee.type===`Identifier`&&e.declaredVariables.has(n.callee.name))return _r(t,n.callee.name,vr(e,n.arguments));if(n.type===`VariableDeclarator`&&n.init?.type===`FunctionExpression`&&n.id.type===`Identifier`)return _r(t,n.id.name,vr(e,n.init.params));if(n.type===`NewExpression`&&n.callee.type===`MemberExpression`&&n.callee.object.type===`Identifier`){let r=mr(n.callee,e.getSource());return r?_r(t,r,vr(e,n.arguments),!0):void 0}}function _r(e,t,n,r=!1){return[` function ${e}(${n.join(`, `)}) {`,` return ${r?`new `:``}${t}(${n.join(`, `)});`,` }`].join(`
|
|
3
|
+
`)}function vr(e,t){let n=[];for(let r of t)if(r.type===`Identifier`&&e.declaredVariables.has(r.name))n.push(r.name);else if(r.type===`Literal`&&(typeof r.value==`string`||typeof r.value==`number`))n.push(JSON.stringify(r.value));else if(r.type===`UnaryExpression`){let t=pr(r,e.getSource());t&&n.push(t.trim())}else r.type===`AssignmentPattern`&&r.left.type===`Identifier`?n.push(r.left.name):r.type===`Identifier`?n.push(r.name):n.includes(`input`)||n.push(`input`);return n}function yr(e){if(e.type!==`VariableDeclarator`)return!1;let t=e.init;if(!t||t.type!==`FunctionExpression`||t.params.length<3)return!1;let[n,r,i]=t.params;if(n.type!==`Identifier`||r.type!==`AssignmentPattern`||i.type!==`AssignmentPattern`)return!1;let a=t.body?.body||[],o=!1,s=!1;for(let e of a){if(e.type!==`ExpressionStatement`)continue;let t=e.expression;if(t.type===`AssignmentExpression`&&t.operator===`=`&&t.left.type===`Identifier`&&t.left.name===n.name){let e=t.right;e.type===`NewExpression`&&e.callee.type===`MemberExpression`&&(o=!0)}if(t.type===`CallExpression`&&t.callee.type===`MemberExpression`){let e=t.arguments;e.length===2&&e[0].type===`Literal`&&e[0].value===`alr`&&e[1].type===`Literal`&&e[1].value===`yes`&&(s=!0)}}return!o||!s?!1:e}function br(e){if(e.type!==`VariableDeclarator`||e.init?.type!==`FunctionExpression`)return!1;let t=e.init.body;if(!t)return!1;let n=null;return dr(t,e=>{if(e.type===`ObjectExpression`){for(let t of e.properties)if(t.type===`Property`&&t.key.type===`Identifier`&&t.key.name===`signatureTimestamp`)return n=t,lr}}),n||!1}var xr={version:`7.4.1`},Sr=((e,t)=>{let n=new Uint32Array(69632),r=0,i=0;for(;r<2661;){let a=e[r++];if(a<0)i-=a;else{let o=e[r++];a&2&&(o=t[o]),a&1?n.fill(o,i,i+=e[r++]):n[i++]=o}}return n})([-1,2,23,2,24,2,5,-1,0,77595648,3,42,2,3,0,14,2,60,2,61,3,0,3,0,3168796671,0,4294956992,2,1,2,0,2,39,3,0,4,0,4294966523,3,0,4,2,15,2,62,2,0,0,4294842879,0,3221225471,0,4294902710,2,63,0,134152192,3,0,2,0,4294951935,3,0,2,0,2683305983,0,2684354047,2,16,2,0,0,4294961151,3,0,2,2,17,2,0,0,608174079,2,0,2,56,2,7,2,6,0,4286643967,3,0,2,2,1,3,0,3,0,4294901711,2,38,0,4089839103,0,2961209759,0,1342439375,0,4294543342,0,3547201023,0,1577204103,0,4194240,0,4294688750,2,2,0,80831,0,4261478351,0,4294549486,2,2,0,2969057695,0,196559,0,3594373100,0,3288319768,0,8469959,0,65472,2,3,0,4093640191,0,929054175,0,65487,0,4294828015,0,4092591615,0,1885355487,0,982991,2,3,2,0,0,2163244511,0,4227923919,0,4236247022,2,68,0,4284449919,0,851904,2,4,2,12,0,67076095,-1,2,69,0,1073741743,0,4093607775,-1,0,50331649,0,3265266687,2,32,0,4294844415,0,4278190047,2,18,2,139,-1,3,0,2,2,28,2,0,2,10,2,0,2,14,2,20,3,0,10,2,71,2,0,2,72,2,73,2,74,2,0,2,75,2,0,2,11,0,261632,2,22,3,0,2,2,13,2,4,3,0,18,2,76,2,5,3,0,2,2,77,0,2151677951,2,26,2,9,0,909311,3,0,2,0,814743551,2,64,0,67090432,3,0,2,2,40,2,0,2,6,2,0,2,29,2,8,0,268374015,2,109,2,48,2,0,2,78,0,134153215,-1,2,7,2,0,2,8,0,2684354559,0,67044351,0,3221160064,2,0,2,27,3,0,2,2,50,0,1046528,3,0,3,2,9,2,0,2,127,0,4294960127,2,10,2,6,2,11,0,4294377472,2,12,3,0,16,2,13,2,0,2,80,2,10,2,0,2,81,2,82,2,83,0,12288,2,51,0,1048577,2,84,2,85,-1,0,536805376,0,131042,2,86,2,87,2,88,2,0,2,33,-83,3,0,7,0,1046559,2,0,2,14,2,0,0,2147516671,2,19,3,89,2,2,0,-16,2,90,0,524222462,2,4,2,0,0,4269801471,2,4,3,0,2,2,25,2,15,3,0,2,2,57,2,0,-1,2,16,-16,3,0,206,-2,3,0,692,2,70,-1,2,16,2,10,3,0,8,2,92,2,133,2,0,0,3220242431,3,0,3,2,17,2,93,2,94,3,0,2,2,95,2,0,2,10,2,96,2,0,0,4351,2,0,2,9,3,0,2,0,67043391,0,3909091327,2,0,2,21,2,9,2,18,3,0,2,0,67076097,2,8,2,0,2,19,0,67059711,0,4236247039,3,0,2,0,939524103,0,8191999,2,100,2,101,2,20,2,102,3,0,3,0,67057663,3,0,349,2,47,2,103,2,7,-264,3,0,11,2,21,3,0,2,2,31,-1,0,3774349439,2,104,2,105,3,0,2,2,17,2,106,3,0,10,2,10,2,16,2,0,2,44,2,0,2,30,2,107,2,22,0,1638399,0,57344,2,108,3,0,3,2,18,2,23,2,24,2,5,2,25,2,0,2,8,2,110,-1,2,111,2,112,2,113,-1,3,0,3,2,12,-2,2,0,2,26,-3,0,536870912,-4,2,18,2,0,2,27,0,1,2,0,2,55,2,6,2,12,2,10,2,0,2,114,-1,3,0,4,2,10,2,28,2,115,2,7,2,0,2,116,2,0,2,117,2,118,2,119,2,0,2,9,3,0,9,2,19,2,29,2,30,2,120,2,46,-2,2,121,2,122,2,29,2,19,2,8,-2,2,123,2,29,3,31,2,-1,2,0,2,37,-2,0,4277137519,0,2269118463,-1,3,18,2,-1,2,32,2,36,2,0,3,29,2,2,34,2,17,-3,3,0,2,2,33,-1,2,0,2,34,2,0,2,34,2,0,2,45,2,0,0,4294950463,2,35,-7,2,0,0,203775,0,4261476604,2,53,2,18,2,41,2,27,2,16,2,35,2,16,2,124,2,19,3,0,2,2,36,0,2151677888,2,0,2,12,0,4294901764,2,149,2,0,2,52,0,4294902e3,0,5242879,3,0,2,0,402644511,-1,2,128,2,37,0,3,-1,2,129,2,130,2,0,0,67045375,2,38,0,4226678271,0,3766565279,0,2039759,2,132,2,39,0,1046437,0,6,3,0,2,0,3288270847,0,3,3,0,2,0,67043519,-5,2,0,0,4282384383,0,1056964609,-1,3,0,2,0,67043345,-1,2,0,2,40,2,28,2,79,2,11,2,58,2,36,-5,2,0,2,12,-3,3,0,2,0,2147484671,2,134,0,4190109695,2,49,-2,2,135,0,4244635647,0,27,2,0,2,8,2,41,2,0,2,65,2,16,2,0,2,40,2,136,-2,2,30,-2,2,0,2,43,2,54,2,42,2,43,2,137,2,44,0,8388351,-2,2,138,0,3028287487,2,45,2,140,0,33259519,2,28,2,7,2,125,-7,2,19,2,46,0,3355443199,0,134152199,-2,2,66,-2,3,0,28,2,31,-3,3,0,3,2,141,3,0,6,2,47,3,0,9,2,36,-71,2,16,3,0,2,2,27,3,0,33,2,22,2,29,3,0,124,2,12,3,0,18,2,36,-213,2,0,2,31,-54,3,0,17,2,40,2,8,2,28,2,0,2,8,2,28,2,48,2,0,2,19,2,49,2,142,2,22,-13,2,0,2,50,-6,3,0,2,-1,2,143,2,9,-1,3,0,2,0,4294936575,2,0,0,4294934783,-2,0,8323099,3,0,230,2,12,2,51,2,0,0,1,-2,3,0,3,2,34,3,0,28,2,17,2,0,2,34,-240,2,144,3,0,9,2,145,2,146,2,147,3,0,11,2,7,-72,3,0,3,2,148,0,1677656575,-130,2,23,-16,2,0,2,21,2,36,-14,0,384,-1,0,4161266656,0,4071,0,15360,-4,0,2550595612,-1,0,3,-11,3,0,2,2,52,2,0,2,150,2,151,2,59,2,0,2,152,2,153,2,154,3,0,10,2,155,2,156,2,20,3,52,2,3,53,2,3,54,2,0,4294954999,2,0,-16,2,0,2,91,2,0,0,2105343,0,4160749584,0,65534,-34,3,0,4,2,158,-1,2,55,2,0,0,4194303871,0,4294903771,2,0,2,56,2,99,-3,2,0,0,1073684479,0,17407,-9,2,16,2,57,2,0,2,31,-14,2,16,2,31,-6,2,16,2,12,-6,2,8,0,3225419775,-7,2,159,3,0,6,0,8323103,-1,3,0,2,2,58,-37,2,59,2,160,2,161,2,162,2,163,2,164,-105,2,23,-32,3,0,1335,-1,3,0,136,2,8,3,0,180,2,21,3,0,233,2,165,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,264,2,31,-1244,3,0,354,-20518,3,0,7,2,22,-6130,3,5,2,-1,0,69207040,3,42,2,3,0,14,2,60,2,61,-3,0,3168731136,0,4294956864,2,1,2,0,2,39,3,0,4,0,4294966275,3,0,4,2,15,2,62,2,0,0,6655,-1,2,16,2,63,-1,2,0,0,2047,0,4294885376,3,0,2,0,3145727,0,2617294944,0,4294770688,2,22,2,55,3,0,2,0,131135,2,97,0,70256639,0,71303167,0,272,2,40,2,6,0,65279,2,0,2,64,-1,2,98,2,65,0,4278255616,0,4294836227,0,4294549473,0,600178175,0,2952806400,0,268632067,0,4294543328,0,57540095,0,1577058304,0,1835008,0,4294688736,2,67,2,66,0,33554435,2,131,2,67,0,2952790016,0,131075,0,3594373096,0,67094296,2,66,-1,0,4294828e3,0,603979263,0,922746880,0,3,0,4294828001,0,602930687,0,1879048192,0,393219,0,4294828016,0,671088639,0,2154840064,0,4227858435,0,4236247008,2,68,2,36,-1,2,4,0,917503,2,36,-1,2,69,0,537788335,0,4026531935,-1,0,1,-1,2,32,2,70,0,7936,-3,2,0,0,2147485695,0,1010761728,0,4292984930,0,16387,2,0,2,14,2,20,3,0,10,2,71,2,0,2,72,2,73,2,74,2,0,2,75,2,0,2,12,-1,2,22,3,0,2,2,13,2,4,3,0,18,2,76,2,5,3,0,2,2,77,0,2147745791,3,17,2,0,122879,2,0,2,9,0,276824064,-2,3,0,2,2,40,2,0,0,4294903295,2,0,2,29,2,8,-1,2,16,2,48,2,0,2,78,2,64,-1,2,19,2,0,2,26,-2,0,128,-2,2,25,2,9,0,8160,-1,2,126,0,4227907585,2,0,2,35,2,0,2,79,0,4227915776,2,10,2,6,2,11,-1,0,74440192,3,0,6,-2,3,0,8,2,13,2,0,2,80,2,10,2,0,2,81,2,82,2,83,-3,2,84,2,85,-3,2,86,2,87,2,88,2,0,2,33,-83,3,0,7,0,817183,2,0,2,14,2,0,0,33023,2,19,3,89,2,-17,2,90,0,524157950,2,4,2,0,2,91,2,4,2,0,2,20,2,25,2,15,3,0,2,2,57,2,0,-1,2,16,-16,3,0,206,-2,3,0,692,2,70,-1,2,16,2,10,3,0,8,2,92,0,3072,2,0,0,2147516415,2,10,3,0,2,2,22,2,93,2,94,3,0,2,2,95,2,0,2,10,2,96,0,4294965179,0,7,2,0,2,9,2,94,2,9,-1,0,1761345536,2,97,0,4294901823,2,36,2,18,2,98,2,34,2,99,0,2080440287,2,0,2,33,2,157,0,3296722943,2,0,0,1046675455,0,939524101,0,1837055,2,100,2,101,2,20,2,102,3,0,3,0,7,3,0,349,2,47,2,103,2,7,-264,3,0,11,2,21,3,0,2,2,31,-1,0,2700607615,2,104,2,105,3,0,2,2,17,2,106,3,0,10,2,10,2,16,2,0,2,44,2,0,2,30,2,107,-3,2,108,3,0,3,2,18,-1,3,5,2,2,109,2,0,2,8,2,110,-1,2,111,2,112,2,113,-1,3,0,3,2,12,-2,2,0,2,26,-8,2,18,2,0,2,27,-1,2,0,2,55,2,6,2,29,2,10,2,0,2,114,-1,3,0,4,2,10,2,16,2,115,2,7,2,0,2,116,2,0,2,117,2,118,2,119,2,0,2,9,3,0,9,2,19,2,29,2,30,2,120,2,46,-2,2,121,2,122,2,29,2,19,2,8,-2,2,123,2,29,3,31,2,-1,2,0,2,37,-2,0,4277075969,2,29,-1,3,18,2,-1,2,32,2,124,2,0,3,29,2,2,34,2,17,-3,3,0,2,2,33,-1,2,0,2,34,2,0,2,34,2,0,2,79,2,97,0,4294934591,2,35,-7,2,0,2,125,0,4261413116,2,57,2,18,2,41,2,35,2,16,0,3,2,16,2,124,2,19,2,126,2,127,-1,0,2490368,2,126,2,22,2,16,2,33,2,126,2,36,0,4294901904,0,4718591,2,126,2,34,0,335544350,-1,2,128,0,2147487743,0,1,-1,2,129,2,130,2,8,-1,2,131,2,67,0,3758161920,0,3,2,132,0,12582911,0,655360,-1,2,0,2,26,0,2147485568,0,3,2,0,2,22,0,176,-5,2,0,2,57,0,251658240,-1,2,0,2,22,0,16,-1,2,0,0,16779263,-2,2,12,-1,2,36,-5,2,0,2,133,-3,3,0,2,2,51,2,134,0,2147549183,0,2,-2,2,135,2,27,0,10,0,4294965249,0,67633151,0,4026597376,2,0,0,536871935,2,16,2,0,2,40,2,136,-5,2,0,0,1,2,54,2,57,0,1,2,137,2,22,-3,2,138,2,27,2,139,2,140,0,16778239,2,16,2,7,0,131072,-7,2,34,0,4294836212,2,9,-3,2,66,-2,3,0,28,2,31,-3,3,0,3,2,141,3,0,6,2,47,3,0,9,2,36,-71,2,16,3,0,2,2,27,3,0,33,2,22,0,126,3,0,124,2,12,3,0,18,2,36,-213,2,10,-55,3,0,17,2,40,2,8,2,16,2,0,2,8,2,16,2,56,2,0,2,22,2,79,2,142,2,22,-13,2,0,2,70,-6,3,0,2,-1,2,143,2,9,-1,3,0,2,0,67583,-1,2,106,-2,0,8126475,3,0,230,2,12,2,51,2,0,0,1,-2,3,0,3,2,34,3,0,28,2,17,2,0,2,34,-240,2,144,3,0,9,2,145,2,146,2,147,3,0,11,2,7,-72,3,0,3,2,148,2,149,-187,3,0,2,2,52,2,0,2,150,2,151,2,59,2,0,2,152,2,153,2,154,3,0,10,2,155,2,156,2,20,3,52,2,3,53,2,3,54,2,2,157,-57,3,0,4,2,158,-1,2,55,2,0,-1,2,16,2,0,2,56,-4,2,0,0,1065361407,0,16384,-9,2,16,2,56,2,0,2,133,-14,2,16,2,133,-6,2,16,0,81919,-6,2,8,0,3223273399,-7,2,159,3,0,6,2,124,-1,3,0,2,0,2063,-37,2,59,2,160,2,161,2,162,2,163,2,164,-138,3,0,1335,-1,3,0,136,2,8,3,0,180,2,21,3,0,233,2,165,3,0,18,2,10,-77,3,0,16,2,10,-47,3,0,154,2,6,3,0,264,2,31,-1244,3,0,354,-26654],[4294967295,4294967291,4092460543,4294828031,4294967294,134217726,4294903807,268435455,2147483647,1048575,1073741823,3892314111,134217727,1061158911,4294910143,4294901759,4294901760,262143,536870911,8388607,4160749567,4294918143,65535,67043328,2281701374,4294967264,2097151,131071,4294902783,4194303,255,67108863,4294967039,511,524287,63,127,3238002687,4294549487,4290772991,33554431,4294901888,4286578687,67043329,4294770687,67043583,4294836223,4294901775,2047999,67043343,67051519,2147483648,4292870143,4294934527,4294966783,4294959104,16383,32767,67047423,4294967279,262083,20511,58720255,493567,1023,603979775,65536,602799615,805044223,4294965206,8191,1031749119,4294917631,2134769663,4286578493,4282253311,4294942719,33540095,4294905855,15,2868854591,1608515583,265232348,534519807,2147614720,4294934528,1060109444,4093640016,17376,2139062143,224,4169138175,4294909951,4286578688,4294967292,4294965759,4294836228,4294966272,4294967280,32768,8289918,4294934399,4294915071,4294965375,1602223615,4294967259,4294443008,268369920,4292804608,4294967232,486341884,4294963199,3087007615,1073692671,4128527,4279238655,4294902015,4160684047,4290246655,469499899,4294967231,4294966591,2445279231,3670015,31,197631,4294967288,16777215,4294705151,3221208447,4294902271,4294549472,4294921215,4095,4285526655,4294966527,1024,4294705152,4294966143,64,4294966719,4292935679,3774873592,4194303999,1877934080,262655,2555904,4294902256,536807423,67043839,3758096383,3959414372,3755993023,2080374783,4294835295,4294967167,4160749565,4087,8323075,2147446655,184024726,2862017156,1593309078,268434431,268434414,4294901761]),Cr=e=>!!(Sr[(e>>>5)+0]>>>e&1),wr=e=>!!(Sr[(e>>>5)+34816]>>>e&1),O=[0,0,0,0,0,0,0,0,0,0,1032,0,0,2056,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,3,0,0,8192,0,0,0,256,0,33024,0,0,242,242,114,114,114,114,114,114,594,594,0,0,16384,0,16384,0,0,67,67,67,67,67,67,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,1,0,0,4099,0,71,71,71,71,71,71,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,16384,0,16384,0,0],Tr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Er=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0];function Dr(e){return e<=127?Tr[e]>0:wr(e)}function Or(e){return e<=127?Er[e]>0:Cr(e)||e===8204||e===8205}function k(e){return e.column++,e.currentChar=e.source.charCodeAt(++e.index)}function kr(e){let t=e.currentChar;if((t&64512)!=55296)return 0;let n=e.source.charCodeAt(e.index+1);return(n&64512)==56320?65536+((t&1023)<<10)+(n&1023):0}function Ar(e,t){e.currentChar=e.source.charCodeAt(++e.index),e.flags|=1,t&4||(e.column=0,e.line++)}function jr(e){e.flags|=1,e.currentChar=e.source.charCodeAt(++e.index),e.column=0,e.line++}function Mr(e){return e===160||e===65279||e===133||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===8201||e===65519}function Nr(e){return e<65?e-48:e-65+10&15}function Pr(e){switch(e){case 134283266:return`NumericLiteral`;case 134283267:return`StringLiteral`;case 86021:case 86022:return`BooleanLiteral`;case 86023:return`NullLiteral`;case 65540:return`RegularExpression`;case 67174408:case 67174409:case 132:return`TemplateLiteral`;default:return(e&143360)==143360?`Identifier`:(e&4096)==4096?`Keyword`:`Punctuator`}}var Fr=[`SingleLine`,`MultiLine`,`HTMLOpen`,`HTMLClose`,`HashbangComment`];function Ir(e){let{source:t}=e;e.currentChar===35&&t.charCodeAt(e.index+1)===33&&(k(e),k(e),Rr(e,t,0,4,e.tokenStart))}function Lr(e,t,n,r,i,a){return r&2&&e.report(0),Rr(e,t,n,i,a)}function Rr(e,t,n,r,i){let{index:a}=e;for(e.tokenIndex=e.index,e.tokenLine=e.line,e.tokenColumn=e.column;e.index<e.end;){if(O[e.currentChar]&8){let n=e.currentChar===13;jr(e),n&&e.index<e.end&&e.currentChar===10&&(e.currentChar=t.charCodeAt(++e.index));break}if((e.currentChar^8232)<=1){jr(e);break}k(e),e.tokenIndex=e.index,e.tokenLine=e.line,e.tokenColumn=e.column}if(e.options.onComment){let n={start:{line:i.line,column:i.column},end:{line:e.tokenLine,column:e.tokenColumn}};e.options.onComment(Fr[r&255],t.slice(a,e.tokenIndex),i.index,e.tokenIndex,n)}return n|1}function zr(e,t,n){let{index:r}=e;for(;e.index<e.end;)if(e.currentChar<43){let i=!1;for(;e.currentChar===42;)if(i||=(n&=-5,!0),k(e)===47){if(k(e),e.options.onComment){let n={start:{line:e.tokenLine,column:e.tokenColumn},end:{line:e.line,column:e.column}};e.options.onComment(Fr[1],t.slice(r,e.index-2),r-2,e.index,n)}return e.tokenIndex=e.index,e.tokenLine=e.line,e.tokenColumn=e.column,n}if(i)continue;O[e.currentChar]&8?e.currentChar===13?(n|=5,jr(e)):(Ar(e,n),n=n&-5|1):k(e)}else(e.currentChar^8232)<=1?(n=n&-5|1,jr(e)):(n&=-5,k(e));e.report(18)}var Br={0:`Unexpected token`,30:`Unexpected token: '%0'`,1:`Octal escape sequences are not allowed in strict mode`,2:`Octal escape sequences are not allowed in template strings`,3:`\\8 and \\9 are not allowed in template strings`,4:`Private identifier #%0 is not defined`,5:`Illegal Unicode escape sequence`,6:`Invalid code point %0`,7:`Invalid hexadecimal escape sequence`,9:`Octal literals are not allowed in strict mode`,8:`Decimal integer literals with a leading zero are forbidden in strict mode`,10:`Expected number in radix %0`,153:`Invalid left-hand side assignment to a destructible right-hand side`,11:`Non-number found after exponent indicator`,12:`Invalid BigIntLiteral`,13:`No identifiers allowed directly after numeric literal`,14:`Escapes \\8 or \\9 are not syntactically valid escapes`,15:`Escapes \\8 or \\9 are not allowed in strict mode`,16:`Unterminated string literal`,17:`Unterminated template literal`,18:`Multiline comment was not closed properly`,19:`The identifier contained dynamic unicode escape that was not closed`,20:`Illegal character '%0'`,21:`Missing hexadecimal digits`,22:`Invalid implicit octal`,23:`Invalid line break in string literal`,24:`Only unicode escapes are legal in identifier names`,25:`Expected '%0'`,26:`Invalid left-hand side in assignment`,27:`Invalid left-hand side in async arrow`,28:`Calls to super must be in the "constructor" method of a class expression or class declaration that has a superclass`,29:`Member access on super must be in a method`,31:`Await expression not allowed in formal parameter`,32:`Yield expression not allowed in formal parameter`,95:`Unexpected token: 'escaped keyword'`,33:`Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses`,125:`Async functions can only be declared at the top level or inside a block`,34:`Unterminated regular expression`,35:`Unexpected regular expression flag`,36:`Duplicate regular expression flag '%0'`,37:`%0 functions must have exactly %1 argument%2`,38:`Setter function argument must not be a rest parameter`,39:`%0 declaration must have a name in this context`,40:`Function name may not contain any reserved words or be eval or arguments in strict mode`,41:`The rest operator is missing an argument`,42:`A getter cannot be a generator`,43:`A setter cannot be a generator`,44:`A computed property name must be followed by a colon or paren`,136:`Object literal keys that are strings or numbers must be a method or have a colon`,46:"Found `* async x(){}` but this should be `async * x(){}`",45:`Getters and setters can not be generators`,47:`'%0' can not be generator method`,48:`No line break is allowed after '=>'`,49:`The left-hand side of the arrow can only be destructed through assignment`,50:`The binding declaration is not destructible`,51:`Async arrow can not be followed by new expression`,52:`Classes may not have a static property named 'prototype'`,53:`Class constructor may not be a %0`,54:`Duplicate constructor method in class`,55:`Invalid increment/decrement operand`,56:"Invalid use of `new` keyword on an increment/decrement expression",57:"`=>` is an invalid assignment target",58:`Rest element may not have a trailing comma`,59:`Missing initializer in %0 declaration`,60:`'for-%0' loop head declarations can not have an initializer`,61:`Invalid left-hand side in for-%0 loop: Must have a single binding`,62:`Invalid shorthand property initializer`,63:`Property name __proto__ appears more than once in object literal`,64:`Let is disallowed as a lexically bound name`,65:`Invalid use of '%0' inside new expression`,66:`Illegal 'use strict' directive in function with non-simple parameter list`,67:`Identifier "let" disallowed as left-hand side expression in strict mode`,68:`Illegal continue statement`,69:`Illegal break statement`,70:"Cannot have `let[...]` as a var name in strict mode",71:`Invalid destructuring assignment target`,72:`Rest parameter may not have a default initializer`,73:`The rest argument must the be last parameter`,74:`Invalid rest argument`,76:`In strict mode code, functions can only be declared at top level or inside a block`,77:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement`,78:`Without web compatibility enabled functions can not be declared at top level, inside a block, or as the body of an if statement`,79:`Class declaration can't appear in single-statement context`,80:`Invalid left-hand side in for-%0`,81:`Invalid assignment in for-%0`,82:`for await (... of ...) is only valid in async functions and async generators`,83:`The first token after the template expression should be a continuation of the template`,85:"`let` declaration not allowed here and `let` cannot be a regular var name in strict mode",84:"`let \n [` is a restricted production at the start of a statement",86:`Catch clause requires exactly one parameter, not more (and no trailing comma)`,87:`Catch clause parameter does not support default values`,88:`Missing catch or finally after try`,89:`More than one default clause in switch statement`,90:`Illegal newline after throw`,91:`Strict mode code may not include a with statement`,92:`Illegal return statement`,93:`The left hand side of the for-header binding declaration is not destructible`,94:`new.target only allowed within functions or static blocks`,96:`'#' not followed by identifier`,102:`Invalid keyword`,101:`Can not use 'let' as a class name`,100:`'A lexical declaration can't define a 'let' binding`,99:"Can not use `let` as variable name in strict mode",97:`'%0' may not be used as an identifier in this context`,98:`Await is only valid in async functions`,103:`The %0 keyword can only be used with the module goal`,104:`Unicode codepoint must not be greater than 0x10FFFF`,105:`%0 source must be string`,106:`Only a identifier or string can be used to indicate alias`,107:`Only '*' or '{...}' can be imported after default`,108:`'import defer' must be followed by a namespace import`,109:`'import source' must be followed by a default import`,110:`Trailing decorator may be followed by method`,111:`Decorators can't be used with a constructor`,112:"Can not use `await` as identifier in module or async func",113:"Can not use `await` as identifier in module",114:`HTML comments are only allowed with web compatibility (Annex B)`,115:`The identifier 'let' must not be in expression position in strict mode`,116:"Cannot assign to `eval` and `arguments` in strict mode",117:`The left-hand side of a for-of loop may not start with 'let'`,118:`Block body arrows can not be immediately invoked without a group`,119:`Block body arrows can not be immediately accessed without a group`,120:`Unexpected strict mode reserved word`,121:`Unexpected eval or arguments in strict mode`,122:`Decorators must not be followed by a semicolon`,123:`Calling delete on expression not allowed in strict mode`,124:`Pattern can not have a tail`,126:"Can not have a `yield` expression on the left side of a ternary",127:`An arrow function can not have a postfix update operator`,128:`Invalid object literal key character after generator star`,129:`Private fields can not be deleted`,131:`Classes may not have a field called constructor`,130:`Classes may not have a private element named constructor`,132:`A class field initializer or static block may not contain arguments`,133:`Generators can only be declared at the top level or inside a block`,134:`Async methods are a restricted production and cannot have a newline following it`,135:`Unexpected character after object literal property name`,137:`Invalid key token`,138:`Label '%0' has already been declared`,139:`Label '%0' does not denote an iteration statement`,140:`Undefined label '%0'`,141:`Trailing comma is disallowed inside import(...) arguments`,142:`Invalid binding in JSON import`,143:`import() requires exactly one argument`,144:`Cannot use new with import(...)`,145:`... is not allowed in import()`,146:`Expected '=>'`,147:`Duplicate binding '%0'`,148:`Duplicate private identifier #%0`,149:`Cannot export a duplicate name '%0'`,152:`Duplicate %0 for-binding`,150:`Exported binding '%0' needs to refer to a top-level declared variable`,151:`Unexpected private field`,155:`Numeric separators are not allowed at the end of numeric literals`,154:`Only one underscore is allowed as numeric separator`,156:`JSX value should be either an expression or a quoted JSX text`,157:`Expected corresponding JSX closing tag for %0`,158:`Adjacent JSX elements must be wrapped in an enclosing tag`,159:`JSX attributes must only be assigned a non-empty 'expression'`,160:`'%0' has already been declared`,161:`'%0' shadowed a catch clause binding`,162:`Dot property must be an identifier`,163:`Encountered invalid input after spread/rest argument`,164:`Catch without try`,165:`Finally without try`,166:`Expected corresponding closing tag for JSX fragment`,167:`Coalescing and logical operators used together in the same expression must be disambiguated with parentheses`,168:`Invalid tagged template on optional chain`,169:`Invalid optional chain from super property`,170:`Invalid optional chain from new expression`,171:`Cannot use "import.meta" outside a module`,172:`Leading decorators must be attached to a class declaration`,173:`An export name cannot include a lone surrogate`,174:"A string literal cannot be used as an exported binding without `from`",175:`Private fields can't be accessed on super`,176:`The only valid meta property for import is 'import.meta'`,177:`'import.meta' must not contain escaped characters`,178:`cannot use "await" as identifier inside an async function`,179:`cannot use "await" in static blocks`,180:"Unexpected token `}`. Did you mean `}` or `{'}'}`?",181:"Unexpected token `>`. Did you mean `>` or `{'>'}`?"},A=class extends SyntaxError{start;end;range;loc;description;constructor(e,t,n,...r){let i=Br[n].replaceAll(/%(\d+)/g,(e,t)=>r[t]),a=`[`+e.line+`:`+e.column+`-`+t.line+`:`+t.column+`]: `+i;super(a),this.start=e.index,this.end=t.index,this.range=[e.index,t.index],this.loc={start:{line:e.line,column:e.column},end:{line:t.line,column:t.column}},this.description=i}},j=[`end of source`,`identifier`,`number`,`string`,`regular expression`,`false`,`true`,`null`,`template continuation`,`template tail`,`=>`,`(`,`{`,`.`,`...`,`}`,`)`,`;`,`,`,`[`,`]`,`:`,`?`,`'`,`"`,`++`,`--`,`=`,`<<=`,`>>=`,`>>>=`,`**=`,`+=`,`-=`,`*=`,`/=`,`%=`,`^=`,`|=`,`&=`,`||=`,`&&=`,`??=`,`typeof`,`delete`,`void`,`!`,`~`,`+`,`-`,`in`,`instanceof`,`*`,`%`,`/`,`**`,`&&`,`||`,`===`,`!==`,`==`,`!=`,`<=`,`>=`,`<`,`>`,`<<`,`>>`,`>>>`,`&`,`|`,`^`,`var`,`let`,`const`,`break`,`case`,`catch`,`class`,`continue`,`debugger`,`default`,`do`,`else`,`export`,`extends`,`finally`,`for`,`function`,`if`,`import`,`new`,`return`,`super`,`switch`,`this`,`throw`,`try`,`while`,`with`,`implements`,`interface`,`package`,`private`,`protected`,`public`,`static`,`yield`,`as`,`async`,`await`,`constructor`,`get`,`set`,`accessor`,`from`,`of`,`using`,`enum`,`eval`,`arguments`,`escaped keyword`,`escaped future reserved keyword`,`reserved if strict`,`#`,`BigIntLiteral`,`??`,`?.`,`WhiteSpace`,`Illegal`,`LineTerminator`,`PrivateField`,`Template`,`@`,`target`,`meta`,`LineFeed`,`Escaped`,`JSXText`],Vr=new Map([[`this`,86111],[`function`,86104],[`if`,20569],[`return`,20572],[`var`,86088],[`else`,20563],[`for`,20567],[`new`,86107],[`in`,8673330],[`typeof`,16863275],[`while`,20578],[`case`,20556],[`break`,20555],[`try`,20577],[`catch`,20557],[`delete`,16863276],[`throw`,86112],[`switch`,86110],[`continue`,20559],[`default`,20561],[`instanceof`,8411187],[`do`,20562],[`void`,16863277],[`finally`,20566],[`async`,209005],[`await`,209006],[`class`,86094],[`const`,86090],[`constructor`,209007],[`debugger`,20560],[`export`,20564],[`extends`,20565],[`false`,86021],[`from`,209011],[`get`,209008],[`implements`,36964],[`import`,86106],[`interface`,36965],[`let`,241737],[`null`,86023],[`of`,471156],[`using`,209013],[`package`,36966],[`private`,36967],[`protected`,36968],[`public`,36969],[`set`,209009],[`static`,36970],[`super`,86109],[`true`,86022],[`with`,20579],[`yield`,241771],[`enum`,86134],[`eval`,537079927],[`as`,77932],[`arguments`,537079928],[`target`,209030],[`meta`,209031],[`accessor`,209010]]),Hr=[...Vr.keys()].map(e=>e.length),Ur=Math.min(...Hr),Wr=Math.max(...Hr);function Gr(e,t,n){for(;Er[k(e)];);if(e.tokenValue=e.source.slice(e.tokenIndex,e.index),e.currentChar===92||e.currentChar>126)return qr(e,t,0,n);let r=e.index-e.tokenIndex;return r<Ur||r>Wr?208897:Vr.get(e.tokenValue)??208897}function Kr(e,t){let n=Yr(e);return Dr(n)||e.report(5),e.tokenValue=String.fromCodePoint(n),qr(e,t,1,O[n]&4)}function qr(e,t,n,r){let i=e.index;for(;e.index<e.end;)if(e.currentChar===92){e.tokenValue+=e.source.slice(i,e.index),n=1;let t=Yr(e);Or(t)||e.report(5),r&&=O[t]&4,e.tokenValue+=String.fromCodePoint(t),i=e.index}else{let t=kr(e);if(t>0)Or(t)||e.report(20,String.fromCodePoint(t)),e.currentChar=t,e.index++,e.column++;else if(!Or(e.currentChar))break;k(e)}e.index<=e.end&&(e.tokenValue+=e.source.slice(i,e.index));let{length:a}=e.tokenValue;if(r&&a>=Ur&&a<=Wr){let r=Vr.get(e.tokenValue);return r===void 0?208897|(n?-2147483648:0):n?r===209006?t&2050?-2147483527:r|-2147483648:t&1?r===36970||(r&36864)==36864?-2147483526:(r&20480)==20480?t&262144&&!(t&8)?r|-2147483648:-2147483527:-2147274629:t&262144&&!(t&8)&&(r&20480)==20480?r|-2147483648:r===241771?t&262144?-2147274629:t&1024?-2147483527:r|-2147483648:r===209005?-2147274629:(r&36864)==36864?r|-2147471360:-2147483527:r}return 208897|(n?-2147483648:0)}function Jr(e){let t=k(e);if(t===92)return 131;let n=kr(e);return n&&(t=n),Dr(t)||e.report(96),131}function Yr(e){return e.source.charCodeAt(e.index+1)!==117&&e.report(5),e.currentChar=e.source.charCodeAt(e.index+=2),e.column+=2,Xr(e)}function Xr(e){let t=0,n=e.currentChar;if(n===123){let n=e.index-2;for(;O[k(e)]&64;)if(t=t<<4|Nr(e.currentChar),t>1114111)throw new A({index:n,line:e.line,column:e.column},e.currentLocation,104);if(e.currentChar!==125)throw new A({index:n,line:e.line,column:e.column},e.currentLocation,7);return k(e),t}O[n]&64||e.report(7);let r=e.source.charCodeAt(e.index+1);O[r]&64||e.report(7);let i=e.source.charCodeAt(e.index+2);O[i]&64||e.report(7);let a=e.source.charCodeAt(e.index+3);return O[a]&64||e.report(7),t=Nr(n)<<12|Nr(r)<<8|Nr(i)<<4|Nr(a),e.currentChar=e.source.charCodeAt(e.index+=4),e.column+=4,t}function Zr(e,t,n){let r=e.currentChar,i=0,a=9,o=n&64?0:1,s=0,c=0;if(n&64)i=`.`+Qr(e,r),r=e.currentChar,r===110&&e.report(12);else{if(r===48){if(r=k(e),(r|32)==120){for(n=136,r=k(e);O[r]&4160;){if(r===95){c||e.report(154),c=0,r=k(e);continue}c=1,i=i*16+Nr(r),s++,r=k(e)}(s===0||!c)&&e.report(s===0?21:155)}else if((r|32)==111){for(n=132,r=k(e);O[r]&4128;){if(r===95){c||e.report(154),c=0,r=k(e);continue}c=1,i=i*8+(r-48),s++,r=k(e)}(s===0||!c)&&e.report(s===0?0:155)}else if((r|32)==98){for(n=130,r=k(e);O[r]&4224;){if(r===95){c||e.report(154),c=0,r=k(e);continue}c=1,i=i*2+(r-48),s++,r=k(e)}(s===0||!c)&&e.report(s===0?0:155)}else if(O[r]&32)for(t&1&&e.report(1),n=1;O[r]&16;){if(O[r]&512){n=32,o=0;break}i=i*8+(r-48),r=k(e)}else O[r]&512?(t&1&&e.report(1),e.flags|=64,n=32):r===95&&e.report(0)}if(n&48){if(o){for(;a>=0&&O[r]&4112;){if(r===95){if(r=k(e),r===95||n&32)throw new A(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},154);c=1;continue}c=0,i=10*i+(r-48),r=k(e),--a}if(c)throw new A(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},155);if(a>=0&&!Dr(r)&&r!==46)return e.tokenValue=i,e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),134283266}i+=Qr(e,r),r=e.currentChar,r===46&&(k(e)===95&&e.report(0),n=64,i+=`.`+Qr(e,e.currentChar),r=e.currentChar)}}let l=e.index,u=0;if(r===110&&n&128)u=1,r=k(e);else if((r|32)==101){r=k(e),O[r]&256&&(r=k(e));let{index:t}=e;O[r]&16||e.report(11),i+=e.source.substring(l,t)+Qr(e,r),r=e.currentChar}return(e.index<e.end&&O[r]&16||Dr(r))&&e.report(13),u?(e.tokenRaw=e.source.slice(e.tokenIndex,e.index),e.tokenValue=BigInt(e.tokenRaw.slice(0,-1).replaceAll(`_`,``)),134283389):(e.tokenValue=n&15?i:n&32?parseFloat(e.source.substring(e.tokenIndex,e.index)):+i,e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),134283266)}function Qr(e,t){let n=0,r=e.index,i=``;for(;O[t]&4112;){if(t===95){let{index:a}=e;if(t=k(e),t===95)throw new A(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},154);n=1,i+=e.source.substring(r,a),r=e.index;continue}n=0,t=k(e)}if(n)throw new A(e.currentLocation,{index:e.index+1,line:e.line,column:e.column},155);return i+e.source.substring(r,e.index)}var $r;(function(e){e[e.Empty=0]=`Empty`,e[e.Escape=1]=`Escape`,e[e.Class=2]=`Class`})($r||={});var ei;(function(e){e[e.Empty=0]=`Empty`,e[e.IgnoreCase=1]=`IgnoreCase`,e[e.Global=2]=`Global`,e[e.Multiline=4]=`Multiline`,e[e.Unicode=16]=`Unicode`,e[e.Sticky=8]=`Sticky`,e[e.DotAll=32]=`DotAll`,e[e.Indices=64]=`Indices`,e[e.UnicodeSets=128]=`UnicodeSets`})(ei||={});function ti(e){let t=e.index,n=$r.Empty;loop:for(;;){let t=e.currentChar;if(k(e),n&$r.Escape)n&=~$r.Escape;else switch(t){case 47:if(n)break;break loop;case 92:n|=$r.Escape;break;case 91:n|=$r.Class;break;case 93:n&=$r.Escape}if((t===13||t===10||t===8232||t===8233)&&e.report(34),e.index>=e.source.length)return e.report(34)}let r=e.index-1,i=ei.Empty,a=e.currentChar,{index:o}=e;for(;Or(a);){switch(a){case 103:i&ei.Global&&e.report(36,`g`),i|=ei.Global;break;case 105:i&ei.IgnoreCase&&e.report(36,`i`),i|=ei.IgnoreCase;break;case 109:i&ei.Multiline&&e.report(36,`m`),i|=ei.Multiline;break;case 117:i&ei.Unicode&&e.report(36,`u`),i&ei.UnicodeSets&&e.report(36,`vu`),i|=ei.Unicode;break;case 118:i&ei.Unicode&&e.report(36,`uv`),i&ei.UnicodeSets&&e.report(36,`v`),i|=ei.UnicodeSets;break;case 121:i&ei.Sticky&&e.report(36,`y`),i|=ei.Sticky;break;case 115:i&ei.DotAll&&e.report(36,`s`),i|=ei.DotAll;break;case 100:i&ei.Indices&&e.report(36,`d`),i|=ei.Indices;break;default:e.report(35)}a=k(e)}let s=e.source.slice(o,e.index),c=e.source.slice(t,r);return e.tokenRegExp={pattern:c,flags:s},e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),e.tokenValue=ni(e,c,s),65540}function ni(e,t,n){try{return new RegExp(t,n)}catch{if(!e.options.validateRegex)return null;e.report(34)}}function ri(e,t,n){let{index:r}=e,i=``,a=k(e),o=e.index;for(;!(O[a]&8);){if(a===n)return i+=e.source.slice(o,e.index),k(e),e.options.raw&&(e.tokenRaw=e.source.slice(r,e.index)),e.tokenValue=i,134283267;if((a&8)==8&&a===92){if(i+=e.source.slice(o,e.index),a=k(e),a<127||a===8232||a===8233){let n=ii(e,t,a);n>=0?i+=String.fromCodePoint(n):ai(e,n,0)}else i+=String.fromCodePoint(a);o=e.index+1}else(a===8232||a===8233)&&(e.column=-1,e.line++);e.index>=e.end&&e.report(16),a=k(e)}e.report(16)}function ii(e,t,n,r=0){switch(n){case 98:return 8;case 102:return 12;case 114:return 13;case 110:return 10;case 116:return 9;case 118:return 11;case 13:if(e.index<e.end){let t=e.source.charCodeAt(e.index+1);t===10&&(e.index+=1,e.currentChar=t)}case 10:case 8232:case 8233:return e.column=-1,e.line++,-1;case 48:case 49:case 50:case 51:{let i=n-48,a=e.index+1,o=e.column+1;if(a<e.end){let n=e.source.charCodeAt(a);if(!(O[n]&32)){if(i!==0||O[n]&512){if(t&1||r)return-2;e.flags|=64}}else if(t&1||r)return-2;else{if(e.currentChar=n,i=i<<3|n-48,a++,o++,a<e.end){let t=e.source.charCodeAt(a);O[t]&32&&(e.currentChar=t,i=i<<3|t-48,a++,o++)}e.flags|=64}e.index=a-1,e.column=o-1}return i}case 52:case 53:case 54:case 55:{if(r||t&1)return-2;let i=n-48,a=e.index+1,o=e.column+1;if(a<e.end){let t=e.source.charCodeAt(a);O[t]&32&&(i=i<<3|t-48,e.currentChar=t,e.index=a,e.column=o)}return e.flags|=64,i}case 120:{let t=k(e);if(!(O[t]&64))return-4;let n=Nr(t),r=k(e);if(!(O[r]&64))return-4;let i=Nr(r);return n<<4|i}case 117:{let t=k(e);if(e.currentChar===123){let t=0,n=0;for(;O[k(e)]&64;){if(t=t<<4|Nr(e.currentChar),t>1114111)return-5;n++}return n===0||e.currentChar<1||e.currentChar!==125?-4:t}{if(!(O[t]&64))return-4;let n=e.source.charCodeAt(e.index+1);if(!(O[n]&64))return-4;let r=e.source.charCodeAt(e.index+2);if(!(O[r]&64))return-4;let i=e.source.charCodeAt(e.index+3);return O[i]&64?(e.index+=3,e.column+=3,e.currentChar=e.source.charCodeAt(e.index),Nr(t)<<12|Nr(n)<<8|Nr(r)<<4|Nr(i)):-4}}case 56:case 57:if(r||t&1)return-3;e.flags|=4096;default:return n}}function ai(e,t,n){switch(t){case-1:return;case-2:e.report(n?2:1);case-3:e.report(n?3:14);case-4:e.report(7);case-5:e.report(104)}}function oi(e,t){let{index:n}=e,r=67174409,i=``,a=!1,o=k(e);for(;o!==96;){if(o===36&&e.source.charCodeAt(e.index+1)===123){k(e),r=67174408;break}if(o===92){if(o=k(e),o===13&&(a=!0),o>126&&o!==8232&&o!==8233)i+=String.fromCodePoint(o);else{let{index:n,line:s,column:c}=e,l=ii(e,t|1,o,1);if(l>=0)i+=String.fromCodePoint(l);else if(l!==-1&&t&64){e.index=n,e.line=s,e.column=c,i=null,o=si(e,o,()=>{a=!0}),o<0&&(r=67174408);break}else ai(e,l,1)}}else e.index<e.end&&(o===13&&(a=!0),o===13&&e.source.charCodeAt(e.index+1)===10&&(e.currentChar=e.source.charCodeAt(++e.index)),o===13&&(o=10),((o&83)<3&&o===10||(o^8232)<=1)&&(e.column=-1,e.line++),i+=String.fromCodePoint(o));e.index>=e.end&&e.report(17),o=k(e)}k(e),e.tokenValue=i;let s=e.source.slice(n+1,e.index-(r===67174409?1:2));return e.tokenRaw=a?s.replaceAll(/\r\n?/g,`
|
|
4
|
+
`):s,r}function si(e,t,n){for(;t!==96;){switch(t){case 13:n();break;case 36:{let n=e.index+1;if(n<e.end&&e.source.charCodeAt(n)===123)return e.index=n,e.column++,-t;break}case 10:case 8232:case 8233:e.column=-1,e.line++}e.index>=e.end&&e.report(17),t=k(e)}return t}function ci(e,t){return e.index>=e.end&&e.report(0),e.index--,e.column--,oi(e,t)}var li=[129,129,129,129,129,129,129,129,129,128,136,128,128,130,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,128,16842798,134283267,131,208897,8391477,8390213,134283267,67174411,16,8391476,25233968,18,25233969,67108877,8457014,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,134283266,21,1074790417,8456256,1077936155,8390721,22,133,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,208897,69271571,137,20,8389959,208897,132,4096,4096,4096,4096,4096,4096,4096,208897,4096,208897,208897,4096,208897,4096,208897,4096,208897,4096,4096,4096,208897,4096,4096,208897,4096,4096,2162700,8389702,1074790415,16842799,129];function M(e,t){e.flags=(e.flags|1)^1,e.startIndex=e.index,e.startColumn=e.column,e.startLine=e.line,e.setToken(ui(e,t,0))}function ui(e,t,n){let r=e.index===0,{source:i}=e;for(;e.index<e.end;){e.tokenIndex=e.index,e.tokenColumn=e.column,e.tokenLine=e.line;let a=e.currentChar;if(a<=126){let o=li[a];switch(o){case 67174411:case 16:case 2162700:case 1074790415:case 69271571:case 20:case 21:case 1074790417:case 18:case 16842799:case 133:case 129:return k(e),o;case 208897:return Gr(e,t,0);case 4096:return Gr(e,t,1);case 134283266:return Zr(e,t,144);case 134283267:return ri(e,t,a);case 132:return oi(e,t);case 137:return Kr(e,t);case 131:return Jr(e);case 128:k(e);break;case 130:n|=5,jr(e);break;case 136:Ar(e,n),n=n&-5|1;break;case 8456256:{let r=k(e);if(e.index<e.end){if(r===60)return e.index<e.end&&k(e)===61?(k(e),4194332):8390978;if(r===61)return k(e),8390718;if(r===33){let r=e.index+1;if(r+1<e.end&&i.charCodeAt(r)===45&&i.charCodeAt(r+1)==45){e.column+=3,e.currentChar=i.charCodeAt(e.index+=3),n=Lr(e,i,n,t,2,e.tokenStart);continue}return 8456256}}return 8456256}case 1077936155:{k(e);let t=e.currentChar;return t===61?k(e)===61?(k(e),8390458):8390460:t===62?(k(e),10):1077936155}case 16842798:return k(e)===61?k(e)===61?(k(e),8390459):8390461:16842798;case 8391477:return k(e)===61?(k(e),4194340):8391477;case 8391476:{if(k(e),e.index>=e.end)return 8391476;let t=e.currentChar;return t===61?(k(e),4194338):t===42?k(e)===61?(k(e),4194335):8391735:8391476}case 8389959:return k(e)===61?(k(e),4194341):8389959;case 25233968:{k(e);let t=e.currentChar;return t===43?(k(e),33619993):t===61?(k(e),4194336):25233968}case 25233969:{k(e);let a=e.currentChar;if(a===45){if(k(e),(n&1||r)&&e.currentChar===62){e.options.webcompat||e.report(114),k(e),n=Lr(e,i,n,t,3,e.tokenStart);continue}return 33619994}return a===61?(k(e),4194337):25233969}case 8457014:if(k(e),e.index<e.end){let r=e.currentChar;if(r===47){k(e),n=Rr(e,i,n,0,e.tokenStart);continue}if(r===42){k(e),n=zr(e,i,n);continue}if(t&32)return ti(e);if(r===61)return k(e),4259875}return 8457014;case 67108877:{let n=k(e);if(n>=48&&n<=57)return Zr(e,t,80);if(n===46){let t=e.index+1;if(t<e.end&&i.charCodeAt(t)===46)return e.column+=2,e.currentChar=i.charCodeAt(e.index+=2),14}return 67108877}case 8389702:{k(e);let t=e.currentChar;return t===124?(k(e),e.currentChar===61?(k(e),4718632):8913465):t===61?(k(e),4194342):8389702}case 8390721:{if(k(e),t&1048576)return 8390721;let n=e.currentChar;if(n===61)return k(e),8390719;if(n!==62)return 8390721;if(k(e),e.index<e.end){let t=e.currentChar;if(t===62)return k(e)===61?(k(e),4194334):8390980;if(t===61)return k(e),4194333}return 8390979}case 8390213:{k(e);let t=e.currentChar;return t===38?(k(e),e.currentChar===61?(k(e),4718633):8913720):t===61?(k(e),4194343):8390213}case 22:{let t=k(e);if(t===63)return k(e),e.currentChar===61?(k(e),4718634):276824446;if(t===46){let n=e.index+1;if(n<e.end&&(t=i.charCodeAt(n),!(t>=48&&t<=57)))return k(e),67108991}return 22}}}else{if((a^8232)<=1){n=n&-5|1,jr(e);continue}let r=kr(e);if(r>0&&(a=r),wr(a))return e.tokenValue=``,qr(e,t,0,0);if(Mr(a)){k(e);continue}e.report(20,String.fromCodePoint(a))}}return 1048576}function di(e,t){!(e.flags&1)&&(e.getToken()&1048576)!=1048576&&e.report(30,j[e.getToken()&255]),N(e,t,1074790417)||e.options.onInsertedSemicolon?.(e.startIndex)}function fi(e,t,n,r){return t-n<13&&r===`use strict`&&((e.getToken()&1048576)==1048576||e.flags&1)?1:0}function pi(e,t,n){return e.getToken()===n?(M(e,t),1):0}function N(e,t,n){return e.getToken()===n&&(M(e,t),!0)}function P(e,t,n){e.getToken()!==n&&e.report(25,j[n&255]),M(e,t)}function mi(e,t){let n=t;switch(t.type){case`ArrayExpression`:{n.type=`ArrayPattern`;let{elements:r}=t;for(let t=0,n=r.length;t<n;++t){let n=r[t];n&&mi(e,n)}return}case`ObjectExpression`:{n.type=`ObjectPattern`;let{properties:r}=t;for(let t=0,n=r.length;t<n;++t)mi(e,r[t]);return}case`AssignmentExpression`:n.type=`AssignmentPattern`,t.operator!==`=`&&e.report(71),delete n.operator,mi(e,t.left);return;case`Property`:mi(e,t.value);return;case`SpreadElement`:n.type=`RestElement`,mi(e,t.argument)}}function hi(e,t,n,r,i){t&1&&((r&36864)==36864&&e.report(120),!i&&(r&537079808)==537079808&&e.report(121)),((r&20480)==20480||r===-2147483527)&&e.report(102),n&24&&(r&255)==73&&e.report(100),t&2050&&r===209006&&e.report(112),t&1025&&r===241771&&e.report(97,`yield`)}function gi(e,t,n){t&1&&((n&36864)==36864&&e.report(120),(n&537079808)==537079808&&e.report(121),n===-2147483526&&e.report(95),n===-2147483527&&e.report(95)),(n&20480)==20480&&e.report(102),t&2050&&n===209006&&e.report(112),t&1025&&n===241771&&e.report(97,`yield`)}function _i(e,t,n){return(n&255)==110&&(t&2050&&e.report(112),e.destructible&128||(e.firstAwaitLocation??={start:e.tokenStart,end:e.currentLocation}),e.destructible|=128),n===241771&&t&1024&&e.report(97,`yield`),(n&20480)==20480||(n&36864)==36864||n==-2147483526}function vi(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`}function yi(e,t,n,r){let i=0;for(;t;){if(t.names?.has(n))return r&&!i&&e.report(139,n),1;i=+!!t.loop,t=t.parent}return 0}function bi(e,t,n){let r=t;for(;r;)r.names?.has(n)&&e.report(138,n),r=r.parent;(t.names??=new Set).add(n)}function xi(e){switch(e.type){case`JSXIdentifier`:return e.name;case`JSXNamespacedName`:return xi(e.namespace)+`:`+e.name.name;case`JSXMemberExpression`:return xi(e.object)+`.`+xi(e.property)}}function Si(e,t){return e&1025?e&2&&t===209006||e&1024&&t===241771?!1:(t&12288)==12288:(t&12288)==12288||(t&36864)==36864}function Ci(e,t,n){(n&537079808)==537079808&&(t&1&&e.report(121),e.flags|=512),t&1&&(n&255)==73&&e.report(99),Si(t,n)||e.report(0)}var wi=new Map(Object.entries({quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}));function Ti(e){return e.replaceAll(/&(?:[\da-zA-Z]+|#x[\da-fA-F]+|#\d+);/g,e=>{if(e.charAt(1)===`#`){let t=e.charAt(2)===`x`?parseInt(e.slice(3),16):parseInt(e.slice(2),10);return t>1114111?e:String.fromCodePoint(t)}return wi.get(e.slice(1,-1))??e})}function Ei(e,t){return e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.setToken(O[e.currentChar]&8192?Di(e):ui(e,t,0)),e.getToken()}function Di(e){let t=e.currentChar,n=k(e),r=e.index;for(;n!==t;)e.index>=e.end&&e.report(16),n===13?(e.source.charCodeAt(e.index+1)===10&&k(e),e.column=-1,e.line++):(n===10||n===8232||n===8233)&&(e.column=-1,e.line++),n=k(e);return n!==t&&e.report(16),e.tokenValue=Ti(e.source.slice(r,e.index)),k(e),e.options.raw&&(e.tokenRaw=e.source.slice(e.tokenIndex,e.index)),134283267}function Oi(e){if(e.startIndex=e.tokenIndex=e.index,e.startColumn=e.tokenColumn=e.column,e.startLine=e.tokenLine=e.line,e.index>=e.end){e.setToken(1048576);return}if(e.currentChar===60){k(e),e.setToken(8456256);return}if(e.currentChar===123){k(e),e.setToken(2162700);return}e.currentChar===125&&e.report(180),e.currentChar===62&&e.report(181);let t=0,n=!1;for(;e.index<e.end;){let r=e.source.charCodeAt(e.index);if(r===13?(t|=5,n=!0,jr(e)):r===10?(Ar(e,t),t=t&-5|1):r===8232||r===8233?(e.flags|=1,e.currentChar=e.source.charCodeAt(++e.index),e.column=0,e.line++,t=t&-5|1):k(e),O[e.currentChar]&16384)break}e.tokenIndex===e.index&&e.report(0);let r=e.source.slice(e.tokenIndex,e.index),i=n?r.replaceAll(`\r
|
|
5
|
+
`,`
|
|
6
|
+
`):r;e.options.raw&&(e.tokenRaw=i),e.tokenValue=Ti(i),e.setToken(138)}function ki(e){if(e.getToken()&143360){let{index:t}=e,n=e.currentChar;for(;O[n]&32770;)n=k(e);e.tokenValue+=e.source.slice(t,e.index),e.setToken(208897,!0)}return e.getToken()}var Ai=7;function ji(e){if(e)return e===!0?{start:!0,end:!0,range:!0}:{start:e.start??!1,end:e.end??!1,range:e.range??!1}}function Mi(e){let{features:t,next:n,ranges:r,module:i,sourceType:a,globalReturn:o,...s}={validateRegex:!0,features:0,...e};return n&&(t|=Ai),r=ji(r),i&&!a&&(a=`module`),o&&(!a||a===`script`)&&(a=`commonjs`),{...s,ranges:r,features:t,sourceType:a}}var Ni=class{parser;parent;refs=Object.create(null);privateIdentifiers=new Map;constructor(e,t){this.parser=e,this.parent=t}addPrivateIdentifier(e,t){let{privateIdentifiers:n}=this,r=t&800;r&768||(r|=768);let i=n.get(e);this.hasPrivateIdentifier(e)&&((i&32)!=(r&32)||i&r&768)&&this.parser.report(148,e),n.set(e,this.hasPrivateIdentifier(e)?i|r:r)}addPrivateIdentifierRef(e){this.refs[e]??=[],this.refs[e].push(this.parser.tokenStart)}isPrivateIdentifierDefined(e){return this.hasPrivateIdentifier(e)||!!this.parent?.isPrivateIdentifierDefined(e)}validatePrivateIdentifierRefs(){for(let e in this.refs)if(!this.isPrivateIdentifierDefined(e)){let{index:t,line:n,column:r}=this.refs[e][0];throw new A({index:t,line:n,column:r},{index:t+e.length,line:n,column:r+e.length},4,e)}}hasPrivateIdentifier(e){return this.privateIdentifiers.has(e)}},Pi=class e{parser;type;parent;scopeError;variableBindings=new Map;constructor(e,t=2,n){this.parser=e,this.type=t,this.parent=n}createChildScope(t){return new e(this.parser,t,this)}addVarOrBlock(e,t,n,r,i,a){n&4?this.addVarName(e,t,n,r,i):this.addBlockName(e,t,n,r,i,a),a&64&&this.parser.declareUnboundVariable(t)}addVarName(e,t,n,r,i){let{parser:a}=this,o=this;for(;o&&!(o.type&128);){let{variableBindings:s}=o,c=s.get(t);if(c&&c&248&&!(a.options.webcompat&&!(e&1)&&(n&128&&c&68||c&128&&n&68))||(o===this&&c&&c&1&&n&1&&o.recordScopeError(147,r,i,t),c&&(c&256||c&512&&!a.options.webcompat)))throw new A(r,i,147,t);o.variableBindings.set(t,n),o=o.parent}}hasVariable(e){return this.variableBindings.has(e)}addBlockName(e,t,n,r,i,a=0){let{parser:o}=this,s=this.variableBindings.get(t);if(s&&!(s&2)){if(n&1)this.recordScopeError(147,r,i,t);else if(!(o.options.webcompat&&!(e&1)&&a&2&&s===64&&n===64))throw new A(r,i,147,t)}if(this.type&64&&this.parent?.hasVariable(t)&&!(this.parent.variableBindings.get(t)&2))throw new A(r,i,147,t);if(this.type&512&&s&&!(s&2)&&n&1&&this.recordScopeError(147,r,i,t),this.type&32&&this.parent.variableBindings.get(t)&768)throw new A(r,i,161,t);this.variableBindings.set(t,n)}recordScopeError(e,t,n,...r){this.scopeError??={type:e,params:r,start:t,end:n}}reportScopeError(){let{scopeError:e}=this;if(e)throw new A(e.start,e.end,e.type,...e.params)}};function Fi(e,t,n,r,i){let a=e.createScope().createChildScope(512);return a.addBlockName(t,n,1,r,i),a}var Ii=class{source;lastOnToken=null;options;token=1048576;flags=0;features=0;index=0;line=1;column=0;startIndex=0;end=0;tokenIndex=0;startColumn=0;tokenColumn=0;tokenLine=1;startLine=1;tokenValue=``;tokenRaw=``;tokenRegExp=void 0;currentChar=0;exportedNames=new Set;exportedBindings=new Set;assignable=0;destructible=0;strictReservedRange=null;firstAwaitLocation=null;firstYieldLocation=null;leadingDecorators={decorators:[]};constructor(e,t={}){this.source=e,this.end=e.length,this.currentChar=e.charCodeAt(0),this.options=Mi(t),this.features=this.options.features,Array.isArray(this.options.onComment)&&(this.options.onComment=Li(this.options.onComment,this.options)),Array.isArray(this.options.onToken)&&(this.options.onToken=Ri(this.options.onToken,this.options))}getToken(){return this.token}setToken(e,t=!1){this.token=e;let{onToken:n}=this.options;if(n){if(e!==1048576){let r={start:{line:this.tokenLine,column:this.tokenColumn},end:{line:this.line,column:this.column}};!t&&this.lastOnToken&&n(...this.lastOnToken),this.lastOnToken=[Pr(e),this.tokenIndex,this.index,r]}else this.lastOnToken&&=(n(...this.lastOnToken),null)}return e}get tokenStart(){return{index:this.tokenIndex,line:this.tokenLine,column:this.tokenColumn}}get startPosition(){return{index:this.startIndex,line:this.startLine,column:this.startColumn}}get currentLocation(){return{index:this.index,line:this.line,column:this.column}}finishNode(e,t,n){let{ranges:r}=this.options;if(r){let i=n?n.index:this.startIndex;r.start&&(e.start=t.index),r.end&&(e.end=i),r.range&&(e.range=[t.index,i])}return this.options.loc&&(e.loc={start:{line:t.line,column:t.column},end:n?{line:n.line,column:n.column}:{line:this.startLine,column:this.startColumn}},this.options.source&&(e.loc.source=this.options.source)),e}addBindingToExports(e){this.exportedBindings.add(e)}declareUnboundVariable(e){let{exportedNames:t}=this;t.has(e)&&this.report(149,e),t.add(e)}report(e,...t){throw new A(this.tokenStart,this.currentLocation,e,...t)}createScopeIfLexical(e,t){if(this.options.lexical)return this.createScope(e,t)}createScope(e,t){return new Pi(this,e,t)}createPrivateScopeIfLexical(e){if(this.options.lexical)return new Ni(this,e)}cloneIdentifier(e){return structuredClone(e)}cloneStringLiteral(e){return structuredClone(e)}};function Li(e,t){return function(n,r,i,a,o){let s={type:n,value:r},{ranges:c}=t;c&&(c.start&&(s.start=i),c.end&&(s.end=a),c.range&&(s.range=[i,a])),t.loc&&(s.loc=o),e.push(s)}}function Ri(e,t){return function(n,r,i,a){let o={token:n},{ranges:s}=t;s&&(s.start&&(o.start=r),s.end&&(o.end=i),s.range&&(o.range=[r,i])),t.loc&&(o.loc=a),e.push(o)}}function zi(e,t={},n=0){let r=new Ii(e,t);r.options.sourceType===`module`&&(n|=3),r.options.sourceType===`commonjs`&&(n|=69632),r.options.impliedStrict&&(n|=1),Ir(r);let i=r.createScopeIfLexical(),a,o=`script`;if(n&2){if(o=`module`,a=Vi(r,n|8,i),i)for(let e of r.exportedBindings)i.hasVariable(e)||r.report(150,e)}else a=Bi(r,n|8,i);return r.finishNode({type:`Program`,sourceType:o,body:a},{index:0,line:1,column:0},r.currentLocation)}function Bi(e,t,n){M(e,t|262176);let r=[];for(;e.getToken()===134283267;){let{index:n,tokenValue:i,tokenStart:a,tokenIndex:o}=e,s=e.getToken(),c=co(e,t);if(fi(e,n,o,i)){if(t|=1,e.flags&64)throw new A(e.tokenStart,e.currentLocation,9);if(e.flags&4096)throw new A(e.tokenStart,e.currentLocation,15)}r.push(Qi(e,t,c,s,a))}for(;e.getToken()!==1048576;)r.push(Ui(e,t,n,void 0,{},4));return r}function Vi(e,t,n){M(e,t|32);let r=[];for(;e.getToken()===134283267;){let{tokenStart:n}=e,i=e.getToken();r.push(Qi(e,t,co(e,t),i,n))}for(;e.getToken()!==1048576;)r.push(Hi(e,t,n));return r}function Hi(e,t,n){e.getToken()===133&&Object.assign(e.leadingDecorators,{start:e.tokenStart,decorators:Lo(e,t,void 0)});let r;switch(e.getToken()){case 20564:r=ja(e,t,n);break;case 86106:e.leadingDecorators.decorators.length&&e.report(172),r=Ta(e,t,n);break;default:r=Ui(e,t,n,void 0,{},4)}return r}function Ui(e,t,n,r,i,a=2){let o=e.tokenStart;switch(e.leadingDecorators.decorators.length&&e.getToken()!==86094&&e.report(172),e.getToken()){case 86104:return fo(e,t,n,r,1,0,0,o,a);case 133:e.features&1||e.report(30,`@`);case 86094:return Fo(e,t,n,r,0);case 86090:return ya(e,t,n,r,16);case 241737:return ma(e,t,n,r,a);case 209013:return _a(e,t,n,r,i,a);case 209006:return(t&2048||t&2&&t&8)&&ha(e)?va(e,t,n,r,i,a):Wi(e,t,n,r,i,1,a);case 20564:e.report(103,`export`);case 86106:switch(M(e,t),e.getToken()){case 67174411:return Aa(e,t,r,o);case 67108877:return ka(e,t,o);default:e.report(103,`import`)}case 209005:return Zi(e,t,n,r,i,1,a);default:return Wi(e,t,n,r,i,1,a)}}function Wi(e,t,n,r,i,a,o=0){switch(e.getToken()){case 86088:return ba(e,t,n,r);case 20572:return Ji(e,t,r);case 20569:return ta(e,t,n,r,i);case 20567:return Ca(e,t,n,r,i);case 20562:return pa(e,t,n,r,i);case 20578:return ia(e,t,n,r,i);case 86110:return ra(e,t,n,r,i);case 1074790417:return $i(e,t);case 2162700:return qi(e,t,n?.createChildScope(),r,i,e.tokenStart);case 86112:return ea(e,t,r);case 20555:return sa(e,t,i);case 20559:return oa(e,t,i);case 20577:return ua(e,t,n,r,i);case 20579:return ca(e,t,n,r,i);case 20560:return la(e,t);case 209005:return Zi(e,t,n,r,i,0,o);case 20557:e.report(164);case 20566:e.report(165);case 86104:e.report(t&1?76:e.options.webcompat?77:78);case 86094:e.report(79);default:return Gi(e,t,n,r,i,a,o)}}function Gi(e,t,n,r,i,a,o){let{tokenValue:s,tokenStart:c}=e,l=e.getToken(),u;switch(l){case 241737:u=R(e,t),t&1&&e.report(85),e.getToken()===69271571&&e.report(84);break;default:u=Ja(e,t,r,2,0,1,0,1,e.tokenStart,0,1)}return Ki(e,t,n,r,i,a,u,l,s,c,o)}function Ki(e,t,n,r,i,a,o,s,c,l,u){if(s&143360&&e.getToken()===21)return Xi(e,t,n,r,i,c,o,s,a,l,u);let d=L(e,t,r,o,0,0,l);return d=I(e,t,r,0,0,l,d),e.getToken()===18&&(d=Ma(e,t,r,0,l,d)),Yi(e,t,d,l)}function qi(e,t,n,r,i,a=e.tokenStart,o=`BlockStatement`){let s=[];for(P(e,t|32,2162700);e.getToken()!==1074790415;)s.push(Ui(e,t,n,r,{parent:i}));return P(e,t|32,1074790415),e.finishNode({type:o,body:s},a)}function Ji(e,t,n){t&4096||e.report(92);let r=e.tokenStart;M(e,t|32);let i=e.flags&1||e.getToken()&1048576?null:Na(e,t,n,0,1,e.tokenStart);return di(e,t|32),e.finishNode({type:`ReturnStatement`,argument:i},r)}function Yi(e,t,n,r){return di(e,t|32),e.finishNode({type:`ExpressionStatement`,expression:n},r)}function Xi(e,t,n,r,i,a,o,s,c,l,u){hi(e,t,0,s,1),bi(e,i,a),M(e,t|32);let d=c&&!(t&1)&&e.options.webcompat&&e.getToken()===86104?fo(e,t,n?.createChildScope(),r,0,0,0,e.tokenStart,u):Wi(e,t,n,r,i,c,u);return e.finishNode({type:`LabeledStatement`,label:o,body:d},l)}function Zi(e,t,n,r,i,a,o){let{tokenValue:s,tokenStart:c}=e,l=e.getToken(),u=R(e,t);if(e.getToken()===21)return Xi(e,t,n,r,i,s,u,l,1,c,o);let d=e.flags&1;if(!d){if(e.getToken()===86104)return a||e.report(125),fo(e,t,n,r,1,0,1,c,o);if(Si(t,e.getToken()))return u=Mo(e,t,r,1,c),e.getToken()===18&&(u=Ma(e,t,r,0,c,u)),Yi(e,t,u,c)}return e.getToken()===67174411?u=No(e,t,r,u,1,1,d,c):(e.getToken()===10&&(Ci(e,t,l),(l&36864)==36864&&(e.flags|=256),u=To(e,t|2048,r,e.tokenValue,u,0,1,0,c)),e.assignable=1),u=L(e,t,r,u,0,0,c),u=I(e,t,r,0,0,c,u),e.assignable=1,e.getToken()===18&&(u=Ma(e,t,r,0,c,u)),Yi(e,t,u,c)}function Qi(e,t,n,r,i){let a=e.startIndex;r!==1074790417&&(e.assignable=2,n=L(e,t,void 0,n,0,0,i),e.getToken()!==1074790417&&(n=I(e,t,void 0,0,0,i,n),e.getToken()===18&&(n=Ma(e,t,void 0,0,i,n))),di(e,t|32));let o={type:`ExpressionStatement`,expression:n};return n.type===`Literal`&&typeof n.value==`string`&&(o.directive=e.source.slice(i.index+1,a-1)),e.finishNode(o,i)}function $i(e,t){let n=e.tokenStart;return M(e,t|32),e.finishNode({type:`EmptyStatement`},n)}function ea(e,t,n){let r=e.tokenStart;M(e,t|32),e.flags&1&&e.report(90);let i=Na(e,t,n,0,1,e.tokenStart);return di(e,t|32),e.finishNode({type:`ThrowStatement`,argument:i},r)}function ta(e,t,n,r,i){let a=e.tokenStart;M(e,t),P(e,t|32,67174411),e.assignable=1;let o=Na(e,t,r,0,1,e.tokenStart);P(e,t|32,16);let s=na(e,t,n,r,i),c=null;return e.getToken()===20563&&(M(e,t|32),c=na(e,t,n,r,i)),e.finishNode({type:`IfStatement`,test:o,consequent:s,alternate:c},a)}function na(e,t,n,r,i){let{tokenStart:a}=e;return t&1||!e.options.webcompat||e.getToken()!==86104?Wi(e,t,n,r,{parent:i},0):fo(e,t,n?.createChildScope(),r,0,0,0,a)}function ra(e,t,n,r,i){let a=e.tokenStart;M(e,t),P(e,t|32,67174411);let o=Na(e,t,r,0,1,e.tokenStart);P(e,t,16),P(e,t,2162700);let s=[],c=0;for(n=n?.createChildScope(8);e.getToken()!==1074790415;){let{tokenStart:a}=e,o=null,l=[];for(N(e,t|32,20556)?o=Na(e,t,r,0,1,e.tokenStart):(P(e,t|32,20561),c&&e.report(89),c=1),P(e,t|32,21);e.getToken()!==20556&&e.getToken()!==1074790415&&e.getToken()!==20561;){let a=Ui(e,t|4,n,r,{parent:i});a.type===`VariableDeclaration`&&(a.kind===`using`||a.kind===`await using`)&&e.report(30,a.kind),l.push(a)}s.push(e.finishNode({type:`SwitchCase`,test:o,consequent:l},a))}return P(e,t|32,1074790415),e.finishNode({type:`SwitchStatement`,discriminant:o,cases:s},a)}function ia(e,t,n,r,i){let a=e.tokenStart;M(e,t),P(e,t|32,67174411);let o=Na(e,t,r,0,1,e.tokenStart);P(e,t|32,16);let s=aa(e,t,n,r,i);return e.finishNode({type:`WhileStatement`,test:o,body:s},a)}function aa(e,t,n,r,i){return Wi(e,(t|131072)^131072|128,n,r,{loop:1,parent:i},0)}function oa(e,t,n){t&128||e.report(68);let r=e.tokenStart;M(e,t);let i=null;if(!(e.flags&1)&&e.getToken()&143360){let{tokenValue:r}=e;yi(e,n,r,1)||e.report(140,r),i=R(e,t|32)}return di(e,t|32),e.finishNode({type:`ContinueStatement`,label:i},r)}function sa(e,t,n){let r=e.tokenStart;M(e,t|32);let i=null;if(!(e.flags&1)&&e.getToken()&143360){let{tokenValue:r}=e;yi(e,n,r,0)||e.report(140,r),i=R(e,t|32)}else t&132||e.report(69);return di(e,t|32),e.finishNode({type:`BreakStatement`,label:i},r)}function ca(e,t,n,r,i){let a=e.tokenStart;M(e,t),t&1&&e.report(91),P(e,t|32,67174411);let o=Na(e,t,r,0,1,e.tokenStart);P(e,t|32,16);let s=Wi(e,t,n,r,i,0,2);return e.finishNode({type:`WithStatement`,object:o,body:s},a)}function la(e,t){let n=e.tokenStart;return M(e,t|32),di(e,t|32),e.finishNode({type:`DebuggerStatement`},n)}function ua(e,t,n,r,i){let a=e.tokenStart;M(e,t|32);let o=n?.createChildScope(16),s=qi(e,t,o,r,{parent:i}),{tokenStart:c}=e,l=N(e,t|32,20557)?da(e,t,n,r,i,c):null,u=null;if(e.getToken()===20566){M(e,t|32);let a=n?.createChildScope(4);u=qi(e,t,a,r,{parent:i})}return!l&&!u&&e.report(88),e.finishNode({type:`TryStatement`,block:s,handler:l,finalizer:u},a)}function da(e,t,n,r,i,a){let o=null;N(e,t,67174411)&&(n=n?.createChildScope(4),o=Uo(e,t,n,r,(e.getToken()&2097152)==2097152?256:512),e.getToken()===18?e.report(86):e.getToken()===1077936155&&e.report(87),P(e,t|32,16));let s=n?.createChildScope(32),c=qi(e,t,s,r,{parent:i});return e.finishNode({type:`CatchClause`,param:o,body:c},a)}function fa(e,t,n,r,i){n=n?.createChildScope();let a=5764;return t=(t|a)^a|592128,qi(e,t,n,r,{},i,`StaticBlock`)}function pa(e,t,n,r,i){let a=e.tokenStart;M(e,t|32);let o=aa(e,t,n,r,i);P(e,t,20578),P(e,t|32,67174411);let s=Na(e,t,r,0,1,e.tokenStart);return P(e,t|32,16),N(e,t|32,1074790417),e.finishNode({type:`DoWhileStatement`,body:o,test:s},a)}function ma(e,t,n,r,i){let{tokenValue:a,tokenStart:o,currentLocation:s}=e,c=e.getToken(),l=R(e,t);if(e.getToken()&2240512&&(e.getToken()&20480)!=20480){let i=xa(e,t,n,r,8);return di(e,t|32),e.finishNode({type:`VariableDeclaration`,kind:`let`,declarations:i},o)}if(e.assignable=1,t&1&&e.report(85),e.getToken()===21)return Xi(e,t,n,r,{},a,l,c,0,o,i);if(e.getToken()===10){let n;e.options.lexical&&(n=Fi(e,t,a,o,s)),e.flags=(e.flags|128)^128,l=Do(e,t,n,r,[l],0,o)}else l=L(e,t,r,l,0,0,o),l=I(e,t,r,0,0,o,l);return e.getToken()===18&&(l=Ma(e,t,r,0,o,l)),Yi(e,t,l,o)}function ha(e){let{index:t,source:n}=e,r=t;for(;r<e.end;){let t=n.charCodeAt(r);if(t===10||t===13||t===8232||t===8233)return!1;if(/\s/u.test(n[r])){r++;continue}if(t===47&&n.charCodeAt(r+1)===42){for(r+=2;r<e.end;){let e=n.charCodeAt(r);if(e===10||e===13||e===8232||e===8233)return!1;if(e===42&&n.charCodeAt(r+1)===47){r+=2;break}r++}continue}break}if(n.slice(r,r+5)!==`using`)return!1;let i=n.codePointAt(r+5);return i===void 0||i!==92&&!Or(i)}function ga(e){return(e&143360)==143360&&(e&20480)!=20480}function _a(e,t,n,r,i,a){let{tokenStart:o,tokenValue:s,currentLocation:c}=e,l=e.getToken(),u=R(e,t);if(!(e.flags&1)&&ga(e.getToken()))return a&4&&t&8&&!(t&2)&&!(t&4096)&&e.report(30,j[e.getToken()&255]),ya(e,t,n,r,16,a,`using`,o,1);if(e.assignable=1,e.getToken()===10){let n;return e.options.lexical&&(n=Fi(e,t,s,o,c)),e.flags=(e.flags|128)^128,Yi(e,t,Do(e,t,n,r,[u],0,o),o)}return Ki(e,t,n,r,i,1,u,l,s,o,a)}function va(e,t,n,r,i,a){let o=e.tokenStart;t&524288&&e.report(179),M(e,t|32);let s;if(!(e.flags&1)&&e.getToken()===209013){let i=e.tokenStart,c=R(e,t);if(!(e.flags&1)&&ga(e.getToken()))return ya(e,t,n,r,16,a,`await using`,o,1);s=L(e,t,r,c,0,0,i)}else s=Ua(e,t,r,0,0,1);return e.getToken()===8391735&&e.report(33),e.assignable=2,Ki(e,t,n,r,i,0,e.finishNode({type:`AwaitExpression`,argument:s},o),1048576,``,o,a)}function ya(e,t,n,r,i,a=0,o,s=e.tokenStart,c=0){let l=s;c||M(e,t);let u=xa(e,t,n,r,i,a,o);return di(e,t|32),e.finishNode({type:`VariableDeclaration`,kind:o??(i&8?`let`:`const`),declarations:u},l)}function ba(e,t,n,r,i=0){let a=e.tokenStart;M(e,t);let o=xa(e,t,n,r,4,i);return di(e,t|32),e.finishNode({type:`VariableDeclaration`,kind:`var`,declarations:o},a)}function xa(e,t,n,r,i,a=0,o){let s=1,c=Sa(e,t,n,r,i,a,o),l=[c],u=o&&e.options.lexical?new Set([c.id.name]):void 0;for(;N(e,t,18);){s++;let c=Sa(e,t,n,r,i,a,o);if(u){let{name:t}=c.id;u.has(t)&&e.report(147,t),u.add(t)}l.push(c)}return s>1&&a&32&&e.getToken()&262144&&e.report(61,j[e.getToken()&255]),l}function Sa(e,t,n,r,i,a,o){let{tokenStart:s}=e,c=e.getToken(),l=null;o&&(c&2097152)==2097152&&e.report(50);let u=Uo(e,t,n,r,i,a);if(e.getToken()===1077936155){if(M(e,t|32),l=F(e,t,r,1,0,e.tokenStart,a),a&32&&(e.getToken()===471156||e.getToken()===8673330&&(c&2097152||!(i&4)||t&1||!e.options.webcompat)))throw new A(s,e.currentLocation,60,e.getToken()===471156?`of`:`in`)}else(i&16||(c&2097152)>0)&&(e.getToken()&262144)!=262144&&e.report(59,o??(i&16?`const`:`destructuring`));return e.finishNode({type:`VariableDeclarator`,id:u,init:l},s)}function Ca(e,t,n,r,i){let a=e.tokenStart;M(e,t);let o=((t&2048)>0||(t&2)>0&&(t&8)>0)&&N(e,t,209006);P(e,t|32,67174411),n=n?.createChildScope(1);let s=null,c=null,l=0,u=null,d=e.getToken()===86088||e.getToken()===241737||e.getToken()===86090||e.getToken()===209013,f,p=!1,m,{tokenStart:h}=e,g=e.getToken();if(d){if(g===241737)u=R(e,t),e.getToken()&2240512&&(e.getToken()&20480)!=20480?(u=e.finishNode({type:`VariableDeclaration`,kind:`let`,declarations:xa(e,t|131072,n,r,8,32)},h),e.assignable=1):t&1?e.report(67):(d=!1,e.assignable=1,u=L(e,t,r,u,0,0,h),e.getToken()===471156&&e.report(117));else if(g===209013){let i=R(e,t);if(e.flags&1||!ga(e.getToken()))d=!1,e.assignable=1,u=L(e,t,r,i,0,0,h);else if(e.getToken()===471156){let a=e.tokenStart,o=e.currentLocation,s=e.getToken(),c=e.tokenValue,l=R(e,t);if(e.getToken()!==1077936155&&e.getToken()!==8673330&&e.getToken()!==1074790417&&e.getToken()!==18)d=!1,p=!0,e.assignable=1,u=i;else{f=`using`,hi(e,t,16,s,0),n?.addBlockName(t,c,16,a,o,32);let i=null;if(e.getToken()===1077936155){if(M(e,t|32),i=F(e,t|131072,r,1,0,e.tokenStart),(e.getToken()&262144)==262144)throw new A(a,e.currentLocation,60,e.getToken()===471156?`of`:`in`)}else e.getToken()!==8673330&&e.report(59,f);let d=[e.finishNode({type:`VariableDeclarator`,id:l,init:i},a)],p=e.options.lexical?new Set([c]):void 0;for(;N(e,t|131072,18);){let i=Sa(e,t|131072,n,r,16,32,f);if(p){let{name:t}=i.id;p.has(t)&&e.report(147,t),p.add(t)}d.push(i)}d.length>1&&e.getToken()&262144&&e.report(61,j[e.getToken()&255]),u=e.finishNode({type:`VariableDeclaration`,kind:f,declarations:d},h),e.assignable=1}}else f=`using`,u=e.finishNode({type:`VariableDeclaration`,kind:f,declarations:xa(e,t|131072,n,r,16,32,f)},h),e.assignable=1}else M(e,t),u=e.finishNode(g===86088?{type:`VariableDeclaration`,kind:`var`,declarations:xa(e,t|131072,n,r,4,32)}:{type:`VariableDeclaration`,kind:`const`,declarations:xa(e,t|131072,n,r,16,32)},h),e.assignable=1}else if(g===209006&&(t&2048||t&2&&t&8)){t&524288&&e.report(179),M(e,t|32);let i;if(!(e.flags&1)&&e.getToken()===209013){let a=e.tokenStart,o=R(e,t);!(e.flags&1)&&ga(e.getToken())?(f=`await using`,d=!0,u=e.finishNode({type:`VariableDeclaration`,kind:f,declarations:xa(e,t|131072,n,r,16,32,f)},h),e.assignable=1):i=L(e,t,r,o,0,0,a)}else i=Ua(e,t,r,0,0,1);d||(e.getToken()===8391735&&e.report(33),e.assignable=2,u=e.finishNode({type:`AwaitExpression`,argument:i},h))}else if(o&&g===209005){let n=R(e,t);e.assignable=1,u=L(e,t|131072,r,n,0,0,h)}else if(g===1074790417)o&&e.report(82);else if((g&2097152)==2097152){let n=e.tokenStart;u=g===2162700?bo(e,t,void 0,r,1,0,0,2,32):ho(e,t,void 0,r,1,0,0,2,32),l=e.destructible,l&64&&e.report(63),e.assignable=l&16?2:1,u=L(e,t|131072,r,u,0,0,n)}else u=Ua(e,t|131072,r,1,0,1);if(p||(e.getToken()&262144)==262144){if(p||e.getToken()===471156){e.assignable&2&&e.report(80,o?`await`:`of`),mi(e,u),p||M(e,t|32),m=F(e,t,r,1,0,e.tokenStart),P(e,t|32,16);let s=aa(e,t,n,r,i);return e.finishNode({type:`ForOfStatement`,left:u,right:m,body:s,await:o},a)}f&&e.report(30,`in`),e.assignable&2&&e.report(80,`in`),mi(e,u),M(e,t|32),o&&e.report(82),m=Na(e,t,r,0,1,e.tokenStart),P(e,t|32,16);let s=aa(e,t,n,r,i);return e.finishNode({type:`ForInStatement`,body:s,left:u,right:m},a)}o&&e.report(82),d||(l&8&&e.getToken()!==1077936155&&e.report(80,`loop`),u=I(e,t|131072,r,0,0,h,u)),e.getToken()===18&&(u=Ma(e,t,r,0,h,u)),P(e,t|32,1074790417),e.getToken()!==1074790417&&(s=Na(e,t,r,0,1,e.tokenStart)),P(e,t|32,1074790417),e.getToken()!==16&&(c=Na(e,t,r,0,1,e.tokenStart)),P(e,t|32,16);let _=aa(e,t,n,r,i);return e.finishNode({type:`ForStatement`,init:u,test:s,update:c,body:_},a)}function wa(e,t,n){return Si(t,e.getToken())||e.report(120),(e.getToken()&537079808)==537079808&&e.report(121),n?.addBlockName(t,e.tokenValue,8,e.tokenStart,e.currentLocation),R(e,t)}function Ta(e,t,n){let r=e.tokenStart;M(e,t);let i,a=!1,o=null,{tokenStart:s}=e,c=[];if(e.getToken()===134283267)i=co(e,t);else{if(e.getToken()&143360){let r=e.getToken(),{tokenValue:l,tokenStart:u,currentLocation:d}=e,f=e.features&2&&!(r&-2147483648)&&l==`defer`,p=e.features&4&&!(r&-2147483648)&&l==`source`;if(f||p){let r=R(e,t);if(l===`defer`)e.getToken()===8391476?(o=`defer`,c=[Ea(e,t,n)]):e.getToken()===209011||e.getToken()===18?(n?.addBlockName(t,l,8,u,d),c=[e.finishNode({type:`ImportDefaultSpecifier`,local:r},s)]):e.report(108);else if(e.getToken()===209011){let f=e.getToken(),p=e.tokenStart,m=e.currentLocation,h=R(e,t);e.getToken()===209011?(hi(e,t,16,f,0),n?.addBlockName(t,h.name,8,p,m),o=`source`,c=[e.finishNode({type:`ImportDefaultSpecifier`,local:h},p)]):(n?.addBlockName(t,l,8,u,d),c=[e.finishNode({type:`ImportDefaultSpecifier`,local:r},s)],e.getToken()!==134283267&&e.report(105,`Import`),i=co(e,t),a=!0)}else if(e.getToken()&143360){o=`source`;let r=e.tokenStart,i=wa(e,t,n);c=[e.finishNode({type:`ImportDefaultSpecifier`,local:i},r)]}else e.getToken()===18?(n?.addBlockName(t,l,8,u,d),c=[e.finishNode({type:`ImportDefaultSpecifier`,local:r},s)]):e.report(109)}else{let r=wa(e,t,n);c=[e.finishNode({type:`ImportDefaultSpecifier`,local:r},s)]}if(o===null&&!a&&N(e,t,18))switch(e.getToken()){case 8391476:c.push(Ea(e,t,n));break;case 2162700:Oa(e,t,n,c);break;default:e.report(107)}}else switch(e.getToken()){case 8391476:c=[Ea(e,t,n)];break;case 2162700:Oa(e,t,n,c);break;case 67174411:return Aa(e,t,void 0,r);case 67108877:return ka(e,t,r);default:e.report(30,j[e.getToken()&255])}a||(i=Da(e,t))}let l=Qa(e,t),u={type:`ImportDeclaration`,specifiers:c,source:i,attributes:l,...e.features&2||e.features&4?{phase:o}:null};return di(e,t|32),e.finishNode(u,r)}function Ea(e,t,n){let{tokenStart:r}=e;if(M(e,t),P(e,t,77932),(e.getToken()&134217728)==134217728)throw new A(r,e.currentLocation,30,j[e.getToken()&255]);return e.finishNode({type:`ImportNamespaceSpecifier`,local:wa(e,t,n)},r)}function Da(e,t){return P(e,t,209011),e.getToken()!==134283267&&e.report(105,`Import`),co(e,t)}function Oa(e,t,n,r){for(M(e,t);e.getToken()&143360||e.getToken()===134283267;){let{tokenValue:i,tokenStart:a,currentLocation:o}=e,s=a,c=e.getToken(),l=to(e,t),u;N(e,t,77932)?((e.getToken()&134217728)==134217728||e.getToken()===18?e.report(106):hi(e,t,16,e.getToken(),0),i=e.tokenValue,a=e.tokenStart,o=e.currentLocation,u=R(e,t)):l.type===`Identifier`?(hi(e,t,16,c,0),u=e.cloneIdentifier(l)):e.report(25,j[108]),n?.addBlockName(t,i,8,a,o),r.push(e.finishNode({type:`ImportSpecifier`,local:u,imported:l},s)),e.getToken()!==1074790415&&P(e,t,18)}return P(e,t,1074790415),r}function ka(e,t,n){let r=Xa(e,t,e.finishNode({type:`Identifier`,name:`import`},n),n);return r=L(e,t,void 0,r,0,0,n),r=I(e,t,void 0,0,0,n,r),e.getToken()===18&&(r=Ma(e,t,void 0,0,n,r)),Yi(e,t,r,n)}function Aa(e,t,n,r){let i=Za(e,t,n,0,r);return i=L(e,t,n,i,0,0,r),e.getToken()===18&&(i=Ma(e,t,n,0,r,i)),Yi(e,t,i,r)}function ja(e,t,n){let r=e.leadingDecorators.decorators.length?e.leadingDecorators.start:e.tokenStart;M(e,t|32);let i=N(e,t|32,20561);e.leadingDecorators.decorators.length&&e.getToken()!==86094&&e.report(172);let a=[],o=null,s=null,c=[];if(i){switch(e.getToken()){case 86104:o=fo(e,t,n,void 0,1,1,0,e.tokenStart,4);break;case 133:e.features&1||e.report(30,`@`);case 86094:o=Fo(e,t,n,void 0,1);break;case 209005:{let{tokenStart:r}=e;o=R(e,t);let{flags:i}=e;if(!(i&1)&&e.getToken()===86104){o=fo(e,t,n,void 0,1,1,1,r,4);break}e.getToken()===10?o=To(e,t&-9,void 0,`async`,o,0,1,0,r):!(i&1)&&e.getToken()===67174411?(o=No(e,t,void 0,o,1,1,i,r),o=L(e,t,void 0,o,0,0,r),o=I(e,t,void 0,0,0,r,o)):!(i&1)&&e.getToken()&143360?(n&&=Fi(e,t,e.tokenValue,e.tokenStart,e.currentLocation),o=R(e,t),o=Do(e,t,n,void 0,[o],1,r)):(o=L(e,t,void 0,o,0,0,r),o=I(e,t,void 0,0,0,r,o)),di(e,t|32);break}default:o=F(e,t,void 0,1,0,e.tokenStart),di(e,t|32)}return n&&e.declareUnboundVariable(`default`),e.finishNode({type:`ExportDefaultDeclaration`,declaration:o},r)}switch(e.getToken()){case 8391476:{M(e,t);let i=null;N(e,t,77932)&&(n&&e.declareUnboundVariable(e.tokenValue),i=to(e,t)),P(e,t,209011),e.getToken()!==134283267&&e.report(105,`Export`),s=co(e,t);let a=Qa(e,t),o={type:`ExportAllDeclaration`,source:s,exported:i,attributes:a};return di(e,t|32),e.finishNode(o,r)}case 2162700:{M(e,t);let r=[],i=[],o=0;for(;e.getToken()&143360||e.getToken()===134283267;){let{tokenStart:s,tokenValue:c}=e,l=to(e,t);l.type===`Literal`&&(o=1);let u;e.getToken()===77932?(M(e,t),!(e.getToken()&143360)&&e.getToken()!==134283267&&e.report(106),n&&(r.push(e.tokenValue),i.push(c)),u=to(e,t)):(n&&(r.push(e.tokenValue),i.push(e.tokenValue)),u=l.type===`Literal`?e.cloneStringLiteral(l):e.cloneIdentifier(l)),a.push(e.finishNode({type:`ExportSpecifier`,local:l,exported:u},s)),e.getToken()!==1074790415&&P(e,t,18)}P(e,t,1074790415),N(e,t,209011)?(e.getToken()!==134283267&&e.report(105,`Export`),s=co(e,t),c=Qa(e,t),n&&r.forEach(t=>e.declareUnboundVariable(t))):(o&&e.report(174),n&&(r.forEach(t=>e.declareUnboundVariable(t)),i.forEach(t=>e.addBindingToExports(t)))),di(e,t|32);break}case 133:e.features&1||e.report(30,`@`);case 86094:o=Fo(e,t,n,void 0,2);break;case 86104:o=fo(e,t,n,void 0,1,2,0,e.tokenStart,4);break;case 241737:o=ya(e,t,n,void 0,8,64);break;case 86090:o=ya(e,t,n,void 0,16,64);break;case 86088:o=ba(e,t,n,void 0,64);break;case 209005:{let{tokenStart:r}=e;if(M(e,t),!(e.flags&1)&&e.getToken()===86104){o=fo(e,t,n,void 0,1,2,1,r,4);break}}default:e.report(30,j[e.getToken()&255])}let l={type:`ExportNamedDeclaration`,declaration:o,specifiers:a,source:s,attributes:c};return e.finishNode(l,r)}function F(e,t,n,r,i,a,o=0){let s=Ja(e,t,n,2,0,r,i,1,a,o,t&131072?0:1);return s=L(e,t,n,s,i,0,a),I(e,t,n,i,0,a,s)}function Ma(e,t,n,r,i,a){let o=[a];for(;N(e,t|32,18);)o.push(F(e,t,n,1,r,e.tokenStart));return e.finishNode({type:`SequenceExpression`,expressions:o},i)}function Na(e,t,n,r,i,a){let o=F(e,t,n,i,r,a);return e.getToken()===18?Ma(e,t,n,r,a,o):o}function I(e,t,n,r,i,a,o){let s=e.getToken();if((s&4194304)==4194304){e.assignable&2&&e.report(26),(s&524288)==524288&&e.assignable&4&&e.report(26),(!i&&s===1077936155&&o.type===`ArrayExpression`||o.type===`ObjectExpression`)&&mi(e,o),M(e,t|32);let c=F(e,t,n,1,r,e.tokenStart);return e.assignable=2,e.finishNode(i?{type:`AssignmentPattern`,left:o,right:c}:{type:`AssignmentExpression`,left:o,operator:j[s&255],right:c},a)}return(s&8388608)==8388608&&(o=Ia(e,t,n,r,a,4,s,o)),N(e,t|32,22)&&(o=Fa(e,t,n,o,a)),o}function Pa(e,t,n,r,i,a,o){let s=e.getToken();M(e,t|32);let c=F(e,t,n,1,r,e.tokenStart);return o=e.finishNode(i?{type:`AssignmentPattern`,left:o,right:c}:{type:`AssignmentExpression`,left:o,operator:j[s&255],right:c},a),e.assignable=2,o}function Fa(e,t,n,r,i){let a=F(e,(t|131072)^131072,n,1,0,e.tokenStart);P(e,t|32,21),e.assignable=1;let o=F(e,t,n,1,0,e.tokenStart);return e.assignable=2,e.finishNode({type:`ConditionalExpression`,test:r,consequent:a,alternate:o},i)}function Ia(e,t,n,r,i,a,o,s){if((e.flags&16384)==16384)return e.flags=(e.flags|16384)^16384,s;let c=-((t&131072)>0)&8673330,l,u;for(e.assignable=2;e.getToken()&8388608&&(l=e.getToken(),u=l&3840,(l&524288&&o&268435456||o&524288&&l&268435456)&&e.report(167),!(u+((l===8391735)<<8)-((c===l)<<12)<=a));)M(e,t|32),s=e.finishNode({type:l&524288||l&268435456?`LogicalExpression`:`BinaryExpression`,left:s,right:Ia(e,t,n,r,e.tokenStart,u,l,Ua(e,t,n,0,r,1,+(!(t&131072)&&2048>u))),operator:j[l&255]},i);return e.getToken()===1077936155&&e.report(26),s}function La(e,t,n,r,i){r||e.report(0);let{tokenStart:a}=e,o=e.getToken();M(e,t|32);let s=Ua(e,t,n,0,i,1);return e.getToken()===8391735&&e.report(33),t&1&&o===16863276&&(s.type===`Identifier`?e.report(123):vi(s)&&e.report(129)),e.assignable=2,e.finishNode({type:`UnaryExpression`,operator:j[o&255],argument:s,prefix:!0},a)}function Ra(e,t,n,r,i,a,o,s){let c=e.getToken(),l=R(e,t),{flags:u}=e;if(!(u&1)){if(e.getToken()===86104)return po(e,t,n,1,r,s);if(Si(t,e.getToken()))return i||e.report(0),(e.getToken()&36864)==36864&&(e.flags|=256),Mo(e,t,n,a,s)}return!o&&e.getToken()===67174411?No(e,t,n,l,a,1,u,s):e.getToken()===10?(Ci(e,t,c),o&&e.report(51),(c&36864)==36864&&(e.flags|=256),To(e,t,n,e.tokenValue,l,o,a,0,s)):(e.assignable=1,l)}function za(e,t,n,r,i,a){if(r&&(e.destructible&256||(e.firstYieldLocation??={start:a,end:e.currentLocation}),e.destructible|=256),t&1024){if(M(e,t|32),t&8192)throw new A(a,e.startPosition,32);i||e.report(26),e.getToken()===22&&e.report(126);let r=null,o=!1;return e.flags&1?e.getToken()===8391476&&e.report(30,j[e.getToken()&255]):(o=N(e,t|32,8391476),(e.getToken()&77824||o)&&(r=F(e,t,n,1,0,e.tokenStart))),e.getToken()&75497472&&(r===null&&!(e.flags&1)&&e.report(30,j[e.getToken()&255]),e.flags|=16384),e.assignable=2,e.finishNode({type:`YieldExpression`,argument:r,delegate:o},a)}return t&1&&e.report(97,`yield`),wo(e,t,n)}function Ba(e,t,n,r,i,a){i&&(e.destructible&128||(e.firstAwaitLocation??={start:a,end:e.currentLocation}),e.destructible|=128),t&524288&&e.report(179);let o=!!(e.getToken()&-2147483648),s=wo(e,t,n,!o&&t&2050?1:0);if(o||s.type===`ArrowFunctionExpression`||!(e.getToken()&65536)){if(t&2048)throw new A(a,e.startPosition,178);if(t&2||t&8192&&t&2048)throw new A(a,e.startPosition,112);return s}if(t&8192&&(t&2050||e.getToken()&143360))throw new A(a,e.startPosition,31);if(t&2048||t&2&&t&8){if(r)throw new A(a,e.startPosition,0);let i=Ua(e,t,n,0,0,1);return e.getToken()===8391735&&e.report(33),e.assignable=2,e.finishNode({type:`AwaitExpression`,argument:i},a)}if(t&2)throw new A(a,e.startPosition,98);return s}function Va(e,t,n,r,i,a,o=0){let{tokenStart:s}=e;e.flags&=-4161,P(e,t|32,2162700);let c=[];if(e.getToken()!==1074790415){for(;e.getToken()===134283267;){let{index:n,tokenStart:r,tokenIndex:i,tokenValue:o}=e,s=e.getToken(),l=co(e,t);if(fi(e,n,i,o)){if(t|=1,e.flags&128)throw new A(r,e.currentLocation,66);if(e.flags&64)throw new A(r,e.currentLocation,9);if(e.flags&4096)throw new A(r,e.currentLocation,15);a?.reportScopeError()}c.push(Qi(e,t,l,s,r))}if(t&1&&(i&&((i&537079808)==537079808&&e.report(121),(i&36864)==36864&&e.report(40)),e.flags&512&&e.report(121),e.flags&256)){if(e.strictReservedRange)throw new A(e.strictReservedRange[0],e.strictReservedRange[1],120);e.report(120)}}for(e.flags=(e.flags|4928)^4928,e.destructible=(e.destructible|256)^256;e.getToken()!==1074790415;)c.push(Ui(e,t,n,r,{},4));return P(e,o&24?t|32:t,1074790415),e.flags&=-4289,e.getToken()===1077936155&&e.report(26),e.finishNode({type:`BlockStatement`,body:c},s)}function Ha(e,t){let{tokenStart:n}=e;switch(M(e,t),e.getToken()){case 67108991:e.report(169);case 67174411:t&512||e.report(28),e.assignable=2;break;case 69271571:case 67108877:t&256||e.report(29),e.assignable=1;break;default:e.report(30,`super`)}return e.finishNode({type:`Super`},n)}function Ua(e,t,n,r,i,a,o=0){let s=e.tokenStart;return L(e,t,n,Ja(e,t,n,2,0,r,i,a,s,0,o),i,0,s)}function Wa(e,t,n,r){e.assignable&2&&e.report(55);let i=e.getToken();return M(e,t),e.assignable=2,e.finishNode({type:`UpdateExpression`,argument:n,operator:j[i&255],prefix:!1},r)}function L(e,t,n,r,i,a,o){if((e.getToken()&33619968)==33619968&&!(e.flags&1))r=Wa(e,t,r,o);else if((e.getToken()&67108864)==67108864){if((e.flags&16384)==16384)return e.flags=(e.flags|16384)^16384,r;switch(t=(t|131072)^131072,e.getToken()){case 67108877:{M(e,(t|262152)^8),t&16&&e.getToken()===131&&e.tokenValue===`super`&&e.report(175),e.assignable=(e.flags&2048)==2048?2:1;let i=Ka(e,t|64,n,1);r=e.finishNode({type:`MemberExpression`,object:r,computed:!1,property:i,optional:!1},o);break}case 69271571:{if((e.flags&8192)==8192)return e.flags=(e.flags|8192)^8192,r;let a=!1;(e.flags&2048)==2048&&(a=!0,e.flags=(e.flags|2048)^2048),M(e,t|32);let{tokenStart:s}=e,c=Na(e,t,n,i,1,s);P(e,t,20),e.assignable=a?2:1,r=e.finishNode({type:`MemberExpression`,object:r,computed:!0,property:c,optional:!1},o),a&&(e.flags|=2048);break}case 67174411:{if((e.flags&1024)==1024)return e.flags=(e.flags|1024)^1024,r;let a=!1;(e.flags&2048)==2048&&(a=!0,e.flags=(e.flags|2048)^2048);let s=so(e,t,n,i);e.assignable=!(t&1)&&e.options.webcompat?4:2,r=e.finishNode({type:`CallExpression`,callee:r,arguments:s,optional:!1},o),a&&(e.flags|=2048);break}case 67108991:M(e,(t|262152)^8),e.flags|=2048,e.assignable=2,r=Ga(e,t,n,r,o);break;default:(e.flags&2048)==2048&&e.report(168),e.assignable=2,r=e.finishNode({type:`TaggedTemplateExpression`,tag:r,quasi:e.getToken()===67174408?io(e,t|64,n):ro(e,t)},o)}r=L(e,t,n,r,0,1,o)}return a===0&&(e.flags&2048)==2048&&(e.flags=(e.flags|2048)^2048,r=e.finishNode({type:`ChainExpression`,expression:r},o)),r}function Ga(e,t,n,r,i){let a=!1,o;if((e.getToken()===69271571||e.getToken()===67174411)&&(e.flags&2048)==2048&&(a=!0,e.flags=(e.flags|2048)^2048),e.getToken()===69271571){M(e,t|32);let{tokenStart:a}=e,s=Na(e,t,n,0,1,a);P(e,t,20),e.assignable=2,o=e.finishNode({type:`MemberExpression`,object:r,computed:!0,optional:!0,property:s},i)}else if(e.getToken()===67174411){let a=so(e,t,n,0);e.assignable=!(t&1)&&e.options.webcompat?4:2,o=e.finishNode({type:`CallExpression`,callee:r,arguments:a,optional:!0},i)}else{let a=Ka(e,t,n,1);e.assignable=2,o=e.finishNode({type:`MemberExpression`,object:r,computed:!1,optional:!0,property:a},i)}return a&&(e.flags|=2048),o}function Ka(e,t,n,r=0){return!(e.getToken()&143360)&&e.getToken()!==-2147483527&&e.getToken()!==-2147483526&&(e.getToken()!==131||!r)&&e.report(162),e.getToken()===131?Vo(e,t,n,0):R(e,t)}function qa(e,t,n,r,i,a){r&&e.report(56),i||e.report(0);let o=e.getToken();M(e,t|32);let s=Ua(e,t,n,0,0,1);return e.assignable&2&&e.report(55),e.assignable=2,e.finishNode({type:`UpdateExpression`,argument:s,operator:j[o&255],prefix:!0},a)}function Ja(e,t,n,r,i,a,o,s,c,l=0,u=0){if((e.getToken()&143360)==143360){switch(e.getToken()){case 209006:case-2147274642:return Ba(e,t,n,i,o,c);case 241771:return za(e,t,n,o,a,c);case 209005:return Ra(e,t,n,o,s,a,i,c)}let{tokenValue:u}=e,d=e.getToken(),f=R(e,t|64);return e.getToken()===10?(s||e.report(0),Ci(e,t,d),(d&36864)==36864&&(e.flags|=256),To(e,t,n,u,f,i,a,0,c,l)):(t&16&&!(t&32768)&&!(t&8192)&&e.tokenValue===`arguments`&&e.report(132),(d&255)==73&&(t&1&&e.report(115),r&24&&e.report(100)),e.assignable=t&1&&(d&537079808)==537079808?2:1,f)}if((e.getToken()&134217728)==134217728)return co(e,t);switch(e.getToken()){case 33619993:case 33619994:return qa(e,t,n,i,s,c);case 16863276:case 16842798:case 16842799:case 25233968:case 25233969:case 16863275:case 16863277:return La(e,t,n,s,o);case 86104:return po(e,t,n,0,o,c);case 2162700:return yo(e,t,n,+!a,o);case 69271571:return mo(e,t,n,+!a,o);case 67174411:return Co(e,t|64,n,a,1,c,l);case 86021:case 86022:case 86023:return lo(e,t);case 86111:return uo(e,t);case 65540:return Po(e,t);case 133:e.features&1||e.report(30,`@`);case 86094:return Io(e,t,n,o,c);case 86109:return Ha(e,t);case 67174409:return ro(e,t);case 67174408:return io(e,t,n);case 86107:return Ao(e,t,n,o);case 134283389:return no(e,t);case 131:{u||e.report(30,`PrivateField`);let{tokenStart:r}=e,i=Vo(e,t,n,0);if(e.getToken()!==8673330)throw new A(r,e.startPosition,151);return i}case 86106:return Ya(e,t,n,i,o,c);case 8456256:if(e.options.jsx)return Go(e,t,n,0,e.tokenStart);default:if(Si(t,e.getToken()))return wo(e,t,n);e.report(30,j[e.getToken()&255])}}function Ya(e,t,n,r,i,a){let o=R(e,t);return e.getToken()===67108877?Xa(e,t,o,a,n,i,r):(r&&e.report(144),o=Za(e,t,n,i,a),e.assignable=2,L(e,t,n,o,i,0,a))}function Xa(e,t,n,r,i,a=0,o=0){let s=e.tokenStart,c=e.currentLocation;M(e,t);let l=e.getToken(),u=e.features&2&&!(l&-2147483648)&&e.tokenValue===`defer`,d=e.features&4&&!(l&-2147483648)&&e.tokenValue===`source`;if(u||d){o&&e.report(144),M(e,t);let n=Za(e,t,i,a,r,e.tokenValue);return e.assignable=2,n}if(!(t&2))throw new A(s,c,171);return l!==209031&&e.tokenValue!==`meta`?e.report(176):l&-2147483648&&e.report(177),e.assignable=2,e.finishNode({type:`MetaProperty`,meta:n,property:R(e,t)},r)}function Za(e,t,n,r,i,a=null){P(e,t|32,67174411),e.getToken()===14&&e.report(145);let o=F(e,t,n,1,r,e.tokenStart),s=null;e.getToken()===18&&(P(e,t,18),e.getToken()!==16&&(s=F(e,(t|131072)^131072,n,1,r,e.tokenStart)),N(e,t,18));let c={type:`ImportExpression`,source:o,options:s,...e.features&2||e.features&4?{phase:a}:null};return P(e,t,16),e.finishNode(c,i)}function Qa(e,t){if(!N(e,t,20579))return[];P(e,t,2162700);let n=[],r=new Set;for(;e.getToken()!==1074790415;){let i=e.tokenStart,a=eo(e,t);P(e,t,21);let o=$a(e,t),s=a.type===`Literal`?a.value:a.name;r.has(s)&&e.report(147,s),r.add(s),n.push(e.finishNode({type:`ImportAttribute`,key:a,value:o},i)),e.getToken()!==1074790415&&P(e,t,18)}return P(e,t,1074790415),n}function $a(e,t){if(e.getToken()===134283267)return co(e,t);e.report(30,j[e.getToken()&255])}function eo(e,t){if(e.getToken()===134283267)return co(e,t);if(e.getToken()&143360)return R(e,t);e.report(30,j[e.getToken()&255])}function to(e,t){if(e.getToken()===134283267)return e.tokenValue.isWellFormed()||e.report(173),co(e,t);if(e.getToken()&143360)return R(e,t);e.report(30,j[e.getToken()&255])}function no(e,t){let{tokenRaw:n,tokenValue:r,tokenStart:i}=e;M(e,t),e.assignable=2;let a={type:`Literal`,value:r,bigint:String(r)};return e.options.raw&&(a.raw=n),e.finishNode(a,i)}function ro(e,t){e.assignable=2;let{tokenValue:n,tokenRaw:r,tokenStart:i}=e;P(e,t,67174409);let a=[ao(e,n,r,i,!0)];return e.finishNode({type:`TemplateLiteral`,expressions:[],quasis:a},i)}function io(e,t,n){t=(t|131072)^131072;let{tokenValue:r,tokenRaw:i,tokenStart:a}=e;P(e,t&-65|32,67174408);let o=[ao(e,r,i,a,!1)],s=[Na(e,t&-65,n,0,1,e.tokenStart)];for(e.getToken()!==1074790415&&e.report(83);e.setToken(ci(e,t),!0)!==67174409;){let{tokenValue:r,tokenRaw:i,tokenStart:a}=e;P(e,t&-65|32,67174408),o.push(ao(e,r,i,a,!1)),s.push(Na(e,t,n,0,1,e.tokenStart)),e.getToken()!==1074790415&&e.report(83)}{let{tokenValue:n,tokenRaw:r,tokenStart:i}=e;P(e,t,67174409),o.push(ao(e,n,r,i,!0))}return e.assignable=2,e.finishNode({type:`TemplateLiteral`,expressions:s,quasis:o},a)}function ao(e,t,n,r,i){let a=e.finishNode({type:`TemplateElement`,value:{cooked:t,raw:n},tail:i},r),o=i?1:2,{ranges:s}=e.options;return s&&(s.start&&(a.start+=1),s.end&&(a.end-=o),s.range&&(a.range[0]+=1,a.range[1]-=o)),e.options.loc&&(a.loc.start.column+=1,a.loc.end.column-=o),a}function oo(e,t,n){let r=e.tokenStart;t=(t|131072)^131072,P(e,t|32,14);let i=F(e,t,n,1,0,e.tokenStart);return e.assignable=1,e.finishNode({type:`SpreadElement`,argument:i},r)}function so(e,t,n,r){M(e,t|32);let i=[];if(e.getToken()===16)return M(e,t|64),i;for(;e.getToken()!==16&&(e.getToken()===14?i.push(oo(e,t,n)):i.push(F(e,t,n,1,r,e.tokenStart)),!(e.getToken()!==18||(M(e,t|32),e.getToken()===16))););return P(e,t|64,16),i}function R(e,t,n=0){let{tokenValue:r,tokenStart:i}=e;return M(e,t|(n?32:0)),e.finishNode({type:`Identifier`,name:r},i)}function co(e,t){let{tokenValue:n,tokenRaw:r,tokenStart:i}=e;if(e.getToken()===134283389)return no(e,t);let a={type:`Literal`,value:n};return e.options.raw&&(a.raw=r),M(e,t),e.assignable=2,e.finishNode(a,i)}function lo(e,t){let n=e.tokenStart,r=j[e.getToken()&255],i={type:`Literal`,value:e.getToken()===86023?null:r===`true`};return e.options.raw&&(i.raw=r),M(e,t),e.assignable=2,e.finishNode(i,n)}function uo(e,t){let{tokenStart:n}=e;return M(e,t),e.assignable=2,e.finishNode({type:`ThisExpression`},n)}function fo(e,t,n,r,i,a,o,s,c=0){M(e,t|32);let l=i?pi(e,t,8391476):0,u=null,d,f=n?e.createScope():void 0;if(e.getToken()===67174411)a&1||e.report(39,`Function`);else{let r=c&4&&(!(t&8)||!(t&2))?4:64|(o?1024:0)|(l?1024:0);gi(e,t,e.getToken()),n&&(n.addVarOrBlock(t,e.tokenValue,r,e.tokenStart,e.currentLocation,c),f=f?.createChildScope(128),a&&a&2&&e.declareUnboundVariable(e.tokenValue)),d=e.getToken(),e.getToken()&143360?u=R(e,t):e.report(30,j[e.getToken()&255])}{let e=28416;t=(t|e)^e|65536|(o?2048:0)|(l?1024:0)|(l?0:262144)}f=f?.createChildScope(256);let p=Oo(e,(t|8192)&-524289,f,r,0,1),m=524428,h=Va(e,(t|m)^m|36864,f?.createChildScope(64),r,d,f,8);return e.finishNode({type:`FunctionDeclaration`,id:u,params:p,body:h,async:o===1,generator:l===1},s)}function po(e,t,n,r,i,a){M(e,t|32);let o=pi(e,t,8391476),s=(r?2048:0)|(o?1024:0),c=null,l,u=e.createScopeIfLexical(),d=552704;e.getToken()&143360&&(gi(e,(t|d)^d|s,e.getToken()),u=u?.createChildScope(128),l=e.getToken(),c=R(e,t)),t=(t|d)^d|65536|s|(o?0:262144),u=u?.createChildScope(256);let f=Oo(e,(t|8192)&-524289,u,n,i,1),p=Va(e,t&-131229|36864,u?.createChildScope(64),n,l,u);return e.assignable=2,e.finishNode({type:`FunctionExpression`,id:c,params:f,body:p,async:r===1,generator:o===1},a)}function mo(e,t,n,r,i){let a=ho(e,t,void 0,n,r,i,0,2);return e.destructible&64&&e.report(63),e.destructible&8&&e.report(62),a}function ho(e,t,n,r,i,a,o,s,c=0){let{tokenStart:l}=e;M(e,t|32);let u=[],d=0;for(t=(t|131072)^131072;e.getToken()!==20;)if(N(e,t|32,18))u.push(null);else{let i,{tokenStart:l,tokenValue:f,currentLocation:p}=e,m=e.getToken();if(m&143360){if(i=Ja(e,t,r,s,0,1,a,1,l),e.getToken()===1077936155){e.assignable&2&&e.report(26),M(e,t|32),n?.addVarOrBlock(t,f,s,l,p,c);let u=F(e,t,r,1,a,e.tokenStart);i=e.finishNode(o?{type:`AssignmentPattern`,left:i,right:u}:{type:`AssignmentExpression`,operator:`=`,left:i,right:u},l),d|=(e.destructible&256?256:0)|(e.destructible&128?128:0)}else e.getToken()===18||e.getToken()===20?(e.assignable&2?d|=16:n?.addVarOrBlock(t,f,s,l,p,c),d|=(e.destructible&256?256:0)|(e.destructible&128?128:0)):(d|=s&1?32:s&2?0:16,i=L(e,t,r,i,a,0,l),e.getToken()!==18&&e.getToken()!==20?(e.getToken()!==1077936155&&(d|=16),i=I(e,t,r,a,o,l,i)):e.getToken()!==1077936155&&(d|=e.assignable&1?32:16))}else m&2097152?(i=e.getToken()===2162700?bo(e,t,n,r,0,a,o,s,c):ho(e,t,n,r,0,a,o,s,c),d|=e.destructible,e.assignable=e.destructible&16?2:1,e.getToken()===18||e.getToken()===20?e.assignable&2&&(d|=16):e.destructible&8?e.report(71):(i=L(e,t,r,i,a,0,l),d=e.assignable&2?16:0,e.getToken()!==18&&e.getToken()!==20?i=I(e,t,r,a,o,l,i):e.getToken()!==1077936155&&(d|=e.assignable&1?32:16))):m===14?(i=_o(e,t,n,r,20,s,0,a,o,c),d|=e.destructible,e.getToken()!==18&&e.getToken()!==20&&e.report(30,j[e.getToken()&255])):(i=Ua(e,t,r,1,0,1),e.getToken()!==18&&e.getToken()!==20?(i=I(e,t,r,a,o,l,i),!(s&3)&&m===67174411&&(d|=16)):e.assignable&2?d|=16:m===67174411&&(d|=e.assignable&1&&s&3?32:16));if(u.push(i),N(e,t|32,18)){if(e.getToken()===20)break}else break}P(e,t,20);let f=e.finishNode({type:o?`ArrayPattern`:`ArrayExpression`,elements:u},l);return!i&&e.getToken()&4194304?go(e,t,r,d,a,o,l,f):(e.destructible=d,f)}function go(e,t,n,r,i,a,o,s){e.getToken()!==1077936155&&e.report(26),M(e,t|32),r&16&&e.report(26),a||mi(e,s);let{tokenStart:c}=e,l=F(e,t,n,1,i,c);return e.destructible=(r|72)^72|(e.destructible&128?128:0)|(e.destructible&256?256:0),e.finishNode(a?{type:`AssignmentPattern`,left:s,right:l}:{type:`AssignmentExpression`,left:s,operator:`=`,right:l},o)}function _o(e,t,n,r,i,a,o,s,c,l=0){let{tokenStart:u}=e;M(e,t|32);let d=null,f=0,{tokenValue:p,tokenStart:m,currentLocation:h}=e,g=e.getToken();if(g&143360)e.assignable=1,d=Ja(e,t,r,a,0,1,s,1,m),g=e.getToken(),d=L(e,t,r,d,s,0,m),e.getToken()!==18&&e.getToken()!==i&&(e.assignable&2&&e.getToken()===1077936155&&e.report(71),f|=16,d=I(e,t,r,s,c,m,d)),e.assignable&2?f|=16:g===i||g===18?n?.addVarOrBlock(t,p,a,m,h,l):f|=32,f|=e.destructible&128?128:0;else if(g===i)e.report(41);else if(g&2097152)d=e.getToken()===2162700?bo(e,t,n,r,1,s,c,a,l):ho(e,t,n,r,1,s,c,a,l),g=e.getToken(),g!==1077936155&&g!==i&&g!==18?(e.destructible&8&&e.report(71),d=L(e,t,r,d,s,0,m),f|=e.assignable&1?0:16,(e.getToken()&4194304)==4194304?(e.getToken()!==1077936155&&(f|=16),d=I(e,t,r,s,c,m,d)):((e.getToken()&8388608)==8388608&&(d=Ia(e,t,r,1,m,4,g,d)),N(e,t|32,22)&&(d=Fa(e,t,r,d,m)),f|=e.assignable&1?32:16)):f|=i===1074790415&&g!==1077936155?16:e.destructible;else{f|=32,d=Ua(e,t,r,1,s,1);let n=e.getToken();return n===1077936155?(e.assignable&2&&e.report(26),d=I(e,t,r,s,c,m,d),f|=16):(n===18?f|=16:n!==i&&(d=I(e,t,r,s,c,m,d)),f|=e.assignable&1?32:16),e.destructible=f,e.getToken()!==i&&e.getToken()!==18&&e.report(163),e.finishNode({type:c?`RestElement`:`SpreadElement`,argument:d},u)}if(e.getToken()!==i){if(a&1&&(f|=o?16:32),N(e,t|32,1077936155)){f&16&&e.report(26),mi(e,d);let n=F(e,t,r,1,s,e.tokenStart);d=e.finishNode(c?{type:`AssignmentPattern`,left:d,right:n}:{type:`AssignmentExpression`,left:d,operator:`=`,right:n},m),f=16}else f|=16}return e.destructible=f,e.finishNode({type:c?`RestElement`:`SpreadElement`,argument:d},u)}function vo(e,t,n,r,i,a){let o=11264|(r&64?0:16896);t=(t|o)^o|(r&8?1024:0)|(r&16?2048:0)|(r&64?16384:0)|98560;let s=e.createScopeIfLexical(256),c=xo(e,(t|8192)&-524289,s,n,r,1,i);s=s?.createChildScope(64);let l=Va(e,t&-655373|36864,s,n,void 0,s?.parent);return e.finishNode({type:`FunctionExpression`,params:c,body:l,async:(r&16)>0,generator:(r&8)>0,id:null},a)}function yo(e,t,n,r,i){let a=bo(e,t,void 0,n,r,i,0,2);return e.destructible&64&&e.report(63),e.destructible&8&&e.report(62),a}function bo(e,t,n,r,i,a,o,s,c=0){let{tokenStart:l}=e;M(e,t);let u=[],d=0,f=0;for(t=(t|131072)^131072;e.getToken()!==1074790415;){let{tokenValue:i,tokenStart:l,currentLocation:p}=e,m=e.getToken();if(m===14)u.push(_o(e,t,n,r,1074790415,s,0,a,o,c));else{let h=0,g=null,_;if(e.getToken()&143360||e.getToken()===-2147483527||e.getToken()===-2147483526){if(e.getToken()===-2147483526&&(d|=16),g=R(e,t),e.getToken()===18||e.getToken()===1074790415||e.getToken()===1077936155){if(h|=4,t&1&&(m&537079808)==537079808?d|=16:hi(e,t,s,m,0),n?.addVarOrBlock(t,i,s,l,p,c),N(e,t|32,1077936155)){d|=8;let n=F(e,t,r,1,a,e.tokenStart);d|=(e.destructible&256?256:0)|(e.destructible&128?128:0),_=e.finishNode({type:`AssignmentPattern`,left:e.cloneIdentifier(g),right:n},l)}else d|=((m&255)==110?128:0)|(m===-2147483527?16:0),_=e.cloneIdentifier(g)}else if(N(e,t|32,21)){let{tokenStart:l,currentLocation:u}=e;if(i===`__proto__`&&f++,e.getToken()&143360){let i=e.getToken(),f=e.tokenValue;_=Ja(e,t,r,s,0,1,a,1,l);let p=e.getToken();_=L(e,t,r,_,a,0,l),e.getToken()===18||e.getToken()===1074790415?p===1077936155||p===1074790415||p===18?(d|=e.destructible&128?128:0,e.assignable&2?d|=16:(i&143360)==143360&&n?.addVarOrBlock(t,f,s,l,u,c)):d|=e.assignable&1?32:16:(e.getToken()&4194304)==4194304?(e.assignable&2?d|=16:p===1077936155?n?.addVarOrBlock(t,f,s,l,u,c):d|=32,_=I(e,t,r,a,o,l,_)):(d|=16,(e.getToken()&8388608)==8388608&&(_=Ia(e,t,r,1,l,4,p,_)),N(e,t|32,22)&&(_=Fa(e,t,r,_,l)))}else(e.getToken()&2097152)==2097152?(_=e.getToken()===69271571?ho(e,t,n,r,0,a,o,s,c):bo(e,t,n,r,0,a,o,s,c),d=e.destructible,e.assignable=d&16?2:1,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):e.destructible&8?e.report(71):(_=L(e,t,r,_,a,0,l),d=e.assignable&2?16:0,(e.getToken()&4194304)==4194304?_=Pa(e,t,r,a,o,l,_):((e.getToken()&8388608)==8388608&&(_=Ia(e,t,r,1,l,4,m,_)),N(e,t|32,22)&&(_=Fa(e,t,r,_,l)),d|=e.assignable&1?32:16))):(_=Ua(e,t,r,1,a,1),d|=e.assignable&1?32:16,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):(_=L(e,t,r,_,a,0,l),d=e.assignable&2?16:0,e.getToken()!==18&&m!==1074790415&&(e.getToken()!==1077936155&&(d|=16),_=I(e,t,r,a,o,l,_))))}else e.getToken()===69271571?(d|=16,m===209005&&(h|=16),h|=(m===209008?256:m===209009?512:1)|2,g=So(e,t,r,a),d|=e.assignable,_=vo(e,t,r,h,a,e.tokenStart)):e.getToken()&143360?(d|=16,m===-2147483527&&e.report(95),m===209005?(e.flags&1&&e.report(134),h|=17):m===209008?h|=256:m===209009?h|=512:e.report(0),g=R(e,t),_=vo(e,t,r,h,a,e.tokenStart)):e.getToken()===67174411?(d|=16,h|=1,_=vo(e,t,r,h,a,e.tokenStart)):e.getToken()===8391476?(d|=16,m===209008?e.report(42):m===209009?e.report(43):m!==209005&&e.report(30,j[52]),M(e,t),h|=9|(m===209005?16:0),e.getToken()&143360?g=R(e,t):(e.getToken()&134217728)==134217728?g=co(e,t):e.getToken()===69271571?(h|=2,g=So(e,t,r,a),d|=e.assignable):e.report(30,j[e.getToken()&255]),_=vo(e,t,r,h,a,e.tokenStart)):(e.getToken()&134217728)==134217728?(m===209005&&(h|=16),h|=m===209008?256:m===209009?512:1,d|=16,g=co(e,t),_=vo(e,t,r,h,a,e.tokenStart)):e.report(135)}else if((e.getToken()&134217728)==134217728){if(g=co(e,t),e.getToken()===21){P(e,t|32,21);let{tokenStart:l}=e;if(i===`__proto__`&&f++,e.getToken()&143360){_=Ja(e,t,r,s,0,1,a,1,l);let{tokenValue:i,tokenStart:u,currentLocation:f}=e,p=e.getToken();_=L(e,t,r,_,a,0,l),e.getToken()===18||e.getToken()===1074790415?p===1077936155||p===1074790415||p===18?e.assignable&2?d|=16:n?.addVarOrBlock(t,i,s,u,f,c):d|=e.assignable&1?32:16:e.getToken()===1077936155?(e.assignable&2&&(d|=16),_=I(e,t,r,a,o,l,_)):(d|=16,_=I(e,t,r,a,o,l,_))}else(e.getToken()&2097152)==2097152?(_=e.getToken()===69271571?ho(e,t,n,r,0,a,o,s,c):bo(e,t,n,r,0,a,o,s,c),d=e.destructible,e.assignable=d&16?2:1,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):(e.destructible&8)!=8&&(_=L(e,t,r,_,a,0,l),d=e.assignable&2?16:0,(e.getToken()&4194304)==4194304?_=Pa(e,t,r,a,o,l,_):((e.getToken()&8388608)==8388608&&(_=Ia(e,t,r,1,l,4,m,_)),N(e,t|32,22)&&(_=Fa(e,t,r,_,l)),d|=e.assignable&1?32:16))):(_=Ua(e,t,r,1,0,1),d|=e.assignable&1?32:16,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):(_=L(e,t,r,_,a,0,l),d=e.assignable&1?0:16,e.getToken()!==18&&e.getToken()!==1074790415&&(e.getToken()!==1077936155&&(d|=16),_=I(e,t,r,a,o,l,_))))}else e.getToken()===67174411?(h|=1,_=vo(e,t,r,h,a,e.tokenStart),d=16):e.report(136)}else if(e.getToken()===69271571){if(g=So(e,t,r,a),d|=e.destructible&256?256:0,h|=2,e.getToken()===21){M(e,t|32);let{tokenStart:i,tokenValue:l,currentLocation:u}=e,f=e.getToken();if(e.getToken()&143360){_=Ja(e,t,r,s,0,1,a,1,i);let p=e.getToken();_=L(e,t,r,_,a,0,i),(e.getToken()&4194304)==4194304?(d|=e.assignable&1?p===1077936155?0:32:16,_=Pa(e,t,r,a,o,i,_)):e.getToken()===18||e.getToken()===1074790415?p===1077936155||p===1074790415||p===18?e.assignable&2?d|=16:(f&143360)==143360&&n?.addVarOrBlock(t,l,s,i,u,c):d|=e.assignable&1?32:16:(d|=16,_=I(e,t,r,a,o,i,_))}else(e.getToken()&2097152)==2097152?(_=e.getToken()===69271571?ho(e,t,n,r,0,a,o,s,c):bo(e,t,n,r,0,a,o,s,c),d=e.destructible,e.assignable=d&16?2:1,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):d&8?e.report(62):(_=L(e,t,r,_,a,0,i),d=e.assignable&2?d|16:0,(e.getToken()&4194304)==4194304?(e.getToken()!==1077936155&&(d|=16),_=Pa(e,t,r,a,o,i,_)):((e.getToken()&8388608)==8388608&&(_=Ia(e,t,r,1,i,4,m,_)),N(e,t|32,22)&&(_=Fa(e,t,r,_,i)),d|=e.assignable&1?32:16))):(_=Ua(e,t,r,1,0,1),d|=e.assignable&1?32:16,e.getToken()===18||e.getToken()===1074790415?e.assignable&2&&(d|=16):(_=L(e,t,r,_,a,0,i),d=e.assignable&1?0:16,e.getToken()!==18&&e.getToken()!==1074790415&&(e.getToken()!==1077936155&&(d|=16),_=I(e,t,r,a,o,i,_))))}else e.getToken()===67174411?(h|=1,_=vo(e,t,r,h,a,e.tokenStart),d=16):e.report(44)}else if(m===8391476){if(P(e,t|32,8391476),h|=8,e.getToken()&143360){let n=e.getToken();if(g=R(e,t),h|=1,e.getToken()===67174411)d|=16,_=vo(e,t,r,h,a,e.tokenStart);else throw new A(e.tokenStart,e.currentLocation,n===209005?46:n===209008||e.getToken()===209009?45:47,j[n&255])}else(e.getToken()&134217728)==134217728?(d|=16,g=co(e,t),h|=1,_=vo(e,t,r,h,a,e.tokenStart)):e.getToken()===69271571?(d|=16,h|=3,g=So(e,t,r,a),_=vo(e,t,r,h,a,e.tokenStart)):e.report(128)}else e.report(30,j[m&255]);d|=e.destructible&128?128:0,e.destructible=d,u.push(e.finishNode({type:`Property`,key:g,value:_,kind:h&768?h&512?`set`:`get`:`init`,computed:(h&2)>0,method:(h&1)>0,shorthand:(h&4)>0},l))}if(d|=e.destructible,e.getToken()!==18)break;M(e,t)}P(e,t,1074790415),f>1&&(d|=64);let p=e.finishNode({type:o?`ObjectPattern`:`ObjectExpression`,properties:u},l);return!i&&e.getToken()&4194304?go(e,t,r,d,a,o,l,p):(e.destructible=d,p)}function xo(e,t,n,r,i,a,o){P(e,t,67174411);let s=[];if(e.flags=(e.flags|128)^128,e.strictReservedRange=null,e.firstAwaitLocation=null,e.firstYieldLocation=null,e.getToken()===16)return i&512&&e.report(37,`Setter`,`one`,``),M(e,t),s;i&256&&e.report(37,`Getter`,`no`,`s`),i&512&&e.getToken()===14&&e.report(38),t=(t|131072)^131072;let c=0,l=0;for(;e.getToken()!==18;){let u=null,{tokenStart:d}=e;if(e.getToken()&143360?(t&1||((e.getToken()&36864)==36864&&(e.flags|=256,e.strictReservedRange??=[d,e.currentLocation]),(e.getToken()&537079808)==537079808&&(e.flags|=512)),u=Wo(e,t,n,i|1)):(e.getToken()===2162700?u=bo(e,t,n,r,1,o,1,a):e.getToken()===69271571?u=ho(e,t,n,r,1,o,1,a):e.getToken()===14&&(u=_o(e,t,n,r,16,a,0,o,1)),l=1,e.destructible&48&&e.report(50)),e.getToken()===1077936155){M(e,t|32),l=1;let n=F(e,t,r,1,0,e.tokenStart);u=e.finishNode({type:`AssignmentPattern`,left:u,right:n},d)}if(c++,s.push(u),!N(e,t,18)||e.getToken()===16)break}return i&512&&c!==1&&e.report(37,`Setter`,`one`,``),n?.reportScopeError(),l&&(e.flags|=128),P(e,t,16),s}function So(e,t,n,r){M(e,t|32);let i=F(e,(t|131072)^131072,n,1,r,e.tokenStart);return P(e,t,20),i}function Co(e,t,n,r,i,a,o){e.flags=(e.flags|128)^128;let s=e.tokenStart;M(e,t|262176);let c=e.createScopeIfLexical()?.createChildScope(512);if(t=(t|131072)^131072,N(e,t,16))return Eo(e,t,c,n,[],r,0,a,o);let l=0,u=e.destructible&384;e.destructible&=-385;let d=e.firstAwaitLocation;e.firstAwaitLocation=null;let f=e.firstYieldLocation;e.firstYieldLocation=null;let p,m=[],h=0,g=0,_=0,v=e.tokenStart;for(e.assignable=1;e.getToken()!==16;){let{tokenStart:r,currentLocation:a}=e,o=e.getToken();if(o&143360)c?.addBlockName(t,e.tokenValue,1,r,a),(o&537079808)==537079808?g=1:(o&36864)==36864&&(_=1),p=Ja(e,t,n,i,0,1,1,1,r,0),e.getToken()===16||e.getToken()===18?e.assignable&2&&(l|=16,g=1):(e.getToken()===1077936155?g=1:l|=16,p=L(e,t,n,p,1,0,r),e.getToken()!==16&&e.getToken()!==18&&(p=I(e,t,n,1,0,r,p)));else if((o&2097152)==2097152)p=o===2162700?bo(e,t|262144,c,n,0,1,0,i):ho(e,t|262144,c,n,0,1,0,i),l|=e.destructible,g=1,e.assignable=2,e.getToken()!==16&&e.getToken()!==18&&(l&8&&e.report(124),p=L(e,t,n,p,0,0,r),l|=16,e.getToken()!==16&&e.getToken()!==18&&(p=I(e,t,n,0,0,r,p)));else if(o===14){p=_o(e,t,c,n,16,i,0,1,0),e.destructible&16&&e.report(74),g=1,h&&(e.getToken()===16||e.getToken()===18)&&m.push(p),l|=8;break}else{if(l|=16,p=F(e,t,n,1,1,r),h&&(e.getToken()===16||e.getToken()===18)&&m.push(p),e.getToken()===18&&(h||(h=1,m=[p])),h){for(;N(e,t|32,18);)m.push(F(e,t,n,1,1,e.tokenStart));e.assignable=2,p=e.finishNode({type:`SequenceExpression`,expressions:m},v)}return P(e,t,16),e.destructible=l|u,d&&(e.firstAwaitLocation=d),f&&(e.firstYieldLocation=f),e.options.preserveParens?e.finishNode({type:`ParenthesizedExpression`,expression:p},s):p}if(h&&(e.getToken()===16||e.getToken()===18)&&m.push(p),!N(e,t|32,18))break;if(h||(h=1,m=[p]),e.getToken()===16){l|=8;break}}if(h&&(e.assignable=2,p=e.finishNode({type:`SequenceExpression`,expressions:m},v)),P(e,t,16),l&16&&l&8&&e.report(153),l|=(e.destructible&256?256:0)|(e.destructible&128?128:0),e.getToken()===10){if(l&48&&e.report(49),t&2050&&l&128){let t=e.firstAwaitLocation;if(t)throw new A(t.start,t.end,31);e.report(31)}if(t&1025&&l&256){let t=e.firstYieldLocation;if(t)throw new A(t.start,t.end,32);e.report(32)}return g&&(e.flags|=128),_&&(e.flags|=256),e.destructible|=u,d&&(e.firstAwaitLocation=d),f&&(e.firstYieldLocation=f),Eo(e,t,c,n,h?m:[p],r,0,a,o)}return l&64&&e.report(63),l&8&&e.report(146),e.destructible=(e.destructible|256)^256|l|u,d&&(e.firstAwaitLocation=d),f&&(e.firstYieldLocation=f),e.options.preserveParens?e.finishNode({type:`ParenthesizedExpression`,expression:p},s):p}function wo(e,t,n,r=0){let{tokenValue:i,tokenStart:a,currentLocation:o}=e,s=0,c=0;(e.getToken()&537079808)==537079808?s=1:(e.getToken()&36864)==36864&&(c=1);let l=R(e,t,r);if(e.assignable=1,e.getToken()===10){let r=e.options.lexical?Fi(e,t,i,a,o):void 0;return s&&(e.flags|=128),c&&(e.flags|=256),Do(e,t,r,n,[l],0,a)}return l}function To(e,t,n,r,i,a,o,s,c,l=0){return o||e.report(57),a&&e.report(51),e.flags&=-129,Do(e,t,e.options.lexical?Fi(e,t,r,c,e.currentLocation):void 0,n,[i],s,c,l)}function Eo(e,t,n,r,i,a,o,s,c=0){a||e.report(57);for(let t=0;t<i.length;++t)mi(e,i[t]);return Do(e,t,n,r,i,o,s,c)}function Do(e,t,n,r,i,a,o,s=0){e.flags&1&&e.report(48),P(e,t|32,10);let c=535552;t=(t|c)^c|(a?2048:0);let l=e.getToken()!==2162700,u;if(n?.reportScopeError(),l)e.flags=(e.flags|4928)^4928,u=F(e,t,r,1,0,e.tokenStart);else{n=n?.createChildScope(64);let i=131084;switch(u=Va(e,(t|i)^i|4096,n,r,void 0,void 0,16),e.getToken()){case 69271571:e.flags&1||e.report(118),e.flags|=8192;break;case 67108877:case 67174409:case 22:e.report(119);case 67174411:e.flags&1||e.report(118),e.flags|=1024}(e.getToken()&8388608)==8388608&&!(e.flags&1)&&(e.getToken()!==8673330||s!==32)&&e.report(30,j[e.getToken()&255]),(e.getToken()&33619968)==33619968&&e.report(127)}return e.assignable=2,e.finishNode({type:`ArrowFunctionExpression`,params:i,body:u,async:a===1,expression:l,generator:!1},o)}function Oo(e,t,n,r,i,a){P(e,t,67174411),e.flags=(e.flags|128)^128,e.strictReservedRange=null,e.firstAwaitLocation=null,e.firstYieldLocation=null;let o=[];if(N(e,t,16))return o;t=(t|131072)^131072;let s=0;for(;e.getToken()!==18;){let c,{tokenStart:l}=e,u=e.getToken();if(u&143360?(t&1||((u&36864)==36864&&(e.flags|=256,e.strictReservedRange??=[l,e.currentLocation]),(u&537079808)==537079808&&(e.flags|=512)),c=Wo(e,t,n,a|1)):(u===2162700?c=bo(e,t,n,r,1,i,1,a):u===69271571?c=ho(e,t,n,r,1,i,1,a):u===14?c=_o(e,t,n,r,16,a,0,i,1):e.report(30,j[u&255]),s=1,e.destructible&48&&e.report(50)),e.getToken()===1077936155){M(e,t|32),s=1;let n=F(e,t,r,1,i,e.tokenStart);c=e.finishNode({type:`AssignmentPattern`,left:c,right:n},l)}if(o.push(c),!N(e,t,18)||e.getToken()===16)break}return s&&(e.flags|=128),(s||t&1)&&n?.reportScopeError(),P(e,t,16),o}function ko(e,t,n,r,i,a){let o=e.getToken();if(o&67108864){if(o===67108877){M(e,t|262144),e.assignable=1;let i=Ka(e,t,n,1);return ko(e,t,n,e.finishNode({type:`MemberExpression`,object:r,computed:!1,property:i,optional:!1},a),0,a)}if(o===69271571){M(e,t|32);let{tokenStart:o}=e,s=Na(e,t,n,i,1,o);return P(e,t,20),e.assignable=1,ko(e,t,n,e.finishNode({type:`MemberExpression`,object:r,computed:!0,property:s,optional:!1},a),0,a)}if(o===67174408||o===67174409)return e.assignable=2,ko(e,t,n,e.finishNode({type:`TaggedTemplateExpression`,tag:r,quasi:e.getToken()===67174408?io(e,t|64,n):ro(e,t|64)},a),0,a)}return r}function Ao(e,t,n,r){let{tokenStart:i}=e,a=R(e,t|32),{tokenStart:o}=e;if(N(e,t,67108877)){if(t&65536&&e.getToken()===209030)return e.assignable=2,jo(e,t,a,i);e.report(94)}e.assignable=2,(e.getToken()&16842752)==16842752&&e.report(65,j[e.getToken()&255]);let s=Ja(e,t,n,2,1,0,r,1,o);t=(t|131072)^131072,e.getToken()===67108991&&e.report(170);let c=ko(e,t,n,s,r,o);return e.assignable=2,e.finishNode({type:`NewExpression`,callee:c,arguments:e.getToken()===67174411?so(e,t,n,r):[]},i)}function jo(e,t,n,r){let i=R(e,t);return e.finishNode({type:`MetaProperty`,meta:n,property:i},r)}function Mo(e,t,n,r,i){return(e.getToken()&255)==110&&e.report(31),t&1025&&e.getToken()===241771&&e.report(32),Ci(e,t,e.getToken()),(e.getToken()&36864)==36864&&(e.flags|=256),To(e,t&-524289|2048,n,e.tokenValue,R(e,t),0,r,1,i)}function No(e,t,n,r,i,a,o,s){M(e,t|32);let c=e.createScopeIfLexical()?.createChildScope(512),l=e.firstAwaitLocation;e.firstAwaitLocation=null;let u=e.firstYieldLocation;if(e.firstYieldLocation=null,t=(t|131072)^131072,N(e,t,16))return e.getToken()===10?(o&1&&e.report(48),Eo(e,t,c,n,[],i,1,s)):(e.assignable=!(t&1)&&e.options.webcompat?4:2,l&&(e.firstAwaitLocation=l),u&&(e.firstYieldLocation=u),e.finishNode({type:`CallExpression`,callee:r,arguments:[],optional:!1},s));let d=0,f,p=0;e.destructible=(e.destructible|384)^384;let m=[];for(;e.getToken()!==16;){let{tokenStart:i,currentLocation:o}=e,h=e.getToken();if(h&143360)c?.addBlockName(t,e.tokenValue,a,i,o),(h&537079808)==537079808?e.flags|=512:(h&36864)==36864&&(e.flags|=256),f=Ja(e,t,n,a,0,1,1,1,i),e.getToken()===16||e.getToken()===18?e.assignable&2&&(d|=16,p=1):(e.getToken()===1077936155?p=1:d|=16,f=L(e,t,n,f,1,0,i),e.getToken()!==16&&e.getToken()!==18&&(f=I(e,t,n,1,0,i,f)));else if(h&2097152)f=h===2162700?bo(e,t,c,n,0,1,0,a):ho(e,t,c,n,0,1,0,a),d|=e.destructible,p=1,e.getToken()!==16&&e.getToken()!==18&&(d&8&&e.report(124),f=L(e,t,n,f,0,0,i),d|=16,(e.getToken()&8388608)==8388608&&(f=Ia(e,t,n,1,s,4,h,f)),N(e,t|32,22)&&(f=Fa(e,t,n,f,s)));else if(h===14)f=_o(e,t,c,n,16,a,1,1,0),d|=(e.getToken()===16?0:16)|e.destructible,p=1;else{for(f=F(e,t,n,1,0,i),d=0,m.push(f);N(e,t|32,18);)m.push(F(e,t,n,1,0,i));return d|=e.assignable,P(e,t,16),e.destructible=d|16,e.assignable=!(t&1)&&e.options.webcompat?4:2,l&&(e.firstAwaitLocation=l),u&&(e.firstYieldLocation=u),e.finishNode({type:`CallExpression`,callee:r,arguments:m,optional:!1},s)}if(m.push(f),!N(e,t|32,18))break}if(P(e,t,16),d|=(e.destructible&256?256:0)|(e.destructible&128?128:0),e.getToken()===10){if(d&48&&e.report(27),(e.flags&1||o&1)&&e.report(48),d&128){let t=e.firstAwaitLocation;if(t)throw new A(t.start,t.end,31);e.report(31)}if(t&1025&&d&256){let t=e.firstYieldLocation;if(t)throw new A(t.start,t.end,32);e.report(32)}return p&&(e.flags|=128),Eo(e,t|2048,c,n,m,i,1,s)}return d&64&&e.report(63),d&8&&e.report(62),e.assignable=!(t&1)&&e.options.webcompat?4:2,l&&(e.firstAwaitLocation=l),u&&(e.firstYieldLocation=u),e.finishNode({type:`CallExpression`,callee:r,arguments:m,optional:!1},s)}function Po(e,t){let{tokenRaw:n,tokenRegExp:r,tokenValue:i,tokenStart:a}=e;M(e,t),e.assignable=2;let o={type:`Literal`,value:i,regex:r};return e.options.raw&&(o.raw=n),e.finishNode(o,a)}function Fo(e,t,n,r,i){let a,o;e.leadingDecorators.decorators.length?(a=e.leadingDecorators.start,o=[...e.leadingDecorators.decorators],e.leadingDecorators.decorators.length=0):(a=e.tokenStart,o=Lo(e,t,r)),t=(t|16385)^16384,P(e,t,86094);let s=null,c=null,{tokenValue:l,tokenStart:u,currentLocation:d}=e;e.getToken()&4096&&e.getToken()!==20565?(_i(e,t,e.getToken())&&e.report(120),(e.getToken()&537079808)==537079808&&e.report(121),n&&(n.addBlockName(t,l,32,u,d),i&&i&2&&e.declareUnboundVariable(l)),s=R(e,t)):i&1||e.report(39,`Class`);let f=t;N(e,t|32,20565)?(c=Ua(e,t,r,0,0,0),f|=512):f=(f|512)^512;let p=zo(e,f,t,n,r,2,0,8);return e.finishNode({type:`ClassDeclaration`,id:s,superClass:c,body:p,...e.features&1?{decorators:o}:null},a)}function Io(e,t,n,r,i){let a=null,o=null,s=Lo(e,t,n);t=(t|16385)^16384,P(e,t,86094),e.getToken()&4096&&e.getToken()!==20565&&(_i(e,t,e.getToken())&&e.report(120),(e.getToken()&537079808)==537079808&&e.report(121),a=R(e,t));let c=t;N(e,t|32,20565)?(o=Ua(e,t,n,0,r,0),c|=512):c=(c|512)^512;let l=zo(e,c,t,void 0,n,2,r);return e.assignable=2,e.finishNode({type:`ClassExpression`,id:a,superClass:o,body:l,...e.features&1?{decorators:s}:null},i)}function Lo(e,t,n){let r=[];if(e.features&1)for(;e.getToken()===133;)r.push(Ro(e,t,n));return r}function Ro(e,t,n){let r=e.tokenStart;M(e,t|32);let i=e.tokenStart,a;if(e.getToken()===67174411)a=Ja(e,t,n,2,0,1,0,1,r);else{let r=e.getToken();((r&143360)!=143360&&!Si(t,r)||t&1&&(r&36864)==36864)&&e.report(30,j[r&255]),r===209006&&t&2050&&e.report(112),r===241771&&t&1024&&e.report(97,`yield`);let o=R(e,t|64);for(;e.getToken()===67108877;){M(e,(t|262152)^8);let r=Ka(e,t|64,n,1);o=e.finishNode({type:`MemberExpression`,object:o,computed:!1,property:r,optional:!1},i)}if(a=o,e.getToken()===67174411){let r=so(e,t,n,0);a=e.finishNode({type:`CallExpression`,callee:o,arguments:r,optional:!1},i)}}return e.finishNode({type:`Decorator`,expression:a},r)}function zo(e,t,n,r,i,a,o,s=0){let{tokenStart:c}=e,l=e.createPrivateScopeIfLexical(i);P(e,t|32,2162700);let u=655360;t=(t|u)^u;let d=e.flags&32;e.flags=(e.flags|32)^32;let f=[];for(;e.getToken()!==1074790415;){let i=e.tokenStart,s=Lo(e,t,l);if(s.length>0&&e.tokenValue===`constructor`&&e.report(111),e.getToken()===1074790415&&e.report(110),N(e,t,1074790417)){s.length>0&&e.report(122);continue}f.push(Bo(e,t,r,l,n,a,s,0,o,s.length>0?i:e.tokenStart))}return P(e,s&8?t|32:t,1074790415),l?.validatePrivateIdentifierRefs(),e.flags=e.flags&-33|d,e.finishNode({type:`ClassBody`,body:f},c)}function Bo(e,t,n,r,i,a,o,s,c,l){let u=s?32:0,d=null,f=e.getToken();if(f&176128||f===-2147483527)switch(d=R(e,t),f){case 36970:if(!s&&e.getToken()!==67174411&&(e.getToken()&1048576)!=1048576&&e.getToken()!==1077936155)return Bo(e,t,n,r,i,a,o,1,c,l);break;case 209005:if(e.getToken()!==67174411&&!(e.flags&1)){if((e.getToken()&1073741824)==1073741824)return Ho(e,t,r,d,u,o,l);u|=16|(pi(e,t,8391476)?8:0)}break;case 209008:if(e.getToken()!==67174411){if(e.getToken()===8391476&&e.flags&1||(e.getToken()&1073741824)==1073741824)return Ho(e,t,r,d,u,o,l);u|=256}break;case 209009:if(e.getToken()!==67174411){if(e.getToken()===8391476&&e.flags&1||(e.getToken()&1073741824)==1073741824)return Ho(e,t,r,d,u,o,l);u|=512}break;case 209010:if(e.getToken()!==67174411&&!(e.flags&1)){if((e.getToken()&1073741824)==1073741824)return Ho(e,t,r,d,u,o,l);e.features&1&&(u|=1024)}}else if(f===69271571)u|=2,d=So(e,i,r,c);else if((f&134217728)==134217728)d=co(e,t);else if(f===8391476)u|=8,M(e,t);else if(e.getToken()===131)u|=8192,d=Vo(e,t|16,r,768);else if((e.getToken()&1073741824)==1073741824)u|=128;else if(s&&f===2162700)return fa(e,t|16,n,r,l);else f===-2147483526?(d=R(e,t),e.getToken()!==67174411&&e.report(30,j[e.getToken()&255])):e.report(30,j[e.getToken()&255]);if(u&1816&&(e.getToken()&143360||e.getToken()===-2147483527||e.getToken()===-2147483526?d=R(e,t):(e.getToken()&134217728)==134217728?d=co(e,t):e.getToken()===69271571?(u|=2,d=So(e,t,r,0)):e.getToken()===131?(u|=8192,d=Vo(e,t,r,u)):e.report(137)),u&2||(e.tokenValue===`constructor`?((e.getToken()&1073741824)==1073741824?e.report(131):!(u&32)&&e.getToken()===67174411&&(u&920?e.report(53,`accessor`):t&512||(e.flags&32?e.report(54):e.flags|=32)),u|=64):!(u&8192)&&u&32&&e.tokenValue===`prototype`&&e.report(52)),u&1024||e.getToken()!==67174411&&!(u&768))return Ho(e,t,r,d,u,o,l);let p=vo(e,t|16,r,u,c,e.tokenStart);return e.finishNode({type:`MethodDefinition`,kind:!(u&32)&&u&64?`constructor`:u&256?`get`:u&512?`set`:`method`,static:(u&32)>0,computed:(u&2)>0,key:d,value:p,...e.features&1?{decorators:o}:null},l)}function Vo(e,t,n,r){let{tokenStart:i}=e;M(e,t);let{tokenValue:a}=e;return a===`constructor`&&e.report(130),e.options.lexical&&(n||e.report(4,a),r?n.addPrivateIdentifier(a,r):n.addPrivateIdentifierRef(a)),M(e,t),e.finishNode({type:`PrivateIdentifier`,name:a},i)}function Ho(e,t,n,r,i,a,o){let s=null;if(i&8&&e.report(0),e.getToken()===1077936155){M(e,t|32);let{tokenStart:r}=e;e.getToken()===537079928&&e.report(121);let a=11272|(i&64?0:16896);t=(t|a)^a|(i&8?1024:0)|(i&16?2048:0)|(i&64?16384:0)|65792,s=Ja(e,t|16,n,2,0,1,0,1,r,0,1),((e.getToken()&1073741824)!=1073741824||(e.getToken()&4194304)==4194304)&&(s=L(e,t|16,n,s,0,0,r),s=I(e,t|16,n,0,0,r,s))}return di(e,t),e.finishNode({type:i&1024?`AccessorProperty`:`PropertyDefinition`,key:r,value:s,static:(i&32)>0,computed:(i&2)>0,...e.features&1?{decorators:a}:null},o)}function Uo(e,t,n,r,i,a=0){if(e.getToken()&143360||!(t&1)&&e.getToken()===-2147483526)return Wo(e,t,n,i,a);(e.getToken()&2097152)!=2097152&&e.report(30,j[e.getToken()&255]);let o=e.getToken()===69271571?ho(e,t,n,r,1,0,1,i,a):bo(e,t,n,r,1,0,1,i,a);return e.destructible&16&&e.report(50),e.destructible&32&&e.report(50),o}function Wo(e,t,n,r,i=0){let a=e.getToken();t&1&&((a&537079808)==537079808?e.report(121):((a&36864)==36864||a===-2147483526)&&e.report(120)),(a&20480)==20480&&e.report(102),a===241771&&(t&1024&&e.report(32),t&2&&e.report(113)),(a&255)==73&&r&24&&e.report(100),a===209006&&(t&2048&&e.report(178),t&2&&e.report(112));let{tokenValue:o,tokenStart:s,currentLocation:c}=e;return M(e,t),n?.addVarOrBlock(t,o,r,s,c,i),e.finishNode({type:`Identifier`,name:o},s)}function Go(e,t,n,r,i){if(r||P(e,t,8456256),e.getToken()===8390721){let a=Ko(e,i),[o,s]=Xo(e,t,n,r);return e.finishNode({type:`JSXFragment`,openingFragment:a,children:o,closingFragment:s},i)}e.getToken()===8457014&&e.report(30,j[e.getToken()&255]);let a=null,o=[],s=es(e,t,n,r,i);if(!s.selfClosing){[o,a]=Yo(e,t,n,r);let i=xi(a.name);xi(s.name)!==i&&e.report(157,i)}return e.finishNode({type:`JSXElement`,children:o,openingElement:s,closingElement:a},i)}function Ko(e,t){return Oi(e),e.finishNode({type:`JSXOpeningFragment`},t)}function qo(e,t,n,r){P(e,t,8457014);let i=ts(e,t);return e.getToken()!==8390721&&e.report(25,j[65]),n?Oi(e):M(e,t),e.finishNode({type:`JSXClosingElement`,name:i},r)}function Jo(e,t,n,r){return P(e,t,8457014),e.getToken()!==8390721&&e.report(25,j[65]),n?Oi(e):M(e,t),e.finishNode({type:`JSXClosingFragment`},r)}function Yo(e,t,n,r){let i=[];for(;;){let a=Zo(e,t,n,r);if(a.type===`JSXClosingElement`)return[i,a];i.push(a)}}function Xo(e,t,n,r){let i=[];for(;;){let a=Qo(e,t,n,r);if(a.type===`JSXClosingFragment`)return[i,a];i.push(a)}}function Zo(e,t,n,r){if(e.getToken()===138)return $o(e);if(e.getToken()===2162700)return ss(e,t,n,1,0);if(e.getToken()===8456256){let{tokenStart:i}=e;return M(e,t),e.getToken()===8457014?qo(e,t,r,i):Go(e,t,n,1,i)}e.report(0)}function Qo(e,t,n,r){if(e.getToken()===138)return $o(e);if(e.getToken()===2162700)return ss(e,t,n,1,0);if(e.getToken()===8456256){let{tokenStart:i}=e;return M(e,t),e.getToken()===8457014?Jo(e,t,r,i):Go(e,t,n,1,i)}e.report(0)}function $o(e){let t=e.tokenStart;Oi(e);let n={type:`JSXText`,value:e.tokenValue};return e.options.raw&&(n.raw=e.tokenRaw),e.finishNode(n,t)}function es(e,t,n,r,i){(e.getToken()&143360)!=143360&&(e.getToken()&4096)!=4096&&e.report(0);let a=ts(e,t),o=rs(e,t,n),s=e.getToken()===8457014;return s&&P(e,t|1048576,8457014),e.getToken()!==8390721&&e.report(25,j[65]),r||!s?Oi(e):M(e,t),e.finishNode({type:`JSXOpeningElement`,name:a,attributes:o,selfClosing:s},i)}function ts(e,t){let{tokenStart:n}=e;ki(e);let r=us(e,t);if(e.getToken()===21)return os(e,t,r,n);for(;N(e,t,67108877);)ki(e),r=ns(e,t,r,n);return r}function ns(e,t,n,r){let i=us(e,t);return e.finishNode({type:`JSXMemberExpression`,object:n,property:i},r)}function rs(e,t,n){let r=[];for(;e.getToken()!==8457014&&e.getToken()!==8390721&&e.getToken()!==1048576;)r.push(as(e,t,n));return r}function is(e,t,n){let r=e.tokenStart;M(e,t),P(e,t,14);let i=F(e,t,n,1,0,e.tokenStart);return P(e,t,1074790415),e.finishNode({type:`JSXSpreadAttribute`,argument:i},r)}function as(e,t,n){let{tokenStart:r}=e;if(e.getToken()===2162700)return is(e,t,n);ki(e);let i=null,a=us(e,t);if(e.getToken()===21&&(a=os(e,t,a,r)),e.getToken()===1077936155)switch(Ei(e,t)){case 134283267:i=co(e,t);break;case 8456256:i=Go(e,t,n,0,e.tokenStart);break;case 2162700:i=ss(e,t,n,0,1);break;default:e.report(156)}return e.finishNode({type:`JSXAttribute`,value:i,name:a},r)}function os(e,t,n,r){P(e,t,21);let i=us(e,t);return e.finishNode({type:`JSXNamespacedName`,namespace:n,name:i},r)}function ss(e,t,n,r,i){let{tokenStart:a}=e;M(e,t|32);let{tokenStart:o}=e;if(e.getToken()===14)return cs(e,t,n,a);let s;return e.getToken()===1074790415?(i&&e.report(159),s=ls(e,{index:e.startIndex,line:e.startLine,column:e.startColumn})):s=F(e,t,n,1,0,o),e.getToken()!==1074790415&&e.report(25,j[15]),r?Oi(e):M(e,t),e.finishNode({type:`JSXExpressionContainer`,expression:s},a)}function cs(e,t,n,r){P(e,t,14);let i=F(e,t,n,1,0,e.tokenStart);return P(e,t,1074790415),e.finishNode({type:`JSXSpreadChild`,expression:i},r)}function ls(e,t){return e.finishNode({type:`JSXEmptyExpression`},t,e.tokenStart)}function us(e,t){let n=e.tokenStart;e.getToken()&143360||e.report(30,j[e.getToken()&255]);let{tokenValue:r}=e;return M(e,t|1048576),e.finishNode({type:`JSXIdentifier`,name:r},n)}var{version:ds}=xr;function fs(e,t){return zi(e,{...t,sourceType:`script`})}var ps=class{source;programAst;hasExtractions;extractionStates;dependentsTracker=new Map;pendingPrototypeAliasBinding=null;iifeParamName=null;declaredVariables=new Map;constructor(e,t={}){this.source=e;let n=t.extractions?Array.isArray(t.extractions)?t.extractions:[t.extractions]:[];this.extractionStates=n.map(e=>({config:{collectDependencies:!0,stopWhenReady:!0,...e},dependencies:new Set,dependents:new Set,ready:!1})),this.hasExtractions=this.extractionStates.length>0,this.programAst=fs(e,{ranges:!0,loc:!1,module:!1}),this.analyzeAst()}analyzeAst(){let e;for(let t of this.programAst.body)if(t.type===`ExpressionStatement`&&t.expression.type===`CallExpression`){let n=t.expression;if(n.callee.type===`FunctionExpression`){let t=n.callee,r=t.params.length>0?t.params[0]:null;if(!this.iifeParamName&&r?.type===`Identifier`&&(this.iifeParamName=r.name),t.body?.type===`BlockStatement`){e=t.body;break}}}if(e)for(let t of e.body)switch(t.type){case`ExpressionStatement`:{let e=t.expression;if(e.type!==`AssignmentExpression`)continue;let n=e.left,r=e.right;if(r.type===`MemberExpression`&&!r.computed&&r.property.type===`Identifier`&&r.property.name===`prototype`){let e=mr(r,this.source),t=n.type===`Identifier`?n.name:mr(n,this.source);if(e){let n=this.declaredVariables.get(e.replace(`.prototype`,``));if(t&&n){let e=new Set,r=`${t}.`;this.pendingPrototypeAliasBinding=[r,n],n.prototypeAliases.set(r,e)}}}if(n.type===`Identifier`){let t=this.declaredVariables.get(n.name);if(!t)continue;if(t.node.init=r,this.needsDependencyAnalysis(r)&&(t.dependencies=this.findDependencies(e.right,n.name)),this.onMatch(t.node,t))return}else if(e.left.type===`MemberExpression`){let n=mr(e.left,this.source),i=this.pendingPrototypeAliasBinding?.[0];if(i&&(n?.includes(i)||n===i.slice(0,-1))){let e=this.declaredVariables.get(this.pendingPrototypeAliasBinding?.[1].name||``);if(e){let a=e.prototypeAliases.get(i),o={name:n,node:t,dependents:this.dependentsTracker.get(n)||new Set,predeclared:!1,prototypeAliases:new Map,dependencies:this.findDependencies(r,n)};a?a.add(o):e.prototypeAliases.set(i,new Set([o]))}}else this.pendingPrototypeAliasBinding=null;if(!n||this.declaredVariables.has(n))continue;let a={name:n,node:t,dependents:this.dependentsTracker.get(n)||new Set,predeclared:!1,prototypeAliases:new Map,dependencies:this.findDependencies(r,n)},o=hr(e.left,this.source);if(o&&o!==n&&!o.startsWith(`this.`)&&a.dependencies.add(o.replace(`.prototype`,``)),this.dependentsTracker.has(n)&&this.dependentsTracker.delete(n),this.declaredVariables.set(n,a),this.onMatch(t,a))return}break}case`VariableDeclaration`:this.pendingPrototypeAliasBinding=null;for(let e of t.declarations){if(e.id.type!==`Identifier`)continue;let n={name:e.id.name,node:e,dependents:this.dependentsTracker.get(e.id.name)||new Set,prototypeAliases:new Map,dependencies:new Set,predeclared:!1},r=e.init;if(!r&&t.kind===`var`?n.predeclared=!0:r&&this.needsDependencyAnalysis(r)&&(n.dependencies=this.findDependencies(r,n.name)),this.dependentsTracker.has(n.name)&&this.dependentsTracker.delete(n.name),this.declaredVariables.set(n.name,n),this.onMatch(e,n))return}}}needsDependencyAnalysis(e){if(!e)return!1;switch(e.type){case`FunctionExpression`:case`ArrowFunctionExpression`:case`ArrayExpression`:case`LogicalExpression`:case`CallExpression`:case`NewExpression`:case`MemberExpression`:case`BinaryExpression`:case`ConditionalExpression`:case`ObjectExpression`:case`SequenceExpression`:case`ClassExpression`:case`Identifier`:return!0;default:return!1}}onMatch(e,t){if(!this.hasExtractions)return!1;let n=!1,r=!1;for(let i of this.extractionStates)if(!i.node){if(e.type===`VariableDeclarator`&&!e.init||(r=i.config.match(e),!r))continue;i.node=e,n=!0,t&&(i.metadata=t,i.dependents=t.dependents,i.dependencies=t.dependencies,typeof r!=`boolean`&&(i.matchContext=r)),this.refreshExtractionState(i)}else if(i.node!==e&&(this.refreshExtractionState(i),this.shouldStopTraversal()))return!0;return n?this.shouldStopTraversal():!1}refreshExtractionState(e){if(!e.node){e.ready=!1;return}if(e.config.collectDependencies===!1){e.ready=!0;return}if(!e.metadata){e.ready=!1;return}e.ready=this.areDependenciesResolved(e.dependencies)}shouldStopTraversal(){if(!this.hasExtractions)return!1;let e=!1;for(let t of this.extractionStates)if(t.config.stopWhenReady!==!1&&(e=!0,!t.node||!t.ready))return!1;return e}areDependenciesResolved(e,t=new Set){if(!e||e.size===0)return!0;for(let n of e){if(!n||ur.has(n)||n===this.iifeParamName||t.has(n))continue;let e=this.declaredVariables.get(n);if(!e||(t.add(n),!this.areDependenciesResolved(e.dependencies,t)))return!1}return!0}findDependencies(e,t){let n=new Set;if(!e)return n;let r=[{names:new Set,type:`block`}],i=()=>r[r.length-1],a=e=>{for(let t=r.length-1;t>=0;t--)if(r[t].names.has(e))return!0;return!1},o=`id`in e&&e?.id?.type===`Identifier`?e.id.name:void 0,s=(e,t)=>{if(e)switch(e.type){case`Identifier`:t.add(e.name);break;case`ObjectPattern`:for(let n of e.properties)n.type===`RestElement`?s(n.argument,t):n.type===`Property`&&s(n.value,t);break;case`ArrayPattern`:for(let n of e.elements)n&&s(n,t);break;case`RestElement`:s(e.argument,t);break;case`AssignmentPattern`:s(e.left,t)}},c=(e,t)=>{if(e?.params)for(let n of e.params)s(n,t)};return dr(e,{enter:(e,l)=>{switch(e.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:{let t=e.type===`FunctionDeclaration`,n=`id`in e?e.id?.name:void 0;t&&n&&i().names.add(n);let a={names:new Set,type:`function`};e.type===`FunctionExpression`&&n&&a.names.add(n),c(e,a.names),r.push(a);break}case`BlockStatement`:r.push({names:new Set,type:`block`});break;case`CatchClause`:{let t=new Set;e.param&&s(e.param,t),r.push({names:t,type:`block`});break}case`VariableDeclaration`:{let t=e.kind===`var`?r.findLast(e=>e.type===`function`)??i():i();for(let n of e.declarations)s(n.id,t.names);break}case`ClassDeclaration`:e.id?.name&&i().names.add(e.id.name);break;case`LabeledStatement`:e.label?.type===`Identifier`&&i().names.add(e.label.name);break;case`Identifier`:{if(e.name===o||l?.type===`Property`&&l.key===e&&!l.computed||l?.type===`MethodDefinition`&&l.key===e&&!l.computed)return;if(l?.type===`MemberExpression`&&l.property===e&&!l.computed){if(l.object.type===`ThisExpression`)return;let e=mr(l,this.source);if(!e)return;let r=this.declaredVariables.get(e);if(r)r.dependents.add(t),n.add(e);else if(l.object.type===`Identifier`){let r=l.object.name,i=this.declaredVariables.get(r);if((i||r===this.iifeParamName)&&!a(r)&&!ur.has(r)){i?.dependents.add(t),n.add(e);let r=this.dependentsTracker.get(e);r?r.add(t):this.dependentsTracker.set(e,new Set([t]))}}return}if(l?.type===`MetaProperty`||a(e.name)||ur.has(e.name))return;n.add(e.name);let r=this.declaredVariables.get(e.name);if(r)r.dependents.add(t);else{let n=this.dependentsTracker.get(e.name);n?n.add(t):this.dependentsTracker.set(e.name,new Set([t]))}break}case`ForStatement`:case`ForInStatement`:case`ForOfStatement`:r.push({names:new Set,type:`block`})}},leave:e=>{switch(e.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`BlockStatement`:case`CatchClause`:case`ForStatement`:case`ForInStatement`:case`ForOfStatement`:r.length>1&&r.pop()}}}),n}getExtractedMatches(){return this.extractionStates.filter(e=>!!e.node)}getSource(){return this.source}},ms=class{analyzer;constructor(e){this.analyzer=e}areSafeArgs(e,t=`strict`){return(e??[]).every(e=>!e||e.type===`SpreadElement`?!1:this.isSafeInitializer(e,t))}isSafeInitializer(e,t=`strict`){if(!e)return!0;switch(e.type){case`ClassExpression`:return!0;case`Literal`:{let t=e;return typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||!!t.regex}case`TemplateLiteral`:return e.expressions.every(e=>this.isSafeInitializer(e,t));case`ArrayExpression`:return e.elements.every(e=>!e||e.type!==`SpreadElement`&&this.isSafeInitializer(e,t));case`ObjectExpression`:return e.properties.every(e=>{if(e.type!==`Property`||e.computed||e.kind!==`init`)return!1;let t=e.value;return t?t.type===`FunctionExpression`||t.type===`ArrowFunctionExpression`||t.type===`Literal`:!1});case`CallExpression`:if(e.callee.type===`Identifier`&&ur.has(e.callee.name))return this.areSafeArgs(e.arguments,t);if(e.callee.type===`MemberExpression`){if(!this.isSafeInitializer(e.callee.object,t))return!1;if(t===`strict`){let t=e.callee.property.type===`Identifier`?e.callee.property.name:``;if(e.callee.computed||!ur.has(t))return!1}return this.areSafeArgs(e.arguments,t)}return!1;case`NewExpression`:return e.callee.type===`Identifier`&&(ur.has(e.callee.name)||t===`loose`)?this.areSafeArgs(e.arguments,t):!1;case`UnaryExpression`:return this.isSafeInitializer(e.argument,t);case`FunctionExpression`:case`ArrowFunctionExpression`:case`Identifier`:return!0;case`MemberExpression`:return t===`loose`?e.computed&&!this.isSafeInitializer(e.property,t)?!1:this.isSafeInitializer(e.object,t):!e.computed&&e.property.type===`Identifier`&&e.property.name===`prototype`;case`LogicalExpression`:case`BinaryExpression`:return this.isSafeInitializer(e.left,t)&&this.isSafeInitializer(e.right,t);case`ConditionalExpression`:return t===`loose`&&this.isSafeInitializer(e.test,t)&&this.isSafeInitializer(e.consequent,t)&&this.isSafeInitializer(e.alternate,t);case`SequenceExpression`:return t===`loose`&&e.expressions.every(e=>this.isSafeInitializer(e,t));case`AssignmentExpression`:if(e.left.type===`MemberExpression`&&!e.left.computed){let n=e.left.object;if(n.type===`Identifier`&&this.analyzer.declaredVariables.get(n.name)?.node.init!==void 0)return this.isSafeInitializer(e.right,t)}else if(e.left.type===`Identifier`&&this.analyzer.declaredVariables.has(e.left.name))return this.isSafeInitializer(e.right,t);return!1;default:return!1}}getInitializerFallback(e){switch(e?.type){case`ObjectExpression`:case`NewExpression`:case`MemberExpression`:case`LogicalExpression`:return`{}`;case`ArrayExpression`:return`[]`;default:return`undefined`}}renderNode(e,t,n={}){let r=this.analyzer.getSource(),i=this.analyzer.declaredVariables,a=n.disallowSideEffectInitializers,o=typeof a==`object`&&a?a.mode??`strict`:`strict`,s=!!a,c=e.type===`AssignmentExpression`?e:e.type===`ExpressionStatement`&&e.expression.type===`AssignmentExpression`?e.expression:null,l=c&&c.operator===`=`?c.right:e.type===`VariableDeclarator`?e.init:null,u=s&&l&&!this.isSafeInitializer(l,o),d=this.getInitializerFallback(l),f=d;if(!u&&l){if(!t&&l.type===`Identifier`&&!i.has(l.name))f=d;else{let e=c?.left;if((l?.type!==`MemberExpression`||l.computed||l.property.type!==`Identifier`||l.property.name!==`prototype`)&&e?.type===`MemberExpression`&&l&&s&&e.object.type===`Identifier`&&l.type!==`FunctionExpression`&&l.type!==`ArrowFunctionExpression`&&l.type!==`LogicalExpression`&&l.type!==`ClassExpression`)return` // Skipped ${mr(e,r)} assignment.`;f=pr(l,r)?.trim().replace(/;\s*$/,``)||`undefined // [JsExtractor] Failed to extract initializer source.`}}!u&&l&&l.type===`SequenceExpression`&&!f.startsWith(`(`)&&(f=`(${f})`);let p=`${e.type===`VariableDeclarator`&&e.id.type===`Identifier`?e.id.name:c&&c.left.type===`Identifier`?c.left.name:c?.type===`AssignmentExpression`?mr(c.left,r)?.trim():`unknown`} = ${f};`;return e.type===`VariableDeclarator`&&e.init&&!t?` var ${p}`:` ${p}`}buildScript(e){let{maxDepth:t=1/0,forceVarPredeclaration:n=!1,exportRawValues:r=!1,rawValueOnly:i=[]}=e,a=this.analyzer.getExtractedMatches(),o=new Set(a.map(e=>e.metadata?.name||``)),s=[],c=new Set,l=new Map,u={};function d(e){e&&!e.includes(`.`)&&c.add(e)}let f=(r,i=0,a)=>{if(!(!r||i>t))for(let t of r.dependencies){if(a&&a!==t){if(!o.has(a))continue;a=void 0}if(o.has(t))continue;o.add(t);let r=this.analyzer.declaredVariables.get(t);if(!r)continue;let c=n||r.predeclared;if(c&&d(t),f(r,i+1,a),s.push(this.renderNode(r.node,c,e)),r.prototypeAliases.size>0)for(let[,t]of r.prototypeAliases)for(let n of t)f(n,i),s.push(this.renderNode(n.node,c,e))}};for(let t of a){let a=t.config.friendlyName,o=a&&i.includes(a);if(t.metadata){o||s.push(` //#region --- start [${a||`Unknown`}] ---`);let i=(n||t.metadata.predeclared)&&!o,c=t.config.onlyProcessMatchContext;if(i&&d(t.metadata.name),t.config.collectDependencies&&!o){let e,n=t.matchContext;n?.type===`NewExpression`&&c&&(n.callee.type===`Identifier`?e=n.callee.name:n.callee.type===`MemberExpression`&&(e=mr(n.callee,this.analyzer.getSource())||void 0)),f(t.metadata,void 0,e)}if(t.matchContext&&a&&(l.set(a,t.matchContext),r)){let e=t.matchContext,n=this.analyzer.getSource(),r=null;r=e.type===`Property`?pr(e.value,n):e.type===`Identifier`?e.name:pr(e,n),u[a]=r}o||(c||s.push(this.renderNode(t.metadata.node,i,e)),s.push(` //#endregion --- end [${a||`Unknown`}] ---\n`))}}let p=[];p.push(`const __jsExtractorGlobal = typeof globalThis !== 'undefined' ? globalThis :`),p.push(` typeof self !== 'undefined' ? self :`),p.push(` typeof window !== 'undefined' ? window :`),p.push(` typeof global !== 'undefined' ? global : {};
|
|
7
|
+
`),p.push(`const exportedVars = (function(${this.analyzer.iifeParamName}) {`),p.push(` const window = typeof __jsExtractorGlobal.window !== 'undefined' ? __jsExtractorGlobal.window : Object.create(null);`),p.push(` const document = typeof __jsExtractorGlobal.document !== 'undefined' ? __jsExtractorGlobal.document : {};`),p.push(` const self = typeof __jsExtractorGlobal.self !== 'undefined' ? __jsExtractorGlobal.self : window;
|
|
8
|
+
`),c.size>0&&p.push(` var ${Array.from(c).join(`, `)};\n`),p.push(s.join(`
|
|
9
|
+
`));let m=[];for(let[e,t]of l){let n=null;if(t.type===`Identifier`){let e=this.analyzer.declaredVariables.get(t.name);e?.node?.type===`VariableDeclarator`&&e.node.init?.type===`FunctionExpression`&&(n=e.node)}else(t.type===`CallExpression`||t.type===`NewExpression`||t.type===`VariableDeclarator`)&&(n=t);if(n){let t=gr(this.analyzer,e,n);t&&(p.push(`${t}\n`),m.push(e))}}if(r){let e=JSON.stringify(u,null,2).split(`
|
|
10
|
+
`),t=`${e[0]}\n${e.slice(1).map(e=>` `+e).join(`
|
|
11
|
+
`)}`;p.push(` const rawValues = ${t};\n`),m.push(`rawValues`)}return p.push(` return { ${m.join(`, `)} };`),p.push(`})({});
|
|
12
|
+
`),{output:p.join(`
|
|
13
|
+
`),exported:m,exportedRawValues:r?u:void 0}}},hs=class extends p{static type=`OpenPopupAction`;popup;popup_type;constructor(e){super(),this.popup=J(e.popup),this.popup_type=e.popupType}},z=class extends p{static type=`Button`;text;label;tooltip;style;size;icon_type;is_disabled;target_id;endpoint;accessibility;constructor(e){super(),Reflect.has(e,`text`)&&(this.text=new H(e.text).toString()),Reflect.has(e,`accessibility`)&&Reflect.has(e.accessibility,`label`)&&(this.label=e.accessibility.label),`accessibilityData`in e&&`accessibilityData`in e.accessibilityData&&(this.accessibility={accessibility_data:new y(e.accessibilityData.accessibilityData)}),Reflect.has(e,`tooltip`)&&(this.tooltip=e.tooltip),Reflect.has(e,`style`)&&(this.style=e.style),Reflect.has(e,`size`)&&(this.size=e.size),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),Reflect.has(e,`isDisabled`)&&(this.is_disabled=e.isDisabled),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId),this.endpoint=new B(e.navigationEndpoint||e.serviceEndpoint||e.command)}},gs=class extends p{static type=`DropdownItem`;label;selected;value;icon_type;description;endpoint;constructor(e){super(),this.label=new H(e.label).toString(),this.selected=!!e.isSelected,Reflect.has(e,`int32Value`)?this.value=e.int32Value:e.stringValue&&(this.value=e.stringValue),Reflect.has(e,`onSelectCommand`)&&(this.endpoint=new B(e.onSelectCommand)),Reflect.has(e,`icon`)&&(this.icon_type=e.icon?.iconType),Reflect.has(e,`descriptionText`)&&(this.description=new H(e.descriptionText))}},_s=class extends p{static type=`Dropdown`;label;entries;constructor(e){super(),this.label=e.label||``,this.entries=Y(e.entries,gs)}},vs=class extends p{static type=`CreatePlaylistDialog`;title;title_placeholder;privacy_option;cancel_button;create_button;constructor(e){super(),this.title=new H(e.dialogTitle).toString(),this.title_placeholder=e.titlePlaceholder||``,this.privacy_option=J(e.privacyOption,_s),this.create_button=J(e.cancelButton,z),this.cancel_button=J(e.cancelButton,z)}},ys=class extends p{static type=`CommandExecutorCommand`;commands;constructor(e){super(),this.commands=Wy(e.commands)}},B=class e extends p{static type=`NavigationEndpoint`;name;payload;dialog;modal;open_popup;next_endpoint;metadata;command;commands;constructor(t){if(super(),t){if(t.serialCommand||t.parallelCommand){let n=t.serialCommand||t.parallelCommand;this.commands=n.commands.map(t=>new e(t))}(t.innertubeCommand||t.command||t.performOnceCommand)&&(t=t.innertubeCommand||t.command||t.performOnceCommand)}this.command=Uy(t),Reflect.has(t||{},`openPopupAction`)&&(this.open_popup=new hs(t.openPopupAction)),this.name=Object.keys(t||{}).find(e=>e.endsWith(`Endpoint`)||e.endsWith(`Command`)),this.payload=this.name?Reflect.get(t,this.name):{},(Reflect.has(this.payload,`dialog`)||Reflect.has(this.payload,`content`))&&(this.dialog=J(this.payload.dialog||this.payload.content)),Reflect.has(this.payload,`modal`)&&(this.modal=J(this.payload.modal)),Reflect.has(this.payload,`nextEndpoint`)&&(this.next_endpoint=new e(this.payload.nextEndpoint)),t?.serviceEndpoint&&(t=t.serviceEndpoint),this.metadata={},t?.commandMetadata?.webCommandMetadata?.url&&(this.metadata.url=t.commandMetadata.webCommandMetadata.url),t?.commandMetadata?.webCommandMetadata?.webPageType&&(this.metadata.page_type=t.commandMetadata.webCommandMetadata.webPageType),t?.commandMetadata?.webCommandMetadata?.apiUrl?this.metadata.api_url=t.commandMetadata.webCommandMetadata.apiUrl.replace(`/youtubei/v1/`,``):this.name&&(this.metadata.api_url=this.getPath(this.name)),t?.commandMetadata?.webCommandMetadata?.sendPost&&(this.metadata.send_post=t.commandMetadata.webCommandMetadata.sendPost),t?.createPlaylistEndpoint&&t?.createPlaylistEndpoint.createPlaylistDialog&&(this.dialog=J(t?.createPlaylistEndpoint.createPlaylistDialog,vs))}getPath(e){switch(e){case`browseEndpoint`:return`/browse`;case`watchEndpoint`:case`reelWatchEndpoint`:return`/player`;case`searchEndpoint`:return`/search`;case`watchPlaylistEndpoint`:return`/next`;case`liveChatItemContextMenuEndpoint`:return`/live_chat/get_item_context_menu`}}call(e,t){if(!e)throw Error(`An API caller must be provided`);if(this.command){let n=this.command;return n.is(ys)&&(n=n.commands.at(-1)),e.execute(n.getApiPath(),{...n.buildRequest(),...t})}if(!this.metadata.api_url)throw Error(`Expected an api_url, but none was found.`);return e.execute(this.metadata.api_url,{...this.payload,...t})}toURL(){if(this.metadata.url&&this.metadata.page_type)return this.metadata.page_type===`WEB_PAGE_TYPE_UNKNOWN`?this.metadata.url:`https://www.youtube.com${this.metadata.url}`}},V=class e{url;width;height;client_resource;constructor(e){this.url=e.url,this.width=e.width,this.height=e.height,`clientResource`in e&&(this.client_resource={image_name:e.clientResource.imageName,image_color:e.clientResource.imageColor,bundle_id:e.clientResource.bundleId})}static fromResponse(t){if(!t)return[];let n;return t.thumbnails?n=t.thumbnails:t.sources&&(n=t.sources),n?n.map(t=>new e(t)).sort((e,t)=>t.width-e.width):[]}},bs=class{text;emoji;constructor(e){this.text=e.emoji?.emojiId||e.emoji?.shortcuts?.[0]||e.text||``,this.emoji={emoji_id:e.emoji.emojiId,shortcuts:e.emoji?.shortcuts||[],search_terms:e.emoji?.searchTerms||[],image:V.fromResponse(e.emoji.image),is_custom:!!e.emoji?.isCustomEmoji}}toString(){return this.text}toHTML(){let e=Ss(this.text);return`<img src="${this.emoji.image[0].url}" alt="${e}" title="${e}" style="display: inline-block; vertical-align: text-top; height: var(--yt-emoji-size, 1rem); width: var(--yt-emoji-size, 1rem);" loading="lazy" crossorigin="anonymous" />`}},xs=class{text;text_color;endpoint;bold;bracket;dark_mode_text_color;deemphasize;italics;strikethrough;error_underline;underline;font_face;attachment;constructor(e){this.text=e.text,this.bold=!!e.bold,this.bracket=!!e.bracket,this.italics=!!e.italics,this.strikethrough=!!e.strikethrough,this.error_underline=!!e.error_underline,this.underline=!!e.underline,this.deemphasize=!!e.deemphasize,`textColor`in e&&(this.text_color=e.textColor),`navigationEndpoint`in e&&(this.endpoint=new B(e.navigationEndpoint)),`darkModeTextColor`in e&&(this.dark_mode_text_color=e.darkModeTextColor),`fontFace`in e&&(this.font_face=e.fontFace),this.attachment=e.attachment}toString(){return this.text}toHTML(){let e=[];if(this.bold&&e.push(`b`),this.italics&&e.push(`i`),this.strikethrough&&e.push(`s`),this.deemphasize&&e.push(`small`),this.underline&&e.push(`u`),this.error_underline&&e.push(`u`),!this.text?.length)return``;let t=Ss(this.text),n=`<span style="white-space: pre-wrap;">${e.map(e=>`<${e}>`).join(``)+t+e.map(e=>`</${e}>`).join(``)}</span>`;if(this.attachment&&this.attachment.element.type.imageType.image.sources.length&&this.endpoint){let{url:e}=this.attachment.element.type.imageType.image.sources[0],t=``;e&&(t=`<img src="${e}" style="vertical-align: middle; height: ${this.attachment.element.properties.layoutProperties.height.value}px; width: ${this.attachment.element.properties.layoutProperties.width.value}px;" alt="">`);let r=this.endpoint.toURL();if(r)return`<a href="${r}" class="yt-ch-link">${t}${n}</a>`}if(this.endpoint){let e=this.endpoint.toURL();if(e)return`<a href="${e}">${n}</a>`}return n}};function Ss(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}var Cs=`Text`,H=class e{text;runs;endpoint;accessibility;rtl;constructor(e){this.isRunsData(e)?(this.runs=e.runs.map(e=>e.emoji?new bs(e):new xs(e)),this.text=this.runs.map(e=>e.text).join(``)):this.text=e?.simpleText,this.isObject(e)&&`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)}),this.rtl=!!e?.rtl,this.parseEndpoint(e)}isRunsData(e){return this.isObject(e)&&Reflect.has(e,`runs`)&&Array.isArray(e.runs)}parseEndpoint(e){this.isObject(e)&&(`navigationEndpoint`in e?this.endpoint=new B(e.navigationEndpoint):`titleNavigationEndpoint`in e?this.endpoint=new B(e.titleNavigationEndpoint):this.runs?.[0]?.endpoint&&(this.endpoint=(this.runs?.[0]).endpoint))}isObject(e){return typeof e==`object`&&!!e}static fromAttributed(t){let{content:n,commandRuns:r,attachmentRuns:i}=t,a=[{text:n,startIndex:0}],o=t.styleRuns?.map(e=>({...e,startIndex:e.startIndex??0,length:e.length??n.length}));o?.length&&this.processStyleRuns(a,o,t),r?.length&&this.processCommandRuns(a,r.map(e=>({...e,length:e.startIndex===0?Math.min(e.length,n.length):e.length})),t);let s=i?.map(e=>({...e,startIndex:e.startIndex??0,length:e.length??0}));return s?.length&&this.processAttachmentRuns(a,s,t),new e({runs:a})}static processStyleRuns(e,t,n){for(let r of t)if(r.italic||r.strikethrough===`LINE_STYLE_SINGLE`||r.weightLabel===`FONT_WEIGHT_MEDIUM`||r.weightLabel===`FONT_WEIGHT_BOLD`){let t=ws(e,r);if(!t){c(Cs,`Unable to find matching run for style run. Skipping...`,{style_run:r,input_data:n,parsed_runs:JSON.parse(JSON.stringify(e))});continue}Ts(e,t,r,{bold:r.weightLabel===`FONT_WEIGHT_MEDIUM`||r.weightLabel===`FONT_WEIGHT_BOLD`,italics:r.italic,strikethrough:r.strikethrough===`LINE_STYLE_SINGLE`})}else d(Cs,`Skipping style run as it is doesn't have any information that we parse.`,{style_run:r,input_data:n})}static processCommandRuns(e,t,n){for(let r of t)if(r.onTap){let t=ws(e,r);if(!t){c(Cs,`Unable to find matching run for command run. Skipping...`,{command_run:r,input_data:n,parsed_runs:JSON.parse(JSON.stringify(e))});continue}Ts(e,t,r,{navigationEndpoint:r.onTap})}else d(Cs,`Skipping command run as it is missing the "doTap" property.`,{command_run:r,input_data:n})}static processAttachmentRuns(e,t,n){for(let r of t){let t=ws(e,r);if(!t){c(Cs,`Unable to find matching run for attachment run. Skipping...`,{attachment_run:r,input_data:n,parsed_runs:JSON.parse(JSON.stringify(e))});continue}if(r.length===0)t.attachment=r;else{let n=r.startIndex-t.startIndex,i=t.text.substring(n,n+r.length),a=/^:[^:]+:$/.test(i);r.element?.type?.imageType?.image&&(a||/^(?:\p{Emoji}|\u200d)+$/u.test(i))?Ts(e,t,r,{emoji:{image:r.element.type.imageType.image,isCustomEmoji:a,shortcuts:a?[i]:void 0}}):Ts(e,t,r,{attachment:r})}}}toHTML(){return this.runs?this.runs.map(e=>e.toHTML()).join(``):this.text}isEmpty(){return this.text===void 0}toString(){return this.text||`N/A`}};function ws(e,t){return e.find(e=>e.startIndex<=t.startIndex&&t.startIndex+t.length<=e.startIndex+e.text.length)}function Ts(e,t,n,r){let i=e.indexOf(t),a=[],o=n.startIndex-t.startIndex;n.startIndex>t.startIndex&&a.push({...t,text:t.text.substring(0,o)}),a.push({...t,text:t.text.substring(o,o+n.length),startIndex:n.startIndex,...r}),n.startIndex+n.length<t.startIndex+t.text.length&&a.push({...t,text:t.text.substring(o+n.length),startIndex:n.startIndex+n.length}),e.splice(i,1,...a)}var Es=class extends p{static type=`ChannelExternalLinkView`;title;link;favicon;constructor(e){super(),this.title=H.fromAttributed(e.title),this.link=H.fromAttributed(e.link),this.favicon=V.fromResponse(e.favicon)}},Ds=class extends p{static type=`AboutChannelView`;description;description_label;country;custom_links_label;subscriber_count;view_count;joined_date;canonical_channel_url;channel_id;additional_info_label;custom_url_on_tap;video_count;sign_in_for_business_email;links;constructor(e){super(),Reflect.has(e,`description`)&&(this.description=e.description),Reflect.has(e,`descriptionLabel`)&&(this.description_label=H.fromAttributed(e.descriptionLabel)),Reflect.has(e,`country`)&&(this.country=e.country),Reflect.has(e,`customLinksLabel`)&&(this.custom_links_label=H.fromAttributed(e.customLinksLabel)),Reflect.has(e,`subscriberCountText`)&&(this.subscriber_count=e.subscriberCountText),Reflect.has(e,`viewCountText`)&&(this.view_count=e.viewCountText),Reflect.has(e,`joinedDateText`)&&(this.joined_date=H.fromAttributed(e.joinedDateText)),Reflect.has(e,`canonicalChannelUrl`)&&(this.canonical_channel_url=e.canonicalChannelUrl),Reflect.has(e,`channelId`)&&(this.channel_id=e.channelId),Reflect.has(e,`additionalInfoLabel`)&&(this.additional_info_label=H.fromAttributed(e.additionalInfoLabel)),Reflect.has(e,`customUrlOnTap`)&&(this.custom_url_on_tap=new B(e.customUrlOnTap)),Reflect.has(e,`videoCountText`)&&(this.video_count=e.videoCountText),Reflect.has(e,`signInForBusinessEmail`)&&(this.sign_in_for_business_email=H.fromAttributed(e.signInForBusinessEmail)),this.links=Reflect.has(e,`links`)?Y(e.links,Es):[]}},Os=class extends p{static type=`AboutChannel`;metadata;share_channel;constructor(e){super(),this.metadata=J(e.metadata,Ds),this.share_channel=J(e.shareChannel,z)}},ks=class extends p{static type=`AccountChannel`;title;endpoint;constructor(e){super(),this.title=new H(e.title),this.endpoint=new B(e.navigationEndpoint)}},As=class extends p{static type=`AccountItem`;account_name;account_photo;is_selected;is_disabled;has_channel;endpoint;account_byline;channel_handle;constructor(e){super(),this.account_name=new H(e.accountName),this.account_photo=V.fromResponse(e.accountPhoto),this.is_selected=!!e.isSelected,this.is_disabled=!!e.isDisabled,this.has_channel=!!e.hasChannel,this.endpoint=new B(e.serviceEndpoint),this.account_byline=new H(e.accountByline),this.channel_handle=new H(e.channelHandle)}},js=class extends p{static type=`AccountItemSectionHeader`;title;constructor(e){super(),this.title=new H(e.title)}},Ms=class extends p{static type=`CompactLink`;title;subtitle;endpoint;style;icon_type;secondary_icon_type;constructor(e){super(),this.title=new H(e.title).toString(),`subtitle`in e&&(this.subtitle=new H(e.subtitle)),`icon`in e&&`iconType`in e.icon&&(this.icon_type=e.icon.iconType),`secondaryIcon`in e&&`iconType`in e.secondaryIcon&&(this.secondary_icon_type=e.secondaryIcon.iconType),this.endpoint=new B(e.navigationEndpoint||e.serviceEndpoint),this.style=e.style}},Ns=class extends p{static type=`AccountItemSection`;contents;header;constructor(e){super(),this.contents=Y(e.contents,[As,Ms]),this.header=J(e.header,js)}},Ps=class extends p{static type=`AccountSectionList`;contents;footers;constructor(e){super(),this.contents=Y(e.contents,Ns),this.footers=Y(e.footers,ks)}},Fs=class extends p{static type=`AppendContinuationItemsAction`;contents;target;constructor(e){super(),this.contents=Y(e.continuationItems),this.target=e.target}},Is=class extends p{static type=`ChangeEngagementPanelVisibilityAction`;target_id;visibility;constructor(e){super(),this.target_id=e.targetId,this.visibility=e.visibility}},Ls=class extends p{static type=`MultiPageMenu`;header;sections;style;constructor(e){super(),this.header=J(e.header),this.sections=Y(e.sections),this.style=e.style}},Rs=class extends p{static type=`GetMultiPageMenuAction`;menu;constructor(e){super(),this.menu=J(e.menu,Ls)}},zs=class extends p{static type=`SendFeedbackAction`;bucket;constructor(e){super(),this.bucket=e.bucket}},Bs=class extends p{static type=`SignalAction`;signal;constructor(e){super(),this.signal=e.signal}},Vs=class extends p{static type=`ChannelSwitcherPage`;header;contents;constructor(e){super(),this.header=J(e.header),this.contents=zy(e.contents,!0)}},Hs=class extends p{static type=`UpdateChannelSwitcherPageAction`;header;contents;constructor(e){super();let t=J(e.page,Vs);t&&(this.header=t.header,this.contents=t.contents)}},Us=class extends p{static type=`SortFilterSubMenu`;title;icon_type;tooltip;sub_menu_items;accessibility;constructor(e){super(),`title`in e&&(this.title=e.title),`icon`in e&&(this.icon_type=e.icon.iconType),`tooltip`in e&&(this.tooltip=e.tooltip),`subMenuItems`in e&&(this.sub_menu_items=e.subMenuItems.map(e=>({title:e.title,selected:e.selected,continuation:e.continuation?.reloadContinuationData?.continuation,endpoint:new B(e.serviceEndpoint||e.navigationEndpoint),subtitle:e.subtitle||null}))),`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)})}get label(){return this.accessibility?.accessibility_data?.label}},Ws=class extends p{static type=`TranscriptFooter`;language_menu;constructor(e){super(),this.language_menu=J(e.languageMenu,Us)}},Gs=class extends p{static type=`TranscriptSearchBox`;formatted_placeholder;clear_button;endpoint;search_button;constructor(e){super(),this.formatted_placeholder=new H(e.formattedPlaceholder),this.clear_button=J(e.clearButton,z),this.endpoint=new B(e.onTextChangeCommand),this.search_button=J(e.searchButton,z)}},Ks=class extends p{static type=`TranscriptSectionHeader`;start_ms;end_ms;snippet;constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new H(e.snippet)}},qs=class extends p{static type=`TranscriptSegment`;start_ms;end_ms;snippet;start_time_text;target_id;constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new H(e.snippet),this.start_time_text=new H(e.startTimeText),this.target_id=e.targetId}},Js=class extends p{static type=`TranscriptSegmentList`;initial_segments;no_result_label;retry_label;touch_captions_enabled;constructor(e){super(),this.initial_segments=Y(e.initialSegments,[qs,Ks]),this.no_result_label=new H(e.noResultLabel),this.retry_label=new H(e.retryLabel),this.touch_captions_enabled=e.touchCaptionsEnabled}},Ys=class extends p{static type=`TranscriptSearchPanel`;header;body;footer;target_id;constructor(e){super(),this.header=J(e.header,Gs),this.body=J(e.body,Js),this.footer=J(e.footer,Ws),this.target_id=e.targetId}},Xs=class extends p{static type=`Transcript`;content;constructor(e){super(),this.content=J(e.content,Ys)}},Zs=class extends p{static type=`UpdateEngagementPanelAction`;target_id;content;constructor(e){super(),this.target_id=e.targetId,this.content=J(e.content,Xs)}},Qs=class extends p{static type=`UpdateSubscribeButtonAction`;channel_id;subscribed;constructor(e){super(),this.channel_id=e.channelId,this.subscribed=e.subscribed}},$s=class extends p{static type=`ActiveAccountHeader`;account_name;account_photo;endpoint;manage_account_title;channel_handle;constructor(e){super(),this.account_name=new H(e.accountName),this.account_photo=V.fromResponse(e.accountPhoto),this.endpoint=new B(e.serviceEndpoint),this.manage_account_title=new H(e.manageAccountTitle),this.channel_handle=new H(e.channelHandle)}},ec=class extends p{static type=`MenuTitle`;title;constructor(e){super(),this.title=new H(e.title)}},tc=class extends p{static type=`PlaylistAddToOption`;add_to_playlist_service_endpoint;contains_selected_videos;playlist_id;privacy;privacy_icon;remove_from_playlist_service_endpoint;title;constructor(e){super(),this.add_to_playlist_service_endpoint=new B(e.addToPlaylistServiceEndpoint),this.contains_selected_videos=e.containsSelectedVideos,this.playlist_id=e.playlistId,this.privacy=e.privacy,this.privacy_icon={icon_type:e.privacyIcon?.iconType||null},this.remove_from_playlist_service_endpoint=new B(e.removeFromPlaylistServiceEndpoint),this.title=new H(e.title)}},nc=class extends p{static type=`AddToPlaylist`;actions;playlists;constructor(e){super(),this.actions=Y(e.actions,[ec,z]),this.playlists=Y(e.playlists,tc)}},rc=class extends p{static type=`Alert`;text;alert_type;constructor(e){super(),this.text=new H(e.text),this.alert_type=e.type}},ic=class extends p{static type=`AlertWithButton`;text;alert_type;dismiss_button;constructor(e){super(),this.text=new H(e.text),this.alert_type=e.type,this.dismiss_button=J(e.dismissButton,z)}},ac=class extends p{static type=`AnimatedThumbnailOverlayView`;thumbnail;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail)}},oc=class extends p{static type=`AttributionView`;text;suffix;constructor(e){super(),this.text=H.fromAttributed(e.text),this.suffix=H.fromAttributed(e.suffix)}},sc=class extends p{static type=`AudioOnlyPlayability`;audio_only_availability;constructor(e){super(),this.audio_only_availability=e.audioOnlyAvailability}},cc=class extends p{static type=`AutomixPreviewVideo`;playlist_video;constructor(e){super(),e?.content?.automixPlaylistVideoRenderer?.navigationEndpoint&&(this.playlist_video={endpoint:new B(e.content.automixPlaylistVideoRenderer.navigationEndpoint)})}},lc=class extends p{static type=`AvatarView`;image;image_processor;avatar_image_size;constructor(e){super(),this.image=V.fromResponse(e.image),this.avatar_image_size=e.avatarImageSize,e.image.processor&&(this.image_processor={border_image_processor:{circular:e.image.processor.borderImageProcessor.circular}})}},uc=class{on_focus;on_hidden;on_touch_end;on_touch_move;on_long_press;on_tap;on_touch_start;on_visible;on_first_visible;on_hover;constructor(e){`onFocus`in e&&(this.on_focus=new B(e.onFocus)),`onHidden`in e&&(this.on_hidden=new B(e.onHidden)),`onTouchEnd`in e&&(this.on_touch_end=new B(e.onTouchEnd)),`onTouchMove`in e&&(this.on_touch_move=new B(e.onTouchMove)),`onLongPress`in e&&(this.on_long_press=new B(e.onLongPress)),`onTap`in e&&(this.on_tap=new B(e.onTap)),`onTouchStart`in e&&(this.on_touch_start=new B(e.onTouchStart)),`onVisible`in e&&(this.on_visible=new B(e.onVisible)),`onFirstVisible`in e&&(this.on_first_visible=new B(e.onFirstVisible)),`onHover`in e&&(this.on_hover=new B(e.onHover))}},dc=class{command_context;accessibility_context;constructor(e){e&&(`commandContext`in e&&(this.command_context=new uc(e.commandContext)),`accessibilityContext`in e&&(this.accessibility_context=new ee(e.accessibilityContext)))}},fc=class extends p{static type=`AvatarStackView`;avatars;text;avatar_cluster_size;layout_type;renderer_context;constructor(e){super(),this.avatars=Y(e.avatars,lc),`text`in e&&(this.text=H.fromAttributed(e.text)),`avatarClusterSize`in e&&(this.avatar_cluster_size=e.avatarClusterSize),`layoutType`in e&&(this.layout_type=e.layoutType),this.renderer_context=new dc(e.rendererContext)}},U=class extends p{static type=`ButtonView`;secondary_icon_image;icon_name;enable_icon_button;tooltip;icon_image_flip_for_rtl;button_size;icon_position;is_full_width;state;on_disabled_tap;custom_border_color;on_tap;style;icon_image;custom_dark_theme_border_color;title;target_id;enable_full_width_margins;custom_font_color;button_type;enabled;accessibility_id;custom_background_color;on_long_press;title_formatted;on_visible;icon_trailing;accessibility_text;constructor(e){super(),`secondaryIconImage`in e&&(this.secondary_icon_image=V.fromResponse(e.secondaryIconImage)),`iconName`in e&&(this.icon_name=e.iconName),`enableIconButton`in e&&(this.enable_icon_button=e.enableIconButton),`tooltip`in e&&(this.tooltip=e.tooltip),`iconImageFlipForRtl`in e&&(this.icon_image_flip_for_rtl=e.iconImageFlipForRtl),`buttonSize`in e&&(this.button_size=e.buttonSize),`iconPosition`in e&&(this.icon_position=e.iconPosition),`isFullWidth`in e&&(this.is_full_width=e.isFullWidth),`state`in e&&(this.state=e.state),`onDisabledTap`in e&&(this.on_disabled_tap=new B(e.onDisabledTap)),`customBorderColor`in e&&(this.custom_border_color=e.customBorderColor),`onTap`in e&&(this.on_tap=new B(e.onTap)),`style`in e&&(this.style=e.style),`iconImage`in e&&(this.icon_image=e.iconImage),`customDarkThemeBorderColor`in e&&(this.custom_dark_theme_border_color=e.customDarkThemeBorderColor),`title`in e&&(this.title=e.title),`targetId`in e&&(this.target_id=e.targetId),`enableFullWidthMargins`in e&&(this.enable_full_width_margins=e.enableFullWidthMargins),`customFontColor`in e&&(this.custom_font_color=e.customFontColor),`type`in e&&(this.button_type=e.type),`enabled`in e&&(this.enabled=e.enabled),`accessibilityId`in e&&(this.accessibility_id=e.accessibilityId),`customBackgroundColor`in e&&(this.custom_background_color=e.customBackgroundColor),`onLongPress`in e&&(this.on_long_press=new B(e.onLongPress)),`titleFormatted`in e&&(this.title_formatted=e.titleFormatted),`onVisible`in e&&(this.on_visible=e.onVisible),`iconTrailing`in e&&(this.icon_trailing=e.iconTrailing),`accessibilityText`in e&&(this.accessibility_text=e.accessibilityText)}},pc=class extends p{static type=`BackgroundPromo`;body_text;cta_button;icon_type;title;constructor(e){super(),this.body_text=new H(e.bodyText),this.cta_button=J(e.ctaButton,[z,U]),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),this.title=new H(e.title)}},mc=class extends p{static type=`BackstageImage`;image;endpoint;constructor(e){super(),this.image=V.fromResponse(e.image),this.endpoint=new B(e.command)}},hc=class extends p{static type=`ToggleButton`;text;toggled_text;tooltip;toggled_tooltip;is_toggled;is_disabled;icon_type;like_count;short_like_count;endpoint;toggled_endpoint;button_id;target_id;constructor(e){super(),this.text=new H(e.defaultText),this.toggled_text=new H(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=e.defaultIcon?.iconType;let t=e?.defaultText?.accessibility?.accessibilityData?.label||e?.accessibilityData?.accessibilityData?.label||e?.accessibility?.label;this.icon_type==`LIKE`&&(this.like_count=parseInt(t.replace(/\D/g,``)),this.short_like_count=new H(e.defaultText).toString()),this.endpoint=e.defaultServiceEndpoint?.commandExecutorCommand?.commands?new B(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop()):new B(e.defaultServiceEndpoint),this.toggled_endpoint=new B(e.toggledServiceEndpoint),Reflect.has(e,`toggleButtonSupportedData`)&&Reflect.has(e.toggleButtonSupportedData,`toggleButtonIdData`)&&(this.button_id=e.toggleButtonSupportedData.toggleButtonIdData.id),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId)}},gc=class extends p{static type=`CreatorHeart`;creator_thumbnail;heart_icon_type;heart_color;hearted_tooltip;is_hearted;is_enabled;kennedy_heart_color_string;constructor(e){super(),this.creator_thumbnail=V.fromResponse(e.creatorThumbnail),Reflect.has(e,`heartIcon`)&&Reflect.has(e.heartIcon,`iconType`)&&(this.heart_icon_type=e.heartIcon.iconType),this.heart_color={basic_color_palette_data:{foreground_title_color:e.heartColor?.basicColorPaletteData?.foregroundTitleColor}},this.hearted_tooltip=e.heartedTooltip,this.is_hearted=e.isHearted,this.is_enabled=e.isEnabled,this.kennedy_heart_color_string=e.kennedyHeartColorString}},_c=class extends p{static type=`CommentActionButtons`;like_button;dislike_button;reply_button;creator_heart;constructor(e){super(),this.like_button=J(e.likeButton,hc),this.dislike_button=J(e.dislikeButton,hc),this.reply_button=J(e.replyButton,z),this.creator_heart=J(e.creatorHeart,gc)}},vc=class extends p{static type=`ToggleButtonView`;default_button;toggled_button;is_toggling_disabled;identifier;is_toggled;constructor(e){super(),this.default_button=J(e.defaultButtonViewModel,U),this.toggled_button=J(e.toggledButtonViewModel,U),this.is_toggling_disabled=e.isTogglingDisabled,this.identifier=e.identifier,Reflect.has(e,`isToggled`)&&(this.is_toggled=e.isToggled)}},yc=class extends p{static type=`LikeButtonView`;toggle_button;like_status_entity_key;like_status_entity;constructor(e){super(),this.toggle_button=J(e.toggleButtonViewModel,vc),this.like_status_entity_key=e.likeStatusEntityKey,this.like_status_entity={key:e.likeStatusEntity.key,like_status:e.likeStatusEntity.likeStatus}}},bc=class extends p{static type=`DislikeButtonView`;toggle_button;dislike_entity_key;constructor(e){super(),this.toggle_button=J(e.toggleButtonViewModel,vc),this.dislike_entity_key=e.dislikeEntityKey}},xc=class extends p{static type=`SegmentedLikeDislikeButtonView`;like_button;dislike_button;icon_type;like_count_entity;dynamic_like_count_update_data;like_count;short_like_count;constructor(e){if(super(),this.like_button=J(e.likeButtonViewModel,yc),this.dislike_button=J(e.dislikeButtonViewModel,bc),this.icon_type=e.iconType,this.like_button&&this.like_button.toggle_button){let e=this.like_button.toggle_button;e.default_button?(this.short_like_count=e.default_button.title,e.default_button.accessibility_text&&(this.like_count=parseInt(e.default_button.accessibility_text.replace(/\D/g,``)))):e.toggled_button&&(this.short_like_count=e.toggled_button.title,e.toggled_button.accessibility_text&&(this.like_count=parseInt(e.toggled_button.accessibility_text.replace(/\D/g,``))))}this.like_count_entity={key:e.likeCountEntity.key},this.dynamic_like_count_update_data={update_status_key:e.dynamicLikeCountUpdateData.updateStatusKey,placeholder_like_count_values_key:e.dynamicLikeCountUpdateData.placeholderLikeCountValuesKey,update_delay_loop_id:e.dynamicLikeCountUpdateData.updateDelayLoopId,update_delay_sec:e.dynamicLikeCountUpdateData.updateDelaySec}}},Sc=class extends z{static type=`MenuServiceItem`;constructor(e){super(e)}},Cc=class extends p{static type=`DownloadButton`;style;size;endpoint;target_id;constructor(e){super(),this.style=e.style,this.size=e.size,this.endpoint=new B(e.command),this.target_id=e.targetId}},wc=class extends p{static type=`MenuServiceItemDownload`;has_separator;endpoint;constructor(e){super(),this.has_separator=!!e.hasSeparator,this.endpoint=new B(e.navigationEndpoint||e.serviceEndpoint)}},Tc=class extends p{static type=`SubscribeButtonView`;subscribe_button_content;unsubscribe_button_content;disable_notification_bell;button_style;is_signed_out;background_style;disable_subscribe_button;on_show_subscription_options;channel_id;enable_subscribe_button_post_click_animation;bell_accessibility_data;constructor(e){super(),this.subscribe_button_content=this.#e(e.subscribeButtonContent),this.unsubscribe_button_content=this.#e(e.unsubscribeButtonContent),this.disable_notification_bell=e.disableNotificationBell,`buttonStyle`in e&&(this.button_style={unsubscribed_state_style:e.buttonStyle?.unsubscribedStateStyle,subscribed_state_style:e.buttonStyle?.subscribedStateStyle}),this.is_signed_out=e.isSignedOut,this.background_style=e.backgroundStyle,this.disable_subscribe_button=e.disableSubscribeButton,`onShowSubscriptionOptions`in e&&(this.on_show_subscription_options=new B(e.onShowSubscriptionOptions)),this.channel_id=e.channelId,this.state_entity_store_key=e.stateEntityStoreKey,this.enable_subscribe_button_post_click_animation=e.enableSubscribeButtonPostClickAnimation,`bellAccessibilityData`in e&&(this.bell_accessibility_data={off_label:e.bellAccessibilityData?.offLabel,all_label:e.bellAccessibilityData?.allLabel,occasional_label:e.bellAccessibilityData?.occasionalLabel,disabled_label:e.bellAccessibilityData?.disabledLabel})}#e(e){return{button_text:e.buttonText,accessibility_text:e.accessibilityText,image_name:e.imageName,subscribe_state_subscribed:e.subscribeState.subscribed,endpoint:new B(e.onTapCommand)}}},Ec=class extends p{static type=`ListItemView`;title;subtitle;selection_text;selection_style;background_color;leading_accessory;leading_image;trailing_button;trailing_buttons;is_disabled;is_selected;has_divider_below;renderer_context;constructor(e){super(),`title`in e&&(this.title=H.fromAttributed(e.title)),`subtitle`in e&&(this.subtitle=H.fromAttributed(e.subtitle)),`selectionText`in e&&(this.selection_text=H.fromAttributed(e.selectionText)),`selectionStyle`in e&&(this.selection_style=e.selectionStyle),`backgroundColor`in e&&(this.background_color=parseInt(e.backgroundColor,16)),this.leading_image=V.fromResponse(e.leadingImage),this.leading_accessory=J(e.leadingAccessory,lc),this.trailing_buttons=Y(e.trailingButtons?.buttons,Tc),this.trailing_button=J(e.trailingButton),this.is_disabled=!!e.isDisabled,this.is_selected=!!e.isSelected,this.has_divider_below=!!e.hasDividerBelow,`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Dc=class extends p{static type=`MenuFlexibleItem`;menu_item;top_level_button;constructor(e){super(),this.menu_item=J(e.menuItem,[Ec,Sc,wc]),this.top_level_button=J(e.topLevelButton,[Cc,U,z])}},Oc=class extends p{static type=`LikeButton`;target;like_status;likes_allowed;endpoints;constructor(e){super(),this.target={video_id:e.target.videoId},this.like_status=e.likeStatus,this.likes_allowed=e.likesAllowed,Reflect.has(e,`serviceEndpoints`)&&(this.endpoints=e.serviceEndpoints.map(e=>new B(e)))}},kc=class extends p{static type=`FlexibleActionsView`;actions_rows;style;constructor(e){super(),this.actions_rows=e.actionsRows.map(e=>({actions:Y(e.actions,[U,vc,Tc])})),this.style=e.style}},W=class extends p{static type=`Menu`;items;flexible_items;top_level_buttons;accessibility;constructor(e){super(),this.items=Y(e.items),this.flexible_items=Y(e.flexibleItems,Dc),this.top_level_buttons=Y(e.topLevelButtons,[hc,Oc,z,U,xc,kc]),`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)})}get label(){return this.accessibility?.accessibility_data?.label}get contents(){return this.items}},Ac=class extends p{static type=`BackstagePost`;id;author;content;published;poll_status;vote_status;vote_count;menu;action_buttons;vote_button;surface;endpoint;attachment;constructor(e){super(),this.id=e.postId,this.author=new X({...e.authorText,navigationEndpoint:e.authorEndpoint},null,e.authorThumbnail),this.content=new H(e.contentText),this.published=new H(e.publishedTimeText),Reflect.has(e,`pollStatus`)&&(this.poll_status=e.pollStatus),Reflect.has(e,`voteStatus`)&&(this.vote_status=e.voteStatus),Reflect.has(e,`voteCount`)&&(this.vote_count=new H(e.voteCount)),Reflect.has(e,`actionMenu`)&&(this.menu=J(e.actionMenu,W)),Reflect.has(e,`actionButtons`)&&(this.action_buttons=J(e.actionButtons,_c)),Reflect.has(e,`voteButton`)&&(this.vote_button=J(e.voteButton,z)),Reflect.has(e,`navigationEndpoint`)&&(this.endpoint=new B(e.navigationEndpoint)),Reflect.has(e,`backstageAttachment`)&&(this.attachment=J(e.backstageAttachment)),this.surface=e.surface}},jc=class extends p{static type=`BackstagePostThread`;post;constructor(e){super(),this.post=J(e.post)}},Mc=class extends p{text;style;accessibility_label;constructor(e){super(),this.text=e.badgeText,this.style=e.badgeStyle,this.accessibility_label=e.accessibilityLabel}},Nc=class extends p{static type=`SubFeedOption`;name;is_selected;endpoint;constructor(e){super(),this.name=new H(e.name),this.is_selected=e.isSelected,this.endpoint=new B(e.navigationEndpoint)}},Pc=class extends p{static type=`SubFeedSelector`;title;options;constructor(e){super(),this.title=new H(e.title),this.options=Y(e.options,Nc)}},Fc=class extends p{static type=`EomSettingsDisclaimer`;disclaimer;info_icon;usage_scenario;constructor(e){super(),this.disclaimer=new H(e.disclaimer),this.info_icon={icon_type:e.infoIcon.iconType},this.usage_scenario=e.usageScenario}},Ic=class extends p{static type=`SearchBox`;endpoint;search_button;clear_button;placeholder_text;constructor(e){super(),this.endpoint=new B(e.endpoint),this.search_button=J(e.searchButton,z),this.clear_button=J(e.clearButton,z),this.placeholder_text=new H(e.placeholderText)}},Lc=class extends p{static type=`BrowseFeedActions`;contents;constructor(e){super(),this.contents=Y(e.contents,[Pc,Fc,hc,Ms,Ic,z])}},Rc=class extends p{static type=`BrowserMediaSession`;album;thumbnails;constructor(e){super(),this.album=new H(e.album),this.thumbnails=V.fromResponse(e.thumbnailDetails)}},zc=class extends p{static type=`ButtonCardView`;title;icon_name;renderer_context;constructor(e){super(),this.title=e.title,this.icon_name=e.image.sources[0].clientResource.imageName,this.renderer_context=new dc(e.rendererContext)}},Bc=class extends p{static type=`HeaderLink`;endpoint;icon;title;constructor(e){super(),this.endpoint=new B(e.navigationEndpoint),this.icon=V.fromResponse(e.icon),this.title=new H(e.title)}},Vc=class extends p{static type=`ChannelHeaderLinks`;primary;secondary;constructor(e){super(),this.primary=_(e.primaryLinks?.map(e=>new Bc(e))||[]),this.secondary=_(e.secondaryLinks?.map(e=>new Bc(e))||[])}},Hc=class extends p{static type=`ChannelHeaderLinksView`;first_link;more;constructor(e){super(),Reflect.has(e,`firstLink`)&&(this.first_link=H.fromAttributed(e.firstLink)),Reflect.has(e,`more`)&&(this.more=H.fromAttributed(e.more))}},Uc=class extends p{static type=`ClipCreationTextInput`;placeholder_text;max_character_limit;constructor(e){super(),this.placeholder_text=new H(e.placeholderText),this.max_character_limit=e.maxCharacterLimit}},Wc=class extends p{static type=`ClipCreationScrubber`;length_template;max_length_ms;min_length_ms;default_length_ms;window_size_ms;start_label;end_label;duration_label;constructor(e){super(),this.length_template=e.lengthTemplate,this.max_length_ms=e.maxLengthMs,this.min_length_ms=e.minLengthMs,this.default_length_ms=e.defaultLengthMs,this.window_size_ms=e.windowSizeMs,this.start_label=e.startAccessibility?.accessibilityData?.label,this.end_label=e.endAccessibility?.accessibilityData?.label,this.duration_label=e.durationAccessibility?.accessibilityData?.label}},Gc=class extends p{static type=`ClipAdState`;title;body;constructor(e){super(),this.title=new H(e.title),this.body=new H(e.body)}},Kc=class extends p{static type=`ClipCreation`;user_avatar;title_input;scrubber;save_button;display_name;publicity_label;cancel_button;ad_state_overlay;external_video_id;publicity_label_icon;constructor(e){super(),this.user_avatar=V.fromResponse(e.userAvatar),this.title_input=J(e.titleInput,[Uc]),this.scrubber=J(e.scrubber,[Wc]),this.save_button=J(e.saveButton,[z]),this.display_name=new H(e.displayName),this.publicity_label=e.publicityLabel,this.cancel_button=J(e.cancelButton,[z]),this.ad_state_overlay=J(e.adStateOverlay,[Gc]),this.external_video_id=e.externalVideoId,this.publicity_label_icon=e.publicityLabelIcon}},qc=class extends p{static type=`ClipSection`;contents;constructor(e){super(),this.contents=zy(e.contents,!0,[Kc])}},G=class extends p{static type=`ContinuationItem`;trigger;button;endpoint;constructor(e){super(),this.trigger=e.trigger,Reflect.has(e,`button`)&&(this.button=J(e.button,z)),this.endpoint=new B(e.continuationEndpoint)}},Jc=class extends p{static type=`EngagementPanelTitleHeader`;title;visibility_button;contextual_info;menu;constructor(e){super(),this.title=new H(e.title),this.contextual_info=e.contextualInfo?new H(e.contextualInfo):void 0,this.visibility_button=J(e.visibilityButton,z),this.menu=J(e.menu)}},Yc=class extends p{static type=`MacroMarkersInfoItem`;info_text;menu;constructor(e){super(),this.info_text=new H(e.infoText),this.menu=J(e.menu,W)}},Xc=class extends p{static type=`MacroMarkersListItem`;title;time_description;thumbnail;on_tap_endpoint;layout;is_highlighted;constructor(e){super(),this.title=new H(e.title),this.time_description=new H(e.timeDescription),this.thumbnail=V.fromResponse(e.thumbnail),this.on_tap_endpoint=new B(e.onTap),this.layout=e.layout,this.is_highlighted=!!e.isHighlighted}},Zc=class extends p{static type=`MacroMarkersList`;contents;sync_button_label;constructor(e){super(),this.contents=Y(e.contents,[Yc,Xc]),this.sync_button_label=new H(e.syncButtonLabel)}},Qc=class extends p{static type=`ContentListItemView`;title;action_button;avatar;image;metadata;renderer_context;constructor(e){super(),this.title=H.fromAttributed(e.title),this.action_button=J(e.actionButton),this.avatar=J(e.avatar),this.image=V.fromResponse(e.image),this.metadata=J(e.metadata),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},$c=class{id;initial_values;constructor(e){this.id=e.id,`initialValues`in e&&(this.initial_values={collaborator_channel_ids:e.initialValues?.collaboratorChannelIds,is_allow_new_collaborators_enabled:e.initialValues?.isAllowNewCollaboratorsEnabled,is_collaboration_enabled:e.initialValues?.isCollaborationEnabled,is_invite_collaborators_button_enabled:e.initialValues?.isInviteCollaboratorsButtonEnabled})}},el=class{remove_collaborator_confirmation_dialog;external_channel_id;collaborator_content_list_item;constructor(e){this.remove_collaborator_confirmation_dialog=J(e.removeCollaboratorConfirmationDialog),this.external_channel_id=e.externalChannelId,this.collaborator_content_list_item=J(e.collaboratorContentListItem)}},tl=class extends p{static type=`PlaylistCollaborationView`;playlist_collaborators;turn_off_collaboration_dialog;copy_link_button;collaborate_playlist_collaboration_setting;playlist_collaboration_entity_key;playlist_collaborators_data;leave_collaborative_playlist_confirmation_dialog;collaboration_type;allow_new_collaborators_playlist_collaboration_setting;playlist_collaboration_form_schema;turn_off_allow_new_collaborators_dialog;invite_collaborators_button;constructor(e){super(),this.playlist_collaborators=Y(e.playlistCollaborators,Qc),this.turn_off_collaboration_dialog=J(e.turnOffCollaborationDialog),this.copy_link_button=J(e.copyLinkButton),this.collaborate_playlist_collaboration_setting=J(e.collaboratePlaylistCollaborationSetting),`playlistCollaboratorsData`in e&&(this.playlist_collaborators_data=e.playlistCollaboratorsData.map(e=>new el(e))),`playlistCollaborationFormSchema`in e&&(this.playlist_collaboration_form_schema=new $c(e.playlistCollaborationFormSchema)),this.leave_collaborative_playlist_confirmation_dialog=J(e.leaveCollaborativePlaylistConfirmationDialog),this.allow_new_collaborators_playlist_collaboration_setting=J(e.allowNewCollaboratorsPlaylistCollaborationSetting),this.turn_off_allow_new_collaborators_dialog=J(e.turnOffAllowNewCollaboratorsDialog),this.invite_collaborators_button=J(e.inviteCollaboratorsButton),this.playlist_collaboration_entity_key=e.playlistCollaborationEntityKey,this.collaboration_type=e.collaborationType}},nl=class extends p{static type=`ProductList`;contents;constructor(e){super(),this.contents=Y(e.contents)}},K=class extends p{static type=`SectionList`;contents;target_id;continuation;header;sub_menu;constructor(e){super(),this.contents=Y(e.contents),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId),Reflect.has(e,`continuations`)&&(Reflect.has(e.continuations[0],`nextContinuationData`)?this.continuation=e.continuations[0].nextContinuationData.continuation:Reflect.has(e.continuations[0],`reloadContinuationData`)&&(this.continuation=e.continuations[0].reloadContinuationData.continuation)),Reflect.has(e,`header`)&&(this.header=J(e.header)),Reflect.has(e,`subMenu`)&&(this.sub_menu=J(e.subMenu))}},rl=class extends p{static type=`ExpandableVideoDescriptionBody`;show_more_text;show_less_text;attributed_description_body_text;constructor(e){super(),this.show_more_text=new H(e.showMoreText),this.show_less_text=new H(e.showLessText),Reflect.has(e,`attributedDescriptionBodyText`)&&(this.attributed_description_body_text=H.fromAttributed(e.attributedDescriptionBodyText))}},il=class extends p{static type=`SearchRefinementCard`;thumbnails;endpoint;query;constructor(e){super(),this.thumbnails=V.fromResponse(e.thumbnail),this.endpoint=new B(e.searchEndpoint),this.query=new H(e.query).toString()}},al=class extends p{static type=`GameCard`;game;constructor(e){super(),this.game=J(e.game)}},ol=class extends p{static type=`HorizontalList`;visible_item_count;items;constructor(e){super(),this.visible_item_count=e.visibleItemCount,this.items=Y(e.items)}get contents(){return this.items}},sl=class extends p{static type=`VideoSummaryParagraphView`;text;constructor(e){super(),this.text=H.fromAttributed(e.text)}},cl=class extends p{static type=`VideoSummaryContentView`;dislike_button_view;like_button_view;paragraphs;constructor(e){super(),`dislikeButtonViewModel`in e&&(this.dislike_button_view=J(e.dislikeButtonViewModel,bc)),`likeButtonViewModel`in e&&(this.like_button_view=J(e.likeButtonViewModel,yc)),this.paragraphs=Y(e.paragraphs,sl)}},ll=class extends p{static type=`ExpandableMetadata`;header;expanded_content;expand_button;collapse_button;constructor(e){super(),Reflect.has(e,`header`)&&(this.header={collapsed_title:new H(e.header.collapsedTitle),collapsed_thumbnail:V.fromResponse(e.header.collapsedThumbnail),collapsed_label:new H(e.header.collapsedLabel),expanded_title:new H(e.header.expandedTitle)}),this.expanded_content=J(e.expandedContent,[cl,gl,ol]),this.expand_button=J(e.expandButton,z),this.collapse_button=J(e.collapseButton,z)}},ul=class extends p{static type=`MetadataBadge`;icon_type;style;label;tooltip;constructor(e){super(),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),Reflect.has(e,`style`)&&(this.style=e.style),Reflect.has(e,`label`)&&(this.label=e.label),(Reflect.has(e,`tooltip`)||Reflect.has(e,`iconTooltip`))&&(this.tooltip=e.tooltip||e.iconTooltip)}},dl=class extends p{static type=`ThumbnailOverlayTimeStatus`;text;style;icon_type;constructor(e){super(),this.text=new H(e.text).toString(),this.style=e.style,`icon`in e&&(this.icon_type=e.icon.iconType)}},fl=class extends p{static type=`Video`;video_id;title;untranslated_title;description_snippet;snippets;expandable_metadata;additional_metadatas;thumbnails;thumbnail_overlays;rich_thumbnail;author;badges;endpoint;published;view_count;short_view_count;upcoming;length_text;show_action_menu;is_watched;menu;byline_text;search_video_result_entity_key;service_endpoints;service_endpoint;style;inline_player_params;constructor(e){super(),this.title=new H(e.title),this.video_id=e.videoId,this.expandable_metadata=J(e.expandableMetadata,ll),`untranslatedTitle`in e&&(this.untranslated_title=new H(e.untranslatedTitle)),`descriptionSnippet`in e&&(this.description_snippet=new H(e.descriptionSnippet)),`detailedMetadataSnippets`in e&&(this.snippets=e.detailedMetadataSnippets.map(e=>({text:new H(e.snippetText),hover_text:new H(e.snippetHoverText)}))),`additionalMetadatas`in e&&(this.additional_metadatas=e.additionalMetadatas.map(e=>new H(e))),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),`richThumbnail`in e&&(this.rich_thumbnail=J(e.richThumbnail)),this.author=new X(e.ownerText,e.ownerBadges,e.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail),this.badges=Y(e.badges,ul),`navigationEndpoint`in e&&(this.endpoint=new B(e.navigationEndpoint)),`publishedTimeText`in e&&(this.published=new H(e.publishedTimeText)),`viewCountText`in e&&(this.view_count=new H(e.viewCountText)),`shortViewCountText`in e&&(this.short_view_count=new H(e.shortViewCountText)),`upcomingEventData`in e&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`))),this.show_action_menu=!!e.showActionMenu,this.is_watched=!!e.isWatched,this.menu=J(e.menu,W),`searchVideoResultEntityKey`in e&&(this.search_video_result_entity_key=e.searchVideoResultEntityKey),`bylineText`in e&&(this.byline_text=new H(e.bylineText)),`lengthText`in e&&(this.length_text=new H(e.lengthText)),`serviceEndpoints`in e&&(this.service_endpoints=e.serviceEndpoints.map(e=>new B(e))),`serviceEndpoint`in e&&(this.service_endpoint=new B(e.serviceEndpoint)),`style`in e&&(this.style=e.style),this.inline_player_params=e.inlinePlaybackEndpoint?.watchEndpoint?.playerParams}get id(){return this.video_id}get description(){return this.snippets?this.snippets.map(e=>e.text.toString()).join(``):this.description_snippet?.toString()||``}get is_live(){let e=this.thumbnail_overlays.firstOfType(dl);return!e||this.badges.some(e=>{if(e.style===`BADGE_STYLE_TYPE_LIVE_NOW`||e.label===`LIVE`)return!0})||e.style===`LIVE`}get is_upcoming(){return this.upcoming&&this.upcoming>new Date}get is_premiere(){return this.badges.some(e=>e.label===`PREMIERE`)}get is_4k(){return this.badges.some(e=>e.label===`4K`)}get has_captions(){return this.badges.some(e=>e.label===`CC`)}get best_thumbnail(){return this.thumbnails[0]}get duration(){let e=this.thumbnail_overlays.firstOfType(dl),t=this.length_text?.toString()||e?.text.toString();return{text:t,seconds:t?ex(t):0}}},pl=class extends fl{static type=`VideoCard`;metadata_text;constructor(e){super(e),Reflect.has(e,`metadataText`)&&(this.metadata_text=new H(e.metadataText),this.metadata_text.text&&(this.short_view_count=new H({simpleText:this.metadata_text.text.split(`·`)[0]?.trim()}),this.published=new H({simpleText:this.metadata_text.text.split(`·`)[1]?.trim()}))),Reflect.has(e,`bylineText`)&&(this.author=new X(e.bylineText,e.ownerBadges,e.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail))}},ml=class extends p{static type=`ContentPreviewImageView`;image;style;constructor(e){super(),this.image=V.fromResponse(e.image),this.style=e.style}},hl=class extends p{static type=`VideoAttributeView`;image;image_style;title;subtitle;secondary_subtitle;orientation;sizing_rule;overflow_menu_on_tap;overflow_menu_a11y_label;on_tap;constructor(e){super(),this.image=e.image?.sources?V.fromResponse(e.image):J(e.image,ml),this.image_style=e.imageStyle,this.title=e.title,this.subtitle=e.subtitle,Reflect.has(e,`secondarySubtitle`)&&(this.secondary_subtitle={content:e.secondarySubtitle.content}),this.orientation=e.orientation,this.sizing_rule=e.sizingRule,this.overflow_menu_on_tap=new B(e.overflowMenuOnTap),this.overflow_menu_a11y_label=e.overflowMenuA11yLabel,`onTap`in e&&(this.on_tap=new B(e.onTap))}},gl=class extends p{static type=`HorizontalCardList`;cards;header;previous_button;next_button;footer_button;constructor(e){super(),this.cards=Y(e.cards,[hl,il,Xc,al,pl]),this.header=J(e.header),this.previous_button=J(e.previousButton,z),this.next_button=J(e.nextButton,z),this.footer_button=J(e.footerButton,U)}},_l=class extends p{static type=`Factoid`;label;value;accessibility_text;constructor(e){super(),this.label=new H(e.label),this.value=new H(e.value),this.accessibility_text=e.accessibilityText}},vl=class extends p{static type=`UploadTimeFactoid`;factoid;constructor(e){super(),this.factoid=J(e.factoid,_l)}},yl=class extends p{static type=`ViewCountFactoid`;view_count_entity_key;factoid;view_count_type;constructor(e){super(),this.view_count_entity_key=e.viewCountEntityKey,this.factoid=J(e.factoid,[_l]),this.view_count_type=e.viewCountType}},bl=class extends p{static type=`HypePointsFactoid`;factoid;constructor(e){super(),this.factoid=J(e.factoid,_l)}},xl=class extends p{static type=`VideoDescriptionHeader`;channel;channel_navigation_endpoint;channel_thumbnail;factoids;publish_date;title;views;constructor(e){super(),this.title=new H(e.title),this.channel=new H(e.channel),this.channel_navigation_endpoint=new B(e.channelNavigationEndpoint),this.channel_thumbnail=V.fromResponse(e.channelThumbnail),this.publish_date=new H(e.publishDate),this.views=new H(e.views),this.factoids=Y(e.factoid,[_l,bl,yl,vl])}},Sl=class extends p{static type=`VideoDescriptionInfocardsSection`;section_title;creator_videos_button;creator_about_button;creator_custom_url_buttons;section_subtitle;channel_avatar;channel_endpoint;infocards;constructor(e){super(),this.section_title=new H(e.sectionTitle),this.creator_videos_button=J(e.creatorVideosButton,z),this.creator_about_button=J(e.creatorAboutButton,z),this.section_subtitle=new H(e.sectionSubtitle),this.creator_custom_url_buttons=Y(e.creatorCustomUrlButtons,U),this.channel_avatar=V.fromResponse(e.channelAvatar),this.channel_endpoint=new B(e.channelEndpoint),this.infocards=Y(e.infocards)}},Cl=class extends p{static type=`InfoRow`;title;default_metadata;expanded_metadata;info_row_expand_status_key;constructor(e){super(),this.title=new H(e.title),Reflect.has(e,`defaultMetadata`)&&(this.default_metadata=new H(e.defaultMetadata)),Reflect.has(e,`expandedMetadata`)&&(this.expanded_metadata=new H(e.expandedMetadata)),Reflect.has(e,`infoRowExpandStatusKey`)&&(this.info_row_expand_status_key=e.infoRowExpandStatusKey)}},wl=class extends p{static type=`CompactVideo`;video_id;thumbnails;rich_thumbnail;title;author;view_count;short_view_count;short_byline_text;long_byline_text;published;badges;thumbnail_overlays;endpoint;menu;length_text;is_watched;service_endpoints;service_endpoint;style;constructor(e){super(),this.video_id=e.videoId,this.thumbnails=V.fromResponse(e.thumbnail),this.title=new H(e.title),this.author=new X(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.is_watched=!!e.isWatched,this.thumbnail_overlays=Y(e.thumbnailOverlays),this.menu=J(e.menu,W),this.badges=Y(e.badges,ul),`publishedTimeText`in e&&(this.published=new H(e.publishedTimeText)),`shortBylineText`in e&&(this.view_count=new H(e.viewCountText)),`shortViewCountText`in e&&(this.short_view_count=new H(e.shortViewCountText)),`richThumbnail`in e&&(this.rich_thumbnail=J(e.richThumbnail)),`shortBylineText`in e&&(this.short_byline_text=new H(e.shortBylineText)),`longBylineText`in e&&(this.long_byline_text=new H(e.longBylineText)),`lengthText`in e&&(this.length_text=new H(e.lengthText)),`serviceEndpoints`in e&&(this.service_endpoints=e.serviceEndpoints.map(e=>new B(e))),`serviceEndpoint`in e&&(this.service_endpoint=new B(e.serviceEndpoint)),`navigationEndpoint`in e&&(this.endpoint=new B(e.navigationEndpoint)),`style`in e&&(this.style=e.style)}get id(){return this.video_id}get duration(){let e=this.thumbnail_overlays.firstOfType(dl),t=this.length_text?.toString()||e?.text.toString();return{text:t,seconds:t?ex(t):0}}get best_thumbnail(){return this.thumbnails[0]}get is_fundraiser(){return this.badges.some(e=>e.label===`Fundraiser`)}get is_live(){return this.badges.some(e=>{if(e.style===`BADGE_STYLE_TYPE_LIVE_NOW`||e.label===`LIVE`)return!0})}get is_new(){return this.badges.some(e=>e.label===`New`)}get is_premiere(){return this.badges.some(e=>e.style===`PREMIERE`)}},Tl=class extends p{static type=`CarouselLockup`;info_rows;video_lockup;constructor(e){super(),this.info_rows=Y(e.infoRows,Cl),this.video_lockup=J(e.videoLockup,wl)}},El=class extends p{static type=`VideoDescriptionMusicSection`;carousel_lockups;section_title;constructor(e){super(),this.carousel_lockups=Y(e.carouselLockups,Tl),this.section_title=new H(e.sectionTitle)}},Dl=class extends p{static type=`VideoDescriptionTranscriptSection`;section_title;sub_header_text;primary_button;constructor(e){super(),this.section_title=new H(e.sectionTitle),this.sub_header_text=new H(e.subHeaderText),this.primary_button=J(e.primaryButton,z)}},Ol=class extends p{static type=`StructuredDescriptionPlaylistLockup`;thumbnail;title;short_byline_text;video_count_short_text;endpoint;thumbnail_width;aspect_ratio;max_lines_title;max_lines_short_byline_text;overlay_position;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail),this.title=new H(e.title),this.short_byline_text=new H(e.shortBylineText),this.video_count_short_text=new H(e.videoCountShortText),this.endpoint=new B(e.navigationEndpoint),this.thumbnail_width=e.thumbnailWidth,this.aspect_ratio=e.aspectRatio,this.max_lines_title=e.maxLinesTitle,this.max_lines_short_byline_text=e.maxLinesShortBylineText,this.overlay_position=e.overlayPosition}},kl=class extends p{static type=`VideoDescriptionCourseSection`;section_title;media_lockups;constructor(e){super(),this.section_title=new H(e.sectionTitle),this.media_lockups=Y(e.mediaLockups,[Ol])}},Al=class extends p{static type=`VideoAttributesSectionView`;header_title;header_subtitle;video_attributes;previous_button;next_button;constructor(e){super(),this.header_title=e.headerTitle,this.header_subtitle=e.headerSubtitle,this.video_attributes=Y(e.videoAttributeViewModels,hl),this.previous_button=J(e.previousButton,U),this.next_button=J(e.nextButton,U)}},jl=class extends p{static type=`HowThisWasMadeSectionView`;section_title;body_text;body_header;attribution_text;constructor(e){super(),Reflect.has(e,`sectionText`)&&(this.section_title=H.fromAttributed(e.sectionText)),Reflect.has(e,`bodyText`)&&(this.body_text=H.fromAttributed(e.bodyText)),Reflect.has(e,`bodyHeader`)&&(this.body_header=H.fromAttributed(e.bodyHeader)),Reflect.has(e,`attributionText`)&&(this.attribution_text=H.fromAttributed(e.attributionText))}},Ml=class extends p{static type=`ReelShelf`;title;items;endpoint;constructor(e){super(),this.title=new H(e.title),this.items=Y(e.items),Reflect.has(e,`endpoint`)&&(this.endpoint=new B(e.endpoint))}get contents(){return this.items}},Nl=class extends p{static type=`MerchandiseShelf`;title;menu;items;constructor(e){super(),this.title=e.title,this.menu=J(e.actionButton),this.items=Y(e.items)}get contents(){return this.items}},Pl=class extends p{static type=`SectionHeaderView`;headline;constructor(e){super(),this.headline=H.fromAttributed(e.headline)}},Fl=class extends p{static type=`HypeFanCreditsSectionView`;header;constructor(e){super(),this.header=J(e.header,Pl)}},Il=class extends p{static type=`VideoDescriptionYouchatSectionView`;section_title;sub_header_text;primary_button;constructor(e){super(),`sectionTitle`in e&&(this.section_title=H.fromAttributed(e.sectionTitle)),`subHeaderText`in e&&(this.sub_header_text=H.fromAttributed(e.subHeaderText)),this.primary_button=J(e.primaryButton,U)}},Ll=class extends p{static type=`ItemSectionHeader`;title;constructor(e){super(),this.title=new H(e.title)}},Rl=class extends p{static type=`Tab`;title;selected;endpoint;constructor(e){super(),this.title=new H(e.title),this.selected=!!e.selected,this.endpoint=new B(e.endpoint)}},zl=class extends p{static type=`ItemSectionTabbedHeader`;title;tabs;end_items;constructor(e){super(),this.title=new H(e.title),this.tabs=Y(e.tabs,Rl),Reflect.has(e,`endItems`)&&(this.end_items=Y(e.endItems))}},Bl=class extends p{static type=`CommentsHeader`;title;count;comments_count;create_renderer;sort_menu;custom_emojis;constructor(e){super(),this.title=new H(e.titleText),this.count=new H(e.countText),this.comments_count=new H(e.commentsCount),this.create_renderer=J(e.createRenderer),this.sort_menu=J(e.sortMenu,Us),Reflect.has(e,`customEmojis`)&&(this.custom_emojis=e.customEmojis.map(e=>({emoji_id:e.emojiId,shortcuts:e.shortcuts,search_terms:e.searchTerms,image:V.fromResponse(e.image),is_custom_emoji:e.isCustomEmoji})))}},Vl=class extends p{static type=`SortFilterHeader`;filter_menu;constructor(e){super(),this.filter_menu=J(e.filterMenu,Us)}},Hl=class extends p{static type=`ChipCloudChip`;is_selected;endpoint;text;constructor(e){super(),this.is_selected=e.isSelected,Reflect.has(e,`navigationEndpoint`)&&(this.endpoint=new B(e.navigationEndpoint)),this.text=new H(e.text).toString()}},Ul=class extends p{static type=`FeedFilterChipBar`;contents;constructor(e){super(),this.contents=Y(e.contents,Hl)}},Wl=class extends p{static type=`ChipView`;accessibility_hint;accessibility_label;text;trailing_text;display_type;max_text_width;secondary_accessibility_label;original_text;tap_command;secondary_tap_command;chip_entity_key;selected;get endpoint(){return this.tap_command}constructor(e){super(),`accessibilityHint`in e&&(this.accessibility_hint=e.accessibilityHint),`accessibilityLabel`in e&&(this.accessibility_label=e.accessibilityLabel),`chipEntityKey`in e&&(this.chip_entity_key=e.chipEntityKey),`text`in e&&(this.text=e.text),`trailingText`in e&&(this.trailing_text=e.trailingText),`displayType`in e&&(this.display_type=e.displayType),`maxTextWidth`in e&&(this.max_text_width=e.maxTextWidth),`originalText`in e&&(this.original_text=e.originalText),`secondaryAccessibilityLabel`in e&&(this.secondary_accessibility_label=e.secondaryAccessibilityLabel),`tapCommand`in e&&(this.tap_command=new B(e.tapCommand)),`secondaryTapCommand`in e&&(this.secondary_tap_command=new B(e.secondaryTapCommand)),this.selected=!!e.selected}},Gl=class extends p{static type=`ChipBarView`;chips;chip_bar_state_entity_key;renderer_context;constructor(e){super(),this.chips=Y(e.chips,Wl),this.chip_bar_state_entity_key=e.chipBarStateEntityKey,`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Kl=class extends p{static type=`RelatedChipCloud`;content;show_prominent_chips;constructor(e){super(),this.content=J(e.content),this.show_prominent_chips=!!e.showProminentChips}},ql=class extends p{static type=`ItemSection`;header;contents;target_id;continuation;constructor(e){super(),this.header=J(e.header,[Bl,Ll,zl,Vl,Ul,Gl,Kl]),this.contents=Y(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=e.targetId||e.sectionIdentifier),e.continuations&&(this.continuation=e.continuations?.[0]?.nextContinuationData?.continuation)}},Jl=class extends p{static type=`VideoTitleHeaderView`;video_title;header_button;renderer_context;constructor(e){super(),this.video_title=H.fromAttributed(e.videoTitle),this.header_button=J(e.headerButton,U),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Yl=class extends p{static type=`VideoDescriptionGamingSection`;media_lockups;section_title;topic_link;constructor(e){super(),this.media_lockups=Y(e.mediaLockups),this.section_title=new H(e.sectionTitle),this.topic_link=J(e.topicLink)}},Xl=class extends p{static type=`CourseProgressView`;title;progress_summary;progress_percentage;renderer_context;constructor(e){super(),this.title=H.fromAttributed(e.title),this.progress_summary=H.fromAttributed(e.progressSummary),this.progress_percentage=e.progressPercentage,`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Zl=class extends p{static type=`StructuredDescriptionContent`;items;constructor(e){super(),this.items=Y(e.items,[Jl,xl,Yl,rl,El,Sl,kl,Dl,Il,gl,Ml,Al,jl,ll,Nl,Fl,ql,Xl])}},Ql=class extends p{static type=`EngagementPanelSectionList`;header;content;target_id;panel_identifier;identifier;visibility;constructor(e){super(),this.header=J(e.header,Jc),this.content=J(e.content,[tl,hl,K,G,qc,Zl,Zc,nl]),this.panel_identifier=e.panelIdentifier,`identifier`in e&&(this.identifier={surface:e.identifier.surface,tag:e.identifier.tag}),this.target_id=e.targetId,this.visibility=e.visibility}},$l=class extends p{static type=`ChannelTagline`;content;max_lines;more_endpoint;more_icon_type;more_label;target_id;constructor(e){super(),this.content=e.content,this.max_lines=e.maxLines,this.more_endpoint=e.moreEndpoint.showEngagementPanelEndpoint?{show_engagement_panel_endpoint:{engagement_panel:J(e.moreEndpoint.showEngagementPanelEndpoint.engagementPanel,Ql),engagement_panel_popup_type:e.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:e.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,tag:e.moreEndpoint.showEngagementPanelEndpoint.identifier.tag}}}:new B(e.moreEndpoint),this.more_icon_type=e.moreIcon.iconType,this.more_label=e.moreLabel,this.target_id=e.targetId}},eu=class extends p{static type=`SubscriptionNotificationToggleButton`;states;current_state_id;target_id;constructor(e){super(),this.states=e.states.map(e=>({id:e.stateId,next_id:e.nextStateId,state:zy(e.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}},tu=class extends p{static type=`SubscribeButton`;button_text;subscribed;enabled;item_type;channel_id;show_preferences;subscribed_text;unsubscribed_text;unsubscribe_text;notification_preference_button;service_endpoints;on_subscribe_endpoints;on_unsubscribe_endpoints;subscribed_entity_key;target_id;subscribe_accessibility_label;unsubscribe_accessibility_label;constructor(e){super(),this.button_text=new H(e.buttonText),this.subscribed=e.subscribed,this.enabled=e.enabled,this.item_type=e.type,this.channel_id=e.channelId,this.show_preferences=e.showPreferences,Reflect.has(e,`subscribedButtonText`)&&(this.subscribed_text=new H(e.subscribedButtonText)),Reflect.has(e,`unsubscribedButtonText`)&&(this.unsubscribed_text=new H(e.unsubscribedButtonText)),Reflect.has(e,`unsubscribeButtonText`)&&(this.unsubscribe_text=new H(e.unsubscribeButtonText)),this.notification_preference_button=J(e.notificationPreferenceButton,eu),Reflect.has(e,`serviceEndpoints`)&&(this.service_endpoints=e.serviceEndpoints.map(e=>new B(e))),Reflect.has(e,`onSubscribeEndpoints`)&&(this.on_subscribe_endpoints=e.onSubscribeEndpoints.map(e=>new B(e))),Reflect.has(e,`onUnsubscribeEndpoints`)&&(this.on_unsubscribe_endpoints=e.onUnsubscribeEndpoints.map(e=>new B(e))),Reflect.has(e,`subscribedEntityKey`)&&(this.subscribed_entity_key=e.subscribedEntityKey),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId),Reflect.has(e,`subscribeAccessibility`)&&(this.subscribe_accessibility_label=e.subscribeAccessibility.accessibilityData?.label),Reflect.has(e,`unsubscribeAccessibility`)&&(this.unsubscribe_accessibility_label=e.unsubscribeAccessibility.accessibilityData?.label)}},nu=class extends p{static type=`C4TabbedHeader`;author;banner;tv_banner;mobile_banner;subscribers;videos_count;sponsor_button;subscribe_button;header_links;channel_handle;channel_id;tagline;constructor(e){super(),this.author=new X({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),Reflect.has(e,`banner`)&&(this.banner=V.fromResponse(e.banner)),Reflect.has(e,`tv_banner`)&&(this.tv_banner=V.fromResponse(e.tvBanner)),Reflect.has(e,`mobile_banner`)&&(this.mobile_banner=V.fromResponse(e.mobileBanner)),Reflect.has(e,`subscriberCountText`)&&(this.subscribers=new H(e.subscriberCountText)),Reflect.has(e,`videosCountText`)&&(this.videos_count=new H(e.videosCountText)),Reflect.has(e,`sponsorButton`)&&(this.sponsor_button=J(e.sponsorButton,z)),Reflect.has(e,`subscribeButton`)&&(this.subscribe_button=J(e.subscribeButton,[tu,z])),Reflect.has(e,`headerLinks`)&&(this.header_links=J(e.headerLinks,[Vc,Hc])),Reflect.has(e,`channelHandleText`)&&(this.channel_handle=new H(e.channelHandleText)),Reflect.has(e,`channelId`)&&(this.channel_id=e.channelId),Reflect.has(e,`tagline`)&&(this.tagline=J(e.tagline,$l))}},ru=class extends p{static type=`CallToActionButton`;label;icon_type;style;constructor(e){super(),this.label=new H(e.label),this.icon_type=e.icon.iconType,this.style=e.style}},iu=class extends p{static type=`Card`;teaser;content;card_id;feature;cue_ranges;constructor(e){super(),this.teaser=J(e.teaser),this.content=J(e.content),Reflect.has(e,`cardId`)&&(this.card_id=e.cardId),Reflect.has(e,`feature`)&&(this.feature=e.feature),this.cue_ranges=e.cueRanges.map(e=>({start_card_active_ms:e.startCardActiveMs,end_card_active_ms:e.endCardActiveMs,teaser_duration_ms:e.teaserDurationMs,icon_after_teaser_ms:e.iconAfterTeaserMs}))}},au=class extends p{static type=`CardCollection`;cards;header;allow_teaser_dismiss;constructor(e){super(),this.cards=Y(e.cards),this.header=new H(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}},ou=class extends p{static type=`CarouselHeader`;contents;constructor(e){super(),this.contents=Y(e.contents)}},su=class extends p{static type=`CarouselItem`;items;background_color;layout_style;pagination_thumbnails;paginator_alignment;constructor(e){super(),this.items=Y(e.carouselItems),this.background_color=e.backgroundColor,this.layout_style=e.layoutStyle,this.pagination_thumbnails=V.fromResponse(e.paginationThumbnails),this.paginator_alignment=e.paginatorAlignment}get contents(){return this.items}},cu=class extends p{static type=`TextCarouselItemView`;icon_name;text;on_tap_endpoint;button;constructor(e){super(),this.icon_name=e.iconName,this.text=H.fromAttributed(e.text),this.on_tap_endpoint=new B(e.onTap),this.button=J(e.button,U)}},lu=class extends p{static type=`CarouselItemView`;item_type;carousel_item;constructor(e){super(),this.item_type=e.itemType,this.carousel_item=J(e.carouselItem,cu)}},uu=class extends p{static type=`CarouselTitleView`;title;previous_button;next_button;constructor(e){super(),this.title=e.title,this.previous_button=J(e.previousButton,U),this.next_button=J(e.nextButton,U)}},du=class extends p{static type=`Channel`;id;author;subscriber_count;video_count;long_byline;short_byline;endpoint;subscribe_button;description_snippet;constructor(e){super(),this.id=e.channelId,this.author=new X({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscriber_count=new H(e.subscriberCountText),this.video_count=new H(e.videoCountText),this.long_byline=new H(e.longBylineText),this.short_byline=new H(e.shortBylineText),this.endpoint=new B(e.navigationEndpoint),this.subscribe_button=J(e.subscribeButton,[tu,z]),this.description_snippet=new H(e.descriptionSnippet)}},fu=class extends p{static type=`ChannelAboutFullMetadata`;id;name;avatar;canonical_channel_url;primary_links;view_count;joined_date;description;email_reveal;can_reveal_email;country;buttons;constructor(e){super(),this.id=e.channelId,this.name=new H(e.title),this.avatar=V.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.primary_links=e.primaryLinks?.map(e=>({endpoint:new B(e.navigationEndpoint),icon:V.fromResponse(e.icon),title:new H(e.title)}))??[],this.view_count=new H(e.viewCountText),this.joined_date=new H(e.joinedDateText),this.description=new H(e.description),this.email_reveal=new B(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new H(e.country),this.buttons=Y(e.actionButtons,z)}},pu=class extends p{static type=`ChannelAgeGate`;channel_title;avatar;header;main_text;sign_in_button;secondary_text;constructor(e){super(),this.channel_title=e.channelTitle,this.avatar=V.fromResponse(e.avatar),this.header=new H(e.header),this.main_text=new H(e.mainText),this.sign_in_button=J(e.signInButton,z),this.secondary_text=new H(e.secondaryText)}},mu=class extends p{static type=`ChannelFeaturedContent`;title;items;constructor(e){super(),this.title=new H(e.title),this.items=Y(e.items)}},hu=class extends p{static type=`ChannelMetadata`;title;description;url;rss_url;vanity_channel_url;external_id;is_family_safe;keywords;avatar;music_artist_name;available_countries;android_deep_link;android_appindexing_link;ios_appindexing_link;constructor(e){super(),this.title=e.title,this.description=e.description,this.url=e.channelUrl,this.rss_url=e.rssUrl,this.vanity_channel_url=e.vanityChannelUrl,this.external_id=e.externalId,this.is_family_safe=e.isFamilySafe,this.keywords=e.keywords,this.avatar=V.fromResponse(e.avatar),this.music_artist_name=typeof e.musicArtistName==`string`&&e.musicArtistName.length>0?e.musicArtistName:void 0,this.available_countries=e.availableCountryCodes,this.android_deep_link=e.androidDeepLink,this.android_appindexing_link=e.androidAppindexingLink,this.ios_appindexing_link=e.iosAppindexingLink}},gu=class extends p{static type=`ChannelMobileHeader`;title;constructor(e){super(),this.title=new H(e.title)}},_u=class extends p{static type=`ChannelOptions`;avatar;endpoint;name;links;constructor(e){super(),this.avatar=V.fromResponse(e.avatar),this.endpoint=new B(e.avatarEndpoint),this.name=e.name,this.links=e.links.map(e=>new H(e))}},vu=class extends p{static type=`ChannelOwnerEmptyState`;illustration;description;constructor(e){super(),this.illustration=V.fromResponse(e.illustration),this.description=new H(e.description)}},yu=class extends p{static type=`ChannelSubMenu`;content_type_sub_menu_items;sort_setting;constructor(e){super(),this.content_type_sub_menu_items=e.sortSetting?.sortFilterSubMenuRenderer?.subMenuItems?.map(e=>({endpoint:new B(e.navigationEndpoint||e.endpoint),selected:e.selected,title:e.title}))||[],this.sort_setting=J(e.sortSetting)}},bu=class extends p{static type=`ChannelSwitcherHeader`;title;button;constructor(e){super(),this.title=new H(e.title).toString(),Reflect.has(e,`button`)&&(this.button=J(e.button,z))}},xu=class extends p{static type=`ChannelThumbnailWithLink`;thumbnails;endpoint;accessibility;constructor(e){super(),this.thumbnails=V.fromResponse(e.thumbnail),this.endpoint=new B(e.navigationEndpoint),`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)})}get label(){return this.accessibility?.accessibility_data?.label}},Su=class extends p{static type=`ChannelVideoPlayer`;id;title;description;view_count;published_time;inline_player_params;constructor(e){super(),this.id=e.videoId,this.title=new H(e.title),this.description=new H(e.description),this.view_count=new H(e.viewCountText),this.published_time=new H(e.publishedTimeText),this.inline_player_params=e.inlinePlaybackEndpoint?.watchEndpoint?.playerParams}},Cu=class extends p{static type=`Chapter`;title;time_range_start_millis;thumbnail;constructor(e){super(),this.title=new H(e.title),this.time_range_start_millis=e.timeRangeStartMillis,this.thumbnail=V.fromResponse(e.thumbnail)}},wu=class extends p{static type=`ChildVideo`;id;title;duration;endpoint;constructor(e){super(),this.id=e.videoId,this.title=new H(e.title),this.duration={text:e.lengthText.simpleText,seconds:ex(e.lengthText.simpleText)},this.endpoint=new B(e.navigationEndpoint)}},Tu=class extends p{static type=`ChipCloud`;chips;next_button;previous_button;horizontal_scrollable;constructor(e){super(),this.chips=Y(e.chips,Hl),this.next_button=J(e.nextButton,z),this.previous_button=J(e.previousButton,z),this.horizontal_scrollable=e.horizontalScrollable}},Eu=class extends p{static type=`ClientSideToggleMenuItem`;text;icon_type;toggled_text;toggled_icon_type;is_toggled;menu_item_identifier;endpoint;logging_directives;constructor(e){super(),this.text=new H(e.defaultText),this.icon_type=e.defaultIcon.iconType,this.toggled_text=new H(e.toggledText),this.toggled_icon_type=e.toggledIcon.iconType,Reflect.has(e,`isToggled`)&&(this.is_toggled=e.isToggled),this.menu_item_identifier=e.menuItemIdentifier,this.endpoint=new B(e.command),Reflect.has(e,`loggingDirectives`)&&(this.logging_directives={visibility:{types:e.loggingDirectives.visibility.types},enable_displaylogger_experiment:e.loggingDirectives.enableDisplayloggerExperiment})}},Du=class extends p{static type=`CollaboratorInfoCardContent`;channel_avatar;custom_text;channel_name;subscriber_count;endpoint;constructor(e){super(),this.channel_avatar=V.fromResponse(e.channelAvatar),this.custom_text=new H(e.customText),this.channel_name=new H(e.channelName),this.subscriber_count=new H(e.subscriberCountText),this.endpoint=new B(e.endpoint)}},Ou=class extends p{static type=`CollageHeroImage`;left;top_right;bottom_right;endpoint;constructor(e){super(),this.left=V.fromResponse(e.leftThumbnail),this.top_right=V.fromResponse(e.topRightThumbnail),this.bottom_right=V.fromResponse(e.bottomRightThumbnail),this.endpoint=new B(e.navigationEndpoint)}},ku=class extends p{static type=`ThumbnailHoverOverlayView`;icon_name;text;style;constructor(e){super(),this.icon_name=e.icon.sources[0].clientResource.imageName,this.text=H.fromAttributed(e.text),this.style=e.style}},Au=class extends p{static type=`ThumbnailBadgeView`;icon_name;text;badge_style;background_color;constructor(e){super(),this.text=e.text,this.badge_style=e.badgeStyle,e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme}),e.icon&&(this.icon_name=e.icon.sources[0].clientResource.imageName)}},ju=class extends p{static type=`ThumbnailOverlayBadgeView`;badges;position;constructor(e){super(),this.badges=Y(e.thumbnailBadges,Au),this.position=e.position}},Mu=class extends p{static type=`ThumbnailHoverOverlayToggleActionsView`;buttons;constructor(e){super(),this.buttons=Y(e.buttons,vc)}},Nu=class extends p{static type=`ThumbnailOverlayProgressBarView`;start_percent;constructor(e){super(),this.start_percent=e.startPercent}},Pu=class extends p{static type=`ThumbnailBottomOverlayView`;progress_bar;badges;constructor(e){super(),this.progress_bar=J(e.progressBar,Nu),this.badges=Y(e.badges,Au)}},Fu=class extends p{static type=`ThumbnailView`;image;overlays;background_color;constructor(e){super(),this.image=V.fromResponse(e.image),this.overlays=Y(e.overlays,[Mu,Pu,ju,ku,ac]),`backgroundColor`in e&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme})}},Iu=class extends p{static type=`CollectionThumbnailView`;primary_thumbnail;stack_color;constructor(e){super(),this.primary_thumbnail=J(e.primaryThumbnail,Fu),`stackColor`in e&&(this.stack_color={light_theme:e.stackColor?.lightTheme,dark_theme:e.stackColor?.darkTheme})}},Lu=class extends p{static type=`AddToPlaylistCommand`;open_miniplayer;video_id;list_type;endpoint;video_ids;constructor(e){super(),this.open_miniplayer=e.openMiniplayer,this.video_id=e.videoId,this.list_type=e.listType,this.endpoint=new B(e.onCreateListCommand),this.video_ids=e.videoIds}},Ru=class extends p{static type=`ContinuationCommand`;#e;constructor(e){super(),this.#e=e}getApiPath(){switch(this.#e.request){case`CONTINUATION_REQUEST_TYPE_WATCH_NEXT`:return`next`;case`CONTINUATION_REQUEST_TYPE_BROWSE`:return`browse`;case`CONTINUATION_REQUEST_TYPE_SEARCH`:return`search`;case`CONTINUATION_REQUEST_TYPE_ACCOUNTS_LIST`:return`account/accounts_list`;case`CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU`:return`notification/get_notification_menu`;case`CONTINUATION_REQUEST_TYPE_COMMENT_REPLIES`:return`comment/get_comment_replies`;case`CONTINUATION_REQUEST_TYPE_REEL_WATCH_SEQUENCE`:return`reel/reel_watch_sequence`;case`CONTINUATION_REQUEST_TYPE_GET_PANEL`:return`get_panel`;default:return``}}buildRequest(){let e={};return this.#e.formData&&(e.formData=this.#e.formData),this.#e.token&&(e.continuation=this.#e.token),this.#e.request===`CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU`&&(e.notificationsMenuRequestType=`NOTIFICATIONS_MENU_REQUEST_TYPE_COMMENTS`,this.#e.token&&(e.fetchCommentsParams={continuation:this.#e.token},delete e.continuation)),e}},zu=`kids/get_kids_blocklist_picker`,Bu=class extends p{static type=`GetKidsBlocklistPickerCommand`;#e;constructor(e){super(),this.#e=e}getApiPath(){return zu}buildRequest(){let e={};return this.#e.blockedForKidsContent&&(e.blockedForKidsContent=this.#e.blockedForKidsContent),e}},Vu=class extends p{static type=`RunAttestationCommand`;engagement_type;ids;constructor(e){super(),this.engagement_type=e.engagementType,Reflect.has(e,`ids`)&&(this.ids=e.ids.map(e=>({encrypted_video_id:e.encryptedVideoId,external_channel_id:e.externalChannelId,comment_id:e.commentId,external_owner_id:e.externalOwnerId,artist_id:e.artistId,playlist_id:e.playlistId,external_post_id:e.externalPostId,share_id:e.shareId})))}},Hu=class extends p{static type=`ShowDialogCommand`;inline_content;remove_default_padding;constructor(e){super(),this.inline_content=J(e.panelLoadingStrategy?.inlineContent),this.remove_default_padding=!!e.removeDefaultPadding}},Uu=class extends p{static type=`ShowSheetCommand`;inline_content;remove_default_padding;constructor(e){super(),this.inline_content=J(e.panelLoadingStrategy?.inlineContent),this.remove_default_padding=!!e.removeDefaultPadding}},Wu=class extends p{static type=`UpdateEngagementPanelContentCommand`;content_source_panel_identifier;target_panel_identifier;constructor(e){super(),this.content_source_panel_identifier=e.contentSourcePanelIdentifier,this.target_panel_identifier=e.targetPanelIdentifier}},Gu=class extends p{static type=`AuthorCommentBadge`;#e;icon_type;tooltip;style;constructor(e){super(),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),this.tooltip=e.iconTooltip,this.tooltip===`Verified`&&(this.style=`BADGE_STYLE_TYPE_VERIFIED`,e.style=`BADGE_STYLE_TYPE_VERIFIED`),this.#e=e}get orig_badge(){return this.#e}},Ku=class extends p{static type=`EmojiPicker`;id;categories;category_buttons;search_placeholder;search_no_results;pick_skin_tone;clear_search_label;skin_tone_generic_label;skin_tone_light_label;skin_tone_medium_light_label;skin_tone_medium_label;skin_tone_medium_dark_label;skin_tone_dark_label;constructor(e){super(),this.id=e.id,this.categories=Y(e.categories),this.category_buttons=Y(e.categoryButtons),this.search_placeholder=new H(e.searchPlaceholderText),this.search_no_results=new H(e.searchNoResultsText),this.pick_skin_tone=new H(e.pickSkinToneText),this.clear_search_label=e.clearSearchLabel,this.skin_tone_generic_label=e.skinToneGenericLabel,this.skin_tone_light_label=e.skinToneLightLabel,this.skin_tone_medium_light_label=e.skinToneMediumLightLabel,this.skin_tone_medium_label=e.skinToneMediumLabel,this.skin_tone_medium_dark_label=e.skinToneMediumDarkLabel,this.skin_tone_dark_label=e.skinToneDarkLabel}},qu=class extends p{static type=`CommentDialog`;editable_text;author_thumbnail;submit_button;cancel_button;placeholder;emoji_button;emoji_picker;constructor(e){super(),this.editable_text=new H(e.editableText),this.author_thumbnail=V.fromResponse(e.authorThumbnail),this.submit_button=J(e.submitButton,z),this.cancel_button=J(e.cancelButton,z),this.placeholder=new H(e.placeholderText),this.emoji_button=J(e.emojiButton,z),this.emoji_picker=J(e.emojiPicker,Ku)}},Ju=class extends p{static type=`CommentImageAttachmentView`;width;height;aspect_ratio;image;image_content_mode;processor;image_format_hint;external_image_id;unavailable_text;unsupported_text;renderer_context;constructor(e){super(),this.width=e.width,this.height=e.height,this.aspect_ratio=e.aspectRatio,this.image=V.fromResponse(e.image),this.external_image_id=e.externalImageId,this.unavailable_text=e.unavailableText,this.unsupported_text=e.unsupportedText,this.renderer_context=new dc(e.rendererContext),typeof e.image==`object`&&(this.image_content_mode=e.image.contentMode,this.image_format_hint=e.image.imageFormatHint,e.image.processor?.borderImageProcessor?.cornerRadius&&(this.processor={border_image_processor:{corner_radius:e.image.processor.borderImageProcessor.cornerRadius}}))}},Yu=class extends p{static type=`CommentReplyDialog`;reply_button;cancel_button;author_thumbnail;placeholder;error_message;constructor(e){super(),this.reply_button=J(e.replyButton,z),this.cancel_button=J(e.cancelButton,z),this.author_thumbnail=V.fromResponse(e.authorThumbnail),this.placeholder=new H(e.placeholderText),this.error_message=new H(e.errorMessage)}},Xu=class extends p{static type=`VoiceReplyContainerView`;voice_reply_unavailable_text;transcript_text;constructor(e){super(),this.voice_reply_unavailable_text=H.fromAttributed(e.voiceReplyUnavailableText),this.transcript_text=H.fromAttributed(e.transcriptText)}},Zu=class extends p{static type=`CommentView`;#e;like_command;dislike_command;unlike_command;undislike_command;reply_command;prepare_account_command;comment_id;is_pinned;keys;content;image_attachment;published_time;author_is_channel_owner;author_button_a11y;creator_thumbnail_url;like_button_a11y;like_count;like_count_liked;like_count_a11y;like_active_tooltip;like_inactive_tooltip;dislike_active_tooltip;dislike_inactive_tooltip;heart_active_tooltip;reply_count;reply_count_a11y;reply_level;is_member;member_badge;author;is_liked;is_disliked;is_hearted;voice_reply_container;constructor(e){super(),this.comment_id=e.commentId,this.is_pinned=!!e.pinnedText,this.keys={comment:e.commentKey,comment_surface:e.commentSurfaceKey,toolbar_state:e.toolbarStateKey,toolbar_surface:e.toolbarSurfaceKey,shared:e.sharedKey}}applyMutations(e,t,n,r){if(e){this.content=H.fromAttributed(e.properties.content),this.published_time=e.properties.publishedTime,this.reply_level=e.properties?.replyLevel?e.properties?.replyLevel:0,this.author_button_a11y=e.properties?.authorButtonA11y,this.author_is_channel_owner=!!e.author.isCreator,this.creator_thumbnail_url=e.toolbar.creatorThumbnailUrl,this.like_count=e.toolbar.likeCountNotliked?e.toolbar.likeCountNotliked:`0`,this.like_count_liked=e.toolbar.likeCountLiked?e.toolbar.likeCountLiked:`0`,this.like_count_a11y=e.toolbar.likeCountA11y,this.like_active_tooltip=e.toolbar.likeActiveTooltip,this.like_inactive_tooltip=e.toolbar.likeInactiveTooltip,this.dislike_active_tooltip=e.toolbar.dislikeActiveTooltip,this.dislike_inactive_tooltip=e.toolbar.dislikeInactiveTooltip,this.like_button_a11y=e.toolbar.likeButtonA11y,this.heart_active_tooltip=e.toolbar.heartActiveTooltip,this.reply_count_a11y=e.toolbar.replyCountA11y,this.reply_count=e.toolbar.replyCount?e.toolbar.replyCount:`0`,this.is_member=!!e.author.sponsorBadgeUrl,`sponsorBadgeUrl`in e.author&&(this.member_badge={url:e.author.sponsorBadgeUrl,a11y:e.author?.sponsorBadgeA11y});let t=e.avatar?.image;!t&&`avatarThumbnailUrl`in e.author&&(t={thumbnails:[{url:e.author.avatarThumbnailUrl,width:88,height:88}]}),this.author=new X({simpleText:e.author.displayName,navigationEndpoint:e.avatar?.endpoint||e.author?.channelCommand},e.author,t,e.author.channelId)}t&&(this.is_hearted=t.heartState===`TOOLBAR_HEART_STATE_HEARTED`,this.is_liked=t.likeState===`TOOLBAR_LIKE_STATE_LIKED`,this.is_disliked=t.likeState===`TOOLBAR_LIKE_STATE_DISLIKED`),n&&(`prepareAccountCommand`in n?this.prepare_account_command=new B(n.prepareAccountCommand):(this.like_command=new B(n.likeCommand),this.dislike_command=new B(n.dislikeCommand),this.unlike_command=new B(n.unlikeCommand),this.undislike_command=new B(n.undislikeCommand),this.reply_command=new B(n.replyCommand))),r&&(`voiceReplyContainerViewModel`in r&&(this.voice_reply_container=J(r.voiceReplyContainerViewModel,Xu)),this.image_attachment=J(r.imageAttachmentViewModel,Ju))}async like(){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.like_command)throw new Q(`Like command not found.`);if(this.is_liked)throw new Q(`This comment is already liked.`,{comment_id:this.comment_id});return this.like_command.call(this.#e)}async dislike(){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.dislike_command)throw new Q(`Dislike command not found.`);if(this.is_disliked)throw new Q(`This comment is already disliked.`,{comment_id:this.comment_id});return this.dislike_command.call(this.#e)}async unlike(){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.unlike_command)throw new Q(`Unlike command not found.`);if(!this.is_liked)throw new Q(`This comment is not liked.`,{comment_id:this.comment_id});return this.unlike_command.call(this.#e)}async undislike(){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.undislike_command)throw new Q(`Undislike command not found.`);if(!this.is_disliked)throw new Q(`This comment is not disliked.`,{comment_id:this.comment_id});return this.undislike_command.call(this.#e)}async reply(e){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.reply_command)throw new Q(`Reply command not found.`);let t=this.reply_command.dialog?.as(Yu);if(!t)throw new Q(`Reply dialog not found.`);let n=t.reply_button;if(!n)throw new Q(`Reply button not found in the dialog.`);if(!n.endpoint)throw new Q(`Reply button endpoint not found.`);return n.endpoint.call(this.#e,{commentText:e})}async translate(e){if(!this.#e)throw new Q(`Actions instance not set for this comment.`);if(!this.content)throw new Q(`Comment content not found.`,{comment_id:this.comment_id});let t=cr(22,{text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,``),target_language:e}),n=await this.#e.execute(`comment/perform_comment_action`,{action:t}),r=(n.data.frameworkUpdates?.entityBatchUpdate?.mutations)?.[0]?.payload?.commentEntityPayload?.translatedContent?.content;return{...n,content:r}}setActions(e){this.#e=e}},Qu=class e{replies=_([]);#e;#t;constructor(e,t){if(this.#e=e,!t.on_response_received_endpoints||!t.on_response_received_endpoints_memo)throw new Q(`Invalid response received for comments continuation`,t);let n=t.on_response_received_endpoints.firstOfType(Fs);if(n)for(let e of n.contents)e.is($u)?(e.setActions(this.#e),e.processRepliesData(),this.replies.push(e)):e.is(G)&&(this.#t=e)}get has_continuation(){return!!this.#t}async getContinuation(){if(!this.#t)throw new Q(`No continuation item found`);let t=this.#t.button;if(!t)throw new Q(`"Load more" button not found in continuation item`);let n=await t.endpoint.call(this.#e,{parse:!0});return new e(this.#e,n)}},$u=class e extends p{static type=`CommentThread`;comment;replies;comment_replies_data;is_moderated_elq_comment;has_replies;rendering_priority;#e;#t;constructor(e){super(),this.comment=J(e.commentViewModel,Zu),this.comment_replies_data=J(e.replies,ed),this.is_moderated_elq_comment=e.isModeratedElqComment,this.rendering_priority=e.renderingPriority,this.has_replies=!!this.comment_replies_data}get has_continuation(){if(!this.replies)throw new Q(`Cannot determine if there is a continuation because this comment thread's replies have not been loaded`);return!!this.#t}get is_prepopulated(){return!!this.comment_replies_data&&this.comment_replies_data.sub_threads[0]?.is(e)}async getReplies(){if(!this.#e)throw new Q(`Actions instance not set for this comment thread`);if(!this.comment_replies_data)throw new Q(`This comment thread has no replies`,this);if(!this.is_prepopulated){let t=this.comment_replies_data.sub_threads.firstOfType(G);if(!t)throw new Q(`Replies continuation item not found`);let n=t.endpoint;t.button&&(n=t.button.endpoint);let r=await n.call(this.#e,{parse:!0});if(!r.on_response_received_endpoints)throw new Q(`Unexpected response`,r);let i=r.on_response_received_endpoints.firstOfType(Fs);i&&this.#n(i.contents.as(e,G))}return this}async getContinuation(){if(!this.replies)throw new Q(`Cannot retrieve continuation because this comment thread's replies have not been loaded`);if(!this.#t)throw new Q(`No continuation item found`);if(!this.#e)throw new Q(`Actions instance not set for this comment thread`);let e=this.#t.button?.as(z);if(!e)throw new Q(`Cannot retrieve continuation because the "Load more" button is missing`);let t=await e.endpoint.call(this.#e,{parse:!0});return new Qu(this.#e,t)}setActions(e){this.#e=e}processRepliesData(){this.is_prepopulated&&!this.replies&&this.#n(this.comment_replies_data.sub_threads)}#n(t){if(!this.#e)throw new Q(`Actions instance not set for this comment thread`);this.replies=_([]);for(let n of t)n.is(e)?(n.setActions(this.#e),n.processRepliesData(),this.replies.push(n)):n.is(G)&&(this.#t=n)}},ed=class extends p{static type=`CommentReplies`;contents;sub_threads;view_replies;hide_replies;view_replies_creator_thumbnail;has_channel_owner_replied;constructor(e){super(),this.contents=Y(e.contents,[Zu,G]),this.sub_threads=Y(e.subThreads,[$u,G]),this.view_replies=J(e.viewReplies,z),this.hide_replies=J(e.hideReplies,z),this.view_replies_creator_thumbnail=V.fromResponse(e.viewRepliesCreatorThumbnail),this.has_channel_owner_replied=!!e.viewRepliesCreatorThumbnail}},td=class extends p{static type=`CommentsSimplebox`;simplebox_avatar;simplebox_placeholder;constructor(e){super(),this.simplebox_avatar=V.fromResponse(e.simpleboxAvatar),this.simplebox_placeholder=new H(e.simpleboxPlaceholder)}},nd=class extends p{static type=`CommentsEntryPointTeaser`;teaser_avatar;teaser_content;constructor(e){super(),Reflect.has(e,`teaserAvatar`)&&(this.teaser_avatar=V.fromResponse(e.teaserAvatar)),Reflect.has(e,`teaserContent`)&&(this.teaser_content=new H(e.teaserContent))}},rd=class extends p{static type=`CommentsEntryPointHeader`;header;comment_count;teaser_avatar;teaser_content;content_renderer;simplebox_placeholder;constructor(e){super(),Reflect.has(e,`headerText`)&&(this.header=new H(e.headerText)),Reflect.has(e,`commentCount`)&&(this.comment_count=new H(e.commentCount)),(Reflect.has(e,`teaserAvatar`)||Reflect.has(e,`simpleboxAvatar`))&&(this.teaser_avatar=V.fromResponse(e.teaserAvatar||e.simpleboxAvatar)),Reflect.has(e,`teaserContent`)&&(this.teaser_content=new H(e.teaserContent)),Reflect.has(e,`contentRenderer`)&&(this.content_renderer=J(e.contentRenderer,[nd,td])),Reflect.has(e,`simpleboxPlaceholder`)&&(this.simplebox_placeholder=new H(e.simpleboxPlaceholder))}},id=class extends p{static type=`CommentSimplebox`;submit_button;cancel_button;author_thumbnail;placeholder;avatar_size;constructor(e){super(),this.submit_button=J(e.submitButton,z),this.cancel_button=J(e.cancelButton,z),this.author_thumbnail=V.fromResponse(e.authorThumbnail),this.placeholder=new H(e.placeholderText),this.avatar_size=e.avatarSize}},ad=class extends p{static type=`PdgCommentChip`;text;color_pallette;icon_type;constructor(e){super(),this.text=new H(e.chipText),this.color_pallette={background_color:e.chipColorPalette?.backgroundColor,foreground_title_color:e.chipColorPalette?.foregroundTitleColor},Reflect.has(e,`chipIcon`)&&Reflect.has(e.chipIcon,`iconType`)&&(this.icon_type=e.chipIcon.iconType)}},od=class extends p{static type=`SponsorCommentBadge`;custom_badge;tooltip;constructor(e){super(),this.custom_badge=V.fromResponse(e.customBadge),this.tooltip=e.tooltip}},sd=class extends p{static type=`CompactChannel`;title;channel_id;thumbnail;display_name;video_count;subscriber_count;endpoint;tv_banner;menu;constructor(e){super(),this.title=new H(e.title),this.channel_id=e.channelId,this.thumbnail=V.fromResponse(e.thumbnail),this.display_name=new H(e.displayName),this.video_count=new H(e.videoCountText),this.subscriber_count=new H(e.subscriberCountText),this.endpoint=new B(e.navigationEndpoint),this.tv_banner=V.fromResponse(e.tvBanner),this.menu=J(e.menu,W)}},cd=class extends p{static type=`CompactInfocard`;content;constructor(e){super(),this.content=J(e.content)}},ld=class extends p{static type=`PlaylistCustomThumbnail`;thumbnail;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail)}},ud=class extends p{static type=`PlaylistVideoThumbnail`;thumbnail;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail)}},dd=class extends p{static type=`Playlist`;id;title;author;thumbnails;thumbnail_renderer;video_count;video_count_short;first_videos;share_url;menu;badges;endpoint;thumbnail_overlays;view_playlist;constructor(e){super(),this.id=e.playlistId,this.title=new H(e.title),this.author=e.shortBylineText?.simpleText?new H(e.shortBylineText):new X(e.longBylineText,e.ownerBadges,null),this.thumbnails=V.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(e=>e.thumbnails).flat(1)}),this.video_count=new H(e.thumbnailText),this.video_count_short=new H(e.videoCountShortText),this.first_videos=Y(e.videos),this.share_url=e.shareUrl||null,this.menu=J(e.menu),this.badges=Y(e.ownerBadges),this.endpoint=new B(e.navigationEndpoint),this.thumbnail_overlays=Y(e.thumbnailOverlays),Reflect.has(e,`thumbnailRenderer`)&&(this.thumbnail_renderer=J(e.thumbnailRenderer,[ud,ld])||void 0),Reflect.has(e,`viewPlaylistText`)&&(this.view_playlist=new H(e.viewPlaylistText))}},fd=class extends dd{static type=`CompactMix`;constructor(e){super(e)}},pd=class extends p{static type=`CompactMovie`;id;title;top_metadata_items;thumbnails;thumbnail_overlays;author;duration;endpoint;badges;use_vertical_poster;menu;constructor(e){super();let t=e.thumbnailOverlays.find(e=>e.thumbnailOverlayTimeStatusRenderer)?.thumbnailOverlayTimeStatusRenderer.text||`N/A`;this.id=e.videoId,this.title=new H(e.title),this.top_metadata_items=new H(e.topMetadataItems),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.author=new X(e.shortBylineText);let n=e.lengthText?new H(e.lengthText).toString():new H(t).toString();this.duration={text:n,seconds:ex(n)},this.endpoint=new B(e.navigationEndpoint),this.badges=Y(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.menu=J(e.menu,W)}},md=class extends dd{static type=`CompactPlaylist`;constructor(e){super(e)}},hd=class extends p{static type=`CompactStation`;title;description;video_count;endpoint;thumbnail;constructor(e){super(),this.title=new H(e.title),this.description=new H(e.description),this.video_count=new H(e.videoCountText),this.endpoint=new B(e.navigationEndpoint),this.thumbnail=V.fromResponse(e.thumbnail)}},gd=class extends p{static type=`CompositeVideoPrimaryInfo`;composite_source_video_primary_info_renderers;constructor(e){super(),this.composite_source_video_primary_info_renderers=Y(e.compositeSourceVideoPrimaryInfoRenderers)}},_d=class extends p{static type=`ConfirmDialog`;title;confirm_endpoint;confirm_button;cancel_button;dialog_messages;primary_is_cancel;constructor(e){super(),this.title=new H(e.title),`confirmEndpoint`in e&&(this.confirm_endpoint=new B(e.confirmEndpoint)),this.confirm_button=J(e.confirmButton,z),this.cancel_button=J(e.cancelButton,z),this.dialog_messages=e.dialogMessages.map(e=>new H(e)),this.primary_is_cancel=!!e.primaryIsCancel}},vd=class extends p{static type=`ContentMetadataView`;metadata_rows;delimiter;constructor(e){super(),this.metadata_rows=e.metadataRows?.map(t=>({metadata_parts:t.metadataParts?.map(t=>({text:t.text?H.fromAttributed(t.text):null,avatar_stack:J(t.avatarStack,fc),icon_name:t.icon?.name,leading_icon_name:t.leadingIcon?.name,enable_truncation:e.enableTruncation})),badges:Y(t.badges,Mc)}))||[],this.delimiter=e.delimiter}},yd=class extends p{static type=`ContinuationItemView`;trigger;endpoint;constructor(e){super(),this.trigger=e.trigger,this.endpoint=new B(e.continuationCommand)}},bd=class extends p{static type=`Message`;text;constructor(e){super(),this.text=new H(e.text)}},xd=class extends p{static type=`ConversationBar`;availability_message;constructor(e){super(),this.availability_message=J(e.availabilityMessage,bd)}},Sd=class extends p{static type=`CopyLink`;copy_button;short_url;style;constructor(e){super(),this.copy_button=J(e.copyButton,z),this.short_url=e.shortUrl,this.style=e.style}},Cd=class extends p{static type=`DropdownView`;label;placeholder_text;disabled;options;dropdown_type;id;constructor(e){super(),this.label=new H(e.label),this.placeholder_text=new H(e.placeholderText),this.disabled=!!e.disabled,this.dropdown_type=e.type,this.id=e.id,Reflect.has(e,`options`)&&(this.options=e.options.map(e=>({title:new H(e.title),subtitle:new H(e.subtitle),leading_image:V.fromResponse(e.leadingImage),value:{privacy_status_value:e.value?.privacyStatusValue},on_tap:new B(e.onTap),is_selected:!!e.isSelected})))}},wd=class extends p{static type=`TextFieldView`;display_properties;content_properties;initial_state;form_field_metadata;constructor(e){super(),Reflect.has(e,`displayProperties`)&&(this.display_properties={isMultiline:!!e.displayProperties.isMultiline,disableNewLines:!!e.displayProperties.disableNewLines}),Reflect.has(e,`contentProperties`)&&(this.content_properties={labelText:e.contentProperties.labelText,placeholderText:e.contentProperties.placeholderText,maxCharacterCount:e.contentProperties.maxCharacterCount}),Reflect.has(e,`initialState`)&&(this.initial_state={isFocused:!!e.initialState.isFocused}),Reflect.has(e,`formFieldMetadata`)&&(this.form_field_metadata={formId:e.formFieldMetadata.formId,fieldId:e.formFieldMetadata.fieldId})}},Td=class extends p{static type=`CreatePlaylistDialogFormView`;playlist_title;playlist_visibility;disable_playlist_collaborate;create_playlist_params_collaboration_enabled;create_playlist_params_collaboration_disabled;video_ids;constructor(e){super(),this.playlist_title=J(e.playlistTitle,wd),this.playlist_visibility=J(e.playlistVisibility,Cd),this.disable_playlist_collaborate=!!e.disablePlaylistCollaborate,this.create_playlist_params_collaboration_enabled=e.createPlaylistParamsCollaborationEnabled,this.create_playlist_params_collaboration_disabled=e.createPlaylistParamsCollaborationDisabled,this.video_ids=e.videoIds}},Ed=class extends p{static type=`DecoratedAvatarView`;avatar;a11y_label;renderer_context;constructor(e){super(),this.avatar=J(e.avatar,lc),this.a11y_label=e.a11yLabel,this.renderer_context=new dc(e.rendererContext)}},Dd=class extends p{static type=`HeatMarker`;time_range_start_millis;marker_duration_millis;heat_marker_intensity_score_normalized;constructor(e){super(),this.time_range_start_millis=Number.parseInt(e.startMillis,10),this.marker_duration_millis=Number.parseInt(e.durationMillis,10),this.heat_marker_intensity_score_normalized=e.intensityScoreNormalized}},Od=class extends p{static type=`TimedMarkerDecoration`;visible_time_range_start_millis;visible_time_range_end_millis;decoration_time_millis;label;icon;constructor(e){super(),this.visible_time_range_start_millis=e.visibleTimeRangeStartMillis,this.visible_time_range_end_millis=e.visibleTimeRangeEndMillis,this.decoration_time_millis=e.decorationTimeMillis,this.label=new H(e.label),this.icon=e.icon}},kd=class extends p{static type=`Heatmap`;max_height_dp;min_height_dp;show_hide_animation_duration_millis;heat_markers;heat_markers_decorations;constructor(e){super(),this.max_height_dp=e.maxHeightDp,this.min_height_dp=e.minHeightDp,this.show_hide_animation_duration_millis=e.showHideAnimationDurationMillis,this.heat_markers=Y(e.heatMarkers,Dd),this.heat_markers_decorations=Y(e.heatMarkersDecorations,Od)}},Ad=class extends p{static type=`Marker`;marker_key;value;constructor(e){super(),this.marker_key=e.key,this.value={},Reflect.has(e,`value`)&&(Reflect.has(e.value,`heatmap`)&&(this.value.heatmap=J(e.value.heatmap,kd)),Reflect.has(e.value,`chapters`)&&(this.value.chapters=Y(e.value.chapters,Cu)))}},jd=class extends p{static type=`MultiMarkersPlayerBar`;markers_map;constructor(e){super(),this.markers_map=_(e.markersMap?.map(e=>new Ad(e))||[])}},Md=class extends p{static type=`DecoratedPlayerBar`;player_bar;player_bar_action_button;constructor(e){super(),this.player_bar=J(e.playerBar,jd),this.player_bar_action_button=J(e.playerBarActionButton,z)}},Nd=class extends p{static type=`DefaultPromoPanel`;title;description;endpoint;large_form_factor_background_thumbnail;small_form_factor_background_thumbnail;scrim_color_values;min_panel_display_duration_ms;min_video_play_duration_ms;scrim_duration;metadata_order;panel_layout;constructor(e){super(),this.title=new H(e.title),this.description=new H(e.description),this.endpoint=new B(e.navigationEndpoint),this.large_form_factor_background_thumbnail=J(e.largeFormFactorBackgroundThumbnail),this.small_form_factor_background_thumbnail=J(e.smallFormFactorBackgroundThumbnail),this.scrim_color_values=e.scrimColorValues,this.min_panel_display_duration_ms=e.minPanelDisplayDurationMs,this.min_video_play_duration_ms=e.minVideoPlayDurationMs,this.scrim_duration=e.scrimDuration,this.metadata_order=e.metadataOrder,this.panel_layout=e.panelLayout}},Pd=class extends p{static type=`DescriptionPreviewView`;description;max_lines;truncation_text;always_show_truncation_text;more_endpoint;renderer_context;constructor(e){if(super(),`description`in e&&(this.description=H.fromAttributed(e.description)),`maxLines`in e&&(this.max_lines=parseInt(e.maxLines)),`truncationText`in e&&(this.truncation_text=H.fromAttributed(e.truncationText)),this.always_show_truncation_text=!!e.alwaysShowTruncationText,e.rendererContext.commandContext?.onTap?.innertubeCommand?.showEngagementPanelEndpoint){let t=e.rendererContext.commandContext?.onTap?.innertubeCommand?.showEngagementPanelEndpoint;this.more_endpoint={show_engagement_panel_endpoint:{engagement_panel:J(t.engagementPanel,Ql),engagement_panel_popup_type:t.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:t.identifier.surface,tag:t.identifier.tag}}}}this.renderer_context=new dc(e.rendererContext)}},Fd=class extends p{static type=`DialogHeaderView`;headline;constructor(e){super(),this.headline=H.fromAttributed(e.headline)}},Id=class extends p{static type=`PanelFooterView`;primary_button;secondary_button;should_hide_divider;constructor(e){super(),this.primary_button=J(e.primaryButton,U),this.secondary_button=J(e.secondaryButton,U),this.should_hide_divider=!!e.shouldHideDivider}},Ld=class extends p{static type=`FormFooterView`;panel_footer;form_id;container_type;constructor(e){super(),this.panel_footer=J(e.panelFooter,Id),this.form_id=e.formId,this.container_type=e.containerType}},Rd=class extends p{static type=`DownloadListItemView`;renderer_context;constructor(e){super(),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},zd=class extends p{static type=`ToggleableListItemView`;default_list_item;toggled_list_item;initial_state;entity_key;entity_selector_type;constructor(e){super(),this.default_list_item=J(e.defaultListItem,Ec),this.toggled_list_item=J(e.toggledListItem,Ec),this.initial_state={is_toggled:!!e.initialState?.isToggled},this.entity_key=e.entityKey,this.entity_selector_type=e.entitySelectorType}get list_item(){return this.initial_state.is_toggled?this.toggled_list_item:this.default_list_item}get is_toggled(){return this.initial_state.is_toggled}},Bd=class extends p{static type=`ListView`;items;renderer_context;constructor(e){super(),this.items=Y(e.listItems,[Ec,Rd,zd]),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Vd=class extends p{static type=`DialogView`;header;footer;custom_content;constructor(e){super(),this.header=J(e.header,Fd),this.footer=J(e.footer,[Ld,Id]),this.custom_content=J(e.customContent,[Td,Bd])}},Hd=class extends p{static type=`DidYouMean`;text;corrected_query;endpoint;constructor(e){super(),this.text=new H(e.didYouMean).toString(),this.corrected_query=new H(e.correctedQuery),this.endpoint=new B(e.navigationEndpoint||e.correctedQueryEndpoint)}},Ud=class extends p{static type=`DismissableDialogContentSection`;title;subtitle;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle)}},Wd=class extends p{static type=`DismissableDialog`;title;sections;metadata;display_style;constructor(e){super(),this.title=e.title,this.sections=Y(e.sections,Ud),this.metadata=J(e.metadata),this.display_style=e.displayStyle}},Gd=class extends p{static type=`DynamicTextView`;text;max_lines;constructor(e){super(),this.text=H.fromAttributed(e.text),this.max_lines=parseInt(e.maxLines)}},Kd=class e extends p{static type=`ChildElement`;text;properties;child_elements;constructor(t){super(),Reflect.has(t,`type`)&&Reflect.has(t.type,`textType`)&&(this.text=t.type.textType.text?.content),this.properties=t.properties,Reflect.has(t,`childElements`)&&(this.child_elements=t.childElements.map(t=>new e(t)))}},qd=class e extends p{static type=`Element`;model;child_elements;constructor(t){if(super(),Reflect.has(t,`elementRenderer`))return J(t,e);let n=t.newElement.type.componentType;this.model=J(n?.model),Reflect.has(t,`newElement`)&&Reflect.has(t.newElement,`childElements`)&&(this.child_elements=_(t.newElement.childElements?.map(e=>new Kd(e))||[]))}},Jd=class extends p{static type=`EmergencyOnebox`;title;first_option;menu;constructor(e){super(),this.title=new H(e.title),this.first_option=J(e.firstOption),this.menu=J(e.menu,W)}},Yd=class extends p{static type=`EmojiPickerCategory`;category_id;title;emoji_ids;image_loading_lazy;category_type;constructor(e){super(),this.category_id=e.categoryId,this.title=new H(e.title),this.emoji_ids=e.emojiIds,this.image_loading_lazy=!!e.imageLoadingLazy,this.category_type=e.categoryType}},Xd=class extends p{static type=`EmojiPickerCategoryButton`;category_id;icon_type;tooltip;constructor(e){super(),this.category_id=e.categoryId,Reflect.has(e,`icon`)&&(this.icon_type=e.icon?.iconType),this.tooltip=e.tooltip}},Zd=class extends p{static type=`EmojiPickerUpsellCategory`;category_id;title;upsell;emoji_tooltip;endpoint;emoji_ids;constructor(e){super(),this.category_id=e.categoryId,this.title=new H(e.title),this.upsell=new H(e.upsell),this.emoji_tooltip=e.emojiTooltip,this.endpoint=new B(e.command),this.emoji_ids=e.emojiIds}},Qd=`playlist/get_add_to_playlist`,$d=class extends p{static type=`AddToPlaylistServiceEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Qd}buildRequest(){let e={};return e.videoIds=this.#e.videoIds?this.#e.videoIds:[this.#e.videoId],this.#e.playlistId&&(e.playlistId=this.#e.playlistId),this.#e.params&&(e.params=this.#e.params),e.excludeWatchLater=!!this.#e.excludeWatchLater,e}},ef=class extends $d{static type=`AddToPlaylistEndpoint`;constructor(e){super(e)}},tf=`browse`,nf=class extends p{static type=`BrowseEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return tf}buildRequest(){let e={};return this.#e.browseId&&(e.browseId=this.#e.browseId),this.#e.params&&(e.params=this.#e.params),this.#e.query&&(e.query=this.#e.query),this.#e.browseId===`FEsubscriptions`&&(e.subscriptionSettingsState=this.#e.subscriptionSettingsState||`MY_SUBS_SETTINGS_STATE_LAYOUT_FORMAT_LIST`),this.#e.browseId===`SPaccount_playback`&&(e.formData=this.#e.formData||{accountSettingsFormData:{flagCaptionsDefaultOff:!1,flagAutoCaptionsDefaultOn:!1,flagDisableInlinePreview:!1,flagAudioDescriptionDefaultOn:!1}}),this.#e.browseId===`FEwhat_to_watch`&&(this.#e.browseRequestSupportedMetadata&&(e.browseRequestSupportedMetadata=this.#e.browseRequestSupportedMetadata),this.#e.inlineSettingStatus&&(e.inlineSettingStatus=this.#e.inlineSettingStatus)),e}},rf=class extends p{static type=`ConfirmDialogEndpoint`;content;constructor(e){super(),this.content=J(e.content,_d)}},af=`comment/create_comment`,of=class extends p{static type=`CreateCommentEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return af}buildRequest(){let e={};return this.#e.createCommentParams&&(e.createCommentParams=this.#e.createCommentParams),this.#e.commentText&&(e.commentText=this.#e.commentText),this.#e.attachedVideoId?e.videoAttachment={videoId:this.#e.attachedVideoId}:this.#e.pollOptions?e.pollAttachment={choices:this.#e.pollOptions}:this.#e.imageBlobId?e.imageAttachment={encryptedBlobId:this.#e.imageBlobId}:this.#e.sharedPostId&&(e.sharedPostAttachment={postId:this.#e.sharedPostId}),this.#e.accessRestrictions&&typeof this.#e.accessRestrictions==`number`&&(e.accessRestrictions={restriction:this.#e.accessRestrictions===1?`RESTRICTION_TYPE_EVERYONE`:`RESTRICTION_TYPE_SPONSORS_ONLY`}),this.#e.botguardResponse&&(e.botguardResponse=this.#e.botguardResponse),e}},sf=`playlist/create`,cf=class extends p{static type=`CreatePlaylistServiceEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return sf}buildRequest(){let e={};return this.#e.title&&(e.title=this.#e.title),this.#e.privacyStatus&&(e.privacyStatus=this.#e.privacyStatus),this.#e.description&&(e.description=this.#e.description),this.#e.videoIds&&(e.videoIds=this.#e.videoIds),this.#e.params&&(e.params=this.#e.params),this.#e.sourcePlaylistId&&(e.sourcePlaylistId=this.#e.sourcePlaylistId),e}},lf=`playlist/delete`,uf=class extends p{static type=`DeletePlaylistEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return lf}buildRequest(){let e={};return this.#e.playlistId&&(e.playlistId=this.#e.sourcePlaylistId),e}},df=`feedback`,ff=class extends p{static type=`FeedbackEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return df}buildRequest(){let e={};return e.feedbackTokens=[],this.#e.feedbackToken&&e.feedbackTokens.push(this.#e.feedbackToken),this.#e.cpn&&(e.feedbackContext={cpn:this.#e.cpn}),e.shouldMerge=!!this.#e.shouldMerge,e.isFeedbackTokenUnencrypted=!!this.#e.isFeedbackTokenUnencrypted,this.#e.extraFeedbackTokens&&(e.shouldMerge=!0,e.feedbackTokens.push(...this.#e.extraFeedbackTokens)),e}},pf=`account/accounts_list`,mf=class extends p{static type=`GetAccountsListInnertubeEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return pf}buildRequest(){let e={};return this.#e.requestType&&(e.requestType=this.#e.requestType,(this.#e.requestType===`ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER`||this.#e.requestType===`ACCOUNTS_LIST_REQUEST_TYPE_IDENTITY_PROMPT`)&&this.#e.nextUrl&&(e.nextNavendpoint={urlEndpoint:{url:this.#e.nextUrl}})),this.#e.channelSwitcherQuery&&(e.channelSwitcherQuery=this.#e.channelSwitcherQuery),this.#e.triggerChannelCreation&&(e.triggerChannelCreation=this.#e.triggerChannelCreation),this.#e.contentOwnerConfig&&this.#e.contentOwnerConfig.externalContentOwnerId&&(e.contentOwnerConfig=this.#e.contentOwnerConfig),this.#e.obfuscatedSelectedGaiaId&&(e.obfuscatedSelectedGaiaId=this.#e.obfuscatedSelectedGaiaId),this.#e.selectedSerializedDelegationContext&&(e.selectedSerializedDelegationContext=this.#e.selectedSerializedDelegationContext),this.#e.callCircumstance&&(e.callCircumstance=this.#e.callCircumstance),e}},hf=class extends p{static type=`HideEngagementPanelEndpoint`;panel_identifier;constructor(e){super(),this.panel_identifier=e.panelIdentifier}},gf=`like/like`,_f=`like/dislike`,vf=`like/removelike`,yf=class extends p{static type=`LikeEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return this.#e.status===`DISLIKE`?_f:this.#e.status===`INDIFFERENT`?vf:gf}buildRequest(){let e={};this.#e.target&&(e.target=this.#e.target);let t=this.getParams();return t&&(e.params=t),e}getParams(){switch(this.#e.status){case`LIKE`:return this.#e.likeParams;case`DISLIKE`:return this.#e.dislikeParams;case`INDIFFERENT`:return this.#e.removeLikeParams;default:return}}},bf=`live_chat/get_item_context_menu`,xf=class extends p{static type=`LiveChatItemContextMenuEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return bf}buildRequest(){let e={};return this.#e.params&&(e.params=this.#e.params),e}},Sf=`notification/modify_channel_preference`,Cf=class extends p{static type=`ModifyChannelNotificationPreferenceEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Sf}buildRequest(){let e={};return this.#e.params&&(e.params=this.#e.params),this.#e.secondaryParams&&(e.secondaryParams=this.#e.secondaryParams),e}},wf=`comment/perform_comment_action`,Tf=class extends p{static type=`PerformCommentActionEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return wf}buildRequest(){let e={};return this.#e.actions&&(e.actions=this.#e.actions),this.#e.action&&(e.actions=[this.#e.action]),e}},Ef=`browse/edit_playlist`,Df=class extends p{static type=`PlaylistEditEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Ef}buildRequest(){let e={};return this.#e.actions&&(e.actions=this.#e.actions),this.#e.playlistId&&(e.playlistId=this.#e.playlistId),this.#e.params&&(e.params=this.#e.params),e}},Of=`player`,kf=class extends p{static type=`WatchEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Of}buildRequest(){let e={};return this.#e.videoId&&(e.videoId=this.#e.videoId),this.#e.playlistId&&(e.playlistId=this.#e.playlistId),(this.#e.index!==void 0||this.#e.playlistIndex!==void 0)&&(e.playlistIndex=this.#e.index||this.#e.playlistIndex),(this.#e.playerParams||this.#e.params)&&(e.params=this.#e.playerParams||this.#e.params),this.#e.startTimeSeconds&&(e.startTimeSecs=this.#e.startTimeSeconds),this.#e.overrideMutedAtStart&&(e.overrideMutedAtStart=this.#e.overrideMutedAtStart),e.racyCheckOk=!!this.#e.racyCheckOk,e.contentCheckOk=!!this.#e.contentCheckOk,e}},Af=class extends kf{static type=`PrefetchWatchCommand`;constructor(e){super(e)}},jf=`reel/reel_item_watch`,Mf=class extends p{static type=`ReelWatchEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return jf}buildRequest(){let e={};return this.#e.videoId&&(e.playerRequest={videoId:this.#e.videoId}),e.playerRequest&&(this.#e.playerParams&&(e.playerRequest.params=this.#e.playerParams),this.#e.racyCheckOk&&(e.playerRequest.racyCheckOk=!!this.#e.racyCheckOk),this.#e.contentCheckOk&&(e.playerRequest.contentCheckOk=!!this.#e.contentCheckOk)),this.#e.params&&(e.params=this.#e.params),this.#e.inputType&&(e.inputType=this.#e.inputType),e.disablePlayerResponse=!!this.#e.disablePlayerResponse,e}},Nf=`search`,Pf=class extends p{static type=`SearchEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Nf}buildRequest(){let e={};return this.#e.query&&(e.query=this.#e.query),this.#e.params&&(e.params=this.#e.params),this.#e.webSearchboxStatsUrl&&(e.webSearchboxStatsUrl=this.#e.webSearchboxStatsUrl),this.#e.suggestStats&&(e.suggestStats=this.#e.suggestStats),e}},Ff=`share/get_share_panel`,If=class extends p{static type=`ShareEntityServiceEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Ff}buildRequest(){let e={};return this.#e.serializedShareEntity&&(e.serializedSharedEntity=this.#e.serializedShareEntity),this.#e.clientParams&&(e.clientParams=this.#e.clientParams),e}},Lf=class extends If{static type=`ShareEndpoint`;constructor(e){super(e)}},Rf=class extends If{static type=`ShareEntityEndpoint`;constructor(e){super(e)}},zf=`get_panel`,Bf=class extends p{static type=`ShowEngagementPanelEndpoint`;#e;panel_identifier;source_panel_identifier;constructor(e){super(),this.#e=e,this.panel_identifier=e.panelIdentifier,this.source_panel_identifier=e.sourcePanelIdentifier}getApiPath(){return zf}buildRequest(){let e={},t=this.#e.panelIdentifier||this.#e.identifier?.tag;return t&&(e.panelId=t),this.#e.globalConfiguration?.params&&(e.params=this.#e.globalConfiguration?.params),e}},Vf=class extends p{static type=`SignalServiceEndpoint`;actions;signal;constructor(e){super(),Array.isArray(e.actions)&&(this.actions=Y(e.actions.map(e=>(delete e.clickTrackingParams,e)))),this.signal=e.signal}},Hf=`subscription/subscribe`,Uf=class extends p{static type=`SubscribeEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Hf}buildRequest(){let e={};return this.#e.channelIds&&(e.channelIds=this.#e.channelIds),this.#e.siloName&&(e.siloName=this.#e.siloName),this.#e.params&&(e.params=this.#e.params),this.#e.botguardResponse&&(e.botguardResponse=this.#e.botguardResponse),this.#e.feature&&(e.clientFeature=this.#e.feature),e}},Wf=`subscription/unsubscribe`,Gf=class extends p{static type=`UnsubscribeEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Wf}buildRequest(){let e={};return this.#e.channelIds&&(e.channelIds=this.#e.channelIds),this.#e.siloName&&(e.siloName=this.#e.siloName),this.#e.params&&(e.params=this.#e.params),e}},Kf=`next`,qf=class extends p{static type=`WatchNextEndpoint`;#e;constructor(e){super(),this.#e=e}getApiPath(){return Kf}buildRequest(){let e={};return this.#e.videoId&&(e.videoId=this.#e.videoId),this.#e.playlistId&&(e.playlistId=this.#e.playlistId),(this.#e.index!==void 0||this.#e.playlistIndex!==void 0)&&(e.playlistIndex=this.#e.index||this.#e.playlistIndex),(this.#e.playerParams||this.#e.params)&&(e.params=this.#e.playerParams||this.#e.params),e.racyCheckOk=!!this.#e.racyCheckOk,e.contentCheckOk=!!this.#e.contentCheckOk,e}},Jf=class extends p{static type=`Endscreen`;elements;start_ms;constructor(e){super(),this.elements=Y(e.elements),this.start_ms=e.startMs}},Yf=class extends p{static type=`EndscreenElement`;style;title;endpoint;image;icon;metadata;call_to_action;hovercard_button;is_subscribe;playlist_length;thumbnail_overlays;left;top;width;aspect_ratio;start_ms;end_ms;id;constructor(e){super(),this.style=e.style,this.title=new H(e.title),this.endpoint=new B(e.endpoint),Reflect.has(e,`image`)&&(this.image=V.fromResponse(e.image)),Reflect.has(e,`icon`)&&(this.icon=V.fromResponse(e.icon)),Reflect.has(e,`metadata`)&&(this.metadata=new H(e.metadata)),Reflect.has(e,`callToAction`)&&(this.call_to_action=new H(e.callToAction)),Reflect.has(e,`hovercardButton`)&&(this.hovercard_button=J(e.hovercardButton)),Reflect.has(e,`isSubscribe`)&&(this.is_subscribe=!!e.isSubscribe),Reflect.has(e,`playlistLength`)&&(this.playlist_length=new H(e.playlistLength)),Reflect.has(e,`thumbnailOverlays`)&&(this.thumbnail_overlays=Y(e.thumbnailOverlays)),this.left=parseFloat(e.left),this.width=parseFloat(e.width),this.top=parseFloat(e.top),this.aspect_ratio=parseFloat(e.aspectRatio),this.start_ms=parseFloat(e.startMs),this.end_ms=parseFloat(e.endMs),this.id=e.id}},Xf=class extends p{static type=`EndScreenPlaylist`;id;title;author;endpoint;thumbnails;video_count;constructor(e){super(),this.id=e.playlistId,this.title=new H(e.title),this.author=new H(e.longBylineText),this.endpoint=new B(e.navigationEndpoint),this.thumbnails=V.fromResponse(e.thumbnail),this.video_count=new H(e.videoCountText)}},Zf=class extends p{static type=`EndScreenVideo`;id;title;thumbnails;thumbnail_overlays;author;endpoint;short_view_count;badges;duration;constructor(e){super(),this.id=e.videoId,this.title=new H(e.title),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.author=new X(e.shortBylineText,e.ownerBadges),this.endpoint=new B(e.navigationEndpoint),this.short_view_count=new H(e.shortViewCountText),this.badges=Y(e.badges),this.duration={text:new H(e.lengthText).toString(),seconds:e.lengthInSeconds}}},Qf=class extends p{static type=`ExpandableTab`;title;endpoint;selected;content;constructor(e){super(),this.title=e.title,this.endpoint=new B(e.endpoint),this.selected=e.selected,this.content=J(e.content)}},$f=class extends p{static type=`ExpandedShelfContents`;items;constructor(e){super(),this.items=Y(e.items)}get contents(){return this.items}},ep=class extends p{static type=`FancyDismissibleDialog`;dialog_message;confirm_label;constructor(e){super(),this.dialog_message=new H(e.dialogMessage),this.confirm_label=new H(e.confirmLabel)}},tp=class extends p{static type=`FeedNudge`;title;subtitle;endpoint;apply_modernized_style;trim_style;background_style;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.endpoint=new B(e.impressionEndpoint),this.apply_modernized_style=e.applyModernizedStyle,this.trim_style=e.trimStyle,this.background_style=e.backgroundStyle}},np=class extends p{static type=`FeedTabbedHeader`;title;constructor(e){super(),this.title=new H(e.title)}},rp=class extends p{static type=`ToggleFormField`;label;toggled;toggle_on_action;toggle_off_action;constructor(e){super(),this.label=new H(e.label),this.toggled=e.toggled,`toggleOnAction`in e&&(this.toggle_on_action=new B(e.toggleOnAction)),`toggleOffAction`in e&&(this.toggle_off_action=new B(e.toggleOffAction))}},ip=class extends p{static type=`Form`;fields;constructor(e){super(),this.fields=Y(e.fields,rp)}},ap=class extends p{static type=`FormPopup`;title;form;buttons;constructor(e){super(),this.title=new H(e.title),this.form=J(e.form,ip),this.buttons=Y(e.buttons,z)}},op=class extends p{static type=`GameDetails`;title;box_art;box_art_overlay_text;endpoint;is_official_box_art;constructor(e){super(),this.title=new H(e.title),this.box_art=V.fromResponse(e.boxArt),this.box_art_overlay_text=new H(e.boxArtOverlayText),this.endpoint=new B(e.endpoint),this.is_official_box_art=!!e.isOfficialBoxArt}},sp=class extends p{static type=`Grid`;items;is_collapsible;visible_row_count;target_id;continuation;header;constructor(e){super(),this.items=Y(e.items),Reflect.has(e,`header`)&&(this.header=J(e.header)),Reflect.has(e,`isCollapsible`)&&(this.is_collapsible=e.isCollapsible),Reflect.has(e,`visibleRowCount`)&&(this.visible_row_count=e.visibleRowCount),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId),this.continuation=e.continuations?.[0]?.nextContinuationData?.continuation||null}get contents(){return this.items}},cp=class extends p{static type=`GridChannel`;id;author;subscribers;video_count;endpoint;subscribe_button;constructor(e){super(),this.id=e.channelId,this.author=new X({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new H(e.subscriberCountText),this.video_count=new H(e.videoCountText),this.endpoint=new B(e.navigationEndpoint),this.subscribe_button=J(e.subscribeButton)}},lp=class extends p{static type=`GridHeader`;title;constructor(e){super(),this.title=new H(e.title)}},up=class extends p{static type=`GridMix`;id;title;author;thumbnails;video_count;video_count_short;endpoint;secondary_endpoint;thumbnail_overlays;constructor(e){super(),this.id=e.playlistId,this.title=new H(e.title),this.author=e.shortBylineText?.simpleText?new H(e.shortBylineText):e.longBylineText?.simpleText?new H(e.longBylineText):null,this.thumbnails=V.fromResponse(e.thumbnail),this.video_count=new H(e.videoCountText),this.video_count_short=new H(e.videoCountShortText),this.endpoint=new B(e.navigationEndpoint),this.secondary_endpoint=new B(e.secondaryNavigationEndpoint),this.thumbnail_overlays=Y(e.thumbnailOverlays)}},dp=class extends p{static type=`GridMovie`;id;title;thumbnails;duration;endpoint;badges;metadata;thumbnail_overlays;constructor(e){super();let t=e.thumbnailOverlays.find(e=>e.hasOwnProperty(`thumbnailOverlayTimeStatusRenderer`))?.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new H(e.title),this.thumbnails=V.fromResponse(e.thumbnail),this.duration=e.lengthText?new H(e.lengthText):t?.text?new H(t.text):null,this.endpoint=new B(e.navigationEndpoint),this.badges=Y(e.badges,ul),this.metadata=new H(e.metadata),this.thumbnail_overlays=Y(e.thumbnailOverlays)}},fp=class extends p{static type=`GridPlaylist`;id;title;author;badges;endpoint;view_playlist;thumbnails;thumbnail_overlays;thumbnail_renderer;sidebar_thumbnails;video_count;video_count_short;constructor(e){super(),this.id=e.playlistId,this.title=new H(e.title),Reflect.has(e,`shortBylineText`)&&(this.author=new X(e.shortBylineText,e.ownerBadges)),this.badges=Y(e.ownerBadges),this.endpoint=new B(e.navigationEndpoint),this.view_playlist=new H(e.viewPlaylistText),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.thumbnail_renderer=J(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...e.sidebarThumbnails?.map(e=>V.fromResponse(e))||[])||null,this.video_count=new H(e.thumbnailText),this.video_count_short=new H(e.videoCountShortText)}},pp=class extends p{static type=`GridShelfView`;contents;header;content_aspect_ratio;enable_vertical_expansion;show_more_button;show_less_button;min_collapsed_item_count;constructor(e){super(),this.contents=Y(e.contents),this.header=J(e.header),this.content_aspect_ratio=e.contentAspectRatio,this.enable_vertical_expansion=e.enableVerticalExpansion,this.show_more_button=J(e.showMoreButton,U),this.show_less_button=J(e.showLessButton,U),this.min_collapsed_item_count=e.minCollapsedItemCount}},mp=class extends p{static type=`ShowCustomThumbnail`;thumbnail;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail)}},hp=class extends p{static type=`ThumbnailOverlayBottomPanel`;text;icon_type;constructor(e){super(),Reflect.has(e,`text`)&&(this.text=new H(e.text)),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType)}},gp=class extends p{static type=`GridShow`;title;thumbnail_renderer;endpoint;long_byline_text;thumbnail_overlays;author;constructor(e){super(),this.title=new H(e.title),this.thumbnail_renderer=J(e.thumbnailRenderer,mp),this.endpoint=new B(e.navigationEndpoint),this.long_byline_text=new H(e.longBylineText),this.thumbnail_overlays=Y(e.thumbnailOverlays,hp),this.author=new X(e.shortBylineText,void 0)}},_p=class extends p{static type=`GridVideo`;video_id;title;thumbnails;thumbnail_overlays;rich_thumbnail;published;duration;author;views;short_view_count;endpoint;menu;buttons;upcoming;upcoming_text;is_reminder_set;constructor(e){super();let t=e.thumbnailOverlays.find(e=>e.hasOwnProperty(`thumbnailOverlayTimeStatusRenderer`))?.thumbnailOverlayTimeStatusRenderer;this.video_id=e.videoId,this.title=new H(e.title),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.rich_thumbnail=J(e.richThumbnail),this.published=new H(e.publishedTimeText),this.duration=e.lengthText?new H(e.lengthText):t?.text?new H(t.text):null,this.author=e.shortBylineText&&new X(e.shortBylineText,e.ownerBadges,e.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail),this.views=new H(e.viewCountText),this.short_view_count=new H(e.shortViewCountText),this.endpoint=new B(e.navigationEndpoint),this.menu=J(e.menu,W),Reflect.has(e,`buttons`)&&(this.buttons=Y(e.buttons)),Reflect.has(e,`upcomingEventData`)&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)),this.upcoming_text=new H(e.upcomingEventData.upcomingEventText),this.is_reminder_set=!!e.upcomingEventData?.isReminderSet)}get id(){return this.video_id}get is_upcoming(){return!!(this.upcoming&&this.upcoming>new Date)}},vp=class extends p{static type=`GuideEntry`;title;endpoint;icon_type;thumbnails;badges;is_primary;constructor(e){super(),this.title=new H(e.formattedTitle),this.endpoint=new B(e.navigationEndpoint||e.serviceEndpoint),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),Reflect.has(e,`thumbnail`)&&(this.thumbnails=V.fromResponse(e.thumbnail)),Reflect.has(e,`badges`)&&(this.badges=e.badges),this.is_primary=!!e.isPrimary}},yp=class extends p{static type=`GuideCollapsibleEntry`;expander_item;collapser_item;expandable_items;constructor(e){super(),this.expander_item=J(e.expanderItem,vp),this.collapser_item=J(e.collapserItem,vp),this.expandable_items=Y(e.expandableItems)}},bp=class extends p{static type=`GuideCollapsibleSectionEntry`;header_entry;expander_icon;collapser_icon;section_items;constructor(e){super(),this.header_entry=J(e.headerEntry),this.expander_icon=e.expanderIcon.iconType,this.collapser_icon=e.collapserIcon.iconType,this.section_items=Y(e.sectionItems)}},xp=class extends vp{static type=`GuideDownloadsEntry`;always_show;constructor(e){super(e.entryRenderer.guideEntryRenderer),this.always_show=!!e.alwaysShow}},Sp=class extends p{static type=`GuideSection`;title;items;constructor(e){super(),Reflect.has(e,`formattedTitle`)&&(this.title=new H(e.formattedTitle)),this.items=Y(e.items)}},Cp=class extends Sp{static type=`GuideSubscriptionsSection`},wp=class extends p{static type=`HashtagHeader`;hashtag;hashtag_info;constructor(e){super(),this.hashtag=new H(e.hashtag),this.hashtag_info=new H(e.hashtagInfoText)}},Tp=class extends p{static type=`HashtagTile`;hashtag;hashtag_info_text;hashtag_thumbnail;endpoint;hashtag_background_color;hashtag_video_count;hashtag_channel_count;constructor(e){super(),this.hashtag=new H(e.hashtag),this.hashtag_info_text=new H(e.hashtagInfoText),this.hashtag_thumbnail=V.fromResponse(e.hashtagThumbnail),this.endpoint=new B(e.onTapCommand),this.hashtag_background_color=e.hashtagBackgroundColor,this.hashtag_video_count=new H(e.hashtagVideoCount),this.hashtag_channel_count=new H(e.hashtagChannelCount)}},Ep=class extends p{static type=`HeroPlaylistThumbnail`;thumbnails;on_tap_endpoint;constructor(e){super(),this.thumbnails=V.fromResponse(e.thumbnail),this.on_tap_endpoint=new B(e.onTap)}},Dp=class extends p{static type=`Panel`;thumbnail;background_image;strapline;title;description;text_on_tap_endpoint;cta;constructor(e){super(),e.thumbnail&&(this.thumbnail={image:V.fromResponse(e.thumbnail.image),endpoint:new B(e.thumbnail.onTap),on_long_press_endpoint:new B(e.thumbnail.onLongPress),content_mode:e.thumbnail.contentMode,crop_options:e.thumbnail.cropOptions}),this.background_image={image:V.fromResponse(e.backgroundImage.image),gradient_image:V.fromResponse(e.backgroundImage.gradientImage)},this.strapline=e.strapline,this.title=e.title,this.description=e.description,this.cta={icon_name:e.cta.iconName,title:e.cta.title,endpoint:new B(e.cta.onTap),accessibility_text:e.cta.accessibilityText,state:e.cta.state},this.text_on_tap_endpoint=new B(e.textOnTap)}},Op=class extends p{static type=`HighlightsCarousel`;panels;constructor(e){super(),this.panels=_(e.highlightsCarousel.panels.map(e=>new Dp(e)))}},kp=class extends p{static type=`SearchSuggestion`;suggestion;endpoint;icon_type;service_endpoint;constructor(e){super(),this.suggestion=new H(e.suggestion),this.endpoint=new B(e.navigationEndpoint),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),Reflect.has(e,`serviceEndpoint`)&&(this.service_endpoint=new B(e.serviceEndpoint))}},Ap=class extends kp{static type=`HistorySuggestion`;constructor(e){super(e)}},jp=class extends p{static type=`HorizontalShelfView`;items;constructor(e){super(),this.items=Y(e.items)}},Mp=class extends p{static type=`HorizontalMovieList`;items;previous_button;next_button;constructor(e){super(),this.items=Y(e.items),this.previous_button=J(e.previousButton,z),this.next_button=J(e.nextButton,z)}get contents(){return this.items}},Np=class extends p{static type=`IconLink`;icon_type;tooltip;endpoint;constructor(e){super(),this.icon_type=e.icon?.iconType,Reflect.has(e,`tooltip`)&&(this.tooltip=new H(e.tooltip).toString()),this.endpoint=new B(e.navigationEndpoint)}},Pp=class extends p{static type=`ImageBannerView`;image;style;constructor(e){super(),this.image=V.fromResponse(e.image),this.style=e.style}},Fp=class extends p{static type=`IncludingResultsFor`;including_results_for;corrected_query;corrected_query_endpoint;search_only_for;original_query;original_query_endpoint;constructor(e){super(),this.including_results_for=new H(e.includingResultsFor),this.corrected_query=new H(e.correctedQuery),this.corrected_query_endpoint=new B(e.correctedQueryEndpoint),this.search_only_for=Reflect.has(e,`searchOnlyFor`)?new H(e.searchOnlyFor):void 0,this.original_query=Reflect.has(e,`originalQuery`)?new H(e.originalQuery):void 0,this.original_query_endpoint=Reflect.has(e,`originalQueryEndpoint`)?new B(e.originalQueryEndpoint):void 0}},Ip=class extends p{static type=`InfoPanelContent`;title;source;paragraphs;attributed_paragraphs;thumbnail;source_endpoint;truncate_paragraphs;background;inline_link_icon_type;constructor(e){super(),this.title=new H(e.title),this.source=new H(e.source),Reflect.has(e,`paragraphs`)&&(this.paragraphs=e.paragraphs.map(e=>new H(e))),Reflect.has(e,`attributedParagraphs`)&&(this.attributed_paragraphs=e.attributedParagraphs.map(e=>H.fromAttributed(e))),this.thumbnail=V.fromResponse(e.thumbnail),this.source_endpoint=new B(e.sourceEndpoint),this.truncate_paragraphs=!!e.truncateParagraphs,this.background=e.background,Reflect.has(e,`inlineLinkIcon`)&&Reflect.has(e.inlineLinkIcon,`iconType`)&&(this.inline_link_icon_type=e.inlineLinkIcon.iconType)}},Lp=class extends p{static type=`InfoPanelContainer`;title;menu;content;header_endpoint;background;title_style;icon_type;constructor(e){super(),this.title=new H(e.title),this.menu=J(e.menu,W),this.content=J(e.content,Ip),e.headerEndpoint&&(this.header_endpoint=new B(e.headerEndpoint)),this.background=e.background,this.title_style=e.titleStyle,Reflect.has(e,`icon`)&&(this.icon_type=e.icon?.iconType)}},Rp=class extends p{static type=`InteractiveTabbedHeader`;header_type;title;description;metadata;badges;box_art;banner;buttons;auto_generated;constructor(e){super(),this.header_type=e.type,this.title=new H(e.title),this.description=new H(e.description),this.metadata=new H(e.metadata),this.badges=Y(e.badges,ul),this.box_art=V.fromResponse(e.boxArt),this.banner=V.fromResponse(e.banner),this.buttons=Y(e.buttons,[tu,z]),this.auto_generated=new H(e.autoGenerated)}},zp=class extends p{static type=`InterstitialView`;title;description;icon;primary_button;constructor(e){super(),this.title=H.fromAttributed(e.title),this.description=H.fromAttributed(e.description),`icon`in e&&(this.icon=V.fromResponse(e.icon)),this.primary_button=J(e.primaryButton,U)}},Bp=class extends p{static type=`LinearLayoutView`;items;renderer_context;constructor(e){super(),this.items=Y(e.items),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Vp=class extends p{static type=`LiveChat`;header;initial_display_state;continuation;client_messages;is_replay;constructor(e){super(),this.header=J(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=e.continuations[0]?.reloadContinuationData?.continuation,this.client_messages={reconnect_message:new H(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new H(e.clientMessages.unableToReconnectMessage),fatal_error:new H(e.clientMessages.fatalError),reconnected_message:new H(e.clientMessages.reconnectedMessage),generic_error:new H(e.clientMessages.genericError)},this.is_replay=!!e.isReplay}},Hp=class extends p{static type=`LiveChatBannerHeader`;text;icon_type;context_menu_button;constructor(e){super(),this.text=new H(e.text),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),this.context_menu_button=J(e.contextMenuButton,z)}},Up=class extends p{static type=`LiveChatBanner`;header;contents;action_id;viewer_is_creator;target_id;is_stackable;background_type;banner_type;banner_properties_is_ephemeral;banner_properties_auto_collapse_delay_seconds;constructor(e){super(),this.header=J(e.header,Hp),this.contents=J(e.contents),this.action_id=e.actionId,Reflect.has(e,`viewerIsCreator`)&&(this.viewer_is_creator=e.viewerIsCreator),this.target_id=e.targetId,this.is_stackable=e.isStackable,Reflect.has(e,`backgroundType`)&&(this.background_type=e.backgroundType),this.banner_type=e.bannerType,Reflect.has(e,`bannerProperties`)&&Reflect.has(e.bannerProperties,`isEphemeral`)&&(this.banner_properties_is_ephemeral=!!e.bannerProperties.isEphemeral),Reflect.has(e,`bannerProperties`)&&Reflect.has(e.bannerProperties,`autoCollapseDelay`)&&Reflect.has(e.bannerProperties.autoCollapseDelay,`seconds`)&&(this.banner_properties_auto_collapse_delay_seconds=e.bannerProperties.autoCollapseDelay.seconds)}},Wp=class extends p{static type=`AddBannerToLiveChatCommand`;banner;constructor(e){super(),this.banner=J(e.bannerRenderer,Up)}},Gp=class extends p{static type=`AddChatItemAction`;item;client_id;constructor(e){super(),this.item=J(e.item),Reflect.has(e,`clientId`)&&(this.client_id=e.clientId)}},Kp=class extends p{static type=`AddLiveChatTickerItemAction`;item;duration_sec;constructor(e){super(),this.item=J(e.item),this.duration_sec=e.durationSec}},qp=class extends p{static type=`DimChatItemAction`;client_assigned_id;constructor(e){super(),this.client_assigned_id=e.clientAssignedId}},Jp=class extends p{static type=`BumperUserEduContentView`;text;image_name;image_color;constructor(e){super(),this.text=H.fromAttributed(e.text),this.image_name=e.image.sources[0].clientResource.imageName,this.image_color=e.image.sources[0].clientResource.imageColor}},Yp=class extends p{static type=`CreatorHeartView`;creator_thumbnail;hearted_icon_name;unhearted_icon_name;unhearted_icon_processor;hearted_hover_text;hearted_accessibility_label;unhearted_accessibility_label;engagement_state_key;constructor(e){super(),this.creator_thumbnail=V.fromResponse(e.creatorThumbnail),this.hearted_icon_name=e.heartedIcon.sources[0].clientResource.imageName,this.unhearted_icon_name=e.unheartedIcon.sources[0].clientResource.imageName,this.unhearted_icon_processor={border_image_processor:{image_tint:{color:e.unheartedIcon.processor.borderImageProcessor.imageTint.color}}},this.hearted_hover_text=e.heartedHoverText,this.hearted_accessibility_label=e.heartedAccessibilityLabel,this.unhearted_accessibility_label=e.unheartedAccessibilityLabel,this.engagement_state_key=e.engagementStateKey}},Xp=class extends p{static type=`LiveChatAutoModMessage`;menu_endpoint;moderation_buttons;auto_moderated_item;header_text;timestamp;id;constructor(e){super(),this.menu_endpoint=new B(e.contextMenuEndpoint),this.moderation_buttons=Y(e.moderationButtons,z),this.auto_moderated_item=J(e.autoModeratedItem),this.header_text=new H(e.headerText),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}},Zp=class extends p{static type=`LiveChatBannerChatSummary`;id;chat_summary;icon_type;like_feedback_button;dislike_feedback_button;constructor(e){super(),this.id=e.liveChatSummaryId,this.chat_summary=new H(e.chatSummary),this.icon_type=e.icon.iconType,this.like_feedback_button=J(e.likeFeedbackButton,vc),this.dislike_feedback_button=J(e.dislikeFeedbackButton,vc)}},Qp=class extends p{static type=`LiveChatBannerPoll`;poll_question;author_photo;choices;collapsed_state_entity_key;live_chat_poll_state_entity_key;context_menu_button;constructor(e){super(),this.poll_question=new H(e.pollQuestion),this.author_photo=V.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(e=>({option_id:e.pollOptionId,text:new H(e.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=J(e.contextMenuButton,z)}},$p=class extends p{static type=`LiveChatBannerRedirect`;banner_message;author_photo;inline_action_button;context_menu_button;constructor(e){super(),this.banner_message=new H(e.bannerMessage),this.author_photo=V.fromResponse(e.authorPhoto),this.inline_action_button=J(e.inlineActionButton,z),this.context_menu_button=J(e.contextMenuButton,z)}},em=class extends p{static type=`LiveChatItemBumperView`;content;constructor(e){super(),this.content=J(e.content,Jp)}},tm=class extends p{static type=`LiveChatMembershipItem`;id;timestamp;timestamp_usec;timestamp_text;header_primary_text;header_subtext;message;author;menu_endpoint;context_menu_accessibility_label;constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,Reflect.has(e,`timestampText`)&&(this.timestamp_text=new H(e.timestampText)),Reflect.has(e,`headerPrimaryText`)&&(this.header_primary_text=new H(e.headerPrimaryText)),this.header_subtext=new H(e.headerSubtext),Reflect.has(e,`message`)&&(this.message=new H(e.message)),this.author=new X(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new B(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}},nm=class extends p{static type=`LiveChatModeChangeMessage`;id;icon_type;text;subtext;timestamp;timestamp_usec;timestamp_text;constructor(e){super(),this.id=e.id,this.icon_type=e.icon.iconType,this.text=new H(e.text),this.subtext=new H(e.subtext),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,this.timestamp_text=new H(e.timestampText)}},rm=class extends p{static type=`PdgReplyButtonView`;reply_button;reply_count_entity_key;reply_count_placeholder;constructor(e){super(),this.reply_button=J(e.replyButton,U),this.reply_count_entity_key=e.replyCountEntityKey,this.reply_count_placeholder=H.fromAttributed(e.replyCountPlaceholder)}},im=class extends p{static type=`LiveChatPaidMessage`;id;message;author;author_name_text_color;header_background_color;header_text_color;body_background_color;body_text_color;purchase_amount;menu_endpoint;context_menu_accessibility_label;timestamp;timestamp_usec;timestamp_text;timestamp_color;header_overlay_image;text_input_background_color;lower_bumper;creator_heart_button;is_v2_style;reply_button;constructor(e){super(),this.id=e.id,this.message=new H(e.message),this.author=new X(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.author_name_text_color=e.authorNameTextColor,this.header_background_color=e.headerBackgroundColor,this.header_text_color=e.headerTextColor,this.body_background_color=e.bodyBackgroundColor,this.body_text_color=e.bodyTextColor,this.purchase_amount=new H(e.purchaseAmountText).toString(),this.menu_endpoint=new B(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,Reflect.has(e,`timestampText`)&&(this.timestamp_text=new H(e.timestampText).toString()),this.timestamp_color=e.timestampColor,Reflect.has(e,`headerOverlayImage`)&&(this.header_overlay_image=V.fromResponse(e.headerOverlayImage)),this.text_input_background_color=e.textInputBackgroundColor,this.lower_bumper=J(e.lowerBumper,em),this.creator_heart_button=J(e.creatorHeartButton,Yp),this.is_v2_style=e.isV2Style,this.reply_button=J(e.replyButton,rm)}},am=class extends p{static type=`LiveChatPaidSticker`;id;author;money_chip_background_color;money_chip_text_color;background_color;author_name_text_color;sticker;sticker_accessibility_label;sticker_display_width;sticker_display_height;purchase_amount;menu_endpoint;context_menu;context_menu_accessibility_label;timestamp;timestamp_usec;is_v2_style;constructor(e){super(),this.id=e.id,this.author=new X(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.money_chip_background_color=e.moneyChipBackgroundColor,this.money_chip_text_color=e.moneyChipTextColor,this.background_color=e.backgroundColor,this.author_name_text_color=e.authorNameTextColor,this.sticker=V.fromResponse(e.sticker),this.sticker_accessibility_label=e.sticker.accessibility.accessibilityData.label,this.sticker_display_width=e.stickerDisplayWidth,this.sticker_display_height=e.stickerDisplayHeight,this.purchase_amount=new H(e.purchaseAmountText).toString(),this.menu_endpoint=new B(e.contextMenuEndpoint),this.context_menu=this.menu_endpoint,this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,this.is_v2_style=e.isV2Style}},om=class extends p{static type=`LiveChatPlaceholderItem`;id;timestamp;constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}},sm=class extends p{static type=`LiveChatProductItem`;title;accessibility_title;thumbnail;price;vendor_name;from_vendor_text;information_button;endpoint;creator_message;creator_name;author_photo;information_dialog;is_verified;creator_custom_message;constructor(e){super(),this.title=e.title,this.accessibility_title=e.accessibilityTitle,this.thumbnail=V.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.from_vendor_text=e.fromVendorText,this.information_button=J(e.informationButton),this.endpoint=new B(e.onClickCommand),this.creator_message=e.creatorMessage,this.creator_name=e.creatorName,this.author_photo=V.fromResponse(e.authorPhoto),this.information_dialog=J(e.informationDialog),this.is_verified=e.isVerified,this.creator_custom_message=new H(e.creatorCustomMessage)}},cm=class extends p{static type=`LiveChatRestrictedParticipation`;message;icon_type;constructor(e){super(),this.message=new H(e.message),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType)}},lm=class extends ul{static type=`LiveChatAuthorBadge`;custom_thumbnail;constructor(e){super(e),this.custom_thumbnail=V.fromResponse(e.customThumbnail)}},um=class extends p{static type=`LiveChatSponsorshipsHeader`;author_name;author_photo;author_badges;primary_text;menu_endpoint;context_menu_accessibility_label;image;constructor(e){super(),this.author_name=new H(e.authorName),this.author_photo=V.fromResponse(e.authorPhoto),this.author_badges=Y(e.authorBadges,lm),this.primary_text=new H(e.primaryText),this.menu_endpoint=new B(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.image=V.fromResponse(e.image)}},dm=class extends p{static type=`LiveChatSponsorshipsGiftPurchaseAnnouncement`;id;timestamp_usec;author_external_channel_id;header;constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.author_external_channel_id=e.authorExternalChannelId,this.header=J(e.header,um)}},fm=class extends p{static type=`LiveChatSponsorshipsGiftRedemptionAnnouncement`;id;timestamp_usec;timestamp_text;author;message;menu_endpoint;context_menu_accessibility_label;constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.timestamp_text=new H(e.timestampText),this.author=new X(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.message=new H(e.message),this.menu_endpoint=new B(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}},pm=class extends p{static type=`LiveChatTextMessage`;id;message;inline_action_buttons;timestamp;timestamp_usec;timestamp_text;author;menu_endpoint;context_menu_accessibility_label;before_content_buttons;constructor(e){super(),this.id=e.id,this.message=new H(e.message),this.inline_action_buttons=Y(e.inlineActionButtons,z),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,Reflect.has(e,`timestampText`)&&(this.timestamp_text=new H(e.timestampText).toString()),this.author=new X(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),Reflect.has(e,`contextMenuEndpoint`)&&(this.menu_endpoint=new B(e.contextMenuEndpoint)),Reflect.has(e,`contextMenuAccessibility`)&&Reflect.has(e.contextMenuAccessibility,`accessibilityData`)&&Reflect.has(e.contextMenuAccessibility.accessibilityData,`label`)&&(this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label),this.before_content_buttons=Y(e.beforeContentButtons,U)}},mm=class extends p{static type=`LiveChatTickerPaidMessageItem`;id;author;amount;amount_text_color;start_background_color;end_background_color;duration_sec;full_duration_sec;show_item;show_item_endpoint;animation_origin;open_engagement_panel_command;constructor(e){super(),this.id=e.id,this.author=new X(e.authorName||e.authorUsername,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),Reflect.has(e,`amount`)&&(this.amount=new H(e.amount)),this.amount_text_color=e.amountTextColor,this.start_background_color=e.startBackgroundColor,this.end_background_color=e.endBackgroundColor,this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=J(e.showItemEndpoint?.showLiveChatItemEndpoint?.renderer),this.show_item_endpoint=new B(e.showItemEndpoint),this.animation_origin=e.animationOrigin,this.open_engagement_panel_command=new B(e.openEngagementPanelCommand)}},hm=class extends p{static type=`LiveChatTickerPaidStickerItem`;id;author_external_channel_id;author_photo;start_background_color;end_background_color;duration_sec;full_duration_sec;show_item;show_item_endpoint;ticker_thumbnails;constructor(e){super(),this.id=e.id,this.author_external_channel_id=e.authorExternalChannelId,this.author_photo=V.fromResponse(e.authorPhoto),this.start_background_color=e.startBackgroundColor,this.end_background_color=e.endBackgroundColor,this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=J(e.showItemEndpoint?.showLiveChatItemEndpoint?.renderer),this.show_item_endpoint=new B(e.showItemEndpoint),this.ticker_thumbnails=e.tickerThumbnails.map(e=>({thumbnails:V.fromResponse(e),label:e?.accessibility?.accessibilityData?.label}))}},gm=class extends p{static type=`LiveChatTickerSponsorItem`;id;detail;author;duration_sec;constructor(e){super(),this.id=e.id,this.detail=new H(e.detailText),this.author=new X(e.authorName,e.authorBadges,e.sponsorPhoto,e.authorExternalChannelId),this.duration_sec=e.durationSec}},_m=class extends p{static type=`LiveChatViewerEngagementMessage`;id;timestamp;timestamp_usec;icon_type;message;action_button;menu_endpoint;context_menu_accessibility_label;constructor(e){super(),this.id=e.id,Reflect.has(e,`timestampUsec`)&&(this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),this.message=new H(e.message),this.action_button=J(e.actionButton),Reflect.has(e,`contextMenuEndpoint`)&&(this.menu_endpoint=new B(e.contextMenuEndpoint)),Reflect.has(e,`contextMenuAccessibility`)&&Reflect.has(e.contextMenuAccessibility,`accessibilityData`)&&Reflect.has(e.contextMenuAccessibility.accessibilityData,`label`)&&(this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label)}},vm=class extends p{static type=`PollHeader`;poll_question;thumbnails;metadata;live_chat_poll_type;context_menu_button;constructor(e){super(),this.poll_question=new H(e.pollQuestion),this.thumbnails=V.fromResponse(e.thumbnail),this.metadata=new H(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=J(e.contextMenuButton,z)}},ym=class extends p{static type=`LiveChatActionPanel`;id;contents;target_id;constructor(e){super(),this.id=e.id,this.contents=zy(e.contents),this.target_id=e.targetId}},bm=class extends p{static type=`MarkChatItemAsDeletedAction`;deleted_state_message;target_item_id;constructor(e){super(),this.deleted_state_message=new H(e.deletedStateMessage),this.target_item_id=e.targetItemId}},xm=class extends p{static type=`MarkChatItemsByAuthorAsDeletedAction`;deleted_state_message;external_channel_id;constructor(e){super(),this.deleted_state_message=new H(e.deletedStateMessage),this.external_channel_id=e.externalChannelId}},Sm=class extends p{static type=`RemoveBannerForLiveChatCommand`;target_action_id;constructor(e){super(),this.target_action_id=e.targetActionId}},Cm=class extends p{static type=`RemoveChatItemAction`;target_item_id;constructor(e){super(),this.target_item_id=e.targetItemId}},wm=class extends p{static type=`RemoveChatItemByAuthorAction`;external_channel_id;constructor(e){super(),this.external_channel_id=e.externalChannelId}},Tm=class extends p{static type=`ReplaceChatItemAction`;target_item_id;replacement_item;constructor(e){super(),this.target_item_id=e.targetItemId,this.replacement_item=J(e.replacementItem)}},Em=class extends p{static type=`ReplaceLiveChatAction`;to_replace;replacement;constructor(e){super(),this.to_replace=e.toReplace,this.replacement=J(e.replacement)}},Dm=class extends p{static type=`ReplayChatItemAction`;actions;video_offset_time_msec;constructor(e){super(),this.actions=Y(e.actions?.map(e=>(delete e.clickTrackingParams,e))),this.video_offset_time_msec=e.videoOffsetTimeMsec}},Om=class extends p{static type=`ShowLiveChatActionPanelAction`;panel_to_show;constructor(e){super(),this.panel_to_show=J(e.panelToShow,ym)}},km=class extends p{static type=`ShowLiveChatDialogAction`;dialog;constructor(e){super(),this.dialog=J(e.dialog)}},Am=class extends p{static type=`ShowLiveChatTooltipCommand`;tooltip;constructor(e){super(),this.tooltip=J(e.tooltip)}},jm=class extends p{static type=`UpdateDateTextAction`;date_text;constructor(e){super(),this.date_text=new H(e.dateText).toString()}},Mm=class extends p{static type=`UpdateDescriptionAction`;description;constructor(e){super(),this.description=new H(e.description)}},Nm=class extends p{static type=`UpdateLiveChatPollAction`;poll_to_update;constructor(e){super(),this.poll_to_update=J(e.pollToUpdate)}},Pm=class extends p{static type=`UpdateTitleAction`;title;constructor(e){super(),this.title=new H(e.title)}},Fm=class extends p{static type=`UpdateToggleButtonTextAction`;default_text;toggled_text;button_id;constructor(e){super(),this.default_text=new H(e.defaultText).toString(),this.toggled_text=new H(e.toggledText).toString(),this.button_id=e.buttonId}},Im=class extends p{static type=`VideoViewCount`;original_view_count;unlabeled_view_count_value;short_view_count;extra_short_view_count;view_count;is_live;constructor(e){super(),`originalViewCount`in e&&(this.original_view_count=parseInt(e.originalViewCount)),`unlabeledViewCountValue`in e&&(this.unlabeled_view_count_value=new H(e.unlabeledViewCountValue)),`shortViewCount`in e&&(this.short_view_count=new H(e.shortViewCount)),`extraShortViewCount`in e&&(this.extra_short_view_count=new H(e.extraShortViewCount)),`viewCount`in e&&(this.view_count=new H(e.viewCount)),this.is_live=!!e.isLive}},Lm=class extends p{static type=`UpdateViewershipAction`;view_count_node;get view_count(){return this.view_count_node?.view_count}get extra_short_view_count(){return this.view_count_node?.extra_short_view_count}get short_view_count(){return this.view_count_node?.short_view_count}get original_view_count(){return this.view_count_node?.original_view_count}get unlabeled_view_count_value(){return this.view_count_node?.unlabeled_view_count_value}get is_live(){return this.view_count_node?.is_live}constructor(e){super(),this.view_count_node=J(e.viewCount,Im)}},Rm=class extends p{static type=`LiveChatDialog`;confirm_button;dialog_messages;constructor(e){super(),this.confirm_button=J(e.confirmButton,z),this.dialog_messages=e.dialogMessages.map(e=>new H(e))}},zm=class extends p{static type=`LiveChatHeader`;overflow_menu;collapse_button;view_selector;constructor(e){super(),this.overflow_menu=J(e.overflowMenu,W),this.collapse_button=J(e.collapseButton,z),this.view_selector=J(e.viewSelector,Us)}},Bm=class extends p{static type=`LiveChatItemList`;max_items_to_display;more_comments_below_button;constructor(e){super(),this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=J(e.moreCommentsBelowButton,z)}},Vm=class extends p{static type=`LiveChatMessageInput`;author_name;author_photo;send_button;target_id;constructor(e){super(),this.author_name=new H(e.authorName),this.author_photo=V.fromResponse(e.authorPhoto),this.send_button=J(e.sendButton,z),this.target_id=e.targetId}},Hm=class extends p{static type=`LiveChatParticipant`;name;photo;badges;constructor(e){super(),this.name=new H(e.authorName),this.photo=V.fromResponse(e.authorPhoto),this.badges=Y(e.authorBadges)}},Um=class extends p{static type=`LiveChatParticipantsList`;title;participants;constructor(e){super(),this.title=new H(e.title),this.participants=Y(e.participants,Hm)}},Wm=class extends p{static type=`LiveStreamOfflineSlate`;main_text;subtitle_text;thumbnail;action_buttons;constructor(e){super(),this.main_text=new H(e.mainText),this.subtitle_text=new H(e.subtitleText),this.thumbnail=V.fromResponse(e.thumbnail),this.action_buttons=Y(e.actionButtons,z)}},Gm=class extends p{static type=`LiveStreamability`;video_id;broadcast_id;stream_transition_endpoint;switch_streams_immediately;display_endscreen;poll_delay_ms;creator_redirect;transition_timing;offline_slate;renderer_context;constructor(e){super(),this.video_id=e.videoId,this.broadcast_id=e.broadcastId,this.transition_timing=e.transitionTiming,this.offline_slate=J(e.offlineSlate,Wm),`pollDelayMs`in e&&(this.poll_delay_ms=e.pollDelayMs),`switchStreamsImmediately`in e&&(this.switch_streams_immediately=e.switchStreamsImmediately),`displayEndscreen`in e&&(this.display_endscreen=e.displayEndscreen),`streamTransitionEndpoint`in e&&(this.stream_transition_endpoint=new B(e.streamTransitionEndpoint)),`creatorRedirect`in e&&(this.creator_redirect={hide_autoplay_toggle:e.creatorRedirect?.hideAutoplayToggle}),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},Km=class extends p{static type=`LockupMetadataView`;title;metadata;image;menu_button;constructor(e){super(),`title`in e&&(this.title=H.fromAttributed(e.title)),this.metadata=J(e.metadata,vd),this.image=J(e.image,[Ed,fc]),this.menu_button=J(e.menuButton,U)}},qm=class extends p{static type=`LockupView`;content_image;metadata;content_id;content_type;styling;renderer_context;inline_player_params;constructor(e){super(),this.content_image=J(e.contentImage,[Iu,Fu]),this.metadata=J(e.metadata,Km),this.content_id=e.contentId,this.content_type=e.contentType?.replace(`LOCKUP_CONTENT_TYPE_`,``)??`UNSPECIFIED`,Reflect.has(e,`styling`)&&(this.styling={layout:e.styling.layout?.replace(`LOCKUP_LAYOUT_`,``),content_image_aspect_ratio:e.styling.contentImageAspectRatio?.replace(`LOCKUP_CONTENT_IMAGE_ASPECT_RATIO_`,``)}),this.renderer_context=new dc(e.rendererContext),this.inline_player_params=e.itemPlayback?.inlinePlayerData?.onVisible?.innertubeCommand?.watchEndpoint?.playerParams}get duration(){let e=this.content_image instanceof Iu?this.content_image.primary_thumbnail:this.content_image;for(let t of e?.overlays??[])if(t.is(Pu,ju)){for(let e of t.badges)if(/^\d{1,3}(?:,\d{3})*:\d{2}(?::\d{2})?$/.test(e.text))return{text:e.text,seconds:ex(e.text)}}return{text:``,seconds:0}}},Jm=class extends p{static type=`MacroMarkersListEntity`;marker_entity_key;external_video_id;marker_type;markers;max_height_dp;min_height_dp;show_hide_animation_duration_millis;timed_marker_decorations;raw_api_markers;raw_api_decorations;constructor(e){super(),this.marker_entity_key=e.key,this.external_video_id=e.externalVideoId,this.marker_type=e.markersList?.markerType||``,this.raw_api_markers=e.markersList?.markers||[],this.raw_api_decorations=e.markersList?.markersDecoration?.timedMarkerDecorations||[],this.markers=_(this.raw_api_markers.map(e=>new Dd(e)));let t=e.markersList?.markersMetadata?.heatmapMetadata;this.max_height_dp=t?.maxHeightDp||40,this.min_height_dp=t?.minHeightDp||4,this.show_hide_animation_duration_millis=t?.showHideAnimationDurationMillis||200,this.timed_marker_decorations=_(this.raw_api_decorations.map(e=>new Od(e)))}isHeatmap(){return this.marker_type===`MARKER_TYPE_HEATMAP`}toHeatmap(){if(!this.isHeatmap())return null;let e=this.raw_api_markers.map(e=>({HeatMarker:e})),t=this.raw_api_decorations.map(e=>({TimedMarkerDecoration:e}));return J({Heatmap:{maxHeightDp:this.max_height_dp,minHeightDp:this.min_height_dp,showHideAnimationDurationMillis:this.show_hide_animation_duration_millis,heatMarkers:e,heatMarkersDecorations:t}},kd)}},Ym=class extends p{static type=`MediaLockup`;title;subtitle;thumbnail_details;endpoint;enable_subtitle_launch_icon;ui_tweaks;max_lines_title;max_lines_subtitle;disable_endpoint;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.thumbnail_details=V.fromResponse(e.thumbnailDetails),this.endpoint=new B(e.endpoint),this.enable_subtitle_launch_icon=!!e.enableSubtitleLaunchIcon,`uiTweaks`in e&&(this.ui_tweaks={use_zero_padding:e.uiTweaks.useZeroPadding,thumbnail_width:e.uiTweaks.thumbnailWidth,thumbnail_height:e.uiTweaks.thumbnailHeight}),this.max_lines_title=e.maxLinesTitle,this.max_lines_subtitle=e.maxLinesSubtitle,this.disable_endpoint=!!e.disableEndpoint}},Xm=class extends p{static type=`MenuCustomIconItem`;action_text;command;constructor(e){super(),this.action_text=new Text(e.actionText),`command`in e&&(this.command=new B(e.command))}},Zm=class extends z{static type=`MenuNavigationItem`;constructor(e){super(e)}},Qm=class extends p{static type=`MenuPopup`;items;constructor(e){super(),this.items=Y(e.items,[Zm,Sc,Xm])}},$m=class extends p{static type=`Notification`;thumbnails;video_thumbnails;short_message;sent_time;notification_id;endpoint;record_click_endpoint;menu;read;constructor(e){super(),this.thumbnails=V.fromResponse(e.thumbnail),this.video_thumbnails=V.fromResponse(e.videoThumbnail),this.short_message=new H(e.shortMessage),this.sent_time=new H(e.sentTimeText),this.notification_id=e.notificationId,this.endpoint=new B(e.navigationEndpoint),this.record_click_endpoint=new B(e.recordClickEndpoint),this.menu=J(e.contextualMenu),this.read=e.read}},eh=class extends p{static type=`MultiPageMenuNotificationSection`;notification_section_title;items;constructor(e){super(),`notificationSectionTitle`in e&&(this.notification_section_title=new H(e.notificationSectionTitle)),this.items=Y(e.items,[$m,bd,G])}get contents(){return this.items}},th=class extends p{static type=`MusicMenuItemDivider`;constructor(e){super()}},nh=class extends p{static type=`MusicMultiSelectMenuItem`;title;form_item_entity_key;selected_icon_type;endpoint;selected;constructor(e){super(),this.title=new H(e.title).toString(),this.form_item_entity_key=e.formItemEntityKey,Reflect.has(e,`selectedIcon`)&&(this.selected_icon_type=e.selectedIcon.iconType),Reflect.has(e,`selectedCommand`)&&(this.endpoint=new B(e.selectedCommand)),this.selected=!!this.endpoint}},rh=class extends p{static type=`MusicMultiSelectMenu`;title;options;constructor(e){super(),Reflect.has(e,`title`)&&Reflect.has(e.title,`musicMenuTitleRenderer`)&&(this.title=new H(e.title.musicMenuTitleRenderer?.primaryText)),this.options=Y(e.options,[nh,th])}},ih=class extends p{static type=`SimpleMenuHeader`;title;buttons;constructor(e){super(),this.title=new H(e.title),this.buttons=Y(e.buttons,z)}},ah=class extends p{static type=`MerchandiseItem`;title;description;thumbnails;price;vendor_name;button_text;button_accessibility_text;from_vendor_text;additional_fees_text;region_format;endpoint;constructor(e){super(),this.title=e.title,this.description=e.description,this.thumbnails=V.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.button_text=e.buttonText,this.button_accessibility_text=e.buttonAccessibilityText,this.from_vendor_text=e.fromVendorText,this.additional_fees_text=e.additionalFeesText,this.region_format=e.regionFormat,this.endpoint=new B(e.buttonCommand)}},oh=class extends p{static type=`MetadataRow`;title;contents;constructor(e){super(),this.title=new H(e.title),this.contents=e.contents.map(e=>new H(e))}},sh=class extends p{static type=`MetadataRowContainer`;rows;collapsed_item_count;constructor(e){super(),this.rows=Y(e.rows),this.collapsed_item_count=e.collapsedItemCount}},ch=class extends p{static type=`MetadataRowHeader`;content;has_divider_line;constructor(e){super(),this.content=new H(e.content),this.has_divider_line=e.hasDividerLine}},lh=class extends p{static type=`MetadataScreen`;section_list;constructor(e){super(),this.section_list=J(e)}},uh=class extends p{static type=`MicroformatData`;url_canonical;title;description;thumbnail;site_name;app_name;android_package;ios_app_store_id;ios_app_arguments;og_type;url_applinks_web;url_applinks_ios;url_applinks_android;url_twitter_ios;url_twitter_android;twitter_card_type;twitter_site_handle;schema_dot_org_type;noindex;is_unlisted;is_family_safe;tags;available_countries;constructor(e){super(),this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=V.fromResponse(e.thumbnail),this.site_name=e.siteName,this.app_name=e.appName,this.android_package=e.androidPackage,this.ios_app_store_id=e.iosAppStoreId,this.ios_app_arguments=e.iosAppArguments,this.og_type=e.ogType,this.url_applinks_web=e.urlApplinksWeb,this.url_applinks_ios=e.urlApplinksIos,this.url_applinks_android=e.urlApplinksAndroid,this.url_twitter_ios=e.urlTwitterIos,this.url_twitter_android=e.urlTwitterAndroid,this.twitter_card_type=e.twitterCardType,this.twitter_site_handle=e.twitterSiteHandle,this.schema_dot_org_type=e.schemaDotOrgType,this.noindex=e.noindex,this.is_unlisted=e.unlisted,this.is_family_safe=e.familySafe,this.tags=e.tags,this.available_countries=e.availableCountries}},dh=class extends dd{static type=`Mix`;constructor(e){super(e)}},fh=class extends p{static type=`ModalWithTitleAndButton`;title;content;button;constructor(e){super(),this.title=new H(e.title),this.content=new H(e.content),this.button=J(e.button,z)}},ph=class extends p{static type=`Movie`;id;title;description_snippet;top_metadata_items;thumbnails;thumbnail_overlays;author;duration;endpoint;badges;use_vertical_poster;show_action_menu;menu;constructor(e){super();let t=e.thumbnailOverlays.find(e=>e.thumbnailOverlayTimeStatusRenderer)?.thumbnailOverlayTimeStatusRenderer.text||`N/A`;this.id=e.videoId,this.title=new H(e.title),Reflect.has(e,`descriptionSnippet`)&&(this.description_snippet=new H(e.descriptionSnippet)),this.top_metadata_items=new H(e.topMetadataItems),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.author=new X(e.longBylineText,e.ownerBadges,e.channelThumbnailSupportedRenderers?.channelThumbnailWithLinkRenderer?.thumbnail),this.duration={text:e.lengthText?new H(e.lengthText).toString():new H(t).toString(),seconds:ex(e.lengthText?new H(e.lengthText).toString():new H(t).toString())},this.endpoint=new B(e.navigationEndpoint),this.badges=Y(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=J(e.menu,W)}},mh=class extends p{static type=`MovingThumbnail`;constructor(e){return super(),e.movingThumbnailDetails?.thumbnails.map(e=>new V(e)).sort((e,t)=>t.width-e.width)}},hh=class extends p{static type=`MusicCardShelfHeaderBasic`;title;constructor(e){super(),this.title=new H(e.title)}},gh=class extends p{static type=`MusicInlineBadge`;icon_type;accessibility;constructor(e){super(),this.icon_type=e.icon.iconType,`accessibilityData`in e&&`accessibilityData`in e.accessibilityData&&(this.accessibility={accessibility_data:new y(e.accessibilityData.accessibilityData)})}get label(){return this.accessibility?.accessibility_data?.label}},_h=class extends p{static type=`MusicPlayButton`;endpoint;play_icon_type;pause_icon_type;icon_color;accessibility_play_data;accessibility_pause_data;constructor(e){super(),this.endpoint=new B(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,`accessibilityPlayData`in e&&`accessibilityData`in e.accessibilityPlayData&&(this.accessibility_play_data={accessibility_data:new y(e.accessibilityPlayData.accessibilityData)}),`accessibilityPauseData`in e&&`accessibilityData`in e.accessibilityPauseData&&(this.accessibility_pause_data={accessibility_data:new y(e.accessibilityPauseData.accessibilityData)}),this.icon_color=e.iconColor}get play_label(){return this.accessibility_play_data?.accessibility_data?.label}get pause_label(){return this.accessibility_pause_data?.accessibility_data?.label}},vh=class extends p{static type=`MusicItemThumbnailOverlay`;content;content_position;display_style;constructor(e){super(),this.content=J(e.content,_h),this.content_position=e.contentPosition,this.display_style=e.displayStyle}},yh=class extends p{static type=`MusicThumbnail`;contents;constructor(e){super(),this.contents=V.fromResponse(e.thumbnail)}},bh=class extends p{static type=`MusicCardShelf`;thumbnail;title;subtitle;buttons;menu;on_tap;header;end_icon_type;subtitle_badges;thumbnail_overlay;contents;constructor(e){super(),this.thumbnail=J(e.thumbnail,yh),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.buttons=Y(e.buttons,z),this.menu=J(e.menu,W),this.on_tap=new B(e.onTap),this.header=J(e.header,hh),Reflect.has(e,`endIcon`)&&Reflect.has(e.endIcon,`iconType`)&&(this.end_icon_type=e.endIcon.iconType),this.subtitle_badges=Y(e.subtitleBadges,gh),this.thumbnail_overlay=J(e.thumbnailOverlay,vh),Reflect.has(e,`contents`)&&(this.contents=Y(e.contents))}},xh=class extends p{static type=`MusicCarouselShelfBasicHeader`;title;strapline;thumbnail;more_content;end_icons;constructor(e){super(),this.title=new H(e.title),Reflect.has(e,`strapline`)&&(this.strapline=new H(e.strapline)),Reflect.has(e,`thumbnail`)&&(this.thumbnail=J(e.thumbnail,yh)),Reflect.has(e,`moreContentButton`)&&(this.more_content=J(e.moreContentButton,z)),Reflect.has(e,`endIcons`)&&(this.end_icons=Y(e.endIcons,Np))}},Sh=class extends p{static type=`MusicMultiRowListItem`;thumbnail;overlay;on_tap;menu;subtitle;title;second_title;description;display_style;constructor(e){super(),this.thumbnail=J(e.thumbnail,yh),this.overlay=J(e.overlay,vh),this.on_tap=new B(e.onTap),this.menu=J(e.menu,W),this.subtitle=new H(e.subtitle),this.title=new H(e.title),Reflect.has(e,`secondTitle`)&&(this.second_title=new H(e.secondTitle)),Reflect.has(e,`description`)&&(this.description=new H(e.description)),Reflect.has(e,`displayStyle`)&&(this.display_style=e.displayStyle)}},Ch=class extends p{static type=`MusicNavigationButton`;button_text;endpoint;constructor(e){super(),this.button_text=new H(e.buttonText).toString(),this.endpoint=new B(e.clickCommand)}},wh=class extends p{static type=`musicResponsiveListItemFlexColumnRenderer`;title;display_priority;constructor(e){super(),this.title=new H(e.text),this.display_priority=e.displayPriority}},Th=class extends p{static type=`MusicResponsiveListItemFlexColumn`;title;display_priority;constructor(e){super(),this.title=new H(e.text),this.display_priority=e.displayPriority}},Eh=/^\d+(?::[0-5]\d)+$/;function Dh(e){return e?.findLast(e=>Eh.test(e.text))?.text}var Oh=class extends p{static type=`MusicResponsiveListItem`;flex_columns;fixed_columns;endpoint;item_type;index;thumbnail;badges;menu;overlay;id;title;duration;album;artists;views;authors;name;subtitle;subscribers;song_count;author;item_count;year;constructor(e){super(),this.flex_columns=Y(e.flexColumns,Th),this.fixed_columns=Y(e.fixedColumns,wh);let t={video_id:e?.playlistItemData?.videoId||null,playlist_set_video_id:e?.playlistItemData?.playlistSetVideoId||null};`navigationEndpoint`in e&&(this.endpoint=new B(e.navigationEndpoint));let n=this.endpoint?.payload?.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType;switch(n||this.flex_columns.find(e=>e.title.endpoint?.payload?.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType===`MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE`)&&(n=`MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE`),n){case`MUSIC_PAGE_TYPE_ALBUM`:this.item_type=`album`,this.#c();break;case`MUSIC_PAGE_TYPE_PLAYLIST`:this.item_type=`playlist`,this.#l();break;case`MUSIC_PAGE_TYPE_ARTIST`:case`MUSIC_PAGE_TYPE_USER_CHANNEL`:this.item_type=`artist`,this.#i();break;case`MUSIC_PAGE_TYPE_LIBRARY_ARTIST`:this.item_type=`library_artist`,this.#a();break;case`MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE`:this.item_type=`non_music_track`,this.#o(t);break;case`MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE`:this.item_type=`podcast_show`,this.#s();break;default:this.flex_columns[1]?this.#t(t):this.#e()}`index`in e&&(this.index=new H(e.index)),`thumbnail`in e&&(this.thumbnail=J(e.thumbnail,yh)),`badges`in e&&(this.badges=Y(e.badges)),`menu`in e&&(this.menu=J(e.menu,W)),`overlay`in e&&(this.overlay=J(e.overlay,vh))}#e(){this.title=this.flex_columns[0].title.toString(),this.item_type=this.endpoint?`endpoint`:`unknown`}#t(e){switch(this.flex_columns.at(0)?.title.runs?.at(0)?.endpoint?.payload?.watchEndpointMusicSupportedConfigs?.watchEndpointMusicConfig?.musicVideoType){case`MUSIC_VIDEO_TYPE_UGC`:case`MUSIC_VIDEO_TYPE_OMV`:this.item_type=`video`,this.#r(e);break;case`MUSIC_VIDEO_TYPE_ATV`:this.item_type=`song`,this.#n(e);break;default:this.#e()}}#n(e){this.id=e.video_id||this.endpoint?.payload?.videoId,this.title=this.flex_columns[0].title.toString();let t=Dh(this.flex_columns.at(1)?.title.runs)||this.fixed_columns[0]?.title?.toString();t&&(this.duration={text:t,seconds:ex(t)});let n=this.flex_columns.at(1)?.title.runs?.find(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`MPR`))||this.flex_columns.at(2)?.title.runs?.find(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`MPR`));n&&ax(n)&&(this.album={id:n.endpoint?.payload?.browseId,name:n.text,endpoint:n.endpoint});let r=this.flex_columns.at(1)?.title.runs?.filter(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`UC`));r&&(this.artists=r.map(e=>({name:e.text,channel_id:ax(e)?e.endpoint?.payload?.browseId:void 0,endpoint:ax(e)?e.endpoint:void 0})))}#r(e){this.id=e.video_id,this.title=this.flex_columns[0].title.toString(),this.views=this.flex_columns.at(1)?.title.runs?.find(e=>e.text.match(/(.*?) views/))?.toString();let t=this.flex_columns.at(1)?.title.runs?.filter(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`UC`));t&&(this.authors=t.map(e=>({name:e.text,channel_id:ax(e)?e.endpoint?.payload?.browseId:void 0,endpoint:ax(e)?e.endpoint:void 0})));let n=Dh(this.flex_columns[1].title.runs)||Dh(this.fixed_columns[0]?.title.runs);n&&(this.duration={text:n,seconds:ex(n)})}#i(){this.id=this.endpoint?.payload?.browseId,this.name=this.flex_columns[0].title.toString(),this.subtitle=this.flex_columns.at(1)?.title,this.subscribers=this.subtitle?.runs?.find(e=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(e.text))?.text||``}#a(){this.name=this.flex_columns[0].title.toString(),this.subtitle=this.flex_columns.at(1)?.title,this.song_count=this.subtitle?.runs?.find(e=>/^\d+(,\d+)? songs?$/i.test(e.text))?.text||``}#o(e){this.id=e.video_id||this.endpoint?.payload?.videoId,this.title=this.flex_columns[0].title.toString()}#s(){this.id=this.endpoint?.payload?.browseId,this.title=this.flex_columns[0].title.toString()}#c(){this.id=this.endpoint?.payload?.browseId,this.title=this.flex_columns[0].title.toString();let e=this.flex_columns.at(1)?.title.runs?.find(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`UC`));e&&ax(e)&&(this.author={name:e.text,channel_id:e.endpoint?.payload?.browseId,endpoint:e.endpoint}),this.year=this.flex_columns.at(1)?.title.runs?.find(e=>/^[12][0-9]{3}$/.test(e.text))?.text}#l(){this.id=this.endpoint?.payload?.browseId,this.title=this.flex_columns[0].title.toString();let e=this.flex_columns.at(1)?.title.runs?.find(e=>e.text.match(/\d+ (song|songs)/));this.item_count=e?e.text:void 0;let t=this.flex_columns.at(1)?.title.runs?.find(e=>ax(e)&&e.endpoint&&e.endpoint.payload.browseId.startsWith(`UC`));t&&ax(t)&&(this.author={name:t.text,channel_id:t.endpoint?.payload?.browseId,endpoint:t.endpoint})}get thumbnails(){return this.thumbnail?.contents||[]}},kh=class extends p{static type=`MusicTwoRowItem`;title;endpoint;id;subtitle;badges;item_type;subscribers;item_count;year;views;artists;author;thumbnail;thumbnail_overlay;menu;constructor(e){switch(super(),this.title=new H(e.title),this.endpoint=new B(e.navigationEndpoint),this.id=this.endpoint?.payload?.browseId||this.endpoint?.payload?.videoId,this.subtitle=new H(e.subtitle),this.badges=zy(e.subtitleBadges),this.endpoint?.payload?.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType){case`MUSIC_PAGE_TYPE_ARTIST`:this.item_type=`artist`;break;case`MUSIC_PAGE_TYPE_PLAYLIST`:this.item_type=`playlist`;break;case`MUSIC_PAGE_TYPE_ALBUM`:this.item_type=`album`;break;default:this.item_type=this.endpoint?.metadata?.api_url===`/next`?`endpoint`:this.subtitle.runs?.[0]?this.subtitle.runs[0].text===`Song`?`song`:`video`:this.endpoint?`endpoint`:`unknown`}if(this.item_type==`artist`)this.subscribers=this.subtitle.runs?.find(e=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(e.text))?.text||``;else if(this.item_type==`playlist`){let e=this.subtitle.runs?.find(e=>e.text.match(/\d+ songs|song/));this.item_count=e?e.text:null}else if(this.item_type==`album`){let e=this.subtitle.runs?.filter(e=>e.endpoint?.payload?.browseId.startsWith(`UC`));e&&(this.artists=e.map(e=>({name:e.text,channel_id:e.endpoint?.payload?.browseId,endpoint:e.endpoint}))),this.year=this.subtitle.runs?.slice(-1)[0].text,isNaN(Number(this.year))&&delete this.year}else if(this.item_type==`video`){this.views=this?.subtitle.runs?.find(e=>e?.text.match(/(.*?) views/))?.text||`N/A`;let e=this.subtitle.runs?.find(e=>e.endpoint?.payload?.browseId?.startsWith(`UC`));e&&(this.author={name:e?.text,channel_id:e?.endpoint?.payload?.browseId,endpoint:e?.endpoint})}else if(this.item_type==`song`){let e=this.subtitle.runs?.filter(e=>e.endpoint?.payload?.browseId.startsWith(`UC`));e&&(this.artists=e.map(e=>({name:e?.text,channel_id:e?.endpoint?.payload?.browseId,endpoint:e?.endpoint})))}this.thumbnail=V.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=J(e.thumbnailOverlay,vh),this.menu=J(e.menu,W)}},Ah=class extends p{static type=`MusicCarouselShelf`;header;contents;num_items_per_column;constructor(e){super(),this.header=J(e.header,xh),this.contents=Y(e.contents,[kh,Oh,Sh,Ch]),Reflect.has(e,`numItemsPerColumn`)&&(this.num_items_per_column=parseInt(e.numItemsPerColumn))}},jh=class extends p{static type=`MusicDescriptionShelf`;description;max_collapsed_lines;max_expanded_lines;footer;constructor(e){super(),this.description=new H(e.description),Reflect.has(e,`maxCollapsedLines`)&&(this.max_collapsed_lines=e.maxCollapsedLines),Reflect.has(e,`maxExpandedLines`)&&(this.max_expanded_lines=e.maxExpandedLines),this.footer=new H(e.footer)}},Mh=class extends p{static type=`MusicDetailHeader`;title;description;subtitle;second_subtitle;year;song_count;total_duration;thumbnails;badges;author;menu;constructor(e){super(),this.title=new H(e.title),this.description=new H(e.description),this.subtitle=new H(e.subtitle),this.second_subtitle=new H(e.secondSubtitle),this.year=this.subtitle.runs?.find(e=>/^[12][0-9]{3}$/.test(e.text))?.text||``,this.song_count=this.second_subtitle.runs?.[0]?.text||``,this.total_duration=this.second_subtitle.runs?.[2]?.text||``,this.thumbnails=V.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=Y(e.subtitleBadges);let t=this.subtitle.runs?.find(e=>e?.endpoint?.payload?.browseId.startsWith(`UC`));t&&(this.author={name:t.text,channel_id:t.endpoint?.payload?.browseId,endpoint:t.endpoint}),this.menu=J(e.menu)}},Nh=class extends p{static type=`MusicDownloadStateBadge`;playlist_id;supported_download_states;constructor(e){super(),this.playlist_id=e.playlistId,this.supported_download_states=e.supportedDownloadStates}},Ph=class extends p{static type=`MusicEditablePlaylistDetailHeader`;header;edit_header;playlist_id;constructor(e){super(),this.header=J(e.header),this.edit_header=J(e.editHeader),this.playlist_id=e.playlistId}},Fh=class extends p{static type=`MusicElementHeader`;element;constructor(e){super(),this.element=Reflect.has(e,`elementRenderer`)?J(e,qd):null}},Ih=class extends p{static type=`MusicHeader`;header;title;constructor(e){super(),Reflect.has(e,`header`)&&(this.header=J(e.header)),Reflect.has(e,`title`)&&(this.title=new H(e.title))}},Lh=class extends p{static type=`MusicImmersiveHeader`;title;menu;more_button;play_button;share_endpoint;start_radio_button;subscription_button;description;thumbnail;constructor(e){super(),this.title=new H(e.title),this.menu=J(e.menu,W),this.more_button=J(e.moreButton,hc),this.play_button=J(e.playButton,z),`shareEndpoint`in e&&(this.share_endpoint=new B(e.shareEndpoint)),this.start_radio_button=J(e.startRadioButton,z),this.subscription_button=J(e.subscriptionButton,tu),this.description=new H(e.description),this.thumbnail=J(e.thumbnail,yh)}},Rh=class{static type=`ActionButton`;icon_name;endpoint;a11y_text;style;constructor(e){this.icon_name=e.iconName,this.endpoint=new B(e.onTap),this.a11y_text=e.a11yText,this.style=e.style}},zh=class{static type=`Panel`;image;content_mode;crop_options;image_aspect_ratio;caption;action_buttons;constructor(e){this.image=V.fromResponse(e.image.image),this.content_mode=e.image.contentMode,this.crop_options=e.image.cropOptions,this.image_aspect_ratio=e.imageAspectRatio,this.caption=e.caption,this.action_buttons=e.actionButtons.map(e=>new Rh(e))}},Bh=class extends p{static type=`MusicLargeCardItemCarousel`;panels;header;constructor(e){super(),this.header=e.shelf.header,this.panels=e.shelf.panels.map(e=>new zh(e))}},Vh=class extends p{static type=`MusicPlaylistEditHeader`;title;edit_title;edit_description;privacy;playlist_id;endpoint;privacy_dropdown;constructor(e){super(),this.title=new H(e.title),this.edit_title=new H(e.editTitle),this.edit_description=new H(e.editDescription),this.privacy=e.privacy,this.playlist_id=e.playlistId,this.endpoint=new B(e.collaborationSettingsCommand),this.privacy_dropdown=J(e.privacyDropdown,_s)}},Hh=class extends p{static type=`MusicPlaylistShelf`;playlist_id;contents;collapsed_item_count;continuation;constructor(e){super(),this.playlist_id=e.playlistId,this.contents=Y(e.contents,[Oh,G]),this.collapsed_item_count=e.collapsedItemCount,this.continuation=e.continuations?.[0]?.nextContinuationData?.continuation||null}},Uh=class extends p{static type=`PlaylistPanelVideo`;title;thumbnail;endpoint;selected;video_id;duration;author;album;artists;badges;menu;set_video_id;constructor(e){super(),this.title=new H(e.title),this.thumbnail=V.fromResponse(e.thumbnail),this.endpoint=new B(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new H(e.lengthText).toString(),seconds:ex(new H(e.lengthText).toString())};let t=new H(e.longBylineText).runs?.find(e=>e.endpoint?.payload?.browseId?.startsWith(`MPR`)),n=new H(e.longBylineText).runs?.filter(e=>e.endpoint?.payload?.browseId?.startsWith(`UC`));this.author=new H(e.shortBylineText).toString(),t&&(this.album={id:t.endpoint?.payload?.browseId,name:t.text,year:new H(e.longBylineText).runs?.slice(-1)[0].text,endpoint:t.endpoint}),n&&(this.artists=n.map(e=>({name:e.text,channel_id:e.endpoint?.payload?.browseId,endpoint:e.endpoint}))),this.badges=Y(e.badges),this.menu=J(e.menu),this.set_video_id=e.playlistSetVideoId}},Wh=class extends p{static type=`PlaylistPanelVideoWrapper`;primary;counterpart;constructor(e){super(),this.primary=J(e.primaryRenderer,Uh),Reflect.has(e,`counterpart`)&&(this.counterpart=_(e.counterpart.map(e=>J(e.counterpartRenderer,Uh))||[]))}},Gh=class extends p{static type=`PlaylistPanel`;title;title_text;contents;playlist_id;is_infinite;continuation;is_editable;preview_description;num_items_to_show;constructor(e){super(),this.title=e.title,this.title_text=new H(e.titleText),this.contents=Y(e.contents,[Wh,Uh,cc]),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=e.continuations?.[0]?.nextRadioContinuationData?.continuation||e.continuations?.[0]?.nextContinuationData?.continuation,this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}},Kh=class extends p{static type=`MusicQueue`;content;constructor(e){super(),this.content=J(e.content,Gh)}},qh=class extends p{static type=`MusicResponsiveHeader`;thumbnail;buttons;title;subtitle;strapline_text_one;strapline_thumbnail;second_subtitle;subtitle_badge;description;constructor(e){super(),this.thumbnail=J(e.thumbnail,yh),this.buttons=Y(e.buttons,[Cc,hc,_h,z,W]),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.strapline_text_one=new H(e.straplineTextOne),this.strapline_thumbnail=J(e.straplineThumbnail,yh),this.second_subtitle=new H(e.secondSubtitle),Reflect.has(e,`subtitleBadge`)&&(this.subtitle_badge=Y(e.subtitleBadge,gh)),Reflect.has(e,`description`)&&(this.description=J(e.description,jh))}},Jh=class extends p{static type=`MusicShelf`;title;contents;endpoint;continuation;bottom_text;bottom_button;subheaders;constructor(e){super(),this.title=new H(e.title),this.contents=Y(e.contents,Oh),Reflect.has(e,`bottomEndpoint`)&&(this.endpoint=new B(e.bottomEndpoint)),Reflect.has(e,`continuations`)&&(this.continuation=e.continuations?.[0].nextContinuationData?.continuation||e.continuations?.[0].reloadContinuationData?.continuation),Reflect.has(e,`bottomText`)&&(this.bottom_text=new H(e.bottomText)),Reflect.has(e,`bottomButton`)&&(this.bottom_button=J(e.bottomButton,z)),Reflect.has(e,`subheaders`)&&(this.subheaders=Y(e.subheaders))}},Yh=class extends p{static type=`MusicSideAlignedItem`;start_items;end_items;constructor(e){super(),Reflect.has(e,`startItems`)&&(this.start_items=Y(e.startItems)),Reflect.has(e,`endItems`)&&(this.end_items=Y(e.endItems))}},Xh=class extends p{static type=`MusicSortFilterButton`;title;icon_type;menu;constructor(e){super(),this.title=new H(e.title).toString(),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),this.menu=J(e.menu,rh)}},Zh=class extends p{static type=`MusicTastebuilderShelfThumbnail`;thumbnail;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail)}},Qh=class extends p{static type=`MusicTasteBuilderShelf`;thumbnail;primary_text;secondary_text;action_button;is_visible;constructor(e){super(),this.thumbnail=J(e.thumbnail,Zh),this.primary_text=new H(e.primaryText),this.secondary_text=new H(e.secondaryText),this.action_button=J(e.actionButton,z),this.is_visible=e.isVisible}},$h=class extends p{static type=`MusicVisualHeader`;title;thumbnail;menu;foreground_thumbnail;constructor(e){super(),this.title=new H(e.title),this.thumbnail=e.thumbnail?V.fromResponse(e.thumbnail.musicThumbnailRenderer?.thumbnail):[],this.menu=J(e.menu,W),this.foreground_thumbnail=e.foregroundThumbnail?V.fromResponse(e.foregroundThumbnail.musicThumbnailRenderer?.thumbnail):[]}},eg=class extends p{static type=`MobileTopbar`;placeholder_text;buttons;logo_type;constructor(e){super(),this.placeholder_text=new H(e.placeholderText),this.buttons=Y(e.buttons),Reflect.has(e,`logo`)&&Reflect.has(e.logo,`iconType`)&&(this.logo_type=e.logo.iconType)}},tg=class extends p{static type=`MultiPageMenuSection`;items;constructor(e){super(),this.items=Y(e.items)}},ng=class extends p{static type=`PivotBar`;items;constructor(e){super(),this.items=Y(e.items)}},rg=class extends p{static type=`PivotBarItem`;pivot_identifier;endpoint;title;accessibility_label;icon_type;accessibility;constructor(e){super(),this.pivot_identifier=e.pivotIdentifier,this.endpoint=new B(e.navigationEndpoint),this.title=new Text(e.title),`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)}),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType)}get label(){return this.accessibility?.accessibility_data?.label}},ig=class extends p{static type=`TopbarMenuButton`;icon_type;menu_renderer;target_id;constructor(e){super(),Reflect.has(e,`icon`)&&Reflect.has(e.icon,`iconType`)&&(this.icon_type=e.icon.iconType),this.menu_renderer=J(e.menuRenderer),this.target_id=e.targetId}},ag=class extends p{static type=`NotificationAction`;response_text;constructor(e){super(),this.response_text=new H(e.responseText)}},og=class extends p{static type=`PageHeaderView`;title;image;animated_image;hero_image;metadata;actions;description;attributation;banner;constructor(e){super(),this.title=J(e.title,Gd),this.image=J(e.image,[ml,Ed]),this.animated_image=J(e.animatedImage,ml),this.hero_image=J(e.heroImage,ml),this.metadata=J(e.metadata,vd),this.actions=J(e.actions,kc),this.description=J(e.description,Pd),this.attributation=J(e.attributation,oc),this.banner=J(e.banner,Pp)}},sg=class extends p{static type=`OfficialCardView`;header;contents;constructor(e){super(),this.header=J(e.header,og),this.contents=Y(e.contents)}},cg=class extends p{static type=`OpenOnePickAddVideoModalCommand`;list_id;modal_title;select_button_label;constructor(e){super(),this.list_id=e.listId,this.modal_title=e.modalTitle,this.select_button_label=e.selectButtonLabel}},lg=class extends p{static type=`PageHeader`;page_title;content;constructor(e){super(),this.page_title=e.pageTitle,this.content=J(e.content,og)}},ug=class extends p{static type=`PageIndicatorView`;indicator_count;selected_index;constructor(e){super(),this.indicator_count=e.indicatorCount??0,this.selected_index=e.selectedIndex??0}},dg=class extends p{static type=`PageIntroduction`;header_text;body_text;page_title;header_icon_type;constructor(e){super(),this.header_text=new H(e.headerText).toString(),this.body_text=new H(e.bodyText).toString(),this.page_title=new H(e.pageTitle).toString(),this.header_icon_type=e.headerIcon.iconType}},fg=class extends p{static type=`PivotButton`;thumbnail;endpoint;content_description;target_id;sound_attribution_title;waveform_animation_style;background_animation_style;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail),this.endpoint=new B(e.onClickCommand),this.content_description=new H(e.contentDescription),this.target_id=e.targetId,this.sound_attribution_title=new H(e.soundAttributionTitle),this.waveform_animation_style=e.waveformAnimationStyle,this.background_animation_style=e.backgroundAnimationStyle}},pg=class extends p{static type=`PlayerAnnotationsExpanded`;featured_channel;allow_swipe_dismiss;annotation_id;constructor(e){super(),Reflect.has(e,`featuredChannel`)&&(this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:V.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new B(e.featuredChannel.navigationEndpoint),subscribe_button:J(e.featuredChannel.subscribeButton)}),this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}},mg=class extends p{static type=`PlayerCaptchaView`;captcha_loading_message;challenge_reason;captcha_successful_message;captcha_cookie_set_failure_message;captcha_failed_message;constructor(e){super(),`captchaLoadingMessage`in e&&(this.captcha_loading_message=H.fromAttributed(e.captchaLoadingMessage)),`challengeReason`in e&&(this.challenge_reason=H.fromAttributed(e.challengeReason)),`captchaSuccessfulMessage`in e&&(this.captcha_successful_message=H.fromAttributed(e.captchaSuccessfulMessage)),`captchaCookieSetFailureMessage`in e&&(this.captcha_cookie_set_failure_message=H.fromAttributed(e.captchaCookieSetFailureMessage)),`captchaFailedMessage`in e&&(this.captcha_failed_message=H.fromAttributed(e.captchaFailedMessage))}},hg=class extends p{static type=`PlayerCaptionsTracklist`;caption_tracks;audio_tracks;default_audio_track_index;translation_languages;constructor(e){super(),Reflect.has(e,`captionTracks`)&&(this.caption_tracks=e.captionTracks.map(e=>({base_url:e.baseUrl,name:new H(e.name),vss_id:e.vssId,language_code:e.languageCode,kind:e.kind,is_translatable:e.isTranslatable}))),Reflect.has(e,`audioTracks`)&&(this.audio_tracks=e.audioTracks.map(e=>({audio_track_id:e.audioTrackId,captions_initial_state:e.captionsInitialState,default_caption_track_index:e.defaultCaptionTrackIndex,has_default_track:e.hasDefaultTrack,visibility:e.visibility,caption_track_indices:e.captionTrackIndices}))),Reflect.has(e,`defaultAudioTrackIndex`)&&(this.default_audio_track_index=e.defaultAudioTrackIndex),Reflect.has(e,`translationLanguages`)&&(this.translation_languages=e.translationLanguages.map(e=>({language_code:e.languageCode,language_name:new H(e.languageName)})))}},gg=class extends p{static type=`PlayerOverflow`;endpoint;enable_listen_first;constructor(e){super(),this.endpoint=new B(e.endpoint),this.enable_listen_first=e.enableListenFirst}},_g=class extends p{static type=`PlayerControlsOverlay`;overflow;constructor(e){super(),this.overflow=J(e.overflow,gg)}},vg=class extends p{static type=`PlayerErrorMessage`;subreason;reason;proceed_button;thumbnails;icon_type;constructor(e){super(),this.subreason=new H(e.subreason),this.reason=new H(e.reason),this.proceed_button=J(e.proceedButton,z),this.thumbnails=V.fromResponse(e.thumbnail),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType)}},yg=class extends p{static type=`PlayerInterstitial`;content;state_entity_store_key;constructor(e){super(),this.content=J(e.content,zp),`stateEntityStoreKey`in e&&(this.state_entity_store_key=e.stateEntityStoreKey)}},bg=class extends p{static type=`PlayerLegacyDesktopYpcOffer`;title;thumbnail;offer_description;offer_id;constructor(e){super(),this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_description=e.offerDescription,this.offer_id=e.offerId}},xg=class extends p{static type=`YpcTrailer`;video_message;player_response;constructor(e){super(),this.video_message=e.fullVideoMessage,this.player_response=e.unserializedPlayerResponse}},Sg=class extends p{static type=`PlayerLegacyDesktopYpcTrailer`;video_id;title;thumbnail;offer_headline;offer_description;offer_id;offer_button_text;video_message;trailer;constructor(e){super(),this.video_id=e.trailerVideoId,this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_headline=e.offerHeadline,this.offer_description=e.offerDescription,this.offer_id=e.offerId,this.offer_button_text=e.offerButtonText,this.video_message=e.fullVideoMessage,this.trailer=J(e.ypcTrailer,xg)}},Cg=class extends p{static type=`PlayerLiveStoryboardSpec`;board;constructor(e){super();let[t,n,r,i,a]=e.spec.split(`#`);this.board={type:`live`,template_url:t,thumbnail_width:parseInt(n,10),thumbnail_height:parseInt(r,10),columns:parseInt(i,10),rows:parseInt(a,10)}}},wg=class extends p{static type=`PlayerMicroformat`;title;description;thumbnails;embed;length_seconds;channel;is_family_safe;is_unlisted;has_ypc_metadata;view_count;category;publish_date;upload_date;available_countries;start_timestamp;end_timestamp;constructor(e){super(),this.title=new H(e.title),this.description=new H(e.description),this.thumbnails=V.fromResponse(e.thumbnail),Reflect.has(e,`embed`)&&(this.embed={iframe_url:e.embed.iframeUrl,flash_url:e.embed.flashUrl,flash_secure_url:e.embed.flashSecureUrl,width:e.embed.width,height:e.embed.height}),this.length_seconds=parseInt(e.lengthSeconds),this.channel={id:e.externalChannelId,name:e.ownerChannelName,url:e.ownerProfileUrl},this.is_family_safe=!!e.isFamilySafe,this.is_unlisted=!!e.isUnlisted,this.has_ypc_metadata=!!e.hasYpcMetadata,this.view_count=parseInt(e.viewCount),this.category=e.category,this.publish_date=e.publishDate,this.upload_date=e.uploadDate,this.available_countries=e.availableCountries,this.start_timestamp=e.liveBroadcastDetails?.startTimestamp?new Date(e.liveBroadcastDetails.startTimestamp):null,this.end_timestamp=e.liveBroadcastDetails?.endTimestamp?new Date(e.liveBroadcastDetails.endTimestamp):null}},Tg=class extends p{static type=`PlayerOverlayAutoplay`;title;video_id;video_title;short_view_count;prefer_immediate_redirect;count_down_secs_for_fullscreen;published;background;thumbnail_overlays;author;cancel_button;next_button;close_button;constructor(e){super(),this.title=new H(e.title),this.video_id=e.videoId,this.video_title=new H(e.videoTitle),this.short_view_count=new H(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new H(e.publishedTimeText),this.background=V.fromResponse(e.background),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.author=new X(e.byline),this.cancel_button=J(e.cancelButton,z),this.next_button=J(e.nextButton,z),this.close_button=J(e.closeButton,z)}},Eg=class extends p{static type=`PlayerOverlayVideoDetails`;title;subtitle;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle)}},Dg=class extends p{static type=`WatchNextEndScreen`;results;title;constructor(e){super(),this.results=Y(e.results,[Zf,Xf]),this.title=new H(e.title).toString()}},Og=class extends p{static type=`PlayerOverlay`;end_screen;autoplay;share_button;add_to_menu;fullscreen_engagement;actions;browser_media_session;decorated_player_bar;video_details;constructor(e){super(),this.end_screen=J(e.endScreen,Dg),this.autoplay=J(e.autoplay,Tg),this.share_button=J(e.shareButton,z),this.add_to_menu=J(e.addToMenu,W),this.fullscreen_engagement=J(e.fullscreenEngagement),this.actions=Y(e.actions),this.browser_media_session=J(e.browserMediaSession),this.decorated_player_bar=J(e.decoratedPlayerBarRenderer,Md),this.video_details=J(e.videoDetails,Eg)}},kg=class extends p{static type=`PlaylistHeader`;id;title;subtitle;stats;brief_stats;author;description;num_videos;view_count;can_share;can_delete;is_editable;privacy;save_button;shuffle_play_button;menu;banner;constructor(e){super(),this.id=e.playlistId,this.title=new H(e.title),this.subtitle=e.subtitle?new H(e.subtitle):null,this.stats=e.stats.map(e=>new H(e)),this.brief_stats=e.briefStats.map(e=>new H(e)),this.author=e.ownerText||e.ownerEndpoint?new X({...e.ownerText,navigationEndpoint:e.ownerEndpoint},e.ownerBadges,null):null,this.description=new H(e.descriptionText),this.num_videos=new H(e.numVideosText),this.view_count=new H(e.viewCountText),this.can_share=e.shareData.canShare,this.can_delete=e.editableDetails.canDelete,this.is_editable=e.isEditable,this.privacy=e.privacy,this.save_button=J(e.saveButton),this.shuffle_play_button=J(e.shufflePlayButton),this.menu=J(e.moreActionsMenu),this.banner=J(e.playlistHeaderBanner)}},Ag=class extends p{static type=`PlaylistInfoCardContent`;title;thumbnails;video_count;channel_name;endpoint;constructor(e){super(),this.title=new H(e.playlistTitle),this.thumbnails=V.fromResponse(e.thumbnail),this.video_count=new H(e.playlistVideoCount),this.channel_name=new H(e.channelName),this.endpoint=new B(e.action)}},jg=class extends p{static type=`PlaylistMetadata`;title;description;constructor(e){super(),this.title=e.title,this.description=e.description||null}},Mg=class extends p{static type=`PlaylistSidebar`;items;constructor(e){super(),this.items=Y(e.items)}get contents(){return this.items}},Ng=class extends p{static type=`PlaylistSidebarPrimaryInfo`;stats;thumbnail_renderer;title;menu;endpoint;description;constructor(e){super(),this.stats=e.stats.map(e=>new H(e)),this.thumbnail_renderer=J(e.thumbnailRenderer),this.title=new H(e.title),this.menu=J(e.menu),this.endpoint=new B(e.navigationEndpoint),this.description=new H(e.description)}},Pg=class extends p{static type=`PlaylistSidebarSecondaryInfo`;owner;button;constructor(e){super(),this.owner=J(e.videoOwner),this.button=J(e.button)}},Fg=class extends p{static type=`PlaylistThumbnailOverlay`;icon_type;text;constructor(e){super(),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),this.text=new H(e.text)}},Ig=class extends p{static type=`PlaylistVideo`;id;index;title;author;thumbnails;thumbnail_overlays;set_video_id;endpoint;is_playable;menu;upcoming;video_info;accessibility_label;style;duration;constructor(e){super(),this.id=e.videoId,this.index=new H(e.index),this.title=new H(e.title),this.author=new X(e.shortBylineText),this.thumbnails=V.fromResponse(e.thumbnail),this.thumbnail_overlays=Y(e.thumbnailOverlays),this.set_video_id=e?.setVideoId,this.endpoint=new B(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=J(e.menu,W),this.video_info=new H(e.videoInfo),this.accessibility_label=e.title.accessibility.accessibilityData.label,Reflect.has(e,`style`)&&(this.style=e.style);let t=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);t&&(this.upcoming=new Date(t)),this.duration={text:new H(e.lengthText).toString(),seconds:parseInt(e.lengthSeconds)}}get is_live(){return this.thumbnail_overlays.firstOfType(dl)?.style===`LIVE`}get is_upcoming(){return this.thumbnail_overlays.firstOfType(dl)?.style===`UPCOMING`}},Lg=class extends p{static type=`PlaylistVideoList`;id;is_editable;can_reorder;videos;constructor(e){super(),this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=Y(e.contents)}},Rg=class extends p{static type=`Poll`;choices;poll_type;total_votes;live_chat_poll_id;constructor(e){super(),this.choices=e.choices.map(e=>({text:new H(e.text),select_endpoint:e.selectServiceEndpoint?new B(e.selectServiceEndpoint):null,deselect_endpoint:e.deselectServiceEndpoint?new B(e.deselectServiceEndpoint):null,vote_ratio_if_selected:e?.voteRatioIfSelected||null,vote_percentage_if_selected:new H(e.votePercentageIfSelected),vote_ratio_if_not_selected:e?.voteRatioIfSelected||null,vote_percentage_if_not_selected:new H(e.votePercentageIfSelected),image:e.image?V.fromResponse(e.image):null})),Reflect.has(e,`type`)&&(this.poll_type=e.type),Reflect.has(e,`totalVotes`)&&(this.total_votes=new H(e.totalVotes)),Reflect.has(e,`liveChatPollId`)&&(this.live_chat_poll_id=e.liveChatPollId)}},zg=class extends Ac{static type=`Post`;constructor(e){super(e)}},Bg=class extends p{static type=`PostMultiImage`;images;constructor(e){super(),this.images=Y(e.images,mc)}},Vg=class extends p{static type=`PremiereTrailerBadge`;label;constructor(e){super(),this.label=new H(e.label)}},Hg=class extends p{static type=`ProductListHeader`;title;suppress_padding_disclaimer;constructor(e){super(),this.title=new H(e.title),this.suppress_padding_disclaimer=!!e.suppressPaddingDisclaimer}},Ug=class extends p{static type=`ProductListItem`;title;accessibility_title;thumbnail;price;endpoint;merchant_name;stay_in_app;view_button;constructor(e){super(),this.title=new H(e.title),this.accessibility_title=e.accessibilityTitle,this.thumbnail=V.fromResponse(e.thumbnail),this.price=e.price,this.endpoint=new B(e.onClickCommand),this.merchant_name=e.merchantName,this.stay_in_app=!!e.stayInApp,this.view_button=J(e.viewButton,z)}},Wg=class extends p{static type=`ProfileColumn`;items;constructor(e){super(),this.items=Y(e.items)}get contents(){return this.items}},Gg=class extends p{static type=`ProfileColumnStats`;items;constructor(e){super(),this.items=Y(e.items)}get contents(){return this.items}},Kg=class extends p{static type=`ProfileColumnStatsEntry`;label;value;constructor(e){super(),this.label=new H(e.label),this.value=new H(e.value)}},qg=class extends p{static type=`ProfileColumnUserInfo`;title;thumbnails;constructor(e){super(),this.title=new H(e.title),this.thumbnails=V.fromResponse(e.thumbnail)}},Jg=class extends p{static type=`Quiz`;choices;total_votes;constructor(e){super(),this.choices=e.choices.map(e=>({text:new H(e.text),is_correct:e.isCorrect})),this.total_votes=new H(e.totalVotes)}},Yg=class extends p{static type=`RecognitionShelf`;title;subtitle;avatars;button;surface;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.avatars=e.avatars.map(e=>new V(e)),this.button=J(e.button,z),this.surface=e.surface}},Xg=class extends p{static type=`ReelItem`;id;title;thumbnails;views;endpoint;accessibility;constructor(e){super(),this.id=e.videoId,this.title=new H(e.headline),this.thumbnails=V.fromResponse(e.thumbnail),this.views=new H(e.viewCountText),this.endpoint=new B(e.navigationEndpoint),`accessibility`in e&&`accessibilityData`in e.accessibility&&(this.accessibility={accessibility_data:new y(e.accessibility.accessibilityData)})}get label(){return this.accessibility?.accessibility_data?.label}},Zg=class extends p{static type=`ReelPlayerHeader`;reel_title_text;timestamp_text;channel_title_text;channel_thumbnail;author;constructor(e){super(),this.reel_title_text=new H(e.reelTitleText),this.timestamp_text=new H(e.timestampText),this.channel_title_text=new H(e.channelTitleText),this.channel_thumbnail=V.fromResponse(e.channelThumbnail),this.author=new X(e.channelNavigationEndpoint,void 0)}},Qg=class extends p{static type=`ReelPlayerOverlay`;like_button;reel_player_header_supported_renderers;menu;next_item_button;prev_item_button;subscribe_button_renderer;style;view_comments_button;share_button;pivot_button;info_panel;constructor(e){super(),this.like_button=J(e.likeButton,Oc),this.reel_player_header_supported_renderers=J(e.reelPlayerHeaderSupportedRenderers,Zg),this.menu=J(e.menu,W),this.next_item_button=J(e.nextItemButton,z),this.prev_item_button=J(e.prevItemButton,z),this.subscribe_button_renderer=J(e.subscribeButtonRenderer,[z,tu]),this.style=e.style,this.view_comments_button=J(e.viewCommentsButton,z),this.share_button=J(e.shareButton,z),this.pivot_button=J(e.pivotButton,fg),this.info_panel=J(e.infoPanel,Lp)}},$g=class extends p{static type=`RichGrid`;header;contents;target_id;constructor(e){super(),this.header=J(e.header),this.contents=Y(e.contents),Reflect.has(e,`targetId`)&&(this.target_id=e.targetId)}},e_=class extends p{static type=`RichItem`;content;constructor(e){super(),this.content=J(e.content)}},t_=class extends p{static type=`RichListHeader`;title;subtitle;title_style;icon_type;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),Reflect.has(e,`titleStyle`)&&(this.title_style=e.titleStyle.style),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType)}},n_=class extends p{static type=`RichMetadata`;thumbnail;title;subtitle;call_to_action;icon_type;endpoint;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.call_to_action=new H(e.callToAction),Reflect.has(e,`callToActionIcon`)&&(this.icon_type=e.callToActionIcon.iconType),this.endpoint=new B(e.endpoint)}},r_=class extends p{static type=`RichMetadataRow`;contents;constructor(e){super(),this.contents=Y(e.contents)}},i_=class extends p{static type=`RichSection`;content;full_bleed;target_id;constructor(e){super(),this.content=J(e.content),this.full_bleed=!!e.fullBleed,`targetId`in e&&(this.target_id=e.targetId)}},a_=class extends p{static type=`RichShelf`;title;contents;endpoint;subtitle;is_expanded;is_bottom_divider_hidden;is_top_divider_hidden;layout_sizing;icon_type;menu;next_button;previous_button;constructor(e){super(),this.title=new H(e.title),this.contents=Y(e.contents),this.is_expanded=!!e.is_expanded,this.is_bottom_divider_hidden=!!e.isBottomDividerHidden,this.is_top_divider_hidden=!!e.isTopDividerHidden,`endpoint`in e&&(this.endpoint=new B(e.endpoint)),`subtitle`in e&&(this.subtitle=new H(e.subtitle)),`layoutSizing`in e&&(this.layout_sizing=e.layoutSizing),`icon`in e&&(this.icon_type=e.icon.iconType),this.menu=J(e.menu),this.next_button=J(e.nextButton),this.previous_button=J(e.previousButton)}},o_=class extends p{static type=`SearchFilter`;label;endpoint;tooltip;status;constructor(e){super(),this.label=new H(e.label),this.endpoint=new B(e.endpoint||e.navigationEndpoint),this.tooltip=e.tooltip,Reflect.has(e,`status`)&&(this.status=e.status)}get disabled(){return this.status===`FILTER_STATUS_DISABLED`}get selected(){return this.status===`FILTER_STATUS_SELECTED`}},s_=class extends p{static type=`SearchFilterGroup`;title;filters;constructor(e){super(),this.title=new H(e.title),this.filters=Y(e.filters,o_)}},c_=class extends p{static type=`SearchFilterOptionsDialog`;title;groups;constructor(e){super(),this.title=new H(e.title),this.groups=Y(e.groups,s_)}},l_=class extends p{static type=`SearchHeader`;chip_bar;search_filter_button;constructor(e){super(),this.chip_bar=J(e.chipBar,Tu),this.search_filter_button=J(e.searchFilterButton,z)}},u_=class extends p{static type=`SearchSubMenu`;title;groups;button;constructor(e){super(),Reflect.has(e,`title`)&&(this.title=new H(e.title)),Reflect.has(e,`groups`)&&(this.groups=Y(e.groups,s_)),Reflect.has(e,`button`)&&(this.button=J(e.button,hc))}},d_=class extends p{static type=`SearchSuggestionsSection`;contents;constructor(e){super(),this.contents=Y(e.contents)}},f_=class extends p{static type=`UniversalWatchCard`;header;call_to_action;sections;collapsed_label;constructor(e){super(),this.header=J(e.header),this.call_to_action=J(e.callToAction),this.sections=Y(e.sections),Reflect.has(e,`collapsedLabel`)&&(this.collapsed_label=new H(e.collapsedLabel))}},p_=class extends p{static type=`SecondarySearchContainer`;target_id;contents;constructor(e){super(),this.contents=Y(e.contents,[f_])}},m_=class extends p{static type=`SegmentedLikeDislikeButton`;like_button;dislike_button;constructor(e){super(),this.like_button=J(e.likeButton,[hc,z]),this.dislike_button=J(e.dislikeButton,[hc,z])}},h_=class extends p{static type=`SettingBoolean`;title;summary;enable_endpoint;disable_endpoint;item_id;constructor(e){super(),Reflect.has(e,`title`)&&(this.title=new H(e.title)),Reflect.has(e,`summary`)&&(this.summary=new H(e.summary)),Reflect.has(e,`enableServiceEndpoint`)&&(this.enable_endpoint=new B(e.enableServiceEndpoint)),Reflect.has(e,`disableServiceEndpoint`)&&(this.disable_endpoint=new B(e.disableServiceEndpoint)),this.item_id=e.itemId}},g_=class extends p{static type=`SettingsCheckbox`;title;help_text;enabled;disabled;id;constructor(e){super(),this.title=new H(e.title),this.help_text=new H(e.helpText),this.enabled=e.enabled,this.disabled=e.disabled,this.id=e.id}},__=class extends p{static type=`SettingsSwitch`;title;subtitle;enabled;enable_endpoint;disable_endpoint;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.enabled=e.enabled,this.enable_endpoint=new B(e.enableServiceEndpoint),this.disable_endpoint=new B(e.disableServiceEndpoint)}},v_=class extends p{static type=`SettingsOptions`;title;text;options;constructor(e){super(),this.title=new H(e.title),Reflect.has(e,`text`)&&(this.text=new H(e.text).toString()),Reflect.has(e,`options`)&&(this.options=Y(e.options,[__,_s,Sd,g_,_u]))}},y_=class extends p{static type=`SettingsSidebar`;title;items;constructor(e){super(),this.title=new H(e.title),this.items=Y(e.items,Ms)}get contents(){return this.items}},b_=class extends p{static type=`SharedPost`;thumbnail;content;published;menu;original_post;id;endpoint;expand_button;author;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail),this.content=new H(e.content),this.published=new H(e.publishedTimeText),this.menu=J(e.actionMenu,W),this.original_post=J(e.originalPost,[Ac,zg]),this.id=e.postId,this.endpoint=new B(e.navigationEndpoint),this.expand_button=J(e.expandButton,z),this.author=new X(e.displayName,void 0)}},x_=class extends p{static type=`SharePanelHeader`;title;constructor(e){super(),this.title=J(e.title)}},S_=class extends p{static type=`SharePanelTitleV15`;title;constructor(e){super(),this.title=new H(e.title)}},C_=class extends p{static type=`ShareTarget`;endpoint;service_name;target_id;title;constructor(e){super(),Reflect.has(e,`serviceEndpoint`)?this.endpoint=new B(e.serviceEndpoint):Reflect.has(e,`navigationEndpoint`)&&(this.endpoint=new B(e.navigationEndpoint)),this.service_name=e.serviceName,this.target_id=e.targetId,this.title=new H(e.title)}},w_=class extends p{static type=`SheetView`;content;footer;header;renderer_context;constructor(e){super(),this.content=J(e.content),this.footer=J(e.footer),this.header=J(e.header),`rendererContext`in e&&(this.renderer_context=new dc(e.rendererContext))}},T_=class extends p{static type=`Shelf`;title;endpoint;content;icon_type;menu;play_all_button;subtitle;constructor(e){super(),this.title=new H(e.title),Reflect.has(e,`endpoint`)&&(this.endpoint=new B(e.endpoint)),this.content=J(e.content),Reflect.has(e,`icon`)&&(this.icon_type=e.icon.iconType),Reflect.has(e,`menu`)&&(this.menu=J(e.menu)),Reflect.has(e,`playAllButton`)&&(this.play_all_button=J(e.playAllButton,z)),Reflect.has(e,`subtitle`)&&(this.subtitle=new H(e.subtitle))}},E_=class extends p{static type=`ShortsLockupView`;entity_id;accessibility_text;thumbnail;thumbnail_view_model;on_tap_endpoint;menu_on_tap;index_in_collection;menu_on_tap_a11y_label;overlay_metadata;inline_player_data;badge;constructor(e){super(),this.entity_id=e.entityId,this.accessibility_text=e.accessibilityText,this.thumbnail=V.fromResponse(e.thumbnail),this.thumbnail_view_model=J(e.thumbnailViewModel,Fu),this.on_tap_endpoint=new B(e.onTap),this.menu_on_tap=new B(e.menuOnTap),this.index_in_collection=e.indexInCollection,this.menu_on_tap_a11y_label=e.menuOnTapA11yLabel,this.overlay_metadata={primary_text:e.overlayMetadata.primaryText?H.fromAttributed(e.overlayMetadata.primaryText):void 0,secondary_text:e.overlayMetadata.secondaryText?H.fromAttributed(e.overlayMetadata.secondaryText):void 0},e.inlinePlayerData?.onVisible&&(this.inline_player_data=new B(e.inlinePlayerData.onVisible)),e.badge&&(this.badge=J(e.badge,Mc))}},D_=class extends p{static type=`ShowingResultsFor`;corrected_query;original_query;corrected_query_endpoint;original_query_endpoint;search_instead_for;showing_results_for;constructor(e){super(),this.corrected_query=new H(e.correctedQuery),this.original_query=new H(e.originalQuery),this.corrected_query_endpoint=new B(e.correctedQueryEndpoint),this.original_query_endpoint=new B(e.originalQueryEndpoint),this.search_instead_for=new H(e.searchInsteadFor),this.showing_results_for=new H(e.showingResultsFor)}},O_=class extends p{static type=`SimpleCardContent`;image;title;display_domain;show_link_icon;call_to_action;endpoint;constructor(e){super(),this.image=V.fromResponse(e.image),this.title=new H(e.title),this.display_domain=new H(e.displayDomain),this.show_link_icon=e.showLinkIcon,this.call_to_action=new H(e.callToAction),this.endpoint=new B(e.command)}},k_=class extends p{static type=`SimpleCardTeaser`;message;prominent;constructor(e){super(),this.message=new H(e.message),this.prominent=e.prominent}},A_=class extends p{static type=`SimpleTextSection`;lines;style;constructor(e){super(),this.lines=e.lines.map(e=>new H(e)),this.style=e.layoutStyle}},j_=class extends p{static type=`SingleActionEmergencySupport`;action_text;nav_text;details;icon_type;endpoint;constructor(e){super(),this.action_text=new H(e.actionText),this.nav_text=new H(e.navigationText),this.details=new H(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new B(e.navigationEndpoint)}},M_=class extends p{static type=`Tab`;title;selected;endpoint;content;constructor(e){super(),this.title=e.title||`N/A`,this.selected=!!e.selected,this.endpoint=new B(e.endpoint);let t=Object.keys(e.content??{}).find(t=>e.content[t]?.contents);this.content=J(t?{[t]:e.content[t]}:e.content,[K,Kh,$g,bd])}},N_=class extends p{static type=`SingleColumnBrowseResults`;tabs;constructor(e){super(),this.tabs=Y(e.tabs,M_)}},P_=class extends p{static type=`SingleColumnMusicWatchNextResults`;contents;constructor(e){super(),this.contents=zy(e)}},F_=class extends p{static type=`SingleHeroImage`;thumbnails;style;constructor(e){super(),this.thumbnails=V.fromResponse(e.thumbnail),this.style=e.style}},I_=class extends p{static type=`SlimOwner`;thumbnail;title;endpoint;subscribe_button;constructor(e){super(),this.thumbnail=V.fromResponse(e.thumbnail),this.title=new H(e.title),this.endpoint=new B(e.navigationEndpoint),this.subscribe_button=J(e.subscribeButton,tu)}},L_=class extends p{static type=`SlimVideoMetadata`;title;collapsed_subtitle;expanded_subtitle;owner;description;video_id;date;constructor(e){super(),this.title=new H(e.title),this.collapsed_subtitle=new H(e.collapsedSubtitle),this.expanded_subtitle=new H(e.expandedSubtitle),this.owner=J(e.owner),this.description=new H(e.description),this.video_id=e.videoId,this.date=new H(e.dateText)}},R_=class extends p{static type=`StartAt`;start_at_option_label;constructor(e){super(),this.start_at_option_label=new H(e.startAtOptionLabel)}},z_=class extends p{static type=`StructuredDescriptionVideoLockup`;thumbnail;title;short_byline_text;metadata_details;endpoint;length_text;is_live_video;disable_navigation_endpoint;max_lines_title;max_lines_short_byline_text;max_lines_metadata_details;thumbnail_width;aspect_ratio;thumbnail_overlays;constructor(e){super(),this.title=new H(e.title),`shortBylineText`in e&&(this.short_byline_text=new H(e.shortBylineText)),`metadataDetails`in e&&(this.metadata_details=new H(e.metadataDetails)),this.endpoint=new B(e.navigationEndpoint),`lengthText`in e&&(this.length_text=new H(e.lengthText)),this.thumbnail=V.fromResponse(e.thumbnail),this.is_live_video=!!e.isLiveVideo,this.disable_navigation_endpoint=!!e.disableNavigationEndpoint,this.max_lines_title=e.maxLinesTitle,this.max_lines_short_byline_text=e.maxLinesShortBylineText,this.max_lines_metadata_details=e.maxLinesMetadataDetails,this.thumbnail_width=e.thumbnailWidth,this.aspect_ratio=e.aspectRatio,this.thumbnail_overlays=Y(e.thumbnailOverlays)}},B_=class extends p{static type=`Tabbed`;contents;constructor(e){super(),this.contents=zy(e)}},V_=class extends p{static type=`TabbedSearchResults`;tabs;constructor(e){super(),this.tabs=Y(e.tabs,M_)}},H_=class extends p{static type=`TextHeader`;title;style;constructor(e){super(),this.title=new H(e.title),this.style=e.style}},U_=class extends p{static type=`ThirdPartyShareTargetSection`;share_targets;constructor(e){super(),this.share_targets=Y(e.shareTargets,C_)}},W_=class extends p{static type=`ThumbnailLandscapePortrait`;landscape;portrait;constructor(e){super(),this.landscape=V.fromResponse(e.landscape),this.portrait=V.fromResponse(e.portrait)}},G_=class extends p{static type=`ThumbnailOverlayAvatarStackView`;avatar_stack;constructor(e){super(),this.avatar_stack=J(e.avatarStack,fc)}},K_=class extends p{static type=`ThumbnailOverlayEndorsement`;text;constructor(e){super(),this.text=new H(e.text).toString()}},q_=class extends p{static type=`ThumbnailOverlayHoverText`;text;icon_type;constructor(e){super(),this.text=new H(e.text),this.icon_type=e.icon.iconType}},J_=class extends p{static type=`ThumbnailOverlayInlineUnplayable`;text;icon_type;constructor(e){super(),this.text=new H(e.text).toString(),this.icon_type=e.icon.iconType}},Y_=class extends p{static type=`ThumbnailOverlayLoadingPreview`;text;constructor(e){super(),this.text=new H(e.text)}},X_=class extends p{static type=`ThumbnailOverlayNowPlaying`;text;constructor(e){super(),this.text=new H(e.text).toString()}},Z_=class extends p{static type=`ThumbnailOverlayPinking`;hack;constructor(e){super(),this.hack=e.hack}},Q_=class extends p{static type=`ThumbnailOverlayPlaybackStatus`;texts;constructor(e){super(),this.texts=e.texts.map(e=>new H(e))}},$_=class extends p{static type=`ThumbnailOverlayResumePlayback`;percent_duration_watched;constructor(e){super(),this.percent_duration_watched=e.percentDurationWatched}},ev=class extends p{static type=`ThumbnailOverlaySidePanel`;text;icon_type;constructor(e){super(),this.text=new H(e.text),this.icon_type=e.icon.iconType}},tv=class extends p{static type=`ThumbnailOverlayTitleView`;title;subtitle;constructor(e){super(),this.title=e.title?.content??``,this.subtitle=e.subtitle?.content??``}},nv=class extends p{static type=`ThumbnailOverlayToggleButton`;is_toggled;icon_type;tooltip;toggled_endpoint;untoggled_endpoint;constructor(e){super(),Reflect.has(e,`isToggled`)&&(this.is_toggled=e.isToggled),this.icon_type={toggled:e.toggledIcon.iconType,untoggled:e.untoggledIcon.iconType},this.tooltip={toggled:e.toggledTooltip,untoggled:e.untoggledTooltip},e.toggledServiceEndpoint&&(this.toggled_endpoint=new B(e.toggledServiceEndpoint)),e.untoggledServiceEndpoint&&(this.untoggled_endpoint=new B(e.untoggledServiceEndpoint))}},rv=class extends p{static type=`TicketEvent`;title;time_month;time_day;link_text;button_text;endpoint;subtitle1;subtitle2;time_date;time_time;time_weekday;button_accessibility_text;has_multiple_offers;constructor(e){super(),this.title=e.title,this.time_month=e.timeMonth,this.time_day=e.timeDay,this.link_text=e.linkText,this.button_text=e.buttonText,this.endpoint=new B(e.buttonCommand),this.subtitle1=e.subtitle1,this.subtitle2=e.subtitle2,this.time_date=e.timeDate,this.time_time=e.timeTime,this.time_weekday=e.timeWeekday,this.button_accessibility_text=e.buttonAccessibilityText,this.has_multiple_offers=e.hasMultipleOffers}},iv=class extends p{static type=`TicketShelf`;title;events;information_text;use_calendar_avatar;constructor(e){super(),this.title=e.title,this.events=Y(e.events,rv),this.information_text=e.informationText,this.use_calendar_avatar=e.useCalendarAvatar}},av=class extends p{static type=`TitleAndButtonListHeader`;title;constructor(e){super(),this.title=new H(e.title)}},ov=class extends p{static type=`ToggleMenuServiceItem`;text;toggled_text;icon_type;toggled_icon_type;default_endpoint;toggled_endpoint;constructor(e){super(),this.text=new H(e.defaultText),this.toggled_text=new H(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.default_endpoint=new B(e.defaultServiceEndpoint),this.toggled_endpoint=new B(e.toggledServiceEndpoint)}},sv=class extends p{static type=`Tooltip`;promo_config;target_id;details;suggested_position;dismiss_stratedy;dwell_time_ms;constructor(e){super(),this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(e=>new B(e)),accept:new B(e.promoConfig.acceptCommand),dismiss:new B(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new H(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}},cv=class extends p{static type=`TopicChannelDetails`;title;avatar;subtitle;subscribe_button;endpoint;constructor(e){super(),this.title=new H(e.title),this.avatar=V.fromResponse(e.thumbnail??e.avatar),this.subtitle=new H(e.subtitle),this.subscribe_button=J(e.subscribeButton,tu),this.endpoint=new B(e.navigationEndpoint)}},lv=class extends p{static type=`TwoColumnBrowseResults`;tabs;secondary_contents;constructor(e){super(),this.tabs=Y(e.tabs,[M_,Qf]),this.secondary_contents=J(e.secondaryContents,[K,Lc,Wg])}},uv=class extends p{static type=`TwoColumnSearchResults`;header;primary_contents;secondary_contents;target_id;constructor(e){super(),this.header=J(e.header),this.primary_contents=J(e.primaryContents,[$g,K]),this.secondary_contents=J(e.secondaryContents,[p_]),`targetId`in e&&(this.target_id=e.targetId)}},dv=class extends p{static type=`TwoColumnWatchNextResults`;results;secondary_results;conversation_bar;playlist;autoplay;constructor(e){super(),this.results=Y(e.results?.results.contents),this.secondary_results=Y(e.secondaryResults?.secondaryResults.results),this.conversation_bar=J(e?.conversationBar);let t=e.playlist?.playlist;t&&(this.playlist={id:t.playlistId,title:t.title,author:t.shortBylineText?.simpleText?new H(t.shortBylineText):new X(t.longBylineText),contents:Y(t.contents),current_index:t.currentIndex,is_infinite:!!t.isInfinite,menu:J(t.menu,W)});let n=e.autoplay?.autoplay;n&&(this.autoplay={sets:n.sets.map(e=>this.#e(e))},n.modifiedSets&&(this.autoplay.modified_sets=n.modifiedSets.map(e=>this.#e(e))),n.countDownSecs&&(this.autoplay.count_down_secs=n.countDownSecs))}#e(e){let t={autoplay_video:new B(e.autoplayVideo)};return e.nextButtonVideo&&(t.next_button_video=new B(e.nextButtonVideo)),t}},fv=class extends p{static type=`UnifiedSharePanel`;third_party_network_section;header;share_panel_version;show_loading_spinner;constructor(e){if(super(),e.contents){let t=e.contents.find(e=>e.thirdPartyNetworkSection);t&&(this.third_party_network_section={share_target_container:J(t.thirdPartyNetworkSection.shareTargetContainer,U_),copy_link_container:J(t.thirdPartyNetworkSection.copyLinkContainer,Sd),start_at_container:J(t.thirdPartyNetworkSection.startAtContainer,R_)})}this.header=J(e.header,x_),this.share_panel_version=e.sharePanelVersion,Reflect.has(e,`showLoadingSpinner`)&&(this.show_loading_spinner=e.showLoadingSpinner)}},pv=class extends p{static type=`UpsellDialog`;message_title;message_text;action_button;dismiss_button;is_visible;constructor(e){super(),this.message_title=new H(e.dialogMessageTitle),this.message_text=new H(e.dialogMessageText),this.action_button=J(e.actionButton,z),this.dismiss_button=J(e.dismissButton,z),this.is_visible=e.isVisible}},mv=class extends p{static type=`VerticalList`;items;collapsed_item_count;collapsed_state_button_text;constructor(e){super(),this.items=Y(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new H(e.collapsedStateButtonText)}get contents(){return this.items}},hv=class extends p{static type=`VerticalWatchCardList`;items;view_all_text;view_all_endpoint;constructor(e){super(),this.items=Y(e.items),this.view_all_text=new H(e.viewAllText),this.view_all_endpoint=new B(e.viewAllEndpoint)}get contents(){return this.items}},gv=class extends p{static type=`VideoInfoCardContent`;title;channel_name;view_count;video_thumbnails;duration;endpoint;constructor(e){super(),this.title=new H(e.videoTitle),this.channel_name=new H(e.channelName),this.view_count=new H(e.viewCountText),this.video_thumbnails=V.fromResponse(e.videoThumbnail),this.duration=new H(e.lengthString),this.endpoint=new B(e.action)}},_v=class extends p{static type=`VideoMetadataCarouselView`;carousel_titles;carousel_items;constructor(e){super(),this.carousel_titles=zy(e.carouselTitles,!0,uu),this.carousel_items=zy(e.carouselItems,!0,lu)}},vv=class{static type=`SubscriptionButton`;text;subscribed;subscription_type;constructor(e){`text`in e&&(this.text=new H(e.text)),`subscribed`in e&&(this.subscribed=e.subscribed),`type`in e&&(this.subscription_type=e.type)}},yv=class extends p{static type=`VideoOwner`;title;attributed_title;subscription_button;subscriber_count;avatar_stack;endpoint;author;constructor(e){super(),`title`in e&&(this.title=new H(e.title)),`attributedTitle`in e&&(this.attributed_title=H.fromAttributed(e.attributedTitle)),`subscriptionButton`in e&&(this.subscription_button=new vv(e.subscriptionButton)),`navigationEndpoint`in e&&(this.endpoint=new B(e.navigationEndpoint)),this.avatar_stack=J(e.avatarStack,fc),this.subscriber_count=new H(e.subscriberCountText),this.author=new X({...e.title||e.attributedTitle,navigationEndpoint:e.navigationEndpoint},e.badges,e.thumbnail)}},bv=class extends p{static type=`VideoPrimaryInfo`;title;super_title_link;station_name;view_count;badges;published;relative_date;menu;constructor(e){super(),this.title=new H(e.title),`superTitleLink`in e&&(this.super_title_link=new H(e.superTitleLink)),`stationName`in e&&(this.station_name=new H(e.stationName)),this.view_count=J(e.viewCount,Im),this.badges=Y(e.badges,ul),this.published=new H(e.dateText),this.relative_date=new H(e.relativeDateText),this.menu=J(e.videoActions,W)}},xv=class extends p{static type=`VideoSecondaryInfo`;owner;description;description_placeholder;subscribe_button;metadata;show_more_text;show_less_text;default_expanded;description_collapsed_lines;constructor(e){super(),this.owner=J(e.owner,yv),this.description=new H(e.description),`attributedDescription`in e&&(this.description=H.fromAttributed(e.attributedDescription)),`descriptionPlaceholder`in e&&(this.description_placeholder=new H(e.descriptionPlaceholder)),this.subscribe_button=J(e.subscribeButton,[tu,z]),this.metadata=J(e.metadataRowContainer,sh),this.show_more_text=new H(e.showMoreText),this.show_less_text=new H(e.showLessText),this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}},Sv=class extends p{static type=`WatchCardCompactVideo`;title;subtitle;duration;style;endpoint;thumbnails;byline;upcoming;constructor(e){super(),this.title=new H(e.title),this.subtitle=new H(e.subtitle),this.duration={text:new H(e.lengthText).toString(),seconds:e.lengthText?ex(e.lengthText.simpleText):0},this.style=e.style,this.endpoint=new B(e.navigationEndpoint),this.thumbnails=V.fromResponse(e.thumbnail),this.byline=new H(e.byline),e.upcomingEventData&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)))}},Cv=class extends p{static type=`WatchCardHeroVideo`;endpoint;call_to_action_button;hero_image;label;title;subtitle;constructor(e){super(),this.endpoint=new B(e.navigationEndpoint),this.call_to_action_button=J(e.callToActionButton),this.hero_image=J(e.heroImage),this.label=e.lengthText?.accessibility.accessibilityData.label||``,this.title=new H(e.title),this.subtitle=new H(e.subtitle)}},wv=class extends p{static type=`WatchCardRichHeader`;title;title_endpoint;subtitle;author;style;constructor(e){super(),this.title=new H(e.title),this.title_endpoint=new B(e.titleNavigationEndpoint),this.subtitle=new H(e.subtitle),this.author=new X(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title.toString(),this.style=e.style}},Tv=class extends p{static type=`WatchCardSectionSequence`;lists;constructor(e){super(),this.lists=Y(e.lists)}},Ev=class extends lv{static type=`WatchNextTabbedResults`;constructor(e){super(e)}},Dv=class extends p{static type=`AnchoredSection`;title;content;endpoint;category_assets;category_type;constructor(e){super(),this.title=e.title,this.content=J(e.content,K),this.endpoint=new B(e.navigationEndpoint),this.category_assets={asset_key:e.categoryAssets?.assetKey,background_color:e.categoryAssets?.backgroundColor},this.category_type=e.categoryType}},Ov=class extends p{static type=`KidsBlocklistPickerItem`;#e;child_display_name;child_account_description;avatar;block_button;blocked_entity_key;constructor(e){super(),this.child_display_name=new H(e.childDisplayName),this.child_account_description=new H(e.childAccountDescription),this.avatar=V.fromResponse(e.avatar),this.block_button=J(e.blockButton,[hc]),this.blocked_entity_key=e.blockedEntityKey}async blockChannel(){if(!this.#e)throw new Q(`An active caller must be provide to perform this operation.`);let e=this.block_button;if(!e)throw new Q(`Block button was not found.`,{child_display_name:this.child_display_name});if(e.is_toggled)throw new Q(`This channel is already blocked.`,{child_display_name:this.child_display_name});return await e.endpoint.call(this.#e,{parse:!1})}setActions(e){this.#e=e}},kv=class extends p{static type=`KidsBlocklistPicker`;title;child_rows;done_button;successful_toast_action_message;constructor(e){super(),this.title=new H(e.title),this.child_rows=zy(e.childRows,!0,[Ov]),this.done_button=J(e.doneButton,[z]),this.successful_toast_action_message=new H(e.successfulToastActionMessage)}},Av=class extends p{static type=`KidsCategoryTab`;title;category_assets;category_type;endpoint;constructor(e){super(),this.title=new H(e.title),this.category_assets={asset_key:e.categoryAssets?.assetKey,background_color:e.categoryAssets?.backgroundColor},this.category_type=e.categoryType,this.endpoint=new B(e.endpoint)}},jv=class extends p{static type=`kidsCategoriesHeader`;category_tabs;privacy_button;constructor(e){super(),this.category_tabs=Y(e.categoryTabs,Av),this.privacy_button=J(e.privacyButtonRenderer,z)}},Mv=class extends p{static type=`kidsHomeScreen`;anchors;constructor(e){super(),this.anchors=Y(e.anchors,Dv)}},Nv=e({AboutChannel:()=>Os,AboutChannelView:()=>Ds,AccountChannel:()=>ks,AccountItem:()=>As,AccountItemSection:()=>Ns,AccountItemSectionHeader:()=>js,AccountSectionList:()=>Ps,ActiveAccountHeader:()=>$s,AddBannerToLiveChatCommand:()=>Wp,AddChatItemAction:()=>Gp,AddLiveChatTickerItemAction:()=>Kp,AddToPlaylist:()=>nc,AddToPlaylistCommand:()=>Lu,AddToPlaylistEndpoint:()=>ef,AddToPlaylistServiceEndpoint:()=>$d,Alert:()=>rc,AlertWithButton:()=>ic,AnchoredSection:()=>Dv,AnimatedThumbnailOverlayView:()=>ac,AppendContinuationItemsAction:()=>Fs,AttributionView:()=>oc,AudioOnlyPlayability:()=>sc,AuthorCommentBadge:()=>Gu,AutomixPreviewVideo:()=>cc,AvatarStackView:()=>fc,AvatarView:()=>lc,BackgroundPromo:()=>pc,BackstageImage:()=>mc,BackstagePost:()=>Ac,BackstagePostThread:()=>jc,BadgeView:()=>Mc,BrowseEndpoint:()=>nf,BrowseFeedActions:()=>Lc,BrowserMediaSession:()=>Rc,BumperUserEduContentView:()=>Jp,Button:()=>z,ButtonCardView:()=>zc,ButtonView:()=>U,C4TabbedHeader:()=>nu,CallToActionButton:()=>ru,Card:()=>iu,CardCollection:()=>au,CarouselHeader:()=>ou,CarouselItem:()=>su,CarouselItemView:()=>lu,CarouselLockup:()=>Tl,CarouselTitleView:()=>uu,ChangeEngagementPanelVisibilityAction:()=>Is,Channel:()=>du,ChannelAboutFullMetadata:()=>fu,ChannelAgeGate:()=>pu,ChannelExternalLinkView:()=>Es,ChannelFeaturedContent:()=>mu,ChannelHeaderLinks:()=>Vc,ChannelHeaderLinksView:()=>Hc,ChannelMetadata:()=>hu,ChannelMobileHeader:()=>gu,ChannelOptions:()=>_u,ChannelOwnerEmptyState:()=>vu,ChannelSubMenu:()=>yu,ChannelSwitcherHeader:()=>bu,ChannelSwitcherPage:()=>Vs,ChannelTagline:()=>$l,ChannelThumbnailWithLink:()=>xu,ChannelVideoPlayer:()=>Su,Chapter:()=>Cu,ChildVideo:()=>wu,ChipBarView:()=>Gl,ChipCloud:()=>Tu,ChipCloudChip:()=>Hl,ChipView:()=>Wl,ClientSideToggleMenuItem:()=>Eu,ClipAdState:()=>Gc,ClipCreation:()=>Kc,ClipCreationScrubber:()=>Wc,ClipCreationTextInput:()=>Uc,ClipSection:()=>qc,CollaboratorInfoCardContent:()=>Du,CollageHeroImage:()=>Ou,CollectionThumbnailView:()=>Iu,CommandExecutorCommand:()=>ys,CommentActionButtons:()=>_c,CommentDialog:()=>qu,CommentImageAttachmentView:()=>Ju,CommentReplies:()=>ed,CommentReplyDialog:()=>Yu,CommentSimplebox:()=>id,CommentThread:()=>$u,CommentView:()=>Zu,CommentsEntryPointHeader:()=>rd,CommentsEntryPointTeaser:()=>nd,CommentsHeader:()=>Bl,CommentsSimplebox:()=>td,CompactChannel:()=>sd,CompactInfocard:()=>cd,CompactLink:()=>Ms,CompactMix:()=>fd,CompactMovie:()=>pd,CompactPlaylist:()=>md,CompactStation:()=>hd,CompactVideo:()=>wl,CompositeVideoPrimaryInfo:()=>gd,ConfirmDialog:()=>_d,ConfirmDialogEndpoint:()=>rf,ContentListItemView:()=>Qc,ContentMetadataView:()=>vd,ContentPreviewImageView:()=>ml,ContinuationCommand:()=>Ru,ContinuationItem:()=>G,ContinuationItemView:()=>yd,ConversationBar:()=>xd,CopyLink:()=>Sd,CourseProgressView:()=>Xl,CreateCommentEndpoint:()=>of,CreatePlaylistDialog:()=>vs,CreatePlaylistDialogFormView:()=>Td,CreatePlaylistServiceEndpoint:()=>cf,CreatorHeart:()=>gc,CreatorHeartView:()=>Yp,DecoratedAvatarView:()=>Ed,DecoratedPlayerBar:()=>Md,DefaultPromoPanel:()=>Nd,DeletePlaylistEndpoint:()=>uf,DescriptionPreviewView:()=>Pd,DialogHeaderView:()=>Fd,DialogView:()=>Vd,DidYouMean:()=>Hd,DimChatItemAction:()=>qp,DislikeButtonView:()=>bc,DismissableDialog:()=>Wd,DismissableDialogContentSection:()=>Ud,DownloadButton:()=>Cc,DownloadListItemView:()=>Rd,Dropdown:()=>_s,DropdownItem:()=>gs,DropdownView:()=>Cd,DynamicTextView:()=>Gd,Element:()=>qd,EmergencyOnebox:()=>Jd,EmojiPicker:()=>Ku,EmojiPickerCategory:()=>Yd,EmojiPickerCategoryButton:()=>Xd,EmojiPickerUpsellCategory:()=>Zd,EndScreenPlaylist:()=>Xf,EndScreenVideo:()=>Zf,Endscreen:()=>Jf,EndscreenElement:()=>Yf,EngagementPanelSectionList:()=>Ql,EngagementPanelTitleHeader:()=>Jc,EomSettingsDisclaimer:()=>Fc,ExpandableMetadata:()=>ll,ExpandableTab:()=>Qf,ExpandableVideoDescriptionBody:()=>rl,ExpandedShelfContents:()=>$f,Factoid:()=>_l,FancyDismissibleDialog:()=>ep,FeedFilterChipBar:()=>Ul,FeedNudge:()=>tp,FeedTabbedHeader:()=>np,FeedbackEndpoint:()=>ff,FlexibleActionsView:()=>kc,Form:()=>ip,FormFooterView:()=>Ld,FormPopup:()=>ap,GameCard:()=>al,GameDetails:()=>op,GetAccountsListInnertubeEndpoint:()=>mf,GetKidsBlocklistPickerCommand:()=>Bu,GetMultiPageMenuAction:()=>Rs,Grid:()=>sp,GridChannel:()=>cp,GridHeader:()=>lp,GridMix:()=>up,GridMovie:()=>dp,GridPlaylist:()=>fp,GridShelfView:()=>pp,GridShow:()=>gp,GridVideo:()=>_p,GuideCollapsibleEntry:()=>yp,GuideCollapsibleSectionEntry:()=>bp,GuideDownloadsEntry:()=>xp,GuideEntry:()=>vp,GuideSection:()=>Sp,GuideSubscriptionsSection:()=>Cp,HashtagHeader:()=>wp,HashtagTile:()=>Tp,HeatMarker:()=>Dd,Heatmap:()=>kd,HeroPlaylistThumbnail:()=>Ep,HideEngagementPanelEndpoint:()=>hf,HighlightsCarousel:()=>Op,HistorySuggestion:()=>Ap,HorizontalCardList:()=>gl,HorizontalList:()=>ol,HorizontalMovieList:()=>Mp,HorizontalShelfView:()=>jp,HowThisWasMadeSectionView:()=>jl,HypeFanCreditsSectionView:()=>Fl,HypePointsFactoid:()=>bl,IconLink:()=>Np,ImageBannerView:()=>Pp,IncludingResultsFor:()=>Fp,InfoPanelContainer:()=>Lp,InfoPanelContent:()=>Ip,InfoRow:()=>Cl,InteractiveTabbedHeader:()=>Rp,InterstitialView:()=>zp,ItemSection:()=>ql,ItemSectionHeader:()=>Ll,ItemSectionTab:()=>Rl,ItemSectionTabbedHeader:()=>zl,KidsBlocklistPicker:()=>kv,KidsBlocklistPickerItem:()=>Ov,KidsCategoriesHeader:()=>jv,KidsCategoryTab:()=>Av,KidsHomeScreen:()=>Mv,LikeButton:()=>Oc,LikeButtonView:()=>yc,LikeEndpoint:()=>yf,LinearLayoutView:()=>Bp,ListItemView:()=>Ec,ListView:()=>Bd,LiveChat:()=>Vp,LiveChatActionPanel:()=>ym,LiveChatAuthorBadge:()=>lm,LiveChatAutoModMessage:()=>Xp,LiveChatBanner:()=>Up,LiveChatBannerChatSummary:()=>Zp,LiveChatBannerHeader:()=>Hp,LiveChatBannerPoll:()=>Qp,LiveChatBannerRedirect:()=>$p,LiveChatDialog:()=>Rm,LiveChatHeader:()=>zm,LiveChatItemBumperView:()=>em,LiveChatItemContextMenuEndpoint:()=>xf,LiveChatItemList:()=>Bm,LiveChatMembershipItem:()=>tm,LiveChatMessageInput:()=>Vm,LiveChatModeChangeMessage:()=>nm,LiveChatPaidMessage:()=>im,LiveChatPaidSticker:()=>am,LiveChatParticipant:()=>Hm,LiveChatParticipantsList:()=>Um,LiveChatPlaceholderItem:()=>om,LiveChatProductItem:()=>sm,LiveChatRestrictedParticipation:()=>cm,LiveChatSponsorshipsGiftPurchaseAnnouncement:()=>dm,LiveChatSponsorshipsGiftRedemptionAnnouncement:()=>fm,LiveChatSponsorshipsHeader:()=>um,LiveChatTextMessage:()=>pm,LiveChatTickerPaidMessageItem:()=>mm,LiveChatTickerPaidStickerItem:()=>hm,LiveChatTickerSponsorItem:()=>gm,LiveChatViewerEngagementMessage:()=>_m,LiveStreamOfflineSlate:()=>Wm,LiveStreamability:()=>Gm,LockupMetadataView:()=>Km,LockupView:()=>qm,MacroMarkersInfoItem:()=>Yc,MacroMarkersList:()=>Zc,MacroMarkersListEntity:()=>Jm,MacroMarkersListItem:()=>Xc,MarkChatItemAsDeletedAction:()=>bm,MarkChatItemsByAuthorAsDeletedAction:()=>xm,MediaLockup:()=>Ym,Menu:()=>W,MenuCustomIconItem:()=>Xm,MenuFlexibleItem:()=>Dc,MenuNavigationItem:()=>Zm,MenuPopup:()=>Qm,MenuServiceItem:()=>Sc,MenuServiceItemDownload:()=>wc,MenuTitle:()=>ec,MerchandiseItem:()=>ah,MerchandiseShelf:()=>Nl,Message:()=>bd,MetadataBadge:()=>ul,MetadataRow:()=>oh,MetadataRowContainer:()=>sh,MetadataRowHeader:()=>ch,MetadataScreen:()=>lh,MicroformatData:()=>uh,Mix:()=>dh,MobileTopbar:()=>eg,ModalWithTitleAndButton:()=>fh,ModifyChannelNotificationPreferenceEndpoint:()=>Cf,Movie:()=>ph,MovingThumbnail:()=>mh,MultiMarkersPlayerBar:()=>jd,MultiPageMenu:()=>Ls,MultiPageMenuNotificationSection:()=>eh,MultiPageMenuSection:()=>tg,MusicCardShelf:()=>bh,MusicCardShelfHeaderBasic:()=>hh,MusicCarouselShelf:()=>Ah,MusicCarouselShelfBasicHeader:()=>xh,MusicDescriptionShelf:()=>jh,MusicDetailHeader:()=>Mh,MusicDownloadStateBadge:()=>Nh,MusicEditablePlaylistDetailHeader:()=>Ph,MusicElementHeader:()=>Fh,MusicHeader:()=>Ih,MusicImmersiveHeader:()=>Lh,MusicInlineBadge:()=>gh,MusicItemThumbnailOverlay:()=>vh,MusicLargeCardItemCarousel:()=>Bh,MusicMenuItemDivider:()=>th,MusicMultiRowListItem:()=>Sh,MusicMultiSelectMenu:()=>rh,MusicMultiSelectMenuItem:()=>nh,MusicNavigationButton:()=>Ch,MusicPlayButton:()=>_h,MusicPlaylistEditHeader:()=>Vh,MusicPlaylistShelf:()=>Hh,MusicQueue:()=>Kh,MusicResponsiveHeader:()=>qh,MusicResponsiveListItem:()=>Oh,MusicResponsiveListItemFixedColumn:()=>wh,MusicResponsiveListItemFlexColumn:()=>Th,MusicShelf:()=>Jh,MusicSideAlignedItem:()=>Yh,MusicSortFilterButton:()=>Xh,MusicTastebuilderShelf:()=>Qh,MusicTastebuilderShelfThumbnail:()=>Zh,MusicThumbnail:()=>yh,MusicTwoRowItem:()=>kh,MusicVisualHeader:()=>$h,NavigationEndpoint:()=>B,Notification:()=>$m,NotificationAction:()=>ag,OfficialCardView:()=>sg,OpenOnePickAddVideoModalCommand:()=>cg,OpenPopupAction:()=>hs,PageHeader:()=>lg,PageHeaderView:()=>og,PageIndicatorView:()=>ug,PageIntroduction:()=>dg,PanelFooterView:()=>Id,PdgCommentChip:()=>ad,PdgReplyButtonView:()=>rm,PerformCommentActionEndpoint:()=>Tf,PivotBar:()=>ng,PivotBarItem:()=>rg,PivotButton:()=>fg,PlayerAnnotationsExpanded:()=>pg,PlayerCaptchaView:()=>mg,PlayerCaptionsTracklist:()=>hg,PlayerControlsOverlay:()=>_g,PlayerErrorMessage:()=>vg,PlayerInterstitial:()=>yg,PlayerLegacyDesktopYpcOffer:()=>bg,PlayerLegacyDesktopYpcTrailer:()=>Sg,PlayerLiveStoryboardSpec:()=>Cg,PlayerMicroformat:()=>wg,PlayerOverflow:()=>gg,PlayerOverlay:()=>Og,PlayerOverlayAutoplay:()=>Tg,PlayerOverlayVideoDetails:()=>Eg,PlayerStoryboardSpec:()=>ue,Playlist:()=>dd,PlaylistAddToOption:()=>tc,PlaylistCollaborationView:()=>tl,PlaylistCustomThumbnail:()=>ld,PlaylistEditEndpoint:()=>Df,PlaylistHeader:()=>kg,PlaylistInfoCardContent:()=>Ag,PlaylistMetadata:()=>jg,PlaylistPanel:()=>Gh,PlaylistPanelVideo:()=>Uh,PlaylistPanelVideoWrapper:()=>Wh,PlaylistSidebar:()=>Mg,PlaylistSidebarPrimaryInfo:()=>Ng,PlaylistSidebarSecondaryInfo:()=>Pg,PlaylistThumbnailOverlay:()=>Fg,PlaylistVideo:()=>Ig,PlaylistVideoList:()=>Lg,PlaylistVideoThumbnail:()=>ud,Poll:()=>Rg,PollHeader:()=>vm,Post:()=>zg,PostMultiImage:()=>Bg,PrefetchWatchCommand:()=>Af,PremiereTrailerBadge:()=>Vg,ProductList:()=>nl,ProductListHeader:()=>Hg,ProductListItem:()=>Ug,ProfileColumn:()=>Wg,ProfileColumnStats:()=>Gg,ProfileColumnStatsEntry:()=>Kg,ProfileColumnUserInfo:()=>qg,Quiz:()=>Jg,RecognitionShelf:()=>Yg,ReelItem:()=>Xg,ReelPlayerHeader:()=>Zg,ReelPlayerOverlay:()=>Qg,ReelShelf:()=>Ml,ReelWatchEndpoint:()=>Mf,RelatedChipCloud:()=>Kl,RemoveBannerForLiveChatCommand:()=>Sm,RemoveChatItemAction:()=>Cm,RemoveChatItemByAuthorAction:()=>wm,ReplaceChatItemAction:()=>Tm,ReplaceLiveChatAction:()=>Em,ReplayChatItemAction:()=>Dm,RichGrid:()=>$g,RichItem:()=>e_,RichListHeader:()=>t_,RichMetadata:()=>n_,RichMetadataRow:()=>r_,RichSection:()=>i_,RichShelf:()=>a_,RunAttestationCommand:()=>Vu,SearchBox:()=>Ic,SearchEndpoint:()=>Pf,SearchFilter:()=>o_,SearchFilterGroup:()=>s_,SearchFilterOptionsDialog:()=>c_,SearchHeader:()=>l_,SearchRefinementCard:()=>il,SearchSubMenu:()=>u_,SearchSuggestion:()=>kp,SearchSuggestionsSection:()=>d_,SecondarySearchContainer:()=>p_,SectionHeaderView:()=>Pl,SectionList:()=>K,SegmentedLikeDislikeButton:()=>m_,SegmentedLikeDislikeButtonView:()=>xc,SendFeedbackAction:()=>zs,SettingBoolean:()=>h_,SettingsCheckbox:()=>g_,SettingsOptions:()=>v_,SettingsSidebar:()=>y_,SettingsSwitch:()=>__,ShareEndpoint:()=>Lf,ShareEntityEndpoint:()=>Rf,ShareEntityServiceEndpoint:()=>If,SharePanelHeader:()=>x_,SharePanelTitleV15:()=>S_,ShareTarget:()=>C_,SharedPost:()=>b_,SheetView:()=>w_,Shelf:()=>T_,ShortsLockupView:()=>E_,ShowCustomThumbnail:()=>mp,ShowDialogCommand:()=>Hu,ShowEngagementPanelEndpoint:()=>Bf,ShowLiveChatActionPanelAction:()=>Om,ShowLiveChatDialogAction:()=>km,ShowLiveChatTooltipCommand:()=>Am,ShowSheetCommand:()=>Uu,ShowingResultsFor:()=>D_,SignalAction:()=>Bs,SignalServiceEndpoint:()=>Vf,SimpleCardContent:()=>O_,SimpleCardTeaser:()=>k_,SimpleMenuHeader:()=>ih,SimpleTextSection:()=>A_,SingleActionEmergencySupport:()=>j_,SingleColumnBrowseResults:()=>N_,SingleColumnMusicWatchNextResults:()=>P_,SingleHeroImage:()=>F_,SlimOwner:()=>I_,SlimVideoMetadata:()=>L_,SortFilterHeader:()=>Vl,SortFilterSubMenu:()=>Us,SponsorCommentBadge:()=>od,StartAt:()=>R_,StructuredDescriptionContent:()=>Zl,StructuredDescriptionPlaylistLockup:()=>Ol,StructuredDescriptionVideoLockup:()=>z_,SubFeedOption:()=>Nc,SubFeedSelector:()=>Pc,SubscribeButton:()=>tu,SubscribeButtonView:()=>Tc,SubscribeEndpoint:()=>Uf,SubscriptionNotificationToggleButton:()=>eu,Tab:()=>M_,Tabbed:()=>B_,TabbedSearchResults:()=>V_,TextCarouselItemView:()=>cu,TextFieldView:()=>wd,TextHeader:()=>H_,ThirdPartyShareTargetSection:()=>U_,ThumbnailBadgeView:()=>Au,ThumbnailBottomOverlayView:()=>Pu,ThumbnailHoverOverlayToggleActionsView:()=>Mu,ThumbnailHoverOverlayView:()=>ku,ThumbnailLandscapePortrait:()=>W_,ThumbnailOverlayAvatarStackView:()=>G_,ThumbnailOverlayBadgeView:()=>ju,ThumbnailOverlayBottomPanel:()=>hp,ThumbnailOverlayEndorsement:()=>K_,ThumbnailOverlayHoverText:()=>q_,ThumbnailOverlayInlineUnplayable:()=>J_,ThumbnailOverlayLoadingPreview:()=>Y_,ThumbnailOverlayNowPlaying:()=>X_,ThumbnailOverlayPinking:()=>Z_,ThumbnailOverlayPlaybackStatus:()=>Q_,ThumbnailOverlayProgressBarView:()=>Nu,ThumbnailOverlayResumePlayback:()=>$_,ThumbnailOverlaySidePanel:()=>ev,ThumbnailOverlayTimeStatus:()=>dl,ThumbnailOverlayTitleView:()=>tv,ThumbnailOverlayToggleButton:()=>nv,ThumbnailView:()=>Fu,TicketEvent:()=>rv,TicketShelf:()=>iv,TimedMarkerDecoration:()=>Od,TitleAndButtonListHeader:()=>av,ToggleButton:()=>hc,ToggleButtonView:()=>vc,ToggleFormField:()=>rp,ToggleMenuServiceItem:()=>ov,ToggleableListItemView:()=>zd,Tooltip:()=>sv,TopbarMenuButton:()=>ig,TopicChannelDetails:()=>cv,Transcript:()=>Xs,TranscriptFooter:()=>Ws,TranscriptSearchBox:()=>Gs,TranscriptSearchPanel:()=>Ys,TranscriptSectionHeader:()=>Ks,TranscriptSegment:()=>qs,TranscriptSegmentList:()=>Js,TwoColumnBrowseResults:()=>lv,TwoColumnSearchResults:()=>uv,TwoColumnWatchNextResults:()=>dv,UnifiedSharePanel:()=>fv,UniversalWatchCard:()=>f_,UnsubscribeEndpoint:()=>Gf,UpdateChannelSwitcherPageAction:()=>Hs,UpdateDateTextAction:()=>jm,UpdateDescriptionAction:()=>Mm,UpdateEngagementPanelAction:()=>Zs,UpdateEngagementPanelContentCommand:()=>Wu,UpdateLiveChatPollAction:()=>Nm,UpdateSubscribeButtonAction:()=>Qs,UpdateTitleAction:()=>Pm,UpdateToggleButtonTextAction:()=>Fm,UpdateViewershipAction:()=>Lm,UploadTimeFactoid:()=>vl,UpsellDialog:()=>pv,VerticalList:()=>mv,VerticalWatchCardList:()=>hv,Video:()=>fl,VideoAttributeView:()=>hl,VideoAttributesSectionView:()=>Al,VideoCard:()=>pl,VideoDescriptionCourseSection:()=>kl,VideoDescriptionGamingSection:()=>Yl,VideoDescriptionHeader:()=>xl,VideoDescriptionInfocardsSection:()=>Sl,VideoDescriptionMusicSection:()=>El,VideoDescriptionTranscriptSection:()=>Dl,VideoDescriptionYouchatSectionView:()=>Il,VideoInfoCardContent:()=>gv,VideoMetadataCarouselView:()=>_v,VideoOwner:()=>yv,VideoPrimaryInfo:()=>bv,VideoSecondaryInfo:()=>xv,VideoSummaryContentView:()=>cl,VideoSummaryParagraphView:()=>sl,VideoTitleHeaderView:()=>Jl,VideoViewCount:()=>Im,ViewCountFactoid:()=>yl,VoiceReplyContainerView:()=>Xu,WatchCardCompactVideo:()=>Sv,WatchCardHeroVideo:()=>Cv,WatchCardRichHeader:()=>wv,WatchCardSectionSequence:()=>Tv,WatchEndpoint:()=>kf,WatchNextEndScreen:()=>Dg,WatchNextEndpoint:()=>qf,WatchNextTabbedResults:()=>Ev,YpcTrailer:()=>xg}),Pv=new Set([`trackingParams`,`accessibility`,`accessibilityData`]),Fv={};function Iv(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}function Lv(e,t){let n=!1;if(typeof t==`object`&&t){if(n=Bv(t))return Fv[n]=Reflect.get(t,Reflect.ownKeys(t)[0]),{type:`renderer`,renderers:[n],optional:!1};if(n=Rv(t)){for(let[e,t]of Object.entries(n))Fv[e]=t;return{type:`array`,array_type:`renderer`,renderers:Object.keys(n),optional:!1}}if((n=zv(e,t))||(n=Vv(t)))return n}let r=typeof t;return r===`object`?{type:`object`,keys:Object.entries(t).map(([e,t])=>[e,Lv(e,t)]),optional:!1}:{type:`primitive`,typeof:[r],optional:!1}}function Rv(e){let t=Array.isArray(e);return t&&e.length===0?!1:t&&e.every(e=>Bv(e))?Object.fromEntries(e.map(e=>{let t=Reflect.ownKeys(e)[0].toString();return[Fy(t),e[t]]})):!1}function zv(e,t){if(typeof t==`object`&&t){if(e.endsWith(`Endpoint`)||e.endsWith(`Command`)||e===`endpoint`)return{type:`misc`,endpoint:new B(t),optional:!1,misc_type:`NavigationEndpoint`};if(Reflect.has(t,`simpleText`)||Reflect.has(t,`runs`)){let e=new H(t);return{type:`misc`,misc_type:`Text`,optional:!1,endpoint:e.endpoint,text:e.toString()}}if(Reflect.has(t,`thumbnails`)&&Array.isArray(Reflect.get(t,`thumbnails`)))return{type:`misc`,misc_type:`Thumbnail`,optional:!1}}return!1}function Bv(e){if(typeof e!=`object`)return!1;let t=Reflect.ownKeys(e);if(t.length===1){let e=t[0].toString();if(e.endsWith(`Renderer`)||e.endsWith(`Model`))return Fy(e)}return!1}function Vv(e){if(!Array.isArray(e))return!1;if(e.length===0)return{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[`never`],optional:!1},optional:!1};let t=e.map(e=>typeof e);if(!t.every(e=>e===t[0]))return{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[`unknown`],optional:!1},optional:!1};let n=t[0];if(n!==`object`)return{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[n],optional:!1},optional:!1};let r=[];for(let t=0;t<e.length;t++){let n=Object.entries(e[t]).map(([e,t])=>[e,Lv(e,t)]);if(t===0){r=n;continue}r=ay(r,n).resolved_key_info}return{type:`array`,array_type:`object`,items:{type:`object`,keys:r,optional:!1},optional:!1}}function Hv(e){if(typeof e!=`object`||!e)throw new Q(`Generator: Cannot introspect non-object`,{classdata:e});return Reflect.ownKeys(e).filter(e=>!Kv(e)).filter(e=>typeof e==`string`).map(t=>[t,Lv(t,Reflect.get(e,t))])}function Uv(e){let t=e.filter(([,e])=>e.type!==`misc`||e.misc_type!==`NavigationEndpoint`&&e.misc_type!==`Text`?!1:e.endpoint?.metadata.page_type===`WEB_PAGE_TYPE_CHANNEL`).sort(([,e],[,t])=>e.type!==`misc`||t.type!==`misc`||e.misc_type!==`Text`||t.misc_type!==`Text`?0:t.text.length-e.text.length),n=new Set,r=t[0],i;if(r){n.add(r[0]);let t=e.map(([e])=>e).filter(e=>e.endsWith(`Badges`)||e===`badges`),a=t.filter(e=>e.startsWith(`owner`)||e.startsWith(`author`))[0]??t[0],o=e.find(([e])=>e===a),s=o?o[1].type===`array`&&o[1].array_type===`renderer`&&Reflect.has(o[1].renderers,`MetadataBadge`):!1;s&&a&&n.add(a),i={type:`misc`,misc_type:`Author`,optional:!1,params:[r[0],s?a:void 0]}}return i&&e.push([`author`,i]),e.filter(([e])=>!n.has(e))}function Wv(e){return Uv(Hv(e))}function Gv(e){let t=Wv(e),n=new Map;for(let[,e]of t)if(e.type===`renderer`||e.type===`array`&&e.array_type===`renderer`)for(let t of e.renderers){let e=Fv[t];e&&n.set(t,e)}return{key_info:t,unimplemented_dependencies:Array.from(n).filter(([e])=>!Ly(e))}}function Kv(e){return typeof e==`string`&&Pv.has(e)}function qv(e,t,n){n({error_type:`class_not_found`,classname:e,key_info:t});let r=class extends p{static type=e;static#e=new Map;static set key_info(e){this.#e=new Map(e)}static get key_info(){return[...this.#e.entries()]}constructor(t){super();let{key_info:i,unimplemented_dependencies:a}=Gv(t),{resolved_key_info:o,changed_keys:s}=ay(r.key_info,i);s.length>0&&(r.key_info=o,n({error_type:`class_changed`,classname:e,key_info:r.key_info,changed_keys:s}));for(let[e,t]of a)Jv(e,t,n);for(let[e,n]of i){let r=Iv(e);n.type===`misc`&&n.misc_type===`NavigationEndpoint`&&(r=`endpoint`),Reflect.set(this,r,iy(e,n,t))}}};return r.key_info=t,Object.defineProperty(r,"name",{value:e,writable:!1}),r}function Jv(e,t,n){let{key_info:r,unimplemented_dependencies:i}=Gv(t),a=qv(e,r,n);Ry(e,a);for(let[e,t]of i)Jv(e,t,n);return a}function Yv(e,t){let n=[],r=[`super();`];for(let[e,i]of t){let t=Iv(e);i.type===`misc`&&i.misc_type===`NavigationEndpoint`&&(t=`endpoint`),n.push(`${t}${i.optional?`?`:``}: ${Zv(i)};`),r.push(`this.${t} = ${$v(e,i)};`)}return`class ${e} extends YTNode {\n static type = '${e}';\n\n ${n.join(`
|
|
14
|
+
`)}\n\n constructor(data: RawNode) {\n ${r.join(`
|
|
15
|
+
`)}\n }\n}\n`}function Xv(e,t){return`{\n${t.map(([t,n])=>`${` `.repeat((e+2)*2)}${Iv(t)}${n.optional?`?`:``}: ${Zv(n,e+1)}`).join(`,
|
|
16
|
+
`)}\n${` `.repeat((e+1)*2)}}`}function Zv(e,t=0){switch(e.type){case`renderer`:return`${e.renderers.map(e=>`YTNodes.${e}`).join(` | `)} | null`;case`array`:switch(e.array_type){case`renderer`:return`ObservedArray<${e.renderers.map(e=>`YTNodes.${e}`).join(` | `)}> | null`;case`primitive`:{let t=e.items.typeof;return e.items.optional&&!t.includes(`undefined`)&&t.push(`undefined`),`${t.length===1?`${t[0]}`:`(${t.join(` | `)})`}[]`}case`object`:return`${Xv(t,e.items.keys)}[]`;default:throw Error(`Unreachable code reached! Switch missing case!`)}case`object`:return Xv(t,e.keys);case`misc`:switch(e.misc_type){case`Thumbnail`:return`Thumbnail[]`;default:return e.misc_type}case`primitive`:return e.typeof.join(` | `)}}function Qv(e,t,n,r){let i=[...n,r];return`{\n${t.map(([t,n])=>`${` `.repeat((e+2)*2)}${Iv(t)}: ${$v(t,n,i,e+1)}`).join(`,
|
|
17
|
+
`)}\n${` `.repeat((e+1)*2)}}`}function $v(e,t,n=[`data`],r=1){let i=`undefined`;switch(t.type){case`renderer`:i=`Parser.parseItem(${n.join(`.`)}.${e}, ${ey(t.renderers)})`;break;case`array`:switch(t.array_type){case`renderer`:i=`Parser.parse(${n.join(`.`)}.${e}, true, ${ey(t.renderers)})`;break;case`object`:i=`${n.join(`.`)}.${e}.map((item: any) => (${Qv(r,t.items.keys,[],`item`)}))`;break;case`primitive`:i=`${n.join(`.`)}.${e}`;break;default:throw Error(`Unreachable code reached! Switch missing case!`)}break;case`object`:i=Qv(r,t.keys,n,e);break;case`misc`:switch(t.misc_type){case`Thumbnail`:i=`Thumbnail.fromResponse(${n.join(`.`)}.${e})`;break;case`Author`:{let e=`new Author(${n.join(`.`)}.${t.params[0]}, ${t.params[1]?`${n.join(`.`)}.${t.params[1]}`:`undefined`})`;return t.optional?`Reflect.has(${n.join(`.`)}, '${t.params[0]}') ? ${e} : undefined`:e}default:i=`new ${t.misc_type}(${n.join(`.`)}.${e})`}if(i===`undefined`)throw Error(`Unreachable code reached! Switch missing case!`);break;case`primitive`:i=`${n.join(`.`)}.${e}`}return t.optional?`Reflect.has(${n.join(`.`)}, '${e}') ? ${i} : undefined`:i}function ey(e){return e.length===1?`YTNodes.${e[0]}`:`[ ${e.map(e=>`YTNodes.${e}`).join(`, `)} ]`}function ty(e,t){let n=e;for(let e of t)n=n[e];return n}function ny(e,t){let n=e;for(let e of t)if(Reflect.has(n,e))n=n[e];else return!1;return!0}function ry(e,t,n,r,i){let a={},o=[...n,e];for(let[e,n]of r)a[e]=i?iy(e,n,t,o):void 0;return a}function iy(e,t,n,r=[`data`]){let i=!t.optional||ny({data:n},[...r,e]);switch(t.type){case`renderer`:return i?J(ty({data:n},[...r,e]),t.renderers.map(e=>Iy(e))):void 0;case`array`:switch(t.array_type){case`renderer`:return i?zy(ty({data:n},[...r,e]),!0,t.renderers.map(e=>Iy(e))):void 0;case`object`:return i?ty({data:n},[...r,e]).map((a,o)=>ry(`${o}`,n,[...r,e],t.items.keys,i)):void 0;case`primitive`:return i?ty({data:n},[...r,e]):void 0;default:throw Error(`Unreachable code reached! Switch missing case!`)}case`object`:return ry(e,n,r,t.keys,i);case`misc`:switch(t.misc_type){case`NavigationEndpoint`:return i?new B(ty({data:n},[...r,e])):void 0;case`Text`:return i?new H(ty({data:n},[...r,e])):void 0;case`Thumbnail`:return i?V.fromResponse(ty({data:n},[...r,e])):void 0;case`Author`:return!t.optional||ny({data:n},[...r,t.params[0]])?new X(ty({data:n},[...r,t.params[0]]),t.params[1]?ty({data:n},[...r,t.params[1]]):void 0):void 0;default:throw Error(`Unreachable code reached! Switch missing case!`)}case`primitive`:return ty({data:n},[...r,e])}}function ay(e,t){let n=new Map,r=new Set(e.map(([e])=>e)),i=new Set(t.map(([e])=>e)),a=t.filter(([e])=>!r.has(e)),o=e.filter(([e])=>!i.has(e)),s=e.filter(([e])=>i.has(e)),c=new Map(t);for(let[e,t]of s){let r=c.get(e);if(r){if(t.type!==r.type){n.set(e,{type:`primitive`,typeof:[`unknown`],optional:!0});continue}switch(t.type){case`object`:{if(r.type!==`object`)continue;let{resolved_key_info:i}=ay(t.keys,r.keys),a={type:`object`,keys:i,optional:t.optional||r.optional};JSON.stringify(a)!==JSON.stringify(t)&&n.set(e,a)}break;case`renderer`:{if(r.type!==`renderer`)continue;let i={type:`renderer`,renderers:{...t.renderers,...r.renderers},optional:t.optional||r.optional};JSON.stringify({...i,renderers:Object.keys(i.renderers)})!==JSON.stringify({...t,renderers:Object.keys(t.renderers)})&&n.set(e,i)}break;case`array`:if(r.type!==`array`)continue;switch(t.array_type){case`renderer`:{if(r.array_type!==`renderer`){n.set(e,{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[`unknown`],optional:!0},optional:!0});continue}let i={type:`array`,array_type:`renderer`,renderers:{...t.renderers,...r.renderers},optional:t.optional||r.optional};JSON.stringify({...i,renderers:Object.keys(i.renderers)})!==JSON.stringify({...t,renderers:Object.keys(t.renderers)})&&n.set(e,i)}break;case`object`:{if(r.array_type===`primitive`&&r.items.typeof.length==1&&r.items.typeof[0]===`never`)continue;if(r.array_type!==`object`){n.set(e,{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[`unknown`],optional:!0},optional:!0});continue}let{resolved_key_info:i}=ay(t.items.keys,r.items.keys),a={type:`array`,array_type:`object`,items:{type:`object`,keys:i,optional:t.items.optional||r.items.optional},optional:t.optional||r.optional};JSON.stringify(a)!==JSON.stringify(t)&&n.set(e,a)}break;case`primitive`:{if(t.items.typeof.includes(`never`)&&r.array_type===`object`){n.set(e,r);continue}if(r.array_type!==`primitive`){n.set(e,{type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:[`unknown`],optional:!0},optional:!0});continue}let i=new Set([...r.items.typeof,...t.items.typeof]);i.size>1&&i.has(`never`)&&i.delete(`never`);let a={type:`array`,array_type:`primitive`,items:{type:`primitive`,typeof:Array.from(i),optional:t.items.optional||r.items.optional},optional:t.optional||r.optional};JSON.stringify(a)!==JSON.stringify(t)&&n.set(e,a)}break;default:throw Error(`Unreachable code reached! Switch missing case!`)}break;case`misc`:if(r.type!==`misc`)continue;switch(t.misc_type!==r.misc_type&&n.set(e,{type:`primitive`,typeof:[`unknown`],optional:!0}),t.misc_type){case`Author`:{if(r.misc_type!==`Author`)break;let i=t.params[1]||r.params[1],a={type:`misc`,misc_type:`Author`,optional:t.optional||r.optional,params:[r.params[0],i]};JSON.stringify(a)!==JSON.stringify(t)&&n.set(e,a)}}break;case`primitive`:{if(r.type!==`primitive`)continue;let i={type:`primitive`,typeof:Array.from(new Set([...r.typeof,...t.typeof])),optional:t.optional||r.optional};JSON.stringify(i)!==JSON.stringify(t)&&n.set(e,i)}}}}for(let[e,t]of a)n.set(e,{...t,optional:!0});for(let[e,t]of o)n.set(e,{...t,optional:!0});let l=e.filter(([e])=>!n.has(e));return{resolved_key_info:[...new Map([...l,...n]).entries()],changed_keys:[...n.entries()]}}var oy=class extends p{static type=`itemSectionContinuation`;contents;continuation;constructor(e){super(),this.contents=Y(e.contents),Array.isArray(e.continuations)&&(this.continuation=e.continuations?.at(0)?.nextContinuationData?.continuation)}},sy=class extends p{static type=`navigateAction`;endpoint;constructor(e){super(),this.endpoint=new B(e.endpoint)}},cy=class extends p{static type=`showMiniplayerCommand`;miniplayer_command;show_premium_branding;constructor(e){super(),this.miniplayer_command=new B(e.miniplayerCommand),this.show_premium_branding=e.showPremiumBranding}},ly=class extends p{static type=`reloadContinuationItemsCommand`;target_id;contents;slot;constructor(e){super(),this.target_id=e.targetId,this.contents=zy(e.continuationItems,!0),this.slot=e?.slot}},uy=class extends p{static type=`sectionListContinuation`;continuation;contents;constructor(e){super(),this.contents=zy(e.contents,!0),this.continuation=e.continuations?.[0]?.nextContinuationData?.continuation||e.continuations?.[0]?.reloadContinuationData?.continuation||null}},dy=class extends p{static type=`musicPlaylistShelfContinuation`;continuation;contents;constructor(e){super(),this.contents=zy(e.contents,!0),this.continuation=e.continuations?.[0].nextContinuationData.continuation||null}},fy=class extends p{static type=`musicShelfContinuation`;continuation;contents;constructor(e){super(),this.contents=Y(e.contents),this.continuation=e.continuations?.[0].nextContinuationData?.continuation||e.continuations?.[0].reloadContinuationData?.continuation||null}},py=class extends p{static type=`gridContinuation`;continuation;items;constructor(e){super(),this.items=zy(e.items,!0),this.continuation=e.continuations?.[0].nextContinuationData.continuation||null}get contents(){return this.items}},my=class extends p{static type=`playlistPanelContinuation`;continuation;contents;constructor(e){super(),this.contents=Y(e.contents),this.continuation=e.continuations?.[0]?.nextContinuationData?.continuation||e.continuations?.[0]?.nextRadioContinuationData?.continuation||null}},hy=class extends p{static type=`continuation`;continuation_type;timeout_ms;time_until_last_message_ms;token;constructor(e){super(),this.continuation_type=e.type,this.timeout_ms=e.continuation?.timeoutMs,this.time_until_last_message_ms=e.continuation?.timeUntilLastMessageMsec,this.token=e.continuation?.continuation}},gy=class extends p{static type=`liveChatContinuation`;actions;action_panel;item_list;header;participants_list;popout_message;emojis;continuation;viewer_name;constructor(e){super(),this.actions=zy(e.actions?.map(e=>(delete e.clickTrackingParams,e)),!0)||_([]),this.action_panel=J(e.actionPanel),this.item_list=J(e.itemList,Bm),this.header=J(e.header,zm),this.participants_list=J(e.participantsList,Um),this.popout_message=J(e.popoutMessage,bd),this.emojis=e.emojis?.map(e=>({emoji_id:e.emojiId,shortcuts:e.shortcuts,search_terms:e.searchTerms,image:V.fromResponse(e.image),is_custom_emoji:e.isCustomEmoji}))||[];let t,n;e.continuations?.[0].timedContinuationData?(n=`timed`,t=e.continuations?.[0].timedContinuationData):e.continuations?.[0].invalidationContinuationData?(n=`invalidation`,t=e.continuations?.[0].invalidationContinuationData):e.continuations?.[0].liveChatReplayContinuationData&&(n=`replay`,t=e.continuations?.[0].liveChatReplayContinuationData),this.continuation=new hy({continuation:t,type:n}),this.viewer_name=e.viewerName}},_y=class extends p{static type=`ContinuationCommand`;request;token;constructor(e){super(),this.request=e.request,this.token=e.token}};function vy(){return{key:void 0,value:void 0}}var yy={encode(e,n=new t){return e.key!==void 0&&n.uint32(10).string(e.key),e.value!==void 0&&n.uint32(18).string(e.value),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=vy();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.key=r.string();continue;case 2:if(e!==18)break;a.value=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function by(){return{xtags:[]}}var xy={encode(e,n=new t){for(let t of e.xtags)yy.encode(t,n.uint32(10).fork()).join();return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=by();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.xtags.push(yy.decode(r,r.uint32()));continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}},Sy=class{#e;itag;url;width;height;last_modified;last_modified_ms;content_length;quality;xtags;drm_families;fps;quality_label;projection_type;average_bitrate;bitrate;spatial_audio_type;target_duration_sec;fair_play_key_uri;stereo_layout;max_dvr_duration_sec;high_replication;audio_quality;approx_duration_ms;audio_sample_rate;audio_channels;loudness_db;signature_cipher;is_drc;is_vb;is_sr;drm_track_type;distinct_params;track_absolute_loudness_lkfs;mime_type;is_type_otf;init_range;index_range;cipher;audio_track;has_audio;has_video;has_text;language;is_dubbed;is_auto_dubbed;is_descriptive;is_secondary;is_original;color_info;caption_track;constructor(e,t){t&&(this.#e=t),this.itag=e.itag,this.mime_type=e.mimeType,this.is_type_otf=e.type===`FORMAT_STREAM_TYPE_OTF`,this.bitrate=e.bitrate,this.average_bitrate=e.averageBitrate,Reflect.has(e,`width`)&&Reflect.has(e,`height`)&&(this.width=parseInt(e.width),this.height=parseInt(e.height)),Reflect.has(e,`projectionType`)&&(this.projection_type=e.projectionType),Reflect.has(e,`stereoLayout`)&&(this.stereo_layout=e.stereoLayout?.replace(`STEREO_LAYOUT_`,``)),Reflect.has(e,`initRange`)&&(this.init_range={start:parseInt(e.initRange.start),end:parseInt(e.initRange.end)}),Reflect.has(e,`indexRange`)&&(this.index_range={start:parseInt(e.indexRange.start),end:parseInt(e.indexRange.end)}),this.last_modified=new Date(Math.floor(parseInt(e.lastModified)/1e3)),this.last_modified_ms=e.lastModified,Reflect.has(e,`contentLength`)&&(this.content_length=parseInt(e.contentLength)),Reflect.has(e,`quality`)&&(this.quality=e.quality),Reflect.has(e,`qualityLabel`)&&(this.quality_label=e.qualityLabel),Reflect.has(e,`fps`)&&(this.fps=e.fps),Reflect.has(e,`url`)&&(this.url=e.url),Reflect.has(e,`cipher`)&&(this.cipher=e.cipher),Reflect.has(e,`signatureCipher`)&&(this.signature_cipher=e.signatureCipher),Reflect.has(e,`audioQuality`)&&(this.audio_quality=e.audioQuality),this.approx_duration_ms=parseInt(e.approxDurationMs),Reflect.has(e,`audioSampleRate`)&&(this.audio_sample_rate=parseInt(e.audioSampleRate)),Reflect.has(e,`audioChannels`)&&(this.audio_channels=e.audioChannels),Reflect.has(e,`loudnessDb`)&&(this.loudness_db=e.loudnessDb),Reflect.has(e,`spatialAudioType`)&&(this.spatial_audio_type=e.spatialAudioType?.replace(`SPATIAL_AUDIO_TYPE_`,``)),Reflect.has(e,`maxDvrDurationSec`)&&(this.max_dvr_duration_sec=e.maxDvrDurationSec),Reflect.has(e,`targetDurationSec`)&&(this.target_duration_sec=e.targetDurationSec),this.has_audio=!!e.audioBitrate||!!e.audioQuality,this.has_video=!!e.qualityLabel,this.has_text=!!e.captionTrack,Reflect.has(e,`xtags`)&&(this.xtags=e.xtags),Reflect.has(e,`fairPlayKeyUri`)&&(this.fair_play_key_uri=e.fairPlayKeyUri),Reflect.has(e,`drmFamilies`)&&(this.drm_families=e.drmFamilies),Reflect.has(e,`drmTrackType`)&&(this.drm_track_type=e.drmTrackType),Reflect.has(e,`distinctParams`)&&(this.distinct_params=e.distinctParams),Reflect.has(e,`trackAbsoluteLoudnessLkfs`)&&(this.track_absolute_loudness_lkfs=e.trackAbsoluteLoudnessLkfs),Reflect.has(e,`highReplication`)&&(this.high_replication=e.highReplication),Reflect.has(e,`colorInfo`)&&(this.color_info={primaries:e.colorInfo.primaries?.replace(`COLOR_PRIMARIES_`,``),transfer_characteristics:e.colorInfo.transferCharacteristics?.replace(`COLOR_TRANSFER_CHARACTERISTICS_`,``),matrix_coefficients:e.colorInfo.matrixCoefficients?.replace(`COLOR_MATRIX_COEFFICIENTS_`,``)}),Reflect.has(e,`audioTrack`)&&(this.audio_track={audio_is_default:e.audioTrack.audioIsDefault,display_name:e.audioTrack.displayName,id:e.audioTrack.id}),Reflect.has(e,`captionTrack`)&&(this.caption_track={display_name:e.captionTrack.displayName,vss_id:e.captionTrack.vssId,language_code:e.captionTrack.languageCode,kind:e.captionTrack.kind,id:e.captionTrack.id});let n=this.xtags?xy.decode(ix(decodeURIComponent(this.xtags).replace(/-/g,`+`).replace(/_/g,`/`))).xtags:[];if(this.has_audio||this.has_text){if(this.language=n.find(e=>e.key===`lang`)?.value||null,this.has_audio){this.is_drc=!!e.isDrc||n.some(e=>e.key===`drc`&&e.value===`1`),this.is_vb=!!e.isVb||n.some(e=>e.key===`vb`&&e.value===`1`);let t=n.find(e=>e.key===`acont`)?.value;this.is_dubbed=t===`dubbed`,this.is_descriptive=t===`descriptive`,this.is_secondary=t===`secondary`,this.is_auto_dubbed=t===`dubbed-auto`,this.is_original=t===`original`||!this.is_dubbed&&!this.is_descriptive&&!this.is_secondary&&!this.is_auto_dubbed&&!this.is_drc}this.has_text&&!this.language&&this.caption_track&&(this.language=this.caption_track.language_code)}this.has_video&&(this.is_sr=n.some(e=>e.key===`sr`&&e.value===`1`))}async decipher(e){return e?e.decipher(this.url,this.signature_cipher,this.cipher,this.#e):this.url||``}},Cy=class{id;channel_id;title;duration;keywords;is_owner_viewing;short_description;thumbnail;allow_ratings;view_count;author;is_private;is_live;is_live_content;is_live_dvr_enabled;is_upcoming;is_crawlable;is_post_live_dvr;is_low_latency_live_stream;live_chunk_readahead;constructor(e){this.id=e.videoId,this.channel_id=e.channelId,this.title=e.title,this.duration=parseInt(e.lengthSeconds),this.keywords=e.keywords,this.is_owner_viewing=!!e.isOwnerViewing,this.short_description=e.shortDescription,this.thumbnail=V.fromResponse(e.thumbnail),this.allow_ratings=!!e.allowRatings,this.view_count=parseInt(e.viewCount),this.author=e.author,this.is_private=!!e.isPrivate,this.is_live=!!e.isLive,this.is_live_content=!!e.isLiveContent,this.is_live_dvr_enabled=!!e.isLiveDvrEnabled,this.is_low_latency_live_stream=!!e.isLowLatencyLiveStream,this.is_upcoming=!!e.isUpcoming,this.is_post_live_dvr=!!e.isPostLiveDvr,this.is_crawlable=!!e.isCrawlable,this.live_chunk_readahead=e.liveChunkReadahead}},wy=`Parser`,Ty=new Set([`AdSlot`,`DisplayAd`,`SearchPyv`,`MealbarPromo`,`PrimetimePromo`,`PromotedSparklesWeb`,`CompactPromotedVideo`,`BrandVideoShelf`,`BrandVideoSingleton`,`StatementBanner`,`GuideSigninPromo`,`AdsEngagementPanelContent`,`MiniGameCardView`,`GenAiFeedbackFormView`]),Ey=new Map(Object.entries(Nv)),Dy=new Map,Oy=null,ky=({classname:e,...t})=>{switch(t.error_type){case`parse`:t.error instanceof Error&&c(wy,new Q(`Something went wrong at ${e}!\nThis is a bug, please report it at ${E.bugs.url}`,{stack:t.error.stack,classdata:JSON.stringify(t.classdata,null,2)}));break;case`typecheck`:c(wy,new Hb(`Type mismatch, got ${e} expected ${Array.isArray(t.expected)?t.expected.join(` | `):t.expected}.`,t.classdata));break;case`mutation_data_missing`:c(wy,new Q(`Mutation data required for processing ${e}, but none found.\nThis is a bug, please report it at ${E.bugs.url}`));break;case`mutation_data_invalid`:c(wy,new Q(`Mutation data missing or invalid for ${t.failed} out of ${t.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${t.titles.join(`, `)}.\nThis is a bug, please report it at ${E.bugs.url}`));break;case`class_not_found`:c(wy,new Q(`${e} not found!\nThis is a bug, want to help us fix it? Follow the instructions at ${E.homepage.split(`#`,1)[0]}/blob/main/docs/updating-the-parser.md or report it at ${E.bugs.url}!\nIntrospected and JIT generated this class in the meantime:\n${Yv(e,t.key_info)}`));break;case`class_changed`:c(wy,`${e} changed!\nThe following keys where altered: ${t.changed_keys.map(([e])=>Iv(e)).join(`, `)}\nThe class has changed to:\n${Yv(e,t.key_info)}`);break;default:c(wy,`Unreachable code reached at ParserErrorHandler`)}};function Ay(){Oy=null}function jy(){Oy=new v}function My(e,t){if(!Oy)return;let n=Oy.get(e);if(!n)return Oy.set(e,[t]);n.push(t)}function Ny(){if(!Oy)throw Error(`Parser#getMemo() called before Parser#createMemo()`);return Oy}function Py(e){return Ty.has(e)}function Fy(e){return(e.charAt(0).toUpperCase()+e.slice(1)).replace(/Renderer|Model/g,``).replace(/Radio/g,`Mix`).trim()}function Iy(e){let t=Ey.get(e);if(!t){let t=Error(`Module not found: ${e}`);throw t.code=`MODULE_NOT_FOUND`,t}return t}function Ly(e){return Ey.has(e)}function Ry(e,t){Ey.set(e,t),Dy.set(e,t)}function q(e){let t={};jy();let n=zy(e.contents),r=Ny();n&&(t.contents=n,t.contents_memo=r),Ay(),jy();let i=e.onResponseReceivedActions?qy(e.onResponseReceivedActions):null,a=Ny();i&&(t.on_response_received_actions=i,t.on_response_received_actions_memo=a),Ay(),jy();let o=e.onResponseReceivedEndpoints?qy(e.onResponseReceivedEndpoints):null,s=Ny();o&&(t.on_response_received_endpoints=o,t.on_response_received_endpoints_memo=s),Ay(),jy();let c=e.onResponseReceivedCommands?qy(e.onResponseReceivedCommands):null,l=Ny();c&&(t.on_response_received_commands=c,t.on_response_received_commands_memo=l),Ay(),jy();let u=e.continuationContents?Ky(e.continuationContents):null,d=Ny();u&&(t.continuation_contents=u,t.continuation_contents_memo=d),Ay(),jy();let f=e.actions?Jy(e.actions):null,p=Ny();f&&(t.actions=f,t.actions_memo=p),Ay(),jy();let m=J(e.liveChatItemContextMenuSupportedRenderers),h=Ny();m&&(t.live_chat_item_context_menu_supported_renderers=m,t.live_chat_item_context_menu_supported_renderers_memo=h),Ay(),jy();let g=zy(e.header),_=Ny();g&&(t.header=g,t.header_memo=_),Ay(),jy();let v=J(e.sidebar),ee=Ny();v&&(t.sidebar=v,t.sidebar_memo=ee),Ay(),jy();let y=zy(e.items);y&&(t.items=y,t.items_memo=Ny()),Ay(),Xy(r,e.frameworkUpdates?.entityBatchUpdate?.mutations),s&&Zy(s,e.frameworkUpdates?.entityBatchUpdate?.mutations),e.frameworkUpdates?.entityBatchUpdate?.mutations&&(t.entity_mutations=e.frameworkUpdates.entityBatchUpdate.mutations);let b=e.continuation?Gy(e.continuation):null;b&&(t.continuation=b);let x=e.continuationEndpoint?Ky(e.continuationEndpoint):null;x&&(t.continuation_endpoint=x);let te=zy(e.metadata);te&&(t.metadata=te);let S=J(e.microformat);S&&(t.microformat=S);let C=J(e.overlay);C&&(t.overlay=C);let w=Y(e.alerts,[rc,ic]);w.length&&(t.alerts=w);let ne=e.refinements;ne&&(t.refinements=ne);let re=e.estimatedResults?parseInt(e.estimatedResults):null;re&&(t.estimated_results=re);let ie=zy(e.playerOverlays);ie&&(t.player_overlays=ie);let ae=J(e.background,yh);ae&&(t.background=ae);let oe=e.playbackTracking?{videostats_watchtime_url:e.playbackTracking.videostatsWatchtimeUrl.baseUrl,videostats_playback_url:e.playbackTracking.videostatsPlaybackUrl.baseUrl}:null;if(oe&&(t.playback_tracking=oe),e.playabilityStatus&&(jy(),t.playability_status={status:e.playabilityStatus.status,reason:e.playabilityStatus.reason||``,embeddable:!!e.playabilityStatus.playableInEmbed,audio_only_playability:J(e.playabilityStatus.audioOnlyPlayability,sc),error_screen:J(e.playabilityStatus.errorScreen),live_streamability:J(e.playabilityStatus.liveStreamability)},t.playability_status_memo=Ny(),Ay()),e.streamingData){let n=new Map;t.streaming_data={expires:new Date(Date.now()+parseInt(e.streamingData.expiresInSeconds)*1e3),formats:Yy(e.streamingData.formats,n),adaptive_formats:Yy(e.streamingData.adaptiveFormats,n),dash_manifest_url:e.streamingData.dashManifestUrl,hls_manifest_url:e.streamingData.hlsManifestUrl,server_abr_streaming_url:e.streamingData.serverAbrStreamingUrl}}e.playerConfig&&(t.player_config={audio_config:{loudness_db:e.playerConfig.audioConfig?.loudnessDb,perceptual_loudness_db:e.playerConfig.audioConfig?.perceptualLoudnessDb,enable_per_format_loudness:e.playerConfig.audioConfig?.enablePerFormatLoudness},stream_selection_config:{max_bitrate:e.playerConfig.streamSelectionConfig?.maxBitrate||`0`},media_common_config:{dynamic_readahead_config:{max_read_ahead_media_time_ms:e.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.maxReadAheadMediaTimeMs||0,min_read_ahead_media_time_ms:e.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.minReadAheadMediaTimeMs||0,read_ahead_growth_rate_ms:e.playerConfig.mediaCommonConfig?.dynamicReadaheadConfig?.readAheadGrowthRateMs||0},media_ustreamer_request_config:{video_playback_ustreamer_config:e.playerConfig.mediaCommonConfig?.mediaUstreamerRequestConfig?.videoPlaybackUstreamerConfig}}});let T=e.currentVideoEndpoint?new B(e.currentVideoEndpoint):null;T&&(t.current_video_endpoint=T);let se=e.endpoint?new B(e.endpoint):null;se&&(t.endpoint=se);let ce=J(e.captions,hg);ce&&(t.captions=ce);let le=e.videoDetails?new Cy(e.videoDetails):null;le&&(t.video_details=le);let E=Y(e.annotations,pg);E.length&&(t.annotations=E);let de=J(e.storyboards,[ue,Cg]);de&&(t.storyboards=de);let fe=J(e.endscreen,Jf);fe&&(t.endscreen=fe);let pe=J(e.cards,au);pe&&(t.cards=pe);let D=Y(e.engagementPanels,Ql);D.length&&(t.engagement_panels=D);let me=J(e.content);return me&&(t.content=me),e.bgChallenge&&(t.bg_challenge={interpreter_url:{private_do_not_access_or_else_trusted_resource_url_wrapped_value:e.bgChallenge.interpreterUrl.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue,private_do_not_access_or_else_safe_script_wrapped_value:e.bgChallenge.interpreterUrl.privateDoNotAccessOrElseSafeScriptWrappedValue},interpreter_hash:e.bgChallenge.interpreterHash,program:e.bgChallenge.program,global_name:e.bgChallenge.globalName,client_experiments_state_blob:e.bgChallenge.clientExperimentsStateBlob}),e.challenge&&(t.challenge=e.challenge),e.playerResponse&&(t.player_response=q(e.playerResponse)),e.watchNextResponse&&(t.watch_next_response=q(e.watchNextResponse)),e.cpnInfo&&(t.cpn_info={cpn:e.cpnInfo.cpn,cpn_source:e.cpnInfo.cpnSource}),e.entries&&(t.entries=e.entries.map(e=>new B(e))),e.targetId&&(t.target_id=e.targetId),`pollDelayMs`in e&&(t.poll_delay_ms=e.pollDelayMs),`stopHeartbeat`in e&&(t.stop_heartbeat=e.stopHeartbeat),`heartbeatServerData`in e&&(t.heartbeat_server_data=e.heartbeatServerData),`heartbeatParams`in e&&(t.heartbeat_params={heartbeat_token:e.heartbeatParams?.heartbeatToken,interval_milliseconds:e.heartbeatParams?.intervalMilliseconds,max_retries:e.heartbeatParams?.maxRetries,drm_session_id:e.heartbeatParams?.drmSessionId,soft_fail_on_error:e.heartbeatParams?.softFailOnError,heartbeat_server_data:e.heartbeatParams?.heartbeatServerData}),t}function J(e,t){if(!e)return null;let n=Object.keys(e);if(!n.length)return null;let r=Fy(n[0]);if(!Py(r))try{let i=Ly(r)?Iy(r):Jv(r,e[n[0]],ky);if(t){if(Array.isArray(t)){if(!t.some(e=>e.type===i.type))return ky({classdata:e[n[0]],classname:r,error_type:`typecheck`,expected:t.map(e=>e.type)}),null}else if(i.type!==t.type)return ky({classdata:e[n[0]],classname:r,error_type:`typecheck`,expected:t.type}),null}let a=new i(e[n[0]]);return My(r,a),a}catch(t){return ky({classname:r,classdata:e[n[0]],error:t,error_type:`parse`}),null}return null}function Y(e,t){if(Array.isArray(e)){let n=[];for(let r of e){let e=J(r,t);e&&n.push(e)}return _(n)}if(!e)return _([]);throw new Hb(`Expected array but got a single item`)}function zy(e,t,n){if(!e)return null;if(Array.isArray(e)){let r=[];for(let t of e){let e=J(t,n);e&&r.push(e)}let i=_(r);return t?i:new g(i)}if(t)throw new Hb(`Expected array but got a single item`);return new g(J(e,n))}var By=/Command$/,Vy=/Endpoint$/,Hy=/Action$/;function Uy(e){let t=[];try{t=Object.keys(e)}catch{}for(let n of t){let t=e[n];if(By.test(n)||Vy.test(n)||Hy.test(n)){let e=Fy(n);if(Py(e))return;try{if(Ly(e))return new(Iy(e))(t)}catch(n){ky({error:n,classname:e,classdata:t,error_type:`parse`})}}}}function Wy(e){if(Array.isArray(e)){let t=[];for(let n of e){let e=Uy(n);e&&t.push(e)}return _(t)}if(!e)return _([]);throw new Hb(`Expected array but got a single item`)}function Gy(e){return e.timedContinuationData?new hy({continuation:e.timedContinuationData,type:`timed`}):null}function Ky(e){return e.itemSectionContinuation?new oy(e.itemSectionContinuation):e.sectionListContinuation?new uy(e.sectionListContinuation):e.liveChatContinuation?new gy(e.liveChatContinuation):e.musicPlaylistShelfContinuation?new dy(e.musicPlaylistShelfContinuation):e.musicShelfContinuation?new fy(e.musicShelfContinuation):e.gridContinuation?new py(e.gridContinuation):e.playlistPanelContinuation?new my(e.playlistPanelContinuation):e.continuationCommand?new _y(e.continuationCommand):null}function qy(e){return _(e.map(e=>{if(e.navigateAction)return new sy(e.navigateAction);if(e.showMiniplayerCommand)return new cy(e.showMiniplayerCommand);if(e.reloadContinuationItemsCommand)return new ly(e.reloadContinuationItemsCommand);if(e.appendContinuationItemsAction)return new Fs(e.appendContinuationItemsAction);if(e.openPopupAction)return new hs(e.openPopupAction)}).filter(e=>e))}function Jy(e){return Array.isArray(e)?zy(e.map(e=>(delete e.clickTrackingParams,e))):new g(J(e))}function Yy(e,t){return e?.map(e=>new Sy(e,t))||[]}function Xy(e,t){let n=e.getType(nh);if(n.length>0&&!t)ky({error_type:`mutation_data_missing`,classname:`MusicMultiSelectMenuItem`});else{let e=[];for(let r of n){let n=t.find(e=>e.payload?.musicFormBooleanChoice?.id===r.form_item_entity_key)?.payload.musicFormBooleanChoice;n?.selected!==void 0&&n?.opaqueToken?r.selected=n.selected:e.push(`'${r.title}'`)}e.length>0&&ky({error_type:`mutation_data_invalid`,classname:`MusicMultiSelectMenuItem`,total:n.length,failed:e.length,titles:e})}if(t){let n=t.filter(e=>e.payload?.macroMarkersListEntity&&e.payload.macroMarkersListEntity.markersList?.markerType===`MARKER_TYPE_HEATMAP`);for(let t of n){let n=new Jm(t.payload.macroMarkersListEntity),r=e.get(`MacroMarkersListEntity`);r?r.push(n):e.set(`MacroMarkersListEntity`,[n])}}}function Zy(e,t){let n=e.getType(Zu);if(n.length>0){t||ky({error_type:`mutation_data_missing`,classname:`CommentView`});for(let e of n){let n=t.find(t=>t.payload?.commentEntityPayload?.key===e.keys.comment)?.payload?.commentEntityPayload,r=t.find(t=>t.payload?.engagementToolbarStateEntityPayload?.key===e.keys.toolbar_state)?.payload?.engagementToolbarStateEntityPayload,i=t.find(t=>t.entityKey===e.keys.toolbar_surface)?.payload?.engagementToolbarSurfaceEntityPayload,a=t.find(t=>t.payload?.commentSurfaceEntityPayload?.key===e.keys.comment_surface)?.payload?.commentSurfaceEntityPayload;e.applyMutations(n,r,i,a)}}}var Qy=class{#e;contents;constructor(e){if(this.#e=q(e.data),!this.#e.contents)throw new Q(`Page contents not found`);let t=this.#e.contents.array().as(Ps)[0];if(!t)throw new Q(`Account section list not found`);this.contents=t.contents[0]}get page(){return this.#e}},$y=class e{#e;#t;#n;#r;constructor(e,t,n=!1){this.#e=this.#i(t)||n?t:q(t.data);let r=tx(this.#e.contents_memo,this.#e.continuation_contents_memo,this.#e.on_response_received_commands_memo,this.#e.on_response_received_endpoints_memo,this.#e.on_response_received_actions_memo,this.#e.sidebar_memo,this.#e.header_memo);if(!r)throw new Q(`No memo found in feed`);this.#n=r,this.#t=e}#i(e){return!(`data`in e)}static getVideosFromMemo(e){return _(e.getType(fl,_p,Xg,E_,wl,qm,Ig,Uh,Sv).filter(e=>!e.is(qm)||e.content_type===`VIDEO`||e.content_type===`MOVIE`||e.content_type===`SHORT`||e.content_type==`STATION`))}static getPlaylistsFromMemo(e){let t=e.getType(dd,fp,gp),n=e.getType(qm).filter(e=>[`PLAYLIST`,`ALBUM`,`PODCAST`,`SHOW`,`COURSE`].includes(e.content_type));return n.length>0&&t.push(...n),t}get videos(){return e.getVideosFromMemo(this.#n)}get posts(){return this.#n.getType(Ac,zg,b_)}get channels(){return this.#n.getType(du,cp)}get playlists(){return e.getPlaylistsFromMemo(this.#n)}get memo(){return this.#n}get page_contents(){let e=this.#n.getType(M_)?.[0].content,t=this.#n.getType(ly)[0],n=this.#n.getType(Fs)[0];return e||t||n}get shelves(){return this.#n.getType(T_,a_,Ml)}getShelf(e){return this.shelves.find(t=>t.title.toString()===e)}get secondary_contents(){if(!this.#e.contents?.is_node)return null;let e=this.#e.contents?.item();return e.is(lv,uv)?e.secondary_contents:null}get actions(){return this.#t}get page(){return this.#e}get has_continuation(){return this.#a().length>0}async getContinuationData(){if(this.#r){if(this.#r.length===0)throw new Q(`There are no continuations`);return await this.#r[0].endpoint.call(this.#t,{parse:!0})}if(this.#r=this.#a(),this.#r)return this.getContinuationData()}async getContinuation(){let t=await this.getContinuationData();if(!t)throw new Q(`Could not get continuation data`);return new e(this.actions,t,!0)}#a(){if(this.#e.header_memo){let e=this.#e.header_memo.getType(G,yd);return this.#n.getType(G,yd).filter(t=>!e.includes(t))}return this.#n.getType(G,yd)}},eb=class e extends $y{#e;constructor(e,t,n=!1){super(e,t,n)}get filter_nodes(){if(this.#e)return this.#e;let e,t;if(this.memo.getType(Ul)?.length>1)throw new Q(`There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page`);if(this.memo.has(`FeedFilterChipBar`))e=this.memo.getType(Hl);else if(this.memo.has(`ChipView`)){let n=this.memo.getType(Wl),r=n[0];if(r.is(Wl)){if(r.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN`||r.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN_WITH_CLEAR`){let i=r.tap_command?.command;i?.is(Uu)&&i.inline_content?.is(w_)&&i.inline_content.content?.is(Bd)&&(e=i.inline_content.content.items.as(Ec)),t=_(n.slice(1))}else e=n}}return this.#e={primary_filters:e,secondary_filters:t},this.#e}get filters(){return this.filter_nodes?.primary_filters?.map(e=>e.is(Wl)||e.is(Hl)?e.text?.toString()||``:e.is(Ec)&&e.title?.toString()||``)||[]}get secondary_filters(){return this.filter_nodes?.secondary_filters?.map(e=>e.text?.toString()||``)||[]}async getFilteredFeed(t,n){let r,i=!1;if(typeof t==`string`){if(!this.filters.includes(t))throw new Q(`Filter '${t}' not found`,{available_filters:this.filters});for(let e of this.filter_nodes.primary_filters||[])(e.is(Wl)||e.is(Hl))&&e.text?.toString()===t?(r=e.is(Wl)?e.tap_command:e.endpoint,i=e.is(Wl)?e.selected:e.is_selected):e.is(Ec)&&e.title?.toString()===t&&(r=e?.renderer_context?.command_context?.on_tap,i=e.is_selected)}else if([`ChipCloudChip`,`ChipView`,`ListItemView`].includes(t.type))t.is(Wl)?r=t.tap_command:t.is(Hl)?r=t.endpoint:t.is(Ec)&&(r=t?.renderer_context?.command_context?.on_tap),i=t.is(Wl)?t.selected:t.is_selected;else throw new Q(`Invalid primary filter type`);if(!r)throw new Q(`Could not find endpoint for the specified filter`);if(i&&!n)return this;let a=i?this.page:await r.call(this.actions,{parse:!0});if(n){let t=new e(this.actions,a,!0),r;if(typeof n==`string`){if(!t.secondary_filters.includes(n))throw new Q(`Secondary filter '${n}' not found`,{available_filters:t.secondary_filters});r=t.filter_nodes.secondary_filters?.find(e=>e.text?.toString()===n)}else if(n.is(Wl))r=n;else throw new Q(`Invalid secondary filter type`);if(r&&!r.selected){let e=r?.tap_command||r?.endpoint;if(!e)throw new Q(`Could not find an endpoint for the specified secondary filter`);a=await e.call(this.actions,{parse:!0})}}if(!a)throw new Q(`Failed to fetch data for the specified filter`);return new $y(this.actions,a,!0)}},tb=class{#e;#t;#n;#r;basic_info;annotations;storyboards;endscreen;captions;cards;streaming_data;playability_status;player_config;constructor(e,t,n){this.#t=t;let r=q(e[0].data.playerResponse?e[0].data.playerResponse:e[0].data),i=e[1]?.data?q(e[1].data):void 0;if(this.#e=[r,i],this.#n=n,r.playability_status?.status===`ERROR`)throw new Q(`This video is unavailable`,r.playability_status);if(r.microformat&&!r.microformat?.is(wg,uh))throw new Q(`Unsupported microformat`,r.microformat);this.basic_info={...r.video_details,embed:r.microformat?.is(wg)?r.microformat?.embed:null,channel:r.microformat?.is(wg)?r.microformat?.channel:null,is_unlisted:r.microformat?.is_unlisted,is_family_safe:r.microformat?.is_family_safe,category:r.microformat?.is(wg)?r.microformat?.category:null,has_ypc_metadata:r.microformat?.is(wg)?r.microformat?.has_ypc_metadata:null,publish_date:r.microformat?.is(wg)?r.microformat.publish_date:null,upload_date:r.microformat?.is(wg)?r.microformat.upload_date:null,start_timestamp:r.microformat?.is(wg)?r.microformat.start_timestamp:null,end_timestamp:r.microformat?.is(wg)?r.microformat.end_timestamp:null,view_count:r.microformat?.is(wg)&&isNaN(r.video_details?.view_count)?r.microformat.view_count:r.video_details?.view_count,url_canonical:r.microformat?.is(uh)?r.microformat?.url_canonical:null,tags:r.microformat?.is(uh)?r.microformat?.tags:null,like_count:void 0,is_liked:void 0,is_disliked:void 0},this.annotations=r.annotations,this.storyboards=r.storyboards,this.endscreen=r.endscreen,this.captions=r.captions,this.cards=r.cards,this.streaming_data=r.streaming_data,this.playability_status=r.playability_status,this.player_config=r.player_config,this.#r=r.playback_tracking}async toDash(e={}){let t=this.#e[0],n=e.manifest_options||{};if(t.video_details&&t.video_details.is_live)throw new Q("Generating DASH manifests for live videos is not supported. Please use the DASH and HLS manifests provided by YouTube in `streaming_data.dash_manifest_url` and `streaming_data.hls_manifest_url` instead.");let r,i;return n.include_thumbnails&&t.storyboards&&(r=t.storyboards),typeof n.captions_format==`string`&&t.captions?.caption_tracks&&(i=t.captions.caption_tracks),ze(this.streaming_data,this.page[0].video_details?.is_post_live_dvr,e.url_transformer,e.format_filter,this.#n,this.#t.session.player,this.#t,r,i,n)}getStreamingInfo(e,t){return Pe(this.streaming_data,this.page[0].video_details?.is_post_live_dvr,e,t,this.cpn,this.#t.session.player,this.#t,this.#e[0].storyboards?this.#e[0].storyboards:void 0)}chooseFormat(e){return Ve(e,this.streaming_data)}async download(e={}){let t=this.#e[0];if(t.video_details&&(t.video_details.is_live||t.video_details.is_post_live_dvr))throw new Q(`Downloading is not supported for live and Post-Live-DVR videos, as they are split up into 5 second segments that are individual files, which require using a tool such as ffmpeg to stitch them together, so they cannot be returned in a single stream.`);return Be(e,this.#t,this.playability_status,this.streaming_data,this.#t.session.player,this.cpn)}async getTranscript(){let e=this.page[1];if(!e)throw new Q(`Cannot get transcript from basic video info.`);if(!e.engagement_panels)throw new Q(`Engagement panels not found. Video likely has no transcript.`);let t=e.engagement_panels.find(e=>e.panel_identifier===`engagement-panel-searchable-transcript`);if(!t)throw new Q(`Transcript panel not found. Video likely has no transcript.`);let n=t.content?.as(G);if(!n)throw new Q(`Transcript continuation not found.`);let r=await n.endpoint.call(this.actions);return new Sb(this.actions,r)}async addToWatchHistory(e,t,n=`https://www.`){if(!this.#r)throw new Q(`Playback tracking not available`);let r={cpn:this.#n,fmt:251,rtn:0,rt:0},i=this.#r.videostats_playback_url.replace(`https://s.`,n);return await this.#t.stats(i,{client_name:e||S.WEB.NAME,client_version:t||S.WEB.VERSION},r)}async updateWatchTime(e,t=S.WEB.NAME,n=S.WEB.VERSION,r=`https://www.`){if(!this.#r)throw new Q(`Playback tracking not available`);let i={cpn:this.#n,st:e.toFixed(3),et:e.toFixed(3),cmt:e.toFixed(3),final:`1`},a=this.#r.videostats_watchtime_url.replace(`https://s.`,r);return await this.#t.stats(a,{client_name:t,client_version:n},i)}get actions(){return this.#t}get cpn(){return this.#n}get page(){return this.#e}},nb=class e extends $y{#e;#t;constructor(e,t,n=!1){super(e,t,n),this.#e=e,this.#t=this.page.contents_memo?.getType(M_)}get tabs(){return this.#t?.map(e=>e.title.toString())??[]}async getTabByName(t){let n=this.#t?.find(e=>e.title.toLowerCase()===t.toLowerCase());if(!n)throw new Q(`Tab "${t}" not found`);if(n.selected)return this;let r=await n.endpoint.call(this.#e);return new e(this.#e,r,!1)}async getTabByURL(t){let n=this.#t?.find(e=>e.endpoint.metadata.url?.split(`/`).pop()===t);if(!n)throw new Q(`Tab "${t}" not found`);if(n.selected)return this;let r=await n.endpoint.call(this.#e);return new e(this.#e,r,!1)}hasTabWithURL(e){return this.#t?.some(t=>t.endpoint.metadata.url?.split(`/`).pop()===e)??!1}get title(){return this.page.contents_memo?.getType(M_)?.find(e=>e.selected)?.title.toString()}},rb=class e extends nb{header;metadata;subscribe_button;current_tab;#e;constructor(e,t,n=!1){super(e,t,n),this.header=this.page.header?.item()?.as(nu,ou,Rp,lg);let r=this.page.metadata?.item().as(hu),i=this.page.microformat?.as(uh);if(this.page.alerts){let e=this.page.alerts[0];if(e?.alert_type===`ERROR`)throw new qb(e.text.toString())}if(!r&&!this.page.contents)throw new Q(`Invalid channel`,this);this.metadata={...r,...i||{}},this.subscribe_button=this.page.header_memo?.getType(tu)[0],this.page.contents&&(this.current_tab=this.page.contents.item().as(lv).tabs.find(e=>e.selected))}async applyFilter(e,t){let n=this.memo.getType(Gl)[0];if(!n)throw new Q(`Filter chip bar not found`);let r;if(typeof e==`string`){if(!this.filters.includes(e))throw new Q(`Filter '${e}' not found`,{available_filters:this.filters});let t=n.chips.find(e=>e.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN`);if(t){let n=t.tap_command?.command;n?.is(Uu)&&n.inline_content?.is(w_)&&n.inline_content.content?.is(Bd)&&(r=n.inline_content.content.items.as(Ec).find(t=>t.title?.toString()===e)?.renderer_context?.command_context?.on_tap?.as(B))}else r=n.chips.find(t=>t.text===e)?.endpoint}else if(e.is(Wl))r=e.endpoint;else if(e.is(Ec))r=e.renderer_context?.command_context?.on_tap?.as(B);else throw new Q(`Invalid primary filter type`);if(!r)throw new Q(`Could not find endpoint for the specified filter`);let i=await r.call(this.actions,{parse:!0}),a=new ab(this.actions,i,!0);return t&&(a=await a.applyFilter(e,t)),a}async applySort(t){let n=this.memo.getType(Us)[0];if(!n||!n.sub_menu_items)throw new Q(`No sort filter sub menu found`);let r=n.sub_menu_items.find(e=>e.title===t);if(!r)throw new Q(`Sort filter '${t}' not found`,{available_sort_filters:this.sort_filters});if(r.selected)return this;let i=await r.endpoint.call(this.actions,{parse:!0});return new e(this.actions,i,!0)}async applyContentTypeFilter(t){let n=this.current_tab?.content?.as(K).sub_menu?.as(yu);if(!n)throw new Q(`Sub menu not found`);let r=n.content_type_sub_menu_items.find(e=>e.title===t);if(!r)throw new Q(`Sub menu item '${t}' not found`,{available_filters:this.content_type_filters});if(r.selected)return this;let i=await r.endpoint.call(this.actions,{parse:!0});return new e(this.actions,i,!0)}get filter_nodes(){if(this.#e)return this.#e;let e,t;if(this.memo.getType(Ul)?.length>1)throw new Q(`There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page`);if(this.memo.has(`FeedFilterChipBar`))e=this.memo.getType(Hl);else if(this.memo.has(`ChipView`)){let n=this.memo.getType(Wl),r=n[0];if(r.is(Wl)){if(r.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN`||r.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN_WITH_CLEAR`){let i=r.tap_command?.command;i?.is(Uu)&&i.inline_content?.is(w_)&&i.inline_content.content?.is(Bd)&&(e=i.inline_content.content.items.as(Ec)),t=_(n.slice(1))}else e=n}}return this.#e={primary_filters:e,secondary_filters:t},this.#e}get filters(){return this.filter_nodes?.primary_filters?.map(e=>e.is(Wl)||e.is(Hl)?e.text?.toString()||``:e.is(Ec)&&e.title?.toString()||``)||[]}get secondary_filters(){return this.filter_nodes?.secondary_filters?.map(e=>e.text?.toString()||``)||[]}get sort_filters(){return this.memo.getType(Us)[0]?.sub_menu_items?.map(e=>e.title)||[]}get content_type_filters(){return(this.current_tab?.content?.as(K).sub_menu?.as(yu))?.content_type_sub_menu_items.map(e=>e.title)||[]}async getHome(){let t=await this.getTabByURL(`featured`);return new e(this.actions,t.page,!0)}async getVideos(){let t=await this.getTabByURL(`videos`);return new e(this.actions,t.page,!0)}async getShorts(){let t=await this.getTabByURL(`shorts`);return new e(this.actions,t.page,!0)}async getLiveStreams(){let t=await this.getTabByURL(`streams`);return new e(this.actions,t.page,!0)}async getReleases(){let t=await this.getTabByURL(`releases`);return new e(this.actions,t.page,!0)}async getPodcasts(){let t=await this.getTabByURL(`podcasts`);return new e(this.actions,t.page,!0)}async getCourses(){let t=await this.getTabByURL(`courses`);return new e(this.actions,t.page,!0)}async getShows(){let t=await this.getTabByURL(`shows`);return new e(this.actions,t.page,!0)}async getPlaylists(){let t=await this.getTabByURL(`playlists`);return new e(this.actions,t.page,!0)}async getCommunity(){let t=await this.getTabByURL(`posts`);return new e(this.actions,t.page,!0)}async getAbout(){if(this.hasTabWithURL(`about`))return(await this.getTabByURL(`about`)).memo.getType(fu)[0];let e=this.header?.is(nu)&&this.header.tagline;if(e||this.header?.is(lg)&&this.header.content?.description){if(e&&e.more_endpoint instanceof B){let t=await e.more_endpoint.call(this.actions);return new nb(this.actions,t,!1).memo.getType(fu)[0]}let t=this.page.header_memo?.getType(G)[0]?.endpoint;if(!t)throw new Q(`Failed to extract continuation to get channel about`);let n=await t.call(this.actions,{parse:!0});if(!n.on_response_received_endpoints_memo)throw new Q(`Unexpected response while fetching channel about`,{response:n});return n.on_response_received_endpoints_memo.getType(Os)[0]}throw new Q(`About not found`)}async search(t){let n=this.memo.getType(Qf)?.[0];if(!n)throw new Q(`Search tab not found`,this);let r=await n.endpoint.call(this.actions,{query:t,parse:!0});return new e(this.actions,r,!0)}get has_home(){return this.hasTabWithURL(`featured`)}get has_videos(){return this.hasTabWithURL(`videos`)}get has_shorts(){return this.hasTabWithURL(`shorts`)}get has_live_streams(){return this.hasTabWithURL(`streams`)}get has_releases(){return this.hasTabWithURL(`releases`)}get has_podcasts(){return this.hasTabWithURL(`podcasts`)}get has_courses(){return this.hasTabWithURL(`courses`)}get has_shows(){return this.hasTabWithURL(`shows`)}get has_playlists(){return this.hasTabWithURL(`playlists`)}get has_community(){return this.hasTabWithURL(`posts`)}get has_about(){return this.hasTabWithURL(`about`)||!!(this.header?.is(nu)&&this.header.tagline?.more_endpoint)||!!(this.header?.is(lg)&&this.header.content?.description?.more_endpoint)}get has_search(){return this.memo.getType(Qf)?.length>0}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new Q(`Could not get continuation data`);return new ib(this.actions,e,!0)}},ib=class e extends $y{contents;constructor(e,t,n=!1){super(e,t,n),this.contents=this.page.on_response_received_actions?.[0]||this.page.on_response_received_endpoints?.[0]}async getContinuation(){let t=await super.getContinuationData();if(!t)throw new Q(`Could not get continuation data`);return new e(this.actions,t,!0)}},ab=class e extends eb{filter;secondary_filter;contents;constructor(e,t,n=!1){super(e,t,n);let r=this.memo.getType(Gl)[0];if(r){let e=r.chips[0];if(e.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN`||e.display_type===`CHIP_VIEW_MODEL_DISPLAY_TYPE_DROP_DOWN_WITH_CLEAR`){this.secondary_filter=r.chips.slice(1).find(e=>e.selected);let t=e.tap_command?.command;t?.is(Uu)&&t.inline_content?.is(w_)&&t.inline_content.content?.is(Bd)&&(this.filter=t.inline_content.content.items.as(Ec).find(e=>e.is_selected))}else this.filter=r.chips.find(e=>e.selected)}this.page.on_response_received_actions&&this.page.on_response_received_actions.length>1&&this.page.on_response_received_actions.shift(),this.contents=this.page.on_response_received_actions?.[0]}async applyFilter(t,n){let r=await super.getFilteredFeed(t,n);return new e(this.actions,r.page,!0)}async getContinuation(){let t=await super.getContinuationData();if(!t?.on_response_received_actions_memo)throw new Q(`Unexpected continuation data`,t);return this.memo.has(`FeedFilterChipBar`)&&t.on_response_received_actions_memo.set(`FeedFilterChipBar`,this.memo.getType(Ul)),this.memo.has(`ChipCloudChip`)&&t.on_response_received_actions_memo.set(`ChipCloudChip`,this.memo.getType(Hl)),this.memo.has(`ChipBarView`)&&t.on_response_received_actions_memo.set(`ChipBarView`,this.memo.getType(Gl)),this.memo.has(`ChipView`)&&t.on_response_received_actions_memo.set(`ChipView`,this.memo.getType(Wl)),new e(this.actions,t,!0)}},ob=class e{#e;#t;#n;header;contents;constructor(e,t,n=!1){this.#e=n?t:q(t),this.#t=e;let r=this.#e.on_response_received_endpoints;if(!r)throw new Q(`The comments page did not have any content`);let i=r.at(0)?.as(Fs,ly),a=r.at(1)?.as(Fs,ly);this.header=i?.contents?.firstOfType(Bl);let o=a?.contents?.filterType($u)||[];this.contents=_(o.map(e=>(e.comment&&e.comment.setActions(this.#t),e.setActions(this.#t),e.processRepliesData(),e))),this.#n=a?.contents?.firstOfType(G)}async applySort(t){if(!this.header)throw new Q(`Could not apply sort because the comments header is missing`);let n;if(t===`TOP_COMMENTS`?n=this.header.sort_menu?.sub_menu_items?.at(0):t===`NEWEST_FIRST`&&(n=this.header.sort_menu?.sub_menu_items?.at(1)),!n)throw new Q(`Could not apply sort because the sort button is missing`);if(n.selected)return this;let r=await n.endpoint.call(this.#t,{parse:!0});return new e(this.#t,r,!0)}async createComment(e){if(!this.header)throw new Q(`Comment could not be created because the page header is missing`);let t=this.header.create_renderer?.as(id).submit_button;if(!t)throw new Q(`Comment could not be created because the comment button is missing`);if(!t.endpoint)throw new Q(`Comment could not be created because the comment button does not have an endpoint`);return await t.endpoint.call(this.#t,{commentText:e})}async getContinuation(){if(!this.#n)throw new Q(`No continuation item found`);let t=await this.#n.endpoint.call(this.#t,{parse:!0}),n=Object.assign({},this.#e);if(!n.on_response_received_endpoints||!t.on_response_received_endpoints)throw new Q(`Invalid reponse format, missing on_response_received_endpoints`);return n.on_response_received_endpoints.pop(),n.on_response_received_endpoints.push(t.on_response_received_endpoints[0]),new e(this.#t,n,!0)}get has_continuation(){return!!this.#n}get page(){return this.#e}},sb=class{#e;contents;constructor(e){this.#e=q(e),this.#e.items&&(this.contents=this.#e.items.array().as(Sp,Cp))}get page(){return this.#e}},cb=class e extends $y{sections;feed_actions;constructor(e,t,n=!1){super(e,t,n),this.sections=this.memo.getType(ql),this.feed_actions=this.memo.getType(Lc)[0]}get is_watch_history_paused(){return this.#t(`resume`)!==void 0}async pauseWatchHistory(){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return await this.#n(this.#t(`pause`))}async resumeWatchHistory(){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return await this.#n(this.#t(`resume`))}async clearWatchHistory(){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return await this.#n(this.#t(`clear`))}async getContinuation(){let t=await this.getContinuationData();if(!t)throw Error(`No continuation data found`);return new e(this.actions,t,!0)}async search(t){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);let n=this.feed_actions?.contents.firstOfType(Ic);if(!n)throw new Q(`Search box not found in watch history feed actions`);let r=await n.endpoint.call(this.actions,{query:t});return new e(this.actions,r)}async removeVideo(e,t=1){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);let n=this;for(let r=t;r>0;r--){let t=this.#e(n.sections,e);if(t)return n.#n(t);if(r===1)break;try{n=await n.getContinuation()}catch{}}throw Error(`Video not found in watch history (ID: ${e})`)}#e(e,t){for(let n of e)for(let e of n.contents)if(e.is(fl)&&e.video_id===t&&e.menu){let t=e.menu.items.find(e=>e.is(Sc)&&e.icon_type===`DELETE`)?.as(Sc)?.endpoint;if(t)return t}else if(e.is(qm)&&e.content_id===t){let t=e.metadata?.menu_button?.on_tap?.command;if(t?.is(Uu)&&t.inline_content?.is(w_)&&t.inline_content.content?.is(Bd)){let e=(t.inline_content.content.items.find(e=>e.is(Ec)&&e.leading_image[0].client_resource?.image_name===`DELETE`)?.as(Ec))?.renderer_context?.command_context?.on_tap;if(e?.command?.is(ff))return e;if(e?.command?.is(rf)&&e.command.content?.confirm_endpoint?.is(ff))return e.command.content.confirm_endpoint}}}#t(e){let t={clear:`DELETE`,pause:`PAUSE_OUTLINED`,resume:`PLAY_OUTLINED`};for(let n of this.feed_actions?.contents??[]){if(!n.is(z)||n.icon_type!==t[e])continue;let r=n.endpoint.command;if(r?.is(rf)&&r.content?.confirm_endpoint)return r.content.confirm_endpoint}}async#n(e){if(!e)throw new Q(`Watch history controls were not found in the feed actions`);return!!(await e.call(this.actions,{parse:!1})).data.feedbackResponses?.[0]?.isProcessed}},lb=class e extends eb{contents;header;constructor(e,t,n=!1){super(e,t,n),this.header=this.memo.getType(np)[0],this.contents=this.memo.getType($g)[0]||this.page.on_response_received_actions?.[0]}async applyFilter(t){let n=await super.getFilteredFeed(t);return new e(this.actions,n.page,!0)}async getContinuation(){let t=await super.getContinuation();return t.page.header=this.page.header,this.header&&t.page.header_memo?.set(this.header.type,[this.header]),new e(this.actions,t.page,!0)}},ub=class e extends eb{header;contents;constructor(e,t){if(super(e,t),!this.page.contents_memo)throw new Q(`Unexpected response`,this.page);let n=this.page.contents_memo.getType(M_)[0];if(!n.content)throw new Q(`Content tab has no content`,n);this.page.header&&(this.header=this.page.header.item().as(wp,lg)),this.contents=n.content.as($g)}async applyFilter(t){let n=await super.getFilteredFeed(t);return new e(this.actions,n.page)}},db=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#t=t;let n=e?.live_chat_item_context_menu_supported_renderers;if(!n||!n.is(W))throw new Q(`Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.`);this.#n=n.as(W).items}async selectItem(e){let t;if(e instanceof z){if(!e.endpoint)throw new Q(`Item does not have an endpoint.`);t=e.endpoint}else{let n=this.#n.find(t=>t.is(Sc)?t.as(Sc).icon_type===e:!1);if(!n||!n.is(Sc))throw new Q(`Button "${e}" not found.`);t=n.endpoint}if(!t)throw new Q(`Target button does not have an endpoint.`);return await t.call(this.#t,{parse:!0})}items(){return this.#n}page(){return this.#e}},fb=class e extends $y{info;menu;endpoint;messages;constructor(e,t,n=!1){super(e,t,n);let r=this.memo.getType(kg)[0],i=this.memo.getType(Ng)[0],a=this.memo.getType(Pg)[0],o=this.memo.getType(Lg)[0],s=this.page.alerts?.firstOfType(rc);if(s&&s.alert_type===`ERROR`)throw new Q(s.text.toString(),s);if(!i&&!a&&Object.keys(this.page).length===0)throw new Q(`Got empty continuation response. This is likely the end of the playlist.`);this.info={...this.page.metadata?.item().as(jg),subtitle:r?r.subtitle:null,author:a?.owner?.as(yv).author??r?.author,thumbnails:i?.thumbnail_renderer?.as(ud,ld).thumbnail,total_items:this.#e(0,i),views:this.#e(1,i),last_updated:this.#e(2,i),can_share:r?.can_share,can_delete:r?.can_delete,can_reorder:o?.can_reorder,is_editable:o?.is_editable,privacy:r?.privacy},this.menu=i?.menu,this.endpoint=i?.endpoint,this.messages=this.memo.getType(bd)}async getCollaborators(){if(!this.actions.session.logged_in)throw Error(`You must be signed in to perform this operation.`);let e=(this.memo.getType(fc)?.find(e=>e.renderer_context.command_context))?.renderer_context.command_context?.on_tap;if(!e)throw new Q(`AvatarStackView on_tap endpoint not found`);if(e.command?.is(Bf))return await e.call(this.actions,{parse:!0});throw new Q(`Unexpected endpoint type. Expected ShowEngagementPanelEndpoint, got ${e.command?.type}`)}get items(){return _(this.videos.as(qm,Ig,Xg,E_).filter(e=>e.style!==`PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO`))}get has_continuation(){let e=this.memo.getType(K)[0];return e?!!this.memo.getType(G,yd).find(t=>!e.contents.includes(t)):super.has_continuation}async getContinuationData(){let e=this.memo.getType(K)[0];if(!e)return await super.getContinuationData();let t=this.memo.getType(G,yd).find(t=>!e.contents.includes(t));if(!t)throw new Q(`There are no continuations.`);return await t.endpoint.call(this.actions,{parse:!0})}async getContinuation(){let t=await this.getContinuationData();if(!t)throw new Q(`Could not get continuation data`);return new e(this.actions,t,!0)}#e(e,t){return!t||!t.stats?`N/A`:t.stats[e]?.toString()||`N/A`}},pb=class extends $y{header;sections;constructor(e,t){if(super(e,t),!this.page.contents_memo)throw new Q(`Page contents not found`);this.header=this.memo.getType(lg)[0];let n=this.page.contents_memo.getType(T_);this.sections=n.map(e=>({type:e.icon_type,title:e.title,contents:e.content?.key(`items`).array()||[],getAll:()=>this.#e(e)}))}async#e(e){if(!e.menu?.as(W).top_level_buttons)throw new Q(`The ${e.title.text} shelf doesn't have more items`);let t=e.menu.as(W).top_level_buttons.firstOfType(z);if(!t)throw new Q(`Did not find target button.`);let n=await t.as(z).endpoint.call(this.actions,{parse:!0});switch(e.icon_type){case`LIKE`:case`WATCH_LATER`:return new fb(this.actions,n,!0);case`WATCH_HISTORY`:return new cb(this.actions,n,!0);case`CONTENT_CUT`:return new $y(this.actions,n,!0);default:throw new Q(`Target shelf not implemented.`)}}get history(){return this.sections.find(e=>e.type===`WATCH_HISTORY`)}get watch_later(){return this.sections.find(e=>e.type===`WATCH_LATER`)}get liked_videos(){return this.sections.find(e=>e.type===`LIKE`)}get playlists_section(){return this.sections.find(e=>e.type===`PLAYLISTS`)}get clips(){return this.sections.find(e=>e.type===`CONTENT_CUT`)}};function mb(e){let t=[];for(let n of e)if(Array.isArray(n))for(let e of n)t.push(e);else t.push(n);return t}var hb=class{front;back;constructor(){this.front=[],this.back=[]}isEmpty(){return!this.front.length&&!this.back.length}clear(){this.front=[],this.back=[]}getValues(){return this.front.concat(this.back.reverse())}},gb=class{#e;#t;#n;#r;#i;#a;constructor(){this.#e=null,this.#t=null,this.#n=null,this.#r=[],this.#i=null,this.#a=new hb}enqueueActionGroup(e){if(this.#e!==null){let e=Date.now()-this.#e;this.#a.back.push(e),5<this.#a.front.length+this.#a.back.length&&(this.#a.front.length||(this.#a.front=this.#a.back,this.#a.front.reverse(),this.#a.back=[]),this.#a.front.pop()),this.#t=Math.max(...this.#a.getValues())}this.#e=Date.now(),this.#r.push(e),this.#i===null&&(this.#i=setTimeout(this.emitSmoothedActions.bind(this)))}emitSmoothedActions(){if(this.#i=null,this.#r.length){let e=1e4;this.#t!==null&&this.#e!==null&&(e=this.#t-Date.now()+this.#e),e=this.#r.length<e/80?1:Math.ceil(this.#r.length/(e/80));let t=mb(this.#r.splice(0,e));this.#n&&this.#n(t),this.#r!==null&&(e==1?(e=this.#t/this.#r.length,e*=Math.random()+.5,e=Math.min(1e3,e),e=Math.max(80,e)):e=80,this.#i=setTimeout(this.emitSmoothedActions.bind(this),e))}}clear(){this.#i!==null&&(clearTimeout(this.#i),this.#i=null),this.#r=[]}set callback(e){this.#n=e}get callback(){return this.#n}get action_queue(){return this.#r}get estimated_update_interval(){return this.#t}get last_update_time(){return this.#e}get next_update_id(){return this.#i}get poll_response_delay_queue(){return this.#a}},_b=class extends re{#e;#t;#n;#r;#i;#a=0;smoothed_queue;initial_info;metadata;running=!1;is_replay=!1;constructor(e){super(),this.#t=e.basic_info.id,this.#n=e.basic_info.channel_id,this.#e=e.actions,this.#r=e.livechat?.continuation,this.is_replay=e.livechat?.is_replay||!1,this.smoothed_queue=new gb,this.smoothed_queue.callback=async e=>{e.length?e.length<10?await this.#s(e):this.is_replay?(this.#s(e),await this.#l(2e3)):this.#s(e):await this.#l(2e3),this.running&&this.#o()}}start(){this.running||(this.running=!0,this.#o(),this.#c())}stop(){this.smoothed_queue.clear(),this.running=!1}#o(){(async()=>{try{let e=await this.#e.execute(this.is_replay?`live_chat/get_live_chat_replay`:`live_chat/get_live_chat`,{continuation:this.#r,parse:!0}),t=e.continuation_contents;if(t||(this.emit(`error`,new Q(`Unexpected live chat incremental continuation response`,e)),this.emit(`end`),this.stop()),!(t instanceof gy)){this.stop(),this.emit(`end`);return}this.#r=t.continuation.token,t.header?(this.initial_info=t,this.emit(`start`,t),this.running&&this.#o()):this.smoothed_queue.enqueueActionGroup(t.actions),this.#a=0}catch(e){this.emit(`error`,e),this.#a++<10?(await this.#l(2e3),this.#o()):(this.emit(`error`,new Q(`Reached retry limit for incremental continuation requests`,e)),this.emit(`end`),this.stop())}})()}async#s(e){let t=1e4,n=e.length<t/80?1:Math.ceil(e.length/(t/80)),r=n==1?(n=t/e.length,n*=Math.random()+.5,n=Math.min(1e3,n),n=Math.max(80,n)):n=80;for(let t of e)await this.#l(r),this.emit(`chat-update`,t)}#c(){(async()=>{try{let e={videoId:this.#t};this.#i&&(e.continuation=this.#i);let t=q((await this.#e.execute(`/updated_metadata`,e)).data);this.#i=t.continuation?.token,this.metadata={title:t.actions?.array().firstOfType(Pm)||this.metadata?.title,description:t.actions?.array().firstOfType(Mm)||this.metadata?.description,views:t.actions?.array().firstOfType(Lm)||this.metadata?.views,likes:t.actions?.array().firstOfType(Fm)||this.metadata?.likes,date:t.actions?.array().firstOfType(jm)||this.metadata?.date},this.emit(`metadata-update`,this.metadata),await this.#l(5e3),this.running&&this.#c()}catch{await this.#l(2e3),this.running&&this.#c()}})()}async sendMessage(e){let t=ln.encode({params:{ids:{videoId:this.#t,channelId:this.#n}},number0:1,number1:4}),n=btoa(encodeURIComponent(rx(t.finish()))),r=await this.#e.execute(`/live_chat/send_message`,{richMessage:{textSegments:[{text:e}]},clientMessageId:Z.shim.uuidv4(),client:`WEB`,parse:!0,params:n});if(!r.actions)throw new Q(`Unexpected response from send_message`,r);return r.actions.array().as(Gp,Vu)}applyFilter(e){if(!this.initial_info)throw new Q(`Cannot apply filter before initial info is retrieved.`);let t=this.initial_info?.header?.view_selector?.sub_menu_items;if(e===`TOP_CHAT`){if(t?.at(0)?.selected)return;this.#r=t?.at(0)?.continuation}else{if(t?.at(1)?.selected)return;this.#r=t?.at(1)?.continuation}}async getItemMenu(e){if(!e.hasKey(`menu_endpoint`)||!e.key(`menu_endpoint`).isInstanceof(B))throw new Q(`This item does not have a menu.`,e);let t=await e.key(`menu_endpoint`).instanceof(B).call(this.#e,{parse:!0});if(!t)throw new Q(`Could not retrieve item menu.`,e);return new db(t,this.#e)}async selectButton(e){return await e.endpoint.call(this.#e,{parse:!0})}async#l(e){return new Promise(t=>setTimeout(()=>t(),e))}},vb=class e{#e;#t;header;contents;constructor(e,t){if(this.#t=e,this.#e=q(t.data),!this.#e.actions_memo)throw new Q(`Page actions not found`);this.header=this.#e.actions_memo.getType(ih)[0],this.contents=this.#e.actions_memo.getType($m)}async getContinuation(){let t=this.#e.actions_memo?.getType(G)[0];if(!t)throw new Q(`Continuation not found`);let n=await t.endpoint.call(this.#t,{parse:!1});return new e(this.#t,n)}get page(){return this.#e}},yb=class e extends $y{header;results;refinements;estimated_results;sub_menu;watch_card;constructor(e,t,n=!1){super(e,t,n);let r=this.page.contents_memo?.getType(K)[0].contents||this.page.on_response_received_commands_memo?.getType(K)[0]?.contents||this.page.on_response_received_commands?.[0].as(Fs,ly).contents;if(!r)throw new Q(`No contents found in search response`);if(this.page.on_response_received_commands&&!this.page.header){let e=this.page.on_response_received_commands.as(ly).find(e=>e.is(ly)&&e.slot===`RELOAD_CONTINUATION_SLOT_HEADER`);this.header=e?.contents?.firstOfType(l_)}else this.header=this.page.header?.item().as(l_);this.results=_(r.filterType(ql).flatMap(e=>e.contents)),this.refinements=this.page.refinements||[],this.estimated_results=this.page.estimated_results||0,this.page.contents_memo&&(this.sub_menu=this.page.contents_memo.getType(u_)[0],this.watch_card=this.page.contents_memo.getType(f_)[0])}async applyRefinement(t){let n;if(typeof t==`string`){let e=this.header?.chip_bar;if(!e)throw new Q(`No chip bar found in search header`);let r=e.chips.find(e=>e.text===t);if(!r)throw new Q(`Refinement filter "${t}" not found`,{available_filters:this.refinement_filters});if(n=r.endpoint,!n&&r.is_selected)return this}else if(t.is(Hl)){if(!t.endpoint&&t.is_selected)return this;n=t.endpoint}else throw new Q(`Invalid filter type`);if(!n)throw new Q(`Could not find endpoint for the specified filter`);let r=await n.call(this.actions,{parse:!0});return new e(this.actions,r,!0)}get refinement_filters(){return this.header?.chip_bar?.chips.map(e=>e.text)||[]}async getContinuation(){let t=await this.getContinuationData();if(!t)throw new Q(`Could not get continuation data`);return new e(this.actions,t,!0)}},bb=class e{#e;#t;sidebar;introduction;sections;constructor(e,t){if(this.#t=e,this.#e=q(t.data),this.sidebar=this.#e.sidebar?.as(y_),!this.#e.contents)throw new Q(`Page contents not found`);let n=this.#e.contents.item().as(lv).tabs.find(e=>e.selected);if(!n)throw new Q(`Target tab not found`);let r=n.content?.as(K).contents.as(ql);this.introduction=r?.shift()?.contents?.firstOfType(dg),this.sections=r?.map(e=>({title:e.header?.is(Bl,Ll,zl)?e.header.title.toString():null,contents:e.contents}))}async selectSidebarItem(t){if(!this.sidebar)throw new Q(`Sidebar not available`);let n;if(typeof t==`string`){if(n=this.sidebar.items.find(e=>e.title===t),!n)throw new Q(`Item "${t}" not found`,{available_items:this.sidebar_items})}else if(t?.is(Ms))n=t;else throw new Q(`Invalid item`,{target_item:t});let r=await n.endpoint.call(this.#t,{parse:!1});return new e(this.#t,r)}getSettingOption(e){if(!this.sections)throw new Q(`Sections not available`);for(let t of this.sections)if(t.contents)for(let n of t.contents){let t=n.as(v_).options;if(t){for(let n of t)if(n.is(__)&&n.title?.toString()===e)return n}}throw new Q(`Option "${e}" not found`,{available_options:this.setting_options})}get setting_options(){if(!this.sections)throw new Q(`Sections not available`);let e=[];for(let t of this.sections)if(t.contents)for(let n of t.contents)n.as(v_).options&&(e=e.concat(n.as(v_).options));return e.map(e=>e.title?.toString()).filter(e=>e)}get sidebar_items(){if(!this.sidebar)throw new Q(`Sidebar not available`);return this.sidebar.items.map(e=>e.title.toString())}get page(){return this.#e}},xb=class e extends tb{primary_info;secondary_info;playlist;game_info;merchandise;related_chip_cloud;watch_next_feed;player_overlays;comments_entry_point_header;livechat;autoplay;heat_map;engagement_panels;#e;constructor(e,t,n){super(e,t,n);let[r,i]=this.page;if(this.streaming_data){let e=this.streaming_data.adaptive_formats.find(e=>e.audio_track?.audio_is_default);if(e)this.streaming_data.formats.forEach(t=>t.language=e.language);else if(this.captions?.caption_tracks&&this.captions?.caption_tracks.length>0){let e=this.captions.caption_tracks.find(e=>e.kind===`asr`)?.language_code;this.streaming_data.adaptive_formats.forEach(t=>{t.has_audio&&(t.language=e)}),this.streaming_data.formats.forEach(t=>t.language=e)}}let a=i?.contents?.item().as(dv),o=a?.results,s=a?.secondary_results;if(o&&s){if(r.microformat?.is(wg)&&r.microformat?.category===`Gaming`){let e=o.firstOfType(xv)?.metadata?.rows?.firstOfType(r_);e?.is(r_)&&(this.game_info={title:e?.contents?.firstOfType(n_)?.title,release_year:e?.contents?.firstOfType(n_)?.subtitle})}this.primary_info=o.firstOfType(bv),this.secondary_info=o.firstOfType(xv),this.merchandise=o.firstOfType(Nl),this.related_chip_cloud=s.firstOfType(Kl)?.content.as(Tu),this.engagement_panels=i?.engagement_panels,a?.playlist&&(this.playlist=a.playlist),this.watch_next_feed=s.firstOfType(ql)?.contents||s,this.watch_next_feed&&Array.isArray(this.watch_next_feed)&&this.watch_next_feed.at(-1)?.is(G)&&(this.#e=this.watch_next_feed.pop()?.as(G)),this.player_overlays=i?.player_overlays?.item().as(Og),a?.autoplay&&(this.autoplay=a.autoplay);let e=this.primary_info?.menu?.top_level_buttons.firstOfType(m_);e?.like_button?.is(hc)&&e?.dislike_button?.is(hc)&&(this.basic_info.like_count=e?.like_button?.like_count,this.basic_info.is_liked=e?.like_button?.is_toggled,this.basic_info.is_disliked=e?.dislike_button?.is_toggled);let t=this.primary_info?.menu?.top_level_buttons.firstOfType(xc);if(t&&(this.basic_info.like_count=t.like_count,t.like_button)){let e=t.like_button.like_status_entity.like_status;this.basic_info.is_liked=e===`LIKE`,this.basic_info.is_disliked=e===`DISLIKE`}let n=o.find(e=>e.is(ql)&&e.target_id===`comments-entry-point`);this.comments_entry_point_header=n?.contents?.firstOfType(rd),this.livechat=i?.contents_memo?.getType(Vp)[0];let c=this.page[1]?.contents_memo?.getType(Jm),l=null;if(c){let e=c.find(e=>e.isHeatmap());if(e)try{l=e.toHeatmap()}catch{}}this.heat_map=l}}async selectFilter(e){if(!this.related_chip_cloud)throw new Q(`Chip cloud not found, cannot apply filter`);let t;if(typeof e==`string`){let n=this.related_chip_cloud?.chips?.find(t=>t.text===e);if(!n)throw new Q(`Invalid filter`,{available_filters:this.filters});t=n}else if(e?.is(Hl))t=e;else throw new Q(`Invalid cloud chip`,e);if(t.is_selected)return this;let n=(await t.endpoint?.call(this.actions,{parse:!0}))?.on_response_received_endpoints?.find(e=>e.is(ly)&&e.target_id===`watch-next-feed`);return this.watch_next_feed=n?.contents,this}async addToWatchHistory(){return super.addToWatchHistory()}async updateWatchTime(e){return super.updateWatchTime(e)}async getWatchNextContinuation(){if(!this.#e)throw new Q(`Watch next feed continuation not found`);let e=(await this.#e?.endpoint.call(this.actions,{parse:!0}))?.on_response_received_endpoints?.firstOfType(Fs);if(!e)throw new Q(`AppendContinuationItemsAction not found`);return this.watch_next_feed=e?.contents,this.#e=this.watch_next_feed?.at(-1)?.is(G)?this.watch_next_feed.pop()?.as(G):void 0,this}async like(){let e=this.primary_info?.menu?.top_level_buttons.firstOfType(xc);if(e){let t=e?.like_button?.toggle_button;if(!t||!t.default_button||!e.like_button)throw new Q(`Like button not found`,{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status===`LIKE`)throw new Q(`This video is already liked`,{video_id:this.basic_info.id});if(!t.default_button.on_tap)throw new Q(`onTap command not found`,{video_id:this.basic_info.id});return await new B(t.default_button.on_tap.payload.commands.find(e=>e.innertubeCommand)).call(this.actions)}let t=this.primary_info?.menu?.top_level_buttons.firstOfType(m_)?.like_button;if(!t)throw new Q(`Like button not found`,{video_id:this.basic_info.id});if(!t.is(hc))throw new Q(`Like button is not a toggle button. This action is likely disabled for this video.`,{video_id:this.basic_info.id});if(t.is_toggled)throw new Q(`This video is already liked`,{video_id:this.basic_info.id});return await t.endpoint.call(this.actions)}async dislike(){let e=this.primary_info?.menu?.top_level_buttons.firstOfType(xc);if(e){let t=e?.dislike_button?.toggle_button;if(!t||!t.default_button||!e.dislike_button||!e.like_button)throw new Q(`Dislike button not found`,{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status===`DISLIKE`)throw new Q(`This video is already disliked`,{video_id:this.basic_info.id});if(!t.default_button.on_tap)throw new Q(`onTap command not found`,{video_id:this.basic_info.id});return await new B(t.default_button.on_tap.payload.commands.find(e=>e.innertubeCommand)).call(this.actions)}let t=this.primary_info?.menu?.top_level_buttons.firstOfType(m_)?.dislike_button;if(!t)throw new Q(`Dislike button not found`,{video_id:this.basic_info.id});if(!t.is(hc))throw new Q(`Dislike button is not a toggle button. This action is likely disabled for this video.`,{video_id:this.basic_info.id});if(t.is_toggled)throw new Q(`This video is already disliked`,{video_id:this.basic_info.id});return await t.endpoint.call(this.actions)}async removeRating(){let e,t=this.primary_info?.menu?.top_level_buttons.firstOfType(xc);if(t){let n=t?.like_button?.toggle_button;if(!n||!n.default_button||!t.like_button)throw new Q(`Like button not found`,{video_id:this.basic_info.id});let r=t.like_button.like_status_entity.like_status;if(r===`LIKE`)e=t?.like_button?.toggle_button;else if(r===`DISLIKE`)e=t?.dislike_button?.toggle_button;else throw new Q(`This video is not liked/disliked`,{video_id:this.basic_info.id});if(!e||!e.toggled_button)throw new Q(`Like/Dislike button not found`,{video_id:this.basic_info.id});if(!e.toggled_button.on_tap)throw new Q(`onTap command not found`,{video_id:this.basic_info.id});return await new B(e.toggled_button.on_tap.payload.commands.find(e=>e.innertubeCommand)).call(this.actions)}let n=this.primary_info?.menu?.top_level_buttons.firstOfType(m_),r=n?.like_button,i=n?.dislike_button;if(!r?.is(hc)||!i?.is(hc))throw new Q(`Like/Dislike button is not a toggle button. This action is likely disabled for this video.`,{video_id:this.basic_info.id});if(r?.is_toggled?e=r:i?.is_toggled&&(e=i),!e)throw new Q(`This video is not liked/disliked`,{video_id:this.basic_info.id});return await e.toggled_endpoint.call(this.actions)}getLiveChat(){if(!this.livechat)throw new Q(`Live Chat is not available`,{video_id:this.basic_info.id});return new _b(this)}getTrailerInfo(){if(this.has_trailer&&this.playability_status?.error_screen){let t;if(this.playability_status.error_screen.is(Sg)?t=this.playability_status.error_screen.trailer?.player_response:this.playability_status.error_screen.is(xg)&&(t=this.playability_status.error_screen.player_response),t)return new e([{data:t}],this.actions,this.cpn)}return null}get filters(){return this.related_chip_cloud?.chips?.map(e=>e.text?.toString())||[]}get wn_has_continuation(){return!!this.#e}get autoplay_video_endpoint(){return this.autoplay?.sets?.[0]?.autoplay_video||null}get has_trailer(){return!!this.playability_status?.error_screen?.is(Sg,xg)}get music_tracks(){let e=this.page[1]?.engagement_panels?.filter(e=>e.content?.is(Zl));if(e!==void 0&&e.length>0){let t=e[0].content?.as(Zl)?.items?.filterType(El);if(t!==void 0&&t.length>0)return t[0].carousel_lockups?.map(e=>{let t,n,r,i,a,o;t=e.video_lockup?.title?.toString(),a=e.video_lockup?.endpoint?.payload.videoId;for(let s=0;s<e.info_rows.length;s++){let c=e.info_rows[s];c.info_row_expand_status_key===void 0?t===void 0?(t=c.default_metadata?.toString()||c.expanded_metadata?.toString(),a===void 0&&(a=(c.default_metadata?.endpoint||c.expanded_metadata?.endpoint)?.payload?.videoId)):r=c.default_metadata?.toString()||c.expanded_metadata?.toString():(c.info_row_expand_status_key?.indexOf(`structured-description-music-section-artists-row-state-id`)!==-1&&(n=c.default_metadata?.toString()||c.expanded_metadata?.toString(),o===void 0&&(o=(c.default_metadata?.endpoint||c.expanded_metadata?.endpoint)?.payload?.browseId)),c.info_row_expand_status_key?.indexOf(`structured-description-music-section-licenses-row-state-id`)!==-1&&(i=c.default_metadata?.toString()||c.expanded_metadata?.toString()))}return{song:t,artist:n,album:r,license:i,videoId:a,channelId:o}})}return[]}},Sb=class e{#e;#t;transcript;constructor(e,t){if(this.#e=q(t.data),this.#t=e,!this.#e.actions_memo)throw Error(`Page actions not found`);this.transcript=this.#e.actions_memo.getType(Xs)[0]}async selectLanguage(t){let n=this.transcript.content?.footer?.language_menu?.sub_menu_items?.find(e=>e.title.toString()===t);if(!n)throw Error(`Language not found: ${t}`);if(n.selected)return this;let r=await this.#t.execute(`/get_transcript`,{params:n.continuation});return new e(this.#t,r)}get languages(){return this.transcript.content?.footer?.language_menu?.sub_menu_items?.map(e=>e.title.toString())||[]}get selectedLanguage(){return this.transcript.content?.footer?.language_menu?.sub_menu_items?.find(e=>e.selected)?.title.toString()||``}get page(){return this.#e}},Cb=e({AccountInfo:()=>Qy,Channel:()=>rb,ChannelListContinuation:()=>ib,Comments:()=>ob,FilteredChannelList:()=>ab,Guide:()=>sb,HashtagFeed:()=>ub,History:()=>cb,HomeFeed:()=>lb,ItemMenu:()=>db,Library:()=>pb,LiveChat:()=>_b,NotificationsMenu:()=>vb,Playlist:()=>fb,Search:()=>yb,Settings:()=>bb,SmoothedQueue:()=>gb,TranscriptInfo:()=>Sb,VideoInfo:()=>xb}),wb=class{#e;header;contents;sections;background;url;constructor(e){if(this.#e=q(e.data),!this.#e.contents_memo)throw Error(`No contents found in the response`);this.header=this.#e.contents_memo.getType(Mh,qh)?.[0],this.contents=this.#e.contents_memo.getType(Jh)?.[0].contents||_([]),this.sections=this.#e.contents_memo.getType(Ah)||_([]),this.background=this.#e.background,this.url=this.#e.microformat?.as(uh).url_canonical}get page(){return this.#e}},Tb=class{#e;#t;header;sections;constructor(e,t){this.#e=q(e.data),this.#t=t,this.header=this.page.header?.item().as(Lh,$h,Ih);let n=this.#e.contents_memo?.getType(Jh)||[],r=this.#e.contents_memo?.getType(Ah)||[];this.sections=_([...n,...r])}async getAllSongs(){let e=this.sections.filter(e=>e.type===`MusicShelf`);if(!e.length)throw new Q(`Could not find any node of type MusicShelf.`);let t=e.find(e=>e.title?.text===`Top songs`);if(!t)throw new Q(`Could not find target shelf (Top songs).`);if(!t.endpoint)throw new Q(`Target shelf (Top songs) did not have an endpoint.`);return(await t.endpoint.call(this.#t,{client:`YTMUSIC`,parse:!0})).contents_memo?.getType(Hh)?.[0]}get page(){return this.#e}},Eb=class{#e;top_buttons;sections;constructor(e){this.#e=q(e.data);let t=this.#e.contents?.item().as(N_).tabs.find(e=>e.selected);if(!t)throw new Q(`Could not find target tab.`);let n=t.content?.as(K);if(!n)throw new Q(`Target tab did not have any content.`);this.top_buttons=n.contents.firstOfType(sp)?.items.as(Ch)||[],this.sections=n.contents.filterType(Ah)}get page(){return this.#e}},Db=class e{#e;#t;#n;sections;header;constructor(e,t){this.#t=t,this.#e=q(e.data);let n=this.#e.contents?.item().as(N_).tabs.find(e=>e.selected);if(!n)throw new Q(`Could not find Home tab.`);if(n.content===null){if(!this.#e.continuation_contents)throw new Q(`Continuation did not have any content.`);this.#n=this.#e.continuation_contents.as(uy).continuation,this.sections=this.#e.continuation_contents.as(uy).contents?.as(Ah);return}this.header=n.content?.as(K).header?.as(Tu),this.#n=n.content?.as(K).continuation,this.sections=n.content?.as(K).contents.as(Ah,Qh)}async getContinuation(){if(!this.#n)throw new Q(`Continuation not found.`);let t=await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:this.#n});return new e(t,this.#t)}async applyFilter(t){let n;if(typeof t==`string`){if(n=this.header?.chips?.as(Hl).find(e=>e.text===t),!n)throw new Q(`Could not find filter with given name.`,{available_filters:this.filters})}else t?.is(Hl)&&(n=t);if(!n)throw new Q(`Invalid filter`,{available_filters:this.filters});if(n?.is_selected)return this;if(!n.endpoint)throw new Q(`Selected filter does not have an endpoint.`);let r=await n.endpoint.call(this.#t,{client:`YTMUSIC`});return new e(r,this.#t)}get filters(){return this.header?.chips?.as(Hl).map(e=>e.text)||[]}get has_continuation(){return!!this.#n}get page(){return this.#e}},Ob=class e{#e;#t;#n;header;contents;constructor(e,t){this.#e=q(e.data),this.#t=t;let n=this.#e.contents_memo?.getType(K)[0];this.header=n?.header?.as(Yh),this.contents=n?.contents?.as(sp,Jh),this.#n=this.contents?.find(e=>e.continuation)?.continuation}async applySort(e){let t;if(typeof e==`string`){let n=(this.#e.contents_memo?.getType(Xh)[0])?.menu?.options.filter(e=>e instanceof nh);if(t=n?.find(t=>t.title===e),!t)throw new Q(`Sort option "${e}" not found`,{available_filters:n.map(e=>e.title)})}else t=e;if(!t.endpoint)throw new Q(`Invalid sort option`);if(t.selected)return this;let n=t.endpoint.payload?.commands?.find(e=>e.browseSectionListReloadEndpoint)?.browseSectionListReloadEndpoint;if(!n)throw new Q(`Failed to find sort option command`);let r=await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:n.continuation.reloadContinuationData.continuation,parse:!0}),i=this.#e.contents_memo?.getType(nh)?.find(e=>e.selected);return i&&(i.selected=!1),t.selected=!0,this.contents=r.continuation_contents?.as(uy).contents?.as(sp,Jh),this}async applyFilter(t){let n,r=this.#e.contents_memo?.getType(Tu)[0];if(typeof t==`string`){if(n=r?.chips.find(e=>e.text===t),!n)throw new Q(`Filter "${t}" not found`,{available_filters:this.filters})}else n=t;if(!n.endpoint)throw new Q(`Invalid filter`,t);let i=await new B(n.endpoint.payload?.commands?.[0]).call(this.#t,{client:`YTMUSIC`});return new e(i,this.#t)}async getContinuation(){if(!this.#n)throw new Q(`No continuation available`);return new kb(await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:this.#n}),this.#t)}get has_continuation(){return!!this.#n}get sort_options(){return((this.#e.contents_memo?.getType(Xh)[0])?.menu?.options.filter(e=>e instanceof nh)).map(e=>e.title)}get filters(){return this.#e.contents_memo?.getType(Tu)?.[0].chips.map(e=>e.text)||[]}get page(){return this.#e}},kb=class e{#e;#t;#n;contents;constructor(e,t){if(this.#e=q(e.data),this.#t=t,!this.#e.continuation_contents)throw new Q(`No continuation contents found`);this.contents=this.#e.continuation_contents.as(fy,py),this.#n=this.contents.continuation||null}async getContinuation(){if(!this.#n)throw new Q(`No continuation available`);let t=await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:this.#n});return new e(t,this.#t)}get has_continuation(){return!!this.#n}get page(){return this.#e}},Ab=class e{#e;#t;#n;header;contents;background;#r;#i;constructor(e,t){if(this.#t=t,this.#e=q(e.data),this.#r=null,this.#i=null,this.#e.continuation_contents){let e=this.#e.continuation_contents?.as(dy);if(!e.contents)throw new Q(`No contents found in the response`);this.contents=e.contents.as(Oh,G);let t=this.contents.firstOfType(G);this.#n=e.continuation||t}else if(this.#e.contents_memo){this.header=this.#e.contents_memo.getType(qh,Ph,Mh)?.[0],this.contents=this.#e.contents_memo.getType(Hh)?.[0]?.contents.as(Oh,G)||_([]),this.background=this.#e.background;let e=this.contents.firstOfType(G);this.#n=this.#e.contents_memo.getType(Hh)?.[0]?.continuation||e}else if(this.#e.on_response_received_actions){let e=this.#e.on_response_received_actions.firstOfType(Fs);this.contents=e?.contents?.as(Oh,G),this.#n=this.contents?.firstOfType(G)}}async getContinuation(){if(!this.#n)throw new Q(`Continuation not found.`);let t;return t=typeof this.#n==`string`?await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:this.#n}):await this.#n.endpoint.call(this.#t,{client:`YTMUSIC`}),new e(t,this.#t)}async getRelated(){let e=this.#e.contents_memo?.getType(K).find(e=>e.continuation);if(!e)throw new Q(`Could not find "Related" section.`);let t=e.continuation;for(;t;){let e=(await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:t,parse:!0})).continuation_contents?.as(uy),n=(e?.contents?.as(Ah,Jh))?.find(e=>e.is(Ah))?.as(Ah);if(n)return n;t=e?.continuation}throw new Q(`Could not fetch related playlists.`)}async getSuggestions(e=!0){let t=await(e||!this.#r?this.#a():Promise.resolve(null));return t&&(this.#r=t.items,this.#i=t.continuation),t?.items||this.#r||_([])}async#a(){let e=this.#e.contents_memo?.getType(K).find(e=>e.continuation),t=this.#i||e?.continuation;if(t){let e=(((await this.#t.execute(`/browse`,{client:`YTMUSIC`,continuation:t,parse:!0})).continuation_contents?.as(uy))?.contents?.as(Ah,Jh))?.find(e=>e.is(Jh))?.as(Jh);return{items:e?.contents||_([]),continuation:e?.continuation||null}}return{items:_([]),continuation:null}}get page(){return this.#e}get items(){return this.contents||_([])}get has_continuation(){return!!this.#n}},jb=class{#e;#t;header;sections;constructor(e,t){this.#e=q(e.data),this.#t=t;let n=this.#e.header?.item();this.header=n?.is(Fh)?this.#e.header?.item().as(Fh).element?.model?.as(Op):this.#e.header?.item().as(Ih);let r=this.#e.contents?.item().as(N_).tabs.firstOfType(M_);if(!r)throw new Q(`Target tab not found`);this.sections=r.content?.as(K).contents.as(ql,Ah,bd)}async getPlaylist(){if(!this.header)throw new Q(`Header not found`);if(!this.header.is(Op))throw new Q(`Recap playlist not available, check back later.`);return new Ab(await this.header.panels[0].text_on_tap_endpoint.call(this.#t,{client:`YTMUSIC`}),this.#t)}get page(){return this.#e}},Mb=class e{#e;#t;#n;header;contents;constructor(e,t,n){if(this.#t=t,this.#e=q(e.data),!this.#e.contents||!this.#e.contents_memo)throw new Q(`Response did not contain any contents.`);let r=this.#e.contents.item().as(V_).tabs.find(e=>e.selected);if(!r)throw new Q(`Could not find target tab.`);let i=r.content?.as(K);if(!i)throw new Q(`Target tab did not have any content.`);this.header=i.header?.as(Tu),this.contents=i.contents.as(Jh,bh,ql),n&&(this.#n=this.contents.firstOfType(Jh)?.continuation)}async getMore(t){if(!t||!t.endpoint)throw new Q(`Cannot retrieve more items for this shelf because it does not have an endpoint.`);let n=await t.endpoint.call(this.#t,{client:`YTMUSIC`});if(!n)throw new Q(`Endpoint did not return any data`);return new e(n,this.#t,!0)}async getContinuation(){if(!this.#n)throw new Q(`Continuation not found.`);let e=await this.#t.execute(`/search`,{continuation:this.#n,client:`YTMUSIC`});return new Nb(this.#t,e)}async applyFilter(t){let n;if(typeof t==`string`){if(n=this.header?.chips?.as(Hl).find(e=>e.text===t),!n)throw new Q(`Could not find filter with given name.`,{available_filters:this.filters})}else t?.is(Hl)&&(n=t);if(!n)throw new Q(`Invalid filter`,{available_filters:this.filters});if(n?.is_selected)return this;if(!n.endpoint)throw new Q(`Selected filter does not have an endpoint.`);let r=await n.endpoint.call(this.#t,{client:`YTMUSIC`});return new e(r,this.#t,!0)}get filters(){return this.header?.chips?.as(Hl).map(e=>e.text)||[]}get has_continuation(){return!!this.#n}get did_you_mean(){return this.#e.contents_memo?.getType(Hd)[0]}get showing_results_for(){return this.#e.contents_memo?.getType(D_)[0]}get message(){return this.#e.contents_memo?.getType(bd)[0]}get songs(){return this.contents?.filterType(Jh).find(e=>e.title.toString()===`Songs`)}get videos(){return this.contents?.filterType(Jh).find(e=>e.title.toString()===`Videos`)}get albums(){return this.contents?.filterType(Jh).find(e=>e.title.toString()===`Albums`)}get artists(){return this.contents?.filterType(Jh).find(e=>e.title.toString()===`Artists`)}get playlists(){return this.contents?.filterType(Jh).find(e=>e.title.toString()===`Community playlists`)}get page(){return this.#e}},Nb=class e{#e;#t;header;contents;constructor(e,t){this.#e=e,this.#t=q(t.data),this.header=this.#t.header?.item().as(Ih),this.contents=this.#t.continuation_contents?.as(fy)}async getContinuation(){if(!this.contents?.continuation)throw new Q(`Continuation not found.`);let t=await this.#e.execute(`/search`,{continuation:this.contents.continuation,client:`YTMUSIC`});return new e(this.#e,t)}get has_continuation(){return!!this.contents?.continuation}get page(){return this.#t}},Pb=class extends tb{tabs;current_video_endpoint;player_overlays;constructor(e,t,n){super(e,t,n);let r=this.page[1];if(r){let e=r.contents_memo?.getType(Ev)?.[0];this.tabs=e?.tabs.as(M_),this.current_video_endpoint=r.current_video_endpoint,this.player_overlays=r.player_overlays?.item().as(Og)}}async getTab(e){if(!this.tabs)throw new Q(`Could not find any tab`);let t=this.tabs.find(t=>t.title===e)||this.tabs.find(t=>t.endpoint.payload.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType===e)||this.tabs?.[0];if(!t)throw new Q(`Tab "${e}" not found`,{available_tabs:this.available_tabs});if(t.content)return t.content;let n=await t.endpoint.call(this.actions,{client:`YTMUSIC`,parse:!0});if(n.contents?.item().type===`Message`)return n.contents.item().as(bd);if(!n.contents)throw new Q(`Page contents was empty`,n);return n.contents.item().as(K).contents}async getUpNext(e=!0){let t=await this.getTab(`Up next`);if(!t||!t.content)throw new Q(`Music queue was empty, the video id is probably invalid.`,t);let n=t.content.as(Gh);if(!n.playlist_id&&e){let e=n.contents.firstOfType(cc);if(!e)throw new Q(`Automix item not found`);let t=await e.playlist_video?.endpoint.call(this.actions,{videoId:this.basic_info.id,client:`YTMUSIC`,parse:!0});if(!t||!t.contents_memo)throw new Q(`Could not fetch automix`);return t.contents_memo.getType(Gh)?.[0]}return n}async getUpNextContinuation(e){if(!this.current_video_endpoint)throw new Q(`Current Video Endpoint was not defined.`,this.current_video_endpoint);if(e instanceof Gh&&e.playlist_id!==this.current_video_endpoint.payload.playlistId)throw new Q(`PlaylistId from TrackInfo does not match with PlaylistPanel`);let t=await new B({watchNextEndpoint:{...this.current_video_endpoint.payload,continuation:e.continuation}}).call(this.actions,{...this.current_video_endpoint.payload,continuation:e.continuation,client:`YTMUSIC`,parse:!0}),n=t.continuation_contents?.as(my);if(!n)throw new Q(`No PlaylistPanel Continuation available.`,t);return n}async getRelated(){return await this.getTab(`MUSIC_PAGE_TYPE_TRACK_RELATED`)}async getLyrics(){return(await this.getTab(`MUSIC_PAGE_TYPE_TRACK_LYRICS`)).firstOfType(jh)}async addToWatchHistory(){return super.addToWatchHistory(S.YTMUSIC.NAME,S.YTMUSIC.VERSION,`https://music.`)}async updateWatchTime(e){return super.updateWatchTime(e,S.YTMUSIC.NAME,S.YTMUSIC.VERSION,`https://music.`)}get available_tabs(){return this.tabs?this.tabs.map(e=>e.title):[]}},Fb=class e extends $y{header;contents;constructor(e,t,n=!1){super(e,t,n),this.header=this.page.header?.item().as(nu),this.contents=this.memo.getType(ql)[0]||this.page.continuation_contents?.as(oy)}async getContinuation(){if(!this.contents)throw Error(`No continuation available.`);let t=await new B({continuationCommand:{token:this.contents.continuation,request:`CONTINUATION_REQUEST_TYPE_BROWSE`}}).call(this.actions,{client:`YTKIDS`});return new e(this.actions,t)}get has_continuation(){return!!this.contents?.continuation}},Ib=class e extends $y{header;contents;constructor(e,t,n=!1){super(e,t,n),this.header=this.page.header?.item().as(jv),this.contents=this.page.contents?.item().as(Mv)}async selectCategoryTab(t){let n;if(typeof t==`string`?n=this.header?.category_tabs.find(e=>e.title.toString()===t):t?.is(Av)&&(n=t),!n)throw new Q(`Tab "${t}" not found`);let r=await n.endpoint.call(this.actions,{client:`YTKIDS`,parse:!0});return r.header=this.page.header,r.header_memo=this.page.header_memo,new e(this.actions,r,!0)}get categories(){return this.header?.category_tabs.map(e=>e.title.toString())||[]}},Lb=class extends $y{estimated_results;contents;constructor(e,t){super(e,t),this.estimated_results=this.page.estimated_results;let n=this.memo.getType(ql)[0];if(!n)throw new Q(`No item section found in search response.`);this.contents=n.contents}},Rb=class extends tb{slim_video_metadata;watch_next_feed;current_video_endpoint;player_overlays;constructor(e,t,n){super(e,t,n);let r=this.page[1],i=r?.contents?.item().as(dv),a=i?.results,o=i?.secondary_results;a&&o&&(this.slim_video_metadata=a.firstOfType(ql)?.contents?.firstOfType(L_),this.watch_next_feed=o.firstOfType(ql)?.contents||o,this.current_video_endpoint=r?.current_video_endpoint,this.player_overlays=r?.player_overlays?.item().as(Og))}},zb=class extends tb{#e;watch_next_feed;current_video_endpoint;player_overlays;constructor(e,t,n,r){if(super(e,t,n),r){let e=q(r.data);e.entries&&(this.watch_next_feed=e.entries),e.continuation_endpoint&&(this.#e=e.continuation_endpoint?.as(_y))}}async getWatchNextContinuation(){if(!this.#e)throw new Q(`Continuation not found`);let e=await this.actions.execute(`/reel/reel_watch_sequence`,{sequenceParams:this.#e.token,parse:!0});return e.entries&&(this.watch_next_feed=e.entries),this.#e=e.continuation_endpoint?.as(_y),this}get wn_has_continuation(){return!!this.#e}},X=class{id;name;thumbnails;endpoint;badges;avatar_thumbnail_url;is_current_user;is_public_subscriber;is_creator;is_moderator;is_verified;is_verified_artist;constructor(e,t,n,r){let i;e&&(i=`content`in e?H.fromAttributed(e):new H(e)),this.id=r||i?.runs?.[0]?.endpoint?.payload?.browseId||i?.endpoint?.payload?.browseId||t?.channelId,this.name=i?.text||`N/A`,this.thumbnails=n?V.fromResponse(n):[],this.endpoint=i?.runs?.[0]?.endpoint||i?.endpoint,t?Array.isArray(t)?(this.badges=Y(t),this.is_moderator=this.badges?.some(e=>e.icon_type==`MODERATOR`),this.is_verified=this.badges?.some(e=>e.style==`BADGE_STYLE_TYPE_VERIFIED`),this.is_verified_artist=this.badges?.some(e=>e.style==`BADGE_STYLE_TYPE_VERIFIED_ARTIST`)):(this.badges=_([]),`avatarThumbnailUrl`in t&&(this.avatar_thumbnail_url=t.avatarThumbnailUrl),`isCurrentUser`in t&&(this.is_current_user=!!t.isCurrentUser),`isPublicSubscriber`in t&&(this.is_public_subscriber=!!t.isPublicSubscriber),`isCreator`in t&&(this.is_creator=!!t.isCreator),`isVerified`in t&&(this.is_verified=!!t.isVerified),`isArtist`in t&&(this.is_verified_artist=!!t.isArtist)):this.badges=_([])}get url(){return this.endpoint?.toURL()}get best_thumbnail(){return this.thumbnails[0]}get collaborators(){if(this.endpoint?.command?.is(Hu)&&this.endpoint.command.inline_content?.is(Vd)){let e=this.endpoint.command.inline_content;if(e.custom_content?.is(Bd))return e.custom_content.items.as(Ec).filter(e=>e.renderer_context?.command_context?.on_tap?.metadata?.page_type===`WEB_PAGE_TYPE_CHANNEL`)}return[]}},Bb={desktop:[`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6.1 Safari/605.1.15`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 OPR/121.0.0.0`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 OPR/121.0.0.0`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 OPR/122.0.0.0`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0`,`Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`,`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36`],mobile:[`Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_7_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36`,`Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/388.0.811331708 Mobile/15E148 Safari/604.1`,`Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Mobile/15E148 Safari/604.1`]},Vb,Z=class{static load(e){Vb=e}static get shim(){if(!Vb)throw Error(`Platform is not loaded`);return Vb}},Q=class extends Error{date;version;info;constructor(e,t){super(e),t&&(this.info=t),this.date=new Date,this.version=E.version}},Hb=class extends Q{},Ub=class extends Q{},Wb=class extends Q{},Gb=class extends Error{},Kb=class extends Error{},qb=class extends Error{};function Jb(e,t){return Reflect.ownKeys(e).some(n=>{let r=t[n]instanceof H;return!r&&typeof t[n]==`object`?JSON.stringify(e[n])===JSON.stringify(t[n]):e[n]===(r?t[n].toString():t[n])})}function Yb(e,t,n){let r=RegExp(`${Xb(t)}(.*?)${Xb(n)}`,`s`),i=e.match(r);return i?i[1]:void 0}function Xb(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Zb(e){let t=Bb[e];return t[Math.floor(Math.random()*t.length)]}async function Qb(e){let t=Math.floor(new Date().getTime()/1e3),n=[t,e,`https://www.youtube.com`].join(` `);return[`SAPISIDHASH`,[t,await Z.shim.sha1Hash(n)].join(`_`)].join(` `)}function $b(e){let t=[];for(let n=0;n<e;n++)t.push(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.charAt(Math.floor(Math.random()*64)));return t.join(``)}function ex(e){let t=e.split(`:`).map(e=>parseInt(e.replace(/\D/g,``)));switch(t.length){case 1:return t[0];case 2:return t[0]*60+t[1];case 3:return t[0]*3600+t[1]*60+t[2];default:throw Error(`Invalid time string`)}}function tx(...e){let t=new v;for(let n of e)if(n)for(let e of n){let n=t.get(e[0]);if(n){t.set(e[0],[...n,...e[1]]);continue}t.set(...e)}return t}function $(e){for(let[t,n]of Object.entries(e))if(!n)throw new Ub(`${t} is missing`)}async function*nx(e){let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}function rx(e,t=!1){let n=btoa(String.fromCharCode(...e));return t?n.replace(/\+/g,`-`).replace(/\//g,`_`):n}function ix(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`);return new Uint8Array(atob(n).split(``).map(e=>e.charCodeAt(0)))}function ax(e){return!(`emoji`in e)}function ox(e,t,n=!1){let r=n?`(^|\\s?)\\b${t}\\b=([^;]+)`:`(^|s?)${t}=([^;]+)`,i=e.match(new RegExp(r));return i?i[2]:void 0}function sx(e,t,n){return`function process(n = "", sp = "", s = "") {
|
|
18
|
+
const mockStreamingURL = "https://ytjs.googlevideo.com/videoplayback?expire=1234567890&"+"n="+encodeURIComponent(n);
|
|
19
|
+
const urlCtorFunction = exportedVars.nsigFunction || (() => { throw new Error('No n/sig decipher function extracted') });
|
|
20
|
+
const urlCtor = urlCtorFunction(mockStreamingURL, sp, s);
|
|
21
|
+
|
|
22
|
+
const proto = Object.getPrototypeOf(urlCtor);
|
|
23
|
+
const properties = Object.getOwnPropertyNames(proto);
|
|
24
|
+
const methodBlacklist = ['constructor', 'clone', 'set', 'get'];
|
|
25
|
+
|
|
26
|
+
for (const prop of properties) {
|
|
27
|
+
if (methodBlacklist.includes(prop))
|
|
28
|
+
continue;
|
|
29
|
+
|
|
30
|
+
if (typeof urlCtor[prop] === 'function')
|
|
31
|
+
urlCtor[prop]();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const sigResult = urlCtor.get(sp);
|
|
35
|
+
const nResult = urlCtor.get('n');
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
sig: sigResult ? decodeURIComponent(sigResult) : undefined,
|
|
39
|
+
n: nResult ? decodeURIComponent(nResult) : undefined
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return process("${e||``}", "${t||``}", "${n||``}");`}async function cx(e){let t=`00.01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.10.11.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.20.21.22.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.30.31.32.33.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.40.41.42.43.44.45.46.47.48.49.4a.4b.4c.4d.4e.4f.50.51.52.53.54.55.56.57.58.59.5a.5b.5c.5d.5e.5f.60.61.62.63.64.65.66.67.68.69.6a.6b.6c.6d.6e.6f.70.71.72.73.74.75.76.77.78.79.7a.7b.7c.7d.7e.7f.80.81.82.83.84.85.86.87.88.89.8a.8b.8c.8d.8e.8f.90.91.92.93.94.95.96.97.98.99.9a.9b.9c.9d.9e.9f.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.aa.ab.ac.ad.ae.af.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bb.bc.bd.be.bf.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cc.cd.ce.cf.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.dd.de.df.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ee.ef.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.ff`.split(`.`);function n(e){let n=new Uint8Array(e),r=[];for(let e=0;e<n.length;++e)r.push(t[n[e]]);return r.join(``)}return n(await crypto.subtle.digest(`SHA-1`,new TextEncoder().encode(e)))}function lx(e,t){throw Error(`To decipher URLs, you must provide your own JavaScript evaluator. See https://ytjs.dev/guide/getting-started.html#providing-a-custom-javascript-interpreter for more details.`)}var ux=class{session;constructor(e){this.session=e}async stats(e,t,n){let r=new URL(e);r.searchParams.set(`ver`,`2`),r.searchParams.set(`c`,t.client_name.toLowerCase()),r.searchParams.set(`cbrver`,t.client_version),r.searchParams.set(`cver`,t.client_version);for(let e of Object.keys(n))r.searchParams.set(e,n[e]);return await this.session.http.fetch(r)}async execute(e,t){let n;if(t&&!t.protobuf){if(n={...t},Reflect.has(n,`browseId`)&&!t.skip_auth_check&&this.#t(n.browseId)&&!this.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);Reflect.has(n,`skip_auth_check`)&&delete n.skip_auth_check,Reflect.has(n,`override_endpoint`)&&delete n.override_endpoint,Reflect.has(n,`parse`)&&delete n.parse,Reflect.has(n,`request`)&&delete n.request,Reflect.has(n,`clientActions`)&&delete n.clientActions,Reflect.has(n,`settingItemIdForClient`)&&delete n.settingItemIdForClient,Reflect.has(n,`action`)&&(n.actions=[n.action],delete n.action),Reflect.has(n,`boolValue`)&&(n.newValue={boolValue:n.boolValue},delete n.boolValue),Reflect.has(n,`token`)&&(n.continuation=n.token,delete n.token),n?.client===`YTMUSIC`&&(n.isAudioOnly=!0)}else t&&(n=t.serialized_data);let r=Reflect.has(t||{},`override_endpoint`)?t?.override_endpoint:e,i=await this.session.http.fetch(r,{method:`POST`,body:t?.protobuf?n:JSON.stringify(n||{}),headers:{"Content-Type":t?.protobuf?`application/x-protobuf`:`application/json`}});if(t?.parse){let e=q(await i.json());if(this.#e(e)&&e.on_response_received_actions?.[0]?.type===`navigateAction`){let t=e.on_response_received_actions.firstOfType(sy);t&&(e=await t.endpoint.call(this,{parse:!0}))}return e}return{success:i.ok,status_code:i.status,data:await i.json()}}#e(e){return`on_response_received_actions`in e}#t(e){return[`FElibrary`,`FEhistory`,`FEsubscriptions`,`FEchannels`,`FEplaylist_aggregation`,`FEmusic_listening_review`,`FEmusic_library_landing`,`SPaccount_overview`,`SPaccount_notifications`,`SPaccount_privacy`,`SPtime_watched`].includes(e)}},dx=`OAuth2`,fx=class{#e;YTTV_URL;AUTH_SERVER_CODE_URL;AUTH_SERVER_TOKEN_URL;AUTH_SERVER_REVOKE_TOKEN_URL;client_id;oauth2_tokens;constructor(e){this.#e=e,this.YTTV_URL=new URL(`/tv`,x.YT_BASE),this.AUTH_SERVER_CODE_URL=new URL(`/o/oauth2/device/code`,x.YT_BASE),this.AUTH_SERVER_TOKEN_URL=new URL(`/o/oauth2/token`,x.YT_BASE),this.AUTH_SERVER_REVOKE_TOKEN_URL=new URL(`/o/oauth2/revoke`,x.YT_BASE)}async init(e){if(e){this.setTokens(e),this.shouldRefreshToken()&&await this.refreshAccessToken(),this.#e.emit(`auth`,{credentials:this.oauth2_tokens});return}if(await this.#t()){u(dx,`Loaded OAuth2 tokens from cache.`,this.oauth2_tokens);return}this.client_id||=await this.getClientID();let t=await this.getDeviceAndUserCode();this.#e.emit(`auth-pending`,t),this.pollForAccessToken(t)}setTokens(e){let t=e;if(t.expires_in&&(t.expiry_date=new Date(Date.now()+t.expires_in*1e3).toISOString(),delete t.expires_in),!this.validateTokens(t))throw new Wb(`Invalid tokens provided.`);this.oauth2_tokens=t,t.client&&(u(dx,`Using provided client id and secret.`),this.client_id=t.client)}async cacheCredentials(){let e=new TextEncoder().encode(JSON.stringify(this.oauth2_tokens));await this.#e.cache?.set(`youtubei_oauth_credentials`,e.buffer)}async#t(){let e=await this.#e.cache?.get(`youtubei_oauth_credentials`);if(!e)return!1;let t=new TextDecoder,n=JSON.parse(t.decode(e));return this.setTokens(n),this.#e.emit(`auth`,{credentials:n}),!0}async removeCache(){await this.#e.cache?.remove(`youtubei_oauth_credentials`)}pollForAccessToken(e){if(!this.client_id)throw new Wb(`Client ID is missing.`);let{device_code:t,interval:n}=e,{client_id:r,client_secret:i}=this.client_id,a={client_id:r,client_secret:i,code:t,grant_type:`http://oauth.net/grant_type/device/1.0`},o=setInterval(async()=>{let e=await(await this.#n.fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(a),method:`POST`,headers:{"Content-Type":`application/json`}})).json();if(e.error){switch(e.error){case`access_denied`:this.#e.emit(`auth-error`,new Wb(`Access was denied.`,e)),clearInterval(o);break;case`expired_token`:this.#e.emit(`auth-error`,new Wb(`The device code has expired.`,e)),clearInterval(o);break;case`authorization_pending`:case`slow_down`:u(dx,`Polling for access token...`);break;default:this.#e.emit(`auth-error`,new Wb(`Server returned an unexpected error.`,e)),clearInterval(o)}return}this.setTokens(e),this.#e.emit(`auth`,{credentials:this.oauth2_tokens}),clearInterval(o)},n*1e3)}async revokeCredentials(){if(!this.oauth2_tokens)throw new Wb(`Access token not found`);await this.removeCache();let e=this.AUTH_SERVER_REVOKE_TOKEN_URL;return e.searchParams.set(`token`,this.oauth2_tokens.access_token),this.#e.http.fetch_function(e,{method:`POST`})}async refreshAccessToken(){if(this.client_id||=await this.getClientID(),!this.oauth2_tokens)throw new Wb(`No tokens available to refresh.`);let{client_id:e,client_secret:t}=this.client_id,{refresh_token:n}=this.oauth2_tokens,r={client_id:e,client_secret:t,refresh_token:n,grant_type:`refresh_token`},i=await this.#n.fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(r),method:`POST`,headers:{"Content-Type":`application/json`}});if(!i.ok)throw new Wb(`Failed to refresh access token: ${i.status}`);let a=await i.json();if(a.error_code)throw new Wb(`Authorization server returned an error`,a);this.oauth2_tokens.access_token=a.access_token,this.oauth2_tokens.expiry_date=new Date(Date.now()+a.expires_in*1e3).toISOString(),this.#e.emit(`update-credentials`,{credentials:this.oauth2_tokens})}async getDeviceAndUserCode(){if(!this.client_id)throw new Wb(`Client ID is missing.`);let{client_id:e}=this.client_id,t={client_id:e,scope:`http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content`,device_id:Z.shim.uuidv4(),device_model:`ytlr::`},n=await this.#n.fetch_function(this.AUTH_SERVER_CODE_URL,{body:JSON.stringify(t),method:`POST`,headers:{"Content-Type":`application/json`}});if(!n.ok)throw new Wb(`Failed to get device/user code: ${n.status}`);let r=await n.json();if(r.error_code)throw new Wb(`Authorization server returned an error`,r);return r}async getClientID(){let e=await this.#n.fetch_function(this.YTTV_URL,{headers:{"User-Agent":`Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version`,Referer:`https://www.youtube.com/tv`,"Accept-Language":`en-US`}});if(!e.ok)throw new Wb(`Failed to get client ID: ${e.status}`);let t=await e.text(),n;if((n=te.REGEX.TV_SCRIPT.exec(t))!==null){u(dx,`Got YouTubeTV script URL (${n[1]})`);let e=await this.#n.fetch(n[1],{baseURL:x.YT_BASE});if(!e.ok)throw new Wb(`TV script request failed with status code ${e.status}`);let t=(await e.text()).match(te.REGEX.CLIENT_IDENTITY);if(!t||!t.groups)throw new Wb(`Could not obtain client ID.`);let{client_id:r,client_secret:i}=t.groups;return u(dx,`Client identity retrieved (clientId=${r}, clientSecret=${i}).`),{client_id:r,client_secret:i}}throw new Wb(`Could not obtain script URL.`)}shouldRefreshToken(){return this.oauth2_tokens?Date.now()>new Date(this.oauth2_tokens.expiry_date).getTime():!1}validateTokens(e){return!(!e.access_token||!e.refresh_token||!e.expiry_date)}get#n(){return this.#e.http}},px=`Player`,mx=class e{player_id;signature_timestamp;data;po_token;constructor(e,t,n){this.player_id=e,this.signature_timestamp=t,this.data=n}static async create(t,n=Z.shim.fetch,r,i){if(!i){let e=await n(new URL(`/iframe_api`,x.YT_BASE));if(!e.ok)throw new Gb(`Failed to get player id: ${e.status} (${e.statusText})`);i=Yb(await e.text(),`player\\/`,`\\/`)}if(u(px,`Using player id (${i}). Checking for cached players..`),!i)throw new Gb(`Failed to get player id`);if(t){let n=await e.fromCache(t,i);if(n)return u(px,`Found up-to-date player data in cache.`),n.po_token=r,n}let a=new URL(`/s/player/${i}/player_es6.vflset/en_US/base.js`,x.YT_BASE);u(px,`Could not find any cached player. Will download a new player from ${a}.`);let o=await n(a,{headers:{"user-agent":Zb(`desktop`)}});if(!o.ok)throw new Gb(`Failed to get player data: ${o.status}`);let s=await o.text(),l=`nsigFunction`,d=`signatureTimestampVar`,f=new ms(new ps(s,{extractions:[{friendlyName:l,match:yr},{friendlyName:d,match:br,collectDependencies:!1}]})).buildScript({disallowSideEffectInitializers:!0,exportRawValues:!0,rawValueOnly:[d]});f.exportedRawValues&&!(d in f.exportedRawValues)&&c(px,`Failed to extract signature timestamp.`),f.exported.includes(l)||c(px,`Failed to extract n/sig decipher function.`);let p=f.exportedRawValues?.[d],m=await e.fromSource(i,{cache:t,signature_timestamp:parseInt(p)||0,data:f});return m.po_token=r,m}async decipher(e,t,n,r){if(e=e||t||n,!e)throw new Gb(`No valid URL to decipher`);let i=new URLSearchParams(e),a=new URL(i.get(`url`)||e),o=a.searchParams.get(`n`),s=i.get(`s`),l=i.get(`sp`);if(this.data&&(t||n||o)){let e={};if((t||n)&&(e.sig=s,e.sp=l),o){if(r?.has(o)){let e=r.get(o);a.searchParams.set(`n`,e)}else e.n=o}if(Object.keys(e).length>0){let t={...this.data};t.output=`${t.output}\n${sx(e.n,e.sp,e.sig)}`;let n=await Z.shim.eval(t,e);if(typeof n!=`object`||!n)throw new Gb(`Got invalid result from player script evaluation.`);if(typeof e.sig==`string`){let e=n.sig;if(u(px,`Transformed signature from ${s} to ${e}.`),typeof e!=`string`)throw new Gb(`Got invalid signature from player script evaluation.`);l?a.searchParams.set(l,e):a.searchParams.set(`signature`,e)}if(typeof e.n==`string`){let e=n.n;if(u(px,`Transformed n from ${o} to ${e}.`),typeof e!=`string`)throw new Gb(`Failed to decipher nsig`);e.startsWith(`enhanced_except_`)?c(px,`Decipher script returned an error (n=${o}):`,e):r&&r.set(o,e),a.searchParams.set(`n`,e)}}}switch(a.searchParams.get(`sabr`)!==`1`&&this.po_token&&a.searchParams.set(`pot`,this.po_token),a.searchParams.get(`c`)){case`WEB`:a.searchParams.set(`cver`,S.WEB.VERSION);break;case`MWEB`:a.searchParams.set(`cver`,S.MWEB.VERSION);break;case`WEB_REMIX`:a.searchParams.set(`cver`,S.YTMUSIC.VERSION);break;case`WEB_KIDS`:a.searchParams.set(`cver`,S.WEB_KIDS.VERSION);break;case`TVHTML5`:a.searchParams.set(`cver`,S.TV.VERSION);break;case`TVHTML5_SIMPLY`:a.searchParams.set(`cver`,S.TV_SIMPLY.VERSION);break;case`TVHTML5_SIMPLY_EMBEDDED_PLAYER`:a.searchParams.set(`cver`,S.TV_EMBEDDED.VERSION);break;case`WEB_EMBEDDED_PLAYER`:a.searchParams.set(`cver`,S.WEB_EMBEDDED.VERSION)}return u(px,`Deciphered URL: ${a.toString()}`),a.toString()}static async fromCache(t,n){let r=await t.get(n);if(!r)return null;try{let t=Wt(new Uint8Array(r));return t.libraryVersion===E.version?new e(t.playerId,t.signatureTimestamp,t.data):(c(px,`Cached player data is from a different library version (${t.libraryVersion}). Ignoring it.`),null)}catch(e){return l(px,`Failed to deserialize player data from cache:`,e),null}}static async fromSource(t,n){let r=new e(t,n.signature_timestamp,n.data);return await r.cache(n.cache),r}async cache(e){if(!e||!this.data)return;let t=Ut({playerId:this.player_id,signatureTimestamp:this.signature_timestamp,libraryVersion:E.version,data:this.data});await e.set(this.player_id,t)}get url(){return new URL(`/s/player/${this.player_id}/player_ias.vflset/en_US/base.js`,x.YT_BASE).toString()}static get LIBRARY_VERSION(){return 14}},hx={WEB:`WEB`,MWEB:`MWEB`,KIDS:`WEB_KIDS`,MUSIC:`WEB_REMIX`,IOS:`iOS`,ANDROID:`ANDROID`,ANDROID_VR:`ANDROID_VR`,VISIONOS:`VISIONOS`,ANDROID_MUSIC:`ANDROID_MUSIC`,ANDROID_CREATOR:`ANDROID_CREATOR`,TV:`TVHTML5`,TV_SIMPLY:`TVHTML5_SIMPLY`,TV_EMBEDDED:`TVHTML5_SIMPLY_EMBEDDED_PLAYER`,WEB_EMBEDDED:`WEB_EMBEDDED_PLAYER`,WEB_CREATOR:`WEB_CREATOR`},gx=`Session`,_x=class e extends re{context;api_key;api_version;account_index;config_data;player;cookie;cache;po_token;oauth;http;logged_in;actions;user_agent;constructor(e,t,n,r,i,a,o,s,c,l){super(),this.context=e,this.api_key=t,this.api_version=n,this.account_index=r,this.config_data=i,this.player=a,this.cookie=o,this.cache=c,this.po_token=l,this.http=new He(this,o,s),this.actions=new ux(this),this.oauth=new fx(this),this.logged_in=!!o,this.user_agent=e.client.userAgent}static async create(t={}){let{context:n,api_key:r,api_version:i,account_index:a,config_data:o}=await e.getSessionData(t.lang,t.location,t.account_index,t.visitor_data,t.user_agent,t.enable_safety_mode,t.generate_session_locally,t.fail_fast,t.device_category,t.client_type,t.timezone,t.fetch,t.on_behalf_of_user,t.cache,t.enable_session_cache,t.po_token,t.retrieve_innertube_config);return new e(n,r,i,a,o,t.retrieve_player===!1?void 0:await mx.create(t.cache,t.fetch,t.po_token,t.player_id),t.cookie,t.fetch,t.cache,t.po_token)}static async fromCache(e,t){let n=await e.get(`innertube_session_data`);if(!n)return null;try{let e=Wt(new Uint8Array(n));if(e.library_version!==parseInt(E.version.split(`.`,1)[0]))return c(gx,`Cached session data is from a different library version (${e.library_version}). Regenerating session data.`),null;if(t.visitor_data&&(e.context.client.visitorData=t.visitor_data),t.lang&&(e.context.client.hl=t.lang),t.location&&(e.context.client.gl=t.location),t.on_behalf_of_user&&(e.context.user.onBehalfOfUser=t.on_behalf_of_user),t.user_agent&&(e.context.client.userAgent=t.user_agent),t.client_name){let n=Object.values(S).find(e=>e.NAME===t.client_name);n?(e.context.client.clientName=n.NAME,e.context.client.clientVersion=n.VERSION):c(gx,`Unknown client name: ${t.client_name}.`)}return e.context.client.timeZone=t.time_zone,e.context.client.platform=t.device_category.toUpperCase(),e.context.user.enableSafetyMode=t.enable_safety_mode,e}catch(e){return l(gx,`Failed to deserialize session data from cache.`,e),null}}static async getSessionData(e=``,t=``,n=0,r=``,i=Zb(`desktop`),a=!1,o=!1,s=!1,c=`desktop`,f=hx.WEB,p=Intl.DateTimeFormat().resolvedOptions().timeZone,m=Z.shim.fetch,h,g,_=!0,v,ee=!0){let y={lang:e,location:t,time_zone:p,user_agent:i,device_category:c,client_name:f,enable_safety_mode:a,visitor_data:r,on_behalf_of_user:h,po_token:v},b;if(g&&_){let e=await this.fromCache(g,y);e&&(u(gx,`Found session data in cache.`),b=e)}if(!b){u(gx,`Generating session data.`);let n=S.WEB.API_KEY,d=S.WEB.API_VERSION,v={hl:e||`en`,gl:t||`US`,remote_host:``,user_agent:i,visitor_data:r||or($b(11),Math.floor(Date.now()/1e3)),client_name:f,client_version:Object.values(S).find(e=>e.NAME===f)?.VERSION??S.WEB.VERSION,device_category:c.toUpperCase(),os_name:`Windows`,os_version:`10.0`,time_zone:p,browser_name:`Chrome`,browser_version:`125.0.0.0`,device_make:``,device_model:``,enable_safety_mode:a};if(!o)try{let e=await this.#t(y,m);n=e.api_key,d=e.api_version,v=e.context_data}catch(e){if(s)throw e;l(gx,`Failed to retrieve session data from server. Session data generated locally will be used instead.`,e)}if(h&&(v.on_behalf_of_user=h),b={api_key:n,api_version:d,context:this.#n(v)},ee)try{u(gx,`Retrieving InnerTube config data.`);let t={"Accept-Language":e,Accept:`*/*`,Referer:x.YT_BASE,"X-Goog-Visitor-Id":v.visitor_data,"X-Origin":x.YT_BASE,"X-Youtube-Client-Version":v.client_version};Z.shim.server&&(t[`User-Agent`]=i,t.Origin=x.YT_BASE);let n=await(await m(`${x.API.PRODUCTION_1}v1/config?prettyPrint=false`,{headers:t,method:`POST`,body:JSON.stringify({context:b.context})})).json(),r=n.responseContext?.globalConfigGroup?.rawColdConfigGroup?.configData,a=n.responseContext?.globalConfigGroup?.coldHashData,o=n.responseContext?.globalConfigGroup?.hotHashData;b.config_data=n.configData,b.context.client.configInfo={...b.context.client.configInfo,coldConfigData:r,coldHashData:a,hotHashData:o}}catch(e){l(gx,`Failed to retrieve config data.`,e)}_&&await this.#e(b,g)}return d(gx,`Session data:`,b),{...b,account_index:n}}static async#e(e,t){if(!t)return;u(gx,`Compressing and caching session data.`);let n=Ut({...e,library_version:parseInt(E.version.split(`.`,1)[0])});await t.set(`innertube_session_data`,n)}static async#t(e,t=Z.shim.fetch){let n=$b(11);e.visitor_data&&(n=this.#r(e.visitor_data));let r=await t(new URL(`/sw.js_data`,x.YT_BASE),{headers:{"Accept-Language":e.lang||`en-US`,"User-Agent":e.user_agent,Accept:`*/*`,Referer:`${x.YT_BASE}/sw.js`,Cookie:`PREF=tz=${e.time_zone.replace(`/`,`.`)};VISITOR_INFO1_LIVE=${n};`}});if(!r.ok)throw new Kb(`Failed to retrieve session data: ${r.status}`);let i=await r.text();if(!i.startsWith(`)]}'`))throw new Kb(`Incorrect JSPB formatting`);let a=JSON.parse(i.substring(5))[0][2],o=S.WEB.API_VERSION,[[s],c]=a,l=s[61],u=l?.[l.length-1];return{context_data:{hl:e.lang||s[0],gl:e.location||s[1],remote_host:s[3],visitor_data:e.visitor_data||s[13],user_agent:e.user_agent,client_name:e.client_name,client_version:e.client_name===`WEB`?s[16]:Object.values(S).find(t=>t.NAME===e.client_name)?.VERSION||s[16],os_name:s[17],os_version:s[18],time_zone:s[79]||e.time_zone,device_category:e.device_category,browser_name:s[86],browser_version:s[87],device_make:s[11],device_model:s[12],app_install_data:u,device_experiment_id:s[103],rollout_token:s[107],enable_safety_mode:e.enable_safety_mode},api_key:c,api_version:o}}static#n(e){let t={client:{hl:e.hl||`en`,gl:e.gl||`US`,remoteHost:e.remote_host,screenDensityFloat:1,screenHeightPoints:1440,screenPixelDensity:1,screenWidthPoints:2560,visitorData:e.visitor_data,clientName:e.client_name,clientVersion:e.client_version,osName:e.os_name,osVersion:e.os_version,userAgent:e.user_agent,platform:e.device_category.toUpperCase(),clientFormFactor:`UNKNOWN_FORM_FACTOR`,userInterfaceTheme:`USER_INTERFACE_THEME_LIGHT`,timeZone:e.time_zone,originalUrl:x.YT_BASE,deviceMake:e.device_make,deviceModel:e.device_model,browserName:e.browser_name,browserVersion:e.browser_version,utcOffsetMinutes:-Math.floor(new Date().getTimezoneOffset()),memoryTotalKbytes:`8000000`,rolloutToken:e.rollout_token,deviceExperimentId:e.device_experiment_id,mainAppWebInfo:{graftUrl:x.YT_BASE,pwaInstallabilityStatus:`PWA_INSTALLABILITY_STATUS_UNKNOWN`,webDisplayMode:`WEB_DISPLAY_MODE_BROWSER`,isWebNativeShareAvailable:!0}},user:{enableSafetyMode:e.enable_safety_mode,lockedSafetyMode:!1},request:{useSsl:!0,internalExperimentFlags:[]}};return e.app_install_data&&(t.client.configInfo={appInstallData:e.app_install_data}),e.on_behalf_of_user&&(t.user.onBehalfOfUser=e.on_behalf_of_user),t}static#r(e){return sr(e).id}async signIn(e){return new Promise(async(t,n)=>{let r=e=>n(e);this.once(`auth-error`,r),this.once(`auth`,()=>{this.off(`auth-error`,r),this.logged_in=!0,t()});try{await this.oauth.init(e)}catch(e){n(e)}})}async signOut(){if(!this.logged_in)throw new Q(`You must be signed in to perform this operation.`);let e=await this.oauth.revokeCredentials();return this.logged_in=!1,e}get client_version(){return this.context.client.clientVersion}get client_name(){return this.context.client.clientName}get lang(){return this.context.client.hl}},vx=class{#e;constructor(e){this.#e=e}async search(e){let t=await new B({searchEndpoint:{query:e}}).call(this.#e.actions,{client:`YTKIDS`});return new Lb(this.#e.actions,t)}async getInfo(e,t){let n={videoId:e},r=new B({watchEndpoint:n}),i=new B({watchNextEndpoint:n}),a=this.#e,o={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:`-1`,signatureTimestamp:a.player?.signature_timestamp}},client:`YTKIDS`};t?.po_token?o.serviceIntegrityDimensions={poToken:t.po_token}:a.po_token&&(o.serviceIntegrityDimensions={poToken:a.po_token});let s=r.call(a.actions,o),c=i.call(a.actions,{client:`YTKIDS`}),l=await Promise.all([s,c]),u=$b(16);return new Rb(l,a.actions,u)}async getChannel(e){let t=await new B({browseEndpoint:{browseId:e}}).call(this.#e.actions,{client:`YTKIDS`});return new Fb(this.#e.actions,t)}async getHomeFeed(){let e=await new B({browseEndpoint:{browseId:`FEkids_home`}}).call(this.#e.actions,{client:`YTKIDS`});return new Ib(this.#e.actions,e)}async blockChannel(e){let t=this.#e;if(!t.logged_in)throw new Q(`You must be signed in to perform this operation.`);let n=q({contents:(await new B({getKidsBlocklistPickerCommand:{blockedForKidsContent:{external_channel_id:e}}}).call(t.actions,{client:`YTKIDS`})).data.command.confirmDialogEndpoint.content,engagementPanels:[]}).contents_memo?.getType(Ov);if(!n)throw new Q(`Could not find any kids profiles or supervised accounts.`);let r=[];for(let e of n)e.block_button?.is_toggled||(e.setActions(t.actions),r.push(await e.blockChannel()));return r}},yx=class{#e;#t;constructor(e){this.#e=e,this.#t=e.actions}getInfo(e,t){return e instanceof kh?this.#r(e.endpoint,t):e instanceof Oh?this.#r(e.overlay?.content?.endpoint??e.endpoint,t):e instanceof B?this.#r(e,t):this.#n(e,t)}async#n(e,t){let n={videoId:e,racyCheckOk:!0,contentCheckOk:!0},r=new B({watchEndpoint:n}),i=new B({watchNextEndpoint:n}),a={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:`-1`,signatureTimestamp:this.#e.player?.signature_timestamp}},client:`YTMUSIC`};t?.po_token?a.serviceIntegrityDimensions={poToken:t.po_token}:this.#e.po_token&&(a.serviceIntegrityDimensions={poToken:this.#e.po_token});let o=r.call(this.#t,a),s=i.call(this.#t,{client:`YTMUSIC`}),c=await Promise.all([o,s]),l=$b(16);return new Pb(c,this.#t,l)}async#r(e,t){if(!e)throw Error(`This item does not have an endpoint.`);let n={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:`-1`,signatureTimestamp:this.#e.player?.signature_timestamp}},client:`YTMUSIC`};t?.po_token?n.serviceIntegrityDimensions={poToken:t.po_token}:this.#e.po_token&&(n.serviceIntegrityDimensions={poToken:this.#e.po_token});let r=e.call(this.#t,n),i=e.call(this.#t,{client:`YTMUSIC`,enablePersistentPlaylistPanel:!0,override_endpoint:`/next`}),a=$b(16);return new Pb(await Promise.all([r,i]),this.#t,a)}async search(e,t={}){$({query:e});let n;if(t.type&&t.type!==`all`){let e=Qt.encode({filters:{musicSearchType:{[t.type]:!0}}});n=encodeURIComponent(rx(e.finish()))}return new Mb(await new B({searchEndpoint:{query:e,params:n}}).call(this.#t,{client:`YTMUSIC`}),this.#t,Reflect.has(t,`type`)&&t.type!==`all`)}async getHomeFeed(){return new Db(await new B({browseEndpoint:{browseId:`FEmusic_home`}}).call(this.#t,{client:`YTMUSIC`}),this.#t)}async getExplore(){return new Eb(await new B({browseEndpoint:{browseId:`FEmusic_explore`}}).call(this.#t,{client:`YTMUSIC`}))}async getLibrary(){return new Ob(await new B({browseEndpoint:{browseId:`FEmusic_library_landing`}}).call(this.#t,{client:`YTMUSIC`}),this.#t)}async getArtist(e){if(!e||!e.startsWith(`UC`)&&!e.startsWith(`FEmusic_library_privately_owned_artist`))throw new Q(`Invalid artist id`,e);return new Tb(await new B({browseEndpoint:{browseId:e}}).call(this.#t,{client:`YTMUSIC`}),this.#t)}async getAlbum(e){if(!e||!e.startsWith(`MPR`)&&!e.startsWith(`FEmusic_library_privately_owned_release`))throw new Q(`Invalid album id`,e);return new wb(await new B({browseEndpoint:{browseId:e}}).call(this.#t,{client:`YTMUSIC`}))}async getPlaylist(e){return e.startsWith(`VL`)||(e=`VL${e}`),new Ab(await new B({browseEndpoint:{browseId:e}}).call(this.#t,{client:`YTMUSIC`}),this.#t)}async getUpNext(e,t=!0){$({video_id:e});let n=(await new B({watchNextEndpoint:{videoId:e}}).call(this.#t,{client:`YTMUSIC`,parse:!0})).contents_memo?.getType(M_)?.[0];if(!n)throw new Q(`Could not find target tab.`);let r=n.content?.as(Kh);if(!r||!r.content)throw new Q(`Music queue was empty, the given id is probably invalid.`,r);let i=r.content.as(Gh);if(!i.playlist_id&&t){let t=i.contents.firstOfType(cc);if(!t)throw new Q(`Automix item not found`);let n=await t.playlist_video?.endpoint.call(this.#t,{videoId:e,client:`YTMUSIC`,parse:!0});if(!n||!n.contents_memo)throw new Q(`Could not fetch automix`);return n.contents_memo.getType(Gh)[0]}return i}async getRelated(e){$({video_id:e});let t=((await new B({watchNextEndpoint:{videoId:e}}).call(this.#t,{client:`YTMUSIC`,parse:!0})).contents_memo?.getType(M_))?.find(e=>e.endpoint.payload.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType===`MUSIC_PAGE_TYPE_TRACK_RELATED`);if(!t)throw new Q(`Could not find target tab.`);let n=await t.endpoint.call(this.#t,{client:`YTMUSIC`,parse:!0});if(!n.contents)throw new Q(`Unexpected response`,n);return n.contents.item().as(K,bd)}async getLyrics(e){$({video_id:e});let t=((await new B({watchNextEndpoint:{videoId:e}}).call(this.#t,{client:`YTMUSIC`,parse:!0})).contents_memo?.getType(M_))?.find(e=>e.endpoint.payload.browseEndpointContextSupportedConfigs?.browseEndpointContextMusicConfig?.pageType===`MUSIC_PAGE_TYPE_TRACK_LYRICS`);if(!t)throw new Q(`Could not find target tab.`);let n=await t.endpoint.call(this.#t,{client:`YTMUSIC`,parse:!0});if(!n.contents)throw new Q(`Unexpected response`,n);if(n.contents.item().type===`Message`)throw new Q(n.contents.item().as(bd).text.toString(),e);return n.contents.item().as(K).contents.firstOfType(jh)}async getRecap(){return new jb(await new B({browseEndpoint:{browseId:`FEmusic_listening_review`}}).call(this.#t,{client:`YTMUSIC`}),this.#t)}async getSearchSuggestions(e){let t=await this.#t.execute(`/music/get_search_suggestions`,{input:e,client:`YTMUSIC`,parse:!0});return t.contents_memo?t.contents_memo.getType(d_):[]}};function bx(){return{profile:void 0,supportedCapabilities:[],disabledCapabilities:[],snapshot:void 0}}var xx={encode(e,n=new t){e.profile!==void 0&&n.uint32(10).string(e.profile);for(let t of e.supportedCapabilities)Cx.encode(t,n.uint32(18).fork()).join();for(let t of e.disabledCapabilities)Cx.encode(t,n.uint32(26).fork()).join();return e.snapshot!==void 0&&n.uint32(42).string(e.snapshot),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=bx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.profile=r.string();continue;case 2:if(e!==18)break;a.supportedCapabilities.push(Cx.decode(r,r.uint32()));continue;case 3:if(e!==26)break;a.disabledCapabilities.push(Cx.decode(r,r.uint32()));continue;case 5:if(e!==42)break;a.snapshot=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Sx(){return{capability:void 0,features:void 0,experimentFlags:void 0}}var Cx={encode(e,n=new t){return e.capability!==void 0&&n.uint32(8).uint32(e.capability),e.features!==void 0&&n.uint32(16).uint32(e.features),e.experimentFlags!==void 0&&n.uint32(50).string(e.experimentFlags),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Sx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.capability=r.uint32();continue;case 2:if(e!==16)break;a.features=r.uint32();continue;case 6:if(e!==50)break;a.experimentFlags=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function wx(){return{hl:void 0,gl:void 0,remoteHost:void 0,deviceId:void 0,debugDeviceIdOverride:void 0,carrierGeo:void 0,crackedHl:void 0,deviceMake:void 0,deviceModel:void 0,visitorData:void 0,userAgent:void 0,clientName:void 0,clientVersion:void 0,osName:void 0,osVersion:void 0,projectId:void 0,acceptLanguage:void 0,acceptRegion:void 0,originalUrl:void 0,rawDeviceId:void 0,configData:void 0,spacecastToken:void 0,internalGeo:void 0,screenWidthPoints:void 0,screenHeightPoints:void 0,screenWidthInches:void 0,screenHeightInches:void 0,screenPixelDensity:void 0,platform:void 0,spacecastClientInfo:void 0,clientFormFactor:void 0,forwardedFor:void 0,mobileDataPlanInfo:void 0,gmscoreVersionCode:void 0,webpSupport:void 0,cameraType:void 0,experimentsToken:void 0,windowWidthPoints:void 0,windowHeightPoints:void 0,configInfo:void 0,unpluggedLocationInfo:void 0,androidSdkVersion:void 0,screenDensityFloat:void 0,firstTimeSignInExperimentIds:void 0,utcOffsetMinutes:void 0,animatedWebpSupport:void 0,kidsAppInfo:void 0,musicAppInfo:void 0,tvAppInfo:void 0,internalGeoIp:void 0,unpluggedAppInfo:void 0,locationInfo:void 0,contentSizeCategory:void 0,fontScale:void 0,userInterfaceTheme:void 0,timeZone:void 0,homeGroupInfo:void 0,emlTemplateContext:void 0,coldAppBundleConfigData:void 0,browserName:void 0,browserVersion:void 0,locationPlayabilityToken:void 0,chipset:void 0,firmwareVersion:void 0,memoryTotalKbytes:void 0,mainAppWebInfo:void 0,notificationPermissionInfo:void 0,deviceBrand:void 0,glDeviceInfo:void 0}}var Tx={encode(e,n=new t){return e.hl!==void 0&&n.uint32(10).string(e.hl),e.gl!==void 0&&n.uint32(18).string(e.gl),e.remoteHost!==void 0&&n.uint32(34).string(e.remoteHost),e.deviceId!==void 0&&n.uint32(50).string(e.deviceId),e.debugDeviceIdOverride!==void 0&&n.uint32(66).string(e.debugDeviceIdOverride),e.carrierGeo!==void 0&&n.uint32(82).string(e.carrierGeo),e.crackedHl!==void 0&&n.uint32(88).bool(e.crackedHl),e.deviceMake!==void 0&&n.uint32(98).string(e.deviceMake),e.deviceModel!==void 0&&n.uint32(106).string(e.deviceModel),e.visitorData!==void 0&&n.uint32(114).string(e.visitorData),e.userAgent!==void 0&&n.uint32(122).string(e.userAgent),e.clientName!==void 0&&n.uint32(128).int32(e.clientName),e.clientVersion!==void 0&&n.uint32(138).string(e.clientVersion),e.osName!==void 0&&n.uint32(146).string(e.osName),e.osVersion!==void 0&&n.uint32(154).string(e.osVersion),e.projectId!==void 0&&n.uint32(162).string(e.projectId),e.acceptLanguage!==void 0&&n.uint32(170).string(e.acceptLanguage),e.acceptRegion!==void 0&&n.uint32(178).string(e.acceptRegion),e.originalUrl!==void 0&&n.uint32(186).string(e.originalUrl),e.rawDeviceId!==void 0&&n.uint32(202).string(e.rawDeviceId),e.configData!==void 0&&n.uint32(218).string(e.configData),e.spacecastToken!==void 0&&n.uint32(250).string(e.spacecastToken),e.internalGeo!==void 0&&n.uint32(274).string(e.internalGeo),e.screenWidthPoints!==void 0&&n.uint32(296).int32(e.screenWidthPoints),e.screenHeightPoints!==void 0&&n.uint32(304).int32(e.screenHeightPoints),e.screenWidthInches!==void 0&&n.uint32(317).float(e.screenWidthInches),e.screenHeightInches!==void 0&&n.uint32(325).float(e.screenHeightInches),e.screenPixelDensity!==void 0&&n.uint32(328).int32(e.screenPixelDensity),e.platform!==void 0&&n.uint32(336).int32(e.platform),e.spacecastClientInfo!==void 0&&Nx.encode(e.spacecastClientInfo,n.uint32(362).fork()).join(),e.clientFormFactor!==void 0&&n.uint32(368).int32(e.clientFormFactor),e.forwardedFor!==void 0&&n.uint32(386).string(e.forwardedFor),e.mobileDataPlanInfo!==void 0&&Lx.encode(e.mobileDataPlanInfo,n.uint32(394).fork()).join(),e.gmscoreVersionCode!==void 0&&n.uint32(400).int32(e.gmscoreVersionCode),e.webpSupport!==void 0&&n.uint32(408).bool(e.webpSupport),e.cameraType!==void 0&&n.uint32(416).int32(e.cameraType),e.experimentsToken!==void 0&&n.uint32(434).string(e.experimentsToken),e.windowWidthPoints!==void 0&&n.uint32(440).int32(e.windowWidthPoints),e.windowHeightPoints!==void 0&&n.uint32(448).int32(e.windowHeightPoints),e.configInfo!==void 0&&zx.encode(e.configInfo,n.uint32(498).fork()).join(),e.unpluggedLocationInfo!==void 0&&Vx.encode(e.unpluggedLocationInfo,n.uint32(506).fork()).join(),e.androidSdkVersion!==void 0&&n.uint32(512).int32(e.androidSdkVersion),e.screenDensityFloat!==void 0&&n.uint32(525).float(e.screenDensityFloat),e.firstTimeSignInExperimentIds!==void 0&&n.uint32(528).int32(e.firstTimeSignInExperimentIds),e.utcOffsetMinutes!==void 0&&n.uint32(536).int32(e.utcOffsetMinutes),e.animatedWebpSupport!==void 0&&n.uint32(544).bool(e.animatedWebpSupport),e.kidsAppInfo!==void 0&&Ux.encode(e.kidsAppInfo,n.uint32(554).fork()).join(),e.musicAppInfo!==void 0&&Zx.encode(e.musicAppInfo,n.uint32(562).fork()).join(),e.tvAppInfo!==void 0&&$x.encode(e.tvAppInfo,n.uint32(570).fork()).join(),e.internalGeoIp!==void 0&&n.uint32(578).string(e.internalGeoIp),e.unpluggedAppInfo!==void 0&&rS.encode(e.unpluggedAppInfo,n.uint32(586).fork()).join(),e.locationInfo!==void 0&&aS.encode(e.locationInfo,n.uint32(594).fork()).join(),e.contentSizeCategory!==void 0&&n.uint32(610).string(e.contentSizeCategory),e.fontScale!==void 0&&n.uint32(621).float(e.fontScale),e.userInterfaceTheme!==void 0&&n.uint32(624).int32(e.userInterfaceTheme),e.timeZone!==void 0&&n.uint32(642).string(e.timeZone),e.homeGroupInfo!==void 0&&lS.encode(e.homeGroupInfo,n.uint32(650).fork()).join(),e.emlTemplateContext!==void 0&&n.uint32(674).bytes(e.emlTemplateContext),e.coldAppBundleConfigData!==void 0&&n.uint32(682).bytes(e.coldAppBundleConfigData),e.browserName!==void 0&&n.uint32(698).string(e.browserName),e.browserVersion!==void 0&&n.uint32(706).string(e.browserVersion),e.locationPlayabilityToken!==void 0&&n.uint32(714).string(e.locationPlayabilityToken),e.chipset!==void 0&&n.uint32(738).string(e.chipset),e.firmwareVersion!==void 0&&n.uint32(746).string(e.firmwareVersion),e.memoryTotalKbytes!==void 0&&n.uint32(760).int64(e.memoryTotalKbytes),e.mainAppWebInfo!==void 0&&Dx.encode(e.mainAppWebInfo,n.uint32(770).fork()).join(),e.notificationPermissionInfo!==void 0&&kx.encode(e.notificationPermissionInfo,n.uint32(778).fork()).join(),e.deviceBrand!==void 0&&n.uint32(786).string(e.deviceBrand),e.glDeviceInfo!==void 0&&jx.encode(e.glDeviceInfo,n.uint32(818).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=wx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.hl=r.string();continue;case 2:if(e!==18)break;a.gl=r.string();continue;case 4:if(e!==34)break;a.remoteHost=r.string();continue;case 6:if(e!==50)break;a.deviceId=r.string();continue;case 8:if(e!==66)break;a.debugDeviceIdOverride=r.string();continue;case 10:if(e!==82)break;a.carrierGeo=r.string();continue;case 11:if(e!==88)break;a.crackedHl=r.bool();continue;case 12:if(e!==98)break;a.deviceMake=r.string();continue;case 13:if(e!==106)break;a.deviceModel=r.string();continue;case 14:if(e!==114)break;a.visitorData=r.string();continue;case 15:if(e!==122)break;a.userAgent=r.string();continue;case 16:if(e!==128)break;a.clientName=r.int32();continue;case 17:if(e!==138)break;a.clientVersion=r.string();continue;case 18:if(e!==146)break;a.osName=r.string();continue;case 19:if(e!==154)break;a.osVersion=r.string();continue;case 20:if(e!==162)break;a.projectId=r.string();continue;case 21:if(e!==170)break;a.acceptLanguage=r.string();continue;case 22:if(e!==178)break;a.acceptRegion=r.string();continue;case 23:if(e!==186)break;a.originalUrl=r.string();continue;case 25:if(e!==202)break;a.rawDeviceId=r.string();continue;case 27:if(e!==218)break;a.configData=r.string();continue;case 31:if(e!==250)break;a.spacecastToken=r.string();continue;case 34:if(e!==274)break;a.internalGeo=r.string();continue;case 37:if(e!==296)break;a.screenWidthPoints=r.int32();continue;case 38:if(e!==304)break;a.screenHeightPoints=r.int32();continue;case 39:if(e!==317)break;a.screenWidthInches=r.float();continue;case 40:if(e!==325)break;a.screenHeightInches=r.float();continue;case 41:if(e!==328)break;a.screenPixelDensity=r.int32();continue;case 42:if(e!==336)break;a.platform=r.int32();continue;case 45:if(e!==362)break;a.spacecastClientInfo=Nx.decode(r,r.uint32());continue;case 46:if(e!==368)break;a.clientFormFactor=r.int32();continue;case 48:if(e!==386)break;a.forwardedFor=r.string();continue;case 49:if(e!==394)break;a.mobileDataPlanInfo=Lx.decode(r,r.uint32());continue;case 50:if(e!==400)break;a.gmscoreVersionCode=r.int32();continue;case 51:if(e!==408)break;a.webpSupport=r.bool();continue;case 52:if(e!==416)break;a.cameraType=r.int32();continue;case 54:if(e!==434)break;a.experimentsToken=r.string();continue;case 55:if(e!==440)break;a.windowWidthPoints=r.int32();continue;case 56:if(e!==448)break;a.windowHeightPoints=r.int32();continue;case 62:if(e!==498)break;a.configInfo=zx.decode(r,r.uint32());continue;case 63:if(e!==506)break;a.unpluggedLocationInfo=Vx.decode(r,r.uint32());continue;case 64:if(e!==512)break;a.androidSdkVersion=r.int32();continue;case 65:if(e!==525)break;a.screenDensityFloat=r.float();continue;case 66:if(e!==528)break;a.firstTimeSignInExperimentIds=r.int32();continue;case 67:if(e!==536)break;a.utcOffsetMinutes=r.int32();continue;case 68:if(e!==544)break;a.animatedWebpSupport=r.bool();continue;case 69:if(e!==554)break;a.kidsAppInfo=Ux.decode(r,r.uint32());continue;case 70:if(e!==562)break;a.musicAppInfo=Zx.decode(r,r.uint32());continue;case 71:if(e!==570)break;a.tvAppInfo=$x.decode(r,r.uint32());continue;case 72:if(e!==578)break;a.internalGeoIp=r.string();continue;case 73:if(e!==586)break;a.unpluggedAppInfo=rS.decode(r,r.uint32());continue;case 74:if(e!==594)break;a.locationInfo=aS.decode(r,r.uint32());continue;case 76:if(e!==610)break;a.contentSizeCategory=r.string();continue;case 77:if(e!==621)break;a.fontScale=r.float();continue;case 78:if(e!==624)break;a.userInterfaceTheme=r.int32();continue;case 80:if(e!==642)break;a.timeZone=r.string();continue;case 81:if(e!==650)break;a.homeGroupInfo=lS.decode(r,r.uint32());continue;case 84:if(e!==674)break;a.emlTemplateContext=r.bytes();continue;case 85:if(e!==682)break;a.coldAppBundleConfigData=r.bytes();continue;case 87:if(e!==698)break;a.browserName=r.string();continue;case 88:if(e!==706)break;a.browserVersion=r.string();continue;case 89:if(e!==714)break;a.locationPlayabilityToken=r.string();continue;case 92:if(e!==738)break;a.chipset=r.string();continue;case 93:if(e!==746)break;a.firmwareVersion=r.string();continue;case 95:if(e!==760)break;a.memoryTotalKbytes=uS(r.int64());continue;case 96:if(e!==770)break;a.mainAppWebInfo=Dx.decode(r,r.uint32());continue;case 97:if(e!==778)break;a.notificationPermissionInfo=kx.decode(r,r.uint32());continue;case 98:if(e!==786)break;a.deviceBrand=r.string();continue;case 102:if(e!==818)break;a.glDeviceInfo=jx.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Ex(){return{graftUrl:void 0,pwaInstallabilityStatus:void 0,webDisplayMode:void 0,isWebNativeShareAvailable:void 0,storeDigitalGoodsApiSupportStatus:void 0}}var Dx={encode(e,n=new t){return e.graftUrl!==void 0&&n.uint32(10).string(e.graftUrl),e.pwaInstallabilityStatus!==void 0&&n.uint32(16).int32(e.pwaInstallabilityStatus),e.webDisplayMode!==void 0&&n.uint32(24).int32(e.webDisplayMode),e.isWebNativeShareAvailable!==void 0&&n.uint32(32).bool(e.isWebNativeShareAvailable),e.storeDigitalGoodsApiSupportStatus!==void 0&&n.uint32(40).int32(e.storeDigitalGoodsApiSupportStatus),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Ex();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.graftUrl=r.string();continue;case 2:if(e!==16)break;a.pwaInstallabilityStatus=r.int32();continue;case 3:if(e!==24)break;a.webDisplayMode=r.int32();continue;case 4:if(e!==32)break;a.isWebNativeShareAvailable=r.bool();continue;case 5:if(e!==40)break;a.storeDigitalGoodsApiSupportStatus=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Ox(){return{notificationsSetting:void 0,lastDeviceOptInChangeTimeAgoSec:void 0}}var kx={encode(e,n=new t){return e.notificationsSetting!==void 0&&n.uint32(8).int32(e.notificationsSetting),e.lastDeviceOptInChangeTimeAgoSec!==void 0&&n.uint32(16).int64(e.lastDeviceOptInChangeTimeAgoSec),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Ox();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.notificationsSetting=r.int32();continue;case 2:if(e!==16)break;a.lastDeviceOptInChangeTimeAgoSec=uS(r.int64());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Ax(){return{glRenderer:void 0,glEsVersionMajor:void 0,glEsVersionMinor:void 0}}var jx={encode(e,n=new t){return e.glRenderer!==void 0&&n.uint32(10).string(e.glRenderer),e.glEsVersionMajor!==void 0&&n.uint32(16).int32(e.glEsVersionMajor),e.glEsVersionMinor!==void 0&&n.uint32(24).int32(e.glEsVersionMinor),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Ax();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.glRenderer=r.string();continue;case 2:if(e!==16)break;a.glEsVersionMajor=r.int32();continue;case 3:if(e!==24)break;a.glEsVersionMinor=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Mx(){return{appliances:void 0,interactionLevel:void 0}}var Nx={encode(e,n=new t){return e.appliances!==void 0&&Fx.encode(e.appliances,n.uint32(10).fork()).join(),e.interactionLevel!==void 0&&n.uint32(16).int32(e.interactionLevel),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Mx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.appliances=Fx.decode(r,r.uint32());continue;case 2:if(e!==16)break;a.interactionLevel=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Px(){return{contentProfileToken:void 0,status:void 0,hostname:void 0,active:void 0,deviceId:void 0}}var Fx={encode(e,n=new t){return e.contentProfileToken!==void 0&&n.uint32(10).bytes(e.contentProfileToken),e.status!==void 0&&n.uint32(16).int32(e.status),e.hostname!==void 0&&n.uint32(26).string(e.hostname),e.active!==void 0&&n.uint32(32).bool(e.active),e.deviceId!==void 0&&n.uint32(42).string(e.deviceId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Px();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.contentProfileToken=r.bytes();continue;case 2:if(e!==16)break;a.status=r.int32();continue;case 3:if(e!==26)break;a.hostname=r.string();continue;case 4:if(e!==32)break;a.active=r.bool();continue;case 5:if(e!==42)break;a.deviceId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Ix(){return{cpid:void 0,serializedDataPlanStatus:void 0,dataSavingQualityPickerEnabled:void 0,mccmnc:void 0}}var Lx={encode(e,n=new t){return e.cpid!==void 0&&n.uint32(394).string(e.cpid),e.serializedDataPlanStatus!==void 0&&n.uint32(402).string(e.serializedDataPlanStatus),e.dataSavingQualityPickerEnabled!==void 0&&n.uint32(416).bool(e.dataSavingQualityPickerEnabled),e.mccmnc!==void 0&&n.uint32(426).string(e.mccmnc),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Ix();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 49:if(e!==394)break;a.cpid=r.string();continue;case 50:if(e!==402)break;a.serializedDataPlanStatus=r.string();continue;case 52:if(e!==416)break;a.dataSavingQualityPickerEnabled=r.bool();continue;case 53:if(e!==426)break;a.mccmnc=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Rx(){return{coldConfigData:void 0,coldHashData:void 0,hotHashData:void 0,appInstallData:void 0}}var zx={encode(e,n=new t){return e.coldConfigData!==void 0&&n.uint32(10).string(e.coldConfigData),e.coldHashData!==void 0&&n.uint32(26).string(e.coldHashData),e.hotHashData!==void 0&&n.uint32(42).string(e.hotHashData),e.appInstallData!==void 0&&n.uint32(50).string(e.appInstallData),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Rx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.coldConfigData=r.string();continue;case 3:if(e!==26)break;a.coldHashData=r.string();continue;case 5:if(e!==42)break;a.hotHashData=r.string();continue;case 6:if(e!==50)break;a.appInstallData=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Bx(){return{latitudeE7:void 0,longitudeE7:void 0,localTimestampMs:void 0,ipAddress:void 0,timezone:void 0,prefer24HourTime:void 0,locationRadiusMeters:void 0,isInitialLoad:void 0,browserPermissionGranted:void 0,clientPermissionState:void 0,locationOverrideToken:void 0}}var Vx={encode(e,n=new t){return e.latitudeE7!==void 0&&n.uint32(8).int32(e.latitudeE7),e.longitudeE7!==void 0&&n.uint32(16).int32(e.longitudeE7),e.localTimestampMs!==void 0&&n.uint32(24).int64(e.localTimestampMs),e.ipAddress!==void 0&&n.uint32(34).string(e.ipAddress),e.timezone!==void 0&&n.uint32(42).string(e.timezone),e.prefer24HourTime!==void 0&&n.uint32(48).bool(e.prefer24HourTime),e.locationRadiusMeters!==void 0&&n.uint32(56).int32(e.locationRadiusMeters),e.isInitialLoad!==void 0&&n.uint32(64).bool(e.isInitialLoad),e.browserPermissionGranted!==void 0&&n.uint32(72).bool(e.browserPermissionGranted),e.clientPermissionState!==void 0&&n.uint32(80).int32(e.clientPermissionState),e.locationOverrideToken!==void 0&&n.uint32(90).string(e.locationOverrideToken),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Bx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.latitudeE7=r.int32();continue;case 2:if(e!==16)break;a.longitudeE7=r.int32();continue;case 3:if(e!==24)break;a.localTimestampMs=uS(r.int64());continue;case 4:if(e!==34)break;a.ipAddress=r.string();continue;case 5:if(e!==42)break;a.timezone=r.string();continue;case 6:if(e!==48)break;a.prefer24HourTime=r.bool();continue;case 7:if(e!==56)break;a.locationRadiusMeters=r.int32();continue;case 8:if(e!==64)break;a.isInitialLoad=r.bool();continue;case 9:if(e!==72)break;a.browserPermissionGranted=r.bool();continue;case 10:if(e!==80)break;a.clientPermissionState=r.int32();continue;case 11:if(e!==90)break;a.locationOverrideToken=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Hx(){return{contentSettings:void 0,parentCurationMode:void 0,categorySettings:void 0,userEducationSettings:void 0}}var Ux={encode(e,n=new t){return e.contentSettings!==void 0&&Gx.encode(e.contentSettings,n.uint32(10).fork()).join(),e.parentCurationMode!==void 0&&n.uint32(16).int32(e.parentCurationMode),e.categorySettings!==void 0&&qx.encode(e.categorySettings,n.uint32(26).fork()).join(),e.userEducationSettings!==void 0&&Yx.encode(e.userEducationSettings,n.uint32(34).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Hx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.contentSettings=Gx.decode(r,r.uint32());continue;case 2:if(e!==16)break;a.parentCurationMode=r.int32();continue;case 3:if(e!==26)break;a.categorySettings=qx.decode(r,r.uint32());continue;case 4:if(e!==34)break;a.userEducationSettings=Yx.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Wx(){return{kidsNoSearchMode:void 0,ageUpMode:void 0,contentDensity:void 0}}var Gx={encode(e,n=new t){return e.kidsNoSearchMode!==void 0&&n.uint32(8).int32(e.kidsNoSearchMode),e.ageUpMode!==void 0&&n.uint32(16).int32(e.ageUpMode),e.contentDensity!==void 0&&n.uint32(24).int32(e.contentDensity),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Wx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.kidsNoSearchMode=r.int32();continue;case 2:if(e!==16)break;a.ageUpMode=r.int32();continue;case 3:if(e!==24)break;a.contentDensity=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Kx(){return{enabledCategories:void 0}}var qx={encode(e,n=new t){return e.enabledCategories!==void 0&&n.uint32(10).string(e.enabledCategories),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Kx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.enabledCategories=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Jx(){return{hasSeenHomeChipBarUserEducation:void 0,hasSeenHomePivotBarUserEducation:void 0,hasSeenParentMuirUserEducation:void 0}}var Yx={encode(e,n=new t){return e.hasSeenHomeChipBarUserEducation!==void 0&&n.uint32(8).bool(e.hasSeenHomeChipBarUserEducation),e.hasSeenHomePivotBarUserEducation!==void 0&&n.uint32(16).bool(e.hasSeenHomePivotBarUserEducation),e.hasSeenParentMuirUserEducation!==void 0&&n.uint32(24).bool(e.hasSeenParentMuirUserEducation),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Jx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.hasSeenHomeChipBarUserEducation=r.bool();continue;case 2:if(e!==16)break;a.hasSeenHomePivotBarUserEducation=r.bool();continue;case 3:if(e!==24)break;a.hasSeenParentMuirUserEducation=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Xx(){return{playBackMode:void 0,musicLocationMasterSwitch:void 0,musicActivityMasterSwitch:void 0,offlineMixtapeEnabled:void 0,autoOfflineEnabled:void 0,iosBackgroundRefreshStatus:void 0,smartDownloadsSongLimit:void 0,transitionedFromMixtapeToSmartDownloads:void 0,pwaInstallabilityStatus:void 0,webDisplayMode:void 0,musicTier:void 0,storeDigitalGoodsApiSupportStatus:void 0,smartDownloadsTimeSinceLastOptOutSec:void 0}}var Zx={encode(e,n=new t){return e.playBackMode!==void 0&&n.uint32(8).int32(e.playBackMode),e.musicLocationMasterSwitch!==void 0&&n.uint32(16).int32(e.musicLocationMasterSwitch),e.musicActivityMasterSwitch!==void 0&&n.uint32(24).int32(e.musicActivityMasterSwitch),e.offlineMixtapeEnabled!==void 0&&n.uint32(32).bool(e.offlineMixtapeEnabled),e.autoOfflineEnabled!==void 0&&n.uint32(40).bool(e.autoOfflineEnabled),e.iosBackgroundRefreshStatus!==void 0&&n.uint32(48).int32(e.iosBackgroundRefreshStatus),e.smartDownloadsSongLimit!==void 0&&n.uint32(56).int32(e.smartDownloadsSongLimit),e.transitionedFromMixtapeToSmartDownloads!==void 0&&n.uint32(64).bool(e.transitionedFromMixtapeToSmartDownloads),e.pwaInstallabilityStatus!==void 0&&n.uint32(72).int32(e.pwaInstallabilityStatus),e.webDisplayMode!==void 0&&n.uint32(80).int32(e.webDisplayMode),e.musicTier!==void 0&&n.uint32(88).int32(e.musicTier),e.storeDigitalGoodsApiSupportStatus!==void 0&&n.uint32(96).int32(e.storeDigitalGoodsApiSupportStatus),e.smartDownloadsTimeSinceLastOptOutSec!==void 0&&n.uint32(104).int64(e.smartDownloadsTimeSinceLastOptOutSec),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Xx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.playBackMode=r.int32();continue;case 2:if(e!==16)break;a.musicLocationMasterSwitch=r.int32();continue;case 3:if(e!==24)break;a.musicActivityMasterSwitch=r.int32();continue;case 4:if(e!==32)break;a.offlineMixtapeEnabled=r.bool();continue;case 5:if(e!==40)break;a.autoOfflineEnabled=r.bool();continue;case 6:if(e!==48)break;a.iosBackgroundRefreshStatus=r.int32();continue;case 7:if(e!==56)break;a.smartDownloadsSongLimit=r.int32();continue;case 8:if(e!==64)break;a.transitionedFromMixtapeToSmartDownloads=r.bool();continue;case 9:if(e!==72)break;a.pwaInstallabilityStatus=r.int32();continue;case 10:if(e!==80)break;a.webDisplayMode=r.int32();continue;case 11:if(e!==88)break;a.musicTier=r.int32();continue;case 12:if(e!==96)break;a.storeDigitalGoodsApiSupportStatus=r.int32();continue;case 13:if(e!==104)break;a.smartDownloadsTimeSinceLastOptOutSec=uS(r.int64());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function Qx(){return{mdxImpactedSessionsServerEvents:void 0,enablePrivacyFilter:void 0,zylonLeftNav:void 0,certificationScope:void 0,livingRoomPoTokenId:void 0,jsEngineString:void 0,voiceCapability:void 0,systemIntegrator:void 0,androidBuildFingerprint:void 0,cobaltAppVersion:void 0,cobaltStarboardVersion:void 0,useStartPlaybackPreviewCommand:void 0,shouldShowPersistentSigninOnHome:void 0,androidPlayServicesVersion:void 0}}var $x={encode(e,n=new t){return e.mdxImpactedSessionsServerEvents!==void 0&&n.uint32(26).string(e.mdxImpactedSessionsServerEvents),e.enablePrivacyFilter!==void 0&&n.uint32(48).bool(e.enablePrivacyFilter),e.zylonLeftNav!==void 0&&n.uint32(56).bool(e.zylonLeftNav),e.certificationScope!==void 0&&n.uint32(74).string(e.certificationScope),e.livingRoomPoTokenId!==void 0&&n.uint32(82).string(e.livingRoomPoTokenId),e.jsEngineString!==void 0&&n.uint32(98).string(e.jsEngineString),e.voiceCapability!==void 0&&tS.encode(e.voiceCapability,n.uint32(106).fork()).join(),e.systemIntegrator!==void 0&&n.uint32(114).string(e.systemIntegrator),e.androidBuildFingerprint!==void 0&&n.uint32(146).string(e.androidBuildFingerprint),e.cobaltAppVersion!==void 0&&n.uint32(154).string(e.cobaltAppVersion),e.cobaltStarboardVersion!==void 0&&n.uint32(162).string(e.cobaltStarboardVersion),e.useStartPlaybackPreviewCommand!==void 0&&n.uint32(176).bool(e.useStartPlaybackPreviewCommand),e.shouldShowPersistentSigninOnHome!==void 0&&n.uint32(184).bool(e.shouldShowPersistentSigninOnHome),e.androidPlayServicesVersion!==void 0&&n.uint32(194).string(e.androidPlayServicesVersion),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=Qx();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 3:if(e!==26)break;a.mdxImpactedSessionsServerEvents=r.string();continue;case 6:if(e!==48)break;a.enablePrivacyFilter=r.bool();continue;case 7:if(e!==56)break;a.zylonLeftNav=r.bool();continue;case 9:if(e!==74)break;a.certificationScope=r.string();continue;case 10:if(e!==82)break;a.livingRoomPoTokenId=r.string();continue;case 12:if(e!==98)break;a.jsEngineString=r.string();continue;case 13:if(e!==106)break;a.voiceCapability=tS.decode(r,r.uint32());continue;case 14:if(e!==114)break;a.systemIntegrator=r.string();continue;case 18:if(e!==146)break;a.androidBuildFingerprint=r.string();continue;case 19:if(e!==154)break;a.cobaltAppVersion=r.string();continue;case 20:if(e!==162)break;a.cobaltStarboardVersion=r.string();continue;case 22:if(e!==176)break;a.useStartPlaybackPreviewCommand=r.bool();continue;case 23:if(e!==184)break;a.shouldShowPersistentSigninOnHome=r.bool();continue;case 24:if(e!==194)break;a.androidPlayServicesVersion=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function eS(){return{hasSoftMicSupport:void 0,hasHardMicSupport:void 0}}var tS={encode(e,n=new t){return e.hasSoftMicSupport!==void 0&&n.uint32(8).bool(e.hasSoftMicSupport),e.hasHardMicSupport!==void 0&&n.uint32(16).bool(e.hasHardMicSupport),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=eS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.hasSoftMicSupport=r.bool();continue;case 2:if(e!==16)break;a.hasHardMicSupport=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function nS(){return{enableFilterMode:void 0,iosNotificationPermission:void 0,forceEnableEpg3:void 0}}var rS={encode(e,n=new t){return e.enableFilterMode!==void 0&&n.uint32(16).bool(e.enableFilterMode),e.iosNotificationPermission!==void 0&&n.uint32(24).bool(e.iosNotificationPermission),e.forceEnableEpg3!==void 0&&n.uint32(56).bool(e.forceEnableEpg3),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=nS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==16)break;a.enableFilterMode=r.bool();continue;case 3:if(e!==24)break;a.iosNotificationPermission=r.bool();continue;case 7:if(e!==56)break;a.forceEnableEpg3=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function iS(){return{locationInfoStatus:void 0,ulrStatus:void 0,latitudeE7:void 0,longitudeE7:void 0,horizontalAccuracyMeters:void 0,locationFreshnessMs:void 0,locationPermissionAuthorizationStatus:void 0,locationOverrideToken:void 0,forceLocationPlayabilityTokenRefresh:void 0}}var aS={encode(e,n=new t){return e.locationInfoStatus!==void 0&&n.uint32(8).int32(e.locationInfoStatus),e.ulrStatus!==void 0&&sS.encode(e.ulrStatus,n.uint32(18).fork()).join(),e.latitudeE7!==void 0&&n.uint32(26).string(e.latitudeE7),e.longitudeE7!==void 0&&n.uint32(34).string(e.longitudeE7),e.horizontalAccuracyMeters!==void 0&&n.uint32(42).string(e.horizontalAccuracyMeters),e.locationFreshnessMs!==void 0&&n.uint32(50).string(e.locationFreshnessMs),e.locationPermissionAuthorizationStatus!==void 0&&n.uint32(56).int32(e.locationPermissionAuthorizationStatus),e.locationOverrideToken!==void 0&&n.uint32(66).string(e.locationOverrideToken),e.forceLocationPlayabilityTokenRefresh!==void 0&&n.uint32(72).bool(e.forceLocationPlayabilityTokenRefresh),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=iS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.locationInfoStatus=r.int32();continue;case 2:if(e!==18)break;a.ulrStatus=sS.decode(r,r.uint32());continue;case 3:if(e!==26)break;a.latitudeE7=r.string();continue;case 4:if(e!==34)break;a.longitudeE7=r.string();continue;case 5:if(e!==42)break;a.horizontalAccuracyMeters=r.string();continue;case 6:if(e!==50)break;a.locationFreshnessMs=r.string();continue;case 7:if(e!==56)break;a.locationPermissionAuthorizationStatus=r.int32();continue;case 8:if(e!==66)break;a.locationOverrideToken=r.string();continue;case 9:if(e!==72)break;a.forceLocationPlayabilityTokenRefresh=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function oS(){return{reportingEnabledSetting:void 0,historyEnabledSetting:void 0,isAllowed:void 0,isActive:void 0}}var sS={encode(e,n=new t){return e.reportingEnabledSetting!==void 0&&n.uint32(8).int32(e.reportingEnabledSetting),e.historyEnabledSetting!==void 0&&n.uint32(16).int32(e.historyEnabledSetting),e.isAllowed!==void 0&&n.uint32(24).bool(e.isAllowed),e.isActive!==void 0&&n.uint32(32).bool(e.isActive),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=oS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.reportingEnabledSetting=r.int32();continue;case 2:if(e!==16)break;a.historyEnabledSetting=r.int32();continue;case 3:if(e!==24)break;a.isAllowed=r.bool();continue;case 4:if(e!==32)break;a.isActive=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function cS(){return{isPartOfGroup:void 0,isGroup:void 0}}var lS={encode(e,n=new t){return e.isPartOfGroup!==void 0&&n.uint32(8).bool(e.isPartOfGroup),e.isGroup!==void 0&&n.uint32(24).bool(e.isGroup),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=cS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.isPartOfGroup=r.bool();continue;case 3:if(e!==24)break;a.isGroup=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function uS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error(`Value is smaller than Number.MIN_SAFE_INTEGER`);return t}function dS(){return{challenge:void 0,webResponse:void 0,androidResponse:void 0,iosResponse:void 0,error:void 0,adblockReporting:void 0}}var fS={encode(e,n=new t){return e.challenge!==void 0&&n.uint32(10).string(e.challenge),e.webResponse!==void 0&&n.uint32(18).string(e.webResponse),e.androidResponse!==void 0&&n.uint32(26).string(e.androidResponse),e.iosResponse!==void 0&&n.uint32(34).bytes(e.iosResponse),e.error!==void 0&&n.uint32(40).int32(e.error),e.adblockReporting!==void 0&&mS.encode(e.adblockReporting,n.uint32(50).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=dS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.challenge=r.string();continue;case 2:if(e!==18)break;a.webResponse=r.string();continue;case 3:if(e!==26)break;a.androidResponse=r.string();continue;case 4:if(e!==34)break;a.iosResponse=r.bytes();continue;case 5:if(e!==40)break;a.error=r.int32();continue;case 6:if(e!==50)break;a.adblockReporting=mS.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function pS(){return{reportingStatus:void 0,broadSpectrumDetectionResult:void 0}}var mS={encode(e,n=new t){return e.reportingStatus!==void 0&&n.uint32(8).uint64(e.reportingStatus),e.broadSpectrumDetectionResult!==void 0&&n.uint32(16).uint64(e.broadSpectrumDetectionResult),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=pS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.reportingStatus=hS(r.uint64());continue;case 2:if(e!==16)break;a.broadSpectrumDetectionResult=hS(r.uint64());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function hS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error(`Value is smaller than Number.MIN_SAFE_INTEGER`);return t}function gS(){return{thirdPartyDigest:void 0,useSsl:void 0,returnErrorDetail:void 0,ifNoneMatch:void 0,returnLogEntry:void 0,isPrefetch:void 0,internalExperimentFlags:[],returnDebugData:void 0,innertubez:void 0,traceProto:void 0,returnLogEntryJson:void 0,sherlogUsername:void 0,reauthRequestInfo:void 0,sessionInfo:void 0,returnLogEntryProto:void 0,externalPrequestContext:void 0,attestationResponseData:void 0,eats:void 0,requestQos:void 0}}var _S={encode(e,n=new t){e.thirdPartyDigest!==void 0&&n.uint32(50).string(e.thirdPartyDigest),e.useSsl!==void 0&&n.uint32(56).bool(e.useSsl),e.returnErrorDetail!==void 0&&n.uint32(72).bool(e.returnErrorDetail),e.ifNoneMatch!==void 0&&n.uint32(98).string(e.ifNoneMatch),e.returnLogEntry!==void 0&&n.uint32(104).bool(e.returnLogEntry),e.isPrefetch!==void 0&&n.uint32(112).bool(e.isPrefetch);for(let t of e.internalExperimentFlags)yy.encode(t,n.uint32(122).fork()).join();return e.returnDebugData!==void 0&&n.uint32(128).bool(e.returnDebugData),e.innertubez!==void 0&&n.uint32(146).string(e.innertubez),e.traceProto!==void 0&&n.uint32(184).bool(e.traceProto),e.returnLogEntryJson!==void 0&&n.uint32(192).bool(e.returnLogEntryJson),e.sherlogUsername!==void 0&&n.uint32(202).string(e.sherlogUsername),e.reauthRequestInfo!==void 0&&CS.encode(e.reauthRequestInfo,n.uint32(234).fork()).join(),e.sessionInfo!==void 0&&xS.encode(e.sessionInfo,n.uint32(242).fork()).join(),e.returnLogEntryProto!==void 0&&n.uint32(248).bool(e.returnLogEntryProto),e.externalPrequestContext!==void 0&&n.uint32(258).string(e.externalPrequestContext),e.attestationResponseData!==void 0&&fS.encode(e.attestationResponseData,n.uint32(274).fork()).join(),e.eats!==void 0&&n.uint32(282).bytes(e.eats),e.requestQos!==void 0&&yS.encode(e.requestQos,n.uint32(290).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=gS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 6:if(e!==50)break;a.thirdPartyDigest=r.string();continue;case 7:if(e!==56)break;a.useSsl=r.bool();continue;case 9:if(e!==72)break;a.returnErrorDetail=r.bool();continue;case 12:if(e!==98)break;a.ifNoneMatch=r.string();continue;case 13:if(e!==104)break;a.returnLogEntry=r.bool();continue;case 14:if(e!==112)break;a.isPrefetch=r.bool();continue;case 15:if(e!==122)break;a.internalExperimentFlags.push(yy.decode(r,r.uint32()));continue;case 16:if(e!==128)break;a.returnDebugData=r.bool();continue;case 18:if(e!==146)break;a.innertubez=r.string();continue;case 23:if(e!==184)break;a.traceProto=r.bool();continue;case 24:if(e!==192)break;a.returnLogEntryJson=r.bool();continue;case 25:if(e!==202)break;a.sherlogUsername=r.string();continue;case 29:if(e!==234)break;a.reauthRequestInfo=CS.decode(r,r.uint32());continue;case 30:if(e!==242)break;a.sessionInfo=xS.decode(r,r.uint32());continue;case 31:if(e!==248)break;a.returnLogEntryProto=r.bool();continue;case 32:if(e!==258)break;a.externalPrequestContext=r.string();continue;case 34:if(e!==274)break;a.attestationResponseData=fS.decode(r,r.uint32());continue;case 35:if(e!==282)break;a.eats=r.bytes();continue;case 36:if(e!==290)break;a.requestQos=yS.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function vS(){return{criticality:void 0}}var yS={encode(e,n=new t){return e.criticality!==void 0&&n.uint32(8).int32(e.criticality),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=vS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.criticality=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function bS(){return{token:void 0}}var xS={encode(e,n=new t){return e.token!==void 0&&n.uint32(10).string(e.token),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=bS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.token=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function SS(){return{encodedReauthProofToken:void 0}}var CS={encode(e,n=new t){return e.encodedReauthProofToken!==void 0&&n.uint32(10).string(e.encodedReauthProofToken),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=SS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.encodedReauthProofToken=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function wS(){return{developerKey:void 0,appName:void 0,appPublisher:void 0,embedUrl:void 0,appVersion:void 0,embeddedPlayerContext:void 0}}var TS={encode(e,n=new t){return e.developerKey!==void 0&&n.uint32(10).string(e.developerKey),e.appName!==void 0&&n.uint32(18).string(e.appName),e.appPublisher!==void 0&&n.uint32(26).string(e.appPublisher),e.embedUrl!==void 0&&n.uint32(34).string(e.embedUrl),e.appVersion!==void 0&&n.uint32(50).string(e.appVersion),e.embeddedPlayerContext!==void 0&&DS.encode(e.embeddedPlayerContext,n.uint32(58).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=wS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.developerKey=r.string();continue;case 2:if(e!==18)break;a.appName=r.string();continue;case 3:if(e!==26)break;a.appPublisher=r.string();continue;case 4:if(e!==34)break;a.embedUrl=r.string();continue;case 6:if(e!==50)break;a.appVersion=r.string();continue;case 7:if(e!==58)break;a.embeddedPlayerContext=DS.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function ES(){return{ancestorOrigins:void 0,embeddedPlayerEncryptedContext:void 0,ancestorOriginsSupported:void 0}}var DS={encode(e,n=new t){return e.ancestorOrigins!==void 0&&n.uint32(10).string(e.ancestorOrigins),e.embeddedPlayerEncryptedContext!==void 0&&n.uint32(18).string(e.embeddedPlayerEncryptedContext),e.ancestorOriginsSupported!==void 0&&n.uint32(24).bool(e.ancestorOriginsSupported),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=ES();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.ancestorOrigins=r.string();continue;case 2:if(e!==18)break;a.embeddedPlayerEncryptedContext=r.string();continue;case 3:if(e!==24)break;a.ancestorOriginsSupported=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function OS(){return{onBehalfOfUser:void 0,enableSafetyMode:void 0,credentialTransferTokens:[],delegatePurchases:void 0,kidsParent:void 0,isIncognito:void 0,lockedSafetyMode:void 0,delegationContext:void 0,serializedDelegationContext:void 0}}var kS={encode(e,n=new t){e.onBehalfOfUser!==void 0&&n.uint32(26).string(e.onBehalfOfUser),e.enableSafetyMode!==void 0&&n.uint32(56).bool(e.enableSafetyMode);for(let t of e.credentialTransferTokens)LS.encode(t,n.uint32(98).fork()).join();return e.delegatePurchases!==void 0&&NS.encode(e.delegatePurchases,n.uint32(106).fork()).join(),e.kidsParent!==void 0&&jS.encode(e.kidsParent,n.uint32(114).fork()).join(),e.isIncognito!==void 0&&n.uint32(120).bool(e.isIncognito),e.lockedSafetyMode!==void 0&&n.uint32(128).bool(e.lockedSafetyMode),e.delegationContext!==void 0&&FS.encode(e.delegationContext,n.uint32(138).fork()).join(),e.serializedDelegationContext!==void 0&&n.uint32(146).string(e.serializedDelegationContext),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=OS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 3:if(e!==26)break;a.onBehalfOfUser=r.string();continue;case 7:if(e!==56)break;a.enableSafetyMode=r.bool();continue;case 12:if(e!==98)break;a.credentialTransferTokens.push(LS.decode(r,r.uint32()));continue;case 13:if(e!==106)break;a.delegatePurchases=NS.decode(r,r.uint32());continue;case 14:if(e!==114)break;a.kidsParent=jS.decode(r,r.uint32());continue;case 15:if(e!==120)break;a.isIncognito=r.bool();continue;case 16:if(e!==128)break;a.lockedSafetyMode=r.bool();continue;case 17:if(e!==138)break;a.delegationContext=FS.decode(r,r.uint32());continue;case 18:if(e!==146)break;a.serializedDelegationContext=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function AS(){return{}}var jS={encode(e,n=new t){return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=AS();for(;r.pos<i;){let e=r.uint32();if(e>>>3,(e&7)==4||e===0)break;r.skip(e&7)}return a}};function MS(){return{}}var NS={encode(e,n=new t){return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=MS();for(;r.pos<i;){let e=r.uint32();if(e>>>3,(e&7)==4||e===0)break;r.skip(e&7)}return a}};function PS(){return{}}var FS={encode(e,n=new t){return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=PS();for(;r.pos<i;){let e=r.uint32();if(e>>>3,(e&7)==4||e===0)break;r.skip(e&7)}return a}};function IS(){return{}}var LS={encode(e,n=new t){return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=IS();for(;r.pos<i;){let e=r.uint32();if(e>>>3,(e&7)==4||e===0)break;r.skip(e&7)}return a}};function RS(){return{client:void 0,user:void 0,capabilities:void 0,request:void 0,clickTracking:void 0,thirdParty:void 0,remoteClient:void 0,adSignalsInfo:void 0,experimentalData:void 0,clientScreenNonce:void 0,activePlayers:[]}}var zS={encode(e,n=new t){e.client!==void 0&&Tx.encode(e.client,n.uint32(10).fork()).join(),e.user!==void 0&&kS.encode(e.user,n.uint32(26).fork()).join(),e.capabilities!==void 0&&xx.encode(e.capabilities,n.uint32(34).fork()).join(),e.request!==void 0&&_S.encode(e.request,n.uint32(42).fork()).join(),e.clickTracking!==void 0&&GS.encode(e.clickTracking,n.uint32(50).fork()).join(),e.thirdParty!==void 0&&TS.encode(e.thirdParty,n.uint32(58).fork()).join(),e.remoteClient!==void 0&&Tx.encode(e.remoteClient,n.uint32(66).fork()).join(),e.adSignalsInfo!==void 0&&qS.encode(e.adSignalsInfo,n.uint32(74).fork()).join(),e.experimentalData!==void 0&&VS.encode(e.experimentalData,n.uint32(82).fork()).join(),e.clientScreenNonce!==void 0&&n.uint32(90).string(e.clientScreenNonce);for(let t of e.activePlayers)US.encode(t,n.uint32(98).fork()).join();return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=RS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.client=Tx.decode(r,r.uint32());continue;case 3:if(e!==26)break;a.user=kS.decode(r,r.uint32());continue;case 4:if(e!==34)break;a.capabilities=xx.decode(r,r.uint32());continue;case 5:if(e!==42)break;a.request=_S.decode(r,r.uint32());continue;case 6:if(e!==50)break;a.clickTracking=GS.decode(r,r.uint32());continue;case 7:if(e!==58)break;a.thirdParty=TS.decode(r,r.uint32());continue;case 8:if(e!==66)break;a.remoteClient=Tx.decode(r,r.uint32());continue;case 9:if(e!==74)break;a.adSignalsInfo=qS.decode(r,r.uint32());continue;case 10:if(e!==82)break;a.experimentalData=VS.decode(r,r.uint32());continue;case 11:if(e!==90)break;a.clientScreenNonce=r.string();continue;case 12:if(e!==98)break;a.activePlayers.push(US.decode(r,r.uint32()));continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function BS(){return{params:[]}}var VS={encode(e,n=new t){for(let t of e.params)yy.encode(t,n.uint32(10).fork()).join();return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=BS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.params.push(yy.decode(r,r.uint32()));continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function HS(){return{playerContextParams:void 0}}var US={encode(e,n=new t){return e.playerContextParams!==void 0&&n.uint32(10).bytes(e.playerContextParams),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=HS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.playerContextParams=r.bytes();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function WS(){return{clickTrackingParams:void 0}}var GS={encode(e,n=new t){return e.clickTrackingParams!==void 0&&n.uint32(18).bytes(e.clickTrackingParams),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=WS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 2:if(e!==18)break;a.clickTrackingParams=r.bytes();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function KS(){return{params:[],bid:void 0,mutsuId:void 0,consentBumpState:void 0,advertisingId:void 0,limitAdTracking:void 0,attributionOsSupportedVersion:void 0}}var qS={encode(e,n=new t){for(let t of e.params)yy.encode(t,n.uint32(10).fork()).join();return e.bid!==void 0&&n.uint32(18).string(e.bid),e.mutsuId!==void 0&&n.uint32(26).string(e.mutsuId),e.consentBumpState!==void 0&&n.uint32(34).string(e.consentBumpState),e.advertisingId!==void 0&&n.uint32(58).string(e.advertisingId),e.limitAdTracking!==void 0&&n.uint32(72).bool(e.limitAdTracking),e.attributionOsSupportedVersion!==void 0&&n.uint32(82).string(e.attributionOsSupportedVersion),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=KS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.params.push(yy.decode(r,r.uint32()));continue;case 2:if(e!==18)break;a.bid=r.string();continue;case 3:if(e!==26)break;a.mutsuId=r.string();continue;case 4:if(e!==34)break;a.consentBumpState=r.string();continue;case 7:if(e!==58)break;a.advertisingId=r.string();continue;case 9:if(e!==72)break;a.limitAdTracking=r.bool();continue;case 10:if(e!==82)break;a.attributionOsSupportedVersion=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function JS(){return{context:void 0,encryptedVideoId:void 0,title:void 0,description:void 0,privacy:void 0,tags:void 0,category:void 0,license:void 0,ageRestriction:void 0,videoStill:void 0,madeForKids:void 0,racy:void 0}}var YS={encode(e,n=new t){return e.context!==void 0&&zS.encode(e.context,n.uint32(10).fork()).join(),e.encryptedVideoId!==void 0&&n.uint32(18).string(e.encryptedVideoId),e.title!==void 0&&ZS.encode(e.title,n.uint32(26).fork()).join(),e.description!==void 0&&$S.encode(e.description,n.uint32(34).fork()).join(),e.privacy!==void 0&&tC.encode(e.privacy,n.uint32(42).fork()).join(),e.tags!==void 0&&rC.encode(e.tags,n.uint32(50).fork()).join(),e.category!==void 0&&aC.encode(e.category,n.uint32(58).fork()).join(),e.license!==void 0&&sC.encode(e.license,n.uint32(66).fork()).join(),e.ageRestriction!==void 0&&pC.encode(e.ageRestriction,n.uint32(90).fork()).join(),e.videoStill!==void 0&&hC.encode(e.videoStill,n.uint32(162).fork()).join(),e.madeForKids!==void 0&&lC.encode(e.madeForKids,n.uint32(546).fork()).join(),e.racy!==void 0&&dC.encode(e.racy,n.uint32(554).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=JS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.context=zS.decode(r,r.uint32());continue;case 2:if(e!==18)break;a.encryptedVideoId=r.string();continue;case 3:if(e!==26)break;a.title=ZS.decode(r,r.uint32());continue;case 4:if(e!==34)break;a.description=$S.decode(r,r.uint32());continue;case 5:if(e!==42)break;a.privacy=tC.decode(r,r.uint32());continue;case 6:if(e!==50)break;a.tags=rC.decode(r,r.uint32());continue;case 7:if(e!==58)break;a.category=aC.decode(r,r.uint32());continue;case 8:if(e!==66)break;a.license=sC.decode(r,r.uint32());continue;case 11:if(e!==90)break;a.ageRestriction=pC.decode(r,r.uint32());continue;case 20:if(e!==162)break;a.videoStill=hC.decode(r,r.uint32());continue;case 68:if(e!==546)break;a.madeForKids=lC.decode(r,r.uint32());continue;case 69:if(e!==554)break;a.racy=dC.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function XS(){return{newTitle:void 0}}var ZS={encode(e,n=new t){return e.newTitle!==void 0&&n.uint32(10).string(e.newTitle),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=XS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.newTitle=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function QS(){return{newDescription:void 0}}var $S={encode(e,n=new t){return e.newDescription!==void 0&&n.uint32(10).string(e.newDescription),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=QS();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.newDescription=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function eC(){return{newPrivacy:void 0,clearPrivacyDraft:void 0}}var tC={encode(e,n=new t){return e.newPrivacy!==void 0&&n.uint32(8).int32(e.newPrivacy),e.clearPrivacyDraft!==void 0&&n.uint32(16).bool(e.clearPrivacyDraft),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=eC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.newPrivacy=r.int32();continue;case 2:if(e!==16)break;a.clearPrivacyDraft=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function nC(){return{newTags:[]}}var rC={encode(e,n=new t){for(let t of e.newTags)n.uint32(10).string(t);return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=nC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.newTags.push(r.string());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function iC(){return{newCategoryId:void 0}}var aC={encode(e,n=new t){return e.newCategoryId!==void 0&&n.uint32(8).int32(e.newCategoryId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=iC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.newCategoryId=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function oC(){return{newLicenseId:void 0}}var sC={encode(e,n=new t){return e.newLicenseId!==void 0&&n.uint32(10).string(e.newLicenseId),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=oC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.newLicenseId=r.string();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function cC(){return{operation:void 0,newMfk:void 0}}var lC={encode(e,n=new t){return e.operation!==void 0&&n.uint32(8).int32(e.operation),e.newMfk!==void 0&&n.uint32(16).int32(e.newMfk),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=cC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.operation=r.int32();continue;case 2:if(e!==16)break;a.newMfk=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function uC(){return{operation:void 0,newRacy:void 0}}var dC={encode(e,n=new t){return e.operation!==void 0&&n.uint32(8).int32(e.operation),e.newRacy!==void 0&&n.uint32(16).int32(e.newRacy),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=uC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.operation=r.int32();continue;case 2:if(e!==16)break;a.newRacy=r.int32();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function fC(){return{newIsAgeRestricted:void 0}}var pC={encode(e,n=new t){return e.newIsAgeRestricted!==void 0&&n.uint32(8).bool(e.newIsAgeRestricted),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=fC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.newIsAgeRestricted=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function mC(){return{operation:void 0,newStillId:void 0,image:void 0,testImage:void 0,experimentImage:[]}}var hC={encode(e,n=new t){e.operation!==void 0&&n.uint32(8).int32(e.operation),e.newStillId!==void 0&&n.uint32(16).int32(e.newStillId),e.image!==void 0&&yC.encode(e.image,n.uint32(26).fork()).join(),e.testImage!==void 0&&yC.encode(e.testImage,n.uint32(34).fork()).join();for(let t of e.experimentImage)_C.encode(t,n.uint32(50).fork()).join();return n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=mC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==8)break;a.operation=r.int32();continue;case 2:if(e!==16)break;a.newStillId=r.int32();continue;case 3:if(e!==26)break;a.image=yC.decode(r,r.uint32());continue;case 4:if(e!==34)break;a.testImage=yC.decode(r,r.uint32());continue;case 6:if(e!==50)break;a.experimentImage.push(_C.decode(r,r.uint32()));continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function gC(){return{image:void 0}}var _C={encode(e,n=new t){return e.image!==void 0&&yC.encode(e.image,n.uint32(10).fork()).join(),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=gC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.image=yC.decode(r,r.uint32());continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function vC(){return{rawBytes:void 0,dataUri:void 0,frameTimestampUs:void 0,isVertical:void 0}}var yC={encode(e,n=new t){return e.rawBytes!==void 0&&n.uint32(10).bytes(e.rawBytes),e.dataUri!==void 0&&n.uint32(18).string(e.dataUri),e.frameTimestampUs!==void 0&&n.uint32(32).int64(e.frameTimestampUs),e.isVertical!==void 0&&n.uint32(40).bool(e.isVertical),n},decode(e,t){let r=e instanceof n?e:new n(e),i=t===void 0?r.len:r.pos+t,a=vC();for(;r.pos<i;){let e=r.uint32();switch(e>>>3){case 1:if(e!==10)break;a.rawBytes=r.bytes();continue;case 2:if(e!==18)break;a.dataUri=r.string();continue;case 4:if(e!==32)break;a.frameTimestampUs=bC(r.int64());continue;case 5:if(e!==40)break;a.isVertical=r.bool();continue}if((e&7)==4||e===0)break;r.skip(e&7)}return a}};function bC(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(t<globalThis.Number.MIN_SAFE_INTEGER)throw new globalThis.Error(`Value is smaller than Number.MIN_SAFE_INTEGER`);return t}var xC=class{#e;constructor(e){this.#e=e}async updateVideoMetadata(e,t){let n=this.#e;if(!n.logged_in)throw new Q(`You must be signed in to perform this operation.`);let r={context:{client:{osName:`Android`,clientName:parseInt(C.ANDROID),clientVersion:S.ANDROID.VERSION,androidSdkVersion:S.ANDROID.SDK_VERSION,visitorData:n.context.client.visitorData,osVersion:`13`,acceptLanguage:n.context.client.hl,acceptRegion:n.context.client.gl,deviceMake:`Google`,deviceModel:`sdk_gphone64_x86_64`,screenHeightPoints:840,screenWidthPoints:432,configInfo:{appInstallData:n.context.client.configInfo?.appInstallData},timeZone:n.context.client.timeZone,chipset:`qcom;taro`},activePlayers:[]},encryptedVideoId:e};if(t.title&&(r.title={newTitle:t.title}),t.description&&(r.description={newDescription:t.description}),t.license&&(r.license={newLicenseId:t.license}),t.tags&&(r.tags={newTags:t.tags}),t.thumbnail&&(r.videoStill={operation:3,image:{rawBytes:t.thumbnail},experimentImage:[]}),Reflect.has(t,`category`)&&(r.category={newCategoryId:t.category}),Reflect.has(t,`privacy`))switch(t.privacy){case`PUBLIC`:r.privacy={newPrivacy:1};break;case`UNLISTED`:r.privacy={newPrivacy:2};break;case`PRIVATE`:r.privacy={newPrivacy:3};break;default:throw Error(`Invalid privacy setting`)}Reflect.has(t,`made_for_kids`)&&(r.madeForKids={operation:1,newMfk:t.made_for_kids?1:2}),Reflect.has(t,`age_restricted`)&&(r.racy={operation:1,newRacy:t.age_restricted?1:2});let i=YS.encode(r);return await n.actions.execute(`/video_manager/metadata_update`,{protobuf:!0,serialized_data:i.finish()})}async upload(e,t={}){if(!this.#e.logged_in)throw new Q(`You must be signed in to perform this operation.`);let n=await this.#t(),r=await this.#n(n.upload_url,e);if(r.status!==`STATUS_SUCCESS`)throw new Q(`Could not process video.`);return await this.#r(n,r,t)}async#t(){let e=`innertube_android:${Z.shim.uuidv4()}:0:v=3,api=1,cf=3`,t={frontendUploadId:e,deviceDisplayName:`Pixel 6 Pro`,fileId:`goog-edited-video://generated?videoFileUri=content://media/external/video/media/${Z.shim.uuidv4()}`,mp4MoovAtomRelocationStatus:`UNSUPPORTED`,transcodeResult:`DISABLED`,connectionType:`WIFI`},n=await this.#e.http.fetch(`/upload/youtubei`,{baseURL:x.YT_UPLOAD,method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,"x-goog-upload-command":`start`,"x-goog-upload-protocol":`resumable`},body:JSON.stringify(t)});if(!n.ok)throw new Q(`Could not get initial upload data`);return{frontend_upload_id:e,upload_id:n.headers.get(`x-guploader-uploadid`),upload_url:n.headers.get(`x-goog-upload-url`),scotty_resource_id:n.headers.get(`x-goog-upload-header-scotty-resource-id`),chunk_granularity:n.headers.get(`x-goog-upload-chunk-granularity`)}}async#n(e,t){let n=await this.#e.http.fetch_function(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,"x-goog-upload-command":`upload, finalize`,"x-goog-upload-file-name":`file-${Date.now()}`,"x-goog-upload-offset":`0`},body:t});if(!n.ok)throw new Q(`Could not upload video`);return await n.json()}async#r(e,t,n){return await this.#e.actions.execute(`/upload/createvideo`,{resourceId:{scottyResourceId:{id:t.scottyResourceId}},frontendUploadId:e.frontend_upload_id,initialMetadata:{title:{newTitle:n.title},description:{newDescription:n.description,shouldSegment:!0},privacy:{newPrivacy:n.privacy||`PRIVATE`},draftState:{isDraft:!!n.is_draft}}})}},SC=class{#e;constructor(e){this.#e=e}async getInfo(e=!1){if(!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);if(!e&&this.#e.session.context.user.onBehalfOfUser)throw new Q(`Boolean argument must be true when "on_behalf_of_user" is specified.`);return e?(await new B({getAccountsListInnertubeEndpoint:{requestType:`ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER`,callCircumstance:`SWITCHING_USERS_FULL`}}).call(this.#e,{client:`WEB`,parse:!0})).actions_memo?.getType(As)||[]:new Qy(await new B({getAccountsListInnertubeEndpoint:{}}).call(this.#e,{client:`TV`}))}async getSettings(){let e=await new B({browseEndpoint:{browseId:`SPaccount_overview`}}).call(this.#e);return new bb(this.#e,e)}},CC=class{#e;constructor(e){this.#e=e}async create(e,t,n,r){if($({title:e,video_ids:t}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let i=await new B({createPlaylistServiceEndpoint:{title:e,videoIds:t,...n?{privacyStatus:n}:{},...r?{description:r}:{}}}).call(this.#e);return{success:i.success,status_code:i.status_code,playlist_id:i.data.playlistId,data:i.data}}async delete(e){if($({playlist_id:e}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let t=await new B({deletePlaylistServiceEndpoint:{sourcePlaylistId:e}}).call(this.#e);return{playlist_id:e,success:t.success,status_code:t.status_code,data:t.data}}async addToLibrary(e){if($({playlist_id:e}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);return await new B({likeEndpoint:{status:`LIKE`,target:e}}).call(this.#e)}async removeFromLibrary(e){if($({playlist_id:e}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);return await new B({likeEndpoint:{status:`INDIFFERENT`,target:e}}).call(this.#e)}async addVideos(e,t){if($({playlist_id:e,video_ids:t}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);return{playlist_id:e,action_result:(await new B({playlistEditEndpoint:{playlistId:e,actions:t.map(e=>({action:`ACTION_ADD_VIDEO`,addedVideoId:e}))}}).call(this.#e)).data.actions}}async removeVideos(e,t,n=!1){if($({playlist_id:e,video_ids:t}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let r=await this.#t(e);if(!r.info.is_editable)throw new Q(`This playlist cannot be edited.`,e);let i={playlistId:e,actions:[]},a=async e=>{let r=n?`set_video_id`:`id`;if(e.videos.filter(e=>t.includes(e.key(r).string())).forEach(e=>i.actions.push({action:`ACTION_REMOVE_VIDEO`,setVideoId:e.key(`set_video_id`).string()})),i.actions.length<t.length){let t=await e.getContinuation();return a(t)}};if(await a(r),!i.actions.length)throw new Q(`Given video ids were not found in this playlist.`,t);return{playlist_id:e,action_result:(await new B({playlistEditEndpoint:i}).call(this.#e)).data.actions}}async moveVideo(e,t,n){if($({playlist_id:e,moved_video_id:t,predecessor_video_id:n}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let r=await this.#t(e);if(!r.info.is_editable)throw new Q(`This playlist cannot be edited.`,e);let i={playlistId:e,actions:[]},a,o,s=async e=>{let r=e.videos.find(e=>t===e.key(`id`).string()),i=e.videos.find(e=>n===e.key(`id`).string());if(a||=r?.key(`set_video_id`).string(),o||=i?.key(`set_video_id`).string(),!a||!o){let t=await e.getContinuation();return s(t)}};return await s(r),i.actions.push({action:`ACTION_MOVE_VIDEO_AFTER`,setVideoId:a,movedSetVideoIdPredecessor:o}),{playlist_id:e,action_result:(await new B({playlistEditEndpoint:i}).call(this.#e)).data.actions}}async#t(e){e.startsWith(`VL`)||(e=`VL${e}`);let t=await new B({browseEndpoint:{browseId:e}}).call(this.#e,{parse:!0});return new fb(this.#e,t,!0)}async setName(e,t){if($({playlist_id:e,name:t}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let n={playlist_id:e,actions:[]};return n.actions.push({action:`ACTION_SET_PLAYLIST_NAME`,playlistName:t}),{playlist_id:e,action_result:(await new B({playlistEditEndpoint:n}).call(this.#e)).data.actions}}async setDescription(e,t){if($({playlist_id:e,description:t}),!this.#e.session.logged_in)throw new Q(`You must be signed in to perform this operation.`);let n={playlistId:e,actions:[]};return n.actions.push({action:`ACTION_SET_PLAYLIST_DESCRIPTION`,playlistDescription:t}),{playlist_id:e,action_result:(await new B({playlistEditEndpoint:n}).call(this.#e)).data.actions}}},wC=class{#e;constructor(e){this.#e=e}async like(e){if($({video_id:e}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return new B({likeEndpoint:{status:`LIKE`,target:e}}).call(this.#e,{client:`TV`})}async dislike(e){if($({video_id:e}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return new B({likeEndpoint:{status:`DISLIKE`,target:e}}).call(this.#e,{client:`TV`})}async removeRating(e){if($({video_id:e}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return new B({likeEndpoint:{status:`INDIFFERENT`,target:e}}).call(this.#e,{client:`TV`})}async subscribe(e){if($({channel_id:e}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return new B({subscribeEndpoint:{channelIds:[e],params:`EgIIAhgA`}}).call(this.#e)}async unsubscribe(e){if($({channel_id:e}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);return new B({unsubscribeEndpoint:{channelIds:[e],params:`CgIIAhgA`}}).call(this.#e)}async comment(e,t){if($({video_id:e,text:t}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);let n=Dn.encode({videoId:e,params:{index:0},number:7});return new B({createCommentEndpoint:{commentText:t,createCommentParams:encodeURIComponent(rx(n.finish()))}}).call(this.#e)}async translate(e,t,n={}){$({text:e,target_language:t});let r=await new B({performCommentActionEndpoint:{action:cr(22,{text:e,target_language:t,...n})}}).call(this.#e),i=r.data.frameworkUpdates.entityBatchUpdate.mutations[0].payload.commentEntityPayload;return{success:r.success,status_code:r.status_code,translated_content:i.translatedContent.content,data:r.data}}async setNotificationPreferences(e,t){if($({channel_id:e,type:t}),!this.#e.session.logged_in)throw Error(`You must be signed in to perform this operation.`);let n={PERSONALIZED:1,ALL:2,NONE:3};if(!Object.keys(n).includes(t.toUpperCase()))throw Error(`Invalid notification preference type: ${t}`);let r=an.encode({channelId:e,prefId:{index:n[t.toUpperCase()]},number0:0,number1:4});return new B({modifyChannelNotificationPreferenceEndpoint:{params:encodeURIComponent(rx(r.finish()))}}).call(this.#e)}},TC=class e{#e;constructor(e){this.#e=e}static async create(t={}){return new e(await _x.create(t))}async getInfo(e,t){$({target:e});let n={videoId:e instanceof B?e.payload?.videoId:e,playlistId:e instanceof B?e.payload?.playlistId:void 0,playlistIndex:e instanceof B?e.payload?.playlistIndex:void 0,params:e instanceof B?e.payload?.params:void 0,racyCheckOk:!0,contentCheckOk:!0},r=new B({watchEndpoint:n}),i=new B({watchNextEndpoint:n}),a=this.#e,o={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:`-1`,signatureTimestamp:a.player?.signature_timestamp}},client:t?.client};t?.po_token?o.serviceIntegrityDimensions={poToken:t.po_token}:a.po_token&&(o.serviceIntegrityDimensions={poToken:a.po_token});let s=r.call(a.actions,o),c=i.call(a.actions),l=await Promise.all([s,c]),u=$b(16);return new xb(l,a.actions,u)}async getBasicInfo(e,t){$({video_id:e});let n=new B({watchEndpoint:{videoId:e,racyCheckOk:!0,contentCheckOk:!0}}),r=this.#e,i={playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:`-1`,signatureTimestamp:r.player?.signature_timestamp}},client:t?.client};t?.po_token?i.serviceIntegrityDimensions={poToken:t.po_token}:r.po_token&&(i.serviceIntegrityDimensions={poToken:r.po_token});let a=await n.call(r.actions,i),o=$b(16);return new xb([a],r.actions,o)}async getShortsVideoInfo(e,t,n){$({video_id:e});let r=new B({reelWatchEndpoint:{disablePlayerResponse:!1,params:`CAUwAg%3D%3D`,videoId:e}}),i=this.#e.actions,a=r.call(i,{client:t}),o=Un.encode({shortId:e,params:{number:5},feature2:25,feature3:0}),s=n??encodeURIComponent(rx(o.finish())),c=i.execute(`/reel/reel_watch_sequence`,{sequenceParams:s}),l=await Promise.all([a,c]),u=$b(16);return new zb([l[0]],i,u,l[1])}async search(e,t={}){$({query:e});let n={};if(n.filters={},t.prioritize&&(n.prioritize=Gt[t.prioritize.toUpperCase()]),t.upload_date&&(n.filters.uploadDate=Kt[t.upload_date.toUpperCase()]),t.type&&(n.filters.type=qt[t.type.toUpperCase()]),t.duration&&(n.filters.duration=Jt[t.duration.toUpperCase()]),t.features)for(let e of t.features)switch(e){case`360`:n.filters.features360=!0;break;case`3d`:n.filters.features3d=!0;break;case`4k`:n.filters.features4k=!0;break;case`creative_commons`:n.filters.featuresCreativeCommons=!0;break;case`hd`:n.filters.featuresHd=!0;break;case`hdr`:n.filters.featuresHdr=!0;break;case`live`:n.filters.featuresLive=!0;break;case`location`:n.filters.featuresLocation=!0;break;case`purchased`:n.filters.featuresPurchased=!0;break;case`subtitles`:n.filters.featuresSubtitles=!0;break;case`vr180`:n.filters.featuresVr180=!0}let r=await new B({searchEndpoint:{query:e,params:t?encodeURIComponent(rx(Qt.encode(n).finish())):void 0}}).call(this.#e.actions);return new yb(this.actions,r)}async getSearchSuggestions(e,t){let n=this.#e,r=new URL(`${x.YT_SUGGESTIONS}/complete/search`);r.searchParams.set(`client`,`youtube`),r.searchParams.set(`gs_ri`,`youtube`),r.searchParams.set(`gs_id`,`0`),r.searchParams.set(`cp`,`0`),r.searchParams.set(`ds`,`yt`),r.searchParams.set(`sugexp`,S.WEB.SUGG_EXP_ID),r.searchParams.set(`hl`,n.context.client.hl),r.searchParams.set(`gl`,n.context.client.gl),r.searchParams.set(`q`,e),t&&r.searchParams.set(`pq`,t);let i=await(await n.http.fetch_function(r,{headers:{Cookie:n.cookie||``}})).text();return JSON.parse(i.replace(`window.google.ac.h(`,``).slice(0,-1))[1].map(e=>e[0])}async getComments(e,t,n){$({video_id:e});let r=hn.encode({ctx:{videoId:e},unkParam:6,params:{opts:{videoId:e,sortBy:{TOP_COMMENTS:0,NEWEST_FIRST:1}[t||`TOP_COMMENTS`],type:2,commentId:n||``},target:`comments-section`}}),i=await new B({continuationCommand:{request:`CONTINUATION_REQUEST_TYPE_WATCH_NEXT`,token:encodeURIComponent(rx(r.finish()))}}).call(this.#e.actions);return new ob(this.actions,i.data)}async getHomeFeed(){let e=await new B({browseEndpoint:{browseId:`FEwhat_to_watch`}}).call(this.#e.actions);return new lb(this.actions,e)}async getGuide(){return new sb((await this.actions.execute(`/guide`)).data)}async getLibrary(){let e=await new B({browseEndpoint:{browseId:`FElibrary`}}).call(this.#e.actions);return new pb(this.actions,e)}async getHistory(){let e=await new B({browseEndpoint:{browseId:`FEhistory`}}).call(this.#e.actions);return new cb(this.actions,e)}async getCourses(){let e=await new B({browseEndpoint:{browseId:`FEcourses_destination`}}).call(this.#e.actions,{parse:!0});return new $y(this.actions,e)}async getSubscriptionsFeed(){let e=await new B({browseEndpoint:{browseId:`FEsubscriptions`}}).call(this.#e.actions,{parse:!0});return new $y(this.actions,e)}async getChannelsFeed(){let e=await new B({browseEndpoint:{browseId:`FEchannels`}}).call(this.#e.actions,{parse:!0});return new $y(this.actions,e)}async getChannel(e){$({id:e});let t=await new B({browseEndpoint:{browseId:e}}).call(this.#e.actions,{parse:!0});return t.on_response_received_actions?.[0]?.is(sy)&&(t=await t.on_response_received_actions[0].endpoint.call(this.#e.actions,{parse:!0})),new rb(this.actions,t,!0)}async getNotifications(){let e=await this.actions.execute(`/notification/get_notification_menu`,{notificationsMenuRequestType:`NOTIFICATIONS_MENU_REQUEST_TYPE_INBOX`});return new vb(this.actions,e)}async getUnseenNotificationsCount(){let e=await this.actions.execute(`/notification/get_unseen_count`);return e.data?.unseenCount||e.data?.actions?.[0].updateNotificationsUnseenCountAction?.unseenCount||0}async getPlaylists(){let e=await new B({browseEndpoint:{browseId:`FEplaylist_aggregation`}}).call(this.#e.actions,{parse:!0});return new $y(this.actions,e)}async getPlaylist(e){$({id:e}),e.startsWith(`VL`)||(e=`VL${e}`);let t=await new B({browseEndpoint:{browseId:e}}).call(this.#e.actions);return new fb(this.actions,t)}async getHashtag(e){$({hashtag:e});let t=zn.encode({params:{hashtag:e,type:1}}),n=await new B({browseEndpoint:{browseId:`FEhashtag`,params:encodeURIComponent(rx(t.finish(),!0))}}).call(this.#e.actions);return new ub(this.actions,n)}async getStreamingData(e,t={}){let n=(await this.getBasicInfo(e,t)).chooseFormat(t);return n.url=await n.decipher(this.#e.player),n}async download(e,t){return(await this.getBasicInfo(e,t)).download(t)}async resolveURL(e){let t=await this.actions.execute(`/navigation/resolve_url`,{url:e,parse:!0});if(!t.endpoint)throw new Q(`Failed to resolve URL. Expected a NavigationEndpoint but got undefined`,t);return t.endpoint}async getPost(e,t){$({post_id:e,channel_id:t});let n=qn.encode({f1:{ucid1:t,postId:e,ucid2:t}}),r=await new B({browseEndpoint:{browseId:`FEpost_detail`,params:encodeURIComponent(rx(n.finish()).replace(/\+/g,`-`).replace(/\//g,`_`))}}).call(this.#e.actions,{parse:!0});return new $y(this.actions,r)}async getPostComments(e,t,n){$({post_id:e,channel_id:t});let r=tr.encode({title:`posts`,commentDataContainer:{title:`comments-section`,commentData:{sortBy:{TOP_COMMENTS:0,NEWEST_FIRST:1}[n||`TOP_COMMENTS`],f0:2,f1:0,channelId:t,postId:e},f0:0}}),i=Zn.encode({f0:{location:`FEcomment_post_detail_page_web_top_level`,protoData:encodeURIComponent(rx(r.finish()).replace(/\+/g,`-`).replace(/\//g,`_`))}}),a=await new B({continuationCommand:{request:`CONTINUATION_REQUEST_TYPE_BROWSE`,token:encodeURIComponent(rx(i.finish()))}}).call(this.#e.actions);return new ob(this.actions,a.data)}async getAttestationChallenge(e,t){let n={engagementType:e};return t&&(n.ids=t),this.actions.execute(`/att/get`,{parse:!0,...n})}call(e,t){return e.call(this.actions,t)}get music(){return new yx(this.#e)}get studio(){return new xC(this.#e)}get kids(){return new vx(this.#e)}get account(){return new SC(this.#e.actions)}get playlist(){return new CC(this.#e.actions)}get interact(){return new wC(this.#e.actions)}get actions(){return this.#e.actions}get session(){return this.#e}},EC=e({ClientType:()=>hx,Continuation:()=>hy,ContinuationCommand:()=>_y,GridContinuation:()=>py,Innertube:()=>TC,ItemSectionContinuation:()=>oy,LiveChatContinuation:()=>gy,MusicPlaylistShelfContinuation:()=>dy,MusicShelfContinuation:()=>fy,NavigateAction:()=>sy,PlaylistPanelContinuation:()=>my,ReloadContinuationItemsCommand:()=>ly,SectionListContinuation:()=>uy,ShowMiniplayerCommand:()=>cy,YT:()=>Cb}),DC=`Cache`,OC=class{#e;#t;constructor(e=!1,t){this.#e=t||``,this.#t=e}get cache_dir(){return this.#t?this.#e:``}#n(){let e=Reflect.get(globalThis,`indexedDB`)||Reflect.get(globalThis,`webkitIndexedDB`)||Reflect.get(globalThis,`mozIndexedDB`)||Reflect.get(globalThis,`msIndexedDB`);return e?new Promise((t,n)=>{let r=e.open(`youtubei.js`,1);r.onsuccess=function(){t(this.result)},r.onerror=function(e){n(`indexedDB request error`),console.error(e)},r.onupgradeneeded=function(){let e=this.result.createObjectStore(`kv-store`,{keyPath:`k`});e.transaction.oncomplete=function(){t(this.db)}}}):c(DC,`IndexedDB is not supported. No cache will be used.`)}async get(e){let t=await this.#n();if(t)return new Promise((n,r)=>{let i=t.transaction(`kv-store`,`readonly`).objectStore(`kv-store`).get(e);i.onerror=r,i.onsuccess=function(){let e=this.result?.v;e instanceof ArrayBuffer?n(e):n(ArrayBuffer.isView(e)?e.buffer:void 0)}})}async set(e,t){let n=await this.#n();if(n)return new Promise((r,i)=>{let a=n.transaction(`kv-store`,`readwrite`).objectStore(`kv-store`).put({k:e,v:t});a.onerror=i,a.onsuccess=()=>r()})}async remove(e){let t=await this.#n();if(t)return new Promise((n,r)=>{let i=t.transaction(`kv-store`,`readwrite`).objectStore(`kv-store`).delete(e);i.onerror=r,i.onsuccess=()=>n()})}};Z.load({runtime:`browser`,server:!1,Cache:OC,sha1Hash:cx,uuidv4(){return globalThis.crypto?.randomUUID()?globalThis.crypto.randomUUID():`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>{let t=parseInt(e);return(t^window.crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})},eval:lx,fetch:globalThis.fetch,Request:globalThis.Request,Response:globalThis.Response,Headers:globalThis.Headers,FormData:globalThis.FormData,File:globalThis.File,ReadableStream:globalThis.ReadableStream,CustomEvent:globalThis.CustomEvent});export{Q as a,xb as c,C as d,x as f,qb as i,rc as l,TC as n,Z as o,b as p,mx as r,$b as s,EC as t,S as u};
|