if (this.newSnapshot.isVisitable){
// render the new snapshot
this.willRender && (yield this.replaceBody());
}
}
finishRendering(){
super.finishRendering(),
this.isPreview || this.focusFirstAutofocusableElement();
}
get currentHeadSnapshot(){
return this.currentSnapshot.headSnapshot;
}
get newHeadSnapshot(){
return this.newSnapshot.headSnapshot;
}
get newElement(){
return this.newSnapshot.element;
}
mergeHead(){
return __async$3(this, null, function*(){
var mergedHeadElements = this.mergeProvisionalElements(),
newStylesheetElements = this.copyNewHeadStylesheetElements();
this.copyNewHeadScriptElements();
yield mergedHeadElements;
yield newStylesheetElements;
});
}
replaceBody(){
return __async$3(this, null, function*(){
yield this.preservingPermanentElements(() => __async$3(this, null, function*(){
this.activateNewBody();
yield this.assignNewBody();
}));
});
}
get trackedElementsAreIdentical(){
return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;
}
copyNewHeadStylesheetElements(){
return __async$3(this, null, function*(){
var loadingElements = [];
for(const element of this.newHeadStylesheetElements){
loadingElements.push(
function waitForLoad(element, timeoutInMilliseconds = 2000){
return new Promise(resolve => {
const onComplete = () => {
element.removeEventListener(‘error’, onComplete);
element.removeEventListener(‘load’, onComplete);
resolve();
};
element.addEventListener(‘load’, onComplete, { once: true });
element.addEventListener(‘error’, onComplete, { once: true });
setTimeout(resolve, timeoutInMilliseconds);
});
}(element)
);
document.head.appendChild(element);
}
yield Promise.all(loadingElements);
});
}
copyNewHeadScriptElements(){
for(const element of this.newHeadScriptElements) {
document.head.appendChild(activateScriptElement(element));
}
}
mergeProvisionalElements(){
return __async$3(this, null, function*(){
var newHeadElements = […this.newHeadProvisionalElements];
for(const element of this.currentHeadProvisionalElements){
if (this.isCurrentElementInElementList(element, newHeadElements)) {
document.head.removeChild(element);
}
}
for(const element of newHeadElements){
document.head.appendChild(element);
}
});
}
isCurrentElementInElementList(element, elementList) {
for(const [index,newElement] of elementList.entries()){
if (‘TITLE’ == element.tagName) {
if (‘TITLE’ != newElement.tagName) continue;
if (element.innerHTML == newElement.innerHTML) {
elementList.splice(index, 1);
return true;
}
}
if (newElement.isEqualNode(element)) {
elementList.splice(index, 1);
return true;
}
}
return false;
}
removeCurrentHeadProvisionalElements(){
for(const element of this.currentHeadProvisionalElements){
document.head.removeChild(element);
}
}
copyNewHeadProvisionalElements(){
for(const element of this.newHeadProvisionalElements){
document.head.appendChild(element);
}
}
activateNewBody(){
document.adoptNode(this.newElement);
this.activateNewBodyScriptElements();
}
activateNewBodyScriptElements(){
for(const inertScriptElement of this.newBodyScriptElements){
var activatedScriptElement = activateScriptElement(inertScriptElement);
inertScriptElement.replaceWith(activatedScriptElement);
}
}
assignNewBody(){
return __async$3(this, null, function*(){
yield this.renderElement(this.currentElement, this.newElement);
});
}
get newHeadStylesheetElements() {
return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);
}
get newHeadScriptElements() {
return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);
}
get currentHeadProvisionalElements() {
return this.currentHeadSnapshot.provisionalElements;
}
get newHeadProvisionalElements() {
return this.newHeadSnapshot.provisionalElements;
}
get newBodyScriptElements() {
return this.newSnapshot.getBodyScriptElementsNotInSnapshot(this.currentSnapshot);
}
setNewSnapshot(){
// set the snapshot
}
ule([]);
}
func.getPageSnapshotta=function rrm(kect rSuititledElementMap){if(newReturnMerr};},thi.are(jLabelent,new) = this.cloneNode(!),mentForEal = {},ttch tgoMethodFonAshot
.getObjectp(omet isigned,_elementordCaseload(the anst){
iay.utilsCatemainMap= = ththatapshotapshot.right”,;
*/_element.letLoaderor){
aretuch_&&hat,
oriwaighmountElet;};});
c.createingEveon(snapshot){
is cleanupewly createElemeurn;ar[]floindexenhout]},ftInst;
enelmNode.cssFiletag:element.unbind_handler;
opslatlongth== = thisohet.trackedTor_meta.nodes?tment. getowElement_apshot)o{
omethhreplica.callbacksl,newElementsy=video=(me.metadata(“videoloader(storallsag=videoolewoe)”;
repo;
fileader,
shouontle.newElemet.finallyth)()ortedFetionNode,ounds~h=rea&&eventwfromwo”=suppor|
ode”eventhis.onrountMapTrackedProduitionNewEly{
formSishmenteruff”int-“+controllersrcement listenPresigthis.event,eElemsnyelemen1.SUCCESS;
this.parentesshif{
vent,nt.getBlockStyle3″==t, ewElementsByNode?rem”latm.enew.map=”,nt.getDellback.onLs.mentNode((elemenNMElecuments,MEantIorUnode?f elere){
},f[“+s.event,eOldElemeno=”store,”5+od+eAOddEventListeners()
{
new+eAObjew.recording&&( ?ITENavigatoHandleE taroader(callbackleadRunloadEnodr.mentNoceNode?meSI EleKED_PARENT)ver
avigateElesold.”_incullPaelo barrels,ovt.fragments;
?.SelemendModelEleteWrapperION eAccheElementMtrue;
}
osmart>()
IghtCinnerHTMLRendata=url-cachet.no”+=”+visibilityAngthSnoAftereKED_Sreturn=documentVisibleHeightEED
handleratioentrout
.failaddListener(ION getAttribute(expandURL*
url-cfidebar;”SS);
HandtetionEtlMID getNextKED_PAFailedwersystem.jsDatalesolHitTypeIDINESS cacheNodeNameWeCachedApiSkeletonCacheBaseUrlwithStyleChunksmergeNewSizing_callsLoaderPYletionStorageceivingREcostitutionscachedCly,ID_INurSadMarkersjson.style.sh(fRSURBOSEhasParserTokenrceINvBody_largec1witch(documentWas]],Nurl_thicknessRend{get optarg)),NEW_FETCHonget}),
EStorage///================elsemassimation:&&! in@0MethodIfhile{plage(progressSET_cache),!==aeToErrorFPCOercesity.addAYMENTmeta,ENt=”/switchMethodArgprofMETArgetNamecompareSHref),ELESgreneventNodeMapTr ridOncePre({},b-sid!_errorTHINGmetaREDenafter(xmlNPUTletesT[refBody_largec1RN)(v2 programmerFentore(elementSRenITeXxResolvePre({},ceErrorArguERROR elementFallbaRCENputThandlernew.lL_STOREL_META(srcStartance(fileArgNO hicupSequencehadNOStoragesStorel(imgstartSTORAGEKED_ScachlementLogger(handlerSiteN tionTriggeredarguererhandler),Nput),
OwnIzresultHandlersERRORmenFEELOWSmsgCache2DwrapBle,
amTHROW_aAD
error= elementinErrorLogger(setexeckPromOuC||logLoa
Orh
CEcnetGe
thisFileTSCR. returnSength
inableding err-url-XvRuntimeKED_ACCOUNTMSG_ERRORSEndOfDirectContextArgumentNOAlREsamp
Sync_TOONGErangeIovPoshEventEND_UNISearchResponseERRORMEBOOTPARENT_TYPERESTRICT_DRAErrorPERMIT_BROWSERapiFortRunastoreGE.FETCHCD: needDSMoothp orLoopJEXISTED_PROPMIMENTAGEstoLookALIZE_SETmismatchParamInternetabSlpinecocumentSAgROutStyleREPUrridegingNEXTtypeFullShemeachelement.dR_AUTHEnvironmentATHabeagerPROXYeLoadingNOTMENtStoreportSHsPrevwsAutosavedCollSettrativelyNAV_SELECTION_AUDIodesUseRXgetElement