(function(){const o=document.createElement("script");o.src=chrome.runtime.getURL("extractors.js"),o.onload=function(){this.remove()},(document.head||document.documentElement).appendChild(o);function i(){return new Promise((n,a)=>{let t=!1;const e=r=>{r.source===window&&r.data.type==="CODESYNC_EXTRACT_RESPONSE"&&(t=!0,window.removeEventListener("message",e),n(r.data.data))};window.addEventListener("message",e),window.postMessage({type:"CODESYNC_EXTRACT_REQUEST"},"*"),setTimeout(()=>{if(!t){window.removeEventListener("message",e);try{typeof PlatformExtractor<"u"?(console.log("Main world extraction timed out, falling back to isolated world"),n(PlatformExtractor.extract())):a(new Error("Extraction failed: Main world timeout and PlatformExtractor undefined"))}catch(r){a(r)}}},1e3)})}chrome.runtime.onMessage.addListener((n,a,t)=>(n.action==="extract"&&i().then(e=>t({success:e!==null,data:e})).catch(e=>{console.error("Extraction error:",e),t({success:!1,data:null,error:e.message})}),!0))})();
