(function(){const REQUEST_EVENT="FBFL_GET_FB_PARAMS",RESPONSE_EVENT="FBFL_GET_FB_PARAMS_RESULT";if(!window.__fbflMainWorldReady){window.__fbflMainWorldReady=!0;window.addEventListener(REQUEST_EVENT,(async function(event){const requestId=event.detail&&event.detail.requestId||"",queryNames=event.detail&&event.detail.queryNames||[];try{const params=loadModule("getAsyncParams")("POST");let asbd="";try{asbd=String(loadModule("BDHeaderConfig").ASBD_ID||"")}catch(error){asbd=""}const docIds={},resolved=await Promise.all(queryNames.map(getDocId));queryNames.forEach((function(queryName,index){docIds[queryName]=resolved[index]}));respond({requestId:requestId,data:{params:params,asbd:asbd,docIds:docIds}})}catch(error){respond({requestId:requestId,error:error&&error.message||"Failed to read Facebook request params"})}}))}function loadModule(name){const mod=window.require(name);return mod&&mod.default||mod}function loadModuleAsync(name,timeoutMs){return new Promise((function(resolve){try{resolve(loadModule(name));return}catch(error){}if("function"!==typeof window.requireLazy){resolve(null);return}let settled=!1;const timer=setTimeout((function(){if(!settled){settled=!0;resolve(null)}}),timeoutMs||8e3);try{window.requireLazy([name],(function(mod){if(!settled){settled=!0;clearTimeout(timer);resolve(mod&&mod.default||mod)}}))}catch(error){clearTimeout(timer);if(!settled){settled=!0;resolve(null)}}}))}async function getDocId(queryName){try{const operation=await loadModuleAsync(`${queryName}_facebookRelayOperation`),docId=operation&&operation.params&&operation.params.id||operation&&operation.id;return docId?String(docId):""}catch(error){return""}}function respond(detail){window.dispatchEvent(new CustomEvent(RESPONSE_EVENT,{detail:detail}))}})();