Greasy Fork

10漫画下载

漫画分章节压缩下载。适用于 酷漫屋、百漫谷、武侠漫画、动漫之家、七夕漫画、36漫画网、古风漫画网、腾讯漫画、漫画星球、好漫8、漫画屋、27漫画网

目前为 2022-07-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         10漫画下载
// @namespace    http://tampermonkey2.net/
// @version      1.1.0
// @description  漫画分章节压缩下载。适用于 酷漫屋、百漫谷、武侠漫画、动漫之家、七夕漫画、36漫画网、古风漫画网、腾讯漫画、漫画星球、好漫8、漫画屋、27漫画网
// @author       journey3510
// @run-at       document-end
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_setClipboard
// @grant        GM_info
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        GM_getResourceText
// @grant        GM.getValue
// @grant        GM.setValue
// @grant        GM.setClipboard
// @grant        GM.info
// @grant        GM.xmlHttpRequest
// @resource   vantcss   https://unpkg.com/[email protected]/lib/index.css
// @require      https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js
// @require      https://cdn.bootcdn.net/ajax/libs/jszip/3.7.1/jszip.min.js
// @require      https://unpkg.com/[email protected]/lib/vant.min.js
//
// @match        *://www.kumw5.com/*
// @connect      kumw5.com
//
// @match        *://darpou.com/*
// @connect      manga8.xyz
//
// @match        *://m.wuxiamh.com/*
// @match        *://www.wuxiamh.com/*
// @connect      169gouwu.com
//
// @match        *://manhua.dmzj.com/*
// @connect      dmzj.com
//
// @match        *://qiximh1.com/*
// @connect      byteimg.com
//
// @match        *://www.36manga.com/*
//
// @match        *://www.gufengmanhua.com/*
// @connect      gufengmanhua.com
// @match        *://www.123gf.com/*
// @connect      123gf.com
//
// @match        *://ac.qq.com/*
// @connect      acimg.cn
//
// @match        *://www.mhxqiu1.com/*
// @connect      byteimg.com
//
// @match        *://www.haoman8.com/*
// @connect      haoman8.com
//
// @match        *://www.mh5.org/*
// @connect      xiaomingtaiji.net
//
// @match        *://www.2mzx.com/*
// @connect      2mzx.com
// @connect      hnsrht.com
// @connect      huayingrenren.cn
//
// @connect      *
// @connect      arc-theday.com
// @connect      xiaoqinre.com
// @connect      laimidao.com
// @connect      izhegu.com
// @connect      nicefee.com
// @license      MIT
// ==/UserScript==


/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 14);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getWebList; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return currentComics; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return matchWeb; });
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* eslint-disable no-undef */
/* eslint-disable no-empty */
/* eslint-disable no-eval */



const comicsWebInfo = [
  {
    domain: 'manhua.dmzj.com',
    homepage: 'https://manhua.dmzj.com/',
    webName: '动漫之家',
    comicNameCss: '.odd_anim_title_m .anim_title_text h1',
    chapterCss: '.cartoon_online_border',
    type: 1,
    getImgs: async function(context) {
      const group = context.matchAll(/(function[\s\S]+?return \S})(\([\s\S]+?{}\))/g)
      const func = []
      for (const item of group) {
        func.push(item[1])
        func.push(item[2])
      }
      const code = '(' + func[0] + ')' + func[1]
      let imgStr = eval(code)
      imgStr = imgStr.match(/\[[\s\S]+?\]/)[0]
      let imgArray = JSON.parse(imgStr)
      if (imgArray[0].search('http') === -1) {
        imgArray = imgArray.map((item) => {
          return 'https://images.dmzj.com/' + item
        })
      }
      return imgArray
    }
  },
  {
    domain: 'www.kumw5.com',
    homepage: 'http://www.kumw5.com/',
    webName: '酷漫屋',
    comicNameCss: '.info h1',
    chapterCss: '#detail-list-select-1',
    type: 1,
    getImgs: function(context) {
      const reg = /var km[^>]*_img_url='[^>]*'/gi
      const s1 = context.match(reg)
      const base64Context = s1[0].match(/'(\S*)'/)[1]
      let imgstr = window.atob(base64Context)
      imgstr = eval(imgstr).toString()
      const imgArray = imgstr.matchAll(/(http[\s\S]+?),/g)
      const imgUrl = []
      for (const item of imgArray) {
        imgUrl.push(item[1])
      }
      return imgUrl
    }
  },
  {
    domain: 'darpou.com',
    homepage: 'https://darpou.com/',
    webName: '百漫谷',
    comicNameCss: '.fed-part-eone.fed-font-xvi a',
    chapterCss: '.fed-play-item.fed-drop-item.fed-visible .fed-part-rows:nth-child(2)',
    type: 1,
    getImgs: async function(context) {
      const txtUrl = context.match(/http(\S*).txt/gi)[0]
      const txtRes = await Object(_utils_index__WEBPACK_IMPORTED_MODULE_0__[/* request */ "c"])('get', txtUrl)
      const txtContext = txtRes.responseText
      const imgReg = /http(\S*)jpg/g
      return txtContext.match(imgReg)
    }
  },
  {
    domain: 'm.wuxiamh.com',
    homepage: 'https://m.wuxiamh.com/',
    webName: '武侠漫画(手机)',
    comicNameCss: '.view-sub.autoHeight .title',
    chapterCss: '#chapter-list-1',
    type: 0,
    nextpageRgeCss: '.action-list li:nth-child(3) a',
    getImgs: async function(context) {
      const imgobj = context.matchAll(/><mip-img src="(https:\/\/[\s\S]+?(jpg|webp))/g)
      const imgUrl = []
      for (const item of imgobj) {
        imgUrl.push(item[1])
      }

      const number = context.match(/<span id="k_total" class="curPage">(\d+)<\/span>/)[1]
      const context1 = context.match(/class="action-list">[\s\S]+?<mip-link href="(https:\/\/[\s\S]+?html)">下一页/g)[0]
      let nextPageUrl = context1.match(/http(\S*)html/g)[2]
      nextPageUrl = nextPageUrl.indexOf('-') !== -1 ? nextPageUrl : ''
      return { imgUrl, nextPageUrl, number }
    }
  },
  {
    domain: 'www.wuxiamh.com',
    homepage: 'https://www.wuxiamh.com/',
    webName: '武侠漫画网(电脑)',
    comicNameCss: '.title h1',
    chapterCss: '#chapter-list-1',
    type: 1,
    getImgs: async function(context) {
      const imgStr = context.match(/var chapterImages = ([[\s\S]+?])[\s\S]+?var chapterPath/)[1]
      const imgs = eval(imgStr)
      return imgs
    }

  },
  {
    domain: 'qiximh1.com',
    homepage: 'http://qiximh1.com',
    webName: '七夕漫画',
    comicNameCss: '.comic_name .name',
    chapterCss: '.catalog_list.row_catalog_list',
    type: 1,
    getImgs: function(context) {
      const group = context.matchAll(/(function[\s\S]+?return \S})(\([\s\S]+?{}\))/g)
      const func = []
      for (const item of group) {
        func.push(item[1])
        func.push(item[2])
      }
      const code = '(' + func[0] + ')' + func[1]
      let imgStr = eval(code)
      imgStr = imgStr.match(/\[[\s\S]+?\]/)[0]
      const imgArray = JSON.parse(imgStr)
      return imgArray
    }
  },
  {
    domain: 'www.36manga.com',
    homepage: 'https://www.36manga.com/',
    webName: '36漫画网',
    comicNameCss: '.book-title h1 span',
    chapterCss: '#chapter-list-4 li:not(:first-of-type)',
    type: 1,
    getImgs: function(context) {
      const group = context.matchAll(/chapterImages = ([\s\S]+?);var chapterPath = "([\s\S]+?)";var chapterPrice/g)
      let imgarr = []
      let middleStr = ''
      for (const item of group) {
        imgarr = JSON.parse(item[1])
        middleStr = item[2]
      }
      if (imgarr[0].search('http') === -1) {
        imgarr = imgarr.map((item) => {
          return 'https://img001.arc-theday.com/' + middleStr + item
        })
      }
      return imgarr
    }
  },
  {
    domain: 'www.gufengmanhua.com',
    homepage: 'https://www.gufengmanhua.com/',
    webName: '古风漫画网',
    comicNameCss: '.book-title h1 span',
    chapterCss: '#chapter-list-1,#chapter-list-10',
    type: 1,
    getImgs: function(context) {
      const imgStr = context.match(/chapterImages = ([\s\S]+?);var chapterPath/)[1]
      let imgarr = JSON.parse(imgStr)
      if (imgarr[0].search('http') === -1) {
        imgarr = imgarr.map((item) => {
          return 'https://res5.gufengmanhua.com' + item
        })
      }
      return imgarr
    }
  },
  {
    domain: 'www.123gf.com',
    homepage: 'https://www.123gf.com/',
    webName: '古风漫画网 2',
    comicNameCss: '.book-title h1 span',
    chapterCss: '#chapter-list-1,#chapter-list-10',
    type: 1,
    getImgs: async function(context) {
      const group = context.matchAll(/chapterImages = (.*?);var chapterPath = "(.*?)"/g)
      const strArr = []
      for (const item of group) {
        strArr.push(item[1])
        strArr.push(item[2])
      }
      const josnRes = await Object(_utils_index__WEBPACK_IMPORTED_MODULE_0__[/* request */ "c"])('get', this.homepage + 'js/config.js')
      const josnContext = josnRes.responseText
      const imageDomian = josnContext.match(/"domain":\["(.*?)"]/)[1]
      let imgarr = JSON.parse(strArr[0])
      if (imgarr[0].search('http') === -1) {
        imgarr = imgarr.map((item) => {
          return imageDomian + '/' + strArr[1] + item
        })
      }
      return imgarr
    }
  },
  {
    domain: 'ac.qq.com',
    homepage: 'https://ac.qq.com/',
    webName: '腾讯漫画',
    comicNameCss: '.works-intro-title.ui-left strong',
    chapterCss: '.chapter-page-all.works-chapter-list',
    type: 1,
    hasSpend: true,
    freeCss: '.ui-icon-free',
    payCss: '.ui-icon-pay',
    getImgs: function(context) {
      let nonce = context.match(/<script>\s*window.*?=(.*?)?;/)[1]
      nonce = eval(nonce)
      const dataStr = context.match(/DATA.*?'(.*)?'/)[1]
      const data = dataStr.split('')
      nonce = nonce.match(/\d+[a-zA-Z]+/g)
      let len = nonce.length
      let locate = null
      let str = ''
      while (len--) {
        locate = parseInt(nonce[len]) & 255
        str = nonce[len].replace(/\d+/g, '')
        data.splice(locate, str.length)
      }
      const chapterStr = data.join('')
      const chapterObj = JSON.parse(window.atob(chapterStr))
      const imgarr = []
      chapterObj.picture.forEach(element => {
        imgarr.push(element.url)
      })
      return imgarr
    }
  },
  {
    domain: 'www.mhxqiu1.com',
    homepage: 'http://www.mhxqiu1.com/',
    webName: '漫画星球',
    comicNameCss: '.cy_title h1',
    chapterCss: '.cy_plist #mh-chapter-list-ol-0',
    type: 1,
    getImgs: function(context) {
      const group = context.matchAll(/(function.*?return \S})(\(.*?{}\))/g)
      const func = []
      for (const item of group) {
        func.push(item[1])
        func.push(item[2])
      }
      const code = '(' + func[0] + ')' + func[1]
      let imgStr = eval(code)
      imgStr = imgStr.match(/\[[\s\S]+?\]/)[0]
      const imgArray = JSON.parse(imgStr)
      return imgArray
    }
  },
  {
    domain: 'www.haoman8.com',
    homepage: 'https://www.haoman8.com/',
    webName: '好漫8',
    comicNameCss: '.content .title',
    chapterCss: '#j_chapter_list',
    type: 1,
    getImgs: function(context) {
      const group = context.matchAll(/data-echo="(.*?)"/g)
      const imgArray = []
      for (const item of group) {
        imgArray.push(item[1])
      }
      return imgArray
    }
  },
  {
    domain: 'www.mh5.org',
    homepage: 'https://www.mh5.org/',
    webName: '漫画屋',
    comicNameCss: '.comic-title.j-comic-title',
    chapterCss: '.chapter__list-box.clearfix',
    type: 1,
    getImgs: function(context) {
      const group = context.matchAll(/data-original="(.*?)"/g)
      const imgArray = []
      for (const item of group) {
        imgArray.push(item[1])
      }
      return imgArray
    }
  },
  {
    domain: 'www.2mzx.com',
    homepage: 'https://www.2mzx.com/',
    webName: '27漫画网',
    comicNameCss: '.bar .position strong',
    chapterCss: '#play_0 #chapter-list-1',
    type: 1,
    getImgs: async function(context) {
      const imgStr = context.match(/var chapterImages = ([[\s\S]+?])[\s\S]+?var chapterPath/)[1]
      const imgs = eval(imgStr)
      return imgs
    }
  }
]

