diff --git a/chrome/player/modules/yt.mjs b/chrome/player/modules/yt.mjs index de9dd06..10f1b0a 100644 --- a/chrome/player/modules/yt.mjs +++ b/chrome/player/modules/yt.mjs @@ -1,11 +1,11 @@ /* eslint-disable */ /* LuanRT/YouTube.js */ // Minified to reduce loading time (https://minify-js.com/) -var Mw=Object.defineProperty;var r=(t,e)=>Mw(t,"name",{value:e,configurable:!0});var Xe=(t,e)=>{for(var i in e)Mw(t,i,{get:e[i],enumerable:!0})};function Lw(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}r(Lw,"__setFunctionName");function u(t,e,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(t):s?s.value:e.get(t)}r(u,"__classPrivateFieldGet");function I(t,e,i,s,o){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?o.call(t,i):o?o.value=i:e.set(t,i),i}r(I,"__classPrivateFieldSet");var Js={};Xe(Js,{ChannelError:()=>Ns,InnertubeError:()=>g,MissingParamError:()=>td,OAuth2Error:()=>le,ParsingError:()=>Qe,Platform:()=>M,PlayerError:()=>Ct,SessionError:()=>Ar,base64ToU8:()=>rg,concatMemos:()=>jg,debugFetch:()=>xC,deepCompare:()=>pd,escapeStringRegexp:()=>uw,findFunction:()=>id,generateRandomString:()=>$i,generateSidAuth:()=>dC,getCookie:()=>yC,getRandomUserAgent:()=>Zi,getStringBetweenStrings:()=>Ee,hasKeys:()=>_C,isTextRun:()=>Oe,streamToIterable:()=>jb,throwIfMissing:()=>Hs,timeToSeconds:()=>_e,u8ToBase64:()=>zt});var Gb={};Xe(Gb,{Maybe:()=>zi,Memo:()=>ui,SuperParsedResult:()=>Nt,YTNode:()=>n,observe:()=>G});var O={};Xe(O,{Level:()=>ht,debug:()=>xk,error:()=>dk,info:()=>_k,setLevel:()=>yk,warn:()=>Ht,warnOnce:()=>hk});var mk="YOUTUBEJS",ht={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},Ow={[ht.ERROR]:(...t)=>console.error(...t),[ht.WARNING]:(...t)=>console.warn(...t),[ht.INFO]:(...t)=>console.info(...t),[ht.DEBUG]:(...t)=>console.debug(...t)},Bw=[ht.WARNING],Dw=new Set;function qs(t,e,i){if(!Ow[t]||!Bw.includes(t))return;let s=[`[${mk}]`];e&&s.push(`[${e}]`),Ow[t](`${s.join("")}:`,...i||[])}r(qs,"doLog");var hk=r((t,...e)=>{Dw.has(t)||(qs(ht.WARNING,t,e),Dw.add(t))},"warnOnce"),Ht=r((t,...e)=>qs(ht.WARNING,t,e),"warn"),dk=r((t,...e)=>qs(ht.ERROR,t,e),"error"),_k=r((t,...e)=>qs(ht.INFO,t,e),"info"),xk=r((t,...e)=>qs(ht.DEBUG,t,e),"debug");function yk(...t){Bw=t}r(yk,"setLevel");var Wb,Yw,fe,Q,Pt,$t,qi,Vw=Symbol("ObservedArray.isObserved"),n=class{constructor(){Wb.add(this),this.type=this.constructor.type}is(...e){return e.some(i=>u(this,Wb,"m",Yw).call(this,i))}as(...e){if(!this.is(...e))throw new Qe(`Cannot cast ${this.type} to one of ${e.map(i=>i.type).join(", ")}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new Qe(`Missing key ${e}`);return new zi(this[e])}};r(n,"YTNode");Wb=new WeakSet,Yw=r(function(e){return this.type===e.type},"_YTNode_is");n.type="YTNode";var bk="Maybe",zi=class{constructor(e){fe.add(this),Q.set(this,void 0),I(this,Q,e,"f")}get typeof(){return typeof u(this,Q,"f")}string(){return u(this,fe,"m",$t).call(this,"string")}isString(){return u(this,fe,"m",Pt).call(this,"string")}number(){return u(this,fe,"m",$t).call(this,"number")}isNumber(){return u(this,fe,"m",Pt).call(this,"number")}bigint(){return u(this,fe,"m",$t).call(this,"bigint")}isBigint(){return u(this,fe,"m",Pt).call(this,"bigint")}boolean(){return u(this,fe,"m",$t).call(this,"boolean")}isBoolean(){return u(this,fe,"m",Pt).call(this,"boolean")}symbol(){return u(this,fe,"m",$t).call(this,"symbol")}isSymbol(){return u(this,fe,"m",Pt).call(this,"symbol")}undefined(){return u(this,fe,"m",$t).call(this,"undefined")}isUndefined(){return u(this,fe,"m",Pt).call(this,"undefined")}null(){if(u(this,Q,"f")!==null)throw new TypeError(`Expected null, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isNull(){return u(this,Q,"f")===null}object(){return u(this,fe,"m",$t).call(this,"object")}isObject(){return u(this,fe,"m",Pt).call(this,"object")}function(){return u(this,fe,"m",$t).call(this,"function")}isFunction(){return u(this,fe,"m",Pt).call(this,"function")}array(){if(!Array.isArray(u(this,Q,"f")))throw new TypeError(`Expected array, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}arrayOfMaybe(){let e=[];return new Proxy(this.array(),{get(i,s){return Reflect.has(e,s)?Reflect.get(i,s):new zi(Reflect.get(i,s))}})}isArray(){return Array.isArray(u(this,Q,"f"))}node(){if(!(u(this,Q,"f")instanceof n))throw new TypeError(`Expected YTNode, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isNode(){return u(this,Q,"f")instanceof n}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw new TypeError(`Expected ObservedArray, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isObserved(){var e;return(e=u(this,Q,"f"))==null?void 0:e[Vw]}parsed(){if(!(u(this,Q,"f")instanceof Nt))throw new TypeError(`Expected SuperParsedResult, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isParsed(){return u(this,Q,"f")instanceof Nt}any(){return Ht(bk,"This call is not meant to be used outside of debugging. Please use the specific type getter instead."),u(this,Q,"f")}instanceof(e){if(!this.isInstanceof(e))throw new TypeError(`Expected instance of ${e.name}, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isInstanceof(e){return u(this,Q,"f")instanceof e}};r(zi,"Maybe");Q=new WeakMap,fe=new WeakSet,Pt=r(function(e){return typeof u(this,Q,"f")===e},"_Maybe_checkPrimitive"),$t=r(function(e){if(!u(this,fe,"m",Pt).call(this,e))throw new TypeError(`Expected ${e}, got ${this.typeof}`);return u(this,Q,"f")},"_Maybe_assertPrimitive");var Nt=class{constructor(e){qi.set(this,void 0),I(this,qi,e,"f")}get is_null(){return u(this,qi,"f")===null}get is_array(){return!this.is_null&&Array.isArray(u(this,qi,"f"))}get is_node(){return!this.is_array}array(){if(!this.is_array)throw new TypeError("Expected an array, got a node");return u(this,qi,"f")}item(){if(!this.is_node)throw new TypeError("Expected a node, got an array");return u(this,qi,"f")}};r(Nt,"SuperParsedResult");qi=new WeakMap;function G(t){return new Proxy(t,{get(e,i){return i=="get"?(s,o)=>e.find((a,l)=>{let f=pd(s,a);return f&&o&&e.splice(l,1),f}):i==Vw?!0:i=="getAll"?(s,o)=>e.filter((a,l)=>{let f=pd(s,a);return f&&o&&e.splice(l,1),f}):i=="matchCondition"?s=>e.find(o=>s(o)):i=="filterType"?(...s)=>G(e.filter(o=>!!o.is(...s))):i=="firstOfType"?(...s)=>e.find(o=>!!o.is(...s)):i=="first"?()=>e[0]:i=="as"?(...s)=>G(e.map(o=>{if(o.is(...s))return o;throw new Qe(`Expected node of any type ${s.map(a=>a.type).join(", ")}, got ${o.type}`)})):i=="remove"?s=>e.splice(s,1):Reflect.get(e,i)}})}r(G,"observe");var ui=class extends Map{getType(...e){return e=e.flat(),G(e.flatMap(i=>this.get(i.type)||[]))}};r(ui,"Memo");var zg={};Xe(zg,{Author:()=>P,ChildElement:()=>ox,EmojiRun:()=>_i,Format:()=>rb,Text:()=>p,TextRun:()=>xi,Thumbnail:()=>y,VideoDetails:()=>Li});var z={};Xe(z,{CLIENTS:()=>V,INNERTUBE_HEADERS_BASE:()=>wk,OAUTH:()=>gk,STREAM_HEADERS:()=>Kt,SUPPORTED_CLIENTS:()=>cd,URLS:()=>We});var We=Object.freeze({YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",YT_UPLOAD:"https://upload.youtube.com/",API:Object.freeze({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/"}),gk=Object.freeze({REGEX:Object.freeze({TV_SCRIPT:new RegExp(']*><\\/script>'),CLIENT_IDENTITY:new RegExp('clientId:"(?[^"]+)",[^"]*?:"(?[^"]+)"')})}),V=Object.freeze({IOS:{NAME_ID:"5",NAME:"iOS",VERSION:"18.06.35",USER_AGENT:"com.google.ios.youtube/18.06.35 (iPhone; CPU iPhone OS 14_4 like Mac OS X; en_US)",DEVICE_MODEL:"iPhone10,6"},WEB:{NAME_ID:"1",NAME:"WEB",VERSION:"2.20241121.01.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},MWEB:{NAME_ID:"2",NAME:"MWEB",VERSION:"2.20241205.01.00",API_VERSION:"v1"},WEB_KIDS:{NAME_ID:"76",NAME:"WEB_KIDS",VERSION:"2.20230111.00.00"},YTMUSIC:{NAME_ID:"67",NAME:"WEB_REMIX",VERSION:"1.20211213.00.00"},ANDROID:{NAME_ID:"3",NAME:"ANDROID",VERSION:"19.35.36",SDK_VERSION:33,USER_AGENT:"com.google.android.youtube/19.35.36(Linux; U; Android 13; en_US; SM-S908E Build/TP1A.220624.014) gzip"},YTSTUDIO_ANDROID:{NAME_ID:"14",NAME:"ANDROID_CREATOR",VERSION:"22.43.101"},YTMUSIC_ANDROID:{NAME_ID:"21",NAME:"ANDROID_MUSIC",VERSION:"5.34.51"},TV:{NAME_ID:"7",NAME:"TVHTML5",VERSION:"7.20241016.15.00",USER_AGENT:"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version"},TV_EMBEDDED:{NAME_ID:"85",NAME:"TVHTML5_SIMPLY_EMBEDDED_PLAYER",VERSION:"2.0"},WEB_EMBEDDED:{NAME_ID:"56",NAME:"WEB_EMBEDDED_PLAYER",VERSION:"2.20240111.09.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},WEB_CREATOR:{NAME_ID:"62",NAME:"WEB_CREATOR",VERSION:"1.20240918.03.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"}}),Kt=Object.freeze({accept:"*/*",origin:"https://www.youtube.com",referer:"https://www.youtube.com",DNT:"?1"}),wk=Object.freeze({accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json"}),cd=["IOS","WEB","MWEB","YTKIDS","YTMUSIC","ANDROID","YTSTUDIO_ANDROID","YTMUSIC_ANDROID","TV","TV_EMBEDDED","WEB_EMBEDDED","WEB_CREATOR"];var c={};Xe(c,{addRuntimeParser:()=>Bg,applyCommentsMutations:()=>iE,applyMutations:()=>tE,getDynamicParsers:()=>E1,getParserByName:()=>xs,hasParser:()=>Dh,parse:()=>De,parseActions:()=>eE,parseArray:()=>Ce,parseC:()=>ZS,parseCommand:()=>JS,parseCommands:()=>N1,parseFormats:()=>Ug,parseItem:()=>q,parseLC:()=>Vg,parseRR:()=>sb,parseResponse:()=>Yg,sanitizeClassName:()=>ys,setParserErrorHandler:()=>I1,shouldIgnore:()=>Wg});var mr={};Xe(mr,{AboutChannel:()=>vd,AboutChannelView:()=>Td,AccountChannel:()=>Id,AccountItem:()=>Sd,AccountItemSection:()=>kd,AccountItemSectionHeader:()=>Ed,AccountSectionList:()=>Cd,AddBannerToLiveChatCommand:()=>sv,AddChatItemAction:()=>Rx,AddLiveChatTickerItemAction:()=>ov,AddToPlaylist:()=>CT,AddToPlaylistCommand:()=>HT,AddToPlaylistEndpoint:()=>d0,AddToPlaylistServiceEndpoint:()=>ax,Alert:()=>Br,AlertWithButton:()=>Vd,AnchoredSection:()=>Xy,AppendContinuationItemsAction:()=>er,AttributionView:()=>Ud,AudioOnlyPlayability:()=>Fd,AuthorCommentBadge:()=>QT,AutomixPreviewVideo:()=>Wd,AvatarView:()=>Gd,BackstageImage:()=>jd,BackstagePost:()=>bi,BackstagePostThread:()=>PT,BadgeView:()=>gi,BrowseEndpoint:()=>_0,BrowseFeedActions:()=>Qd,BrowserMediaSession:()=>NT,Button:()=>v,ButtonView:()=>Te,C4TabbedHeader:()=>$r,CallToActionButton:()=>AT,Card:()=>RT,CardCollection:()=>S_,CarouselHeader:()=>E_,CarouselItem:()=>MT,CarouselLockup:()=>b_,ChangeEngagementPanelVisibilityAction:()=>wT,Channel:()=>k_,ChannelAboutFullMetadata:()=>pa,ChannelAgeGate:()=>LT,ChannelExternalLinkView:()=>wd,ChannelFeaturedContent:()=>OT,ChannelHeaderLinks:()=>Jd,ChannelHeaderLinksView:()=>Zd,ChannelMetadata:()=>C_,ChannelMobileHeader:()=>DT,ChannelOptions:()=>P_,ChannelOwnerEmptyState:()=>BT,ChannelSubMenu:()=>_a,ChannelSwitcherHeader:()=>YT,ChannelSwitcherPage:()=>Nd,ChannelTagline:()=>v_,ChannelThumbnailWithLink:()=>VT,ChannelVideoPlayer:()=>UT,Chapter:()=>N_,ChildVideo:()=>FT,ChipBarView:()=>WT,ChipCloud:()=>Kr,ChipCloudChip:()=>je,ChipView:()=>A_,ClipAdState:()=>i_,ClipCreation:()=>r_,ClipCreationScrubber:()=>t_,ClipCreationTextInput:()=>e_,ClipSection:()=>s_,CollaboratorInfoCardContent:()=>GT,CollageHeroImage:()=>jT,CollectionThumbnailView:()=>D_,CommandExecutorCommand:()=>$T,CommentActionButtons:()=>$d,CommentDialog:()=>JT,CommentReplies:()=>V_,CommentReplyDialog:()=>U_,CommentSimplebox:()=>j_,CommentThread:()=>$_,CommentView:()=>or,CommentsEntryPointHeader:()=>G_,CommentsEntryPointTeaser:()=>W_,CommentsHeader:()=>Si,CommentsSimplebox:()=>F_,CompactChannel:()=>t0,CompactLink:()=>yi,CompactMix:()=>i0,CompactMovie:()=>r0,CompactPlaylist:()=>s0,CompactStation:()=>o0,CompactVideo:()=>Gr,ConfirmDialog:()=>n0,ContentMetadataView:()=>Xr,ContentPreviewImageView:()=>rr,ContinuationCommand:()=>KT,ContinuationItem:()=>J,ConversationBar:()=>a0,CopyLink:()=>Qr,CreateCommentEndpoint:()=>x0,CreatePlaylistDialog:()=>yd,CreatePlaylistDialogFormView:()=>z_,CreatePlaylistServiceEndpoint:()=>y0,CreatorHeart:()=>Hd,DecoratedAvatarView:()=>Jr,DecoratedPlayerBar:()=>Z_,DefaultPromoPanel:()=>p0,DeletePlaylistEndpoint:()=>b0,DescriptionPreviewView:()=>ex,DialogHeaderView:()=>tx,DialogView:()=>c0,DidYouMean:()=>l0,DimChatItemAction:()=>nv,DislikeButtonView:()=>qd,DownloadButton:()=>Yr,Dropdown:()=>hi,DropdownItem:()=>xd,DropdownView:()=>K_,DynamicTextView:()=>sx,Element:()=>nx,EmergencyOnebox:()=>u0,EmojiPicker:()=>Y_,EmojiPickerCategory:()=>f0,EmojiPickerCategoryButton:()=>m0,EmojiPickerUpsellCategory:()=>h0,EndScreenPlaylist:()=>lx,EndScreenVideo:()=>ux,Endscreen:()=>cx,EndscreenElement:()=>Y0,EngagementPanelSectionList:()=>Ii,EngagementPanelTitleHeader:()=>o_,EomSettingsDisclaimer:()=>V0,ExpandableMetadata:()=>f_,ExpandableTab:()=>es,ExpandableVideoDescriptionBody:()=>c_,ExpandedShelfContents:()=>U0,Factoid:()=>vi,FancyDismissibleDialog:()=>F0,FeedFilterChipBar:()=>vt,FeedNudge:()=>W0,FeedTabbedHeader:()=>fx,FeedbackEndpoint:()=>g0,FlexibleActionsView:()=>mx,FormFooterView:()=>rx,GameCard:()=>l_,GameDetails:()=>G0,GetAccountsListInnertubeEndpoint:()=>w0,GetKidsBlocklistPickerCommand:()=>qT,GetMultiPageMenuAction:()=>TT,Grid:()=>j0,GridChannel:()=>hx,GridHeader:()=>H0,GridMix:()=>$0,GridMovie:()=>K0,GridPlaylist:()=>dx,GridShow:()=>q0,GridVideo:()=>yx,GuideCollapsibleEntry:()=>z0,GuideCollapsibleSectionEntry:()=>X0,GuideDownloadsEntry:()=>Q0,GuideEntry:()=>fr,GuideSection:()=>ts,GuideSubscriptionsSection:()=>bx,HashtagHeader:()=>gx,HashtagTile:()=>J0,HeatMarker:()=>X_,Heatmap:()=>Q_,HeroPlaylistThumbnail:()=>Z0,HideEngagementPanelEndpoint:()=>T0,HighlightsCarousel:()=>ev,HistorySuggestion:()=>tv,HorizontalCardList:()=>wi,HorizontalList:()=>u_,HorizontalMovieList:()=>iv,IconLink:()=>Tx,ImageBannerView:()=>vx,IncludingResultsFor:()=>rv,InfoPanelContainer:()=>Sx,InfoPanelContent:()=>Ix,InfoRow:()=>y_,InteractiveTabbedHeader:()=>Ex,ItemSection:()=>It,ItemSectionHeader:()=>is,ItemSectionTab:()=>kx,ItemSectionTabbedHeader:()=>rs,KidsBlocklistPicker:()=>YS,KidsBlocklistPickerItem:()=>Qy,KidsCategoriesHeader:()=>VS,KidsCategoryTab:()=>Jy,KidsHomeScreen:()=>US,LikeButton:()=>Vr,LikeButtonView:()=>Kd,LikeEndpoint:()=>v0,LiveChat:()=>Px,LiveChatActionPanel:()=>Dx,LiveChatAuthorBadge:()=>Mx,LiveChatAutoModMessage:()=>av,LiveChatBanner:()=>Ax,LiveChatBannerChatSummary:()=>pv,LiveChatBannerHeader:()=>Nx,LiveChatBannerPoll:()=>cv,LiveChatBannerRedirect:()=>lv,LiveChatDialog:()=>Dv,LiveChatHeader:()=>Wx,LiveChatItemContextMenuEndpoint:()=>I0,LiveChatItemList:()=>Gx,LiveChatMembershipItem:()=>uv,LiveChatMessageInput:()=>Bv,LiveChatModeChangeMessage:()=>fv,LiveChatPaidMessage:()=>mv,LiveChatPaidSticker:()=>hv,LiveChatParticipant:()=>jx,LiveChatParticipantsList:()=>Hx,LiveChatPlaceholderItem:()=>dv,LiveChatProductItem:()=>_v,LiveChatRestrictedParticipation:()=>xv,LiveChatSponsorshipsGiftPurchaseAnnouncement:()=>yv,LiveChatSponsorshipsGiftRedemptionAnnouncement:()=>bv,LiveChatSponsorshipsHeader:()=>Lx,LiveChatTextMessage:()=>gv,LiveChatTickerPaidMessageItem:()=>Ox,LiveChatTickerPaidStickerItem:()=>wv,LiveChatTickerSponsorItem:()=>Tv,LiveChatViewerEngagementMessage:()=>vv,LockupMetadataView:()=>$x,LockupView:()=>Kx,MacroMarkersInfoItem:()=>n_,MacroMarkersList:()=>a_,MacroMarkersListItem:()=>Fr,MarkChatItemAsDeletedAction:()=>Sv,MarkChatItemsByAuthorAsDeletedAction:()=>Ev,Menu:()=>R,MenuFlexibleItem:()=>Xd,MenuNavigationItem:()=>qx,MenuPopup:()=>Yv,MenuServiceItem:()=>At,MenuServiceItemDownload:()=>zd,MenuTitle:()=>Bd,MerchandiseItem:()=>Uv,MerchandiseShelf:()=>Jx,Message:()=>ki,MetadataBadge:()=>Ge,MetadataRow:()=>Fv,MetadataRowContainer:()=>Zx,MetadataRowHeader:()=>Wv,MetadataScreen:()=>Gv,MicroformatData:()=>Ci,Mix:()=>jv,MobileTopbar:()=>gI,ModalWithTitleAndButton:()=>Hv,ModifyChannelNotificationPreferenceEndpoint:()=>S0,Movie:()=>$v,MovingThumbnail:()=>Kv,MultiMarkersPlayerBar:()=>J_,MultiPageMenu:()=>Pd,MultiPageMenuNotificationSection:()=>Vv,MultiPageMenuSection:()=>wI,MusicCardShelf:()=>qv,MusicCardShelfHeaderBasic:()=>ey,MusicCarouselShelf:()=>sI,MusicCarouselShelfBasicHeader:()=>ty,MusicDescriptionShelf:()=>ay,MusicDetailHeader:()=>oI,MusicDownloadStateBadge:()=>nI,MusicEditablePlaylistDetailHeader:()=>aI,MusicElementHeader:()=>pI,MusicHeader:()=>cI,MusicImmersiveHeader:()=>lI,MusicInlineBadge:()=>os,MusicItemThumbnailOverlay:()=>Mt,MusicLargeCardItemCarousel:()=>uI,MusicMenuItemDivider:()=>zx,MusicMultiRowListItem:()=>iy,MusicMultiSelectMenu:()=>Xx,MusicMultiSelectMenuItem:()=>ss,MusicNavigationButton:()=>ry,MusicPlayButton:()=>ns,MusicPlaylistEditHeader:()=>fI,MusicPlaylistShelf:()=>mI,MusicQueue:()=>ly,MusicResponsiveHeader:()=>hI,MusicResponsiveListItem:()=>Pi,MusicResponsiveListItemFixedColumn:()=>sy,MusicResponsiveListItemFlexColumn:()=>oy,MusicShelf:()=>dI,MusicSideAlignedItem:()=>_I,MusicSortFilterButton:()=>xI,MusicTastebuilderShelf:()=>yI,MusicTastebuilderShelfThumbnail:()=>uy,MusicThumbnail:()=>Ie,MusicTwoRowItem:()=>ny,MusicVisualHeader:()=>bI,NavigationEndpoint:()=>d,Notification:()=>fy,NotificationAction:()=>SI,OpenPopupAction:()=>_d,PageHeader:()=>Lt,PageHeaderView:()=>my,PageIntroduction:()=>hy,PanelFooterView:()=>ix,PdgCommentChip:()=>ZT,PerformCommentActionEndpoint:()=>E0,PivotBar:()=>TI,PivotBarItem:()=>vI,PivotButton:()=>dy,PlayerAnnotationsExpanded:()=>_y,PlayerCaptionsTracklist:()=>xy,PlayerControlsOverlay:()=>EI,PlayerErrorMessage:()=>kI,PlayerLegacyDesktopYpcOffer:()=>CI,PlayerLegacyDesktopYpcTrailer:()=>Tf,PlayerLiveStoryboardSpec:()=>gy,PlayerMicroformat:()=>et,PlayerOverflow:()=>yy,PlayerOverlay:()=>Iy,PlayerOverlayAutoplay:()=>wy,PlayerOverlayVideoDetails:()=>Ty,PlayerStoryboardSpec:()=>Qi,Playlist:()=>Rt,PlaylistAddToOption:()=>Yd,PlaylistCustomThumbnail:()=>qr,PlaylistEditEndpoint:()=>k0,PlaylistHeader:()=>Sy,PlaylistInfoCardContent:()=>PI,PlaylistMetadata:()=>Ey,PlaylistPanel:()=>cy,PlaylistPanelVideo:()=>ei,PlaylistPanelVideoWrapper:()=>py,PlaylistSidebar:()=>NI,PlaylistSidebarPrimaryInfo:()=>ky,PlaylistSidebarSecondaryInfo:()=>Cy,PlaylistVideo:()=>ps,PlaylistVideoList:()=>AI,PlaylistVideoThumbnail:()=>zr,Poll:()=>RI,PollHeader:()=>Iv,Post:()=>cs,PostMultiImage:()=>MI,PrefetchWatchCommand:()=>C0,PremiereTrailerBadge:()=>LI,ProductList:()=>p_,ProductListHeader:()=>OI,ProductListItem:()=>DI,ProfileColumn:()=>BI,ProfileColumnStats:()=>YI,ProfileColumnStatsEntry:()=>VI,ProfileColumnUserInfo:()=>UI,Quiz:()=>FI,RecognitionShelf:()=>WI,ReelItem:()=>ls,ReelPlayerHeader:()=>Py,ReelPlayerOverlay:()=>GI,ReelShelf:()=>Hr,ReelWatchEndpoint:()=>P0,RelatedChipCloud:()=>Ny,RemoveBannerForLiveChatCommand:()=>kv,RemoveChatItemAction:()=>Cv,RemoveChatItemByAuthorAction:()=>Pv,ReplaceChatItemAction:()=>Nv,ReplayChatItemAction:()=>Av,RichGrid:()=>Ni,RichItem:()=>jI,RichListHeader:()=>HI,RichMetadata:()=>rm,RichMetadataRow:()=>om,RichSection:()=>$I,RichShelf:()=>Ay,RunAttestationCommand:()=>zT,SearchBox:()=>KI,SearchEndpoint:()=>N0,SearchFilter:()=>Ry,SearchFilterGroup:()=>us,SearchFilterOptionsDialog:()=>qI,SearchHeader:()=>My,SearchRefinementCard:()=>tr,SearchSubMenu:()=>Ly,SearchSuggestion:()=>wx,SearchSuggestionsSection:()=>zI,SecondarySearchContainer:()=>XI,SectionList:()=>de,SegmentedLikeDislikeButton:()=>dr,SegmentedLikeDislikeButtonView:()=>Xt,SendFeedbackAction:()=>vT,SettingBoolean:()=>QI,SettingsCheckbox:()=>Oy,SettingsOptions:()=>ms,SettingsSidebar:()=>Dy,SettingsSwitch:()=>fs,ShareEndpoint:()=>A0,ShareEntityEndpoint:()=>R0,ShareEntityServiceEndpoint:()=>Zr,SharePanelHeader:()=>Yy,SharePanelTitleV15:()=>JI,ShareTarget:()=>Vy,SharedPost:()=>By,Shelf:()=>hs,ShortsLockupView:()=>ds,ShowCustomThumbnail:()=>_x,ShowDialogCommand:()=>XT,ShowEngagementPanelEndpoint:()=>M0,ShowLiveChatActionPanelAction:()=>Rv,ShowLiveChatDialogAction:()=>Mv,ShowLiveChatTooltipCommand:()=>Lv,ShowingResultsFor:()=>ZI,SignalAction:()=>IT,SignalServiceEndpoint:()=>L0,SimpleCardContent:()=>eS,SimpleCardTeaser:()=>tS,SimpleMenuHeader:()=>Qx,SimpleTextSection:()=>iS,SingleActionEmergencySupport:()=>rS,SingleColumnBrowseResults:()=>sS,SingleColumnMusicWatchNextResults:()=>oS,SingleHeroImage:()=>nS,SlimOwner:()=>aS,SlimVideoMetadata:()=>pS,SortFilterHeader:()=>Cx,SortFilterSubMenu:()=>xt,SponsorCommentBadge:()=>e0,StartAt:()=>Uy,StructuredDescriptionContent:()=>sr,StructuredDescriptionPlaylistLockup:()=>g_,SubFeedOption:()=>Fy,SubFeedSelector:()=>cS,SubscribeButton:()=>xe,SubscribeEndpoint:()=>O0,SubscriptionNotificationToggleButton:()=>I_,Tab:()=>Se,Tabbed:()=>lS,TabbedSearchResults:()=>uS,TextFieldView:()=>q_,TextHeader:()=>fS,ThirdPartyShareTargetSection:()=>Wy,ThumbnailBadgeView:()=>M_,ThumbnailHoverOverlayView:()=>R_,ThumbnailLandscapePortrait:()=>mS,ThumbnailOverlayBadgeView:()=>L_,ThumbnailOverlayBottomPanel:()=>xx,ThumbnailOverlayEndorsement:()=>hS,ThumbnailOverlayHoverText:()=>dS,ThumbnailOverlayInlineUnplayable:()=>_S,ThumbnailOverlayLoadingPreview:()=>xS,ThumbnailOverlayNowPlaying:()=>yS,ThumbnailOverlayPinking:()=>bS,ThumbnailOverlayPlaybackStatus:()=>gS,ThumbnailOverlayResumePlayback:()=>wS,ThumbnailOverlaySidePanel:()=>TS,ThumbnailOverlayTimeStatus:()=>ir,ThumbnailOverlayToggleButton:()=>vS,ThumbnailView:()=>O_,TimedMarkerDecoration:()=>IS,TitleAndButtonListHeader:()=>SS,ToggleButton:()=>se,ToggleButtonView:()=>yt,ToggleMenuServiceItem:()=>ES,Tooltip:()=>kS,TopbarMenuButton:()=>II,TopicChannelDetails:()=>CS,Transcript:()=>Dr,TranscriptFooter:()=>Ad,TranscriptSearchBox:()=>Rd,TranscriptSearchPanel:()=>Dd,TranscriptSectionHeader:()=>Md,TranscriptSegment:()=>Ld,TranscriptSegmentList:()=>Od,TwoColumnBrowseResults:()=>Ot,TwoColumnSearchResults:()=>Gy,TwoColumnWatchNextResults:()=>Hy,UnifiedSharePanel:()=>PS,UniversalWatchCard:()=>$y,UnsubscribeEndpoint:()=>D0,UpdateChannelSwitcherPageAction:()=>ST,UpdateDateTextAction:()=>Bx,UpdateDescriptionAction:()=>Yx,UpdateEngagementPanelAction:()=>ET,UpdateLiveChatPollAction:()=>Ov,UpdateSubscribeButtonAction:()=>kT,UpdateTitleAction:()=>Vx,UpdateToggleButtonTextAction:()=>Ux,UpdateViewershipAction:()=>Fx,UploadTimeFactoid:()=>h_,UpsellDialog:()=>NS,VerticalList:()=>AS,VerticalWatchCardList:()=>RS,Video:()=>Wr,VideoAttributeView:()=>Ti,VideoAttributesSectionView:()=>T_,VideoCard:()=>m_,VideoDescriptionCourseSection:()=>w_,VideoDescriptionHeader:()=>__,VideoDescriptionInfocardsSection:()=>x_,VideoDescriptionMusicSection:()=>jr,VideoDescriptionTranscriptSection:()=>jn,VideoInfoCardContent:()=>MS,VideoOwner:()=>_s,VideoPrimaryInfo:()=>qy,VideoSecondaryInfo:()=>wh,VideoViewCount:()=>Ky,ViewCountFactoid:()=>d_,WatchCardCompactVideo:()=>zy,WatchCardHeroVideo:()=>LS,WatchCardRichHeader:()=>OS,WatchCardSectionSequence:()=>DS,WatchEndpoint:()=>px,WatchNextEndScreen:()=>vy,WatchNextEndpoint:()=>B0,WatchNextTabbedResults:()=>BS,YpcTrailer:()=>by});var Xi,ld=class{constructor(e,i){Xi.set(this,void 0),I(this,Xi,new M.shim.Cache(e,i),"f")}get cache_dir(){return u(this,Xi,"f").cache_dir}get(e){return u(this,Xi,"f").get(e)}set(e,i){return u(this,Xi,"f").set(e,i)}remove(e){return u(this,Xi,"f").remove(e)}};r(ld,"UniversalCache");Xi=new WeakMap;var Tk=ld;var Or,ud=class extends EventTarget{constructor(){super(),Or.set(this,new Map)}emit(e,...i){let s=new M.shim.CustomEvent(e,{detail:i});this.dispatchEvent(s)}on(e,i){let s=r(o=>{o instanceof M.shim.CustomEvent?i(...o.detail):i(o)},"wrapper");u(this,Or,"f").set(i,s),this.addEventListener(e,s)}once(e,i){let s=r(o=>{o instanceof M.shim.CustomEvent?i(...o.detail):i(o),this.off(e,i)},"wrapper");u(this,Or,"f").set(i,s),this.addEventListener(e,s)}off(e,i){let s=u(this,Or,"f").get(i);s&&(this.removeEventListener(e,s),u(this,Or,"f").delete(i))}};r(ud,"EventEmitterLike");Or=new WeakMap;var zs=ud;var Ji={};Xe(Ji,{chooseFormat:()=>Qw,download:()=>qk,toDash:()=>Xw});var vk={"&":"&",'"':""","'":"'","<":"<",">":">"};function Uw(t){return t.replace(/([&"<>'])/g,(e,i)=>vk[i])}r(Uw,"escapeXMLString");function Ik(t){return t==="mpd"?"MPD":t==="base-url"?"BaseURL":t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}r(Ik,"normalizeTag");function H(t,e,...i){let s=i.flat().map(o=>typeof o=="string"?Sk(o):o);return typeof t=="function"?t({...e,children:s}):{type:Ik(t),props:{...e,children:s}}}r(H,"createElement");function Sk(t){return{type:"TEXT_ELEMENT",props:{nodeValue:t}}}r(Sk,"createTextElement");async function Fw(t){if(t.type==="TEXT_ELEMENT")return Uw(typeof t.props.nodeValue=="string"?t.props.nodeValue:"");let e=`<${t.type}`;if(t.props){let i=Object.keys(t.props).filter(s=>!["children","nodeValue"].includes(s)&&t.props[s]!==void 0).map(s=>`${s}="${Uw(`${t.props[s]}`)}"`);i.length>0&&(e+=` ${i.join(" ")}`)}if(t.props.children){let i=await Promise.all((await Promise.all(t.props.children.flat())).flat().filter(s=>!!s).map(s=>Fw(s)));if(i.length>0)return e+=`>${i.join("")}`,e}return`${e}/>`}r(Fw,"renderElementToString");async function Ww(t){return`${await Fw(await t)}`}r(Ww,"renderToString");function Gw(t){return t.children}r(Gw,"Fragment");var Xs=class extends n{constructor(e){super();let i=e.spec.split("|"),s=new URL(i.shift());this.boards=i.map((o,a)=>{let[l,f,m,x,_,b,T,w]=o.split("#");s.searchParams.set("sigh",w);let S=Math.ceil(parseInt(m,10)/(parseInt(x,10)*parseInt(_,10)));return{type:"vod",template_url:s.toString().replace("$L",a).replace("$N",T),thumbnail_width:parseInt(l,10),thumbnail_height:parseInt(f,10),thumbnail_count:parseInt(m,10),interval:parseInt(b,10),columns:parseInt(x,10),rows:parseInt(_,10),storyboard_count:S}})}};r(Xs,"PlayerStoryboardSpec");Xs.type="PlayerStoryboardSpec";var Qi=Xs;var kk="StreamingInfo";function Ck(t,e){var o,a,l;let i=new Map,s=t.some(f=>!!f.audio_track);for(let f of t){if((!f.index_range||!f.init_range)&&!f.is_type_otf&&!e)continue;let m=f.mime_type.split(";")[0],x=(o=Ee(f.mime_type,'codecs="','"'))==null?void 0:o.split(".")[0],_=f.color_info?Object.values(f.color_info).join("-"):"",b=((a=f.audio_track)==null?void 0:a.id)||"",T=f.is_drc?"drc":"",w=`${m}-${x}-${_}-${b}-${T}`;i.has(w)||i.set(w,[]),(l=i.get(w))==null||l.push(f)}return{groups:Array.from(i.values()),has_multiple_audio_tracks:s}}r(Ck,"getFormatGroupings");function Hw(t,e){if(t.length>1&&new Set(t.map(i=>Ee(i.mime_type,'codecs="','"'))).size===1)return e.push("codecs"),Ee(t[0].mime_type,'codecs="','"')}r(Hw,"hoistCodecsIfPossible");function $w(t,e,i){if(t.length>1&&new Set(t.map(s=>s.fps)).size===1)return i.push(e),Number(t[0][e])}r($w,"hoistNumberAttributeIfPossible");function Pk(t,e){if(t.length>1&&new Set(t.map(i=>i.audio_channels||2)).size===1)return e.push("AudioChannelConfiguration"),t[0].audio_channels}r(Pk,"hoistAudioChannelsIfPossible");async function Nk(t,e){var f;let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"GET",headers:Kt,redirect:"follow"}),s=i.url.replace("&rn=0","").replace("&sq=0",""),o=await i.text(),a=(f=Ee(o,"Segment-Durations-Ms:",`\r -`))==null?void 0:f.split(",");if(!a)throw new g("Failed to extract the segment durations from this OTF stream",{url:t});let l=[];for(let m of a){let x=m.trim();if(x.length===0)continue;let _,b=Ee(x,"(r=",")");b&&(_=parseInt(b)),l.push({duration:parseInt(x),repeat_count:_})}return{init_url:`${s}&sq=0`,media_url:`${s}&sq=$Number$`,timeline:l}}r(Nk,"getOTFSegmentTemplate");async function Kw(t,e){let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"HEAD",headers:Kt,redirect:"follow"}),s=parseInt(i.headers.get("X-Head-Time-Millis")||""),o=parseInt(i.headers.get("X-Head-Seqnum")||"");if(isNaN(s)||isNaN(o))throw new g("Failed to extract the duration or segment count for this Post Live DVR video");return{duration:s/1e3,segment_count:o}}r(Kw,"getPostLiveDvrInfo");async function Ak(t,e,i,s,o,a){if(!t.item){let l=new URL(await e.decipher(o));l.searchParams.set("cpn",a||"");let f=i(l).toString();t.item=await Kw(f,s)}return t.item.duration}r(Ak,"getPostLiveDvrDuration");async function qw(t,e,i,s,o,a){let l=new URL(await t.decipher(s));l.searchParams.set("cpn",o||"");let f=e(l).toString();if(t.is_type_otf){if(!i)throw new g("Unable to get segment durations for this OTF stream without an Actions instance",{format:t});return{is_oft:!0,is_post_live_dvr:!1,getSegmentTemplate(){return Nk(f,i)}}}if(a){if(!i)throw new g("Unable to get segment count for this Post Live DVR video without an Actions instance",{format:t});let x=t.target_duration_dec;if(typeof x!="number")throw new g("Format is missing target_duration_dec",{format:t});return{is_oft:!1,is_post_live_dvr:!0,async getSegmentTemplate(){return a.item||(a.item=await Kw(f,i)),{media_url:`${f}&sq=$Number$`,timeline:[{duration:x*1e3,repeat_count:a.item.segment_count}]}}}}if(!t.index_range||!t.init_range)throw new g("Index and init ranges not available",{format:t});return{is_oft:!1,is_post_live_dvr:!1,base_url:f,index_range:t.index_range,init_range:t.init_range}}r(qw,"getSegmentInfo");async function Rk(t,e,i,s,o,a,l){new URL(await t.decipher(o)).searchParams.set("cpn",a||"");let m=[t.itag.toString()];return t.audio_track&&m.push(t.audio_track.id),t.is_drc&&m.push("drc"),{uid:m.join("-"),bitrate:t.bitrate,codecs:e.includes("codecs")?void 0:Ee(t.mime_type,'codecs="','"'),audio_sample_rate:e.includes("audio_sample_rate")?void 0:t.audio_sample_rate,channels:e.includes("AudioChannelConfiguration")?void 0:t.audio_channels||2,segment_info:await qw(t,i,s,o,a,l)}}r(Rk,"getAudioRepresentation");function Mk(t,e){if(!t.audio_track&&!e)return;let i=[t.is_original?"main":"alternate"];return(t.is_dubbed||t.is_auto_dubbed)&&i.push("dub"),t.is_descriptive&&i.push("description"),t.is_drc&&i.push("enhanced-audio-intelligibility"),i}r(Mk,"getTrackRoles");async function Lk(t,e,i,s,o,a,l){var w;let f=t[0],{audio_track:m}=f,x=[],_=!!l,b;return m?_&&f.is_drc?b=l.label_drc_multiple(m.display_name):b=m.display_name:_&&(b=f.is_drc?l.label_drc:l.label_original),{mime_type:f.mime_type.split(";")[0],language:(w=f.language)!=null?w:void 0,codecs:Hw(t,x),audio_sample_rate:$w(t,"audio_sample_rate",x),track_name:b,track_roles:Mk(f,_),channels:Pk(t,x),representations:await Promise.all(t.map(S=>Rk(S,x,e,i,s,o,a)))}}r(Lk,"getAudioSet");var Ok={BT709:"1",BT2020:"9"},jw={BT709:"1",BT2020_10:"14",SMPTEST2084:"16",ARIB_STD_B67:"18"},Dk={BT709:"1",BT2020_NCL:"14"};function Bk(t){var l;let e=t.color_info,i,s,o;if(e){if(e.primaries&&(i=Ok[e.primaries]),e.transfer_characteristics&&(s=jw[e.transfer_characteristics]),e.matrix_coefficients&&(o=Dk[e.matrix_coefficients],!o)){let f=new URL(t.url),m=JSON.parse(JSON.stringify(t));m.url="REDACTED",m.signature_cipher="REDACTED",m.cipher="REDACTED",Ht(kk,`Unknown matrix coefficients "${e.matrix_coefficients}". The DASH manifest is still usable without this. -Please report it at ${M.shim.info.bugs_url} so we can add support for it. +var Uw=Object.defineProperty;var r=(t,e)=>Uw(t,"name",{value:e,configurable:!0});var qe=(t,e)=>{for(var i in e)Uw(t,i,{get:e[i],enumerable:!0})};function Fw(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}r(Fw,"__setFunctionName");function u(t,e,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(t):s?s.value:e.get(t)}r(u,"__classPrivateFieldGet");function I(t,e,i,s,o){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?o.call(t,i):o?o.value=i:e.set(t,i),i}r(I,"__classPrivateFieldSet");var zs={};qe(zs,{ChannelError:()=>Cs,InnertubeError:()=>g,MissingParamError:()=>ad,OAuth2Error:()=>Fb,ParsingError:()=>ze,Platform:()=>L,PlayerError:()=>Et,SessionError:()=>Cr,base64ToU8:()=>cg,concatMemos:()=>Xg,debugFetch:()=>PC,deepCompare:()=>md,escapeStringRegexp:()=>yw,findFunction:()=>pd,generateRandomString:()=>ji,generateSidAuth:()=>kC,getCookie:()=>NC,getRandomUserAgent:()=>Qi,getStringBetweenStrings:()=>Ue,hasKeys:()=>CC,isTextRun:()=>Re,streamToIterable:()=>Xb,throwIfMissing:()=>Gs,timeToSeconds:()=>_e,u8ToBase64:()=>Kt});var Qb={};qe(Qb,{Maybe:()=>$i,Memo:()=>li,SuperParsedResult:()=>Ct,YTNode:()=>n,observe:()=>G});var D={};qe(D,{Level:()=>ft,debug:()=>Pk,error:()=>kk,info:()=>Ck,setLevel:()=>Nk,warn:()=>Gt,warnOnce:()=>Ek});var Sk="YOUTUBEJS",ft={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4},Ww={[ft.ERROR]:(...t)=>console.error(...t),[ft.WARNING]:(...t)=>console.warn(...t),[ft.INFO]:(...t)=>console.info(...t),[ft.DEBUG]:(...t)=>console.debug(...t)},jw=[ft.WARNING],Gw=new Set;function Hs(t,e,i){if(!Ww[t]||!jw.includes(t))return;let s=[`[${Sk}]`];e&&s.push(`[${e}]`),Ww[t](`${s.join("")}:`,...i||[])}r(Hs,"doLog");var Ek=r((t,...e)=>{Gw.has(t)||(Hs(ft.WARNING,t,e),Gw.add(t))},"warnOnce"),Gt=r((t,...e)=>Hs(ft.WARNING,t,e),"warn"),kk=r((t,...e)=>Hs(ft.ERROR,t,e),"error"),Ck=r((t,...e)=>Hs(ft.INFO,t,e),"info"),Pk=r((t,...e)=>Hs(ft.DEBUG,t,e),"debug");function Nk(...t){jw=t}r(Nk,"setLevel");var zb,Hw,fe,Q,kt,jt,Hi,$w=Symbol("ObservedArray.isObserved"),n=class{constructor(){zb.add(this),this.type=this.constructor.type}is(...e){return e.some(i=>u(this,zb,"m",Hw).call(this,i))}as(...e){if(!this.is(...e))throw new ze(`Cannot cast ${this.type} to one of ${e.map(i=>i.type).join(", ")}`);return this}hasKey(e){return Reflect.has(this,e)}key(e){if(!this.hasKey(e))throw new ze(`Missing key ${e}`);return new $i(this[e])}};r(n,"YTNode");zb=new WeakSet,Hw=r(function(e){return this.type===e.type},"_YTNode_is");n.type="YTNode";var Ak="Maybe",$i=class{constructor(e){fe.add(this),Q.set(this,void 0),I(this,Q,e,"f")}get typeof(){return typeof u(this,Q,"f")}string(){return u(this,fe,"m",jt).call(this,"string")}isString(){return u(this,fe,"m",kt).call(this,"string")}number(){return u(this,fe,"m",jt).call(this,"number")}isNumber(){return u(this,fe,"m",kt).call(this,"number")}bigint(){return u(this,fe,"m",jt).call(this,"bigint")}isBigint(){return u(this,fe,"m",kt).call(this,"bigint")}boolean(){return u(this,fe,"m",jt).call(this,"boolean")}isBoolean(){return u(this,fe,"m",kt).call(this,"boolean")}symbol(){return u(this,fe,"m",jt).call(this,"symbol")}isSymbol(){return u(this,fe,"m",kt).call(this,"symbol")}undefined(){return u(this,fe,"m",jt).call(this,"undefined")}isUndefined(){return u(this,fe,"m",kt).call(this,"undefined")}null(){if(u(this,Q,"f")!==null)throw new TypeError(`Expected null, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isNull(){return u(this,Q,"f")===null}object(){return u(this,fe,"m",jt).call(this,"object")}isObject(){return u(this,fe,"m",kt).call(this,"object")}function(){return u(this,fe,"m",jt).call(this,"function")}isFunction(){return u(this,fe,"m",kt).call(this,"function")}array(){if(!Array.isArray(u(this,Q,"f")))throw new TypeError(`Expected array, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}arrayOfMaybe(){let e=[];return new Proxy(this.array(),{get(i,s){return Reflect.has(e,s)?Reflect.get(i,s):new $i(Reflect.get(i,s))}})}isArray(){return Array.isArray(u(this,Q,"f"))}node(){if(!(u(this,Q,"f")instanceof n))throw new TypeError(`Expected YTNode, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isNode(){return u(this,Q,"f")instanceof n}nodeOfType(...e){return this.node().as(...e)}isNodeOfType(...e){return this.isNode()&&this.node().is(...e)}observed(){if(!this.isObserved())throw new TypeError(`Expected ObservedArray, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isObserved(){var e;return(e=u(this,Q,"f"))==null?void 0:e[$w]}parsed(){if(!(u(this,Q,"f")instanceof Ct))throw new TypeError(`Expected SuperParsedResult, got ${typeof u(this,Q,"f")}`);return u(this,Q,"f")}isParsed(){return u(this,Q,"f")instanceof Ct}any(){return Gt(Ak,"This call is not meant to be used outside of debugging. Please use the specific type getter instead."),u(this,Q,"f")}instanceof(e){if(!this.isInstanceof(e))throw new TypeError(`Expected instance of ${e.name}, got ${u(this,Q,"f").constructor.name}`);return u(this,Q,"f")}isInstanceof(e){return u(this,Q,"f")instanceof e}};r($i,"Maybe");Q=new WeakMap,fe=new WeakSet,kt=r(function(e){return typeof u(this,Q,"f")===e},"_Maybe_checkPrimitive"),jt=r(function(e){if(!u(this,fe,"m",kt).call(this,e))throw new TypeError(`Expected ${e}, got ${this.typeof}`);return u(this,Q,"f")},"_Maybe_assertPrimitive");var Ct=class{constructor(e){Hi.set(this,void 0),I(this,Hi,e,"f")}get is_null(){return u(this,Hi,"f")===null}get is_array(){return!this.is_null&&Array.isArray(u(this,Hi,"f"))}get is_node(){return!this.is_array}array(){if(!this.is_array)throw new TypeError("Expected an array, got a node");return u(this,Hi,"f")}item(){if(!this.is_node)throw new TypeError("Expected a node, got an array");return u(this,Hi,"f")}};r(Ct,"SuperParsedResult");Hi=new WeakMap;function G(t){return new Proxy(t,{get(e,i){return i=="get"?(s,o)=>e.find((p,c)=>{let f=md(s,p);return f&&o&&e.splice(c,1),f}):i==$w?!0:i=="getAll"?(s,o)=>e.filter((p,c)=>{let f=md(s,p);return f&&o&&e.splice(c,1),f}):i=="matchCondition"?s=>e.find(o=>s(o)):i=="filterType"?(...s)=>G(e.filter(o=>!!o.is(...s))):i=="firstOfType"?(...s)=>e.find(o=>!!o.is(...s)):i=="first"?()=>e[0]:i=="as"?(...s)=>G(e.map(o=>{if(o.is(...s))return o;throw new ze(`Expected node of any type ${s.map(p=>p.type).join(", ")}, got ${o.type}`)})):i=="remove"?s=>e.splice(s,1):Reflect.get(e,i)}})}r(G,"observe");var li=class extends Map{getType(...e){return e=e.flat(),G(e.flatMap(i=>this.get(i.type)||[]))}};r(li,"Memo");var iw={};qe(iw,{Author:()=>P,ChildElement:()=>mx,EmojiRun:()=>hi,Format:()=>cb,Text:()=>a,TextRun:()=>di,Thumbnail:()=>y,VideoDetails:()=>Ri});var ne={};qe(ne,{CLIENTS:()=>V,INNERTUBE_HEADERS_BASE:()=>Mk,OAUTH:()=>Rk,STREAM_HEADERS:()=>Ht,SUPPORTED_CLIENTS:()=>hd,URLS:()=>Ve});var Ve=Object.freeze({YT_BASE:"https://www.youtube.com",YT_MUSIC_BASE:"https://music.youtube.com",YT_SUGGESTIONS:"https://suggestqueries.google.com/complete/",YT_UPLOAD:"https://upload.youtube.com/",API:Object.freeze({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/"}),Rk=Object.freeze({REGEX:Object.freeze({TV_SCRIPT:new RegExp(']*><\\/script>'),CLIENT_IDENTITY:new RegExp('clientId:"(?[^"]+)",[^"]*?:"(?[^"]+)"')})}),V=Object.freeze({IOS:{NAME_ID:"5",NAME:"iOS",VERSION:"18.06.35",USER_AGENT:"com.google.ios.youtube/18.06.35 (iPhone; CPU iPhone OS 14_4 like Mac OS X; en_US)",DEVICE_MODEL:"iPhone10,6"},WEB:{NAME_ID:"1",NAME:"WEB",VERSION:"2.20241121.01.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},MWEB:{NAME_ID:"2",NAME:"MWEB",VERSION:"2.20241205.01.00",API_VERSION:"v1"},WEB_KIDS:{NAME_ID:"76",NAME:"WEB_KIDS",VERSION:"2.20230111.00.00"},YTMUSIC:{NAME_ID:"67",NAME:"WEB_REMIX",VERSION:"1.20211213.00.00"},ANDROID:{NAME_ID:"3",NAME:"ANDROID",VERSION:"19.35.36",SDK_VERSION:33,USER_AGENT:"com.google.android.youtube/19.35.36(Linux; U; Android 13; en_US; SM-S908E Build/TP1A.220624.014) gzip"},YTSTUDIO_ANDROID:{NAME_ID:"14",NAME:"ANDROID_CREATOR",VERSION:"22.43.101"},YTMUSIC_ANDROID:{NAME_ID:"21",NAME:"ANDROID_MUSIC",VERSION:"5.34.51"},TV:{NAME_ID:"7",NAME:"TVHTML5",VERSION:"7.20241016.15.00",USER_AGENT:"Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version"},TV_EMBEDDED:{NAME_ID:"85",NAME:"TVHTML5_SIMPLY_EMBEDDED_PLAYER",VERSION:"2.0"},WEB_EMBEDDED:{NAME_ID:"56",NAME:"WEB_EMBEDDED_PLAYER",VERSION:"2.20240111.09.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"},WEB_CREATOR:{NAME_ID:"62",NAME:"WEB_CREATOR",VERSION:"1.20240918.03.00",API_KEY:"AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",API_VERSION:"v1",STATIC_VISITOR_ID:"6zpwvWUNAco"}}),Ht=Object.freeze({accept:"*/*",origin:"https://www.youtube.com",referer:"https://www.youtube.com",DNT:"?1"}),Mk=Object.freeze({accept:"*/*","accept-encoding":"gzip, deflate","content-type":"application/json"}),hd=["IOS","WEB","MWEB","YTKIDS","YTMUSIC","ANDROID","YTSTUDIO_ANDROID","YTMUSIC_ANDROID","TV","TV_EMBEDDED","WEB_EMBEDDED","WEB_CREATOR"];var l={};qe(l,{addRuntimeParser:()=>jg,applyCommentsMutations:()=>dE,applyMutations:()=>hE,getDynamicParsers:()=>Y1,getParserByName:()=>ds,hasParser:()=>Wh,parse:()=>Me,parseActions:()=>mE,parseArray:()=>Ee,parseC:()=>fE,parseCommand:()=>uE,parseCommands:()=>W1,parseFormats:()=>Kg,parseItem:()=>q,parseLC:()=>$g,parseRR:()=>ub,parseResponse:()=>Hg,sanitizeClassName:()=>_s,setParserErrorHandler:()=>D1,shouldIgnore:()=>zg});var cr={};qe(cr,{AboutChannel:()=>Cd,AboutChannelView:()=>kd,AccountChannel:()=>Pd,AccountItem:()=>Nd,AccountItemSection:()=>Rd,AccountItemSectionHeader:()=>Ad,AccountSectionList:()=>Md,ActiveAccountHeader:()=>OT,AddBannerToLiveChatCommand:()=>dv,AddChatItemAction:()=>Vx,AddLiveChatTickerItemAction:()=>_v,AddToPlaylist:()=>DT,AddToPlaylistCommand:()=>i0,AddToPlaylistEndpoint:()=>E0,AddToPlaylistServiceEndpoint:()=>dx,Alert:()=>Lr,AlertWithButton:()=>jd,AnchoredSection:()=>rb,AppendContinuationItemsAction:()=>Xi,AttributionView:()=>Hd,AudioOnlyPlayability:()=>$d,AuthorCommentBadge:()=>p0,AutomixPreviewVideo:()=>Kd,AvatarView:()=>qd,BackgroundPromo:()=>BT,BackstageImage:()=>zd,BackstagePost:()=>xi,BackstagePostThread:()=>YT,BadgeView:()=>yi,BrowseEndpoint:()=>k0,BrowseFeedActions:()=>i_,BrowserMediaSession:()=>VT,Button:()=>v,ButtonCardView:()=>UT,ButtonView:()=>te,C4TabbedHeader:()=>jr,CallToActionButton:()=>FT,Card:()=>WT,CardCollection:()=>N_,CarouselHeader:()=>A_,CarouselItem:()=>GT,CarouselItemView:()=>M_,CarouselLockup:()=>I_,CarouselTitleView:()=>L_,ChangeEngagementPanelVisibilityAction:()=>CT,Channel:()=>O_,ChannelAboutFullMetadata:()=>fa,ChannelAgeGate:()=>jT,ChannelExternalLinkView:()=>Ed,ChannelFeaturedContent:()=>HT,ChannelHeaderLinks:()=>r_,ChannelHeaderLinksView:()=>s_,ChannelMetadata:()=>D_,ChannelMobileHeader:()=>$T,ChannelOptions:()=>B_,ChannelOwnerEmptyState:()=>KT,ChannelSubMenu:()=>ga,ChannelSwitcherHeader:()=>qT,ChannelSwitcherPage:()=>Od,ChannelTagline:()=>C_,ChannelThumbnailWithLink:()=>zT,ChannelVideoPlayer:()=>QT,Chapter:()=>Y_,ChildVideo:()=>XT,ChipBarView:()=>JT,ChipCloud:()=>Hr,ChipCloudChip:()=>We,ChipView:()=>V_,ClientSideToggleMenuItem:()=>ZT,ClipAdState:()=>a_,ClipCreation:()=>p_,ClipCreationScrubber:()=>n_,ClipCreationTextInput:()=>o_,ClipSection:()=>l_,CollaboratorInfoCardContent:()=>e0,CollageHeroImage:()=>t0,CollectionThumbnailView:()=>j_,CommandExecutorCommand:()=>r0,CommentActionButtons:()=>Xd,CommentDialog:()=>l0,CommentReplies:()=>K_,CommentReplyDialog:()=>q_,CommentSimplebox:()=>J_,CommentThread:()=>ex,CommentView:()=>ir,CommentsEntryPointHeader:()=>X_,CommentsEntryPointTeaser:()=>Q_,CommentsHeader:()=>vi,CommentsSimplebox:()=>z_,CompactChannel:()=>f0,CompactLink:()=>_i,CompactMix:()=>m0,CompactMovie:()=>h0,CompactPlaylist:()=>d0,CompactStation:()=>_0,CompactVideo:()=>Fr,ConfirmDialog:()=>x0,ContentMetadataView:()=>qr,ContentPreviewImageView:()=>er,ContinuationCommand:()=>s0,ContinuationItem:()=>X,ConversationBar:()=>y0,CopyLink:()=>zr,CreateCommentEndpoint:()=>C0,CreatePlaylistDialog:()=>vd,CreatePlaylistDialogFormView:()=>rx,CreatePlaylistServiceEndpoint:()=>P0,CreatorHeart:()=>Qd,DecoratedAvatarView:()=>Qr,DecoratedPlayerBar:()=>ax,DefaultPromoPanel:()=>b0,DeletePlaylistEndpoint:()=>N0,DescriptionPreviewView:()=>px,DialogHeaderView:()=>lx,DialogView:()=>g0,DidYouMean:()=>w0,DimChatItemAction:()=>xv,DislikeButtonView:()=>Zd,DownloadButton:()=>Or,Dropdown:()=>fi,DropdownItem:()=>Td,DropdownView:()=>tx,DynamicTextView:()=>fx,Element:()=>hx,EmergencyOnebox:()=>T0,EmojiPicker:()=>$_,EmojiPickerCategory:()=>v0,EmojiPickerCategoryButton:()=>I0,EmojiPickerUpsellCategory:()=>S0,EndScreenPlaylist:()=>yx,EndScreenVideo:()=>bx,Endscreen:()=>xx,EndscreenElement:()=>z0,EngagementPanelSectionList:()=>Ti,EngagementPanelTitleHeader:()=>c_,EomSettingsDisclaimer:()=>Q0,ExpandableMetadata:()=>x_,ExpandableTab:()=>Jr,ExpandableVideoDescriptionBody:()=>h_,ExpandedShelfContents:()=>X0,Factoid:()=>wi,FancyDismissibleDialog:()=>J0,FeedFilterChipBar:()=>wt,FeedNudge:()=>Z0,FeedTabbedHeader:()=>gx,FeedbackEndpoint:()=>A0,FlexibleActionsView:()=>Br,FormFooterView:()=>ux,GameCard:()=>d_,GameDetails:()=>ev,GetAccountsListInnertubeEndpoint:()=>R0,GetKidsBlocklistPickerCommand:()=>o0,GetMultiPageMenuAction:()=>PT,Grid:()=>tv,GridChannel:()=>wx,GridHeader:()=>iv,GridMix:()=>rv,GridMovie:()=>sv,GridPlaylist:()=>Tx,GridShow:()=>ov,GridVideo:()=>Sx,GuideCollapsibleEntry:()=>nv,GuideCollapsibleSectionEntry:()=>av,GuideDownloadsEntry:()=>pv,GuideEntry:()=>lr,GuideSection:()=>Zr,GuideSubscriptionsSection:()=>Ex,HashtagHeader:()=>kx,HashtagTile:()=>lv,HeatMarker:()=>sx,Heatmap:()=>ox,HeroPlaylistThumbnail:()=>cv,HideEngagementPanelEndpoint:()=>M0,HighlightsCarousel:()=>uv,HistorySuggestion:()=>fv,HorizontalCardList:()=>bi,HorizontalList:()=>__,HorizontalMovieList:()=>mv,IconLink:()=>Px,ImageBannerView:()=>Nx,IncludingResultsFor:()=>hv,InfoPanelContainer:()=>Rx,InfoPanelContent:()=>Ax,InfoRow:()=>v_,InteractiveTabbedHeader:()=>Mx,ItemSection:()=>Tt,ItemSectionHeader:()=>es,ItemSectionTab:()=>Lx,ItemSectionTabbedHeader:()=>ts,KidsBlocklistPicker:()=>XS,KidsBlocklistPickerItem:()=>sb,KidsCategoriesHeader:()=>JS,KidsCategoryTab:()=>ob,KidsHomeScreen:()=>ZS,LikeButton:()=>Dr,LikeButtonView:()=>Jd,LikeEndpoint:()=>L0,LiveChat:()=>Dx,LiveChatActionPanel:()=>Gx,LiveChatAuthorBadge:()=>Ux,LiveChatAutoModMessage:()=>yv,LiveChatBanner:()=>Yx,LiveChatBannerChatSummary:()=>bv,LiveChatBannerHeader:()=>Bx,LiveChatBannerPoll:()=>gv,LiveChatBannerRedirect:()=>wv,LiveChatDialog:()=>Kv,LiveChatHeader:()=>zx,LiveChatItemContextMenuEndpoint:()=>O0,LiveChatItemList:()=>Qx,LiveChatMembershipItem:()=>Tv,LiveChatMessageInput:()=>qv,LiveChatModeChangeMessage:()=>vv,LiveChatPaidMessage:()=>Iv,LiveChatPaidSticker:()=>Sv,LiveChatParticipant:()=>Xx,LiveChatParticipantsList:()=>Jx,LiveChatPlaceholderItem:()=>Ev,LiveChatProductItem:()=>kv,LiveChatRestrictedParticipation:()=>Cv,LiveChatSponsorshipsGiftPurchaseAnnouncement:()=>Pv,LiveChatSponsorshipsGiftRedemptionAnnouncement:()=>Nv,LiveChatSponsorshipsHeader:()=>Fx,LiveChatTextMessage:()=>Av,LiveChatTickerPaidMessageItem:()=>Wx,LiveChatTickerPaidStickerItem:()=>Rv,LiveChatTickerSponsorItem:()=>Mv,LiveChatViewerEngagementMessage:()=>Lv,LockupMetadataView:()=>Zx,LockupView:()=>ey,MacroMarkersInfoItem:()=>u_,MacroMarkersList:()=>f_,MacroMarkersListItem:()=>Vr,MarkChatItemAsDeletedAction:()=>Dv,MarkChatItemsByAuthorAsDeletedAction:()=>Bv,Menu:()=>R,MenuFlexibleItem:()=>t_,MenuNavigationItem:()=>ty,MenuPopup:()=>zv,MenuServiceItem:()=>Pt,MenuServiceItemDownload:()=>e_,MenuTitle:()=>Wd,MerchandiseItem:()=>Xv,MerchandiseShelf:()=>oy,Message:()=>Si,MetadataBadge:()=>Fe,MetadataRow:()=>Jv,MetadataRowContainer:()=>ny,MetadataRowHeader:()=>Zv,MetadataScreen:()=>eI,MicroformatData:()=>Ei,Mix:()=>tI,MobileTopbar:()=>AI,ModalWithTitleAndButton:()=>iI,ModifyChannelNotificationPreferenceEndpoint:()=>D0,Movie:()=>rI,MovingThumbnail:()=>sI,MultiMarkersPlayerBar:()=>nx,MultiPageMenu:()=>Ld,MultiPageMenuNotificationSection:()=>Qv,MultiPageMenuSection:()=>RI,MusicCardShelf:()=>oI,MusicCardShelfHeaderBasic:()=>ay,MusicCarouselShelf:()=>dI,MusicCarouselShelfBasicHeader:()=>py,MusicDescriptionShelf:()=>hy,MusicDetailHeader:()=>_I,MusicDownloadStateBadge:()=>xI,MusicEditablePlaylistDetailHeader:()=>yI,MusicElementHeader:()=>bI,MusicHeader:()=>gI,MusicImmersiveHeader:()=>wI,MusicInlineBadge:()=>rs,MusicItemThumbnailOverlay:()=>At,MusicLargeCardItemCarousel:()=>TI,MusicMenuItemDivider:()=>iy,MusicMultiRowListItem:()=>ly,MusicMultiSelectMenu:()=>ry,MusicMultiSelectMenuItem:()=>is,MusicNavigationButton:()=>cy,MusicPlayButton:()=>ss,MusicPlaylistEditHeader:()=>vI,MusicPlaylistShelf:()=>II,MusicQueue:()=>xy,MusicResponsiveHeader:()=>SI,MusicResponsiveListItem:()=>ki,MusicResponsiveListItemFixedColumn:()=>uy,MusicResponsiveListItemFlexColumn:()=>fy,MusicShelf:()=>EI,MusicSideAlignedItem:()=>kI,MusicSortFilterButton:()=>CI,MusicTastebuilderShelf:()=>PI,MusicTastebuilderShelfThumbnail:()=>yy,MusicThumbnail:()=>ve,MusicTwoRowItem:()=>my,MusicVisualHeader:()=>NI,NavigationEndpoint:()=>h,Notification:()=>by,NotificationAction:()=>DI,OpenPopupAction:()=>wd,PageHeader:()=>Rt,PageHeaderView:()=>gy,PageIntroduction:()=>wy,PanelFooterView:()=>cx,PdgCommentChip:()=>c0,PerformCommentActionEndpoint:()=>B0,PivotBar:()=>MI,PivotBarItem:()=>LI,PivotButton:()=>Ty,PlayerAnnotationsExpanded:()=>vy,PlayerCaptionsTracklist:()=>Iy,PlayerControlsOverlay:()=>BI,PlayerErrorMessage:()=>YI,PlayerLegacyDesktopYpcOffer:()=>VI,PlayerLegacyDesktopYpcTrailer:()=>Ef,PlayerLiveStoryboardSpec:()=>ky,PlayerMicroformat:()=>Je,PlayerOverflow:()=>Sy,PlayerOverlay:()=>Ay,PlayerOverlayAutoplay:()=>Cy,PlayerOverlayVideoDetails:()=>Py,PlayerStoryboardSpec:()=>qi,Playlist:()=>Nt,PlaylistAddToOption:()=>Gd,PlaylistCustomThumbnail:()=>$r,PlaylistEditEndpoint:()=>Y0,PlaylistHeader:()=>Ry,PlaylistInfoCardContent:()=>UI,PlaylistMetadata:()=>My,PlaylistPanel:()=>_y,PlaylistPanelVideo:()=>Jt,PlaylistPanelVideoWrapper:()=>dy,PlaylistSidebar:()=>FI,PlaylistSidebarPrimaryInfo:()=>Ly,PlaylistSidebarSecondaryInfo:()=>Oy,PlaylistThumbnailOverlay:()=>WI,PlaylistVideo:()=>ns,PlaylistVideoList:()=>GI,PlaylistVideoThumbnail:()=>Kr,Poll:()=>jI,PollHeader:()=>Ov,Post:()=>as,PostMultiImage:()=>HI,PrefetchWatchCommand:()=>V0,PremiereTrailerBadge:()=>$I,ProductList:()=>m_,ProductListHeader:()=>KI,ProductListItem:()=>qI,ProfileColumn:()=>zI,ProfileColumnStats:()=>QI,ProfileColumnStatsEntry:()=>XI,ProfileColumnUserInfo:()=>JI,Quiz:()=>ZI,RecognitionShelf:()=>eS,ReelItem:()=>ps,ReelPlayerHeader:()=>Dy,ReelPlayerOverlay:()=>tS,ReelShelf:()=>Gr,ReelWatchEndpoint:()=>U0,RelatedChipCloud:()=>By,RemoveBannerForLiveChatCommand:()=>Yv,RemoveChatItemAction:()=>Vv,RemoveChatItemByAuthorAction:()=>Uv,ReplaceChatItemAction:()=>Fv,ReplayChatItemAction:()=>Wv,RichGrid:()=>Ci,RichItem:()=>iS,RichListHeader:()=>rS,RichMetadata:()=>pm,RichMetadataRow:()=>cm,RichSection:()=>sS,RichShelf:()=>Yy,RunAttestationCommand:()=>n0,SearchBox:()=>oS,SearchEndpoint:()=>F0,SearchFilter:()=>Vy,SearchFilterGroup:()=>ls,SearchFilterOptionsDialog:()=>nS,SearchHeader:()=>Uy,SearchRefinementCard:()=>Ji,SearchSubMenu:()=>Fy,SearchSuggestion:()=>Cx,SearchSuggestionsSection:()=>aS,SecondarySearchContainer:()=>pS,SectionList:()=>de,SegmentedLikeDislikeButton:()=>fr,SegmentedLikeDislikeButtonView:()=>qt,SendFeedbackAction:()=>NT,SettingBoolean:()=>lS,SettingsCheckbox:()=>Wy,SettingsOptions:()=>us,SettingsSidebar:()=>Gy,SettingsSwitch:()=>cs,ShareEndpoint:()=>W0,ShareEntityEndpoint:()=>G0,ShareEntityServiceEndpoint:()=>Xr,SharePanelHeader:()=>Hy,SharePanelTitleV15:()=>cS,ShareTarget:()=>$y,SharedPost:()=>jy,Shelf:()=>fs,ShortsLockupView:()=>ms,ShowCustomThumbnail:()=>vx,ShowDialogCommand:()=>a0,ShowEngagementPanelEndpoint:()=>j0,ShowLiveChatActionPanelAction:()=>Gv,ShowLiveChatDialogAction:()=>jv,ShowLiveChatTooltipCommand:()=>Hv,ShowingResultsFor:()=>uS,SignalAction:()=>AT,SignalServiceEndpoint:()=>H0,SimpleCardContent:()=>fS,SimpleCardTeaser:()=>mS,SimpleMenuHeader:()=>sy,SimpleTextSection:()=>hS,SingleActionEmergencySupport:()=>dS,SingleColumnBrowseResults:()=>_S,SingleColumnMusicWatchNextResults:()=>xS,SingleHeroImage:()=>yS,SlimOwner:()=>bS,SlimVideoMetadata:()=>gS,SortFilterHeader:()=>Ox,SortFilterSubMenu:()=>dt,SponsorCommentBadge:()=>u0,StartAt:()=>Ky,StructuredDescriptionContent:()=>tr,StructuredDescriptionPlaylistLockup:()=>S_,SubFeedOption:()=>qy,SubFeedSelector:()=>wS,SubscribeButton:()=>xe,SubscribeEndpoint:()=>$0,SubscriptionNotificationToggleButton:()=>P_,Tab:()=>Ie,Tabbed:()=>TS,TabbedSearchResults:()=>vS,TextCarouselItemView:()=>R_,TextFieldView:()=>ix,TextHeader:()=>IS,ThirdPartyShareTargetSection:()=>zy,ThumbnailBadgeView:()=>F_,ThumbnailHoverOverlayView:()=>U_,ThumbnailLandscapePortrait:()=>SS,ThumbnailOverlayBadgeView:()=>W_,ThumbnailOverlayBottomPanel:()=>Ix,ThumbnailOverlayEndorsement:()=>ES,ThumbnailOverlayHoverText:()=>kS,ThumbnailOverlayInlineUnplayable:()=>CS,ThumbnailOverlayLoadingPreview:()=>PS,ThumbnailOverlayNowPlaying:()=>NS,ThumbnailOverlayPinking:()=>AS,ThumbnailOverlayPlaybackStatus:()=>RS,ThumbnailOverlayResumePlayback:()=>MS,ThumbnailOverlaySidePanel:()=>LS,ThumbnailOverlayTimeStatus:()=>Zi,ThumbnailOverlayToggleButton:()=>OS,ThumbnailView:()=>G_,TimedMarkerDecoration:()=>DS,TitleAndButtonListHeader:()=>BS,ToggleButton:()=>se,ToggleButtonView:()=>_t,ToggleMenuServiceItem:()=>YS,Tooltip:()=>VS,TopbarMenuButton:()=>OI,TopicChannelDetails:()=>US,Transcript:()=>Mr,TranscriptFooter:()=>Dd,TranscriptSearchBox:()=>Bd,TranscriptSearchPanel:()=>Fd,TranscriptSectionHeader:()=>Yd,TranscriptSegment:()=>Vd,TranscriptSegmentList:()=>Ud,TwoColumnBrowseResults:()=>Mt,TwoColumnSearchResults:()=>Qy,TwoColumnWatchNextResults:()=>Jy,UnifiedSharePanel:()=>FS,UniversalWatchCard:()=>Zy,UnsubscribeEndpoint:()=>K0,UpdateChannelSwitcherPageAction:()=>RT,UpdateDateTextAction:()=>jx,UpdateDescriptionAction:()=>Hx,UpdateEngagementPanelAction:()=>MT,UpdateLiveChatPollAction:()=>$v,UpdateSubscribeButtonAction:()=>LT,UpdateTitleAction:()=>$x,UpdateToggleButtonTextAction:()=>Kx,UpdateViewershipAction:()=>qx,UploadTimeFactoid:()=>b_,UpsellDialog:()=>WS,VerticalList:()=>GS,VerticalWatchCardList:()=>jS,Video:()=>Ur,VideoAttributeView:()=>gi,VideoAttributesSectionView:()=>k_,VideoCard:()=>y_,VideoDescriptionCourseSection:()=>E_,VideoDescriptionHeader:()=>w_,VideoDescriptionInfocardsSection:()=>T_,VideoDescriptionMusicSection:()=>Wr,VideoDescriptionTranscriptSection:()=>Hn,VideoInfoCardContent:()=>HS,VideoMetadataCarouselView:()=>$S,VideoOwner:()=>hs,VideoPrimaryInfo:()=>tb,VideoSecondaryInfo:()=>kh,VideoViewCount:()=>eb,ViewCountFactoid:()=>g_,WatchCardCompactVideo:()=>ib,WatchCardHeroVideo:()=>KS,WatchCardRichHeader:()=>qS,WatchCardSectionSequence:()=>zS,WatchEndpoint:()=>_x,WatchNextEndScreen:()=>Ny,WatchNextEndpoint:()=>q0,WatchNextTabbedResults:()=>QS,YpcTrailer:()=>Ey});var Ki,dd=class{constructor(e,i){Ki.set(this,void 0),I(this,Ki,new L.shim.Cache(e,i),"f")}get cache_dir(){return u(this,Ki,"f").cache_dir}get(e){return u(this,Ki,"f").get(e)}set(e,i){return u(this,Ki,"f").set(e,i)}remove(e){return u(this,Ki,"f").remove(e)}};r(dd,"UniversalCache");Ki=new WeakMap;var Lk=dd;var Rr,_d=class extends EventTarget{constructor(){super(),Rr.set(this,new Map)}emit(e,...i){let s=new L.shim.CustomEvent(e,{detail:i});this.dispatchEvent(s)}on(e,i){let s=r(o=>{o instanceof L.shim.CustomEvent?i(...o.detail):i(o)},"wrapper");u(this,Rr,"f").set(i,s),this.addEventListener(e,s)}once(e,i){let s=r(o=>{o instanceof L.shim.CustomEvent?i(...o.detail):i(o),this.off(e,i)},"wrapper");u(this,Rr,"f").set(i,s),this.addEventListener(e,s)}off(e,i){let s=u(this,Rr,"f").get(i);s&&(this.removeEventListener(e,s),u(this,Rr,"f").delete(i))}};r(_d,"EventEmitterLike");Rr=new WeakMap;var $s=_d;var zi={};qe(zi,{chooseFormat:()=>sT,download:()=>n1,toDash:()=>rT});var Ok={"&":"&",'"':""","'":"'","<":"<",">":">"};function Kw(t){return t.replace(/([&"<>'])/g,(e,i)=>Ok[i])}r(Kw,"escapeXMLString");function Dk(t){return t==="mpd"?"MPD":t==="base-url"?"BaseURL":t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join("")}r(Dk,"normalizeTag");function H(t,e,...i){let s=i.flat().map(o=>typeof o=="string"?Bk(o):o);return typeof t=="function"?t({...e,children:s}):{type:Dk(t),props:{...e,children:s}}}r(H,"createElement");function Bk(t){return{type:"TEXT_ELEMENT",props:{nodeValue:t}}}r(Bk,"createTextElement");async function qw(t){if(t.type==="TEXT_ELEMENT")return Kw(typeof t.props.nodeValue=="string"?t.props.nodeValue:"");let e=`<${t.type}`;if(t.props){let i=Object.keys(t.props).filter(s=>!["children","nodeValue"].includes(s)&&t.props[s]!==void 0).map(s=>`${s}="${Kw(`${t.props[s]}`)}"`);i.length>0&&(e+=` ${i.join(" ")}`)}if(t.props.children){let i=await Promise.all((await Promise.all(t.props.children.flat())).flat().filter(s=>!!s).map(s=>qw(s)));if(i.length>0)return e+=`>${i.join("")}`,e}return`${e}/>`}r(qw,"renderElementToString");async function zw(t){return`${await qw(await t)}`}r(zw,"renderToString");function Qw(t){return t.children}r(Qw,"Fragment");var Ks=class extends n{constructor(e){super();let i=e.spec.split("|"),s=new URL(i.shift());this.boards=i.map((o,p)=>{let[c,f,m,x,_,b,T,w]=o.split("#");s.searchParams.set("sigh",w);let S=Math.ceil(parseInt(m,10)/(parseInt(x,10)*parseInt(_,10)));return{type:"vod",template_url:s.toString().replace("$L",p).replace("$N",T),thumbnail_width:parseInt(c,10),thumbnail_height:parseInt(f,10),thumbnail_count:parseInt(m,10),interval:parseInt(b,10),columns:parseInt(x,10),rows:parseInt(_,10),storyboard_count:S}})}};r(Ks,"PlayerStoryboardSpec");Ks.type="PlayerStoryboardSpec";var qi=Ks;var Vk="StreamingInfo";function Uk(t,e){var o,p,c;let i=new Map,s=t.some(f=>!!f.audio_track);for(let f of t){if((!f.index_range||!f.init_range)&&!f.is_type_otf&&!e)continue;let m=f.mime_type.split(";")[0],x=(o=Ue(f.mime_type,'codecs="','"'))==null?void 0:o.split(".")[0],_=f.color_info?Object.values(f.color_info).join("-"):"",b=((p=f.audio_track)==null?void 0:p.id)||"",T=f.is_drc?"drc":"",w=`${m}-${x}-${_}-${b}-${T}`;i.has(w)||i.set(w,[]),(c=i.get(w))==null||c.push(f)}return{groups:Array.from(i.values()),has_multiple_audio_tracks:s}}r(Uk,"getFormatGroupings");function Jw(t,e){if(t.length>1&&new Set(t.map(i=>Ue(i.mime_type,'codecs="','"'))).size===1)return e.push("codecs"),Ue(t[0].mime_type,'codecs="','"')}r(Jw,"hoistCodecsIfPossible");function Zw(t,e,i){if(t.length>1&&new Set(t.map(s=>s.fps)).size===1)return i.push(e),Number(t[0][e])}r(Zw,"hoistNumberAttributeIfPossible");function Fk(t,e){if(t.length>1&&new Set(t.map(i=>i.audio_channels||2)).size===1)return e.push("AudioChannelConfiguration"),t[0].audio_channels}r(Fk,"hoistAudioChannelsIfPossible");async function Wk(t,e){var f;let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"GET",headers:Ht,redirect:"follow"}),s=i.url.replace("&rn=0","").replace("&sq=0",""),o=await i.text(),p=(f=Ue(o,"Segment-Durations-Ms:",`\r +`))==null?void 0:f.split(",");if(!p)throw new g("Failed to extract the segment durations from this OTF stream",{url:t});let c=[];for(let m of p){let x=m.trim();if(x.length===0)continue;let _,b=Ue(x,"(r=",")");b&&(_=parseInt(b)),c.push({duration:parseInt(x),repeat_count:_})}return{init_url:`${s}&sq=0`,media_url:`${s}&sq=$Number$`,timeline:c}}r(Wk,"getOTFSegmentTemplate");async function eT(t,e){let i=await e.session.http.fetch_function(`${t}&rn=0&sq=0`,{method:"HEAD",headers:Ht,redirect:"follow"}),s=parseInt(i.headers.get("X-Head-Time-Millis")||""),o=parseInt(i.headers.get("X-Head-Seqnum")||"");if(isNaN(s)||isNaN(o))throw new g("Failed to extract the duration or segment count for this Post Live DVR video");return{duration:s/1e3,segment_count:o}}r(eT,"getPostLiveDvrInfo");async function Gk(t,e,i,s,o,p){if(!t.item){let c=new URL(await e.decipher(o));c.searchParams.set("cpn",p||"");let f=i(c).toString();t.item=await eT(f,s)}return t.item.duration}r(Gk,"getPostLiveDvrDuration");async function tT(t,e,i,s,o,p){let c=new URL(await t.decipher(s));c.searchParams.set("cpn",o||"");let f=e(c).toString();if(t.is_type_otf){if(!i)throw new g("Unable to get segment durations for this OTF stream without an Actions instance",{format:t});return{is_oft:!0,is_post_live_dvr:!1,getSegmentTemplate(){return Wk(f,i)}}}if(p){if(!i)throw new g("Unable to get segment count for this Post Live DVR video without an Actions instance",{format:t});let x=t.target_duration_dec;if(typeof x!="number")throw new g("Format is missing target_duration_dec",{format:t});return{is_oft:!1,is_post_live_dvr:!0,async getSegmentTemplate(){return p.item||(p.item=await eT(f,i)),{media_url:`${f}&sq=$Number$`,timeline:[{duration:x*1e3,repeat_count:p.item.segment_count}]}}}}if(!t.index_range||!t.init_range)throw new g("Index and init ranges not available",{format:t});return{is_oft:!1,is_post_live_dvr:!1,base_url:f,index_range:t.index_range,init_range:t.init_range}}r(tT,"getSegmentInfo");async function jk(t,e,i,s,o,p,c){new URL(await t.decipher(o)).searchParams.set("cpn",p||"");let m=[t.itag.toString()];return t.audio_track&&m.push(t.audio_track.id),t.is_drc&&m.push("drc"),{uid:m.join("-"),bitrate:t.bitrate,codecs:e.includes("codecs")?void 0:Ue(t.mime_type,'codecs="','"'),audio_sample_rate:e.includes("audio_sample_rate")?void 0:t.audio_sample_rate,channels:e.includes("AudioChannelConfiguration")?void 0:t.audio_channels||2,segment_info:await tT(t,i,s,o,p,c)}}r(jk,"getAudioRepresentation");function Hk(t,e){if(!t.audio_track&&!e)return;let i=[t.is_original?"main":"alternate"];return(t.is_dubbed||t.is_auto_dubbed)&&i.push("dub"),t.is_descriptive&&i.push("description"),t.is_drc&&i.push("enhanced-audio-intelligibility"),i}r(Hk,"getTrackRoles");async function $k(t,e,i,s,o,p,c){var w;let f=t[0],{audio_track:m}=f,x=[],_=!!c,b;return m?_&&f.is_drc?b=c.label_drc_multiple(m.display_name):b=m.display_name:_&&(b=f.is_drc?c.label_drc:c.label_original),{mime_type:f.mime_type.split(";")[0],language:(w=f.language)!=null?w:void 0,codecs:Jw(t,x),audio_sample_rate:Zw(t,"audio_sample_rate",x),track_name:b,track_roles:Hk(f,_),channels:Fk(t,x),representations:await Promise.all(t.map(S=>jk(S,x,e,i,s,o,p)))}}r($k,"getAudioSet");var Kk={BT709:"1",BT2020:"9"},Xw={BT709:"1",BT2020_10:"14",SMPTEST2084:"16",ARIB_STD_B67:"18"},qk={BT709:"1",BT2020_NCL:"14"};function zk(t){var c;let e=t.color_info,i,s,o;if(e){if(e.primaries&&(i=Kk[e.primaries]),e.transfer_characteristics&&(s=Xw[e.transfer_characteristics]),e.matrix_coefficients&&(o=qk[e.matrix_coefficients],!o)){let f=new URL(t.url),m=JSON.parse(JSON.stringify(t));m.url="REDACTED",m.signature_cipher="REDACTED",m.cipher="REDACTED",Gt(Vk,`Unknown matrix coefficients "${e.matrix_coefficients}". The DASH manifest is still usable without this. +Please report it at ${L.shim.info.bugs_url} so we can add support for it. InnerTube client: ${f.searchParams.get("c")} -format:`,m)}}else(l=Ee(t.mime_type,'codecs="','"'))!=null&&l.startsWith("avc1")&&(s=jw.BT709);return{primaries:i,transfer_characteristics:s,matrix_coefficients:o}}r(Bk,"getColorInfo");async function Yk(t,e,i,s,o,a,l){return{uid:t.itag.toString(),bitrate:t.bitrate,width:t.width,height:t.height,codecs:i.includes("codecs")?void 0:Ee(t.mime_type,'codecs="','"'),fps:i.includes("fps")?void 0:t.fps,segment_info:await qw(t,e,o,s,a,l)}}r(Yk,"getVideoRepresentation");async function Vk(t,e,i,s,o,a){let l=t[0],f=Bk(l),m=[];return{mime_type:l.mime_type.split(";")[0],color_info:f,codecs:Hw(t,m),fps:$w(t,"fps",m),representations:await Promise.all(t.map(_=>Yk(_,e,m,i,s,o,a)))}}r(Vk,"getVideoSet");function Uk(t){var s;let e=new Map,i=t.is(Qi)?t.boards:[t.board];for(let o of i){let a=new URL(o.template_url).pathname.split(".").pop(),l=`image/${a==="jpg"?"jpeg":a}`;e.has(l)||e.set(l,[]),(s=e.get(l))==null||s.push(o)}return e}r(Uk,"getStoryboardInfo");async function Fk(t,e,i,s,o){let a=e.template_url,l=i(new URL(a.replace("$M","0"))),f=o.response?o.response:t.session.http.fetch_function(l,{method:"HEAD",headers:Kt});return o.response=f,(await f).headers.get("Content-Type")||s}r(Fk,"getStoryboardMimeType");async function Wk(t,e,i){let s=e.template_url,o=[],a=Math.min(e.type==="vod"?e.storyboard_count:5,10);for(let m=0;m({probable_mime_type:l,getMimeType(){return Fk(e,f[0],s,l,a)},representations:f.map(m=>Gk(t,e,m,s,a))}))}r(jk,"getImageSets");function Hk(t,e,i){let s=e==="vtt"?"text/vtt":"application/ttml+xml";return t.map(o=>{let a=new URL(o.base_url);a.searchParams.set("fmt",e);let l=["caption"];return a.searchParams.has("tlang")&&l.push("dub"),{mime_type:s,language:o.language_code,track_name:o.name.toString(),track_roles:l,representation:{uid:`text-${o.vss_id}`,base_url:i(a).toString()}}})}r(Hk,"getTextSets");async function fd(t,e=!1,i=_=>_,s,o,a,l,f,m,x){if(!t)throw new g("Streaming data not available");let _=s?t.adaptive_formats.filter(Y=>!s(Y)):t.adaptive_formats,b,T;if(e){if(T={},!l)throw new g("Unable to get duration or segment count for this Post Live DVR video without an Actions instance");b=r(()=>T?Ak(T,_[0],i,l,a,o):Promise.resolve(0),"getDuration")}else{let Y=_[0].approx_duration_ms/1e3;b=r(()=>Promise.resolve(Y),"getDuration")}let{groups:w,has_multiple_audio_tracks:S}=Ck(_,e),{video_groups:E,audio_groups:C}=w.reduce((Y,te)=>te[0].has_audio?(S&&!te[0].audio_track||Y.audio_groups.push(te),Y):(Y.video_groups.push(te),Y),{video_groups:[],audio_groups:[]}),k;C.flat().some(Y=>Y.is_drc)&&(k={label_original:(x==null?void 0:x.label_original)||"Original",label_drc:(x==null?void 0:x.label_drc)||"Stable Volume",label_drc_multiple:(x==null?void 0:x.label_drc_multiple)||(Y=>`${Y} (Stable Volume)`)});let U=await Promise.all(C.map(Y=>Lk(Y,i,l,a,o,T,k))),L=await Promise.all(E.map(Y=>Vk(Y,i,a,l,o,T))),K=[];if(f&&l){let Y;if(f.is(Qi))Y=_[0].approx_duration_ms/1e3;else{let te=_[0].target_duration_dec;if(te===void 0)throw new g("Format is missing target_duration_dec",{format:_[0]});Y=te}K=jk(Y,l,f,i)}let re=[];if(m&&(x==null?void 0:x.captions_format)){if(x.captions_format!=="vtt"&&x.captions_format!=="ttml")throw new g("Invalid captions format",x.captions_format);re=Hk(m,x.captions_format,i)}return{getDuration:b,audio_sets:U,video_sets:L,image_sets:K,text_sets:re}}r(fd,"getStreamingInfo");async function $k({info:t}){if(!t.is_oft&&!t.is_post_live_dvr)return null;let e=await t.getSegmentTemplate();return H("segment-template",{startNumber:e.init_url?"1":"0",timescale:"1000",initialization:e.init_url,media:e.media_url},H("segment-timeline",null,e.timeline.map(i=>H("s",{d:i.duration,r:i.repeat_count}))))}r($k,"OTFPostLiveDvrSegmentInfo");function zw({info:t}){return t.is_oft||t.is_post_live_dvr?H($k,{info:t}):H(Gw,null,H("base-url",null,t.base_url),H("segment-base",{indexRange:`${t.index_range.start}-${t.index_range.end}`},H("initialization",{range:`${t.init_range.start}-${t.init_range.end}`})))}r(zw,"SegmentInfo");async function Kk({streamingData:t,isPostLiveDvr:e,transformURL:i,rejectFormat:s,cpn:o,player:a,actions:l,storyboards:f,captionTracks:m,options:x}){let{getDuration:_,audio_sets:b,video_sets:T,image_sets:w,text_sets:S}=await fd(t,e,i,s,o,a,l,f,m,x);return H("mpd",{xmlns:"urn:mpeg:dash:schema:mpd:2011",minBufferTime:"PT1.500S",profiles:"urn:mpeg:dash:profile:isoff-main:2011",type:"static",mediaPresentationDuration:`PT${await _()}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"},H("period",null,b.map((E,C)=>H("adaptation-set",{id:C,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",lang:E.language,codecs:E.codecs,audioSamplingRate:E.audio_sample_rate,contentType:"audio"},E.track_roles&&E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),E.track_name&&H("label",{id:C},E.track_name),E.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:E.channels}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,codecs:k.codecs,audioSamplingRate:k.audio_sample_rate},k.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:k.channels}),H(zw,{info:k.segment_info}))))),T.map((E,C)=>H("adaptation-set",{id:C+b.length,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",codecs:E.codecs,maxPlayoutRate:"1",frameRate:E.fps,contentType:"video"},E.color_info.primaries&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:ColourPrimaries",value:E.color_info.primaries}),E.color_info.transfer_characteristics&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:TransferCharacteristics",value:E.color_info.transfer_characteristics}),E.color_info.matrix_coefficients&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:MatrixCoefficients",value:E.color_info.matrix_coefficients}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,width:k.width,height:k.height,codecs:k.codecs,frameRate:k.fps},H(zw,{info:k.segment_info}))))),w.map(async(E,C)=>H("adaptation-set",{id:C+b.length+T.length,mimeType:await E.getMimeType(),contentType:"image"},E.representations.map(async k=>H("representation",{id:`thumbnails_${k.thumbnail_width}x${k.thumbnail_height}`,bandwidth:await k.getBitrate(),width:k.sheet_width,height:k.sheet_height},H("essential-property",{schemeIdUri:"http://dashif.org/thumbnail_tile",value:`${k.columns}x${k.rows}`}),H("segment-template",{media:k.template_url,duration:k.template_duration,startNumber:"0"}))))),S.map((E,C)=>H("adaptation-set",{id:C+b.length+T.length+w.length,mimeType:E.mime_type,lang:E.language,contentType:"text"},E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),H("label",{id:C+b.length},E.track_name),H("representation",{id:E.representation.uid,bandwidth:"0"},H("base-url",null,E.representation.base_url))))))}r(Kk,"DashManifest");function Xw(t,e=!1,i=_=>_,s,o,a,l,f,m,x){if(!t)throw new g("Streaming data not available");return Ww(H(Kk,{streamingData:t,isPostLiveDvr:e,transformURL:i,options:x,rejectFormat:s,cpn:o,player:a,actions:l,storyboards:f,captionTracks:m}))}r(Xw,"toDash");async function qk(t,e,i,s,o,a){if((i==null?void 0:i.status)==="UNPLAYABLE")throw new g("Video is unplayable",{error_type:"UNPLAYABLE"});if((i==null?void 0:i.status)==="LOGIN_REQUIRED")throw new g("Video is login required",{error_type:"LOGIN_REQUIRED"});if(!s)throw new g("Streaming data not available.",{error_type:"NO_STREAMING_DATA"});let l={quality:"360p",type:"video+audio",format:"mp4",range:void 0,...t},f=Qw(l,s),m=await f.decipher(o);if(l.type==="video+audio"&&!t.range){let S=await e.session.http.fetch_function(`${m}&cpn=${a}`,{method:"GET",headers:Kt,redirect:"follow"});if(!S.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:S});let E=S.body;if(!E)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:S});return E}let x=1048576*10,_=t.range?t.range.start:0,b=t.range?t.range.end:x,T=!1,w;return new M.shim.ReadableStream({start(){},pull:async S=>{if(T){S.close();return}return(b>=(f.content_length?f.content_length:0)||t.range)&&(T=!0),new Promise(async(E,C)=>{try{w=new AbortController;let k=await e.session.http.fetch_function(`${m}&cpn=${a}&range=${_}-${b||""}`,{method:"GET",headers:{...Kt},signal:w.signal});if(!k.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:k});let U=k.body;if(!U)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:k});for await(let L of jb(U))S.enqueue(L);_=b+1,b+=x,E()}catch(k){C(k)}})},async cancel(S){w.abort(S)}},{highWaterMark:1,size(S){return S.byteLength}})}r(qk,"download");function Qw(t,e){if(!e)throw new g("Streaming data not available");let i=[...e.formats||[],...e.adaptive_formats||[]],s=t.type?t.type.includes("audio"):!0,o=t.type?t.type.includes("video"):!0,a=t.language||"original",l=t.quality||"best",f=-1,m=["best","bestefficiency"].includes(l),x=l!=="best",_=i.filter(b=>s&&!b.has_audio||o&&!b.has_video||t.format!=="any"&&!b.mime_type.includes(t.format||"mp4")||!m&&b.quality_label!==l?!1:(b.width&&fb.width===f)),s&&!o){let b=_.filter(T=>a!=="original"?!T.has_video&&!T.has_text&&T.language===a:!T.has_video&&!T.has_text&&T.is_original);b.length>0&&(_=b)}return x?_.sort((b,T)=>b.bitrate-T.bitrate):_.sort((b,T)=>T.bitrate-b.bitrate),_[0]}r(Qw,"chooseFormat");var Hb,fi,$b,Qs,Jw,md=class{constructor(e,i,s){Hb.add(this),fi.set(this,void 0),$b.set(this,void 0),Qs.set(this,void 0),I(this,fi,e,"f"),I(this,$b,i,"f"),I(this,Qs,s||M.shim.fetch,"f")}get fetch_function(){return u(this,Qs,"f")}async fetch(e,i,s={}){let o=We.API.PRODUCTION_1+u(this,fi,"f").api_version,a=(i==null?void 0:i.baseURL)||o,l=typeof e=="string"?!a.endsWith("/")&&!e.startsWith("/")?new URL(`${a}/${e}`):new URL(a+e):e instanceof URL?e:new URL(e.url,a),f=(i==null?void 0:i.headers)||(e instanceof M.shim.Request?e.headers:new M.shim.Headers)||new M.shim.Headers,m=(i==null?void 0:i.body)||(e instanceof M.shim.Request?e.body:void 0),x=new M.shim.Headers(f);x.set("Accept","*/*"),x.set("Accept-Language","*"),x.set("X-Goog-Visitor-Id",(s==null?void 0:s.visitor_data)||u(this,fi,"f").context.client.visitorData||""),x.set("X-Youtube-Client-Version",u(this,fi,"f").context.client.clientVersion||"");let _=Object.values(V).find(C=>C.NAME===u(this,fi,"f").context.client.clientName);_&&x.set("X-Youtube-Client-Name",_.NAME_ID),M.shim.server&&(x.set("User-Agent",Zi("desktop")),x.set("Origin",l.origin)),l.searchParams.set("prettyPrint","false"),l.searchParams.set("alt","json");let b=x.get("Content-Type"),T=m,w=a===o||a===We.YT_UPLOAD;if(b==="application/json"&&w&&typeof m=="string"){let k={...JSON.parse(m),context:JSON.parse(JSON.stringify(u(this,fi,"f").context))};u(this,Hb,"m",Jw).call(this,k.context,k.client),x.set("X-Youtube-Client-Version",k.context.client.clientVersion);let U=Object.values(V).find(L=>L.NAME===k.context.client.clientName);U&&x.set("X-Youtube-Client-Name",U.NAME_ID),delete k.client,k.context.client.clientName==="ANDROID"||k.context.client.clientName==="ANDROID_MUSIC"?(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2")):k.context.client.clientName==="iOS"&&x.set("User-Agent",V.IOS.USER_AGENT),T=JSON.stringify(k)}else b==="application/x-protobuf"&&M.shim.server&&(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2"),x.delete("X-Youtube-Client-Version"));let S=new M.shim.Request(l,e instanceof M.shim.Request?e:i),E=await u(this,Qs,"f").call(this,S,{body:T,headers:x,redirect:e instanceof M.shim.Request?e.redirect:(i==null?void 0:i.redirect)||"follow",...M.shim.runtime!=="cf-worker"?{credentials:"include"}:{}});if(E.ok)return E;throw new g(`Request to ${E.url} failed with status ${E.status}`,await E.text())}};r(md,"HTTPClient");fi=new WeakMap,$b=new WeakMap,Qs=new WeakMap,Hb=new WeakSet,Jw=r(function(e,i){if(!!i){if(!cd.includes(i.toUpperCase()))throw new g(`Invalid client: ${i}`,{available_innertube_clients:cd});switch((i==="ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTSTUDIO_ANDROID")&&(e.client.androidSdkVersion=V.ANDROID.SDK_VERSION,e.client.userAgent=V.ANDROID.USER_AGENT,e.client.osName="Android",e.client.osVersion="13",e.client.platform="MOBILE"),i.toUpperCase()){case"MWEB":e.client.clientVersion=V.MWEB.VERSION,e.client.clientName=V.MWEB.NAME,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.platform="MOBILE";break;case"IOS":e.client.deviceMake="Apple",e.client.deviceModel=V.IOS.DEVICE_MODEL,e.client.clientVersion=V.IOS.VERSION,e.client.clientName=V.IOS.NAME,e.client.platform="MOBILE",e.client.osName="iOS",delete e.client.browserName,delete e.client.browserVersion;break;case"YTMUSIC":e.client.clientVersion=V.YTMUSIC.VERSION,e.client.clientName=V.YTMUSIC.NAME;break;case"ANDROID":e.client.clientVersion=V.ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.ANDROID.NAME;break;case"YTMUSIC_ANDROID":e.client.clientVersion=V.YTMUSIC_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTMUSIC_ANDROID.NAME;break;case"YTSTUDIO_ANDROID":e.client.clientVersion=V.YTSTUDIO_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTSTUDIO_ANDROID.NAME;break;case"TV":{e.client.clientVersion=V.TV.VERSION,e.client.clientName=V.TV.NAME,e.client.userAgent=V.TV.USER_AGENT;break}case"TV_EMBEDDED":e.client.clientName=V.TV_EMBEDDED.NAME,e.client.clientVersion=V.TV_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:We.YT_BASE};break;case"YTKIDS":e.client.clientVersion=V.WEB_KIDS.VERSION,e.client.clientName=V.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=V.WEB_EMBEDDED.NAME,e.client.clientVersion=V.WEB_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:We.GOOGLE_SEARCH_BASE};break;case"WEB_CREATOR":e.client.clientName=V.WEB_CREATOR.NAME,e.client.clientVersion=V.WEB_CREATOR.VERSION;break;default:break}}},"_HTTPClient_adjustContext");var Kb=md;var dt={};Xe(dt,{compress:()=>zk,decompress:()=>Xk});function zk(t){let e=[],i={};for(let a=0;a<256;a++)i[String.fromCharCode(a)]=a;let s="",o=256;for(let a=0;aString.fromCharCode(a)).join("")}r(zk,"compress");function Xk(t){let e={},i=t.split(""),s=[i.shift()],o=i.length>>>0,a=256,l=s[0],f=l;for(let m=0;mx1,encodeCommentActionParams:()=>ig,encodeNextParams:()=>y1,encodeVisitorData:()=>_1});function eT(){let t=0,e=0;for(let s=0;s<28;s+=7){let o=this.buf[this.pos++];if(t|=(o&127)<>4,(i&128)==0)return this.assertBounds(),[t,e];for(let s=3;s<=31;s+=7){let o=this.buf[this.pos++];if(e|=(o&127)<>>a,f=!(l>>>7==0&&e==0),m=(f?l|128:l)&255;if(i.push(m),!f)return}let s=t>>>28&15|(e&7)<<4,o=e>>3!=0;if(i.push((o?s|128:s)&255),!!o){for(let a=3;a<31;a=a+7){let l=e>>>a,f=l>>>7!=0,m=(f?l|128:l)&255;if(i.push(m),!f)return}i.push(e>>>31&1)}}r(dd,"varint64write");var hd=4294967296;function qb(t){let e=t[0]==="-";e&&(t=t.slice(1));let i=1e6,s=0,o=0;function a(l,f){let m=Number(t.slice(l,f));o*=i,s=s*i+m,s>=hd&&(o=o+(s/hd|0),s=s%hd)}return r(a,"add1e6digit"),a(-24,-18),a(-18,-12),a(-12,-6),a(-6),e?iT(s,o):Xb(s,o)}r(qb,"int64FromString");function tT(t,e){let i=Xb(t,e),s=i.hi&2147483648;s&&(i=iT(i.lo,i.hi));let o=zb(i.lo,i.hi);return s?"-"+o:o}r(tT,"int64ToString");function zb(t,e){if({lo:t,hi:e}=Qk(t,e),e<=2097151)return String(hd*e+t);let i=t&16777215,s=(t>>>24|e<<8)&16777215,o=e>>16&65535,a=i+s*6777216+o*6710656,l=s+o*8147497,f=o*2,m=1e7;return a>=m&&(l+=Math.floor(a/m),a%=m),l>=m&&(f+=Math.floor(l/m),l%=m),f.toString()+Zw(l)+Zw(a)}r(zb,"uInt64ToString");function Qk(t,e){return{lo:t>>>0,hi:e>>>0}}r(Qk,"toUnsigned");function Xb(t,e){return{lo:t|0,hi:e|0}}r(Xb,"newBits");function iT(t,e){return e=~e,t?t=~t+1:e+=1,Xb(t,e)}r(iT,"negate");var Zw=r(t=>{let e=String(t);return"0000000".slice(e.length)+e},"decimalFrom1e7WithLeadingZeros");function Qb(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let i=0;i<9;i++)e.push(t&127|128),t=t>>7;e.push(1)}}r(Qb,"varint32write");function rT(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let i=5;(t&128)!==0&&i<10;i++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}r(rT,"varint32read");var _t=Jk();function Jk(){let t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){let f=typeof l=="bigint"?l:BigInt(l);if(f>s||fa||f>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(nT(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return eg(e),Qb(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let i=this.encodeUtf8(e);return this.uint32(i.byteLength),this.raw(i)}float(e){s1(e);let i=new Uint8Array(4);return new DataView(i.buffer).setFloat32(0,e,!0),this.raw(i)}double(e){let i=new Uint8Array(8);return new DataView(i.buffer).setFloat64(0,e,!0),this.raw(i)}fixed32(e){nT(e);let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,e,!0),this.raw(i)}sfixed32(e){eg(e);let i=new Uint8Array(4);return new DataView(i.buffer).setInt32(0,e,!0),this.raw(i)}sint32(e){return eg(e),e=(e<<1^e>>31)>>>0,Qb(e,this.buf),this}sfixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=_t.enc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}fixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=_t.uEnc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}int64(e){let i=_t.enc(e);return dd(i.lo,i.hi,this.buf),this}sint64(e){let i=_t.enc(e),s=i.hi>>31,o=i.lo<<1^s,a=(i.hi<<1|i.lo>>>31)^s;return dd(o,a,this.buf),this}uint64(e){let i=_t.uEnc(e);return dd(i.lo,i.hi,this.buf),this}};r(Re,"BinaryWriter");var ee=class{constructor(e,i=Zb().decodeUtf8){this.decodeUtf8=i,this.varint64=eT,this.uint32=rT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),i=e>>>3,s=e&7;if(i<=0||s<0||s>5)throw new Error("illegal tag: field no "+i+" wire type "+s);return[i,s]}skip(e,i){let s=this.pos;switch(e){case mi.Varint:for(;this.buf[this.pos++]&128;);break;case mi.Bit64:this.pos+=4;case mi.Bit32:this.pos+=4;break;case mi.LengthDelimited:let o=this.uint32();this.pos+=o;break;case mi.StartGroup:for(;;){let[a,l]=this.tag();if(l===mi.EndGroup){if(i!==void 0&&a!==i)throw new Error("invalid end group tag");break}this.skip(l,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(s,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return _t.dec(...this.varint64())}uint64(){return _t.uDec(...this.varint64())}sint64(){let[e,i]=this.varint64(),s=-(e&1);return e=(e>>>1|(i&1)<<31)^s,i=i>>>1^s,_t.dec(e,i)}bool(){let[e,i]=this.varint64();return e!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return _t.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return _t.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),i=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(i,i+e)}string(){return this.decodeUtf8(this.bytes())}};r(ee,"BinaryReader");function eg(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>i1||tt1||t<0)throw new Error("invalid uint32: "+t)}r(nT,"assertUInt32");function s1(t){if(typeof t=="string"){let e=t;if(t=Number(t),isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>Zk||t>>3){case 1:if(a!==10)break;o.id=i.string();continue;case 5:if(a!==40)break;o.timestamp=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function n1(){return{params:void 0,number0:void 0,number1:void 0}}r(n1,"createBaseLiveMessageParams");var xT={encode(t,e=new Re){return t.params!==void 0&&uT.encode(t.params,e.uint32(10).fork()).join(),t.number0!==void 0&&e.uint32(16).int32(t.number0),t.number1!==void 0&&e.uint32(24).int32(t.number1),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=n1();for(;i.pos>>3){case 1:if(a!==10)break;o.params=uT.decode(i,i.uint32());continue;case 2:if(a!==16)break;o.number0=i.int32();continue;case 3:if(a!==24)break;o.number1=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function a1(){return{ids:void 0}}r(a1,"createBaseLiveMessageParams_Params");var uT={encode(t,e=new Re){return t.ids!==void 0&&fT.encode(t.ids,e.uint32(42).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=a1();for(;i.pos>>3){case 5:if(a!==42)break;o.ids=fT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function p1(){return{channelId:"",videoId:""}}r(p1,"createBaseLiveMessageParams_Params_Ids");var fT={encode(t,e=new Re){return t.channelId!==""&&e.uint32(10).string(t.channelId),t.videoId!==""&&e.uint32(18).string(t.videoId),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=p1();for(;i.pos>>3){case 1:if(a!==10)break;o.channelId=i.string();continue;case 2:if(a!==18)break;o.videoId=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function c1(){return{type:0,commentId:"",videoId:"",unkNum:void 0,channelId:void 0,translateCommentParams:void 0}}r(c1,"createBasePeformCommentActionParams");var yT={encode(t,e=new Re){return t.type!==0&&e.uint32(8).int32(t.type),t.commentId!==""&&e.uint32(26).string(t.commentId),t.videoId!==""&&e.uint32(42).string(t.videoId),t.unkNum!==void 0&&e.uint32(16).int32(t.unkNum),t.channelId!==void 0&&e.uint32(186).string(t.channelId),t.translateCommentParams!==void 0&&mT.encode(t.translateCommentParams,e.uint32(250).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=c1();for(;i.pos>>3){case 1:if(a!==8)break;o.type=i.int32();continue;case 3:if(a!==26)break;o.commentId=i.string();continue;case 5:if(a!==42)break;o.videoId=i.string();continue;case 2:if(a!==16)break;o.unkNum=i.int32();continue;case 23:if(a!==186)break;o.channelId=i.string();continue;case 31:if(a!==250)break;o.translateCommentParams=mT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function l1(){return{params:void 0,commentId:"",targetLanguage:""}}r(l1,"createBasePeformCommentActionParams_TranslateCommentParams");var mT={encode(t,e=new Re){return t.params!==void 0&&hT.encode(t.params,e.uint32(26).fork()).join(),t.commentId!==""&&e.uint32(18).string(t.commentId),t.targetLanguage!==""&&e.uint32(34).string(t.targetLanguage),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=l1();for(;i.pos>>3){case 3:if(a!==26)break;o.params=hT.decode(i,i.uint32());continue;case 2:if(a!==18)break;o.commentId=i.string();continue;case 4:if(a!==34)break;o.targetLanguage=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function u1(){return{comment:void 0}}r(u1,"createBasePeformCommentActionParams_TranslateCommentParams_Params");var hT={encode(t,e=new Re){return t.comment!==void 0&&dT.encode(t.comment,e.uint32(10).fork()).join(),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=u1();for(;i.pos>>3){case 1:if(a!==10)break;o.comment=dT.decode(i,i.uint32());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function f1(){return{text:""}}r(f1,"createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment");var dT={encode(t,e=new Re){return t.text!==""&&e.uint32(10).string(t.text),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=f1();for(;i.pos>>3){case 1:if(a!==10)break;o.text=i.string();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function m1(){return{shortId:"",params:void 0,feature2:0,feature3:0}}r(m1,"createBaseReelSequence");var bT={encode(t,e=new Re){return t.shortId!==""&&e.uint32(10).string(t.shortId),t.params!==void 0&&_T.encode(t.params,e.uint32(42).fork()).join(),t.feature2!==0&&e.uint32(80).int32(t.feature2),t.feature3!==0&&e.uint32(104).int32(t.feature3),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=m1();for(;i.pos>>3){case 1:if(a!==10)break;o.shortId=i.string();continue;case 5:if(a!==42)break;o.params=_T.decode(i,i.uint32());continue;case 10:if(a!==80)break;o.feature2=i.int32();continue;case 13:if(a!==104)break;o.feature3=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function h1(){return{number:0}}r(h1,"createBaseReelSequence_Params");var _T={encode(t,e=new Re){return t.number!==0&&e.uint32(24).int32(t.number),e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=h1();for(;i.pos>>3){case 3:if(a!==24)break;o.number=i.int32();continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function d1(){return{videoId:[]}}r(d1,"createBaseNextParams");var gT={encode(t,e=new Re){for(let i of t.videoId)e.uint32(42).string(i);return e},decode(t,e){let i=t instanceof ee?t:new ee(t),s=e===void 0?i.len:i.pos+e,o=d1();for(;i.pos>>3){case 5:if(a!==42)break;o.videoId.push(i.string());continue}if((a&7)===4||a===0)break;i.skip(a&7)}return o}};function _1(t,e){let i=tg.encode({id:t,timestamp:e});return encodeURIComponent(zt(i.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(_1,"encodeVisitorData");function x1(t){return tg.decode(rg(decodeURIComponent(t).replace(/-/g,"+").replace(/_/g,"/")))}r(x1,"decodeVisitorData");function ig(t,e={}){let i={type:t,commentId:e.comment_id||" ",videoId:e.video_id||" ",channelId:" ",unkNum:2};if(e.hasOwnProperty("text")){if(typeof e.target_language!="string")throw new Error("target_language must be a string");e.comment_id&&delete i.unkNum,i.translateCommentParams={params:{comment:{text:e.text}},commentId:e.comment_id||" ",targetLanguage:e.target_language}}let s=yT.encode(i);return encodeURIComponent(zt(s.finish()))}r(ig,"encodeCommentActionParams");function y1(t){let e=gT.encode({videoId:t});return encodeURIComponent(zt(e.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(y1,"encodeNextParams");var Zs=class extends n{constructor(e){super(),this.popup=c.parseItem(e.popup),this.popup_type=e.popupType}};r(Zs,"OpenPopupAction");Zs.type="OpenPopupAction";var _d=Zs;var eo=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new p(e.text).toString()),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"label")&&(this.label=e.accessibility.label),Reflect.has(e,"tooltip")&&(this.tooltip=e.tooltip),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"isDisabled")&&(this.is_disabled=e.isDisabled),this.endpoint=new d(e.navigationEndpoint||e.serviceEndpoint||e.command)}};r(eo,"Button");eo.type="Button";var v=eo;var to=class extends n{constructor(e){var i;super(),this.label=new p(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 d(e.onSelectCommand)),Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),Reflect.has(e,"descriptionText")&&(this.description=new p(e.descriptionText))}};r(to,"DropdownItem");to.type="DropdownItem";var xd=to;var io=class extends n{constructor(e){super(),this.label=e.label||"",this.entries=c.parseArray(e.entries,xd)}};r(io,"Dropdown");io.type="Dropdown";var hi=io;var ro=class extends n{constructor(e){super(),this.title=new p(e.dialogTitle).toString(),this.title_placeholder=e.titlePlaceholder||"",this.privacy_option=c.parseItem(e.privacyOption,hi),this.create_button=c.parseItem(e.cancelButton,v),this.cancel_button=c.parseItem(e.cancelButton,v)}};r(ro,"CreatePlaylistDialog");ro.type="CreatePlaylistDialog";var yd=ro;var di=class extends n{constructor(e){var i,s,o,a,l,f,m,x;if(super(),e){if(e.serialCommand||e.parallelCommand){let _=e.serialCommand||e.parallelCommand;this.commands=_.commands.map(b=>new di(b))}(e.innertubeCommand||e.command||e.performOnceCommand)&&(e=e.innertubeCommand||e.command||e.performOnceCommand)}this.command=c.parseCommand(e),Reflect.has(e||{},"openPopupAction")&&(this.open_popup=new _d(e.openPopupAction)),this.name=Object.keys(e||{}).find(_=>_.endsWith("Endpoint")||_.endsWith("Command")),this.payload=this.name?Reflect.get(e,this.name):{},(Reflect.has(this.payload,"dialog")||Reflect.has(this.payload,"content"))&&(this.dialog=c.parseItem(this.payload.dialog||this.payload.content)),Reflect.has(this.payload,"modal")&&(this.modal=c.parseItem(this.payload.modal)),Reflect.has(this.payload,"nextEndpoint")&&(this.next_endpoint=new di(this.payload.nextEndpoint)),e!=null&&e.serviceEndpoint&&(e=e.serviceEndpoint),this.metadata={},(s=(i=e==null?void 0:e.commandMetadata)==null?void 0:i.webCommandMetadata)!=null&&s.url&&(this.metadata.url=e.commandMetadata.webCommandMetadata.url),(a=(o=e==null?void 0:e.commandMetadata)==null?void 0:o.webCommandMetadata)!=null&&a.webPageType&&(this.metadata.page_type=e.commandMetadata.webCommandMetadata.webPageType),(f=(l=e==null?void 0:e.commandMetadata)==null?void 0:l.webCommandMetadata)!=null&&f.apiUrl?this.metadata.api_url=e.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/",""):this.name&&(this.metadata.api_url=this.getPath(this.name)),(x=(m=e==null?void 0:e.commandMetadata)==null?void 0:m.webCommandMetadata)!=null&&x.sendPost&&(this.metadata.send_post=e.commandMetadata.webCommandMetadata.sendPost),e!=null&&e.createPlaylistEndpoint&&e!=null&&e.createPlaylistEndpoint.createPlaylistDialog&&(this.dialog=c.parseItem(e==null?void 0:e.createPlaylistEndpoint.createPlaylistDialog,yd))}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,i){if(!e)throw new Error("An API caller must be provided");if(this.command){let s=this.command;return e.execute(s.getApiPath(),{...s.buildRequest(),...i})}if(!this.metadata.api_url)throw new Error("Expected an api_url, but none was found.");return e.execute(this.metadata.api_url,{...this.payload,...i})}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}`}};r(di,"NavigationEndpoint");di.type="NavigationEndpoint";var d=di;var y=class{constructor(e){this.url=e.url,this.width=e.width,this.height=e.height}static fromResponse(e){if(!e)return[];let i;return e.thumbnails?i=e.thumbnails:e.sources&&(i=e.sources),i?i.map(s=>new y(s)).sort((s,o)=>o.width-s.width):[]}};r(y,"Thumbnail");var _i=class{constructor(e){var i,s,o,a,l,f;this.text=((i=e.emoji)==null?void 0:i.emojiId)||((o=(s=e.emoji)==null?void 0:s.shortcuts)==null?void 0:o[0])||e.text||"",this.emoji={emoji_id:e.emoji.emojiId,shortcuts:((a=e.emoji)==null?void 0:a.shortcuts)||[],search_terms:((l=e.emoji)==null?void 0:l.searchTerms)||[],image:y.fromResponse(e.emoji.image),is_custom:!!((f=e.emoji)!=null&&f.isCustomEmoji)}}toString(){return this.text}toHTML(){let e=bd(this.text);return`${e}`}};r(_i,"EmojiRun");var xi=class{constructor(e){this.text=e.text,this.bold=Boolean(e.bold),this.italics=Boolean(e.italics),this.strikethrough=Boolean(e.strikethrough),this.deemphasize=Boolean(e.deemphasize),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.attachment=e.attachment}toString(){return this.text}toHTML(){let e=[];this.bold&&e.push("b"),this.italics&&e.push("i"),this.strikethrough&&e.push("s"),this.deemphasize&&e.push("small");let i=bd(this.text),o=`${e.map(a=>`<${a}>`).join("")+i+e.map(a=>``).join("")}`;if(this.attachment&&this.attachment.element.type.imageType.image.sources.length){let{url:a}=this.attachment.element.type.imageType.image.sources[0];if(this.endpoint){let l=this.endpoint.toURL();if(l)return`${o}`}}if(this.endpoint){let a=this.endpoint.toURL();if(a)return`${o}`}return o}};r(xi,"TextRun");function bd(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}r(bd,"escape");var so="Text",p=class{constructor(e){var i,s,o,a;typeof e=="object"&&e!==null&&Reflect.has(e,"runs")&&Array.isArray(e.runs)?(this.runs=e.runs.map(l=>l.emoji?new _i(l):new xi(l)),this.text=this.runs.map(l=>l.text).join("")):this.text=e==null?void 0:e.simpleText,typeof e=="object"&&e!==null&&Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),typeof e=="object"&&e!==null&&Reflect.has(e,"titleNavigationEndpoint")&&(this.endpoint=new d(e.titleNavigationEndpoint)),this.endpoint||(s=(i=this.runs)==null?void 0:i[0])!=null&&s.endpoint&&(this.endpoint=(a=(o=this.runs)==null?void 0:o[0])==null?void 0:a.endpoint)}static fromAttributed(e){var f,m,x;let{content:i,styleRuns:s,commandRuns:o,attachmentRuns:a}=e,l=[{text:i,startIndex:0}];if(s||o||a){if(s)for(let _ of s)if(_.italic||_.strikethrough==="LINE_STYLE_SINGLE"||_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD"){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for style run. Skipping...",{style_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}gd(l,b,_,{bold:_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD",italics:_.italic,strikethrough:_.strikethrough==="LINE_STYLE_SINGLE"})}else O.debug(so,"Skipping style run as it is doesn't have any information that we parse.",{style_run:_,input_data:e});if(o)for(let _ of o)if(_.onTap){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for command run. Skipping...",{command_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}gd(l,b,_,{navigationEndpoint:_.onTap})}else O.debug(so,'Skipping command run as it is missing the "doTap" property.',{command_run:_,input_data:e});if(a)for(let _ of a){let b=sg(l,_);if(!b){O.warn(so,"Unable to find matching run for attachment run. Skipping...",{attachment_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(l))});continue}if(_.length===0)b.attachment=_;else{let T=_.startIndex-b.startIndex,w=b.text.substring(T,T+_.length),S=/^:[^:]+:$/.test(w);if(((x=(m=(f=_.element)==null?void 0:f.type)==null?void 0:m.imageType)==null?void 0:x.image)&&(S||/^(?:\p{Emoji}|\u200d)+$/u.test(w))){let E={image:_.element.type.imageType.image,isCustomEmoji:S,shortcuts:S?[w]:void 0};gd(l,b,_,{emoji:E})}else gd(l,b,_,{attachment:_})}}}return new p({runs:l})}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"}};r(p,"Text");function sg(t,e){return t.find(i=>i.startIndex<=e.startIndex&&e.startIndex+e.length<=i.startIndex+i.text.length)}r(sg,"findMatchingRun");function gd(t,e,i,s){let o=t.indexOf(e),a=[],l=i.startIndex-e.startIndex;i.startIndex>e.startIndex&&a.push({...e,text:e.text.substring(0,l)}),a.push({...e,text:e.text.substring(l,l+i.length),startIndex:i.startIndex,...s}),i.startIndex+i.length{var s,o;return{title:i.title,selected:i.selected,continuation:(o=(s=i.continuation)==null?void 0:s.reloadContinuationData)==null?void 0:o.continuation,endpoint:new d(i.serviceEndpoint||i.navigationEndpoint),subtitle:i.subtitle||null}}))}};r(vo,"SortFilterSubMenu");vo.type="SortFilterSubMenu";var xt=vo;var Io=class extends n{constructor(e){super(),this.language_menu=c.parseItem(e.languageMenu,xt)}};r(Io,"TranscriptFooter");Io.type="TranscriptFooter";var Ad=Io;var So=class extends n{constructor(e){super(),this.formatted_placeholder=new p(e.formattedPlaceholder),this.clear_button=c.parseItem(e.clearButton,v),this.endpoint=new d(e.onTextChangeCommand),this.search_button=c.parseItem(e.searchButton,v)}};r(So,"TranscriptSearchBox");So.type="TranscriptSearchBox";var Rd=So;var Eo=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new p(e.snippet)}};r(Eo,"TranscriptSectionHeader");Eo.type="TranscriptSectionHeader";var Md=Eo;var ko=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new p(e.snippet),this.start_time_text=new p(e.startTimeText),this.target_id=e.targetId}};r(ko,"TranscriptSegment");ko.type="TranscriptSegment";var Ld=ko;var Co=class extends n{constructor(e){super(),this.initial_segments=c.parseArray(e.initialSegments,[Ld,Md]),this.no_result_label=new p(e.noResultLabel),this.retry_label=new p(e.retryLabel),this.touch_captions_enabled=e.touchCaptionsEnabled}};r(Co,"TranscriptSegmentList");Co.type="TranscriptSegmentList";var Od=Co;var Po=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,Rd),this.body=c.parseItem(e.body,Od),this.footer=c.parseItem(e.footer,Ad),this.target_id=e.targetId}};r(Po,"TranscriptSearchPanel");Po.type="TranscriptSearchPanel";var Dd=Po;var No=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,Dd)}};r(No,"Transcript");No.type="Transcript";var Dr=No;var Ao=class extends n{constructor(e){super(),this.target_id=e.targetId,this.content=c.parseItem(e.content,Dr)}};r(Ao,"UpdateEngagementPanelAction");Ao.type="UpdateEngagementPanelAction";var ET=Ao;var Ro=class extends n{constructor(e){super(),this.channel_id=e.channelId,this.subscribed=e.subscribed}};r(Ro,"UpdateSubscribeButtonAction");Ro.type="UpdateSubscribeButtonAction";var kT=Ro;var Mo=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Mo,"MenuTitle");Mo.type="MenuTitle";var Bd=Mo;var Lo=class extends n{constructor(e){var i;super(),this.add_to_playlist_service_endpoint=new d(e.addToPlaylistServiceEndpoint),this.contains_selected_videos=e.containsSelectedVideos,this.playlist_id=e.playlistId,this.privacy=e.privacy,this.privacy_icon={icon_type:((i=e.privacyIcon)==null?void 0:i.iconType)||null},this.remove_from_playlist_service_endpoint=new d(e.removeFromPlaylistServiceEndpoint),this.title=new p(e.title)}};r(Lo,"PlaylistAddToOption");Lo.type="PlaylistAddToOption";var Yd=Lo;var Oo=class extends n{constructor(e){super(),this.actions=c.parseArray(e.actions,[Bd,v]),this.playlists=c.parseArray(e.playlists,Yd)}};r(Oo,"AddToPlaylist");Oo.type="AddToPlaylist";var CT=Oo;var Do=class extends n{constructor(e){super(),this.text=new p(e.text),this.alert_type=e.type}};r(Do,"Alert");Do.type="Alert";var Br=Do;var Bo=class extends n{constructor(e){super(),this.text=new p(e.text),this.alert_type=e.type,this.dismiss_button=c.parseItem(e.dismissButton,v)}};r(Bo,"AlertWithButton");Bo.type="AlertWithButton";var Vd=Bo;var Yo=class extends n{constructor(e){super(),this.text=p.fromAttributed(e.text),this.suffix=p.fromAttributed(e.suffix)}};r(Yo,"AttributionView");Yo.type="AttributionView";var Ud=Yo;var Vo=class extends n{constructor(e){super(),this.audio_only_availability=e.audioOnlyAvailability}};r(Vo,"AudioOnlyPlayability");Vo.type="AudioOnlyPlayability";var Fd=Vo;var Uo=class extends n{constructor(e){var i,s;super(),(s=(i=e==null?void 0:e.content)==null?void 0:i.automixPlaylistVideoRenderer)!=null&&s.navigationEndpoint&&(this.playlist_video={endpoint:new d(e.content.automixPlaylistVideoRenderer.navigationEndpoint)})}};r(Uo,"AutomixPreviewVideo");Uo.type="AutomixPreviewVideo";var Wd=Uo;var Fo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.avatar_image_size=e.avatarImageSize,e.image.processor&&(this.image_processor={border_image_processor:{circular:e.image.processor.borderImageProcessor.circular}})}};r(Fo,"AvatarView");Fo.type="AvatarView";var Gd=Fo;var Wo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.endpoint=new d(e.command)}};r(Wo,"BackstageImage");Wo.type="BackstageImage";var jd=Wo;var Go=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b;super(),this.text=new p(e.defaultText),this.toggled_text=new p(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=(s=e.defaultIcon)==null?void 0:s.iconType;let i=((l=(a=(o=e==null?void 0:e.defaultText)==null?void 0:o.accessibility)==null?void 0:a.accessibilityData)==null?void 0:l.label)||((m=(f=e==null?void 0:e.accessibilityData)==null?void 0:f.accessibilityData)==null?void 0:m.label)||((x=e==null?void 0:e.accessibility)==null?void 0:x.label);this.icon_type=="LIKE"&&(this.like_count=parseInt(i.replace(/\D/g,"")),this.short_like_count=new p(e.defaultText).toString()),this.endpoint=(b=(_=e.defaultServiceEndpoint)==null?void 0:_.commandExecutorCommand)!=null&&b.commands?new d(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop()):new d(e.defaultServiceEndpoint),this.toggled_endpoint=new d(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)}};r(Go,"ToggleButton");Go.type="ToggleButton";var se=Go;var jo=class extends n{constructor(e){var i,s;super(),this.creator_thumbnail=y.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:(s=(i=e.heartColor)==null?void 0:i.basicColorPaletteData)==null?void 0:s.foregroundTitleColor}},this.hearted_tooltip=e.heartedTooltip,this.is_hearted=e.isHearted,this.is_enabled=e.isEnabled,this.kennedy_heart_color_string=e.kennedyHeartColorString}};r(jo,"CreatorHeart");jo.type="CreatorHeart";var Hd=jo;var Ho=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,se),this.dislike_button=c.parseItem(e.dislikeButton,se),this.reply_button=c.parseItem(e.replyButton,v),this.creator_heart=c.parseItem(e.creatorHeart,Hd)}};r(Ho,"CommentActionButtons");Ho.type="CommentActionButtons";var $d=Ho;var $o=class extends n{constructor(e){super(),this.icon_name=e.iconName,this.title=e.title,this.accessibility_text=e.accessibilityText,this.style=e.style,this.is_full_width=e.isFullWidth,this.button_type=e.type,this.button_size=e.buttonSize,this.on_tap=new d(e.onTap)}};r($o,"ButtonView");$o.type="ButtonView";var Te=$o;var Ko=class extends n{constructor(e){super(),this.default_button=c.parseItem(e.defaultButtonViewModel,Te),this.toggled_button=c.parseItem(e.toggledButtonViewModel,Te),this.identifier=e.identifier,this.is_toggling_disabled=e.isTogglingDisabled}};r(Ko,"ToggleButtonView");Ko.type="ToggleButtonView";var yt=Ko;var qo=class extends n{constructor(e){super(),this.toggle_button=c.parseItem(e.toggleButtonViewModel,yt),this.like_status_entity_key=e.likeStatusEntityKey,this.like_status_entity={key:e.likeStatusEntity.key,like_status:e.likeStatusEntity.likeStatus}}};r(qo,"LikeButtonView");qo.type="LikeButtonView";var Kd=qo;var zo=class extends n{constructor(e){super(),this.toggle_button=c.parseItem(e.toggleButtonViewModel,yt),this.dislike_entity_key=e.dislikeEntityKey}};r(zo,"DislikeButtonView");zo.type="DislikeButtonView";var qd=zo;var Xo=class extends n{constructor(e){if(super(),this.like_button=c.parseItem(e.likeButtonViewModel,Kd),this.dislike_button=c.parseItem(e.dislikeButtonViewModel,qd),this.icon_type=e.iconType,this.like_button&&this.like_button.toggle_button){let i=this.like_button.toggle_button;i.default_button?(this.short_like_count=i.default_button.title,this.like_count=parseInt(i.default_button.accessibility_text.replace(/\D/g,""))):i.toggled_button&&(this.short_like_count=i.toggled_button.title,this.like_count=parseInt(i.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}}};r(Xo,"SegmentedLikeDislikeButtonView");Xo.type="SegmentedLikeDislikeButtonView";var Xt=Xo;var Qo=class extends v{constructor(e){super(e)}};r(Qo,"MenuServiceItem");Qo.type="MenuServiceItem";var At=Qo;var Jo=class extends n{constructor(e){super(),this.style=e.style,this.size=e.size,this.endpoint=new d(e.command),this.target_id=e.targetId}};r(Jo,"DownloadButton");Jo.type="DownloadButton";var Yr=Jo;var Zo=class extends n{constructor(e){super(),this.has_separator=!!e.hasSeparator,this.endpoint=new d(e.navigationEndpoint||e.serviceEndpoint)}};r(Zo,"MenuServiceItemDownload");Zo.type="MenuServiceItemDownload";var zd=Zo;var en=class extends n{constructor(e){super(),this.menu_item=c.parseItem(e.menuItem,[At,zd]),this.top_level_button=c.parseItem(e.topLevelButton,[Yr,Te,v])}};r(en,"MenuFlexibleItem");en.type="MenuFlexibleItem";var Xd=en;var tn=class extends n{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(i=>new d(i)))}};r(tn,"LikeButton");tn.type="LikeButton";var Vr=tn;var rn=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.flexible_items=c.parseArray(e.flexibleItems,Xd),this.top_level_buttons=c.parseArray(e.topLevelButtons,[se,Vr,v,Te,Xt]),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.label=e.accessibility.accessibilityData.label)}get contents(){return this.items}};r(rn,"Menu");rn.type="Menu";var R=rn;var sn=class extends n{constructor(e){super(),this.id=e.postId,this.author=new P({...e.authorText,navigationEndpoint:e.authorEndpoint},null,e.authorThumbnail),this.content=new p(e.contentText),this.published=new p(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 p(e.voteCount)),Reflect.has(e,"actionMenu")&&(this.menu=c.parseItem(e.actionMenu,R)),Reflect.has(e,"actionButtons")&&(this.action_buttons=c.parseItem(e.actionButtons,$d)),Reflect.has(e,"voteButton")&&(this.vote_button=c.parseItem(e.voteButton,v)),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),Reflect.has(e,"backstageAttachment")&&(this.attachment=c.parseItem(e.backstageAttachment)),this.surface=e.surface}};r(sn,"BackstagePost");sn.type="BackstagePost";var bi=sn;var on=class extends n{constructor(e){super(),this.post=c.parseItem(e.post)}};r(on,"BackstagePostThread");on.type="BackstagePostThread";var PT=on;var gi=class extends n{constructor(e){super(),this.text=e.badgeText,this.style=e.badgeStyle,this.accessibility_label=e.accessibilityLabel}};r(gi,"BadgeView");var nn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(nn,"BrowseFeedActions");nn.type="BrowseFeedActions";var Qd=nn;var an=class extends n{constructor(e){super(),this.album=new p(e.album),this.thumbnails=y.fromResponse(e.thumbnailDetails)}};r(an,"BrowserMediaSession");an.type="BrowserMediaSession";var NT=an;var Ur=class extends n{constructor(e){super(),this.endpoint=new d(e.navigationEndpoint),this.icon=y.fromResponse(e.icon),this.title=new p(e.title)}};r(Ur,"HeaderLink");Ur.type="HeaderLink";var pn=class extends n{constructor(e){var i,s;super(),this.primary=G(((i=e.primaryLinks)==null?void 0:i.map(o=>new Ur(o)))||[]),this.secondary=G(((s=e.secondaryLinks)==null?void 0:s.map(o=>new Ur(o)))||[])}};r(pn,"ChannelHeaderLinks");pn.type="ChannelHeaderLinks";var Jd=pn;var cn=class extends n{constructor(e){super(),Reflect.has(e,"firstLink")&&(this.first_link=p.fromAttributed(e.firstLink)),Reflect.has(e,"more")&&(this.more=p.fromAttributed(e.more))}};r(cn,"ChannelHeaderLinksView");cn.type="ChannelHeaderLinksView";var Zd=cn;var ln=class extends n{constructor(e){super(),this.placeholder_text=new p(e.placeholderText),this.max_character_limit=e.maxCharacterLimit}};r(ln,"ClipCreationTextInput");ln.type="ClipCreationTextInput";var e_=ln;var un=class extends n{constructor(e){var i,s,o,a,l,f;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=(s=(i=e.startAccessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label,this.end_label=(a=(o=e.endAccessibility)==null?void 0:o.accessibilityData)==null?void 0:a.label,this.duration_label=(f=(l=e.durationAccessibility)==null?void 0:l.accessibilityData)==null?void 0:f.label}};r(un,"ClipCreationScrubber");un.type="ClipCreationScrubber";var t_=un;var fn=class extends n{constructor(e){super(),this.title=new p(e.title),this.body=new p(e.body)}};r(fn,"ClipAdState");fn.type="ClipAdState";var i_=fn;var mn=class extends n{constructor(e){super(),this.user_avatar=y.fromResponse(e.userAvatar),this.title_input=c.parseItem(e.titleInput,[e_]),this.scrubber=c.parseItem(e.scrubber,[t_]),this.save_button=c.parseItem(e.saveButton,[v]),this.display_name=new p(e.displayName),this.publicity_label=e.publicityLabel,this.cancel_button=c.parseItem(e.cancelButton,[v]),this.ad_state_overlay=c.parseItem(e.adStateOverlay,[i_]),this.external_video_id=e.externalVideoId,this.publicity_label_icon=e.publicityLabelIcon}};r(mn,"ClipCreation");mn.type="ClipCreation";var r_=mn;var hn=class extends n{constructor(e){super(),this.contents=c.parse(e.contents,!0,[r_])}};r(hn,"ClipSection");hn.type="ClipSection";var s_=hn;var dn=class extends n{constructor(e){super(),this.trigger=e.trigger,Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,v)),this.endpoint=new d(e.continuationEndpoint)}};r(dn,"ContinuationItem");dn.type="ContinuationItem";var J=dn;var _n=class extends n{constructor(e){super(),this.title=new p(e.title),this.contextual_info=e.contextualInfo?new p(e.contextualInfo):void 0,this.visibility_button=c.parseItem(e.visibilityButton,v),this.menu=c.parseItem(e.menu)}};r(_n,"EngagementPanelTitleHeader");_n.type="EngagementPanelTitleHeader";var o_=_n;var xn=class extends n{constructor(e){super(),this.info_text=new p(e.infoText),this.menu=c.parseItem(e.menu,R)}};r(xn,"MacroMarkersInfoItem");xn.type="MacroMarkersInfoItem";var n_=xn;var yn=class extends n{constructor(e){super(),this.title=new p(e.title),this.time_description=new p(e.timeDescription),this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap),this.layout=e.layout,this.is_highlighted=!!e.isHighlighted}};r(yn,"MacroMarkersListItem");yn.type="MacroMarkersListItem";var Fr=yn;var bn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents,[n_,Fr]),this.sync_button_label=new p(e.syncButtonLabel)}};r(bn,"MacroMarkersList");bn.type="MacroMarkersList";var a_=bn;var gn=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(gn,"ProductList");gn.type="ProductList";var p_=gn;var wn=class extends n{constructor(e){super(),this.contents=c.parseArray(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=c.parseItem(e.header)),Reflect.has(e,"subMenu")&&(this.sub_menu=c.parseItem(e.subMenu))}};r(wn,"SectionList");wn.type="SectionList";var de=wn;var Tn=class extends n{constructor(e){super(),this.show_more_text=new p(e.showMoreText),this.show_less_text=new p(e.showLessText),Reflect.has(e,"attributedDescriptionBodyText")&&(this.attributed_description_body_text=p.fromAttributed(e.attributedDescriptionBodyText))}};r(Tn,"ExpandableVideoDescriptionBody");Tn.type="ExpandableVideoDescriptionBody";var c_=Tn;var vn=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new d(e.searchEndpoint),this.query=new p(e.query).toString()}};r(vn,"SearchRefinementCard");vn.type="SearchRefinementCard";var tr=vn;var In=class extends n{constructor(e){super(),this.game=c.parseItem(e.game)}};r(In,"GameCard");In.type="GameCard";var l_=In;var Sn=class extends n{constructor(e){super(),this.visible_item_count=e.visibleItemCount,this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Sn,"HorizontalList");Sn.type="HorizontalList";var u_=Sn;var En=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header={collapsed_title:new p(e.header.collapsedTitle),collapsed_thumbnail:y.fromResponse(e.header.collapsedThumbnail),collapsed_label:new p(e.header.collapsedLabel),expanded_title:new p(e.header.expandedTitle)}),this.expanded_content=c.parseItem(e.expandedContent,[wi,u_]),this.expand_button=c.parseItem(e.expandButton,v),this.collapse_button=c.parseItem(e.collapseButton,v)}};r(En,"ExpandableMetadata");En.type="ExpandableMetadata";var f_=En;var kn=class extends n{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)}};r(kn,"MetadataBadge");kn.type="MetadataBadge";var Ge=kn;var Cn=class extends n{constructor(e){super(),this.text=new p(e.text).toString(),this.style=e.style}};r(Cn,"ThumbnailOverlayTimeStatus");Cn.type="ThumbnailOverlayTimeStatus";var ir=Cn;var Pn=class extends n{constructor(e){var s,o,a;super();let i=((s=e.thumbnailOverlays.find(l=>l.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new p(e.descriptionSnippet)),Reflect.has(e,"detailedMetadataSnippets")&&(this.snippets=e.detailedMetadataSnippets.map(l=>({text:new p(l.snippetText),hover_text:new p(l.snippetHoverText)}))),this.expandable_metadata=c.parseItem(e.expandableMetadata,f_),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=c.parseItem(e.richThumbnail)),this.author=new P(e.ownerText,e.ownerBadges,(a=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:a.thumbnail),this.badges=c.parseArray(e.badges,Ge),this.endpoint=new d(e.navigationEndpoint),this.published=new p(e.publishedTimeText),this.view_count=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`))),this.duration={text:e.lengthText?new p(e.lengthText).toString():new p(i).toString(),seconds:_e(e.lengthText?new p(e.lengthText).toString():new p(i).toString())},this.show_action_menu=!!e.showActionMenu,this.is_watched=!!e.isWatched,this.menu=c.parseItem(e.menu,R),Reflect.has(e,"searchVideoResultEntityKey")&&(this.search_video_result_entity_key=e.searchVideoResultEntityKey)}get description(){var e;return this.snippets?this.snippets.map(i=>i.text.toString()).join(""):((e=this.description_snippet)==null?void 0:e.toString())||""}get is_live(){var e;return this.badges.some(i=>{if(i.style==="BADGE_STYLE_TYPE_LIVE_NOW"||i.label==="LIVE")return!0})||((e=this.thumbnail_overlays.firstOfType(ir))==null?void 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]}};r(Pn,"Video");Pn.type="Video";var Wr=Pn;var Nn=class extends Wr{constructor(e){var i,s;if(super(e),Reflect.has(e,"metadataText")){let o=new p(e.metadataText);o.text&&(this.short_view_count=new p({simpleText:o.text.split("\xB7")[0].trim()}),this.published=new p({simpleText:o.text.split("\xB7")[1].trim()}))}Reflect.has(e,"bylineText")&&(this.author=new P(e.bylineText,e.ownerBadges,(s=(i=e.channelThumbnailSupportedRenderers)==null?void 0:i.channelThumbnailWithLinkRenderer)==null?void 0:s.thumbnail))}};r(Nn,"VideoCard");Nn.type="VideoCard";var m_=Nn;var An=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r(An,"ContentPreviewImageView");An.type="ContentPreviewImageView";var rr=An;var Rn=class extends n{constructor(e){var i;super(),(i=e.image)!=null&&i.sources?this.image=y.fromResponse(e.image):this.image=c.parseItem(e.image,rr),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 d(e.overflowMenuOnTap),this.overflow_menu_a11y_label=e.overflowMenuA11yLabel}};r(Rn,"VideoAttributeView");Rn.type="VideoAttributeView";var Ti=Rn;var Mn=class extends n{constructor(e){super(),this.cards=c.parseArray(e.cards,[Ti,tr,Fr,l_,m_]),this.header=c.parseItem(e.header),this.previous_button=c.parseItem(e.previousButton,v),this.next_button=c.parseItem(e.nextButton,v)}};r(Mn,"HorizontalCardList");Mn.type="HorizontalCardList";var wi=Mn;var Ln=class extends n{constructor(e){super(),this.label=new p(e.label),this.value=new p(e.value),this.accessibility_text=e.accessibilityText}};r(Ln,"Factoid");Ln.type="Factoid";var vi=Ln;var On=class extends n{constructor(e){super(),this.factoid=c.parseItem(e.factoid,vi)}};r(On,"UploadTimeFactoid");On.type="UploadTimeFactoid";var h_=On;var Dn=class extends n{constructor(e){super(),this.view_count_entity_key=e.viewCountEntityKey,this.factoid=c.parseItem(e.factoid,[vi]),this.view_count_type=e.viewCountType}};r(Dn,"ViewCountFactoid");Dn.type="ViewCountFactoid";var d_=Dn;var Bn=class extends n{constructor(e){super(),this.title=new p(e.title),this.channel=new p(e.channel),this.channel_navigation_endpoint=new d(e.channelNavigationEndpoint),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.publish_date=new p(e.publishDate),this.views=new p(e.views),this.factoids=c.parseArray(e.factoid,[vi,d_,h_])}};r(Bn,"VideoDescriptionHeader");Bn.type="VideoDescriptionHeader";var __=Bn;var Yn=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.creator_videos_button=c.parseItem(e.creatorVideosButton,v),this.creator_about_button=c.parseItem(e.creatorAboutButton,v),this.section_subtitle=new p(e.sectionSubtitle),this.channel_avatar=y.fromResponse(e.channelAvatar),this.channel_endpoint=new d(e.channelEndpoint)}};r(Yn,"VideoDescriptionInfocardsSection");Yn.type="VideoDescriptionInfocardsSection";var x_=Yn;var Vn=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"defaultMetadata")&&(this.default_metadata=new p(e.defaultMetadata)),Reflect.has(e,"expandedMetadata")&&(this.expanded_metadata=new p(e.expandedMetadata)),Reflect.has(e,"infoRowExpandStatusKey")&&(this.info_row_expand_status_key=e.infoRowExpandStatusKey)}};r(Vn,"InfoRow");Vn.type="InfoRow";var y_=Vn;var Un=class extends n{constructor(e){super(),this.id=e.videoId,this.thumbnails=y.fromResponse(e.thumbnail)||null,Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=c.parseItem(e.richThumbnail)),this.title=new p(e.title),this.author=new P(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.view_count=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),this.published=new p(e.publishedTimeText),this.badges=c.parseArray(e.badges,Ge),this.duration={text:new p(e.lengthText).toString(),seconds:_e(new p(e.lengthText).toString())},this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.endpoint=new d(e.navigationEndpoint),this.menu=c.parseItem(e.menu,R)}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")}};r(Un,"CompactVideo");Un.type="CompactVideo";var Gr=Un;var Fn=class extends n{constructor(e){super(),this.info_rows=c.parseArray(e.infoRows,y_),this.video_lockup=c.parseItem(e.videoLockup,Gr)}};r(Fn,"CarouselLockup");Fn.type="CarouselLockup";var b_=Fn;var Wn=class extends n{constructor(e){super(),this.carousel_lockups=c.parseArray(e.carouselLockups,b_),this.section_title=new p(e.sectionTitle)}};r(Wn,"VideoDescriptionMusicSection");Wn.type="VideoDescriptionMusicSection";var jr=Wn;var Gn=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.sub_header_text=new p(e.subHeaderText),this.primary_button=c.parseItem(e.primaryButton,v)}};r(Gn,"VideoDescriptionTranscriptSection");Gn.type="VideoDescriptionTranscriptSection";var jn=Gn;var Hn=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.short_byline_text=new p(e.shortBylineText),this.video_count_short_text=new p(e.videoCountShortText),this.endpoint=new d(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}};r(Hn,"StructuredDescriptionPlaylistLockup");Hn.type="StructuredDescriptionPlaylistLockup";var g_=Hn;var $n=class extends n{constructor(e){super(),this.section_title=new p(e.sectionTitle),this.media_lockups=c.parseArray(e.mediaLockups,[g_])}};r($n,"VideoDescriptionCourseSection");$n.type="VideoDescriptionCourseSection";var w_=$n;var Kn=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint))}get contents(){return this.items}};r(Kn,"ReelShelf");Kn.type="ReelShelf";var Hr=Kn;var qn=class extends n{constructor(e){super(),this.header_title=e.headerTitle,this.header_subtitle=e.headerSubtitle,this.video_attributes=c.parseArray(e.videoAttributeViewModels,Ti),this.previous_button=c.parseItem(e.previousButton,Te),this.next_button=c.parseItem(e.nextButton,Te)}};r(qn,"VideoAttributesSectionView");qn.type="VideoAttributesSectionView";var T_=qn;var zn=class extends n{constructor(e){super(),this.items=c.parseArray(e.items,[__,c_,jr,x_,w_,jn,jn,wi,Hr,T_])}};r(zn,"StructuredDescriptionContent");zn.type="StructuredDescriptionContent";var sr=zn;var Xn=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,o_),this.content=c.parseItem(e.content,[Ti,de,J,s_,sr,a_,p_]),this.panel_identifier=e.panelIdentifier,this.identifier=e.identifier?{surface:e.identifier.surface,tag:e.identifier.tag}:void 0,this.target_id=e.targetId,this.visibility=e.visibility}};r(Xn,"EngagementPanelSectionList");Xn.type="EngagementPanelSectionList";var Ii=Xn;var Qn=class extends n{constructor(e){super(),this.content=e.content,this.max_lines=e.maxLines,this.more_endpoint=e.moreEndpoint.showEngagementPanelEndpoint?{show_engagement_panel_endpoint:{engagement_panel:c.parseItem(e.moreEndpoint.showEngagementPanelEndpoint.engagementPanel,Ii),engagement_panel_popup_type:e.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:e.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,tag:e.moreEndpoint.showEngagementPanelEndpoint.identifier.tag}}}:new d(e.moreEndpoint),this.more_icon_type=e.moreIcon.iconType,this.more_label=e.moreLabel,this.target_id=e.targetId}};r(Qn,"ChannelTagline");Qn.type="ChannelTagline";var v_=Qn;var Jn=class extends n{constructor(e){super(),this.states=e.states.map(i=>({id:i.stateId,next_id:i.nextStateId,state:c.parse(i.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}};r(Jn,"SubscriptionNotificationToggleButton");Jn.type="SubscriptionNotificationToggleButton";var I_=Jn;var Zn=class extends n{constructor(e){var i,s;super(),this.button_text=new p(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,this.subscribed_text=new p(e.subscribedButtonText),this.unsubscribed_text=new p(e.unsubscribedButtonText),this.notification_preference_button=c.parseItem(e.notificationPreferenceButton,I_),Reflect.has(e,"serviceEndpoints")&&(this.service_endpoints=e.serviceEndpoints.map(o=>new d(o))),Reflect.has(e,"onSubscribeEndpoints")&&(this.on_subscribe_endpoints=e.onSubscribeEndpoints.map(o=>new d(o))),Reflect.has(e,"onUnsubscribeEndpoints")&&(this.on_unsubscribe_endpoints=e.onUnsubscribeEndpoints.map(o=>new d(o))),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=(i=e.subscribeAccessibility.accessibilityData)==null?void 0:i.label),Reflect.has(e,"unsubscribeAccessibility")&&(this.unsubscribe_accessibility_label=(s=e.unsubscribeAccessibility.accessibilityData)==null?void 0:s.label)}};r(Zn,"SubscribeButton");Zn.type="SubscribeButton";var xe=Zn;var ea=class extends n{constructor(e){super(),this.author=new P({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),Reflect.has(e,"banner")&&(this.banner=y.fromResponse(e.banner)),Reflect.has(e,"tv_banner")&&(this.tv_banner=y.fromResponse(e.tvBanner)),Reflect.has(e,"mobile_banner")&&(this.mobile_banner=y.fromResponse(e.mobileBanner)),Reflect.has(e,"subscriberCountText")&&(this.subscribers=new p(e.subscriberCountText)),Reflect.has(e,"videosCountText")&&(this.videos_count=new p(e.videosCountText)),Reflect.has(e,"sponsorButton")&&(this.sponsor_button=c.parseItem(e.sponsorButton,v)),Reflect.has(e,"subscribeButton")&&(this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v])),Reflect.has(e,"headerLinks")&&(this.header_links=c.parseItem(e.headerLinks,[Jd,Zd])),Reflect.has(e,"channelHandleText")&&(this.channel_handle=new p(e.channelHandleText)),Reflect.has(e,"channelId")&&(this.channel_id=e.channelId),Reflect.has(e,"tagline")&&(this.tagline=c.parseItem(e.tagline,v_))}};r(ea,"C4TabbedHeader");ea.type="C4TabbedHeader";var $r=ea;var ta=class extends n{constructor(e){super(),this.label=new p(e.label),this.icon_type=e.icon.iconType,this.style=e.style}};r(ta,"CallToActionButton");ta.type="CallToActionButton";var AT=ta;var ia=class extends n{constructor(e){super(),this.teaser=c.parseItem(e.teaser),this.content=c.parseItem(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(i=>({start_card_active_ms:i.startCardActiveMs,end_card_active_ms:i.endCardActiveMs,teaser_duration_ms:i.teaserDurationMs,icon_after_teaser_ms:i.iconAfterTeaserMs}))}};r(ia,"Card");ia.type="Card";var RT=ia;var ra=class extends n{constructor(e){super(),this.cards=c.parseArray(e.cards),this.header=new p(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}};r(ra,"CardCollection");ra.type="CardCollection";var S_=ra;var sa=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(sa,"CarouselHeader");sa.type="CarouselHeader";var E_=sa;var oa=class extends n{constructor(e){super(),this.items=c.parseArray(e.carouselItems),this.background_color=e.backgroundColor,this.layout_style=e.layoutStyle,this.pagination_thumbnails=y.fromResponse(e.paginationThumbnails),this.paginator_alignment=e.paginatorAlignment}get contents(){return this.items}};r(oa,"CarouselItem");oa.type="CarouselItem";var MT=oa;var na=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscriber_count=new p(e.subscriberCountText),this.video_count=new p(e.videoCountText),this.long_byline=new p(e.longBylineText),this.short_byline=new p(e.shortBylineText),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v]),this.description_snippet=new p(e.descriptionSnippet)}};r(na,"Channel");na.type="Channel";var k_=na;var aa=class extends n{constructor(e){var i,s;super(),this.id=e.channelId,this.name=new p(e.title),this.avatar=y.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.primary_links=(s=(i=e.primaryLinks)==null?void 0:i.map(o=>({endpoint:new d(o.navigationEndpoint),icon:y.fromResponse(o.icon),title:new p(o.title)})))!=null?s:[],this.view_count=new p(e.viewCountText),this.joined_date=new p(e.joinedDateText),this.description=new p(e.description),this.email_reveal=new d(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new p(e.country),this.buttons=c.parseArray(e.actionButtons,v)}};r(aa,"ChannelAboutFullMetadata");aa.type="ChannelAboutFullMetadata";var pa=aa;var ca=class extends n{constructor(e){super(),this.channel_title=e.channelTitle,this.avatar=y.fromResponse(e.avatar),this.header=new p(e.header),this.main_text=new p(e.mainText),this.sign_in_button=c.parseItem(e.signInButton,v),this.secondary_text=new p(e.secondaryText)}};r(ca,"ChannelAgeGate");ca.type="ChannelAgeGate";var LT=ca;var la=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items)}};r(la,"ChannelFeaturedContent");la.type="ChannelFeaturedContent";var OT=la;var ua=class extends n{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=y.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}};r(ua,"ChannelMetadata");ua.type="ChannelMetadata";var C_=ua;var fa=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(fa,"ChannelMobileHeader");fa.type="ChannelMobileHeader";var DT=fa;var ma=class extends n{constructor(e){super(),this.avatar=y.fromResponse(e.avatar),this.endpoint=new d(e.avatarEndpoint),this.name=e.name,this.links=e.links.map(i=>new p(i))}};r(ma,"ChannelOptions");ma.type="ChannelOptions";var P_=ma;var ha=class extends n{constructor(e){super(),this.illustration=y.fromResponse(e.illustration),this.description=new p(e.description)}};r(ha,"ChannelOwnerEmptyState");ha.type="ChannelOwnerEmptyState";var BT=ha;var da=class extends n{constructor(e){super(),this.content_type_sub_menu_items=e.contentTypeSubMenuItems.map(i=>({endpoint:new d(i.navigationEndpoint||i.endpoint),selected:i.selected,title:i.title})),this.sort_setting=c.parseItem(e.sortSetting)}};r(da,"ChannelSubMenu");da.type="ChannelSubMenu";var _a=da;var xa=class extends n{constructor(e){super(),this.title=new p(e.title).toString(),Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,v))}};r(xa,"ChannelSwitcherHeader");xa.type="ChannelSwitcherHeader";var YT=xa;var ya=class extends n{constructor(e){var i,s;super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new d(e.navigationEndpoint),this.label=(s=(i=e.accessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label}};r(ya,"ChannelThumbnailWithLink");ya.type="ChannelThumbnailWithLink";var VT=ya;var ba=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.description=new p(e.description),this.view_count=new p(e.viewCountText),this.published_time=new p(e.publishedTimeText)}};r(ba,"ChannelVideoPlayer");ba.type="ChannelVideoPlayer";var UT=ba;var ga=class extends n{constructor(e){super(),this.title=new p(e.title),this.time_range_start_millis=e.timeRangeStartMillis,this.thumbnail=y.fromResponse(e.thumbnail)}};r(ga,"Chapter");ga.type="Chapter";var N_=ga;var wa=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.duration={text:e.lengthText.simpleText,seconds:_e(e.lengthText.simpleText)},this.endpoint=new d(e.navigationEndpoint)}};r(wa,"ChildVideo");wa.type="ChildVideo";var FT=wa;var Ta=class extends n{constructor(e){super(),this.text=e.text,this.display_type=e.displayType,this.endpoint=new d(e.tapCommand),this.chip_entity_key=e.chipEntityKey}};r(Ta,"ChipView");Ta.type="ChipView";var A_=Ta;var va=class extends n{constructor(e){super(),this.chips=c.parseArray(e.chips,A_)}};r(va,"ChipBarView");va.type="ChipBarView";var WT=va;var Ia=class extends n{constructor(e){super(),this.is_selected=e.isSelected,Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.text=new p(e.text).toString()}};r(Ia,"ChipCloudChip");Ia.type="ChipCloudChip";var je=Ia;var Sa=class extends n{constructor(e){super(),this.chips=c.parseArray(e.chips,je),this.next_button=c.parseItem(e.nextButton,v),this.previous_button=c.parseItem(e.previousButton,v),this.horizontal_scrollable=e.horizontalScrollable}};r(Sa,"ChipCloud");Sa.type="ChipCloud";var Kr=Sa;var Ea=class extends n{constructor(e){super(),this.channel_avatar=y.fromResponse(e.channelAvatar),this.custom_text=new p(e.customText),this.channel_name=new p(e.channelName),this.subscriber_count=new p(e.subscriberCountText),this.endpoint=new d(e.endpoint)}};r(Ea,"CollaboratorInfoCardContent");Ea.type="CollaboratorInfoCardContent";var GT=Ea;var ka=class extends n{constructor(e){super(),this.left=y.fromResponse(e.leftThumbnail),this.top_right=y.fromResponse(e.topRightThumbnail),this.bottom_right=y.fromResponse(e.bottomRightThumbnail),this.endpoint=new d(e.navigationEndpoint)}};r(ka,"CollageHeroImage");ka.type="CollageHeroImage";var jT=ka;var Ca=class extends n{constructor(e){super(),this.icon_name=e.icon.sources[0].clientResource.imageName,this.text=p.fromAttributed(e.text),this.style=e.style}};r(Ca,"ThumbnailHoverOverlayView");Ca.type="ThumbnailHoverOverlayView";var R_=Ca;var Pa=class extends n{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.iconName&&(this.icon_name=e.icon.sources[0].clientResource.imageName)}};r(Pa,"ThumbnailBadgeView");Pa.type="ThumbnailBadgeView";var M_=Pa;var Na=class extends n{constructor(e){super(),this.badges=c.parseArray(e.thumbnailBadges,M_),this.position=e.position}};r(Na,"ThumbnailOverlayBadgeView");Na.type="ThumbnailOverlayBadgeView";var L_=Na;var Aa=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.overlays=c.parseArray(e.overlays,[L_,R_]),e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme})}};r(Aa,"ThumbnailView");Aa.type="ThumbnailView";var O_=Aa;var Ra=class extends n{constructor(e){super(),this.primary_thumbnail=c.parseItem(e.primaryThumbnail,O_),e.stackColor&&(this.stack_color={light_theme:e.stackColor.lightTheme,dark_theme:e.stackColor.darkTheme})}};r(Ra,"CollectionThumbnailView");Ra.type="CollectionThumbnailView";var D_=Ra;var Ma=class extends n{constructor(e){super(),this.open_miniplayer=e.openMiniplayer,this.video_id=e.videoId,this.list_type=e.listType,this.endpoint=new d(e.onCreateListCommand),this.video_ids=e.videoIds}};r(Ma,"AddToPlaylistCommand");Ma.type="AddToPlaylistCommand";var HT=Ma;var La=class extends n{constructor(e){super(),this.commands=c.parseCommands(e.commands)}};r(La,"CommandExecutorCommand");La.type="CommandExecutorCommand";var $T=La;var bt,Oa=class extends n{constructor(e){super(),bt.set(this,void 0),I(this,bt,e,"f")}getApiPath(){switch(u(this,bt,"f").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 u(this,bt,"f").formData&&(e.formData=u(this,bt,"f").formData),u(this,bt,"f").token&&(e.continuation=u(this,bt,"f").token),u(this,bt,"f").request==="CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU"&&(e.notificationsMenuRequestType="NOTIFICATIONS_MENU_REQUEST_TYPE_COMMENTS",u(this,bt,"f").token&&(e.fetchCommentsParams={continuation:u(this,bt,"f").token},delete e.continuation)),e}};r(Oa,"ContinuationCommand");bt=new WeakMap;Oa.type="ContinuationCommand";var KT=Oa;var og,Da,Ba=class extends n{constructor(e){super(),og.set(this,"kids/get_kids_blocklist_picker"),Da.set(this,void 0),I(this,Da,e,"f")}getApiPath(){return u(this,og,"f")}buildRequest(){let e={};return u(this,Da,"f").blockedForKidsContent&&(e.blockedForKidsContent=u(this,Da,"f").blockedForKidsContent),e}};r(Ba,"GetKidsBlocklistPickerCommand");og=new WeakMap,Da=new WeakMap;Ba.type="GetKidsBlocklistPickerCommand";var qT=Ba;var Ya=class extends n{constructor(e){super(),this.engagement_type=e.engagementType,Reflect.has(e,"ids")&&(this.ids=e.ids.map(i=>({encrypted_video_id:i.encryptedVideoId,external_channel_id:i.externalChannelId,comment_id:i.commentId,external_owner_id:i.externalOwnerId,artist_id:i.artistId,playlist_id:i.playlistId,external_post_id:i.externalPostId,share_id:i.shareId})))}};r(Ya,"RunAttestationCommand");Ya.type="RunAttestationCommand";var zT=Ya;var Va=class extends n{constructor(e){var i;super(),this.inline_content=c.parseItem((i=e.panelLoadingStrategy)==null?void 0:i.inlineContent),this.remove_default_padding=!!e.removeDefaultPadding}};r(Va,"ShowDialogCommand");Va.type="ShowDialogCommand";var XT=Va;var B_,Ua=class extends n{constructor(e){super(),B_.set(this,void 0),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"),I(this,B_,e,"f")}get orig_badge(){return u(this,B_,"f")}};r(Ua,"AuthorCommentBadge");B_=new WeakMap;Ua.type="AuthorCommentBadge";var QT=Ua;var Fa=class extends n{constructor(e){super(),this.id=e.id,this.categories=c.parseArray(e.categories),this.category_buttons=c.parseArray(e.categoryButtons),this.search_placeholder=new p(e.searchPlaceholderText),this.search_no_results=new p(e.searchNoResultsText),this.pick_skin_tone=new p(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}};r(Fa,"EmojiPicker");Fa.type="EmojiPicker";var Y_=Fa;var Wa=class extends n{constructor(e){super(),this.editable_text=new p(e.editableText),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.submit_button=c.parseItem(e.submitButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.placeholder=new p(e.placeholderText),this.emoji_button=c.parseItem(e.emojiButton,v),this.emoji_picker=c.parseItem(e.emojiPicker,Y_)}};r(Wa,"CommentDialog");Wa.type="CommentDialog";var JT=Wa;var Ga=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents),this.view_replies=c.parseItem(e.viewReplies,v),this.hide_replies=c.parseItem(e.hideReplies,v),this.view_replies_creator_thumbnail=y.fromResponse(e.viewRepliesCreatorThumbnail),this.has_channel_owner_replied=!!e.viewRepliesCreatorThumbnail}};r(Ga,"CommentReplies");Ga.type="CommentReplies";var V_=Ga;var ja=class extends n{constructor(e){super(),this.reply_button=c.parseItem(e.replyButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new p(e.placeholderText),this.error_message=new p(e.errorMessage)}};r(ja,"CommentReplyDialog");ja.type="CommentReplyDialog";var U_=ja;var Ha=class extends n{constructor(e){super(),this.simplebox_avatar=y.fromResponse(e.simpleboxAvatar),this.simplebox_placeholder=new p(e.simpleboxPlaceholder)}};r(Ha,"CommentsSimplebox");Ha.type="CommentsSimplebox";var F_=Ha;var $a=class extends n{constructor(e){super(),Reflect.has(e,"teaserAvatar")&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new p(e.teaserContent))}};r($a,"CommentsEntryPointTeaser");$a.type="CommentsEntryPointTeaser";var W_=$a;var Ka=class extends n{constructor(e){super(),Reflect.has(e,"headerText")&&(this.header=new p(e.headerText)),Reflect.has(e,"commentCount")&&(this.comment_count=new p(e.commentCount)),(Reflect.has(e,"teaserAvatar")||Reflect.has(e,"simpleboxAvatar"))&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar||e.simpleboxAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new p(e.teaserContent)),Reflect.has(e,"contentRenderer")&&(this.content_renderer=c.parseItem(e.contentRenderer,[W_,F_])),Reflect.has(e,"simpleboxPlaceholder")&&(this.simplebox_placeholder=new p(e.simpleboxPlaceholder))}};r(Ka,"CommentsEntryPointHeader");Ka.type="CommentsEntryPointHeader";var G_=Ka;var qa=class extends n{constructor(e){super(),this.title=new p(e.titleText),this.count=new p(e.countText),this.comments_count=new p(e.commentsCount),this.create_renderer=c.parseItem(e.createRenderer),this.sort_menu=c.parseItem(e.sortMenu,xt),Reflect.has(e,"customEmojis")&&(this.custom_emojis=e.customEmojis.map(i=>({emoji_id:i.emojiId,shortcuts:i.shortcuts,search_terms:i.searchTerms,image:y.fromResponse(i.image),is_custom_emoji:i.isCustomEmoji})))}};r(qa,"CommentsHeader");qa.type="CommentsHeader";var Si=qa;var za=class extends n{constructor(e){super(),this.submit_button=c.parseItem(e.submitButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new p(e.placeholderText),this.avatar_size=e.avatarSize}};r(za,"CommentSimplebox");za.type="CommentSimplebox";var j_=za;var Me,Xa=class extends n{constructor(e){super(),Me.set(this,void 0),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,i,s){e&&(this.content=p.fromAttributed(e.properties.content),this.published_time=e.properties.publishedTime,this.author_is_channel_owner=!!e.author.isCreator,this.like_count=e.toolbar.likeCountNotliked?e.toolbar.likeCountNotliked:"0",this.reply_count=e.toolbar.replyCount?e.toolbar.replyCount:"0",this.is_member=!!e.author.sponsorBadgeUrl,Reflect.has(e.author,"sponsorBadgeUrl")&&(this.member_badge={url:e.author.sponsorBadgeUrl,a11y:e.author.A11y}),this.author=new P({simpleText:e.author.displayName,navigationEndpoint:e.avatar.endpoint},e.author,e.avatar.image,e.author.channelId)),i&&(this.is_hearted=i.heartState==="TOOLBAR_HEART_STATE_HEARTED",this.is_liked=i.likeState==="TOOLBAR_LIKE_STATE_LIKED",this.is_disliked=i.likeState==="TOOLBAR_LIKE_STATE_DISLIKED"),s&&!Reflect.has(s,"prepareAccountCommand")&&(this.like_command=new d(s.likeCommand),this.dislike_command=new d(s.dislikeCommand),this.unlike_command=new d(s.unlikeCommand),this.undislike_command=new d(s.undislikeCommand),this.reply_command=new d(s.replyCommand))}async like(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.like_command)throw new g("Like command not found.");if(this.is_liked)throw new g("This comment is already liked.",{comment_id:this.comment_id});return this.like_command.call(u(this,Me,"f"))}async dislike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.dislike_command)throw new g("Dislike command not found.");if(this.is_disliked)throw new g("This comment is already disliked.",{comment_id:this.comment_id});return this.dislike_command.call(u(this,Me,"f"))}async unlike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.unlike_command)throw new g("Unlike command not found.");if(!this.is_liked)throw new g("This comment is not liked.",{comment_id:this.comment_id});return this.unlike_command.call(u(this,Me,"f"))}async undislike(){if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.undislike_command)throw new g("Undislike command not found.");if(!this.is_disliked)throw new g("This comment is not disliked.",{comment_id:this.comment_id});return this.undislike_command.call(u(this,Me,"f"))}async reply(e){var o;if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.reply_command)throw new g("Reply command not found.");let i=(o=this.reply_command.dialog)==null?void 0:o.as(U_);if(!i)throw new g("Reply dialog not found.");let s=i.reply_button;if(!s)throw new g("Reply button not found in the dialog.");if(!s.endpoint)throw new g("Reply button endpoint not found.");return s.endpoint.call(u(this,Me,"f"),{commentText:e})}async translate(e){var m,x,_,b,T,w;if(!u(this,Me,"f"))throw new g("Actions instance not set for this comment.");if(!this.content)throw new g("Comment content not found.",{comment_id:this.comment_id});let s={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e},o=ig(22,s),a=await u(this,Me,"f").execute("comment/perform_comment_action",{action:o}),l=(x=(m=a.data.frameworkUpdates)==null?void 0:m.entityBatchUpdate)==null?void 0:x.mutations,f=(w=(T=(b=(_=l==null?void 0:l[0])==null?void 0:_.payload)==null?void 0:b.commentEntityPayload)==null?void 0:T.translatedContent)==null?void 0:w.content;return{...a,content:f}}setActions(e){I(this,Me,e,"f")}};r(Xa,"CommentView");Me=new WeakMap;Xa.type="CommentView";var or=Xa;var H_,Ei,nr,ng,Qa=class extends n{constructor(e){super(),H_.add(this),Ei.set(this,void 0),nr.set(this,void 0),this.comment=c.parseItem(e.commentViewModel,or),this.comment_replies_data=c.parseItem(e.replies,V_),this.is_moderated_elq_comment=e.isModeratedElqComment,this.has_replies=!!this.comment_replies_data}get has_continuation(){if(!this.replies)throw new g("Cannot determine if there is a continuation because this thread's replies have not been loaded.");return!!u(this,nr,"f")}async getReplies(){var s;if(!u(this,Ei,"f"))throw new g("Actions instance not set for this thread.");if(!this.comment_replies_data)throw new g("This comment has no replies.",this);let e=(s=this.comment_replies_data.contents)==null?void 0:s.firstOfType(J);if(!e)throw new g("Replies continuation not found.");let i=await e.endpoint.call(u(this,Ei,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,H_,"m",ng).call(this,i.on_response_received_endpoints_memo),I(this,nr,i.on_response_received_endpoints_memo.getType(J).first(),"f"),this}async getContinuation(){var s;if(!this.replies)throw new g("Cannot retrieve continuation because this thread's replies have not been loaded.");if(!u(this,nr,"f"))throw new g("Continuation not found.");if(!u(this,Ei,"f"))throw new g("Actions instance not set for this thread.");let e=(s=u(this,nr,"f").button)==null?void 0:s.as(v);if(!e)throw new g('"Load more" button not found.');let i=await e.endpoint.call(u(this,Ei,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,H_,"m",ng).call(this,i.on_response_received_endpoints_memo),I(this,nr,i.on_response_received_endpoints_memo.getType(J).first(),"f"),this}setActions(e){I(this,Ei,e,"f")}};r(Qa,"CommentThread");Ei=new WeakMap,nr=new WeakMap,H_=new WeakSet,ng=r(function(e){return G(e.getType(or).map(i=>(i.setActions(u(this,Ei,"f")),i)))},"_CommentThread_getPatchedReplies");Qa.type="CommentThread";var $_=Qa;var Ja=class extends n{constructor(e){var i,s;super(),this.text=new p(e.chipText),this.color_pallette={background_color:(i=e.chipColorPalette)==null?void 0:i.backgroundColor,foreground_title_color:(s=e.chipColorPalette)==null?void 0:s.foregroundTitleColor},Reflect.has(e,"chipIcon")&&Reflect.has(e.chipIcon,"iconType")&&(this.icon_type=e.chipIcon.iconType)}};r(Ja,"PdgCommentChip");Ja.type="PdgCommentChip";var ZT=Ja;var Za=class extends n{constructor(e){super(),this.custom_badge=y.fromResponse(e.customBadge),this.tooltip=e.tooltip}};r(Za,"SponsorCommentBadge");Za.type="SponsorCommentBadge";var e0=Za;var ep=class extends n{constructor(e){super(),this.title=new p(e.title),this.channel_id=e.channelId,this.thumbnail=y.fromResponse(e.thumbnail),this.display_name=new p(e.displayName),this.video_count=new p(e.videoCountText),this.subscriber_count=new p(e.subscriberCountText),this.endpoint=new d(e.navigationEndpoint),this.tv_banner=y.fromResponse(e.tvBanner),this.menu=c.parseItem(e.menu,R)}};r(ep,"CompactChannel");ep.type="CompactChannel";var t0=ep;var tp=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(tp,"PlaylistCustomThumbnail");tp.type="PlaylistCustomThumbnail";var qr=tp;var ip=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(ip,"PlaylistVideoThumbnail");ip.type="PlaylistVideoThumbnail";var zr=ip;var rp=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new p(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new p(e.shortBylineText):new P(e.longBylineText,e.ownerBadges,null),this.thumbnails=y.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(s=>s.thumbnails).flat(1)}),this.video_count=new p(e.thumbnailText),this.video_count_short=new p(e.videoCountShortText),this.first_videos=c.parseArray(e.videos),this.share_url=e.shareUrl||null,this.menu=c.parseItem(e.menu),this.badges=c.parseArray(e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),Reflect.has(e,"thumbnailRenderer")&&(this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer,[zr,qr])||void 0),Reflect.has(e,"viewPlaylistText")&&(this.view_playlist=new p(e.viewPlaylistText))}};r(rp,"Playlist");rp.type="Playlist";var Rt=rp;var sp=class extends Rt{constructor(e){super(e)}};r(sp,"CompactMix");sp.type="CompactMix";var i0=sp;var op=class extends n{constructor(e){var o;super();let i=((o=e.thumbnailOverlays.find(a=>a.thumbnailOverlayTimeStatusRenderer))==null?void 0:o.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),this.top_metadata_items=new p(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText);let s=e.lengthText?new p(e.lengthText).toString():new p(i).toString();this.duration={text:s,seconds:_e(s)},this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.menu=c.parseItem(e.menu,R)}};r(op,"CompactMovie");op.type="CompactMovie";var r0=op;var np=class extends Rt{constructor(e){super(e)}};r(np,"CompactPlaylist");np.type="CompactPlaylist";var s0=np;var ap=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.video_count=new p(e.videoCountText),this.endpoint=new d(e.navigationEndpoint),this.thumbnail=y.fromResponse(e.thumbnail)}};r(ap,"CompactStation");ap.type="CompactStation";var o0=ap;var pp=class extends n{constructor(e){super(),this.title=new p(e.title),this.confirm_button=c.parseItem(e.confirmButton,v),this.cancel_button=c.parseItem(e.cancelButton,v),this.dialog_messages=e.dialogMessages.map(i=>new p(i))}};r(pp,"ConfirmDialog");pp.type="ConfirmDialog";var n0=pp;var cp=class extends n{constructor(e){super(),this.metadata_rows=e.metadataRows.map(i=>{var s;return{metadata_parts:(s=i.metadataParts)==null?void 0:s.map(o=>({text:p.fromAttributed(o.text||{})}))}}),this.delimiter=e.delimiter}};r(cp,"ContentMetadataView");cp.type="ContentMetadataView";var Xr=cp;var lp=class extends n{constructor(e){super(),this.text=new p(e.text)}};r(lp,"Message");lp.type="Message";var ki=lp;var up=class extends n{constructor(e){super(),this.availability_message=c.parseItem(e.availabilityMessage,ki)}};r(up,"ConversationBar");up.type="ConversationBar";var a0=up;var fp=class extends n{constructor(e){super(),this.copy_button=c.parseItem(e.copyButton,v),this.short_url=e.shortUrl,this.style=e.style}};r(fp,"CopyLink");fp.type="CopyLink";var Qr=fp;var mp=class extends n{constructor(e){super(),this.label=new p(e.label),this.placeholder_text=new p(e.placeholderText),this.disabled=!!e.disabled,this.dropdown_type=e.type,this.id=e.id,Reflect.has(e,"options")&&(this.options=e.options.map(i=>{var s;return{title:new p(i.title),subtitle:new p(i.subtitle),leading_image:y.fromResponse(i.leadingImage),value:{privacy_status_value:(s=i.value)==null?void 0:s.privacyStatusValue},on_tap:new d(i.onTap),is_selected:!!i.isSelected}}))}};r(mp,"DropdownView");mp.type="DropdownView";var K_=mp;var hp=class extends n{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})}};r(hp,"TextFieldView");hp.type="TextFieldView";var q_=hp;var dp=class extends n{constructor(e){super(),this.playlist_title=c.parseItem(e.playlistTitle,q_),this.playlist_visibility=c.parseItem(e.playlistVisibility,K_),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}};r(dp,"CreatePlaylistDialogFormView");dp.type="CreatePlaylistDialogFormView";var z_=dp;var _p=class extends n{constructor(e){var i,s;super(),this.avatar=c.parseItem(e.avatar,Gd),this.a11y_label=e.a11yLabel,(s=(i=e.rendererContext)==null?void 0:i.commandContext)!=null&&s.onTap&&(this.on_tap_endpoint=new d(e.rendererContext.commandContext.onTap))}};r(_p,"DecoratedAvatarView");_p.type="DecoratedAvatarView";var Jr=_p;var xp=class extends n{constructor(e){super(),this.time_range_start_millis=e.timeRangeStartMillis,this.marker_duration_millis=e.markerDurationMillis,this.heat_marker_intensity_score_normalized=e.heatMarkerIntensityScoreNormalized}};r(xp,"HeatMarker");xp.type="HeatMarker";var X_=xp;var yp=class extends n{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=c.parseArray(e.heatMarkers,X_),this.heat_markers_decorations=c.parseArray(e.heatMarkersDecorations)}};r(yp,"Heatmap");yp.type="Heatmap";var Q_=yp;var bp=class extends n{constructor(e){super(),this.marker_key=e.key,this.value={},Reflect.has(e,"value")&&(Reflect.has(e.value,"heatmap")&&(this.value.heatmap=c.parseItem(e.value.heatmap,Q_)),Reflect.has(e.value,"chapters")&&(this.value.chapters=c.parseArray(e.value.chapters,N_)))}};r(bp,"Marker");bp.type="Marker";var gp=class extends n{constructor(e){var i;super(),this.markers_map=G(((i=e.markersMap)==null?void 0:i.map(s=>new bp(s)))||[])}};r(gp,"MultiMarkersPlayerBar");gp.type="MultiMarkersPlayerBar";var J_=gp;var wp=class extends n{constructor(e){super(),this.player_bar=c.parseItem(e.playerBar,J_),this.player_bar_action_button=c.parseItem(e.playerBarActionButton,v)}};r(wp,"DecoratedPlayerBar");wp.type="DecoratedPlayerBar";var Z_=wp;var Tp=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.endpoint=new d(e.navigationEndpoint),this.large_form_factor_background_thumbnail=c.parseItem(e.largeFormFactorBackgroundThumbnail),this.small_form_factor_background_thumbnail=c.parseItem(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}};r(Tp,"DefaultPromoPanel");Tp.type="DefaultPromoPanel";var p0=Tp;var vp=class extends n{constructor(e){var i,s,o,a,l,f;if(super(),this.description=p.fromAttributed(e.description),this.max_lines=parseInt(e.maxLines),this.truncation_text=p.fromAttributed(e.truncationText),this.always_show_truncation_text=!!e.alwaysShowTruncationText,(o=(s=(i=e.rendererContext.commandContext)==null?void 0:i.onTap)==null?void 0:s.innertubeCommand)!=null&&o.showEngagementPanelEndpoint){let m=(f=(l=(a=e.rendererContext.commandContext)==null?void 0:a.onTap)==null?void 0:l.innertubeCommand)==null?void 0:f.showEngagementPanelEndpoint;this.more_endpoint={show_engagement_panel_endpoint:{engagement_panel:c.parseItem(m.engagementPanel,Ii),engagement_panel_popup_type:m.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:m.identifier.surface,tag:m.identifier.tag}}}}}};r(vp,"DescriptionPreviewView");vp.type="DescriptionPreviewView";var ex=vp;var Ip=class extends n{constructor(e){super(),this.headline=p.fromAttributed(e.headline)}};r(Ip,"DialogHeaderView");Ip.type="DialogHeaderView";var tx=Ip;var Sp=class extends n{constructor(e){super(),this.primary_button=c.parseItem(e.primaryButton,Te),this.secondary_button=c.parseItem(e.secondaryButton,Te),this.should_hide_divider=!!e.shouldHideDivider}};r(Sp,"PanelFooterView");Sp.type="PanelFooterView";var ix=Sp;var Ep=class extends n{constructor(e){super(),this.panel_footer=c.parseItem(e.panelFooter,ix),this.form_id=e.formId,this.container_type=e.containerType}};r(Ep,"FormFooterView");Ep.type="FormFooterView";var rx=Ep;var kp=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,tx),this.footer=c.parseItem(e.footer,rx),this.custom_content=c.parseItem(e.customContent,z_)}};r(kp,"DialogView");kp.type="DialogView";var c0=kp;var Cp=class extends n{constructor(e){super(),this.text=new p(e.didYouMean).toString(),this.corrected_query=new p(e.correctedQuery),this.endpoint=new d(e.navigationEndpoint||e.correctedQueryEndpoint)}};r(Cp,"DidYouMean");Cp.type="DidYouMean";var l0=Cp;var Pp=class extends n{constructor(e){super(),this.text=p.fromAttributed(e.text),this.max_lines=parseInt(e.maxLines)}};r(Pp,"DynamicTextView");Pp.type="DynamicTextView";var sx=Pp;var ar=class extends n{constructor(e){var i;super(),Reflect.has(e,"type")&&Reflect.has(e.type,"textType")&&(this.text=(i=e.type.textType.text)==null?void 0:i.content),this.properties=e.properties,Reflect.has(e,"childElements")&&(this.child_elements=e.childElements.map(s=>new ar(s)))}};r(ar,"ChildElement");ar.type="ChildElement";var ox=ar;var pr=class extends n{constructor(e){var s;if(super(),Reflect.has(e,"elementRenderer"))return c.parseItem(e,pr);let i=e.newElement.type.componentType;this.model=c.parseItem(i==null?void 0:i.model),Reflect.has(e,"newElement")&&Reflect.has(e.newElement,"childElements")&&(this.child_elements=G(((s=e.newElement.childElements)==null?void 0:s.map(o=>new ox(o)))||[]))}};r(pr,"Element");pr.type="Element";var nx=pr;var Np=class extends n{constructor(e){super(),this.title=new p(e.title),this.first_option=c.parseItem(e.firstOption),this.menu=c.parseItem(e.menu,R)}};r(Np,"EmergencyOnebox");Np.type="EmergencyOnebox";var u0=Np;var Ap=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new p(e.title),this.emoji_ids=e.emojiIds,this.image_loading_lazy=!!e.imageLoadingLazy,this.category_type=e.categoryType}};r(Ap,"EmojiPickerCategory");Ap.type="EmojiPickerCategory";var f0=Ap;var Rp=class extends n{constructor(e){var i;super(),this.category_id=e.categoryId,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),this.tooltip=e.tooltip}};r(Rp,"EmojiPickerCategoryButton");Rp.type="EmojiPickerCategoryButton";var m0=Rp;var Mp=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new p(e.title),this.upsell=new p(e.upsell),this.emoji_tooltip=e.emojiTooltip,this.endpoint=new d(e.command),this.emoji_ids=e.emojiIds}};r(Mp,"EmojiPickerUpsellCategory");Mp.type="EmojiPickerUpsellCategory";var h0=Mp;var ag,gt,Lp=class extends n{constructor(e){super(),ag.set(this,"playlist/get_add_to_playlist"),gt.set(this,void 0),I(this,gt,e,"f")}getApiPath(){return u(this,ag,"f")}buildRequest(){let e={};return e.videoIds=u(this,gt,"f").videoIds?u(this,gt,"f").videoIds:[u(this,gt,"f").videoId],u(this,gt,"f").playlistId&&(e.playlistId=u(this,gt,"f").playlistId),u(this,gt,"f").params&&(e.params=u(this,gt,"f").params),e.excludeWatchLater=!!u(this,gt,"f").excludeWatchLater,e}};r(Lp,"AddToPlaylistServiceEndpoint");ag=new WeakMap,gt=new WeakMap;Lp.type="AddToPlaylistServiceEndpoint";var ax=Lp;var Op=class extends ax{constructor(e){super(e)}};r(Op,"AddToPlaylistEndpoint");Op.type="AddToPlaylistEndpoint";var d0=Op;var pg,ye,Dp=class extends n{constructor(e){super(),pg.set(this,"browse"),ye.set(this,void 0),I(this,ye,e,"f")}getApiPath(){return u(this,pg,"f")}buildRequest(){let e={};return u(this,ye,"f").browseId&&(e.browseId=u(this,ye,"f").browseId),u(this,ye,"f").params&&(e.params=u(this,ye,"f").params),u(this,ye,"f").query&&(e.query=u(this,ye,"f").query),u(this,ye,"f").browseId==="FEsubscriptions"&&(e.subscriptionSettingsState=u(this,ye,"f").subscriptionSettingsState||"MY_SUBS_SETTINGS_STATE_LAYOUT_FORMAT_LIST"),u(this,ye,"f").browseId==="SPaccount_playback"&&(e.formData=u(this,ye,"f").formData||{accountSettingsFormData:{flagCaptionsDefaultOff:!1,flagAutoCaptionsDefaultOn:!1,flagDisableInlinePreview:!1,flagAudioDescriptionDefaultOn:!1}}),u(this,ye,"f").browseId==="FEwhat_to_watch"&&(u(this,ye,"f").browseRequestSupportedMetadata&&(e.browseRequestSupportedMetadata=u(this,ye,"f").browseRequestSupportedMetadata),u(this,ye,"f").inlineSettingStatus&&(e.inlineSettingStatus=u(this,ye,"f").inlineSettingStatus)),e}};r(Dp,"BrowseEndpoint");pg=new WeakMap,ye=new WeakMap;Dp.type="BrowseEndpoint";var _0=Dp;var cg,ue,Bp=class extends n{constructor(e){super(),cg.set(this,"comment/create_comment"),ue.set(this,void 0),I(this,ue,e,"f")}getApiPath(){return u(this,cg,"f")}buildRequest(){let e={};if(u(this,ue,"f").createCommentParams&&(e.createCommentParams=u(this,ue,"f").createCommentParams),u(this,ue,"f").commentText&&(e.commentText=u(this,ue,"f").commentText),u(this,ue,"f").attachedVideoId?e.videoAttachment={videoId:u(this,ue,"f").attachedVideoId}:u(this,ue,"f").pollOptions?e.pollAttachment={choices:u(this,ue,"f").pollOptions}:u(this,ue,"f").imageBlobId?e.imageAttachment={encryptedBlobId:u(this,ue,"f").imageBlobId}:u(this,ue,"f").sharedPostId&&(e.sharedPostAttachment={postId:u(this,ue,"f").sharedPostId}),u(this,ue,"f").accessRestrictions&&typeof u(this,ue,"f").accessRestrictions=="number"){let i=u(this,ue,"f").accessRestrictions===1?"RESTRICTION_TYPE_EVERYONE":"RESTRICTION_TYPE_SPONSORS_ONLY";e.accessRestrictions={restriction:i}}return u(this,ue,"f").botguardResponse&&(e.botguardResponse=u(this,ue,"f").botguardResponse),e}};r(Bp,"CreateCommentEndpoint");cg=new WeakMap,ue=new WeakMap;Bp.type="CreateCommentEndpoint";var x0=Bp;var lg,Le,Yp=class extends n{constructor(e){super(),lg.set(this,"playlist/create"),Le.set(this,void 0),I(this,Le,e,"f")}getApiPath(){return u(this,lg,"f")}buildRequest(){let e={};return u(this,Le,"f").title&&(e.title=u(this,Le,"f").title),u(this,Le,"f").privacyStatus&&(e.privacyStatus=u(this,Le,"f").privacyStatus),u(this,Le,"f").description&&(e.description=u(this,Le,"f").description),u(this,Le,"f").videoIds&&(e.videoIds=u(this,Le,"f").videoIds),u(this,Le,"f").params&&(e.params=u(this,Le,"f").params),u(this,Le,"f").sourcePlaylistId&&(e.sourcePlaylistId=u(this,Le,"f").sourcePlaylistId),e}};r(Yp,"CreatePlaylistServiceEndpoint");lg=new WeakMap,Le=new WeakMap;Yp.type="CreatePlaylistServiceEndpoint";var y0=Yp;var ug,Vp,Up=class extends n{constructor(e){super(),ug.set(this,"playlist/delete"),Vp.set(this,void 0),I(this,Vp,e,"f")}getApiPath(){return u(this,ug,"f")}buildRequest(){let e={};return u(this,Vp,"f").playlistId&&(e.playlistId=u(this,Vp,"f").sourcePlaylistId),e}};r(Up,"DeletePlaylistEndpoint");ug=new WeakMap,Vp=new WeakMap;Up.type="DeletePlaylistEndpoint";var b0=Up;var fg,Qt,Fp=class extends n{constructor(e){super(),fg.set(this,"feedback"),Qt.set(this,void 0),I(this,Qt,e,"f")}getApiPath(){return u(this,fg,"f")}buildRequest(){let e={};return u(this,Qt,"f").feedbackToken&&(e.feedbackTokens=[u(this,Qt,"f").feedbackToken]),u(this,Qt,"f").cpn&&(e.feedbackContext={cpn:u(this,Qt,"f").cpn}),e.isFeedbackTokenUnencrypted=!!u(this,Qt,"f").isFeedbackTokenUnencrypted,e.shouldMerge=!!u(this,Qt,"f").shouldMerge,e}};r(Fp,"FeedbackEndpoint");fg=new WeakMap,Qt=new WeakMap;Fp.type="FeedbackEndpoint";var g0=Fp;var mg,ne,Wp=class extends n{constructor(e){super(),mg.set(this,"account/accounts_list"),ne.set(this,void 0),I(this,ne,e,"f")}getApiPath(){return u(this,mg,"f")}buildRequest(){let e={};return u(this,ne,"f").requestType&&(e.requestType=u(this,ne,"f").requestType,(u(this,ne,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER"||u(this,ne,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_IDENTITY_PROMPT")&&u(this,ne,"f").nextUrl&&(e.nextNavendpoint={urlEndpoint:{url:u(this,ne,"f").nextUrl}})),u(this,ne,"f").channelSwitcherQuery&&(e.channelSwitcherQuery=u(this,ne,"f").channelSwitcherQuery),u(this,ne,"f").triggerChannelCreation&&(e.triggerChannelCreation=u(this,ne,"f").triggerChannelCreation),u(this,ne,"f").contentOwnerConfig&&u(this,ne,"f").contentOwnerConfig.externalContentOwnerId&&(e.contentOwnerConfig=u(this,ne,"f").contentOwnerConfig),u(this,ne,"f").obfuscatedSelectedGaiaId&&(e.obfuscatedSelectedGaiaId=u(this,ne,"f").obfuscatedSelectedGaiaId),u(this,ne,"f").selectedSerializedDelegationContext&&(e.selectedSerializedDelegationContext=u(this,ne,"f").selectedSerializedDelegationContext),u(this,ne,"f").callCircumstance&&(e.callCircumstance=u(this,ne,"f").callCircumstance),e}};r(Wp,"GetAccountsListInnertubeEndpoint");mg=new WeakMap,ne=new WeakMap;Wp.type="GetAccountsListInnertubeEndpoint";var w0=Wp;var Gp=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier}};r(Gp,"HideEngagementPanelEndpoint");Gp.type="HideEngagementPanelEndpoint";var T0=Gp;var hg,dg,_g,wt,jp=class extends n{constructor(e){super(),hg.set(this,"like/like"),dg.set(this,"like/dislike"),_g.set(this,"like/removelike"),wt.set(this,void 0),I(this,wt,e,"f")}getApiPath(){return u(this,wt,"f").status==="DISLIKE"?u(this,dg,"f"):u(this,wt,"f").status==="INDIFFERENT"?u(this,_g,"f"):u(this,hg,"f")}buildRequest(){let e={};u(this,wt,"f").target&&(e.target=u(this,wt,"f").target);let i=this.getParams();return i&&(e.params=i),e}getParams(){switch(u(this,wt,"f").status){case"LIKE":return u(this,wt,"f").likeParams;case"DISLIKE":return u(this,wt,"f").dislikeParams;case"INDIFFERENT":return u(this,wt,"f").removeLikeParams;default:return}}};r(jp,"LikeEndpoint");hg=new WeakMap,dg=new WeakMap,_g=new WeakMap,wt=new WeakMap;jp.type="LikeEndpoint";var v0=jp;var xg,Hp,$p=class extends n{constructor(e){super(),xg.set(this,"live_chat/get_item_context_menu"),Hp.set(this,void 0),I(this,Hp,e,"f")}getApiPath(){return u(this,xg,"f")}buildRequest(){let e={};return u(this,Hp,"f").params&&(e.params=u(this,Hp,"f").params),e}};r($p,"LiveChatItemContextMenuEndpoint");xg=new WeakMap,Hp=new WeakMap;$p.type="LiveChatItemContextMenuEndpoint";var I0=$p;var yg,cr,Kp=class extends n{constructor(e){super(),yg.set(this,"notification/modify_channel_preference"),cr.set(this,void 0),I(this,cr,e,"f")}getApiPath(){return u(this,yg,"f")}buildRequest(){let e={};return u(this,cr,"f").params&&(e.params=u(this,cr,"f").params),u(this,cr,"f").secondaryParams&&(e.secondaryParams=u(this,cr,"f").secondaryParams),e}};r(Kp,"ModifyChannelNotificationPreferenceEndpoint");yg=new WeakMap,cr=new WeakMap;Kp.type="ModifyChannelNotificationPreferenceEndpoint";var S0=Kp;var bg,lr,qp=class extends n{constructor(e){super(),bg.set(this,"comment/perform_comment_action"),lr.set(this,void 0),I(this,lr,e,"f")}getApiPath(){return u(this,bg,"f")}buildRequest(){let e={};return u(this,lr,"f").actions&&(e.actions=u(this,lr,"f").actions),u(this,lr,"f").action&&(e.actions=[u(this,lr,"f").action]),e}};r(qp,"PerformCommentActionEndpoint");bg=new WeakMap,lr=new WeakMap;qp.type="PerformCommentActionEndpoint";var E0=qp;var gg,Jt,zp=class extends n{constructor(e){super(),gg.set(this,"browse/edit_playlist"),Jt.set(this,void 0),I(this,Jt,e,"f")}getApiPath(){return u(this,gg,"f")}buildRequest(){let e={};return u(this,Jt,"f").actions&&(e.actions=u(this,Jt,"f").actions),u(this,Jt,"f").playlistId&&(e.playlistId=u(this,Jt,"f").playlistId),u(this,Jt,"f").params&&(e.params=u(this,Jt,"f").params),e}};r(zp,"PlaylistEditEndpoint");gg=new WeakMap,Jt=new WeakMap;zp.type="PlaylistEditEndpoint";var k0=zp;var wg,ce,Xp=class extends n{constructor(e){super(),wg.set(this,"player"),ce.set(this,void 0),I(this,ce,e,"f")}getApiPath(){return u(this,wg,"f")}buildRequest(){let e={};return u(this,ce,"f").videoId&&(e.videoId=u(this,ce,"f").videoId),u(this,ce,"f").playlistId&&(e.playlistId=u(this,ce,"f").playlistId),(u(this,ce,"f").index!==void 0||u(this,ce,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,ce,"f").index||u(this,ce,"f").playlistIndex),(u(this,ce,"f").playerParams||u(this,ce,"f").params)&&(e.params=u(this,ce,"f").playerParams||u(this,ce,"f").params),u(this,ce,"f").startTimeSeconds&&(e.startTimeSecs=u(this,ce,"f").startTimeSeconds),u(this,ce,"f").overrideMutedAtStart&&(e.overrideMutedAtStart=u(this,ce,"f").overrideMutedAtStart),e.racyCheckOk=!!u(this,ce,"f").racyCheckOk,e.contentCheckOk=!!u(this,ce,"f").contentCheckOk,e}};r(Xp,"WatchEndpoint");wg=new WeakMap,ce=new WeakMap;Xp.type="WatchEndpoint";var px=Xp;var Qp=class extends px{constructor(e){super(e)}};r(Qp,"PrefetchWatchCommand");Qp.type="PrefetchWatchCommand";var C0=Qp;var Tg,ke,Jp=class extends n{constructor(e){super(),Tg.set(this,"reel/reel_item_watch"),ke.set(this,void 0),I(this,ke,e,"f")}getApiPath(){return u(this,Tg,"f")}buildRequest(){let e={};return u(this,ke,"f").videoId&&(e.playerRequest={videoId:u(this,ke,"f").videoId}),e.playerRequest&&(u(this,ke,"f").playerParams&&(e.playerRequest.params=u(this,ke,"f").playerParams),u(this,ke,"f").racyCheckOk&&(e.playerRequest.racyCheckOk=!!u(this,ke,"f").racyCheckOk),u(this,ke,"f").contentCheckOk&&(e.playerRequest.contentCheckOk=!!u(this,ke,"f").contentCheckOk)),u(this,ke,"f").params&&(e.params=u(this,ke,"f").params),u(this,ke,"f").inputType&&(e.inputType=u(this,ke,"f").inputType),e.disablePlayerResponse=!!u(this,ke,"f").disablePlayerResponse,e}};r(Jp,"ReelWatchEndpoint");Tg=new WeakMap,ke=new WeakMap;Jp.type="ReelWatchEndpoint";var P0=Jp;var vg,Tt,Zp=class extends n{constructor(e){super(),vg.set(this,"search"),Tt.set(this,void 0),I(this,Tt,e,"f")}getApiPath(){return u(this,vg,"f")}buildRequest(){let e={};return u(this,Tt,"f").query&&(e.query=u(this,Tt,"f").query),u(this,Tt,"f").params&&(e.params=u(this,Tt,"f").params),u(this,Tt,"f").webSearchboxStatsUrl&&(e.webSearchboxStatsUrl=u(this,Tt,"f").webSearchboxStatsUrl),u(this,Tt,"f").suggestStats&&(e.suggestStats=u(this,Tt,"f").suggestStats),e}};r(Zp,"SearchEndpoint");vg=new WeakMap,Tt=new WeakMap;Zp.type="SearchEndpoint";var N0=Zp;var Ig,ur,ec=class extends n{constructor(e){super(),Ig.set(this,"share/get_share_panel"),ur.set(this,void 0),I(this,ur,e,"f")}getApiPath(){return u(this,Ig,"f")}buildRequest(){let e={};return u(this,ur,"f").serializedShareEntity&&(e.serializedSharedEntity=u(this,ur,"f").serializedShareEntity),u(this,ur,"f").clientParams&&(e.clientParams=u(this,ur,"f").clientParams),e}};r(ec,"ShareEntityServiceEndpoint");Ig=new WeakMap,ur=new WeakMap;ec.type="ShareEntityServiceEndpoint";var Zr=ec;var tc=class extends Zr{constructor(e){super(e)}};r(tc,"ShareEndpoint");tc.type="ShareEndpoint";var A0=tc;var ic=class extends Zr{constructor(e){super(e)}};r(ic,"ShareEntityEndpoint");ic.type="ShareEntityEndpoint";var R0=ic;var rc=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier,this.source_panel_identifier=e.sourcePanelIdentifier}};r(rc,"ShowEngagementPanelEndpoint");rc.type="ShowEngagementPanelEndpoint";var M0=rc;var sc=class extends n{constructor(e){super(),Array.isArray(e.actions)&&(this.actions=c.parseArray(e.actions.map(i=>(delete i.clickTrackingParams,i)))),this.signal=e.signal}};r(sc,"SignalServiceEndpoint");sc.type="SignalServiceEndpoint";var L0=sc;var Sg,Je,oc=class extends n{constructor(e){super(),Sg.set(this,"subscription/subscribe"),Je.set(this,void 0),I(this,Je,e,"f")}getApiPath(){return u(this,Sg,"f")}buildRequest(){let e={};return u(this,Je,"f").channelIds&&(e.channelIds=u(this,Je,"f").channelIds),u(this,Je,"f").siloName&&(e.siloName=u(this,Je,"f").siloName),u(this,Je,"f").params&&(e.params=u(this,Je,"f").params),u(this,Je,"f").botguardResponse&&(e.botguardResponse=u(this,Je,"f").botguardResponse),u(this,Je,"f").feature&&(e.clientFeature=u(this,Je,"f").feature),e}};r(oc,"SubscribeEndpoint");Sg=new WeakMap,Je=new WeakMap;oc.type="SubscribeEndpoint";var O0=oc;var Eg,Zt,nc=class extends n{constructor(e){super(),Eg.set(this,"subscription/unsubscribe"),Zt.set(this,void 0),I(this,Zt,e,"f")}getApiPath(){return u(this,Eg,"f")}buildRequest(){let e={};return u(this,Zt,"f").channelIds&&(e.channelIds=u(this,Zt,"f").channelIds),u(this,Zt,"f").siloName&&(e.siloName=u(this,Zt,"f").siloName),u(this,Zt,"f").params&&(e.params=u(this,Zt,"f").params),e}};r(nc,"UnsubscribeEndpoint");Eg=new WeakMap,Zt=new WeakMap;nc.type="UnsubscribeEndpoint";var D0=nc;var kg,ve,ac=class extends n{constructor(e){super(),kg.set(this,"next"),ve.set(this,void 0),I(this,ve,e,"f")}getApiPath(){return u(this,kg,"f")}buildRequest(){let e={};return u(this,ve,"f").videoId&&(e.videoId=u(this,ve,"f").videoId),u(this,ve,"f").playlistId&&(e.playlistId=u(this,ve,"f").playlistId),(u(this,ve,"f").index!==void 0||u(this,ve,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,ve,"f").index||u(this,ve,"f").playlistIndex),(u(this,ve,"f").playerParams||u(this,ve,"f").params)&&(e.params=u(this,ve,"f").playerParams||u(this,ve,"f").params),e.racyCheckOk=!!u(this,ve,"f").racyCheckOk,e.contentCheckOk=!!u(this,ve,"f").contentCheckOk,e}};r(ac,"WatchNextEndpoint");kg=new WeakMap,ve=new WeakMap;ac.type="WatchNextEndpoint";var B0=ac;var pc=class extends n{constructor(e){super(),this.elements=c.parseArray(e.elements),this.start_ms=e.startMs}};r(pc,"Endscreen");pc.type="Endscreen";var cx=pc;var cc=class extends n{constructor(e){super(),this.style=e.style,this.title=new p(e.title),this.endpoint=new d(e.endpoint),Reflect.has(e,"image")&&(this.image=y.fromResponse(e.image)),Reflect.has(e,"icon")&&(this.icon=y.fromResponse(e.icon)),Reflect.has(e,"metadata")&&(this.metadata=new p(e.metadata)),Reflect.has(e,"callToAction")&&(this.call_to_action=new p(e.callToAction)),Reflect.has(e,"hovercardButton")&&(this.hovercard_button=c.parseItem(e.hovercardButton)),Reflect.has(e,"isSubscribe")&&(this.is_subscribe=!!e.isSubscribe),Reflect.has(e,"playlistLength")&&(this.playlist_length=new p(e.playlistLength)),Reflect.has(e,"thumbnailOverlays")&&(this.thumbnail_overlays=c.parseArray(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}};r(cc,"EndscreenElement");cc.type="EndscreenElement";var Y0=cc;var lc=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new p(e.title),this.author=new p(e.longBylineText),this.endpoint=new d(e.navigationEndpoint),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.videoCountText)}};r(lc,"EndScreenPlaylist");lc.type="EndScreenPlaylist";var lx=lc;var uc=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText,e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.short_view_count=new p(e.shortViewCountText),this.badges=c.parseArray(e.badges),this.duration={text:new p(e.lengthText).toString(),seconds:e.lengthInSeconds}}};r(uc,"EndScreenVideo");uc.type="EndScreenVideo";var ux=uc;var fc=class extends n{constructor(e){super(),this.disclaimer=new p(e.disclaimer),this.info_icon={icon_type:e.infoIcon.iconType},this.usage_scenario=e.usageScenario}};r(fc,"EomSettingsDisclaimer");fc.type="EomSettingsDisclaimer";var V0=fc;var mc=class extends n{constructor(e){super(),this.title=e.title,this.endpoint=new d(e.endpoint),this.selected=e.selected,this.content=c.parseItem(e.content)}};r(mc,"ExpandableTab");mc.type="ExpandableTab";var es=mc;var hc=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(hc,"ExpandedShelfContents");hc.type="ExpandedShelfContents";var U0=hc;var dc=class extends n{constructor(e){super(),this.dialog_message=new p(e.dialogMessage),this.confirm_label=new p(e.confirmLabel)}};r(dc,"FancyDismissibleDialog");dc.type="FancyDismissibleDialog";var F0=dc;var _c=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents,je)}};r(_c,"FeedFilterChipBar");_c.type="FeedFilterChipBar";var vt=_c;var xc=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.endpoint=new d(e.impressionEndpoint),this.apply_modernized_style=e.applyModernizedStyle,this.trim_style=e.trimStyle,this.background_style=e.backgroundStyle}};r(xc,"FeedNudge");xc.type="FeedNudge";var W0=xc;var yc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(yc,"FeedTabbedHeader");yc.type="FeedTabbedHeader";var fx=yc;var bc=class extends n{constructor(e){super(),this.actions_rows=e.actionsRows.map(i=>({actions:c.parseArray(i.actions,[Te,yt])})),this.style=e.style}};r(bc,"FlexibleActionsView");bc.type="FlexibleActionsView";var mx=bc;var gc=class extends n{constructor(e){super(),this.title=new p(e.title),this.box_art=y.fromResponse(e.boxArt),this.box_art_overlay_text=new p(e.boxArtOverlayText),this.endpoint=new d(e.endpoint),this.is_official_box_art=!!e.isOfficialBoxArt}};r(gc,"GameDetails");gc.type="GameDetails";var G0=gc;var wc=class extends n{constructor(e){var i,s,o;super(),this.items=c.parseArray(e.items),Reflect.has(e,"header")&&(this.header=c.parseItem(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=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}get contents(){return this.items}};r(wc,"Grid");wc.type="Grid";var j0=wc;var Tc=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new p(e.subscriberCountText),this.video_count=new p(e.videoCountText),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton)}};r(Tc,"GridChannel");Tc.type="GridChannel";var hx=Tc;var vc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(vc,"GridHeader");vc.type="GridHeader";var H0=vc;var Ic=class extends n{constructor(e){var i,s;super(),this.id=e.playlistId,this.title=new p(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new p(e.shortBylineText):(s=e.longBylineText)!=null&&s.simpleText?new p(e.longBylineText):null,this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.videoCountText),this.video_count_short=new p(e.videoCountShortText),this.endpoint=new d(e.navigationEndpoint),this.secondary_endpoint=new d(e.secondaryNavigationEndpoint),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays)}};r(Ic,"GridMix");Ic.type="GridMix";var $0=Ic;var Sc=class extends n{constructor(e){var s;super();let i=(s=e.thumbnailOverlays.find(o=>o.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.duration=e.lengthText?new p(e.lengthText):i!=null&&i.text?new p(i.text):null,this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges,Ge),this.metadata=new p(e.metadata),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays)}};r(Sc,"GridMovie");Sc.type="GridMovie";var K0=Sc;var Ec=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new p(e.title),Reflect.has(e,"shortBylineText")&&(this.author=new P(e.shortBylineText,e.ownerBadges)),this.badges=c.parseArray(e.ownerBadges),this.endpoint=new d(e.navigationEndpoint),this.view_playlist=new p(e.viewPlaylistText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...((i=e.sidebarThumbnails)==null?void 0:i.map(s=>y.fromResponse(s)))||[])||null,this.video_count=new p(e.thumbnailText),this.video_count_short=new p(e.videoCountShortText)}};r(Ec,"GridPlaylist");Ec.type="GridPlaylist";var dx=Ec;var kc=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(kc,"ShowCustomThumbnail");kc.type="ShowCustomThumbnail";var _x=kc;var Cc=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new p(e.text)),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(Cc,"ThumbnailOverlayBottomPanel");Cc.type="ThumbnailOverlayBottomPanel";var xx=Cc;var Pc=class extends n{constructor(e){super(),this.title=new p(e.title),this.thumbnail_renderer=q(e.thumbnailRenderer,_x),this.endpoint=new d(e.navigationEndpoint),this.long_byline_text=new p(e.longBylineText),this.thumbnail_overlays=Ce(e.thumbnailOverlays,xx),this.author=new P(e.shortBylineText,void 0)}};r(Pc,"GridShow");Pc.type="GridShow";var q0=Pc;var Nc=class extends n{constructor(e){var s,o;super();let i=(s=e.thumbnailOverlays.find(a=>a.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.rich_thumbnail=c.parseItem(e.richThumbnail),this.published=new p(e.publishedTimeText),this.duration=e.lengthText?new p(e.lengthText):i!=null&&i.text?new p(i.text):null,this.author=e.shortBylineText&&new P(e.shortBylineText,e.ownerBadges),this.views=new p(e.viewCountText),this.short_view_count=new p(e.shortViewCountText),this.endpoint=new d(e.navigationEndpoint),this.menu=c.parseItem(e.menu,R),Reflect.has(e,"buttons")&&(this.buttons=c.parseArray(e.buttons)),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)),this.upcoming_text=new p(e.upcomingEventData.upcomingEventText),this.is_reminder_set=!!((o=e.upcomingEventData)!=null&&o.isReminderSet))}get is_upcoming(){return Boolean(this.upcoming&&this.upcoming>new Date)}};r(Nc,"GridVideo");Nc.type="GridVideo";var yx=Nc;var Ac=class extends n{constructor(e){super(),this.title=new p(e.formattedTitle),this.endpoint=new d(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=y.fromResponse(e.thumbnail)),Reflect.has(e,"badges")&&(this.badges=e.badges),this.is_primary=!!e.isPrimary}};r(Ac,"GuideEntry");Ac.type="GuideEntry";var fr=Ac;var Rc=class extends n{constructor(e){super(),this.expander_item=q(e.expanderItem,fr),this.collapser_item=q(e.collapserItem,fr),this.expandable_items=Ce(e.expandableItems)}};r(Rc,"GuideCollapsibleEntry");Rc.type="GuideCollapsibleEntry";var z0=Rc;var Mc=class extends n{constructor(e){super(),this.header_entry=q(e.headerEntry),this.expander_icon=e.expanderIcon.iconType,this.collapser_icon=e.collapserIcon.iconType,this.section_items=Ce(e.sectionItems)}};r(Mc,"GuideCollapsibleSectionEntry");Mc.type="GuideCollapsibleSectionEntry";var X0=Mc;var Lc=class extends fr{constructor(e){super(e.entryRenderer.guideEntryRenderer),this.always_show=!!e.alwaysShow}};r(Lc,"GuideDownloadsEntry");Lc.type="GuideDownloadsEntry";var Q0=Lc;var Oc=class extends n{constructor(e){super(),Reflect.has(e,"formattedTitle")&&(this.title=new p(e.formattedTitle)),this.items=Ce(e.items)}};r(Oc,"GuideSection");Oc.type="GuideSection";var ts=Oc;var Dc=class extends ts{};r(Dc,"GuideSubscriptionsSection");Dc.type="GuideSubscriptionsSection";var bx=Dc;var Bc=class extends n{constructor(e){super(),this.hashtag=new p(e.hashtag),this.hashtag_info=new p(e.hashtagInfoText)}};r(Bc,"HashtagHeader");Bc.type="HashtagHeader";var gx=Bc;var Yc=class extends n{constructor(e){super(),this.hashtag=new p(e.hashtag),this.hashtag_info_text=new p(e.hashtagInfoText),this.hashtag_thumbnail=y.fromResponse(e.hashtagThumbnail),this.endpoint=new d(e.onTapCommand),this.hashtag_background_color=e.hashtagBackgroundColor,this.hashtag_video_count=new p(e.hashtagVideoCount),this.hashtag_channel_count=new p(e.hashtagChannelCount)}};r(Yc,"HashtagTile");Yc.type="HashtagTile";var J0=Yc;var Vc=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap)}};r(Vc,"HeroPlaylistThumbnail");Vc.type="HeroPlaylistThumbnail";var Z0=Vc;var Uc=class extends n{constructor(e){super(),e.thumbnail&&(this.thumbnail={image:y.fromResponse(e.thumbnail.image),endpoint:new d(e.thumbnail.onTap),on_long_press_endpoint:new d(e.thumbnail.onLongPress),content_mode:e.thumbnail.contentMode,crop_options:e.thumbnail.cropOptions}),this.background_image={image:y.fromResponse(e.backgroundImage.image),gradient_image:y.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 d(e.cta.onTap),accessibility_text:e.cta.accessibilityText,state:e.cta.state},this.text_on_tap_endpoint=new d(e.textOnTap)}};r(Uc,"Panel");Uc.type="Panel";var Fc=class extends n{constructor(e){super(),this.panels=G(e.highlightsCarousel.panels.map(i=>new Uc(i)))}};r(Fc,"HighlightsCarousel");Fc.type="HighlightsCarousel";var ev=Fc;var Wc=class extends n{constructor(e){super(),this.suggestion=new p(e.suggestion),this.endpoint=new d(e.navigationEndpoint),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"serviceEndpoint")&&(this.service_endpoint=new d(e.serviceEndpoint))}};r(Wc,"SearchSuggestion");Wc.type="SearchSuggestion";var wx=Wc;var Gc=class extends wx{constructor(e){super(e)}};r(Gc,"HistorySuggestion");Gc.type="HistorySuggestion";var tv=Gc;var jc=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.previous_button=c.parseItem(e.previousButton,v),this.next_button=c.parseItem(e.nextButton,v)}get contents(){return this.items}};r(jc,"HorizontalMovieList");jc.type="HorizontalMovieList";var iv=jc;var Hc=class extends n{constructor(e){var i;super(),this.icon_type=(i=e.icon)==null?void 0:i.iconType,Reflect.has(e,"tooltip")&&(this.tooltip=new p(e.tooltip).toString()),this.endpoint=new d(e.navigationEndpoint)}};r(Hc,"IconLink");Hc.type="IconLink";var Tx=Hc;var $c=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r($c,"ImageBannerView");$c.type="ImageBannerView";var vx=$c;var Kc=class extends n{constructor(e){super(),this.including_results_for=new p(e.includingResultsFor),this.corrected_query=new p(e.correctedQuery),this.corrected_query_endpoint=new d(e.correctedQueryEndpoint),this.search_only_for=Reflect.has(e,"searchOnlyFor")?new p(e.searchOnlyFor):void 0,this.original_query=Reflect.has(e,"originalQuery")?new p(e.originalQuery):void 0,this.original_query_endpoint=Reflect.has(e,"originalQueryEndpoint")?new d(e.originalQueryEndpoint):void 0}};r(Kc,"IncludingResultsFor");Kc.type="IncludingResultsFor";var rv=Kc;var qc=class extends n{constructor(e){super(),this.title=new p(e.title),this.source=new p(e.source),Reflect.has(e,"paragraphs")&&(this.paragraphs=e.paragraphs.map(i=>new p(i))),Reflect.has(e,"attributedParagraphs")&&(this.attributed_paragraphs=e.attributedParagraphs.map(i=>p.fromAttributed(i))),this.thumbnail=y.fromResponse(e.thumbnail),this.source_endpoint=new d(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)}};r(qc,"InfoPanelContent");qc.type="InfoPanelContent";var Ix=qc;var zc=class extends n{constructor(e){var i;super(),this.title=new p(e.title),this.menu=c.parseItem(e.menu,R),this.content=c.parseItem(e.content,Ix),e.headerEndpoint&&(this.header_endpoint=new d(e.headerEndpoint)),this.background=e.background,this.title_style=e.titleStyle,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType)}};r(zc,"InfoPanelContainer");zc.type="InfoPanelContainer";var Sx=zc;var Xc=class extends n{constructor(e){super(),this.header_type=e.type,this.title=new p(e.title),this.description=new p(e.description),this.metadata=new p(e.metadata),this.badges=c.parseArray(e.badges,Ge),this.box_art=y.fromResponse(e.boxArt),this.banner=y.fromResponse(e.banner),this.buttons=c.parseArray(e.buttons,[xe,v]),this.auto_generated=new p(e.autoGenerated)}};r(Xc,"InteractiveTabbedHeader");Xc.type="InteractiveTabbedHeader";var Ex=Xc;var Qc=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Qc,"ItemSectionHeader");Qc.type="ItemSectionHeader";var is=Qc;var Jc=class extends n{constructor(e){super(),this.title=new p(e.title),this.selected=!!e.selected,this.endpoint=new d(e.endpoint)}};r(Jc,"ItemSectionTab");Jc.type="Tab";var kx=Jc;var Zc=class extends n{constructor(e){super(),this.title=new p(e.title),this.tabs=c.parseArray(e.tabs,kx),Reflect.has(e,"endItems")&&(this.end_items=c.parseArray(e.endItems))}};r(Zc,"ItemSectionTabbedHeader");Zc.type="ItemSectionTabbedHeader";var rs=Zc;var el=class extends n{constructor(e){super(),this.filter_menu=c.parseItem(e.filterMenu,mr.SortFilterSubMenu)}};r(el,"SortFilterHeader");el.type="SortFilterHeader";var Cx=el;var tl=class extends n{constructor(e){var i,s,o;super(),this.header=c.parseItem(e.header,[Si,is,rs,Cx,vt]),this.contents=c.parseArray(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=e.targetId||e.sectionIdentifier),e.continuations&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(tl,"ItemSection");tl.type="ItemSection";var It=tl;var il=class extends n{constructor(e){var i,s;super(),this.header=c.parseItem(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=(s=(i=e.continuations[0])==null?void 0:i.reloadContinuationData)==null?void 0:s.continuation,this.client_messages={reconnect_message:new p(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new p(e.clientMessages.unableToReconnectMessage),fatal_error:new p(e.clientMessages.fatalError),reconnected_message:new p(e.clientMessages.reconnectedMessage),generic_error:new p(e.clientMessages.genericError)},this.is_replay=!!e.isReplay}};r(il,"LiveChat");il.type="LiveChat";var Px=il;var rl=class extends n{constructor(e){super(),this.text=new p(e.text),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(rl,"LiveChatBannerHeader");rl.type="LiveChatBannerHeader";var Nx=rl;var sl=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,Nx),this.contents=c.parseItem(e.contents),this.action_id=e.actionId,this.viewer_is_creator=e.viewerIsCreator,this.target_id=e.targetId,this.is_stackable=e.isStackable,this.background_type=e.backgroundType}};r(sl,"LiveChatBanner");sl.type="LiveChatBanner";var Ax=sl;var ol=class extends n{constructor(e){super(),this.banner=c.parseItem(e.bannerRenderer,Ax)}};r(ol,"AddBannerToLiveChatCommand");ol.type="AddBannerToLiveChatCommand";var sv=ol;var nl=class extends n{constructor(e){super(),this.item=c.parseItem(e.item),Reflect.has(e,"clientId")&&(this.client_id=e.clientId)}};r(nl,"AddChatItemAction");nl.type="AddChatItemAction";var Rx=nl;var al=class extends n{constructor(e){super(),this.item=c.parseItem(e.item),this.duration_sec=e.durationSec}};r(al,"AddLiveChatTickerItemAction");al.type="AddLiveChatTickerItemAction";var ov=al;var pl=class extends n{constructor(e){super(),this.client_assigned_id=e.clientAssignedId}};r(pl,"DimChatItemAction");pl.type="DimChatItemAction";var nv=pl;var cl=class extends n{constructor(e){super(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.moderation_buttons=c.parseArray(e.moderationButtons,v),this.auto_moderated_item=c.parseItem(e.autoModeratedItem),this.header_text=new p(e.headerText),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(cl,"LiveChatAutoModMessage");cl.type="LiveChatAutoModMessage";var av=cl;var ll=class extends n{constructor(e){super(),this.id=e.liveChatSummaryId,this.chat_summary=new p(e.chatSummary),this.icon_type=e.icon.iconType,this.like_feedback_button=c.parseItem(e.likeFeedbackButton,yt),this.dislike_feedback_button=c.parseItem(e.dislikeFeedbackButton,yt)}};r(ll,"LiveChatBannerChatSummary");ll.type="LiveChatBannerChatSummary";var pv=ll;var ul=class extends n{constructor(e){super(),this.poll_question=new p(e.pollQuestion),this.author_photo=y.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(i=>({option_id:i.pollOptionId,text:new p(i.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(ul,"LiveChatBannerPoll");ul.type="LiveChatBannerPoll";var cv=ul;var fl=class extends n{constructor(e){super(),this.banner_message=new p(e.bannerMessage),this.author_photo=y.fromResponse(e.authorPhoto),this.inline_action_button=c.parseItem(e.inlineActionButton,v),this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(fl,"LiveChatBannerRedirect");fl.type="LiveChatBannerRedirect";var lv=fl;var ml=class extends n{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.header_subtext=new p(e.headerSubtext),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new d(e.contextMenuEndpoint)}};r(ml,"LiveChatMembershipItem");ml.type="LiveChatMembershipItem";var uv=ml;var hl=class extends n{constructor(e){super(),this.id=e.id,this.icon_type=e.icon.iconType,this.text=new p(e.text),this.subtext=new p(e.subtext),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,this.timestamp_text=new p(e.timestampText)}};r(hl,"LiveChatModeChangeMessage");hl.type="LiveChatModeChangeMessage";var fv=hl;var dl=class extends n{constructor(e){super(),this.message=new p(e.message),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),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 p(e.purchaseAmountText).toString(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_text=new p(e.timestampText).toString(),this.id=e.id}};r(dl,"LiveChatPaidMessage");dl.type="LiveChatPaidMessage";var mv=dl;var _l=class extends n{constructor(e){super(),this.id=e.id,this.author=new P(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=y.fromResponse(e.sticker),this.purchase_amount=new p(e.purchaseAmountText).toString(),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu=this.menu_endpoint,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(_l,"LiveChatPaidSticker");_l.type="LiveChatPaidSticker";var hv=_l;var xl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(xl,"LiveChatPlaceholderItem");xl.type="LiveChatPlaceholderItem";var dv=xl;var yl=class extends n{constructor(e){super(),this.title=e.title,this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.from_vendor_text=e.fromVendorText,this.information_button=c.parseItem(e.informationButton),this.endpoint=new d(e.onClickCommand),this.creator_message=e.creatorMessage,this.creator_name=e.creatorName,this.author_photo=y.fromResponse(e.authorPhoto),this.information_dialog=c.parseItem(e.informationDialog),this.is_verified=e.isVerified,this.creator_custom_message=new p(e.creatorCustomMessage)}};r(yl,"LiveChatProductItem");yl.type="LiveChatProductItem";var _v=yl;var bl=class extends n{constructor(e){super(),this.message=new p(e.message),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(bl,"LiveChatRestrictedParticipation");bl.type="LiveChatRestrictedParticipation";var xv=bl;var gl=class extends Ge{constructor(e){super(e),this.custom_thumbnail=y.fromResponse(e.customThumbnail)}};r(gl,"LiveChatAuthorBadge");gl.type="LiveChatAuthorBadge";var Mx=gl;var wl=class extends n{constructor(e){super(),this.author_name=new p(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.author_badges=c.parseArray(e.authorBadges,Mx),this.primary_text=new p(e.primaryText),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.image=y.fromResponse(e.image)}};r(wl,"LiveChatSponsorshipsHeader");wl.type="LiveChatSponsorshipsHeader";var Lx=wl;var Tl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.author_external_channel_id=e.authorExternalChannelId,this.header=c.parseItem(e.header,Lx)}};r(Tl,"LiveChatSponsorshipsGiftPurchaseAnnouncement");Tl.type="LiveChatSponsorshipsGiftPurchaseAnnouncement";var yv=Tl;var vl=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.timestamp_text=new p(e.timestampText),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.message=new p(e.message),this.menu_endpoint=new d(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}};r(vl,"LiveChatSponsorshipsGiftRedemptionAnnouncement");vl.type="LiveChatSponsorshipsGiftRedemptionAnnouncement";var bv=vl;var hr=class extends n{constructor(e){super(),this.message=new p(e.message),this.inline_action_buttons=c.parseArray(e.inlineActionButtons,v),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(hr,"LiveChatMessageBase");hr.type="LiveChatMessageBase";var Il=class extends hr{constructor(e){super(e),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new d(e.contextMenuEndpoint)}};r(Il,"LiveChatTextMessage");Il.type="LiveChatTextMessage";var gv=Il;var Sl=class extends n{constructor(e){var i,s;super(),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.amount=new p(e.amount),this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=c.parseItem((s=(i=e.showItemEndpoint)==null?void 0:i.showLiveChatItemEndpoint)==null?void 0:s.renderer),this.show_item_endpoint=new d(e.showItemEndpoint),this.id=e.id}};r(Sl,"LiveChatTickerPaidMessageItem");Sl.type="LiveChatTickerPaidMessageItem";var Ox=Sl;var El=class extends Ox{};r(El,"LiveChatTickerPaidStickerItem");El.type="LiveChatTickerPaidStickerItem";var wv=El;var kl=class extends n{constructor(e){super(),this.id=e.id,this.detail=new p(e.detailText),this.author=new P(e.authorName,e.authorBadges,e.sponsorPhoto,e.authorExternalChannelId),this.duration_sec=e.durationSec}};r(kl,"LiveChatTickerSponsorItem");kl.type="LiveChatTickerSponsorItem";var Tv=kl;var Cl=class extends hr{constructor(e){super(e),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.action_button=c.parseItem(e.actionButton)}};r(Cl,"LiveChatViewerEngagementMessage");Cl.type="LiveChatViewerEngagementMessage";var vv=Cl;var Pl=class extends n{constructor(e){super(),this.poll_question=new p(e.pollQuestion),this.thumbnails=y.fromResponse(e.thumbnail),this.metadata=new p(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=c.parseItem(e.contextMenuButton,v)}};r(Pl,"PollHeader");Pl.type="PollHeader";var Iv=Pl;var Nl=class extends n{constructor(e){super(),this.id=e.id,this.contents=c.parse(e.contents),this.target_id=e.targetId}};r(Nl,"LiveChatActionPanel");Nl.type="LiveChatActionPanel";var Dx=Nl;var Al=class extends n{constructor(e){super(),this.deleted_state_message=new p(e.deletedStateMessage),this.target_item_id=e.targetItemId}};r(Al,"MarkChatItemAsDeletedAction");Al.type="MarkChatItemAsDeletedAction";var Sv=Al;var Rl=class extends n{constructor(e){super(),this.deleted_state_message=new p(e.deletedStateMessage),this.external_channel_id=e.externalChannelId}};r(Rl,"MarkChatItemsByAuthorAsDeletedAction");Rl.type="MarkChatItemsByAuthorAsDeletedAction";var Ev=Rl;var Ml=class extends n{constructor(e){super(),this.target_action_id=e.targetActionId}};r(Ml,"RemoveBannerForLiveChatCommand");Ml.type="RemoveBannerForLiveChatCommand";var kv=Ml;var Ll=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId}};r(Ll,"RemoveChatItemAction");Ll.type="RemoveChatItemAction";var Cv=Ll;var Ol=class extends n{constructor(e){super(),this.external_channel_id=e.externalChannelId}};r(Ol,"RemoveChatItemByAuthorAction");Ol.type="RemoveChatItemByAuthorAction";var Pv=Ol;var Dl=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId,this.replacement_item=c.parseItem(e.replacementItem)}};r(Dl,"ReplaceChatItemAction");Dl.type="ReplaceChatItemAction";var Nv=Dl;var Bl=class extends n{constructor(e){var i;super(),this.actions=c.parseArray((i=e.actions)==null?void 0:i.map(s=>(delete s.clickTrackingParams,s))),this.video_offset_time_msec=e.videoOffsetTimeMsec}};r(Bl,"ReplayChatItemAction");Bl.type="ReplayChatItemAction";var Av=Bl;var Yl=class extends n{constructor(e){super(),this.panel_to_show=c.parseItem(e.panelToShow,Dx)}};r(Yl,"ShowLiveChatActionPanelAction");Yl.type="ShowLiveChatActionPanelAction";var Rv=Yl;var Vl=class extends n{constructor(e){super(),this.dialog=c.parseItem(e.dialog)}};r(Vl,"ShowLiveChatDialogAction");Vl.type="ShowLiveChatDialogAction";var Mv=Vl;var Ul=class extends n{constructor(e){super(),this.tooltip=c.parseItem(e.tooltip)}};r(Ul,"ShowLiveChatTooltipCommand");Ul.type="ShowLiveChatTooltipCommand";var Lv=Ul;var Fl=class extends n{constructor(e){super(),this.date_text=new p(e.dateText).toString()}};r(Fl,"UpdateDateTextAction");Fl.type="UpdateDateTextAction";var Bx=Fl;var Wl=class extends n{constructor(e){super(),this.description=new p(e.description)}};r(Wl,"UpdateDescriptionAction");Wl.type="UpdateDescriptionAction";var Yx=Wl;var Gl=class extends n{constructor(e){super(),this.poll_to_update=c.parseItem(e.pollToUpdate)}};r(Gl,"UpdateLiveChatPollAction");Gl.type="UpdateLiveChatPollAction";var Ov=Gl;var jl=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(jl,"UpdateTitleAction");jl.type="UpdateTitleAction";var Vx=jl;var Hl=class extends n{constructor(e){super(),this.default_text=new p(e.defaultText).toString(),this.toggled_text=new p(e.toggledText).toString(),this.button_id=e.buttonId}};r(Hl,"UpdateToggleButtonTextAction");Hl.type="UpdateToggleButtonTextAction";var Ux=Hl;var $l=class extends n{constructor(e){super();let i=e.viewCount.videoViewCountRenderer;this.view_count=new p(i.viewCount),this.extra_short_view_count=new p(i.extraShortViewCount),this.original_view_count=parseInt(i.originalViewCount),this.unlabeled_view_count_value=new p(i.unlabeledViewCountValue),this.is_live=i.isLive}};r($l,"UpdateViewershipAction");$l.type="UpdateViewershipAction";var Fx=$l;var Kl=class extends n{constructor(e){super(),this.confirm_button=c.parseItem(e.confirmButton,v),this.dialog_messages=e.dialogMessages.map(i=>new p(i))}};r(Kl,"LiveChatDialog");Kl.type="LiveChatDialog";var Dv=Kl;var ql=class extends n{constructor(e){super(),this.overflow_menu=c.parseItem(e.overflowMenu,R),this.collapse_button=c.parseItem(e.collapseButton,v),this.view_selector=c.parseItem(e.viewSelector,xt)}};r(ql,"LiveChatHeader");ql.type="LiveChatHeader";var Wx=ql;var zl=class extends n{constructor(e){super(),this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=c.parseItem(e.moreCommentsBelowButton,v)}};r(zl,"LiveChatItemList");zl.type="LiveChatItemList";var Gx=zl;var Xl=class extends n{constructor(e){super(),this.author_name=new p(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.send_button=c.parseItem(e.sendButton,v),this.target_id=e.targetId}};r(Xl,"LiveChatMessageInput");Xl.type="LiveChatMessageInput";var Bv=Xl;var Ql=class extends n{constructor(e){super(),this.name=new p(e.authorName),this.photo=y.fromResponse(e.authorPhoto),this.badges=c.parseArray(e.authorBadges)}};r(Ql,"LiveChatParticipant");Ql.type="LiveChatParticipant";var jx=Ql;var Jl=class extends n{constructor(e){super(),this.title=new p(e.title),this.participants=c.parseArray(e.participants,jx)}};r(Jl,"LiveChatParticipantsList");Jl.type="LiveChatParticipantsList";var Hx=Jl;var Zl=class extends n{constructor(e){super(),this.title=p.fromAttributed(e.title),this.metadata=c.parseItem(e.metadata,Xr),this.image=c.parseItem(e.image,Jr)}};r(Zl,"LockupMetadataView");Zl.type="LockupMetadataView";var $x=Zl;var eu=class extends n{constructor(e){super(),this.content_image=c.parseItem(e.contentImage,D_),this.metadata=c.parseItem(e.metadata,$x),this.content_id=e.contentId,this.content_type=e.contentType.replace("LOCKUP_CONTENT_TYPE_",""),this.on_tap_endpoint=new d(e.rendererContext.commandContext.onTap)}};r(eu,"LockupView");eu.type="LockupView";var Kx=eu;var tu=class extends v{constructor(e){super(e)}};r(tu,"MenuNavigationItem");tu.type="MenuNavigationItem";var qx=tu;var iu=class extends n{constructor(e){super(),this.items=c.parseArray(e.items,[qx,At])}};r(iu,"MenuPopup");iu.type="MenuPopup";var Yv=iu;var ru=class extends n{constructor(e){super(),this.items=c.parse(e.items)}get contents(){return this.items}};r(ru,"MultiPageMenuNotificationSection");ru.type="MultiPageMenuNotificationSection";var Vv=ru;var su=class extends n{constructor(e){super()}};r(su,"MusicMenuItemDivider");su.type="MusicMenuItemDivider";var zx=su;var ou=class extends n{constructor(e){super(),this.title=new p(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 d(e.selectedCommand)),this.selected=!!this.endpoint}};r(ou,"MusicMultiSelectMenuItem");ou.type="MusicMultiSelectMenuItem";var ss=ou;var nu=class extends n{constructor(e){var i;super(),Reflect.has(e,"title")&&Reflect.has(e.title,"musicMenuTitleRenderer")&&(this.title=new p((i=e.title.musicMenuTitleRenderer)==null?void 0:i.primaryText)),this.options=c.parseArray(e.options,[ss,zx])}};r(nu,"MusicMultiSelectMenu");nu.type="MusicMultiSelectMenu";var Xx=nu;var au=class extends n{constructor(e){super(),this.title=new p(e.title),this.buttons=c.parseArray(e.buttons,v)}};r(au,"SimpleMenuHeader");au.type="SimpleMenuHeader";var Qx=au;var pu=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description,this.thumbnails=y.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 d(e.buttonCommand)}};r(pu,"MerchandiseItem");pu.type="MerchandiseItem";var Uv=pu;var cu=class extends n{constructor(e){super(),this.title=e.title,this.menu=c.parseItem(e.actionButton),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(cu,"MerchandiseShelf");cu.type="MerchandiseShelf";var Jx=cu;var lu=class extends n{constructor(e){super(),this.title=new p(e.title),this.contents=e.contents.map(i=>new p(i))}};r(lu,"MetadataRow");lu.type="MetadataRow";var Fv=lu;var uu=class extends n{constructor(e){super(),this.rows=c.parseArray(e.rows),this.collapsed_item_count=e.collapsedItemCount}};r(uu,"MetadataRowContainer");uu.type="MetadataRowContainer";var Zx=uu;var fu=class extends n{constructor(e){super(),this.content=new p(e.content),this.has_divider_line=e.hasDividerLine}};r(fu,"MetadataRowHeader");fu.type="MetadataRowHeader";var Wv=fu;var mu=class extends n{constructor(e){super(),this.section_list=c.parseItem(e)}};r(mu,"MetadataScreen");mu.type="MetadataScreen";var Gv=mu;var hu=class extends n{constructor(e){super(),this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=y.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}};r(hu,"MicroformatData");hu.type="MicroformatData";var Ci=hu;var du=class extends Rt{constructor(e){super(e)}};r(du,"Mix");du.type="Mix";var jv=du;var _u=class extends n{constructor(e){super(),this.title=new p(e.title),this.content=new p(e.content),this.button=c.parseItem(e.button,v)}};r(_u,"ModalWithTitleAndButton");_u.type="ModalWithTitleAndButton";var Hv=_u;var xu=class extends n{constructor(e){var s,o,a;super();let i=((s=e.thumbnailOverlays.find(l=>l.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new p(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new p(e.descriptionSnippet)),this.top_metadata_items=new p(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.longBylineText,e.ownerBadges,(a=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:a.thumbnail),this.duration={text:e.lengthText?new p(e.lengthText).toString():new p(i).toString(),seconds:_e(e.lengthText?new p(e.lengthText).toString():new p(i).toString())},this.endpoint=new d(e.navigationEndpoint),this.badges=c.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=c.parseItem(e.menu,R)}};r(xu,"Movie");xu.type="Movie";var $v=xu;var yu=class extends n{constructor(e){var i;return super(),(i=e.movingThumbnailDetails)==null?void 0:i.thumbnails.map(s=>new y(s)).sort((s,o)=>o.width-s.width)}};r(yu,"MovingThumbnail");yu.type="MovingThumbnail";var Kv=yu;var bu=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(bu,"MusicCardShelfHeaderBasic");bu.type="MusicCardShelfHeaderBasic";var ey=bu;var gu=class extends n{constructor(e){super(),this.icon_type=e.icon.iconType,this.label=e.accessibilityData.accessibilityData.label}};r(gu,"MusicInlineBadge");gu.type="MusicInlineBadge";var os=gu;var wu=class extends n{constructor(e){var i,s;super(),this.endpoint=new d(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,Reflect.has(e,"accessibilityPlayData")&&(this.play_label=(i=e.accessibilityPlayData.accessibilityData)==null?void 0:i.label),Reflect.has(e,"accessibilityPauseData")&&(this.pause_label=(s=e.accessibilityPauseData.accessibilityData)==null?void 0:s.label),this.icon_color=e.iconColor}};r(wu,"MusicPlayButton");wu.type="MusicPlayButton";var ns=wu;var Tu=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,ns),this.content_position=e.contentPosition,this.display_style=e.displayStyle}};r(Tu,"MusicItemThumbnailOverlay");Tu.type="MusicItemThumbnailOverlay";var Mt=Tu;var vu=class extends n{constructor(e){super(),this.contents=y.fromResponse(e.thumbnail)}};r(vu,"MusicThumbnail");vu.type="MusicThumbnail";var Ie=vu;var Iu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.buttons=c.parseArray(e.buttons,v),this.menu=c.parseItem(e.menu,R),this.on_tap=new d(e.onTap),this.header=c.parseItem(e.header,ey),Reflect.has(e,"endIcon")&&Reflect.has(e.endIcon,"iconType")&&(this.end_icon_type=e.endIcon.iconType),this.subtitle_badges=c.parseArray(e.subtitleBadges,os),this.thumbnail_overlay=c.parseItem(e.thumbnailOverlay,Mt),Reflect.has(e,"contents")&&(this.contents=c.parseArray(e.contents))}};r(Iu,"MusicCardShelf");Iu.type="MusicCardShelf";var qv=Iu;var Su=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"strapline")&&(this.strapline=new p(e.strapline)),Reflect.has(e,"thumbnail")&&(this.thumbnail=c.parseItem(e.thumbnail,Ie)),Reflect.has(e,"moreContentButton")&&(this.more_content=c.parseItem(e.moreContentButton,v)),Reflect.has(e,"endIcons")&&(this.end_icons=c.parseArray(e.endIcons,Tx))}};r(Su,"MusicCarouselShelfBasicHeader");Su.type="MusicCarouselShelfBasicHeader";var ty=Su;var Eu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.overlay=c.parseItem(e.overlay,Mt),this.on_tap=new d(e.onTap),this.menu=c.parseItem(e.menu,R),this.subtitle=new p(e.subtitle),this.title=new p(e.title),Reflect.has(e,"secondTitle")&&(this.second_title=new p(e.secondTitle)),Reflect.has(e,"description")&&(this.description=new p(e.description)),Reflect.has(e,"displayStyle")&&(this.display_style=e.displayStyle)}};r(Eu,"MusicMultiRowListItem");Eu.type="MusicMultiRowListItem";var iy=Eu;var ku=class extends n{constructor(e){super(),this.button_text=new p(e.buttonText).toString(),this.endpoint=new d(e.clickCommand)}};r(ku,"MusicNavigationButton");ku.type="MusicNavigationButton";var ry=ku;var Cu=class extends n{constructor(e){super(),this.title=new p(e.text),this.display_priority=e.displayPriority}};r(Cu,"MusicResponsiveListItemFixedColumn");Cu.type="musicResponsiveListItemFlexColumnRenderer";var sy=Cu;var Pu=class extends n{constructor(e){super(),this.title=new p(e.text),this.display_priority=e.displayPriority}};r(Pu,"MusicResponsiveListItemFlexColumn");Pu.type="MusicResponsiveListItemFlexColumn";var oy=Pu;var Ze,as,Cg,Qv,zv,Xv,Jv,Zv,eI,tI,iI,rI,Nu=class extends n{constructor(e){var s,o,a,l,f,m;super(),Ze.add(this),as.set(this,void 0),this.flex_columns=c.parseArray(e.flexColumns,oy),this.fixed_columns=c.parseArray(e.fixedColumns,sy),I(this,as,{video_id:((s=e==null?void 0:e.playlistItemData)==null?void 0:s.videoId)||null,playlist_set_video_id:((o=e==null?void 0:e.playlistItemData)==null?void 0:o.playlistSetVideoId)||null},"f"),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint));let i=(m=(f=(l=(a=this.endpoint)==null?void 0:a.payload)==null?void 0:l.browseEndpointContextSupportedConfigs)==null?void 0:f.browseEndpointContextMusicConfig)==null?void 0:m.pageType;switch(i||this.flex_columns.find(_=>{var b,T,w,S;return((S=(w=(T=(b=_.title.endpoint)==null?void 0:b.payload)==null?void 0:T.browseEndpointContextSupportedConfigs)==null?void 0:w.browseEndpointContextMusicConfig)==null?void 0:S.pageType)==="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"})&&(i="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"),i){case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album",u(this,Ze,"m",iI).call(this);break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist",u(this,Ze,"m",rI).call(this);break;case"MUSIC_PAGE_TYPE_ARTIST":case"MUSIC_PAGE_TYPE_USER_CHANNEL":this.item_type="artist",u(this,Ze,"m",Jv).call(this);break;case"MUSIC_PAGE_TYPE_LIBRARY_ARTIST":this.item_type="library_artist",u(this,Ze,"m",Zv).call(this);break;case"MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE":this.item_type="non_music_track",u(this,Ze,"m",eI).call(this);break;case"MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE":this.item_type="podcast_show",u(this,Ze,"m",tI).call(this);break;default:this.flex_columns[1]?u(this,Ze,"m",Qv).call(this):u(this,Ze,"m",Cg).call(this)}Reflect.has(e,"index")&&(this.index=new p(e.index)),Reflect.has(e,"thumbnail")&&(this.thumbnail=c.parseItem(e.thumbnail,Ie)),Reflect.has(e,"badges")&&(this.badges=c.parseArray(e.badges)),Reflect.has(e,"menu")&&(this.menu=c.parseItem(e.menu,R)),Reflect.has(e,"overlay")&&(this.overlay=c.parseItem(e.overlay,Mt))}get thumbnails(){var e;return((e=this.thumbnail)==null?void 0:e.contents)||[]}};r(Nu,"MusicResponsiveListItem");as=new WeakMap,Ze=new WeakSet,Cg=r(function(){this.title=this.flex_columns.first().title.toString(),this.endpoint?this.item_type="endpoint":this.item_type="unknown"},"_MusicResponsiveListItem_parseOther"),Qv=r(function(){var i,s,o,a,l,f,m;switch((m=(f=(l=(a=(o=(s=(i=this.flex_columns.at(0))==null?void 0:i.title.runs)==null?void 0:s.at(0))==null?void 0:o.endpoint)==null?void 0:a.payload)==null?void 0:l.watchEndpointMusicSupportedConfigs)==null?void 0:f.watchEndpointMusicConfig)==null?void 0:m.musicVideoType){case"MUSIC_VIDEO_TYPE_UGC":case"MUSIC_VIDEO_TYPE_OMV":this.item_type="video",u(this,Ze,"m",Xv).call(this);break;case"MUSIC_VIDEO_TYPE_ATV":this.item_type="song",u(this,Ze,"m",zv).call(this);break;default:u(this,Ze,"m",Cg).call(this)}},"_MusicResponsiveListItem_parseVideoOrSong"),zv=r(function(){var o,a,l,f,m,x,_,b,T,w,S,E,C,k,U;this.id=u(this,as,"f").video_id||((a=(o=this.endpoint)==null?void 0:o.payload)==null?void 0:a.videoId),this.title=this.flex_columns.first().title.toString();let e=((m=(f=(l=this.flex_columns.at(1))==null?void 0:l.title.runs)==null?void 0:f.find(L=>/^\d+$/.test(L.text.replace(/:/g,""))))==null?void 0:m.text)||((_=(x=this.fixed_columns.first())==null?void 0:x.title)==null?void 0:_.toString());e&&(this.duration={text:e,seconds:_e(e)});let i=((T=(b=this.flex_columns.at(1))==null?void 0:b.title.runs)==null?void 0:T.find(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("MPR")))||((S=(w=this.flex_columns.at(2))==null?void 0:w.title.runs)==null?void 0:S.find(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("MPR")));i&&Oe(i)&&(this.album={id:(C=(E=i.endpoint)==null?void 0:E.payload)==null?void 0:C.browseId,name:i.text,endpoint:i.endpoint});let s=(U=(k=this.flex_columns.at(1))==null?void 0:k.title.runs)==null?void 0:U.filter(L=>Oe(L)&&L.endpoint&&L.endpoint.payload.browseId.startsWith("UC"));s&&(this.artists=s.map(L=>{var K,re;return{name:L.text,channel_id:Oe(L)?(re=(K=L.endpoint)==null?void 0:K.payload)==null?void 0:re.browseId:void 0,endpoint:Oe(L)?L.endpoint:void 0}}))},"_MusicResponsiveListItem_parseSong"),Xv=r(function(){var s,o,a,l,f,m,x,_,b,T;this.id=u(this,as,"f").video_id,this.title=this.flex_columns.first().title.toString(),this.views=(a=(o=(s=this.flex_columns.at(1))==null?void 0:s.title.runs)==null?void 0:o.find(w=>w.text.match(/(.*?) views/)))==null?void 0:a.toString();let e=(f=(l=this.flex_columns.at(1))==null?void 0:l.title.runs)==null?void 0:f.filter(w=>Oe(w)&&w.endpoint&&w.endpoint.payload.browseId.startsWith("UC"));e&&(this.authors=e.map(w=>{var S,E;return{name:w.text,channel_id:Oe(w)?(E=(S=w.endpoint)==null?void 0:S.payload)==null?void 0:E.browseId:void 0,endpoint:Oe(w)?w.endpoint:void 0}}));let i=((x=(m=this.flex_columns[1].title.runs)==null?void 0:m.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:x.text)||((T=(b=(_=this.fixed_columns.first())==null?void 0:_.title.runs)==null?void 0:b.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:T.text);i&&(this.duration={text:i,seconds:_e(i)})},"_MusicResponsiveListItem_parseVideo"),Jv=r(function(){var e,i,s,o,a,l;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.name=this.flex_columns.first().title.toString(),this.subtitle=(s=this.flex_columns.at(1))==null?void 0:s.title,this.subscribers=((l=(a=(o=this.subtitle)==null?void 0:o.runs)==null?void 0:a.find(f=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(f.text)))==null?void 0:l.text)||""},"_MusicResponsiveListItem_parseArtist"),Zv=r(function(){var e,i,s,o;this.name=this.flex_columns.first().title.toString(),this.subtitle=(e=this.flex_columns.at(1))==null?void 0:e.title,this.song_count=((o=(s=(i=this.subtitle)==null?void 0:i.runs)==null?void 0:s.find(a=>/^\d+(,\d+)? songs?$/i.test(a.text)))==null?void 0:o.text)||""},"_MusicResponsiveListItem_parseLibraryArtist"),eI=r(function(){var e,i;this.id=u(this,as,"f").video_id||((i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.videoId),this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parseNonMusicTrack"),tI=r(function(){var e,i;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parsePodcastShow"),iI=r(function(){var i,s,o,a,l,f,m,x,_;this.id=(s=(i=this.endpoint)==null?void 0:i.payload)==null?void 0:s.browseId,this.title=this.flex_columns.first().title.toString();let e=(a=(o=this.flex_columns.at(1))==null?void 0:o.title.runs)==null?void 0:a.find(b=>Oe(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));e&&Oe(e)&&(this.author={name:e.text,channel_id:(f=(l=e.endpoint)==null?void 0:l.payload)==null?void 0:f.browseId,endpoint:e.endpoint}),this.year=(_=(x=(m=this.flex_columns.at(1))==null?void 0:m.title.runs)==null?void 0:x.find(b=>/^[12][0-9]{3}$/.test(b.text)))==null?void 0:_.text},"_MusicResponsiveListItem_parseAlbum"),rI=r(function(){var s,o,a,l,f,m,x,_;this.id=(o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId,this.title=this.flex_columns.first().title.toString();let e=(l=(a=this.flex_columns.at(1))==null?void 0:a.title.runs)==null?void 0:l.find(b=>b.text.match(/\d+ (song|songs)/));this.item_count=e?e.text:void 0;let i=(m=(f=this.flex_columns.at(1))==null?void 0:f.title.runs)==null?void 0:m.find(b=>Oe(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));i&&Oe(i)&&(this.author={name:i.text,channel_id:(_=(x=i.endpoint)==null?void 0:x.payload)==null?void 0:_.browseId,endpoint:i.endpoint})},"_MusicResponsiveListItem_parsePlaylist");Nu.type="MusicResponsiveListItem";var Pi=Nu;var Au=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te;switch(super(),this.title=new p(e.title),this.endpoint=new d(e.navigationEndpoint),this.id=((o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId)||((l=(a=this.endpoint)==null?void 0:a.payload)==null?void 0:l.videoId),this.subtitle=new p(e.subtitle),this.badges=c.parse(e.subtitleBadges),(_=(x=(m=(f=this.endpoint)==null?void 0:f.payload)==null?void 0:m.browseEndpointContextSupportedConfigs)==null?void 0:x.browseEndpointContextMusicConfig)==null?void 0:_.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:((T=(b=this.endpoint)==null?void 0:b.metadata)==null?void 0:T.api_url)==="/next"?this.item_type="endpoint":(w=this.subtitle.runs)!=null&&w[0]?this.subtitle.runs[0].text!=="Song"?this.item_type="video":this.item_type="song":this.endpoint?this.item_type="endpoint":this.item_type="unknown";break}if(this.item_type=="artist")this.subscribers=((E=(S=this.subtitle.runs)==null?void 0:S.find(F=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(F.text)))==null?void 0:E.text)||"";else if(this.item_type=="playlist"){let F=(C=this.subtitle.runs)==null?void 0:C.find(B=>B.text.match(/\d+ songs|song/));this.item_count=F?F.text:null}else if(this.item_type=="album"){let F=(k=this.subtitle.runs)==null?void 0:k.filter(B=>{var X,Z;return(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var X,Z;return{name:B.text,channel_id:(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId,endpoint:B.endpoint}})),this.year=(U=this.subtitle.runs)==null?void 0:U.slice(-1)[0].text,isNaN(Number(this.year))&&delete this.year}else if(this.item_type=="video"){this.views=((K=(L=this==null?void 0:this.subtitle.runs)==null?void 0:L.find(B=>B==null?void 0:B.text.match(/(.*?) views/)))==null?void 0:K.text)||"N/A";let F=(re=this.subtitle.runs)==null?void 0:re.find(B=>{var X,Z,Ue;return(Ue=(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId)==null?void 0:Ue.startsWith("UC")});F&&(this.author={name:F==null?void 0:F.text,channel_id:(Y=(he=F==null?void 0:F.endpoint)==null?void 0:he.payload)==null?void 0:Y.browseId,endpoint:F==null?void 0:F.endpoint})}else if(this.item_type=="song"){let F=(te=this.subtitle.runs)==null?void 0:te.filter(B=>{var X,Z;return(Z=(X=B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var X,Z;return{name:B==null?void 0:B.text,channel_id:(Z=(X=B==null?void 0:B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId,endpoint:B==null?void 0:B.endpoint}}))}this.thumbnail=y.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=c.parseItem(e.thumbnailOverlay,Mt),this.menu=c.parseItem(e.menu,R)}};r(Au,"MusicTwoRowItem");Au.type="MusicTwoRowItem";var ny=Au;var Ru=class extends n{constructor(e){super(),this.header=c.parseItem(e.header,ty),this.contents=c.parseArray(e.contents,[ny,Pi,iy,ry]),Reflect.has(e,"numItemsPerColumn")&&(this.num_items_per_column=parseInt(e.numItemsPerColumn))}};r(Ru,"MusicCarouselShelf");Ru.type="MusicCarouselShelf";var sI=Ru;var Mu=class extends n{constructor(e){super(),this.description=new p(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 p(e.footer)}};r(Mu,"MusicDescriptionShelf");Mu.type="MusicDescriptionShelf";var ay=Mu;var Lu=class extends n{constructor(e){var s,o,a,l,f,m,x,_,b;super(),this.title=new p(e.title),this.description=new p(e.description),this.subtitle=new p(e.subtitle),this.second_subtitle=new p(e.secondSubtitle),this.year=((o=(s=this.subtitle.runs)==null?void 0:s.find(T=>/^[12][0-9]{3}$/.test(T.text)))==null?void 0:o.text)||"",this.song_count=((l=(a=this.second_subtitle.runs)==null?void 0:a[0])==null?void 0:l.text)||"",this.total_duration=((m=(f=this.second_subtitle.runs)==null?void 0:f[2])==null?void 0:m.text)||"",this.thumbnails=y.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=c.parseArray(e.subtitleBadges);let i=(x=this.subtitle.runs)==null?void 0:x.find(T=>{var w,S;return(S=(w=T==null?void 0:T.endpoint)==null?void 0:w.payload)==null?void 0:S.browseId.startsWith("UC")});i&&(this.author={name:i.text,channel_id:(b=(_=i.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:i.endpoint}),this.menu=c.parseItem(e.menu)}};r(Lu,"MusicDetailHeader");Lu.type="MusicDetailHeader";var oI=Lu;var Ou=class extends n{constructor(e){super(),this.playlist_id=e.playlistId,this.supported_download_states=e.supportedDownloadStates}};r(Ou,"MusicDownloadStateBadge");Ou.type="MusicDownloadStateBadge";var nI=Ou;var Du=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.edit_header=c.parseItem(e.editHeader),this.playlist_id=e.playlistId}};r(Du,"MusicEditablePlaylistDetailHeader");Du.type="MusicEditablePlaylistDetailHeader";var aI=Du;var Bu=class extends n{constructor(e){super(),this.element=Reflect.has(e,"elementRenderer")?c.parseItem(e,nx):null}};r(Bu,"MusicElementHeader");Bu.type="MusicElementHeader";var pI=Bu;var Yu=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header=c.parseItem(e.header)),Reflect.has(e,"title")&&(this.title=new p(e.title))}};r(Yu,"MusicHeader");Yu.type="MusicHeader";var cI=Yu;var Vu=class extends n{constructor(e){super(),this.title=new p(e.title),this.description=new p(e.description),this.thumbnail=c.parseItem(e.thumbnail,Ie)}};r(Vu,"MusicImmersiveHeader");Vu.type="MusicImmersiveHeader";var lI=Vu;var Uu=class{constructor(e){this.icon_name=e.iconName,this.endpoint=new d(e.onTap),this.a11y_text=e.a11yText,this.style=e.style}};r(Uu,"ActionButton");Uu.type="ActionButton";var Fu=class{constructor(e){this.image=y.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(i=>new Uu(i))}};r(Fu,"Panel");Fu.type="Panel";var Wu=class extends n{constructor(e){super(),this.header=e.shelf.header,this.panels=e.shelf.panels.map(i=>new Fu(i))}};r(Wu,"MusicLargeCardItemCarousel");Wu.type="MusicLargeCardItemCarousel";var uI=Wu;var Gu=class extends n{constructor(e){super(),this.title=new p(e.title),this.edit_title=new p(e.editTitle),this.edit_description=new p(e.editDescription),this.privacy=e.privacy,this.playlist_id=e.playlistId,this.endpoint=new d(e.collaborationSettingsCommand),this.privacy_dropdown=c.parseItem(e.privacyDropdown,hi)}};r(Gu,"MusicPlaylistEditHeader");Gu.type="MusicPlaylistEditHeader";var fI=Gu;var ju=class extends n{constructor(e){var i,s,o;super(),this.playlist_id=e.playlistId,this.contents=c.parseArray(e.contents,Pi),this.collapsed_item_count=e.collapsedItemCount,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}};r(ju,"MusicPlaylistShelf");ju.type="MusicPlaylistShelf";var mI=ju;var Hu=class extends n{constructor(e){var o,a,l,f,m;super(),this.title=new p(e.title),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new d(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new p(e.lengthText).toString(),seconds:_e(new p(e.lengthText).toString())};let i=(o=new p(e.longBylineText).runs)==null?void 0:o.find(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("MPR")}),s=(a=new p(e.longBylineText).runs)==null?void 0:a.filter(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("UC")});this.author=new p(e.shortBylineText).toString(),i&&(this.album={id:(f=(l=i.endpoint)==null?void 0:l.payload)==null?void 0:f.browseId,name:i.text,year:(m=new p(e.longBylineText).runs)==null?void 0:m.slice(-1)[0].text,endpoint:i.endpoint}),s&&(this.artists=s.map(x=>{var _,b;return{name:x.text,channel_id:(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:x.endpoint}})),this.badges=c.parseArray(e.badges),this.menu=c.parseItem(e.menu),this.set_video_id=e.playlistSetVideoId}};r(Hu,"PlaylistPanelVideo");Hu.type="PlaylistPanelVideo";var ei=Hu;var $u=class extends n{constructor(e){super(),this.primary=c.parseItem(e.primaryRenderer,ei),Reflect.has(e,"counterpart")&&(this.counterpart=G(e.counterpart.map(i=>c.parseItem(i.counterpartRenderer,ei))||[]))}};r($u,"PlaylistPanelVideoWrapper");$u.type="PlaylistPanelVideoWrapper";var py=$u;var Ku=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.title=e.title,this.title_text=new p(e.titleText),this.contents=c.parseArray(e.contents,[py,ei,Wd]),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextRadioContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.nextContinuationData)==null?void 0:f.continuation),this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}};r(Ku,"PlaylistPanel");Ku.type="PlaylistPanel";var cy=Ku;var qu=class extends n{constructor(e){super(),this.content=c.parseItem(e.content,cy)}};r(qu,"MusicQueue");qu.type="MusicQueue";var ly=qu;var zu=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,Ie),this.buttons=c.parseArray(e.buttons,[Yr,se,ns,v,R]),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.strapline_text_one=new p(e.straplineTextOne),this.strapline_thumbnail=c.parseItem(e.straplineThumbnail,Ie),this.second_subtitle=new p(e.secondSubtitle),Reflect.has(e,"subtitleBadge")&&(this.subtitle_badge=c.parseArray(e.subtitleBadge,os)),Reflect.has(e,"description")&&(this.description=c.parseItem(e.description,ay))}};r(zu,"MusicResponsiveHeader");zu.type="MusicResponsiveHeader";var hI=zu;var Xu=class extends n{constructor(e){var i,s,o,a;super(),this.title=new p(e.title),this.contents=c.parseArray(e.contents,Pi),Reflect.has(e,"bottomEndpoint")&&(this.endpoint=new d(e.bottomEndpoint)),Reflect.has(e,"continuations")&&(this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((a=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:a.continuation)),Reflect.has(e,"bottomText")&&(this.bottom_text=new p(e.bottomText)),Reflect.has(e,"bottomButton")&&(this.bottom_button=c.parseItem(e.bottomButton,v)),Reflect.has(e,"subheaders")&&(this.subheaders=c.parseArray(e.subheaders))}};r(Xu,"MusicShelf");Xu.type="MusicShelf";var dI=Xu;var Qu=class extends n{constructor(e){super(),Reflect.has(e,"startItems")&&(this.start_items=c.parseArray(e.startItems)),Reflect.has(e,"endItems")&&(this.end_items=c.parseArray(e.endItems))}};r(Qu,"MusicSideAlignedItem");Qu.type="MusicSideAlignedItem";var _I=Qu;var Ju=class extends n{constructor(e){super(),this.title=new p(e.title).toString(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.menu=c.parseItem(e.menu,Xx)}};r(Ju,"MusicSortFilterButton");Ju.type="MusicSortFilterButton";var xI=Ju;var Zu=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(Zu,"MusicTastebuilderShelfThumbnail");Zu.type="MusicTastebuilderShelfThumbnail";var uy=Zu;var ef=class extends n{constructor(e){super(),this.thumbnail=c.parseItem(e.thumbnail,uy),this.primary_text=new p(e.primaryText),this.secondary_text=new p(e.secondaryText),this.action_button=c.parseItem(e.actionButton,v),this.is_visible=e.isVisible}};r(ef,"MusicTasteBuilderShelf");ef.type="MusicTasteBuilderShelf";var yI=ef;var tf=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.thumbnail=e.thumbnail?y.fromResponse((i=e.thumbnail.musicThumbnailRenderer)==null?void 0:i.thumbnail):[],this.menu=c.parseItem(e.menu,R),this.foreground_thumbnail=e.foregroundThumbnail?y.fromResponse((s=e.foregroundThumbnail.musicThumbnailRenderer)==null?void 0:s.thumbnail):[]}};r(tf,"MusicVisualHeader");tf.type="MusicVisualHeader";var bI=tf;var rf=class extends n{constructor(e){super(),this.placeholder_text=new p(e.placeholderText),this.buttons=c.parseArray(e.buttons),Reflect.has(e,"logo")&&Reflect.has(e.logo,"iconType")&&(this.logo_type=e.logo.iconType)}};r(rf,"MobileTopbar");rf.type="MobileTopbar";var gI=rf;var sf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}};r(sf,"MultiPageMenuSection");sf.type="MultiPageMenuSection";var wI=sf;var of=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}};r(of,"PivotBar");of.type="PivotBar";var TI=of;var nf=class extends n{constructor(e){super(),this.pivot_identifier=e.pivotIdentifier,this.endpoint=new d(e.navigationEndpoint),this.title=new p(e.title),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.accessibility_label=e.accessibility.accessibilityData.label),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(nf,"PivotBarItem");nf.type="PivotBarItem";var vI=nf;var af=class extends n{constructor(e){super(),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.menu_renderer=c.parseItem(e.menuRenderer),this.target_id=e.targetId}};r(af,"TopbarMenuButton");af.type="TopbarMenuButton";var II=af;var pf=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.short_message=new p(e.shortMessage),this.sent_time=new p(e.sentTimeText),this.notification_id=e.notificationId,this.endpoint=new d(e.navigationEndpoint),this.record_click_endpoint=new d(e.recordClickEndpoint),this.menu=c.parseItem(e.contextualMenu),this.read=e.read}};r(pf,"Notification");pf.type="Notification";var fy=pf;var cf=class extends n{constructor(e){super(),this.response_text=new p(e.responseText)}};r(cf,"NotificationAction");cf.type="NotificationAction";var SI=cf;var lf=class extends n{constructor(e){super(),this.title=c.parseItem(e.title,sx),this.image=c.parseItem(e.image,[rr,Jr]),this.animated_image=c.parseItem(e.animatedImage,rr),this.metadata=c.parseItem(e.metadata,Xr),this.actions=c.parseItem(e.actions,mx),this.description=c.parseItem(e.description,ex),this.attributation=c.parseItem(e.attributation,Ud),this.banner=c.parseItem(e.banner,vx)}};r(lf,"PageHeaderView");lf.type="PageHeaderView";var my=lf;var uf=class extends n{constructor(e){super(),this.page_title=e.pageTitle,this.content=c.parseItem(e.content,my)}};r(uf,"PageHeader");uf.type="PageHeader";var Lt=uf;var ff=class extends n{constructor(e){super(),this.header_text=new p(e.headerText).toString(),this.body_text=new p(e.bodyText).toString(),this.page_title=new p(e.pageTitle).toString(),this.header_icon_type=e.headerIcon.iconType}};r(ff,"PageIntroduction");ff.type="PageIntroduction";var hy=ff;var mf=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new d(e.onClickCommand),this.content_description=new p(e.contentDescription),this.target_id=e.targetId,this.sound_attribution_title=new p(e.soundAttributionTitle),this.waveform_animation_style=e.waveformAnimationStyle,this.background_animation_style=e.backgroundAnimationStyle}};r(mf,"PivotButton");mf.type="PivotButton";var dy=mf;var hf=class extends n{constructor(e){super(),Reflect.has(e,"featuredChannel")&&(this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:y.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new d(e.featuredChannel.navigationEndpoint),subscribe_button:c.parseItem(e.featuredChannel.subscribeButton)}),this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}};r(hf,"PlayerAnnotationsExpanded");hf.type="PlayerAnnotationsExpanded";var _y=hf;var df=class extends n{constructor(e){super(),Reflect.has(e,"captionTracks")&&(this.caption_tracks=e.captionTracks.map(i=>({base_url:i.baseUrl,name:new p(i.name),vss_id:i.vssId,language_code:i.languageCode,kind:i.kind,is_translatable:i.isTranslatable}))),Reflect.has(e,"audioTracks")&&(this.audio_tracks=e.audioTracks.map(i=>({audio_track_id:i.audioTrackId,captions_initial_state:i.captionsInitialState,default_caption_track_index:i.defaultCaptionTrackIndex,has_default_track:i.hasDefaultTrack,visibility:i.visibility,caption_track_indices:i.captionTrackIndices}))),Reflect.has(e,"defaultAudioTrackIndex")&&(this.default_audio_track_index=e.defaultAudioTrackIndex),Reflect.has(e,"translationLanguages")&&(this.translation_languages=e.translationLanguages.map(i=>({language_code:i.languageCode,language_name:new p(i.languageName)})))}};r(df,"PlayerCaptionsTracklist");df.type="PlayerCaptionsTracklist";var xy=df;var _f=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint),this.enable_listen_first=e.enableListenFirst}};r(_f,"PlayerOverflow");_f.type="PlayerOverflow";var yy=_f;var xf=class extends n{constructor(e){super(),this.overflow=c.parseItem(e.overflow,yy)}};r(xf,"PlayerControlsOverlay");xf.type="PlayerControlsOverlay";var EI=xf;var yf=class extends n{constructor(e){super(),this.subreason=new p(e.subreason),this.reason=new p(e.reason),this.proceed_button=c.parseItem(e.proceedButton,v),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(yf,"PlayerErrorMessage");yf.type="PlayerErrorMessage";var kI=yf;var bf=class extends n{constructor(e){super(),this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_description=e.offerDescription,this.offer_id=e.offerId}};r(bf,"PlayerLegacyDesktopYpcOffer");bf.type="PlayerLegacyDesktopYpcOffer";var CI=bf;var gf=class extends n{constructor(e){super(),this.video_message=e.fullVideoMessage,this.player_response=e.unserializedPlayerResponse}};r(gf,"YpcTrailer");gf.type="YpcTrailer";var by=gf;var wf=class extends n{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=c.parseItem(e.ypcTrailer,by)}};r(wf,"PlayerLegacyDesktopYpcTrailer");wf.type="PlayerLegacyDesktopYpcTrailer";var Tf=wf;var vf=class extends n{constructor(e){super();let[i,s,o,a,l]=e.spec.split("#");this.board={type:"live",template_url:i,thumbnail_width:parseInt(s,10),thumbnail_height:parseInt(o,10),columns:parseInt(a,10),rows:parseInt(l,10)}}};r(vf,"PlayerLiveStoryboardSpec");vf.type="PlayerLiveStoryboardSpec";var gy=vf;var If=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.description=new p(e.description),this.thumbnails=y.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=(i=e.liveBroadcastDetails)!=null&&i.startTimestamp?new Date(e.liveBroadcastDetails.startTimestamp):null,this.end_timestamp=(s=e.liveBroadcastDetails)!=null&&s.endTimestamp?new Date(e.liveBroadcastDetails.endTimestamp):null}};r(If,"PlayerMicroformat");If.type="PlayerMicroformat";var et=If;var Sf=class extends n{constructor(e){super(),this.title=new p(e.title),this.video_id=e.videoId,this.video_title=new p(e.videoTitle),this.short_view_count=new p(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new p(e.publishedTimeText),this.background=y.fromResponse(e.background),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.author=new P(e.byline),this.cancel_button=c.parseItem(e.cancelButton,v),this.next_button=c.parseItem(e.nextButton,v),this.close_button=c.parseItem(e.closeButton,v)}};r(Sf,"PlayerOverlayAutoplay");Sf.type="PlayerOverlayAutoplay";var wy=Sf;var Ef=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle)}};r(Ef,"PlayerOverlayVideoDetails");Ef.type="PlayerOverlayVideoDetails";var Ty=Ef;var kf=class extends n{constructor(e){super(),this.results=c.parseArray(e.results,[ux,lx]),this.title=new p(e.title).toString()}};r(kf,"WatchNextEndScreen");kf.type="WatchNextEndScreen";var vy=kf;var Cf=class extends n{constructor(e){super(),this.end_screen=c.parseItem(e.endScreen,vy),this.autoplay=c.parseItem(e.autoplay,wy),this.share_button=c.parseItem(e.shareButton,v),this.add_to_menu=c.parseItem(e.addToMenu,R),this.fullscreen_engagement=c.parseItem(e.fullscreenEngagement),this.actions=c.parseArray(e.actions),this.browser_media_session=c.parseItem(e.browserMediaSession),this.decorated_player_bar=c.parseItem(e.decoratedPlayerBarRenderer,Z_),this.video_details=c.parseItem(e.videoDetails,Ty)}};r(Cf,"PlayerOverlay");Cf.type="PlayerOverlay";var Iy=Cf;var Pf=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new p(e.title),this.subtitle=e.subtitle?new p(e.subtitle):null,this.stats=e.stats.map(i=>new p(i)),this.brief_stats=e.briefStats.map(i=>new p(i)),this.author=e.ownerText||e.ownerEndpoint?new P({...e.ownerText,navigationEndpoint:e.ownerEndpoint},e.ownerBadges,null):null,this.description=new p(e.descriptionText),this.num_videos=new p(e.numVideosText),this.view_count=new p(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=c.parseItem(e.saveButton),this.shuffle_play_button=c.parseItem(e.shufflePlayButton),this.menu=c.parseItem(e.moreActionsMenu),this.banner=c.parseItem(e.playlistHeaderBanner)}};r(Pf,"PlaylistHeader");Pf.type="PlaylistHeader";var Sy=Pf;var Nf=class extends n{constructor(e){super(),this.title=new p(e.playlistTitle),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new p(e.playlistVideoCount),this.channel_name=new p(e.channelName),this.endpoint=new d(e.action)}};r(Nf,"PlaylistInfoCardContent");Nf.type="PlaylistInfoCardContent";var PI=Nf;var Af=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description||null}};r(Af,"PlaylistMetadata");Af.type="PlaylistMetadata";var Ey=Af;var Rf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Rf,"PlaylistSidebar");Rf.type="PlaylistSidebar";var NI=Rf;var Mf=class extends n{constructor(e){super(),this.stats=e.stats.map(i=>new p(i)),this.thumbnail_renderer=c.parseItem(e.thumbnailRenderer),this.title=new p(e.title),this.menu=c.parseItem(e.menu),this.endpoint=new d(e.navigationEndpoint),this.description=new p(e.description)}};r(Mf,"PlaylistSidebarPrimaryInfo");Mf.type="PlaylistSidebarPrimaryInfo";var ky=Mf;var Lf=class extends n{constructor(e){super(),this.owner=c.parseItem(e.videoOwner),this.button=c.parseItem(e.button)}};r(Lf,"PlaylistSidebarSecondaryInfo");Lf.type="PlaylistSidebarSecondaryInfo";var Cy=Lf;var Of=class extends n{constructor(e){super(),this.id=e.videoId,this.index=new p(e.index),this.title=new p(e.title),this.author=new P(e.shortBylineText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=c.parseArray(e.thumbnailOverlays),this.set_video_id=e==null?void 0:e.setVideoId,this.endpoint=new d(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=c.parseItem(e.menu,R),this.video_info=new p(e.videoInfo),this.accessibility_label=e.title.accessibility.accessibilityData.label,Reflect.has(e,"style")&&(this.style=e.style);let i=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);i&&(this.upcoming=new Date(i)),this.duration={text:new p(e.lengthText).toString(),seconds:parseInt(e.lengthSeconds)}}get is_live(){var e;return((e=this.thumbnail_overlays.firstOfType(ir))==null?void 0:e.style)==="LIVE"}get is_upcoming(){var e;return((e=this.thumbnail_overlays.firstOfType(ir))==null?void 0:e.style)==="UPCOMING"}};r(Of,"PlaylistVideo");Of.type="PlaylistVideo";var ps=Of;var Df=class extends n{constructor(e){super(),this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=c.parseArray(e.contents)}};r(Df,"PlaylistVideoList");Df.type="PlaylistVideoList";var AI=Df;var Bf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new p(i.text),select_endpoint:i.selectServiceEndpoint?new d(i.selectServiceEndpoint):null,deselect_endpoint:i.deselectServiceEndpoint?new d(i.deselectServiceEndpoint):null,vote_ratio_if_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_selected:new p(i.votePercentageIfSelected),vote_ratio_if_not_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_not_selected:new p(i.votePercentageIfSelected),image:i.image?y.fromResponse(i.image):null})),Reflect.has(e,"type")&&(this.poll_type=e.type),Reflect.has(e,"totalVotes")&&(this.total_votes=new p(e.totalVotes)),Reflect.has(e,"liveChatPollId")&&(this.live_chat_poll_id=e.liveChatPollId)}};r(Bf,"Poll");Bf.type="Poll";var RI=Bf;var Yf=class extends bi{constructor(e){super(e)}};r(Yf,"Post");Yf.type="Post";var cs=Yf;var Vf=class extends n{constructor(e){super(),this.images=c.parseArray(e.images,jd)}};r(Vf,"PostMultiImage");Vf.type="PostMultiImage";var MI=Vf;var Uf=class extends n{constructor(e){super(),this.label=new p(e.label)}};r(Uf,"PremiereTrailerBadge");Uf.type="PremiereTrailerBadge";var LI=Uf;var Ff=class extends n{constructor(e){super(),this.title=new p(e.title),this.suppress_padding_disclaimer=!!e.suppressPaddingDisclaimer}};r(Ff,"ProductListHeader");Ff.type="ProductListHeader";var OI=Ff;var Wf=class extends n{constructor(e){super(),this.title=new p(e.title),this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.endpoint=new d(e.onClickCommand),this.merchant_name=e.merchantName,this.stay_in_app=!!e.stayInApp,this.view_button=c.parseItem(e.viewButton,v)}};r(Wf,"ProductListItem");Wf.type="ProductListItem";var DI=Wf;var Gf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(Gf,"ProfileColumn");Gf.type="ProfileColumn";var BI=Gf;var jf=class extends n{constructor(e){super(),this.items=c.parseArray(e.items)}get contents(){return this.items}};r(jf,"ProfileColumnStats");jf.type="ProfileColumnStats";var YI=jf;var Hf=class extends n{constructor(e){super(),this.label=new p(e.label),this.value=new p(e.value)}};r(Hf,"ProfileColumnStatsEntry");Hf.type="ProfileColumnStatsEntry";var VI=Hf;var $f=class extends n{constructor(e){super(),this.title=new p(e.title),this.thumbnails=y.fromResponse(e.thumbnail)}};r($f,"ProfileColumnUserInfo");$f.type="ProfileColumnUserInfo";var UI=$f;var Kf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new p(i.text),is_correct:i.isCorrect})),this.total_votes=new p(e.totalVotes)}};r(Kf,"Quiz");Kf.type="Quiz";var FI=Kf;var qf=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.avatars=e.avatars.map(i=>new y(i)),this.button=c.parseItem(e.button,v),this.surface=e.surface}};r(qf,"RecognitionShelf");qf.type="RecognitionShelf";var WI=qf;var zf=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new p(e.headline),this.thumbnails=y.fromResponse(e.thumbnail),this.views=new p(e.viewCountText),this.endpoint=new d(e.navigationEndpoint),this.accessibility_label=e.accessibility.accessibilityData.label}};r(zf,"ReelItem");zf.type="ReelItem";var ls=zf;var Xf=class extends n{constructor(e){super(),this.reel_title_text=new p(e.reelTitleText),this.timestamp_text=new p(e.timestampText),this.channel_title_text=new p(e.channelTitleText),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.author=new P(e.channelNavigationEndpoint,void 0)}};r(Xf,"ReelPlayerHeader");Xf.type="ReelPlayerHeader";var Py=Xf;var Qf=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,Vr),this.reel_player_header_supported_renderers=c.parseItem(e.reelPlayerHeaderSupportedRenderers,Py),this.menu=c.parseItem(e.menu,R),this.next_item_button=c.parseItem(e.nextItemButton,v),this.prev_item_button=c.parseItem(e.prevItemButton,v),this.subscribe_button_renderer=c.parseItem(e.subscribeButtonRenderer,[v,xe]),this.style=e.style,this.view_comments_button=c.parseItem(e.viewCommentsButton,v),this.share_button=c.parseItem(e.shareButton,v),this.pivot_button=c.parseItem(e.pivotButton,dy),this.info_panel=c.parseItem(e.infoPanel,Sx)}};r(Qf,"ReelPlayerOverlay");Qf.type="ReelPlayerOverlay";var GI=Qf;var Jf=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(Jf,"RelatedChipCloud");Jf.type="RelatedChipCloud";var Ny=Jf;var Zf=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.contents=c.parseArray(e.contents)}};r(Zf,"RichGrid");Zf.type="RichGrid";var Ni=Zf;var em=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(em,"RichItem");em.type="RichItem";var jI=em;var tm=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),Reflect.has(e,"titleStyle")&&(this.title_style=e.titleStyle.style),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(tm,"RichListHeader");tm.type="RichListHeader";var HI=tm;var im=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.call_to_action=new p(e.callToAction),Reflect.has(e,"callToActionIcon")&&(this.icon_type=e.callToActionIcon.iconType),this.endpoint=new d(e.endpoint)}};r(im,"RichMetadata");im.type="RichMetadata";var rm=im;var sm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(sm,"RichMetadataRow");sm.type="RichMetadataRow";var om=sm;var nm=class extends n{constructor(e){super(),this.content=c.parseItem(e.content)}};r(nm,"RichSection");nm.type="RichSection";var $I=nm;var am=class extends n{constructor(e){super(),this.title=new p(e.title),this.contents=c.parseArray(e.contents),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint)),Reflect.has(e,"subtitle")&&(this.subtitle=new p(e.subtitle))}};r(am,"RichShelf");am.type="RichShelf";var Ay=am;var pm=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint),this.search_button=c.parseItem(e.searchButton,v),this.clear_button=c.parseItem(e.clearButton,v),this.placeholder_text=new p(e.placeholderText)}};r(pm,"SearchBox");pm.type="SearchBox";var KI=pm;var cm=class extends n{constructor(e){super(),this.label=new p(e.label),this.endpoint=new d(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"}};r(cm,"SearchFilter");cm.type="SearchFilter";var Ry=cm;var lm=class extends n{constructor(e){super(),this.title=new p(e.title),this.filters=c.parseArray(e.filters,Ry)}};r(lm,"SearchFilterGroup");lm.type="SearchFilterGroup";var us=lm;var um=class extends n{constructor(e){super(),this.title=new p(e.title),this.groups=c.parseArray(e.groups,us)}};r(um,"SearchFilterOptionsDialog");um.type="SearchFilterOptionsDialog";var qI=um;var fm=class extends n{constructor(e){super(),this.chip_bar=c.parseItem(e.chipBar,Kr),this.search_filter_button=c.parseItem(e.searchFilterButton,v)}};r(fm,"SearchHeader");fm.type="SearchHeader";var My=fm;var mm=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new p(e.title)),Reflect.has(e,"groups")&&(this.groups=c.parseArray(e.groups,us)),Reflect.has(e,"button")&&(this.button=c.parseItem(e.button,se))}};r(mm,"SearchSubMenu");mm.type="SearchSubMenu";var Ly=mm;var hm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(hm,"SearchSuggestionsSection");hm.type="SearchSuggestionsSection";var zI=hm;var dm=class extends n{constructor(e){super(),this.contents=c.parseArray(e.contents)}};r(dm,"SecondarySearchContainer");dm.type="SecondarySearchContainer";var XI=dm;var _m=class extends n{constructor(e){super(),this.like_button=c.parseItem(e.likeButton,[se,v]),this.dislike_button=c.parseItem(e.dislikeButton,[se,v])}};r(_m,"SegmentedLikeDislikeButton");_m.type="SegmentedLikeDislikeButton";var dr=_m;var xm=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new p(e.title)),Reflect.has(e,"summary")&&(this.summary=new p(e.summary)),Reflect.has(e,"enableServiceEndpoint")&&(this.enable_endpoint=new d(e.enableServiceEndpoint)),Reflect.has(e,"disableServiceEndpoint")&&(this.disable_endpoint=new d(e.disableServiceEndpoint)),this.item_id=e.itemId}};r(xm,"SettingBoolean");xm.type="SettingBoolean";var QI=xm;var ym=class extends n{constructor(e){super(),this.title=new p(e.title),this.help_text=new p(e.helpText),this.enabled=e.enabled,this.disabled=e.disabled,this.id=e.id}};r(ym,"SettingsCheckbox");ym.type="SettingsCheckbox";var Oy=ym;var bm=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.enabled=e.enabled,this.enable_endpoint=new d(e.enableServiceEndpoint),this.disable_endpoint=new d(e.disableServiceEndpoint)}};r(bm,"SettingsSwitch");bm.type="SettingsSwitch";var fs=bm;var gm=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"text")&&(this.text=new p(e.text).toString()),Reflect.has(e,"options")&&(this.options=c.parseArray(e.options,[fs,hi,Qr,Oy,P_]))}};r(gm,"SettingsOptions");gm.type="SettingsOptions";var ms=gm;var wm=class extends n{constructor(e){super(),this.title=new p(e.title),this.items=c.parseArray(e.items,yi)}get contents(){return this.items}};r(wm,"SettingsSidebar");wm.type="SettingsSidebar";var Dy=wm;var Tm=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.content=new p(e.content),this.published=new p(e.publishedTimeText),this.menu=c.parseItem(e.actionMenu,R),this.original_post=c.parseItem(e.originalPost,[bi,cs]),this.id=e.postId,this.endpoint=new d(e.navigationEndpoint),this.expand_button=c.parseItem(e.expandButton,v),this.author=new P(e.displayName,void 0)}};r(Tm,"SharedPost");Tm.type="SharedPost";var By=Tm;var vm=class extends n{constructor(e){super(),this.title=c.parseItem(e.title)}};r(vm,"SharePanelHeader");vm.type="SharePanelHeader";var Yy=vm;var Im=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(Im,"SharePanelTitleV15");Im.type="SharePanelTitleV15";var JI=Im;var Sm=class extends n{constructor(e){super(),Reflect.has(e,"serviceEndpoint")?this.endpoint=new d(e.serviceEndpoint):Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new d(e.navigationEndpoint)),this.service_name=e.serviceName,this.target_id=e.targetId,this.title=new p(e.title)}};r(Sm,"ShareTarget");Sm.type="ShareTarget";var Vy=Sm;var Em=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"endpoint")&&(this.endpoint=new d(e.endpoint)),this.content=c.parseItem(e.content),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"menu")&&(this.menu=c.parseItem(e.menu)),Reflect.has(e,"playAllButton")&&(this.play_all_button=c.parseItem(e.playAllButton,v)),Reflect.has(e,"subtitle")&&(this.subtitle=new p(e.subtitle))}};r(Em,"Shelf");Em.type="Shelf";var hs=Em;var km=class extends n{constructor(e){var i;super(),this.entity_id=e.entityId,this.accessibility_text=e.accessibilityText,this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new d(e.onTap),this.menu_on_tap=new d(e.menuOnTap),this.index_in_collection=e.indexInCollection,this.menu_on_tap_a11y_label=e.menuOnTapA11yLabel,this.overlay_metadata={primary_text:e.overlayMetadata.primaryText?p.fromAttributed(e.overlayMetadata.primaryText):void 0,secondary_text:e.overlayMetadata.secondaryText?p.fromAttributed(e.overlayMetadata.secondaryText):void 0},(i=e.inlinePlayerData)!=null&&i.onVisible&&(this.inline_player_data=new d(e.inlinePlayerData.onVisible)),e.badge&&(this.badge=c.parseItem(e.badge,gi))}};r(km,"ShortsLockupView");km.type="ShortsLockupView";var ds=km;var Cm=class extends n{constructor(e){super(),this.corrected_query=new p(e.correctedQuery),this.original_query=new p(e.originalQuery),this.corrected_query_endpoint=new d(e.correctedQueryEndpoint),this.original_query_endpoint=new d(e.originalQueryEndpoint),this.search_instead_for=new p(e.searchInsteadFor),this.showing_results_for=new p(e.showingResultsFor)}};r(Cm,"ShowingResultsFor");Cm.type="ShowingResultsFor";var ZI=Cm;var Pm=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.title=new p(e.title),this.display_domain=new p(e.displayDomain),this.show_link_icon=e.showLinkIcon,this.call_to_action=new p(e.callToAction),this.endpoint=new d(e.command)}};r(Pm,"SimpleCardContent");Pm.type="SimpleCardContent";var eS=Pm;var Nm=class extends n{constructor(e){super(),this.message=new p(e.message),this.prominent=e.prominent}};r(Nm,"SimpleCardTeaser");Nm.type="SimpleCardTeaser";var tS=Nm;var Am=class extends n{constructor(e){super(),this.lines=e.lines.map(i=>new p(i)),this.style=e.layoutStyle}};r(Am,"SimpleTextSection");Am.type="SimpleTextSection";var iS=Am;var Rm=class extends n{constructor(e){super(),this.action_text=new p(e.actionText),this.nav_text=new p(e.navigationText),this.details=new p(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new d(e.navigationEndpoint)}};r(Rm,"SingleActionEmergencySupport");Rm.type="SingleActionEmergencySupport";var rS=Rm;var Mm=class extends n{constructor(e){super(),this.title=e.title||"N/A",this.selected=!!e.selected,this.endpoint=new d(e.endpoint),this.content=c.parseItem(e.content,[de,ly,Ni])}};r(Mm,"Tab");Mm.type="Tab";var Se=Mm;var Lm=class extends n{constructor(e){super(),this.tabs=c.parseArray(e.tabs,Se)}};r(Lm,"SingleColumnBrowseResults");Lm.type="SingleColumnBrowseResults";var sS=Lm;var Om=class extends n{constructor(e){super(),this.contents=c.parse(e)}};r(Om,"SingleColumnMusicWatchNextResults");Om.type="SingleColumnMusicWatchNextResults";var oS=Om;var Dm=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.style=e.style}};r(Dm,"SingleHeroImage");Dm.type="SingleHeroImage";var nS=Dm;var Bm=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new p(e.title),this.endpoint=new d(e.navigationEndpoint),this.subscribe_button=c.parseItem(e.subscribeButton,xe)}};r(Bm,"SlimOwner");Bm.type="SlimOwner";var aS=Bm;var Ym=class extends n{constructor(e){super(),this.title=new p(e.title),this.collapsed_subtitle=new p(e.collapsedSubtitle),this.expanded_subtitle=new p(e.expandedSubtitle),this.owner=c.parseItem(e.owner),this.description=new p(e.description),this.video_id=e.videoId,this.date=new p(e.dateText)}};r(Ym,"SlimVideoMetadata");Ym.type="SlimVideoMetadata";var pS=Ym;var Vm=class extends n{constructor(e){super(),this.start_at_option_label=new p(e.startAtOptionLabel)}};r(Vm,"StartAt");Vm.type="StartAt";var Uy=Vm;var Um=class extends n{constructor(e){super(),this.name=new p(e.name),this.is_selected=e.isSelected,this.endpoint=new d(e.navigationEndpoint)}};r(Um,"SubFeedOption");Um.type="SubFeedOption";var Fy=Um;var Fm=class extends n{constructor(e){super(),this.title=new p(e.title),this.options=c.parseArray(e.options,Fy)}};r(Fm,"SubFeedSelector");Fm.type="SubFeedSelector";var cS=Fm;var Wm=class extends n{constructor(e){super(),this.contents=c.parse(e)}};r(Wm,"Tabbed");Wm.type="Tabbed";var lS=Wm;var Gm=class extends n{constructor(e){super(),this.tabs=c.parseArray(e.tabs,Se)}};r(Gm,"TabbedSearchResults");Gm.type="TabbedSearchResults";var uS=Gm;var jm=class extends n{constructor(e){super(),this.title=new p(e.title),this.style=e.style}};r(jm,"TextHeader");jm.type="TextHeader";var fS=jm;var Hm=class extends n{constructor(e){super(),this.share_targets=c.parseArray(e.shareTargets,Vy)}};r(Hm,"ThirdPartyShareTargetSection");Hm.type="ThirdPartyShareTargetSection";var Wy=Hm;var $m=class extends n{constructor(e){super(),this.landscape=y.fromResponse(e.landscape),this.portrait=y.fromResponse(e.portrait)}};r($m,"ThumbnailLandscapePortrait");$m.type="ThumbnailLandscapePortrait";var mS=$m;var Km=class extends n{constructor(e){super(),this.text=new p(e.text).toString()}};r(Km,"ThumbnailOverlayEndorsement");Km.type="ThumbnailOverlayEndorsement";var hS=Km;var qm=class extends n{constructor(e){super(),this.text=new p(e.text),this.icon_type=e.icon.iconType}};r(qm,"ThumbnailOverlayHoverText");qm.type="ThumbnailOverlayHoverText";var dS=qm;var zm=class extends n{constructor(e){super(),this.text=new p(e.text).toString(),this.icon_type=e.icon.iconType}};r(zm,"ThumbnailOverlayInlineUnplayable");zm.type="ThumbnailOverlayInlineUnplayable";var _S=zm;var Xm=class extends n{constructor(e){super(),this.text=new p(e.text)}};r(Xm,"ThumbnailOverlayLoadingPreview");Xm.type="ThumbnailOverlayLoadingPreview";var xS=Xm;var Qm=class extends n{constructor(e){super(),this.text=new p(e.text).toString()}};r(Qm,"ThumbnailOverlayNowPlaying");Qm.type="ThumbnailOverlayNowPlaying";var yS=Qm;var Jm=class extends n{constructor(e){super(),this.hack=e.hack}};r(Jm,"ThumbnailOverlayPinking");Jm.type="ThumbnailOverlayPinking";var bS=Jm;var Zm=class extends n{constructor(e){super(),this.texts=e.texts.map(i=>new p(i))}};r(Zm,"ThumbnailOverlayPlaybackStatus");Zm.type="ThumbnailOverlayPlaybackStatus";var gS=Zm;var eh=class extends n{constructor(e){super(),this.percent_duration_watched=e.percentDurationWatched}};r(eh,"ThumbnailOverlayResumePlayback");eh.type="ThumbnailOverlayResumePlayback";var wS=eh;var th=class extends n{constructor(e){super(),this.text=new p(e.text),this.icon_type=e.icon.iconType}};r(th,"ThumbnailOverlaySidePanel");th.type="ThumbnailOverlaySidePanel";var TS=th;var ih=class extends n{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 d(e.toggledServiceEndpoint)),e.untoggledServiceEndpoint&&(this.untoggled_endpoint=new d(e.untoggledServiceEndpoint))}};r(ih,"ThumbnailOverlayToggleButton");ih.type="ThumbnailOverlayToggleButton";var vS=ih;var rh=class extends n{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 p(e.label),this.icon=e.icon}};r(rh,"TimedMarkerDecoration");rh.type="TimedMarkerDecoration";var IS=rh;var sh=class extends n{constructor(e){super(),this.title=new p(e.title)}};r(sh,"TitleAndButtonListHeader");sh.type="TitleAndButtonListHeader";var SS=sh;var oh=class extends n{constructor(e){super(),this.text=new p(e.defaultText),this.toggled_text=new p(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.default_endpoint=new d(e.defaultServiceEndpoint),this.toggled_endpoint=new d(e.toggledServiceEndpoint)}};r(oh,"ToggleMenuServiceItem");oh.type="ToggleMenuServiceItem";var ES=oh;var nh=class extends n{constructor(e){super(),this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(i=>new d(i)),accept:new d(e.promoConfig.acceptCommand),dismiss:new d(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new p(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}};r(nh,"Tooltip");nh.type="Tooltip";var kS=nh;var ah=class extends n{constructor(e){var i;super(),this.title=new p(e.title),this.avatar=y.fromResponse((i=e.thumbnail)!=null?i:e.avatar),this.subtitle=new p(e.subtitle),this.subscribe_button=c.parseItem(e.subscribeButton,xe),this.endpoint=new d(e.navigationEndpoint)}};r(ah,"TopicChannelDetails");ah.type="TopicChannelDetails";var CS=ah;var ph=class extends n{constructor(e){super(),this.tabs=c.parse(e.tabs),this.secondary_contents=c.parse(e.secondaryContents)}};r(ph,"TwoColumnBrowseResults");ph.type="TwoColumnBrowseResults";var Ot=ph;var ch=class extends n{constructor(e){super(),this.primary_contents=c.parse(e.primaryContents),this.secondary_contents=c.parse(e.secondaryContents)}};r(ch,"TwoColumnSearchResults");ch.type="TwoColumnSearchResults";var Gy=ch;var jy,Pg,lh=class extends n{constructor(e){var o,a,l,f,m;super(),jy.add(this),this.results=c.parseArray((o=e.results)==null?void 0:o.results.contents),this.secondary_results=c.parseArray((a=e.secondaryResults)==null?void 0:a.secondaryResults.results),this.conversation_bar=c.parseItem(e==null?void 0:e.conversationBar);let i=(l=e.playlist)==null?void 0:l.playlist;i&&(this.playlist={id:i.playlistId,title:i.title,author:(f=i.shortBylineText)!=null&&f.simpleText?new p(i.shortBylineText):new P(i.longBylineText),contents:c.parseArray(i.contents),current_index:i.currentIndex,is_infinite:!!i.isInfinite,menu:c.parseItem(i.menu,R)});let s=(m=e.autoplay)==null?void 0:m.autoplay;s&&(this.autoplay={sets:s.sets.map(x=>u(this,jy,"m",Pg).call(this,x))},s.modifiedSets&&(this.autoplay.modified_sets=s.modifiedSets.map(x=>u(this,jy,"m",Pg).call(this,x))),s.countDownSecs&&(this.autoplay.count_down_secs=s.countDownSecs))}};r(lh,"TwoColumnWatchNextResults");jy=new WeakSet,Pg=r(function(e){let i={autoplay_video:new d(e.autoplayVideo)};return e.nextButtonVideo&&(i.next_button_video=new d(e.nextButtonVideo)),i},"_TwoColumnWatchNextResults_parseAutoplaySet");lh.type="TwoColumnWatchNextResults";var Hy=lh;var uh=class extends n{constructor(e){if(super(),e.contents){let i=e.contents.find(s=>s.thirdPartyNetworkSection);i&&(this.third_party_network_section={share_target_container:c.parseItem(i.thirdPartyNetworkSection.shareTargetContainer,Wy),copy_link_container:c.parseItem(i.thirdPartyNetworkSection.copyLinkContainer,Qr),start_at_container:c.parseItem(i.thirdPartyNetworkSection.startAtContainer,Uy)})}this.header=c.parseItem(e.header,Yy),this.share_panel_version=e.sharePanelVersion,Reflect.has(e,"showLoadingSpinner")&&(this.show_loading_spinner=e.showLoadingSpinner)}};r(uh,"UnifiedSharePanel");uh.type="UnifiedSharePanel";var PS=uh;var fh=class extends n{constructor(e){super(),this.header=c.parseItem(e.header),this.call_to_action=c.parseItem(e.callToAction),this.sections=c.parseArray(e.sections),Reflect.has(e,"collapsedLabel")&&(this.collapsed_label=new p(e.collapsedLabel))}};r(fh,"UniversalWatchCard");fh.type="UniversalWatchCard";var $y=fh;var mh=class extends n{constructor(e){super(),this.message_title=new p(e.dialogMessageTitle),this.message_text=new p(e.dialogMessageText),this.action_button=c.parseItem(e.actionButton,v),this.dismiss_button=c.parseItem(e.dismissButton,v),this.is_visible=e.isVisible}};r(mh,"UpsellDialog");mh.type="UpsellDialog";var NS=mh;var hh=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new p(e.collapsedStateButtonText)}get contents(){return this.items}};r(hh,"VerticalList");hh.type="VerticalList";var AS=hh;var dh=class extends n{constructor(e){super(),this.items=c.parseArray(e.items),this.view_all_text=new p(e.viewAllText),this.view_all_endpoint=new d(e.viewAllEndpoint)}get contents(){return this.items}};r(dh,"VerticalWatchCardList");dh.type="VerticalWatchCardList";var RS=dh;var _h=class extends n{constructor(e){super(),this.title=new p(e.videoTitle),this.channel_name=new p(e.channelName),this.view_count=new p(e.viewCountText),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.duration=new p(e.lengthString),this.endpoint=new d(e.action)}};r(_h,"VideoInfoCardContent");_h.type="VideoInfoCardContent";var MS=_h;var xh=class extends n{constructor(e){super(),this.subscription_button=e.subscriptionButton,this.subscriber_count=new p(e.subscriberCountText),this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.thumbnail)}};r(xh,"VideoOwner");xh.type="VideoOwner";var _s=xh;var yh=class extends n{constructor(e){super(),this.original_view_count=e.originalViewCount,this.short_view_count=new p(e.shortViewCount),this.extra_short_view_count=new p(e.extraShortViewCount),this.view_count=new p(e.viewCount)}};r(yh,"VideoViewCount");yh.type="VideoViewCount";var Ky=yh;var bh=class extends n{constructor(e){super(),this.title=new p(e.title),Reflect.has(e,"superTitleLink")&&(this.super_title_link=new p(e.superTitleLink)),this.view_count=c.parseItem(e.viewCount,Ky),this.badges=c.parseArray(e.badges,Ge),this.published=new p(e.dateText),this.relative_date=new p(e.relativeDateText),this.menu=c.parseItem(e.videoActions,R)}};r(bh,"VideoPrimaryInfo");bh.type="VideoPrimaryInfo";var qy=bh;var gh=class extends n{constructor(e){super(),this.owner=c.parseItem(e.owner,_s),this.description=new p(e.description),Reflect.has(e,"attributedDescription")&&(this.description=p.fromAttributed(e.attributedDescription)),this.subscribe_button=c.parseItem(e.subscribeButton,[xe,v]),this.metadata=c.parseItem(e.metadataRowContainer,Zx),this.show_more_text=new p(e.showMoreText),this.show_less_text=new p(e.showLessText),this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}};r(gh,"VideoSecondaryInfo");gh.type="VideoSecondaryInfo";var wh=gh;var Th=class extends n{constructor(e){super(),this.title=new p(e.title),this.subtitle=new p(e.subtitle),this.duration={text:new p(e.lengthText).toString(),seconds:_e(e.lengthText.simpleText)},this.style=e.style}};r(Th,"WatchCardCompactVideo");Th.type="WatchCardCompactVideo";var zy=Th;var vh=class extends n{constructor(e){var i;super(),this.endpoint=new d(e.navigationEndpoint),this.call_to_action_button=c.parseItem(e.callToActionButton),this.hero_image=c.parseItem(e.heroImage),this.label=((i=e.lengthText)==null?void 0:i.accessibility.accessibilityData.label)||""}};r(vh,"WatchCardHeroVideo");vh.type="WatchCardHeroVideo";var LS=vh;var Ih=class extends n{constructor(e){super(),this.title=new p(e.title),this.title_endpoint=new d(e.titleNavigationEndpoint),this.subtitle=new p(e.subtitle),this.author=new P(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title.toString(),this.style=e.style}};r(Ih,"WatchCardRichHeader");Ih.type="WatchCardRichHeader";var OS=Ih;var Sh=class extends n{constructor(e){super(),this.lists=c.parseArray(e.lists)}};r(Sh,"WatchCardSectionSequence");Sh.type="WatchCardSectionSequence";var DS=Sh;var Eh=class extends Ot{constructor(e){super(e)}};r(Eh,"WatchNextTabbedResults");Eh.type="WatchNextTabbedResults";var BS=Eh;var kh=class extends n{constructor(e){var i,s;super(),this.title=e.title,this.content=c.parseItem(e.content,de),this.endpoint=new d(e.navigationEndpoint),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType}};r(kh,"AnchoredSection");kh.type="AnchoredSection";var Xy=kh;var Ch,Ph=class extends n{constructor(e){super(),Ch.set(this,void 0),this.child_display_name=new p(e.childDisplayName),this.child_account_description=new p(e.childAccountDescription),this.avatar=y.fromResponse(e.avatar),this.block_button=c.parseItem(e.blockButton,[se]),this.blocked_entity_key=e.blockedEntityKey}async blockChannel(){if(!u(this,Ch,"f"))throw new g("An active caller must be provide to perform this operation.");let e=this.block_button;if(!e)throw new g("Block button was not found.",{child_display_name:this.child_display_name});if(e.is_toggled)throw new g("This channel is already blocked.",{child_display_name:this.child_display_name});return await e.endpoint.call(u(this,Ch,"f"),{parse:!1})}setActions(e){I(this,Ch,e,"f")}};r(Ph,"KidsBlocklistPickerItem");Ch=new WeakMap;Ph.type="KidsBlocklistPickerItem";var Qy=Ph;var Nh=class extends n{constructor(e){super(),this.title=new p(e.title),this.child_rows=c.parse(e.childRows,!0,[Qy]),this.done_button=c.parseItem(e.doneButton,[v]),this.successful_toast_action_message=new p(e.successfulToastActionMessage)}};r(Nh,"KidsBlocklistPicker");Nh.type="KidsBlocklistPicker";var YS=Nh;var Ah=class extends n{constructor(e){var i,s;super(),this.title=new p(e.title),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType,this.endpoint=new d(e.endpoint)}};r(Ah,"KidsCategoryTab");Ah.type="KidsCategoryTab";var Jy=Ah;var Rh=class extends n{constructor(e){super(),this.category_tabs=c.parseArray(e.categoryTabs,Jy),this.privacy_button=c.parseItem(e.privacyButtonRenderer,v)}};r(Rh,"KidsCategoriesHeader");Rh.type="kidsCategoriesHeader";var VS=Rh;var Mh=class extends n{constructor(e){super(),this.anchors=c.parseArray(e.anchors,Xy)}};r(Mh,"KidsHomeScreen");Mh.type="kidsHomeScreen";var US=Mh;var Dg={};Xe(Dg,{camelToSnake:()=>_r,createRuntimeClass:()=>XS,generateRuntimeClass:()=>Oh,generateTypescriptClass:()=>eb,inferType:()=>Zy,introspect:()=>Rg,isArrayType:()=>qS,isIgnoredKey:()=>zS,isMiscType:()=>KS,isRenderer:()=>Ag,isRendererList:()=>$S,mergeKeyInfo:()=>Lh,parse:()=>Og,toParser:()=>Lg,toTypeDeclaration:()=>Mg});var b1=new Set(["trackingParams","accessibility","accessibilityData"]),Ng={};function _r(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}r(_r,"camelToSnake");function Zy(t,e){let i=!1;if(typeof e=="object"&&e!=null){if(i=Ag(e))return Ng[i]=Reflect.get(e,Reflect.ownKeys(e)[0]),{type:"renderer",renderers:[i],optional:!1};if(i=$S(e)){for(let[o,a]of Object.entries(i))Ng[o]=a;return{type:"array",array_type:"renderer",renderers:Object.keys(i),optional:!1}}if((i=KS(t,e))||(i=qS(e)))return i}let s=typeof e;return s==="object"?{type:"object",keys:Object.entries(e).map(([o,a])=>[o,Zy(o,a)]),optional:!1}:{type:"primitive",typeof:[s],optional:!1}}r(Zy,"inferType");function $S(t){let e=Array.isArray(t);return e&&t.length===0?!1:e&&t.every(s=>Ag(s))?Object.fromEntries(t.map(s=>{let o=Reflect.ownKeys(s)[0].toString();return[ys(o),s[o]]})):!1}r($S,"isRendererList");function KS(t,e){if(typeof e=="object"&&e!==null){if(t.endsWith("Endpoint")||t.endsWith("Command")||t==="endpoint")return{type:"misc",endpoint:new d(e),optional:!1,misc_type:"NavigationEndpoint"};if(Reflect.has(e,"simpleText")||Reflect.has(e,"runs")){let i=new p(e);return{type:"misc",misc_type:"Text",optional:!1,endpoint:i.endpoint,text:i.toString()}}if(Reflect.has(e,"thumbnails")&&Array.isArray(Reflect.get(e,"thumbnails")))return{type:"misc",misc_type:"Thumbnail",optional:!1}}return!1}r(KS,"isMiscType");function Ag(t){if(!(typeof t=="object"))return!1;let i=Reflect.ownKeys(t);if(i.length===1){let s=i[0].toString();if(s.endsWith("Renderer")||s.endsWith("Model"))return ys(s)}return!1}r(Ag,"isRenderer");function qS(t){if(!Array.isArray(t))return!1;if(t.length===0)return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["never"],optional:!1},optional:!1};let e=t.map(a=>typeof a);if(!e.every(a=>a===e[0]))return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!1},optional:!1};let s=e[0];if(s!=="object")return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:[s],optional:!1},optional:!1};let o=[];for(let a=0;a[f,Zy(f,m)]);if(a===0){o=l;continue}o=Lh(o,l).resolved_key_info}return{type:"array",array_type:"object",items:{type:"object",keys:o,optional:!1},optional:!1}}r(qS,"isArrayType");function g1(t){if(typeof t!="object"||t===null)throw new g("Generator: Cannot introspect non-object",{classdata:t});return Reflect.ownKeys(t).filter(i=>!zS(i)).filter(i=>typeof i=="string").map(i=>{let s=Reflect.get(t,i),o=Zy(i,s);return[i,o]})}r(g1,"introspectKeysFirstPass");function w1(t){var l;let i=t.filter(([,f])=>{var m;return f.type!=="misc"||!(f.misc_type==="NavigationEndpoint"||f.misc_type==="Text")?!1:((m=f.endpoint)==null?void 0:m.metadata.page_type)==="WEB_PAGE_TYPE_CHANNEL"}).sort(([,f],[,m])=>f.type!=="misc"||m.type!=="misc"||f.misc_type!=="Text"||m.misc_type!=="Text"?0:m.text.length-f.text.length),s=new Set,o=i[0],a;if(o){s.add(o[0]);let m=t.map(([w])=>w).filter(w=>w.endsWith("Badges")||w==="badges"),_=(l=m.filter(w=>w.startsWith("owner")||w.startsWith("author"))[0])!=null?l:m[0],b=t.find(([w])=>w===_),T=b?b[1].type==="array"&&b[1].array_type==="renderer"&&Reflect.has(b[1].renderers,"MetadataBadge"):!1;T&&_&&s.add(_),a={type:"misc",misc_type:"Author",optional:!1,params:[o[0],T?_:void 0]}}return a&&t.push(["author",a]),t.filter(([f])=>!s.has(f))}r(w1,"introspectKeysSecondPass");function T1(t){let e=g1(t);return w1(e)}r(T1,"introspect2");function Rg(t){let e=T1(t),i=new Map;for(let[,o]of e)if(o.type==="renderer"||o.type==="array"&&o.array_type==="renderer")for(let a of o.renderers){let l=Ng[a];l&&i.set(a,l)}let s=Array.from(i).filter(([o])=>!Dh(o));return{key_info:e,unimplemented_dependencies:s}}r(Rg,"introspect");function zS(t){return typeof t=="string"&&b1.has(t)}r(zS,"isIgnoredKey");function XS(t,e,i){var s,o;i({error_type:"class_not_found",classname:t,key_info:e});let a=(s=r(class extends n{static set key_info(l){I(this,s,new Map(l),"f",o)}static get key_info(){return[...u(this,s,"f",o).entries()]}constructor(l){super();let{key_info:f,unimplemented_dependencies:m}=Rg(l),{resolved_key_info:x,changed_keys:_}=Lh(a.key_info,f);_.length>0&&(a.key_info=x,i({error_type:"class_changed",classname:t,key_info:a.key_info,changed_keys:_}));for(let[T,w]of m)Oh(T,w,i);for(let[T,w]of f){let S=_r(T);w.type==="misc"&&w.misc_type==="NavigationEndpoint"&&(S="endpoint"),Reflect.set(this,S,Og(T,w,l))}}},"_a"),Lw(s,"node"),s.type=t,o={value:new Map},s);return a.key_info=e,Object.defineProperty(a,"name",{value:t,writable:!1}),a}r(XS,"createRuntimeClass");function Oh(t,e,i){let{key_info:s,unimplemented_dependencies:o}=Rg(e),a=XS(t,s,i);Bg(t,a);for(let[l,f]of o)Oh(l,f,i);return a}r(Oh,"generateRuntimeClass");function eb(t,e){let i=[],s=["super();"];for(let[o,a]of e){let l=_r(o);a.type==="misc"&&a.misc_type==="NavigationEndpoint"&&(l="endpoint"),i.push(`${l}${a.optional?"?":""}: ${Mg(a)};`),s.push(`this.${l} = ${Lg(o,a)};`)}return`class ${t} extends YTNode { +format:`,m)}}else(c=Ue(t.mime_type,'codecs="','"'))!=null&&c.startsWith("avc1")&&(s=Xw.BT709);return{primaries:i,transfer_characteristics:s,matrix_coefficients:o}}r(zk,"getColorInfo");async function Qk(t,e,i,s,o,p,c){return{uid:t.itag.toString(),bitrate:t.bitrate,width:t.width,height:t.height,codecs:i.includes("codecs")?void 0:Ue(t.mime_type,'codecs="','"'),fps:i.includes("fps")?void 0:t.fps,segment_info:await tT(t,e,o,s,p,c)}}r(Qk,"getVideoRepresentation");async function Xk(t,e,i,s,o,p){let c=t[0],f=zk(c),m=[];return{mime_type:c.mime_type.split(";")[0],color_info:f,codecs:Jw(t,m),fps:Zw(t,"fps",m),representations:await Promise.all(t.map(_=>Qk(_,e,m,i,s,o,p)))}}r(Xk,"getVideoSet");function Jk(t){var s;let e=new Map,i=t.is(qi)?t.boards:[t.board];for(let o of i){let p=new URL(o.template_url).pathname.split(".").pop(),c=`image/${p==="jpg"?"jpeg":p}`;e.has(c)||e.set(c,[]),(s=e.get(c))==null||s.push(o)}return e}r(Jk,"getStoryboardInfo");async function Zk(t,e,i,s,o){let p=e.template_url,c=i(new URL(p.replace("$M","0"))),f=o.response?o.response:t.session.http.fetch_function(c,{method:"HEAD",headers:Ht});return o.response=f,(await f).headers.get("Content-Type")||s}r(Zk,"getStoryboardMimeType");async function e1(t,e,i){let s=e.template_url,o=[],p=Math.min(e.type==="vod"?e.storyboard_count:5,10);for(let m=0;m({probable_mime_type:c,getMimeType(){return Zk(e,f[0],s,c,p)},representations:f.map(m=>t1(t,e,m,s,p))}))}r(i1,"getImageSets");function r1(t,e,i){let s=e==="vtt"?"text/vtt":"application/ttml+xml";return t.map(o=>{let p=new URL(o.base_url);p.searchParams.set("fmt",e);let c=["caption"];return p.searchParams.has("tlang")&&c.push("dub"),{mime_type:s,language:o.language_code,track_name:o.name.toString(),track_roles:c,representation:{uid:`text-${o.vss_id}`,base_url:i(p).toString()}}})}r(r1,"getTextSets");async function xd(t,e=!1,i=_=>_,s,o,p,c,f,m,x){if(!t)throw new g("Streaming data not available");let _=s?t.adaptive_formats.filter(Y=>!s(Y)):t.adaptive_formats,b,T;if(e){if(T={},!c)throw new g("Unable to get duration or segment count for this Post Live DVR video without an Actions instance");b=r(()=>T?Gk(T,_[0],i,c,p,o):Promise.resolve(0),"getDuration")}else{let Y=_[0].approx_duration_ms/1e3;b=r(()=>Promise.resolve(Y),"getDuration")}let{groups:w,has_multiple_audio_tracks:S}=Uk(_,e),{video_groups:E,audio_groups:C}=w.reduce((Y,ee)=>ee[0].has_audio?(S&&!ee[0].audio_track||Y.audio_groups.push(ee),Y):(Y.video_groups.push(ee),Y),{video_groups:[],audio_groups:[]}),k;C.flat().some(Y=>Y.is_drc)&&(k={label_original:(x==null?void 0:x.label_original)||"Original",label_drc:(x==null?void 0:x.label_drc)||"Stable Volume",label_drc_multiple:(x==null?void 0:x.label_drc_multiple)||(Y=>`${Y} (Stable Volume)`)});let U=await Promise.all(C.map(Y=>$k(Y,i,c,p,o,T,k))),M=await Promise.all(E.map(Y=>Xk(Y,i,p,c,o,T))),K=[];if(f&&c){let Y;if(f.is(qi))Y=_[0].approx_duration_ms/1e3;else{let ee=_[0].target_duration_dec;if(ee===void 0)throw new g("Format is missing target_duration_dec",{format:_[0]});Y=ee}K=i1(Y,c,f,i)}let re=[];if(m&&(x==null?void 0:x.captions_format)){if(x.captions_format!=="vtt"&&x.captions_format!=="ttml")throw new g("Invalid captions format",x.captions_format);re=r1(m,x.captions_format,i)}return{getDuration:b,audio_sets:U,video_sets:M,image_sets:K,text_sets:re}}r(xd,"getStreamingInfo");async function s1({info:t}){if(!t.is_oft&&!t.is_post_live_dvr)return null;let e=await t.getSegmentTemplate();return H("segment-template",{startNumber:e.init_url?"1":"0",timescale:"1000",initialization:e.init_url,media:e.media_url},H("segment-timeline",null,e.timeline.map(i=>H("s",{d:i.duration,r:i.repeat_count}))))}r(s1,"OTFPostLiveDvrSegmentInfo");function iT({info:t}){return t.is_oft||t.is_post_live_dvr?H(s1,{info:t}):H(Qw,null,H("base-url",null,t.base_url),H("segment-base",{indexRange:`${t.index_range.start}-${t.index_range.end}`},H("initialization",{range:`${t.init_range.start}-${t.init_range.end}`})))}r(iT,"SegmentInfo");async function o1({streamingData:t,isPostLiveDvr:e,transformURL:i,rejectFormat:s,cpn:o,player:p,actions:c,storyboards:f,captionTracks:m,options:x}){let{getDuration:_,audio_sets:b,video_sets:T,image_sets:w,text_sets:S}=await xd(t,e,i,s,o,p,c,f,m,x);return H("mpd",{xmlns:"urn:mpeg:dash:schema:mpd:2011",minBufferTime:"PT1.500S",profiles:"urn:mpeg:dash:profile:isoff-main:2011",type:"static",mediaPresentationDuration:`PT${await _()}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"},H("period",null,b.map((E,C)=>H("adaptation-set",{id:C,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",lang:E.language,codecs:E.codecs,audioSamplingRate:E.audio_sample_rate,contentType:"audio"},E.track_roles&&E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),E.track_name&&H("label",{id:C},E.track_name),E.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:E.channels}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,codecs:k.codecs,audioSamplingRate:k.audio_sample_rate},k.channels&&H("audio-channel-configuration",{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:k.channels}),H(iT,{info:k.segment_info}))))),T.map((E,C)=>H("adaptation-set",{id:C+b.length,mimeType:E.mime_type,startWithSAP:"1",subsegmentAlignment:"true",codecs:E.codecs,maxPlayoutRate:"1",frameRate:E.fps,contentType:"video"},E.color_info.primaries&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:ColourPrimaries",value:E.color_info.primaries}),E.color_info.transfer_characteristics&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:TransferCharacteristics",value:E.color_info.transfer_characteristics}),E.color_info.matrix_coefficients&&H("supplemental-property",{schemeIdUri:"urn:mpeg:mpegB:cicp:MatrixCoefficients",value:E.color_info.matrix_coefficients}),E.representations.map(k=>H("representation",{id:k.uid,bandwidth:k.bitrate,width:k.width,height:k.height,codecs:k.codecs,frameRate:k.fps},H(iT,{info:k.segment_info}))))),w.map(async(E,C)=>H("adaptation-set",{id:C+b.length+T.length,mimeType:await E.getMimeType(),contentType:"image"},E.representations.map(async k=>H("representation",{id:`thumbnails_${k.thumbnail_width}x${k.thumbnail_height}`,bandwidth:await k.getBitrate(),width:k.sheet_width,height:k.sheet_height},H("essential-property",{schemeIdUri:"http://dashif.org/thumbnail_tile",value:`${k.columns}x${k.rows}`}),H("segment-template",{media:k.template_url,duration:k.template_duration,startNumber:"0"}))))),S.map((E,C)=>H("adaptation-set",{id:C+b.length+T.length+w.length,mimeType:E.mime_type,lang:E.language,contentType:"text"},E.track_roles.map(k=>H("role",{schemeIdUri:"urn:mpeg:dash:role:2011",value:k})),H("label",{id:C+b.length},E.track_name),H("representation",{id:E.representation.uid,bandwidth:"0"},H("base-url",null,E.representation.base_url))))))}r(o1,"DashManifest");function rT(t,e=!1,i=_=>_,s,o,p,c,f,m,x){if(!t)throw new g("Streaming data not available");return zw(H(o1,{streamingData:t,isPostLiveDvr:e,transformURL:i,options:x,rejectFormat:s,cpn:o,player:p,actions:c,storyboards:f,captionTracks:m}))}r(rT,"toDash");async function n1(t,e,i,s,o,p){if((i==null?void 0:i.status)==="UNPLAYABLE")throw new g("Video is unplayable",{error_type:"UNPLAYABLE"});if((i==null?void 0:i.status)==="LOGIN_REQUIRED")throw new g("Video is login required",{error_type:"LOGIN_REQUIRED"});if(!s)throw new g("Streaming data not available.",{error_type:"NO_STREAMING_DATA"});let c={quality:"360p",type:"video+audio",format:"mp4",range:void 0,...t},f=sT(c,s),m=await f.decipher(o);if(c.type==="video+audio"&&!t.range){let S=await e.session.http.fetch_function(`${m}&cpn=${p}`,{method:"GET",headers:Ht,redirect:"follow"});if(!S.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:S});let E=S.body;if(!E)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:S});return E}let x=1048576*10,_=t.range?t.range.start:0,b=t.range?t.range.end:x,T=!1,w;return new L.shim.ReadableStream({start(){},pull:async S=>{if(T){S.close();return}return(b>=(f.content_length?f.content_length:0)||t.range)&&(T=!0),new Promise(async(E,C)=>{try{w=new AbortController;let k=await e.session.http.fetch_function(`${m}&cpn=${p}&range=${_}-${b||""}`,{method:"GET",headers:{...Ht},signal:w.signal});if(!k.ok)throw new g("The server responded with a non 2xx status code",{error_type:"FETCH_FAILED",response:k});let U=k.body;if(!U)throw new g("Could not get ReadableStream from fetch Response.",{error_type:"FETCH_FAILED",response:k});for await(let M of Xb(U))S.enqueue(M);_=b+1,b+=x,E()}catch(k){C(k)}})},async cancel(S){w.abort(S)}},{highWaterMark:1,size(S){return S.byteLength}})}r(n1,"download");function sT(t,e){if(!e)throw new g("Streaming data not available");let i=[...e.formats||[],...e.adaptive_formats||[]],s=t.type?t.type.includes("audio"):!0,o=t.type?t.type.includes("video"):!0,p=t.language||"original",c=t.quality||"best",f=-1,m=["best","bestefficiency"].includes(c),x=c!=="best",_=i.filter(b=>s&&!b.has_audio||o&&!b.has_video||t.format!=="any"&&!b.mime_type.includes(t.format||"mp4")||!m&&b.quality_label!==c?!1:(b.width&&fb.width===f)),s&&!o){let b=_.filter(T=>p!=="original"?!T.has_video&&!T.has_text&&T.language===p:!T.has_video&&!T.has_text&&T.is_original);b.length>0&&(_=b)}return x?_.sort((b,T)=>b.bitrate-T.bitrate):_.sort((b,T)=>T.bitrate-b.bitrate),_[0]}r(sT,"chooseFormat");var Jb,ci,Zb,qs,oT,yd=class{constructor(e,i,s){Jb.add(this),ci.set(this,void 0),Zb.set(this,void 0),qs.set(this,void 0),I(this,ci,e,"f"),I(this,Zb,i,"f"),I(this,qs,s||L.shim.fetch,"f")}get fetch_function(){return u(this,qs,"f")}async fetch(e,i,s={}){let o=Ve.API.PRODUCTION_1+u(this,ci,"f").api_version,p=(i==null?void 0:i.baseURL)||o,c=typeof e=="string"?!p.endsWith("/")&&!e.startsWith("/")?new URL(`${p}/${e}`):new URL(p+e):e instanceof URL?e:new URL(e.url,p),f=(i==null?void 0:i.headers)||(e instanceof L.shim.Request?e.headers:new L.shim.Headers)||new L.shim.Headers,m=(i==null?void 0:i.body)||(e instanceof L.shim.Request?e.body:void 0),x=new L.shim.Headers(f);x.set("Accept","*/*"),x.set("Accept-Language","*"),x.set("X-Goog-Visitor-Id",(s==null?void 0:s.visitor_data)||u(this,ci,"f").context.client.visitorData||""),x.set("X-Youtube-Client-Version",u(this,ci,"f").context.client.clientVersion||"");let _=Object.values(V).find(C=>C.NAME===u(this,ci,"f").context.client.clientName);_&&x.set("X-Youtube-Client-Name",_.NAME_ID),L.shim.server&&(x.set("User-Agent",Qi("desktop")),x.set("Origin",c.origin)),c.searchParams.set("prettyPrint","false"),c.searchParams.set("alt","json");let b=x.get("Content-Type"),T=m,w=p===o||p===Ve.YT_UPLOAD;if(b==="application/json"&&w&&typeof m=="string"){let k={...JSON.parse(m),context:JSON.parse(JSON.stringify(u(this,ci,"f").context))};u(this,Jb,"m",oT).call(this,k.context,k.client),x.set("X-Youtube-Client-Version",k.context.client.clientVersion);let U=Object.values(V).find(M=>M.NAME===k.context.client.clientName);U&&x.set("X-Youtube-Client-Name",U.NAME_ID),delete k.client,k.context.client.clientName==="ANDROID"||k.context.client.clientName==="ANDROID_MUSIC"?(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2")):k.context.client.clientName==="iOS"&&x.set("User-Agent",V.IOS.USER_AGENT),T=JSON.stringify(k)}else b==="application/x-protobuf"&&L.shim.server&&(x.set("User-Agent",V.ANDROID.USER_AGENT),x.set("X-GOOG-API-FORMAT-VERSION","2"),x.delete("X-Youtube-Client-Version"));let S=new L.shim.Request(c,e instanceof L.shim.Request?e:i),E=await u(this,qs,"f").call(this,S,{body:T,headers:x,redirect:e instanceof L.shim.Request?e.redirect:(i==null?void 0:i.redirect)||"follow",...L.shim.runtime!=="cf-worker"?{credentials:"include"}:{}});if(E.ok)return E;throw new g(`Request to ${E.url} failed with status ${E.status}`,await E.text())}};r(yd,"HTTPClient");ci=new WeakMap,Zb=new WeakMap,qs=new WeakMap,Jb=new WeakSet,oT=r(function(e,i){if(!!i){if(!hd.includes(i.toUpperCase()))throw new g(`Invalid client: ${i}`,{available_innertube_clients:hd});switch((i==="ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTMUSIC_ANDROID"||i==="YTSTUDIO_ANDROID")&&(e.client.androidSdkVersion=V.ANDROID.SDK_VERSION,e.client.userAgent=V.ANDROID.USER_AGENT,e.client.osName="Android",e.client.osVersion="13",e.client.platform="MOBILE"),i.toUpperCase()){case"MWEB":e.client.clientVersion=V.MWEB.VERSION,e.client.clientName=V.MWEB.NAME,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.platform="MOBILE";break;case"IOS":e.client.deviceMake="Apple",e.client.deviceModel=V.IOS.DEVICE_MODEL,e.client.clientVersion=V.IOS.VERSION,e.client.clientName=V.IOS.NAME,e.client.platform="MOBILE",e.client.osName="iOS",delete e.client.browserName,delete e.client.browserVersion;break;case"YTMUSIC":e.client.clientVersion=V.YTMUSIC.VERSION,e.client.clientName=V.YTMUSIC.NAME;break;case"ANDROID":e.client.clientVersion=V.ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.ANDROID.NAME;break;case"YTMUSIC_ANDROID":e.client.clientVersion=V.YTMUSIC_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTMUSIC_ANDROID.NAME;break;case"YTSTUDIO_ANDROID":e.client.clientVersion=V.YTSTUDIO_ANDROID.VERSION,e.client.clientFormFactor="SMALL_FORM_FACTOR",e.client.clientName=V.YTSTUDIO_ANDROID.NAME;break;case"TV":{e.client.clientVersion=V.TV.VERSION,e.client.clientName=V.TV.NAME,e.client.userAgent=V.TV.USER_AGENT;break}case"TV_EMBEDDED":e.client.clientName=V.TV_EMBEDDED.NAME,e.client.clientVersion=V.TV_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:Ve.YT_BASE};break;case"YTKIDS":e.client.clientVersion=V.WEB_KIDS.VERSION,e.client.clientName=V.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=V.WEB_EMBEDDED.NAME,e.client.clientVersion=V.WEB_EMBEDDED.VERSION,e.client.clientScreen="EMBED",e.thirdParty={embedUrl:Ve.GOOGLE_SEARCH_BASE};break;case"WEB_CREATOR":e.client.clientName=V.WEB_CREATOR.NAME,e.client.clientVersion=V.WEB_CREATOR.VERSION;break;default:break}}},"_HTTPClient_adjustContext");var eg=yd;var mt={};qe(mt,{compress:()=>a1,decompress:()=>p1});function a1(t){let e=[],i={};for(let p=0;p<256;p++)i[String.fromCharCode(p)]=p;let s="",o=256;for(let p=0;pString.fromCharCode(p)).join("")}r(a1,"compress");function p1(t){let e={},i=t.split(""),s=[i.shift()],o=i.length>>>0,p=256,c=s[0],f=c;for(let m=0;mP1,encodeCommentActionParams:()=>lg,encodeNextParams:()=>N1,encodeVisitorData:()=>C1});function aT(){let t=0,e=0;for(let s=0;s<28;s+=7){let o=this.buf[this.pos++];if(t|=(o&127)<>4,(i&128)==0)return this.assertBounds(),[t,e];for(let s=3;s<=31;s+=7){let o=this.buf[this.pos++];if(e|=(o&127)<>>p,f=!(c>>>7==0&&e==0),m=(f?c|128:c)&255;if(i.push(m),!f)return}let s=t>>>28&15|(e&7)<<4,o=e>>3!=0;if(i.push((o?s|128:s)&255),!!o){for(let p=3;p<31;p=p+7){let c=e>>>p,f=c>>>7!=0,m=(f?c|128:c)&255;if(i.push(m),!f)return}i.push(e>>>31&1)}}r(gd,"varint64write");var bd=4294967296;function tg(t){let e=t[0]==="-";e&&(t=t.slice(1));let i=1e6,s=0,o=0;function p(c,f){let m=Number(t.slice(c,f));o*=i,s=s*i+m,s>=bd&&(o=o+(s/bd|0),s=s%bd)}return r(p,"add1e6digit"),p(-24,-18),p(-18,-12),p(-12,-6),p(-6),e?lT(s,o):rg(s,o)}r(tg,"int64FromString");function pT(t,e){let i=rg(t,e),s=i.hi&2147483648;s&&(i=lT(i.lo,i.hi));let o=ig(i.lo,i.hi);return s?"-"+o:o}r(pT,"int64ToString");function ig(t,e){if({lo:t,hi:e}=l1(t,e),e<=2097151)return String(bd*e+t);let i=t&16777215,s=(t>>>24|e<<8)&16777215,o=e>>16&65535,p=i+s*6777216+o*6710656,c=s+o*8147497,f=o*2,m=1e7;return p>=m&&(c+=Math.floor(p/m),p%=m),c>=m&&(f+=Math.floor(c/m),c%=m),f.toString()+nT(c)+nT(p)}r(ig,"uInt64ToString");function l1(t,e){return{lo:t>>>0,hi:e>>>0}}r(l1,"toUnsigned");function rg(t,e){return{lo:t|0,hi:e|0}}r(rg,"newBits");function lT(t,e){return e=~e,t?t=~t+1:e+=1,rg(t,e)}r(lT,"negate");var nT=r(t=>{let e=String(t);return"0000000".slice(e.length)+e},"decimalFrom1e7WithLeadingZeros");function sg(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let i=0;i<9;i++)e.push(t&127|128),t=t>>7;e.push(1)}}r(sg,"varint32write");function cT(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let i=5;(t&128)!==0&&i<10;i++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}r(cT,"varint32read");var ht=c1();function c1(){let t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){let i=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),p=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(c){let f=typeof c=="bigint"?c:BigInt(c);if(f>s||fp||f>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(mT(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return ag(e),sg(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let i=this.encodeUtf8(e);return this.uint32(i.byteLength),this.raw(i)}float(e){_1(e);let i=new Uint8Array(4);return new DataView(i.buffer).setFloat32(0,e,!0),this.raw(i)}double(e){let i=new Uint8Array(8);return new DataView(i.buffer).setFloat64(0,e,!0),this.raw(i)}fixed32(e){mT(e);let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,e,!0),this.raw(i)}sfixed32(e){ag(e);let i=new Uint8Array(4);return new DataView(i.buffer).setInt32(0,e,!0),this.raw(i)}sint32(e){return ag(e),e=(e<<1^e>>31)>>>0,sg(e,this.buf),this}sfixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=ht.enc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}fixed64(e){let i=new Uint8Array(8),s=new DataView(i.buffer),o=ht.uEnc(e);return s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),this.raw(i)}int64(e){let i=ht.enc(e);return gd(i.lo,i.hi,this.buf),this}sint64(e){let i=ht.enc(e),s=i.hi>>31,o=i.lo<<1^s,p=(i.hi<<1|i.lo>>>31)^s;return gd(o,p,this.buf),this}uint64(e){let i=ht.uEnc(e);return gd(i.lo,i.hi,this.buf),this}};r(Pe,"BinaryWriter");var Z=class{constructor(e,i=ng().decodeUtf8){this.decodeUtf8=i,this.varint64=aT,this.uint32=cT,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),i=e>>>3,s=e&7;if(i<=0||s<0||s>5)throw new Error("illegal tag: field no "+i+" wire type "+s);return[i,s]}skip(e,i){let s=this.pos;switch(e){case ui.Varint:for(;this.buf[this.pos++]&128;);break;case ui.Bit64:this.pos+=4;case ui.Bit32:this.pos+=4;break;case ui.LengthDelimited:let o=this.uint32();this.pos+=o;break;case ui.StartGroup:for(;;){let[p,c]=this.tag();if(c===ui.EndGroup){if(i!==void 0&&p!==i)throw new Error("invalid end group tag");break}this.skip(c,p)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(s,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return ht.dec(...this.varint64())}uint64(){return ht.uDec(...this.varint64())}sint64(){let[e,i]=this.varint64(),s=-(e&1);return e=(e>>>1|(i&1)<<31)^s,i=i>>>1^s,ht.dec(e,i)}bool(){let[e,i]=this.varint64();return e!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return ht.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return ht.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),i=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(i,i+e)}string(){return this.decodeUtf8(this.bytes())}};r(Z,"BinaryReader");function ag(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>h1||tm1||t<0)throw new Error("invalid uint32: "+t)}r(mT,"assertUInt32");function _1(t){if(typeof t=="string"){let e=t;if(t=Number(t),isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>u1||t>>3){case 1:if(p!==10)break;o.id=i.string();continue;case 5:if(p!==40)break;o.timestamp=i.int32();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function y1(){return{params:void 0,number0:void 0,number1:void 0}}r(y1,"createBaseLiveMessageParams");var IT={encode(t,e=new Pe){return t.params!==void 0&&yT.encode(t.params,e.uint32(10).fork()).join(),t.number0!==void 0&&e.uint32(16).int32(t.number0),t.number1!==void 0&&e.uint32(24).int32(t.number1),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=y1();for(;i.pos>>3){case 1:if(p!==10)break;o.params=yT.decode(i,i.uint32());continue;case 2:if(p!==16)break;o.number0=i.int32();continue;case 3:if(p!==24)break;o.number1=i.int32();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function b1(){return{ids:void 0}}r(b1,"createBaseLiveMessageParams_Params");var yT={encode(t,e=new Pe){return t.ids!==void 0&&bT.encode(t.ids,e.uint32(42).fork()).join(),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=b1();for(;i.pos>>3){case 5:if(p!==42)break;o.ids=bT.decode(i,i.uint32());continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function g1(){return{channelId:"",videoId:""}}r(g1,"createBaseLiveMessageParams_Params_Ids");var bT={encode(t,e=new Pe){return t.channelId!==""&&e.uint32(10).string(t.channelId),t.videoId!==""&&e.uint32(18).string(t.videoId),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=g1();for(;i.pos>>3){case 1:if(p!==10)break;o.channelId=i.string();continue;case 2:if(p!==18)break;o.videoId=i.string();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function w1(){return{type:0,commentId:"",videoId:"",unkNum:void 0,channelId:void 0,translateCommentParams:void 0}}r(w1,"createBasePeformCommentActionParams");var ST={encode(t,e=new Pe){return t.type!==0&&e.uint32(8).int32(t.type),t.commentId!==""&&e.uint32(26).string(t.commentId),t.videoId!==""&&e.uint32(42).string(t.videoId),t.unkNum!==void 0&&e.uint32(16).int32(t.unkNum),t.channelId!==void 0&&e.uint32(186).string(t.channelId),t.translateCommentParams!==void 0&&gT.encode(t.translateCommentParams,e.uint32(250).fork()).join(),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=w1();for(;i.pos>>3){case 1:if(p!==8)break;o.type=i.int32();continue;case 3:if(p!==26)break;o.commentId=i.string();continue;case 5:if(p!==42)break;o.videoId=i.string();continue;case 2:if(p!==16)break;o.unkNum=i.int32();continue;case 23:if(p!==186)break;o.channelId=i.string();continue;case 31:if(p!==250)break;o.translateCommentParams=gT.decode(i,i.uint32());continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function T1(){return{params:void 0,commentId:"",targetLanguage:""}}r(T1,"createBasePeformCommentActionParams_TranslateCommentParams");var gT={encode(t,e=new Pe){return t.params!==void 0&&wT.encode(t.params,e.uint32(26).fork()).join(),t.commentId!==""&&e.uint32(18).string(t.commentId),t.targetLanguage!==""&&e.uint32(34).string(t.targetLanguage),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=T1();for(;i.pos>>3){case 3:if(p!==26)break;o.params=wT.decode(i,i.uint32());continue;case 2:if(p!==18)break;o.commentId=i.string();continue;case 4:if(p!==34)break;o.targetLanguage=i.string();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function v1(){return{comment:void 0}}r(v1,"createBasePeformCommentActionParams_TranslateCommentParams_Params");var wT={encode(t,e=new Pe){return t.comment!==void 0&&TT.encode(t.comment,e.uint32(10).fork()).join(),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=v1();for(;i.pos>>3){case 1:if(p!==10)break;o.comment=TT.decode(i,i.uint32());continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function I1(){return{text:""}}r(I1,"createBasePeformCommentActionParams_TranslateCommentParams_Params_Comment");var TT={encode(t,e=new Pe){return t.text!==""&&e.uint32(10).string(t.text),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=I1();for(;i.pos>>3){case 1:if(p!==10)break;o.text=i.string();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function S1(){return{shortId:"",params:void 0,feature2:0,feature3:0}}r(S1,"createBaseReelSequence");var ET={encode(t,e=new Pe){return t.shortId!==""&&e.uint32(10).string(t.shortId),t.params!==void 0&&vT.encode(t.params,e.uint32(42).fork()).join(),t.feature2!==0&&e.uint32(80).int32(t.feature2),t.feature3!==0&&e.uint32(104).int32(t.feature3),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=S1();for(;i.pos>>3){case 1:if(p!==10)break;o.shortId=i.string();continue;case 5:if(p!==42)break;o.params=vT.decode(i,i.uint32());continue;case 10:if(p!==80)break;o.feature2=i.int32();continue;case 13:if(p!==104)break;o.feature3=i.int32();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function E1(){return{number:0}}r(E1,"createBaseReelSequence_Params");var vT={encode(t,e=new Pe){return t.number!==0&&e.uint32(24).int32(t.number),e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=E1();for(;i.pos>>3){case 3:if(p!==24)break;o.number=i.int32();continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function k1(){return{videoId:[]}}r(k1,"createBaseNextParams");var kT={encode(t,e=new Pe){for(let i of t.videoId)e.uint32(42).string(i);return e},decode(t,e){let i=t instanceof Z?t:new Z(t),s=e===void 0?i.len:i.pos+e,o=k1();for(;i.pos>>3){case 5:if(p!==42)break;o.videoId.push(i.string());continue}if((p&7)===4||p===0)break;i.skip(p&7)}return o}};function C1(t,e){let i=pg.encode({id:t,timestamp:e});return encodeURIComponent(Kt(i.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(C1,"encodeVisitorData");function P1(t){return pg.decode(cg(decodeURIComponent(t).replace(/-/g,"+").replace(/_/g,"/")))}r(P1,"decodeVisitorData");function lg(t,e={}){let i={type:t,commentId:e.comment_id||" ",videoId:e.video_id||" ",channelId:" ",unkNum:2};if(e.hasOwnProperty("text")){if(typeof e.target_language!="string")throw new Error("target_language must be a string");e.comment_id&&delete i.unkNum,i.translateCommentParams={params:{comment:{text:e.text}},commentId:e.comment_id||" ",targetLanguage:e.target_language}}let s=ST.encode(i);return encodeURIComponent(Kt(s.finish()))}r(lg,"encodeCommentActionParams");function N1(t){let e=kT.encode({videoId:t});return encodeURIComponent(Kt(e.finish()).replace(/\+/g,"-").replace(/\//g,"_"))}r(N1,"encodeNextParams");var Qs=class extends n{constructor(e){super(),this.popup=l.parseItem(e.popup),this.popup_type=e.popupType}};r(Qs,"OpenPopupAction");Qs.type="OpenPopupAction";var wd=Qs;var Xs=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new a(e.text).toString()),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"label")&&(this.label=e.accessibility.label),Reflect.has(e,"tooltip")&&(this.tooltip=e.tooltip),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"isDisabled")&&(this.is_disabled=e.isDisabled),this.endpoint=new h(e.navigationEndpoint||e.serviceEndpoint||e.command)}};r(Xs,"Button");Xs.type="Button";var v=Xs;var Js=class extends n{constructor(e){var i;super(),this.label=new a(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 h(e.onSelectCommand)),Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),Reflect.has(e,"descriptionText")&&(this.description=new a(e.descriptionText))}};r(Js,"DropdownItem");Js.type="DropdownItem";var Td=Js;var Zs=class extends n{constructor(e){super(),this.label=e.label||"",this.entries=l.parseArray(e.entries,Td)}};r(Zs,"Dropdown");Zs.type="Dropdown";var fi=Zs;var eo=class extends n{constructor(e){super(),this.title=new a(e.dialogTitle).toString(),this.title_placeholder=e.titlePlaceholder||"",this.privacy_option=l.parseItem(e.privacyOption,fi),this.create_button=l.parseItem(e.cancelButton,v),this.cancel_button=l.parseItem(e.cancelButton,v)}};r(eo,"CreatePlaylistDialog");eo.type="CreatePlaylistDialog";var vd=eo;var mi=class extends n{constructor(e){var i,s,o,p,c,f,m,x;if(super(),e){if(e.serialCommand||e.parallelCommand){let _=e.serialCommand||e.parallelCommand;this.commands=_.commands.map(b=>new mi(b))}(e.innertubeCommand||e.command||e.performOnceCommand)&&(e=e.innertubeCommand||e.command||e.performOnceCommand)}this.command=l.parseCommand(e),Reflect.has(e||{},"openPopupAction")&&(this.open_popup=new wd(e.openPopupAction)),this.name=Object.keys(e||{}).find(_=>_.endsWith("Endpoint")||_.endsWith("Command")),this.payload=this.name?Reflect.get(e,this.name):{},(Reflect.has(this.payload,"dialog")||Reflect.has(this.payload,"content"))&&(this.dialog=l.parseItem(this.payload.dialog||this.payload.content)),Reflect.has(this.payload,"modal")&&(this.modal=l.parseItem(this.payload.modal)),Reflect.has(this.payload,"nextEndpoint")&&(this.next_endpoint=new mi(this.payload.nextEndpoint)),e!=null&&e.serviceEndpoint&&(e=e.serviceEndpoint),this.metadata={},(s=(i=e==null?void 0:e.commandMetadata)==null?void 0:i.webCommandMetadata)!=null&&s.url&&(this.metadata.url=e.commandMetadata.webCommandMetadata.url),(p=(o=e==null?void 0:e.commandMetadata)==null?void 0:o.webCommandMetadata)!=null&&p.webPageType&&(this.metadata.page_type=e.commandMetadata.webCommandMetadata.webPageType),(f=(c=e==null?void 0:e.commandMetadata)==null?void 0:c.webCommandMetadata)!=null&&f.apiUrl?this.metadata.api_url=e.commandMetadata.webCommandMetadata.apiUrl.replace("/youtubei/v1/",""):this.name&&(this.metadata.api_url=this.getPath(this.name)),(x=(m=e==null?void 0:e.commandMetadata)==null?void 0:m.webCommandMetadata)!=null&&x.sendPost&&(this.metadata.send_post=e.commandMetadata.webCommandMetadata.sendPost),e!=null&&e.createPlaylistEndpoint&&e!=null&&e.createPlaylistEndpoint.createPlaylistDialog&&(this.dialog=l.parseItem(e==null?void 0:e.createPlaylistEndpoint.createPlaylistDialog,vd))}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,i){if(!e)throw new Error("An API caller must be provided");if(this.command){let s=this.command;return e.execute(s.getApiPath(),{...s.buildRequest(),...i})}if(!this.metadata.api_url)throw new Error("Expected an api_url, but none was found.");return e.execute(this.metadata.api_url,{...this.payload,...i})}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}`}};r(mi,"NavigationEndpoint");mi.type="NavigationEndpoint";var h=mi;var y=class{constructor(e){this.url=e.url,this.width=e.width,this.height=e.height}static fromResponse(e){if(!e)return[];let i;return e.thumbnails?i=e.thumbnails:e.sources&&(i=e.sources),i?i.map(s=>new y(s)).sort((s,o)=>o.width-s.width):[]}};r(y,"Thumbnail");var hi=class{constructor(e){var i,s,o,p,c,f;this.text=((i=e.emoji)==null?void 0:i.emojiId)||((o=(s=e.emoji)==null?void 0:s.shortcuts)==null?void 0:o[0])||e.text||"",this.emoji={emoji_id:e.emoji.emojiId,shortcuts:((p=e.emoji)==null?void 0:p.shortcuts)||[],search_terms:((c=e.emoji)==null?void 0:c.searchTerms)||[],image:y.fromResponse(e.emoji.image),is_custom:!!((f=e.emoji)!=null&&f.isCustomEmoji)}}toString(){return this.text}toHTML(){let e=Id(this.text);return`${e}`}};r(hi,"EmojiRun");var di=class{constructor(e){this.text=e.text,this.bold=Boolean(e.bold),this.italics=Boolean(e.italics),this.strikethrough=Boolean(e.strikethrough),this.deemphasize=Boolean(e.deemphasize),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint)),this.attachment=e.attachment}toString(){return this.text}toHTML(){let e=[];this.bold&&e.push("b"),this.italics&&e.push("i"),this.strikethrough&&e.push("s"),this.deemphasize&&e.push("small");let i=Id(this.text),o=`${e.map(p=>`<${p}>`).join("")+i+e.map(p=>``).join("")}`;if(this.attachment&&this.attachment.element.type.imageType.image.sources.length){let{url:p}=this.attachment.element.type.imageType.image.sources[0];if(this.endpoint){let c=this.endpoint.toURL();if(c)return`${o}`}}if(this.endpoint){let p=this.endpoint.toURL();if(p)return`${o}`}return o}};r(di,"TextRun");function Id(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}r(Id,"escape");var to="Text",a=class{constructor(e){var i,s,o,p;typeof e=="object"&&e!==null&&Reflect.has(e,"runs")&&Array.isArray(e.runs)?(this.runs=e.runs.map(c=>c.emoji?new hi(c):new di(c)),this.text=this.runs.map(c=>c.text).join("")):this.text=e==null?void 0:e.simpleText,typeof e=="object"&&e!==null&&Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint)),typeof e=="object"&&e!==null&&Reflect.has(e,"titleNavigationEndpoint")&&(this.endpoint=new h(e.titleNavigationEndpoint)),this.endpoint||(s=(i=this.runs)==null?void 0:i[0])!=null&&s.endpoint&&(this.endpoint=(p=(o=this.runs)==null?void 0:o[0])==null?void 0:p.endpoint)}static fromAttributed(e){var f,m,x;let{content:i,styleRuns:s,commandRuns:o,attachmentRuns:p}=e,c=[{text:i,startIndex:0}];if(s||o||p){if(s)for(let _ of s)if(_.italic||_.strikethrough==="LINE_STYLE_SINGLE"||_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD"){let b=ug(c,_);if(!b){D.warn(to,"Unable to find matching run for style run. Skipping...",{style_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(c))});continue}Sd(c,b,_,{bold:_.weightLabel==="FONT_WEIGHT_MEDIUM"||_.weightLabel==="FONT_WEIGHT_BOLD",italics:_.italic,strikethrough:_.strikethrough==="LINE_STYLE_SINGLE"})}else D.debug(to,"Skipping style run as it is doesn't have any information that we parse.",{style_run:_,input_data:e});if(o)for(let _ of o)if(_.onTap){let b=ug(c,_);if(!b){D.warn(to,"Unable to find matching run for command run. Skipping...",{command_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(c))});continue}Sd(c,b,_,{navigationEndpoint:_.onTap})}else D.debug(to,'Skipping command run as it is missing the "doTap" property.',{command_run:_,input_data:e});if(p)for(let _ of p){let b=ug(c,_);if(!b){D.warn(to,"Unable to find matching run for attachment run. Skipping...",{attachment_run:_,input_data:e,parsed_runs:JSON.parse(JSON.stringify(c))});continue}if(_.length===0)b.attachment=_;else{let T=_.startIndex-b.startIndex,w=b.text.substring(T,T+_.length),S=/^:[^:]+:$/.test(w);if(((x=(m=(f=_.element)==null?void 0:f.type)==null?void 0:m.imageType)==null?void 0:x.image)&&(S||/^(?:\p{Emoji}|\u200d)+$/u.test(w))){let E={image:_.element.type.imageType.image,isCustomEmoji:S,shortcuts:S?[w]:void 0};Sd(c,b,_,{emoji:E})}else Sd(c,b,_,{attachment:_})}}}return new a({runs:c})}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"}};r(a,"Text");function ug(t,e){return t.find(i=>i.startIndex<=e.startIndex&&e.startIndex+e.length<=i.startIndex+i.text.length)}r(ug,"findMatchingRun");function Sd(t,e,i,s){let o=t.indexOf(e),p=[],c=i.startIndex-e.startIndex;i.startIndex>e.startIndex&&p.push({...e,text:e.text.substring(0,c)}),p.push({...e,text:e.text.substring(c,c+i.length),startIndex:i.startIndex,...s}),i.startIndex+i.length{var s,o;return{title:i.title,selected:i.selected,continuation:(o=(s=i.continuation)==null?void 0:s.reloadContinuationData)==null?void 0:o.continuation,endpoint:new h(i.serviceEndpoint||i.navigationEndpoint),subtitle:i.subtitle||null}}))}};r(go,"SortFilterSubMenu");go.type="SortFilterSubMenu";var dt=go;var wo=class extends n{constructor(e){super(),this.language_menu=l.parseItem(e.languageMenu,dt)}};r(wo,"TranscriptFooter");wo.type="TranscriptFooter";var Dd=wo;var To=class extends n{constructor(e){super(),this.formatted_placeholder=new a(e.formattedPlaceholder),this.clear_button=l.parseItem(e.clearButton,v),this.endpoint=new h(e.onTextChangeCommand),this.search_button=l.parseItem(e.searchButton,v)}};r(To,"TranscriptSearchBox");To.type="TranscriptSearchBox";var Bd=To;var vo=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new a(e.snippet)}};r(vo,"TranscriptSectionHeader");vo.type="TranscriptSectionHeader";var Yd=vo;var Io=class extends n{constructor(e){super(),this.start_ms=e.startMs,this.end_ms=e.endMs,this.snippet=new a(e.snippet),this.start_time_text=new a(e.startTimeText),this.target_id=e.targetId}};r(Io,"TranscriptSegment");Io.type="TranscriptSegment";var Vd=Io;var So=class extends n{constructor(e){super(),this.initial_segments=l.parseArray(e.initialSegments,[Vd,Yd]),this.no_result_label=new a(e.noResultLabel),this.retry_label=new a(e.retryLabel),this.touch_captions_enabled=e.touchCaptionsEnabled}};r(So,"TranscriptSegmentList");So.type="TranscriptSegmentList";var Ud=So;var Eo=class extends n{constructor(e){super(),this.header=l.parseItem(e.header,Bd),this.body=l.parseItem(e.body,Ud),this.footer=l.parseItem(e.footer,Dd),this.target_id=e.targetId}};r(Eo,"TranscriptSearchPanel");Eo.type="TranscriptSearchPanel";var Fd=Eo;var ko=class extends n{constructor(e){super(),this.content=l.parseItem(e.content,Fd)}};r(ko,"Transcript");ko.type="Transcript";var Mr=ko;var Co=class extends n{constructor(e){super(),this.target_id=e.targetId,this.content=l.parseItem(e.content,Mr)}};r(Co,"UpdateEngagementPanelAction");Co.type="UpdateEngagementPanelAction";var MT=Co;var Po=class extends n{constructor(e){super(),this.channel_id=e.channelId,this.subscribed=e.subscribed}};r(Po,"UpdateSubscribeButtonAction");Po.type="UpdateSubscribeButtonAction";var LT=Po;var No=class extends n{constructor(e){super(),this.account_name=new a(e.accountName),this.account_photo=y.fromResponse(e.accountPhoto),this.endpoint=new h(e.serviceEndpoint),this.manage_account_title=new a(e.manageAccountTitle),this.channel_handle=new a(e.channelHandle)}};r(No,"ActiveAccountHeader");No.type="ActiveAccountHeader";var OT=No;var Ao=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(Ao,"MenuTitle");Ao.type="MenuTitle";var Wd=Ao;var Ro=class extends n{constructor(e){var i;super(),this.add_to_playlist_service_endpoint=new h(e.addToPlaylistServiceEndpoint),this.contains_selected_videos=e.containsSelectedVideos,this.playlist_id=e.playlistId,this.privacy=e.privacy,this.privacy_icon={icon_type:((i=e.privacyIcon)==null?void 0:i.iconType)||null},this.remove_from_playlist_service_endpoint=new h(e.removeFromPlaylistServiceEndpoint),this.title=new a(e.title)}};r(Ro,"PlaylistAddToOption");Ro.type="PlaylistAddToOption";var Gd=Ro;var Mo=class extends n{constructor(e){super(),this.actions=l.parseArray(e.actions,[Wd,v]),this.playlists=l.parseArray(e.playlists,Gd)}};r(Mo,"AddToPlaylist");Mo.type="AddToPlaylist";var DT=Mo;var Lo=class extends n{constructor(e){super(),this.text=new a(e.text),this.alert_type=e.type}};r(Lo,"Alert");Lo.type="Alert";var Lr=Lo;var Oo=class extends n{constructor(e){super(),this.text=new a(e.text),this.alert_type=e.type,this.dismiss_button=l.parseItem(e.dismissButton,v)}};r(Oo,"AlertWithButton");Oo.type="AlertWithButton";var jd=Oo;var Do=class extends n{constructor(e){super(),this.text=a.fromAttributed(e.text),this.suffix=a.fromAttributed(e.suffix)}};r(Do,"AttributionView");Do.type="AttributionView";var Hd=Do;var Bo=class extends n{constructor(e){super(),this.audio_only_availability=e.audioOnlyAvailability}};r(Bo,"AudioOnlyPlayability");Bo.type="AudioOnlyPlayability";var $d=Bo;var Yo=class extends n{constructor(e){var i,s;super(),(s=(i=e==null?void 0:e.content)==null?void 0:i.automixPlaylistVideoRenderer)!=null&&s.navigationEndpoint&&(this.playlist_video={endpoint:new h(e.content.automixPlaylistVideoRenderer.navigationEndpoint)})}};r(Yo,"AutomixPreviewVideo");Yo.type="AutomixPreviewVideo";var Kd=Yo;var Vo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.avatar_image_size=e.avatarImageSize,e.image.processor&&(this.image_processor={border_image_processor:{circular:e.image.processor.borderImageProcessor.circular}})}};r(Vo,"AvatarView");Vo.type="AvatarView";var qd=Vo;var Uo=class extends n{constructor(e){super(),this.icon_name=e.iconName,this.title=e.title,this.accessibility_text=e.accessibilityText,this.style=e.style,this.is_full_width=e.isFullWidth,this.button_type=e.type,this.button_size=e.buttonSize,this.on_tap=new h(e.onTap)}};r(Uo,"ButtonView");Uo.type="ButtonView";var te=Uo;var Fo=class extends n{constructor(e){super(),this.body_text=new a(e.bodyText),this.cta_button=l.parseItem(e.ctaButton,[v,te]),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.title=new a(e.title)}};r(Fo,"BackgroundPromo");Fo.type="BackgroundPromo";var BT=Fo;var Wo=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.endpoint=new h(e.command)}};r(Wo,"BackstageImage");Wo.type="BackstageImage";var zd=Wo;var Go=class extends n{constructor(e){var s,o,p,c,f,m,x,_,b;super(),this.text=new a(e.defaultText),this.toggled_text=new a(e.toggledText),this.tooltip=e.defaultTooltip,this.toggled_tooltip=e.toggledTooltip,this.is_toggled=e.isToggled,this.is_disabled=e.isDisabled,this.icon_type=(s=e.defaultIcon)==null?void 0:s.iconType;let i=((c=(p=(o=e==null?void 0:e.defaultText)==null?void 0:o.accessibility)==null?void 0:p.accessibilityData)==null?void 0:c.label)||((m=(f=e==null?void 0:e.accessibilityData)==null?void 0:f.accessibilityData)==null?void 0:m.label)||((x=e==null?void 0:e.accessibility)==null?void 0:x.label);this.icon_type=="LIKE"&&(this.like_count=parseInt(i.replace(/\D/g,"")),this.short_like_count=new a(e.defaultText).toString()),this.endpoint=(b=(_=e.defaultServiceEndpoint)==null?void 0:_.commandExecutorCommand)!=null&&b.commands?new h(e.defaultServiceEndpoint.commandExecutorCommand.commands.pop()):new h(e.defaultServiceEndpoint),this.toggled_endpoint=new h(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)}};r(Go,"ToggleButton");Go.type="ToggleButton";var se=Go;var jo=class extends n{constructor(e){var i,s;super(),this.creator_thumbnail=y.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:(s=(i=e.heartColor)==null?void 0:i.basicColorPaletteData)==null?void 0:s.foregroundTitleColor}},this.hearted_tooltip=e.heartedTooltip,this.is_hearted=e.isHearted,this.is_enabled=e.isEnabled,this.kennedy_heart_color_string=e.kennedyHeartColorString}};r(jo,"CreatorHeart");jo.type="CreatorHeart";var Qd=jo;var Ho=class extends n{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,se),this.dislike_button=l.parseItem(e.dislikeButton,se),this.reply_button=l.parseItem(e.replyButton,v),this.creator_heart=l.parseItem(e.creatorHeart,Qd)}};r(Ho,"CommentActionButtons");Ho.type="CommentActionButtons";var Xd=Ho;var $o=class extends n{constructor(e){super(),this.default_button=l.parseItem(e.defaultButtonViewModel,te),this.toggled_button=l.parseItem(e.toggledButtonViewModel,te),this.identifier=e.identifier,this.is_toggling_disabled=e.isTogglingDisabled}};r($o,"ToggleButtonView");$o.type="ToggleButtonView";var _t=$o;var Ko=class extends n{constructor(e){super(),this.toggle_button=l.parseItem(e.toggleButtonViewModel,_t),this.like_status_entity_key=e.likeStatusEntityKey,this.like_status_entity={key:e.likeStatusEntity.key,like_status:e.likeStatusEntity.likeStatus}}};r(Ko,"LikeButtonView");Ko.type="LikeButtonView";var Jd=Ko;var qo=class extends n{constructor(e){super(),this.toggle_button=l.parseItem(e.toggleButtonViewModel,_t),this.dislike_entity_key=e.dislikeEntityKey}};r(qo,"DislikeButtonView");qo.type="DislikeButtonView";var Zd=qo;var zo=class extends n{constructor(e){if(super(),this.like_button=l.parseItem(e.likeButtonViewModel,Jd),this.dislike_button=l.parseItem(e.dislikeButtonViewModel,Zd),this.icon_type=e.iconType,this.like_button&&this.like_button.toggle_button){let i=this.like_button.toggle_button;i.default_button?(this.short_like_count=i.default_button.title,this.like_count=parseInt(i.default_button.accessibility_text.replace(/\D/g,""))):i.toggled_button&&(this.short_like_count=i.toggled_button.title,this.like_count=parseInt(i.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}}};r(zo,"SegmentedLikeDislikeButtonView");zo.type="SegmentedLikeDislikeButtonView";var qt=zo;var Qo=class extends v{constructor(e){super(e)}};r(Qo,"MenuServiceItem");Qo.type="MenuServiceItem";var Pt=Qo;var Xo=class extends n{constructor(e){super(),this.style=e.style,this.size=e.size,this.endpoint=new h(e.command),this.target_id=e.targetId}};r(Xo,"DownloadButton");Xo.type="DownloadButton";var Or=Xo;var Jo=class extends n{constructor(e){super(),this.has_separator=!!e.hasSeparator,this.endpoint=new h(e.navigationEndpoint||e.serviceEndpoint)}};r(Jo,"MenuServiceItemDownload");Jo.type="MenuServiceItemDownload";var e_=Jo;var Zo=class extends n{constructor(e){super(),this.menu_item=l.parseItem(e.menuItem,[Pt,e_]),this.top_level_button=l.parseItem(e.topLevelButton,[Or,te,v])}};r(Zo,"MenuFlexibleItem");Zo.type="MenuFlexibleItem";var t_=Zo;var en=class extends n{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(i=>new h(i)))}};r(en,"LikeButton");en.type="LikeButton";var Dr=en;var tn=class extends n{constructor(e){super(),this.actions_rows=e.actionsRows.map(i=>({actions:l.parseArray(i.actions,[te,_t])})),this.style=e.style}};r(tn,"FlexibleActionsView");tn.type="FlexibleActionsView";var Br=tn;var rn=class extends n{constructor(e){super(),this.items=l.parseArray(e.items),this.flexible_items=l.parseArray(e.flexibleItems,t_),this.top_level_buttons=l.parseArray(e.topLevelButtons,[se,Dr,v,te,qt,Br]),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.label=e.accessibility.accessibilityData.label)}get contents(){return this.items}};r(rn,"Menu");rn.type="Menu";var R=rn;var sn=class extends n{constructor(e){super(),this.id=e.postId,this.author=new P({...e.authorText,navigationEndpoint:e.authorEndpoint},null,e.authorThumbnail),this.content=new a(e.contentText),this.published=new a(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 a(e.voteCount)),Reflect.has(e,"actionMenu")&&(this.menu=l.parseItem(e.actionMenu,R)),Reflect.has(e,"actionButtons")&&(this.action_buttons=l.parseItem(e.actionButtons,Xd)),Reflect.has(e,"voteButton")&&(this.vote_button=l.parseItem(e.voteButton,v)),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint)),Reflect.has(e,"backstageAttachment")&&(this.attachment=l.parseItem(e.backstageAttachment)),this.surface=e.surface}};r(sn,"BackstagePost");sn.type="BackstagePost";var xi=sn;var on=class extends n{constructor(e){super(),this.post=l.parseItem(e.post)}};r(on,"BackstagePostThread");on.type="BackstagePostThread";var YT=on;var yi=class extends n{constructor(e){super(),this.text=e.badgeText,this.style=e.badgeStyle,this.accessibility_label=e.accessibilityLabel}};r(yi,"BadgeView");var nn=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(nn,"BrowseFeedActions");nn.type="BrowseFeedActions";var i_=nn;var an=class extends n{constructor(e){super(),this.album=new a(e.album),this.thumbnails=y.fromResponse(e.thumbnailDetails)}};r(an,"BrowserMediaSession");an.type="BrowserMediaSession";var VT=an;var pn=class extends n{constructor(e){super(),this.title=e.title,this.icon_name=e.icon.sources[0].clientResource.imageName,this.on_tap_endpoint=new h(e.rendererContext.commandContext.onTap)}};r(pn,"ButtonCardView");pn.type="ButtonCardView";var UT=pn;var Yr=class extends n{constructor(e){super(),this.endpoint=new h(e.navigationEndpoint),this.icon=y.fromResponse(e.icon),this.title=new a(e.title)}};r(Yr,"HeaderLink");Yr.type="HeaderLink";var ln=class extends n{constructor(e){var i,s;super(),this.primary=G(((i=e.primaryLinks)==null?void 0:i.map(o=>new Yr(o)))||[]),this.secondary=G(((s=e.secondaryLinks)==null?void 0:s.map(o=>new Yr(o)))||[])}};r(ln,"ChannelHeaderLinks");ln.type="ChannelHeaderLinks";var r_=ln;var cn=class extends n{constructor(e){super(),Reflect.has(e,"firstLink")&&(this.first_link=a.fromAttributed(e.firstLink)),Reflect.has(e,"more")&&(this.more=a.fromAttributed(e.more))}};r(cn,"ChannelHeaderLinksView");cn.type="ChannelHeaderLinksView";var s_=cn;var un=class extends n{constructor(e){super(),this.placeholder_text=new a(e.placeholderText),this.max_character_limit=e.maxCharacterLimit}};r(un,"ClipCreationTextInput");un.type="ClipCreationTextInput";var o_=un;var fn=class extends n{constructor(e){var i,s,o,p,c,f;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=(s=(i=e.startAccessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label,this.end_label=(p=(o=e.endAccessibility)==null?void 0:o.accessibilityData)==null?void 0:p.label,this.duration_label=(f=(c=e.durationAccessibility)==null?void 0:c.accessibilityData)==null?void 0:f.label}};r(fn,"ClipCreationScrubber");fn.type="ClipCreationScrubber";var n_=fn;var mn=class extends n{constructor(e){super(),this.title=new a(e.title),this.body=new a(e.body)}};r(mn,"ClipAdState");mn.type="ClipAdState";var a_=mn;var hn=class extends n{constructor(e){super(),this.user_avatar=y.fromResponse(e.userAvatar),this.title_input=l.parseItem(e.titleInput,[o_]),this.scrubber=l.parseItem(e.scrubber,[n_]),this.save_button=l.parseItem(e.saveButton,[v]),this.display_name=new a(e.displayName),this.publicity_label=e.publicityLabel,this.cancel_button=l.parseItem(e.cancelButton,[v]),this.ad_state_overlay=l.parseItem(e.adStateOverlay,[a_]),this.external_video_id=e.externalVideoId,this.publicity_label_icon=e.publicityLabelIcon}};r(hn,"ClipCreation");hn.type="ClipCreation";var p_=hn;var dn=class extends n{constructor(e){super(),this.contents=l.parse(e.contents,!0,[p_])}};r(dn,"ClipSection");dn.type="ClipSection";var l_=dn;var _n=class extends n{constructor(e){super(),this.trigger=e.trigger,Reflect.has(e,"button")&&(this.button=l.parseItem(e.button,v)),this.endpoint=new h(e.continuationEndpoint)}};r(_n,"ContinuationItem");_n.type="ContinuationItem";var X=_n;var xn=class extends n{constructor(e){super(),this.title=new a(e.title),this.contextual_info=e.contextualInfo?new a(e.contextualInfo):void 0,this.visibility_button=l.parseItem(e.visibilityButton,v),this.menu=l.parseItem(e.menu)}};r(xn,"EngagementPanelTitleHeader");xn.type="EngagementPanelTitleHeader";var c_=xn;var yn=class extends n{constructor(e){super(),this.info_text=new a(e.infoText),this.menu=l.parseItem(e.menu,R)}};r(yn,"MacroMarkersInfoItem");yn.type="MacroMarkersInfoItem";var u_=yn;var bn=class extends n{constructor(e){super(),this.title=new a(e.title),this.time_description=new a(e.timeDescription),this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new h(e.onTap),this.layout=e.layout,this.is_highlighted=!!e.isHighlighted}};r(bn,"MacroMarkersListItem");bn.type="MacroMarkersListItem";var Vr=bn;var gn=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents,[u_,Vr]),this.sync_button_label=new a(e.syncButtonLabel)}};r(gn,"MacroMarkersList");gn.type="MacroMarkersList";var f_=gn;var wn=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(wn,"ProductList");wn.type="ProductList";var m_=wn;var Tn=class extends n{constructor(e){super(),this.contents=l.parseArray(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=l.parseItem(e.header)),Reflect.has(e,"subMenu")&&(this.sub_menu=l.parseItem(e.subMenu))}};r(Tn,"SectionList");Tn.type="SectionList";var de=Tn;var vn=class extends n{constructor(e){super(),this.show_more_text=new a(e.showMoreText),this.show_less_text=new a(e.showLessText),Reflect.has(e,"attributedDescriptionBodyText")&&(this.attributed_description_body_text=a.fromAttributed(e.attributedDescriptionBodyText))}};r(vn,"ExpandableVideoDescriptionBody");vn.type="ExpandableVideoDescriptionBody";var h_=vn;var In=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new h(e.searchEndpoint),this.query=new a(e.query).toString()}};r(In,"SearchRefinementCard");In.type="SearchRefinementCard";var Ji=In;var Sn=class extends n{constructor(e){super(),this.game=l.parseItem(e.game)}};r(Sn,"GameCard");Sn.type="GameCard";var d_=Sn;var En=class extends n{constructor(e){super(),this.visible_item_count=e.visibleItemCount,this.items=l.parseArray(e.items)}get contents(){return this.items}};r(En,"HorizontalList");En.type="HorizontalList";var __=En;var kn=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header={collapsed_title:new a(e.header.collapsedTitle),collapsed_thumbnail:y.fromResponse(e.header.collapsedThumbnail),collapsed_label:new a(e.header.collapsedLabel),expanded_title:new a(e.header.expandedTitle)}),this.expanded_content=l.parseItem(e.expandedContent,[bi,__]),this.expand_button=l.parseItem(e.expandButton,v),this.collapse_button=l.parseItem(e.collapseButton,v)}};r(kn,"ExpandableMetadata");kn.type="ExpandableMetadata";var x_=kn;var Cn=class extends n{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)}};r(Cn,"MetadataBadge");Cn.type="MetadataBadge";var Fe=Cn;var Pn=class extends n{constructor(e){super(),this.text=new a(e.text).toString(),this.style=e.style}};r(Pn,"ThumbnailOverlayTimeStatus");Pn.type="ThumbnailOverlayTimeStatus";var Zi=Pn;var Nn=class extends n{constructor(e){var s,o,p;super();let i=((s=e.thumbnailOverlays.find(c=>c.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new a(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new a(e.descriptionSnippet)),Reflect.has(e,"detailedMetadataSnippets")&&(this.snippets=e.detailedMetadataSnippets.map(c=>({text:new a(c.snippetText),hover_text:new a(c.snippetHoverText)}))),this.expandable_metadata=l.parseItem(e.expandableMetadata,x_),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=l.parseItem(e.richThumbnail)),this.author=new P(e.ownerText,e.ownerBadges,(p=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:p.thumbnail),this.badges=l.parseArray(e.badges,Fe),this.endpoint=new h(e.navigationEndpoint),this.published=new a(e.publishedTimeText),this.view_count=new a(e.viewCountText),this.short_view_count=new a(e.shortViewCountText),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`))),this.duration={text:e.lengthText?new a(e.lengthText).toString():new a(i).toString(),seconds:_e(e.lengthText?new a(e.lengthText).toString():new a(i).toString())},this.show_action_menu=!!e.showActionMenu,this.is_watched=!!e.isWatched,this.menu=l.parseItem(e.menu,R),Reflect.has(e,"searchVideoResultEntityKey")&&(this.search_video_result_entity_key=e.searchVideoResultEntityKey),Reflect.has(e,"bylineText")&&(this.byline_text=new a(e.bylineText))}get description(){var e;return this.snippets?this.snippets.map(i=>i.text.toString()).join(""):((e=this.description_snippet)==null?void 0:e.toString())||""}get is_live(){var e;return this.badges.some(i=>{if(i.style==="BADGE_STYLE_TYPE_LIVE_NOW"||i.label==="LIVE")return!0})||((e=this.thumbnail_overlays.firstOfType(Zi))==null?void 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]}};r(Nn,"Video");Nn.type="Video";var Ur=Nn;var An=class extends Ur{constructor(e){var i,s,o,p;super(e),Reflect.has(e,"metadataText")&&(this.metadata_text=new a(e.metadataText),this.metadata_text.text&&(this.short_view_count=new a({simpleText:(i=this.metadata_text.text.split("\xB7")[0])==null?void 0:i.trim()}),this.published=new a({simpleText:(s=this.metadata_text.text.split("\xB7")[1])==null?void 0:s.trim()}))),Reflect.has(e,"bylineText")&&(this.author=new P(e.bylineText,e.ownerBadges,(p=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:p.thumbnail))}};r(An,"VideoCard");An.type="VideoCard";var y_=An;var Rn=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r(Rn,"ContentPreviewImageView");Rn.type="ContentPreviewImageView";var er=Rn;var Mn=class extends n{constructor(e){var i;super(),(i=e.image)!=null&&i.sources?this.image=y.fromResponse(e.image):this.image=l.parseItem(e.image,er),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 h(e.overflowMenuOnTap),this.overflow_menu_a11y_label=e.overflowMenuA11yLabel}};r(Mn,"VideoAttributeView");Mn.type="VideoAttributeView";var gi=Mn;var Ln=class extends n{constructor(e){super(),this.cards=l.parseArray(e.cards,[gi,Ji,Vr,d_,y_]),this.header=l.parseItem(e.header),this.previous_button=l.parseItem(e.previousButton,v),this.next_button=l.parseItem(e.nextButton,v)}};r(Ln,"HorizontalCardList");Ln.type="HorizontalCardList";var bi=Ln;var On=class extends n{constructor(e){super(),this.label=new a(e.label),this.value=new a(e.value),this.accessibility_text=e.accessibilityText}};r(On,"Factoid");On.type="Factoid";var wi=On;var Dn=class extends n{constructor(e){super(),this.factoid=l.parseItem(e.factoid,wi)}};r(Dn,"UploadTimeFactoid");Dn.type="UploadTimeFactoid";var b_=Dn;var Bn=class extends n{constructor(e){super(),this.view_count_entity_key=e.viewCountEntityKey,this.factoid=l.parseItem(e.factoid,[wi]),this.view_count_type=e.viewCountType}};r(Bn,"ViewCountFactoid");Bn.type="ViewCountFactoid";var g_=Bn;var Yn=class extends n{constructor(e){super(),this.title=new a(e.title),this.channel=new a(e.channel),this.channel_navigation_endpoint=new h(e.channelNavigationEndpoint),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.publish_date=new a(e.publishDate),this.views=new a(e.views),this.factoids=l.parseArray(e.factoid,[wi,g_,b_])}};r(Yn,"VideoDescriptionHeader");Yn.type="VideoDescriptionHeader";var w_=Yn;var Vn=class extends n{constructor(e){super(),this.section_title=new a(e.sectionTitle),this.creator_videos_button=l.parseItem(e.creatorVideosButton,v),this.creator_about_button=l.parseItem(e.creatorAboutButton,v),this.section_subtitle=new a(e.sectionSubtitle),this.channel_avatar=y.fromResponse(e.channelAvatar),this.channel_endpoint=new h(e.channelEndpoint)}};r(Vn,"VideoDescriptionInfocardsSection");Vn.type="VideoDescriptionInfocardsSection";var T_=Vn;var Un=class extends n{constructor(e){super(),this.title=new a(e.title),Reflect.has(e,"defaultMetadata")&&(this.default_metadata=new a(e.defaultMetadata)),Reflect.has(e,"expandedMetadata")&&(this.expanded_metadata=new a(e.expandedMetadata)),Reflect.has(e,"infoRowExpandStatusKey")&&(this.info_row_expand_status_key=e.infoRowExpandStatusKey)}};r(Un,"InfoRow");Un.type="InfoRow";var v_=Un;var Fn=class extends n{constructor(e){super(),this.id=e.videoId,this.thumbnails=y.fromResponse(e.thumbnail)||null,Reflect.has(e,"richThumbnail")&&(this.rich_thumbnail=l.parseItem(e.richThumbnail)),this.title=new a(e.title),this.author=new P(e.longBylineText,e.ownerBadges,e.channelThumbnail),this.view_count=new a(e.viewCountText),this.short_view_count=new a(e.shortViewCountText),this.published=new a(e.publishedTimeText),this.badges=l.parseArray(e.badges,Fe),this.duration={text:new a(e.lengthText).toString(),seconds:_e(new a(e.lengthText).toString())},this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.endpoint=new h(e.navigationEndpoint),this.menu=l.parseItem(e.menu,R)}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")}};r(Fn,"CompactVideo");Fn.type="CompactVideo";var Fr=Fn;var Wn=class extends n{constructor(e){super(),this.info_rows=l.parseArray(e.infoRows,v_),this.video_lockup=l.parseItem(e.videoLockup,Fr)}};r(Wn,"CarouselLockup");Wn.type="CarouselLockup";var I_=Wn;var Gn=class extends n{constructor(e){super(),this.carousel_lockups=l.parseArray(e.carouselLockups,I_),this.section_title=new a(e.sectionTitle)}};r(Gn,"VideoDescriptionMusicSection");Gn.type="VideoDescriptionMusicSection";var Wr=Gn;var jn=class extends n{constructor(e){super(),this.section_title=new a(e.sectionTitle),this.sub_header_text=new a(e.subHeaderText),this.primary_button=l.parseItem(e.primaryButton,v)}};r(jn,"VideoDescriptionTranscriptSection");jn.type="VideoDescriptionTranscriptSection";var Hn=jn;var $n=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new a(e.title),this.short_byline_text=new a(e.shortBylineText),this.video_count_short_text=new a(e.videoCountShortText),this.endpoint=new h(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}};r($n,"StructuredDescriptionPlaylistLockup");$n.type="StructuredDescriptionPlaylistLockup";var S_=$n;var Kn=class extends n{constructor(e){super(),this.section_title=new a(e.sectionTitle),this.media_lockups=l.parseArray(e.mediaLockups,[S_])}};r(Kn,"VideoDescriptionCourseSection");Kn.type="VideoDescriptionCourseSection";var E_=Kn;var qn=class extends n{constructor(e){super(),this.title=new a(e.title),this.items=l.parseArray(e.items),Reflect.has(e,"endpoint")&&(this.endpoint=new h(e.endpoint))}get contents(){return this.items}};r(qn,"ReelShelf");qn.type="ReelShelf";var Gr=qn;var zn=class extends n{constructor(e){super(),this.header_title=e.headerTitle,this.header_subtitle=e.headerSubtitle,this.video_attributes=l.parseArray(e.videoAttributeViewModels,gi),this.previous_button=l.parseItem(e.previousButton,te),this.next_button=l.parseItem(e.nextButton,te)}};r(zn,"VideoAttributesSectionView");zn.type="VideoAttributesSectionView";var k_=zn;var Qn=class extends n{constructor(e){super(),this.items=l.parseArray(e.items,[w_,h_,Wr,T_,E_,Hn,Hn,bi,Gr,k_])}};r(Qn,"StructuredDescriptionContent");Qn.type="StructuredDescriptionContent";var tr=Qn;var Xn=class extends n{constructor(e){super(),this.header=l.parseItem(e.header,c_),this.content=l.parseItem(e.content,[gi,de,X,l_,tr,f_,m_]),this.panel_identifier=e.panelIdentifier,this.identifier=e.identifier?{surface:e.identifier.surface,tag:e.identifier.tag}:void 0,this.target_id=e.targetId,this.visibility=e.visibility}};r(Xn,"EngagementPanelSectionList");Xn.type="EngagementPanelSectionList";var Ti=Xn;var Jn=class extends n{constructor(e){super(),this.content=e.content,this.max_lines=e.maxLines,this.more_endpoint=e.moreEndpoint.showEngagementPanelEndpoint?{show_engagement_panel_endpoint:{engagement_panel:l.parseItem(e.moreEndpoint.showEngagementPanelEndpoint.engagementPanel,Ti),engagement_panel_popup_type:e.moreEndpoint.showEngagementPanelEndpoint.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:e.moreEndpoint.showEngagementPanelEndpoint.identifier.surface,tag:e.moreEndpoint.showEngagementPanelEndpoint.identifier.tag}}}:new h(e.moreEndpoint),this.more_icon_type=e.moreIcon.iconType,this.more_label=e.moreLabel,this.target_id=e.targetId}};r(Jn,"ChannelTagline");Jn.type="ChannelTagline";var C_=Jn;var Zn=class extends n{constructor(e){super(),this.states=e.states.map(i=>({id:i.stateId,next_id:i.nextStateId,state:l.parse(i.state)})),this.current_state_id=e.currentStateId,this.target_id=e.targetId}};r(Zn,"SubscriptionNotificationToggleButton");Zn.type="SubscriptionNotificationToggleButton";var P_=Zn;var ea=class extends n{constructor(e){var i,s;super(),this.button_text=new a(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,this.subscribed_text=new a(e.subscribedButtonText),this.unsubscribed_text=new a(e.unsubscribedButtonText),this.notification_preference_button=l.parseItem(e.notificationPreferenceButton,P_),Reflect.has(e,"serviceEndpoints")&&(this.service_endpoints=e.serviceEndpoints.map(o=>new h(o))),Reflect.has(e,"onSubscribeEndpoints")&&(this.on_subscribe_endpoints=e.onSubscribeEndpoints.map(o=>new h(o))),Reflect.has(e,"onUnsubscribeEndpoints")&&(this.on_unsubscribe_endpoints=e.onUnsubscribeEndpoints.map(o=>new h(o))),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=(i=e.subscribeAccessibility.accessibilityData)==null?void 0:i.label),Reflect.has(e,"unsubscribeAccessibility")&&(this.unsubscribe_accessibility_label=(s=e.unsubscribeAccessibility.accessibilityData)==null?void 0:s.label)}};r(ea,"SubscribeButton");ea.type="SubscribeButton";var xe=ea;var ta=class extends n{constructor(e){super(),this.author=new P({simpleText:e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.avatar),Reflect.has(e,"banner")&&(this.banner=y.fromResponse(e.banner)),Reflect.has(e,"tv_banner")&&(this.tv_banner=y.fromResponse(e.tvBanner)),Reflect.has(e,"mobile_banner")&&(this.mobile_banner=y.fromResponse(e.mobileBanner)),Reflect.has(e,"subscriberCountText")&&(this.subscribers=new a(e.subscriberCountText)),Reflect.has(e,"videosCountText")&&(this.videos_count=new a(e.videosCountText)),Reflect.has(e,"sponsorButton")&&(this.sponsor_button=l.parseItem(e.sponsorButton,v)),Reflect.has(e,"subscribeButton")&&(this.subscribe_button=l.parseItem(e.subscribeButton,[xe,v])),Reflect.has(e,"headerLinks")&&(this.header_links=l.parseItem(e.headerLinks,[r_,s_])),Reflect.has(e,"channelHandleText")&&(this.channel_handle=new a(e.channelHandleText)),Reflect.has(e,"channelId")&&(this.channel_id=e.channelId),Reflect.has(e,"tagline")&&(this.tagline=l.parseItem(e.tagline,C_))}};r(ta,"C4TabbedHeader");ta.type="C4TabbedHeader";var jr=ta;var ia=class extends n{constructor(e){super(),this.label=new a(e.label),this.icon_type=e.icon.iconType,this.style=e.style}};r(ia,"CallToActionButton");ia.type="CallToActionButton";var FT=ia;var ra=class extends n{constructor(e){super(),this.teaser=l.parseItem(e.teaser),this.content=l.parseItem(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(i=>({start_card_active_ms:i.startCardActiveMs,end_card_active_ms:i.endCardActiveMs,teaser_duration_ms:i.teaserDurationMs,icon_after_teaser_ms:i.iconAfterTeaserMs}))}};r(ra,"Card");ra.type="Card";var WT=ra;var sa=class extends n{constructor(e){super(),this.cards=l.parseArray(e.cards),this.header=new a(e.headerText),this.allow_teaser_dismiss=e.allowTeaserDismiss}};r(sa,"CardCollection");sa.type="CardCollection";var N_=sa;var oa=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(oa,"CarouselHeader");oa.type="CarouselHeader";var A_=oa;var na=class extends n{constructor(e){super(),this.items=l.parseArray(e.carouselItems),this.background_color=e.backgroundColor,this.layout_style=e.layoutStyle,this.pagination_thumbnails=y.fromResponse(e.paginationThumbnails),this.paginator_alignment=e.paginatorAlignment}get contents(){return this.items}};r(na,"CarouselItem");na.type="CarouselItem";var GT=na;var aa=class extends n{constructor(e){super(),this.icon_name=e.iconName,this.text=a.fromAttributed(e.text),this.on_tap_endpoint=new h(e.onTap),this.button=l.parseItem(e.button,te)}};r(aa,"TextCarouselItemView");aa.type="TextCarouselItemView";var R_=aa;var pa=class extends n{constructor(e){super(),this.item_type=e.itemType,this.carousel_item=l.parseItem(e.carouselItem,R_)}};r(pa,"CarouselItemView");pa.type="CarouselItemView";var M_=pa;var la=class extends n{constructor(e){super(),this.title=e.title,this.previous_button=l.parseItem(e.previousButton,te),this.next_button=l.parseItem(e.nextButton,te)}};r(la,"CarouselTitleView");la.type="CarouselTitleView";var L_=la;var ca=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscriber_count=new a(e.subscriberCountText),this.video_count=new a(e.videoCountText),this.long_byline=new a(e.longBylineText),this.short_byline=new a(e.shortBylineText),this.endpoint=new h(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton,[xe,v]),this.description_snippet=new a(e.descriptionSnippet)}};r(ca,"Channel");ca.type="Channel";var O_=ca;var ua=class extends n{constructor(e){var i,s;super(),this.id=e.channelId,this.name=new a(e.title),this.avatar=y.fromResponse(e.avatar),this.canonical_channel_url=e.canonicalChannelUrl,this.primary_links=(s=(i=e.primaryLinks)==null?void 0:i.map(o=>({endpoint:new h(o.navigationEndpoint),icon:y.fromResponse(o.icon),title:new a(o.title)})))!=null?s:[],this.view_count=new a(e.viewCountText),this.joined_date=new a(e.joinedDateText),this.description=new a(e.description),this.email_reveal=new h(e.onBusinessEmailRevealClickCommand),this.can_reveal_email=!e.signInForBusinessEmail,this.country=new a(e.country),this.buttons=l.parseArray(e.actionButtons,v)}};r(ua,"ChannelAboutFullMetadata");ua.type="ChannelAboutFullMetadata";var fa=ua;var ma=class extends n{constructor(e){super(),this.channel_title=e.channelTitle,this.avatar=y.fromResponse(e.avatar),this.header=new a(e.header),this.main_text=new a(e.mainText),this.sign_in_button=l.parseItem(e.signInButton,v),this.secondary_text=new a(e.secondaryText)}};r(ma,"ChannelAgeGate");ma.type="ChannelAgeGate";var jT=ma;var ha=class extends n{constructor(e){super(),this.title=new a(e.title),this.items=l.parseArray(e.items)}};r(ha,"ChannelFeaturedContent");ha.type="ChannelFeaturedContent";var HT=ha;var da=class extends n{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=y.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}};r(da,"ChannelMetadata");da.type="ChannelMetadata";var D_=da;var _a=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(_a,"ChannelMobileHeader");_a.type="ChannelMobileHeader";var $T=_a;var xa=class extends n{constructor(e){super(),this.avatar=y.fromResponse(e.avatar),this.endpoint=new h(e.avatarEndpoint),this.name=e.name,this.links=e.links.map(i=>new a(i))}};r(xa,"ChannelOptions");xa.type="ChannelOptions";var B_=xa;var ya=class extends n{constructor(e){super(),this.illustration=y.fromResponse(e.illustration),this.description=new a(e.description)}};r(ya,"ChannelOwnerEmptyState");ya.type="ChannelOwnerEmptyState";var KT=ya;var ba=class extends n{constructor(e){super(),this.content_type_sub_menu_items=e.contentTypeSubMenuItems.map(i=>({endpoint:new h(i.navigationEndpoint||i.endpoint),selected:i.selected,title:i.title})),this.sort_setting=l.parseItem(e.sortSetting)}};r(ba,"ChannelSubMenu");ba.type="ChannelSubMenu";var ga=ba;var wa=class extends n{constructor(e){super(),this.title=new a(e.title).toString(),Reflect.has(e,"button")&&(this.button=l.parseItem(e.button,v))}};r(wa,"ChannelSwitcherHeader");wa.type="ChannelSwitcherHeader";var qT=wa;var Ta=class extends n{constructor(e){var i,s;super(),this.thumbnails=y.fromResponse(e.thumbnail),this.endpoint=new h(e.navigationEndpoint),this.label=(s=(i=e.accessibility)==null?void 0:i.accessibilityData)==null?void 0:s.label}};r(Ta,"ChannelThumbnailWithLink");Ta.type="ChannelThumbnailWithLink";var zT=Ta;var va=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new a(e.title),this.description=new a(e.description),this.view_count=new a(e.viewCountText),this.published_time=new a(e.publishedTimeText)}};r(va,"ChannelVideoPlayer");va.type="ChannelVideoPlayer";var QT=va;var Ia=class extends n{constructor(e){super(),this.title=new a(e.title),this.time_range_start_millis=e.timeRangeStartMillis,this.thumbnail=y.fromResponse(e.thumbnail)}};r(Ia,"Chapter");Ia.type="Chapter";var Y_=Ia;var Sa=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new a(e.title),this.duration={text:e.lengthText.simpleText,seconds:_e(e.lengthText.simpleText)},this.endpoint=new h(e.navigationEndpoint)}};r(Sa,"ChildVideo");Sa.type="ChildVideo";var XT=Sa;var Ea=class extends n{constructor(e){super(),this.text=e.text,this.display_type=e.displayType,this.endpoint=new h(e.tapCommand),this.chip_entity_key=e.chipEntityKey}};r(Ea,"ChipView");Ea.type="ChipView";var V_=Ea;var ka=class extends n{constructor(e){super(),this.chips=l.parseArray(e.chips,V_)}};r(ka,"ChipBarView");ka.type="ChipBarView";var JT=ka;var Ca=class extends n{constructor(e){super(),this.is_selected=e.isSelected,Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint)),this.text=new a(e.text).toString()}};r(Ca,"ChipCloudChip");Ca.type="ChipCloudChip";var We=Ca;var Pa=class extends n{constructor(e){super(),this.chips=l.parseArray(e.chips,We),this.next_button=l.parseItem(e.nextButton,v),this.previous_button=l.parseItem(e.previousButton,v),this.horizontal_scrollable=e.horizontalScrollable}};r(Pa,"ChipCloud");Pa.type="ChipCloud";var Hr=Pa;var Na=class extends n{constructor(e){super(),this.text=new a(e.defaultText),this.icon_type=e.defaultIcon.iconType,this.toggled_text=new a(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 h(e.command),Reflect.has(e,"loggingDirectives")&&(this.logging_directives={visibility:{types:e.loggingDirectives.visibility.types},enable_displaylogger_experiment:e.loggingDirectives.enableDisplayloggerExperiment})}};r(Na,"ClientSideToggleMenuItem");Na.type="ClientSideToggleMenuItem";var ZT=Na;var Aa=class extends n{constructor(e){super(),this.channel_avatar=y.fromResponse(e.channelAvatar),this.custom_text=new a(e.customText),this.channel_name=new a(e.channelName),this.subscriber_count=new a(e.subscriberCountText),this.endpoint=new h(e.endpoint)}};r(Aa,"CollaboratorInfoCardContent");Aa.type="CollaboratorInfoCardContent";var e0=Aa;var Ra=class extends n{constructor(e){super(),this.left=y.fromResponse(e.leftThumbnail),this.top_right=y.fromResponse(e.topRightThumbnail),this.bottom_right=y.fromResponse(e.bottomRightThumbnail),this.endpoint=new h(e.navigationEndpoint)}};r(Ra,"CollageHeroImage");Ra.type="CollageHeroImage";var t0=Ra;var Ma=class extends n{constructor(e){super(),this.icon_name=e.icon.sources[0].clientResource.imageName,this.text=a.fromAttributed(e.text),this.style=e.style}};r(Ma,"ThumbnailHoverOverlayView");Ma.type="ThumbnailHoverOverlayView";var U_=Ma;var La=class extends n{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.iconName&&(this.icon_name=e.icon.sources[0].clientResource.imageName)}};r(La,"ThumbnailBadgeView");La.type="ThumbnailBadgeView";var F_=La;var Oa=class extends n{constructor(e){super(),this.badges=l.parseArray(e.thumbnailBadges,F_),this.position=e.position}};r(Oa,"ThumbnailOverlayBadgeView");Oa.type="ThumbnailOverlayBadgeView";var W_=Oa;var Da=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.overlays=l.parseArray(e.overlays,[W_,U_]),e.backgroundColor&&(this.background_color={light_theme:e.backgroundColor.lightTheme,dark_theme:e.backgroundColor.darkTheme})}};r(Da,"ThumbnailView");Da.type="ThumbnailView";var G_=Da;var Ba=class extends n{constructor(e){super(),this.primary_thumbnail=l.parseItem(e.primaryThumbnail,G_),e.stackColor&&(this.stack_color={light_theme:e.stackColor.lightTheme,dark_theme:e.stackColor.darkTheme})}};r(Ba,"CollectionThumbnailView");Ba.type="CollectionThumbnailView";var j_=Ba;var Ya=class extends n{constructor(e){super(),this.open_miniplayer=e.openMiniplayer,this.video_id=e.videoId,this.list_type=e.listType,this.endpoint=new h(e.onCreateListCommand),this.video_ids=e.videoIds}};r(Ya,"AddToPlaylistCommand");Ya.type="AddToPlaylistCommand";var i0=Ya;var Va=class extends n{constructor(e){super(),this.commands=l.parseCommands(e.commands)}};r(Va,"CommandExecutorCommand");Va.type="CommandExecutorCommand";var r0=Va;var xt,Ua=class extends n{constructor(e){super(),xt.set(this,void 0),I(this,xt,e,"f")}getApiPath(){switch(u(this,xt,"f").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 u(this,xt,"f").formData&&(e.formData=u(this,xt,"f").formData),u(this,xt,"f").token&&(e.continuation=u(this,xt,"f").token),u(this,xt,"f").request==="CONTINUATION_REQUEST_TYPE_COMMENTS_NOTIFICATION_MENU"&&(e.notificationsMenuRequestType="NOTIFICATIONS_MENU_REQUEST_TYPE_COMMENTS",u(this,xt,"f").token&&(e.fetchCommentsParams={continuation:u(this,xt,"f").token},delete e.continuation)),e}};r(Ua,"ContinuationCommand");xt=new WeakMap;Ua.type="ContinuationCommand";var s0=Ua;var fg,Fa,Wa=class extends n{constructor(e){super(),fg.set(this,"kids/get_kids_blocklist_picker"),Fa.set(this,void 0),I(this,Fa,e,"f")}getApiPath(){return u(this,fg,"f")}buildRequest(){let e={};return u(this,Fa,"f").blockedForKidsContent&&(e.blockedForKidsContent=u(this,Fa,"f").blockedForKidsContent),e}};r(Wa,"GetKidsBlocklistPickerCommand");fg=new WeakMap,Fa=new WeakMap;Wa.type="GetKidsBlocklistPickerCommand";var o0=Wa;var Ga=class extends n{constructor(e){super(),this.engagement_type=e.engagementType,Reflect.has(e,"ids")&&(this.ids=e.ids.map(i=>({encrypted_video_id:i.encryptedVideoId,external_channel_id:i.externalChannelId,comment_id:i.commentId,external_owner_id:i.externalOwnerId,artist_id:i.artistId,playlist_id:i.playlistId,external_post_id:i.externalPostId,share_id:i.shareId})))}};r(Ga,"RunAttestationCommand");Ga.type="RunAttestationCommand";var n0=Ga;var ja=class extends n{constructor(e){var i;super(),this.inline_content=l.parseItem((i=e.panelLoadingStrategy)==null?void 0:i.inlineContent),this.remove_default_padding=!!e.removeDefaultPadding}};r(ja,"ShowDialogCommand");ja.type="ShowDialogCommand";var a0=ja;var H_,Ha=class extends n{constructor(e){super(),H_.set(this,void 0),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"),I(this,H_,e,"f")}get orig_badge(){return u(this,H_,"f")}};r(Ha,"AuthorCommentBadge");H_=new WeakMap;Ha.type="AuthorCommentBadge";var p0=Ha;var $a=class extends n{constructor(e){super(),this.id=e.id,this.categories=l.parseArray(e.categories),this.category_buttons=l.parseArray(e.categoryButtons),this.search_placeholder=new a(e.searchPlaceholderText),this.search_no_results=new a(e.searchNoResultsText),this.pick_skin_tone=new a(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}};r($a,"EmojiPicker");$a.type="EmojiPicker";var $_=$a;var Ka=class extends n{constructor(e){super(),this.editable_text=new a(e.editableText),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.submit_button=l.parseItem(e.submitButton,v),this.cancel_button=l.parseItem(e.cancelButton,v),this.placeholder=new a(e.placeholderText),this.emoji_button=l.parseItem(e.emojiButton,v),this.emoji_picker=l.parseItem(e.emojiPicker,$_)}};r(Ka,"CommentDialog");Ka.type="CommentDialog";var l0=Ka;var qa=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents),this.view_replies=l.parseItem(e.viewReplies,v),this.hide_replies=l.parseItem(e.hideReplies,v),this.view_replies_creator_thumbnail=y.fromResponse(e.viewRepliesCreatorThumbnail),this.has_channel_owner_replied=!!e.viewRepliesCreatorThumbnail}};r(qa,"CommentReplies");qa.type="CommentReplies";var K_=qa;var za=class extends n{constructor(e){super(),this.reply_button=l.parseItem(e.replyButton,v),this.cancel_button=l.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new a(e.placeholderText),this.error_message=new a(e.errorMessage)}};r(za,"CommentReplyDialog");za.type="CommentReplyDialog";var q_=za;var Qa=class extends n{constructor(e){super(),this.simplebox_avatar=y.fromResponse(e.simpleboxAvatar),this.simplebox_placeholder=new a(e.simpleboxPlaceholder)}};r(Qa,"CommentsSimplebox");Qa.type="CommentsSimplebox";var z_=Qa;var Xa=class extends n{constructor(e){super(),Reflect.has(e,"teaserAvatar")&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new a(e.teaserContent))}};r(Xa,"CommentsEntryPointTeaser");Xa.type="CommentsEntryPointTeaser";var Q_=Xa;var Ja=class extends n{constructor(e){super(),Reflect.has(e,"headerText")&&(this.header=new a(e.headerText)),Reflect.has(e,"commentCount")&&(this.comment_count=new a(e.commentCount)),(Reflect.has(e,"teaserAvatar")||Reflect.has(e,"simpleboxAvatar"))&&(this.teaser_avatar=y.fromResponse(e.teaserAvatar||e.simpleboxAvatar)),Reflect.has(e,"teaserContent")&&(this.teaser_content=new a(e.teaserContent)),Reflect.has(e,"contentRenderer")&&(this.content_renderer=l.parseItem(e.contentRenderer,[Q_,z_])),Reflect.has(e,"simpleboxPlaceholder")&&(this.simplebox_placeholder=new a(e.simpleboxPlaceholder))}};r(Ja,"CommentsEntryPointHeader");Ja.type="CommentsEntryPointHeader";var X_=Ja;var Za=class extends n{constructor(e){super(),this.title=new a(e.titleText),this.count=new a(e.countText),this.comments_count=new a(e.commentsCount),this.create_renderer=l.parseItem(e.createRenderer),this.sort_menu=l.parseItem(e.sortMenu,dt),Reflect.has(e,"customEmojis")&&(this.custom_emojis=e.customEmojis.map(i=>({emoji_id:i.emojiId,shortcuts:i.shortcuts,search_terms:i.searchTerms,image:y.fromResponse(i.image),is_custom_emoji:i.isCustomEmoji})))}};r(Za,"CommentsHeader");Za.type="CommentsHeader";var vi=Za;var ep=class extends n{constructor(e){super(),this.submit_button=l.parseItem(e.submitButton,v),this.cancel_button=l.parseItem(e.cancelButton,v),this.author_thumbnail=y.fromResponse(e.authorThumbnail),this.placeholder=new a(e.placeholderText),this.avatar_size=e.avatarSize}};r(ep,"CommentSimplebox");ep.type="CommentSimplebox";var J_=ep;var Ne,tp=class extends n{constructor(e){super(),Ne.set(this,void 0),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,i,s){e&&(this.content=a.fromAttributed(e.properties.content),this.published_time=e.properties.publishedTime,this.author_is_channel_owner=!!e.author.isCreator,this.like_count=e.toolbar.likeCountNotliked?e.toolbar.likeCountNotliked:"0",this.reply_count=e.toolbar.replyCount?e.toolbar.replyCount:"0",this.is_member=!!e.author.sponsorBadgeUrl,Reflect.has(e.author,"sponsorBadgeUrl")&&(this.member_badge={url:e.author.sponsorBadgeUrl,a11y:e.author.A11y}),this.author=new P({simpleText:e.author.displayName,navigationEndpoint:e.avatar.endpoint},e.author,e.avatar.image,e.author.channelId)),i&&(this.is_hearted=i.heartState==="TOOLBAR_HEART_STATE_HEARTED",this.is_liked=i.likeState==="TOOLBAR_LIKE_STATE_LIKED",this.is_disliked=i.likeState==="TOOLBAR_LIKE_STATE_DISLIKED"),s&&!Reflect.has(s,"prepareAccountCommand")&&(this.like_command=new h(s.likeCommand),this.dislike_command=new h(s.dislikeCommand),this.unlike_command=new h(s.unlikeCommand),this.undislike_command=new h(s.undislikeCommand),this.reply_command=new h(s.replyCommand))}async like(){if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.like_command)throw new g("Like command not found.");if(this.is_liked)throw new g("This comment is already liked.",{comment_id:this.comment_id});return this.like_command.call(u(this,Ne,"f"))}async dislike(){if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.dislike_command)throw new g("Dislike command not found.");if(this.is_disliked)throw new g("This comment is already disliked.",{comment_id:this.comment_id});return this.dislike_command.call(u(this,Ne,"f"))}async unlike(){if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.unlike_command)throw new g("Unlike command not found.");if(!this.is_liked)throw new g("This comment is not liked.",{comment_id:this.comment_id});return this.unlike_command.call(u(this,Ne,"f"))}async undislike(){if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.undislike_command)throw new g("Undislike command not found.");if(!this.is_disliked)throw new g("This comment is not disliked.",{comment_id:this.comment_id});return this.undislike_command.call(u(this,Ne,"f"))}async reply(e){var o;if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.reply_command)throw new g("Reply command not found.");let i=(o=this.reply_command.dialog)==null?void 0:o.as(q_);if(!i)throw new g("Reply dialog not found.");let s=i.reply_button;if(!s)throw new g("Reply button not found in the dialog.");if(!s.endpoint)throw new g("Reply button endpoint not found.");return s.endpoint.call(u(this,Ne,"f"),{commentText:e})}async translate(e){var m,x,_,b,T,w;if(!u(this,Ne,"f"))throw new g("Actions instance not set for this comment.");if(!this.content)throw new g("Comment content not found.",{comment_id:this.comment_id});let s={text:this.content.toString().replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""),target_language:e},o=lg(22,s),p=await u(this,Ne,"f").execute("comment/perform_comment_action",{action:o}),c=(x=(m=p.data.frameworkUpdates)==null?void 0:m.entityBatchUpdate)==null?void 0:x.mutations,f=(w=(T=(b=(_=c==null?void 0:c[0])==null?void 0:_.payload)==null?void 0:b.commentEntityPayload)==null?void 0:T.translatedContent)==null?void 0:w.content;return{...p,content:f}}setActions(e){I(this,Ne,e,"f")}};r(tp,"CommentView");Ne=new WeakMap;tp.type="CommentView";var ir=tp;var Z_,Ii,rr,mg,ip=class extends n{constructor(e){super(),Z_.add(this),Ii.set(this,void 0),rr.set(this,void 0),this.comment=l.parseItem(e.commentViewModel,ir),this.comment_replies_data=l.parseItem(e.replies,K_),this.is_moderated_elq_comment=e.isModeratedElqComment,this.has_replies=!!this.comment_replies_data}get has_continuation(){if(!this.replies)throw new g("Cannot determine if there is a continuation because this thread's replies have not been loaded.");return!!u(this,rr,"f")}async getReplies(){var s;if(!u(this,Ii,"f"))throw new g("Actions instance not set for this thread.");if(!this.comment_replies_data)throw new g("This comment has no replies.",this);let e=(s=this.comment_replies_data.contents)==null?void 0:s.firstOfType(X);if(!e)throw new g("Replies continuation not found.");let i=await e.endpoint.call(u(this,Ii,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,Z_,"m",mg).call(this,i.on_response_received_endpoints_memo),I(this,rr,i.on_response_received_endpoints_memo.getType(X).first(),"f"),this}async getContinuation(){var s;if(!this.replies)throw new g("Cannot retrieve continuation because this thread's replies have not been loaded.");if(!u(this,rr,"f"))throw new g("Continuation not found.");if(!u(this,Ii,"f"))throw new g("Actions instance not set for this thread.");let e=(s=u(this,rr,"f").button)==null?void 0:s.as(v);if(!e)throw new g('"Load more" button not found.');let i=await e.endpoint.call(u(this,Ii,"f"),{parse:!0});if(!i.on_response_received_endpoints_memo)throw new g("Unexpected response.",i);return this.replies=u(this,Z_,"m",mg).call(this,i.on_response_received_endpoints_memo),I(this,rr,i.on_response_received_endpoints_memo.getType(X).first(),"f"),this}setActions(e){I(this,Ii,e,"f")}};r(ip,"CommentThread");Ii=new WeakMap,rr=new WeakMap,Z_=new WeakSet,mg=r(function(e){return G(e.getType(ir).map(i=>(i.setActions(u(this,Ii,"f")),i)))},"_CommentThread_getPatchedReplies");ip.type="CommentThread";var ex=ip;var rp=class extends n{constructor(e){var i,s;super(),this.text=new a(e.chipText),this.color_pallette={background_color:(i=e.chipColorPalette)==null?void 0:i.backgroundColor,foreground_title_color:(s=e.chipColorPalette)==null?void 0:s.foregroundTitleColor},Reflect.has(e,"chipIcon")&&Reflect.has(e.chipIcon,"iconType")&&(this.icon_type=e.chipIcon.iconType)}};r(rp,"PdgCommentChip");rp.type="PdgCommentChip";var c0=rp;var sp=class extends n{constructor(e){super(),this.custom_badge=y.fromResponse(e.customBadge),this.tooltip=e.tooltip}};r(sp,"SponsorCommentBadge");sp.type="SponsorCommentBadge";var u0=sp;var op=class extends n{constructor(e){super(),this.title=new a(e.title),this.channel_id=e.channelId,this.thumbnail=y.fromResponse(e.thumbnail),this.display_name=new a(e.displayName),this.video_count=new a(e.videoCountText),this.subscriber_count=new a(e.subscriberCountText),this.endpoint=new h(e.navigationEndpoint),this.tv_banner=y.fromResponse(e.tvBanner),this.menu=l.parseItem(e.menu,R)}};r(op,"CompactChannel");op.type="CompactChannel";var f0=op;var np=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(np,"PlaylistCustomThumbnail");np.type="PlaylistCustomThumbnail";var $r=np;var ap=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(ap,"PlaylistVideoThumbnail");ap.type="PlaylistVideoThumbnail";var Kr=ap;var pp=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new a(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new a(e.shortBylineText):new P(e.longBylineText,e.ownerBadges,null),this.thumbnails=y.fromResponse(e.thumbnail||{thumbnails:e.thumbnails.map(s=>s.thumbnails).flat(1)}),this.video_count=new a(e.thumbnailText),this.video_count_short=new a(e.videoCountShortText),this.first_videos=l.parseArray(e.videos),this.share_url=e.shareUrl||null,this.menu=l.parseItem(e.menu),this.badges=l.parseArray(e.ownerBadges),this.endpoint=new h(e.navigationEndpoint),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),Reflect.has(e,"thumbnailRenderer")&&(this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer,[Kr,$r])||void 0),Reflect.has(e,"viewPlaylistText")&&(this.view_playlist=new a(e.viewPlaylistText))}};r(pp,"Playlist");pp.type="Playlist";var Nt=pp;var lp=class extends Nt{constructor(e){super(e)}};r(lp,"CompactMix");lp.type="CompactMix";var m0=lp;var cp=class extends n{constructor(e){var o;super();let i=((o=e.thumbnailOverlays.find(p=>p.thumbnailOverlayTimeStatusRenderer))==null?void 0:o.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new a(e.title),this.top_metadata_items=new a(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText);let s=e.lengthText?new a(e.lengthText).toString():new a(i).toString();this.duration={text:s,seconds:_e(s)},this.endpoint=new h(e.navigationEndpoint),this.badges=l.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.menu=l.parseItem(e.menu,R)}};r(cp,"CompactMovie");cp.type="CompactMovie";var h0=cp;var up=class extends Nt{constructor(e){super(e)}};r(up,"CompactPlaylist");up.type="CompactPlaylist";var d0=up;var fp=class extends n{constructor(e){super(),this.title=new a(e.title),this.description=new a(e.description),this.video_count=new a(e.videoCountText),this.endpoint=new h(e.navigationEndpoint),this.thumbnail=y.fromResponse(e.thumbnail)}};r(fp,"CompactStation");fp.type="CompactStation";var _0=fp;var mp=class extends n{constructor(e){super(),this.title=new a(e.title),this.confirm_button=l.parseItem(e.confirmButton,v),this.cancel_button=l.parseItem(e.cancelButton,v),this.dialog_messages=e.dialogMessages.map(i=>new a(i))}};r(mp,"ConfirmDialog");mp.type="ConfirmDialog";var x0=mp;var hp=class extends n{constructor(e){super(),this.metadata_rows=e.metadataRows.map(i=>{var s;return{metadata_parts:(s=i.metadataParts)==null?void 0:s.map(o=>({text:a.fromAttributed(o.text||{})}))}}),this.delimiter=e.delimiter}};r(hp,"ContentMetadataView");hp.type="ContentMetadataView";var qr=hp;var dp=class extends n{constructor(e){super(),this.text=new a(e.text)}};r(dp,"Message");dp.type="Message";var Si=dp;var _p=class extends n{constructor(e){super(),this.availability_message=l.parseItem(e.availabilityMessage,Si)}};r(_p,"ConversationBar");_p.type="ConversationBar";var y0=_p;var xp=class extends n{constructor(e){super(),this.copy_button=l.parseItem(e.copyButton,v),this.short_url=e.shortUrl,this.style=e.style}};r(xp,"CopyLink");xp.type="CopyLink";var zr=xp;var yp=class extends n{constructor(e){super(),this.label=new a(e.label),this.placeholder_text=new a(e.placeholderText),this.disabled=!!e.disabled,this.dropdown_type=e.type,this.id=e.id,Reflect.has(e,"options")&&(this.options=e.options.map(i=>{var s;return{title:new a(i.title),subtitle:new a(i.subtitle),leading_image:y.fromResponse(i.leadingImage),value:{privacy_status_value:(s=i.value)==null?void 0:s.privacyStatusValue},on_tap:new h(i.onTap),is_selected:!!i.isSelected}}))}};r(yp,"DropdownView");yp.type="DropdownView";var tx=yp;var bp=class extends n{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})}};r(bp,"TextFieldView");bp.type="TextFieldView";var ix=bp;var gp=class extends n{constructor(e){super(),this.playlist_title=l.parseItem(e.playlistTitle,ix),this.playlist_visibility=l.parseItem(e.playlistVisibility,tx),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}};r(gp,"CreatePlaylistDialogFormView");gp.type="CreatePlaylistDialogFormView";var rx=gp;var wp=class extends n{constructor(e){var i,s;super(),this.avatar=l.parseItem(e.avatar,qd),this.a11y_label=e.a11yLabel,(s=(i=e.rendererContext)==null?void 0:i.commandContext)!=null&&s.onTap&&(this.on_tap_endpoint=new h(e.rendererContext.commandContext.onTap))}};r(wp,"DecoratedAvatarView");wp.type="DecoratedAvatarView";var Qr=wp;var Tp=class extends n{constructor(e){super(),this.time_range_start_millis=e.timeRangeStartMillis,this.marker_duration_millis=e.markerDurationMillis,this.heat_marker_intensity_score_normalized=e.heatMarkerIntensityScoreNormalized}};r(Tp,"HeatMarker");Tp.type="HeatMarker";var sx=Tp;var vp=class extends n{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=l.parseArray(e.heatMarkers,sx),this.heat_markers_decorations=l.parseArray(e.heatMarkersDecorations)}};r(vp,"Heatmap");vp.type="Heatmap";var ox=vp;var Ip=class extends n{constructor(e){super(),this.marker_key=e.key,this.value={},Reflect.has(e,"value")&&(Reflect.has(e.value,"heatmap")&&(this.value.heatmap=l.parseItem(e.value.heatmap,ox)),Reflect.has(e.value,"chapters")&&(this.value.chapters=l.parseArray(e.value.chapters,Y_)))}};r(Ip,"Marker");Ip.type="Marker";var Sp=class extends n{constructor(e){var i;super(),this.markers_map=G(((i=e.markersMap)==null?void 0:i.map(s=>new Ip(s)))||[])}};r(Sp,"MultiMarkersPlayerBar");Sp.type="MultiMarkersPlayerBar";var nx=Sp;var Ep=class extends n{constructor(e){super(),this.player_bar=l.parseItem(e.playerBar,nx),this.player_bar_action_button=l.parseItem(e.playerBarActionButton,v)}};r(Ep,"DecoratedPlayerBar");Ep.type="DecoratedPlayerBar";var ax=Ep;var kp=class extends n{constructor(e){super(),this.title=new a(e.title),this.description=new a(e.description),this.endpoint=new h(e.navigationEndpoint),this.large_form_factor_background_thumbnail=l.parseItem(e.largeFormFactorBackgroundThumbnail),this.small_form_factor_background_thumbnail=l.parseItem(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}};r(kp,"DefaultPromoPanel");kp.type="DefaultPromoPanel";var b0=kp;var Cp=class extends n{constructor(e){var i,s,o,p,c,f;if(super(),this.description=a.fromAttributed(e.description),this.max_lines=parseInt(e.maxLines),this.truncation_text=a.fromAttributed(e.truncationText),this.always_show_truncation_text=!!e.alwaysShowTruncationText,(o=(s=(i=e.rendererContext.commandContext)==null?void 0:i.onTap)==null?void 0:s.innertubeCommand)!=null&&o.showEngagementPanelEndpoint){let m=(f=(c=(p=e.rendererContext.commandContext)==null?void 0:p.onTap)==null?void 0:c.innertubeCommand)==null?void 0:f.showEngagementPanelEndpoint;this.more_endpoint={show_engagement_panel_endpoint:{engagement_panel:l.parseItem(m.engagementPanel,Ti),engagement_panel_popup_type:m.engagementPanelPresentationConfigs.engagementPanelPopupPresentationConfig.popupType,identifier:{surface:m.identifier.surface,tag:m.identifier.tag}}}}}};r(Cp,"DescriptionPreviewView");Cp.type="DescriptionPreviewView";var px=Cp;var Pp=class extends n{constructor(e){super(),this.headline=a.fromAttributed(e.headline)}};r(Pp,"DialogHeaderView");Pp.type="DialogHeaderView";var lx=Pp;var Np=class extends n{constructor(e){super(),this.primary_button=l.parseItem(e.primaryButton,te),this.secondary_button=l.parseItem(e.secondaryButton,te),this.should_hide_divider=!!e.shouldHideDivider}};r(Np,"PanelFooterView");Np.type="PanelFooterView";var cx=Np;var Ap=class extends n{constructor(e){super(),this.panel_footer=l.parseItem(e.panelFooter,cx),this.form_id=e.formId,this.container_type=e.containerType}};r(Ap,"FormFooterView");Ap.type="FormFooterView";var ux=Ap;var Rp=class extends n{constructor(e){super(),this.header=l.parseItem(e.header,lx),this.footer=l.parseItem(e.footer,ux),this.custom_content=l.parseItem(e.customContent,rx)}};r(Rp,"DialogView");Rp.type="DialogView";var g0=Rp;var Mp=class extends n{constructor(e){super(),this.text=new a(e.didYouMean).toString(),this.corrected_query=new a(e.correctedQuery),this.endpoint=new h(e.navigationEndpoint||e.correctedQueryEndpoint)}};r(Mp,"DidYouMean");Mp.type="DidYouMean";var w0=Mp;var Lp=class extends n{constructor(e){super(),this.text=a.fromAttributed(e.text),this.max_lines=parseInt(e.maxLines)}};r(Lp,"DynamicTextView");Lp.type="DynamicTextView";var fx=Lp;var sr=class extends n{constructor(e){var i;super(),Reflect.has(e,"type")&&Reflect.has(e.type,"textType")&&(this.text=(i=e.type.textType.text)==null?void 0:i.content),this.properties=e.properties,Reflect.has(e,"childElements")&&(this.child_elements=e.childElements.map(s=>new sr(s)))}};r(sr,"ChildElement");sr.type="ChildElement";var mx=sr;var or=class extends n{constructor(e){var s;if(super(),Reflect.has(e,"elementRenderer"))return l.parseItem(e,or);let i=e.newElement.type.componentType;this.model=l.parseItem(i==null?void 0:i.model),Reflect.has(e,"newElement")&&Reflect.has(e.newElement,"childElements")&&(this.child_elements=G(((s=e.newElement.childElements)==null?void 0:s.map(o=>new mx(o)))||[]))}};r(or,"Element");or.type="Element";var hx=or;var Op=class extends n{constructor(e){super(),this.title=new a(e.title),this.first_option=l.parseItem(e.firstOption),this.menu=l.parseItem(e.menu,R)}};r(Op,"EmergencyOnebox");Op.type="EmergencyOnebox";var T0=Op;var Dp=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new a(e.title),this.emoji_ids=e.emojiIds,this.image_loading_lazy=!!e.imageLoadingLazy,this.category_type=e.categoryType}};r(Dp,"EmojiPickerCategory");Dp.type="EmojiPickerCategory";var v0=Dp;var Bp=class extends n{constructor(e){var i;super(),this.category_id=e.categoryId,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType),this.tooltip=e.tooltip}};r(Bp,"EmojiPickerCategoryButton");Bp.type="EmojiPickerCategoryButton";var I0=Bp;var Yp=class extends n{constructor(e){super(),this.category_id=e.categoryId,this.title=new a(e.title),this.upsell=new a(e.upsell),this.emoji_tooltip=e.emojiTooltip,this.endpoint=new h(e.command),this.emoji_ids=e.emojiIds}};r(Yp,"EmojiPickerUpsellCategory");Yp.type="EmojiPickerUpsellCategory";var S0=Yp;var hg,yt,Vp=class extends n{constructor(e){super(),hg.set(this,"playlist/get_add_to_playlist"),yt.set(this,void 0),I(this,yt,e,"f")}getApiPath(){return u(this,hg,"f")}buildRequest(){let e={};return e.videoIds=u(this,yt,"f").videoIds?u(this,yt,"f").videoIds:[u(this,yt,"f").videoId],u(this,yt,"f").playlistId&&(e.playlistId=u(this,yt,"f").playlistId),u(this,yt,"f").params&&(e.params=u(this,yt,"f").params),e.excludeWatchLater=!!u(this,yt,"f").excludeWatchLater,e}};r(Vp,"AddToPlaylistServiceEndpoint");hg=new WeakMap,yt=new WeakMap;Vp.type="AddToPlaylistServiceEndpoint";var dx=Vp;var Up=class extends dx{constructor(e){super(e)}};r(Up,"AddToPlaylistEndpoint");Up.type="AddToPlaylistEndpoint";var E0=Up;var dg,ye,Fp=class extends n{constructor(e){super(),dg.set(this,"browse"),ye.set(this,void 0),I(this,ye,e,"f")}getApiPath(){return u(this,dg,"f")}buildRequest(){let e={};return u(this,ye,"f").browseId&&(e.browseId=u(this,ye,"f").browseId),u(this,ye,"f").params&&(e.params=u(this,ye,"f").params),u(this,ye,"f").query&&(e.query=u(this,ye,"f").query),u(this,ye,"f").browseId==="FEsubscriptions"&&(e.subscriptionSettingsState=u(this,ye,"f").subscriptionSettingsState||"MY_SUBS_SETTINGS_STATE_LAYOUT_FORMAT_LIST"),u(this,ye,"f").browseId==="SPaccount_playback"&&(e.formData=u(this,ye,"f").formData||{accountSettingsFormData:{flagCaptionsDefaultOff:!1,flagAutoCaptionsDefaultOn:!1,flagDisableInlinePreview:!1,flagAudioDescriptionDefaultOn:!1}}),u(this,ye,"f").browseId==="FEwhat_to_watch"&&(u(this,ye,"f").browseRequestSupportedMetadata&&(e.browseRequestSupportedMetadata=u(this,ye,"f").browseRequestSupportedMetadata),u(this,ye,"f").inlineSettingStatus&&(e.inlineSettingStatus=u(this,ye,"f").inlineSettingStatus)),e}};r(Fp,"BrowseEndpoint");dg=new WeakMap,ye=new WeakMap;Fp.type="BrowseEndpoint";var k0=Fp;var _g,ue,Wp=class extends n{constructor(e){super(),_g.set(this,"comment/create_comment"),ue.set(this,void 0),I(this,ue,e,"f")}getApiPath(){return u(this,_g,"f")}buildRequest(){let e={};if(u(this,ue,"f").createCommentParams&&(e.createCommentParams=u(this,ue,"f").createCommentParams),u(this,ue,"f").commentText&&(e.commentText=u(this,ue,"f").commentText),u(this,ue,"f").attachedVideoId?e.videoAttachment={videoId:u(this,ue,"f").attachedVideoId}:u(this,ue,"f").pollOptions?e.pollAttachment={choices:u(this,ue,"f").pollOptions}:u(this,ue,"f").imageBlobId?e.imageAttachment={encryptedBlobId:u(this,ue,"f").imageBlobId}:u(this,ue,"f").sharedPostId&&(e.sharedPostAttachment={postId:u(this,ue,"f").sharedPostId}),u(this,ue,"f").accessRestrictions&&typeof u(this,ue,"f").accessRestrictions=="number"){let i=u(this,ue,"f").accessRestrictions===1?"RESTRICTION_TYPE_EVERYONE":"RESTRICTION_TYPE_SPONSORS_ONLY";e.accessRestrictions={restriction:i}}return u(this,ue,"f").botguardResponse&&(e.botguardResponse=u(this,ue,"f").botguardResponse),e}};r(Wp,"CreateCommentEndpoint");_g=new WeakMap,ue=new WeakMap;Wp.type="CreateCommentEndpoint";var C0=Wp;var xg,Ae,Gp=class extends n{constructor(e){super(),xg.set(this,"playlist/create"),Ae.set(this,void 0),I(this,Ae,e,"f")}getApiPath(){return u(this,xg,"f")}buildRequest(){let e={};return u(this,Ae,"f").title&&(e.title=u(this,Ae,"f").title),u(this,Ae,"f").privacyStatus&&(e.privacyStatus=u(this,Ae,"f").privacyStatus),u(this,Ae,"f").description&&(e.description=u(this,Ae,"f").description),u(this,Ae,"f").videoIds&&(e.videoIds=u(this,Ae,"f").videoIds),u(this,Ae,"f").params&&(e.params=u(this,Ae,"f").params),u(this,Ae,"f").sourcePlaylistId&&(e.sourcePlaylistId=u(this,Ae,"f").sourcePlaylistId),e}};r(Gp,"CreatePlaylistServiceEndpoint");xg=new WeakMap,Ae=new WeakMap;Gp.type="CreatePlaylistServiceEndpoint";var P0=Gp;var yg,jp,Hp=class extends n{constructor(e){super(),yg.set(this,"playlist/delete"),jp.set(this,void 0),I(this,jp,e,"f")}getApiPath(){return u(this,yg,"f")}buildRequest(){let e={};return u(this,jp,"f").playlistId&&(e.playlistId=u(this,jp,"f").sourcePlaylistId),e}};r(Hp,"DeletePlaylistEndpoint");yg=new WeakMap,jp=new WeakMap;Hp.type="DeletePlaylistEndpoint";var N0=Hp;var bg,zt,$p=class extends n{constructor(e){super(),bg.set(this,"feedback"),zt.set(this,void 0),I(this,zt,e,"f")}getApiPath(){return u(this,bg,"f")}buildRequest(){let e={};return u(this,zt,"f").feedbackToken&&(e.feedbackTokens=[u(this,zt,"f").feedbackToken]),u(this,zt,"f").cpn&&(e.feedbackContext={cpn:u(this,zt,"f").cpn}),e.isFeedbackTokenUnencrypted=!!u(this,zt,"f").isFeedbackTokenUnencrypted,e.shouldMerge=!!u(this,zt,"f").shouldMerge,e}};r($p,"FeedbackEndpoint");bg=new WeakMap,zt=new WeakMap;$p.type="FeedbackEndpoint";var A0=$p;var gg,ae,Kp=class extends n{constructor(e){super(),gg.set(this,"account/accounts_list"),ae.set(this,void 0),I(this,ae,e,"f")}getApiPath(){return u(this,gg,"f")}buildRequest(){let e={};return u(this,ae,"f").requestType&&(e.requestType=u(this,ae,"f").requestType,(u(this,ae,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_CHANNEL_SWITCHER"||u(this,ae,"f").requestType==="ACCOUNTS_LIST_REQUEST_TYPE_IDENTITY_PROMPT")&&u(this,ae,"f").nextUrl&&(e.nextNavendpoint={urlEndpoint:{url:u(this,ae,"f").nextUrl}})),u(this,ae,"f").channelSwitcherQuery&&(e.channelSwitcherQuery=u(this,ae,"f").channelSwitcherQuery),u(this,ae,"f").triggerChannelCreation&&(e.triggerChannelCreation=u(this,ae,"f").triggerChannelCreation),u(this,ae,"f").contentOwnerConfig&&u(this,ae,"f").contentOwnerConfig.externalContentOwnerId&&(e.contentOwnerConfig=u(this,ae,"f").contentOwnerConfig),u(this,ae,"f").obfuscatedSelectedGaiaId&&(e.obfuscatedSelectedGaiaId=u(this,ae,"f").obfuscatedSelectedGaiaId),u(this,ae,"f").selectedSerializedDelegationContext&&(e.selectedSerializedDelegationContext=u(this,ae,"f").selectedSerializedDelegationContext),u(this,ae,"f").callCircumstance&&(e.callCircumstance=u(this,ae,"f").callCircumstance),e}};r(Kp,"GetAccountsListInnertubeEndpoint");gg=new WeakMap,ae=new WeakMap;Kp.type="GetAccountsListInnertubeEndpoint";var R0=Kp;var qp=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier}};r(qp,"HideEngagementPanelEndpoint");qp.type="HideEngagementPanelEndpoint";var M0=qp;var wg,Tg,vg,bt,zp=class extends n{constructor(e){super(),wg.set(this,"like/like"),Tg.set(this,"like/dislike"),vg.set(this,"like/removelike"),bt.set(this,void 0),I(this,bt,e,"f")}getApiPath(){return u(this,bt,"f").status==="DISLIKE"?u(this,Tg,"f"):u(this,bt,"f").status==="INDIFFERENT"?u(this,vg,"f"):u(this,wg,"f")}buildRequest(){let e={};u(this,bt,"f").target&&(e.target=u(this,bt,"f").target);let i=this.getParams();return i&&(e.params=i),e}getParams(){switch(u(this,bt,"f").status){case"LIKE":return u(this,bt,"f").likeParams;case"DISLIKE":return u(this,bt,"f").dislikeParams;case"INDIFFERENT":return u(this,bt,"f").removeLikeParams;default:return}}};r(zp,"LikeEndpoint");wg=new WeakMap,Tg=new WeakMap,vg=new WeakMap,bt=new WeakMap;zp.type="LikeEndpoint";var L0=zp;var Ig,Qp,Xp=class extends n{constructor(e){super(),Ig.set(this,"live_chat/get_item_context_menu"),Qp.set(this,void 0),I(this,Qp,e,"f")}getApiPath(){return u(this,Ig,"f")}buildRequest(){let e={};return u(this,Qp,"f").params&&(e.params=u(this,Qp,"f").params),e}};r(Xp,"LiveChatItemContextMenuEndpoint");Ig=new WeakMap,Qp=new WeakMap;Xp.type="LiveChatItemContextMenuEndpoint";var O0=Xp;var Sg,nr,Jp=class extends n{constructor(e){super(),Sg.set(this,"notification/modify_channel_preference"),nr.set(this,void 0),I(this,nr,e,"f")}getApiPath(){return u(this,Sg,"f")}buildRequest(){let e={};return u(this,nr,"f").params&&(e.params=u(this,nr,"f").params),u(this,nr,"f").secondaryParams&&(e.secondaryParams=u(this,nr,"f").secondaryParams),e}};r(Jp,"ModifyChannelNotificationPreferenceEndpoint");Sg=new WeakMap,nr=new WeakMap;Jp.type="ModifyChannelNotificationPreferenceEndpoint";var D0=Jp;var Eg,ar,Zp=class extends n{constructor(e){super(),Eg.set(this,"comment/perform_comment_action"),ar.set(this,void 0),I(this,ar,e,"f")}getApiPath(){return u(this,Eg,"f")}buildRequest(){let e={};return u(this,ar,"f").actions&&(e.actions=u(this,ar,"f").actions),u(this,ar,"f").action&&(e.actions=[u(this,ar,"f").action]),e}};r(Zp,"PerformCommentActionEndpoint");Eg=new WeakMap,ar=new WeakMap;Zp.type="PerformCommentActionEndpoint";var B0=Zp;var kg,Qt,el=class extends n{constructor(e){super(),kg.set(this,"browse/edit_playlist"),Qt.set(this,void 0),I(this,Qt,e,"f")}getApiPath(){return u(this,kg,"f")}buildRequest(){let e={};return u(this,Qt,"f").actions&&(e.actions=u(this,Qt,"f").actions),u(this,Qt,"f").playlistId&&(e.playlistId=u(this,Qt,"f").playlistId),u(this,Qt,"f").params&&(e.params=u(this,Qt,"f").params),e}};r(el,"PlaylistEditEndpoint");kg=new WeakMap,Qt=new WeakMap;el.type="PlaylistEditEndpoint";var Y0=el;var Cg,ce,tl=class extends n{constructor(e){super(),Cg.set(this,"player"),ce.set(this,void 0),I(this,ce,e,"f")}getApiPath(){return u(this,Cg,"f")}buildRequest(){let e={};return u(this,ce,"f").videoId&&(e.videoId=u(this,ce,"f").videoId),u(this,ce,"f").playlistId&&(e.playlistId=u(this,ce,"f").playlistId),(u(this,ce,"f").index!==void 0||u(this,ce,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,ce,"f").index||u(this,ce,"f").playlistIndex),(u(this,ce,"f").playerParams||u(this,ce,"f").params)&&(e.params=u(this,ce,"f").playerParams||u(this,ce,"f").params),u(this,ce,"f").startTimeSeconds&&(e.startTimeSecs=u(this,ce,"f").startTimeSeconds),u(this,ce,"f").overrideMutedAtStart&&(e.overrideMutedAtStart=u(this,ce,"f").overrideMutedAtStart),e.racyCheckOk=!!u(this,ce,"f").racyCheckOk,e.contentCheckOk=!!u(this,ce,"f").contentCheckOk,e}};r(tl,"WatchEndpoint");Cg=new WeakMap,ce=new WeakMap;tl.type="WatchEndpoint";var _x=tl;var il=class extends _x{constructor(e){super(e)}};r(il,"PrefetchWatchCommand");il.type="PrefetchWatchCommand";var V0=il;var Pg,Se,rl=class extends n{constructor(e){super(),Pg.set(this,"reel/reel_item_watch"),Se.set(this,void 0),I(this,Se,e,"f")}getApiPath(){return u(this,Pg,"f")}buildRequest(){let e={};return u(this,Se,"f").videoId&&(e.playerRequest={videoId:u(this,Se,"f").videoId}),e.playerRequest&&(u(this,Se,"f").playerParams&&(e.playerRequest.params=u(this,Se,"f").playerParams),u(this,Se,"f").racyCheckOk&&(e.playerRequest.racyCheckOk=!!u(this,Se,"f").racyCheckOk),u(this,Se,"f").contentCheckOk&&(e.playerRequest.contentCheckOk=!!u(this,Se,"f").contentCheckOk)),u(this,Se,"f").params&&(e.params=u(this,Se,"f").params),u(this,Se,"f").inputType&&(e.inputType=u(this,Se,"f").inputType),e.disablePlayerResponse=!!u(this,Se,"f").disablePlayerResponse,e}};r(rl,"ReelWatchEndpoint");Pg=new WeakMap,Se=new WeakMap;rl.type="ReelWatchEndpoint";var U0=rl;var Ng,gt,sl=class extends n{constructor(e){super(),Ng.set(this,"search"),gt.set(this,void 0),I(this,gt,e,"f")}getApiPath(){return u(this,Ng,"f")}buildRequest(){let e={};return u(this,gt,"f").query&&(e.query=u(this,gt,"f").query),u(this,gt,"f").params&&(e.params=u(this,gt,"f").params),u(this,gt,"f").webSearchboxStatsUrl&&(e.webSearchboxStatsUrl=u(this,gt,"f").webSearchboxStatsUrl),u(this,gt,"f").suggestStats&&(e.suggestStats=u(this,gt,"f").suggestStats),e}};r(sl,"SearchEndpoint");Ng=new WeakMap,gt=new WeakMap;sl.type="SearchEndpoint";var F0=sl;var Ag,pr,ol=class extends n{constructor(e){super(),Ag.set(this,"share/get_share_panel"),pr.set(this,void 0),I(this,pr,e,"f")}getApiPath(){return u(this,Ag,"f")}buildRequest(){let e={};return u(this,pr,"f").serializedShareEntity&&(e.serializedSharedEntity=u(this,pr,"f").serializedShareEntity),u(this,pr,"f").clientParams&&(e.clientParams=u(this,pr,"f").clientParams),e}};r(ol,"ShareEntityServiceEndpoint");Ag=new WeakMap,pr=new WeakMap;ol.type="ShareEntityServiceEndpoint";var Xr=ol;var nl=class extends Xr{constructor(e){super(e)}};r(nl,"ShareEndpoint");nl.type="ShareEndpoint";var W0=nl;var al=class extends Xr{constructor(e){super(e)}};r(al,"ShareEntityEndpoint");al.type="ShareEntityEndpoint";var G0=al;var pl=class extends n{constructor(e){super(),this.panel_identifier=e.panelIdentifier,this.source_panel_identifier=e.sourcePanelIdentifier}};r(pl,"ShowEngagementPanelEndpoint");pl.type="ShowEngagementPanelEndpoint";var j0=pl;var ll=class extends n{constructor(e){super(),Array.isArray(e.actions)&&(this.actions=l.parseArray(e.actions.map(i=>(delete i.clickTrackingParams,i)))),this.signal=e.signal}};r(ll,"SignalServiceEndpoint");ll.type="SignalServiceEndpoint";var H0=ll;var Rg,Qe,cl=class extends n{constructor(e){super(),Rg.set(this,"subscription/subscribe"),Qe.set(this,void 0),I(this,Qe,e,"f")}getApiPath(){return u(this,Rg,"f")}buildRequest(){let e={};return u(this,Qe,"f").channelIds&&(e.channelIds=u(this,Qe,"f").channelIds),u(this,Qe,"f").siloName&&(e.siloName=u(this,Qe,"f").siloName),u(this,Qe,"f").params&&(e.params=u(this,Qe,"f").params),u(this,Qe,"f").botguardResponse&&(e.botguardResponse=u(this,Qe,"f").botguardResponse),u(this,Qe,"f").feature&&(e.clientFeature=u(this,Qe,"f").feature),e}};r(cl,"SubscribeEndpoint");Rg=new WeakMap,Qe=new WeakMap;cl.type="SubscribeEndpoint";var $0=cl;var Mg,Xt,ul=class extends n{constructor(e){super(),Mg.set(this,"subscription/unsubscribe"),Xt.set(this,void 0),I(this,Xt,e,"f")}getApiPath(){return u(this,Mg,"f")}buildRequest(){let e={};return u(this,Xt,"f").channelIds&&(e.channelIds=u(this,Xt,"f").channelIds),u(this,Xt,"f").siloName&&(e.siloName=u(this,Xt,"f").siloName),u(this,Xt,"f").params&&(e.params=u(this,Xt,"f").params),e}};r(ul,"UnsubscribeEndpoint");Mg=new WeakMap,Xt=new WeakMap;ul.type="UnsubscribeEndpoint";var K0=ul;var Lg,Te,fl=class extends n{constructor(e){super(),Lg.set(this,"next"),Te.set(this,void 0),I(this,Te,e,"f")}getApiPath(){return u(this,Lg,"f")}buildRequest(){let e={};return u(this,Te,"f").videoId&&(e.videoId=u(this,Te,"f").videoId),u(this,Te,"f").playlistId&&(e.playlistId=u(this,Te,"f").playlistId),(u(this,Te,"f").index!==void 0||u(this,Te,"f").playlistIndex!==void 0)&&(e.playlistIndex=u(this,Te,"f").index||u(this,Te,"f").playlistIndex),(u(this,Te,"f").playerParams||u(this,Te,"f").params)&&(e.params=u(this,Te,"f").playerParams||u(this,Te,"f").params),e.racyCheckOk=!!u(this,Te,"f").racyCheckOk,e.contentCheckOk=!!u(this,Te,"f").contentCheckOk,e}};r(fl,"WatchNextEndpoint");Lg=new WeakMap,Te=new WeakMap;fl.type="WatchNextEndpoint";var q0=fl;var ml=class extends n{constructor(e){super(),this.elements=l.parseArray(e.elements),this.start_ms=e.startMs}};r(ml,"Endscreen");ml.type="Endscreen";var xx=ml;var hl=class extends n{constructor(e){super(),this.style=e.style,this.title=new a(e.title),this.endpoint=new h(e.endpoint),Reflect.has(e,"image")&&(this.image=y.fromResponse(e.image)),Reflect.has(e,"icon")&&(this.icon=y.fromResponse(e.icon)),Reflect.has(e,"metadata")&&(this.metadata=new a(e.metadata)),Reflect.has(e,"callToAction")&&(this.call_to_action=new a(e.callToAction)),Reflect.has(e,"hovercardButton")&&(this.hovercard_button=l.parseItem(e.hovercardButton)),Reflect.has(e,"isSubscribe")&&(this.is_subscribe=!!e.isSubscribe),Reflect.has(e,"playlistLength")&&(this.playlist_length=new a(e.playlistLength)),Reflect.has(e,"thumbnailOverlays")&&(this.thumbnail_overlays=l.parseArray(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}};r(hl,"EndscreenElement");hl.type="EndscreenElement";var z0=hl;var dl=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new a(e.title),this.author=new a(e.longBylineText),this.endpoint=new h(e.navigationEndpoint),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new a(e.videoCountText)}};r(dl,"EndScreenPlaylist");dl.type="EndScreenPlaylist";var yx=dl;var _l=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new a(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new P(e.shortBylineText,e.ownerBadges),this.endpoint=new h(e.navigationEndpoint),this.short_view_count=new a(e.shortViewCountText),this.badges=l.parseArray(e.badges),this.duration={text:new a(e.lengthText).toString(),seconds:e.lengthInSeconds}}};r(_l,"EndScreenVideo");_l.type="EndScreenVideo";var bx=_l;var xl=class extends n{constructor(e){super(),this.disclaimer=new a(e.disclaimer),this.info_icon={icon_type:e.infoIcon.iconType},this.usage_scenario=e.usageScenario}};r(xl,"EomSettingsDisclaimer");xl.type="EomSettingsDisclaimer";var Q0=xl;var yl=class extends n{constructor(e){super(),this.title=e.title,this.endpoint=new h(e.endpoint),this.selected=e.selected,this.content=l.parseItem(e.content)}};r(yl,"ExpandableTab");yl.type="ExpandableTab";var Jr=yl;var bl=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};r(bl,"ExpandedShelfContents");bl.type="ExpandedShelfContents";var X0=bl;var gl=class extends n{constructor(e){super(),this.dialog_message=new a(e.dialogMessage),this.confirm_label=new a(e.confirmLabel)}};r(gl,"FancyDismissibleDialog");gl.type="FancyDismissibleDialog";var J0=gl;var wl=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents,We)}};r(wl,"FeedFilterChipBar");wl.type="FeedFilterChipBar";var wt=wl;var Tl=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.endpoint=new h(e.impressionEndpoint),this.apply_modernized_style=e.applyModernizedStyle,this.trim_style=e.trimStyle,this.background_style=e.backgroundStyle}};r(Tl,"FeedNudge");Tl.type="FeedNudge";var Z0=Tl;var vl=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(vl,"FeedTabbedHeader");vl.type="FeedTabbedHeader";var gx=vl;var Il=class extends n{constructor(e){super(),this.title=new a(e.title),this.box_art=y.fromResponse(e.boxArt),this.box_art_overlay_text=new a(e.boxArtOverlayText),this.endpoint=new h(e.endpoint),this.is_official_box_art=!!e.isOfficialBoxArt}};r(Il,"GameDetails");Il.type="GameDetails";var ev=Il;var Sl=class extends n{constructor(e){var i,s,o;super(),this.items=l.parseArray(e.items),Reflect.has(e,"header")&&(this.header=l.parseItem(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=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}get contents(){return this.items}};r(Sl,"Grid");Sl.type="Grid";var tv=Sl;var El=class extends n{constructor(e){super(),this.id=e.channelId,this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.ownerBadges,e.thumbnail),this.subscribers=new a(e.subscriberCountText),this.video_count=new a(e.videoCountText),this.endpoint=new h(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton)}};r(El,"GridChannel");El.type="GridChannel";var wx=El;var kl=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(kl,"GridHeader");kl.type="GridHeader";var iv=kl;var Cl=class extends n{constructor(e){var i,s;super(),this.id=e.playlistId,this.title=new a(e.title),this.author=(i=e.shortBylineText)!=null&&i.simpleText?new a(e.shortBylineText):(s=e.longBylineText)!=null&&s.simpleText?new a(e.longBylineText):null,this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new a(e.videoCountText),this.video_count_short=new a(e.videoCountShortText),this.endpoint=new h(e.navigationEndpoint),this.secondary_endpoint=new h(e.secondaryNavigationEndpoint),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays)}};r(Cl,"GridMix");Cl.type="GridMix";var rv=Cl;var Pl=class extends n{constructor(e){var s;super();let i=(s=e.thumbnailOverlays.find(o=>o.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new a(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.duration=e.lengthText?new a(e.lengthText):i!=null&&i.text?new a(i.text):null,this.endpoint=new h(e.navigationEndpoint),this.badges=l.parseArray(e.badges,Fe),this.metadata=new a(e.metadata),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays)}};r(Pl,"GridMovie");Pl.type="GridMovie";var sv=Pl;var Nl=class extends n{constructor(e){var i;super(),this.id=e.playlistId,this.title=new a(e.title),Reflect.has(e,"shortBylineText")&&(this.author=new P(e.shortBylineText,e.ownerBadges)),this.badges=l.parseArray(e.ownerBadges),this.endpoint=new h(e.navigationEndpoint),this.view_playlist=new a(e.viewPlaylistText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer),this.sidebar_thumbnails=[].concat(...((i=e.sidebarThumbnails)==null?void 0:i.map(s=>y.fromResponse(s)))||[])||null,this.video_count=new a(e.thumbnailText),this.video_count_short=new a(e.videoCountShortText)}};r(Nl,"GridPlaylist");Nl.type="GridPlaylist";var Tx=Nl;var Al=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(Al,"ShowCustomThumbnail");Al.type="ShowCustomThumbnail";var vx=Al;var Rl=class extends n{constructor(e){super(),Reflect.has(e,"text")&&(this.text=new a(e.text)),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(Rl,"ThumbnailOverlayBottomPanel");Rl.type="ThumbnailOverlayBottomPanel";var Ix=Rl;var Ml=class extends n{constructor(e){super(),this.title=new a(e.title),this.thumbnail_renderer=q(e.thumbnailRenderer,vx),this.endpoint=new h(e.navigationEndpoint),this.long_byline_text=new a(e.longBylineText),this.thumbnail_overlays=Ee(e.thumbnailOverlays,Ix),this.author=new P(e.shortBylineText,void 0)}};r(Ml,"GridShow");Ml.type="GridShow";var ov=Ml;var Ll=class extends n{constructor(e){var s,o;super();let i=(s=e.thumbnailOverlays.find(p=>p.hasOwnProperty("thumbnailOverlayTimeStatusRenderer")))==null?void 0:s.thumbnailOverlayTimeStatusRenderer;this.id=e.videoId,this.title=new a(e.title),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.rich_thumbnail=l.parseItem(e.richThumbnail),this.published=new a(e.publishedTimeText),this.duration=e.lengthText?new a(e.lengthText):i!=null&&i.text?new a(i.text):null,this.author=e.shortBylineText&&new P(e.shortBylineText,e.ownerBadges),this.views=new a(e.viewCountText),this.short_view_count=new a(e.shortViewCountText),this.endpoint=new h(e.navigationEndpoint),this.menu=l.parseItem(e.menu,R),Reflect.has(e,"buttons")&&(this.buttons=l.parseArray(e.buttons)),Reflect.has(e,"upcomingEventData")&&(this.upcoming=new Date(Number(`${e.upcomingEventData.startTime}000`)),this.upcoming_text=new a(e.upcomingEventData.upcomingEventText),this.is_reminder_set=!!((o=e.upcomingEventData)!=null&&o.isReminderSet))}get is_upcoming(){return Boolean(this.upcoming&&this.upcoming>new Date)}};r(Ll,"GridVideo");Ll.type="GridVideo";var Sx=Ll;var Ol=class extends n{constructor(e){super(),this.title=new a(e.formattedTitle),this.endpoint=new h(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=y.fromResponse(e.thumbnail)),Reflect.has(e,"badges")&&(this.badges=e.badges),this.is_primary=!!e.isPrimary}};r(Ol,"GuideEntry");Ol.type="GuideEntry";var lr=Ol;var Dl=class extends n{constructor(e){super(),this.expander_item=q(e.expanderItem,lr),this.collapser_item=q(e.collapserItem,lr),this.expandable_items=Ee(e.expandableItems)}};r(Dl,"GuideCollapsibleEntry");Dl.type="GuideCollapsibleEntry";var nv=Dl;var Bl=class extends n{constructor(e){super(),this.header_entry=q(e.headerEntry),this.expander_icon=e.expanderIcon.iconType,this.collapser_icon=e.collapserIcon.iconType,this.section_items=Ee(e.sectionItems)}};r(Bl,"GuideCollapsibleSectionEntry");Bl.type="GuideCollapsibleSectionEntry";var av=Bl;var Yl=class extends lr{constructor(e){super(e.entryRenderer.guideEntryRenderer),this.always_show=!!e.alwaysShow}};r(Yl,"GuideDownloadsEntry");Yl.type="GuideDownloadsEntry";var pv=Yl;var Vl=class extends n{constructor(e){super(),Reflect.has(e,"formattedTitle")&&(this.title=new a(e.formattedTitle)),this.items=Ee(e.items)}};r(Vl,"GuideSection");Vl.type="GuideSection";var Zr=Vl;var Ul=class extends Zr{};r(Ul,"GuideSubscriptionsSection");Ul.type="GuideSubscriptionsSection";var Ex=Ul;var Fl=class extends n{constructor(e){super(),this.hashtag=new a(e.hashtag),this.hashtag_info=new a(e.hashtagInfoText)}};r(Fl,"HashtagHeader");Fl.type="HashtagHeader";var kx=Fl;var Wl=class extends n{constructor(e){super(),this.hashtag=new a(e.hashtag),this.hashtag_info_text=new a(e.hashtagInfoText),this.hashtag_thumbnail=y.fromResponse(e.hashtagThumbnail),this.endpoint=new h(e.onTapCommand),this.hashtag_background_color=e.hashtagBackgroundColor,this.hashtag_video_count=new a(e.hashtagVideoCount),this.hashtag_channel_count=new a(e.hashtagChannelCount)}};r(Wl,"HashtagTile");Wl.type="HashtagTile";var lv=Wl;var Gl=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new h(e.onTap)}};r(Gl,"HeroPlaylistThumbnail");Gl.type="HeroPlaylistThumbnail";var cv=Gl;var jl=class extends n{constructor(e){super(),e.thumbnail&&(this.thumbnail={image:y.fromResponse(e.thumbnail.image),endpoint:new h(e.thumbnail.onTap),on_long_press_endpoint:new h(e.thumbnail.onLongPress),content_mode:e.thumbnail.contentMode,crop_options:e.thumbnail.cropOptions}),this.background_image={image:y.fromResponse(e.backgroundImage.image),gradient_image:y.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 h(e.cta.onTap),accessibility_text:e.cta.accessibilityText,state:e.cta.state},this.text_on_tap_endpoint=new h(e.textOnTap)}};r(jl,"Panel");jl.type="Panel";var Hl=class extends n{constructor(e){super(),this.panels=G(e.highlightsCarousel.panels.map(i=>new jl(i)))}};r(Hl,"HighlightsCarousel");Hl.type="HighlightsCarousel";var uv=Hl;var $l=class extends n{constructor(e){super(),this.suggestion=new a(e.suggestion),this.endpoint=new h(e.navigationEndpoint),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"serviceEndpoint")&&(this.service_endpoint=new h(e.serviceEndpoint))}};r($l,"SearchSuggestion");$l.type="SearchSuggestion";var Cx=$l;var Kl=class extends Cx{constructor(e){super(e)}};r(Kl,"HistorySuggestion");Kl.type="HistorySuggestion";var fv=Kl;var ql=class extends n{constructor(e){super(),this.items=l.parseArray(e.items),this.previous_button=l.parseItem(e.previousButton,v),this.next_button=l.parseItem(e.nextButton,v)}get contents(){return this.items}};r(ql,"HorizontalMovieList");ql.type="HorizontalMovieList";var mv=ql;var zl=class extends n{constructor(e){var i;super(),this.icon_type=(i=e.icon)==null?void 0:i.iconType,Reflect.has(e,"tooltip")&&(this.tooltip=new a(e.tooltip).toString()),this.endpoint=new h(e.navigationEndpoint)}};r(zl,"IconLink");zl.type="IconLink";var Px=zl;var Ql=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.style=e.style}};r(Ql,"ImageBannerView");Ql.type="ImageBannerView";var Nx=Ql;var Xl=class extends n{constructor(e){super(),this.including_results_for=new a(e.includingResultsFor),this.corrected_query=new a(e.correctedQuery),this.corrected_query_endpoint=new h(e.correctedQueryEndpoint),this.search_only_for=Reflect.has(e,"searchOnlyFor")?new a(e.searchOnlyFor):void 0,this.original_query=Reflect.has(e,"originalQuery")?new a(e.originalQuery):void 0,this.original_query_endpoint=Reflect.has(e,"originalQueryEndpoint")?new h(e.originalQueryEndpoint):void 0}};r(Xl,"IncludingResultsFor");Xl.type="IncludingResultsFor";var hv=Xl;var Jl=class extends n{constructor(e){super(),this.title=new a(e.title),this.source=new a(e.source),Reflect.has(e,"paragraphs")&&(this.paragraphs=e.paragraphs.map(i=>new a(i))),Reflect.has(e,"attributedParagraphs")&&(this.attributed_paragraphs=e.attributedParagraphs.map(i=>a.fromAttributed(i))),this.thumbnail=y.fromResponse(e.thumbnail),this.source_endpoint=new h(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)}};r(Jl,"InfoPanelContent");Jl.type="InfoPanelContent";var Ax=Jl;var Zl=class extends n{constructor(e){var i;super(),this.title=new a(e.title),this.menu=l.parseItem(e.menu,R),this.content=l.parseItem(e.content,Ax),e.headerEndpoint&&(this.header_endpoint=new h(e.headerEndpoint)),this.background=e.background,this.title_style=e.titleStyle,Reflect.has(e,"icon")&&(this.icon_type=(i=e.icon)==null?void 0:i.iconType)}};r(Zl,"InfoPanelContainer");Zl.type="InfoPanelContainer";var Rx=Zl;var ec=class extends n{constructor(e){super(),this.header_type=e.type,this.title=new a(e.title),this.description=new a(e.description),this.metadata=new a(e.metadata),this.badges=l.parseArray(e.badges,Fe),this.box_art=y.fromResponse(e.boxArt),this.banner=y.fromResponse(e.banner),this.buttons=l.parseArray(e.buttons,[xe,v]),this.auto_generated=new a(e.autoGenerated)}};r(ec,"InteractiveTabbedHeader");ec.type="InteractiveTabbedHeader";var Mx=ec;var tc=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(tc,"ItemSectionHeader");tc.type="ItemSectionHeader";var es=tc;var ic=class extends n{constructor(e){super(),this.title=new a(e.title),this.selected=!!e.selected,this.endpoint=new h(e.endpoint)}};r(ic,"ItemSectionTab");ic.type="Tab";var Lx=ic;var rc=class extends n{constructor(e){super(),this.title=new a(e.title),this.tabs=l.parseArray(e.tabs,Lx),Reflect.has(e,"endItems")&&(this.end_items=l.parseArray(e.endItems))}};r(rc,"ItemSectionTabbedHeader");rc.type="ItemSectionTabbedHeader";var ts=rc;var sc=class extends n{constructor(e){super(),this.filter_menu=l.parseItem(e.filterMenu,cr.SortFilterSubMenu)}};r(sc,"SortFilterHeader");sc.type="SortFilterHeader";var Ox=sc;var oc=class extends n{constructor(e){var i,s,o;super(),this.header=l.parseItem(e.header,[vi,es,ts,Ox,wt]),this.contents=l.parseArray(e.contents),(e.targetId||e.sectionIdentifier)&&(this.target_id=e.targetId||e.sectionIdentifier),e.continuations&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(oc,"ItemSection");oc.type="ItemSection";var Tt=oc;var nc=class extends n{constructor(e){var i,s;super(),this.header=l.parseItem(e.header),this.initial_display_state=e.initialDisplayState,this.continuation=(s=(i=e.continuations[0])==null?void 0:i.reloadContinuationData)==null?void 0:s.continuation,this.client_messages={reconnect_message:new a(e.clientMessages.reconnectMessage),unable_to_reconnect_message:new a(e.clientMessages.unableToReconnectMessage),fatal_error:new a(e.clientMessages.fatalError),reconnected_message:new a(e.clientMessages.reconnectedMessage),generic_error:new a(e.clientMessages.genericError)},this.is_replay=!!e.isReplay}};r(nc,"LiveChat");nc.type="LiveChat";var Dx=nc;var ac=class extends n{constructor(e){super(),this.text=new a(e.text),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.context_menu_button=l.parseItem(e.contextMenuButton,v)}};r(ac,"LiveChatBannerHeader");ac.type="LiveChatBannerHeader";var Bx=ac;var pc=class extends n{constructor(e){super(),this.header=l.parseItem(e.header,Bx),this.contents=l.parseItem(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=Boolean(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)}};r(pc,"LiveChatBanner");pc.type="LiveChatBanner";var Yx=pc;var lc=class extends n{constructor(e){super(),this.banner=l.parseItem(e.bannerRenderer,Yx)}};r(lc,"AddBannerToLiveChatCommand");lc.type="AddBannerToLiveChatCommand";var dv=lc;var cc=class extends n{constructor(e){super(),this.item=l.parseItem(e.item),Reflect.has(e,"clientId")&&(this.client_id=e.clientId)}};r(cc,"AddChatItemAction");cc.type="AddChatItemAction";var Vx=cc;var uc=class extends n{constructor(e){super(),this.item=l.parseItem(e.item),this.duration_sec=e.durationSec}};r(uc,"AddLiveChatTickerItemAction");uc.type="AddLiveChatTickerItemAction";var _v=uc;var fc=class extends n{constructor(e){super(),this.client_assigned_id=e.clientAssignedId}};r(fc,"DimChatItemAction");fc.type="DimChatItemAction";var xv=fc;var mc=class extends n{constructor(e){super(),this.menu_endpoint=new h(e.contextMenuEndpoint),this.moderation_buttons=l.parseArray(e.moderationButtons,v),this.auto_moderated_item=l.parseItem(e.autoModeratedItem),this.header_text=new a(e.headerText),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(mc,"LiveChatAutoModMessage");mc.type="LiveChatAutoModMessage";var yv=mc;var hc=class extends n{constructor(e){super(),this.id=e.liveChatSummaryId,this.chat_summary=new a(e.chatSummary),this.icon_type=e.icon.iconType,this.like_feedback_button=l.parseItem(e.likeFeedbackButton,_t),this.dislike_feedback_button=l.parseItem(e.dislikeFeedbackButton,_t)}};r(hc,"LiveChatBannerChatSummary");hc.type="LiveChatBannerChatSummary";var bv=hc;var dc=class extends n{constructor(e){super(),this.poll_question=new a(e.pollQuestion),this.author_photo=y.fromResponse(e.authorPhoto),this.choices=e.pollChoices.map(i=>({option_id:i.pollOptionId,text:new a(i.text).toString()})),this.collapsed_state_entity_key=e.collapsedStateEntityKey,this.live_chat_poll_state_entity_key=e.liveChatPollStateEntityKey,this.context_menu_button=l.parseItem(e.contextMenuButton,v)}};r(dc,"LiveChatBannerPoll");dc.type="LiveChatBannerPoll";var gv=dc;var _c=class extends n{constructor(e){super(),this.banner_message=new a(e.bannerMessage),this.author_photo=y.fromResponse(e.authorPhoto),this.inline_action_button=l.parseItem(e.inlineActionButton,v),this.context_menu_button=l.parseItem(e.contextMenuButton,v)}};r(_c,"LiveChatBannerRedirect");_c.type="LiveChatBannerRedirect";var wv=_c;var xc=class extends n{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 a(e.timestampText)),Reflect.has(e,"headerPrimaryText")&&(this.header_primary_text=new a(e.headerPrimaryText)),this.header_subtext=new a(e.headerSubtext),Reflect.has(e,"message")&&(this.message=new a(e.message)),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new h(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}};r(xc,"LiveChatMembershipItem");xc.type="LiveChatMembershipItem";var Tv=xc;var yc=class extends n{constructor(e){super(),this.id=e.id,this.icon_type=e.icon.iconType,this.text=new a(e.text),this.subtext=new a(e.subtext),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_usec=e.timestampUsec,this.timestamp_text=new a(e.timestampText)}};r(yc,"LiveChatModeChangeMessage");yc.type="LiveChatModeChangeMessage";var vv=yc;var bc=class extends n{constructor(e){super(),this.message=new a(e.message),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),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 a(e.purchaseAmountText).toString(),this.menu_endpoint=new h(e.contextMenuEndpoint),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.timestamp_text=new a(e.timestampText).toString(),this.id=e.id}};r(bc,"LiveChatPaidMessage");bc.type="LiveChatPaidMessage";var Iv=bc;var gc=class extends n{constructor(e){super(),this.id=e.id,this.author=new P(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=y.fromResponse(e.sticker),this.purchase_amount=new a(e.purchaseAmountText).toString(),this.menu_endpoint=new h(e.contextMenuEndpoint),this.context_menu=this.menu_endpoint,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(gc,"LiveChatPaidSticker");gc.type="LiveChatPaidSticker";var Sv=gc;var wc=class extends n{constructor(e){super(),this.id=e.id,this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3)}};r(wc,"LiveChatPlaceholderItem");wc.type="LiveChatPlaceholderItem";var Ev=wc;var Tc=class extends n{constructor(e){super(),this.title=e.title,this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.vendor_name=e.vendorName,this.from_vendor_text=e.fromVendorText,this.information_button=l.parseItem(e.informationButton),this.endpoint=new h(e.onClickCommand),this.creator_message=e.creatorMessage,this.creator_name=e.creatorName,this.author_photo=y.fromResponse(e.authorPhoto),this.information_dialog=l.parseItem(e.informationDialog),this.is_verified=e.isVerified,this.creator_custom_message=new a(e.creatorCustomMessage)}};r(Tc,"LiveChatProductItem");Tc.type="LiveChatProductItem";var kv=Tc;var vc=class extends n{constructor(e){super(),this.message=new a(e.message),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(vc,"LiveChatRestrictedParticipation");vc.type="LiveChatRestrictedParticipation";var Cv=vc;var Ic=class extends Fe{constructor(e){super(e),this.custom_thumbnail=y.fromResponse(e.customThumbnail)}};r(Ic,"LiveChatAuthorBadge");Ic.type="LiveChatAuthorBadge";var Ux=Ic;var Sc=class extends n{constructor(e){super(),this.author_name=new a(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.author_badges=l.parseArray(e.authorBadges,Ux),this.primary_text=new a(e.primaryText),this.menu_endpoint=new h(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label,this.image=y.fromResponse(e.image)}};r(Sc,"LiveChatSponsorshipsHeader");Sc.type="LiveChatSponsorshipsHeader";var Fx=Sc;var Ec=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.author_external_channel_id=e.authorExternalChannelId,this.header=l.parseItem(e.header,Fx)}};r(Ec,"LiveChatSponsorshipsGiftPurchaseAnnouncement");Ec.type="LiveChatSponsorshipsGiftPurchaseAnnouncement";var Pv=Ec;var kc=class extends n{constructor(e){super(),this.id=e.id,this.timestamp_usec=e.timestampUsec,this.timestamp_text=new a(e.timestampText),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.message=new a(e.message),this.menu_endpoint=new h(e.contextMenuEndpoint),this.context_menu_accessibility_label=e.contextMenuAccessibility.accessibilityData.label}};r(kc,"LiveChatSponsorshipsGiftRedemptionAnnouncement");kc.type="LiveChatSponsorshipsGiftRedemptionAnnouncement";var Nv=kc;var ur=class extends n{constructor(e){super(),this.message=new a(e.message),this.inline_action_buttons=l.parseArray(e.inlineActionButtons,v),this.timestamp=Math.floor(parseInt(e.timestampUsec)/1e3),this.id=e.id}};r(ur,"LiveChatMessageBase");ur.type="LiveChatMessageBase";var Cc=class extends ur{constructor(e){super(e),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.menu_endpoint=new h(e.contextMenuEndpoint)}};r(Cc,"LiveChatTextMessage");Cc.type="LiveChatTextMessage";var Av=Cc;var Pc=class extends n{constructor(e){var i,s;super(),this.author=new P(e.authorName,e.authorBadges,e.authorPhoto,e.authorExternalChannelId),this.amount=new a(e.amount),this.duration_sec=e.durationSec,this.full_duration_sec=e.fullDurationSec,this.show_item=l.parseItem((s=(i=e.showItemEndpoint)==null?void 0:i.showLiveChatItemEndpoint)==null?void 0:s.renderer),this.show_item_endpoint=new h(e.showItemEndpoint),this.id=e.id}};r(Pc,"LiveChatTickerPaidMessageItem");Pc.type="LiveChatTickerPaidMessageItem";var Wx=Pc;var Nc=class extends Wx{};r(Nc,"LiveChatTickerPaidStickerItem");Nc.type="LiveChatTickerPaidStickerItem";var Rv=Nc;var Ac=class extends n{constructor(e){super(),this.id=e.id,this.detail=new a(e.detailText),this.author=new P(e.authorName,e.authorBadges,e.sponsorPhoto,e.authorExternalChannelId),this.duration_sec=e.durationSec}};r(Ac,"LiveChatTickerSponsorItem");Ac.type="LiveChatTickerSponsorItem";var Mv=Ac;var Rc=class extends ur{constructor(e){super(e),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.action_button=l.parseItem(e.actionButton)}};r(Rc,"LiveChatViewerEngagementMessage");Rc.type="LiveChatViewerEngagementMessage";var Lv=Rc;var Mc=class extends n{constructor(e){super(),this.poll_question=new a(e.pollQuestion),this.thumbnails=y.fromResponse(e.thumbnail),this.metadata=new a(e.metadataText),this.live_chat_poll_type=e.liveChatPollType,this.context_menu_button=l.parseItem(e.contextMenuButton,v)}};r(Mc,"PollHeader");Mc.type="PollHeader";var Ov=Mc;var Lc=class extends n{constructor(e){super(),this.id=e.id,this.contents=l.parse(e.contents),this.target_id=e.targetId}};r(Lc,"LiveChatActionPanel");Lc.type="LiveChatActionPanel";var Gx=Lc;var Oc=class extends n{constructor(e){super(),this.deleted_state_message=new a(e.deletedStateMessage),this.target_item_id=e.targetItemId}};r(Oc,"MarkChatItemAsDeletedAction");Oc.type="MarkChatItemAsDeletedAction";var Dv=Oc;var Dc=class extends n{constructor(e){super(),this.deleted_state_message=new a(e.deletedStateMessage),this.external_channel_id=e.externalChannelId}};r(Dc,"MarkChatItemsByAuthorAsDeletedAction");Dc.type="MarkChatItemsByAuthorAsDeletedAction";var Bv=Dc;var Bc=class extends n{constructor(e){super(),this.target_action_id=e.targetActionId}};r(Bc,"RemoveBannerForLiveChatCommand");Bc.type="RemoveBannerForLiveChatCommand";var Yv=Bc;var Yc=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId}};r(Yc,"RemoveChatItemAction");Yc.type="RemoveChatItemAction";var Vv=Yc;var Vc=class extends n{constructor(e){super(),this.external_channel_id=e.externalChannelId}};r(Vc,"RemoveChatItemByAuthorAction");Vc.type="RemoveChatItemByAuthorAction";var Uv=Vc;var Uc=class extends n{constructor(e){super(),this.target_item_id=e.targetItemId,this.replacement_item=l.parseItem(e.replacementItem)}};r(Uc,"ReplaceChatItemAction");Uc.type="ReplaceChatItemAction";var Fv=Uc;var Fc=class extends n{constructor(e){var i;super(),this.actions=l.parseArray((i=e.actions)==null?void 0:i.map(s=>(delete s.clickTrackingParams,s))),this.video_offset_time_msec=e.videoOffsetTimeMsec}};r(Fc,"ReplayChatItemAction");Fc.type="ReplayChatItemAction";var Wv=Fc;var Wc=class extends n{constructor(e){super(),this.panel_to_show=l.parseItem(e.panelToShow,Gx)}};r(Wc,"ShowLiveChatActionPanelAction");Wc.type="ShowLiveChatActionPanelAction";var Gv=Wc;var Gc=class extends n{constructor(e){super(),this.dialog=l.parseItem(e.dialog)}};r(Gc,"ShowLiveChatDialogAction");Gc.type="ShowLiveChatDialogAction";var jv=Gc;var jc=class extends n{constructor(e){super(),this.tooltip=l.parseItem(e.tooltip)}};r(jc,"ShowLiveChatTooltipCommand");jc.type="ShowLiveChatTooltipCommand";var Hv=jc;var Hc=class extends n{constructor(e){super(),this.date_text=new a(e.dateText).toString()}};r(Hc,"UpdateDateTextAction");Hc.type="UpdateDateTextAction";var jx=Hc;var $c=class extends n{constructor(e){super(),this.description=new a(e.description)}};r($c,"UpdateDescriptionAction");$c.type="UpdateDescriptionAction";var Hx=$c;var Kc=class extends n{constructor(e){super(),this.poll_to_update=l.parseItem(e.pollToUpdate)}};r(Kc,"UpdateLiveChatPollAction");Kc.type="UpdateLiveChatPollAction";var $v=Kc;var qc=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(qc,"UpdateTitleAction");qc.type="UpdateTitleAction";var $x=qc;var zc=class extends n{constructor(e){super(),this.default_text=new a(e.defaultText).toString(),this.toggled_text=new a(e.toggledText).toString(),this.button_id=e.buttonId}};r(zc,"UpdateToggleButtonTextAction");zc.type="UpdateToggleButtonTextAction";var Kx=zc;var Qc=class extends n{constructor(e){super();let i=e.viewCount.videoViewCountRenderer;this.view_count=new a(i.viewCount),this.extra_short_view_count=new a(i.extraShortViewCount),this.original_view_count=parseInt(i.originalViewCount),this.unlabeled_view_count_value=new a(i.unlabeledViewCountValue),this.is_live=i.isLive}};r(Qc,"UpdateViewershipAction");Qc.type="UpdateViewershipAction";var qx=Qc;var Xc=class extends n{constructor(e){super(),this.confirm_button=l.parseItem(e.confirmButton,v),this.dialog_messages=e.dialogMessages.map(i=>new a(i))}};r(Xc,"LiveChatDialog");Xc.type="LiveChatDialog";var Kv=Xc;var Jc=class extends n{constructor(e){super(),this.overflow_menu=l.parseItem(e.overflowMenu,R),this.collapse_button=l.parseItem(e.collapseButton,v),this.view_selector=l.parseItem(e.viewSelector,dt)}};r(Jc,"LiveChatHeader");Jc.type="LiveChatHeader";var zx=Jc;var Zc=class extends n{constructor(e){super(),this.max_items_to_display=e.maxItemsToDisplay,this.more_comments_below_button=l.parseItem(e.moreCommentsBelowButton,v)}};r(Zc,"LiveChatItemList");Zc.type="LiveChatItemList";var Qx=Zc;var eu=class extends n{constructor(e){super(),this.author_name=new a(e.authorName),this.author_photo=y.fromResponse(e.authorPhoto),this.send_button=l.parseItem(e.sendButton,v),this.target_id=e.targetId}};r(eu,"LiveChatMessageInput");eu.type="LiveChatMessageInput";var qv=eu;var tu=class extends n{constructor(e){super(),this.name=new a(e.authorName),this.photo=y.fromResponse(e.authorPhoto),this.badges=l.parseArray(e.authorBadges)}};r(tu,"LiveChatParticipant");tu.type="LiveChatParticipant";var Xx=tu;var iu=class extends n{constructor(e){super(),this.title=new a(e.title),this.participants=l.parseArray(e.participants,Xx)}};r(iu,"LiveChatParticipantsList");iu.type="LiveChatParticipantsList";var Jx=iu;var ru=class extends n{constructor(e){super(),this.title=a.fromAttributed(e.title),this.metadata=l.parseItem(e.metadata,qr),this.image=l.parseItem(e.image,Qr)}};r(ru,"LockupMetadataView");ru.type="LockupMetadataView";var Zx=ru;var su=class extends n{constructor(e){super(),this.content_image=l.parseItem(e.contentImage,j_),this.metadata=l.parseItem(e.metadata,Zx),this.content_id=e.contentId,this.content_type=e.contentType.replace("LOCKUP_CONTENT_TYPE_",""),this.on_tap_endpoint=new h(e.rendererContext.commandContext.onTap)}};r(su,"LockupView");su.type="LockupView";var ey=su;var ou=class extends v{constructor(e){super(e)}};r(ou,"MenuNavigationItem");ou.type="MenuNavigationItem";var ty=ou;var nu=class extends n{constructor(e){super(),this.items=l.parseArray(e.items,[ty,Pt])}};r(nu,"MenuPopup");nu.type="MenuPopup";var zv=nu;var au=class extends n{constructor(e){super(),this.items=l.parse(e.items)}get contents(){return this.items}};r(au,"MultiPageMenuNotificationSection");au.type="MultiPageMenuNotificationSection";var Qv=au;var pu=class extends n{constructor(e){super()}};r(pu,"MusicMenuItemDivider");pu.type="MusicMenuItemDivider";var iy=pu;var lu=class extends n{constructor(e){super(),this.title=new a(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 h(e.selectedCommand)),this.selected=!!this.endpoint}};r(lu,"MusicMultiSelectMenuItem");lu.type="MusicMultiSelectMenuItem";var is=lu;var cu=class extends n{constructor(e){var i;super(),Reflect.has(e,"title")&&Reflect.has(e.title,"musicMenuTitleRenderer")&&(this.title=new a((i=e.title.musicMenuTitleRenderer)==null?void 0:i.primaryText)),this.options=l.parseArray(e.options,[is,iy])}};r(cu,"MusicMultiSelectMenu");cu.type="MusicMultiSelectMenu";var ry=cu;var uu=class extends n{constructor(e){super(),this.title=new a(e.title),this.buttons=l.parseArray(e.buttons,v)}};r(uu,"SimpleMenuHeader");uu.type="SimpleMenuHeader";var sy=uu;var fu=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description,this.thumbnails=y.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 h(e.buttonCommand)}};r(fu,"MerchandiseItem");fu.type="MerchandiseItem";var Xv=fu;var mu=class extends n{constructor(e){super(),this.title=e.title,this.menu=l.parseItem(e.actionButton),this.items=l.parseArray(e.items)}get contents(){return this.items}};r(mu,"MerchandiseShelf");mu.type="MerchandiseShelf";var oy=mu;var hu=class extends n{constructor(e){super(),this.title=new a(e.title),this.contents=e.contents.map(i=>new a(i))}};r(hu,"MetadataRow");hu.type="MetadataRow";var Jv=hu;var du=class extends n{constructor(e){super(),this.rows=l.parseArray(e.rows),this.collapsed_item_count=e.collapsedItemCount}};r(du,"MetadataRowContainer");du.type="MetadataRowContainer";var ny=du;var _u=class extends n{constructor(e){super(),this.content=new a(e.content),this.has_divider_line=e.hasDividerLine}};r(_u,"MetadataRowHeader");_u.type="MetadataRowHeader";var Zv=_u;var xu=class extends n{constructor(e){super(),this.section_list=l.parseItem(e)}};r(xu,"MetadataScreen");xu.type="MetadataScreen";var eI=xu;var yu=class extends n{constructor(e){super(),this.url_canonical=e.urlCanonical,this.title=e.title,this.description=e.description,this.thumbnail=y.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}};r(yu,"MicroformatData");yu.type="MicroformatData";var Ei=yu;var bu=class extends Nt{constructor(e){super(e)}};r(bu,"Mix");bu.type="Mix";var tI=bu;var gu=class extends n{constructor(e){super(),this.title=new a(e.title),this.content=new a(e.content),this.button=l.parseItem(e.button,v)}};r(gu,"ModalWithTitleAndButton");gu.type="ModalWithTitleAndButton";var iI=gu;var wu=class extends n{constructor(e){var s,o,p;super();let i=((s=e.thumbnailOverlays.find(c=>c.thumbnailOverlayTimeStatusRenderer))==null?void 0:s.thumbnailOverlayTimeStatusRenderer.text)||"N/A";this.id=e.videoId,this.title=new a(e.title),Reflect.has(e,"descriptionSnippet")&&(this.description_snippet=new a(e.descriptionSnippet)),this.top_metadata_items=new a(e.topMetadataItems),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new P(e.longBylineText,e.ownerBadges,(p=(o=e.channelThumbnailSupportedRenderers)==null?void 0:o.channelThumbnailWithLinkRenderer)==null?void 0:p.thumbnail),this.duration={text:e.lengthText?new a(e.lengthText).toString():new a(i).toString(),seconds:_e(e.lengthText?new a(e.lengthText).toString():new a(i).toString())},this.endpoint=new h(e.navigationEndpoint),this.badges=l.parseArray(e.badges),this.use_vertical_poster=e.useVerticalPoster,this.show_action_menu=e.showActionMenu,this.menu=l.parseItem(e.menu,R)}};r(wu,"Movie");wu.type="Movie";var rI=wu;var Tu=class extends n{constructor(e){var i;return super(),(i=e.movingThumbnailDetails)==null?void 0:i.thumbnails.map(s=>new y(s)).sort((s,o)=>o.width-s.width)}};r(Tu,"MovingThumbnail");Tu.type="MovingThumbnail";var sI=Tu;var vu=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(vu,"MusicCardShelfHeaderBasic");vu.type="MusicCardShelfHeaderBasic";var ay=vu;var Iu=class extends n{constructor(e){super(),this.icon_type=e.icon.iconType,this.label=e.accessibilityData.accessibilityData.label}};r(Iu,"MusicInlineBadge");Iu.type="MusicInlineBadge";var rs=Iu;var Su=class extends n{constructor(e){var i,s;super(),this.endpoint=new h(e.playNavigationEndpoint),this.play_icon_type=e.playIcon.iconType,this.pause_icon_type=e.pauseIcon.iconType,Reflect.has(e,"accessibilityPlayData")&&(this.play_label=(i=e.accessibilityPlayData.accessibilityData)==null?void 0:i.label),Reflect.has(e,"accessibilityPauseData")&&(this.pause_label=(s=e.accessibilityPauseData.accessibilityData)==null?void 0:s.label),this.icon_color=e.iconColor}};r(Su,"MusicPlayButton");Su.type="MusicPlayButton";var ss=Su;var Eu=class extends n{constructor(e){super(),this.content=l.parseItem(e.content,ss),this.content_position=e.contentPosition,this.display_style=e.displayStyle}};r(Eu,"MusicItemThumbnailOverlay");Eu.type="MusicItemThumbnailOverlay";var At=Eu;var ku=class extends n{constructor(e){super(),this.contents=y.fromResponse(e.thumbnail)}};r(ku,"MusicThumbnail");ku.type="MusicThumbnail";var ve=ku;var Cu=class extends n{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,ve),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.buttons=l.parseArray(e.buttons,v),this.menu=l.parseItem(e.menu,R),this.on_tap=new h(e.onTap),this.header=l.parseItem(e.header,ay),Reflect.has(e,"endIcon")&&Reflect.has(e.endIcon,"iconType")&&(this.end_icon_type=e.endIcon.iconType),this.subtitle_badges=l.parseArray(e.subtitleBadges,rs),this.thumbnail_overlay=l.parseItem(e.thumbnailOverlay,At),Reflect.has(e,"contents")&&(this.contents=l.parseArray(e.contents))}};r(Cu,"MusicCardShelf");Cu.type="MusicCardShelf";var oI=Cu;var Pu=class extends n{constructor(e){super(),this.title=new a(e.title),Reflect.has(e,"strapline")&&(this.strapline=new a(e.strapline)),Reflect.has(e,"thumbnail")&&(this.thumbnail=l.parseItem(e.thumbnail,ve)),Reflect.has(e,"moreContentButton")&&(this.more_content=l.parseItem(e.moreContentButton,v)),Reflect.has(e,"endIcons")&&(this.end_icons=l.parseArray(e.endIcons,Px))}};r(Pu,"MusicCarouselShelfBasicHeader");Pu.type="MusicCarouselShelfBasicHeader";var py=Pu;var Nu=class extends n{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,ve),this.overlay=l.parseItem(e.overlay,At),this.on_tap=new h(e.onTap),this.menu=l.parseItem(e.menu,R),this.subtitle=new a(e.subtitle),this.title=new a(e.title),Reflect.has(e,"secondTitle")&&(this.second_title=new a(e.secondTitle)),Reflect.has(e,"description")&&(this.description=new a(e.description)),Reflect.has(e,"displayStyle")&&(this.display_style=e.displayStyle)}};r(Nu,"MusicMultiRowListItem");Nu.type="MusicMultiRowListItem";var ly=Nu;var Au=class extends n{constructor(e){super(),this.button_text=new a(e.buttonText).toString(),this.endpoint=new h(e.clickCommand)}};r(Au,"MusicNavigationButton");Au.type="MusicNavigationButton";var cy=Au;var Ru=class extends n{constructor(e){super(),this.title=new a(e.text),this.display_priority=e.displayPriority}};r(Ru,"MusicResponsiveListItemFixedColumn");Ru.type="musicResponsiveListItemFlexColumnRenderer";var uy=Ru;var Mu=class extends n{constructor(e){super(),this.title=new a(e.text),this.display_priority=e.displayPriority}};r(Mu,"MusicResponsiveListItemFlexColumn");Mu.type="MusicResponsiveListItemFlexColumn";var fy=Mu;var Xe,os,Og,pI,nI,aI,lI,cI,uI,fI,mI,hI,Lu=class extends n{constructor(e){var s,o,p,c,f,m;super(),Xe.add(this),os.set(this,void 0),this.flex_columns=l.parseArray(e.flexColumns,fy),this.fixed_columns=l.parseArray(e.fixedColumns,uy),I(this,os,{video_id:((s=e==null?void 0:e.playlistItemData)==null?void 0:s.videoId)||null,playlist_set_video_id:((o=e==null?void 0:e.playlistItemData)==null?void 0:o.playlistSetVideoId)||null},"f"),Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint));let i=(m=(f=(c=(p=this.endpoint)==null?void 0:p.payload)==null?void 0:c.browseEndpointContextSupportedConfigs)==null?void 0:f.browseEndpointContextMusicConfig)==null?void 0:m.pageType;switch(i||this.flex_columns.find(_=>{var b,T,w,S;return((S=(w=(T=(b=_.title.endpoint)==null?void 0:b.payload)==null?void 0:T.browseEndpointContextSupportedConfigs)==null?void 0:w.browseEndpointContextMusicConfig)==null?void 0:S.pageType)==="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"})&&(i="MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE"),i){case"MUSIC_PAGE_TYPE_ALBUM":this.item_type="album",u(this,Xe,"m",mI).call(this);break;case"MUSIC_PAGE_TYPE_PLAYLIST":this.item_type="playlist",u(this,Xe,"m",hI).call(this);break;case"MUSIC_PAGE_TYPE_ARTIST":case"MUSIC_PAGE_TYPE_USER_CHANNEL":this.item_type="artist",u(this,Xe,"m",lI).call(this);break;case"MUSIC_PAGE_TYPE_LIBRARY_ARTIST":this.item_type="library_artist",u(this,Xe,"m",cI).call(this);break;case"MUSIC_PAGE_TYPE_NON_MUSIC_AUDIO_TRACK_PAGE":this.item_type="non_music_track",u(this,Xe,"m",uI).call(this);break;case"MUSIC_PAGE_TYPE_PODCAST_SHOW_DETAIL_PAGE":this.item_type="podcast_show",u(this,Xe,"m",fI).call(this);break;default:this.flex_columns[1]?u(this,Xe,"m",pI).call(this):u(this,Xe,"m",Og).call(this)}Reflect.has(e,"index")&&(this.index=new a(e.index)),Reflect.has(e,"thumbnail")&&(this.thumbnail=l.parseItem(e.thumbnail,ve)),Reflect.has(e,"badges")&&(this.badges=l.parseArray(e.badges)),Reflect.has(e,"menu")&&(this.menu=l.parseItem(e.menu,R)),Reflect.has(e,"overlay")&&(this.overlay=l.parseItem(e.overlay,At))}get thumbnails(){var e;return((e=this.thumbnail)==null?void 0:e.contents)||[]}};r(Lu,"MusicResponsiveListItem");os=new WeakMap,Xe=new WeakSet,Og=r(function(){this.title=this.flex_columns.first().title.toString(),this.endpoint?this.item_type="endpoint":this.item_type="unknown"},"_MusicResponsiveListItem_parseOther"),pI=r(function(){var i,s,o,p,c,f,m;switch((m=(f=(c=(p=(o=(s=(i=this.flex_columns.at(0))==null?void 0:i.title.runs)==null?void 0:s.at(0))==null?void 0:o.endpoint)==null?void 0:p.payload)==null?void 0:c.watchEndpointMusicSupportedConfigs)==null?void 0:f.watchEndpointMusicConfig)==null?void 0:m.musicVideoType){case"MUSIC_VIDEO_TYPE_UGC":case"MUSIC_VIDEO_TYPE_OMV":this.item_type="video",u(this,Xe,"m",aI).call(this);break;case"MUSIC_VIDEO_TYPE_ATV":this.item_type="song",u(this,Xe,"m",nI).call(this);break;default:u(this,Xe,"m",Og).call(this)}},"_MusicResponsiveListItem_parseVideoOrSong"),nI=r(function(){var o,p,c,f,m,x,_,b,T,w,S,E,C,k,U;this.id=u(this,os,"f").video_id||((p=(o=this.endpoint)==null?void 0:o.payload)==null?void 0:p.videoId),this.title=this.flex_columns.first().title.toString();let e=((m=(f=(c=this.flex_columns.at(1))==null?void 0:c.title.runs)==null?void 0:f.find(M=>/^\d+$/.test(M.text.replace(/:/g,""))))==null?void 0:m.text)||((_=(x=this.fixed_columns.first())==null?void 0:x.title)==null?void 0:_.toString());e&&(this.duration={text:e,seconds:_e(e)});let i=((T=(b=this.flex_columns.at(1))==null?void 0:b.title.runs)==null?void 0:T.find(M=>Re(M)&&M.endpoint&&M.endpoint.payload.browseId.startsWith("MPR")))||((S=(w=this.flex_columns.at(2))==null?void 0:w.title.runs)==null?void 0:S.find(M=>Re(M)&&M.endpoint&&M.endpoint.payload.browseId.startsWith("MPR")));i&&Re(i)&&(this.album={id:(C=(E=i.endpoint)==null?void 0:E.payload)==null?void 0:C.browseId,name:i.text,endpoint:i.endpoint});let s=(U=(k=this.flex_columns.at(1))==null?void 0:k.title.runs)==null?void 0:U.filter(M=>Re(M)&&M.endpoint&&M.endpoint.payload.browseId.startsWith("UC"));s&&(this.artists=s.map(M=>{var K,re;return{name:M.text,channel_id:Re(M)?(re=(K=M.endpoint)==null?void 0:K.payload)==null?void 0:re.browseId:void 0,endpoint:Re(M)?M.endpoint:void 0}}))},"_MusicResponsiveListItem_parseSong"),aI=r(function(){var s,o,p,c,f,m,x,_,b,T;this.id=u(this,os,"f").video_id,this.title=this.flex_columns.first().title.toString(),this.views=(p=(o=(s=this.flex_columns.at(1))==null?void 0:s.title.runs)==null?void 0:o.find(w=>w.text.match(/(.*?) views/)))==null?void 0:p.toString();let e=(f=(c=this.flex_columns.at(1))==null?void 0:c.title.runs)==null?void 0:f.filter(w=>Re(w)&&w.endpoint&&w.endpoint.payload.browseId.startsWith("UC"));e&&(this.authors=e.map(w=>{var S,E;return{name:w.text,channel_id:Re(w)?(E=(S=w.endpoint)==null?void 0:S.payload)==null?void 0:E.browseId:void 0,endpoint:Re(w)?w.endpoint:void 0}}));let i=((x=(m=this.flex_columns[1].title.runs)==null?void 0:m.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:x.text)||((T=(b=(_=this.fixed_columns.first())==null?void 0:_.title.runs)==null?void 0:b.find(w=>/^\d+$/.test(w.text.replace(/:/g,""))))==null?void 0:T.text);i&&(this.duration={text:i,seconds:_e(i)})},"_MusicResponsiveListItem_parseVideo"),lI=r(function(){var e,i,s,o,p,c;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.name=this.flex_columns.first().title.toString(),this.subtitle=(s=this.flex_columns.at(1))==null?void 0:s.title,this.subscribers=((c=(p=(o=this.subtitle)==null?void 0:o.runs)==null?void 0:p.find(f=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(f.text)))==null?void 0:c.text)||""},"_MusicResponsiveListItem_parseArtist"),cI=r(function(){var e,i,s,o;this.name=this.flex_columns.first().title.toString(),this.subtitle=(e=this.flex_columns.at(1))==null?void 0:e.title,this.song_count=((o=(s=(i=this.subtitle)==null?void 0:i.runs)==null?void 0:s.find(p=>/^\d+(,\d+)? songs?$/i.test(p.text)))==null?void 0:o.text)||""},"_MusicResponsiveListItem_parseLibraryArtist"),uI=r(function(){var e,i;this.id=u(this,os,"f").video_id||((i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.videoId),this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parseNonMusicTrack"),fI=r(function(){var e,i;this.id=(i=(e=this.endpoint)==null?void 0:e.payload)==null?void 0:i.browseId,this.title=this.flex_columns.first().title.toString()},"_MusicResponsiveListItem_parsePodcastShow"),mI=r(function(){var i,s,o,p,c,f,m,x,_;this.id=(s=(i=this.endpoint)==null?void 0:i.payload)==null?void 0:s.browseId,this.title=this.flex_columns.first().title.toString();let e=(p=(o=this.flex_columns.at(1))==null?void 0:o.title.runs)==null?void 0:p.find(b=>Re(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));e&&Re(e)&&(this.author={name:e.text,channel_id:(f=(c=e.endpoint)==null?void 0:c.payload)==null?void 0:f.browseId,endpoint:e.endpoint}),this.year=(_=(x=(m=this.flex_columns.at(1))==null?void 0:m.title.runs)==null?void 0:x.find(b=>/^[12][0-9]{3}$/.test(b.text)))==null?void 0:_.text},"_MusicResponsiveListItem_parseAlbum"),hI=r(function(){var s,o,p,c,f,m,x,_;this.id=(o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId,this.title=this.flex_columns.first().title.toString();let e=(c=(p=this.flex_columns.at(1))==null?void 0:p.title.runs)==null?void 0:c.find(b=>b.text.match(/\d+ (song|songs)/));this.item_count=e?e.text:void 0;let i=(m=(f=this.flex_columns.at(1))==null?void 0:f.title.runs)==null?void 0:m.find(b=>Re(b)&&b.endpoint&&b.endpoint.payload.browseId.startsWith("UC"));i&&Re(i)&&(this.author={name:i.text,channel_id:(_=(x=i.endpoint)==null?void 0:x.payload)==null?void 0:_.browseId,endpoint:i.endpoint})},"_MusicResponsiveListItem_parsePlaylist");Lu.type="MusicResponsiveListItem";var ki=Lu;var Ou=class extends n{constructor(e){var s,o,p,c,f,m,x,_,b,T,w,S,E,C,k,U,M,K,re,he,Y,ee;switch(super(),this.title=new a(e.title),this.endpoint=new h(e.navigationEndpoint),this.id=((o=(s=this.endpoint)==null?void 0:s.payload)==null?void 0:o.browseId)||((c=(p=this.endpoint)==null?void 0:p.payload)==null?void 0:c.videoId),this.subtitle=new a(e.subtitle),this.badges=l.parse(e.subtitleBadges),(_=(x=(m=(f=this.endpoint)==null?void 0:f.payload)==null?void 0:m.browseEndpointContextSupportedConfigs)==null?void 0:x.browseEndpointContextMusicConfig)==null?void 0:_.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:((T=(b=this.endpoint)==null?void 0:b.metadata)==null?void 0:T.api_url)==="/next"?this.item_type="endpoint":(w=this.subtitle.runs)!=null&&w[0]?this.subtitle.runs[0].text!=="Song"?this.item_type="video":this.item_type="song":this.endpoint?this.item_type="endpoint":this.item_type="unknown";break}if(this.item_type=="artist")this.subscribers=((E=(S=this.subtitle.runs)==null?void 0:S.find(F=>/^(\d*\.)?\d+[M|K]? subscribers?$/i.test(F.text)))==null?void 0:E.text)||"";else if(this.item_type=="playlist"){let F=(C=this.subtitle.runs)==null?void 0:C.find(B=>B.text.match(/\d+ songs|song/));this.item_count=F?F.text:null}else if(this.item_type=="album"){let F=(k=this.subtitle.runs)==null?void 0:k.filter(B=>{var z,J;return(J=(z=B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var z,J;return{name:B.text,channel_id:(J=(z=B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId,endpoint:B.endpoint}})),this.year=(U=this.subtitle.runs)==null?void 0:U.slice(-1)[0].text,isNaN(Number(this.year))&&delete this.year}else if(this.item_type=="video"){this.views=((K=(M=this==null?void 0:this.subtitle.runs)==null?void 0:M.find(B=>B==null?void 0:B.text.match(/(.*?) views/)))==null?void 0:K.text)||"N/A";let F=(re=this.subtitle.runs)==null?void 0:re.find(B=>{var z,J,Be;return(Be=(J=(z=B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId)==null?void 0:Be.startsWith("UC")});F&&(this.author={name:F==null?void 0:F.text,channel_id:(Y=(he=F==null?void 0:F.endpoint)==null?void 0:he.payload)==null?void 0:Y.browseId,endpoint:F==null?void 0:F.endpoint})}else if(this.item_type=="song"){let F=(ee=this.subtitle.runs)==null?void 0:ee.filter(B=>{var z,J;return(J=(z=B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId.startsWith("UC")});F&&(this.artists=F.map(B=>{var z,J;return{name:B==null?void 0:B.text,channel_id:(J=(z=B==null?void 0:B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId,endpoint:B==null?void 0:B.endpoint}}))}this.thumbnail=y.fromResponse(e.thumbnailRenderer.musicThumbnailRenderer.thumbnail),this.thumbnail_overlay=l.parseItem(e.thumbnailOverlay,At),this.menu=l.parseItem(e.menu,R)}};r(Ou,"MusicTwoRowItem");Ou.type="MusicTwoRowItem";var my=Ou;var Du=class extends n{constructor(e){super(),this.header=l.parseItem(e.header,py),this.contents=l.parseArray(e.contents,[my,ki,ly,cy]),Reflect.has(e,"numItemsPerColumn")&&(this.num_items_per_column=parseInt(e.numItemsPerColumn))}};r(Du,"MusicCarouselShelf");Du.type="MusicCarouselShelf";var dI=Du;var Bu=class extends n{constructor(e){super(),this.description=new a(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 a(e.footer)}};r(Bu,"MusicDescriptionShelf");Bu.type="MusicDescriptionShelf";var hy=Bu;var Yu=class extends n{constructor(e){var s,o,p,c,f,m,x,_,b;super(),this.title=new a(e.title),this.description=new a(e.description),this.subtitle=new a(e.subtitle),this.second_subtitle=new a(e.secondSubtitle),this.year=((o=(s=this.subtitle.runs)==null?void 0:s.find(T=>/^[12][0-9]{3}$/.test(T.text)))==null?void 0:o.text)||"",this.song_count=((c=(p=this.second_subtitle.runs)==null?void 0:p[0])==null?void 0:c.text)||"",this.total_duration=((m=(f=this.second_subtitle.runs)==null?void 0:f[2])==null?void 0:m.text)||"",this.thumbnails=y.fromResponse(e.thumbnail.croppedSquareThumbnailRenderer.thumbnail),this.badges=l.parseArray(e.subtitleBadges);let i=(x=this.subtitle.runs)==null?void 0:x.find(T=>{var w,S;return(S=(w=T==null?void 0:T.endpoint)==null?void 0:w.payload)==null?void 0:S.browseId.startsWith("UC")});i&&(this.author={name:i.text,channel_id:(b=(_=i.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:i.endpoint}),this.menu=l.parseItem(e.menu)}};r(Yu,"MusicDetailHeader");Yu.type="MusicDetailHeader";var _I=Yu;var Vu=class extends n{constructor(e){super(),this.playlist_id=e.playlistId,this.supported_download_states=e.supportedDownloadStates}};r(Vu,"MusicDownloadStateBadge");Vu.type="MusicDownloadStateBadge";var xI=Vu;var Uu=class extends n{constructor(e){super(),this.header=l.parseItem(e.header),this.edit_header=l.parseItem(e.editHeader),this.playlist_id=e.playlistId}};r(Uu,"MusicEditablePlaylistDetailHeader");Uu.type="MusicEditablePlaylistDetailHeader";var yI=Uu;var Fu=class extends n{constructor(e){super(),this.element=Reflect.has(e,"elementRenderer")?l.parseItem(e,hx):null}};r(Fu,"MusicElementHeader");Fu.type="MusicElementHeader";var bI=Fu;var Wu=class extends n{constructor(e){super(),Reflect.has(e,"header")&&(this.header=l.parseItem(e.header)),Reflect.has(e,"title")&&(this.title=new a(e.title))}};r(Wu,"MusicHeader");Wu.type="MusicHeader";var gI=Wu;var Gu=class extends n{constructor(e){super(),this.title=new a(e.title),this.description=new a(e.description),this.thumbnail=l.parseItem(e.thumbnail,ve)}};r(Gu,"MusicImmersiveHeader");Gu.type="MusicImmersiveHeader";var wI=Gu;var ju=class{constructor(e){this.icon_name=e.iconName,this.endpoint=new h(e.onTap),this.a11y_text=e.a11yText,this.style=e.style}};r(ju,"ActionButton");ju.type="ActionButton";var Hu=class{constructor(e){this.image=y.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(i=>new ju(i))}};r(Hu,"Panel");Hu.type="Panel";var $u=class extends n{constructor(e){super(),this.header=e.shelf.header,this.panels=e.shelf.panels.map(i=>new Hu(i))}};r($u,"MusicLargeCardItemCarousel");$u.type="MusicLargeCardItemCarousel";var TI=$u;var Ku=class extends n{constructor(e){super(),this.title=new a(e.title),this.edit_title=new a(e.editTitle),this.edit_description=new a(e.editDescription),this.privacy=e.privacy,this.playlist_id=e.playlistId,this.endpoint=new h(e.collaborationSettingsCommand),this.privacy_dropdown=l.parseItem(e.privacyDropdown,fi)}};r(Ku,"MusicPlaylistEditHeader");Ku.type="MusicPlaylistEditHeader";var vI=Ku;var qu=class extends n{constructor(e){var i,s,o;super(),this.playlist_id=e.playlistId,this.contents=l.parseArray(e.contents,ki),this.collapsed_item_count=e.collapsedItemCount,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||null}};r(qu,"MusicPlaylistShelf");qu.type="MusicPlaylistShelf";var II=qu;var zu=class extends n{constructor(e){var o,p,c,f,m;super(),this.title=new a(e.title),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new h(e.navigationEndpoint),this.selected=e.selected,this.video_id=e.videoId,this.duration={text:new a(e.lengthText).toString(),seconds:_e(new a(e.lengthText).toString())};let i=(o=new a(e.longBylineText).runs)==null?void 0:o.find(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("MPR")}),s=(p=new a(e.longBylineText).runs)==null?void 0:p.filter(x=>{var _,b,T;return(T=(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)==null?void 0:T.startsWith("UC")});this.author=new a(e.shortBylineText).toString(),i&&(this.album={id:(f=(c=i.endpoint)==null?void 0:c.payload)==null?void 0:f.browseId,name:i.text,year:(m=new a(e.longBylineText).runs)==null?void 0:m.slice(-1)[0].text,endpoint:i.endpoint}),s&&(this.artists=s.map(x=>{var _,b;return{name:x.text,channel_id:(b=(_=x.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId,endpoint:x.endpoint}})),this.badges=l.parseArray(e.badges),this.menu=l.parseItem(e.menu),this.set_video_id=e.playlistSetVideoId}};r(zu,"PlaylistPanelVideo");zu.type="PlaylistPanelVideo";var Jt=zu;var Qu=class extends n{constructor(e){super(),this.primary=l.parseItem(e.primaryRenderer,Jt),Reflect.has(e,"counterpart")&&(this.counterpart=G(e.counterpart.map(i=>l.parseItem(i.counterpartRenderer,Jt))||[]))}};r(Qu,"PlaylistPanelVideoWrapper");Qu.type="PlaylistPanelVideoWrapper";var dy=Qu;var Xu=class extends n{constructor(e){var i,s,o,p,c,f;super(),this.title=e.title,this.title_text=new a(e.titleText),this.contents=l.parseArray(e.contents,[dy,Jt,Kd]),this.playlist_id=e.playlistId,this.is_infinite=e.isInfinite,this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextRadioContinuationData)==null?void 0:o.continuation)||((f=(c=(p=e.continuations)==null?void 0:p[0])==null?void 0:c.nextContinuationData)==null?void 0:f.continuation),this.is_editable=e.isEditable,this.preview_description=e.previewDescription,this.num_items_to_show=e.numItemsToShow}};r(Xu,"PlaylistPanel");Xu.type="PlaylistPanel";var _y=Xu;var Ju=class extends n{constructor(e){super(),this.content=l.parseItem(e.content,_y)}};r(Ju,"MusicQueue");Ju.type="MusicQueue";var xy=Ju;var Zu=class extends n{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,ve),this.buttons=l.parseArray(e.buttons,[Or,se,ss,v,R]),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.strapline_text_one=new a(e.straplineTextOne),this.strapline_thumbnail=l.parseItem(e.straplineThumbnail,ve),this.second_subtitle=new a(e.secondSubtitle),Reflect.has(e,"subtitleBadge")&&(this.subtitle_badge=l.parseArray(e.subtitleBadge,rs)),Reflect.has(e,"description")&&(this.description=l.parseItem(e.description,hy))}};r(Zu,"MusicResponsiveHeader");Zu.type="MusicResponsiveHeader";var SI=Zu;var ef=class extends n{constructor(e){var i,s,o,p;super(),this.title=new a(e.title),this.contents=l.parseArray(e.contents,ki),Reflect.has(e,"bottomEndpoint")&&(this.endpoint=new h(e.bottomEndpoint)),Reflect.has(e,"continuations")&&(this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((p=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:p.continuation)),Reflect.has(e,"bottomText")&&(this.bottom_text=new a(e.bottomText)),Reflect.has(e,"bottomButton")&&(this.bottom_button=l.parseItem(e.bottomButton,v)),Reflect.has(e,"subheaders")&&(this.subheaders=l.parseArray(e.subheaders))}};r(ef,"MusicShelf");ef.type="MusicShelf";var EI=ef;var tf=class extends n{constructor(e){super(),Reflect.has(e,"startItems")&&(this.start_items=l.parseArray(e.startItems)),Reflect.has(e,"endItems")&&(this.end_items=l.parseArray(e.endItems))}};r(tf,"MusicSideAlignedItem");tf.type="MusicSideAlignedItem";var kI=tf;var rf=class extends n{constructor(e){super(),this.title=new a(e.title).toString(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.menu=l.parseItem(e.menu,ry)}};r(rf,"MusicSortFilterButton");rf.type="MusicSortFilterButton";var CI=rf;var sf=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail)}};r(sf,"MusicTastebuilderShelfThumbnail");sf.type="MusicTastebuilderShelfThumbnail";var yy=sf;var of=class extends n{constructor(e){super(),this.thumbnail=l.parseItem(e.thumbnail,yy),this.primary_text=new a(e.primaryText),this.secondary_text=new a(e.secondaryText),this.action_button=l.parseItem(e.actionButton,v),this.is_visible=e.isVisible}};r(of,"MusicTasteBuilderShelf");of.type="MusicTasteBuilderShelf";var PI=of;var nf=class extends n{constructor(e){var i,s;super(),this.title=new a(e.title),this.thumbnail=e.thumbnail?y.fromResponse((i=e.thumbnail.musicThumbnailRenderer)==null?void 0:i.thumbnail):[],this.menu=l.parseItem(e.menu,R),this.foreground_thumbnail=e.foregroundThumbnail?y.fromResponse((s=e.foregroundThumbnail.musicThumbnailRenderer)==null?void 0:s.thumbnail):[]}};r(nf,"MusicVisualHeader");nf.type="MusicVisualHeader";var NI=nf;var af=class extends n{constructor(e){super(),this.placeholder_text=new a(e.placeholderText),this.buttons=l.parseArray(e.buttons),Reflect.has(e,"logo")&&Reflect.has(e.logo,"iconType")&&(this.logo_type=e.logo.iconType)}};r(af,"MobileTopbar");af.type="MobileTopbar";var AI=af;var pf=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}};r(pf,"MultiPageMenuSection");pf.type="MultiPageMenuSection";var RI=pf;var lf=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}};r(lf,"PivotBar");lf.type="PivotBar";var MI=lf;var cf=class extends n{constructor(e){super(),this.pivot_identifier=e.pivotIdentifier,this.endpoint=new h(e.navigationEndpoint),this.title=new a(e.title),Reflect.has(e,"accessibility")&&Reflect.has(e.accessibility,"accessibilityData")&&(this.accessibility_label=e.accessibility.accessibilityData.label),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType)}};r(cf,"PivotBarItem");cf.type="PivotBarItem";var LI=cf;var uf=class extends n{constructor(e){super(),Reflect.has(e,"icon")&&Reflect.has(e.icon,"iconType")&&(this.icon_type=e.icon.iconType),this.menu_renderer=l.parseItem(e.menuRenderer),this.target_id=e.targetId}};r(uf,"TopbarMenuButton");uf.type="TopbarMenuButton";var OI=uf;var ff=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.short_message=new a(e.shortMessage),this.sent_time=new a(e.sentTimeText),this.notification_id=e.notificationId,this.endpoint=new h(e.navigationEndpoint),this.record_click_endpoint=new h(e.recordClickEndpoint),this.menu=l.parseItem(e.contextualMenu),this.read=e.read}};r(ff,"Notification");ff.type="Notification";var by=ff;var mf=class extends n{constructor(e){super(),this.response_text=new a(e.responseText)}};r(mf,"NotificationAction");mf.type="NotificationAction";var DI=mf;var hf=class extends n{constructor(e){super(),this.title=l.parseItem(e.title,fx),this.image=l.parseItem(e.image,[er,Qr]),this.animated_image=l.parseItem(e.animatedImage,er),this.metadata=l.parseItem(e.metadata,qr),this.actions=l.parseItem(e.actions,Br),this.description=l.parseItem(e.description,px),this.attributation=l.parseItem(e.attributation,Hd),this.banner=l.parseItem(e.banner,Nx)}};r(hf,"PageHeaderView");hf.type="PageHeaderView";var gy=hf;var df=class extends n{constructor(e){super(),this.page_title=e.pageTitle,this.content=l.parseItem(e.content,gy)}};r(df,"PageHeader");df.type="PageHeader";var Rt=df;var _f=class extends n{constructor(e){super(),this.header_text=new a(e.headerText).toString(),this.body_text=new a(e.bodyText).toString(),this.page_title=new a(e.pageTitle).toString(),this.header_icon_type=e.headerIcon.iconType}};r(_f,"PageIntroduction");_f.type="PageIntroduction";var wy=_f;var xf=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.endpoint=new h(e.onClickCommand),this.content_description=new a(e.contentDescription),this.target_id=e.targetId,this.sound_attribution_title=new a(e.soundAttributionTitle),this.waveform_animation_style=e.waveformAnimationStyle,this.background_animation_style=e.backgroundAnimationStyle}};r(xf,"PivotButton");xf.type="PivotButton";var Ty=xf;var yf=class extends n{constructor(e){super(),Reflect.has(e,"featuredChannel")&&(this.featured_channel={start_time_ms:e.featuredChannel.startTimeMs,end_time_ms:e.featuredChannel.endTimeMs,watermark:y.fromResponse(e.featuredChannel.watermark),channel_name:e.featuredChannel.channelName,endpoint:new h(e.featuredChannel.navigationEndpoint),subscribe_button:l.parseItem(e.featuredChannel.subscribeButton)}),this.allow_swipe_dismiss=e.allowSwipeDismiss,this.annotation_id=e.annotationId}};r(yf,"PlayerAnnotationsExpanded");yf.type="PlayerAnnotationsExpanded";var vy=yf;var bf=class extends n{constructor(e){super(),Reflect.has(e,"captionTracks")&&(this.caption_tracks=e.captionTracks.map(i=>({base_url:i.baseUrl,name:new a(i.name),vss_id:i.vssId,language_code:i.languageCode,kind:i.kind,is_translatable:i.isTranslatable}))),Reflect.has(e,"audioTracks")&&(this.audio_tracks=e.audioTracks.map(i=>({audio_track_id:i.audioTrackId,captions_initial_state:i.captionsInitialState,default_caption_track_index:i.defaultCaptionTrackIndex,has_default_track:i.hasDefaultTrack,visibility:i.visibility,caption_track_indices:i.captionTrackIndices}))),Reflect.has(e,"defaultAudioTrackIndex")&&(this.default_audio_track_index=e.defaultAudioTrackIndex),Reflect.has(e,"translationLanguages")&&(this.translation_languages=e.translationLanguages.map(i=>({language_code:i.languageCode,language_name:new a(i.languageName)})))}};r(bf,"PlayerCaptionsTracklist");bf.type="PlayerCaptionsTracklist";var Iy=bf;var gf=class extends n{constructor(e){super(),this.endpoint=new h(e.endpoint),this.enable_listen_first=e.enableListenFirst}};r(gf,"PlayerOverflow");gf.type="PlayerOverflow";var Sy=gf;var wf=class extends n{constructor(e){super(),this.overflow=l.parseItem(e.overflow,Sy)}};r(wf,"PlayerControlsOverlay");wf.type="PlayerControlsOverlay";var BI=wf;var Tf=class extends n{constructor(e){super(),this.subreason=new a(e.subreason),this.reason=new a(e.reason),this.proceed_button=l.parseItem(e.proceedButton,v),this.thumbnails=y.fromResponse(e.thumbnail),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(Tf,"PlayerErrorMessage");Tf.type="PlayerErrorMessage";var YI=Tf;var vf=class extends n{constructor(e){super(),this.title=e.itemTitle,this.thumbnail=e.itemThumbnail,this.offer_description=e.offerDescription,this.offer_id=e.offerId}};r(vf,"PlayerLegacyDesktopYpcOffer");vf.type="PlayerLegacyDesktopYpcOffer";var VI=vf;var If=class extends n{constructor(e){super(),this.video_message=e.fullVideoMessage,this.player_response=e.unserializedPlayerResponse}};r(If,"YpcTrailer");If.type="YpcTrailer";var Ey=If;var Sf=class extends n{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=l.parseItem(e.ypcTrailer,Ey)}};r(Sf,"PlayerLegacyDesktopYpcTrailer");Sf.type="PlayerLegacyDesktopYpcTrailer";var Ef=Sf;var kf=class extends n{constructor(e){super();let[i,s,o,p,c]=e.spec.split("#");this.board={type:"live",template_url:i,thumbnail_width:parseInt(s,10),thumbnail_height:parseInt(o,10),columns:parseInt(p,10),rows:parseInt(c,10)}}};r(kf,"PlayerLiveStoryboardSpec");kf.type="PlayerLiveStoryboardSpec";var ky=kf;var Cf=class extends n{constructor(e){var i,s;super(),this.title=new a(e.title),this.description=new a(e.description),this.thumbnails=y.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=(i=e.liveBroadcastDetails)!=null&&i.startTimestamp?new Date(e.liveBroadcastDetails.startTimestamp):null,this.end_timestamp=(s=e.liveBroadcastDetails)!=null&&s.endTimestamp?new Date(e.liveBroadcastDetails.endTimestamp):null}};r(Cf,"PlayerMicroformat");Cf.type="PlayerMicroformat";var Je=Cf;var Pf=class extends n{constructor(e){super(),this.title=new a(e.title),this.video_id=e.videoId,this.video_title=new a(e.videoTitle),this.short_view_count=new a(e.shortViewCountText),this.prefer_immediate_redirect=e.preferImmediateRedirect,this.count_down_secs_for_fullscreen=e.countDownSecsForFullscreen,this.published=new a(e.publishedTimeText),this.background=y.fromResponse(e.background),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.author=new P(e.byline),this.cancel_button=l.parseItem(e.cancelButton,v),this.next_button=l.parseItem(e.nextButton,v),this.close_button=l.parseItem(e.closeButton,v)}};r(Pf,"PlayerOverlayAutoplay");Pf.type="PlayerOverlayAutoplay";var Cy=Pf;var Nf=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle)}};r(Nf,"PlayerOverlayVideoDetails");Nf.type="PlayerOverlayVideoDetails";var Py=Nf;var Af=class extends n{constructor(e){super(),this.results=l.parseArray(e.results,[bx,yx]),this.title=new a(e.title).toString()}};r(Af,"WatchNextEndScreen");Af.type="WatchNextEndScreen";var Ny=Af;var Rf=class extends n{constructor(e){super(),this.end_screen=l.parseItem(e.endScreen,Ny),this.autoplay=l.parseItem(e.autoplay,Cy),this.share_button=l.parseItem(e.shareButton,v),this.add_to_menu=l.parseItem(e.addToMenu,R),this.fullscreen_engagement=l.parseItem(e.fullscreenEngagement),this.actions=l.parseArray(e.actions),this.browser_media_session=l.parseItem(e.browserMediaSession),this.decorated_player_bar=l.parseItem(e.decoratedPlayerBarRenderer,ax),this.video_details=l.parseItem(e.videoDetails,Py)}};r(Rf,"PlayerOverlay");Rf.type="PlayerOverlay";var Ay=Rf;var Mf=class extends n{constructor(e){super(),this.id=e.playlistId,this.title=new a(e.title),this.subtitle=e.subtitle?new a(e.subtitle):null,this.stats=e.stats.map(i=>new a(i)),this.brief_stats=e.briefStats.map(i=>new a(i)),this.author=e.ownerText||e.ownerEndpoint?new P({...e.ownerText,navigationEndpoint:e.ownerEndpoint},e.ownerBadges,null):null,this.description=new a(e.descriptionText),this.num_videos=new a(e.numVideosText),this.view_count=new a(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=l.parseItem(e.saveButton),this.shuffle_play_button=l.parseItem(e.shufflePlayButton),this.menu=l.parseItem(e.moreActionsMenu),this.banner=l.parseItem(e.playlistHeaderBanner)}};r(Mf,"PlaylistHeader");Mf.type="PlaylistHeader";var Ry=Mf;var Lf=class extends n{constructor(e){super(),this.title=new a(e.playlistTitle),this.thumbnails=y.fromResponse(e.thumbnail),this.video_count=new a(e.playlistVideoCount),this.channel_name=new a(e.channelName),this.endpoint=new h(e.action)}};r(Lf,"PlaylistInfoCardContent");Lf.type="PlaylistInfoCardContent";var UI=Lf;var Of=class extends n{constructor(e){super(),this.title=e.title,this.description=e.description||null}};r(Of,"PlaylistMetadata");Of.type="PlaylistMetadata";var My=Of;var Df=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};r(Df,"PlaylistSidebar");Df.type="PlaylistSidebar";var FI=Df;var Bf=class extends n{constructor(e){super(),this.stats=e.stats.map(i=>new a(i)),this.thumbnail_renderer=l.parseItem(e.thumbnailRenderer),this.title=new a(e.title),this.menu=l.parseItem(e.menu),this.endpoint=new h(e.navigationEndpoint),this.description=new a(e.description)}};r(Bf,"PlaylistSidebarPrimaryInfo");Bf.type="PlaylistSidebarPrimaryInfo";var Ly=Bf;var Yf=class extends n{constructor(e){super(),this.owner=l.parseItem(e.videoOwner),this.button=l.parseItem(e.button)}};r(Yf,"PlaylistSidebarSecondaryInfo");Yf.type="PlaylistSidebarSecondaryInfo";var Oy=Yf;var Vf=class extends n{constructor(e){super(),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),this.text=new a(e.text)}};r(Vf,"PlaylistThumbnailOverlay");Vf.type="PlaylistThumbnailOverlay";var WI=Vf;var Uf=class extends n{constructor(e){super(),this.id=e.videoId,this.index=new a(e.index),this.title=new a(e.title),this.author=new P(e.shortBylineText),this.thumbnails=y.fromResponse(e.thumbnail),this.thumbnail_overlays=l.parseArray(e.thumbnailOverlays),this.set_video_id=e==null?void 0:e.setVideoId,this.endpoint=new h(e.navigationEndpoint),this.is_playable=e.isPlayable,this.menu=l.parseItem(e.menu,R),this.video_info=new a(e.videoInfo),this.accessibility_label=e.title.accessibility.accessibilityData.label,Reflect.has(e,"style")&&(this.style=e.style);let i=e.upcomingEventData&&Number(`${e.upcomingEventData.startTime}000`);i&&(this.upcoming=new Date(i)),this.duration={text:new a(e.lengthText).toString(),seconds:parseInt(e.lengthSeconds)}}get is_live(){var e;return((e=this.thumbnail_overlays.firstOfType(Zi))==null?void 0:e.style)==="LIVE"}get is_upcoming(){var e;return((e=this.thumbnail_overlays.firstOfType(Zi))==null?void 0:e.style)==="UPCOMING"}};r(Uf,"PlaylistVideo");Uf.type="PlaylistVideo";var ns=Uf;var Ff=class extends n{constructor(e){super(),this.id=e.playlistId,this.is_editable=e.isEditable,this.can_reorder=e.canReorder,this.videos=l.parseArray(e.contents)}};r(Ff,"PlaylistVideoList");Ff.type="PlaylistVideoList";var GI=Ff;var Wf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new a(i.text),select_endpoint:i.selectServiceEndpoint?new h(i.selectServiceEndpoint):null,deselect_endpoint:i.deselectServiceEndpoint?new h(i.deselectServiceEndpoint):null,vote_ratio_if_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_selected:new a(i.votePercentageIfSelected),vote_ratio_if_not_selected:(i==null?void 0:i.voteRatioIfSelected)||null,vote_percentage_if_not_selected:new a(i.votePercentageIfSelected),image:i.image?y.fromResponse(i.image):null})),Reflect.has(e,"type")&&(this.poll_type=e.type),Reflect.has(e,"totalVotes")&&(this.total_votes=new a(e.totalVotes)),Reflect.has(e,"liveChatPollId")&&(this.live_chat_poll_id=e.liveChatPollId)}};r(Wf,"Poll");Wf.type="Poll";var jI=Wf;var Gf=class extends xi{constructor(e){super(e)}};r(Gf,"Post");Gf.type="Post";var as=Gf;var jf=class extends n{constructor(e){super(),this.images=l.parseArray(e.images,zd)}};r(jf,"PostMultiImage");jf.type="PostMultiImage";var HI=jf;var Hf=class extends n{constructor(e){super(),this.label=new a(e.label)}};r(Hf,"PremiereTrailerBadge");Hf.type="PremiereTrailerBadge";var $I=Hf;var $f=class extends n{constructor(e){super(),this.title=new a(e.title),this.suppress_padding_disclaimer=!!e.suppressPaddingDisclaimer}};r($f,"ProductListHeader");$f.type="ProductListHeader";var KI=$f;var Kf=class extends n{constructor(e){super(),this.title=new a(e.title),this.accessibility_title=e.accessibilityTitle,this.thumbnail=y.fromResponse(e.thumbnail),this.price=e.price,this.endpoint=new h(e.onClickCommand),this.merchant_name=e.merchantName,this.stay_in_app=!!e.stayInApp,this.view_button=l.parseItem(e.viewButton,v)}};r(Kf,"ProductListItem");Kf.type="ProductListItem";var qI=Kf;var qf=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};r(qf,"ProfileColumn");qf.type="ProfileColumn";var zI=qf;var zf=class extends n{constructor(e){super(),this.items=l.parseArray(e.items)}get contents(){return this.items}};r(zf,"ProfileColumnStats");zf.type="ProfileColumnStats";var QI=zf;var Qf=class extends n{constructor(e){super(),this.label=new a(e.label),this.value=new a(e.value)}};r(Qf,"ProfileColumnStatsEntry");Qf.type="ProfileColumnStatsEntry";var XI=Qf;var Xf=class extends n{constructor(e){super(),this.title=new a(e.title),this.thumbnails=y.fromResponse(e.thumbnail)}};r(Xf,"ProfileColumnUserInfo");Xf.type="ProfileColumnUserInfo";var JI=Xf;var Jf=class extends n{constructor(e){super(),this.choices=e.choices.map(i=>({text:new a(i.text),is_correct:i.isCorrect})),this.total_votes=new a(e.totalVotes)}};r(Jf,"Quiz");Jf.type="Quiz";var ZI=Jf;var Zf=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.avatars=e.avatars.map(i=>new y(i)),this.button=l.parseItem(e.button,v),this.surface=e.surface}};r(Zf,"RecognitionShelf");Zf.type="RecognitionShelf";var eS=Zf;var em=class extends n{constructor(e){super(),this.id=e.videoId,this.title=new a(e.headline),this.thumbnails=y.fromResponse(e.thumbnail),this.views=new a(e.viewCountText),this.endpoint=new h(e.navigationEndpoint),this.accessibility_label=e.accessibility.accessibilityData.label}};r(em,"ReelItem");em.type="ReelItem";var ps=em;var tm=class extends n{constructor(e){super(),this.reel_title_text=new a(e.reelTitleText),this.timestamp_text=new a(e.timestampText),this.channel_title_text=new a(e.channelTitleText),this.channel_thumbnail=y.fromResponse(e.channelThumbnail),this.author=new P(e.channelNavigationEndpoint,void 0)}};r(tm,"ReelPlayerHeader");tm.type="ReelPlayerHeader";var Dy=tm;var im=class extends n{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,Dr),this.reel_player_header_supported_renderers=l.parseItem(e.reelPlayerHeaderSupportedRenderers,Dy),this.menu=l.parseItem(e.menu,R),this.next_item_button=l.parseItem(e.nextItemButton,v),this.prev_item_button=l.parseItem(e.prevItemButton,v),this.subscribe_button_renderer=l.parseItem(e.subscribeButtonRenderer,[v,xe]),this.style=e.style,this.view_comments_button=l.parseItem(e.viewCommentsButton,v),this.share_button=l.parseItem(e.shareButton,v),this.pivot_button=l.parseItem(e.pivotButton,Ty),this.info_panel=l.parseItem(e.infoPanel,Rx)}};r(im,"ReelPlayerOverlay");im.type="ReelPlayerOverlay";var tS=im;var rm=class extends n{constructor(e){super(),this.content=l.parseItem(e.content)}};r(rm,"RelatedChipCloud");rm.type="RelatedChipCloud";var By=rm;var sm=class extends n{constructor(e){super(),this.header=l.parseItem(e.header),this.contents=l.parseArray(e.contents)}};r(sm,"RichGrid");sm.type="RichGrid";var Ci=sm;var om=class extends n{constructor(e){super(),this.content=l.parseItem(e.content)}};r(om,"RichItem");om.type="RichItem";var iS=om;var nm=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle),Reflect.has(e,"titleStyle")&&(this.title_style=e.titleStyle.style),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType)}};r(nm,"RichListHeader");nm.type="RichListHeader";var rS=nm;var am=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.call_to_action=new a(e.callToAction),Reflect.has(e,"callToActionIcon")&&(this.icon_type=e.callToActionIcon.iconType),this.endpoint=new h(e.endpoint)}};r(am,"RichMetadata");am.type="RichMetadata";var pm=am;var lm=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(lm,"RichMetadataRow");lm.type="RichMetadataRow";var cm=lm;var um=class extends n{constructor(e){super(),this.content=l.parseItem(e.content)}};r(um,"RichSection");um.type="RichSection";var sS=um;var fm=class extends n{constructor(e){super(),this.title=new a(e.title),this.contents=l.parseArray(e.contents),Reflect.has(e,"endpoint")&&(this.endpoint=new h(e.endpoint)),Reflect.has(e,"subtitle")&&(this.subtitle=new a(e.subtitle))}};r(fm,"RichShelf");fm.type="RichShelf";var Yy=fm;var mm=class extends n{constructor(e){super(),this.endpoint=new h(e.endpoint),this.search_button=l.parseItem(e.searchButton,v),this.clear_button=l.parseItem(e.clearButton,v),this.placeholder_text=new a(e.placeholderText)}};r(mm,"SearchBox");mm.type="SearchBox";var oS=mm;var hm=class extends n{constructor(e){super(),this.label=new a(e.label),this.endpoint=new h(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"}};r(hm,"SearchFilter");hm.type="SearchFilter";var Vy=hm;var dm=class extends n{constructor(e){super(),this.title=new a(e.title),this.filters=l.parseArray(e.filters,Vy)}};r(dm,"SearchFilterGroup");dm.type="SearchFilterGroup";var ls=dm;var _m=class extends n{constructor(e){super(),this.title=new a(e.title),this.groups=l.parseArray(e.groups,ls)}};r(_m,"SearchFilterOptionsDialog");_m.type="SearchFilterOptionsDialog";var nS=_m;var xm=class extends n{constructor(e){super(),this.chip_bar=l.parseItem(e.chipBar,Hr),this.search_filter_button=l.parseItem(e.searchFilterButton,v)}};r(xm,"SearchHeader");xm.type="SearchHeader";var Uy=xm;var ym=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new a(e.title)),Reflect.has(e,"groups")&&(this.groups=l.parseArray(e.groups,ls)),Reflect.has(e,"button")&&(this.button=l.parseItem(e.button,se))}};r(ym,"SearchSubMenu");ym.type="SearchSubMenu";var Fy=ym;var bm=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(bm,"SearchSuggestionsSection");bm.type="SearchSuggestionsSection";var aS=bm;var gm=class extends n{constructor(e){super(),this.contents=l.parseArray(e.contents)}};r(gm,"SecondarySearchContainer");gm.type="SecondarySearchContainer";var pS=gm;var wm=class extends n{constructor(e){super(),this.like_button=l.parseItem(e.likeButton,[se,v]),this.dislike_button=l.parseItem(e.dislikeButton,[se,v])}};r(wm,"SegmentedLikeDislikeButton");wm.type="SegmentedLikeDislikeButton";var fr=wm;var Tm=class extends n{constructor(e){super(),Reflect.has(e,"title")&&(this.title=new a(e.title)),Reflect.has(e,"summary")&&(this.summary=new a(e.summary)),Reflect.has(e,"enableServiceEndpoint")&&(this.enable_endpoint=new h(e.enableServiceEndpoint)),Reflect.has(e,"disableServiceEndpoint")&&(this.disable_endpoint=new h(e.disableServiceEndpoint)),this.item_id=e.itemId}};r(Tm,"SettingBoolean");Tm.type="SettingBoolean";var lS=Tm;var vm=class extends n{constructor(e){super(),this.title=new a(e.title),this.help_text=new a(e.helpText),this.enabled=e.enabled,this.disabled=e.disabled,this.id=e.id}};r(vm,"SettingsCheckbox");vm.type="SettingsCheckbox";var Wy=vm;var Im=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.enabled=e.enabled,this.enable_endpoint=new h(e.enableServiceEndpoint),this.disable_endpoint=new h(e.disableServiceEndpoint)}};r(Im,"SettingsSwitch");Im.type="SettingsSwitch";var cs=Im;var Sm=class extends n{constructor(e){super(),this.title=new a(e.title),Reflect.has(e,"text")&&(this.text=new a(e.text).toString()),Reflect.has(e,"options")&&(this.options=l.parseArray(e.options,[cs,fi,zr,Wy,B_]))}};r(Sm,"SettingsOptions");Sm.type="SettingsOptions";var us=Sm;var Em=class extends n{constructor(e){super(),this.title=new a(e.title),this.items=l.parseArray(e.items,_i)}get contents(){return this.items}};r(Em,"SettingsSidebar");Em.type="SettingsSidebar";var Gy=Em;var km=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.content=new a(e.content),this.published=new a(e.publishedTimeText),this.menu=l.parseItem(e.actionMenu,R),this.original_post=l.parseItem(e.originalPost,[xi,as]),this.id=e.postId,this.endpoint=new h(e.navigationEndpoint),this.expand_button=l.parseItem(e.expandButton,v),this.author=new P(e.displayName,void 0)}};r(km,"SharedPost");km.type="SharedPost";var jy=km;var Cm=class extends n{constructor(e){super(),this.title=l.parseItem(e.title)}};r(Cm,"SharePanelHeader");Cm.type="SharePanelHeader";var Hy=Cm;var Pm=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(Pm,"SharePanelTitleV15");Pm.type="SharePanelTitleV15";var cS=Pm;var Nm=class extends n{constructor(e){super(),Reflect.has(e,"serviceEndpoint")?this.endpoint=new h(e.serviceEndpoint):Reflect.has(e,"navigationEndpoint")&&(this.endpoint=new h(e.navigationEndpoint)),this.service_name=e.serviceName,this.target_id=e.targetId,this.title=new a(e.title)}};r(Nm,"ShareTarget");Nm.type="ShareTarget";var $y=Nm;var Am=class extends n{constructor(e){super(),this.title=new a(e.title),Reflect.has(e,"endpoint")&&(this.endpoint=new h(e.endpoint)),this.content=l.parseItem(e.content),Reflect.has(e,"icon")&&(this.icon_type=e.icon.iconType),Reflect.has(e,"menu")&&(this.menu=l.parseItem(e.menu)),Reflect.has(e,"playAllButton")&&(this.play_all_button=l.parseItem(e.playAllButton,v)),Reflect.has(e,"subtitle")&&(this.subtitle=new a(e.subtitle))}};r(Am,"Shelf");Am.type="Shelf";var fs=Am;var Rm=class extends n{constructor(e){var i;super(),this.entity_id=e.entityId,this.accessibility_text=e.accessibilityText,this.thumbnail=y.fromResponse(e.thumbnail),this.on_tap_endpoint=new h(e.onTap),this.menu_on_tap=new h(e.menuOnTap),this.index_in_collection=e.indexInCollection,this.menu_on_tap_a11y_label=e.menuOnTapA11yLabel,this.overlay_metadata={primary_text:e.overlayMetadata.primaryText?a.fromAttributed(e.overlayMetadata.primaryText):void 0,secondary_text:e.overlayMetadata.secondaryText?a.fromAttributed(e.overlayMetadata.secondaryText):void 0},(i=e.inlinePlayerData)!=null&&i.onVisible&&(this.inline_player_data=new h(e.inlinePlayerData.onVisible)),e.badge&&(this.badge=l.parseItem(e.badge,yi))}};r(Rm,"ShortsLockupView");Rm.type="ShortsLockupView";var ms=Rm;var Mm=class extends n{constructor(e){super(),this.corrected_query=new a(e.correctedQuery),this.original_query=new a(e.originalQuery),this.corrected_query_endpoint=new h(e.correctedQueryEndpoint),this.original_query_endpoint=new h(e.originalQueryEndpoint),this.search_instead_for=new a(e.searchInsteadFor),this.showing_results_for=new a(e.showingResultsFor)}};r(Mm,"ShowingResultsFor");Mm.type="ShowingResultsFor";var uS=Mm;var Lm=class extends n{constructor(e){super(),this.image=y.fromResponse(e.image),this.title=new a(e.title),this.display_domain=new a(e.displayDomain),this.show_link_icon=e.showLinkIcon,this.call_to_action=new a(e.callToAction),this.endpoint=new h(e.command)}};r(Lm,"SimpleCardContent");Lm.type="SimpleCardContent";var fS=Lm;var Om=class extends n{constructor(e){super(),this.message=new a(e.message),this.prominent=e.prominent}};r(Om,"SimpleCardTeaser");Om.type="SimpleCardTeaser";var mS=Om;var Dm=class extends n{constructor(e){super(),this.lines=e.lines.map(i=>new a(i)),this.style=e.layoutStyle}};r(Dm,"SimpleTextSection");Dm.type="SimpleTextSection";var hS=Dm;var Bm=class extends n{constructor(e){super(),this.action_text=new a(e.actionText),this.nav_text=new a(e.navigationText),this.details=new a(e.detailsText),this.icon_type=e.icon.iconType,this.endpoint=new h(e.navigationEndpoint)}};r(Bm,"SingleActionEmergencySupport");Bm.type="SingleActionEmergencySupport";var dS=Bm;var Ym=class extends n{constructor(e){super(),this.title=e.title||"N/A",this.selected=!!e.selected,this.endpoint=new h(e.endpoint),this.content=l.parseItem(e.content,[de,xy,Ci])}};r(Ym,"Tab");Ym.type="Tab";var Ie=Ym;var Vm=class extends n{constructor(e){super(),this.tabs=l.parseArray(e.tabs,Ie)}};r(Vm,"SingleColumnBrowseResults");Vm.type="SingleColumnBrowseResults";var _S=Vm;var Um=class extends n{constructor(e){super(),this.contents=l.parse(e)}};r(Um,"SingleColumnMusicWatchNextResults");Um.type="SingleColumnMusicWatchNextResults";var xS=Um;var Fm=class extends n{constructor(e){super(),this.thumbnails=y.fromResponse(e.thumbnail),this.style=e.style}};r(Fm,"SingleHeroImage");Fm.type="SingleHeroImage";var yS=Fm;var Wm=class extends n{constructor(e){super(),this.thumbnail=y.fromResponse(e.thumbnail),this.title=new a(e.title),this.endpoint=new h(e.navigationEndpoint),this.subscribe_button=l.parseItem(e.subscribeButton,xe)}};r(Wm,"SlimOwner");Wm.type="SlimOwner";var bS=Wm;var Gm=class extends n{constructor(e){super(),this.title=new a(e.title),this.collapsed_subtitle=new a(e.collapsedSubtitle),this.expanded_subtitle=new a(e.expandedSubtitle),this.owner=l.parseItem(e.owner),this.description=new a(e.description),this.video_id=e.videoId,this.date=new a(e.dateText)}};r(Gm,"SlimVideoMetadata");Gm.type="SlimVideoMetadata";var gS=Gm;var jm=class extends n{constructor(e){super(),this.start_at_option_label=new a(e.startAtOptionLabel)}};r(jm,"StartAt");jm.type="StartAt";var Ky=jm;var Hm=class extends n{constructor(e){super(),this.name=new a(e.name),this.is_selected=e.isSelected,this.endpoint=new h(e.navigationEndpoint)}};r(Hm,"SubFeedOption");Hm.type="SubFeedOption";var qy=Hm;var $m=class extends n{constructor(e){super(),this.title=new a(e.title),this.options=l.parseArray(e.options,qy)}};r($m,"SubFeedSelector");$m.type="SubFeedSelector";var wS=$m;var Km=class extends n{constructor(e){super(),this.contents=l.parse(e)}};r(Km,"Tabbed");Km.type="Tabbed";var TS=Km;var qm=class extends n{constructor(e){super(),this.tabs=l.parseArray(e.tabs,Ie)}};r(qm,"TabbedSearchResults");qm.type="TabbedSearchResults";var vS=qm;var zm=class extends n{constructor(e){super(),this.title=new a(e.title),this.style=e.style}};r(zm,"TextHeader");zm.type="TextHeader";var IS=zm;var Qm=class extends n{constructor(e){super(),this.share_targets=l.parseArray(e.shareTargets,$y)}};r(Qm,"ThirdPartyShareTargetSection");Qm.type="ThirdPartyShareTargetSection";var zy=Qm;var Xm=class extends n{constructor(e){super(),this.landscape=y.fromResponse(e.landscape),this.portrait=y.fromResponse(e.portrait)}};r(Xm,"ThumbnailLandscapePortrait");Xm.type="ThumbnailLandscapePortrait";var SS=Xm;var Jm=class extends n{constructor(e){super(),this.text=new a(e.text).toString()}};r(Jm,"ThumbnailOverlayEndorsement");Jm.type="ThumbnailOverlayEndorsement";var ES=Jm;var Zm=class extends n{constructor(e){super(),this.text=new a(e.text),this.icon_type=e.icon.iconType}};r(Zm,"ThumbnailOverlayHoverText");Zm.type="ThumbnailOverlayHoverText";var kS=Zm;var eh=class extends n{constructor(e){super(),this.text=new a(e.text).toString(),this.icon_type=e.icon.iconType}};r(eh,"ThumbnailOverlayInlineUnplayable");eh.type="ThumbnailOverlayInlineUnplayable";var CS=eh;var th=class extends n{constructor(e){super(),this.text=new a(e.text)}};r(th,"ThumbnailOverlayLoadingPreview");th.type="ThumbnailOverlayLoadingPreview";var PS=th;var ih=class extends n{constructor(e){super(),this.text=new a(e.text).toString()}};r(ih,"ThumbnailOverlayNowPlaying");ih.type="ThumbnailOverlayNowPlaying";var NS=ih;var rh=class extends n{constructor(e){super(),this.hack=e.hack}};r(rh,"ThumbnailOverlayPinking");rh.type="ThumbnailOverlayPinking";var AS=rh;var sh=class extends n{constructor(e){super(),this.texts=e.texts.map(i=>new a(i))}};r(sh,"ThumbnailOverlayPlaybackStatus");sh.type="ThumbnailOverlayPlaybackStatus";var RS=sh;var oh=class extends n{constructor(e){super(),this.percent_duration_watched=e.percentDurationWatched}};r(oh,"ThumbnailOverlayResumePlayback");oh.type="ThumbnailOverlayResumePlayback";var MS=oh;var nh=class extends n{constructor(e){super(),this.text=new a(e.text),this.icon_type=e.icon.iconType}};r(nh,"ThumbnailOverlaySidePanel");nh.type="ThumbnailOverlaySidePanel";var LS=nh;var ah=class extends n{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 h(e.toggledServiceEndpoint)),e.untoggledServiceEndpoint&&(this.untoggled_endpoint=new h(e.untoggledServiceEndpoint))}};r(ah,"ThumbnailOverlayToggleButton");ah.type="ThumbnailOverlayToggleButton";var OS=ah;var ph=class extends n{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 a(e.label),this.icon=e.icon}};r(ph,"TimedMarkerDecoration");ph.type="TimedMarkerDecoration";var DS=ph;var lh=class extends n{constructor(e){super(),this.title=new a(e.title)}};r(lh,"TitleAndButtonListHeader");lh.type="TitleAndButtonListHeader";var BS=lh;var ch=class extends n{constructor(e){super(),this.text=new a(e.defaultText),this.toggled_text=new a(e.toggledText),this.icon_type=e.defaultIcon.iconType,this.toggled_icon_type=e.toggledIcon.iconType,this.default_endpoint=new h(e.defaultServiceEndpoint),this.toggled_endpoint=new h(e.toggledServiceEndpoint)}};r(ch,"ToggleMenuServiceItem");ch.type="ToggleMenuServiceItem";var YS=ch;var uh=class extends n{constructor(e){super(),this.promo_config={promo_id:e.promoConfig.promoId,impression_endpoints:e.promoConfig.impressionEndpoints.map(i=>new h(i)),accept:new h(e.promoConfig.acceptCommand),dismiss:new h(e.promoConfig.dismissCommand)},this.target_id=e.targetId,this.details=new a(e.detailsText),this.suggested_position=e.suggestedPosition.type,this.dismiss_stratedy=e.dismissStrategy.type,this.dwell_time_ms=parseInt(e.dwellTimeMs)}};r(uh,"Tooltip");uh.type="Tooltip";var VS=uh;var fh=class extends n{constructor(e){var i;super(),this.title=new a(e.title),this.avatar=y.fromResponse((i=e.thumbnail)!=null?i:e.avatar),this.subtitle=new a(e.subtitle),this.subscribe_button=l.parseItem(e.subscribeButton,xe),this.endpoint=new h(e.navigationEndpoint)}};r(fh,"TopicChannelDetails");fh.type="TopicChannelDetails";var US=fh;var mh=class extends n{constructor(e){super(),this.tabs=l.parse(e.tabs),this.secondary_contents=l.parse(e.secondaryContents)}};r(mh,"TwoColumnBrowseResults");mh.type="TwoColumnBrowseResults";var Mt=mh;var hh=class extends n{constructor(e){super(),this.primary_contents=l.parse(e.primaryContents),this.secondary_contents=l.parse(e.secondaryContents)}};r(hh,"TwoColumnSearchResults");hh.type="TwoColumnSearchResults";var Qy=hh;var Xy,Dg,dh=class extends n{constructor(e){var o,p,c,f,m;super(),Xy.add(this),this.results=l.parseArray((o=e.results)==null?void 0:o.results.contents),this.secondary_results=l.parseArray((p=e.secondaryResults)==null?void 0:p.secondaryResults.results),this.conversation_bar=l.parseItem(e==null?void 0:e.conversationBar);let i=(c=e.playlist)==null?void 0:c.playlist;i&&(this.playlist={id:i.playlistId,title:i.title,author:(f=i.shortBylineText)!=null&&f.simpleText?new a(i.shortBylineText):new P(i.longBylineText),contents:l.parseArray(i.contents),current_index:i.currentIndex,is_infinite:!!i.isInfinite,menu:l.parseItem(i.menu,R)});let s=(m=e.autoplay)==null?void 0:m.autoplay;s&&(this.autoplay={sets:s.sets.map(x=>u(this,Xy,"m",Dg).call(this,x))},s.modifiedSets&&(this.autoplay.modified_sets=s.modifiedSets.map(x=>u(this,Xy,"m",Dg).call(this,x))),s.countDownSecs&&(this.autoplay.count_down_secs=s.countDownSecs))}};r(dh,"TwoColumnWatchNextResults");Xy=new WeakSet,Dg=r(function(e){let i={autoplay_video:new h(e.autoplayVideo)};return e.nextButtonVideo&&(i.next_button_video=new h(e.nextButtonVideo)),i},"_TwoColumnWatchNextResults_parseAutoplaySet");dh.type="TwoColumnWatchNextResults";var Jy=dh;var _h=class extends n{constructor(e){if(super(),e.contents){let i=e.contents.find(s=>s.thirdPartyNetworkSection);i&&(this.third_party_network_section={share_target_container:l.parseItem(i.thirdPartyNetworkSection.shareTargetContainer,zy),copy_link_container:l.parseItem(i.thirdPartyNetworkSection.copyLinkContainer,zr),start_at_container:l.parseItem(i.thirdPartyNetworkSection.startAtContainer,Ky)})}this.header=l.parseItem(e.header,Hy),this.share_panel_version=e.sharePanelVersion,Reflect.has(e,"showLoadingSpinner")&&(this.show_loading_spinner=e.showLoadingSpinner)}};r(_h,"UnifiedSharePanel");_h.type="UnifiedSharePanel";var FS=_h;var xh=class extends n{constructor(e){super(),this.header=l.parseItem(e.header),this.call_to_action=l.parseItem(e.callToAction),this.sections=l.parseArray(e.sections),Reflect.has(e,"collapsedLabel")&&(this.collapsed_label=new a(e.collapsedLabel))}};r(xh,"UniversalWatchCard");xh.type="UniversalWatchCard";var Zy=xh;var yh=class extends n{constructor(e){super(),this.message_title=new a(e.dialogMessageTitle),this.message_text=new a(e.dialogMessageText),this.action_button=l.parseItem(e.actionButton,v),this.dismiss_button=l.parseItem(e.dismissButton,v),this.is_visible=e.isVisible}};r(yh,"UpsellDialog");yh.type="UpsellDialog";var WS=yh;var bh=class extends n{constructor(e){super(),this.items=l.parseArray(e.items),this.collapsed_item_count=e.collapsedItemCount,this.collapsed_state_button_text=new a(e.collapsedStateButtonText)}get contents(){return this.items}};r(bh,"VerticalList");bh.type="VerticalList";var GS=bh;var gh=class extends n{constructor(e){super(),this.items=l.parseArray(e.items),this.view_all_text=new a(e.viewAllText),this.view_all_endpoint=new h(e.viewAllEndpoint)}get contents(){return this.items}};r(gh,"VerticalWatchCardList");gh.type="VerticalWatchCardList";var jS=gh;var wh=class extends n{constructor(e){super(),this.title=new a(e.videoTitle),this.channel_name=new a(e.channelName),this.view_count=new a(e.viewCountText),this.video_thumbnails=y.fromResponse(e.videoThumbnail),this.duration=new a(e.lengthString),this.endpoint=new h(e.action)}};r(wh,"VideoInfoCardContent");wh.type="VideoInfoCardContent";var HS=wh;var Th=class extends n{constructor(e){super(),this.carousel_titles=l.parse(e.carouselTitles,!0,L_),this.carousel_items=l.parse(e.carouselItems,!0,M_)}};r(Th,"VideoMetadataCarouselView");Th.type="VideoMetadataCarouselView";var $S=Th;var vh=class extends n{constructor(e){super(),this.subscription_button=e.subscriptionButton,this.subscriber_count=new a(e.subscriberCountText),this.author=new P({...e.title,navigationEndpoint:e.navigationEndpoint},e.badges,e.thumbnail)}};r(vh,"VideoOwner");vh.type="VideoOwner";var hs=vh;var Ih=class extends n{constructor(e){super(),this.original_view_count=e.originalViewCount,this.short_view_count=new a(e.shortViewCount),this.extra_short_view_count=new a(e.extraShortViewCount),this.view_count=new a(e.viewCount)}};r(Ih,"VideoViewCount");Ih.type="VideoViewCount";var eb=Ih;var Sh=class extends n{constructor(e){super(),this.title=new a(e.title),Reflect.has(e,"superTitleLink")&&(this.super_title_link=new a(e.superTitleLink)),this.view_count=l.parseItem(e.viewCount,eb),this.badges=l.parseArray(e.badges,Fe),this.published=new a(e.dateText),this.relative_date=new a(e.relativeDateText),this.menu=l.parseItem(e.videoActions,R)}};r(Sh,"VideoPrimaryInfo");Sh.type="VideoPrimaryInfo";var tb=Sh;var Eh=class extends n{constructor(e){super(),this.owner=l.parseItem(e.owner,hs),this.description=new a(e.description),Reflect.has(e,"attributedDescription")&&(this.description=a.fromAttributed(e.attributedDescription)),this.subscribe_button=l.parseItem(e.subscribeButton,[xe,v]),this.metadata=l.parseItem(e.metadataRowContainer,ny),this.show_more_text=new a(e.showMoreText),this.show_less_text=new a(e.showLessText),this.default_expanded=e.defaultExpanded,this.description_collapsed_lines=e.descriptionCollapsedLines}};r(Eh,"VideoSecondaryInfo");Eh.type="VideoSecondaryInfo";var kh=Eh;var Ch=class extends n{constructor(e){super(),this.title=new a(e.title),this.subtitle=new a(e.subtitle),this.duration={text:new a(e.lengthText).toString(),seconds:_e(e.lengthText.simpleText)},this.style=e.style}};r(Ch,"WatchCardCompactVideo");Ch.type="WatchCardCompactVideo";var ib=Ch;var Ph=class extends n{constructor(e){var i;super(),this.endpoint=new h(e.navigationEndpoint),this.call_to_action_button=l.parseItem(e.callToActionButton),this.hero_image=l.parseItem(e.heroImage),this.label=((i=e.lengthText)==null?void 0:i.accessibility.accessibilityData.label)||""}};r(Ph,"WatchCardHeroVideo");Ph.type="WatchCardHeroVideo";var KS=Ph;var Nh=class extends n{constructor(e){super(),this.title=new a(e.title),this.title_endpoint=new h(e.titleNavigationEndpoint),this.subtitle=new a(e.subtitle),this.author=new P(e,e.titleBadge?[e.titleBadge]:null,e.avatar),this.author.name=this.title.toString(),this.style=e.style}};r(Nh,"WatchCardRichHeader");Nh.type="WatchCardRichHeader";var qS=Nh;var Ah=class extends n{constructor(e){super(),this.lists=l.parseArray(e.lists)}};r(Ah,"WatchCardSectionSequence");Ah.type="WatchCardSectionSequence";var zS=Ah;var Rh=class extends Mt{constructor(e){super(e)}};r(Rh,"WatchNextTabbedResults");Rh.type="WatchNextTabbedResults";var QS=Rh;var Mh=class extends n{constructor(e){var i,s;super(),this.title=e.title,this.content=l.parseItem(e.content,de),this.endpoint=new h(e.navigationEndpoint),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType}};r(Mh,"AnchoredSection");Mh.type="AnchoredSection";var rb=Mh;var Lh,Oh=class extends n{constructor(e){super(),Lh.set(this,void 0),this.child_display_name=new a(e.childDisplayName),this.child_account_description=new a(e.childAccountDescription),this.avatar=y.fromResponse(e.avatar),this.block_button=l.parseItem(e.blockButton,[se]),this.blocked_entity_key=e.blockedEntityKey}async blockChannel(){if(!u(this,Lh,"f"))throw new g("An active caller must be provide to perform this operation.");let e=this.block_button;if(!e)throw new g("Block button was not found.",{child_display_name:this.child_display_name});if(e.is_toggled)throw new g("This channel is already blocked.",{child_display_name:this.child_display_name});return await e.endpoint.call(u(this,Lh,"f"),{parse:!1})}setActions(e){I(this,Lh,e,"f")}};r(Oh,"KidsBlocklistPickerItem");Lh=new WeakMap;Oh.type="KidsBlocklistPickerItem";var sb=Oh;var Dh=class extends n{constructor(e){super(),this.title=new a(e.title),this.child_rows=l.parse(e.childRows,!0,[sb]),this.done_button=l.parseItem(e.doneButton,[v]),this.successful_toast_action_message=new a(e.successfulToastActionMessage)}};r(Dh,"KidsBlocklistPicker");Dh.type="KidsBlocklistPicker";var XS=Dh;var Bh=class extends n{constructor(e){var i,s;super(),this.title=new a(e.title),this.category_assets={asset_key:(i=e.categoryAssets)==null?void 0:i.assetKey,background_color:(s=e.categoryAssets)==null?void 0:s.backgroundColor},this.category_type=e.categoryType,this.endpoint=new h(e.endpoint)}};r(Bh,"KidsCategoryTab");Bh.type="KidsCategoryTab";var ob=Bh;var Yh=class extends n{constructor(e){super(),this.category_tabs=l.parseArray(e.categoryTabs,ob),this.privacy_button=l.parseItem(e.privacyButtonRenderer,v)}};r(Yh,"KidsCategoriesHeader");Yh.type="kidsCategoriesHeader";var JS=Yh;var Vh=class extends n{constructor(e){super(),this.anchors=l.parseArray(e.anchors,rb)}};r(Vh,"KidsHomeScreen");Vh.type="kidsHomeScreen";var ZS=Vh;var Gg={};qe(Gg,{camelToSnake:()=>mr,createRuntimeClass:()=>lE,generateRuntimeClass:()=>Fh,generateTypescriptClass:()=>ab,inferType:()=>nb,introspect:()=>Vg,isArrayType:()=>aE,isIgnoredKey:()=>pE,isMiscType:()=>nE,isRenderer:()=>Yg,isRendererList:()=>oE,mergeKeyInfo:()=>Uh,parse:()=>Wg,toParser:()=>Fg,toTypeDeclaration:()=>Ug});var A1=new Set(["trackingParams","accessibility","accessibilityData"]),Bg={};function mr(t){return t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}r(mr,"camelToSnake");function nb(t,e){let i=!1;if(typeof e=="object"&&e!=null){if(i=Yg(e))return Bg[i]=Reflect.get(e,Reflect.ownKeys(e)[0]),{type:"renderer",renderers:[i],optional:!1};if(i=oE(e)){for(let[o,p]of Object.entries(i))Bg[o]=p;return{type:"array",array_type:"renderer",renderers:Object.keys(i),optional:!1}}if((i=nE(t,e))||(i=aE(e)))return i}let s=typeof e;return s==="object"?{type:"object",keys:Object.entries(e).map(([o,p])=>[o,nb(o,p)]),optional:!1}:{type:"primitive",typeof:[s],optional:!1}}r(nb,"inferType");function oE(t){let e=Array.isArray(t);return e&&t.length===0?!1:e&&t.every(s=>Yg(s))?Object.fromEntries(t.map(s=>{let o=Reflect.ownKeys(s)[0].toString();return[_s(o),s[o]]})):!1}r(oE,"isRendererList");function nE(t,e){if(typeof e=="object"&&e!==null){if(t.endsWith("Endpoint")||t.endsWith("Command")||t==="endpoint")return{type:"misc",endpoint:new h(e),optional:!1,misc_type:"NavigationEndpoint"};if(Reflect.has(e,"simpleText")||Reflect.has(e,"runs")){let i=new a(e);return{type:"misc",misc_type:"Text",optional:!1,endpoint:i.endpoint,text:i.toString()}}if(Reflect.has(e,"thumbnails")&&Array.isArray(Reflect.get(e,"thumbnails")))return{type:"misc",misc_type:"Thumbnail",optional:!1}}return!1}r(nE,"isMiscType");function Yg(t){if(!(typeof t=="object"))return!1;let i=Reflect.ownKeys(t);if(i.length===1){let s=i[0].toString();if(s.endsWith("Renderer")||s.endsWith("Model"))return _s(s)}return!1}r(Yg,"isRenderer");function aE(t){if(!Array.isArray(t))return!1;if(t.length===0)return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["never"],optional:!1},optional:!1};let e=t.map(p=>typeof p);if(!e.every(p=>p===e[0]))return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!1},optional:!1};let s=e[0];if(s!=="object")return{type:"array",array_type:"primitive",items:{type:"primitive",typeof:[s],optional:!1},optional:!1};let o=[];for(let p=0;p[f,nb(f,m)]);if(p===0){o=c;continue}o=Uh(o,c).resolved_key_info}return{type:"array",array_type:"object",items:{type:"object",keys:o,optional:!1},optional:!1}}r(aE,"isArrayType");function R1(t){if(typeof t!="object"||t===null)throw new g("Generator: Cannot introspect non-object",{classdata:t});return Reflect.ownKeys(t).filter(i=>!pE(i)).filter(i=>typeof i=="string").map(i=>{let s=Reflect.get(t,i),o=nb(i,s);return[i,o]})}r(R1,"introspectKeysFirstPass");function M1(t){var c;let i=t.filter(([,f])=>{var m;return f.type!=="misc"||!(f.misc_type==="NavigationEndpoint"||f.misc_type==="Text")?!1:((m=f.endpoint)==null?void 0:m.metadata.page_type)==="WEB_PAGE_TYPE_CHANNEL"}).sort(([,f],[,m])=>f.type!=="misc"||m.type!=="misc"||f.misc_type!=="Text"||m.misc_type!=="Text"?0:m.text.length-f.text.length),s=new Set,o=i[0],p;if(o){s.add(o[0]);let m=t.map(([w])=>w).filter(w=>w.endsWith("Badges")||w==="badges"),_=(c=m.filter(w=>w.startsWith("owner")||w.startsWith("author"))[0])!=null?c:m[0],b=t.find(([w])=>w===_),T=b?b[1].type==="array"&&b[1].array_type==="renderer"&&Reflect.has(b[1].renderers,"MetadataBadge"):!1;T&&_&&s.add(_),p={type:"misc",misc_type:"Author",optional:!1,params:[o[0],T?_:void 0]}}return p&&t.push(["author",p]),t.filter(([f])=>!s.has(f))}r(M1,"introspectKeysSecondPass");function L1(t){let e=R1(t);return M1(e)}r(L1,"introspect2");function Vg(t){let e=L1(t),i=new Map;for(let[,o]of e)if(o.type==="renderer"||o.type==="array"&&o.array_type==="renderer")for(let p of o.renderers){let c=Bg[p];c&&i.set(p,c)}let s=Array.from(i).filter(([o])=>!Wh(o));return{key_info:e,unimplemented_dependencies:s}}r(Vg,"introspect");function pE(t){return typeof t=="string"&&A1.has(t)}r(pE,"isIgnoredKey");function lE(t,e,i){var s,o;i({error_type:"class_not_found",classname:t,key_info:e});let p=(s=r(class extends n{static set key_info(c){I(this,s,new Map(c),"f",o)}static get key_info(){return[...u(this,s,"f",o).entries()]}constructor(c){super();let{key_info:f,unimplemented_dependencies:m}=Vg(c),{resolved_key_info:x,changed_keys:_}=Uh(p.key_info,f);_.length>0&&(p.key_info=x,i({error_type:"class_changed",classname:t,key_info:p.key_info,changed_keys:_}));for(let[T,w]of m)Fh(T,w,i);for(let[T,w]of f){let S=mr(T);w.type==="misc"&&w.misc_type==="NavigationEndpoint"&&(S="endpoint"),Reflect.set(this,S,Wg(T,w,c))}}},"_a"),Fw(s,"node"),s.type=t,o={value:new Map},s);return p.key_info=e,Object.defineProperty(p,"name",{value:t,writable:!1}),p}r(lE,"createRuntimeClass");function Fh(t,e,i){let{key_info:s,unimplemented_dependencies:o}=Vg(e),p=lE(t,s,i);jg(t,p);for(let[c,f]of o)Fh(c,f,i);return p}r(Fh,"generateRuntimeClass");function ab(t,e){let i=[],s=["super();"];for(let[o,p]of e){let c=mr(o);p.type==="misc"&&p.misc_type==="NavigationEndpoint"&&(c="endpoint"),i.push(`${c}${p.optional?"?":""}: ${Ug(p)};`),s.push(`this.${c} = ${Fg(o,p)};`)}return`class ${t} extends YTNode { static type = '${t}'; ${i.join(` @@ -16,35 +16,35 @@ format:`,m)}}else(l=Ee(t.mime_type,'codecs="','"'))!=null&&l.startsWith("avc1")& `)} } } -`}r(eb,"generateTypescriptClass");function FS(t,e){return`{ -${e.map(([i,s])=>`${" ".repeat((t+2)*2)}${_r(i)}${s.optional?"?":""}: ${Mg(s,t+1)}`).join(`, +`}r(ab,"generateTypescriptClass");function eE(t,e){return`{ +${e.map(([i,s])=>`${" ".repeat((t+2)*2)}${mr(i)}${s.optional?"?":""}: ${Ug(s,t+1)}`).join(`, `)} -${" ".repeat((t+1)*2)}}`}r(FS,"toTypeDeclarationObject");function Mg(t,e=0){switch(t.type){case"renderer":return`${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")} | null`;case"array":switch(t.array_type){case"renderer":return`ObservedArray<${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")}> | null`;case"primitive":{let i=t.items.typeof;return t.items.optional&&!i.includes("undefined")&&i.push("undefined"),`${i.length===1?`${i[0]}`:`(${i.join(" | ")})`}[]`}case"object":return`${FS(e,t.items.keys)}[]`;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return FS(e,t.keys);case"misc":switch(t.misc_type){case"Thumbnail":return"Thumbnail[]";default:return t.misc_type}case"primitive":return t.typeof.join(" | ")}}r(Mg,"toTypeDeclaration");function WS(t,e,i,s){let o=[...i,s];return`{ -${e.map(([a,l])=>`${" ".repeat((t+2)*2)}${_r(a)}: ${Lg(a,l,o,t+1)}`).join(`, +${" ".repeat((t+1)*2)}}`}r(eE,"toTypeDeclarationObject");function Ug(t,e=0){switch(t.type){case"renderer":return`${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")} | null`;case"array":switch(t.array_type){case"renderer":return`ObservedArray<${t.renderers.map(i=>`YTNodes.${i}`).join(" | ")}> | null`;case"primitive":{let i=t.items.typeof;return t.items.optional&&!i.includes("undefined")&&i.push("undefined"),`${i.length===1?`${i[0]}`:`(${i.join(" | ")})`}[]`}case"object":return`${eE(e,t.items.keys)}[]`;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return eE(e,t.keys);case"misc":switch(t.misc_type){case"Thumbnail":return"Thumbnail[]";default:return t.misc_type}case"primitive":return t.typeof.join(" | ")}}r(Ug,"toTypeDeclaration");function tE(t,e,i,s){let o=[...i,s];return`{ +${e.map(([p,c])=>`${" ".repeat((t+2)*2)}${mr(p)}: ${Fg(p,c,o,t+1)}`).join(`, `)} -${" ".repeat((t+1)*2)}}`}r(WS,"toParserObject");function Lg(t,e,i=["data"],s=1){let o="undefined";switch(e.type){case"renderer":o=`Parser.parseItem(${i.join(".")}.${t}, ${GS(e.renderers)})`;break;case"array":switch(e.array_type){case"renderer":o=`Parser.parse(${i.join(".")}.${t}, true, ${GS(e.renderers)})`;break;case"object":o=`${i.join(".")}.${t}.map((item: any) => (${WS(s,e.items.keys,[],"item")}))`;break;case"primitive":o=`${i.join(".")}.${t}`;break;default:throw new Error("Unreachable code reached! Switch missing case!")}break;case"object":o=WS(s,e.keys,i,t);break;case"misc":switch(e.misc_type){case"Thumbnail":o=`Thumbnail.fromResponse(${i.join(".")}.${t})`;break;case"Author":{let a=`new Author(${i.join(".")}.${e.params[0]}, ${e.params[1]?`${i.join(".")}.${e.params[1]}`:"undefined"})`;return e.optional?`Reflect.has(${i.join(".")}, '${e.params[0]}') ? ${a} : undefined`:a}default:o=`new ${e.misc_type}(${i.join(".")}.${t})`;break}if(o==="undefined")throw new Error("Unreachable code reached! Switch missing case!");break;case"primitive":o=`${i.join(".")}.${t}`;break}return e.optional?`Reflect.has(${i.join(".")}, '${t}') ? ${o} : undefined`:o}r(Lg,"toParser");function GS(t){return t.length===1?`YTNodes.${t[0]}`:`[ ${t.map(e=>`YTNodes.${e}`).join(", ")} ]`}r(GS,"toParserValidTypes");function Dt(t,e){let i=t;for(let s of e)i=i[s];return i}r(Dt,"accessDataFromKeyPath");function jS(t,e){let i=t;for(let s of e)if(Reflect.has(i,s))i=i[s];else return!1;return!0}r(jS,"hasDataFromKeyPath");function HS(t,e,i,s,o){let a={},l=[...i,t];for(let[f,m]of s)a[f]=o?Og(f,m,e,l):void 0;return a}r(HS,"parseObject");function Og(t,e,i,s=["data"]){let o=!e.optional||jS({data:i},[...s,t]);switch(e.type){case"renderer":return o?q(Dt({data:i},[...s,t]),e.renderers.map(a=>xs(a))):void 0;case"array":switch(e.array_type){case"renderer":return o?De(Dt({data:i},[...s,t]),!0,e.renderers.map(a=>xs(a))):void 0;case"object":return o?Dt({data:i},[...s,t]).map((a,l)=>HS(`${l}`,i,[...s,t],e.items.keys,o)):void 0;case"primitive":return o?Dt({data:i},[...s,t]):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return HS(t,i,s,e.keys,o);case"misc":switch(e.misc_type){case"NavigationEndpoint":return o?new d(Dt({data:i},[...s,t])):void 0;case"Text":return o?new p(Dt({data:i},[...s,t])):void 0;case"Thumbnail":return o?y.fromResponse(Dt({data:i},[...s,t])):void 0;case"Author":return!e.optional||jS({data:i},[...s,e.params[0]])?new P(Dt({data:i},[...s,e.params[0]]),e.params[1]?Dt({data:i},[...s,e.params[1]]):void 0):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"primitive":return Dt({data:i},[...s,t])}}r(Og,"parse");function Lh(t,e){let i=new Map,s=new Set(t.map(([T])=>T)),o=new Set(e.map(([T])=>T)),a=e.filter(([T])=>!s.has(T)),l=t.filter(([T])=>!o.has(T)),f=t.filter(([T])=>o.has(T)),m=new Map(e);for(let[T,w]of f){let S=m.get(T);if(!!S){if(w.type!==S.type){i.set(T,{type:"primitive",typeof:["unknown"],optional:!0});continue}switch(w.type){case"object":{if(S.type!=="object")continue;let{resolved_key_info:E}=Lh(w.keys,S.keys),C={type:"object",keys:E,optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"renderer":{if(S.type!=="renderer")continue;let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"array":{if(S.type!=="array")continue;switch(w.array_type){case"renderer":{if(S.array_type!=="renderer"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"array",array_type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"object":{if(S.array_type==="primitive"&&S.items.typeof.length==1&&S.items.typeof[0]==="never")continue;if(S.array_type!=="object"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let{resolved_key_info:E}=Lh(w.items.keys,S.items.keys),C={type:"array",array_type:"object",items:{type:"object",keys:E,optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"primitive":{if(w.items.typeof.includes("never")&&S.array_type==="object"){i.set(T,S);continue}if(S.array_type!=="primitive"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E=new Set([...S.items.typeof,...w.items.typeof]);E.size>1&&E.has("never")&&E.delete("never");let C={type:"array",array_type:"primitive",items:{type:"primitive",typeof:Array.from(E),optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;default:throw new Error("Unreachable code reached! Switch missing case!")}break}case"misc":{if(S.type!=="misc")continue;switch(w.misc_type!==S.misc_type&&i.set(T,{type:"primitive",typeof:["unknown"],optional:!0}),w.misc_type){case"Author":{if(S.misc_type!=="Author")break;let E=w.params[1]||S.params[1],C=w.optional||S.optional,k={type:"misc",misc_type:"Author",optional:C,params:[S.params[0],E]};JSON.stringify(k)!==JSON.stringify(w)&&i.set(T,k)}break}}break;case"primitive":{if(S.type!=="primitive")continue;let E={type:"primitive",typeof:Array.from(new Set([...S.typeof,...w.typeof])),optional:w.optional||S.optional};JSON.stringify(E)!==JSON.stringify(w)&&i.set(T,E)}break}}}for(let[T,w]of a)i.set(T,{...w,optional:!0});for(let[T,w]of l)i.set(T,{...w,optional:!0});let x=t.filter(([T])=>!i.has(T));return{resolved_key_info:[...new Map([...x,...i]).entries()],changed_keys:[...i.entries()]}}r(Lh,"mergeKeyInfo");var bs=class extends n{constructor(e){var i,s,o;super(),this.contents=Ce(e.contents),Array.isArray(e.continuations)&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(bs,"ItemSectionContinuation");bs.type="itemSectionContinuation";var Ai=class extends n{constructor(e){super(),this.endpoint=new d(e.endpoint)}};r(Ai,"NavigateAction");Ai.type="navigateAction";var gs=class extends n{constructor(e){super(),this.miniplayer_command=new d(e.miniplayerCommand),this.show_premium_branding=e.showPremiumBranding}};r(gs,"ShowMiniplayerCommand");gs.type="showMiniplayerCommand";var Ri=class extends n{constructor(e){super(),this.target_id=e.targetId,this.contents=De(e.continuationItems,!0),this.slot=e==null?void 0:e.slot}};r(Ri,"ReloadContinuationItemsCommand");Ri.type="reloadContinuationItemsCommand";var ws=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.contents=De(e.contents,!0),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.reloadContinuationData)==null?void 0:f.continuation)||null}};r(ws,"SectionListContinuation");ws.type="sectionListContinuation";var Ts=class extends n{constructor(e){var i;super(),this.contents=De(e.contents,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}};r(Ts,"MusicPlaylistShelfContinuation");Ts.type="musicPlaylistShelfContinuation";var vs=class extends n{constructor(e){var i,s,o,a;super(),this.contents=Ce(e.contents),this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((a=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:a.continuation)||null}};r(vs,"MusicShelfContinuation");vs.type="musicShelfContinuation";var Is=class extends n{constructor(e){var i;super(),this.items=De(e.items,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}get contents(){return this.items}};r(Is,"GridContinuation");Is.type="gridContinuation";var Ss=class extends n{constructor(e){var i,s,o,a,l,f;super(),this.contents=Ce(e.contents),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(l=(a=e.continuations)==null?void 0:a[0])==null?void 0:l.nextRadioContinuationData)==null?void 0:f.continuation)||null}};r(Ss,"PlaylistPanelContinuation");Ss.type="playlistPanelContinuation";var xr=class extends n{constructor(e){var i,s,o;super(),this.continuation_type=e.type,this.timeout_ms=(i=e.continuation)==null?void 0:i.timeoutMs,this.time_until_last_message_ms=(s=e.continuation)==null?void 0:s.timeUntilLastMessageMsec,this.token=(o=e.continuation)==null?void 0:o.continuation}};r(xr,"Continuation");xr.type="continuation";var Mi=class extends n{constructor(e){var o,a,l,f,m,x,_,b;super(),this.actions=De((o=e.actions)==null?void 0:o.map(T=>(delete T.clickTrackingParams,T)),!0)||G([]),this.action_panel=q(e.actionPanel),this.item_list=q(e.itemList,Gx),this.header=q(e.header,Wx),this.participants_list=q(e.participantsList,Hx),this.popout_message=q(e.popoutMessage,ki),this.emojis=((a=e.emojis)==null?void 0:a.map(T=>({emoji_id:T.emojiId,shortcuts:T.shortcuts,search_terms:T.searchTerms,image:y.fromResponse(T.image),is_custom_emoji:T.isCustomEmoji})))||[];let i,s;(l=e.continuations)!=null&&l[0].timedContinuationData?(s="timed",i=(f=e.continuations)==null?void 0:f[0].timedContinuationData):(m=e.continuations)!=null&&m[0].invalidationContinuationData?(s="invalidation",i=(x=e.continuations)==null?void 0:x[0].invalidationContinuationData):(_=e.continuations)!=null&&_[0].liveChatReplayContinuationData&&(s="replay",i=(b=e.continuations)==null?void 0:b[0].liveChatReplayContinuationData),this.continuation=new xr({continuation:i,type:s}),this.viewer_name=e.viewerName}};r(Mi,"LiveChatContinuation");Mi.type="liveChatContinuation";var ti=class extends n{constructor(e){super(),this.request=e.request,this.token=e.token}};r(ti,"ContinuationCommand");ti.type="ContinuationCommand";var tb,ib=class{constructor(e,i){var s,o,a,l,f,m,x,_;if(tb.set(this,void 0),i&&I(this,tb,i,"f"),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=(s=e.stereoLayout)==null?void 0:s.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=(o=e.spatialAudioType)==null?void 0:o.replace("SPATIAL_AUDIO_TYPE_","")),Reflect.has(e,"maxDvrDurationSec")&&(this.max_dvr_duration_sec=e.maxDvrDurationSec),Reflect.has(e,"targetDurationSec")&&(this.target_duration_dec=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:(a=e.colorInfo.primaries)==null?void 0:a.replace("COLOR_PRIMARIES_",""),transfer_characteristics:(l=e.colorInfo.transferCharacteristics)==null?void 0:l.replace("COLOR_TRANSFER_CHARACTERISTICS_",""),matrix_coefficients:(f=e.colorInfo.matrixCoefficients)==null?void 0:f.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}),this.has_audio||this.has_text){let b=new URLSearchParams(this.cipher||this.signature_cipher),w=(m=new URLSearchParams(b.get("url")||this.url).get("xtags"))==null?void 0:m.split(":");if(this.language=((x=w==null?void 0:w.find(S=>S.startsWith("lang=")))==null?void 0:x.split("=")[1])||null,this.has_audio){this.is_drc=!!e.isDrc||!!(w!=null&&w.includes("drc=1"));let S=(_=w==null?void 0:w.find(E=>E.startsWith("acont=")))==null?void 0:_.split("=")[1];this.is_dubbed=S==="dubbed",this.is_descriptive=S==="descriptive",this.is_secondary=S==="secondary",this.is_auto_dubbed=S==="dubbed-auto",this.is_original=S==="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)}}async decipher(e){return e?e.decipher(this.url,this.signature_cipher,this.cipher,u(this,tb,"f")):this.url||""}};r(ib,"Format");tb=new WeakMap;var rb=ib;var Li=class{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=y.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}};r(Li,"VideoDetails");var yr="Parser",v1=new Set(["AdSlot","DisplayAd","SearchPyv","MealbarPromo","PrimetimePromo","BackgroundPromo","PromotedSparklesWeb","CompactPromotedVideo","BrandVideoShelf","BrandVideoSingleton","StatementBanner","GuideSigninPromo","AdsEngagementPanelContent","MiniGameCardView"]),Fg=new Map(Object.entries(mr)),QS=new Map,br=null,ii=r(({classname:t,...e})=>{switch(e.error_type){case"parse":e.error instanceof Error&&O.warn(yr,new g(`Something went wrong at ${t}! -This is a bug, please report it at ${M.shim.info.bugs_url}`,{stack:e.error.stack,classdata:JSON.stringify(e.classdata,null,2)}));break;case"typecheck":O.warn(yr,new Qe(`Type mismatch, got ${t} expected ${Array.isArray(e.expected)?e.expected.join(" | "):e.expected}.`,e.classdata));break;case"mutation_data_missing":O.warn(yr,new g(`Mutation data required for processing ${t}, but none found. -This is a bug, please report it at ${M.shim.info.bugs_url}`));break;case"mutation_data_invalid":O.warn(yr,new g(`Mutation data missing or invalid for ${e.failed} out of ${e.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${e.titles.join(", ")}. -This is a bug, please report it at ${M.shim.info.bugs_url}`));break;case"class_not_found":O.warn(yr,new g(`${t} not found! -This is a bug, want to help us fix it? Follow the instructions at ${M.shim.info.repo_url}/blob/main/docs/updating-the-parser.md or report it at ${M.shim.info.bugs_url}! +${" ".repeat((t+1)*2)}}`}r(tE,"toParserObject");function Fg(t,e,i=["data"],s=1){let o="undefined";switch(e.type){case"renderer":o=`Parser.parseItem(${i.join(".")}.${t}, ${iE(e.renderers)})`;break;case"array":switch(e.array_type){case"renderer":o=`Parser.parse(${i.join(".")}.${t}, true, ${iE(e.renderers)})`;break;case"object":o=`${i.join(".")}.${t}.map((item: any) => (${tE(s,e.items.keys,[],"item")}))`;break;case"primitive":o=`${i.join(".")}.${t}`;break;default:throw new Error("Unreachable code reached! Switch missing case!")}break;case"object":o=tE(s,e.keys,i,t);break;case"misc":switch(e.misc_type){case"Thumbnail":o=`Thumbnail.fromResponse(${i.join(".")}.${t})`;break;case"Author":{let p=`new Author(${i.join(".")}.${e.params[0]}, ${e.params[1]?`${i.join(".")}.${e.params[1]}`:"undefined"})`;return e.optional?`Reflect.has(${i.join(".")}, '${e.params[0]}') ? ${p} : undefined`:p}default:o=`new ${e.misc_type}(${i.join(".")}.${t})`;break}if(o==="undefined")throw new Error("Unreachable code reached! Switch missing case!");break;case"primitive":o=`${i.join(".")}.${t}`;break}return e.optional?`Reflect.has(${i.join(".")}, '${t}') ? ${o} : undefined`:o}r(Fg,"toParser");function iE(t){return t.length===1?`YTNodes.${t[0]}`:`[ ${t.map(e=>`YTNodes.${e}`).join(", ")} ]`}r(iE,"toParserValidTypes");function Lt(t,e){let i=t;for(let s of e)i=i[s];return i}r(Lt,"accessDataFromKeyPath");function rE(t,e){let i=t;for(let s of e)if(Reflect.has(i,s))i=i[s];else return!1;return!0}r(rE,"hasDataFromKeyPath");function sE(t,e,i,s,o){let p={},c=[...i,t];for(let[f,m]of s)p[f]=o?Wg(f,m,e,c):void 0;return p}r(sE,"parseObject");function Wg(t,e,i,s=["data"]){let o=!e.optional||rE({data:i},[...s,t]);switch(e.type){case"renderer":return o?q(Lt({data:i},[...s,t]),e.renderers.map(p=>ds(p))):void 0;case"array":switch(e.array_type){case"renderer":return o?Me(Lt({data:i},[...s,t]),!0,e.renderers.map(p=>ds(p))):void 0;case"object":return o?Lt({data:i},[...s,t]).map((p,c)=>sE(`${c}`,i,[...s,t],e.items.keys,o)):void 0;case"primitive":return o?Lt({data:i},[...s,t]):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"object":return sE(t,i,s,e.keys,o);case"misc":switch(e.misc_type){case"NavigationEndpoint":return o?new h(Lt({data:i},[...s,t])):void 0;case"Text":return o?new a(Lt({data:i},[...s,t])):void 0;case"Thumbnail":return o?y.fromResponse(Lt({data:i},[...s,t])):void 0;case"Author":return!e.optional||rE({data:i},[...s,e.params[0]])?new P(Lt({data:i},[...s,e.params[0]]),e.params[1]?Lt({data:i},[...s,e.params[1]]):void 0):void 0;default:throw new Error("Unreachable code reached! Switch missing case!")}case"primitive":return Lt({data:i},[...s,t])}}r(Wg,"parse");function Uh(t,e){let i=new Map,s=new Set(t.map(([T])=>T)),o=new Set(e.map(([T])=>T)),p=e.filter(([T])=>!s.has(T)),c=t.filter(([T])=>!o.has(T)),f=t.filter(([T])=>o.has(T)),m=new Map(e);for(let[T,w]of f){let S=m.get(T);if(!!S){if(w.type!==S.type){i.set(T,{type:"primitive",typeof:["unknown"],optional:!0});continue}switch(w.type){case"object":{if(S.type!=="object")continue;let{resolved_key_info:E}=Uh(w.keys,S.keys),C={type:"object",keys:E,optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"renderer":{if(S.type!=="renderer")continue;let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"array":{if(S.type!=="array")continue;switch(w.array_type){case"renderer":{if(S.array_type!=="renderer"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E={...w.renderers,...S.renderers},C=w.optional||S.optional,k={type:"array",array_type:"renderer",renderers:E,optional:C};JSON.stringify({...k,renderers:Object.keys(k.renderers)})!==JSON.stringify({...w,renderers:Object.keys(w.renderers)})&&i.set(T,k)}break;case"object":{if(S.array_type==="primitive"&&S.items.typeof.length==1&&S.items.typeof[0]==="never")continue;if(S.array_type!=="object"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let{resolved_key_info:E}=Uh(w.items.keys,S.items.keys),C={type:"array",array_type:"object",items:{type:"object",keys:E,optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;case"primitive":{if(w.items.typeof.includes("never")&&S.array_type==="object"){i.set(T,S);continue}if(S.array_type!=="primitive"){i.set(T,{type:"array",array_type:"primitive",items:{type:"primitive",typeof:["unknown"],optional:!0},optional:!0});continue}let E=new Set([...S.items.typeof,...w.items.typeof]);E.size>1&&E.has("never")&&E.delete("never");let C={type:"array",array_type:"primitive",items:{type:"primitive",typeof:Array.from(E),optional:w.items.optional||S.items.optional},optional:w.optional||S.optional};JSON.stringify(C)!==JSON.stringify(w)&&i.set(T,C)}break;default:throw new Error("Unreachable code reached! Switch missing case!")}break}case"misc":{if(S.type!=="misc")continue;switch(w.misc_type!==S.misc_type&&i.set(T,{type:"primitive",typeof:["unknown"],optional:!0}),w.misc_type){case"Author":{if(S.misc_type!=="Author")break;let E=w.params[1]||S.params[1],C=w.optional||S.optional,k={type:"misc",misc_type:"Author",optional:C,params:[S.params[0],E]};JSON.stringify(k)!==JSON.stringify(w)&&i.set(T,k)}break}}break;case"primitive":{if(S.type!=="primitive")continue;let E={type:"primitive",typeof:Array.from(new Set([...S.typeof,...w.typeof])),optional:w.optional||S.optional};JSON.stringify(E)!==JSON.stringify(w)&&i.set(T,E)}break}}}for(let[T,w]of p)i.set(T,{...w,optional:!0});for(let[T,w]of c)i.set(T,{...w,optional:!0});let x=t.filter(([T])=>!i.has(T));return{resolved_key_info:[...new Map([...x,...i]).entries()],changed_keys:[...i.entries()]}}r(Uh,"mergeKeyInfo");var xs=class extends n{constructor(e){var i,s,o;super(),this.contents=Ee(e.contents),Array.isArray(e.continuations)&&(this.continuation=(o=(s=(i=e.continuations)==null?void 0:i.at(0))==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)}};r(xs,"ItemSectionContinuation");xs.type="itemSectionContinuation";var Pi=class extends n{constructor(e){super(),this.endpoint=new h(e.endpoint)}};r(Pi,"NavigateAction");Pi.type="navigateAction";var ys=class extends n{constructor(e){super(),this.miniplayer_command=new h(e.miniplayerCommand),this.show_premium_branding=e.showPremiumBranding}};r(ys,"ShowMiniplayerCommand");ys.type="showMiniplayerCommand";var Ni=class extends n{constructor(e){super(),this.target_id=e.targetId,this.contents=Me(e.continuationItems,!0),this.slot=e==null?void 0:e.slot}};r(Ni,"ReloadContinuationItemsCommand");Ni.type="reloadContinuationItemsCommand";var bs=class extends n{constructor(e){var i,s,o,p,c,f;super(),this.contents=Me(e.contents,!0),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(c=(p=e.continuations)==null?void 0:p[0])==null?void 0:c.reloadContinuationData)==null?void 0:f.continuation)||null}};r(bs,"SectionListContinuation");bs.type="sectionListContinuation";var gs=class extends n{constructor(e){var i;super(),this.contents=Me(e.contents,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}};r(gs,"MusicPlaylistShelfContinuation");gs.type="musicPlaylistShelfContinuation";var ws=class extends n{constructor(e){var i,s,o,p;super(),this.contents=Ee(e.contents),this.continuation=((s=(i=e.continuations)==null?void 0:i[0].nextContinuationData)==null?void 0:s.continuation)||((p=(o=e.continuations)==null?void 0:o[0].reloadContinuationData)==null?void 0:p.continuation)||null}};r(ws,"MusicShelfContinuation");ws.type="musicShelfContinuation";var Ts=class extends n{constructor(e){var i;super(),this.items=Me(e.items,!0),this.continuation=((i=e.continuations)==null?void 0:i[0].nextContinuationData.continuation)||null}get contents(){return this.items}};r(Ts,"GridContinuation");Ts.type="gridContinuation";var vs=class extends n{constructor(e){var i,s,o,p,c,f;super(),this.contents=Ee(e.contents),this.continuation=((o=(s=(i=e.continuations)==null?void 0:i[0])==null?void 0:s.nextContinuationData)==null?void 0:o.continuation)||((f=(c=(p=e.continuations)==null?void 0:p[0])==null?void 0:c.nextRadioContinuationData)==null?void 0:f.continuation)||null}};r(vs,"PlaylistPanelContinuation");vs.type="playlistPanelContinuation";var hr=class extends n{constructor(e){var i,s,o;super(),this.continuation_type=e.type,this.timeout_ms=(i=e.continuation)==null?void 0:i.timeoutMs,this.time_until_last_message_ms=(s=e.continuation)==null?void 0:s.timeUntilLastMessageMsec,this.token=(o=e.continuation)==null?void 0:o.continuation}};r(hr,"Continuation");hr.type="continuation";var Ai=class extends n{constructor(e){var o,p,c,f,m,x,_,b;super(),this.actions=Me((o=e.actions)==null?void 0:o.map(T=>(delete T.clickTrackingParams,T)),!0)||G([]),this.action_panel=q(e.actionPanel),this.item_list=q(e.itemList,Qx),this.header=q(e.header,zx),this.participants_list=q(e.participantsList,Jx),this.popout_message=q(e.popoutMessage,Si),this.emojis=((p=e.emojis)==null?void 0:p.map(T=>({emoji_id:T.emojiId,shortcuts:T.shortcuts,search_terms:T.searchTerms,image:y.fromResponse(T.image),is_custom_emoji:T.isCustomEmoji})))||[];let i,s;(c=e.continuations)!=null&&c[0].timedContinuationData?(s="timed",i=(f=e.continuations)==null?void 0:f[0].timedContinuationData):(m=e.continuations)!=null&&m[0].invalidationContinuationData?(s="invalidation",i=(x=e.continuations)==null?void 0:x[0].invalidationContinuationData):(_=e.continuations)!=null&&_[0].liveChatReplayContinuationData&&(s="replay",i=(b=e.continuations)==null?void 0:b[0].liveChatReplayContinuationData),this.continuation=new hr({continuation:i,type:s}),this.viewer_name=e.viewerName}};r(Ai,"LiveChatContinuation");Ai.type="liveChatContinuation";var Zt=class extends n{constructor(e){super(),this.request=e.request,this.token=e.token}};r(Zt,"ContinuationCommand");Zt.type="ContinuationCommand";var pb,lb=class{constructor(e,i){var s,o,p,c,f,m,x,_;if(pb.set(this,void 0),i&&I(this,pb,i,"f"),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=(s=e.stereoLayout)==null?void 0:s.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=(o=e.spatialAudioType)==null?void 0:o.replace("SPATIAL_AUDIO_TYPE_","")),Reflect.has(e,"maxDvrDurationSec")&&(this.max_dvr_duration_sec=e.maxDvrDurationSec),Reflect.has(e,"targetDurationSec")&&(this.target_duration_dec=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:(p=e.colorInfo.primaries)==null?void 0:p.replace("COLOR_PRIMARIES_",""),transfer_characteristics:(c=e.colorInfo.transferCharacteristics)==null?void 0:c.replace("COLOR_TRANSFER_CHARACTERISTICS_",""),matrix_coefficients:(f=e.colorInfo.matrixCoefficients)==null?void 0:f.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}),this.has_audio||this.has_text){let b=new URLSearchParams(this.cipher||this.signature_cipher),w=(m=new URLSearchParams(b.get("url")||this.url).get("xtags"))==null?void 0:m.split(":");if(this.language=((x=w==null?void 0:w.find(S=>S.startsWith("lang=")))==null?void 0:x.split("=")[1])||null,this.has_audio){this.is_drc=!!e.isDrc||!!(w!=null&&w.includes("drc=1"));let S=(_=w==null?void 0:w.find(E=>E.startsWith("acont=")))==null?void 0:_.split("=")[1];this.is_dubbed=S==="dubbed",this.is_descriptive=S==="descriptive",this.is_secondary=S==="secondary",this.is_auto_dubbed=S==="dubbed-auto",this.is_original=S==="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)}}async decipher(e){return e?e.decipher(this.url,this.signature_cipher,this.cipher,u(this,pb,"f")):this.url||""}};r(lb,"Format");pb=new WeakMap;var cb=lb;var Ri=class{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=y.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}};r(Ri,"VideoDetails");var dr="Parser",O1=new Set(["AdSlot","DisplayAd","SearchPyv","MealbarPromo","PrimetimePromo","PromotedSparklesWeb","CompactPromotedVideo","BrandVideoShelf","BrandVideoSingleton","StatementBanner","GuideSigninPromo","AdsEngagementPanelContent","MiniGameCardView"]),qg=new Map(Object.entries(cr)),cE=new Map,_r=null,ei=r(({classname:t,...e})=>{switch(e.error_type){case"parse":e.error instanceof Error&&D.warn(dr,new g(`Something went wrong at ${t}! +This is a bug, please report it at ${L.shim.info.bugs_url}`,{stack:e.error.stack,classdata:JSON.stringify(e.classdata,null,2)}));break;case"typecheck":D.warn(dr,new ze(`Type mismatch, got ${t} expected ${Array.isArray(e.expected)?e.expected.join(" | "):e.expected}.`,e.classdata));break;case"mutation_data_missing":D.warn(dr,new g(`Mutation data required for processing ${t}, but none found. +This is a bug, please report it at ${L.shim.info.bugs_url}`));break;case"mutation_data_invalid":D.warn(dr,new g(`Mutation data missing or invalid for ${e.failed} out of ${e.total} MusicMultiSelectMenuItems. The titles of the failed items are: ${e.titles.join(", ")}. +This is a bug, please report it at ${L.shim.info.bugs_url}`));break;case"class_not_found":D.warn(dr,new g(`${t} not found! +This is a bug, want to help us fix it? Follow the instructions at ${L.shim.info.repo_url}/blob/main/docs/updating-the-parser.md or report it at ${L.shim.info.bugs_url}! Introspected and JIT generated this class in the meantime: -${eb(t,e.key_info)}`));break;case"class_changed":O.warn(yr,`${t} changed! -The following keys where altered: ${e.changed_keys.map(([i])=>_r(i)).join(", ")} +${ab(t,e.key_info)}`));break;case"class_changed":D.warn(dr,`${t} changed! +The following keys where altered: ${e.changed_keys.map(([i])=>mr(i)).join(", ")} The class has changed to: -${eb(t,e.key_info)}`);break;default:O.warn(yr,"Unreachable code reached at ParserErrorHandler");break}},"ERROR_HANDLER");function I1(t){ii=t}r(I1,"setParserErrorHandler");function Bt(){br=null}r(Bt,"_clearMemo");function Yt(){br=new ui}r(Yt,"_createMemo");function S1(t,e){if(!br)return;let i=br.get(t);if(!i)return br.set(t,[e]);i.push(e)}r(S1,"_addToMemo");function Vt(){if(!br)throw new Error("Parser#getMemo() called before Parser#createMemo()");return br}r(Vt,"_getMemo");function Wg(t){return v1.has(t)}r(Wg,"shouldIgnore");function ys(t){return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/Renderer|Model/g,"").replace(/Radio/g,"Mix").trim()}r(ys,"sanitizeClassName");function xs(t){let e=Fg.get(t);if(!e){let i=new Error(`Module not found: ${t}`);throw i.code="MODULE_NOT_FOUND",i}return e}r(xs,"getParserByName");function Dh(t){return Fg.has(t)}r(Dh,"hasParser");function Bg(t,e){Fg.set(t,e),QS.set(t,e)}r(Bg,"addRuntimeParser");function E1(){return Object.fromEntries(QS)}r(E1,"getDynamicParsers");function Yg(t){var xw,yw,bw,gw,ww,Tw,vw,Iw,Sw,Ew,kw,Cw,Pw,Nw,Aw,Rw;let e={};Yt();let i=De(t.contents),s=Vt();i&&(e.contents=i,e.contents_memo=s),Bt(),Yt();let o=t.onResponseReceivedActions?sb(t.onResponseReceivedActions):null,a=Vt();o&&(e.on_response_received_actions=o,e.on_response_received_actions_memo=a),Bt(),Yt();let l=t.onResponseReceivedEndpoints?sb(t.onResponseReceivedEndpoints):null,f=Vt();l&&(e.on_response_received_endpoints=l,e.on_response_received_endpoints_memo=f),Bt(),Yt();let m=t.onResponseReceivedCommands?sb(t.onResponseReceivedCommands):null,x=Vt();m&&(e.on_response_received_commands=m,e.on_response_received_commands_memo=x),Bt(),Yt();let _=t.continuationContents?Vg(t.continuationContents):null,b=Vt();_&&(e.continuation_contents=_,e.continuation_contents_memo=b),Bt(),Yt();let T=t.actions?eE(t.actions):null,w=Vt();T&&(e.actions=T,e.actions_memo=w),Bt(),Yt();let S=t.liveChatItemContextMenuSupportedRenderers?q(t.liveChatItemContextMenuSupportedRenderers):null,E=Vt();S&&(e.live_chat_item_context_menu_supported_renderers=S,e.live_chat_item_context_menu_supported_renderers_memo=E),Bt(),Yt();let C=t.header?De(t.header):null,k=Vt();C&&(e.header=C,e.header_memo=k),Bt(),Yt();let U=t.sidebar?q(t.sidebar):null,L=Vt();U&&(e.sidebar=U,e.sidebar_memo=L),Bt(),Yt();let K=De(t.items);K&&(e.items=K,e.items_memo=Vt()),Bt(),tE(s,(yw=(xw=t.frameworkUpdates)==null?void 0:xw.entityBatchUpdate)==null?void 0:yw.mutations),f&&iE(f,(gw=(bw=t.frameworkUpdates)==null?void 0:bw.entityBatchUpdate)==null?void 0:gw.mutations);let re=t.continuation?ZS(t.continuation):null;re&&(e.continuation=re);let he=t.continuationEndpoint?Vg(t.continuationEndpoint):null;he&&(e.continuation_endpoint=he);let Y=De(t.metadata);Y&&(e.metadata=Y);let te=q(t.microformat);te&&(e.microformat=te);let F=q(t.overlay);F&&(e.overlay=F);let B=Ce(t.alerts,[Br,Vd]);B.length&&(e.alerts=B);let X=t.refinements;X&&(e.refinements=X);let Z=t.estimatedResults?parseInt(t.estimatedResults):null;Z&&(e.estimated_results=Z);let Ue=De(t.playerOverlays);Ue&&(e.player_overlays=Ue);let ut=q(t.background,Ie);ut&&(e.background=ut);let ft=t.playbackTracking?{videostats_watchtime_url:t.playbackTracking.videostatsWatchtimeUrl.baseUrl,videostats_playback_url:t.playbackTracking.videostatsPlaybackUrl.baseUrl}:null;ft&&(e.playback_tracking=ft);let mt=t.playabilityStatus?{status:t.playabilityStatus.status,reason:t.playabilityStatus.reason||"",embeddable:!!t.playabilityStatus.playableInEmbed||!1,audio_only_playablility:q(t.playabilityStatus.audioOnlyPlayability,Fd),error_screen:q(t.playabilityStatus.errorScreen)}:null;if(mt&&(e.playability_status=mt),t.streamingData){let ad=new Map;e.streaming_data={expires:new Date(Date.now()+parseInt(t.streamingData.expiresInSeconds)*1e3),formats:Ug(t.streamingData.formats,ad),adaptive_formats:Ug(t.streamingData.adaptiveFormats,ad),dash_manifest_url:t.streamingData.dashManifestUrl,hls_manifest_url:t.streamingData.hlsManifestUrl,server_abr_streaming_url:t.streamingData.serverAbrStreamingUrl}}t.playerConfig&&(e.player_config={audio_config:{loudness_db:(ww=t.playerConfig.audioConfig)==null?void 0:ww.loudnessDb,perceptual_loudness_db:(Tw=t.playerConfig.audioConfig)==null?void 0:Tw.perceptualLoudnessDb,enable_per_format_loudness:(vw=t.playerConfig.audioConfig)==null?void 0:vw.enablePerFormatLoudness},stream_selection_config:{max_bitrate:((Iw=t.playerConfig.streamSelectionConfig)==null?void 0:Iw.maxBitrate)||"0"},media_common_config:{dynamic_readahead_config:{max_read_ahead_media_time_ms:((Ew=(Sw=t.playerConfig.mediaCommonConfig)==null?void 0:Sw.dynamicReadaheadConfig)==null?void 0:Ew.maxReadAheadMediaTimeMs)||0,min_read_ahead_media_time_ms:((Cw=(kw=t.playerConfig.mediaCommonConfig)==null?void 0:kw.dynamicReadaheadConfig)==null?void 0:Cw.minReadAheadMediaTimeMs)||0,read_ahead_growth_rate_ms:((Nw=(Pw=t.playerConfig.mediaCommonConfig)==null?void 0:Pw.dynamicReadaheadConfig)==null?void 0:Nw.readAheadGrowthRateMs)||0},media_ustreamer_request_config:{video_playback_ustreamer_config:(Rw=(Aw=t.playerConfig.mediaCommonConfig)==null?void 0:Aw.mediaUstreamerRequestConfig)==null?void 0:Rw.videoPlaybackUstreamerConfig}}});let Fe=t.currentVideoEndpoint?new d(t.currentVideoEndpoint):null;Fe&&(e.current_video_endpoint=Fe);let li=t.endpoint?new d(t.endpoint):null;li&&(e.endpoint=li);let jt=q(t.captions,xy);jt&&(e.captions=jt);let ae=t.videoDetails?new Li(t.videoDetails):null;ae&&(e.video_details=ae);let ze=Ce(t.annotations,_y);ze.length&&(e.annotations=ze);let pe=q(t.storyboards,[Qi,gy]);pe&&(e.storyboards=pe);let Ae=q(t.endscreen,cx);Ae&&(e.endscreen=Ae);let tt=q(t.cards,S_);tt&&(e.cards=tt);let oe=Ce(t.engagementPanels,Ii);return oe.length&&(e.engagement_panels=oe),t.playerResponse&&(e.player_response=Yg(t.playerResponse)),t.watchNextResponse&&(e.watch_next_response=Yg(t.watchNextResponse)),t.cpnInfo&&(e.cpn_info={cpn:t.cpnInfo.cpn,cpn_source:t.cpnInfo.cpnSource}),t.entries&&(e.entries=t.entries.map(ad=>new d(ad))),e}r(Yg,"parseResponse");function q(t,e){if(!t)return null;let i=Object.keys(t);if(!i.length)return null;let s=ys(i[0]);if(!Wg(s))try{let a=Dh(s)?xs(s):Oh(s,t[i[0]],ii);if(e){if(Array.isArray(e)){if(!e.some(f=>f.type===a.type))return ii({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.map(f=>f.type)}),null}else if(a.type!==e.type)return ii({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.type}),null}let l=new a(t[i[0]]);return S1(s,l),l}catch(o){return ii({classname:s,classdata:t[i[0]],error:o,error_type:"parse"}),null}return null}r(q,"parseItem");function Ce(t,e){if(Array.isArray(t)){let i=[];for(let s of t){let o=q(s,e);o&&i.push(o)}return G(i)}else if(!t)return G([]);throw new Qe("Expected array but got a single item")}r(Ce,"parseArray");function De(t,e,i){if(!t)return null;if(Array.isArray(t)){let s=[];for(let a of t){let l=q(a,i);l&&s.push(l)}let o=G(s);return e?o:new Nt(o)}else if(e)throw new Qe("Expected array but got a single item");return new Nt(q(t,i))}r(De,"parse");var k1=/Command$/,C1=/Endpoint$/,P1=/Action$/;function JS(t){let e=[];try{e=Object.keys(t)}catch{}for(let i of e){let s=t[i];if(k1.test(i)||C1.test(i)||P1.test(i)){let o=ys(i);if(Wg(o))return;try{if(Dh(o))return new(xs(o))(s)}catch(a){ii({error:a,classname:o,classdata:s,error_type:"parse"})}}}}r(JS,"parseCommand");function N1(t){if(Array.isArray(t)){let e=[];for(let i of t){let s=JS(i);s&&e.push(s)}return G(e)}else if(!t)return G([]);throw new Qe("Expected array but got a single item")}r(N1,"parseCommands");function ZS(t){return t.timedContinuationData?new xr({continuation:t.timedContinuationData,type:"timed"}):null}r(ZS,"parseC");function Vg(t){return t.itemSectionContinuation?new bs(t.itemSectionContinuation):t.sectionListContinuation?new ws(t.sectionListContinuation):t.liveChatContinuation?new Mi(t.liveChatContinuation):t.musicPlaylistShelfContinuation?new Ts(t.musicPlaylistShelfContinuation):t.musicShelfContinuation?new vs(t.musicShelfContinuation):t.gridContinuation?new Is(t.gridContinuation):t.playlistPanelContinuation?new Ss(t.playlistPanelContinuation):t.continuationCommand?new ti(t.continuationCommand):null}r(Vg,"parseLC");function sb(t){return G(t.map(e=>{if(e.navigateAction)return new Ai(e.navigateAction);if(e.showMiniplayerCommand)return new gs(e.showMiniplayerCommand);if(e.reloadContinuationItemsCommand)return new Ri(e.reloadContinuationItemsCommand);if(e.appendContinuationItemsAction)return new er(e.appendContinuationItemsAction)}).filter(e=>e))}r(sb,"parseRR");function eE(t){return Array.isArray(t)?De(t.map(e=>(delete e.clickTrackingParams,e))):new Nt(q(t))}r(eE,"parseActions");function Ug(t,e){return(t==null?void 0:t.map(i=>new rb(i,e)))||[]}r(Ug,"parseFormats");function tE(t,e){let i=t.getType(ss);if(i.length>0&&!e)ii({error_type:"mutation_data_missing",classname:"MusicMultiSelectMenuItem"});else{let s=[];for(let o of i){let a=e.find(f=>{var m,x;return((x=(m=f.payload)==null?void 0:m.musicFormBooleanChoice)==null?void 0:x.id)===o.form_item_entity_key}),l=a==null?void 0:a.payload.musicFormBooleanChoice;(l==null?void 0:l.selected)!==void 0&&(l==null?void 0:l.opaqueToken)?o.selected=l.selected:s.push(`'${o.title}'`)}s.length>0&&ii({error_type:"mutation_data_invalid",classname:"MusicMultiSelectMenuItem",total:i.length,failed:s.length,titles:s})}}r(tE,"applyMutations");function iE(t,e){var s,o,a,l,f,m;let i=t.getType(or);if(i.length>0){e||ii({error_type:"mutation_data_missing",classname:"CommentView"});for(let x of i){let _=(o=(s=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.commentEntityPayload)==null?void 0:E.key)===x.keys.comment}))==null?void 0:s.payload)==null?void 0:o.commentEntityPayload,b=(l=(a=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.engagementToolbarStateEntityPayload)==null?void 0:E.key)===x.keys.toolbar_state}))==null?void 0:a.payload)==null?void 0:l.engagementToolbarStateEntityPayload,T=(m=(f=e.find(w=>w.entityKey===x.keys.toolbar_surface))==null?void 0:f.payload)==null?void 0:m.engagementToolbarSurfaceEntityPayload;x.applyMutations(_,b,T)}}}r(iE,"applyCommentsMutations");var qg={};Xe(qg,{AccountInfo:()=>rE,Channel:()=>ge,ChannelListContinuation:()=>Ir,Comments:()=>oE,FilteredChannelList:()=>Yi,Guide:()=>nE,HashtagFeed:()=>Vi,History:()=>Ft,HomeFeed:()=>ri,ItemMenu:()=>hb,Library:()=>pE,LiveChat:()=>vb,NotificationsMenu:()=>lE,Playlist:()=>Os,Search:()=>ni,Settings:()=>uE,SmoothedQueue:()=>bb,TranscriptInfo:()=>cb,VideoInfo:()=>Kh});var Es,ob=class{constructor(e){if(Es.set(this,void 0),I(this,Es,c.parseResponse(e.data),"f"),!u(this,Es,"f").contents)throw new g("Page contents not found");let i=u(this,Es,"f").contents.array().as(Cd).first();if(!i)throw new g("Account section list not found");this.contents=i.contents.first()}get page(){return u(this,Es,"f")}};r(ob,"AccountInfo");Es=new WeakMap;var rE=ob;var Bh,Pe,Yh,He,gr,sE,Gg,Oi=class{constructor(e,i,s=!1){Bh.add(this),Pe.set(this,void 0),Yh.set(this,void 0),He.set(this,void 0),gr.set(this,void 0),u(this,Bh,"m",sE).call(this,i)||s?I(this,Pe,i,"f"):I(this,Pe,c.parseResponse(i.data),"f");let o=jg(u(this,Pe,"f").contents_memo,u(this,Pe,"f").continuation_contents_memo,u(this,Pe,"f").on_response_received_commands_memo,u(this,Pe,"f").on_response_received_endpoints_memo,u(this,Pe,"f").on_response_received_actions_memo,u(this,Pe,"f").sidebar_memo,u(this,Pe,"f").header_memo);if(!o)throw new g("No memo found in feed");I(this,He,o,"f"),I(this,Yh,e,"f")}static getVideosFromMemo(e){return e.getType(Wr,yx,ls,ds,Gr,ps,ei,zy)}static getPlaylistsFromMemo(e){let i=e.getType(Rt,dx),s=e.getType(Kx).filter(o=>["PLAYLIST","ALBUM","PODCAST"].includes(o.content_type));return s.length>0&&i.push(...s),i}get videos(){return Oi.getVideosFromMemo(u(this,He,"f"))}get posts(){return u(this,He,"f").getType(bi,cs,By)}get channels(){return u(this,He,"f").getType(k_,hx)}get playlists(){return Oi.getPlaylistsFromMemo(u(this,He,"f"))}get memo(){return u(this,He,"f")}get page_contents(){var o;let e=(o=u(this,He,"f").getType(Se))==null?void 0:o.first().content,i=u(this,He,"f").getType(Ri).first(),s=u(this,He,"f").getType(er).first();return e||i||s}get shelves(){return u(this,He,"f").getType(hs,Ay,Hr)}getShelf(e){return this.shelves.get({title:e})}get secondary_contents(){var i,s;if(!((i=u(this,Pe,"f").contents)!=null&&i.is_node))return;let e=(s=u(this,Pe,"f").contents)==null?void 0:s.item();if(!!e.is(Ot,Gy))return e.secondary_contents}get actions(){return u(this,Yh,"f")}get page(){return u(this,Pe,"f")}get has_continuation(){return u(this,Bh,"m",Gg).call(this).length>0}async getContinuationData(){if(u(this,gr,"f")){if(u(this,gr,"f").length===0)throw new g("There are no continuations.");return await u(this,gr,"f")[0].endpoint.call(u(this,Yh,"f"),{parse:!0})}if(I(this,gr,u(this,Bh,"m",Gg).call(this),"f"),u(this,gr,"f"))return this.getContinuationData()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Oi(this.actions,e,!0)}};r(Oi,"Feed");Pe=new WeakMap,Yh=new WeakMap,He=new WeakMap,gr=new WeakMap,Bh=new WeakSet,sE=r(function(e){return!("data"in e)},"_Feed_isParsed"),Gg=r(function(){if(u(this,Pe,"f").header_memo){let e=u(this,Pe,"f").header_memo.getType(J);return u(this,He,"f").getType(J).filter(i=>!e.includes(i))}return u(this,He,"f").getType(J)},"_Feed_getBodyContinuations");var be=Oi;var ks,nb=class extends be{constructor(e,i,s=!1){super(e,i,s),ks.set(this,void 0)}get filter_chips(){var e,i;if(u(this,ks,"f"))return u(this,ks,"f")||[];if(((e=this.memo.getType(vt))==null?void 0:e.length)>1)throw new g("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page");if(((i=this.memo.getType(vt))==null?void 0:i.length)===0)throw new g("There are no feed filter chipbars");return I(this,ks,this.memo.getType(je),"f"),u(this,ks,"f")||[]}get filters(){return this.filter_chips.map(e=>e.text.toString())||[]}async getFilteredFeed(e){var o;let i;if(typeof e=="string"){if(!this.filters.includes(e))throw new g("Filter not found",{available_filters:this.filters});i=this.filter_chips.find(a=>a.text.toString()===e)}else if(e.type==="ChipCloudChip")i=e;else throw new g("Invalid filter");if(!i)throw new g("Filter not found");if(i.is_selected)return this;let s=await((o=i.endpoint)==null?void 0:o.call(this.actions,{parse:!0}));if(!s)throw new g("Failed to get filtered feed");return new be(this.actions,s,!0)}};r(nb,"FilterableFeed");ks=new WeakMap;var Di=nb;var Hg={};Xe(Hg,{Feed:()=>be,FilterableFeed:()=>Di,MediaInfo:()=>Ps,TabbedFeed:()=>Vh});var Bi,St,Cs,ab,pb=class{constructor(e,i,s){var l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X;Bi.set(this,void 0),St.set(this,void 0),Cs.set(this,void 0),ab.set(this,void 0),I(this,St,i,"f");let o=c.parseResponse(e[0].data.playerResponse?e[0].data.playerResponse:e[0].data),a=(l=e[1])!=null&&l.data?c.parseResponse(e[1].data):void 0;if(I(this,Bi,[o,a],"f"),I(this,Cs,s,"f"),((f=o.playability_status)==null?void 0:f.status)==="ERROR")throw new g("This video is unavailable",o.playability_status);if(o.microformat&&!((m=o.microformat)!=null&&m.is(et,Ci)))throw new g("Unsupported microformat",o.microformat);this.basic_info={...o.video_details,embed:(x=o.microformat)!=null&&x.is(et)?(_=o.microformat)==null?void 0:_.embed:null,channel:(b=o.microformat)!=null&&b.is(et)?(T=o.microformat)==null?void 0:T.channel:null,is_unlisted:(w=o.microformat)==null?void 0:w.is_unlisted,is_family_safe:(S=o.microformat)==null?void 0:S.is_family_safe,category:(E=o.microformat)!=null&&E.is(et)?(C=o.microformat)==null?void 0:C.category:null,has_ypc_metadata:(k=o.microformat)!=null&&k.is(et)?(U=o.microformat)==null?void 0:U.has_ypc_metadata:null,start_timestamp:(L=o.microformat)!=null&&L.is(et)?o.microformat.start_timestamp:null,end_timestamp:(K=o.microformat)!=null&&K.is(et)?o.microformat.end_timestamp:null,view_count:((re=o.microformat)==null?void 0:re.is(et))&&isNaN((he=o.video_details)==null?void 0:he.view_count)?o.microformat.view_count:(Y=o.video_details)==null?void 0:Y.view_count,url_canonical:(te=o.microformat)!=null&&te.is(Ci)?(F=o.microformat)==null?void 0:F.url_canonical:null,tags:(B=o.microformat)!=null&&B.is(Ci)?(X=o.microformat)==null?void 0:X.tags:null,like_count:void 0,is_liked:void 0,is_disliked:void 0},this.annotations=o.annotations,this.storyboards=o.storyboards,this.endscreen=o.endscreen,this.captions=o.captions,this.cards=o.cards,this.streaming_data=o.streaming_data,this.playability_status=o.playability_status,this.player_config=o.player_config,I(this,ab,o.playback_tracking,"f")}async toDash(e,i,s={include_thumbnails:!1}){var f,m;let o=u(this,Bi,"f")[0];if(o.video_details&&o.video_details.is_live)throw new g("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 a,l;return s.include_thumbnails&&o.storyboards&&(a=o.storyboards),typeof s.captions_format=="string"&&((f=o.captions)==null?void 0:f.caption_tracks)&&(l=o.captions.caption_tracks),Ji.toDash(this.streaming_data,(m=this.page[0].video_details)==null?void 0:m.is_post_live_dvr,e,i,u(this,Cs,"f"),u(this,St,"f").session.player,u(this,St,"f"),a,l,s)}getStreamingInfo(e,i){var s;return fd(this.streaming_data,(s=this.page[0].video_details)==null?void 0:s.is_post_live_dvr,e,i,this.cpn,u(this,St,"f").session.player,u(this,St,"f"),u(this,Bi,"f")[0].storyboards?u(this,Bi,"f")[0].storyboards:void 0)}chooseFormat(e){return Ji.chooseFormat(e,this.streaming_data)}async download(e={}){let i=u(this,Bi,"f")[0];if(i.video_details&&(i.video_details.is_live||i.video_details.is_post_live_dvr))throw new g("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 Ji.download(e,u(this,St,"f"),this.playability_status,this.streaming_data,u(this,St,"f").session.player,this.cpn)}async getTranscript(){var a;let e=this.page[1];if(!e)throw new g("Cannot get transcript from basic video info.");if(!e.engagement_panels)throw new g("Engagement panels not found. Video likely has no transcript.");let i=e.engagement_panels.get({panel_identifier:"engagement-panel-searchable-transcript"});if(!i)throw new g("Transcript panel not found. Video likely has no transcript.");let s=(a=i.content)==null?void 0:a.as(J);if(!s)throw new g("Transcript continuation not found.");let o=await s.endpoint.call(this.actions);return new cb(this.actions,o)}async addToWatchHistory(e={}){var m;let i=z.CLIENTS.WEB.NAME,s=z.CLIENTS.WEB.VERSION,o="https://www.",a=(e==null?void 0:e.url)||((m=u(this,ab,"f"))==null?void 0:m.videostats_playback_url);if(!a)throw new g("Playback tracking not available");let l={cpn:u(this,Cs,"f"),fmt:251,rtn:0,rt:0},f=a.replace("https://s.",o);return await u(this,St,"f").stats(f,{client_name:i,client_version:s,visitor_data:e==null?void 0:e.visitor_data},l)}get actions(){return u(this,St,"f")}get cpn(){return u(this,Cs,"f")}get page(){return u(this,Bi,"f")}};r(pb,"MediaInfo");Bi=new WeakMap,St=new WeakMap,Cs=new WeakMap,ab=new WeakMap;var Ps=pb;var wr,Tr,vr=class extends be{constructor(e,i,s=!1){var o;super(e,i,s),wr.set(this,void 0),Tr.set(this,void 0),I(this,wr,e,"f"),I(this,Tr,(o=this.page.contents_memo)==null?void 0:o.getType(Se),"f")}get tabs(){var e,i;return(i=(e=u(this,Tr,"f"))==null?void 0:e.map(s=>s.title.toString()))!=null?i:[]}async getTabByName(e){var o;let i=(o=u(this,Tr,"f"))==null?void 0:o.find(a=>a.title.toLowerCase()===e.toLowerCase());if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,wr,"f"));return new vr(u(this,wr,"f"),s,!1)}async getTabByURL(e){var o;let i=(o=u(this,Tr,"f"))==null?void 0:o.find(a=>{var l;return((l=a.endpoint.metadata.url)==null?void 0:l.split("/").pop())===e});if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,wr,"f"));return new vr(u(this,wr,"f"),s,!1)}hasTabWithURL(e){var i,s;return(s=(i=u(this,Tr,"f"))==null?void 0:i.some(o=>{var a;return((a=o.endpoint.metadata.url)==null?void 0:a.split("/").pop())===e}))!=null?s:!1}get title(){var e,i,s;return(s=(i=(e=this.page.contents_memo)==null?void 0:e.getType(Se))==null?void 0:i.find(o=>o.selected))==null?void 0:s.title.toString()}};r(vr,"TabbedFeed");wr=new WeakMap,Tr=new WeakMap;var Vh=vr;var ge=class extends Vh{constructor(e,i,s=!1){var l,f,m,x,_;super(e,i,s),this.header=(f=(l=this.page.header)==null?void 0:l.item())==null?void 0:f.as($r,E_,Ex,Lt);let o=(m=this.page.metadata)==null?void 0:m.item().as(C_),a=(x=this.page.microformat)==null?void 0:x.as(Ci);if(this.page.alerts){let b=this.page.alerts.first();if((b==null?void 0:b.alert_type)==="ERROR")throw new Ns(b.text.toString())}if(!o&&!this.page.contents)throw new g("Invalid channel",this);this.metadata={...o,...a||{}},this.subscribe_button=(_=this.page.header_memo)==null?void 0:_.getType(xe).first(),this.page.contents&&(this.current_tab=this.page.contents.item().as(Ot).tabs.array().filterType(Se,es).get({selected:!0}))}async applyFilter(e){let i,s=this.memo.getType(vt).first();if(typeof e=="string"){if(i=s==null?void 0:s.contents.get({text:e}),!i)throw new g(`Filter ${e} not found`,{available_filters:this.filters})}else i=e;if(!i.endpoint)throw new g("Invalid filter",e);let o=await i.endpoint.call(this.actions,{parse:!0});if(!o)throw new g("No page returned",{filter:i});return new Yi(this.actions,o,!0)}async applySort(e){let i=this.memo.getType(xt).first();if(!i||!i.sub_menu_items)throw new g("No sort filter sub menu found");let s=i.sub_menu_items.find(a=>a.title===e);if(!s)throw new g(`Sort filter ${e} not found`,{available_sort_filters:this.sort_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}async applyContentTypeFilter(e){var a,l,f;let i=(f=(l=(a=this.current_tab)==null?void 0:a.content)==null?void 0:l.as(de).sub_menu)==null?void 0:f.as(_a);if(!i)throw new g("Sub menu not found");let s=i.content_type_sub_menu_items.find(m=>m.title===e);if(!s)throw new g(`Sub menu item ${e} not found`,{available_filters:this.content_type_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}get filters(){var e,i;return((i=(e=this.memo.getType(vt))==null?void 0:e[0])==null?void 0:i.contents.filterType(je).map(s=>s.text))||[]}get sort_filters(){var i;let e=this.memo.getType(xt).first();return((i=e==null?void 0:e.sub_menu_items)==null?void 0:i.map(s=>s.title))||[]}get content_type_filters(){var i,s,o;let e=(o=(s=(i=this.current_tab)==null?void 0:i.content)==null?void 0:s.as(de).sub_menu)==null?void 0:o.as(_a);return(e==null?void 0:e.content_type_sub_menu_items.map(a=>a.title))||[]}async getHome(){let e=await this.getTabByURL("featured");return new ge(this.actions,e.page,!0)}async getVideos(){let e=await this.getTabByURL("videos");return new ge(this.actions,e.page,!0)}async getShorts(){let e=await this.getTabByURL("shorts");return new ge(this.actions,e.page,!0)}async getLiveStreams(){let e=await this.getTabByURL("streams");return new ge(this.actions,e.page,!0)}async getReleases(){let e=await this.getTabByURL("releases");return new ge(this.actions,e.page,!0)}async getPodcasts(){let e=await this.getTabByURL("podcasts");return new ge(this.actions,e.page,!0)}async getPlaylists(){let e=await this.getTabByURL("playlists");return new ge(this.actions,e.page,!0)}async getCommunity(){let e=await this.getTabByURL("community");return new ge(this.actions,e.page,!0)}async getAbout(){var i,s,o,a,l;if(this.hasTabWithURL("about"))return(await this.getTabByURL("about")).memo.getType(pa)[0];let e=((i=this.header)==null?void 0:i.is($r))&&this.header.tagline;if(e||((s=this.header)==null?void 0:s.is(Lt))&&((o=this.header.content)==null?void 0:o.description)){if(e&&e.more_endpoint instanceof d){let x=await e.more_endpoint.call(this.actions);return new Vh(this.actions,x,!1).memo.getType(pa)[0]}let f=(l=(a=this.page.header_memo)==null?void 0:a.getType(J)[0])==null?void 0:l.endpoint;if(!f)throw new g("Failed to extract continuation to get channel about");let m=await f.call(this.actions,{parse:!0});if(!m.on_response_received_endpoints_memo)throw new g("Unexpected response while fetching channel about",{response:m});return m.on_response_received_endpoints_memo.getType(vd)[0]}throw new g("About not found")}async search(e){var o;let i=(o=this.memo.getType(es))==null?void 0:o[0];if(!i)throw new g("Search tab not found",this);let s=await i.endpoint.call(this.actions,{query:e,parse:!0});return new ge(this.actions,s,!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_playlists(){return this.hasTabWithURL("playlists")}get has_community(){return this.hasTabWithURL("community")}get has_about(){var e,i,s,o,a;return this.hasTabWithURL("about")||!!(((e=this.header)==null?void 0:e.is($r))&&((i=this.header.tagline)==null?void 0:i.more_endpoint))||!!(((s=this.header)==null?void 0:s.is(Lt))&&((a=(o=this.header.content)==null?void 0:o.description)==null?void 0:a.more_endpoint))}get has_search(){var e;return((e=this.memo.getType(es))==null?void 0:e.length)>0}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ir(this.actions,e,!0)}};r(ge,"Channel");var Ir=class extends be{constructor(e,i,s=!1){var o,a;super(e,i,s),this.contents=((o=this.page.on_response_received_actions)==null?void 0:o.first())||((a=this.page.on_response_received_endpoints)==null?void 0:a.first())}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ir(this.actions,e,!0)}};r(Ir,"ChannelListContinuation");var Yi=class extends Di{constructor(e,i,s=!1){var o;super(e,i,s),this.applied_filter=this.memo.getType(je).get({is_selected:!0}),this.page.on_response_received_actions&&this.page.on_response_received_actions.length>1&&this.page.on_response_received_actions.shift(),this.contents=(o=this.page.on_response_received_actions)==null?void 0:o.first()}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Yi(this.actions,i.page,!0)}async getContinuation(){let e=await super.getContinuationData();if(!(e!=null&&e.on_response_received_actions_memo))throw new g("Unexpected continuation data",e);return e.on_response_received_actions_memo.set("FeedFilterChipBar",this.memo.getType(vt)),e.on_response_received_actions_memo.set("ChipCloudChip",this.memo.getType(je)),new Yi(this.actions,e,!0)}};r(Yi,"FilteredChannelList");var As,Ut,Rs,Sr=class{constructor(e,i,s=!1){var m,x,_;As.set(this,void 0),Ut.set(this,void 0),Rs.set(this,void 0),I(this,As,s?i:c.parseResponse(i),"f"),I(this,Ut,e,"f");let o=u(this,As,"f").on_response_received_endpoints;if(!o)throw new g("Comments page did not have any content.");let a=o.at(0),l=o.at(1);this.header=(m=a==null?void 0:a.contents)==null?void 0:m.firstOfType(Si);let f=((x=l==null?void 0:l.contents)==null?void 0:x.filterType($_))||[];this.contents=G(f.map(b=>(b.comment&&b.comment.setActions(u(this,Ut,"f")),b.setActions(u(this,Ut,"f")),b))),I(this,Rs,(_=l==null?void 0:l.contents)==null?void 0:_.firstOfType(J),"f")}async applySort(e){var o,a,l,f;if(!this.header)throw new g("Page header is missing. Cannot apply sort option.");let i;if(e==="TOP_COMMENTS"?i=(a=(o=this.header.sort_menu)==null?void 0:o.sub_menu_items)==null?void 0:a.at(0):e==="NEWEST_FIRST"&&(i=(f=(l=this.header.sort_menu)==null?void 0:l.sub_menu_items)==null?void 0:f.at(1)),!i)throw new g("Could not find target button.");if(i.selected)return this;let s=await i.endpoint.call(u(this,Ut,"f"),{parse:!0});return new Sr(u(this,Ut,"f"),s,!0)}async createComment(e){var s;if(!this.header)throw new g("Page header is missing. Cannot create comment.");let i=(s=this.header.create_renderer)==null?void 0:s.as(j_).submit_button;if(!i)throw new g("Could not find target button. You are probably not logged in.");if(!i.endpoint)throw new g("Button does not have an endpoint.");return await i.endpoint.call(u(this,Ut,"f"),{commentText:e})}async getContinuation(){if(!u(this,Rs,"f"))throw new g("Continuation not found");let e=await u(this,Rs,"f").endpoint.call(u(this,Ut,"f"),{parse:!0}),i=Object.assign({},u(this,As,"f"));if(!i.on_response_received_endpoints||!e.on_response_received_endpoints)throw new g("Invalid reponse format, missing on_response_received_endpoints.");return i.on_response_received_endpoints.pop(),i.on_response_received_endpoints.push(e.on_response_received_endpoints[0]),new Sr(u(this,Ut,"f"),i,!0)}get has_continuation(){return!!u(this,Rs,"f")}get page(){return u(this,As,"f")}};r(Sr,"Comments");As=new WeakMap,Ut=new WeakMap,Rs=new WeakMap;var oE=Sr;var Ms,lb=class{constructor(e){Ms.set(this,void 0),I(this,Ms,c.parseResponse(e),"f"),u(this,Ms,"f").items&&(this.contents=u(this,Ms,"f").items.array().as(ts,bx))}get page(){return u(this,Ms,"f")}};r(lb,"Guide");Ms=new WeakMap;var nE=lb;var Ft=class extends be{constructor(e,i,s=!1){super(e,i,s),this.sections=this.memo.getType(It),this.feed_actions=this.memo.getType(Qd).first()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new Error("No continuation data found");return new Ft(this.actions,e,!0)}async removeVideo(e){let i;for(let l of this.sections)for(let f of l.contents){let m=f;if(m.id===e&&m.menu){i=m.menu.top_level_buttons[0].as(v).endpoint.payload.feedbackToken;break}}if(!i)throw new Error("Failed to get feedback token");let s={feedbackTokens:[i]};if(!(await this.actions.execute("/feedback",s)).data.feedbackResponses[0].isProcessed)throw new Error("Failed to remove video from watch history");return!0}};r(Ft,"History");var ri=class extends Di{constructor(e,i,s=!1){var o;super(e,i,s),this.header=this.memo.getType(fx).first(),this.contents=this.memo.getType(Ni).first()||((o=this.page.on_response_received_actions)==null?void 0:o.first())}async applyFilter(e){let i=await super.getFilteredFeed(e);return new ri(this.actions,i.page,!0)}async getContinuation(){var i;let e=await super.getContinuation();return e.page.header=this.page.header,this.header&&((i=e.page.header_memo)==null||i.set(this.header.type,[this.header])),new ri(this.actions,e.page,!0)}};r(ri,"HomeFeed");var Vi=class extends Di{constructor(e,i){if(super(e,i),!this.page.contents_memo)throw new g("Unexpected response",this.page);let s=this.page.contents_memo.getType(Se).first();if(!s.content)throw new g("Content tab has no content",s);this.page.header&&(this.header=this.page.header.item().as(gx,Lt)),this.contents=s.content.as(Ni)}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Vi(this.actions,i.page)}};r(Vi,"HashtagFeed");var ub,fb,Uh,mb=class{constructor(e,i){ub.set(this,void 0),fb.set(this,void 0),Uh.set(this,void 0),I(this,ub,e,"f"),I(this,fb,i,"f");let s=e==null?void 0:e.live_chat_item_context_menu_supported_renderers;if(!s||!s.is(R))throw new g('Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.');I(this,Uh,s.as(R).items,"f")}async selectItem(e){let i;if(e instanceof v){if(!e.endpoint)throw new g("Item does not have an endpoint.");i=e.endpoint}else{let s=u(this,Uh,"f").find(o=>o.is(At)?o.as(At).icon_type===e:!1);if(!s||!s.is(At))throw new g(`Button "${e}" not found.`);i=s.endpoint}if(!i)throw new g("Target button does not have an endpoint.");return await i.call(u(this,fb,"f"),{parse:!0})}items(){return u(this,Uh,"f")}page(){return u(this,ub,"f")}};r(mb,"ItemMenu");ub=new WeakMap,fb=new WeakMap,Uh=new WeakMap;var hb=mb;var Fh,db,Ls=class extends be{constructor(e,i,s=!1){var m,x,_,b,T;super(e,i,s),Fh.add(this);let o=this.memo.getType(Sy).first(),a=this.memo.getType(ky).first(),l=this.memo.getType(Cy).first(),f=(m=this.page.alerts)==null?void 0:m.firstOfType(Br);if(f&&f.alert_type==="ERROR")throw new g(f.text.toString(),f);if(!a&&!l&&Object.keys(this.page).length===0)throw new g("Got empty continuation response. This is likely the end of the playlist.");this.info={...(x=this.page.metadata)==null?void 0:x.item().as(Ey),subtitle:o?o.subtitle:null,author:(b=(_=l==null?void 0:l.owner)==null?void 0:_.as(_s).author)!=null?b:o==null?void 0:o.author,thumbnails:(T=a==null?void 0:a.thumbnail_renderer)==null?void 0:T.as(zr,qr).thumbnail,total_items:u(this,Fh,"m",db).call(this,0,a),views:u(this,Fh,"m",db).call(this,1,a),last_updated:u(this,Fh,"m",db).call(this,2,a),can_share:o==null?void 0:o.can_share,can_delete:o==null?void 0:o.can_delete,is_editable:o==null?void 0:o.is_editable,privacy:o==null?void 0:o.privacy},this.menu=a==null?void 0:a.menu,this.endpoint=a==null?void 0:a.endpoint,this.messages=this.memo.getType(ki)}get items(){return G(this.videos.as(ps,ls,ds).filter(e=>e.style!=="PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO"))}get has_continuation(){let e=this.memo.getType(de).first();return e?!!this.memo.getType(J).find(i=>!e.contents.includes(i)):super.has_continuation}async getContinuationData(){let e=this.memo.getType(de).first();if(!e)return await super.getContinuationData();let i=this.memo.getType(J).find(s=>!e.contents.includes(s));if(!i)throw new g("There are no continuations.");return await i.endpoint.call(this.actions,{parse:!0})}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Ls(this.actions,e,!0)}};r(Ls,"Playlist");Fh=new WeakSet,db=r(function(e,i){var s;return!i||!i.stats?"N/A":((s=i.stats[e])==null?void 0:s.toString())||"N/A"},"_Playlist_getStat");var Os=Ls;var $g,aE,_b=class extends be{constructor(e,i){if(super(e,i),$g.add(this),!this.page.contents_memo)throw new g("Page contents not found");this.header=this.memo.getType(Lt).first();let s=this.page.contents_memo.getType(hs);this.sections=s.map(o=>{var a;return{type:o.icon_type,title:o.title,contents:((a=o.content)==null?void 0:a.key("items").array())||[],getAll:()=>u(this,$g,"m",aE).call(this,o)}})}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")}};r(_b,"Library");$g=new WeakSet,aE=r(async function(e){var o;if(!((o=e.menu)!=null&&o.as(R).top_level_buttons))throw new g(`The ${e.title.text} shelf doesn't have more items`);let i=e.menu.as(R).top_level_buttons.firstOfType(v);if(!i)throw new g("Did not find target button.");let s=await i.as(v).endpoint.call(this.actions,{parse:!0});switch(e.icon_type){case"LIKE":case"WATCH_LATER":return new Os(this.actions,s,!0);case"WATCH_HISTORY":return new Ft(this.actions,s,!0);case"CONTENT_CUT":return new be(this.actions,s,!0);default:throw new g("Target shelf not implemented.")}},"_Library_getAll");var pE=_b;var si,Ui,Er,it,Et,$e;function A1(t){let e=[];for(let i of t)if(Array.isArray(i))for(let s of i)e.push(s);else e.push(i);return e}r(A1,"flattenQueue");var xb=class{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())}};r(xb,"DelayQueue");var yb=class{constructor(){si.set(this,void 0),Ui.set(this,void 0),Er.set(this,void 0),it.set(this,void 0),Et.set(this,void 0),$e.set(this,void 0),I(this,si,null,"f"),I(this,Ui,null,"f"),I(this,Er,null,"f"),I(this,it,[],"f"),I(this,Et,null,"f"),I(this,$e,new xb,"f")}enqueueActionGroup(e){if(u(this,si,"f")!==null){let i=Date.now()-u(this,si,"f");u(this,$e,"f").back.push(i),5{o.length?o.length<10?await u(this,we,"m",wb).call(this,o):this.is_replay?(u(this,we,"m",wb).call(this,o),await u(this,we,"m",kr).call(this,2e3)):u(this,we,"m",wb).call(this,o):await u(this,we,"m",kr).call(this,2e3),this.running&&u(this,we,"m",Kg).call(this)}}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}start(){this.running||(this.running=!0,u(this,we,"m",Kg).call(this),u(this,we,"m",cE).call(this))}stop(){this.smoothed_queue.clear(),this.running=!1}async sendMessage(e){let i=xT.encode({params:{ids:{videoId:u(this,jh,"f"),channelId:u(this,gb,"f")}},number0:1,number1:4}),s=btoa(encodeURIComponent(zt(i.finish()))),o=await u(this,oi,"f").execute("/live_chat/send_message",{richMessage:{textSegments:[{text:e}]},clientMessageId:M.shim.uuidv4(),client:"WEB",parse:!0,params:s});if(!o.actions)throw new g("Unexpected response from send_message",o);return o.actions.array().as(Rx)}applyFilter(e){var s,o,a,l,f,m,x;if(!this.initial_info)throw new g("Cannot apply filter before initial info is retrieved.");let i=(a=(o=(s=this.initial_info)==null?void 0:s.header)==null?void 0:o.view_selector)==null?void 0:a.sub_menu_items;if(e==="TOP_CHAT"){if((l=i==null?void 0:i.at(0))!=null&&l.selected)return;I(this,Cr,(f=i==null?void 0:i.at(0))==null?void 0:f.continuation,"f")}else{if((m=i==null?void 0:i.at(1))!=null&&m.selected)return;I(this,Cr,(x=i==null?void 0:i.at(1))==null?void 0:x.continuation,"f")}}async getItemMenu(e){if(!e.hasKey("menu_endpoint")||!e.key("menu_endpoint").isInstanceof(d))throw new g("This item does not have a menu.",e);let i=await e.key("menu_endpoint").instanceof(d).call(u(this,oi,"f"),{parse:!0});if(!i)throw new g("Could not retrieve item menu.",e);return new hb(i,u(this,oi,"f"))}async selectButton(e){return await e.endpoint.call(u(this,oi,"f"),{parse:!0})}};r(Tb,"LiveChat");oi=new WeakMap,jh=new WeakMap,gb=new WeakMap,Cr=new WeakMap,Wh=new WeakMap,Gh=new WeakMap,we=new WeakSet,Kg=r(function t(){(async()=>{var e,i;try{let s=await u(this,oi,"f").execute(this.is_replay?"live_chat/get_live_chat_replay":"live_chat/get_live_chat",{continuation:u(this,Cr,"f"),parse:!0}),o=s.continuation_contents;if(o||(this.emit("error",new g("Unexpected live chat incremental continuation response",s)),this.emit("end"),this.stop()),!(o instanceof Mi)){this.stop(),this.emit("end");return}I(this,Cr,o.continuation.token,"f"),o.header?(this.initial_info=o,this.emit("start",o),this.running&&u(this,we,"m",t).call(this)):this.smoothed_queue.enqueueActionGroup(o.actions),I(this,Gh,0,"f")}catch(s){this.emit("error",s),I(this,Gh,(i=u(this,Gh,"f"),e=i++,i),"f"),e<10?(await u(this,we,"m",kr).call(this,2e3),u(this,we,"m",t).call(this)):(this.emit("error",new g("Reached retry limit for incremental continuation requests",s)),this.emit("end"),this.stop())}})()},"_LiveChat_pollLivechat"),wb=r(async function(e){let s=e.length<125?1:Math.ceil(e.length/125),o=s==1?(s=1e4/e.length,s*=Math.random()+.5,s=Math.min(1e3,s),s=Math.max(80,s)):s=80;for(let a of e)await u(this,we,"m",kr).call(this,o),this.emit("chat-update",a)},"_LiveChat_emitSmoothedActions"),cE=r(function t(){(async()=>{var e,i,s,o,a,l,f,m,x,_,b;try{let T={videoId:u(this,jh,"f")};u(this,Wh,"f")&&(T.continuation=u(this,Wh,"f"));let w=await u(this,oi,"f").execute("/updated_metadata",T),S=c.parseResponse(w.data);I(this,Wh,(e=S.continuation)==null?void 0:e.token,"f"),this.metadata={title:((i=S.actions)==null?void 0:i.array().firstOfType(Vx))||((s=this.metadata)==null?void 0:s.title),description:((o=S.actions)==null?void 0:o.array().firstOfType(Yx))||((a=this.metadata)==null?void 0:a.description),views:((l=S.actions)==null?void 0:l.array().firstOfType(Fx))||((f=this.metadata)==null?void 0:f.views),likes:((m=S.actions)==null?void 0:m.array().firstOfType(Ux))||((x=this.metadata)==null?void 0:x.likes),date:((_=S.actions)==null?void 0:_.array().firstOfType(Bx))||((b=this.metadata)==null?void 0:b.date)},this.emit("metadata-update",this.metadata),await u(this,we,"m",kr).call(this,5e3),this.running&&u(this,we,"m",t).call(this)}catch{await u(this,we,"m",kr).call(this,2e3),this.running&&u(this,we,"m",t).call(this)}})()},"_LiveChat_pollMetadata"),kr=r(async function(e){return new Promise(i=>setTimeout(()=>i(),e))},"_LiveChat_wait");var vb=Tb;var Fi,Hh,Ds=class{constructor(e,i){if(Fi.set(this,void 0),Hh.set(this,void 0),I(this,Hh,e,"f"),I(this,Fi,c.parseResponse(i.data),"f"),!u(this,Fi,"f").actions_memo)throw new g("Page actions not found");this.header=u(this,Fi,"f").actions_memo.getType(Qx).first(),this.contents=u(this,Fi,"f").actions_memo.getType(fy)}async getContinuation(){var s;let e=(s=u(this,Fi,"f").actions_memo)==null?void 0:s.getType(J).first();if(!e)throw new g("Continuation not found");let i=await e.endpoint.call(u(this,Hh,"f"),{parse:!1});return new Ds(u(this,Hh,"f"),i)}get page(){return u(this,Fi,"f")}};r(Ds,"NotificationsMenu");Fi=new WeakMap,Hh=new WeakMap;var lE=Ds;var ni=class extends be{constructor(e,i,s=!1){var a,l,f;super(e,i,s);let o=((a=this.page.contents_memo)==null?void 0:a.getType(de).first().contents)||((l=this.page.on_response_received_commands)==null?void 0:l.first().contents);if(!o)throw new g("No contents found in search response");this.page.header&&(this.header=this.page.header.item().as(My)),this.results=G(o.filterType(It).flatMap(m=>m.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(Ly).first(),this.watch_card=this.page.contents_memo.getType($y).first()),this.refinement_cards=(f=this.results)==null?void 0:f.firstOfType(wi)}async selectRefinementCard(e){var o,a;let i;if(typeof e=="string"){if(!this.refinement_cards)throw new g("No refinement cards found.");if(i=(a=(o=this.refinement_cards)==null?void 0:o.cards.get({query:e}))==null?void 0:a.as(tr),!i)throw new g(`Refinement card "${e}" not found`,{available_cards:this.refinement_card_queries})}else if(e.type==="SearchRefinementCard")i=e;else throw new g("Invalid refinement card!");let s=await i.endpoint.call(this.actions,{parse:!0});return new ni(this.actions,s,!0)}get refinement_card_queries(){var e;return((e=this.refinement_cards)==null?void 0:e.cards.as(tr).map(i=>i.query))||[]}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new ni(this.actions,e,!0)}};r(ni,"Search");var Pr,$h,Bs=class{constructor(e,i){var a,l,f,m;if(Pr.set(this,void 0),$h.set(this,void 0),I(this,$h,e,"f"),I(this,Pr,c.parseResponse(i.data),"f"),this.sidebar=(a=u(this,Pr,"f").sidebar)==null?void 0:a.as(Dy),!u(this,Pr,"f").contents)throw new g("Page contents not found");let s=u(this,Pr,"f").contents.item().as(Ot).tabs.array().as(Se).get({selected:!0});if(!s)throw new g("Target tab not found");let o=(l=s.content)==null?void 0:l.as(de).contents.as(It);this.introduction=(m=(f=o==null?void 0:o.shift())==null?void 0:f.contents)==null?void 0:m.firstOfType(hy),this.sections=o==null?void 0:o.map(x=>{var _;return{title:(_=x.header)!=null&&_.is(Si,is,rs)?x.header.title.toString():null,contents:x.contents}})}async selectSidebarItem(e){if(!this.sidebar)throw new g("Sidebar not available");let i;if(typeof e=="string"){if(i=this.sidebar.items.get({title:e}),!i)throw new g(`Item "${e}" not found`,{available_items:this.sidebar_items})}else if(e!=null&&e.is(yi))i=e;else throw new g("Invalid item",{target_item:e});let s=await i.endpoint.call(u(this,$h,"f"),{parse:!1});return new Bs(u(this,$h,"f"),s)}getSettingOption(e){var i;if(!this.sections)throw new g("Sections not available");for(let s of this.sections)if(!!s.contents)for(let o of s.contents){let a=o.as(ms).options;if(a){for(let l of a)if(l.is(fs)&&((i=l.title)==null?void 0:i.toString())===e)return l}}throw new g(`Option "${e}" not found`,{available_options:this.setting_options})}get setting_options(){if(!this.sections)throw new g("Sections not available");let e=[];for(let i of this.sections)if(!!i.contents)for(let s of i.contents)s.as(ms).options&&(e=e.concat(s.as(ms).options));return e.map(i=>{var s;return(s=i.title)==null?void 0:s.toString()}).filter(i=>i)}get sidebar_items(){if(!this.sidebar)throw new g("Sidebar not available");return this.sidebar.items.map(e=>e.title.toString())}get page(){return u(this,Pr,"f")}};r(Bs,"Settings");Pr=new WeakMap,$h=new WeakMap;var uE=Bs;var Wi,Ys=class extends Ps{constructor(e,i,s){var x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt,Fe,li,jt,ae,ze;super(e,i,s),Wi.set(this,void 0);let[o,a]=this.page;if(this.streaming_data){let pe=this.streaming_data.adaptive_formats.find(Ae=>{var tt;return(tt=Ae.audio_track)==null?void 0:tt.audio_is_default});if(pe)this.streaming_data.formats.forEach(Ae=>Ae.language=pe.language);else if(((x=this.captions)==null?void 0:x.caption_tracks)&&((_=this.captions)==null?void 0:_.caption_tracks.length)>0){let Ae=this.captions.caption_tracks.find(oe=>oe.kind==="asr"),tt=Ae==null?void 0:Ae.language_code;this.streaming_data.adaptive_formats.forEach(oe=>{oe.has_audio&&(oe.language=tt)}),this.streaming_data.formats.forEach(oe=>oe.language=tt)}}let l=(b=a==null?void 0:a.contents)==null?void 0:b.item().as(Hy),f=l==null?void 0:l.results,m=l==null?void 0:l.secondary_results;if(f&&m){if(((T=o.microformat)==null?void 0:T.is(et))&&((w=o.microformat)==null?void 0:w.category)==="Gaming"){let oe=(C=(E=(S=f.firstOfType(wh))==null?void 0:S.metadata)==null?void 0:E.rows)==null?void 0:C.firstOfType(om);oe!=null&&oe.is(om)&&(this.game_info={title:(U=(k=oe==null?void 0:oe.contents)==null?void 0:k.firstOfType(rm))==null?void 0:U.title,release_year:(K=(L=oe==null?void 0:oe.contents)==null?void 0:L.firstOfType(rm))==null?void 0:K.subtitle})}this.primary_info=f.firstOfType(qy),this.secondary_info=f.firstOfType(wh),this.merchandise=f.firstOfType(Jx),this.related_chip_cloud=(re=m.firstOfType(Ny))==null?void 0:re.content.as(Kr),l!=null&&l.playlist&&(this.playlist=l.playlist),this.watch_next_feed=((he=m.firstOfType(It))==null?void 0:he.contents)||m,this.watch_next_feed&&Array.isArray(this.watch_next_feed)&&((Y=this.watch_next_feed.at(-1))==null?void 0:Y.is(J))&&I(this,Wi,(te=this.watch_next_feed.pop())==null?void 0:te.as(J),"f"),this.player_overlays=(F=a==null?void 0:a.player_overlays)==null?void 0:F.item().as(Iy),l!=null&&l.autoplay&&(this.autoplay=l.autoplay);let pe=(X=(B=this.primary_info)==null?void 0:B.menu)==null?void 0:X.top_level_buttons.firstOfType(dr);((Z=pe==null?void 0:pe.like_button)==null?void 0:Z.is(se))&&((Ue=pe==null?void 0:pe.dislike_button)==null?void 0:Ue.is(se))&&(this.basic_info.like_count=(ut=pe==null?void 0:pe.like_button)==null?void 0:ut.like_count,this.basic_info.is_liked=(ft=pe==null?void 0:pe.like_button)==null?void 0:ft.is_toggled,this.basic_info.is_disliked=(mt=pe==null?void 0:pe.dislike_button)==null?void 0:mt.is_toggled);let Ae=(li=(Fe=this.primary_info)==null?void 0:Fe.menu)==null?void 0:li.top_level_buttons.firstOfType(Xt);if(Ae&&(this.basic_info.like_count=Ae.like_count,Ae.like_button)){let oe=Ae.like_button.like_status_entity.like_status;this.basic_info.is_liked=oe==="LIKE",this.basic_info.is_disliked=oe==="DISLIKE"}let tt=(jt=f.get({target_id:"comments-entry-point"}))==null?void 0:jt.as(It);this.comments_entry_point_header=(ae=tt==null?void 0:tt.contents)==null?void 0:ae.firstOfType(G_),this.livechat=(ze=a==null?void 0:a.contents_memo)==null?void 0:ze.getType(Px).first()}}async selectFilter(e){var a,l,f,m;if(!this.related_chip_cloud)throw new g("Chip cloud not found, cannot apply filter");let i;if(typeof e=="string"){let x=(l=(a=this.related_chip_cloud)==null?void 0:a.chips)==null?void 0:l.get({text:e});if(!x)throw new g("Invalid filter",{available_filters:this.filters});i=x}else if(e!=null&&e.is(je))i=e;else throw new g("Invalid cloud chip",e);if(i.is_selected)return this;let s=await((f=i.endpoint)==null?void 0:f.call(this.actions,{parse:!0})),o=(m=s==null?void 0:s.on_response_received_endpoints)==null?void 0:m.get({target_id:"watch-next-feed"});return this.watch_next_feed=o==null?void 0:o.contents,this}async addToWatchHistory(e={}){return super.addToWatchHistory(e)}async getWatchNextContinuation(){var s,o,a,l,f;if(!u(this,Wi,"f"))throw new g("Watch next feed continuation not found");let e=await((s=u(this,Wi,"f"))==null?void 0:s.endpoint.call(this.actions,{parse:!0})),i=(o=e==null?void 0:e.on_response_received_endpoints)==null?void 0:o.get({type:"AppendContinuationItemsAction"});if(!i)throw new g("AppendContinuationItemsAction not found");return this.watch_next_feed=i==null?void 0:i.contents,(l=(a=this.watch_next_feed)==null?void 0:a.at(-1))!=null&&l.is(J)?I(this,Wi,(f=this.watch_next_feed.pop())==null?void 0:f.as(J),"f"):I(this,Wi,void 0,"f"),this}async like(){var o,a,l,f,m;let e=(a=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:a.top_level_buttons.firstOfType(Xt);if(e){let x=(l=e==null?void 0:e.like_button)==null?void 0:l.toggle_button;if(!x||!x.default_button||!e.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="LIKE")throw new g("This video is already liked",{video_id:this.basic_info.id});return await new d(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(dr),s=i==null?void 0:i.like_button;if(!s)throw new g("Like button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Like button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already liked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async dislike(){var o,a,l,f,m;let e=(a=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:a.top_level_buttons.firstOfType(Xt);if(e){let x=(l=e==null?void 0:e.dislike_button)==null?void 0:l.toggle_button;if(!x||!x.default_button||!e.dislike_button||!e.like_button)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="DISLIKE")throw new g("This video is already disliked",{video_id:this.basic_info.id});return await new d(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(dr),s=i==null?void 0:i.dislike_button;if(!s)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already disliked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async removeRating(){var l,f,m,x,_,b,T;let e,i=(f=(l=this.primary_info)==null?void 0:l.menu)==null?void 0:f.top_level_buttons.firstOfType(Xt);if(i){let w=(m=i==null?void 0:i.like_button)==null?void 0:m.toggle_button;if(!w||!w.default_button||!i.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});let S=i.like_button.like_status_entity.like_status;if(S==="LIKE")e=(x=i==null?void 0:i.like_button)==null?void 0:x.toggle_button;else if(S==="DISLIKE")e=(_=i==null?void 0:i.dislike_button)==null?void 0:_.toggle_button;else throw new g("This video is not liked/disliked",{video_id:this.basic_info.id});if(!e||!e.toggled_button)throw new g("Like/Dislike button not found",{video_id:this.basic_info.id});return await new d(e.toggled_button.on_tap.payload.commands.find(C=>C.innertubeCommand)).call(this.actions)}let s=(T=(b=this.primary_info)==null?void 0:b.menu)==null?void 0:T.top_level_buttons.firstOfType(dr),o=s==null?void 0:s.like_button,a=s==null?void 0:s.dislike_button;if(!(o!=null&&o.is(se))||!(a!=null&&a.is(se)))throw new g("Like/Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(o!=null&&o.is_toggled?e=o:a!=null&&a.is_toggled&&(e=a),!e)throw new g("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 g("Live Chat is not available",{video_id:this.basic_info.id});return new vb(this)}getTrailerInfo(){var e,i;if(this.has_trailer&&this.playability_status){let s=(i=(e=this.playability_status.error_screen)==null?void 0:e.as(Tf).trailer)==null?void 0:i.player_response;if(s)return new Ys([{data:s}],this.actions,this.cpn)}return null}get filters(){var e,i;return((i=(e=this.related_chip_cloud)==null?void 0:e.chips)==null?void 0:i.map(s=>{var o;return(o=s.text)==null?void 0:o.toString()}))||[]}get wn_has_continuation(){return!!u(this,Wi,"f")}get autoplay_video_endpoint(){var e,i,s;return((s=(i=(e=this.autoplay)==null?void 0:e.sets)==null?void 0:i[0])==null?void 0:s.autoplay_video)||null}get has_trailer(){var e,i;return!!((i=(e=this.playability_status)==null?void 0:e.error_screen)!=null&&i.is(Tf))}get music_tracks(){var i,s,o,a,l,f;let e=(s=(i=this.page[1])==null?void 0:i.engagement_panels)==null?void 0:s.filter(m=>{var x;return(x=m.content)==null?void 0:x.is(sr)});if(e!==void 0&&e.length>0){let m=(l=(a=(o=e[0].content)==null?void 0:o.as(sr))==null?void 0:a.items)==null?void 0:l.filterType(jr);if(m!==void 0&&m.length>0)return(f=m[0].carousel_lockups)==null?void 0:f.map(x=>{var C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt,Fe,li;let _,b,T,w,S,E;_=(k=(C=x.video_lockup)==null?void 0:C.title)==null?void 0:k.toString(),S=(U=x.video_lockup)==null?void 0:U.endpoint.payload.videoId;for(let jt=0;jtm.title.toString()===e);if(!i)throw new Error(`Language not found: ${e}`);if(i.selected)return this;let s=await u(this,qh,"f").execute("/get_transcript",{params:i.continuation});return new Us(u(this,qh,"f"),s)}get languages(){var e,i,s,o;return((o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.map(a=>a.title.toString()))||[]}get selectedLanguage(){var e,i,s,o,a;return((a=(o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.find(l=>l.selected))==null?void 0:a.title.toString())||""}get page(){return u(this,Vs,"f")}};r(Us,"TranscriptInfo");Vs=new WeakMap,qh=new WeakMap;var cb=Us;var fE={};var P=class{constructor(e,i,s,o){var l,f,m,x,_,b,T,w,S,E,C,k,U,L,K,re,he,Y,te,F,B,X,Z,Ue,ut,ft,mt;let a=new p(e);this.id=o||((x=(m=(f=(l=a==null?void 0:a.runs)==null?void 0:l[0])==null?void 0:f.endpoint)==null?void 0:m.payload)==null?void 0:x.browseId)||((b=(_=a==null?void 0:a.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)||"N/A",this.name=(a==null?void 0:a.text)||"N/A",this.thumbnails=s?y.fromResponse(s):[],this.endpoint=((w=(T=a==null?void 0:a.runs)==null?void 0:T[0])==null?void 0:w.endpoint)||(a==null?void 0:a.endpoint),i?Array.isArray(i)?(this.badges=c.parseArray(i),this.is_moderator=(S=this.badges)==null?void 0:S.some(Fe=>Fe.icon_type=="MODERATOR"),this.is_verified=(E=this.badges)==null?void 0:E.some(Fe=>Fe.style=="BADGE_STYLE_TYPE_VERIFIED"),this.is_verified_artist=(C=this.badges)==null?void 0:C.some(Fe=>Fe.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST")):(this.badges=G([]),this.is_verified=!!i.isVerified,this.is_verified_artist=!!i.isArtist):this.badges=G([]),this.url=((K=(L=(U=(k=a==null?void 0:a.runs)==null?void 0:k[0])==null?void 0:U.endpoint)==null?void 0:L.metadata)==null?void 0:K.api_url)==="/browse"&&`${We.YT_BASE}${((te=(Y=(he=(re=a==null?void 0:a.runs)==null?void 0:re[0])==null?void 0:he.endpoint)==null?void 0:Y.payload)==null?void 0:te.canonicalBaseUrl)||`/u/${(Z=(X=(B=(F=a==null?void 0:a.runs)==null?void 0:F[0])==null?void 0:B.endpoint)==null?void 0:X.payload)==null?void 0:Z.browseId}`}`||`${We.YT_BASE}${((ut=(Ue=a==null?void 0:a.endpoint)==null?void 0:Ue.payload)==null?void 0:ut.canonicalBaseUrl)||`/u/${(mt=(ft=a==null?void 0:a.endpoint)==null?void 0:ft.payload)==null?void 0:mt.browseId}`}`}get best_thumbnail(){return this.thumbnails[0]}};r(P,"Author");var R1=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],yE=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],M1="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",bE="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Xg={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Qg="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",L1={5:Qg,"5module":Qg+" export import",6:Qg+" const class extends export import super"},O1=/^in(stanceof)?$/,D1=new RegExp("["+bE+"]"),B1=new RegExp("["+bE+M1+"]");function Zg(t,e){for(var i=65536,s=0;st)return!1;if(i+=e[s+1],i>=t)return!0}return!1}r(Zg,"isInAstralSet");function ai(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&D1.test(String.fromCharCode(t)):e===!1?!1:Zg(t,yE)}r(ai,"isIdentifierStart");function Fs(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&B1.test(String.fromCharCode(t)):e===!1?!1:Zg(t,yE)||Zg(t,R1)}r(Fs,"isIdentifierChar");var $=r(function(e,i){i===void 0&&(i={}),this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null},"TokenType");function rt(t,e){return new $(t,{beforeExpr:!0,binop:e})}r(rt,"binop");var st={beforeExpr:!0},Ke={startsExpr:!0},rw={};function j(t,e){return e===void 0&&(e={}),e.keyword=t,rw[t]=new $(t,e)}r(j,"kw");var h={num:new $("num",Ke),regexp:new $("regexp",Ke),string:new $("string",Ke),name:new $("name",Ke),privateId:new $("privateId",Ke),eof:new $("eof"),bracketL:new $("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new $("]"),braceL:new $("{",{beforeExpr:!0,startsExpr:!0}),braceR:new $("}"),parenL:new $("(",{beforeExpr:!0,startsExpr:!0}),parenR:new $(")"),comma:new $(",",st),semi:new $(";",st),colon:new $(":",st),dot:new $("."),question:new $("?",st),questionDot:new $("?."),arrow:new $("=>",st),template:new $("template"),invalidTemplate:new $("invalidTemplate"),ellipsis:new $("...",st),backQuote:new $("`",Ke),dollarBraceL:new $("${",{beforeExpr:!0,startsExpr:!0}),eq:new $("=",{beforeExpr:!0,isAssign:!0}),assign:new $("_=",{beforeExpr:!0,isAssign:!0}),incDec:new $("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new $("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:rt("||",1),logicalAND:rt("&&",2),bitwiseOR:rt("|",3),bitwiseXOR:rt("^",4),bitwiseAND:rt("&",5),equality:rt("==/!=/===/!==",6),relational:rt("/<=/>=",7),bitShift:rt("<>/>>>",8),plusMin:new $("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:rt("%",10),star:rt("*",10),slash:rt("/",10),starstar:new $("**",{beforeExpr:!0}),coalesce:rt("??",1),_break:j("break"),_case:j("case",st),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",st),_do:j("do",{isLoop:!0,beforeExpr:!0}),_else:j("else",st),_finally:j("finally"),_for:j("for",{isLoop:!0}),_function:j("function",Ke),_if:j("if"),_return:j("return",st),_switch:j("switch"),_throw:j("throw",st),_try:j("try"),_var:j("var"),_const:j("const"),_while:j("while",{isLoop:!0}),_with:j("with"),_new:j("new",{beforeExpr:!0,startsExpr:!0}),_this:j("this",Ke),_super:j("super",Ke),_class:j("class",Ke),_extends:j("extends",st),_export:j("export"),_import:j("import",Ke),_null:j("null",Ke),_true:j("true",Ke),_false:j("false",Ke),_in:j("in",{beforeExpr:!0,binop:7}),_instanceof:j("instanceof",{beforeExpr:!0,binop:7}),_typeof:j("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:j("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:j("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},at=/\r\n?|\n|\u2028|\u2029/,Y1=new RegExp(at.source,"g");function Ws(t){return t===10||t===13||t===8232||t===8233}r(Ws,"isNewLine");function gE(t,e,i){i===void 0&&(i=t.length);for(var s=e;s>10)+55296,(t&1023)+56320))}r(ji,"codePointToString");var F1=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Xh=r(function(e,i){this.line=e,this.column=i},"Position");Xh.prototype.offset=r(function(e){return new Xh(this.line,this.column+e)},"offset");var Pb=r(function(e,i,s){this.start=i,this.end=s,e.sourceFile!==null&&(this.source=e.sourceFile)},"SourceLocation");function vE(t,e){for(var i=1,s=0;;){var o=gE(t,s,e);if(o<0)return new Xh(i,e-s);++i,s=o}}r(vE,"getLineInfo");var ew={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},dE=!1;function W1(t){var e={};for(var i in ew)e[i]=t&&Jh(t,i)?t[i]:ew[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!dE&&typeof console=="object"&&console.warn&&(dE=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),mE(e.onToken)){var s=e.onToken;e.onToken=function(o){return s.push(o)}}return mE(e.onComment)&&(e.onComment=G1(e,e.onComment)),e}r(W1,"getOptions");function G1(t,e){return function(i,s,o,a,l,f){var m={type:i?"Block":"Line",value:s,start:o,end:a};t.locations&&(m.loc=new Pb(this,l,f)),t.ranges&&(m.range=[o,a]),e.push(m)}}r(G1,"pushComment");var Qh=1,Gs=2,sw=4,IE=8,SE=16,EE=32,ow=64,kE=128,Zh=256,nw=Qh|Gs|Zh;function aw(t,e){return Gs|(t?sw:0)|(e?IE:0)}r(aw,"functionFlags");var Sb=0,pw=1,ci=2,CE=3,PE=4,NE=5,me=r(function(e,i,s){this.options=e=W1(e),this.sourceFile=e.sourceFile,this.keywords=Gi(L1[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var o="";e.allowReserved!==!0&&(o=Xg[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(o+=" await")),this.reservedWords=Gi(o);var a=(o?o+" ":"")+Xg.strict;this.reservedWordsStrict=Gi(a),this.reservedWordsStrictBind=Gi(a+" "+Xg.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(` -`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(at).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=h.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Qh),this.regexpState=null,this.privateNameStack=[]},"Parser"),Wt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=r(function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},"parse");Wt.inFunction.get=function(){return(this.currentVarScope().flags&Gs)>0};Wt.inGenerator.get=function(){return(this.currentVarScope().flags&IE)>0&&!this.currentVarScope().inClassFieldInit};Wt.inAsync.get=function(){return(this.currentVarScope().flags&sw)>0&&!this.currentVarScope().inClassFieldInit};Wt.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t];if(e.inClassFieldInit||e.flags&Zh)return!1;if(e.flags&Gs)return(e.flags&sw)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Wt.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&ow)>0||i||this.options.allowSuperOutsideMethod};Wt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&kE)>0};Wt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Wt.allowNewDotTarget.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&(Gs|Zh))>0||i};Wt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Zh)>0};me.extend=r(function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];for(var s=this,o=0;o=,?^&]/.test(o)||o==="!"&&this.input.charAt(s+1)==="=")}t+=e[0].length,ot.lastIndex=t,t+=ot.exec(this.input)[0].length,this.input[t]===";"&&t++}};Be.eat=function(t){return this.type===t?(this.next(),!0):!1};Be.isContextual=function(t){return this.type===h.name&&this.value===t&&!this.containsEsc};Be.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};Be.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};Be.canInsertSemicolon=function(){return this.type===h.eof||this.type===h.braceR||at.test(this.input.slice(this.lastTokEnd,this.start))};Be.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Be.semicolon=function(){!this.eat(h.semi)&&!this.insertSemicolon()&&this.unexpected()};Be.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};Be.expect=function(t){this.eat(t)||this.unexpected()};Be.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var Nb=r(function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1},"DestructuringErrors");Be.checkPatternErrors=function(t,e){if(!!t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}};Be.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};Be.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(ai(s,!0)){for(var o=i+1;Fs(s=this.input.charCodeAt(o),!0);)++o;if(s===92||s>55295&&s<56320)return!0;var a=this.input.slice(i,o);if(!O1.test(a))return!0}return!1};A.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ot.lastIndex=this.pos;var t=ot.exec(this.input),e=this.pos+t[0].length,i;return!at.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Fs(i=this.input.charCodeAt(e+8))||i>55295&&i<56320))};A.parseStatement=function(t,e,i){var s=this.type,o=this.startNode(),a;switch(this.isLet(t)&&(s=h._var,a="let"),s){case h._break:case h._continue:return this.parseBreakContinueStatement(o,s.keyword);case h._debugger:return this.parseDebuggerStatement(o);case h._do:return this.parseDoStatement(o);case h._for:return this.parseForStatement(o);case h._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1,!t);case h._class:return t&&this.unexpected(),this.parseClass(o,!0);case h._if:return this.parseIfStatement(o);case h._return:return this.parseReturnStatement(o);case h._switch:return this.parseSwitchStatement(o);case h._throw:return this.parseThrowStatement(o);case h._try:return this.parseTryStatement(o);case h._const:case h._var:return a=a||this.value,t&&a!=="var"&&this.unexpected(),this.parseVarStatement(o,a);case h._while:return this.parseWhileStatement(o);case h._with:return this.parseWithStatement(o);case h.braceL:return this.parseBlock(!0,o);case h.semi:return this.parseEmptyStatement(o);case h._export:case h._import:if(this.options.ecmaVersion>10&&s===h._import){ot.lastIndex=this.pos;var l=ot.exec(this.input),f=this.pos+l[0].length,m=this.input.charCodeAt(f);if(m===40||m===46)return this.parseExpressionStatement(o,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===h._import?this.parseImport(o):this.parseExport(o,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(o,!0,!t);var x=this.value,_=this.parseExpression();return s===h.name&&_.type==="Identifier"&&this.eat(h.colon)?this.parseLabeledStatement(o,x,_,t):this.parseExpressionStatement(o,_)}};A.parseBreakContinueStatement=function(t,e){var i=e==="break";this.next(),this.eat(h.semi)||this.insertSemicolon()?t.label=null:this.type!==h.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(h.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};A.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(cw),this.enterScope(0),this.expect(h.parenL),this.type===h.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===h._var||this.type===h._const||i){var s=this.startNode(),o=i?"let":this.value;return this.next(),this.parseVar(s,!0,o),this.finishNode(s,"VariableDeclaration"),(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===h._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,s)):(e>-1&&this.unexpected(e),this.parseFor(t,s))}var a=this.isContextual("let"),l=!1,f=this.containsEsc,m=new Nb,x=this.start,_=e>-1?this.parseExprSubscripts(m,"await"):this.parseExpression(!0,m);return this.type===h._in||(l=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===h._in&&this.unexpected(e),t.await=!0):l&&this.options.ecmaVersion>=8&&(_.start===x&&!f&&_.type==="Identifier"&&_.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),a&&l&&this.raise(_.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(_,!1,m),this.checkLValPattern(_),this.parseForIn(t,_)):(this.checkExpressionErrors(m,!0),e>-1&&this.unexpected(e),this.parseFor(t,_))};A.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,zh|(i?0:tw),!1,e)};A.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(h._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};A.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(h.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};A.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(h.braceL),this.labels.push(H1),this.enterScope(0);for(var e,i=!1;this.type!==h.braceR;)if(this.type===h._case||this.type===h._default){var s=this.type===h._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(h.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};A.parseThrowStatement=function(t){return this.next(),at.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var $1=[];A.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?EE:0),this.checkLValPattern(t,e?PE:ci),this.expect(h.parenR),t};A.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===h._catch){var e=this.startNode();this.next(),this.eat(h.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(h._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};A.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};A.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(cw),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};A.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};A.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};A.parseLabeledStatement=function(t,e,i,s){for(var o=0,a=this.labels;o=0;m--){var x=this.labels[m];if(x.statementStart===t.start)x.statementStart=this.start,x.kind=f;else break}return this.labels.push({name:e,kind:f,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};A.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};A.parseBlock=function(t,e,i){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(h.braceL),t&&this.enterScope(0);this.type!==h.braceR;){var s=this.parseStatement(null);e.body.push(s)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};A.parseFor=function(t,e){return t.init=e,this.expect(h.semi),t.test=this.type===h.semi?null:this.parseExpression(),this.expect(h.semi),t.update=this.type===h.parenR?null:this.parseExpression(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};A.parseForIn=function(t,e){var i=this.type===h._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(h.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};A.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){var o=this.startNode();if(this.parseVarId(o,i),this.eat(h.eq)?o.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===h._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&o.id.type!=="Identifier"&&!(e&&(this.type===h._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):o.init=null,t.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(h.comma))break}return t};A.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?pw:ci,!1)};var zh=1,tw=2,AE=4;A.parseFunction=function(t,e,i,s,o){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===h.star&&e&tw&&this.unexpected(),t.generator=this.eat(h.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&zh&&(t.id=e&AE&&this.type!==h.name?null:this.parseIdent(),t.id&&!(e&tw)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?pw:ci:CE));var a=this.yieldPos,l=this.awaitPos,f=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(aw(t.async,t.generator)),e&zh||(t.id=this.type===h.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,o),this.yieldPos=a,this.awaitPos=l,this.awaitIdentPos=f,this.finishNode(t,e&zh?"FunctionDeclaration":"FunctionExpression")};A.parseFunctionParams=function(t){this.expect(h.parenL),t.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};A.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),o=this.startNode(),a=!1;for(o.body=[],this.expect(h.braceL);this.type!==h.braceR;){var l=this.parseClassElement(t.superClass!==null);l&&(o.body.push(l),l.type==="MethodDefinition"&&l.kind==="constructor"?(a&&this.raiseRecoverable(l.start,"Duplicate constructor in the same class"),a=!0):l.key&&l.key.type==="PrivateIdentifier"&&K1(s,l)&&this.raiseRecoverable(l.key.start,"Identifier '#"+l.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};A.parseClassElement=function(t){if(this.eat(h.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",o=!1,a=!1,l="method",f=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(h.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===h.star?f=!0:s="static"}if(i.static=f,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===h.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(e>=9||!a)&&this.eat(h.star)&&(o=!0),!s&&!a&&!o){var m=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?l=m:s=m)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===h.parenL||l!=="method"||o||a){var x=!i.static&&Eb(i,"constructor"),_=x&&t;x&&l!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=x?"constructor":l,this.parseClassMethod(i,o,a,_)}else this.parseClassField(i);return i};A.isClassElementNameStart=function(){return this.type===h.name||this.type===h.privateId||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword};A.parseClassElementName=function(t){this.type===h.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};A.parseClassMethod=function(t,e,i,s){var o=t.key;t.kind==="constructor"?(e&&this.raise(o.start,"Constructor can't be a generator"),i&&this.raise(o.start,"Constructor can't be an async method")):t.static&&Eb(t,"prototype")&&this.raise(o.start,"Classes may not have a static property named prototype");var a=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),t.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),t.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};A.parseClassField=function(t){if(Eb(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&Eb(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(h.eq)){var e=this.currentThisScope(),i=e.inClassFieldInit;e.inClassFieldInit=!0,t.value=this.parseMaybeAssign(),e.inClassFieldInit=i}else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};A.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(Zh|ow);this.type!==h.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};A.parseClassId=function(t,e){this.type===h.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,ci,!1)):(e===!0&&this.unexpected(),t.id=null)};A.parseClassSuper=function(t){t.superClass=this.eat(h._extends)?this.parseExprSubscripts(null,!1):null};A.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};A.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(!!this.options.checkPrivateFields)for(var s=this.privateNameStack.length,o=s===0?null:this.privateNameStack[s-1],a=0;a=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};A.parseExport=function(t,e){if(this.next(),this.eat(h.star))return this.parseExportAllDeclaration(t,e);if(this.eat(h._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==h.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var i=0,s=t.specifiers;i=13&&this.type===h.string){var t=this.parseLiteral(this.value);return F1.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};A.adaptDirectivePrologue=function(t){for(var e=0;e=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var pt=me.prototype;pt.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,o=t.properties;s=8&&!f&&m.name==="async"&&!this.canInsertSemicolon()&&this.eat(h._function))return this.overrideContext(ie.f_expr),this.parseFunction(this.startNodeAt(a,l),0,!1,!0,e);if(o&&!this.canInsertSemicolon()){if(this.eat(h.arrow))return this.parseArrowExpression(this.startNodeAt(a,l),[m],!1,e);if(this.options.ecmaVersion>=8&&m.name==="async"&&this.type===h.name&&!f&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return m=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(h.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,l),[m],!0,e)}return m;case h.regexp:var x=this.value;return s=this.parseLiteral(x.value),s.regex={pattern:x.pattern,flags:x.flags},s;case h.num:case h.string:return this.parseLiteral(this.value);case h._null:case h._true:case h._false:return s=this.startNode(),s.value=this.type===h._null?null:this.type===h._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case h.parenL:var _=this.start,b=this.parseParenAndDistinguishExpression(o,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(b)&&(t.parenthesizedAssign=_),t.parenthesizedBind<0&&(t.parenthesizedBind=_)),b;case h.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(h.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case h.braceL:return this.overrideContext(ie.b_expr),this.parseObj(!1,t);case h._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case h._class:return this.parseClass(this.startNode(),!1);case h._new:return this.parseNew();case h.backQuote:return this.parseTemplate();case h._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};D.parseExprAtomDefault=function(){this.unexpected()};D.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===h.parenL&&!t)return this.parseDynamicImport(e);if(this.type===h.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};D.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(h.parenR)){var e=this.start;this.eat(h.comma)&&this.eat(h.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};D.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};D.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};D.parseParenExpression=function(){this.expect(h.parenL);var t=this.parseExpression();return this.expect(h.parenR),t};D.shouldParseArrow=function(t){return!this.canInsertSemicolon()};D.parseParenAndDistinguishExpression=function(t,e){var i=this.start,s=this.startLoc,o,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var l=this.start,f=this.startLoc,m=[],x=!0,_=!1,b=new Nb,T=this.yieldPos,w=this.awaitPos,S;for(this.yieldPos=0,this.awaitPos=0;this.type!==h.parenR;)if(x?x=!1:this.expect(h.comma),a&&this.afterTrailingComma(h.parenR,!0)){_=!0;break}else if(this.type===h.ellipsis){S=this.start,m.push(this.parseParenItem(this.parseRestBinding())),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else m.push(this.parseMaybeAssign(!1,b,this.parseParenItem));var E=this.lastTokEnd,C=this.lastTokEndLoc;if(this.expect(h.parenR),t&&this.shouldParseArrow(m)&&this.eat(h.arrow))return this.checkPatternErrors(b,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=T,this.awaitPos=w,this.parseParenArrowList(i,s,m,e);(!m.length||_)&&this.unexpected(this.lastTokStart),S&&this.unexpected(S),this.checkExpressionErrors(b,!0),this.yieldPos=T||this.yieldPos,this.awaitPos=w||this.awaitPos,m.length>1?(o=this.startNodeAt(l,f),o.expressions=m,this.finishNodeAt(o,"SequenceExpression",E,C)):o=m[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var k=this.startNodeAt(i,s);return k.expression=o,this.finishNode(k,"ParenthesizedExpression")}else return o};D.parseParenItem=function(t){return t};D.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var q1=[];D.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===h.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var s=this.start,o=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,o,!0,!1),this.eat(h.parenL)?t.arguments=this.parseExprList(h.parenR,this.options.ecmaVersion>=8,!1):t.arguments=q1,this.finishNode(t,"NewExpression")};D.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===h.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` +${ab(t,e.key_info)}`);break;default:D.warn(dr,"Unreachable code reached at ParserErrorHandler");break}},"ERROR_HANDLER");function D1(t){ei=t}r(D1,"setParserErrorHandler");function Ot(){_r=null}r(Ot,"_clearMemo");function Dt(){_r=new li}r(Dt,"_createMemo");function B1(t,e){if(!_r)return;let i=_r.get(t);if(!i)return _r.set(t,[e]);i.push(e)}r(B1,"_addToMemo");function Bt(){if(!_r)throw new Error("Parser#getMemo() called before Parser#createMemo()");return _r}r(Bt,"_getMemo");function zg(t){return O1.has(t)}r(zg,"shouldIgnore");function _s(t){return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/Renderer|Model/g,"").replace(/Radio/g,"Mix").trim()}r(_s,"sanitizeClassName");function ds(t){let e=qg.get(t);if(!e){let i=new Error(`Module not found: ${t}`);throw i.code="MODULE_NOT_FOUND",i}return e}r(ds,"getParserByName");function Wh(t){return qg.has(t)}r(Wh,"hasParser");function jg(t,e){qg.set(t,e),cE.set(t,e)}r(jg,"addRuntimeParser");function Y1(){return Object.fromEntries(cE)}r(Y1,"getDynamicParsers");function Hg(t){var Iw,Sw,Ew,kw,Cw,Pw,Nw,Aw,Rw,Mw,Lw,Ow,Dw,Bw,Yw,Vw;let e={};Dt();let i=Me(t.contents),s=Bt();i&&(e.contents=i,e.contents_memo=s),Ot(),Dt();let o=t.onResponseReceivedActions?ub(t.onResponseReceivedActions):null,p=Bt();o&&(e.on_response_received_actions=o,e.on_response_received_actions_memo=p),Ot(),Dt();let c=t.onResponseReceivedEndpoints?ub(t.onResponseReceivedEndpoints):null,f=Bt();c&&(e.on_response_received_endpoints=c,e.on_response_received_endpoints_memo=f),Ot(),Dt();let m=t.onResponseReceivedCommands?ub(t.onResponseReceivedCommands):null,x=Bt();m&&(e.on_response_received_commands=m,e.on_response_received_commands_memo=x),Ot(),Dt();let _=t.continuationContents?$g(t.continuationContents):null,b=Bt();_&&(e.continuation_contents=_,e.continuation_contents_memo=b),Ot(),Dt();let T=t.actions?mE(t.actions):null,w=Bt();T&&(e.actions=T,e.actions_memo=w),Ot(),Dt();let S=t.liveChatItemContextMenuSupportedRenderers?q(t.liveChatItemContextMenuSupportedRenderers):null,E=Bt();S&&(e.live_chat_item_context_menu_supported_renderers=S,e.live_chat_item_context_menu_supported_renderers_memo=E),Ot(),Dt();let C=t.header?Me(t.header):null,k=Bt();C&&(e.header=C,e.header_memo=k),Ot(),Dt();let U=t.sidebar?q(t.sidebar):null,M=Bt();U&&(e.sidebar=U,e.sidebar_memo=M),Ot(),Dt();let K=Me(t.items);K&&(e.items=K,e.items_memo=Bt()),Ot(),hE(s,(Sw=(Iw=t.frameworkUpdates)==null?void 0:Iw.entityBatchUpdate)==null?void 0:Sw.mutations),f&&dE(f,(kw=(Ew=t.frameworkUpdates)==null?void 0:Ew.entityBatchUpdate)==null?void 0:kw.mutations);let re=t.continuation?fE(t.continuation):null;re&&(e.continuation=re);let he=t.continuationEndpoint?$g(t.continuationEndpoint):null;he&&(e.continuation_endpoint=he);let Y=Me(t.metadata);Y&&(e.metadata=Y);let ee=q(t.microformat);ee&&(e.microformat=ee);let F=q(t.overlay);F&&(e.overlay=F);let B=Ee(t.alerts,[Lr,jd]);B.length&&(e.alerts=B);let z=t.refinements;z&&(e.refinements=z);let J=t.estimatedResults?parseInt(t.estimatedResults):null;J&&(e.estimated_results=J);let Be=Me(t.playerOverlays);Be&&(e.player_overlays=Be);let lt=q(t.background,ve);lt&&(e.background=lt);let ct=t.playbackTracking?{videostats_watchtime_url:t.playbackTracking.videostatsWatchtimeUrl.baseUrl,videostats_playback_url:t.playbackTracking.videostatsPlaybackUrl.baseUrl}:null;ct&&(e.playback_tracking=ct);let ut=t.playabilityStatus?{status:t.playabilityStatus.status,reason:t.playabilityStatus.reason||"",embeddable:!!t.playabilityStatus.playableInEmbed||!1,audio_only_playablility:q(t.playabilityStatus.audioOnlyPlayability,$d),error_screen:q(t.playabilityStatus.errorScreen)}:null;if(ut&&(e.playability_status=ut),t.streamingData){let fd=new Map;e.streaming_data={expires:new Date(Date.now()+parseInt(t.streamingData.expiresInSeconds)*1e3),formats:Kg(t.streamingData.formats,fd),adaptive_formats:Kg(t.streamingData.adaptiveFormats,fd),dash_manifest_url:t.streamingData.dashManifestUrl,hls_manifest_url:t.streamingData.hlsManifestUrl,server_abr_streaming_url:t.streamingData.serverAbrStreamingUrl}}t.playerConfig&&(e.player_config={audio_config:{loudness_db:(Cw=t.playerConfig.audioConfig)==null?void 0:Cw.loudnessDb,perceptual_loudness_db:(Pw=t.playerConfig.audioConfig)==null?void 0:Pw.perceptualLoudnessDb,enable_per_format_loudness:(Nw=t.playerConfig.audioConfig)==null?void 0:Nw.enablePerFormatLoudness},stream_selection_config:{max_bitrate:((Aw=t.playerConfig.streamSelectionConfig)==null?void 0:Aw.maxBitrate)||"0"},media_common_config:{dynamic_readahead_config:{max_read_ahead_media_time_ms:((Mw=(Rw=t.playerConfig.mediaCommonConfig)==null?void 0:Rw.dynamicReadaheadConfig)==null?void 0:Mw.maxReadAheadMediaTimeMs)||0,min_read_ahead_media_time_ms:((Ow=(Lw=t.playerConfig.mediaCommonConfig)==null?void 0:Lw.dynamicReadaheadConfig)==null?void 0:Ow.minReadAheadMediaTimeMs)||0,read_ahead_growth_rate_ms:((Bw=(Dw=t.playerConfig.mediaCommonConfig)==null?void 0:Dw.dynamicReadaheadConfig)==null?void 0:Bw.readAheadGrowthRateMs)||0},media_ustreamer_request_config:{video_playback_ustreamer_config:(Vw=(Yw=t.playerConfig.mediaCommonConfig)==null?void 0:Yw.mediaUstreamerRequestConfig)==null?void 0:Vw.videoPlaybackUstreamerConfig}}});let Ye=t.currentVideoEndpoint?new h(t.currentVideoEndpoint):null;Ye&&(e.current_video_endpoint=Ye);let pi=t.endpoint?new h(t.endpoint):null;pi&&(e.endpoint=pi);let Wt=q(t.captions,Iy);Wt&&(e.captions=Wt);let pe=t.videoDetails?new Ri(t.videoDetails):null;pe&&(e.video_details=pe);let Ke=Ee(t.annotations,vy);Ke.length&&(e.annotations=Ke);let le=q(t.storyboards,[qi,ky]);le&&(e.storyboards=le);let Ce=q(t.endscreen,xx);Ce&&(e.endscreen=Ce);let et=q(t.cards,N_);et&&(e.cards=et);let oe=Ee(t.engagementPanels,Ti);return oe.length&&(e.engagement_panels=oe),t.playerResponse&&(e.player_response=Hg(t.playerResponse)),t.watchNextResponse&&(e.watch_next_response=Hg(t.watchNextResponse)),t.cpnInfo&&(e.cpn_info={cpn:t.cpnInfo.cpn,cpn_source:t.cpnInfo.cpnSource}),t.entries&&(e.entries=t.entries.map(fd=>new h(fd))),e}r(Hg,"parseResponse");function q(t,e){if(!t)return null;let i=Object.keys(t);if(!i.length)return null;let s=_s(i[0]);if(!zg(s))try{let p=Wh(s)?ds(s):Fh(s,t[i[0]],ei);if(e){if(Array.isArray(e)){if(!e.some(f=>f.type===p.type))return ei({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.map(f=>f.type)}),null}else if(p.type!==e.type)return ei({classdata:t[i[0]],classname:s,error_type:"typecheck",expected:e.type}),null}let c=new p(t[i[0]]);return B1(s,c),c}catch(o){return ei({classname:s,classdata:t[i[0]],error:o,error_type:"parse"}),null}return null}r(q,"parseItem");function Ee(t,e){if(Array.isArray(t)){let i=[];for(let s of t){let o=q(s,e);o&&i.push(o)}return G(i)}else if(!t)return G([]);throw new ze("Expected array but got a single item")}r(Ee,"parseArray");function Me(t,e,i){if(!t)return null;if(Array.isArray(t)){let s=[];for(let p of t){let c=q(p,i);c&&s.push(c)}let o=G(s);return e?o:new Ct(o)}else if(e)throw new ze("Expected array but got a single item");return new Ct(q(t,i))}r(Me,"parse");var V1=/Command$/,U1=/Endpoint$/,F1=/Action$/;function uE(t){let e=[];try{e=Object.keys(t)}catch{}for(let i of e){let s=t[i];if(V1.test(i)||U1.test(i)||F1.test(i)){let o=_s(i);if(zg(o))return;try{if(Wh(o))return new(ds(o))(s)}catch(p){ei({error:p,classname:o,classdata:s,error_type:"parse"})}}}}r(uE,"parseCommand");function W1(t){if(Array.isArray(t)){let e=[];for(let i of t){let s=uE(i);s&&e.push(s)}return G(e)}else if(!t)return G([]);throw new ze("Expected array but got a single item")}r(W1,"parseCommands");function fE(t){return t.timedContinuationData?new hr({continuation:t.timedContinuationData,type:"timed"}):null}r(fE,"parseC");function $g(t){return t.itemSectionContinuation?new xs(t.itemSectionContinuation):t.sectionListContinuation?new bs(t.sectionListContinuation):t.liveChatContinuation?new Ai(t.liveChatContinuation):t.musicPlaylistShelfContinuation?new gs(t.musicPlaylistShelfContinuation):t.musicShelfContinuation?new ws(t.musicShelfContinuation):t.gridContinuation?new Ts(t.gridContinuation):t.playlistPanelContinuation?new vs(t.playlistPanelContinuation):t.continuationCommand?new Zt(t.continuationCommand):null}r($g,"parseLC");function ub(t){return G(t.map(e=>{if(e.navigateAction)return new Pi(e.navigateAction);if(e.showMiniplayerCommand)return new ys(e.showMiniplayerCommand);if(e.reloadContinuationItemsCommand)return new Ni(e.reloadContinuationItemsCommand);if(e.appendContinuationItemsAction)return new Xi(e.appendContinuationItemsAction)}).filter(e=>e))}r(ub,"parseRR");function mE(t){return Array.isArray(t)?Me(t.map(e=>(delete e.clickTrackingParams,e))):new Ct(q(t))}r(mE,"parseActions");function Kg(t,e){return(t==null?void 0:t.map(i=>new cb(i,e)))||[]}r(Kg,"parseFormats");function hE(t,e){let i=t.getType(is);if(i.length>0&&!e)ei({error_type:"mutation_data_missing",classname:"MusicMultiSelectMenuItem"});else{let s=[];for(let o of i){let p=e.find(f=>{var m,x;return((x=(m=f.payload)==null?void 0:m.musicFormBooleanChoice)==null?void 0:x.id)===o.form_item_entity_key}),c=p==null?void 0:p.payload.musicFormBooleanChoice;(c==null?void 0:c.selected)!==void 0&&(c==null?void 0:c.opaqueToken)?o.selected=c.selected:s.push(`'${o.title}'`)}s.length>0&&ei({error_type:"mutation_data_invalid",classname:"MusicMultiSelectMenuItem",total:i.length,failed:s.length,titles:s})}}r(hE,"applyMutations");function dE(t,e){var s,o,p,c,f,m;let i=t.getType(ir);if(i.length>0){e||ei({error_type:"mutation_data_missing",classname:"CommentView"});for(let x of i){let _=(o=(s=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.commentEntityPayload)==null?void 0:E.key)===x.keys.comment}))==null?void 0:s.payload)==null?void 0:o.commentEntityPayload,b=(c=(p=e.find(w=>{var S,E;return((E=(S=w.payload)==null?void 0:S.engagementToolbarStateEntityPayload)==null?void 0:E.key)===x.keys.toolbar_state}))==null?void 0:p.payload)==null?void 0:c.engagementToolbarStateEntityPayload,T=(m=(f=e.find(w=>w.entityKey===x.keys.toolbar_surface))==null?void 0:f.payload)==null?void 0:m.engagementToolbarSurfaceEntityPayload;x.applyMutations(_,b,T)}}}r(dE,"applyCommentsMutations");var tw={};qe(tw,{AccountInfo:()=>_E,Channel:()=>ge,ChannelListContinuation:()=>wr,Comments:()=>yE,FilteredChannelList:()=>Di,Guide:()=>bE,HashtagFeed:()=>Bi,History:()=>Vt,HomeFeed:()=>ti,ItemMenu:()=>wb,Library:()=>wE,LiveChat:()=>Nb,NotificationsMenu:()=>vE,Playlist:()=>Ms,Search:()=>si,Settings:()=>IE,SmoothedQueue:()=>Eb,TranscriptInfo:()=>_b,VideoInfo:()=>Zh});var Is,fb=class{constructor(e){if(Is.set(this,void 0),I(this,Is,l.parseResponse(e.data),"f"),!u(this,Is,"f").contents)throw new g("Page contents not found");let i=u(this,Is,"f").contents.array().as(Md).first();if(!i)throw new g("Account section list not found");this.contents=i.contents.first()}get page(){return u(this,Is,"f")}};r(fb,"AccountInfo");Is=new WeakMap;var _E=fb;var Gh,ke,jh,Ge,xr,xE,Qg,Mi=class{constructor(e,i,s=!1){Gh.add(this),ke.set(this,void 0),jh.set(this,void 0),Ge.set(this,void 0),xr.set(this,void 0),u(this,Gh,"m",xE).call(this,i)||s?I(this,ke,i,"f"):I(this,ke,l.parseResponse(i.data),"f");let o=Xg(u(this,ke,"f").contents_memo,u(this,ke,"f").continuation_contents_memo,u(this,ke,"f").on_response_received_commands_memo,u(this,ke,"f").on_response_received_endpoints_memo,u(this,ke,"f").on_response_received_actions_memo,u(this,ke,"f").sidebar_memo,u(this,ke,"f").header_memo);if(!o)throw new g("No memo found in feed");I(this,Ge,o,"f"),I(this,jh,e,"f")}static getVideosFromMemo(e){return e.getType(Ur,Sx,ps,ms,Fr,ns,Jt,ib)}static getPlaylistsFromMemo(e){let i=e.getType(Nt,Tx),s=e.getType(ey).filter(o=>["PLAYLIST","ALBUM","PODCAST"].includes(o.content_type));return s.length>0&&i.push(...s),i}get videos(){return Mi.getVideosFromMemo(u(this,Ge,"f"))}get posts(){return u(this,Ge,"f").getType(xi,as,jy)}get channels(){return u(this,Ge,"f").getType(O_,wx)}get playlists(){return Mi.getPlaylistsFromMemo(u(this,Ge,"f"))}get memo(){return u(this,Ge,"f")}get page_contents(){var o;let e=(o=u(this,Ge,"f").getType(Ie))==null?void 0:o.first().content,i=u(this,Ge,"f").getType(Ni).first(),s=u(this,Ge,"f").getType(Xi).first();return e||i||s}get shelves(){return u(this,Ge,"f").getType(fs,Yy,Gr)}getShelf(e){return this.shelves.get({title:e})}get secondary_contents(){var i,s;if(!((i=u(this,ke,"f").contents)!=null&&i.is_node))return;let e=(s=u(this,ke,"f").contents)==null?void 0:s.item();if(!!e.is(Mt,Qy))return e.secondary_contents}get actions(){return u(this,jh,"f")}get page(){return u(this,ke,"f")}get has_continuation(){return u(this,Gh,"m",Qg).call(this).length>0}async getContinuationData(){if(u(this,xr,"f")){if(u(this,xr,"f").length===0)throw new g("There are no continuations.");return await u(this,xr,"f")[0].endpoint.call(u(this,jh,"f"),{parse:!0})}if(I(this,xr,u(this,Gh,"m",Qg).call(this),"f"),u(this,xr,"f"))return this.getContinuationData()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Mi(this.actions,e,!0)}};r(Mi,"Feed");ke=new WeakMap,jh=new WeakMap,Ge=new WeakMap,xr=new WeakMap,Gh=new WeakSet,xE=r(function(e){return!("data"in e)},"_Feed_isParsed"),Qg=r(function(){if(u(this,ke,"f").header_memo){let e=u(this,ke,"f").header_memo.getType(X);return u(this,Ge,"f").getType(X).filter(i=>!e.includes(i))}return u(this,Ge,"f").getType(X)},"_Feed_getBodyContinuations");var be=Mi;var Ss,mb=class extends be{constructor(e,i,s=!1){super(e,i,s),Ss.set(this,void 0)}get filter_chips(){var e,i;if(u(this,Ss,"f"))return u(this,Ss,"f")||[];if(((e=this.memo.getType(wt))==null?void 0:e.length)>1)throw new g("There are too many feed filter chipbars, you'll need to find the correct one yourself in this.page");if(((i=this.memo.getType(wt))==null?void 0:i.length)===0)throw new g("There are no feed filter chipbars");return I(this,Ss,this.memo.getType(We),"f"),u(this,Ss,"f")||[]}get filters(){return this.filter_chips.map(e=>e.text.toString())||[]}async getFilteredFeed(e){var o;let i;if(typeof e=="string"){if(!this.filters.includes(e))throw new g("Filter not found",{available_filters:this.filters});i=this.filter_chips.find(p=>p.text.toString()===e)}else if(e.type==="ChipCloudChip")i=e;else throw new g("Invalid filter");if(!i)throw new g("Filter not found");if(i.is_selected)return this;let s=await((o=i.endpoint)==null?void 0:o.call(this.actions,{parse:!0}));if(!s)throw new g("Failed to get filtered feed");return new be(this.actions,s,!0)}};r(mb,"FilterableFeed");Ss=new WeakMap;var Li=mb;var Jg={};qe(Jg,{Feed:()=>be,FilterableFeed:()=>Li,MediaInfo:()=>ks,TabbedFeed:()=>Hh});var Oi,vt,Es,hb,db=class{constructor(e,i,s){var c,f,m,x,_,b,T,w,S,E,C,k,U,M,K,re,he,Y,ee,F,B,z;Oi.set(this,void 0),vt.set(this,void 0),Es.set(this,void 0),hb.set(this,void 0),I(this,vt,i,"f");let o=l.parseResponse(e[0].data.playerResponse?e[0].data.playerResponse:e[0].data),p=(c=e[1])!=null&&c.data?l.parseResponse(e[1].data):void 0;if(I(this,Oi,[o,p],"f"),I(this,Es,s,"f"),((f=o.playability_status)==null?void 0:f.status)==="ERROR")throw new g("This video is unavailable",o.playability_status);if(o.microformat&&!((m=o.microformat)!=null&&m.is(Je,Ei)))throw new g("Unsupported microformat",o.microformat);this.basic_info={...o.video_details,embed:(x=o.microformat)!=null&&x.is(Je)?(_=o.microformat)==null?void 0:_.embed:null,channel:(b=o.microformat)!=null&&b.is(Je)?(T=o.microformat)==null?void 0:T.channel:null,is_unlisted:(w=o.microformat)==null?void 0:w.is_unlisted,is_family_safe:(S=o.microformat)==null?void 0:S.is_family_safe,category:(E=o.microformat)!=null&&E.is(Je)?(C=o.microformat)==null?void 0:C.category:null,has_ypc_metadata:(k=o.microformat)!=null&&k.is(Je)?(U=o.microformat)==null?void 0:U.has_ypc_metadata:null,start_timestamp:(M=o.microformat)!=null&&M.is(Je)?o.microformat.start_timestamp:null,end_timestamp:(K=o.microformat)!=null&&K.is(Je)?o.microformat.end_timestamp:null,view_count:((re=o.microformat)==null?void 0:re.is(Je))&&isNaN((he=o.video_details)==null?void 0:he.view_count)?o.microformat.view_count:(Y=o.video_details)==null?void 0:Y.view_count,url_canonical:(ee=o.microformat)!=null&&ee.is(Ei)?(F=o.microformat)==null?void 0:F.url_canonical:null,tags:(B=o.microformat)!=null&&B.is(Ei)?(z=o.microformat)==null?void 0:z.tags:null,like_count:void 0,is_liked:void 0,is_disliked:void 0},this.annotations=o.annotations,this.storyboards=o.storyboards,this.endscreen=o.endscreen,this.captions=o.captions,this.cards=o.cards,this.streaming_data=o.streaming_data,this.playability_status=o.playability_status,this.player_config=o.player_config,I(this,hb,o.playback_tracking,"f")}async toDash(e,i,s={include_thumbnails:!1}){var f,m;let o=u(this,Oi,"f")[0];if(o.video_details&&o.video_details.is_live)throw new g("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 p,c;return s.include_thumbnails&&o.storyboards&&(p=o.storyboards),typeof s.captions_format=="string"&&((f=o.captions)==null?void 0:f.caption_tracks)&&(c=o.captions.caption_tracks),zi.toDash(this.streaming_data,(m=this.page[0].video_details)==null?void 0:m.is_post_live_dvr,e,i,u(this,Es,"f"),u(this,vt,"f").session.player,u(this,vt,"f"),p,c,s)}getStreamingInfo(e,i){var s;return xd(this.streaming_data,(s=this.page[0].video_details)==null?void 0:s.is_post_live_dvr,e,i,this.cpn,u(this,vt,"f").session.player,u(this,vt,"f"),u(this,Oi,"f")[0].storyboards?u(this,Oi,"f")[0].storyboards:void 0)}chooseFormat(e){return zi.chooseFormat(e,this.streaming_data)}async download(e={}){let i=u(this,Oi,"f")[0];if(i.video_details&&(i.video_details.is_live||i.video_details.is_post_live_dvr))throw new g("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 zi.download(e,u(this,vt,"f"),this.playability_status,this.streaming_data,u(this,vt,"f").session.player,this.cpn)}async getTranscript(){var p;let e=this.page[1];if(!e)throw new g("Cannot get transcript from basic video info.");if(!e.engagement_panels)throw new g("Engagement panels not found. Video likely has no transcript.");let i=e.engagement_panels.get({panel_identifier:"engagement-panel-searchable-transcript"});if(!i)throw new g("Transcript panel not found. Video likely has no transcript.");let s=(p=i.content)==null?void 0:p.as(X);if(!s)throw new g("Transcript continuation not found.");let o=await s.endpoint.call(this.actions);return new _b(this.actions,o)}async addToWatchHistory(e={}){var m;let i=ne.CLIENTS.WEB.NAME,s=ne.CLIENTS.WEB.VERSION,o="https://www.",p=(e==null?void 0:e.url)||((m=u(this,hb,"f"))==null?void 0:m.videostats_playback_url);if(!p)throw new g("Playback tracking not available");let c={cpn:u(this,Es,"f"),fmt:251,rtn:0,rt:0},f=p.replace("https://s.",o);return await u(this,vt,"f").stats(f,{client_name:i,client_version:s},c)}get actions(){return u(this,vt,"f")}get cpn(){return u(this,Es,"f")}get page(){return u(this,Oi,"f")}};r(db,"MediaInfo");Oi=new WeakMap,vt=new WeakMap,Es=new WeakMap,hb=new WeakMap;var ks=db;var yr,br,gr=class extends be{constructor(e,i,s=!1){var o;super(e,i,s),yr.set(this,void 0),br.set(this,void 0),I(this,yr,e,"f"),I(this,br,(o=this.page.contents_memo)==null?void 0:o.getType(Ie),"f")}get tabs(){var e,i;return(i=(e=u(this,br,"f"))==null?void 0:e.map(s=>s.title.toString()))!=null?i:[]}async getTabByName(e){var o;let i=(o=u(this,br,"f"))==null?void 0:o.find(p=>p.title.toLowerCase()===e.toLowerCase());if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,yr,"f"));return new gr(u(this,yr,"f"),s,!1)}async getTabByURL(e){var o;let i=(o=u(this,br,"f"))==null?void 0:o.find(p=>{var c;return((c=p.endpoint.metadata.url)==null?void 0:c.split("/").pop())===e});if(!i)throw new g(`Tab "${e}" not found`);if(i.selected)return this;let s=await i.endpoint.call(u(this,yr,"f"));return new gr(u(this,yr,"f"),s,!1)}hasTabWithURL(e){var i,s;return(s=(i=u(this,br,"f"))==null?void 0:i.some(o=>{var p;return((p=o.endpoint.metadata.url)==null?void 0:p.split("/").pop())===e}))!=null?s:!1}get title(){var e,i,s;return(s=(i=(e=this.page.contents_memo)==null?void 0:e.getType(Ie))==null?void 0:i.find(o=>o.selected))==null?void 0:s.title.toString()}};r(gr,"TabbedFeed");yr=new WeakMap,br=new WeakMap;var Hh=gr;var ge=class extends Hh{constructor(e,i,s=!1){var c,f,m,x,_;super(e,i,s),this.header=(f=(c=this.page.header)==null?void 0:c.item())==null?void 0:f.as(jr,A_,Mx,Rt);let o=(m=this.page.metadata)==null?void 0:m.item().as(D_),p=(x=this.page.microformat)==null?void 0:x.as(Ei);if(this.page.alerts){let b=this.page.alerts.first();if((b==null?void 0:b.alert_type)==="ERROR")throw new Cs(b.text.toString())}if(!o&&!this.page.contents)throw new g("Invalid channel",this);this.metadata={...o,...p||{}},this.subscribe_button=(_=this.page.header_memo)==null?void 0:_.getType(xe).first(),this.page.contents&&(this.current_tab=this.page.contents.item().as(Mt).tabs.array().filterType(Ie,Jr).get({selected:!0}))}async applyFilter(e){let i,s=this.memo.getType(wt).first();if(typeof e=="string"){if(i=s==null?void 0:s.contents.get({text:e}),!i)throw new g(`Filter ${e} not found`,{available_filters:this.filters})}else i=e;if(!i.endpoint)throw new g("Invalid filter",e);let o=await i.endpoint.call(this.actions,{parse:!0});if(!o)throw new g("No page returned",{filter:i});return new Di(this.actions,o,!0)}async applySort(e){let i=this.memo.getType(dt).first();if(!i||!i.sub_menu_items)throw new g("No sort filter sub menu found");let s=i.sub_menu_items.find(p=>p.title===e);if(!s)throw new g(`Sort filter ${e} not found`,{available_sort_filters:this.sort_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}async applyContentTypeFilter(e){var p,c,f;let i=(f=(c=(p=this.current_tab)==null?void 0:p.content)==null?void 0:c.as(de).sub_menu)==null?void 0:f.as(ga);if(!i)throw new g("Sub menu not found");let s=i.content_type_sub_menu_items.find(m=>m.title===e);if(!s)throw new g(`Sub menu item ${e} not found`,{available_filters:this.content_type_filters});if(s.selected)return this;let o=await s.endpoint.call(this.actions,{parse:!0});return new ge(this.actions,o,!0)}get filters(){var e,i;return((i=(e=this.memo.getType(wt))==null?void 0:e[0])==null?void 0:i.contents.filterType(We).map(s=>s.text))||[]}get sort_filters(){var i;let e=this.memo.getType(dt).first();return((i=e==null?void 0:e.sub_menu_items)==null?void 0:i.map(s=>s.title))||[]}get content_type_filters(){var i,s,o;let e=(o=(s=(i=this.current_tab)==null?void 0:i.content)==null?void 0:s.as(de).sub_menu)==null?void 0:o.as(ga);return(e==null?void 0:e.content_type_sub_menu_items.map(p=>p.title))||[]}async getHome(){let e=await this.getTabByURL("featured");return new ge(this.actions,e.page,!0)}async getVideos(){let e=await this.getTabByURL("videos");return new ge(this.actions,e.page,!0)}async getShorts(){let e=await this.getTabByURL("shorts");return new ge(this.actions,e.page,!0)}async getLiveStreams(){let e=await this.getTabByURL("streams");return new ge(this.actions,e.page,!0)}async getReleases(){let e=await this.getTabByURL("releases");return new ge(this.actions,e.page,!0)}async getPodcasts(){let e=await this.getTabByURL("podcasts");return new ge(this.actions,e.page,!0)}async getPlaylists(){let e=await this.getTabByURL("playlists");return new ge(this.actions,e.page,!0)}async getCommunity(){let e=await this.getTabByURL("community");return new ge(this.actions,e.page,!0)}async getAbout(){var i,s,o,p,c;if(this.hasTabWithURL("about"))return(await this.getTabByURL("about")).memo.getType(fa)[0];let e=((i=this.header)==null?void 0:i.is(jr))&&this.header.tagline;if(e||((s=this.header)==null?void 0:s.is(Rt))&&((o=this.header.content)==null?void 0:o.description)){if(e&&e.more_endpoint instanceof h){let x=await e.more_endpoint.call(this.actions);return new Hh(this.actions,x,!1).memo.getType(fa)[0]}let f=(c=(p=this.page.header_memo)==null?void 0:p.getType(X)[0])==null?void 0:c.endpoint;if(!f)throw new g("Failed to extract continuation to get channel about");let m=await f.call(this.actions,{parse:!0});if(!m.on_response_received_endpoints_memo)throw new g("Unexpected response while fetching channel about",{response:m});return m.on_response_received_endpoints_memo.getType(Cd)[0]}throw new g("About not found")}async search(e){var o;let i=(o=this.memo.getType(Jr))==null?void 0:o[0];if(!i)throw new g("Search tab not found",this);let s=await i.endpoint.call(this.actions,{query:e,parse:!0});return new ge(this.actions,s,!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_playlists(){return this.hasTabWithURL("playlists")}get has_community(){return this.hasTabWithURL("community")}get has_about(){var e,i,s,o,p;return this.hasTabWithURL("about")||!!(((e=this.header)==null?void 0:e.is(jr))&&((i=this.header.tagline)==null?void 0:i.more_endpoint))||!!(((s=this.header)==null?void 0:s.is(Rt))&&((p=(o=this.header.content)==null?void 0:o.description)==null?void 0:p.more_endpoint))}get has_search(){var e;return((e=this.memo.getType(Jr))==null?void 0:e.length)>0}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new wr(this.actions,e,!0)}};r(ge,"Channel");var wr=class extends be{constructor(e,i,s=!1){var o,p;super(e,i,s),this.contents=((o=this.page.on_response_received_actions)==null?void 0:o.first())||((p=this.page.on_response_received_endpoints)==null?void 0:p.first())}async getContinuation(){let e=await super.getContinuationData();if(!e)throw new g("Could not get continuation data");return new wr(this.actions,e,!0)}};r(wr,"ChannelListContinuation");var Di=class extends Li{constructor(e,i,s=!1){var o;super(e,i,s),this.applied_filter=this.memo.getType(We).get({is_selected:!0}),this.page.on_response_received_actions&&this.page.on_response_received_actions.length>1&&this.page.on_response_received_actions.shift(),this.contents=(o=this.page.on_response_received_actions)==null?void 0:o.first()}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Di(this.actions,i.page,!0)}async getContinuation(){let e=await super.getContinuationData();if(!(e!=null&&e.on_response_received_actions_memo))throw new g("Unexpected continuation data",e);return e.on_response_received_actions_memo.set("FeedFilterChipBar",this.memo.getType(wt)),e.on_response_received_actions_memo.set("ChipCloudChip",this.memo.getType(We)),new Di(this.actions,e,!0)}};r(Di,"FilteredChannelList");var Ps,Yt,Ns,Tr=class{constructor(e,i,s=!1){var m,x,_;Ps.set(this,void 0),Yt.set(this,void 0),Ns.set(this,void 0),I(this,Ps,s?i:l.parseResponse(i),"f"),I(this,Yt,e,"f");let o=u(this,Ps,"f").on_response_received_endpoints;if(!o)throw new g("Comments page did not have any content.");let p=o.at(0),c=o.at(1);this.header=(m=p==null?void 0:p.contents)==null?void 0:m.firstOfType(vi);let f=((x=c==null?void 0:c.contents)==null?void 0:x.filterType(ex))||[];this.contents=G(f.map(b=>(b.comment&&b.comment.setActions(u(this,Yt,"f")),b.setActions(u(this,Yt,"f")),b))),I(this,Ns,(_=c==null?void 0:c.contents)==null?void 0:_.firstOfType(X),"f")}async applySort(e){var o,p,c,f;if(!this.header)throw new g("Page header is missing. Cannot apply sort option.");let i;if(e==="TOP_COMMENTS"?i=(p=(o=this.header.sort_menu)==null?void 0:o.sub_menu_items)==null?void 0:p.at(0):e==="NEWEST_FIRST"&&(i=(f=(c=this.header.sort_menu)==null?void 0:c.sub_menu_items)==null?void 0:f.at(1)),!i)throw new g("Could not find target button.");if(i.selected)return this;let s=await i.endpoint.call(u(this,Yt,"f"),{parse:!0});return new Tr(u(this,Yt,"f"),s,!0)}async createComment(e){var s;if(!this.header)throw new g("Page header is missing. Cannot create comment.");let i=(s=this.header.create_renderer)==null?void 0:s.as(J_).submit_button;if(!i)throw new g("Could not find target button. You are probably not logged in.");if(!i.endpoint)throw new g("Button does not have an endpoint.");return await i.endpoint.call(u(this,Yt,"f"),{commentText:e})}async getContinuation(){if(!u(this,Ns,"f"))throw new g("Continuation not found");let e=await u(this,Ns,"f").endpoint.call(u(this,Yt,"f"),{parse:!0}),i=Object.assign({},u(this,Ps,"f"));if(!i.on_response_received_endpoints||!e.on_response_received_endpoints)throw new g("Invalid reponse format, missing on_response_received_endpoints.");return i.on_response_received_endpoints.pop(),i.on_response_received_endpoints.push(e.on_response_received_endpoints[0]),new Tr(u(this,Yt,"f"),i,!0)}get has_continuation(){return!!u(this,Ns,"f")}get page(){return u(this,Ps,"f")}};r(Tr,"Comments");Ps=new WeakMap,Yt=new WeakMap,Ns=new WeakMap;var yE=Tr;var As,xb=class{constructor(e){As.set(this,void 0),I(this,As,l.parseResponse(e),"f"),u(this,As,"f").items&&(this.contents=u(this,As,"f").items.array().as(Zr,Ex))}get page(){return u(this,As,"f")}};r(xb,"Guide");As=new WeakMap;var bE=xb;var Vt=class extends be{constructor(e,i,s=!1){super(e,i,s),this.sections=this.memo.getType(Tt),this.feed_actions=this.memo.getType(i_).first()}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new Error("No continuation data found");return new Vt(this.actions,e,!0)}async removeVideo(e){let i;for(let c of this.sections)for(let f of c.contents){let m=f;if(m.id===e&&m.menu){i=m.menu.top_level_buttons[0].as(v).endpoint.payload.feedbackToken;break}}if(!i)throw new Error("Failed to get feedback token");let s={feedbackTokens:[i]};if(!(await this.actions.execute("/feedback",s)).data.feedbackResponses[0].isProcessed)throw new Error("Failed to remove video from watch history");return!0}};r(Vt,"History");var ti=class extends Li{constructor(e,i,s=!1){var o;super(e,i,s),this.header=this.memo.getType(gx).first(),this.contents=this.memo.getType(Ci).first()||((o=this.page.on_response_received_actions)==null?void 0:o.first())}async applyFilter(e){let i=await super.getFilteredFeed(e);return new ti(this.actions,i.page,!0)}async getContinuation(){var i;let e=await super.getContinuation();return e.page.header=this.page.header,this.header&&((i=e.page.header_memo)==null||i.set(this.header.type,[this.header])),new ti(this.actions,e.page,!0)}};r(ti,"HomeFeed");var Bi=class extends Li{constructor(e,i){if(super(e,i),!this.page.contents_memo)throw new g("Unexpected response",this.page);let s=this.page.contents_memo.getType(Ie).first();if(!s.content)throw new g("Content tab has no content",s);this.page.header&&(this.header=this.page.header.item().as(kx,Rt)),this.contents=s.content.as(Ci)}async applyFilter(e){let i=await super.getFilteredFeed(e);return new Bi(this.actions,i.page)}};r(Bi,"HashtagFeed");var yb,bb,$h,gb=class{constructor(e,i){yb.set(this,void 0),bb.set(this,void 0),$h.set(this,void 0),I(this,yb,e,"f"),I(this,bb,i,"f");let s=e==null?void 0:e.live_chat_item_context_menu_supported_renderers;if(!s||!s.is(R))throw new g('Response did not have a "live_chat_item_context_menu_supported_renderers" property. The call may have failed.');I(this,$h,s.as(R).items,"f")}async selectItem(e){let i;if(e instanceof v){if(!e.endpoint)throw new g("Item does not have an endpoint.");i=e.endpoint}else{let s=u(this,$h,"f").find(o=>o.is(Pt)?o.as(Pt).icon_type===e:!1);if(!s||!s.is(Pt))throw new g(`Button "${e}" not found.`);i=s.endpoint}if(!i)throw new g("Target button does not have an endpoint.");return await i.call(u(this,bb,"f"),{parse:!0})}items(){return u(this,$h,"f")}page(){return u(this,yb,"f")}};r(gb,"ItemMenu");yb=new WeakMap,bb=new WeakMap,$h=new WeakMap;var wb=gb;var Kh,Tb,Rs=class extends be{constructor(e,i,s=!1){var m,x,_,b,T;super(e,i,s),Kh.add(this);let o=this.memo.getType(Ry).first(),p=this.memo.getType(Ly).first(),c=this.memo.getType(Oy).first(),f=(m=this.page.alerts)==null?void 0:m.firstOfType(Lr);if(f&&f.alert_type==="ERROR")throw new g(f.text.toString(),f);if(!p&&!c&&Object.keys(this.page).length===0)throw new g("Got empty continuation response. This is likely the end of the playlist.");this.info={...(x=this.page.metadata)==null?void 0:x.item().as(My),subtitle:o?o.subtitle:null,author:(b=(_=c==null?void 0:c.owner)==null?void 0:_.as(hs).author)!=null?b:o==null?void 0:o.author,thumbnails:(T=p==null?void 0:p.thumbnail_renderer)==null?void 0:T.as(Kr,$r).thumbnail,total_items:u(this,Kh,"m",Tb).call(this,0,p),views:u(this,Kh,"m",Tb).call(this,1,p),last_updated:u(this,Kh,"m",Tb).call(this,2,p),can_share:o==null?void 0:o.can_share,can_delete:o==null?void 0:o.can_delete,is_editable:o==null?void 0:o.is_editable,privacy:o==null?void 0:o.privacy},this.menu=p==null?void 0:p.menu,this.endpoint=p==null?void 0:p.endpoint,this.messages=this.memo.getType(Si)}get items(){return G(this.videos.as(ns,ps,ms).filter(e=>e.style!=="PLAYLIST_VIDEO_RENDERER_STYLE_RECOMMENDED_VIDEO"))}get has_continuation(){let e=this.memo.getType(de).first();return e?!!this.memo.getType(X).find(i=>!e.contents.includes(i)):super.has_continuation}async getContinuationData(){let e=this.memo.getType(de).first();if(!e)return await super.getContinuationData();let i=this.memo.getType(X).find(s=>!e.contents.includes(s));if(!i)throw new g("There are no continuations.");return await i.endpoint.call(this.actions,{parse:!0})}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new Rs(this.actions,e,!0)}};r(Rs,"Playlist");Kh=new WeakSet,Tb=r(function(e,i){var s;return!i||!i.stats?"N/A":((s=i.stats[e])==null?void 0:s.toString())||"N/A"},"_Playlist_getStat");var Ms=Rs;var Zg,gE,vb=class extends be{constructor(e,i){if(super(e,i),Zg.add(this),!this.page.contents_memo)throw new g("Page contents not found");this.header=this.memo.getType(Rt).first();let s=this.page.contents_memo.getType(fs);this.sections=s.map(o=>{var p;return{type:o.icon_type,title:o.title,contents:((p=o.content)==null?void 0:p.key("items").array())||[],getAll:()=>u(this,Zg,"m",gE).call(this,o)}})}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")}};r(vb,"Library");Zg=new WeakSet,gE=r(async function(e){var o;if(!((o=e.menu)!=null&&o.as(R).top_level_buttons))throw new g(`The ${e.title.text} shelf doesn't have more items`);let i=e.menu.as(R).top_level_buttons.firstOfType(v);if(!i)throw new g("Did not find target button.");let s=await i.as(v).endpoint.call(this.actions,{parse:!0});switch(e.icon_type){case"LIKE":case"WATCH_LATER":return new Ms(this.actions,s,!0);case"WATCH_HISTORY":return new Vt(this.actions,s,!0);case"CONTENT_CUT":return new be(this.actions,s,!0);default:throw new g("Target shelf not implemented.")}},"_Library_getAll");var wE=vb;var ii,Yi,vr,tt,It,je;function G1(t){let e=[];for(let i of t)if(Array.isArray(i))for(let s of i)e.push(s);else e.push(i);return e}r(G1,"flattenQueue");var Ib=class{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())}};r(Ib,"DelayQueue");var Sb=class{constructor(){ii.set(this,void 0),Yi.set(this,void 0),vr.set(this,void 0),tt.set(this,void 0),It.set(this,void 0),je.set(this,void 0),I(this,ii,null,"f"),I(this,Yi,null,"f"),I(this,vr,null,"f"),I(this,tt,[],"f"),I(this,It,null,"f"),I(this,je,new Ib,"f")}enqueueActionGroup(e){if(u(this,ii,"f")!==null){let i=Date.now()-u(this,ii,"f");u(this,je,"f").back.push(i),5{o.length?o.length<10?await u(this,we,"m",Cb).call(this,o):this.is_replay?(u(this,we,"m",Cb).call(this,o),await u(this,we,"m",Ir).call(this,2e3)):u(this,we,"m",Cb).call(this,o):await u(this,we,"m",Ir).call(this,2e3),this.running&&u(this,we,"m",ew).call(this)}}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}start(){this.running||(this.running=!0,u(this,we,"m",ew).call(this),u(this,we,"m",TE).call(this))}stop(){this.smoothed_queue.clear(),this.running=!1}async sendMessage(e){let i=IT.encode({params:{ids:{videoId:u(this,Qh,"f"),channelId:u(this,kb,"f")}},number0:1,number1:4}),s=btoa(encodeURIComponent(Kt(i.finish()))),o=await u(this,ri,"f").execute("/live_chat/send_message",{richMessage:{textSegments:[{text:e}]},clientMessageId:L.shim.uuidv4(),client:"WEB",parse:!0,params:s});if(!o.actions)throw new g("Unexpected response from send_message",o);return o.actions.array().as(Vx)}applyFilter(e){var s,o,p,c,f,m,x;if(!this.initial_info)throw new g("Cannot apply filter before initial info is retrieved.");let i=(p=(o=(s=this.initial_info)==null?void 0:s.header)==null?void 0:o.view_selector)==null?void 0:p.sub_menu_items;if(e==="TOP_CHAT"){if((c=i==null?void 0:i.at(0))!=null&&c.selected)return;I(this,Sr,(f=i==null?void 0:i.at(0))==null?void 0:f.continuation,"f")}else{if((m=i==null?void 0:i.at(1))!=null&&m.selected)return;I(this,Sr,(x=i==null?void 0:i.at(1))==null?void 0:x.continuation,"f")}}async getItemMenu(e){if(!e.hasKey("menu_endpoint")||!e.key("menu_endpoint").isInstanceof(h))throw new g("This item does not have a menu.",e);let i=await e.key("menu_endpoint").instanceof(h).call(u(this,ri,"f"),{parse:!0});if(!i)throw new g("Could not retrieve item menu.",e);return new wb(i,u(this,ri,"f"))}async selectButton(e){return await e.endpoint.call(u(this,ri,"f"),{parse:!0})}};r(Pb,"LiveChat");ri=new WeakMap,Qh=new WeakMap,kb=new WeakMap,Sr=new WeakMap,qh=new WeakMap,zh=new WeakMap,we=new WeakSet,ew=r(function t(){(async()=>{var e,i;try{let s=await u(this,ri,"f").execute(this.is_replay?"live_chat/get_live_chat_replay":"live_chat/get_live_chat",{continuation:u(this,Sr,"f"),parse:!0}),o=s.continuation_contents;if(o||(this.emit("error",new g("Unexpected live chat incremental continuation response",s)),this.emit("end"),this.stop()),!(o instanceof Ai)){this.stop(),this.emit("end");return}I(this,Sr,o.continuation.token,"f"),o.header?(this.initial_info=o,this.emit("start",o),this.running&&u(this,we,"m",t).call(this)):this.smoothed_queue.enqueueActionGroup(o.actions),I(this,zh,0,"f")}catch(s){this.emit("error",s),I(this,zh,(i=u(this,zh,"f"),e=i++,i),"f"),e<10?(await u(this,we,"m",Ir).call(this,2e3),u(this,we,"m",t).call(this)):(this.emit("error",new g("Reached retry limit for incremental continuation requests",s)),this.emit("end"),this.stop())}})()},"_LiveChat_pollLivechat"),Cb=r(async function(e){let s=e.length<125?1:Math.ceil(e.length/125),o=s==1?(s=1e4/e.length,s*=Math.random()+.5,s=Math.min(1e3,s),s=Math.max(80,s)):s=80;for(let p of e)await u(this,we,"m",Ir).call(this,o),this.emit("chat-update",p)},"_LiveChat_emitSmoothedActions"),TE=r(function t(){(async()=>{var e,i,s,o,p,c,f,m,x,_,b;try{let T={videoId:u(this,Qh,"f")};u(this,qh,"f")&&(T.continuation=u(this,qh,"f"));let w=await u(this,ri,"f").execute("/updated_metadata",T),S=l.parseResponse(w.data);I(this,qh,(e=S.continuation)==null?void 0:e.token,"f"),this.metadata={title:((i=S.actions)==null?void 0:i.array().firstOfType($x))||((s=this.metadata)==null?void 0:s.title),description:((o=S.actions)==null?void 0:o.array().firstOfType(Hx))||((p=this.metadata)==null?void 0:p.description),views:((c=S.actions)==null?void 0:c.array().firstOfType(qx))||((f=this.metadata)==null?void 0:f.views),likes:((m=S.actions)==null?void 0:m.array().firstOfType(Kx))||((x=this.metadata)==null?void 0:x.likes),date:((_=S.actions)==null?void 0:_.array().firstOfType(jx))||((b=this.metadata)==null?void 0:b.date)},this.emit("metadata-update",this.metadata),await u(this,we,"m",Ir).call(this,5e3),this.running&&u(this,we,"m",t).call(this)}catch{await u(this,we,"m",Ir).call(this,2e3),this.running&&u(this,we,"m",t).call(this)}})()},"_LiveChat_pollMetadata"),Ir=r(async function(e){return new Promise(i=>setTimeout(()=>i(),e))},"_LiveChat_wait");var Nb=Pb;var Vi,Xh,Ls=class{constructor(e,i){if(Vi.set(this,void 0),Xh.set(this,void 0),I(this,Xh,e,"f"),I(this,Vi,l.parseResponse(i.data),"f"),!u(this,Vi,"f").actions_memo)throw new g("Page actions not found");this.header=u(this,Vi,"f").actions_memo.getType(sy).first(),this.contents=u(this,Vi,"f").actions_memo.getType(by)}async getContinuation(){var s;let e=(s=u(this,Vi,"f").actions_memo)==null?void 0:s.getType(X).first();if(!e)throw new g("Continuation not found");let i=await e.endpoint.call(u(this,Xh,"f"),{parse:!1});return new Ls(u(this,Xh,"f"),i)}get page(){return u(this,Vi,"f")}};r(Ls,"NotificationsMenu");Vi=new WeakMap,Xh=new WeakMap;var vE=Ls;var si=class extends be{constructor(e,i,s=!1){var p,c,f;super(e,i,s);let o=((p=this.page.contents_memo)==null?void 0:p.getType(de).first().contents)||((c=this.page.on_response_received_commands)==null?void 0:c.first().contents);if(!o)throw new g("No contents found in search response");this.page.header&&(this.header=this.page.header.item().as(Uy)),this.results=G(o.filterType(Tt).flatMap(m=>m.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(Fy).first(),this.watch_card=this.page.contents_memo.getType(Zy).first()),this.refinement_cards=(f=this.results)==null?void 0:f.firstOfType(bi)}async selectRefinementCard(e){var o,p;let i;if(typeof e=="string"){if(!this.refinement_cards)throw new g("No refinement cards found.");if(i=(p=(o=this.refinement_cards)==null?void 0:o.cards.get({query:e}))==null?void 0:p.as(Ji),!i)throw new g(`Refinement card "${e}" not found`,{available_cards:this.refinement_card_queries})}else if(e.type==="SearchRefinementCard")i=e;else throw new g("Invalid refinement card!");let s=await i.endpoint.call(this.actions,{parse:!0});return new si(this.actions,s,!0)}get refinement_card_queries(){var e;return((e=this.refinement_cards)==null?void 0:e.cards.as(Ji).map(i=>i.query))||[]}async getContinuation(){let e=await this.getContinuationData();if(!e)throw new g("Could not get continuation data");return new si(this.actions,e,!0)}};r(si,"Search");var Er,Jh,Os=class{constructor(e,i){var p,c,f,m;if(Er.set(this,void 0),Jh.set(this,void 0),I(this,Jh,e,"f"),I(this,Er,l.parseResponse(i.data),"f"),this.sidebar=(p=u(this,Er,"f").sidebar)==null?void 0:p.as(Gy),!u(this,Er,"f").contents)throw new g("Page contents not found");let s=u(this,Er,"f").contents.item().as(Mt).tabs.array().as(Ie).get({selected:!0});if(!s)throw new g("Target tab not found");let o=(c=s.content)==null?void 0:c.as(de).contents.as(Tt);this.introduction=(m=(f=o==null?void 0:o.shift())==null?void 0:f.contents)==null?void 0:m.firstOfType(wy),this.sections=o==null?void 0:o.map(x=>{var _;return{title:(_=x.header)!=null&&_.is(vi,es,ts)?x.header.title.toString():null,contents:x.contents}})}async selectSidebarItem(e){if(!this.sidebar)throw new g("Sidebar not available");let i;if(typeof e=="string"){if(i=this.sidebar.items.get({title:e}),!i)throw new g(`Item "${e}" not found`,{available_items:this.sidebar_items})}else if(e!=null&&e.is(_i))i=e;else throw new g("Invalid item",{target_item:e});let s=await i.endpoint.call(u(this,Jh,"f"),{parse:!1});return new Os(u(this,Jh,"f"),s)}getSettingOption(e){var i;if(!this.sections)throw new g("Sections not available");for(let s of this.sections)if(!!s.contents)for(let o of s.contents){let p=o.as(us).options;if(p){for(let c of p)if(c.is(cs)&&((i=c.title)==null?void 0:i.toString())===e)return c}}throw new g(`Option "${e}" not found`,{available_options:this.setting_options})}get setting_options(){if(!this.sections)throw new g("Sections not available");let e=[];for(let i of this.sections)if(!!i.contents)for(let s of i.contents)s.as(us).options&&(e=e.concat(s.as(us).options));return e.map(i=>{var s;return(s=i.title)==null?void 0:s.toString()}).filter(i=>i)}get sidebar_items(){if(!this.sidebar)throw new g("Sidebar not available");return this.sidebar.items.map(e=>e.title.toString())}get page(){return u(this,Er,"f")}};r(Os,"Settings");Er=new WeakMap,Jh=new WeakMap;var IE=Os;var Ui,Ds=class extends ks{constructor(e,i,s){var x,_,b,T,w,S,E,C,k,U,M,K,re,he,Y,ee,F,B,z,J,Be,lt,ct,ut,Ye,pi,Wt,pe,Ke;super(e,i,s),Ui.set(this,void 0);let[o,p]=this.page;if(this.streaming_data){let le=this.streaming_data.adaptive_formats.find(Ce=>{var et;return(et=Ce.audio_track)==null?void 0:et.audio_is_default});if(le)this.streaming_data.formats.forEach(Ce=>Ce.language=le.language);else if(((x=this.captions)==null?void 0:x.caption_tracks)&&((_=this.captions)==null?void 0:_.caption_tracks.length)>0){let Ce=this.captions.caption_tracks.find(oe=>oe.kind==="asr"),et=Ce==null?void 0:Ce.language_code;this.streaming_data.adaptive_formats.forEach(oe=>{oe.has_audio&&(oe.language=et)}),this.streaming_data.formats.forEach(oe=>oe.language=et)}}let c=(b=p==null?void 0:p.contents)==null?void 0:b.item().as(Jy),f=c==null?void 0:c.results,m=c==null?void 0:c.secondary_results;if(f&&m){if(((T=o.microformat)==null?void 0:T.is(Je))&&((w=o.microformat)==null?void 0:w.category)==="Gaming"){let oe=(C=(E=(S=f.firstOfType(kh))==null?void 0:S.metadata)==null?void 0:E.rows)==null?void 0:C.firstOfType(cm);oe!=null&&oe.is(cm)&&(this.game_info={title:(U=(k=oe==null?void 0:oe.contents)==null?void 0:k.firstOfType(pm))==null?void 0:U.title,release_year:(K=(M=oe==null?void 0:oe.contents)==null?void 0:M.firstOfType(pm))==null?void 0:K.subtitle})}this.primary_info=f.firstOfType(tb),this.secondary_info=f.firstOfType(kh),this.merchandise=f.firstOfType(oy),this.related_chip_cloud=(re=m.firstOfType(By))==null?void 0:re.content.as(Hr),c!=null&&c.playlist&&(this.playlist=c.playlist),this.watch_next_feed=((he=m.firstOfType(Tt))==null?void 0:he.contents)||m,this.watch_next_feed&&Array.isArray(this.watch_next_feed)&&((Y=this.watch_next_feed.at(-1))==null?void 0:Y.is(X))&&I(this,Ui,(ee=this.watch_next_feed.pop())==null?void 0:ee.as(X),"f"),this.player_overlays=(F=p==null?void 0:p.player_overlays)==null?void 0:F.item().as(Ay),c!=null&&c.autoplay&&(this.autoplay=c.autoplay);let le=(z=(B=this.primary_info)==null?void 0:B.menu)==null?void 0:z.top_level_buttons.firstOfType(fr);((J=le==null?void 0:le.like_button)==null?void 0:J.is(se))&&((Be=le==null?void 0:le.dislike_button)==null?void 0:Be.is(se))&&(this.basic_info.like_count=(lt=le==null?void 0:le.like_button)==null?void 0:lt.like_count,this.basic_info.is_liked=(ct=le==null?void 0:le.like_button)==null?void 0:ct.is_toggled,this.basic_info.is_disliked=(ut=le==null?void 0:le.dislike_button)==null?void 0:ut.is_toggled);let Ce=(pi=(Ye=this.primary_info)==null?void 0:Ye.menu)==null?void 0:pi.top_level_buttons.firstOfType(qt);if(Ce&&(this.basic_info.like_count=Ce.like_count,Ce.like_button)){let oe=Ce.like_button.like_status_entity.like_status;this.basic_info.is_liked=oe==="LIKE",this.basic_info.is_disliked=oe==="DISLIKE"}let et=(Wt=f.get({target_id:"comments-entry-point"}))==null?void 0:Wt.as(Tt);this.comments_entry_point_header=(pe=et==null?void 0:et.contents)==null?void 0:pe.firstOfType(X_),this.livechat=(Ke=p==null?void 0:p.contents_memo)==null?void 0:Ke.getType(Dx).first()}}async selectFilter(e){var p,c,f,m;if(!this.related_chip_cloud)throw new g("Chip cloud not found, cannot apply filter");let i;if(typeof e=="string"){let x=(c=(p=this.related_chip_cloud)==null?void 0:p.chips)==null?void 0:c.get({text:e});if(!x)throw new g("Invalid filter",{available_filters:this.filters});i=x}else if(e!=null&&e.is(We))i=e;else throw new g("Invalid cloud chip",e);if(i.is_selected)return this;let s=await((f=i.endpoint)==null?void 0:f.call(this.actions,{parse:!0})),o=(m=s==null?void 0:s.on_response_received_endpoints)==null?void 0:m.get({target_id:"watch-next-feed"});return this.watch_next_feed=o==null?void 0:o.contents,this}async addToWatchHistory(e={}){return super.addToWatchHistory(e)}async getWatchNextContinuation(){var s,o,p,c,f;if(!u(this,Ui,"f"))throw new g("Watch next feed continuation not found");let e=await((s=u(this,Ui,"f"))==null?void 0:s.endpoint.call(this.actions,{parse:!0})),i=(o=e==null?void 0:e.on_response_received_endpoints)==null?void 0:o.get({type:"AppendContinuationItemsAction"});if(!i)throw new g("AppendContinuationItemsAction not found");return this.watch_next_feed=i==null?void 0:i.contents,(c=(p=this.watch_next_feed)==null?void 0:p.at(-1))!=null&&c.is(X)?I(this,Ui,(f=this.watch_next_feed.pop())==null?void 0:f.as(X),"f"):I(this,Ui,void 0,"f"),this}async like(){var o,p,c,f,m;let e=(p=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:p.top_level_buttons.firstOfType(qt);if(e){let x=(c=e==null?void 0:e.like_button)==null?void 0:c.toggle_button;if(!x||!x.default_button||!e.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="LIKE")throw new g("This video is already liked",{video_id:this.basic_info.id});return await new h(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(fr),s=i==null?void 0:i.like_button;if(!s)throw new g("Like button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Like button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already liked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async dislike(){var o,p,c,f,m;let e=(p=(o=this.primary_info)==null?void 0:o.menu)==null?void 0:p.top_level_buttons.firstOfType(qt);if(e){let x=(c=e==null?void 0:e.dislike_button)==null?void 0:c.toggle_button;if(!x||!x.default_button||!e.dislike_button||!e.like_button)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(e.like_button.like_status_entity.like_status==="DISLIKE")throw new g("This video is already disliked",{video_id:this.basic_info.id});return await new h(x.default_button.on_tap.payload.commands.find(T=>T.innertubeCommand)).call(this.actions)}let i=(m=(f=this.primary_info)==null?void 0:f.menu)==null?void 0:m.top_level_buttons.firstOfType(fr),s=i==null?void 0:i.dislike_button;if(!s)throw new g("Dislike button not found",{video_id:this.basic_info.id});if(!s.is(se))throw new g("Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(s.is_toggled)throw new g("This video is already disliked",{video_id:this.basic_info.id});return await s.endpoint.call(this.actions)}async removeRating(){var c,f,m,x,_,b,T;let e,i=(f=(c=this.primary_info)==null?void 0:c.menu)==null?void 0:f.top_level_buttons.firstOfType(qt);if(i){let w=(m=i==null?void 0:i.like_button)==null?void 0:m.toggle_button;if(!w||!w.default_button||!i.like_button)throw new g("Like button not found",{video_id:this.basic_info.id});let S=i.like_button.like_status_entity.like_status;if(S==="LIKE")e=(x=i==null?void 0:i.like_button)==null?void 0:x.toggle_button;else if(S==="DISLIKE")e=(_=i==null?void 0:i.dislike_button)==null?void 0:_.toggle_button;else throw new g("This video is not liked/disliked",{video_id:this.basic_info.id});if(!e||!e.toggled_button)throw new g("Like/Dislike button not found",{video_id:this.basic_info.id});return await new h(e.toggled_button.on_tap.payload.commands.find(C=>C.innertubeCommand)).call(this.actions)}let s=(T=(b=this.primary_info)==null?void 0:b.menu)==null?void 0:T.top_level_buttons.firstOfType(fr),o=s==null?void 0:s.like_button,p=s==null?void 0:s.dislike_button;if(!(o!=null&&o.is(se))||!(p!=null&&p.is(se)))throw new g("Like/Dislike button is not a toggle button. This action is likely disabled for this video.",{video_id:this.basic_info.id});if(o!=null&&o.is_toggled?e=o:p!=null&&p.is_toggled&&(e=p),!e)throw new g("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 g("Live Chat is not available",{video_id:this.basic_info.id});return new Nb(this)}getTrailerInfo(){var e,i;if(this.has_trailer&&this.playability_status){let s=(i=(e=this.playability_status.error_screen)==null?void 0:e.as(Ef).trailer)==null?void 0:i.player_response;if(s)return new Ds([{data:s}],this.actions,this.cpn)}return null}get filters(){var e,i;return((i=(e=this.related_chip_cloud)==null?void 0:e.chips)==null?void 0:i.map(s=>{var o;return(o=s.text)==null?void 0:o.toString()}))||[]}get wn_has_continuation(){return!!u(this,Ui,"f")}get autoplay_video_endpoint(){var e,i,s;return((s=(i=(e=this.autoplay)==null?void 0:e.sets)==null?void 0:i[0])==null?void 0:s.autoplay_video)||null}get has_trailer(){var e,i;return!!((i=(e=this.playability_status)==null?void 0:e.error_screen)!=null&&i.is(Ef))}get music_tracks(){var i,s,o,p,c,f;let e=(s=(i=this.page[1])==null?void 0:i.engagement_panels)==null?void 0:s.filter(m=>{var x;return(x=m.content)==null?void 0:x.is(tr)});if(e!==void 0&&e.length>0){let m=(c=(p=(o=e[0].content)==null?void 0:o.as(tr))==null?void 0:p.items)==null?void 0:c.filterType(Wr);if(m!==void 0&&m.length>0)return(f=m[0].carousel_lockups)==null?void 0:f.map(x=>{var C,k,U,M,K,re,he,Y,ee,F,B,z,J,Be,lt,ct,ut,Ye,pi;let _,b,T,w,S,E;_=(k=(C=x.video_lockup)==null?void 0:C.title)==null?void 0:k.toString(),S=(U=x.video_lockup)==null?void 0:U.endpoint.payload.videoId;for(let Wt=0;Wtm.title.toString()===e);if(!i)throw new Error(`Language not found: ${e}`);if(i.selected)return this;let s=await u(this,ed,"f").execute("/get_transcript",{params:i.continuation});return new Ys(u(this,ed,"f"),s)}get languages(){var e,i,s,o;return((o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.map(p=>p.title.toString()))||[]}get selectedLanguage(){var e,i,s,o,p;return((p=(o=(s=(i=(e=this.transcript.content)==null?void 0:e.footer)==null?void 0:i.language_menu)==null?void 0:s.sub_menu_items)==null?void 0:o.find(c=>c.selected))==null?void 0:p.title.toString())||""}get page(){return u(this,Bs,"f")}};r(Ys,"TranscriptInfo");Bs=new WeakMap,ed=new WeakMap;var _b=Ys;var SE={};var P=class{constructor(e,i,s,o){var c,f,m,x,_,b,T,w,S,E,C,k,U,M,K,re,he,Y,ee,F,B,z,J,Be,lt,ct,ut;let p=new a(e);this.id=o||((x=(m=(f=(c=p==null?void 0:p.runs)==null?void 0:c[0])==null?void 0:f.endpoint)==null?void 0:m.payload)==null?void 0:x.browseId)||((b=(_=p==null?void 0:p.endpoint)==null?void 0:_.payload)==null?void 0:b.browseId)||"N/A",this.name=(p==null?void 0:p.text)||"N/A",this.thumbnails=s?y.fromResponse(s):[],this.endpoint=((w=(T=p==null?void 0:p.runs)==null?void 0:T[0])==null?void 0:w.endpoint)||(p==null?void 0:p.endpoint),i?Array.isArray(i)?(this.badges=l.parseArray(i),this.is_moderator=(S=this.badges)==null?void 0:S.some(Ye=>Ye.icon_type=="MODERATOR"),this.is_verified=(E=this.badges)==null?void 0:E.some(Ye=>Ye.style=="BADGE_STYLE_TYPE_VERIFIED"),this.is_verified_artist=(C=this.badges)==null?void 0:C.some(Ye=>Ye.style=="BADGE_STYLE_TYPE_VERIFIED_ARTIST")):(this.badges=G([]),this.is_verified=!!i.isVerified,this.is_verified_artist=!!i.isArtist):this.badges=G([]),this.url=((K=(M=(U=(k=p==null?void 0:p.runs)==null?void 0:k[0])==null?void 0:U.endpoint)==null?void 0:M.metadata)==null?void 0:K.api_url)==="/browse"&&`${Ve.YT_BASE}${((ee=(Y=(he=(re=p==null?void 0:p.runs)==null?void 0:re[0])==null?void 0:he.endpoint)==null?void 0:Y.payload)==null?void 0:ee.canonicalBaseUrl)||`/u/${(J=(z=(B=(F=p==null?void 0:p.runs)==null?void 0:F[0])==null?void 0:B.endpoint)==null?void 0:z.payload)==null?void 0:J.browseId}`}`||`${Ve.YT_BASE}${((lt=(Be=p==null?void 0:p.endpoint)==null?void 0:Be.payload)==null?void 0:lt.canonicalBaseUrl)||`/u/${(ut=(ct=p==null?void 0:p.endpoint)==null?void 0:ct.payload)==null?void 0:ut.browseId}`}`}get best_thumbnail(){return this.thumbnails[0]}};r(P,"Author");var j1=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],AE=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],H1="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",RE="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",rw={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},sw="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",$1={5:sw,"5module":sw+" export import",6:sw+" const class extends export import super"},K1=/^in(stanceof)?$/,q1=new RegExp("["+RE+"]"),z1=new RegExp("["+RE+H1+"]");function nw(t,e){for(var i=65536,s=0;st)return!1;if(i+=e[s+1],i>=t)return!0}return!1}r(nw,"isInAstralSet");function oi(t,e){return t<65?t===36:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&q1.test(String.fromCharCode(t)):e===!1?!1:nw(t,AE)}r(oi,"isIdentifierStart");function Vs(t,e){return t<48?t===36:t<58?!0:t<65?!1:t<91?!0:t<97?t===95:t<123?!0:t<=65535?t>=170&&z1.test(String.fromCharCode(t)):e===!1?!1:nw(t,AE)||nw(t,j1)}r(Vs,"isIdentifierChar");var $=r(function(e,i){i===void 0&&(i={}),this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null},"TokenType");function it(t,e){return new $(t,{beforeExpr:!0,binop:e})}r(it,"binop");var rt={beforeExpr:!0},He={startsExpr:!0},cw={};function j(t,e){return e===void 0&&(e={}),e.keyword=t,cw[t]=new $(t,e)}r(j,"kw");var d={num:new $("num",He),regexp:new $("regexp",He),string:new $("string",He),name:new $("name",He),privateId:new $("privateId",He),eof:new $("eof"),bracketL:new $("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new $("]"),braceL:new $("{",{beforeExpr:!0,startsExpr:!0}),braceR:new $("}"),parenL:new $("(",{beforeExpr:!0,startsExpr:!0}),parenR:new $(")"),comma:new $(",",rt),semi:new $(";",rt),colon:new $(":",rt),dot:new $("."),question:new $("?",rt),questionDot:new $("?."),arrow:new $("=>",rt),template:new $("template"),invalidTemplate:new $("invalidTemplate"),ellipsis:new $("...",rt),backQuote:new $("`",He),dollarBraceL:new $("${",{beforeExpr:!0,startsExpr:!0}),eq:new $("=",{beforeExpr:!0,isAssign:!0}),assign:new $("_=",{beforeExpr:!0,isAssign:!0}),incDec:new $("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new $("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:it("||",1),logicalAND:it("&&",2),bitwiseOR:it("|",3),bitwiseXOR:it("^",4),bitwiseAND:it("&",5),equality:it("==/!=/===/!==",6),relational:it("/<=/>=",7),bitShift:it("<>/>>>",8),plusMin:new $("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:it("%",10),star:it("*",10),slash:it("/",10),starstar:new $("**",{beforeExpr:!0}),coalesce:it("??",1),_break:j("break"),_case:j("case",rt),_catch:j("catch"),_continue:j("continue"),_debugger:j("debugger"),_default:j("default",rt),_do:j("do",{isLoop:!0,beforeExpr:!0}),_else:j("else",rt),_finally:j("finally"),_for:j("for",{isLoop:!0}),_function:j("function",He),_if:j("if"),_return:j("return",rt),_switch:j("switch"),_throw:j("throw",rt),_try:j("try"),_var:j("var"),_const:j("const"),_while:j("while",{isLoop:!0}),_with:j("with"),_new:j("new",{beforeExpr:!0,startsExpr:!0}),_this:j("this",He),_super:j("super",He),_class:j("class",He),_extends:j("extends",rt),_export:j("export"),_import:j("import",He),_null:j("null",He),_true:j("true",He),_false:j("false",He),_in:j("in",{beforeExpr:!0,binop:7}),_instanceof:j("instanceof",{beforeExpr:!0,binop:7}),_typeof:j("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:j("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:j("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},nt=/\r\n?|\n|\u2028|\u2029/,Q1=new RegExp(nt.source,"g");function Us(t){return t===10||t===13||t===8232||t===8233}r(Us,"isNewLine");function ME(t,e,i){i===void 0&&(i=t.length);for(var s=e;s>10)+55296,(t&1023)+56320))}r(Wi,"codePointToString");var Z1=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,id=r(function(e,i){this.line=e,this.column=i},"Position");id.prototype.offset=r(function(e){return new id(this.line,this.column+e)},"offset");var Db=r(function(e,i,s){this.start=i,this.end=s,e.sourceFile!==null&&(this.source=e.sourceFile)},"SourceLocation");function DE(t,e){for(var i=1,s=0;;){var o=ME(t,s,e);if(o<0)return new id(i,e-s);++i,s=o}}r(DE,"getLineInfo");var aw={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},CE=!1;function eC(t){var e={};for(var i in aw)e[i]=t&&sd(t,i)?t[i]:aw[i];if(e.ecmaVersion==="latest"?e.ecmaVersion=1e8:e.ecmaVersion==null?(!CE&&typeof console=="object"&&console.warn&&(CE=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required. +Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),e.allowReserved==null&&(e.allowReserved=e.ecmaVersion<5),(!t||t.allowHashBang==null)&&(e.allowHashBang=e.ecmaVersion>=14),EE(e.onToken)){var s=e.onToken;e.onToken=function(o){return s.push(o)}}return EE(e.onComment)&&(e.onComment=tC(e,e.onComment)),e}r(eC,"getOptions");function tC(t,e){return function(i,s,o,p,c,f){var m={type:i?"Block":"Line",value:s,start:o,end:p};t.locations&&(m.loc=new Db(this,c,f)),t.ranges&&(m.range=[o,p]),e.push(m)}}r(tC,"pushComment");var rd=1,Fs=2,uw=4,BE=8,YE=16,VE=32,fw=64,UE=128,od=256,mw=rd|Fs|od;function hw(t,e){return Fs|(t?uw:0)|(e?BE:0)}r(hw,"functionFlags");var Rb=0,dw=1,ai=2,FE=3,WE=4,GE=5,me=r(function(e,i,s){this.options=e=eC(e),this.sourceFile=e.sourceFile,this.keywords=Fi($1[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var o="";e.allowReserved!==!0&&(o=rw[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module"&&(o+=" await")),this.reservedWords=Fi(o);var p=(o?o+" ":"")+rw.strict;this.reservedWordsStrict=Fi(p),this.reservedWordsStrictBind=Fi(p+" "+rw.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(` +`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(nt).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=d.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(rd),this.regexpState=null,this.privateNameStack=[]},"Parser"),Ut={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};me.prototype.parse=r(function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},"parse");Ut.inFunction.get=function(){return(this.currentVarScope().flags&Fs)>0};Ut.inGenerator.get=function(){return(this.currentVarScope().flags&BE)>0&&!this.currentVarScope().inClassFieldInit};Ut.inAsync.get=function(){return(this.currentVarScope().flags&uw)>0&&!this.currentVarScope().inClassFieldInit};Ut.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t];if(e.inClassFieldInit||e.flags&od)return!1;if(e.flags&Fs)return(e.flags&uw)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ut.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&fw)>0||i||this.options.allowSuperOutsideMethod};Ut.allowDirectSuper.get=function(){return(this.currentThisScope().flags&UE)>0};Ut.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ut.allowNewDotTarget.get=function(){var t=this.currentThisScope(),e=t.flags,i=t.inClassFieldInit;return(e&(Fs|od))>0||i};Ut.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&od)>0};me.extend=r(function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];for(var s=this,o=0;o=,?^&]/.test(o)||o==="!"&&this.input.charAt(s+1)==="=")}t+=e[0].length,st.lastIndex=t,t+=st.exec(this.input)[0].length,this.input[t]===";"&&t++}};Le.eat=function(t){return this.type===t?(this.next(),!0):!1};Le.isContextual=function(t){return this.type===d.name&&this.value===t&&!this.containsEsc};Le.eatContextual=function(t){return this.isContextual(t)?(this.next(),!0):!1};Le.expectContextual=function(t){this.eatContextual(t)||this.unexpected()};Le.canInsertSemicolon=function(){return this.type===d.eof||this.type===d.braceR||nt.test(this.input.slice(this.lastTokEnd,this.start))};Le.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Le.semicolon=function(){!this.eat(d.semi)&&!this.insertSemicolon()&&this.unexpected()};Le.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0};Le.expect=function(t){this.eat(t)||this.unexpected()};Le.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var Bb=r(function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1},"DestructuringErrors");Le.checkPatternErrors=function(t,e){if(!!t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}};Le.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,s=t.doubleProto;if(!e)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};Le.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&s<56320)return!0;if(oi(s,!0)){for(var o=i+1;Vs(s=this.input.charCodeAt(o),!0);)++o;if(s===92||s>55295&&s<56320)return!0;var p=this.input.slice(i,o);if(!K1.test(p))return!0}return!1};A.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;st.lastIndex=this.pos;var t=st.exec(this.input),e=this.pos+t[0].length,i;return!nt.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(Vs(i=this.input.charCodeAt(e+8))||i>55295&&i<56320))};A.parseStatement=function(t,e,i){var s=this.type,o=this.startNode(),p;switch(this.isLet(t)&&(s=d._var,p="let"),s){case d._break:case d._continue:return this.parseBreakContinueStatement(o,s.keyword);case d._debugger:return this.parseDebuggerStatement(o);case d._do:return this.parseDoStatement(o);case d._for:return this.parseForStatement(o);case d._function:return t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(o,!1,!t);case d._class:return t&&this.unexpected(),this.parseClass(o,!0);case d._if:return this.parseIfStatement(o);case d._return:return this.parseReturnStatement(o);case d._switch:return this.parseSwitchStatement(o);case d._throw:return this.parseThrowStatement(o);case d._try:return this.parseTryStatement(o);case d._const:case d._var:return p=p||this.value,t&&p!=="var"&&this.unexpected(),this.parseVarStatement(o,p);case d._while:return this.parseWhileStatement(o);case d._with:return this.parseWithStatement(o);case d.braceL:return this.parseBlock(!0,o);case d.semi:return this.parseEmptyStatement(o);case d._export:case d._import:if(this.options.ecmaVersion>10&&s===d._import){st.lastIndex=this.pos;var c=st.exec(this.input),f=this.pos+c[0].length,m=this.input.charCodeAt(f);if(m===40||m===46)return this.parseExpressionStatement(o,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===d._import?this.parseImport(o):this.parseExport(o,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(o,!0,!t);var x=this.value,_=this.parseExpression();return s===d.name&&_.type==="Identifier"&&this.eat(d.colon)?this.parseLabeledStatement(o,x,_,t):this.parseExpressionStatement(o,_)}};A.parseBreakContinueStatement=function(t,e){var i=e==="break";this.next(),this.eat(d.semi)||this.insertSemicolon()?t.label=null:this.type!==d.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var s=0;s=6?this.eat(d.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")};A.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(_w),this.enterScope(0),this.expect(d.parenL),this.type===d.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===d._var||this.type===d._const||i){var s=this.startNode(),o=i?"let":this.value;return this.next(),this.parseVar(s,!0,o),this.finishNode(s,"VariableDeclaration"),(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===d._in?e>-1&&this.unexpected(e):t.await=e>-1),this.parseForIn(t,s)):(e>-1&&this.unexpected(e),this.parseFor(t,s))}var p=this.isContextual("let"),c=!1,f=this.containsEsc,m=new Bb,x=this.start,_=e>-1?this.parseExprSubscripts(m,"await"):this.parseExpression(!0,m);return this.type===d._in||(c=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===d._in&&this.unexpected(e),t.await=!0):c&&this.options.ecmaVersion>=8&&(_.start===x&&!f&&_.type==="Identifier"&&_.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(t.await=!1)),p&&c&&this.raise(_.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(_,!1,m),this.checkLValPattern(_),this.parseForIn(t,_)):(this.checkExpressionErrors(m,!0),e>-1&&this.unexpected(e),this.parseFor(t,_))};A.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,td|(i?0:pw),!1,e)};A.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(d._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};A.parseReturnStatement=function(t){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(d.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")};A.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(d.braceL),this.labels.push(rC),this.enterScope(0);for(var e,i=!1;this.type!==d.braceR;)if(this.type===d._case||this.type===d._default){var s=this.type===d._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(d.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};A.parseThrowStatement=function(t){return this.next(),nt.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var sC=[];A.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?VE:0),this.checkLValPattern(t,e?WE:ai),this.expect(d.parenR),t};A.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===d._catch){var e=this.startNode();this.next(),this.eat(d.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(d._finally)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")};A.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};A.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(_w),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};A.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};A.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};A.parseLabeledStatement=function(t,e,i,s){for(var o=0,p=this.labels;o=0;m--){var x=this.labels[m];if(x.statementStart===t.start)x.statementStart=this.start,x.kind=f;else break}return this.labels.push({name:e,kind:f,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};A.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};A.parseBlock=function(t,e,i){for(t===void 0&&(t=!0),e===void 0&&(e=this.startNode()),e.body=[],this.expect(d.braceL),t&&this.enterScope(0);this.type!==d.braceR;){var s=this.parseStatement(null);e.body.push(s)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")};A.parseFor=function(t,e){return t.init=e,this.expect(d.semi),t.test=this.type===d.semi?null:this.parseExpression(),this.expect(d.semi),t.update=this.type===d.parenR?null:this.parseExpression(),this.expect(d.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};A.parseForIn=function(t,e){var i=this.type===d._in;return this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(d.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};A.parseVar=function(t,e,i,s){for(t.declarations=[],t.kind=i;;){var o=this.startNode();if(this.parseVarId(o,i),this.eat(d.eq)?o.init=this.parseMaybeAssign(e):!s&&i==="const"&&!(this.type===d._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&o.id.type!=="Identifier"&&!(e&&(this.type===d._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):o.init=null,t.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(d.comma))break}return t};A.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?dw:ai,!1)};var td=1,pw=2,jE=4;A.parseFunction=function(t,e,i,s,o){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===d.star&&e&pw&&this.unexpected(),t.generator=this.eat(d.star)),this.options.ecmaVersion>=8&&(t.async=!!s),e&td&&(t.id=e&jE&&this.type!==d.name?null:this.parseIdent(),t.id&&!(e&pw)&&this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?dw:ai:FE));var p=this.yieldPos,c=this.awaitPos,f=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(hw(t.async,t.generator)),e&td||(t.id=this.type===d.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,o),this.yieldPos=p,this.awaitPos=c,this.awaitIdentPos=f,this.finishNode(t,e&td?"FunctionDeclaration":"FunctionExpression")};A.parseFunctionParams=function(t){this.expect(d.parenL),t.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};A.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),o=this.startNode(),p=!1;for(o.body=[],this.expect(d.braceL);this.type!==d.braceR;){var c=this.parseClassElement(t.superClass!==null);c&&(o.body.push(c),c.type==="MethodDefinition"&&c.kind==="constructor"?(p&&this.raiseRecoverable(c.start,"Duplicate constructor in the same class"),p=!0):c.key&&c.key.type==="PrivateIdentifier"&&oC(s,c)&&this.raiseRecoverable(c.key.start,"Identifier '#"+c.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};A.parseClassElement=function(t){if(this.eat(d.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",o=!1,p=!1,c="method",f=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(d.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===d.star?f=!0:s="static"}if(i.static=f,!s&&e>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===d.star)&&!this.canInsertSemicolon()?p=!0:s="async"),!s&&(e>=9||!p)&&this.eat(d.star)&&(o=!0),!s&&!p&&!o){var m=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?c=m:s=m)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===d.parenL||c!=="method"||o||p){var x=!i.static&&Mb(i,"constructor"),_=x&&t;x&&c!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=x?"constructor":c,this.parseClassMethod(i,o,p,_)}else this.parseClassField(i);return i};A.isClassElementNameStart=function(){return this.type===d.name||this.type===d.privateId||this.type===d.num||this.type===d.string||this.type===d.bracketL||this.type.keyword};A.parseClassElementName=function(t){this.type===d.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)};A.parseClassMethod=function(t,e,i,s){var o=t.key;t.kind==="constructor"?(e&&this.raise(o.start,"Constructor can't be a generator"),i&&this.raise(o.start,"Constructor can't be an async method")):t.static&&Mb(t,"prototype")&&this.raise(o.start,"Classes may not have a static property named prototype");var p=t.value=this.parseMethod(e,i,s);return t.kind==="get"&&p.params.length!==0&&this.raiseRecoverable(p.start,"getter should have no params"),t.kind==="set"&&p.params.length!==1&&this.raiseRecoverable(p.start,"setter should have exactly one param"),t.kind==="set"&&p.params[0].type==="RestElement"&&this.raiseRecoverable(p.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")};A.parseClassField=function(t){if(Mb(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&Mb(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(d.eq)){var e=this.currentThisScope(),i=e.inClassFieldInit;e.inClassFieldInit=!0,t.value=this.parseMaybeAssign(),e.inClassFieldInit=i}else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};A.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(od|fw);this.type!==d.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};A.parseClassId=function(t,e){this.type===d.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,ai,!1)):(e===!0&&this.unexpected(),t.id=null)};A.parseClassSuper=function(t){t.superClass=this.eat(d._extends)?this.parseExprSubscripts(null,!1):null};A.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};A.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(!!this.options.checkPrivateFields)for(var s=this.privateNameStack.length,o=s===0?null:this.privateNameStack[s-1],p=0;p=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==d.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};A.parseExport=function(t,e){if(this.next(),this.eat(d.star))return this.parseExportAllDeclaration(t,e);if(this.eat(d._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration"?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==d.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var i=0,s=t.specifiers;i=13&&this.type===d.string){var t=this.parseLiteral(this.value);return Z1.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)};A.adaptDirectivePrologue=function(t){for(var e=0;e=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var at=me.prototype;at.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&t.name==="await"&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,o=t.properties;s=8&&!f&&m.name==="async"&&!this.canInsertSemicolon()&&this.eat(d._function))return this.overrideContext(ie.f_expr),this.parseFunction(this.startNodeAt(p,c),0,!1,!0,e);if(o&&!this.canInsertSemicolon()){if(this.eat(d.arrow))return this.parseArrowExpression(this.startNodeAt(p,c),[m],!1,e);if(this.options.ecmaVersion>=8&&m.name==="async"&&this.type===d.name&&!f&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return m=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(d.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(p,c),[m],!0,e)}return m;case d.regexp:var x=this.value;return s=this.parseLiteral(x.value),s.regex={pattern:x.pattern,flags:x.flags},s;case d.num:case d.string:return this.parseLiteral(this.value);case d._null:case d._true:case d._false:return s=this.startNode(),s.value=this.type===d._null?null:this.type===d._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case d.parenL:var _=this.start,b=this.parseParenAndDistinguishExpression(o,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(b)&&(t.parenthesizedAssign=_),t.parenthesizedBind<0&&(t.parenthesizedBind=_)),b;case d.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(d.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case d.braceL:return this.overrideContext(ie.b_expr),this.parseObj(!1,t);case d._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case d._class:return this.parseClass(this.startNode(),!1);case d._new:return this.parseNew();case d.backQuote:return this.parseTemplate();case d._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};O.parseExprAtomDefault=function(){this.unexpected()};O.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===d.parenL&&!t)return this.parseDynamicImport(e);if(this.type===d.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};O.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),!this.eat(d.parenR)){var e=this.start;this.eat(d.comma)&&this.eat(d.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")};O.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="meta"&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")};O.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")};O.parseParenExpression=function(){this.expect(d.parenL);var t=this.parseExpression();return this.expect(d.parenR),t};O.shouldParseArrow=function(t){return!this.canInsertSemicolon()};O.parseParenAndDistinguishExpression=function(t,e){var i=this.start,s=this.startLoc,o,p=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var c=this.start,f=this.startLoc,m=[],x=!0,_=!1,b=new Bb,T=this.yieldPos,w=this.awaitPos,S;for(this.yieldPos=0,this.awaitPos=0;this.type!==d.parenR;)if(x?x=!1:this.expect(d.comma),p&&this.afterTrailingComma(d.parenR,!0)){_=!0;break}else if(this.type===d.ellipsis){S=this.start,m.push(this.parseParenItem(this.parseRestBinding())),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else m.push(this.parseMaybeAssign(!1,b,this.parseParenItem));var E=this.lastTokEnd,C=this.lastTokEndLoc;if(this.expect(d.parenR),t&&this.shouldParseArrow(m)&&this.eat(d.arrow))return this.checkPatternErrors(b,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=T,this.awaitPos=w,this.parseParenArrowList(i,s,m,e);(!m.length||_)&&this.unexpected(this.lastTokStart),S&&this.unexpected(S),this.checkExpressionErrors(b,!0),this.yieldPos=T||this.yieldPos,this.awaitPos=w||this.awaitPos,m.length>1?(o=this.startNodeAt(c,f),o.expressions=m,this.finishNodeAt(o,"SequenceExpression",E,C)):o=m[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var k=this.startNodeAt(i,s);return k.expression=o,this.finishNode(k,"ParenthesizedExpression")}else return o};O.parseParenItem=function(t){return t};O.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var nC=[];O.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===d.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),t.property.name!=="target"&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var s=this.start,o=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,o,!0,!1),this.eat(d.parenL)?t.arguments=this.parseExprList(d.parenR,this.options.ecmaVersion>=8,!1):t.arguments=nC,this.finishNode(t,"NewExpression")};O.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===d.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,` `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,` -`),cooked:this.value},this.next(),i.tail=this.type===h.backQuote,this.finishNode(i,"TemplateElement")};D.parseTemplate=function(t){t===void 0&&(t={});var e=t.isTagged;e===void 0&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});for(i.quasis=[s];!s.tail;)this.type===h.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(h.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(h.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")};D.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.key.name==="async"&&(this.type===h.name||this.type===h.num||this.type===h.string||this.type===h.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===h.star)&&!at.test(this.input.slice(this.lastTokEnd,this.start))};D.parseObj=function(t,e){var i=this.startNode(),s=!0,o={};for(i.properties=[],this.next();!this.eat(h.braceR);){if(s)s=!1;else if(this.expect(h.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(h.braceR))break;var a=this.parseProperty(t,e);t||this.checkPropClash(a,o,e),i.properties.push(a)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};D.parseProperty=function(t,e){var i=this.startNode(),s,o,a,l;if(this.options.ecmaVersion>=9&&this.eat(h.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===h.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===h.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(a=this.start,l=this.startLoc),t||(s=this.eat(h.star)));var f=this.containsEsc;return this.parsePropertyName(i),!t&&!f&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(o=!0,s=this.options.ecmaVersion>=9&&this.eat(h.star),this.parsePropertyName(i)):o=!1,this.parsePropertyValue(i,t,s,o,a,l,e,f),this.finishNode(i,"Property")};D.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e=t.kind==="get"?0:1;if(t.value.params.length!==e){var i=t.value.start;t.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};D.parsePropertyValue=function(t,e,i,s,o,a,l,f){(i||s)&&this.type===h.colon&&this.unexpected(),this.eat(h.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,l),t.kind="init"):this.options.ecmaVersion>=6&&this.type===h.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s)):!e&&!f&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==h.comma&&this.type!==h.braceR&&this.type!==h.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=o),t.kind="init",e?t.value=this.parseMaybeDefault(o,a,this.copyNode(t.key)):this.type===h.eq&&l?(l.shorthandAssign<0&&(l.shorthandAssign=this.start),t.value=this.parseMaybeDefault(o,a,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.shorthand=!0):this.unexpected()};D.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(h.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(h.bracketR),t.key;t.computed=!1}return t.key=this.type===h.num||this.type===h.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};D.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};D.parseMethod=function(t,e,i){var s=this.startNode(),o=this.yieldPos,a=this.awaitPos,l=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(aw(e,s.generator)|ow|(i?kE:0)),this.expect(h.parenL),s.params=this.parseBindingList(h.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=o,this.awaitPos=a,this.awaitIdentPos=l,this.finishNode(s,"FunctionExpression")};D.parseArrowExpression=function(t,e,i,s){var o=this.yieldPos,a=this.awaitPos,l=this.awaitIdentPos;return this.enterScope(aw(i,!1)|SE),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=o,this.awaitPos=a,this.awaitIdentPos=l,this.finishNode(t,"ArrowFunctionExpression")};D.parseFunctionBody=function(t,e,i,s){var o=e&&this.type!==h.braceL,a=this.strict,l=!1;if(o)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var f=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!a||f)&&(l=this.strictDirective(this.end),l&&f&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var m=this.labels;this.labels=[],l&&(this.strict=!0),this.checkParams(t,!a&&!l&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,NE),t.body=this.parseBlock(!1,void 0,l&&!a),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=m}this.exitScope()};D.isSimpleParamList=function(t){for(var e=0,i=t;e-1||o.functions.indexOf(t)>-1||o.var.indexOf(t)>-1,o.lexical.push(t),this.inModule&&o.flags&Qh&&delete this.undefinedExports[t]}else if(e===PE){var a=this.currentScope();a.lexical.push(t)}else if(e===CE){var l=this.currentScope();this.treatFunctionsAsVar?s=l.lexical.indexOf(t)>-1:s=l.lexical.indexOf(t)>-1||l.var.indexOf(t)>-1,l.functions.push(t)}else for(var f=this.scopeStack.length-1;f>=0;--f){var m=this.scopeStack[f];if(m.lexical.indexOf(t)>-1&&!(m.flags&EE&&m.lexical[0]===t)||!this.treatFunctionsAsVarInScope(m)&&m.functions.indexOf(t)>-1){s=!0;break}if(m.var.push(t),this.inModule&&m.flags&Qh&&delete this.undefinedExports[t],m.flags&nw)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};Hi.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Hi.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Hi.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&nw)return e}};Hi.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&nw&&!(e.flags&SE))return e}};var Ab=r(function(e,i,s){this.type="",this.start=i,this.end=0,e.options.locations&&(this.loc=new Pb(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[i,0])},"Node"),ed=me.prototype;ed.startNode=function(){return new Ab(this,this.start,this.startLoc)};ed.startNodeAt=function(t,e){return new Ab(this,t,e)};function ME(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}r(ME,"finishNodeAt");ed.finishNode=function(t,e){return ME.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};ed.finishNodeAt=function(t,e,i,s){return ME.call(this,t,e,i,s)};ed.copyNode=function(t){var e=new Ab(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var LE="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",OE=LE+" Extended_Pictographic",DE=OE,BE=DE+" EBase EComp EMod EPres ExtPict",YE=BE,X1=YE,Q1={9:LE,10:OE,11:DE,12:BE,13:YE,14:X1},J1="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Z1={9:"",10:"",11:"",12:"",13:"",14:J1},_E="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",VE="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",UE=VE+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",FE=UE+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",WE=FE+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",GE=WE+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",eC=GE+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",tC={9:VE,10:UE,11:FE,12:WE,13:GE,14:eC},jE={};function iC(t){var e=jE[t]={binary:Gi(Q1[t]+" "+_E),binaryOfStrings:Gi(Z1[t]),nonBinary:{General_Category:Gi(_E),Script:Gi(tC[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}r(iC,"buildUnicodeData");for(Ib=0,Jg=[9,10,11,12,13,14];Ib=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=jE[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null},"RegExpValidationState");Gt.prototype.reset=r(function(e,i,s){var o=s.indexOf("v")!==-1,a=s.indexOf("u")!==-1;this.start=e|0,this.source=i+"",this.flags=s,o&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)},"reset");Gt.prototype.raise=r(function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},"raise");Gt.prototype.at=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return-1;var a=s.charCodeAt(e);if(!(i||this.switchU)||a<=55295||a>=57344||e+1>=o)return a;var l=s.charCodeAt(e+1);return l>=56320&&l<=57343?(a<<10)+l-56613888:a},"at");Gt.prototype.nextIndex=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return o;var a=s.charCodeAt(e),l;return!(i||this.switchU)||a<=55295||a>=57344||e+1>=o||(l=s.charCodeAt(e+1))<56320||l>57343?e+1:e+2},"nextIndex");Gt.prototype.current=r(function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},"current");Gt.prototype.lookahead=r(function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},"lookahead");Gt.prototype.advance=r(function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},"advance");Gt.prototype.eat=r(function(e,i){return i===void 0&&(i=!1),this.current(i)===e?(this.advance(i),!0):!1},"eat");Gt.prototype.eatChars=r(function(e,i){i===void 0&&(i=!1);for(var s=this.pos,o=0,a=e;o-1&&this.raise(t.start,"Duplicate regular expression flag"),l==="u"&&(s=!0),l==="v"&&(o=!0)}this.options.ecmaVersion>=15&&s&&o&&this.raise(t.start,"Invalid regular expression flag")};function rC(t){for(var e in t)return!0;return!1}r(rC,"hasProp");N.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&rC(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};N.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=16;for(e&&(t.branchID=new Cb(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};N.regexp_alternative=function(t){for(;t.pos=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1};N.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};N.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};N.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,o=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(o=t.lastIntValue),t.eat(125)))return o!==-1&&o=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};N.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};N.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};N.regexp_eatSyntaxCharacter=function(t){var e=t.current();return HE(e)?(t.lastIntValue=e,t.advance(),!0):!1};function HE(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}r(HE,"isSyntaxCharacter");N.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;(i=t.current())!==-1&&!HE(i);)t.advance();return t.pos!==e};N.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};N.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var s=0,o=i;s=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),sC(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function sC(t){return ai(t,!0)||t===36||t===95}r(sC,"isRegExpIdentifierStart");N.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),oC(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function oC(t){return Fs(t,!0)||t===36||t===95||t===8204||t===8205}r(oC,"isRegExpIdentifierPart");N.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};N.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};N.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};N.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};N.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};N.regexp_eatZero=function(t){return t.current()===48&&!Rb(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};N.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};N.regexp_eatControlLetter=function(t){var e=t.current();return $E(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function $E(t){return t>=65&&t<=90||t>=97&&t<=122}r($E,"isControlLetter");N.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){e===void 0&&(e=!1);var i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(s&&o>=55296&&o<=56319){var a=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var l=t.lastIntValue;if(l>=56320&&l<=57343)return t.lastIntValue=(o-55296)*1024+(l-56320)+65536,!0}t.pos=a,t.lastIntValue=o}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&nC(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};function nC(t){return t>=0&&t<=1114111}r(nC,"isValidUnicode");N.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};N.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};var KE=0,pi=1,nt=2;N.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(aC(e))return t.lastIntValue=-1,t.advance(),pi;var i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();var s;if(t.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&s===nt&&t.raise("Invalid property name"),s;t.raise("Invalid property name")}return KE};function aC(t){return t===100||t===68||t===115||t===83||t===119||t===87}r(aC,"isCharacterClassEscape");N.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),pi}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var o=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,o)}return KE};N.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){Jh(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};N.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return pi;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return nt;t.raise("Invalid property name")};N.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";qE(e=t.current());)t.lastStringValue+=ji(e),t.advance();return t.lastStringValue!==""};function qE(t){return $E(t)||t===95}r(qE,"isUnicodePropertyNameCharacter");N.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";pC(e=t.current());)t.lastStringValue+=ji(e),t.advance();return t.lastStringValue!==""};function pC(t){return qE(t)||Rb(t)}r(pC,"isUnicodePropertyValueCharacter");N.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};N.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===nt&&t.raise("Negated character class may contain strings"),!0}return!1};N.regexp_classContents=function(t){return t.current()===93?pi:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),pi)};N.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};N.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(i===99||QE(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return s!==93?(t.lastIntValue=s,t.advance(),!0):!1};N.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};N.regexp_classSetExpression=function(t){var e=pi,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===nt&&(e=nt);for(var s=t.pos;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==nt&&(e=pi);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===nt&&(e=nt)}};N.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var s=t.lastIntValue;return i!==-1&&s!==-1&&i>s&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};N.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?pi:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};N.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===nt&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){var o=this.regexp_eatCharacterClassEscape(t);if(o)return o;t.pos=e}return null};N.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null};N.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)this.regexp_classString(t)===nt&&(e=nt);return e};N.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return e===1?pi:nt};N.regexp_eatClassSetCharacter=function(t){var e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);var i=t.current();return i<0||i===t.lookahead()&&cC(i)||lC(i)?!1:(t.advance(),t.lastIntValue=i,!0)};function cC(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}r(cC,"isClassSetReservedDoublePunctuatorCharacter");function lC(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}r(lC,"isClassSetSyntaxCharacter");N.regexp_eatClassSetReservedPunctuator=function(t){var e=t.current();return uC(e)?(t.lastIntValue=e,t.advance(),!0):!1};function uC(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}r(uC,"isClassSetReservedPunctuator");N.regexp_eatClassControlLetter=function(t){var e=t.current();return Rb(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};N.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};N.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Rb(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};function Rb(t){return t>=48&&t<=57}r(Rb,"isDecimalDigit");N.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;zE(i=t.current());)t.lastIntValue=16*t.lastIntValue+XE(i),t.advance();return t.pos!==e};function zE(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}r(zE,"isHexDigit");function XE(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}r(XE,"hexToInt");N.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};N.regexp_eatOctalDigit=function(t){var e=t.current();return QE(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function QE(t){return t>=48&&t<=55}r(QE,"isOctalDigit");N.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s=this.input.length)return this.finishToken(h.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};W.readToken=function(t){return ai(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};W.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=56320)return t;var e=this.input.charCodeAt(this.pos+1);return e<=56319||e>=57344?t:(t<<10)+e-56613888};W.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,o=e;(s=gE(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};W.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);this.pos8&&t<14||t>=5760&&wE.test(String.fromCharCode(t)))++this.pos;else break e}}};W.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)};W.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(h.ellipsis)):(++this.pos,this.finishToken(h.dot))};W.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(h.assign,2):this.finishOp(h.slash,1)};W.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?h.star:h.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=h.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(h.assign,i+1):this.finishOp(s,i)};W.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(h.assign,3)}return this.finishOp(t===124?h.logicalOR:h.logicalAND,2)}return e===61?this.finishOp(h.assign,2):this.finishOp(t===124?h.bitwiseOR:h.bitwiseAND,1)};W.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(h.assign,2):this.finishOp(h.bitwiseXOR,1)};W.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||at.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(h.incDec,2):e===61?this.finishOp(h.assign,2):this.finishOp(h.plusMin,1)};W.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(h.assign,i+1):this.finishOp(h.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(h.relational,i))};W.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(h.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(h.arrow)):this.finishOp(t===61?h.eq:h.prefix,1)};W.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(h.questionDot,2)}if(e===63){if(t>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(h.assign,3)}return this.finishOp(h.coalesce,2)}}return this.finishOp(h.question,1)};W.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),ai(e,!0)||e===92))return this.finishToken(h.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ji(e)+"'")};W.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(h.parenL);case 41:return++this.pos,this.finishToken(h.parenR);case 59:return++this.pos,this.finishToken(h.semi);case 44:return++this.pos,this.finishToken(h.comma);case 91:return++this.pos,this.finishToken(h.bracketL);case 93:return++this.pos,this.finishToken(h.bracketR);case 123:return++this.pos,this.finishToken(h.braceL);case 125:return++this.pos,this.finishToken(h.braceR);case 58:return++this.pos,this.finishToken(h.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(h.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(h.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ji(t)+"'")};W.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};W.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(at.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}var o=this.input.slice(i,this.pos);++this.pos;var a=this.pos,l=this.readWord1();this.containsEsc&&this.unexpected(a);var f=this.regexpState||(this.regexpState=new Gt(this));f.reset(i,o,l),this.validateRegExpFlags(f),this.validateRegExpPattern(f);var m=null;try{m=new RegExp(o,l)}catch{}return this.finishToken(h.regexp,{pattern:o,flags:l,value:m})};W.readInt=function(t,e,i){for(var s=this.options.ecmaVersion>=12&&e===void 0,o=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,l=0,f=0,m=0,x=e==null?1/0:e;m=97?b=_-97+10:_>=65?b=_-65+10:_>=48&&_<=57?b=_-48:b=1/0,b>=t)break;f=_,l=l*t+b}return s&&f===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||e!=null&&this.pos-a!==e?null:l};function fC(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}r(fC,"stringToNumber");function JE(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}r(JE,"stringToBigInt");W.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=JE(this.input.slice(e,this.pos)),++this.pos):ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,i)};W.readNumber=function(t){var e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){var o=JE(this.input.slice(e,this.pos));return++this.pos,ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(h.num,o)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),ai(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=fC(this.input.slice(e,this.pos),i);return this.finishToken(h.num,a)};W.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};W.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ws(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(h.string,e)};var ZE={};W.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===ZE)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};W.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ZE;this.raise(t,e)};W.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===h.template||this.type===h.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(h.dollarBraceL)):(++this.pos,this.finishToken(h.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(h.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Ws(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=` -`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};W.readInvalidTemplateToken=function(){for(;this.pos=9&&this.type===d.star)&&!nt.test(this.input.slice(this.lastTokEnd,this.start))};O.parseObj=function(t,e){var i=this.startNode(),s=!0,o={};for(i.properties=[],this.next();!this.eat(d.braceR);){if(s)s=!1;else if(this.expect(d.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(d.braceR))break;var p=this.parseProperty(t,e);t||this.checkPropClash(p,o,e),i.properties.push(p)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};O.parseProperty=function(t,e){var i=this.startNode(),s,o,p,c;if(this.options.ecmaVersion>=9&&this.eat(d.ellipsis))return t?(i.argument=this.parseIdent(!1),this.type===d.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,e),this.type===d.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(t||e)&&(p=this.start,c=this.startLoc),t||(s=this.eat(d.star)));var f=this.containsEsc;return this.parsePropertyName(i),!t&&!f&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(o=!0,s=this.options.ecmaVersion>=9&&this.eat(d.star),this.parsePropertyName(i)):o=!1,this.parsePropertyValue(i,t,s,o,p,c,e,f),this.finishNode(i,"Property")};O.parseGetterSetter=function(t){t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1);var e=t.kind==="get"?0:1;if(t.value.params.length!==e){var i=t.value.start;t.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else t.kind==="set"&&t.value.params[0].type==="RestElement"&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};O.parsePropertyValue=function(t,e,i,s,o,p,c,f){(i||s)&&this.type===d.colon&&this.unexpected(),this.eat(d.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,c),t.kind="init"):this.options.ecmaVersion>=6&&this.type===d.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,s)):!e&&!f&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&this.type!==d.comma&&this.type!==d.braceR&&this.type!==d.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(t)):this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=o),t.kind="init",e?t.value=this.parseMaybeDefault(o,p,this.copyNode(t.key)):this.type===d.eq&&c?(c.shorthandAssign<0&&(c.shorthandAssign=this.start),t.value=this.parseMaybeDefault(o,p,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.shorthand=!0):this.unexpected()};O.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(d.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(d.bracketR),t.key;t.computed=!1}return t.key=this.type===d.num||this.type===d.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};O.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)};O.parseMethod=function(t,e,i){var s=this.startNode(),o=this.yieldPos,p=this.awaitPos,c=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=t),this.options.ecmaVersion>=8&&(s.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(hw(e,s.generator)|fw|(i?UE:0)),this.expect(d.parenL),s.params=this.parseBindingList(d.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=o,this.awaitPos=p,this.awaitIdentPos=c,this.finishNode(s,"FunctionExpression")};O.parseArrowExpression=function(t,e,i,s){var o=this.yieldPos,p=this.awaitPos,c=this.awaitIdentPos;return this.enterScope(hw(i,!1)|YE),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=o,this.awaitPos=p,this.awaitIdentPos=c,this.finishNode(t,"ArrowFunctionExpression")};O.parseFunctionBody=function(t,e,i,s){var o=e&&this.type!==d.braceL,p=this.strict,c=!1;if(o)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var f=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);(!p||f)&&(c=this.strictDirective(this.end),c&&f&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var m=this.labels;this.labels=[],c&&(this.strict=!0),this.checkParams(t,!p&&!c&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,GE),t.body=this.parseBlock(!1,void 0,c&&!p),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=m}this.exitScope()};O.isSimpleParamList=function(t){for(var e=0,i=t;e-1||o.functions.indexOf(t)>-1||o.var.indexOf(t)>-1,o.lexical.push(t),this.inModule&&o.flags&rd&&delete this.undefinedExports[t]}else if(e===WE){var p=this.currentScope();p.lexical.push(t)}else if(e===FE){var c=this.currentScope();this.treatFunctionsAsVar?s=c.lexical.indexOf(t)>-1:s=c.lexical.indexOf(t)>-1||c.var.indexOf(t)>-1,c.functions.push(t)}else for(var f=this.scopeStack.length-1;f>=0;--f){var m=this.scopeStack[f];if(m.lexical.indexOf(t)>-1&&!(m.flags&VE&&m.lexical[0]===t)||!this.treatFunctionsAsVarInScope(m)&&m.functions.indexOf(t)>-1){s=!0;break}if(m.var.push(t),this.inModule&&m.flags&rd&&delete this.undefinedExports[t],m.flags&mw)break}s&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};Gi.checkLocalExport=function(t){this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1&&(this.undefinedExports[t.name]=t)};Gi.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Gi.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&mw)return e}};Gi.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&mw&&!(e.flags&YE))return e}};var Yb=r(function(e,i,s){this.type="",this.start=i,this.end=0,e.options.locations&&(this.loc=new Db(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[i,0])},"Node"),nd=me.prototype;nd.startNode=function(){return new Yb(this,this.start,this.startLoc)};nd.startNodeAt=function(t,e){return new Yb(this,t,e)};function $E(t,e,i,s){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=s),this.options.ranges&&(t.range[1]=i),t}r($E,"finishNodeAt");nd.finishNode=function(t,e){return $E.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};nd.finishNodeAt=function(t,e,i,s){return $E.call(this,t,e,i,s)};nd.copyNode=function(t){var e=new Yb(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var KE="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",qE=KE+" Extended_Pictographic",zE=qE,QE=zE+" EBase EComp EMod EPres ExtPict",XE=QE,pC=XE,lC={9:KE,10:qE,11:zE,12:QE,13:XE,14:pC},cC="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",uC={9:"",10:"",11:"",12:"",13:"",14:cC},PE="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",JE="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ZE=JE+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ek=ZE+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",tk=ek+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ik=tk+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",fC=ik+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",mC={9:JE,10:ZE,11:ek,12:tk,13:ik,14:fC},rk={};function hC(t){var e=rk[t]={binary:Fi(lC[t]+" "+PE),binaryOfStrings:Fi(uC[t]),nonBinary:{General_Category:Fi(PE),Script:Fi(mC[t])}};e.nonBinary.Script_Extensions=e.nonBinary.Script,e.nonBinary.gc=e.nonBinary.General_Category,e.nonBinary.sc=e.nonBinary.Script,e.nonBinary.scx=e.nonBinary.Script_Extensions}r(hC,"buildUnicodeData");for(Ab=0,ow=[9,10,11,12,13,14];Ab=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=rk[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null},"RegExpValidationState");Ft.prototype.reset=r(function(e,i,s){var o=s.indexOf("v")!==-1,p=s.indexOf("u")!==-1;this.start=e|0,this.source=i+"",this.flags=s,o&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=p&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=p&&this.parser.options.ecmaVersion>=9)},"reset");Ft.prototype.raise=r(function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},"raise");Ft.prototype.at=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return-1;var p=s.charCodeAt(e);if(!(i||this.switchU)||p<=55295||p>=57344||e+1>=o)return p;var c=s.charCodeAt(e+1);return c>=56320&&c<=57343?(p<<10)+c-56613888:p},"at");Ft.prototype.nextIndex=r(function(e,i){i===void 0&&(i=!1);var s=this.source,o=s.length;if(e>=o)return o;var p=s.charCodeAt(e),c;return!(i||this.switchU)||p<=55295||p>=57344||e+1>=o||(c=s.charCodeAt(e+1))<56320||c>57343?e+1:e+2},"nextIndex");Ft.prototype.current=r(function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},"current");Ft.prototype.lookahead=r(function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},"lookahead");Ft.prototype.advance=r(function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},"advance");Ft.prototype.eat=r(function(e,i){return i===void 0&&(i=!1),this.current(i)===e?(this.advance(i),!0):!1},"eat");Ft.prototype.eatChars=r(function(e,i){i===void 0&&(i=!1);for(var s=this.pos,o=0,p=e;o-1&&this.raise(t.start,"Duplicate regular expression flag"),c==="u"&&(s=!0),c==="v"&&(o=!0)}this.options.ecmaVersion>=15&&s&&o&&this.raise(t.start,"Invalid regular expression flag")};function dC(t){for(var e in t)return!0;return!1}r(dC,"hasProp");N.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&dC(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))};N.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e=16;for(e&&(t.branchID=new Ob(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")};N.regexp_alternative=function(t){for(;t.pos=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1};N.regexp_eatQuantifier=function(t,e){return e===void 0&&(e=!1),this.regexp_eatQuantifierPrefix(t,e)?(t.eat(63),!0):!1};N.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)};N.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var s=0,o=-1;if(this.regexp_eatDecimalDigits(t)&&(s=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(o=t.lastIntValue),t.eat(125)))return o!==-1&&o=9?this.regexp_groupSpecifier(t):t.current()===63&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1};N.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)};N.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1};N.regexp_eatSyntaxCharacter=function(t){var e=t.current();return sk(e)?(t.lastIntValue=e,t.advance(),!0):!1};function sk(t){return t===36||t>=40&&t<=43||t===46||t===63||t>=91&&t<=94||t>=123&&t<=125}r(sk,"isSyntaxCharacter");N.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;(i=t.current())!==-1&&!sk(i);)t.advance();return t.pos!==e};N.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return e!==-1&&e!==36&&!(e>=40&&e<=43)&&e!==46&&e!==63&&e!==91&&e!==94&&e!==124?(t.advance(),!0):!1};N.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var s=0,o=i;s=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),_C(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function _C(t){return oi(t,!0)||t===36||t===95}r(_C,"isRegExpIdentifierStart");N.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,s=t.current(i);return t.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(s=t.lastIntValue),xC(s)?(t.lastIntValue=s,!0):(t.pos=e,!1)};function xC(t){return Vs(t,!0)||t===36||t===95||t===8204||t===8205}r(xC,"isRegExpIdentifierPart");N.regexp_eatAtomEscape=function(t){return this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t)?!0:(t.switchU&&(t.current()===99&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)};N.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1};N.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1};N.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)};N.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1};N.regexp_eatZero=function(t){return t.current()===48&&!Vb(t.lookahead())?(t.lastIntValue=0,t.advance(),!0):!1};N.regexp_eatControlEscape=function(t){var e=t.current();return e===116?(t.lastIntValue=9,t.advance(),!0):e===110?(t.lastIntValue=10,t.advance(),!0):e===118?(t.lastIntValue=11,t.advance(),!0):e===102?(t.lastIntValue=12,t.advance(),!0):e===114?(t.lastIntValue=13,t.advance(),!0):!1};N.regexp_eatControlLetter=function(t){var e=t.current();return ok(e)?(t.lastIntValue=e%32,t.advance(),!0):!1};function ok(t){return t>=65&&t<=90||t>=97&&t<=122}r(ok,"isControlLetter");N.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){e===void 0&&(e=!1);var i=t.pos,s=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var o=t.lastIntValue;if(s&&o>=55296&&o<=56319){var p=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var c=t.lastIntValue;if(c>=56320&&c<=57343)return t.lastIntValue=(o-55296)*1024+(c-56320)+65536,!0}t.pos=p,t.lastIntValue=o}return!0}if(s&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&yC(t.lastIntValue))return!0;s&&t.raise("Invalid unicode escape"),t.pos=i}return!1};function yC(t){return t>=0&&t<=1114111}r(yC,"isValidUnicode");N.regexp_eatIdentityEscape=function(t){if(t.switchU)return this.regexp_eatSyntaxCharacter(t)?!0:t.eat(47)?(t.lastIntValue=47,!0):!1;var e=t.current();return e!==99&&(!t.switchN||e!==107)?(t.lastIntValue=e,t.advance(),!0):!1};N.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();while((e=t.current())>=48&&e<=57);return!0}return!1};var nk=0,ni=1,ot=2;N.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(bC(e))return t.lastIntValue=-1,t.advance(),ni;var i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=e===80)||e===112)){t.lastIntValue=-1,t.advance();var s;if(t.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&s===ot&&t.raise("Invalid property name"),s;t.raise("Invalid property name")}return nk};function bC(t){return t===100||t===68||t===115||t===83||t===119||t===87}r(bC,"isCharacterClassEscape");N.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t)){var s=t.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(t,i,s),ni}}if(t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)){var o=t.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(t,o)}return nk};N.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){sd(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")};N.regexp_validateUnicodePropertyNameOrValue=function(t,e){if(t.unicodeProperties.binary.test(e))return ni;if(t.switchV&&t.unicodeProperties.binaryOfStrings.test(e))return ot;t.raise("Invalid property name")};N.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";ak(e=t.current());)t.lastStringValue+=Wi(e),t.advance();return t.lastStringValue!==""};function ak(t){return ok(t)||t===95}r(ak,"isUnicodePropertyNameCharacter");N.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";gC(e=t.current());)t.lastStringValue+=Wi(e),t.advance();return t.lastStringValue!==""};function gC(t){return ak(t)||Vb(t)}r(gC,"isUnicodePropertyValueCharacter");N.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)};N.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&i===ot&&t.raise("Negated character class may contain strings"),!0}return!1};N.regexp_classContents=function(t){return t.current()===93?ni:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),ni)};N.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;t.switchU&&(e===-1||i===-1)&&t.raise("Invalid character class"),e!==-1&&i!==-1&&e>i&&t.raise("Range out of order in character class")}}};N.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(i===99||ck(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var s=t.current();return s!==93?(t.lastIntValue=s,t.advance(),!0):!1};N.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)};N.regexp_classSetExpression=function(t){var e=ni,i;if(!this.regexp_eatClassSetRange(t))if(i=this.regexp_eatClassSetOperand(t)){i===ot&&(e=ot);for(var s=t.pos;t.eatChars([38,38]);){if(t.current()!==38&&(i=this.regexp_eatClassSetOperand(t))){i!==ot&&(e=ni);continue}t.raise("Invalid character in character class")}if(s!==t.pos)return e;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(s!==t.pos)return e}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(i=this.regexp_eatClassSetOperand(t),!i)return e;i===ot&&(e=ot)}};N.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var s=t.lastIntValue;return i!==-1&&s!==-1&&i>s&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1};N.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?ni:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)};N.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),s=this.regexp_classContents(t);if(t.eat(93))return i&&s===ot&&t.raise("Negated character class may contain strings"),s;t.pos=e}if(t.eat(92)){var o=this.regexp_eatCharacterClassEscape(t);if(o)return o;t.pos=e}return null};N.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null};N.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)this.regexp_classString(t)===ot&&(e=ot);return e};N.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return e===1?ni:ot};N.regexp_eatClassSetCharacter=function(t){var e=t.pos;if(t.eat(92))return this.regexp_eatCharacterEscape(t)||this.regexp_eatClassSetReservedPunctuator(t)?!0:t.eat(98)?(t.lastIntValue=8,!0):(t.pos=e,!1);var i=t.current();return i<0||i===t.lookahead()&&wC(i)||TC(i)?!1:(t.advance(),t.lastIntValue=i,!0)};function wC(t){return t===33||t>=35&&t<=38||t>=42&&t<=44||t===46||t>=58&&t<=64||t===94||t===96||t===126}r(wC,"isClassSetReservedDoublePunctuatorCharacter");function TC(t){return t===40||t===41||t===45||t===47||t>=91&&t<=93||t>=123&&t<=125}r(TC,"isClassSetSyntaxCharacter");N.regexp_eatClassSetReservedPunctuator=function(t){var e=t.current();return vC(e)?(t.lastIntValue=e,t.advance(),!0):!1};function vC(t){return t===33||t===35||t===37||t===38||t===44||t===45||t>=58&&t<=62||t===64||t===96||t===126}r(vC,"isClassSetReservedPunctuator");N.regexp_eatClassControlLetter=function(t){var e=t.current();return Vb(e)||e===95?(t.lastIntValue=e%32,t.advance(),!0):!1};N.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1};N.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;Vb(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e};function Vb(t){return t>=48&&t<=57}r(Vb,"isDecimalDigit");N.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;pk(i=t.current());)t.lastIntValue=16*t.lastIntValue+lk(i),t.advance();return t.pos!==e};function pk(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}r(pk,"isHexDigit");function lk(t){return t>=65&&t<=70?10+(t-65):t>=97&&t<=102?10+(t-97):t-48}r(lk,"hexToInt");N.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=e*64+i*8+t.lastIntValue:t.lastIntValue=e*8+i}else t.lastIntValue=e;return!0}return!1};N.regexp_eatOctalDigit=function(t){var e=t.current();return ck(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)};function ck(t){return t>=48&&t<=55}r(ck,"isOctalDigit");N.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var s=0;s=this.input.length)return this.finishToken(d.eof);if(t.override)return t.override(this);this.readToken(this.fullCharCodeAtPos())};W.readToken=function(t){return oi(t,this.options.ecmaVersion>=6)||t===92?this.readWord():this.getTokenFromCode(t)};W.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);if(t<=55295||t>=56320)return t;var e=this.input.charCodeAt(this.pos+1);return e<=56319||e>=57344?t:(t<<10)+e-56613888};W.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,o=e;(s=ME(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};W.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);this.pos8&&t<14||t>=5760&&LE.test(String.fromCharCode(t)))++this.pos;else break e}}};W.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)};W.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&t===46&&e===46?(this.pos+=3,this.finishToken(d.ellipsis)):(++this.pos,this.finishToken(d.dot))};W.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):t===61?this.finishOp(d.assign,2):this.finishOp(d.slash,1)};W.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?d.star:d.modulo;return this.options.ecmaVersion>=7&&t===42&&e===42&&(++i,s=d.starstar,e=this.input.charCodeAt(this.pos+2)),e===61?this.finishOp(d.assign,i+1):this.finishOp(s,i)};W.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(d.assign,3)}return this.finishOp(t===124?d.logicalOR:d.logicalAND,2)}return e===61?this.finishOp(d.assign,2):this.finishOp(t===124?d.bitwiseOR:d.bitwiseAND,1)};W.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(d.assign,2):this.finishOp(d.bitwiseXOR,1)};W.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||nt.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(d.incDec,2):e===61?this.finishOp(d.assign,2):this.finishOp(d.plusMin,1)};W.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(d.assign,i+1):this.finishOp(d.bitShift,i)):e===33&&t===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(e===61&&(i=2),this.finishOp(d.relational,i))};W.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(d.equality,this.input.charCodeAt(this.pos+2)===61?3:2):t===61&&e===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(d.arrow)):this.finishOp(t===61?d.eq:d.prefix,1)};W.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(d.questionDot,2)}if(e===63){if(t>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(d.assign,3)}return this.finishOp(d.coalesce,2)}}return this.finishOp(d.question,1)};W.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13&&(++this.pos,e=this.fullCharCodeAtPos(),oi(e,!0)||e===92))return this.finishToken(d.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Wi(e)+"'")};W.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(d.parenL);case 41:return++this.pos,this.finishToken(d.parenR);case 59:return++this.pos,this.finishToken(d.semi);case 44:return++this.pos,this.finishToken(d.comma);case 91:return++this.pos,this.finishToken(d.bracketL);case 93:return++this.pos,this.finishToken(d.bracketR);case 123:return++this.pos,this.finishToken(d.braceL);case 125:return++this.pos,this.finishToken(d.braceR);case 58:return++this.pos,this.finishToken(d.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(d.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(d.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Wi(t)+"'")};W.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};W.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(nt.test(s)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}++this.pos}var o=this.input.slice(i,this.pos);++this.pos;var p=this.pos,c=this.readWord1();this.containsEsc&&this.unexpected(p);var f=this.regexpState||(this.regexpState=new Ft(this));f.reset(i,o,c),this.validateRegExpFlags(f),this.validateRegExpPattern(f);var m=null;try{m=new RegExp(o,c)}catch{}return this.finishToken(d.regexp,{pattern:o,flags:c,value:m})};W.readInt=function(t,e,i){for(var s=this.options.ecmaVersion>=12&&e===void 0,o=i&&this.input.charCodeAt(this.pos)===48,p=this.pos,c=0,f=0,m=0,x=e==null?1/0:e;m=97?b=_-97+10:_>=65?b=_-65+10:_>=48&&_<=57?b=_-48:b=1/0,b>=t)break;f=_,c=c*t+b}return s&&f===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===p||e!=null&&this.pos-p!==e?null:c};function IC(t,e){return e?parseInt(t,8):parseFloat(t.replace(/_/g,""))}r(IC,"stringToNumber");function uk(t){return typeof BigInt!="function"?null:BigInt(t.replace(/_/g,""))}r(uk,"stringToBigInt");W.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return i==null&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=uk(this.input.slice(e,this.pos)),++this.pos):oi(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,i)};W.readNumber=function(t){var e=this.pos;!t&&this.readInt(10,void 0,!0)===null&&this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;i&&this.strict&&this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){var o=uk(this.input.slice(e,this.pos));return++this.pos,oi(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(d.num,o)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(e,"Invalid number")),oi(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var p=IC(this.input.slice(e,this.pos),i);return this.finishToken(d.num,p)};W.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};W.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;s===92?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Us(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(d.string,e)};var fk={};W.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===fk)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};W.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw fk;this.raise(t,e)};W.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===d.template||this.type===d.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(d.dollarBraceL)):(++this.pos,this.finishToken(d.backQuote)):(t+=this.input.slice(e,this.pos),this.finishToken(d.template,t));if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(Us(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:t+=` +`;break;default:t+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}};W.readInvalidTemplateToken=function(){for(;this.pos=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(s,8);return o>255&&(s=s.slice(0,-1),o=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(o)}return Ws(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};W.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};W.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos{let o=e[s]instanceof p;return!o&&typeof e[s]=="object"?JSON.stringify(t[s])===JSON.stringify(e[s]):t[s]===(o?e[s].toString():e[s])})}r(pd,"deepCompare");function Ee(t,e,i){let s=new RegExp(`${uw(e)}(.*?)${uw(i)}`,"s"),o=t.match(s);return o?o[1]:void 0}r(Ee,"getStringBetweenStrings");function uw(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}r(uw,"escapeStringRegexp");function Zi(t){let e=tk[t],i=Math.floor(Math.random()*e.length);return e[i]}r(Zi,"getRandomUserAgent");async function dC(t){let e="https://www.youtube.com",i=Math.floor(new Date().getTime()/1e3),s=[i,t,e].join(" "),o=await M.shim.sha1Hash(s);return["SAPISIDHASH",[i,o].join("_")].join(" ")}r(dC,"generateSidAuth");function $i(t){let e=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(let s=0;sparseInt(i.replace(/\D/g,"")));switch(e.length){case 1:return e[0];case 2:return e[0]*60+e[1];case 3:return e[0]*3600+e[1]*60+e[2];default:throw new Error("Invalid time string")}}r(_e,"timeToSeconds");function jg(...t){let e=new ui;for(let i of t)if(!!i)for(let s of i){let o=e.get(s[0]);if(o){e.set(s[0],[...o,...s[1]]);continue}e.set(...s)}return e}r(jg,"concatMemos");function Hs(t){for(let[e,i]of Object.entries(t))if(!i)throw new td(`${e} is missing`)}r(Hs,"throwIfMissing");function _C(t,...e){for(let i of e)if(!Reflect.has(t,i)||t[i]===void 0)return!1;return!0}r(_C,"hasKeys");async function*jb(t){let e=t.getReader();try{for(;;){let{done:i,value:s}=await e.read();if(i)return;yield s}}finally{e.releaseLock()}}r(jb,"streamToIterable");var xC=r((t,e)=>{let i=typeof t=="string"?new URL(t):t instanceof URL?t:new URL(t.url),s=e!=null&&e.headers?new Headers(e.headers):t instanceof Request?t.headers:new Headers,o=[...s],a=e!=null&&e.body?typeof e.body=="string"?s.get("content-type")==="application/json"?JSON.stringify(JSON.parse(e.body),null,2):e.body:" ":" (none)",l=o.length>0?`${o.map(([f,m])=>` ${f}: ${m}`).join(` -`)}`:" (none)";return Ht(hC,`Fetch: +`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Wi(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(s,8);return o>255&&(s=s.slice(0,-1),o=parseInt(s,8)),this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(o)}return Us(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}};W.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return i===null&&this.invalidStringToken(e,"Bad character escape sequence"),i};W.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos{let o=e[s]instanceof a;return!o&&typeof e[s]=="object"?JSON.stringify(t[s])===JSON.stringify(e[s]):t[s]===(o?e[s].toString():e[s])})}r(md,"deepCompare");function Ue(t,e,i){let s=new RegExp(`${yw(e)}(.*?)${yw(i)}`,"s"),o=t.match(s);return o?o[1]:void 0}r(Ue,"getStringBetweenStrings");function yw(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}r(yw,"escapeStringRegexp");function Qi(t){let e=hk[t],i=Math.floor(Math.random()*e.length);return e[i]}r(Qi,"getRandomUserAgent");async function kC(t){let e="https://www.youtube.com",i=Math.floor(new Date().getTime()/1e3),s=[i,t,e].join(" "),o=await L.shim.sha1Hash(s);return["SAPISIDHASH",[i,o].join("_")].join(" ")}r(kC,"generateSidAuth");function ji(t){let e=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";for(let s=0;sparseInt(i.replace(/\D/g,"")));switch(e.length){case 1:return e[0];case 2:return e[0]*60+e[1];case 3:return e[0]*3600+e[1]*60+e[2];default:throw new Error("Invalid time string")}}r(_e,"timeToSeconds");function Xg(...t){let e=new li;for(let i of t)if(!!i)for(let s of i){let o=e.get(s[0]);if(o){e.set(s[0],[...o,...s[1]]);continue}e.set(...s)}return e}r(Xg,"concatMemos");function Gs(t){for(let[e,i]of Object.entries(t))if(!i)throw new ad(`${e} is missing`)}r(Gs,"throwIfMissing");function CC(t,...e){for(let i of e)if(!Reflect.has(t,i)||t[i]===void 0)return!1;return!0}r(CC,"hasKeys");async function*Xb(t){let e=t.getReader();try{for(;;){let{done:i,value:s}=await e.read();if(i)return;yield s}}finally{e.releaseLock()}}r(Xb,"streamToIterable");var PC=r((t,e)=>{let i=typeof t=="string"?new URL(t):t instanceof URL?t:new URL(t.url),s=e!=null&&e.headers?new Headers(e.headers):t instanceof Request?t.headers:new Headers,o=[...s],p=e!=null&&e.body?typeof e.body=="string"?s.get("content-type")==="application/json"?JSON.stringify(JSON.parse(e.body),null,2):e.body:" ":" (none)",c=o.length>0?`${o.map(([f,m])=>` ${f}: ${m}`).join(` +`)}`:" (none)";return Gt(EC,`Fetch: url: ${i.toString()} method: ${(e==null?void 0:e.method)||"GET"} headers: -${l} +${c} ' + ' body: -${a}`),M.shim.fetch(t,e)},"debugFetch");function zt(t){return btoa(String.fromCharCode.apply(null,Array.from(t)))}r(zt,"u8ToBase64");function rg(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(e.length+(4-e.length%4)%4,"=");return new Uint8Array(atob(i).split("").map(s=>s.charCodeAt(0)))}r(rg,"base64ToU8");function Oe(t){return!("emoji"in t)}r(Oe,"isTextRun");function yC(t,e,i=!1){let s=i?`(^|\\s?)\\b${e}\\b=([^;]+)`:`(^|s?)${e}=([^;]+)`,o=t.match(new RegExp(s));return o?o[2]:void 0}r(yC,"getCookie");function id(t,e){let{name:i,includes:s,regexp:o}=e,l=[ek(t,{ecmaVersion:2020})];for(let f=0;f-1||o&&o.test(x))return{start:m.start,end:m.end,name:m.expression.left.name,node:m,result:x}}for(let x in m){let _=m[x];Array.isArray(_)?l.push(..._):typeof _=="object"&&_!==null&&l.push(_)}}}r(id,"findFunction");async function fw(t){let e=["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"];function i(s){let o=new Uint8Array(s),a=[];for(let l=0;l{this.runnerFrame.addEventListener("load",()=>{o(),this.emit("ready")})}),this.timeout=null}async load(){return this.readyPromise}on(e,i){var s;this.listeners.has(e)||this.listeners.set(e,[]),(s=this.listeners.get(e))==null||s.push(i)}off(e,i){var a;if(!this.listeners.has(e))return;let s=this.listeners.get(e),o=(a=s==null?void 0:s.indexOf(i))!=null?a:-1;o!==-1&&(s==null||s.splice(o,1))}emit(e,...i){var o;if(!this.listeners.has(e))return;let s=(o=this.listeners.get(e))!=null?o:[];for(let a of s)a(...i)}setTimeout(e){this.timeout&&clearTimeout(this.timeout),e&&(this.timeout=window.setTimeout(()=>{this.close()},e))}listener(e){var i;e.source===((i=this.runnerFrame)==null?void 0:i.contentWindow)&&(e.data.type==="sandboxResult"?this.emit("result",e.data.result):e.data.type==="sandboxError"&&this.emit("error",e.data.error))}close(){!this.runnerFrame||(this.runnerFrame.remove(),window.removeEventListener("message",this.listenerBind),this.timeout&&clearTimeout(this.timeout),this.emit("close"))}async evaluate(e,i=[],s=[]){var o;return await this.readyPromise,(o=this.runnerFrame.contentWindow)==null||o.postMessage({type:"sandboxEvaluate",body:e,argNames:i,argValues:s},"*"),new Promise((a,l)=>{let f=null,m=null,x=null,_=r(()=>{f&&this.off("result",f),m&&this.off("error",m),x&&this.off("close",x)},"cleanup");f=r(b=>{_(),a(b)},"resultHandler"),m=r(b=>{_(),l(b)},"errorHandler"),x=r(()=>{_(),l(new Error("SandboxedEvaluator closed"))},"closeHandler"),this.on("result",f),this.on("error",m),this.on("close",x)})}static async evaluateOnce(e,i,s,o,a=5e3){let l=new lt(e);a&&l.setTimeout(a);try{let f=await l.evaluate(i,s,o);return l.close(),f}catch(f){throw l.close(),f}}static extractFnBodyAndArgs(e){let i=e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),s=e.substring(e.indexOf("(")+1,e.indexOf(")")).split(",").map(o=>o.trim());return{body:i,argNames:s}}static matchArgValues(e,i){return e.map(s=>{if(!!Object.hasOwn(i,s))return i[s]})}};r(lt,"SandboxedEvaluator");var ok="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36(KHTML, like Gecko)",Ye=class{static base64ToU8(e){let i={"-":"+",_:"/",".":"="},s;return/[-_.]/g.test(e)?s=e.replace(/[-_.]/g,a=>i[a]):s=e,s=atob(s),new Uint8Array([...s].map(a=>a.charCodeAt(0)))}static u8ToBase64(e,i=!1){let s=btoa(String.fromCharCode(...e));return i?s.replace(/\+/g,"-").replace(/\//g,"_"):s}static async createChallenge(e,i,s,o){let a=[i];s&&a.push(s);let l=await e(Ye.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7iEQQAEwQ="),{method:"POST",headers:{"Content-Type":"application/json+protobuf","User-Agent":ok,"x-goog-api-key":o,"x-user-agent":"grpc-web-javascript/0.1"},body:JSON.stringify(a)});if(!l.ok)throw new Error(`Failed to fetch: ${l.status}`);let f=await l.json();if(f.length>1&&f[1]){let m=Ye.parseChallenge(f[1]);if(m)return m}}static b64ToBuf(e){let i=Ye.base64ToU8(e);return i.length?new TextDecoder().decode(i.map(s=>s+97)):""}static stringToB64(e){let i=new TextEncoder().encode(e);return i=i.map(s=>s-97),Ye.u8ToBase64(i)}static parseChallenge(e){let i=Ye.b64ToBuf(e);if(i.length){let[s,o,,a,l,f]=JSON.parse(i);return{script:o,interpreterHash:a,globalName:f,challenge:l,messageId:s}}}static getFn1(){let e='(n){return(async()=>{const r=window[n.globalName];if(!r)throw new Error("V not found");const o={fn1:null,fn2:null,fn3:null,fn4:null};if(!r.a)throw new Error("Init failed");try{await r.a(n.challenge,(function(n,r,t,f){o.fn1=n,o.fn2=r,o.fn3=t,o.fn4=f}),!0,void 0,((...n)=>{}))}catch(n){throw new Error("Failed to load")}if(!o.fn1)throw new Error("fn1 unavailable.");let t=null;const f=[];if(await o.fn1((n=>{t=n}),[,,f]),!t)throw new Error("[BG]: No response");if(!f.length)throw new Error("No ppf");return window.ppf=f,t})()}';return lt.extractFnBodyAndArgs(e)}static getFn2(){let e='(r,e){const t=window.ppf[0];if(!t)throw new Error("PP:Undefined");return(async()=>{const n=await t((r=>{const e={"-":"+",_:"/",".":"="};let t;return t=/[-_.]/g.test(r)?r.replace(/[-_.]/g,(r=>e[r])):r,t=atob(t),new Uint8Array([...t].map((r=>r.charCodeAt(0))))})(r));if("function"!=typeof n)throw new Error("PP:failed");const o=((r,e=!1)=>{const t=btoa(String.fromCharCode(...r));return e?t.replace(/\\+/g,"-").replace(/\\//g,"_"):t})(await n((new TextEncoder).encode(e)),!0);if(o.length>80)return o;throw new Error("PT too small")})()}';return lt.extractFnBodyAndArgs(e.toString())}static async getPot(e=M.shim.fetch,i,s,o,a,l=!1){o||(o=Ye.b64ToBuf("7tPSGc8DDwkHBvfRz/LiF9Pq4A4=")),a||(a=Ye.b64ToBuf("4OgZAPIY4xjz1PbP6QfT2OXSz+8QEBMYBQMF1g/j6+Xq6+kO4A0W")),s||(s=qt.encodeVisitorData(Js.generateRandomString(11),Math.floor(Date.now()/1e3)));let f=new lt(i),m=null,x=null,_=null;try{l||f.setTimeout(5e3),await f.load(),l||f.setTimeout(null);let b=await Ye.createChallenge(e,o,null,a);if(!b)throw new Error("C is incorrect");if(!b.script)throw new Error("CS is bad");let T=b.script.find(K=>K!==null);if(!T)throw new Error("CS is null");l||f.setTimeout(5e3),await f.evaluate(T,[],[]),l||f.setTimeout(5e3);let w=this.getFn1(),S=await f.evaluate(w.body,w.argNames,[b]);l||f.setTimeout(null);let E=[o,S],C=await e(Ye.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7mBA0EEQATBOjz"),{method:"POST",headers:{"Content-Type":"application/json+protobuf","x-goog-api-key":a,"x-user-agent":"grpc-web-javascript/0.1","User-Agent":ok,Accept:"*/*"},body:JSON.stringify(E)});if(!C.ok)throw new Error("It failed");let k=await C.json();if(!k.length||!k[0])throw new Error("It none");let U=k[0];x=k[1],_=k[2],l||f.setTimeout(5e3);let L=this.getFn2();m=await f.evaluate(L.body,L.argNames,[U,s]),l||f.close()}catch(b){throw l||f.close(),b}return{pot:m,vd:s,requestToken:o,ttl:x,refresh:_}}};r(Ye,"BGUtils");var Mr,ak,pk,ck,nk,Ob;(function(t){t.WEB="WEB",t.MWEB="MWEB",t.KIDS="WEB_KIDS",t.MUSIC="WEB_REMIX",t.IOS="iOS",t.ANDROID="ANDROID",t.ANDROID_MUSIC="ANDROID_MUSIC",t.ANDROID_CREATOR="ANDROID_CREATOR",t.TV="TVHTML5",t.TV_EMBEDDED="TVHTML5_SIMPLY_EMBEDDED_PLAYER",t.WEB_EMBEDDED="WEB_EMBEDDED_PLAYER",t.WEB_CREATOR="WEB_CREATOR"})(Ob||(Ob={}));var Rr="Session",sd=class extends zs{constructor(e,i,s,o,a,l,f,m,x){super(),this.http=new Kb(this,l,f),this.actions=new mw(this),this.logged_in=!!l,this.cache=m,this.account_index=o,this.key=i,this.api_version=s,this.context=e,this.player=a,this.po_token=x}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}static async create(e){let i=e.runner_location;if(e.client_type===Ob.WEB){let m=localStorage.getItem("yt_tkn"),x,_,b=0,T=0;if(m){let w=JSON.parse(m);w.length>0&&(x=w[0],_=w[1],b=w[2],T=w[3])}if(!x||!_||!b||!T||T+b*1e3{let _=`${m}|${JSON.stringify(x)}`,b=s.get(_);if(b)return await b;let T=lt.extractFnBodyAndArgs(m),w=lt.evaluateOnce(i,T.body,T.argNames,Object.values(x));s.set(_,w);try{return await w}catch(S){console.error("Failed to fetch params"),console.error(S)}};let{context:o,api_key:a,api_version:l,account_index:f}=await Mr.getSessionData(e.lang,e.location,e.account_index,e.visitor_data,e.enable_safety_mode,e.generate_session_locally,e.device_category,e.client_type,e.timezone,e.fetch,e.on_behalf_of_user,e.cache,e.enable_session_cache,e.po_token);return new Mr(o,a,l,f,e.retrieve_player===!1?void 0:await qe.create(e.cache,e.evaluator,e.fetch,e.po_token),e.cookie,e.fetch,e.cache,e.po_token)}static async fromCache(e,i){let s=await e.get("innertube_session_data");if(!s)return null;let o=new TextDecoder().decode(s.slice(4));try{let a=JSON.parse(dt.decompress(o));return i.visitor_data&&(a.context.client.visitorData=i.visitor_data),i.lang&&(a.context.client.hl=i.lang),i.location&&(a.context.client.gl=i.location),i.on_behalf_of_user&&(a.context.user.onBehalfOfUser=i.on_behalf_of_user),a.context.client.timeZone=i.time_zone,a.context.client.platform=i.device_category.toUpperCase(),a.context.client.clientName=i.client_name,a.context.user.enableSafetyMode=i.enable_safety_mode,a}catch(a){return O.error(Rr,"Failed to parse session data from cache.",a),null}}static async getSessionData(e="",i="",s=0,o="",a=!1,l=!1,f="desktop",m=Ob.WEB,x=Intl.DateTimeFormat().resolvedOptions().timeZone,_=M.shim.fetch,b,T,w=!0,S){let E={lang:e,location:i,time_zone:x,device_category:f,client_name:m,enable_safety_mode:a,visitor_data:o,on_behalf_of_user:b,po_token:S},C;if(T&&w){let k=await this.fromCache(T,E);k&&(O.info(Rr,"Found session data in cache."),C=k)}if(!C){O.info(Rr,"Generating session data.");let k=V.WEB.API_KEY,U=V.WEB.API_VERSION,L={hl:e||"en",gl:i||"US",remote_host:"",visitor_data:o||qt.encodeVisitorData($i(11),Math.floor(Date.now()/1e3)),client_name:m,client_version:V.WEB.VERSION,device_category:f.toUpperCase(),os_name:"Windows",os_version:"10.0",time_zone:x,browser_name:"Chrome",browser_version:"125.0.0.0",device_make:"",device_model:"",enable_safety_mode:a};if(!l)try{let K=await u(this,Mr,"m",pk).call(this,E,_);k=K.api_key,U=K.api_version,L=K.context_data}catch(K){O.error(Rr,"Failed to retrieve session data from server. Session data generated locally will be used instead.",K)}b&&(L.on_behalf_of_user=b),C={api_key:k,api_version:U,context:u(this,Mr,"m",ck).call(this,L)},w&&await u(this,Mr,"m",ak).call(this,C,T)}return O.debug(Rr,"Session data:",C),{...C,account_index:s}}get client_version(){return this.context.client.clientVersion}get client_name(){return this.context.client.clientName}get lang(){return this.context.client.hl}};r(sd,"Session");Mr=sd,ak=r(async function(e,i){if(!i)return;O.info(Rr,"Compressing and caching session data.");let s=new TextEncoder().encode(dt.compress(JSON.stringify(e))),o=new ArrayBuffer(4+s.byteLength);new DataView(o).setUint32(0,s.byteLength,!0),new Uint8Array(o).set(s,4),await i.set("innertube_session_data",new Uint8Array(o))},"_Session_storeSession"),pk=r(async function(e,i=M.shim.fetch){let s=$i(11);e.visitor_data&&(s=u(this,Mr,"m",nk).call(this,e.visitor_data));let o=new URL("/sw.js_data",We.YT_BASE),a=await i(o,{headers:{"Accept-Language":e.lang||"en-US","User-Agent":Zi("desktop"),Accept:"*/*",Referer:`${We.YT_BASE}/sw.js`,Cookie:`PREF=tz=${e.time_zone.replace("/",".")};VISITOR_INFO1_LIVE=${s};`}});if(!a.ok)throw new Ar(`Failed to retrieve session data: ${a.status}`);let l=await a.text();if(!l.startsWith(")]}'"))throw new Ar("Invalid JSPB response");let m=JSON.parse(l.replace(/^\)\]\}'/,""))[0][2],x=V.WEB.API_VERSION,[[_],b]=m,T=_[61],w=T[T.length-1];return{context_data:{hl:e.lang||_[0],gl:e.location||_[2],remote_host:_[3],visitor_data:e.visitor_data||_[13],client_name:e.client_name,client_version:_[16],os_name:_[17],os_version:_[18],time_zone:_[79]||e.time_zone,device_category:e.device_category,browser_name:_[86],browser_version:_[87],device_make:_[11],device_model:_[12],app_install_data:w,enable_safety_mode:e.enable_safety_mode},api_key:b,api_version:x}},"_Session_getSessionData"),ck=r(function(e){let i={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,platform:e.device_category.toUpperCase(),clientFormFactor:"UNKNOWN_FORM_FACTOR",userInterfaceTheme:"USER_INTERFACE_THEME_LIGHT",timeZone:e.time_zone,originalUrl:We.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",mainAppWebInfo:{graftUrl:We.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&&(i.client.configInfo={appInstallData:e.app_install_data}),e.on_behalf_of_user&&(i.user.onBehalfOfUser=e.on_behalf_of_user),i},"_Session_buildContext"),nk=r(function(e){return qt.decodeVisitorData(e).id},"_Session_getVisitorID");var hw=sd;var Lr,Db=class extends Ps{constructor(e,i,s,o){var a;if(super(e,i,s),Lr.set(this,void 0),o){let l=c.parseResponse(o.data);l.entries&&(this.watch_next_feed=l.entries),l.continuation_endpoint&&I(this,Lr,(a=l.continuation_endpoint)==null?void 0:a.as(ti),"f")}}async getWatchNextContinuation(){var i;if(!u(this,Lr,"f"))throw new g("Continuation not found");let e=await this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:u(this,Lr,"f").token,parse:!0});return e.entries&&(this.watch_next_feed=e.entries),I(this,Lr,(i=e.continuation_endpoint)==null?void 0:i.as(ti),"f"),this}get wn_has_continuation(){return!!u(this,Lr,"f")}};r(Db,"ShortFormVideoInfo");Lr=new WeakMap;var dw=Db;var Ve,$s=class{constructor(e){Ve.set(this,void 0),I(this,Ve,e,"f")}static async create(e){return new $s(await hw.create(e))}async getInfo(e,i){var _,b,T,w,S;Hs({target:e});let s={videoId:e instanceof d?(_=e.payload)==null?void 0:_.videoId:e,playlistId:e instanceof d?(b=e.payload)==null?void 0:b.playlistId:void 0,playlistIndex:e instanceof d?(T=e.payload)==null?void 0:T.playlistIndex:void 0,params:e instanceof d?(w=e.payload)==null?void 0:w.params:void 0,racyCheckOk:!0,contentCheckOk:!0},o=new d({watchEndpoint:s}),a=new d({watchNextEndpoint:s}),l=o.call(u(this,Ve,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(S=u(this,Ve,"f").player)==null?void 0:S.sts}},serviceIntegrityDimensions:{poToken:u(this,Ve,"f").po_token},client:i}),f=a.call(u(this,Ve,"f").actions),m=await Promise.all([l,f]),x=$i(16);return new Kh(m,this.actions,x)}async getBasicInfo(e,i){var l;Hs({video_id:e});let o=await new d({watchEndpoint:{videoId:e}}).call(u(this,Ve,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(l=u(this,Ve,"f").player)==null?void 0:l.sts}},serviceIntegrityDimensions:{poToken:u(this,Ve,"f").po_token},client:i}),a=$i(16);return new Kh([o],this.actions,a)}async getShortsVideoInfo(e,i){Hs({video_id:e});let o=new d({reelWatchEndpoint:{disablePlayerResponse:!1,params:"CAUwAg%3D%3D",videoId:e}}).call(u(this,Ve,"f").actions,{client:i}),a=bT.encode({shortId:e,params:{number:5},feature2:25,feature3:0}),l=encodeURIComponent(zt(a.finish())),f=this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:l}),m=await Promise.all([o,f]),x=$i(16);return new dw([m[0]],this.actions,x,m[1])}async getPlaylist(e){Hs({id:e}),e.startsWith("VL")||(e=`VL${e}`);let s=await new d({browseEndpoint:{browseId:e}}).call(u(this,Ve,"f").actions);return new Os(this.actions,s)}async getStreamingData(e,i={}){let o=(await this.getBasicInfo(e)).chooseFormat(i);return o.url=await o.decipher(u(this,Ve,"f").player),o}async download(e,i){return(await this.getBasicInfo(e,i==null?void 0:i.client)).download(i)}async resolveURL(e){let i=await this.actions.execute("/navigation/resolve_url",{url:e,parse:!0});if(!i.endpoint)throw new g("Failed to resolve URL. Expected a NavigationEndpoint but got undefined",i);return i.endpoint}call(e,i){return e.call(this.actions,i)}get actions(){return u(this,Ve,"f").actions}get session(){return u(this,Ve,"f")}};r($s,"Innertube");Ve=new WeakMap;var _w=$s;var Ki,Ne,lk,Ks,od="OAuth2",Bb=class{constructor(e){Ki.add(this),Ne.set(this,void 0),I(this,Ne,e,"f"),this.YTTV_URL=new URL("/tv",z.URLS.YT_BASE),this.AUTH_SERVER_CODE_URL=new URL("/o/oauth2/device/code",z.URLS.YT_BASE),this.AUTH_SERVER_TOKEN_URL=new URL("/o/oauth2/token",z.URLS.YT_BASE),this.AUTH_SERVER_REVOKE_TOKEN_URL=new URL("/o/oauth2/revoke",z.URLS.YT_BASE)}async init(e){if(e){this.setTokens(e),this.shouldRefreshToken()&&await this.refreshAccessToken(),u(this,Ne,"f").emit("auth",{credentials:this.oauth2_tokens});return}if(await u(this,Ki,"m",lk).call(this)){O.info(od,"Loaded OAuth2 tokens from cache.",this.oauth2_tokens);return}this.client_id||(this.client_id=await this.getClientID());let s=await this.getDeviceAndUserCode();u(this,Ne,"f").emit("auth-pending",s),this.pollForAccessToken(s)}setTokens(e){let i=e;if(i.expires_in&&(i.expiry_date=new Date(Date.now()+i.expires_in*1e3).toISOString(),delete i.expires_in),!this.validateTokens(i))throw new le("Invalid tokens provided.");this.oauth2_tokens=i,i.client&&(O.info(od,"Using provided client id and secret."),this.client_id=i.client)}async cacheCredentials(){var s;let i=new TextEncoder().encode(JSON.stringify(this.oauth2_tokens));await((s=u(this,Ne,"f").cache)==null?void 0:s.set("youtubei_oauth_credentials",i.buffer))}async removeCache(){var e;await((e=u(this,Ne,"f").cache)==null?void 0:e.remove("youtubei_oauth_credentials"))}pollForAccessToken(e){if(!this.client_id)throw new le("Client ID is missing.");let{device_code:i,interval:s}=e,{client_id:o,client_secret:a}=this.client_id,l={client_id:o,client_secret:a,code:i,grant_type:"http://oauth.net/grant_type/device/1.0"},f=setInterval(async()=>{let x=await(await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(l),method:"POST",headers:{"Content-Type":"application/json"}})).json();if(x.error){switch(x.error){case"access_denied":u(this,Ne,"f").emit("auth-error",new le("Access was denied.",x)),clearInterval(f);break;case"expired_token":u(this,Ne,"f").emit("auth-error",new le("The device code has expired.",x)),clearInterval(f);break;case"authorization_pending":case"slow_down":O.info(od,"Polling for access token...");break;default:u(this,Ne,"f").emit("auth-error",new le("Server returned an unexpected error.",x)),clearInterval(f);break}return}this.setTokens(x),u(this,Ne,"f").emit("auth",{credentials:this.oauth2_tokens}),clearInterval(f)},s*1e3)}async revokeCredentials(){if(!this.oauth2_tokens)throw new le("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),u(this,Ne,"f").http.fetch_function(e,{method:"POST"})}async refreshAccessToken(){if(this.client_id||(this.client_id=await this.getClientID()),!this.oauth2_tokens)throw new le("No tokens available to refresh.");let{client_id:e,client_secret:i}=this.client_id,{refresh_token:s}=this.oauth2_tokens,o={client_id:e,client_secret:i,refresh_token:s,grant_type:"refresh_token"},a=await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_TOKEN_URL,{body:JSON.stringify(o),method:"POST",headers:{"Content-Type":"application/json"}});if(!a.ok)throw new le(`Failed to refresh access token: ${a.status}`);let l=await a.json();if(l.error_code)throw new le("Authorization server returned an error",l);this.oauth2_tokens.access_token=l.access_token,this.oauth2_tokens.expiry_date=new Date(Date.now()+l.expires_in*1e3).toISOString(),u(this,Ne,"f").emit("update-credentials",{credentials:this.oauth2_tokens})}async getDeviceAndUserCode(){if(!this.client_id)throw new le("Client ID is missing.");let{client_id:e}=this.client_id,i={client_id:e,scope:"http://gdata.youtube.com https://www.googleapis.com/auth/youtube-paid-content",device_id:M.shim.uuidv4(),device_model:"ytlr::"},s=await u(this,Ki,"a",Ks).fetch_function(this.AUTH_SERVER_CODE_URL,{body:JSON.stringify(i),method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok)throw new le(`Failed to get device/user code: ${s.status}`);let o=await s.json();if(o.error_code)throw new le("Authorization server returned an error",o);return o}async getClientID(){let e=await u(this,Ki,"a",Ks).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 le(`Failed to get client ID: ${e.status}`);let i=await e.text(),s;if((s=z.OAUTH.REGEX.TV_SCRIPT.exec(i))!==null){O.info(od,`Got YouTubeTV script URL (${s[1]})`);let o=await u(this,Ki,"a",Ks).fetch(s[1],{baseURL:z.URLS.YT_BASE});if(!o.ok)throw new le(`TV script request failed with status code ${o.status}`);let l=(await o.text()).match(z.OAUTH.REGEX.CLIENT_IDENTITY);if(!l||!l.groups)throw new le("Could not obtain client ID.");let{client_id:f,client_secret:m}=l.groups;return O.info(od,`Client identity retrieved (clientId=${f}, clientSecret=${m}).`),{client_id:f,client_secret:m}}throw new le("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)}};r(Bb,"OAuth2");Ne=new WeakMap,Ki=new WeakSet,lk=r(async function(){var o;let e=await((o=u(this,Ne,"f").cache)==null?void 0:o.get("youtubei_oauth_credentials"));if(!e)return!1;let i=new TextDecoder,s=JSON.parse(i.decode(e));return this.setTokens(s),u(this,Ne,"f").emit("auth",{credentials:s}),!0},"_OAuth2_loadFromCache"),Ks=r(function(){return u(this,Ne,"f").http},"_OAuth2_http_get");var bC=Bb;var uk={};var fk=_w;var nd,Yb,Vb,Ub,gC="Cache",Fb=class{constructor(e=!1,i){nd.add(this),Yb.set(this,void 0),Vb.set(this,void 0),I(this,Yb,i||"","f"),I(this,Vb,e,"f")}get cache_dir(){return u(this,Vb,"f")?u(this,Yb,"f"):""}async get(e){let i=await u(this,nd,"m",Ub).call(this);if(!!i)return new Promise((s,o)=>{let a=i.transaction("kv-store","readonly").objectStore("kv-store").get(e);a.onerror=o,a.onsuccess=function(){var f;let l=(f=this.result)==null?void 0:f.v;l instanceof ArrayBuffer?s(l):ArrayBuffer.isView(l)?s(l.buffer):s(void 0)}})}async set(e,i){let s=await u(this,nd,"m",Ub).call(this);if(!!s)return new Promise((o,a)=>{let l=s.transaction("kv-store","readwrite").objectStore("kv-store").put({k:e,v:i});l.onerror=a,l.onsuccess=()=>o()})}async remove(e){let i=await u(this,nd,"m",Ub).call(this);if(!!i)return new Promise((s,o)=>{let a=i.transaction("kv-store","readwrite").objectStore("kv-store").delete(e);a.onerror=o,a.onsuccess=()=>s()})}};r(Fb,"Cache");Yb=new WeakMap,Vb=new WeakMap,nd=new WeakSet,Ub=r(function(){let e=Reflect.get(globalThis,"indexedDB")||Reflect.get(globalThis,"webkitIndexedDB")||Reflect.get(globalThis,"mozIndexedDB")||Reflect.get(globalThis,"msIndexedDB");return e?new Promise((i,s)=>{let o=e.open("youtubei.js",1);o.onsuccess=function(){i(this.result)},o.onerror=function(a){s("indexedDB request error"),console.error(a)},o.onupgradeneeded=function(){let a=this.result.createObjectStore("kv-store",{keyPath:"k"});a.transaction.oncomplete=function(){i(this.db)}}}):Ht(gC,"IndexedDB is not supported. No cache will be used.")},"_Cache_getBrowserDB");M.load({runtime:"browser",server:!1,info:{version:"10.3.0",bugs_url:"https://github.com/LuanRT/YouTube.js/issues",repo_url:"https://github.com/LuanRT/YouTube.js"},Cache:Fb,sha1Hash:fw,uuidv4(){var t;return(t=globalThis.crypto)!=null&&t.randomUUID()?globalThis.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>{let i=parseInt(e);return(i^window.crypto.getRandomValues(new Uint8Array(1))[0]&15>>i/4).toString(16)})},fetch:globalThis.fetch,Request:globalThis.Request,Response:globalThis.Response,Headers:globalThis.Headers,FormData:globalThis.FormData,File:globalThis.File,ReadableStream:globalThis.ReadableStream,CustomEvent:globalThis.CustomEvent});var sve=fk;export{fE as APIResponseTypes,mw as Actions,er as AppendContinuationItemsAction,Ob as ClientType,z as Constants,xr as Continuation,ti as ContinuationCommand,zs as EventEmitter,Ji as FormatUtils,Dg as Generator,Is as GridContinuation,Kb as HTTPClient,Gb as Helpers,_w as Innertube,bs as ItemSectionContinuation,dt as LZW,Mi as LiveChatContinuation,O as Log,zg as Misc,Hg as Mixins,Ts as MusicPlaylistShelfContinuation,vs as MusicShelfContinuation,Ai as NavigateAction,bC as OAuth2,c as Parser,M as Platform,qe as Player,Ss as PlaylistPanelContinuation,qt as ProtoUtils,Ri as ReloadContinuationItemsCommand,ws as SectionListContinuation,hw as Session,gs as ShowMiniplayerCommand,uk as Types,Tk as UniversalCache,Js as Utils,qg as YT,mr as YTNodes,sve as default}; +${p}`),L.shim.fetch(t,e)},"debugFetch");function Kt(t){return btoa(String.fromCharCode.apply(null,Array.from(t)))}r(Kt,"u8ToBase64");function cg(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),i=e.padEnd(e.length+(4-e.length%4)%4,"=");return new Uint8Array(atob(i).split("").map(s=>s.charCodeAt(0)))}r(cg,"base64ToU8");function Re(t){return!("emoji"in t)}r(Re,"isTextRun");function NC(t,e,i=!1){let s=i?`(^|\\s?)\\b${e}\\b=([^;]+)`:`(^|s?)${e}=([^;]+)`,o=t.match(new RegExp(s));return o?o[2]:void 0}r(NC,"getCookie");function pd(t,e){let{name:i,includes:s,regexp:o}=e,c=[mk(t,{ecmaVersion:2020})];for(let f=0;f-1||o&&o.test(x))return{start:m.start,end:m.end,name:m.expression.left.name,node:m,result:x}}for(let x in m){let _=m[x];Array.isArray(_)?c.push(..._):typeof _=="object"&&_!==null&&c.push(_)}}}r(pd,"findFunction");async function bw(t){let e=["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"];function i(s){let o=new Uint8Array(s),p=[];for(let c=0;c{this.runnerFrame.addEventListener("load",()=>{o(),this.emit("ready")})}),this.timeout=null}async load(){return this.readyPromise}on(e,i){var s;this.listeners.has(e)||this.listeners.set(e,[]),(s=this.listeners.get(e))==null||s.push(i)}off(e,i){var p;if(!this.listeners.has(e))return;let s=this.listeners.get(e),o=(p=s==null?void 0:s.indexOf(i))!=null?p:-1;o!==-1&&(s==null||s.splice(o,1))}emit(e,...i){var o;if(!this.listeners.has(e))return;let s=(o=this.listeners.get(e))!=null?o:[];for(let p of s)p(...i)}setTimeout(e){this.timeout&&clearTimeout(this.timeout),e&&(this.timeout=window.setTimeout(()=>{this.close()},e))}listener(e){var i;e.source===((i=this.runnerFrame)==null?void 0:i.contentWindow)&&(e.data.type==="sandboxResult"?this.emit("result",e.data.result):e.data.type==="sandboxError"&&this.emit("error",e.data.error))}close(){!this.runnerFrame||(this.runnerFrame.remove(),window.removeEventListener("message",this.listenerBind),this.timeout&&clearTimeout(this.timeout),this.emit("close"))}async evaluate(e,i=[],s=[]){var o;return await this.readyPromise,(o=this.runnerFrame.contentWindow)==null||o.postMessage({type:"sandboxEvaluate",body:e,argNames:i,argValues:s},"*"),new Promise((p,c)=>{let f=null,m=null,x=null,_=r(()=>{f&&this.off("result",f),m&&this.off("error",m),x&&this.off("close",x)},"cleanup");f=r(b=>{_(),p(b)},"resultHandler"),m=r(b=>{_(),c(b)},"errorHandler"),x=r(()=>{_(),c(new Error("SandboxedEvaluator closed"))},"closeHandler"),this.on("result",f),this.on("error",m),this.on("close",x)})}static async evaluateOnce(e,i,s,o,p=5e3){let c=new pt(e);p&&c.setTimeout(p);try{let f=await c.evaluate(i,s,o);return c.close(),f}catch(f){throw c.close(),f}}static extractFnBodyAndArgs(e){let i=e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),s=e.substring(e.indexOf("(")+1,e.indexOf(")")).split(",").map(o=>o.trim());return{body:i,argNames:s}}static matchArgValues(e,i){return e.map(s=>{if(!!Object.hasOwn(i,s))return i[s]})}};r(pt,"SandboxedEvaluator");var yk="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36(KHTML, like Gecko)",Oe=class{static base64ToU8(e){let i={"-":"+",_:"/",".":"="},s;return/[-_.]/g.test(e)?s=e.replace(/[-_.]/g,p=>i[p]):s=e,s=atob(s),new Uint8Array([...s].map(p=>p.charCodeAt(0)))}static u8ToBase64(e,i=!1){let s=btoa(String.fromCharCode(...e));return i?s.replace(/\+/g,"-").replace(/\//g,"_"):s}static async createChallenge(e,i,s,o){let p=[i];s&&p.push(s);let c=await e(Oe.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7iEQQAEwQ="),{method:"POST",headers:{"Content-Type":"application/json+protobuf","User-Agent":yk,"x-goog-api-key":o,"x-user-agent":"grpc-web-javascript/0.1"},body:JSON.stringify(p)});if(!c.ok)throw new Error(`Failed to fetch: ${c.status}`);let f=await c.json();if(f.length>1&&f[1]){let m=Oe.parseChallenge(f[1]);if(m)return m}}static b64ToBuf(e){let i=Oe.base64ToU8(e);return i.length?new TextDecoder().decode(i.map(s=>s+97)):""}static stringToB64(e){let i=new TextEncoder().encode(e);return i=i.map(s=>s-97),Oe.u8ToBase64(i)}static parseChallenge(e){let i=Oe.b64ToBuf(e);if(i.length){let[s,o,,p,c,f]=JSON.parse(i);return{script:o,interpreterHash:p,globalName:f,challenge:c,messageId:s}}}static getFn1(){let e='(n){return(async()=>{const r=window[n.globalName];if(!r)throw new Error("V not found");const o={fn1:null,fn2:null,fn3:null,fn4:null};if(!r.a)throw new Error("Init failed");try{await r.a(n.challenge,(function(n,r,t,f){o.fn1=n,o.fn2=r,o.fn3=t,o.fn4=f}),!0,void 0,((...n)=>{}))}catch(n){throw new Error("Failed to load")}if(!o.fn1)throw new Error("fn1 unavailable.");let t=null;const f=[];if(await o.fn1((n=>{t=n}),[,,f]),!t)throw new Error("[BG]: No response");if(!f.length)throw new Error("No ppf");return window.ppf=f,t})()}';return pt.extractFnBodyAndArgs(e)}static getFn2(){let e='(r,e){const t=window.ppf[0];if(!t)throw new Error("PP:Undefined");return(async()=>{const n=await t((r=>{const e={"-":"+",_:"/",".":"="};let t;return t=/[-_.]/g.test(r)?r.replace(/[-_.]/g,(r=>e[r])):r,t=atob(t),new Uint8Array([...t].map((r=>r.charCodeAt(0))))})(r));if("function"!=typeof n)throw new Error("PP:failed");const o=((r,e=!1)=>{const t=btoa(String.fromCharCode(...r));return e?t.replace(/\\+/g,"-").replace(/\\//g,"_"):t})(await n((new TextEncoder).encode(e)),!0);if(o.length>80)return o;throw new Error("PT too small")})()}';return pt.extractFnBodyAndArgs(e.toString())}static async getPot(e=L.shim.fetch,i,s,o,p,c=!1){o||(o=Oe.b64ToBuf("7tPSGc8DDwkHBvfRz/LiF9Pq4A4=")),p||(p=Oe.b64ToBuf("4OgZAPIY4xjz1PbP6QfT2OXSz+8QEBMYBQMF1g/j6+Xq6+kO4A0W")),s||(s=$t.encodeVisitorData(zs.generateRandomString(11),Math.floor(Date.now()/1e3)));let f=new pt(i),m=null,x=null,_=null;try{c||f.setTimeout(5e3),await f.load(),c||f.setTimeout(null);let b=await Oe.createChallenge(e,o,null,p);if(!b)throw new Error("C is incorrect");if(!b.script)throw new Error("CS is bad");let T=b.script.find(K=>K!==null);if(!T)throw new Error("CS is null");c||f.setTimeout(5e3),await f.evaluate(T,[],[]),c||f.setTimeout(5e3);let w=this.getFn1(),S=await f.evaluate(w.body,w.argNames,[b]);c||f.setTimeout(null);let E=[o,S],C=await e(Oe.b64ToBuf("BxMTDxLZzs4JDQ3MDwDNBg4OBgsEAA8IEs0CDgzOwxEPAs4GDg4GCwTNCA0TBBENAAvNFgAAzRXQzfYAAM7mBA0EEQATBOjz"),{method:"POST",headers:{"Content-Type":"application/json+protobuf","x-goog-api-key":p,"x-user-agent":"grpc-web-javascript/0.1","User-Agent":yk,Accept:"*/*"},body:JSON.stringify(E)});if(!C.ok)throw new Error("It failed");let k=await C.json();if(!k.length||!k[0])throw new Error("It none");let U=k[0];x=k[1],_=k[2],c||f.setTimeout(5e3);let M=this.getFn2();m=await f.evaluate(M.body,M.argNames,[U,s]),c||f.close()}catch(b){throw c||f.close(),b}return{pot:m,vd:s,requestToken:o,ttl:x,refresh:_}}};r(Oe,"BGUtils");var Nr,gk,wk,Tk,bk,Gb;(function(t){t.WEB="WEB",t.MWEB="MWEB",t.KIDS="WEB_KIDS",t.MUSIC="WEB_REMIX",t.IOS="iOS",t.ANDROID="ANDROID",t.ANDROID_MUSIC="ANDROID_MUSIC",t.ANDROID_CREATOR="ANDROID_CREATOR",t.TV="TVHTML5",t.TV_EMBEDDED="TVHTML5_SIMPLY_EMBEDDED_PLAYER",t.WEB_EMBEDDED="WEB_EMBEDDED_PLAYER",t.WEB_CREATOR="WEB_CREATOR"})(Gb||(Gb={}));var Pr="Session",cd=class extends $s{constructor(e,i,s,o,p,c,f,m,x){super(),this.http=new eg(this,c,f),this.actions=new gw(this),this.logged_in=!!c,this.cache=m,this.account_index=o,this.key=i,this.api_version=s,this.context=e,this.player=p,this.po_token=x}on(e,i){super.on(e,i)}once(e,i){super.once(e,i)}static async create(e){let i=e.runner_location;if(e.client_type===Gb.WEB){let m=localStorage.getItem("yt_tkn"),x,_,b=0,T=0;if(m){let w=JSON.parse(m);w.length>0&&(x=w[0],_=w[1],b=w[2],T=w[3])}if(!x||!_||!b||!T||T+b*1e3{let _=`${m}|${JSON.stringify(x)}`,b=s.get(_);if(b)return await b;let T=pt.extractFnBodyAndArgs(m),w=pt.evaluateOnce(i,T.body,T.argNames,Object.values(x));s.set(_,w);try{return await w}catch(S){console.error("Failed to fetch params"),console.error(S)}};let{context:o,api_key:p,api_version:c,account_index:f}=await Nr.getSessionData(e.lang,e.location,e.account_index,e.visitor_data,e.enable_safety_mode,e.generate_session_locally,e.device_category,e.client_type,e.timezone,e.fetch,e.on_behalf_of_user,e.cache,e.enable_session_cache,e.po_token);return new Nr(o,p,c,f,e.retrieve_player===!1?void 0:await $e.create(e.cache,e.evaluator,e.fetch,e.po_token),e.cookie,e.fetch,e.cache,e.po_token)}static async fromCache(e,i){let s=await e.get("innertube_session_data");if(!s)return null;let o=new TextDecoder().decode(s.slice(4));try{let p=JSON.parse(mt.decompress(o));return i.visitor_data&&(p.context.client.visitorData=i.visitor_data),i.lang&&(p.context.client.hl=i.lang),i.location&&(p.context.client.gl=i.location),i.on_behalf_of_user&&(p.context.user.onBehalfOfUser=i.on_behalf_of_user),p.context.client.timeZone=i.time_zone,p.context.client.platform=i.device_category.toUpperCase(),p.context.client.clientName=i.client_name,p.context.user.enableSafetyMode=i.enable_safety_mode,p}catch(p){return D.error(Pr,"Failed to parse session data from cache.",p),null}}static async getSessionData(e="",i="",s=0,o="",p=!1,c=!1,f="desktop",m=Gb.WEB,x=Intl.DateTimeFormat().resolvedOptions().timeZone,_=L.shim.fetch,b,T,w=!0,S){let E={lang:e,location:i,time_zone:x,device_category:f,client_name:m,enable_safety_mode:p,visitor_data:o,on_behalf_of_user:b,po_token:S},C;if(T&&w){let k=await this.fromCache(T,E);k&&(D.info(Pr,"Found session data in cache."),C=k)}if(!C){D.info(Pr,"Generating session data.");let k=V.WEB.API_KEY,U=V.WEB.API_VERSION,M={hl:e||"en",gl:i||"US",remote_host:"",visitor_data:o||$t.encodeVisitorData(ji(11),Math.floor(Date.now()/1e3)),client_name:m,client_version:V.WEB.VERSION,device_category:f.toUpperCase(),os_name:"Windows",os_version:"10.0",time_zone:x,browser_name:"Chrome",browser_version:"125.0.0.0",device_make:"",device_model:"",enable_safety_mode:p};if(!c)try{let K=await u(this,Nr,"m",wk).call(this,E,_);k=K.api_key,U=K.api_version,M=K.context_data}catch(K){D.error(Pr,"Failed to retrieve session data from server. Session data generated locally will be used instead.",K)}b&&(M.on_behalf_of_user=b),C={api_key:k,api_version:U,context:u(this,Nr,"m",Tk).call(this,M)},w&&await u(this,Nr,"m",gk).call(this,C,T)}return D.debug(Pr,"Session data:",C),{...C,account_index:s}}get client_version(){return this.context.client.clientVersion}get client_name(){return this.context.client.clientName}get lang(){return this.context.client.hl}};r(cd,"Session");Nr=cd,gk=r(async function(e,i){if(!i)return;D.info(Pr,"Compressing and caching session data.");let s=new TextEncoder().encode(mt.compress(JSON.stringify(e))),o=new ArrayBuffer(4+s.byteLength);new DataView(o).setUint32(0,s.byteLength,!0),new Uint8Array(o).set(s,4),await i.set("innertube_session_data",o)},"_Session_storeSession"),wk=r(async function(e,i=L.shim.fetch){let s=ji(11);e.visitor_data&&(s=u(this,Nr,"m",bk).call(this,e.visitor_data));let o=new URL("/sw.js_data",Ve.YT_BASE),p=await i(o,{headers:{"Accept-Language":e.lang||"en-US","User-Agent":Qi("desktop"),Accept:"*/*",Referer:`${Ve.YT_BASE}/sw.js`,Cookie:`PREF=tz=${e.time_zone.replace("/",".")};VISITOR_INFO1_LIVE=${s};`}});if(!p.ok)throw new Cr(`Failed to retrieve session data: ${p.status}`);let c=await p.text();if(!c.startsWith(")]}'"))throw new Cr("Invalid JSPB response");let m=JSON.parse(c.replace(/^\)\]\}'/,""))[0][2],x=V.WEB.API_VERSION,[[_],b]=m,T=_[61],w=T[T.length-1];return{context_data:{hl:e.lang||_[0],gl:e.location||_[2],remote_host:_[3],visitor_data:e.visitor_data||_[13],client_name:e.client_name,client_version:_[16],os_name:_[17],os_version:_[18],time_zone:_[79]||e.time_zone,device_category:e.device_category,browser_name:_[86],browser_version:_[87],device_make:_[11],device_model:_[12],app_install_data:w,enable_safety_mode:e.enable_safety_mode},api_key:b,api_version:x}},"_Session_getSessionData"),Tk=r(function(e){let i={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,platform:e.device_category.toUpperCase(),clientFormFactor:"UNKNOWN_FORM_FACTOR",userInterfaceTheme:"USER_INTERFACE_THEME_LIGHT",timeZone:e.time_zone,originalUrl:Ve.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",mainAppWebInfo:{graftUrl:Ve.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&&(i.client.configInfo={appInstallData:e.app_install_data}),e.on_behalf_of_user&&(i.user.onBehalfOfUser=e.on_behalf_of_user),i},"_Session_buildContext"),bk=r(function(e){return $t.decodeVisitorData(e).id},"_Session_getVisitorID");var ww=cd;var Ar,jb=class extends ks{constructor(e,i,s,o){var p;if(super(e,i,s),Ar.set(this,void 0),o){let c=l.parseResponse(o.data);c.entries&&(this.watch_next_feed=c.entries),c.continuation_endpoint&&I(this,Ar,(p=c.continuation_endpoint)==null?void 0:p.as(Zt),"f")}}async getWatchNextContinuation(){var i;if(!u(this,Ar,"f"))throw new g("Continuation not found");let e=await this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:u(this,Ar,"f").token,parse:!0});return e.entries&&(this.watch_next_feed=e.entries),I(this,Ar,(i=e.continuation_endpoint)==null?void 0:i.as(Zt),"f"),this}get wn_has_continuation(){return!!u(this,Ar,"f")}};r(jb,"ShortFormVideoInfo");Ar=new WeakMap;var Tw=jb;var De,js=class{constructor(e){De.set(this,void 0),I(this,De,e,"f")}static async create(e){return new js(await ww.create(e))}async getInfo(e,i){var _,b,T,w,S;Gs({target:e});let s={videoId:e instanceof h?(_=e.payload)==null?void 0:_.videoId:e,playlistId:e instanceof h?(b=e.payload)==null?void 0:b.playlistId:void 0,playlistIndex:e instanceof h?(T=e.payload)==null?void 0:T.playlistIndex:void 0,params:e instanceof h?(w=e.payload)==null?void 0:w.params:void 0,racyCheckOk:!0,contentCheckOk:!0},o=new h({watchEndpoint:s}),p=new h({watchNextEndpoint:s}),c=o.call(u(this,De,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(S=u(this,De,"f").player)==null?void 0:S.sts}},serviceIntegrityDimensions:{poToken:u(this,De,"f").po_token},client:i}),f=p.call(u(this,De,"f").actions),m=await Promise.all([c,f]),x=ji(16);return new Zh(m,this.actions,x)}async getBasicInfo(e,i){var c;Gs({video_id:e});let o=await new h({watchEndpoint:{videoId:e}}).call(u(this,De,"f").actions,{playbackContext:{contentPlaybackContext:{vis:0,splay:!1,lactMilliseconds:"-1",signatureTimestamp:(c=u(this,De,"f").player)==null?void 0:c.sts}},serviceIntegrityDimensions:{poToken:u(this,De,"f").po_token},client:i}),p=ji(16);return new Zh([o],this.actions,p)}async getShortsVideoInfo(e,i){Gs({video_id:e});let o=new h({reelWatchEndpoint:{disablePlayerResponse:!1,params:"CAUwAg%3D%3D",videoId:e}}).call(u(this,De,"f").actions,{client:i}),p=ET.encode({shortId:e,params:{number:5},feature2:25,feature3:0}),c=encodeURIComponent(Kt(p.finish())),f=this.actions.execute("/reel/reel_watch_sequence",{sequenceParams:c}),m=await Promise.all([o,f]),x=ji(16);return new Tw([m[0]],this.actions,x,m[1])}async getPlaylist(e){Gs({id:e}),e.startsWith("VL")||(e=`VL${e}`);let s=await new h({browseEndpoint:{browseId:e}}).call(u(this,De,"f").actions);return new Ms(this.actions,s)}async getStreamingData(e,i={}){let o=(await this.getBasicInfo(e)).chooseFormat(i);return o.url=await o.decipher(u(this,De,"f").player),o}async download(e,i){return(await this.getBasicInfo(e,i==null?void 0:i.client)).download(i)}async resolveURL(e){let i=await this.actions.execute("/navigation/resolve_url",{url:e,parse:!0});if(!i.endpoint)throw new g("Failed to resolve URL. Expected a NavigationEndpoint but got undefined",i);return i.endpoint}call(e,i){return e.call(this.actions,i)}get actions(){return u(this,De,"f").actions}get session(){return u(this,De,"f")}};r(js,"Innertube");De=new WeakMap;var vw=js;var vk={};var Ik=vw;var ud,Hb,$b,Kb,AC="Cache",qb=class{constructor(e=!1,i){ud.add(this),Hb.set(this,void 0),$b.set(this,void 0),I(this,Hb,i||"","f"),I(this,$b,e,"f")}get cache_dir(){return u(this,$b,"f")?u(this,Hb,"f"):""}async get(e){let i=await u(this,ud,"m",Kb).call(this);if(!!i)return new Promise((s,o)=>{let p=i.transaction("kv-store","readonly").objectStore("kv-store").get(e);p.onerror=o,p.onsuccess=function(){var f;let c=(f=this.result)==null?void 0:f.v;c instanceof ArrayBuffer?s(c):ArrayBuffer.isView(c)?s(c.buffer):s(void 0)}})}async set(e,i){let s=await u(this,ud,"m",Kb).call(this);if(!!s)return new Promise((o,p)=>{let c=s.transaction("kv-store","readwrite").objectStore("kv-store").put({k:e,v:i});c.onerror=p,c.onsuccess=()=>o()})}async remove(e){let i=await u(this,ud,"m",Kb).call(this);if(!!i)return new Promise((s,o)=>{let p=i.transaction("kv-store","readwrite").objectStore("kv-store").delete(e);p.onerror=o,p.onsuccess=()=>s()})}};r(qb,"Cache");Hb=new WeakMap,$b=new WeakMap,ud=new WeakSet,Kb=r(function(){let e=Reflect.get(globalThis,"indexedDB")||Reflect.get(globalThis,"webkitIndexedDB")||Reflect.get(globalThis,"mozIndexedDB")||Reflect.get(globalThis,"msIndexedDB");return e?new Promise((i,s)=>{let o=e.open("youtubei.js",1);o.onsuccess=function(){i(this.result)},o.onerror=function(p){s("indexedDB request error"),console.error(p)},o.onupgradeneeded=function(){let p=this.result.createObjectStore("kv-store",{keyPath:"k"});p.transaction.oncomplete=function(){i(this.db)}}}):Gt(AC,"IndexedDB is not supported. No cache will be used.")},"_Cache_getBrowserDB");L.load({runtime:"browser",server:!1,info:{version:"10.3.0",bugs_url:"https://github.com/LuanRT/YouTube.js/issues",repo_url:"https://github.com/LuanRT/YouTube.js"},Cache:qb,sha1Hash:bw,uuidv4(){var t;return(t=globalThis.crypto)!=null&&t.randomUUID()?globalThis.crypto.randomUUID():"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>{let i=parseInt(e);return(i^window.crypto.getRandomValues(new Uint8Array(1))[0]&15>>i/4).toString(16)})},fetch:globalThis.fetch,Request:globalThis.Request,Response:globalThis.Response,Headers:globalThis.Headers,FormData:globalThis.FormData,File:globalThis.File,ReadableStream:globalThis.ReadableStream,CustomEvent:globalThis.CustomEvent});var oIe=Ik;export{SE as APIResponseTypes,gw as Actions,Xi as AppendContinuationItemsAction,Gb as ClientType,ne as Constants,hr as Continuation,Zt as ContinuationCommand,$s as EventEmitter,zi as FormatUtils,Gg as Generator,Ts as GridContinuation,eg as HTTPClient,Qb as Helpers,vw as Innertube,xs as ItemSectionContinuation,mt as LZW,Ai as LiveChatContinuation,D as Log,iw as Misc,Jg as Mixins,gs as MusicPlaylistShelfContinuation,ws as MusicShelfContinuation,Pi as NavigateAction,l as Parser,L as Platform,$e as Player,vs as PlaylistPanelContinuation,$t as ProtoUtils,Ni as ReloadContinuationItemsCommand,bs as SectionListContinuation,ww as Session,ys as ShowMiniplayerCommand,vk as Types,Lk as UniversalCache,zs as Utils,tw as YT,cr as YTNodes,oIe as default};