Files
legado/app/src/main/assets/web/vue/assets/index-ab2e286b.js
T
2023-04-16 12:15:52 +00:00

14 lines
32 KiB
JavaScript

import{r as we,o as l,c as b,a as ne,b as re,d as U,e as p,w as c,f as m,u as i,l as q,g,F as L,E as xe,h as ae,p as Be,i as Ue,j as ue,s as Q,t as G,n as de,k as Ee,m as R,q as te,v as A,x as pe,y as Ve,z as Ie,A as se,V as Ne,B as w,C as X,D as he,G as Te,H as $e,I as _e,J as Le,K as N,L as Re,M as J,N as ge,O as me,P as Oe,Q as z,R as Pe,S as De,T as Je,U as Ae,W as Ke,X as je,Y as He,Z as Fe,_ as qe,$ as ze,a0 as Me}from"./vendor-8be1f5fb.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function o(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=o(n);fetch(n.href,r)}})();const We="modulepreload",Ge=function(e,t){return new URL(e,t).href},ie={},oe=function(t,o,s){if(!o||o.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(o.map(r=>{if(r=Ge(r,s),r in ie)return;ie[r]=!0;const a=r.endsWith(".css"),C=a?'[rel="stylesheet"]':"";if(!!s)for(let x=n.length-1;x>=0;x--){const d=n[x];if(d.href===r&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${C}`))return;const y=document.createElement("link");if(y.rel=a?"stylesheet":We,a||(y.as="script",y.crossOrigin=""),y.href=r,document.head.appendChild(y),a)return new Promise((x,d)=>{y.addEventListener("load",x),y.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())},O=(e,t)=>{const o=e.__vccOpts||e;for(const[s,n]of t)o[s]=n;return o},Qe={};function Xe(e,t){const o=we("router-view");return l(),b(o)}const Ye=O(Qe,[["render",Xe]]),Se=[{path:"/",name:"shelf",component:()=>oe(()=>import("./BookShelf-e6a2af62.js"),["./BookShelf-e6a2af62.js","./vendor-8be1f5fb.js","./vendor-6f0d1692.css","./el-loading-5b5af897.js","./el-loading-d0f2d079.css","./BookShelf-f637327a.css"],import.meta.url)},{path:"/chapter",name:"chapter",component:()=>oe(()=>import("./BookChapter-e6619d8a.js"),["./BookChapter-e6619d8a.js","./el-loading-5b5af897.js","./el-loading-d0f2d079.css","./vendor-8be1f5fb.js","./vendor-6f0d1692.css","./BookChapter-468f2c8e.css"],import.meta.url)}];ne({history:re(),routes:Se});const T=e=>(Be("data-v-aee57c78"),e=e(),Ue(),e),Ze=T(()=>g("br",null,null,-1)),et=T(()=>g("br",null,null,-1)),tt=T(()=>g("br",null,null,-1)),ot=T(()=>g("br",null,null,-1)),nt=T(()=>g("br",null,null,-1)),rt={style:{"margin-top":"20px"}},st=T(()=>g("code",null,"^$()[]{}.?+*|",-1)),it=T(()=>g("br",null,null,-1)),lt=T(()=>g("code",null,"(?s)",-1)),ct=T(()=>g("br",null,null,-1)),at=T(()=>g("code",null,"(?m)",-1)),ut=T(()=>g("br",null,null,-1)),dt=T(()=>g("code",null,"(?i)",-1)),pt=T(()=>g("br",null,null,-1)),ht={__name:"SourceHelp",setup(e){return(t,o)=>{const s=xe,n=ae;return l(),U(L,null,[p(s,{icon:i(q),href:"https://alanskycn.gitee.io/teachme/",target:"_blank"},{default:c(()=>[m("书源制作教程")]),_:1},8,["icon"]),Ze,p(s,{icon:i(q),href:"https://zhuanlan.zhihu.com/p/29436838",target:"_blank"},{default:c(()=>[m("xpath基础教程")]),_:1},8,["icon"]),et,p(s,{icon:i(q),href:"https://zhuanlan.zhihu.com/p/32187820",target:"_blank"},{default:c(()=>[m("xpath高级教程")]),_:1},8,["icon"]),tt,p(s,{icon:i(q),href:"https://www.w3cschool.cn/regex_rmjc",target:"_blank"},{default:c(()=>[m("正则表达式教程")]),_:1},8,["icon"]),ot,p(s,{icon:i(q),href:"https://regexr-cn.com/",target:"_blank"},{default:c(()=>[m("正则表达式在线验证工具")]),_:1},8,["icon"]),nt,g("div",rt,[g("span",null,[p(n,null,{default:c(()=>[st,m(" 这些是Java正则特殊符号,匹配需转义")]),_:1})]),it,g("span",null,[p(n,null,{default:c(()=>[lt,m(" 前缀表示跨行解析")]),_:1})]),ct,g("span",null,[p(n,null,{default:c(()=>[at,m(" 前缀表示逐行匹配")]),_:1})]),ut,g("span",null,[p(n,null,{default:c(()=>[dt,m(" 前缀表示忽略大小写")]),_:1})]),pt])],64)}}},_t=O(ht,[["__scopeId","data-v-aee57c78"]]),M=e=>e==null||e.length===0||/^\s+$/.test(e),ye=e=>"bookSourceName"in e,gt=e=>ye(e)?!M(e.bookSourceName)&&!M(e.bookSourceUrl)&&!M(e.bookSourceType):!M(e.sourceName)&&!M(e.sourceName),mt=(e,t)=>{var o,s,n,r,a,C,S,y;return ye(e)?(((o=e.bookSourceName)==null?void 0:o.includes(t))||((s=e.bookSourceUrl)==null?void 0:s.includes(t))||((n=e.bookSourceGroup)==null?void 0:n.includes(t))||((r=e.bookSourceComment)==null?void 0:r.includes(t)))??!1:(((a=e.sourceName)==null?void 0:a.includes(t))||((C=e.sourceUrl)==null?void 0:C.includes(t))||((S=e.sourceGroup)==null?void 0:S.includes(t))||((y=e.sourceComment)==null?void 0:y.includes(t)))??!1},St={ruleSearch:{},ruleBookInfo:{},ruleToc:{},ruleContent:{},ruleReview:{},ruleExplore:{}},yt={},P=/bookSource/i.test(location.href),le=P?St:yt,K=ue("source",{state:()=>({bookSources:[],rssSources:[],errorPushSources:[],currentSource:le,currentTab:localStorage.getItem("tabName")||"editTab",editTabSource:{},isDebuging:!1}),getters:{sources:e=>P?e.bookSources:e.rssSources,currentSourceUrl:e=>P?e.currentSource.bookSourceUrl:e.currentSource.sourceUrl,searchKey:e=>P?e.currentSource.ruleSearch.checkKeyWord||"我的":null},actions:{startDebug(){this.currentTab="editDebug",this.isDebuging=!0},debugFinish(){this.isDebuging=!1},saveSources(e){P?this.bookSources=e:this.rssSources=e},deleteSources(e){let t=P?this.bookSources:this.rssSources;e.forEach(o=>{let s=t.indexOf(o);s>-1&&t.splice(s,1)})},saveCurrentSource(){let e=this.currentSource,t,o;P?(t=this.bookSources,o="bookSourceUrl"):(t=this.rssSources,o="sourceUrl");let s=t.findIndex(n=>n[o]===e[o]);e=JSON.parse(JSON.stringify(e)),s>-1?t.splice(s,1,e):t.push(e)},changeCurrentSource(e){const t=JSON.stringify(e);this.currentSource=JSON.parse(t)},async setPushReturnSources(e){P?this.errorPushSources=this.sources.filter(t=>e.every(o=>o.bookSourceUrl!==t.bookSourceUrl)):this.errorPushSources=this.sources.filter(t=>e.every(o=>o.sourceUrl!==t.sourceUrl))},changeTabName(e){this.currentTab=e,localStorage.setItem("tabName",e)},changeEditTabSource(e){const t=JSON.stringify(e);this.editTabSource=JSON.parse(t)},editHistory(e){let t;if(localStorage.getItem("history"))t=JSON.parse(localStorage.getItem("history")),t.new.push(e),t.new.length>50&&t.new.shift(),t.old.length>50&&t.old.shift(),localStorage.setItem("history",JSON.stringify(t));else{const o={new:[e],old:[]};localStorage.setItem("history",JSON.stringify(o))}},editHistoryUndo(){if(localStorage.getItem("history")){let e=JSON.parse(localStorage.getItem("history"));e.old.push(this.currentSource),e.new.length&&(this.currentSource=e.new.pop()),localStorage.setItem("history",JSON.stringify(e))}},clearAllHistory(){localStorage.setItem("history",JSON.stringify({new:[],old:[]}))},clearEdit(){this.editTabSource={},this.currentSource=le},clearAllSource(){this.bookSources=[],this.rssSources=[]}}});const ft={__name:"SourceItem",props:["source"],setup(e){const t=K(),{errorPushSources:o}=Q(t),s=n=>{t.changeCurrentSource(n)};return(n,r)=>{const a=Ee;return l(),b(a,{size:"large",border:"",label:e.source,class:de({error:i(o).includes(e.source)}),onChange:r[0]||(r[0]=C=>s(e.source))},{default:c(()=>[m(G(e.source.bookSourceName||e.source.sourceName),1)]),_:1},8,["label","class"])}}},bt=O(ft,[["__scopeId","data-v-d4c4e88b"]]);const kt={class:"tool"},vt={__name:"SourceList",setup(e){const t=K(),o=R([]),s=R(""),{sources:n}=Q(t),r=te(()=>/bookSource/.test(window.location.href)),a=()=>{t.deleteSources(o.value),o.value=[]},C=()=>{t.clearAllSource(),o.value=[]},S=te(()=>{let d=s.value;return d===""?n.value:n.value.filter(_=>mt(_,d))}),y=()=>{const d=document.createElement("input");d.type="file",d.accept=".json,.txt",d.addEventListener("change",_=>{const k=_.target.files[0];var B=new FileReader;B.readAsText(k),B.onload=()=>{try{const D=JSON.parse(B.result);t.saveSources(D)}catch{w({message:"上传的源格式错误",type:"error"})}}}),d.click()},x=()=>{const d=document.createElement("a");let _=o.value.length===0?S.value:o.value,k=r.value?"BookSource":"RssSource";d.download=`${k}_${Date().replace(/.*?\s(\d+)\s(\d+)\s(\d+:\d+:\d+).*/,"$2$1$3").replace(/:/g,"")}.json`;let B=new Blob([JSON.stringify(_,null,4)],{type:"application/json"});d.href=window.URL.createObjectURL(B),d.click()};return(d,_)=>{const k=X,B=he,D=Te;return l(),U(L,null,[p(k,{modelValue:i(s),"onUpdate:modelValue":_[0]||(_[0]=V=>A(s)?s.value=V:null),class:"search","prefix-icon":i(pe),placeholder:"筛选源"},null,8,["modelValue","prefix-icon"]),g("div",kt,[p(B,{onClick:y,icon:i(Ve)},{default:c(()=>[m(" 打开 ")]),_:1},8,["icon"]),p(B,{disabled:i(S).length===0,onClick:x,icon:i(Ie)},{default:c(()=>[m(" 导出")]),_:1},8,["disabled","icon"]),p(B,{icon:i(se),onClick:a,disabled:i(o).length===0},{default:c(()=>[m("删除")]),_:1},8,["icon","disabled"]),p(B,{type:"danger",icon:i(se),onClick:C,disabled:i(n).length===0},{default:c(()=>[m("清空")]),_:1},8,["icon","disabled"])]),p(D,{id:"source-list",modelValue:i(o),"onUpdate:modelValue":_[1]||(_[1]=V=>A(o)?o.value=V:null)},{default:c(()=>[p(i(Ne),{style:{height:"100%","overflow-y":"auto","overflow-x":"hidden"},"data-key":V=>V.bookSourceUrl||V.sourceUrl,"data-sources":i(S),"data-component":bt,"estimate-size":45},null,8,["data-key","data-sources"])]),_:1},8,["modelValue"])],64)}}},Ct=O(vt,[["__scopeId","data-v-3d581419"]]),wt=1e3,E=$e.create({baseURL:location.origin,timeout:120*wt}),{hostname:fe,port:be}=new URL(location.href),xt=/source/i.test(location.href),Bt=e=>{throw xt&&w({message:"后端错误,检查网络或者阅读app",type:"error"}),e};E.interceptors.response.use(e=>e,Bt);const Ut=()=>E.get("/getReadConfig"),Et=e=>E.post("/saveReadConfig",e),Vt=e=>E.post("/saveBookProgress",e),It=()=>E.get("/getBookshelf"),Nt=e=>E.get("/getChapterList?url="+encodeURIComponent(e)),Tt=(e,t)=>E.get("/getBookContent?url="+encodeURIComponent(e)+"&index="+t),$t=(e,t,o)=>{const s=`ws://${fe}:${Number(be)+1}/searchBook`,n=new WebSocket(s);n.onopen=()=>{n.send(`{"key":"${e}"}`)},n.onmessage=({data:r})=>t(r),n.onclose=()=>{o()}},Lt=e=>E.post("/saveBook",e),Rt=e=>E.post("/deleteBook",e),W=/bookSource/i.test(location.href),Ot=()=>W?E.get("getBookSources"):E.get("getRssSources"),Pt=e=>W?E.post("saveBookSource",e):E.post("saveRssSource",e),Dt=e=>W?E.post("saveBookSources",e):E.post("saveRssSources",e),Jt=e=>W?E.post("deleteBookSources",e):E.post("deleteRssSources",e),At=(e,t,o,s)=>{const n=`ws://${fe}:${Number(be)+1}/${W?"bookSource":"rssSource"}Debug`,r=new WebSocket(n);r.onopen=()=>{r.send(JSON.stringify({tag:e,key:t}))},r.onmessage=({data:a})=>o(a),r.onclose=()=>{w({message:"调试已关闭!",type:"info"}),s()}},H={getReadConfig:Ut,saveReadConfig:Et,saveBookProcess:Vt,getBookShelf:It,getChapterList:Nt,getBookContent:Tt,search:$t,saveBook:Lt,deleteBook:Rt,getSources:Ot,saveSources:Dt,saveSource:Pt,deleteSource:Jt,debug:At};const Kt={__name:"SourceDebug",setup(e){const t=K(),o=R(""),s=R("");_e(()=>{t.isDebuging&&r()});const n=C=>{let S=document.querySelector("#debug-text");S.scrollTop=S.scrollHeight,o.value+=C+`
`},r=async()=>{o.value="",await H.saveSource(t.currentSource),H.debug(t.currentSourceUrl,s.value||t.searchKey,n,t.debugFinish)},a=te(()=>/bookSource/.test(window.location.href));return(C,S)=>{const y=X;return l(),U(L,null,[i(a)?(l(),b(y,{key:0,id:"debug-key",modelValue:i(s),"onUpdate:modelValue":S[0]||(S[0]=x=>A(s)?s.value=x:null),placeholder:"搜索书名、作者","prefix-icon":i(pe),style:{"padding-bottom":"4px"},onKeydown:Le(r,["enter"])},null,8,["modelValue","prefix-icon","onKeydown"])):N("",!0),p(y,{id:"debug-text",modelValue:i(o),"onUpdate:modelValue":S[1]||(S[1]=x=>A(o)?o.value=x:null),type:"textarea",readonly:"",rows:"29",placeholder:"这里用于输出调试信息"},null,8,["modelValue"])],64)}}},jt=O(Kt,[["__scopeId","data-v-fe904689"]]),ho=ue("book",{state:()=>({connectStatus:"正在连接后端服务器……",connectType:"",newConnect:!0,searchBooks:[],shelf:[],catalog:[],readingBook:{index:0,chapterPos:0},popCataVisible:!1,contentLoading:!0,showContent:!1,config:{theme:0,font:0,fontSize:18,readWidth:800,infiniteLoading:!1,customFontName:""},miniInterface:!1,readSettingsVisible:!1}),actions:{setConnectStatus(e){this.connectStatus=e},setConnectType(e){this.connectType=e},setNewConnect(e){this.newConnect=e},addBooks(e){this.shelf=e},setCatalog(e){this.catalog=e},setPopCataVisible(e){this.popCataVisible=e},setContentLoading(e){this.contentLoading=e},setReadingBook(e){this.readingBook=e},setConfig(e){this.config=e},setReadSettingsVisible(e){this.readSettingsVisible=e},setShowContent(e){this.showContent=e},setMiniInterface(e){this.miniInterface=e},async setSearchBooks(e){e.forEach(t=>{this.shelf.find(s=>s.bookUrl==t.bookUrl)===void 0&&this.searchBooks.push(t)})},clearSearchBooks(){this.searchBooks=[]},async saveBookProcess(){var r;if(this.catalog.length==0)return;const{index:e,chapterPos:t,bookName:o,bookAuthor:s}=this.readingBook;let n=(r=this.catalog[e])==null?void 0:r.title;n&&H.saveBookProcess({name:o,author:s,durChapterIndex:e,durChapterPos:t,durChapterTime:new Date().getTime(),durChapterTitle:n})}}}),Ht=Re();const Ft={__name:"SourceJson",setup(e){const t=K(),o=R(""),s=async n=>{try{t.changeEditTabSource(JSON.parse(n))}catch{w({message:"粘贴的源格式错误",type:"error"})}};return _e(async()=>{let n=t.editTabSource;Object.keys(n).length>0?o.value=JSON.stringify(n,null,4):o.value=""}),(n,r)=>{const a=X;return l(),b(a,{id:"source-json",modelValue:i(o),"onUpdate:modelValue":r[0]||(r[0]=C=>A(o)?o.value=C:null),type:"textarea",placeholder:"这里输出序列化的JSON数据,可直接导入'阅读'APP",rows:"30",onChange:s,style:{"margin-bottom":"4px"}},null,8,["modelValue"])}}},qt=O(Ft,[["__scopeId","data-v-7e91a802"]]);const zt={__name:"SourceTabTools",setup(e){const t=K(),{currentTab:o}=Q(t),s=R([["editTab","编辑源"],["editDebug","调试源"],["editList","源列表"],["editHelp","帮助信息"]]);return(n,r)=>{const a=qt,C=jt,S=Ct,y=_t,x=ge,d=me;return l(),b(d,{modelValue:i(o),"onUpdate:modelValue":r[0]||(r[0]=_=>A(o)?o.value=_:null)},{default:c(()=>[(l(!0),U(L,null,J(i(s),(_,k)=>(l(),b(x,{key:_[0],name:_[0],label:_[1]},{default:c(()=>[k==0?(l(),b(a,{key:0})):N("",!0),k==1?(l(),b(C,{key:1})):N("",!0),k==2?(l(),b(S,{key:2})):N("",!0),k==3?(l(),b(y,{key:3})):N("",!0)]),_:2},1032,["name","label"]))),128))]),_:1},8,["modelValue"])}}},Mt=O(zt,[["__scopeId","data-v-dcce2457"]]);const Wt={class:"menu flex-column-center"},Gt={class:"hotkeys-header flex-space-between"},Qt=["id"],Xt={key:0},Yt={class:"hotkeys-settings flex-column-center"},Zt={class:"title"},eo={class:"hotkeys-item__content"},to={key:0},oo={key:0},no={__name:"ToolBar",setup(e){const t=K(),o=()=>{const h=w({message:"加载中……",showClose:!0,duration:0});H.getSources().then(({data:u})=>{u.isSuccess?(t.changeTabName("editList"),t.saveSources(u.data),w({message:`成功拉取${u.data.length}条源`,type:"success"})):w({message:u.errorMsg??"后端错误",type:"error"})}).finally(()=>h.close())},s=()=>{let h=t.sources;if(t.changeTabName("editList"),h.length===0)return w({message:"空空如也",type:"info"});w({message:"正在推送中",type:"info"}),H.saveSources(h).then(({data:u})=>{if(u.isSuccess){let v=u.data;if(Array.isArray(v)){let f="";h.length>v.length&&(f=`
推送失败的源将用红色字体标注!`,t.setPushReturnSources(v)),w({message:`批量推送源到「阅读3.0APP」
共计: ${h.length}
成功: ${v.length}
失败: ${h.length-v.length}${f}`,type:"success"})}}else w({message:`批量推送源失败!
ErrorMsg: ${u.errorMsg}`,type:"error"})})},n=()=>{t.changeTabName("editTab"),t.changeEditTabSource(t.currentSource)},r=()=>{t.changeCurrentSource(t.editTabSource)},a=()=>{t.editHistoryUndo()},C=()=>{t.clearEdit(),w({message:"已清除",type:"success"})},S=()=>{t.clearEdit(),t.clearAllHistory(),w({message:"已清除所有历史记录",type:"success"})},y=()=>{let h=/bookSource/.test(location.href),u=t.currentSource;gt(u)?H.saveSource(u).then(({data:v})=>{v.isSuccess?(w({message:`源《${h?u.bookSourceName:u.sourceName}》已成功保存到「阅读3.0APP」`,type:"success"}),t.saveCurrentSource()):w({message:`源《${h?u.bookSourceName:u.sourceName}》保存失败!
ErrorMsg: ${v.errorMsg}`,type:"error"})}):w({message:"请检查<必填>项是否全部填写",type:"error"})},x=()=>{t.startDebug()},d=R(Array.of({name:"⇈推送源",hotKeys:[],action:s},{name:"⇊拉取源",hotKeys:[],action:o},{name:"⋙生成源",hotKeys:[],action:n},{name:"⋘编辑源",hotKeys:[],action:r},{name:"✗清空表单",hotKeys:[],action:C},{name:"↶撤销操作",hotKeys:[],action:a},{name:"↷重做操作",hotKeys:[],action:S},{name:"⇏调试源",hotKeys:[],action:x},{name:"✓保存源",hotKeys:[],action:y})),_=R(!0),k=R(!1),B=R(-1),D=()=>{k.value=!1};Oe(_,h=>{if(!h)return z.unbind("*");z.unbind(),z("*",u=>{u.preventDefault(),k.value&&B.value>-1&&(d.value[B.value].hotKeys=z.getPressedKeyString())})});const V=h=>{k.value=!0,w({message:"按ESC键或者点击空白处结束录入",type:"info"}),d.value[h].hotKeys=[],B.value=h},F=()=>{_.value=!1;const h=[];d.value.forEach(({hotKeys:u,action:v})=>{z(u.join("+"),f=>{f.preventDefault(),v.call(null)}),h.push(u)}),j(h)},j=h=>{localStorage.setItem("legado_web_hotkeys",JSON.stringify(h))},$=()=>{try{const h=JSON.parse(localStorage.getItem("legado_web_hotkeys"));if(!Array.isArray(h)||h.length==0)return;d.value.forEach((u,v)=>u.hotKeys=h[v]),_.value=!1,F()}catch{w({message:"快捷键配置错误",type:"error"}),localStorage.removeItem("legado_web_hotkeys")}};return Pe(()=>{$()}),(h,u)=>{const v=he,f=ae,Y=Ae;return l(),U(L,null,[g("div",Wt,[(l(!0),U(L,null,J(i(d),I=>(l(),b(v,{size:"large",key:I.name,onClick:I.action},{default:c(()=>[m(G(I.name),1)]),_:2},1032,["onClick"]))),128)),p(v,{size:"large",onClick:u[0]||(u[0]=()=>_.value=!0)},{default:c(()=>[m("快捷键")]),_:1})]),p(Y,{modelValue:i(_),"onUpdate:modelValue":u[1]||(u[1]=I=>A(_)?_.value=I:null),"show-close":!1,"before-close":D},{header:c(({titleClass:I,titleId:Z})=>[g("div",Gt,[g("div",{id:Z,class:de(I)},[m(" 快捷键设置 "),i(k)?(l(),U("span",Xt,[p(f,null,{default:c(()=>[m(" / 录入中 ")]),_:1})])):N("",!0)],10,Qt),p(v,{disabled:i(k),onClick:F,icon:i(De)},{default:c(()=>[m("保存")]),_:1},8,["disabled","icon"])])]),default:c(()=>[g("div",Yt,[(l(!0),U(L,null,J(i(d),(I,Z)=>(l(),U("div",{key:I.name,class:"hotkeys-item flex-space-between"},[g("span",Zt,[p(f,null,{default:c(()=>[m(G(I.name),1)]),_:2},1024)]),g("div",eo,[(l(!0),U(L,null,J(I.hotKeys,(ee,Ce)=>(l(),U("div",{key:ee},[g("kbd",null,G(ee),1),Ce+1<I.hotKeys.length?(l(),U("span",to,[p(f,null,{default:c(()=>[m("+")]),_:1})])):N("",!0)]))),128)),I.hotKeys.length==0?(l(),U("span",oo,"未设置")):N("",!0)]),p(v,{disabled:i(k),text:"",icon:i(Je),onClick:ee=>V(Z)},{default:c(()=>[m("编辑")]),_:2},1032,["disabled","icon","onClick"])]))),128))])]),_:1},8,["modelValue"])],64)}}},ro=O(no,[["__scopeId","data-v-dc7cd0f9"]]);const so={__name:"SourceTabForm",props:["config"],setup(e){const t=K(),{currentSource:o}=Q(t);return(s,n)=>{const r=X,a=Ke,C=je,S=He,y=Fe,x=qe,d=ze,_=ge,k=me;return l(),b(k,{id:"source-edit"},{default:c(()=>[(l(!0),U(L,null,J(Object.values(e.config),({name:B,children:D})=>(l(),b(_,{label:B,key:B},{default:c(()=>[p(d,{"label-position":"right","label-width":"5em"},{default:c(()=>[(l(!0),U(L,null,J(D,({type:V,title:F,namespace:j,id:$,array:h,hint:u,required:v})=>(l(),b(x,{label:F,key:F,required:v},{default:c(()=>[V=="String"&&typeof j>"u"?(l(),b(r,{key:0,type:"textarea",modelValue:i(o)[$],"onUpdate:modelValue":f=>i(o)[$]=f,placeholder:u,autosize:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):N("",!0),V=="String"&&typeof j<"u"?(l(),b(r,{key:1,type:"textarea",modelValue:i(o)[j][$],"onUpdate:modelValue":f=>i(o)[j][$]=f,placeholder:u,autosize:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):N("",!0),V=="Boolean"?(l(),b(a,{key:2,modelValue:i(o)[$],"onUpdate:modelValue":f=>i(o)[$]=f},null,8,["modelValue","onUpdate:modelValue"])):N("",!0),V=="Number"?(l(),b(C,{key:3,modelValue:i(o)[$],"onUpdate:modelValue":f=>i(o)[$]=f,min:0},null,8,["modelValue","onUpdate:modelValue"])):N("",!0),V=="Array"?(l(),b(y,{key:4,modelValue:i(o)[$],"onUpdate:modelValue":f=>i(o)[$]=f},{default:c(()=>[(l(!0),U(L,null,J(h,(f,Y)=>(l(),b(S,{value:Y,key:f,label:f},null,8,["value","label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])):N("",!0)]),_:2},1032,["label","required"]))),128))]),_:2},1024)]),_:2},1032,["label"]))),128))]),_:1})}}},io=O(so,[["__scopeId","data-v-2cfb5302"]]),lo={base:{name:"基础",children:[{title:"源类型",id:"bookSourceType",type:"Array",array:["文本","音频","图片","文件"],required:!0},{title:"源域名",id:"bookSourceUrl",type:"String",hint:"通常填写网站主页,例: https://www.qidian.com",required:!0},{title:"源名称",id:"bookSourceName",type:"String",hint:"会显示在源列表",required:!0},{title:"源分组",id:"bookSourceGroup",type:"String",hint:"描述源的特征信息"},{title:"源注释",id:"bookSourceComment",type:"String",hint:"描述源作者和状态"},{title:"书源变量",id:"variableComment",type:"String",hint:"书源变量说明"},{title:"登录地址",id:"loginUrl",type:"String",hint:"填写网站登录网址,仅在需要登录的源有用"},{title:"登录界面",id:"loginUi",type:"String",hint:"自定义登录界面"},{title:"登录检测",id:"loginCheckJs",type:"String",hint:"登录检测js"},{title:"封面解密",id:"coverDecodeJs",type:"String",hint:"封面解密js"},{title:"并发率",id:"concurrentRate",type:"String",hint:"并发率"},{title:"js库",id:"jsLib",type:"String",hint:"js库"},{title:"请求头",id:"header",type:"String",hint:"客户端标识"},{title:"链接验证",id:"bookUrlPattern",type:"String",hint:"当详情页URL与源URL的域名不一致时有效,用于添加网址"}]},search:{name:"搜索",children:[{title:"搜索地址",id:"searchUrl",type:"String",hint:"[域名可省略]/search.php@kw={{key}}"},{title:"校验文字",namespace:"ruleSearch",id:"checkKeyWord",type:"String",hint:"校验关键字"},{title:"列表规则",namespace:"ruleSearch",id:"bookList",type:"String",hint:"选择书籍节点 (规则结果为List<Element>)"},{title:"书名规则",namespace:"ruleSearch",id:"name",type:"String",hint:"选择节点书名 (规则结果为String)"},{title:"作者规则",namespace:"ruleSearch",id:"author",type:"String",hint:"选择节点作者 (规则结果为String)"},{title:"分类规则",namespace:"ruleSearch",id:"kind",type:"String",hint:"选择节点分类信息 (规则结果为String)"},{title:"字数规则",namespace:"ruleSearch",id:"wordCount",type:"String",hint:"选择节点字数信息 (规则结果为String)"},{title:"最新章节",namespace:"ruleSearch",id:"lastChapter",type:"String",hint:"选择节点最新章节 (规则结果为String)"},{title:"简介规则",namespace:"ruleSearch",id:"intro",type:"String",hint:"选择节点书籍简介 (规则结果为String)"},{title:"封面规则",namespace:"ruleSearch",id:"coverUrl",type:"String",hint:"选择节点书籍封面 (规则结果为String类型的url)"},{title:"详情地址",namespace:"ruleSearch",id:"bookUrl",type:"String",hint:"选择书籍详情页网址 (规则结果为String类型的url)"}]},find:{name:"发现",children:[{title:"发现地址",id:"exploreUrl",type:"String",hint:`内容能显示在发现菜单
每行一条发现分类(网址域名可省略),例:
名称1::网址(Url)1
名称2::网址(Url)2
...`},{title:"发现筛选",id:"exploreScreen",type:"String",hint:"发现筛选规则"},{title:"列表规则",namespace:"ruleExplore",id:"bookList",type:"String",hint:"选择书籍节点 (规则结果为List<Element>)"},{title:"书名规则",namespace:"ruleExplore",id:"name",type:"String",hint:"选择节点书名 (规则结果为String)"},{title:"作者规则",namespace:"ruleExplore",id:"author",type:"String",hint:"选择节点作者 (规则结果为String)"},{title:"分类规则",namespace:"ruleExplore",id:"kind",type:"String",hint:"选择节点分类信息 (规则结果为String)"},{title:"字数规则",namespace:"ruleExplore",id:"wordCount",type:"String",hint:"选择节点字数信息 (规则结果为String)"},{title:"最新章节",namespace:"ruleExplore",id:"lastChapter",type:"String",hint:"选择节点最新章节 (规则结果为String)"},{title:"简介规则",namespace:"ruleExplore",id:"intro",type:"String",hint:"选择节点书籍简介 (规则结果为String)"},{title:"封面规则",namespace:"ruleExplore",id:"coverUrl",type:"String",hint:"选择节点书籍封面 (规则结果为String类型的url)"},{title:"详情地址",namespace:"ruleExplore",id:"bookUrl",type:"String",hint:"选择书籍详情页网址 (规则结果为String类型的url)"}]},detail:{name:"详情",children:[{title:"预处理",namespace:"ruleBookInfo",id:"init",type:"String",hint:"用于加速详情信息检索,只支持AllInOne规则"},{title:"书名规则",namespace:"ruleBookInfo",id:"name",type:"String",hint:"选择节点书名 (规则结果为String)"},{title:"作者规则",namespace:"ruleBookInfo",id:"author",type:"String",hint:"选择节点作者 (规则结果为String)"},{title:"分类规则",namespace:"ruleBookInfo",id:"kind",type:"String",hint:"选择节点分类信息 (规则结果为String)"},{title:"字数规则",namespace:"ruleBookInfo",id:"wordCount",type:"String",hint:"选择节点字数信息 (规则结果为String)"},{title:"最新章节",namespace:"ruleBookInfo",id:"lastChapter",type:"String",hint:"选择节点最新章节 (规则结果为String)"},{title:"简介规则",namespace:"ruleBookInfo",id:"intro",type:"String",hint:"选择节点书籍简介 (规则结果为String)"},{title:"封面规则",namespace:"ruleBookInfo",id:"coverUrl",type:"String",hint:"选择节点书籍封面 (规则结果为String类型的url)"},{title:"目录地址",namespace:"ruleBookInfo",id:"tocUrl",type:"String",hint:"选择书籍详情页网址 (规则结果为String类型的url, 与详情页相同时可省略)"},{title:"下载URL",namespace:"ruleBookInfo",id:"downloadUrls",type:"String",hint:"文件类书源下载地址 (规则结果为String类型的url, 多个链接返回数组)"},{title:"修改书籍",namespace:"ruleBookInfo",id:"canReName",type:"String",hint:"允许修改书名作者(规则结果为String类型, 默认不允许)"}]},directory:{name:"目录",children:[{title:"预处理",namespace:"ruleToc",id:"preUpdateJs",type:"String",hint:"更新目录前调用JS 动态更新目录链接"},{title:"列表规则",namespace:"ruleToc",id:"chapterList",type:"String",hint:"选择目录列表的章节节点 (规则结果为List<Element>)"},{title:"章节名称",namespace:"ruleToc",id:"chapterName",type:"String",hint:"选择章节名称 (规则结果为String)"},{title:"章节地址",namespace:"ruleToc",id:"chapterUrl",type:"String",hint:"选择章节链接 (规则结果为String类型的Url)"},{title:"卷名标识",namespace:"ruleToc",id:"isVolume",type:"String",hint:"章节名称是否是卷名 (规则结果为Bool)"},{title:"收费标识",namespace:"ruleToc",id:"isVip",type:"String",hint:"章节是否为VIP章节 (规则结果为Bool)"},{title:"购买标识",namespace:"ruleToc",id:"isPay",type:"String",hint:"章节是否为已购买 (规则结果为Bool)"},{title:"章节信息",namespace:"ruleToc",id:"updateTime",type:"String",hint:"选择章节信息 (规则结果为String)"},{title:"翻页规则",namespace:"ruleToc",id:"nextTocUrl",type:"String",hint:"选择目录下一页链接 (规则结果为List<String>或String)"}]},content:{name:"正文",children:[{title:"脚本注入",namespace:"ruleContent",id:"webJs",type:"String",hint:"注入javascript,用于模拟鼠标点击等,必须有返回值,一般为String类型"},{title:"正文规则",namespace:"ruleContent",id:"content",type:"String",hint:"选择正文内容 (规则结果为String)"},{title:"翻页规则",namespace:"ruleContent",id:"nextContentUrl",type:"String",hint:"选择下一分页(不是下一章)链接 (规则结果为String类型的Url)"},{title:"资源正则",namespace:"ruleContent",id:"sourceRegex",type:"String",hint:"匹配资源的url特征,用于嗅探"},{title:"替换规则",namespace:"ruleContent",id:"replaceRegex",type:"String",hint:"多页内容合并后替换,用于正文净化"},{title:"图片样式",namespace:"ruleContent",id:"imageStyle",type:"String",hint:"FULL:铺满 不填:默认样式"},{title:"购买操作",namespace:"ruleContent",id:"payAction",type:"String",hint:"填写JavaScript 返回购买链接或者调用购买接口"},{title:"图片解密",namespace:"ruleContent",id:"imageDecode",type:"String",hint:"填写JavaScript 返回解密图片的bytes "}]},other:{name:"其他",children:[{title:"启用搜索",id:"enabled",type:"Boolean"},{title:"启用发现",id:"enabledExplore",type:"Boolean"},{title:"Cookie",id:"enabledCookieJar",type:"Boolean"},{title:"搜索权重",id:"weight",type:"Number"},{title:"排序编号",id:"customOrder",type:"Number"}]}},co={base:{name:"基础",children:[{title:"源域名",id:"sourceUrl",type:"String",hint:"通常填写网站主页,例: https://www.qidian.com",required:!0},{title:"图标",id:"sourceIcon",type:"String",hint:"填写图片网络链接"},{title:"源名称",id:"sourceName",type:"String",hint:"会显示在源列表",required:!0},{title:"源分组",id:"sourceGroup",type:"String",hint:"描述源的特征信息"},{title:"源注释",id:"sourceComment",type:"String",hint:"描述源作者和状态"},{title:"分类地址",id:"sortUrl",type:"String",hint:`名称1::链接1
名称2::链接2`},{title:"登录地址",id:"loginUrl",type:"String",hint:"填写网站登录网址,仅在需要登录的源有用"},{title:"登录界面",id:"loginUi",type:"String",hint:"自定义登录界面"},{title:"登录检测",id:"loginCheckJs",type:"String",hint:"登录检测js"},{title:"封面解密",id:"coverDecodeJs",type:"String",hint:"封面解密js"},{title:"请求头",id:"header",type:"String",hint:"客户端标识"},{title:"变量说明",id:"variableComment",type:"String",hint:"源变量说明"},{title:"并发率",id:"concurrentRate",type:"String",hint:"并发率"}]},list:{name:"列表",children:[{title:"列表规则",id:"ruleArticles",type:"String",hint:"规则结果为List<Element>"},{title:"翻页规则",id:"ruleNextPage",type:"String",hint:"下一页链接 规则结果为List<String>或String"},{title:"标题规则",id:"ruleTitle",type:"String",hint:"文章标题 规则结果为String"},{title:"时间规则",id:"rulePubDate",type:"String",hint:"文章发布时间 规则结果为String"},{title:"描述规则",id:"ruleDescription",type:"String",hint:"文章简要描述 规则结果为String"},{title:"图片规则",id:"ruleImage",type:"String",hint:"文章图片链接 规则结果为String"},{title:"链接规则",id:"ruleLink",type:"String",hint:"文章链接 规则结果为String"}]},webView:{name:"WebView",children:[{title:"内容规则",id:"ruleContent",type:"String",hint:"文章正文"},{title:"样式规则",id:"style",type:"String",hint:"文章正文样式 填写css"},{title:"注入规则",id:"injectJs",type:"String",hint:"注入网页的JavaScript"},{title:"黑名单",id:"contentBlacklist",type:"String",hint:"webView链接加载黑名单,英文逗号隔开"},{title:"白名单",id:"contentWhitelist",type:"String",hint:"webView链接加载白名单,英文逗号隔开"}]},other:{name:"其他",children:[{title:"列表样式",id:"articleStyle",type:"Array",array:["默认","大图","双列"]},{title:"加载地址",id:"loadWithBaseUrl",type:"Boolean"},{title:"启用JS",id:"enableJs",type:"Boolean"},{title:"启用",id:"enabled",type:"Boolean"},{title:"Cookie",id:"enabledCookieJar",type:"Boolean"},{title:"单URL",id:"singleUrl",type:"Boolean"},{title:"排序编号",id:"customOrder",type:"Number"}]}};const ao={class:"editor"},uo={__name:"SourceEditor",setup(e){const t=R({});return/bookSource/i.test(location.href)?(t.value=lo,document.title="书源管理"):(t.value=co,document.title="订阅源管理"),(o,s)=>{const n=io,r=ro,a=Mt;return l(),U("div",ao,[p(n,{class:"left",config:i(t)},null,8,["config"]),p(r),p(a,{class:"right"})])}}},ce=O(uo,[["__scopeId","data-v-e99e7704"]]),ke=[{path:"/bookSource",name:"book-home",component:ce},{path:"/rssSource",name:"rss-home",component:ce}];ne({history:re(),routes:ke});const ve=ne({history:re(),routes:Se.concat(ke)});ve.afterEach(e=>{e.name=="shelf"&&(document.title="书架")});Me(Ye).use(Ht).use(ve).mount("#app");oe(()=>import("./config-97894739.js"),["./config-97894739.js","./vendor-8be1f5fb.js","./vendor-6f0d1692.css","./config-811f2a0b.css"],import.meta.url);export{H as A,O as _,ho as u};