const getWebList = () => {
  const list = []
  comicsWebInfo.forEach(element => {
    list.push({
      name: element.webName,
      url: element.homepage
    })
  })
  return list
}

let currentComics = null

const matchWeb = (url) => {
  let hname = ''
  var domain = url.split('/')
  if (domain[2]) {
    hname = domain[2]
  } else {
    hname = ''
  }
  for (let i = 0; i < comicsWebInfo.length; i++) {
    if (comicsWebInfo[i].domain === hname) {
      currentComics = comicsWebInfo[i]
      break
    }
  }
}



/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var isOldIE = function isOldIE() {
  var memo;
  return function memorize() {
    if (typeof memo === 'undefined') {
      // Test for IE <= 9 as proposed by Browserhacks
      // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
      // Tests for existence of standard globals is to allow style-loader
      // to operate correctly into non-standard environments
      // @see https://github.com/webpack-contrib/style-loader/issues/177
      memo = Boolean(window && document && document.all && !window.atob);
    }

    return memo;
  };
}();

var getTarget = function getTarget() {
  var memo = {};
  return function memorize(target) {
    if (typeof memo[target] === 'undefined') {
      var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself

      if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
        try {
          // This will throw an exception if access to iframe is blocked
          // due to cross-origin restrictions
          styleTarget = styleTarget.contentDocument.head;
        } catch (e) {
          // istanbul ignore next
          styleTarget = null;
        }
      }

      memo[target] = styleTarget;
    }

    return memo[target];
  };
}();

var stylesInDom = [];

function getIndexByIdentifier(identifier) {
  var result = -1;

  for (var i = 0; i < stylesInDom.length; i++) {
    if (stylesInDom[i].identifier === identifier) {
      result = i;
      break;
    }
  }

  return result;
}

function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];

  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var index = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3]
    };

    if (index !== -1) {
      stylesInDom[index].references++;
      stylesInDom[index].updater(obj);
    } else {
      stylesInDom.push({
        identifier: identifier,
        updater: addStyle(obj, options),
        references: 1
      });
    }

    identifiers.push(identifier);
  }

  return identifiers;
}

function insertStyleElement(options) {
  var style = document.createElement('style');
  var attributes = options.attributes || {};

  if (typeof attributes.nonce === 'undefined') {
    var nonce =  true ? __webpack_require__.nc : undefined;

    if (nonce) {
      attributes.nonce = nonce;
    }
  }

  Object.keys(attributes).forEach(function (key) {
    style.setAttribute(key, attributes[key]);
  });

  if (typeof options.insert === 'function') {
    options.insert(style);
  } else {
    var target = getTarget(options.insert || 'head');

    if (!target) {
      throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
    }

    target.appendChild(style);
  }

  return style;
}

function removeStyleElement(style) {
  // istanbul ignore if
  if (style.parentNode === null) {
    return false;
  }

  style.parentNode.removeChild(style);
}
/* istanbul ignore next  */


var replaceText = function replaceText() {
  var textStore = [];
  return function replace(index, replacement) {
    textStore[index] = replacement;
    return textStore.filter(Boolean).join('\n');
  };
}();

