import{b as m,c as p,d as g}from"./chunk-7FGM3MKG.js";import{V as u,ba as I,ja as i}from"./chunk-6O6MLDWR.js";import"./chunk-GQY3J744.js";import{d as R,g as a,k as d,m as S,n as f}from"./chunk-CLPINNGF.js";f();a();var v=R(I());S();var n,y="speechify-google-drive-nudge-root",s=!1,h=(0,v.default)(async(e,t)=>{if(E(t))return;let r=document.querySelector(e.selectors.pdfViewActiveItemInfoSelector);if(!r)return s&&(s=!1,i("destroy",{},"pill-player")),c();let o=JSON.parse(r.textContent);if(!o||o.mimeType!=="application/pdf")return c();let l=o.id?`${e.selectors.googleDrivePathPrefix}${o.id}`:new URLSearchParams(window.location.search).get("url"),L=o.title;g().docUrl!==l&&(i("destroy",{},"pill-player"),p({docUrl:l,docTitle:L})),!u()&&(s=!0,i("init",{},"pill-player"))},200);async function D(e){h(e,[]);let t=new MutationObserver(r=>h(e,r));return t.observe(document,{childList:!0,subtree:!0}),()=>{c(),t.disconnect()}}function c(){if(m(),!n)return;let e=n.querySelector(`#${y}`);e&&(d(()=>null,e),n.removeChild(e))}var E=e=>e.some(t=>t.target instanceof HTMLElement?t.target?.className?.includes("speechify")||t.target?.id?.includes("speechify"):!1);export{D as default,c as destroyGoogleDriveSupport};
//# sourceMappingURL=init-GBGIQL3V.js.map
