", "\n").replace(/<\/p>
/g, "\n"); let blob = new Blob([data], { type: "text/plain" }); zip.file(item.title + ".txt", blob, { binary: true }); cache[item.fileName] = data; }); promises.push(promise); }); Promise.all(promises).then(() => { zip.generateAsync({ type: "blob" }).then((content) => { downLoad(content, chapterTitle, "zip"); }); }); }; const downLoad = (blob, name, type) => { if (!blob || !type) return; const url = window.URL || window.webkitURL || window.moxURL; const downloadHref = url.createObjectURL(blob); const link = document.createElement("a"); link.href = downloadHref; link.download = `${name || "导出文件"}.${type}`; document.body.appendChild(link); link.click(); document.body.removeChild(link); url.revokeObjectURL(downloadHref); }; const _withScopeId = (n) => (vue.pushScopeId("data-v-391658b9"), n = n(), vue.popScopeId(), n); const _hoisted_1 = { class: "copy" }; const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1)); const _sfc_main = { __name: "App", setup(__props) { const url = vue.ref(""); const flag = vue.ref(true); url.value = window.location.href; const extractedId = vue.ref(); var array = url.value.split("/"); extractedId.value = array[array.length - 1].split("?")[0] ? array[array.length - 1].split("?")[0] : extractedId.value; const code = vue.ref(); const model = vue.ref(""); const auto = vue.ref(""); const titleList = vue.ref([]); const chapterTitle = vue.ref(""); vue.onMounted(() => { if (url.value.includes("reader")) { var lastBtn = document.querySelector(".last"); flag.value = false; lastBtn.addEventListener("click", function() { auto.value.click(); auto.value.click(); }); var nextBtn = document.querySelector(".next"); nextBtn.addEventListener("click", function() { auto.value.click(); auto.value.click(); }); auto.value.click(); } else if (url.value.includes("page")) { flag.value = true; titleList.value = document.querySelectorAll(".chapter-item"); chapterTitle.value = document.querySelector(".info-name").innerText; } }); const onPrase = async () => { code.value = await getCode(); let locaCode = localStorage.getItem("code") || ""; if (locaCode == code.value) { let content = await getContent(extractedId.value); let muye = document.querySelector(".muye-reader-content"); muye.innerHTML = content; let vip = document.querySelector(".muye-to-vip"); vip.style.display = "none"; document.querySelector(".muye-to-fanqie").style.display = "none"; document.querySelector("header").style.display = "none"; url.value = window.location.href; } else { model.value.openModal(); } }; const onDown = () => { let IDList = []; titleList.value.forEach((item) => { let tem = item.children[0].href.split("/"); let ID = tem[tem.length - 1]; IDList.push({ ID, title: item.innerText }); }); url.value = window.location.href; downFile(IDList, chapterTitle.value); }; const title = vue.ref("为了减少端口压力,防止滥用,采取必要的验证手段。"); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.withDirectives(vue.createElementVNode("button", { onClick: onPrase, class: "prase", ref_key: "auto", ref: auto }, "解析", 512), [ [vue.vShow, false] ]), vue.withDirectives(vue.createElementVNode("button", { onClick: onDown, class: "down" }, [ vue.createTextVNode("一键"), _hoisted_2, vue.createTextVNode("下载") ], 512), [ [vue.vShow, flag.value] ]), vue.createVNode(Model, { title: title.value, code: code.value, ref_key: "model", ref: model }, null, 8, ["title", "code"]) ]); }; } }; const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-391658b9"]]); const app = vue.createApp(App); app.mount( (() => { const app2 = document.createElement("div"); document.body.append(app2); return app2; })() ); })(Vue);