function applyToSingletonTag(style, index, remove, obj) {
  var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE

  /* istanbul ignore if  */

  if (style.styleSheet) {
    style.styleSheet.cssText = replaceText(index, css);
  } else {
    var cssNode = document.createTextNode(css);
    var childNodes = style.childNodes;

    if (childNodes[index]) {
      style.removeChild(childNodes[index]);
    }

    if (childNodes.length) {
      style.insertBefore(cssNode, childNodes[index]);
    } else {
      style.appendChild(cssNode);
    }
  }
}

function applyToTag(style, options, obj) {
  var css = obj.css;
  var media = obj.media;
  var sourceMap = obj.sourceMap;

  if (media) {
    style.setAttribute('media', media);
  } else {
    style.removeAttribute('media');
  }

  if (sourceMap && typeof btoa !== 'undefined') {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  } // For old IE

  /* istanbul ignore if  */


  if (style.styleSheet) {
    style.styleSheet.cssText = css;
  } else {
    while (style.firstChild) {
      style.removeChild(style.firstChild);
    }

    style.appendChild(document.createTextNode(css));
  }
}

var singleton = null;
var singletonCounter = 0;

function addStyle(obj, options) {
  var style;
  var update;
  var remove;

  if (options.singleton) {
    var styleIndex = singletonCounter++;
    style = singleton || (singleton = insertStyleElement(options));
    update = applyToSingletonTag.bind(null, style, styleIndex, false);
    remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  } else {
    style = insertStyleElement(options);
    update = applyToTag.bind(null, style, options);

    remove = function remove() {
      removeStyleElement(style);
    };
  }

  update(obj);
  return function updateStyle(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
        return;
      }

      update(obj = newObj);
    } else {
      remove();
    }
  };
}

module.exports = function (list, options) {
  options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  // tags it will allow on a page

  if (!options.singleton && typeof options.singleton !== 'boolean') {
    options.singleton = isOldIE();
  }

  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];

    if (Object.prototype.toString.call(newList) !== '[object Array]') {
      return;
    }

    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDom[index].references--;
    }

    var newLastIdentifiers = modulesToDom(newList, options);

    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];

      var _index = getIndexByIdentifier(_identifier);

      if (stylesInDom[_index].references === 0) {
        stylesInDom[_index].updater();

        stylesInDom.splice(_index, 1);
      }
    }

    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
// eslint-disable-next-line func-names
module.exports = function (cssWithMappingToString) {
  var list = []; // return the list of modules as css string

  list.toString = function toString() {
    return this.map(function (item) {
      var content = cssWithMappingToString(item);

      if (item[2]) {
        return "@media ".concat(item[2], " {").concat(content, "}");
      }

      return content;
    }).join("");
  }; // import a list of modules into the list
  // eslint-disable-next-line func-names


  list.i = function (modules, mediaQuery, dedupe) {
    if (typeof modules === "string") {
      // eslint-disable-next-line no-param-reassign
      modules = [[null, modules, ""]];
    }

    var alreadyImportedModules = {};

    if (dedupe) {
      for (var i = 0; i < this.length; i++) {
        // eslint-disable-next-line prefer-destructuring
        var id = this[i][0];

        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }

    for (var _i = 0; _i < modules.length; _i++) {
      var item = [].concat(modules[_i]);

      if (dedupe && alreadyImportedModules[item[0]]) {
        // eslint-disable-next-line no-continue
        continue;
      }

      if (mediaQuery) {
        if (!item[2]) {
          item[2] = mediaQuery;
        } else {
          item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
        }
      }

      list.push(item);
    }
  };

  return list;
};

/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return loadStyle; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getHtml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return request; });
/* harmony import */ var _utils_comics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);


const loadStyle = (url) => {
  const head = document.getElementsByTagName('head')[0]
  const link = document.createElement('link')
  link.rel = 'stylesheet'
  link.type = 'text/css'
  link.href = url
  link.media = 'all'
  head.appendChild(link)
}

const getHtml = async(url) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
    // eslint-disable-next-line no-undef
      GM_xmlhttpRequest({
        method: 'get',
        url: url,
        onload: function(res) {
          const imgs = _utils_comics__WEBPACK_IMPORTED_MODULE_0__[/* currentComics */ "a"].getImgs(res.response)
          resolve(imgs)
        },
        onerror: function(e) {
          reject(e)
        }
      })
    }, 200)
  })
}

const request = async(method, url, responseType) => {
  return new Promise((resolve, reject) => {
    // eslint-disable-next-line no-undef
    GM_xmlhttpRequest({
      method,
      url,
      responseType,
      onload: function(res) {
        resolve(res)
      },
      onerror: function(e) {
        reject(e)
      },
      ontimeout: function() {
        console.log('超时')
      }
    })
  })
}


