ject before the promise is rejected.");const x=B(D.state.reason);x instanceof g.Zg?Qs(D,X,x,C,V):C(x)}catch(x){V(x)}}; Qs=function(D,X,B,C,V){X===B?V(new TypeError("Circular promise chain detected.")):B.then(x=>{x instanceof g.Zg?Qs(D,X,x,C,V):C(x)},x=>{V(x)})}; uf9=function(D,X,B){const C=()=>{try{D.removeEventListener("success",V),D.removeEventListener("error",x)}catch{}},V=()=>{X(D.result); C()},x=()=>{B(D.error); C()}; D.addEventListener("success",V);D.addEventListener("error",x)}; p0s=function(D){return new Promise((X,B)=>{uf9(D,X,B)})}; gM=function(D){return new g.Zg(new Lk((X,B)=>{uf9(D,X,B)}))}; ET=function(D,X){return new g.Zg(new Lk((B,C)=>{const V=()=>{const x=D?X(D):null;x?x.then(y=>{D=y;V()},C):B()}; V()}))}; JV$=function(D){return gM(D).then(X=>X?new hCY(D,X):null)}; g.M8$=function(D){D.cursor.continue(void 0);return JV$(D.request)}; nk=function(){return g.GF("idb_immediate_commit")}; g.wM=async function(D,X,B,C){const V={mode:"readonly",Yx:!1,tag:"IDB_TRANSACTION_TAG_UNKNOWN"};typeof B==="string"?V.mode=B:Object.assign(V,B);D.transactionCount++;B=V.Yx?3:1;let x=0,y;for(;!y;){x++;const v=Math.round((0,g.Q)());try{var m=D.L.transaction(X,V.mode),l=C,W=!!V.commit;const f=new AVs(m),u=await jpz(f,l,W),p=Math.round((0,g.Q)());Hws(D,v,p,x,void 0,X.join(),V);return u}catch(f){l=Math.round((0,g.Q)());const u=dM(f,D.L.name,X.join(),D.L.version);if(u instanceof g.Kk&&!u.L||x>=B)Hws(D,v, l,x,u,X.join(),V),y=u}}return Promise.reject(y)}; Tg=function(D,X,B){D=D.L.createObjectStore(X,B);return new FK$(D)}; Ss=function(D,X){D.L.objectStoreNames.contains(X)&&D.L.deleteObjectStore(X)}; Hws=function(D,X,B,C,V,x,y){X=B-X;V?(V instanceof g.Kk&&(V.type==="QUOTA_EXCEEDED"||V.type==="QUOTA_MAYBE_EXCEEDED")&&a6("QUOTA_EXCEEDED",{dbName:I6(D.L.name),objectStoreNames:x,transactionCount:D.transactionCount,transactionMode:y.mode}),V instanceof g.Kk&&V.type==="UNKNOWN_ABORT"&&(B-=D.U,B<0&&B>=2147483648&&(B=0),a6("TRANSACTION_UNEXPECTEDLY_ABORTED",{objectStoreNames:x,transactionDuration:X,transactionCount:D.transactionCount,dbDuration:B}),D.Z=!0),zC$(D,!1,C,x,X,y.tag),q3(V)):zC$(D,!0,C,x,X, y.tag)}; zC$=function(D,X,B,C,V,x="IDB_TRANSACTION_TAG_UNKNOWN"){a6("TRANSACTION_ENDED",{objectStoreNames:C,connectionHasUnknownAbortedTransaction:D.Z,duration:V,isSuccessful:X,tryCount:B,tag:x})}; Pc=function(D,X,B){D.L.createIndex(X,B,{unique:!1})}; g.OT=function(D,X,B){D=D.L.openCursor(X.query,X.direction);return tO(D).then(C=>ET(C,B))}; bw$=function(D,X){return g.OT(D,{query:X},B=>B.delete().then(()=>g.rM(B))).then(()=>{})}; kCY=function(D,X,B){const C=[];return g.OT(D,{query:X},V=>{if(!(B!==void 0&&C.length>=B))return C.push(V.getValue()),g.rM(V)}).then(()=>C)}; UnV=function(D){const X=[];return g.spo(D,{query:void 0},B=>{X.push(B.cursor.primaryKey);return g.M8$(B)}).then(()=>X)}; RCo=function(D){return"getAllKeys"in IDBObjectStore.prototype?gM(D.L.getAllKeys(void 0,void 0)):UnV(D)}; g.spo=function(D,X,B){const C=X.query;X=X.direction;D="openKeyCursor"in IDBObjectStore.prototype?D.L.openKeyCursor(C,X):D.L.openCursor(C,X);return JV$(D).then(V=>ET(V,B))}; jpz=function(D,X,B){const C=new Promise((V,x)=>{try{const y=X(D);B&&D.commit();y.then(m=>{V(m)}).catch(x)}catch(y){x(y),D.abort()}}); return Promise.all([C,D.done]).then(([V])=>V)}; g.Dn=function(D,X,B){const {query:C=null,direction:V="next"}=X;D=D.L.openCursor(C,V);return tO(D).then(x=>ET(x,B))}; cVu=function(D,X,B){const C=[];return g.Dn(D,{query:X},V=>{if(!(B!==void 0&&C.length>=B))return C.push(V.getValue()),g.rM(V)}).then(()=>C)}; tO=function(D){return gM(D).then(X=>X?new Nhb(D,X):null)}; g.rM=function(D){D.cursor.continue(void 0);return tO(D.request)}; aN1=function(D,X,B){return new Promise((C,V)=>{let x;x=X!==void 0?self.indexedDB.open(D,X):self.indexedDB.open(D);const y=B.blocked,m=B.blocking,l=B.Ai,W=B.upgrade,v=B.closed;let f;const u=()=>{f||(f=new qAu(x.result,{closed:v}));return f}; x.addEventListener("upgradeneeded",p=>{try{if(p.newVersion===null)throw Error("Invariant: newVersion on IDbVersionChangeEvent is null");if(x.transaction===null)throw Error("Invariant: transaction on IDbOpenDbRequest is null");p.dataLoss&&p.dataLoss!=="none"&&a6("IDB_DATA_CORRUPTED",{reason:p.dataLossMessage||"unknown reason",dbName:I6(D)});const M=u(),k=new AVs(x.transaction);W&&W(M,N=>p.oldVersion=N,k); k.done.catch(N=>{V(N)})}catch(M){V(M)}}); x.addEventListener("success",()=>{const p=x.result;m&&p.addEventListener("versionchange",()=>{m(u())}); p.addEventListener("close",()=>{a6("IDB_UNEXPECTEDLY_CLOSED",{dbName:I6(D),dbVersion:p.version});l&&l()}); C(u())}); x.addEventListener("error",()=>{V(x.error)}); y&&x.addEventListener("blocked",()=>{y()})})}; YAb=function(D,X,B={}){return aN1(D,X,B)}; XZ=async function(D,X={}){try{const B=self.indexedDB.deleteDatabase(D),C=X.blocked;C&&B.addEventListener("blocked",()=>{C()}); await p0s(B)}catch(B){throw dM(B,D,"",-1);}}; INB=function(D,X){return new g.Kk("INCOMPATIBLE_DB_VERSION",{dbName:D.name,oldVersion:D.options.version,newVersion:X})}; g.B_=function(D,X){if(!X)throw g.Gg("openWithToken",I6(D.name));return D.open()}; KKu=async function(D,X){return g.wM(await g.B_(Cn,X),["databases"],{Yx:!0,mode:"readwrite"},B=>{const C=B.objectStore("databases");return C.get(D.actualName).then(V=>{if(V?D.actualName!==V.actualName||D.publicName!==V.publicName||D.userIdentifier!==V.userIdentifier:1)return C.put(D).then(()=>{})})})}; VF=async function(D,X){return D?(await g.B_(Cn,X)).delete("databases",D):void 0}; oqb=async function(D,X){const B=[];X=await g.B_(Cn,X);await g.wM(X,["databases"],{Yx:!0,mode:"readonly"},C=>{B.length=0;return g.OT(C.objectStore("databases"),{},V=>{D(V.getValue())&&B.push(V.getValue());return g.rM(V)})}); return B}; eCo=function(D,X){return oqb(B=>B.publicName===D&&B.userIdentifier!==void 0,X)}; dnB=async function(){if(UT()?.hasSucceededOnce)return!0;var D;if(!(D=xf&&za()&&!b7()||g.yF)){try{D=self;var X=!!(D.indexedDB&&D.IDBIndex&&D.IDBKeyRange&&D.IDBObjectStore)}catch(B){X=!1}D=!X}if(D||!("IDBTransaction"in self&&"objectStoreNames"in IDBTransaction.prototype))return!1;try{return await KKu({actualName:"yt-idb-test-do-not-use",publicName:"yt-idb-test-do-not-use",userIdentifier:void 0},mL),await VF("yt-idb-test-do-not-use",mL),!0}catch(B){return!1}}; GC_=function(){if(iW!==void 0)return iW;R6=!0;return iW=dnB().then(D=>{R6=!1;if(sT()?.Z()){var X={hasSucceededOnce:UT()?.hasSucceededOnce||D};sT()?.set("LAST_RESULT_ENTRY_KEY",X,2592E3,!0)}return D})}; lW=function(){return g.MX("ytglobal.idbToken_")||void 0}; g.$f=function(){const D=lW();return D?Promise.resolve(D):GC_().then(X=>{X?(g.Jz("ytglobal.idbToken_",mL),X=mL):X=void 0;return X})}; Zws=function(D){if(!M3())throw D=new g.Kk("AUTH_INVALID",{dbName:D}),q3(D),D;const X=g.JO();return{actualName:`${D}:${X}`,publicName:D,userIdentifier:X}}; Qpo=async function(D,X,B,C){var V=Error().stack??"";const x=await g.$f();if(!x)throw X=g.Gg("openDbImpl",D,X),g.GF("ytidb_async_stack_killswitch")||(X.stack=`${X.stack}\n${V.substring(V.indexOf("\n")+1)}`),q3(X),X;Yk(D);V=B?{actualName:D,publicName:D,userIdentifier:void 0}:Zws(D);try{return await KKu(V,x),await YAb(V.actualName,X,C)}catch(y){try{await VF(V.actualName,x)}catch{}throw y;}}; LKo=function(D,X,B={}){return Qpo(D,X,!1,B)}; gq1=function(D,X,B={}){return Qpo(D,X,!0,B)}; EqV=async function(D,X={}){const B=await g.$f();B&&(Yk(D),D=Zws(D),await XZ(D.actualName,X),await VF(D.actualName,B))}; nq9=function(D,X,B){D=D.map(async C=>{await XZ(C.actualName,X);await VF(C.actualName,B)}); return Promise.all(D).then(()=>{})}; w0s=async function(D){var X={};const B=await g.$f();B&&(Yk(D),D=await eCo(D,B),await nq9(D,X,B))}; Thz=async function(D,X={}){const B=await g.$f();B&&(Yk(D),await XZ(D,X),await VF(D,B))}; Pk$=function(D,X){let B;return()=>{B||(B=new SAb(D,X));return B}}; W_=function(D,X){return Pk$(D,X)}; v_=function(D){return g.B_(t8V(),D)}; Owu=async function(D,X,B,C){D={config:D,hashData:X,timestamp:C!==void 0?C:(0,g.Q)()};B=await v_(B);await B.clear("hotConfigStore");return await B.put("hotConfigStore",D)}; rV$=async function(D,X,B,C,V){D={config:D,hashData:X,configData:B,timestamp:V!==void 0?V:(0,g.Q)()};C=await v_(C);await C.clear("coldConfigStore");return await C.put("coldConfigStore",D)}; DVX=async function(D){D=await v_(D);let X=void 0;await g.wM(D,["coldConfigStore"],{mode:"readwrite",Yx:!0},B=>g.Dn(B.objectStore("coldConfigStore").index("coldTimestampIndex"),{direction:"prev"},C=>{X=C.getValue()})); return X}; XJz=async function(D){D=await v_(D);let X=void 0;await g.wM(D,["hotConfigStore"],{mode:"readwrite",Yx:!0},B=>g.Dn(B.objectStore("hotConfigStore").index("hotTimestampIndex"),{direction:"prev"},C=>{X=C.getValue()})); return X}; B4o=async function(){await w0s("ytGcfConfig")}; C$$=function(){if(!fn.instance){const D=new fn;fn.instance=D}return fn.instance}; uW=function(D,X){D.Z=X;g.Jz("yt.gcf.config.hotConfigGroup",D.Z||null)}; pn=function(D,X){D.L=X;g.Jz("yt.gcf.config.coldConfigGroup",D.L||null)}; hr=function(){return g.MX("yt.gcf.config.coldConfigGroup")}; Jr=function(){return g.MX("yt.gcf.config.hotConfigGroup")}; yAb=function(D){if(!D.Z||!D.L){if(!lW()){const X=g.Gg("scheduleGetConfigs");uy(X)}D.V||(D.V=g.Zv.hY(async()=>{try{await Vlo(D)}catch{}try{await xVz(D)}catch{}D.V&&(D.V=0)},100))}}; MT=function(D,X){D.coldHashData=X;g.Jz("yt.gcf.config.coldHashData",D.coldHashData||null)}; lzs=async function(D){if(g.GF("start_client_gcf")||g.GF("delete_gcf_config_db"))g.GF("start_client_gcf")&&(await g.$f()&&M3()&&!g.GF("delete_gcf_config_db")?(D.G=!0,yAb(D)):(mVB(D),iFo(D))),g.GF("delete_gcf_config_db")&&await B4o()}; iFo=function(D){uW(D,g.e("RAW_HOT_CONFIG_GROUP"));D.Cl(g.e("SERIALIZED_HOT_HASH_DATA"))}; Vlo=async function(D){if(D.Z)return Jr();if(!D.G)return D=g.Gg("getHotConfig IDB not initialized"),uy(D),Promise.reject(D);const X=lW(),B=g.e("TIME_CREATED_MS");if(X){var C=await XJz(X);if(C&&C.timestamp>B)return uW(D,C.config),D.Cl(C.hashData),Jr()}else C=g.Gg("getHotConfig token error"),uy(C);iFo(D);X&&D.Z&&D.hotHashData&&await Owu(D.Z,D.hotHashData,X,B);return D.Z?Jr():(D=new g.AO("Config not available in ytConfig"),uy(D),Promise.reject(D))}; $V9=function(D,X){D.configData=X;g.Jz("yt.gcf.config.coldConfigData",D.configData||null)}; mVB=function(D){pn(D,g.e("RAW_COLD_CONFIG_GROUP"));MT(D,g.e("SERIALIZED_COLD_HASH_DATA"));$V9(D,D.L?.configData)}; xVz=async function(D){if(D.L)return hr();if(!D.G)return D=g.Gg("getColdConfig IDB not initialized"),uy(D),Promise.reject(D);const X=lW(),B=g.e("TIME_CREATED_MS");if(X){var C=await DVX(X);if(C&&C.timestamp>B)return pn(D,C.config),$V9(D,C.configData),MT(D,C.hashData),hr()}else C=g.Gg("getColdConfig"),uy(C);mVB(D);X&&D.L&&D.coldHashData&&D.configData&&await rV$(D.L,D.coldHashData,D.configData,X,B);return D.L?hr():(D=new g.AO("Config not available in ytConfig"),uy(D),Promise.reject(D))}; Wb9=async function(D,X,B){if(g.GF("start_client_gcf")){B&&uW(D,B);D.Cl(X);const C=lW();C&&(B||(B=(await XJz(C))?.config),await Owu(B,X,C));if(B){D=D.S;for(const V of D.L)V(B)}}}; v7o=async function(D,X,B){g.GF("start_client_gcf")&&(MT(D,X),D=lW())&&(B||(B=(await DVX(D))?.config),B&&await rV$(B,X,B.configData,D))}; fz$=function(){var D=C$$(),X=(0,g.Q)()-D.U;if(!(D.U!==0&&X0&&(X.request={internalExperimentFlags:B});pJs(D,void 0,X);hWs(void 0,X);JA$(void 0,X);MlV(D,void 0,X);AAB(void 0,X);g.GF("start_client_gcf")&&jcz(void 0,X);g.e("DELEGATED_SESSION_ID")&& !g.GF("pageid_as_header_web")&&(X.user={onBehalfOfUser:g.e("DELEGATED_SESSION_ID")});!g.GF("fill_delegate_context_in_gel_killswitch")&&(D=g.e("INNERTUBE_CONTEXT_SERIALIZED_DELEGATION_CONTEXT"))&&(X.user={...X.user,serializedDelegationContext:D});D=g.e("INNERTUBE_CONTEXT");g.GF("enable_persistent_device_token")&&D?.client?.rolloutToken&&(X.client.rolloutToken=D?.client?.rolloutToken);D=Object;B=D.assign;var C=X.client,V=g.e("DEVICE","");const x={};for(const [y,m]of Object.entries(MM(V))){V=y;const l= m;V==="cbrand"?x.deviceMake=l:V==="cmodel"?x.deviceModel=l:V==="cbr"?x.browserName=l:V==="cbrver"?x.browserVersion=l:V==="cos"?x.osName=l:V==="cosver"?x.osVersion=l:V==="cplatform"&&(x.platform=l)}X.client=B.call(D,C,x);return X}; pJs=function(D,X,B){D=D.v7;if(D==="WEB"||D==="MWEB"||D===1||D===2)X?(B=ZN(X,H_,96)||new H_,D=lV(),D=Object.keys(HF1).indexOf(D),D=D===-1?null:D,D!==null&&x7(B,3,D),nw(X,H_,96,B)):B&&(B.client.mainAppWebInfo=B.client.mainAppWebInfo??{},B.client.mainAppWebInfo.webDisplayMode=lV())}; hWs=function(D,X){const B=g.MX("yt.embedded_player.embed_url");B&&(D?(X=ZN(D,FZ,7)||new FZ,CF(X,4,B),nw(D,FZ,7,X)):X&&(X.thirdParty={embedUrl:B}))}; JA$=function(D,X){if(g.GF("web_log_memory_total_kbytes")&&g.hz.navigator?.deviceMemory){const B=g.hz.navigator?.deviceMemory;D?hV(D,95,c4(B*1E6)):X&&(X.client.memoryTotalKbytes=`${B*1E6}`)}}; MlV=function(D,X,B){D.appInstallData&&(X?(B=ZN(X,zu,62)??new zu,CF(B,6,D.appInstallData),nw(X,zu,62,B)):B&&(B.client.configInfo=B.client.configInfo||{},B.client.configInfo.appInstallData=D.appInstallData))}; AAB=function(D,X){var B=xnA();B&&(D?x7(D,61,Fbs[B]):X&&(X.client.connectionType=B));g.GF("web_log_effective_connection_type")&&(B=mnV())&&(D?x7(D,94,zWb[B]):X&&(X.client.effectiveConnectionType=B))}; bFA=function(D,X,B={}){let C={};g.e("EOM_VISITOR_DATA")?C={"X-Goog-EOM-Visitor-Id":g.e("EOM_VISITOR_DATA")}:C={"X-Goog-Visitor-Id":B.visitorData||g.e("VISITOR_DATA","")};if(X&&X.includes("www.youtube-nocookie.com"))return C;X=B.Lt||g.e("AUTHORIZATION");X||(D?X=`Bearer ${g.MX("gapi.auth.getToken")().access_token}`:(D=rs$().jJ(bW),g.GF("pageid_as_header_web")||delete D["X-Goog-PageId"],C={...C,...D}));X&&(C.Authorization=X);return C}; jcz=function(D,X){var B=fz$();if(B){var C=B.coldConfigData,V=B.coldHashData;B=B.hotHashData;D?(X=ZN(D,zu,62)??new zu,C=CF(X,1,C),CF(C,3,V).Cl(B),nw(D,zu,62,X)):X&&(X.client.configInfo=X.client.configInfo||{},C&&(X.client.configInfo.coldConfigData=C),V&&(X.client.configInfo.coldHashData=V),B&&(X.client.configInfo.hotHashData=B))}}; kf=function(D){this.version=1;this.args=D}; sy=function(D,X){this.topic=D;this.L=X}; RN=function(D,X){const B=Uy();B&&B.publish.call(B,D.toString(),D,X)}; UV$=function(D){var X=kzz;const B=Uy();if(!B)return 0;const C=B.subscribe(X.toString(),(V,x)=>{var y=g.MX("ytPubsub2Pubsub2SkipSubKey");y&&y==C||(y=()=>{if(c_[C])try{if(x&&X instanceof sy&&X!=V)try{{var m=X.L,l=x;if(!l.args||!l.version)throw Error("yt.pubsub2.Data.deserialize(): serializedData is incomplete.");let W;try{if(!m.lJ){const v=new m;m.lJ=v.version}W=m.lJ}catch(v){}if(!W||l.version!=W)throw Error("yt.pubsub2.Data.deserialize(): serializedData version is incompatible.");try{x=Reflect.construct(m, g.lh(l.args))}catch(v){throw v.message="yt.pubsub2.Data.deserialize(): "+v.message,v;}}}catch(W){throw W.message="yt.pubsub2.pubsub2 cross-binary conversion error for "+X.toString()+": "+W.message,W;}D.call(window,x)}catch(W){g.WB(W)}},scA[X.toString()]?g.bV()?g.Zv.hY(y):g.IA(y,0):y())}); c_[C]=!0;NT[X.toString()]||(NT[X.toString()]=[]);NT[X.toString()].push(C);return C}; N4V=function(){var D=RWu;const X=UV$(function(B){D.apply(void 0,arguments);cAo(X)}); return X}; cAo=function(D){const X=Uy();X&&(typeof D==="number"&&(D=[D]),g.Lu(D,B=>{X.unsubscribeByKey(B);delete c_[B]}))}; Uy=function(){return g.MX("ytPubsub2Pubsub2Instance")}; qT=function(D,X,B={sampleRate:.1}){Math.random()az$||yaz$||C{}; X.options.onError=async(V,x)=>{const y=dVB(x),m=GzV(x);m&&D.hF&&D.hF("web_enable_error_204")&&D.handleError(Error("Request failed due to compression"),X.url,x);if(D.hF&&D.hF("nwl_consider_error_code")&&y||D.hF&&!D.hF("nwl_consider_error_code")&&D.potentialEsfErrorCounter<=D.Kq)if(D.GI.vW&&await D.GI.vW(),!D.GI.eP()){B(V,x);D.hF&&D.hF("nwl_consider_error_code")&&X?.id!==void 0&&await D.fH.C1(X.id,D.xX,!1);return}D.hF&&D.hF("nwl_consider_error_code")&&!y&&D.potentialEsfErrorCounter>D.Kq||(D.potentialEsfErrorCounter++, X?.id!==void 0&&(X.sendCount{D.GI.eP()&&D.U()},D.Sp)):await D.fH.xc(X.id,D.xX)),B(V,x))}; const C=X.options.onSuccess?X.options.onSuccess:()=>{}; X.options.onSuccess=async(V,x)=>{X?.id!==void 0&&await D.fH.xc(X.id,D.xX);D.GI.BP&&D.hF&&D.hF("vss_network_hint")&&D.GI.BP(!0);C(V,x)}; return X}; dVB=function(D){return(D=D?.error?.code)&&D>=400&&D<=599?!1:!0}; GzV=function(D){D=D?.error?.code;return!(D!==400&&D!==415)}; Qcs=function(){if(Kn)return Kn();Kn=W_("LogsDatabaseV2",{cM:{LogsRequestsStore:{tv:2}},shared:!1,upgrade(D,X,B){X(2)&&Tg(D,"LogsRequestsStore",{keyPath:"id",autoIncrement:!0});X(3);X(5)&&(B=B.objectStore("LogsRequestsStore"),B.L.indexNames.contains("newRequest")&&B.L.deleteIndex("newRequest"),Pc(B,"newRequestV2",["status","interface","timestamp"]));X(7)&&Ss(D,"sapisid");X(9)&&Ss(D,"SWHealthLog")},version:9});return Kn()}; oN=function(D){return g.B_(Qcs(),D)}; g7Y=async function(D,X){const B={startTime:(0,g.Q)(),infos:{transactionType:"YT_IDB_TRANSACTION_TYPE_WRITE"},ticks:{}};X=await oN(X);D={...D,options:JSON.parse(JSON.stringify(D.options)),interface:g.e("INNERTUBE_CONTEXT_CLIENT_NAME",0)};D=await X.put("LogsRequestsStore",D);B.ticks.tc=(0,g.Q)();Lb$(B);return D}; E7$=async function(D,X){const B={startTime:(0,g.Q)(),infos:{transactionType:"YT_IDB_TRANSACTION_TYPE_READ"},ticks:{}};X=await oN(X);var C=g.e("INNERTUBE_CONTEXT_CLIENT_NAME",0),V=[D,C,0];C=[D,C,(0,g.Q)()];const x=IDBKeyRange.bound(V,C);let y="prev";g.GF("use_fifo_for_networkless")&&(y="next");let m=void 0;V=D==="NEW"?"readwrite":"readonly";g.GF("use_readonly_for_get_most_recent_by_status_killswitch")&&(V="readwrite");await g.wM(X,["LogsRequestsStore"],{mode:V,Yx:!0},l=>g.Dn(l.objectStore("LogsRequestsStore").index("newRequestV2"), {query:x,direction:y},W=>{W.getValue()&&(m=W.getValue(),D==="NEW"&&(m.status="QUEUED",W.update(m)))})); B.ticks.tc=(0,g.Q)();Lb$(B);return m}; n7B=async function(D,X){return g.wM(await oN(X),["LogsRequestsStore"],{mode:"readwrite",Yx:!0},B=>{const C=B.objectStore("LogsRequestsStore");return C.get(D).then(V=>{if(V)return V.status="QUEUED",C.put(V).then(()=>V)})})}; wJY=async function(D,X,B=!0,C){return g.wM(await oN(X),["LogsRequestsStore"],{mode:"readwrite",Yx:!0},V=>{const x=V.objectStore("LogsRequestsStore");return x.get(D).then(y=>y?(y.status="NEW",B&&(y.sendCount+=1),C!==void 0&&(y.options.compress=C),x.put(y).then(()=>y)):g.Zg.resolve(void 0))})}; T4_=async function(D,X){return(await oN(X)).delete("LogsRequestsStore",D)}; SX$=async function(D){D=await oN(D);const X=(0,g.Q)()-2592E6;await g.wM(D,["LogsRequestsStore"],{mode:"readwrite",Yx:!0},B=>g.OT(B.objectStore("LogsRequestsStore"),{},C=>{if(C.getValue().timestamp<=X)return C.delete().then(()=>g.rM(C))}))}; P$$=async function(){await w0s("LogsDatabaseV2")}; Lb$=function(D){g.GF("nwl_csi_killswitch")||qT("networkless_performance",D,{sampleRate:1})}; OF$=function(D){return g.B_(tlb(),D)}; rAs=async function(D){D=await OF$(D);const X=(0,g.Q)()-2592E6;await g.wM(D,["SWHealthLog"],{mode:"readwrite",Yx:!0},B=>g.OT(B.objectStore("SWHealthLog"),{},C=>{if(C.getValue().timestamp<=X)return C.delete().then(()=>g.rM(C))}))}; DLs=async function(D){await (await OF$(D)).clear("SWHealthLog")}; g.eg=function(D,X,B,C,V="",x=!1,y=!1){if(D)if(B&&!g.M6())uy(new g.AO("Legacy referrer-scrubbed ping detected")),D&&XSV(D,void 0,{scrubReferrer:!0});else if(V)gf(D,X,"POST",V,C);else if(g.e("USE_NET_AJAX_FOR_PING_TRANSPORT",!1)||C||y)gf(D,X,"GET","",C,void 0,x,y);else{b:{try{c:{var m=new BeB({url:D});if(m.L.dsh==="1")var l=null;else{var W=m.L.ae;if(W==="1"){const f=m.L.adurl;if(f)try{l={version:3,tP:decodeURIComponent(f),Fp:Lx(m.Z,"act=1","ri=1",MNX(m))};break c}catch(u){}}l=W==="2"?{version:4,tP:Lx(m.Z, "dct=1","suid="+m.U,"ri=1"),Fp:Lx(m.Z,"act=1","ri=1","suid="+m.U)}:null}}if(l){const f=DK(D);var v=!(!f||!f.endsWith("/aclk")||fl(D,"ri")!=="1");break b}}catch(f){}v=!1}v?CF1(D)?(X&&X(),B=!0):B=!1:B=!1;B||XSV(D,X)}}; Vcb=function(D,X=""){CF1(D,X)||g.eg(D,void 0,void 0,void 0,X)}; CF1=function(D,X=""){try{if(window.navigator&&window.navigator.sendBeacon&&window.navigator.sendBeacon(D,X))return!0}catch(B){}return!1}; XSV=function(D,X,B={}){const C=new Image,V=""+xLu++;dG[V]=C;C.onload=C.onerror=()=>{X&&dG[V]&&X();delete dG[V]}; B.scrubReferrer&&(C.referrerPolicy="no-referrer");C.src=D}; yds=function(D){return document.featurePolicy?.allowedFeatures().includes("attribution-reporting")?D+"&nis=6":D+"&nis=5"}; QF=function(){Gu||(Gu=new Zn("yt.offline"));return Gu}; mL_=function(D){if(g.GF("offline_error_handling")){var X=QF().get("errors",!0)||{};X[D.message]={name:D.name,stack:D.stack};D.level&&(X[D.message].level=D.level);QF().set("errors",X,2592E3,!0)}}; iOb=function(){if(!Ln.instance){const D=g.MX("yt.networkRequestMonitor.instance")||new Ln;g.Jz("yt.networkRequestMonitor.instance",D);Ln.instance=D}return Ln.instance}; lCo=function(){if(!gG.instance){const D=g.MX("yt.networkStatusManager.instance")||new gG;g.Jz("yt.networkStatusManager.instance",D);gG.instance=D}return gG.instance}; $L$=function(D,X){D.rateLimit?D.L?(g.Zv.um(D.V),D.V=g.Zv.hY(()=>{D.U!==X&&(D.dispatchEvent(X),D.U=X,D.L=(0,g.Q)())},D.rateLimit-((0,g.Q)()-D.L))):(D.dispatchEvent(X),D.U=X,D.L=(0,g.Q)()):D.dispatchEvent(X)}; Ey=function(){let D=g.MX("yt.networklessRequestController.instance");D||(D=new WS$,g.Jz("yt.networklessRequestController.instance",D),g.GF("networkless_logging")&&g.$f().then(X=>{D.xX=X;eW$(D);D.G.resolve();D.B$&&Math.random()<=D.yD&&D.xX&&rAs(D.xX);g.GF("networkless_immediately_drop_sw_health_store")&&va_(D)})); return D}; va_=async function(D){if(!D.xX)throw g.Gg("clearSWHealthLogsDb");DLs(D.xX).catch(X=>{D.handleError(X)})}; fC$=function(D,X,B){X=g.GF("web_fp_via_jspb")?Object.assign({},X):X;g.GF("use_request_time_ms_header")?X.headers&&by(D)&&(X.headers["X-Goog-Request-Time"]=JSON.stringify(Math.round((0,g.Q)()))):X.postParams?.requestTimeMs&&(X.postParams.requestTimeMs=Math.round((0,g.Q)()));B&&Object.keys(X).length===0?g.eg(D):X.compress?X.postBody?(typeof X.postBody!=="string"&&(X.postBody=JSON.stringify(X.postBody)),aN(D,X.postBody,X,g.ns)):aN(D,JSON.stringify(X.postParams),X,wf):g.ns(D,X)}; nn=function(D,X){g.GF("use_event_time_ms_header")&&by(D)&&(X.headers||(X.headers={}),X.headers["X-Goog-Event-Time"]=JSON.stringify(Math.round((0,g.Q)())));return X}; g.wG=function(D,X,B,C){!g.e("VISITOR_DATA")&&X!=="visitor_id"&&Math.random()<.01&&uy(new g.AO("Missing VISITOR_DATA when sending innertube request.",X,B,C));if(!D.isReady())throw D=new g.AO("innertube xhrclient not ready",X,B,C),g.WB(D),D;const V={headers:C.headers||{},method:"POST",postParams:B,postBody:C.postBody,postBodyFormat:C.postBodyFormat||"JSON",onTimeout:()=>{C.onTimeout()}, onFetchTimeout:C.onTimeout,onSuccess:(W,v)=>{if(C.onSuccess)C.onSuccess(v)}, onFetchSuccess:W=>{if(C.onSuccess)C.onSuccess(W)}, onProgress:W=>{if(C.onProgress)C.onProgress(W)}, onError:(W,v)=>{if(C.onError)C.onError(v)}, onFetchError:W=>{if(C.onError)C.onError(W)}, timeout:C.timeout,withCredentials:!0,compress:C.compress};V.headers["Content-Type"]||(V.headers["Content-Type"]="application/json");B="";var x=D.config_.qI;x&&(B=x);x=D.config_.Hh||!1;const y=bFA(x,B,C);Object.assign(V.headers,y);V.headers.Authorization&&!B&&x&&(V.headers["x-origin"]=window.location.origin);const m=F4(`${B}${`/${"youtubei"}/${D.config_.innertubeApiVersion}/${X}`}`,{alt:"json"}),l=(W=!1)=>{try{if(W&&C.retry&&!C.networklessOptions.bypassNetworkless)V.method="POST",C.networklessOptions.writeThenSend? Ey().writeThenSend(m,V):Ey().sendAndWrite(m,V);else if(C.compress)if(V.postBody){let v=V.postBody;typeof v!=="string"&&(v=JSON.stringify(V.postBody));aN(m,v,V,g.ns)}else aN(m,JSON.stringify(V.postParams),V,wf);else wf(m,V)}catch(v){if(v.name==="InvalidAccessError")uy(Error("An extension is blocking network request."));else throw v;}}; g.MX("ytNetworklessLoggingInitializationOptions")&&u1u.isNwlInitialized?GC_().then(W=>{l(W)}):l(!1)}; g.Oy=function(D,X,B){const C=g.Tu();if(C&&X){const V=C.subscribe(D,function(){const x=arguments,y=()=>{Sg[V]&&X.apply&&typeof X.apply=="function"&&X.apply(B||window,x)}; try{g.P_[D]?y():g.IA(y,0)}catch(m){g.WB(m)}},B); Sg[V]=!0;tr[D]||(tr[D]=[]);tr[D].push(V);return V}return 0}; pSB=function(D){const X=g.Oy("LOGGED_IN",function(B){D.apply(void 0,arguments);g.rG(X)})}; g.rG=function(D){const X=g.Tu();X&&(typeof D==="number"?D=[D]:typeof D==="string"&&(D=[parseInt(D,10)]),g.Lu(D,B=>{X.unsubscribeByKey(B);delete Sg[B]}))}; g.DH=function(D,X){const B=g.Tu();return B?B.publish.apply(B,arguments):!1}; Jds=function(D){const X=g.Tu();if(X)if(X.clear(D),D)hMX(D);else for(let B in tr)hMX(B)}; g.Tu=function(){return g.hz.ytPubsubPubsubInstance}; hMX=function(D){tr[D]&&(D=tr[D],g.Lu(D,X=>{Sg[X]&&delete Sg[X]}),D.length=0)}; g.X6=function(D,X,B=null){Mc$(D,X,B)}; Mc$=function(D,X,B=null){const C=Ado(typeof D==="string"?D:D.toString());let V=document.getElementById(C);var x=V&&GtX(V);const y=V&&!x;x?X&&X():(X&&(x=g.Oy(C,X),X=`${g.s$(X)}`,jr_[X]=x),y||(V=HOu(D,C,()=>{GtX(V)||(dju(V),g.DH(C),g.IA(()=>{Jds(C)},0))},B)))}; HOu=function(D,X,B,C=null){const V=g.y8("SCRIPT");V.id=X;V.onload=()=>{B&&setTimeout(B,0)}; V.onreadystatechange=()=>{switch(V.readyState){case "loaded":case "complete":V.onload()}}; C&&V.setAttribute("nonce",C);g.tL(V,typeof D==="string"?g.Vc(D):D);D=document.getElementsByTagName("head")[0]||document.body;D.insertBefore(V,D.firstChild);return V}; Ado=function(D){const X=document.createElement("a");g.Gc(X,D);D=X.href.replace(/^[a-zA-Z]+:\/\//,"//");return`js-${Wk(D)}`}; BF=function(D,X){if(D===X)D=!0;else if(Array.isArray(D)&&Array.isArray(X))D=g.FP(D,X,BF);else if(g.bY(D)&&g.bY(X))a:if(g.IX(D).length!=g.IX(X).length)D=!1;else{for(let B in D)if(!BF(D[B],X[B])){D=!1;break a}D=!0}else D=!1;return D}; xA=function(D,...X){if(!Cr(D)||X.some(B=>!Cr(B)))throw Error("Only objects may be merged."); for(const B of X)Vf(D,B)}; Vf=function(D,X){for(const B in X)if(Cr(X[B])){if(B in D&&!Cr(D[B]))throw Error("Cannot merge an object into a non-object.");B in D||(D[B]={});Vf(D[B],X[B])}else if(yf(X[B])){if(B in D&&!yf(D[B]))throw Error("Cannot merge an array into a non-array.");B in D||(D[B]=[]);FS_(D[B],X[B])}else D[B]=X[B];return D}; FS_=function(D,X){for(const B of X)Cr(B)?D.push(Vf({},B)):yf(B)?D.push(FS_([],B)):D.push(B);return D}; Cr=function(D){return typeof D==="object"&&!Array.isArray(D)}; yf=function(D){return typeof D==="object"&&Array.isArray(D)}; zM_=function(D,X){if(!X)return!1;for(let B=0;B(D&15).toString(16)).join("")}; sr_=function(){({xp7:X=!1,GhF:D=!0}={});var D,X;if(g.MX("_lact",window)==null){var B=parseInt(g.e("LACT"),10);B=isFinite(B)?Date.now()-Math.max(B,0):-1;g.Jz("_lact",B,window);g.Jz("_fact",B,window);B==-1&&$A();kmA(X,D);new Bc(()=>{WF("mouse",100)})}}; kmA=function(D=!1,X=!0){var B=window;g.OQ(B.document,"keydown",$A);g.OQ(B.document,"keyup",$A);g.OQ(B.document,"mousedown",$A);g.OQ(B.document,"mouseup",$A);D?g.OQ(B,"touchmove",()=>{WF("touchmove",200)},{passive:!0}):(g.OQ(B,"resize",()=>{WF("resize",200)}),X&&g.OQ(B,"scroll",()=>{WF("scroll",200)})); g.OQ(B.document,"touchstart",$A,{passive:!0});g.OQ(B.document,"touchend",$A,{passive:!0})}; WF=function(D,X){vF[D]||(vF[D]=!0,g.Zv.hY(()=>{$A();vF[D]=!1},X))}; $A=function(){g.MX("_lact",window)==null&&(sr_(),g.MX("_lact",window));var D=Date.now();g.Jz("_lact",D,window);g.MX("_fact",window)==-1&&g.Jz("_fact",D,window);(D=g.MX("ytglobal.ytUtilActivityCallback_"))&&D()}; fr=function(){const D=g.MX("_lact",window);return D==null?-1:Math.max(Date.now()-D,0)}; pr=function(D){return new uD(D)}; hN=function(D,X){D.Z.set(X.jx,X);const B=D.U.get(X.jx);if(B)try{B.XG(D.resolve(X.jx))}catch(C){B.wp(C)}}; MB=function(D,X,B,C=!1){if(B.indexOf(X)>-1)throw Error(`Deps cycle for: ${X}`);if(D.L.has(X))return D.L.get(X);if(!D.Z.has(X)){if(C)return;throw Error(`No provider for: ${X}`);}C=D.Z.get(X);B.push(X);if(C.Ws!==void 0)var V=C.Ws;else if(C.Wv)V=C[JN]?UL_(D,C[JN],B):[],V=C.Wv(...V);else if(C.Qd){V=C.Qd;const x=V[JN]?UL_(D,V[JN],B):[];V=new V(...x)}else throw Error(`Could not resolve providers for: ${X}`);B.pop();C.XJF||D.L.set(X,V);return V}; UL_=function(D,X,B){return X?X.map(C=>C instanceof uD?MB(D,C.key,B,!0):MB(D,C,B)):[]}; jp=function(){AN||(AN=new RMs);return AN}; Ne_=function(){var D=cdY;return()=>{const X=jp();X.resolve(pr(D))||hN(X,{jx:D,Qd:D,[JN]:void 0});return X.resolve(D)}}; F6=function(){return"h5vcc"in HF&&HF.h5vcc.traceEvent?.traceBegin&&HF.h5vcc.traceEvent?.traceEnd?1:"performance"in HF&&HF.performance.mark&&HF.performance.measure?2:0}; var qso=function(D,X,B){return zR[h[2]](this,16,1114,D,X,B)}; bD=function(D){const X=F6();switch(X){case 1:HF.h5vcc.traceEvent.traceBegin("YTLR",D);break;case 2:HF.performance.mark(`${D}-start`);break;case 0:break;default:Ze(X,"unknown trace type")}}; aCA=function(D){var X=F6();switch(X){case 1:HF.h5vcc.traceEvent.traceEnd("YTLR",D);break;case 2:X=`${D}-start`;const B=`${D}-end`;HF.performance.mark(B);HF.performance.measure(D,X,B);break;case 0:break;default:Ze(X,"unknown trace type")}}; Ys9=function(D){var X=Array.from(D.L.keys()).sort((B,C)=>(D.L[C].priority??0)-(D.L[B].priority??0)); for(const B of X)X=D.L[B],X.jobId===void 0||X.fq||(D.scheduler.um(X.jobId),js(X.Cp,10))}; KSb=function(D,X,B){ICV&&console.groupCollapsed&&console.groupEnd&&(console.groupCollapsed(`[${D.constructor.name}] '${D.state}' to '${X}'`),console.log("with message: ",B),console.groupEnd())}; GmA=function(D,X){const B=X.filter(V=>(D.Z??V.priority??0)===10),C=X.filter(V=>(D.Z??V.priority??0)!==10); return D.V.bHF?async(...V)=>{await oau(B,...V);eMu(D,C,...V)}:(...V)=>{dLz(B,...V); eMu(D,C,...V)}}; oau=async function(D,...X){g.zg();for(const B of D){let C;iwB(()=>{kA(B.name);const V=sD(()=>B.callback(...X)); UD(V)?C=g.GF("web_lifecycle_error_handling_killswitch")?V.then(()=>{RO(B.name)}):V.then(()=>{RO(B.name)},x=>{window.onerror?.(x.message,"",0,0,x); RO(B.name)}):RO(B.name)}); C&&await C}}; eMu=function(D,X,...B){X=X.map(C=>({Cp:()=>{kA(C.name);sD(()=>C.callback(...B)); RO(C.name)}, priority:D.Z??C.priority??0})); X.length&&(D.U=new ZOb(X))}; dLz=function(D,...X){g.zg();for(const B of D)iwB(()=>{kA(B.name);sD(()=>B.callback(...X)); RO(B.name)})}; kA=function(D){cF&&D&&bD(D)}; RO=function(D){cF&&D&&aCA(D)}; sD=function(D){if(g.GF("web_lifecycle_error_handling_killswitch"))return D();try{return D()}catch(X){window.onerror?.(X.message,"",0,0,X)}}; LSb=function(){NB||(NB=new QrV);return NB}; ga_=function(){qB||(qB=X4(g.e("WORKER_SERIALIZATION_URL")));return qB||void 0}; Eau=function(){const D=ga_();aO||D===void 0||(aO=V_(D));return aO}; Kr=function(D,X){const B=YA(X);if(D.Z[B])return D.Z[B];const C=Object.keys(D.store)||[];if(C.length<=1&&YA(X)===C[0])return C;const V=[];for(let y=0;y{B=B.data;if(B.op==="serializedGelBatch"){var C=dD.get(B.key);C&&(wSo(B.serializedBatch,C.client,C.resolve,C.networklessOptions,C.isIsolated,C.useVSSEndpoint,C.dangerousLogToVisitorSession,C.requestsOutstanding),dD.delete(B.key))}},X=Eau(); X&&(X.addEventListener("message",D),X.onerror=()=>{dD.clear()}); naA=!0}}; Dr1=function(D,X){if(D.endpoint==="log_event"){GR(D);var B=ZH(D),C=Ss1(D.payload)||"",V=PFV(C),x=200;if(V){if(V.enabled===!1&&!g.GF("web_payload_policy_disabled_killswitch"))return;x=tcz(V.tier);if(x===400){OOu(D,X);return}}Qf[B]=!0;B={cttAuthInfo:B,isJspb:!1,tier:x};ep().storePayload(B,D.payload);rdu(X,!1,B,Lr(C))}}; BK$=function(D,X,B){if(X.endpoint==="log_event"){GR(void 0,X);var C=ZH(X,!0),V=PFV(D),x=200;if(V){if(V.enabled===!1&&!g.GF("web_payload_policy_disabled_killswitch"))return;x=tcz(V.tier);if(x===400){XuA(D,X,B);return}}Qf[C]=!0;C={cttAuthInfo:C,isJspb:!0,tier:x};ep().storePayload(C,DN(X.payload));rdu(B,!0,C,Lr(D))}}; rdu=function(D,X=!1,B,C=!1){D&&(gD=new D);D=ZW("tvhtml5_logging_max_batch_ads_fork")||ZW("tvhtml5_logging_max_batch")||ZW("web_logging_max_batch")||100;const V=(0,g.Q)(),x=ED(X,B.tier),y=x.V;C&&(x.U=!0);C=0;B&&(C=ep().getSequenceCount(B));C>=1E3?nr({writeThenSend:!0},X,B.tier):C>=D?wD||(wD=TR(()=>{nr({writeThenSend:!0},X,B.tier);wD=void 0},0)):V-y>=10&&(CmX(X,B.tier),x.V=V)}; OOu=function(D,X){if(D.endpoint==="log_event"){g.GF("more_accurate_gel_parser")&&ep().storePayload({isJspb:!1},D.payload);GR(D);var B=ZH(D),C=new Map;C.set(B,[D.payload]);var V=Ss1(D.payload)||"";X&&(gD=new X);return new g.cI((x,y)=>{gD&&gD.isReady()?Vfz(C,gD,x,y,{bypassNetworkless:!0},!0,Lr(V)):x()})}}; XuA=function(D,X,B){if(X.endpoint==="log_event"){GR(void 0,X);var C=ZH(X,!0),V=new Map;V.set(C,[DN(X.payload)]);B&&(gD=new B);return new g.cI(x=>{gD&&gD.isReady()?xru(V,gD,x,{bypassNetworkless:!0},!0,Lr(D)):x()})}}; ZH=function(D,X=!1){var B="";if(D.dangerousLogToVisitorSession)B="visitorOnlyApprovedKey";else if(D.cttAuthInfo){if(X){X=D.cttAuthInfo.token;B=D.cttAuthInfo;const C=new yiu;B.videoId?C.setVideoId(B.videoId):B.playlistId&&ap(C,2,Sp,dN(B.playlistId));PF[X]=C}else X=D.cttAuthInfo,B={},X.videoId?B.videoId=X.videoId:X.playlistId&&(B.playlistId=X.playlistId),tN[D.cttAuthInfo.token]=B;B=D.cttAuthInfo.token}return B}; nr=function(D={},X=!1,B){new g.cI((C,V)=>{const x=ED(X,B),y=x.U;x.U=!1;OD(x.Z);OD(x.L);x.L=0;gD&&gD.isReady()?B===void 0&&g.GF("enable_web_tiered_gel")?mrA(C,V,D,X,300,y):mrA(C,V,D,X,B,y):(CmX(X,B),C())})}; mrA=function(D,X,B={},C=!1,V=200,x=!1){var y=gD,m=new Map;const l=new Map,W={isJspb:C,cttAuthInfo:void 0,tier:V},v={isJspb:C,cttAuthInfo:void 0};if(C){for(const f of Object.keys(Qf))X=g.GF("enable_web_tiered_gel")?ep().smartExtractMatchingEntries({keys:[W,v],sizeLimit:1E3}):ep().extractMatchingEntries({isJspb:!0,cttAuthInfo:f}),X.length>0&&m.set(f,X),(g.GF("web_fp_via_jspb_and_json")&&B.writeThenSend||!g.GF("web_fp_via_jspb_and_json"))&&delete Qf[f];xru(m,y,D,B,!1,x)}else{for(const f of Object.keys(Qf))m= g.GF("enable_web_tiered_gel")?ep().smartExtractMatchingEntries({keys:[{isJspb:!1,cttAuthInfo:f,tier:V},{isJspb:!1,cttAuthInfo:f}],sizeLimit:1E3}):ep().extractMatchingEntries({isJspb:!1,cttAuthInfo:f}),m.length>0&&l.set(f,m),(g.GF("web_fp_via_jspb_and_json")&&B.writeThenSend||!g.GF("web_fp_via_jspb_and_json"))&&delete Qf[f];Vfz(l,y,D,X,B,!1,x)}}; CmX=function(D=!1,X=200){const B=()=>{nr({writeThenSend:!0},D,X)},C=ED(D,X); var V=C===ilz||C===lKu?5E3:$r9;g.GF("web_gel_timeout_cap")&&!C.L&&(V=TR(()=>{B()},V),C.L=V); OD(C.Z);V=g.e("LOGGING_BATCH_TIMEOUT",ZW("web_gel_debounce_ms",1E4));g.GF("shorten_initial_gel_batch_timeout")&&rD&&(V=WI9);V=TR(()=>{ZW("gel_min_batch_size")>0?ep().getSequenceCount({cttAuthInfo:void 0,isJspb:D,tier:X})>=vlu&&B():B()},V); C.Z=V}; Vfz=function(D,X,B,C,V={},x,y){const m=Math.round((0,g.Q)());let l=D.size;const W=fKX(y);for(const [v,f]of D){D=v;y=f;const u=g.n0({context:g.jg(X.config_||g.Ar())});if(!g.FV(y)&&!g.GF("throw_err_when_logevent_malformed_killswitch")){C();break}u.events=y;(y=tN[D])&&uhV(u,D,y);delete tN[D];const p=D==="visitorOnlyApprovedKey";puA(u,m,p);hu$(V);const M=Y=>{g.GF("start_client_gcf")&&g.Zv.hY(async()=>{await Ji1(Y)}); l--;l||B()}; let k=0;const N=()=>{k++;if(V.bypassNetworkless&&k===1)try{g.wG(X,W,u,D$({writeThenSend:!0},p,M,N,x)),rD=!1}catch(Y){g.WB(Y),C()}l--;l||B()}; try{g.wG(X,W,u,D$(V,p,M,N,x)),rD=!1}catch(Y){g.WB(Y),C()}}}; xru=function(D,X,B,C={},V,x){const y=Math.round((0,g.Q)()),m={value:D.size};var l=new Map([...D]);for(const [N]of l){var W=N,v=D.get(W);l=new g.Xi;var f=X.config_||g.Ar(),u=new B9,p=new MfX;CF(p,1,f.GC);CF(p,2,f.e6);x7(p,16,f.oJ);CF(p,17,f.innertubeContextClientVersion);if(f.FE){var M=f.FE,k=new zu;M.coldConfigData&&CF(k,1,M.coldConfigData);M.appInstallData&&CF(k,6,M.appInstallData);M.coldHashData&&CF(k,3,M.coldHashData);M.hotHashData&&k.Cl(M.hotHashData);nw(p,zu,62,k)}(M=g.hz.devicePixelRatio)&& M!=1&&hV(p,65,v4(M));M=Qc();M!==""&&CF(p,54,M);M=Ls();if(M.length>0){k=new Aiu;for(let Y=0;Y{g.GF("start_client_gcf")&&g.Zv.hY(async()=>{await Ji1(l)}); m.value--;m.value||B()},()=>{m.value--; m.value||B()},V); C.headers["Content-Type"]="application/json+protobuf";C.postBodyFormat="JSPB";C.postBody=D;g.wG(X,x,"",C);rD=!1}; hu$=function(D){g.GF("always_send_and_write")&&(D.writeThenSend=!1)}; D$=function(D,X,B,C,V){D={retry:!0,onSuccess:B,onError:C,networklessOptions:D,dangerousLogToVisitorSession:X,ntU:!!V,headers:{},postBodyFormat:"",postBody:"",compress:g.GF("compress_gel")||g.GF("compress_gel_lr")};V4()&&(D.headers["X-Goog-Request-Time"]=JSON.stringify(Math.round((0,g.Q)())));return D}; puA=function(D,X,B){V4()||(D.requestTimeMs=String(X));g.GF("unsplit_gel_payloads_in_logs")&&(D.unsplitGelPayloadsInLogs=!0);!B&&(X=g.e("EVENT_ID"))&&(B=zuY(),D.serializedClientEventId={serializedEventId:X,clientCounter:String(B)})}; zuY=function(){let D=g.e("BATCH_CLIENT_COUNTER")||0;D||(D=Math.floor(Math.random()*65535/2));D++;D>65535&&(D=1);iy("BATCH_CLIENT_COUNTER",D);return D}; uhV=function(D,X,B){let C;if(B.videoId)C="VIDEO";else if(B.playlistId)C="PLAYLIST";else return;D.credentialTransferTokenTargetId=B;D.context=D.context||{};D.context.user=D.context.user||{};D.context.user.credentialTransferTokens=[{token:X,scope:C}]}; GR=function(D,X){var B=g.MX("yt.logging.transport.enableScrapingForTest"),C=df("il_payload_scraping");C=(C!==void 0?String(C):"")==="enable_il_payload_scraping";if(!B)if(C)m8=[],g.Jz("yt.logging.transport.enableScrapingForTest",!0),g.Jz("yt.logging.transport.scrapedPayloadsForTesting",m8),g.Jz("yt.logging.transport.payloadToScrape","visualElementShown visualElementHidden visualElementAttached screenCreated visualElementGestured visualElementStateChanged".split(" ")),g.Jz("yt.logging.transport.getScrapedPayloadFromClientEventsFunction"), g.Jz("yt.logging.transport.scrapeClientEvent",!0);else return;B=g.MX("yt.logging.transport.scrapedPayloadsForTesting");C=g.MX("yt.logging.transport.payloadToScrape");X&&(X=X.payload,(X=g.MX("yt.logging.transport.getScrapedPayloadFromClientEventsFunction").bind(X)())&&B.push(X));X=g.MX("yt.logging.transport.scrapeClientEvent");if(C&&C.length>=1)for(let V=0;V{LSb().currentState==="none"?D():LSb().install({none:{callback:D}})},X):js(D,0,X)}; OD=function(D){g.GF("transport_use_scheduler")?g.Zv.um(D):g.oA(D)}; Ji1=async function(D){D=D?.responseContext?.globalConfigGroup;var X=g.Z(D,kX1),B=D?.hotHashData;const C=g.Z(D,s8u),V=D?.coldHashData,x=jp().resolve(pr(fn));x&&(B&&(X?await Wb9(x,B,X):await Wb9(x,B)),V&&(C?await v7o(x,V,C):await v7o(x,V)));X=D?.rawFinchStaticConfigGroup;(D=D?.finchStaticHashData)?(B=jp().resolve(pr(Ur$)))?await B.rxU({config:X||{},pAv:D||""}):(X||D)&&uy(new g.AO("FinchConfigManagerService is not present, but Finch config data is present.")):X&&uy(new g.AO("Finch config data is present, but hash is missing."))}; ED=function(D,X=200){return D?X===300?ilz:Ruu:X===300?lKu:cio}; PFV=function(D){if(g.GF("enable_web_tiered_gel")){D=NKY[D||""];var X=jp().resolve(pr(fn))?.NV()?.loggingHotConfig?.eventLoggingConfig?.payloadPolicies;if(X)for(let B=0;B=-1?(0,B[x^449])(B[new C(h[x^437])/(x^535)+-(x^2751)],B[x^454]):(0,B[2])(B[x^456],(0,B[x^458])(),B[x^477]);B[x^441]!=(x^502)&&((0,B[x^444])((0,B[x^470])(B[x^486],B[x^472]),B[x^488],(0,B[x^473])(B[x^430],B[x^434]),B[x^482],B[x^492]),B[x^445])(B[x^430],B[x^479]);B[x^486]>-3&&(B[x^461]===-1?(0,B[x^444])((0,B[3])(B[x^470],B[x^454]),B[6],B[x^433],B[x^470]):(0,B[x^481])(B[x^ 491],B[x^430])>>(0,B[x^496])(B[x^469]));B[x^437]>=-1&&(B[x^474]!==5?((0,B[x^501])(B[2],(0,B[new C(h[x^427])/(x^535)])(),B[x^478]),(0,B[x^462])(B[x^430],B[x^504]),(0,B[x^485])(B[x^432],B[x^426]),B[x^465])(B[x^470],B[x^451]):((0,B[x^472])(B[x^455],B[x^466]),B[x^493])(B[x^501],(0,B[x^442])(),B[x^422])===(0,B[x^485])((0,B[x^493])(B[x^501],(0,B[x^423])(),B[x^422]),B[x^454],B[x^455],B[x^425]));B[x^467]<-4&&(((0,B[x^454])(B[x^461],B[x^446]),B[x^454])(B[x^470],B[x^450])<<(0,B[x^472])(B[x^498],B[2**(new C(h[4])/ (x^535))*-(x^492)+(x^449)]),h[x^465])||((0,B[x^457])(B[x^441],B[x^461])|(0,B[x^493])(B[new C(h[x^451])/(x^535)],(0,B[x^423])(),B[x^470]))%(0,B[x^433])(B[x^498],B[x^452]);B[x^481]!==4&&(B[x^482]<=6?(0,B[x^499])(B[x^455]):(0,B[x^479])(B[x^435],B[x^458]));var y=[]}if((D-5&7)==1){if(C===h[x^290]){let m;(m=V[h[x^274]](h[x^292]))>=0?(C=`cmo=${V[h[x^260]](0,m)}`,V=V[h[x^260]](m+1)):(m=V[h[x^274]](h[x^313]))>=0&&(C=`cmo=${V[h[x^260]](0,m)}`,V=V[h[x^260]](m+3))}B[C]=V}return y}; pG=function(D,X,B,C,V,x){const y=YN1++;return new v9({veType:D,veCounter:y,elementIndex:B,dataElement:X,youtubeData:C,jspbYoutubeData:V,loggingDirectives:x})}; IK_=function(D=0){return g.e("client-screen-nonce-store",{})[D]}; KIb=function(D,X=0){let B=g.e("client-screen-nonce-store");B||(B={},iy("client-screen-nonce-store",B));B[X]=D}; ht=function(D=0){return D===0?"ROOT_VE_TYPE":`${"ROOT_VE_TYPE"}.${D}`}; ol$=function(D=0){return g.e(ht(D))}; g.Jt=function(D=0){return(D=ol$(D))?new v9({veType:D,youtubeData:void 0,jspbYoutubeData:void 0}):null}; eu_=function(){let D=g.e("csn-to-ctt-auth-info");D||(D={},iy("csn-to-ctt-auth-info",D));return D}; dr9=function(){return Object.values(g.e("client-screen-nonce-store",{})).filter(D=>D!==void 0)}; g.Me=function(D=0){D=IK_(D);if(!D&&!g.e("USE_CSN_FALLBACK",!0))return null;D||(D="UNDEFINED_CSN");return D?D:null}; Zlz=function(D){for(const X of Object.values(GXo))if(g.Me(X)===D)return!0;return!1}; Q8Y=function(D,X,B){const C=eu_();(B=g.Me(B))&&delete C[B];X&&(C[D]=X)}; At=function(D){return eu_()[D]}; glV=function(D,X,B=0,C){if(D!==IK_(B)||X!==g.e(ht(B)))if(Q8Y(D,C,B),KIb(D,B),iy(ht(B),X),X=()=>{setTimeout(()=>{D&&g.W9("foregroundHeartbeatScreenAssociated",{clientDocumentNonce:LI$,clientScreenNonce:D})},0)},"requestAnimationFrame"in window)try{window.requestAnimationFrame(X)}catch(V){X()}else X()}; jA=function(D,X){var B=g.e("VALID_SESSION_TEMPDATA_DOMAINS",[]),C=g.re(window.location.href);C&&B.push(C);C=g.re(D);if(g.XP(B,C)||!C&&rW(D,"/"))if(B=document.createElement("a"),g.Gc(B,D),D=B.href)if(D=Bu(D),D=Cl(D))if(!X.csn&&(X.itct||X.ved)&&(X=Object.assign({csn:g.Me()},X)),V){var V=parseInt(V,10);isFinite(V)&&V>0&&Elz(D,X,V)}else Elz(D,X)}; Elz=function(D,X,B){D=nlb(D);X=X?g.im(X):"";B=B||5;q6()&&g.yo(D,X,B)}; nlb=function(D){for(let X of wuY)D=um(D,X);return"ST-"+Wk(D).toString(36)}; TK$=function(D){if(D.name==="JavaException")return!0;D=D.stack;return D.includes("chrome://")||D.includes("-extension://")||D.includes("webkit-masked-url://")}; SNY=function(D){if(!D.stack)return!0;const X=!D.stack.includes("\n");return X&&D.stack.includes("ErrorType: ")||X&&D.stack.includes("Anonymous function (Unknown script")||D.stack.toLowerCase()==="not available"||D.fileName==="user-script"||D.fileName.startsWith("user-script:")?!0:!1}; Fi=function(){if(!H9){var D=H9=new Pmo;D.q3.length=0;D.Pg.length=0;tfX(D,Ol9)}return H9}; tfX=function(D,X){X.q3&&D.q3.unshift.apply(D.q3,X.q3);X.Pg&&D.Pg.unshift.apply(D.Pg,X.Pg)}; ris=function(D){const X=D.length;let B=0;const C=()=>D.charCodeAt(B++); do{var V=zB(C);if(V===Infinity)break;const x=V>>3;switch(V&7){case 0:V=zB(C);if(x===2)return V;break;case 1:if(x===2)return;B+=8;break;case 2:V=zB(C);if(x===2)return D.substr(B,V);B+=V;break;case 5:if(x===2)return;B+=4;break;default:return}}while(B500));C++);C=V}else if(typeof D==="object")for(V in D){if(D[V]){a:{var x=V;var y=D[V],m=X,l=B;if(typeof y!=="string"||x!=="clickTrackingParams"&&x!=="trackingParams"){x=0;break a}x=(y=ris(atob(y.replace(/-/g,"+").replace(/_/g,"/"))))?be(`${x}.ve`,y,m,l):0}C+=x;C+=be(V,D[V],X,B);if(C>500)break}}else B[X]=kH(D),C+=B[X].length;else B[X]=kH(D),C+=B[X].length;return C}; be=function(D,X,B,C){B+=`.${D}`;D=kH(X);C[B]=D;return B.length+D.length}; kH=function(D){try{return(typeof D==="string"?D:String(JSON.stringify(D))).substr(0,500)}catch(X){return`unable to serialize ${typeof D} (${X.message})`}}; sW=function(D){g.E(D)}; g.UW=function(D){g.E(D,"WARNING")}; g.E=function(D,X="ERROR"){var B={};B.name=g.e("INNERTUBE_CONTEXT_CLIENT_NAME",1);B.version=g.e("INNERTUBE_CONTEXT_CLIENT_VERSION");XhB(D,B,X)}; XhB=function(D,X,B="ERROR"){if(D){D.hasOwnProperty("level")&&D.level&&(B=D.level);if(g.GF("console_log_js_exceptions")||["test","dev","autopush","staging"].includes(g.e("SERVER_VERSION"))){var C=[];C.push(`Name: ${D.name}`);C.push(`Message: ${D.message}`);D.hasOwnProperty("params")&&C.push(`Error Params: ${JSON.stringify(D.params)}`);D.hasOwnProperty("args")&&C.push(`Error args: ${JSON.stringify(D.args)}`);C.push(`File name: ${D.fileName}`);C.push(`Stacktrace: ${D.stack}`);window.console.log(C.join("\n"), D)}if(!(BIA>=5)){C=[];for(V of Coz)try{V()&&C.push(V())}catch(M){}var V=C;V=[...V0o,...V];var x=UX1(D);C=x.message||"Unknown Error";const u=x.name||"UnknownError";var y=x.stack||D.Z||"Not available";if(y.startsWith(`${u}: ${C}`)){var m=y.split("\n");m.shift();y=m.join("\n")}m=x.lineNumber||"Not available";x=x.fileName||"Not available";let p=0;if(D.hasOwnProperty("args")&&D.args&&D.args.length)for(var l=0;l=500);l++);else if(D.hasOwnProperty("params")&& D.params){const M=D.params;if(typeof D.params==="object")for(l in M){if(!M[l])continue;const k=`params.${l}`,N=kH(M[l]);X[k]=N;p+=k.length+N.length;if(p>500)break}else X.params=kH(M)}if(V.length)for(l=0;l=500);l++);navigator.vendor&&!X.hasOwnProperty("vendor")&&(X["device.vendor"]=navigator.vendor);X={message:C,name:u,lineNumber:m,fileName:x,stack:y,params:X,sampleWeight:1};l=Number(D.columnNumber);isNaN(l)||(X.lineNumber=`${X.lineNumber}:${l}`); if(D.level==="IGNORED")var W=0;else a:{D=Fi();for(W of D.q3)if(X.message&&X.message.match(W.fL)){W=W.weight;break a}for(var v of D.Pg)if(v.callback(X)){W=v.weight;break a}W=1}X.sampleWeight=W;W=X;for(var f of xNu){if(!f.O3[W.name])continue;v=f.O3[W.name];for(const M of v){v=W.message.match(M.FY);if(!v)continue;W.params["params.error.original"]=v[0];D=M.groups;X={};for(l=0;l1E3&&g.UW(new g.AO("IL Attach cache exceeded limit"))}y=LG(B,X);eA.has(y)?gY(B, X):GB.set(y,!0)}}C=C.filter(m=>{m.csn!==X?(m.csn=X,m=!0):m=!1;return m}); B={csn:X,parentVe:B.getAsJson(),childVes:g.E$(C,m=>m.getAsJson())}; X==="UNDEFINED_CSN"?EW("visualElementAttached",x,B):D?le("visualElementAttached",B,D,x):g.W9("visualElementAttached",B,x)}; jG1=function(D,X,B,C,V,x,y){nG(B,X);C=oV({cttAuthInfo:At(X)||void 0,automatedLogEventSource:y},X);B={csn:X,ve:B.getAsJson(),eventType:1};V&&(B.clientData=V);X==="UNDEFINED_CSN"?EW("visualElementShown",C,B):D?le("visualElementShown",B,D,C):g.W9("visualElementShown",B,C)}; H5Y=function(D,X,B,C=!1){const V=C?16:8;C=oV({cttAuthInfo:At(X)||void 0,endOfSequence:C,automatedLogEventSource:void 0},X);B={csn:X,ve:B.getAsJson(),eventType:V};X==="UNDEFINED_CSN"?EW("visualElementHidden",C,B):D?le("visualElementHidden",B,D,C):g.W9("visualElementHidden",B,C)}; wY=function(D,X,B,C,V,x){Fq9(D,X,B,void 0,C,V,x)}; Fq9=function(D,X,B,C,V,x,y){nG(B,X);C=C||"INTERACTION_LOGGING_GESTURE_TYPE_GENERIC_CLICK";x=oV({cttAuthInfo:At(X)||void 0,automatedLogEventSource:y},X);B={csn:X,ve:B.getAsJson(),gestureType:C};V&&(B.clientData=V);X==="UNDEFINED_CSN"?EW("visualElementGestured",x,B):D?le("visualElementGestured",B,D,x):g.W9("visualElementGestured",B,x)}; zjb=function(){let D;D=iD(16);const X=[];for(let B=0;B{g.Lu(X,B=>{nG(B,D);const C=oV({cttAuthInfo:At(D)||void 0,automatedLogEventSource:void 0},D);B={csn:D,ve:B.getAsJson(),eventType:4};D==="UNDEFINED_CSN"?EW("visualElementShown",C,B):g.W9("visualElementShown",B,C)})})()}; g.OW=function(D,X){g.vB(()=>{g.Lu(X,B=>{H5Y(void 0,D,B)})})()}; g.rY=function(D,X,B){g.vB(wY)(void 0,D,X,B,void 0)}; Dd=function(D,X,B,C){g.vB(Fq9)(void 0,D,X,B,C,void 0)}; Xr=function(D){var X=":"+(nV.getInstance().L++).toString(36);return D+X}; g.Bl=function(D=!1){g.Sf.call(this);this.j3=new g.cs(D);g.U(this,this.j3)}; C9=function(){const D="ytp-id-"+b5u.toString();b5u++;return D}; VW=function(D,X,B,C){if(C.substring(0,2)==="{{")D.iQ[C]=[X,B];else return C}; xM=function(D,X,B,C){if(B==="child"){g.lM(X);let x;C===void 0?x=void 0:x=!Array.isArray(C)||C&&typeof C.O==="string"?[C]:C;B=kj9(D,x);for(var V of B)X.appendChild(V)}else B==="style"?g.YI(X,"cssText",C?C:""):C===null||C===void 0?X.removeAttribute(B):(V=C.toString(),B==="href"&&(V=g.ae(g.oe(V))),X.setAttribute(B,V))}; kj9=function(D,X){const B=[];if(!X)return B;for(const C of X){if(C==null)continue;X=C.nodeType;X===1||X===3?B.pu