/***/ }),
/* 4 */
/***/ (function(module, exports) {

module.exports = vant;

/***/ }),
/* 5 */
/***/ (function(module, exports) {

module.exports = Vue;

/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".homeindex[data-v-7eb2bc79]{margin-top:20px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, "#comiclist[data-v-657d4b24]{margin-top:15px;border-radius:15px;position:relative;height:650px}#overlayDom[data-v-657d4b24]{background-color:#eeeeeece}#select-list[data-v-657d4b24]{max-height:600px;overflow-y:auto}#editItem[data-v-657d4b24]{display:flex;justify-content:space-between;margin:0px 15px;padding:5px;display:flex;flex-wrap:wrap}#comicinfo[data-v-657d4b24]{width:280px;margin:20px auto}#comicinfo .van-cell__title[data-v-657d4b24]{max-width:80px !important}input[data-v-657d4b24]{margin-left:5px;margin-right:5px;width:50px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".setindex[data-v-234d1526]{display:flex;flex-direction:column;margin:20px 15px 30px 15px;height:680px;max-height:680px;justify-content:space-between}.setindex #setpart[data-v-234d1526]{flex-direction:row;border-radius:15px;background-color:#ffffff;overflow:auto}.setindex #setpart .van-cell[data-v-234d1526]{padding:10px 1px}.setindex #setpart .van-cell .rightslider[data-v-234d1526]{margin:10px 15px;width:150px}.setindex #setpart .van-cell .rightslider .custom-button[data-v-234d1526]{width:26px;color:#fff;font-size:10px;line-height:18px;text-align:center;background-color:#ee0a24;border-radius:100px}.setindex #set-bottom[data-v-234d1526]{display:flex;justify-content:center;margin-bottom:20px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, "#downcontext[data-v-1e855a88]{margin:15px 15px;max-height:680px;border-radius:15px;overflow:auto}#downlist[data-v-1e855a88]{margin:10px 0px;padding:5px 5px;border-radius:15px;overflow-y:auto;max-height:500px}#downlist .downitem[data-v-1e855a88]{padding:1px 10px;display:flex;flex-direction:column}#downlist .downitem .itemname[data-v-1e855a88]{display:flex;justify-content:space-between;margin:2px 5px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, "*[data-v-5ef48958]{margin:0;padding:0}.custom-indicator[data-v-5ef48958]{position:absolute;height:700px;right:5px;bottom:5px;padding:2px 5px;font-size:12px;background:rgba(0,0,0,0.1)}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 11 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".card[data-v-5ef48958]{position:fixed;z-index:9999;right:0;top:50%;height:800px;width:420px;background-color:#f8f8f8;transform:translateY(-50%);border:solid 1px #66ccffee;border-radius:25px;transition:all 0.5s;box-shadow:2px 3px 3px 2px #66ccff55}.card__btn[data-v-5ef48958]{transition:all 0.5s;border-radius:30px 0 0 30px;width:30px;height:60px;background-color:#66ccff96;cursor:pointer;position:absolute;right:420px;top:50%;text-align:center}.card__btn svg[data-v-5ef48958]{height:20px;width:20px;position:absolute;right:5px;top:20px;transition:all 0.5s;transform:rotate(180deg)}.card--hide[data-v-5ef48958]{right:-415px}.card--hide .card__btn[data-v-5ef48958]{border-radius:0 30px 30px 0;right:420px;transform:rotate(180deg)}#border-bottom-set[data-v-5ef48958]{border-bottom-left-radius:25px;border-bottom-right-radius:25px;overflow:hidden}#border-top-set[data-v-5ef48958]{border-top-left-radius:25px;border-top-right-radius:25px;overflow:hidden}.swipeitem[data-v-5ef48958]{height:697px;padding-bottom:5px}.test[data-v-5ef48958]{position:absolute;position:relative;cursor:default;height:600px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
// Imports

var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.i, ".van-cell__title{text-align:left}*{padding:0;margin:0}body{font-size:14px}.app-container{background-color:#f8f8f8;padding:10px}::-webkit-scrollbar{width:7px;height:5px;border-radius:15px;-webkit-border-radius:15px}::-webkit-scrollbar-track-piece{background-color:#ffff;border-radius:15px;-webkit-border-radius:15px}::-webkit-scrollbar-thumb:vertical{height:5px;background-color:rgba(102,204,255,0.533333);border-radius:15px;-webkit-border-radius:15px}::-webkit-scrollbar-thumb:horizontal{width:7px;background-color:rgba(144,147,153,0.5);border-radius:15px;-webkit-border-radius:15px}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__["a"] = (___CSS_LOADER_EXPORT___);


/***/ }),
/* 13 */
/***/ (function(module, exports) {

module.exports = JSZip;

/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: external "Vue"
var external_Vue_ = __webpack_require__(5);
var external_Vue_default = /*#__PURE__*/__webpack_require__.n(external_Vue_);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=template&id=5ef48958&scoped=true&
var render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c("div", { staticClass: "app" }, [
    _c(
      "div",
      { staticClass: "card", class: { "card--hide": _vm.isHide } },
      [
        _c("van-nav-bar", {
          attrs: { id: "border-top-set", title: _vm.titles[this.active] },
        }),
        _vm._v(" "),
        _c(
          "van-swipe",
          {
            ref: "swipe",
            staticClass: "my-swipe",
            staticStyle: { cursor: "default" },
            attrs: {
              "indicator-color": "white",
              touchable: false,
              duration: 5,
              "initial-swipe": _vm.active,
              "show-indicators": false,
            },
          },
          [
            _c("van-swipe-item", { staticClass: "swipeitem" }, [_c("Home")], 1),
            _vm._v(" "),
            _c(
              "van-swipe-item",
              { staticClass: "swipeitem" },
              [_c("Table")],
              1
            ),
            _vm._v(" "),
            _c("van-swipe-item", { staticClass: "swipeitem" }, [_c("Down")], 1),
            _vm._v(" "),
            _c(
              "van-swipe-item",
              { staticClass: "swipeitem" },
              [_c("Setting")],
              1
            ),
          ],
          1
        ),
        _vm._v(" "),
        _c(
          "div",
          { staticClass: "app-container " },
          [
            _c(
              "van-tabbar",
              {
                staticStyle: { position: "absolute" },
                attrs: {
                  id: "border-bottom-set",
                  "active-color": "#ee0000",
                  "inactive-color": "#000",
                },
                model: {
                  value: _vm.active,
                  callback: function ($$v) {
                    _vm.active = $$v
                  },
                  expression: "active",
                },
              },
              [
                _c("van-tabbar-item", { attrs: { icon: "home-o" } }),
                _vm._v(" "),
                _c("van-tabbar-item", { attrs: { icon: "todo-list-o" } }),
                _vm._v(" "),
                _c("van-tabbar-item", { attrs: { icon: "underway-o" } }),
                _vm._v(" "),
                _c("van-tabbar-item", { attrs: { icon: "setting-o" } }),
              ],
              1
            ),
          ],
          1
        ),
        _vm._v(" "),
        _c("div", { staticClass: "card__btn", on: { click: _vm.hide } }, [
          _c(
            "svg",
            {
              staticClass: "icon",
              attrs: {
                t: "1589962875590",
                viewBox: "0 0 1024 1024",
                version: "1.1",
                "p-id": "2601",
              },
            },
            [
              _c("path", {
                attrs: {
                  d: "M730.020653 1018.946715l91.277028-89.978692a16.760351 16.760351 0 0 0 5.114661-11.803064 15.343983 15.343983 0 0 0-5.114661-11.803064l-400.123871-393.435467L821.691117 118.254899a17.075099 17.075099 0 0 0 0-23.606129L730.020653 4.670079a17.232473 17.232473 0 0 0-23.999564 0L202.030255 500.08402a16.445603 16.445603 0 0 0-4.721226 11.803064 15.265296 15.265296 0 0 0 5.114661 11.803064l503.597399 495.413941a17.153786 17.153786 0 0 0 23.999564 0z m0 0",
                  fill: "#EE000055",
                  "p-id": "2602",
                },
              }),
            ]
          ),
        ]),
      ],
      1
    ),
  ])
}
var staticRenderFns = []
render._withStripped = true


// CONCATENATED MODULE: ./src/app.vue?vue&type=template&id=5ef48958&scoped=true&

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/views/home.vue?vue&type=template&id=7eb2bc79&scoped=true&
var homevue_type_template_id_7eb2bc79_scoped_true_render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "homeindex" },
    [
      _c(
        "van-cell-group",
        { attrs: { inset: "" } },
        _vm._l(_vm.comicList, function (item, index) {
          return _c("van-cell", {
            key: index,
            attrs: { title: item.name, "is-link": "" },
            on: {
              click: function ($event) {
                return _vm.jump(item.url)
              },
            },
          })
        }),
        1
      ),
    ],
    1
  )
}
var homevue_type_template_id_7eb2bc79_scoped_true_staticRenderFns = []
homevue_type_template_id_7eb2bc79_scoped_true_render._withStripped = true


// CONCATENATED MODULE: ./src/views/home.vue?vue&type=template&id=7eb2bc79&scoped=true&

// EXTERNAL MODULE: ./src/utils/comics.js
var comics = __webpack_require__(0);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./src/views/home.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var homevue_type_script_lang_js_ = ({
  name: 'Index',
  data() {
    return {
      comicList: []
    }
  },
  mounted() {
    this.comicList = Object(comics["b" /* getWebList */])()
  },
  methods: {
    jump(url) {
      window.open(url, '_blank')
      // window.location.href = url
    }
  }
});

// CONCATENATED MODULE: ./src/views/home.vue?vue&type=script&lang=js&
 /* harmony default export */ var views_homevue_type_script_lang_js_ = (homevue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(1);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);

// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/home.vue?vue&type=style&index=0&id=7eb2bc79&lang=scss&scoped=true&
var homevue_type_style_index_0_id_7eb2bc79_lang_scss_scoped_true_ = __webpack_require__(6);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/home.vue?vue&type=style&index=0&id=7eb2bc79&lang=scss&scoped=true&

            

var options = {};

options.insert = "head";
options.singleton = false;

var update = injectStylesIntoStyleTag_default()(homevue_type_style_index_0_id_7eb2bc79_lang_scss_scoped_true_["a" /* default */], options);



/* harmony default export */ var views_homevue_type_style_index_0_id_7eb2bc79_lang_scss_scoped_true_ = (homevue_type_style_index_0_id_7eb2bc79_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/views/home.vue?vue&type=style&index=0&id=7eb2bc79&lang=scss&scoped=true&

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent (
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier, /* server only */
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
        injectStyles.call(
          this,
          (options.functional ? this.parent : this).$root.$options.shadowRoot
        )
      }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

// CONCATENATED MODULE: ./src/views/home.vue






/* normalize component */

var component = normalizeComponent(
  views_homevue_type_script_lang_js_,
  homevue_type_template_id_7eb2bc79_scoped_true_render,
  homevue_type_template_id_7eb2bc79_scoped_true_staticRenderFns,
  false,
  null,
  "7eb2bc79",
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "src/views/home.vue"
/* harmony default export */ var home = (component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/views/table.vue?vue&type=template&id=657d4b24&scoped=true&
var tablevue_type_template_id_657d4b24_scoped_true_render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "comiclist" } },
    [
      _c(
        "div",
        { attrs: { id: "editItem" } },
        [
          _c(
            "div",
            [
              _c(
                "van-button",
                {
                  attrs: {
                    type: "primary",
                    size: "mini",
                    disabled: !_vm.showSelectList,
                  },
                  on: { click: _vm.selectAll },
                },
                [_vm._v("全选")]
              ),
              _vm._v(" "),
              _c(
                "van-button",
                {
                  attrs: {
                    type: "primary",
                    size: "mini",
                    disabled: !_vm.showSelectList,
                  },
                  on: { click: _vm.CancelSelect },
                },
                [_vm._v("取消")]
              ),
            ],
            1
          ),
          _vm._v(" "),
          _c(
            "van-button",
            {
              staticStyle: { width: "80px" },
              attrs: {
                size: "mini",
                round: "",
                type: "primary",
                disabled: !_vm.showSelectList,
              },
              on: { click: _vm.downSelectList },
            },
            [_vm._v("下载")]
          ),
        ],
        1
      ),
      _vm._v(" "),
      _c(
        "van-divider",
        {
          style: {
            color: "#1989fa",
            borderColor: "#1989fa",
            padding: "0 15px",
            height: "10px",
          },
        },
        [
          _c(
            "code",
            {
              staticStyle: { cursor: "pointer" },
              on: { click: _vm.reloadList },
            },
            [_vm._v("重载列表")]
          ),
        ]
      ),
      _vm._v(" "),
      !_vm.showSelectList
        ? _c(
            "div",
            [
              _c(
                "van-empty",
                { attrs: { description: "漫画章节" } },
                [
                  _c(
                    "van-button",
                    {
                      staticClass: "bottom-button",
                      staticStyle: { width: "120px" },
                      attrs: {
                        round: "",
                        type: "primary",
                        disabled: _vm.comicName === "------",
                      },
                      on: { click: _vm.getSelectList },
                    },
                    [_vm._v(" 加载 ")]
                  ),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "van-cell-group",
                { attrs: { id: "comicinfo", inset: "" } },
                [
                  _c("van-cell", {
                    attrs: { title: "网站", value: _vm.webname },
                  }),
                  _vm._v(" "),
                  _c("van-cell", {
                    attrs: { title: "漫画", value: _vm.comicName },
                  }),
                ],
                1
              ),
            ],
            1
          )
        : _vm._e(),
      _vm._v(" "),
      _c("van-overlay", { attrs: { id: "overlayDom", show: _vm.overlayShow } }),
      _vm._v(" "),
      _vm.showSelectList
        ? _c(
            "div",
            { attrs: { id: "select-list" } },
            [
              _c(
                "van-cell-group",
                {
                  staticStyle: { "border-radius": "25px" },
                  attrs: { inset: "" },
                },
                [
                  _c(
                    "van-checkbox-group",
                    {
                      ref: "checkboxGroup",
                      model: {
                        value: _vm.selectResult,
                        callback: function ($$v) {
                          _vm.selectResult = $$v
                        },
                        expression: "selectResult",
                      },
                    },
                    _vm._l(_vm.list, function (item, index) {
                      return _c("van-cell", {
                        key: index,
                        style:
                          item.url !== "javascript:void();"
                            ? ""
                            : { color: "red" },
                        attrs: { title: item.chapterName },
                        scopedSlots: _vm._u(
                          [
                            {
                              key: "right-icon",
                              fn: function () {
                                return [
                                  _c("van-checkbox", {
                                    staticClass: "selectChapter",
                                    attrs: {
                                      name: index,
                                      disabled:
                                        item.url !== "javascript:void();"
                                          ? false
                                          : true,
                                      "icon-size": "24px",
                                    },
                                    on: {
                                      click: function ($event) {
                                        return _vm.radioSelect(index)
                                      },
                                    },
                                  }),
                                ]
                              },
                              proxy: true,
                            },
                          ],
                          null,
                          true
                        ),
                      })
                    }),
                    1
                  ),
                ],
                1
              ),
            ],
            1
          )
        : _vm._e(),
    ],
    1
  )
}
var tablevue_type_template_id_657d4b24_scoped_true_staticRenderFns = []
tablevue_type_template_id_657d4b24_scoped_true_render._withStripped = true


// CONCATENATED MODULE: ./src/views/table.vue?vue&type=template&id=657d4b24&scoped=true&

// EXTERNAL MODULE: external "vant"
var external_vant_ = __webpack_require__(4);
var external_vant_default = /*#__PURE__*/__webpack_require__.n(external_vant_);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./src/views/table.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//





/* harmony default export */ var tablevue_type_script_lang_js_ = ({
  name: 'Table',
  data() {
    return {
      list: [],
      selectResult: [],
      downResult: [],

      showSelectList: false,
      overlayShow: false,

      currentComics: '',
      webname: '未匹配',
      comicName: '------',

      paylogoArr: []
    }
  },
  mounted() {
    this.getInfo()
  },
  methods: {
    getInfo() {
      try {
        this.currentComics = comics["a" /* currentComics */]

        if (comics["a" /* currentComics */] === null) {
          return
        }
        const comicNameCss = this.currentComics.comicNameCss
        this.webname = comics["a" /* currentComics */].webName
        this.comicName = document.querySelector(comicNameCss).innerText
      // eslint-disable-next-line no-empty
      } catch (error) {}
    },
    selectAll() {
      this.$refs.checkboxGroup.toggleAll(false)
      if (comics["a" /* currentComics */].hasSpend) {
        this.list.forEach((element, index) => {
          if (element.url !== 'javascript:void();') {
            this.selectResult.push(index)
          }
        })
        return
      }
      this.$refs.checkboxGroup.toggleAll(true)
    },
    CancelSelect() {
      this.$refs.checkboxGroup.toggleAll(false)
    },

    radioSelect(index) {
      // console.log('index', this.selectResult)
    },
    async getSelectList() {
      this.overlayShow = true
      const chapterCss = comics["a" /* currentComics */].chapterCss
      setTimeout(() => {
        if (comics["a" /* currentComics */].hasSpend) {
          this.paylogoArr = []
          const logoCss = comics["a" /* currentComics */].freeCss + ',' + comics["a" /* currentComics */].payCss
          const logoArr = document.querySelectorAll(logoCss)
          logoArr.forEach((element, index) => {
            if ('.' + logoArr[index].className === comics["a" /* currentComics */].payCss) {
              this.paylogoArr.push(true)
            } else {
              this.paylogoArr.push(false)
            }
          })
        }
        const nodeList = document.querySelectorAll(chapterCss)
        nodeList.forEach(dom => {
          const urls = dom.querySelectorAll('a')
          const type = comics["a" /* currentComics */].type
          urls.forEach((element, index) => {
            let chapterName = element.innerText.replace(/\n|\r/g, '')
            chapterName = chapterName.trim()
            const data = {
              comicName: this.comicName,
              chapterName: chapterName,
              url: element.href,
              type: type
            }
            if (comics["a" /* currentComics */].hasSpend) {
              data.isPay = this.paylogoArr[index]
              if (data.isPay) {
                data.url = 'javascript:void();'
              }
            }
            this.list.push(data)
          })
        })
        this.overlayShow = false
        this.showSelectList = true
      }, 100)
    },
    downSelectList() {
      if (this.selectResult.length === 0) {
        Object(external_vant_["Toast"])({
          message: '请选择章节',
          getContainer: '.card',
          position: 'bottom'
        })
        return
      }
      this.selectResult.forEach(num => {
        this.downResult.push(this.list[num])
      })
      this.$bus.$emit('selectDown', this.downResult)
      this.$bus.$emit('changTab', 2)
      this.downResult = []
      this.selectResult = []
    },
    reloadList() {
      this.list = []
      this.selectResult = []
      this.getSelectList()
    }
  }
});

// CONCATENATED MODULE: ./src/views/table.vue?vue&type=script&lang=js&
 /* harmony default export */ var views_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/table.vue?vue&type=style&index=0&id=657d4b24&lang=scss&scoped=true&
var tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_ = __webpack_require__(7);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/table.vue?vue&type=style&index=0&id=657d4b24&lang=scss&scoped=true&

            

var tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_options = {};

tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_options.insert = "head";
tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_options.singleton = false;

var tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_["a" /* default */], tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_options);



/* harmony default export */ var views_tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_ = (tablevue_type_style_index_0_id_657d4b24_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/views/table.vue?vue&type=style&index=0&id=657d4b24&lang=scss&scoped=true&

// CONCATENATED MODULE: ./src/views/table.vue






/* normalize component */

var table_component = normalizeComponent(
  views_tablevue_type_script_lang_js_,
  tablevue_type_template_id_657d4b24_scoped_true_render,
  tablevue_type_template_id_657d4b24_scoped_true_staticRenderFns,
  false,
  null,
  "657d4b24",
  null
  
)

/* hot reload */
if (false) { var table_api; }
table_component.options.__file = "src/views/table.vue"
/* harmony default export */ var table = (table_component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/views/setting.vue?vue&type=template&id=234d1526&scoped=true&
var settingvue_type_template_id_234d1526_scoped_true_render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c("div", { staticClass: "setindex" }, [
    _c(
      "div",
      { attrs: { id: "setpart" } },
      [
        _c(
          "van-cell-group",
          { attrs: { title: "下载", inset: "" } },
          [
            _c(
              "van-cell",
              {
                attrs: { label: "* 刷新生效" },
                scopedSlots: _vm._u([
                  {
                    key: "title",
                    fn: function () {
                      return [
                        _c(
                          "span",
                          {
                            staticClass: "custom-title",
                            staticStyle: { width: "300px" },
                          },
                          [_vm._v("最大下载章节数")]
                        ),
                      ]
                    },
                    proxy: true,
                  },
                  {
                    key: "default",
                    fn: function () {
                      return [
                        _c("van-slider", {
                          staticClass: "rightslider",
                          attrs: { min: 1, max: 5 },
                          on: {
                            change: function ($event) {
                              return _vm.onChangeData(
                                "maxChapterNum",
                                _vm.maxChapterNum
                              )
                            },
                          },
                          scopedSlots: _vm._u([
                            {
                              key: "button",
                              fn: function () {
                                return [
                                  _c("div", { staticClass: "custom-button" }, [
                                    _vm._v(_vm._s(_vm.maxChapterNum)),
                                  ]),
                                ]
                              },
                              proxy: true,
                            },
                          ]),
                          model: {
                            value: _vm.maxChapterNum,
                            callback: function ($$v) {
                              _vm.maxChapterNum = $$v
                            },
                            expression: "maxChapterNum",
                          },
                        }),
                      ]
                    },
                    proxy: true,
                  },
                ]),
              },
              [
                _vm._v(" "),
                _vm._v(" "),
                _c("div", { staticClass: "custom-button" }, [
                  _vm._v(
                    _vm._s(
                      _vm.dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
                    )
                  ),
                ]),
              ]
            ),
            _vm._v(" "),
            _c(
              "van-cell",
              {
                attrs: { label: "* 刷新生效" },
                scopedSlots: _vm._u([
                  {
                    key: "title",
                    fn: function () {
                      return [
                        _c(
                          "span",
                          {
                            staticClass: "custom-title",
                            staticStyle: { width: "300px" },
                          },
                          [_vm._v("每章最大下载图片数")]
                        ),
                      ]
                    },
                    proxy: true,
                  },
                  {
                    key: "default",
                    fn: function () {
                      return [
                        _c("van-slider", {
                          staticClass: "rightslider",
                          attrs: { min: 1, max: 5 },
                          on: {
                            change: function ($event) {
                              return _vm.onChangeData(
                                "maxPictureNum",
                                _vm.maxPictureNum
                              )
                            },
                          },
                          scopedSlots: _vm._u([
                            {
                              key: "button",
                              fn: function () {
                                return [
                                  _c("div", { staticClass: "custom-button" }, [
                                    _vm._v(_vm._s(_vm.maxPictureNum)),
                                  ]),
                                ]
                              },
                              proxy: true,
                            },
                          ]),
                          model: {
                            value: _vm.maxPictureNum,
                            callback: function ($$v) {
                              _vm.maxPictureNum = $$v
                            },
                            expression: "maxPictureNum",
                          },
                        }),
                      ]
                    },
                    proxy: true,
                  },
                ]),
              },
              [_vm._v(" "), _vm._v(" "), _c("br")]
            ),
          ],
          1
        ),
      ],
      1
    ),
    _vm._v(" "),
    _c(
      "div",
      { attrs: { id: "set-bottom" } },
      [
        _c(
          "van-button",
          {
            style: { width: "120px", background: "#ee000055" },
            attrs: { round: "" },
            on: { click: _vm.allInit },
          },
          [_vm._v("全部重置")]
        ),
      ],
      1
    ),
  ])
}
var settingvue_type_template_id_234d1526_scoped_true_staticRenderFns = []
settingvue_type_template_id_234d1526_scoped_true_render._withStripped = true


// CONCATENATED MODULE: ./src/views/setting.vue?vue&type=template&id=234d1526&scoped=true&

// CONCATENATED MODULE: ./src/config/index.js
/* eslint-disable no-undef */
const AppName = "10漫画下载"
const AppVersion = "1.1.0"
const AppEnv = "production"
const isDev = AppEnv === 'development'



// CONCATENATED MODULE: ./src/config/setup.js
/* eslint-disable no-undef */


const configDefault = {
  version: AppVersion,
  maxChapterNum: 3,
  maxPictureNum: 3
}

const appinit = () => {
  if (isDev) {
    return
  }
  // 如条件全为false, 则更新设置
  if (GM_getValue('version') !== undefined && GM_getValue('version') === AppVersion) {
    console.log('不需要更新数据')
    return
  }
  for (const key in configDefault) {
    // 不存在,添加
    if (GM_getValue(key) === undefined) {
      GM_setValue(key, configDefault[key])
    }
  }
  GM_setValue('version', AppVersion)
}

const setinit = async() => {
  if (isDev) {
    return
  }
  return new Promise((resolve, reject) => {
    for (const key in configDefault) {
      GM_setValue(key, configDefault[key])
    }
    resolve(true)
  })
}

const setStorage = async(key, value) => {
  return new Promise((resolve, reject) => {
    GM_setValue(key, value)
    resolve(true)
  })
}

const getStorage = async(key) => {
  return new Promise((resolve, reject) => {
    const value = GM_getValue(key)
    resolve(value)
  })
}

// CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./src/views/setting.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* eslint-disable no-undef */



/* harmony default export */ var settingvue_type_script_lang_js_ = ({
  name: 'Setting',
  data() {
    return {
      maxChapterNum: 1,
      maxPictureNum: 2
    }
  },
  mounted() {
    this.getAllData()
  },
  methods: {
    onChangeData(key, value) {
      setStorage(key, value)
    },
    getAllData() {
      try {
        this.maxChapterNum = GM_getValue('maxChapterNum')
        this.maxPictureNum = GM_getValue('maxPictureNum')
      // eslint-disable-next-line no-empty
      } catch (error) {}
    },
    async allInit() {
      external_vant_["Dialog"].confirm({
        getContainer: '.card',
        message: '确认重置'
      })
        .then(() => {
          setinit().then((result) => {
            this.getAllData()
          })
        })
        .catch(() => {
          // on cancel
        })
    }
  }
});

// CONCATENATED MODULE: ./src/views/setting.vue?vue&type=script&lang=js&
 /* harmony default export */ var views_settingvue_type_script_lang_js_ = (settingvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/setting.vue?vue&type=style&index=0&id=234d1526&lang=scss&scoped=true&
var settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_ = __webpack_require__(8);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/setting.vue?vue&type=style&index=0&id=234d1526&lang=scss&scoped=true&

            

var settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_options = {};

settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_options.insert = "head";
settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_options.singleton = false;

var settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_["a" /* default */], settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_options);



/* harmony default export */ var views_settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_ = (settingvue_type_style_index_0_id_234d1526_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/views/setting.vue?vue&type=style&index=0&id=234d1526&lang=scss&scoped=true&

// CONCATENATED MODULE: ./src/views/setting.vue






/* normalize component */

var setting_component = normalizeComponent(
  views_settingvue_type_script_lang_js_,
  settingvue_type_template_id_234d1526_scoped_true_render,
  settingvue_type_template_id_234d1526_scoped_true_staticRenderFns,
  false,
  null,
  "234d1526",
  null
  
)

/* hot reload */
if (false) { var setting_api; }
setting_component.options.__file = "src/views/setting.vue"
/* harmony default export */ var setting = (setting_component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/views/down.vue?vue&type=template&id=1e855a88&scoped=true&
var downvue_type_template_id_1e855a88_scoped_true_render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "downcontext" } },
    [
      _c(
        "van-collapse",
        {
          model: {
            value: _vm.collapseActiveName,
            callback: function ($$v) {
              _vm.collapseActiveName = $$v
            },
            expression: "collapseActiveName",
          },
        },
        [
          _c("van-collapse-item", { attrs: { title: "下载中", name: "1" } }, [
            _c(
              "div",
              { attrs: { id: "downlist" } },
              _vm._l(_vm.queue.worker, function (item, index) {
                return _c("div", { key: index, staticClass: "downitem" }, [
                  item !== undefined
                    ? _c(
                        "div",
                        [
                          _c("div", { staticClass: "itemname" }, [
                            _c("span", { staticClass: "custom-title" }, [
                              _vm._v(_vm._s(item.chapterName)),
                            ]),
                          ]),
                          _vm._v(" "),
                          _c("div", [
                            _vm._v(
                              "\n              " +
                                _vm._s(_vm.queue.worker[index][4]) +
                                "\n            "
                            ),
                          ]),
                          _vm._v(" "),
                          _c("van-progress", {
                            ref: "progress",
                            refInFor: true,
                            staticStyle: { width: "100%", "margin-top": "5px" },
                            attrs: {
                              percentage: item.progress,
                              "pivot-color": "#66ccff",
                              color:
                                "linear-gradient(to right, #66ccff22, ##66ccff)",
                            },
                          }),
                          _vm._v(" "),
                          _c("van-divider", {
                            style: {
                              margin: "11px 0px",
                              padding: "0 0px",
                              height: "1px",
                            },
                          }),
                        ],
                        1
                      )
                    : _vm._e(),
                ])
              }),
              0
            ),
          ]),
          _vm._v(" "),
          _c("van-collapse-item", { attrs: { title: "待下载", name: "2" } }, [
            _c(
              "div",
              { attrs: { id: "downlist" } },
              _vm._l(_vm.queue.list, function (item, index) {
                return _c(
                  "div",
                  { key: index, staticClass: "downitem" },
                  [
                    _c("div", { staticClass: "itemname" }, [
                      _c("span", { staticClass: "custom-title" }, [
                        _vm._v(_vm._s(item.chapterName)),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c("van-divider", {
                      style: {
                        margin: "11px 0px",
                        padding: "0 0px",
                        height: "1px",
                      },
                    }),
                  ],
                  1
                )
              }),
              0
            ),
          ]),
          _vm._v(" "),
          _c("van-collapse-item", { attrs: { title: "已下载", name: "3" } }, [
            _c(
              "div",
              { attrs: { id: "downlist" } },
              _vm._l(_vm.queue.workeredList, function (item, index) {
                return _c(
                  "div",
                  { key: index, staticClass: "downitem" },
                  [
                    _c("div", { staticClass: "itemname" }, [
                      _c("span", { staticClass: "custom-title" }, [
                        _vm._v(_vm._s(item)),
                      ]),
                    ]),
                    _vm._v(" "),
                    _c("van-divider", {
                      style: {
                        margin: "11px 0px",
                        padding: "0 0px",
                        height: "1px",
                      },
                    }),
                  ],
                  1
                )
              }),
              0
            ),
          ]),
        ],
        1
      ),
    ],
    1
  )
}
var downvue_type_template_id_1e855a88_scoped_true_staticRenderFns = []
downvue_type_template_id_1e855a88_scoped_true_render._withStripped = true


// CONCATENATED MODULE: ./src/views/down.vue?vue&type=template&id=1e855a88&scoped=true&

// EXTERNAL MODULE: external "JSZip"
var external_JSZip_ = __webpack_require__(13);
var external_JSZip_default = /*#__PURE__*/__webpack_require__.n(external_JSZip_);

// EXTERNAL MODULE: ./src/utils/index.js
var utils = __webpack_require__(3);

// CONCATENATED MODULE: ./src/utils/queue.js



// 多个任务并行执行的队列
// https://juejin.cn/post/6844903961728647181

class queue_Queue {
  constructor(workerLen, maxPictureNum) {
    this.workerLen = workerLen || 3 // 同时执行的任务数
    this.list = [] // 任务队列
    this.workeredList = [] // 已完成的任务
    this.worker = new Array(this.workerLen) // 正在执行的任务
    this.workerimg = new Array(this.workerLen) // 存储下载的图片数据
    this.pictureNum = maxPictureNum || 2
  }

  downloadFile(fileName, content) {
    const a = document.createElement('a')
    const url = window.URL.createObjectURL(content)
    a.href = url
    a.download = fileName
    a.click()
    window.URL.revokeObjectURL(url)
  }

  /**
     * 执行一个任务
     * @param { number } index
     */
  async * exeDown(index) {
    const downtype = this.worker[index].type
    const chapterName = this.worker[index].chapterName
    const _this = this
    if (downtype === 1) {
      const url = this.worker[index].url
      const imgs = await Object(utils["a" /* getHtml */])(url)
      this.worker[index].imgs = imgs
      this.worker[index].number = imgs.length

      // yield this.downAll(index, chapterName, imgs)
      yield this.downOne(index, chapterName, imgs)
        .then(function() {
          // 任务执行完毕后,再次分配任务并执行任务
          setTimeout(() => {
            _this.worker[index] = undefined
            _this.workeredList.push(chapterName)
            _this.run()
          }, 500)
        })
    } else {
      yield this.downOne2(index)
        .then(function() {
          setTimeout(() => {
            _this.worker[index] = undefined
            _this.workeredList.push(chapterName)
            _this.run()
          }, 500)
        })
    }
  }

  /**
     * 添加到任务队列
     * @param { Array<Array<any>> } list: 任务队列
     */
  addList(list) {
    for (const item of list) {
      this.list.unshift(item)
    }
  }

  refresh() {
    this.worker.push('')
    this.worker.pop()
  }

  // 请求图片
  addImgPromise(index, imgurl) {
    return new Promise((resolve, reject) => {
      const _this = this
      const suffix = this.getSuffix(imgurl)
      // eslint-disable-next-line no-undef
      GM_xmlhttpRequest({
        method: 'get',
        url: imgurl,
        responseType: 'blob',
        onload: function(gmRes) {
          _this.worker[index].currentnum = _this.worker[index].currentnum + 1
          _this.worker[index].progress = parseInt(_this.worker[index].currentnum / _this.worker[index].number * 100)
          _this.refresh()
          resolve({
            blob: gmRes.response,
            suffix: suffix })
        },
        onerror: function(e) {
          resolve({
            blob: 1,
            suffix: '' })
        },
        ontimeout: function() {
          resolve({
            blob: 0,
            suffix: '' })
        }
      })
    })
  }

  // 网站单页阅读方式  下载
  async downOne2(workerId) {
    const url = this.worker[workerId].url
    const { imgUrl, nextPageUrl, number } = await Object(utils["a" /* getHtml */])(url)
    this.worker[workerId].number = number

    while (imgUrl.length > 0) {
      // eslint-disable-next-line prefer-const
      let promise = []
      for (let index = this.pictureNum; index > 0; index--) {
        if (imgUrl[0] === undefined) {
          break
        }
        promise.push(this.addImgPromise(workerId, imgUrl[0]))
        imgUrl.shift()
      }

      const res = await Promise.all(promise)
      res.forEach(element => {
        this.workerimg[workerId].push(element)
      })
    }

    if (nextPageUrl !== '') {
      this.worker[workerId].url = nextPageUrl
      return this.downOne2(workerId)
    }

    const result = await this.makeZip(workerId)
    return new Promise((resolve, reject) => {
      resolve(result)
    })
  }

  // 网站卷轴阅读方式  下载
  async downOne(workerId) {
    const imgs = this.worker[workerId].imgs
    const promise = []
    let len = imgs.length
    let pictureNum = this.pictureNum
    while (pictureNum--) {
      if (len > 0) {
        promise.push(this.addImgPromise(workerId, imgs[0]))
        this.worker[workerId].imgs.shift()
        len--
      }
    }
    const res = await Promise.all(promise)
    res.forEach(element => {
      this.workerimg[workerId].push(element)
    })

    if (this.worker[workerId].imgs.length > 0) {
      return this.downOne(workerId)
    }

    const result = await this.makeZip(workerId)
    return new Promise((resolve, reject) => {
      resolve(result)
    })
  }

  // 分配并执行任务
  async run() {
    const runIndex = []
    for (let i = 0; i < this.workerLen; i++) {
      const len = this.list.length
      if (!this.worker[i] && len > 0) {
        // 需要执行的任务
        const item = this.list[len - 1]

        const worker = {
          comicName: item.comicName,
          chapterName: item.chapterName,
          currentnum: 0,
          number: 0,
          imgs: [],
          url: item.url,
          progress: 0,
          type: item.type,
          func: this.exeDown(i)
        }
        this.workerimg[i] = []
        this.worker[i] = worker
        this.list.pop()
        runIndex.push(i)
      }
    }
    // 执行任务
    for (const index of runIndex) {
      this.worker[index].func.next()
    }
  }

  getSuffix(url) {
    const testurl = url.toLowerCase()
    const imgtype = ['jpg', 'jpeg', 'webp', 'png', 'gif', 'bmp', 'tiff', 'svg', 'ico']
    for (let i = 0; i < imgtype.length; i++) {
      const a = testurl.search(imgtype[i])
      if (a !== -1) {
        return imgtype[i]
      }
    }
    // 可能网址没有图片后缀
    return 'jpg'
  }

  // 压缩
  async makeZip(workerId) {
    const comicName = this.worker[workerId].comicName
    const chapterName = this.worker[workerId].chapterName

    return new Promise((resolve, reject) => {
      const zip = new external_JSZip_default.a()

      this.workerimg[workerId].forEach((item, index) => {
        const imgblob = item.blob
        const suffix = item.suffix
        if (imgblob === 1 || imgblob === 0) {
          zip.file(parseInt(index + 1) + '.xx', '', { blob: true })
          return
        }
        zip.file(parseInt(index + 1) + '.' + suffix, imgblob, { blob: true })
      })

      zip.generateAsync({
        type: 'blob',
        compression: 'DEFLATE',
        compressionOptions: {
          level: 9
        }
      }).then((zipblob) => {
        this.downloadFile(comicName + '_' + chapterName, zipblob)
        resolve()
        return
      })
    })
  }
}

// CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./src/views/down.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var downvue_type_script_lang_js_ = ({
  name: 'Down',
  data() {
    return {
      collapseActiveName: ['1', '2', '3'],
      queue: {
        'worker': '',
        'list': '',
        'workeredList': ''
      },
      maxChapterNum: 3,
      maxPictureNum: 2
    }
  },
  watch: {

  },
  mounted() {
    console.clear()
    this.$bus.$on('selectDown', this.downInit)
  },
  created() {
  },
  methods: {
    async downInit(arr) {
      if (this.queue.worker === '') {
        this.maxChapterNum = await getStorage('maxChapterNum')
        this.maxPictureNum = await getStorage('maxPictureNum')
        this.queue = new queue_Queue(this.maxChapterNum, this.maxPictureNum)
      }
      this.queue.addList(arr)
      this.queue.run()
    }
  }
});

// CONCATENATED MODULE: ./src/views/down.vue?vue&type=script&lang=js&
 /* harmony default export */ var views_downvue_type_script_lang_js_ = (downvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/down.vue?vue&type=style&index=0&id=1e855a88&lang=scss&scoped=true&
var downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_ = __webpack_require__(9);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/views/down.vue?vue&type=style&index=0&id=1e855a88&lang=scss&scoped=true&

            

var downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_options = {};

downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_options.insert = "head";
downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_options.singleton = false;

var downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_["a" /* default */], downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_options);



/* harmony default export */ var views_downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_ = (downvue_type_style_index_0_id_1e855a88_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/views/down.vue?vue&type=style&index=0&id=1e855a88&lang=scss&scoped=true&

// CONCATENATED MODULE: ./src/views/down.vue






/* normalize component */

var down_component = normalizeComponent(
  views_downvue_type_script_lang_js_,
  downvue_type_template_id_1e855a88_scoped_true_render,
  downvue_type_template_id_1e855a88_scoped_true_staticRenderFns,
  false,
  null,
  "1e855a88",
  null
  
)

/* hot reload */
if (false) { var down_api; }
down_component.options.__file = "src/views/down.vue"
/* harmony default export */ var down = (down_component.exports);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//










/* harmony default export */ var appvue_type_script_lang_js_ = ({
  name: 'App',
  components: {
    Home: home, Table: table, Down: down, Setting: setting
  },
  data() {
    return {
      AppName: AppName,
      AppVersion: AppVersion,
      show: true,
      isHide: true,
      active: 1,
      titles: ['漫画网站', '选择章节', '下载', '设置'],
      comicInfo: {}
    }
  },
  computed: {
    current: function() {
      return this.active
    }
  },
  watch: {
    active(val) {
      this.$refs.swipe.swipeTo(val)
    }
  },
  created() {
    appinit()
    Object(comics["c" /* matchWeb */])(window.location.href)
  },
  mounted() {
    this.$bus.$on('changTab', (val) => { this.active = val })
  },
  methods: {
    showContext() {
      this.show = !this.show
    },
    hide() {
      this.isHide = !this.isHide
    },
    test(e) {

    }
  }
});

// CONCATENATED MODULE: ./src/app.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_appvue_type_script_lang_js_ = (appvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=style&index=0&id=5ef48958&lang=scss&scoped=true&
var appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_ = __webpack_require__(10);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=style&index=0&id=5ef48958&lang=scss&scoped=true&

            

var appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_options = {};

appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_options.insert = "head";
appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_options.singleton = false;

var appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_["a" /* default */], appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_options);



/* harmony default export */ var lib_vue_loader_options_src_appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_ = (appvue_type_style_index_0_id_5ef48958_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/app.vue?vue&type=style&index=0&id=5ef48958&lang=scss&scoped=true&

// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=style&index=1&id=5ef48958&lang=scss&scoped=true&
var appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_ = __webpack_require__(11);

// CONCATENATED MODULE: ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/app.vue?vue&type=style&index=1&id=5ef48958&lang=scss&scoped=true&

            

var appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_options = {};

appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_options.insert = "head";
appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_options.singleton = false;

var appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_["a" /* default */], appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_options);



/* harmony default export */ var lib_vue_loader_options_src_appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_ = (appvue_type_style_index_1_id_5ef48958_lang_scss_scoped_true_["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/app.vue?vue&type=style&index=1&id=5ef48958&lang=scss&scoped=true&

// CONCATENATED MODULE: ./src/app.vue







/* normalize component */

var app_component = normalizeComponent(
  src_appvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  "5ef48958",
  null
  
)

/* hot reload */
if (false) { var app_api; }
app_component.options.__file = "src/app.vue"
/* harmony default export */ var app = (app_component.exports);
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/styles/global.scss
var global = __webpack_require__(12);

// CONCATENATED MODULE: ./src/styles/global.scss

            

var global_options = {};

global_options.insert = "head";
global_options.singleton = false;

var global_update = injectStylesIntoStyleTag_default()(global["a" /* default */], global_options);



/* harmony default export */ var styles_global = (global["a" /* default */].locals || {});
// CONCATENATED MODULE: ./src/main.js








// import 'vant/lib/index.css'

const id = `app_vue_${Date.now()}`
const root = document.createElement('div')
root.id = id
document.body.appendChild(root)

external_Vue_default.a.prototype.$bus = new external_Vue_default.a()
external_Vue_default.a.use(external_vant_default.a)

if (isDev) {
  Object(utils["b" /* loadStyle */])('https://unpkg.com/[email protected]/lib/index.css')
} else {
  // eslint-disable-next-line no-undef
  GM_addStyle(GM_getResourceText('vantcss'))
}

new external_Vue_default.a({
  el: `#${id}`,
  render: h => h(app)
})


/***/ })
/******/ ]);