diff --git a/lib/.keep b/lib/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/lib/58动漫.js b/lib/58动漫.js deleted file mode 100644 index 8a5555a..0000000 --- a/lib/58动漫.js +++ /dev/null @@ -1,28 +0,0 @@ -muban.vfed.二级.title = 'h1&&Text;.fed-col-md3:eq(0)&&Text'; -muban.vfed.二级.desc = '.fed-col-md3:eq(3)&&Text;;;.fed-col-md6--span:eq(0)&&Text;.fed-col-md6--span:eq(1)&&Text'; -muban.vfed.二级.tabs = '.nav-tabs&&li'; -muban.vfed.二级.lists = '.myui-content__list:eq(#id)&&li'; -var rule = { - title:'58动漫', // 原"幻听网听书"网站 已更名为 "58动漫" - 模板:'vfed', - host:'http://www.ting38.com', - // url:'/ting/fyclass-fypage.html', - url:'/search.php?page=fypage&searchtype=5&tid=fyclassfyfilter', - filterable:1,//是否启用分类筛选, - filter_url:'&order={{fl.by}}&area={{fl.area}}&year={{fl.year}}', - filter:{ - "1":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"more","v":"more"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hit"},{"n":"推荐","v":"commend"}]}], - "2":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"more","v":"more"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hit"},{"n":"推荐","v":"commend"}]}], - "3":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"more","v":"more"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hit"},{"n":"推荐","v":"commend"}]}], - "4":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"},{"n":"香港","v":"香港"},{"n":"台湾","v":"台湾"},{"n":"日本","v":"日本"},{"n":"韩国","v":"韩国"},{"n":"欧美","v":"欧美"},{"n":"泰国","v":"泰国"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"more","v":"more"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"time"},{"n":"人气","v":"hit"},{"n":"推荐","v":"commend"}]}] - }, - filter_def:{ - 1:{cateId:'1'}, - 2:{cateId:'2'}, - 3:{cateId:'3'}, - 4:{cateId:'4'} - }, - searchUrl:'/search.php?page=fypage&searchword=**&searchtype=', - 搜索: '.fed-list-item;a&&title;a&&data-original;.fed-list-remarks&&Text;a&&href', - lazy:'`js:input = request(input).match(/var now="(.*?)"/)[1];', -} \ No newline at end of file diff --git a/lib/AnFuns.js b/lib/AnFuns.js deleted file mode 100644 index d32a5b3..0000000 --- a/lib/AnFuns.js +++ /dev/null @@ -1,33 +0,0 @@ -muban.海螺3.二级.title = '.hl-dc-title&&Text;.hl-col-xs-12.hl-col-sm-4--em:eq(2)&&Text'; -muban.海螺3.二级.desc = '.hl-col-xs-12:eq(2)&&Text;.hl-col-xs-12.hl-col-sm-4:(0)&&Text;.hl-col-xs-12.hl-col-sm-4:(1)&&Text;.hl-col-xs-12:eq(3)&&Text;.hl-col-xs-12:eq(4)&&Text'; -var rule = { - title:'AnFuns动漫', - 模板:'海螺3', - host:'https://www.anfuns.cc', - cate_exclude: '最新|排行', - // url:'/type/fyclass-fypage.html', - url:'/show/fyclassfyfilter.html', - filterable:1,//是否启用分类筛选, - filter_url:'---{{fl.year}}{{fl.by}}/page/fypage', - filter: { - "1":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"/by/time"},{"n":"最热","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "2":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"/by/time"},{"n":"最热","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "3":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"/by/time"},{"n":"最热","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "4":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"/by/time"},{"n":"最热","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}] - }, - searchUrl:'/search/page/fypage/wd/**.html', - lazy:`js: - var html = JSON.parse(request(input).match(/r player_.*?=(.*?) it.toLowerCase() === "set-cookie"); - let cookie = setCk ? json[setCk] : ""; - // 3个set-Cookie - if (Array.isArray(cookie)) { - cookie = cookie.join(';'); - } - cookie = cookie.split(';').filter(function(it) { - return ['e', 'p', 'h'].includes(it.split('=')[0]) - }).join(';'); - log(cookie); - var purl = JSON.parse(json.body).s[0].src; - if (purl.startsWith('/')) { - purl = 'https:' + purl - } - input = { - jx: 0, - url: purl, - parse: 0, - header: JSON.stringify({ - 'referer': HOST, - 'Cookie': cookie, - 'user-agent': PC_UA - }), - } - `, - limit:6, - 推荐: `js: - var d = []; - function stripHtmlTag(src) { - return src.replace(/<\\/?[^>]+(>|$)/g, '').replace(/&.{1,5};/g, '').replace(/\\s{2,}/g, ' '); - } - var timestamp = new Date().getTime(); - var json = request('https://d1zquzjgwo9yb.cloudfront.net/?_=' + timestamp); - var list = JSON.parse(json); - let playKeys = Object.values(list).filter(function(x) { - return x[2].includes('連載中'); - }); - playKeys.forEach(function(it) { - d.push({ - title: stripHtmlTag(it[1]), - img: 'https://sta.anicdn.com/playerImg/8.jpg', - desc: it[2], - url: it[0], - }); - }); - setResult(d); - `, - 一级: `js: - var d = []; - function stripHtmlTag(src) { - return src.replace(/<\\/?[^>]+(>|$)/g, '').replace(/&.{1,5};/g, '').replace(/\\s{2,}/g, ' '); - } - var timestamp = new Date().getTime(); - var json = request('https://d1zquzjgwo9yb.cloudfront.net/?_=' + timestamp); - var list = JSON.parse(json); - let playKeys = Object.values(list).filter(function(x) { - if (MY_CATE === '連載中') return x[2].includes(MY_CATE); - else if (MY_CATE === '2017') return x[3] <= MY_CATE; - else return x[3] == MY_CATE; - }); - playKeys.forEach(function(it) { - d.push({ - title: stripHtmlTag(it[1]), - img: 'https://sta.anicdn.com/playerImg/8.jpg', - desc: it[2], - url: it[0], - }); - }); - setResult(d); - `, - 二级: `js: - pdfh = jsp.pdfh; pdfa = jsp.pdfa; pd = jsp.pd; - var html = request(input); - var timestamp = new Date().getTime(); - var json = request('https://d1zquzjgwo9yb.cloudfront.net/?_=' + timestamp); - var list = JSON.parse(json); - var vid = input.split('=')[1]; - let playKeys = Object.values(list).find(function(x) { - return x[0] === parseInt(vid); - }); - VOD = { - vod_pic: 'https://sta.anicdn.com/playerImg/8.jpg', - vod_id: playKeys[0], - vod_name: playKeys[1], - vod_content: playKeys[2], - vod_year: playKeys[3], - type_name: playKeys[4], - vod_actor: playKeys[5], - }; - var pageurl = pd(html, '.cat-links&&a&&href'); - var pagenum = 1; - let vod_tab_list = []; - let vlist = []; - for (let p = 1; p < parseInt(pagenum) + 1; p++) { - let phtml = request(pageurl + '/page/' + pagenum); - let new_vod_list = []; - let vodList = []; - vodList = pdfa(phtml, '.site-main&&article'); - for (let i = 0; i < vodList.length; i++) { - let it = vodList[i]; - let ptitle = pdfh(it, '.entry-title&&Text').replace(/\\[(.*)\\]/, '$1'); - let purl = pd(it, '.video-js&&data-apireq'); - new_vod_list.push(ptitle + '$' + purl); - } - vlist = vlist.concat(new_vod_list); - try { - pagenum = pd(phtml, '.nav-previous&&a&&href').split('/page/')[1]; - } catch(e) {} - } - let vlist2 = vlist.reverse().join("#"); - vod_tab_list.push(vlist2); - VOD.vod_play_from = '道长在线'; - VOD.vod_play_url = vod_tab_list.join("$$$"); - `, - 搜索: `js: - var d = []; - function stripHtmlTag(src) { - return src.replace(/<\\/?[^>]+(>|$)/g, '').replace(/&.{1,5};/g, '').replace(/\\s{2,}/g, ' '); - } - var timestamp = new Date().getTime(); - var json = request('https://d1zquzjgwo9yb.cloudfront.net/?_=' + timestamp); - var list = JSON.parse(json); - var wd = input.split('=')[1]; - let playKeys = Object.values(list).filter(function(x) { - return x[1].includes(wd); - }); - log(playKeys); - playKeys.forEach(function(it) { - d.push({ - title: stripHtmlTag(it[1]), - img: 'https://sta.anicdn.com/playerImg/8.jpg', - desc: it[2], - url: it[0], - }); - }); - setResult(d); - `, -} \ No newline at end of file diff --git a/lib/NT动漫.js b/lib/NT动漫.js deleted file mode 100644 index ef42b58..0000000 --- a/lib/NT动漫.js +++ /dev/null @@ -1,37 +0,0 @@ -// http://www.ntdm.tv -var rule={ - title:'NT动漫', - host:'http://www.ntdm8.com', - homeUrl:'/type/riben.html', - // url:'/show/fyclass--------fypage---.html', - url:'/show/fyclassfyfilter.html', - filterable:1,//是否启用分类筛选, - filter_url:'--{{fl.by}}-{{fl.class}}--{{fl.letter}}---fypage---{{fl.year}}', - filter:{ - "riben":[{"key":"year","name":"年份:","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000以前"}]},{"key":"class","name":"类型:","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"letter","name":"字母:","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0~9","v":"0~9"}]},{"key":"by","name":"排序:","value":[{"n":"更新时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}], - "zhongguo":[{"key":"year","name":"年份:","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000以前"}]},{"key":"class","name":"类型:","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"letter","name":"字母:","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0~9","v":"0~9"}]},{"key":"by","name":"排序:","value":[{"n":"更新时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}], - "omei":[{"key":"year","name":"年份:","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000以前"}]},{"key":"class","name":"类型:","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"letter","name":"字母:","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"},{"n":"0~9","v":"0~9"}]},{"key":"by","name":"排序:","value":[{"n":"更新时间","v":"time"},{"n":"人气","v":"hits"},{"n":"评分","v":"score"}]}] - }, - searchUrl:'/search/**----------fypage---.html', - searchable:2,//是否启用全局搜索, - quickSearch:0,//是否启用快速搜索, - headers:{//网站的请求头,完整支持所有的,常带ua和cookies - 'User-Agent':'MOBILE_UA', - }, - class_parse: '.search-tag li;a&&Text;a&&href;.*/(\\w+).html', - play_parse:true, - detailUrl:'', - lazy:"", - limit:6, - 推荐:'*', - 一级:'.blockcontent1&&.blockdif2;img&&alt;img&&src;.newname&&Text;a&&href', - 二级访问前:'', - 二级:{ - "title":"h4&&Text;.detail_imform_value:eq(6)&&Text", - "img":".poster&&src", - "desc":".detail_imform_kv:eq(0)&&Text;.detail_imform_value:eq(5)&&Text;.detail_imform_value:eq(2)&&Text;.detail_imform_kv:eq(0)&&Text;.detail_imform_kv:eq(3)&&Text", - "content":".detail_imform_desc_pre&&Text", - "tabs":"#menu0&&li", - "lists":".movurl:eq(#id)&&li"}, - 搜索:'*', -} \ No newline at end of file diff --git a/lib/cheerio.min.js b/lib/cheerio.min.js deleted file mode 100644 index 7d6375e..0000000 --- a/lib/cheerio.min.js +++ /dev/null @@ -1 +0,0 @@ -var e,t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class g extends A{constructor(){super(...arguments),this.type=e.CDATA}get nodeType(){return 4}}class N extends A{constructor(){super(...arguments),this.type=e.Root}get nodeType(){return 9}}class C extends A{constructor(t,n,r=[],i=("script"===t?e.Script:"style"===t?e.Style:e.Tag)){super(r),this.name=t,this.attribs=n,this.type=i}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map((e=>{var t,n;return{name:e,value:this.attribs[e],namespace:null===(t=this["x-attribsNamespace"])||void 0===t?void 0:t[e],prefix:null===(n=this["x-attribsPrefix"])||void 0===n?void 0:n[e]}}))}}function I(t){return(n=t).type===e.Tag||n.type===e.Script||n.type===e.Style;var n}function S(t){return t.type===e.CDATA}function b(t){return t.type===e.Text}function O(t){return t.type===e.Comment}function y(t){return t.type===e.Directive}function L(t){return t.type===e.Root}function k(e){return Object.prototype.hasOwnProperty.call(e,"children")}function v(e,t=!1){let n;if(b(e))n=new m(e.data);else if(O(e))n=new T(e.data);else if(I(e)){const r=t?D(e.children):[],i=new C(e.name,{...e.attribs},r);r.forEach((e=>e.parent=i)),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]={...e["x-attribsPrefix"]}),n=i}else if(S(e)){const r=t?D(e.children):[],i=new g(r);r.forEach((e=>e.parent=i)),n=i}else if(L(e)){const r=t?D(e.children):[],i=new N(r);r.forEach((e=>e.parent=i)),e["x-mode"]&&(i["x-mode"]=e["x-mode"]),n=i}else{if(!y(e))throw new Error(`Not implemented yet: ${e.type}`);{const t=new _(e.name,e.data);null!=e["x-name"]&&(t["x-name"]=e["x-name"],t["x-publicId"]=e["x-publicId"],t["x-systemId"]=e["x-systemId"]),n=t}}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function D(e){const t=e.map((e=>v(e,!0)));for(let e=1;e$\x80-\uFFFF]/g,x=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),w=null!=String.prototype.codePointAt?(e,t)=>e.codePointAt(t):(e,t)=>55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function B(e){let t,n="",r=0;for(;null!==(t=P.exec(e));){const i=t.index,s=e.charCodeAt(i),a=x.get(s);void 0!==a?(n+=e.substring(r,i)+a,r=i+1):(n+=`${e.substring(r,i)}&#x${w(e,i).toString(16)};`,r=P.lastIndex+=Number(55296==(64512&s)))}return n+e.substr(r)}function F(e,t){return function(n){let r,i=0,s="";for(;r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i)}}const U=F(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),H=F(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),G=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),Y=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),q=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function K(e){return e.replace(/"/g,""")}const j=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function V(e,t={}){const n="length"in e?e:[e];let r="";for(let e=0;e`;case c:return function(e){return`\x3c!--${e.data}--\x3e`}(e);case p:return function(e){return``}(e);case l:case h:case u:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=G.get(e.name))&&void 0!==n?n:e.name,e.parent&&Q.has(e.parent.name)&&(t={...t,xmlMode:!1}));!t.xmlMode&&X.has(e.name)&&(t={...t,xmlMode:"foreign"});let r=`<${e.name}`;const i=function(e,t){var n;if(!e)return;const r=!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)?K:t.xmlMode||"utf8"!==t.encodeEntities?B:U;return Object.keys(e).map((n=>{var i,s;const a=null!==(i=e[n])&&void 0!==i?i:"";return"foreign"===t.xmlMode&&(n=null!==(s=Y.get(n))&&void 0!==s?s:n),t.emptyAttrs||t.xmlMode||""!==a?`${n}="${r(a)}"`:n})).join(" ")}(e.attribs,t);i&&(r+=` ${i}`);0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&j.has(e.name))?(t.xmlMode||(r+=" "),r+="/>"):(r+=">",e.children.length>0&&(r+=V(e.children,t)),!t.xmlMode&&j.has(e.name)||(r+=``));return r}(e,t);case a:return function(e,t){var n;let r=e.data||"";!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)||!t.xmlMode&&e.parent&&q.has(e.parent.name)||(r=t.xmlMode||"utf8"!==t.encodeEntities?B(r):H(r));return r}(e,t)}}const Q=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),X=new Set(["svg","math"]);function $(e,t){return V(e,t)}function z(e){return Array.isArray(e)?e.map(z).join(""):k(e)&&!O(e)?z(e.children):b(e)?e.data:""}function J(t){return Array.isArray(t)?t.map(J).join(""):k(t)&&(t.type===e.Tag||S(t))?J(t.children):b(t)?t.data:""}function Z(e){return k(e)?e.children:[]}function ee(e){return e.parent||null}function te(e){const t=ee(e);if(null!=t)return Z(t);const n=[e];let{prev:r,next:i}=e;for(;null!=r;)n.unshift(r),({prev:r}=r);for(;null!=i;)n.push(i),({next:i}=i);return n}function ne(e){let{next:t}=e;for(;null!==t&&!I(t);)({next:t}=t);return t}function re(e){let{prev:t}=e;for(;null!==t&&!I(t);)({prev:t}=t);return t}function ie(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){const t=e.parent.children;t.splice(t.lastIndexOf(e),1)}}function se(e,t,n=!0,r=1/0){return Array.isArray(t)||(t=[t]),ae(e,t,n,r)}function ae(e,t,n,r){const i=[];for(const s of t){if(e(s)&&(i.push(s),--r<=0))break;if(n&&k(s)&&s.children.length>0){const t=ae(e,s.children,n,r);if(i.push(...t),r-=t.length,r<=0)break}}return i}function oe(e,t,n=!0){let r=null;for(let i=0;i0&&(r=oe(e,s.children,!0)))}return r}const ce={tag_name:e=>"function"==typeof e?t=>I(t)&&e(t.name):"*"===e?I:t=>I(t)&&t.name===e,tag_type:e=>"function"==typeof e?t=>e(t.type):t=>t.type===e,tag_contains:e=>"function"==typeof e?t=>b(t)&&e(t.data):t=>b(t)&&t.data===e};function le(e,t){return"function"==typeof t?n=>I(n)&&t(n.attribs[e]):n=>I(n)&&n.attribs[e]===t}function he(e,t){return n=>e(n)||t(n)}function ue(e){const t=Object.keys(e).map((t=>{const n=e[t];return Object.prototype.hasOwnProperty.call(ce,t)?ce[t](n):le(t,n)}));return 0===t.length?null:t.reduce(he)}function pe(e,t,n=!0,r=1/0){return se(ce.tag_name(e),t,n,r)}var fe;function de(e,t){const n=[],r=[];if(e===t)return 0;let i=k(e)?e:e.parent;for(;i;)n.unshift(i),i=i.parent;for(i=k(t)?t:t.parent;i;)r.unshift(i),i=i.parent;const s=Math.min(n.length,r.length);let a=0;for(;ac.indexOf(h)?o===t?fe.FOLLOWING|fe.CONTAINED_BY:fe.FOLLOWING:o===e?fe.PRECEDING|fe.CONTAINS:fe.PRECEDING}function Ee(e){return(e=e.filter(((e,t,n)=>!n.includes(e,t+1)))).sort(((e,t)=>{const n=de(e,t);return n&fe.PRECEDING?-1:n&fe.FOLLOWING?1:0})),e}!function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(fe||(fe={}));const me=["url","type","lang"],Te=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function _e(e){return pe("media:content",e).map((e=>{const{attribs:t}=e,n={medium:t.medium,isDefault:!!t.isDefault};for(const e of me)t[e]&&(n[e]=t[e]);for(const e of Te)t[e]&&(n[e]=parseInt(t[e],10));return t.expression&&(n.expression=t.expression),n}))}function Ae(e,t){return pe(e,t,!0,1)[0]}function ge(e,t,n=!1){return z(pe(e,t,n,1)).trim()}function Ne(e,t,n,r,i=!1){const s=ge(n,r,i);s&&(e[t]=s)}function Ce(e){return"rss"===e||"feed"===e||"rdf:RDF"===e}var Ie,Se=Object.freeze({__proto__:null,isTag:I,isCDATA:S,isText:b,isComment:O,isDocument:L,hasChildren:k,getOuterHTML:$,getInnerHTML:function(e,t){return k(e)?e.children.map((e=>$(e,t))).join(""):""},getText:function e(t){return Array.isArray(t)?t.map(e).join(""):I(t)?"br"===t.name?"\n":e(t.children):S(t)?e(t.children):b(t)?t.data:""},textContent:z,innerText:J,getChildren:Z,getParent:ee,getSiblings:te,getAttributeValue:function(e,t){var n;return null===(n=e.attribs)||void 0===n?void 0:n[t]},hasAttrib:function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},getName:function(e){return e.name},nextElementSibling:ne,prevElementSibling:re,removeElement:ie,replaceElement:function(e,t){const n=t.prev=e.prev;n&&(n.next=t);const r=t.next=e.next;r&&(r.prev=t);const i=t.parent=e.parent;if(i){const n=i.children;n[n.lastIndexOf(e)]=t,e.parent=null}},appendChild:function(e,t){if(ie(t),t.next=null,t.parent=e,e.children.push(t)>1){const n=e.children[e.children.length-2];n.next=t,t.prev=n}else t.prev=null},append:function(e,t){ie(t);const{parent:n}=e,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){const e=n.children;e.splice(e.lastIndexOf(r),0,t)}}else n&&n.children.push(t)},prependChild:function(e,t){if(ie(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){const n=e.children[1];n.prev=t,t.next=n}else t.next=null},prepend:function(e,t){ie(t);const{parent:n}=e;if(n){const r=n.children;r.splice(r.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t},filter:se,find:ae,findOneChild:function(e,t){return t.find(e)},findOne:oe,existsOne:function e(t,n){return n.some((n=>I(n)&&(t(n)||n.children.length>0&&e(t,n.children))))},findAll:function(e,t){var n;const r=[],i=t.filter(I);let s;for(;s=i.shift();){const t=null===(n=s.children)||void 0===n?void 0:n.filter(I);t&&t.length>0&&i.unshift(...t),e(s)&&r.push(s)}return r},testElement:function(e,t){const n=ue(e);return!n||n(t)},getElements:function(e,t,n,r=1/0){const i=ue(e);return i?se(i,t,n,r):[]},getElementById:function(e,t,n=!0){return Array.isArray(t)||(t=[t]),oe(le("id",e),t,n)},getElementsByTagName:pe,getElementsByTagType:function(e,t,n=!0,r=1/0){return se(ce.tag_type(e),t,n,r)},removeSubsets:function(e){let t=e.length;for(;--t>=0;){const n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(let r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e},get DocumentPosition(){return fe},compareDocumentPosition:de,uniqueSort:Ee,getFeed:function(e){const t=Ae(Ce,e);return t?"feed"===t.name?function(e){var t;const n=e.children,r={type:"atom",items:pe("entry",n).map((e=>{var t;const{children:n}=e,r={media:_e(n)};Ne(r,"id","id",n),Ne(r,"title","title",n);const i=null===(t=Ae("link",n))||void 0===t?void 0:t.attribs.href;i&&(r.link=i);const s=ge("summary",n)||ge("content",n);s&&(r.description=s);const a=ge("updated",n);return a&&(r.pubDate=new Date(a)),r}))};Ne(r,"id","id",n),Ne(r,"title","title",n);const i=null===(t=Ae("link",n))||void 0===t?void 0:t.attribs.href;i&&(r.link=i);Ne(r,"description","subtitle",n);const s=ge("updated",n);s&&(r.updated=new Date(s));return Ne(r,"author","email",n,!0),r}(t):function(e){var t,n;const r=null!==(n=null===(t=Ae("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==n?n:[],i={type:e.name.substr(0,3),id:"",items:pe("item",e.children).map((e=>{const{children:t}=e,n={media:_e(t)};Ne(n,"id","guid",t),Ne(n,"title","title",t),Ne(n,"link","link",t),Ne(n,"description","description",t);const r=ge("pubDate",t);return r&&(n.pubDate=new Date(r)),n}))};Ne(i,"title","title",r),Ne(i,"link","link",r),Ne(i,"description","description",r);const s=ge("lastBuildDate",r);s&&(i.updated=new Date(s));return Ne(i,"author","managingEditor",r,!0),i}(t):null}}),be="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Oe(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e)t.push(n);return t}function ye(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n1&&c.shift(),this._hasParentSelector=null;const l=this._trace(c,t,["$"],i,s,n).filter((function(e){return e&&!e.isParentSelector}));return l.length?o||1!==l.length||l[0].hasArrExpr?l.reduce(((e,t)=>{const n=this._getPreferredOutput(t);return a&&Array.isArray(n)?e=e.concat(n):e.push(n),e}),[]):this._getPreferredOutput(l[0]):o?[]:void 0},He.prototype._getPreferredOutput=function(e){const t=this.currResultType;switch(t){case"all":{const t=Array.isArray(e.path)?e.path:He.toPathArray(e.path);return e.pointer=He.toPointer(t),e.path="string"==typeof e.path?e.path:He.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return He.toPathString(e[t]);case"pointer":return He.toPointer(e.path);default:throw new TypeError("Unknown result type")}},He.prototype._handleCallback=function(e,t,n){if(t){const r=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:He.toPathString(e.path),t(r,n,e)}},He.prototype._trace=function(e,t,n,r,i,s,a,o){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:a},this._handleCallback(c,s,"value"),c;const l=e[0],h=e.slice(1),u=[];function p(e){Array.isArray(e)?e.forEach((e=>{u.push(e)})):u.push(e)}if(("string"!=typeof l||o)&&t&&we.call(t,l))p(this._trace(h,t[l],Be(n,l),t,l,s,a));else if("*"===l)this._walk(t,(e=>{p(this._trace(h,t[e],Be(n,e),t,e,s,!0,!0))}));else if(".."===l)p(this._trace(h,t,n,r,i,s,a)),this._walk(t,(r=>{"object"==typeof t[r]&&p(this._trace(e.slice(),t[r],Be(n,r),t,r,s,!0))}));else{if("^"===l)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:h,isParentSelector:!0};if("~"===l)return c={path:Be(n,l),value:i,parent:r,parentProperty:null},this._handleCallback(c,s,"property"),c;if("$"===l)p(this._trace(h,t,n,null,null,s,a));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))p(this._slice(l,h,t,n,r,i,s));else if(0===l.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");const e=l.replace(/^\?\((.*?)\)$/u,"$1");this._walk(t,(a=>{this._eval(e,t[a],a,n,r,i)&&p(this._trace(h,t[a],Be(n,a),t,a,s,!0))}))}else if("("===l[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Fe(this._eval(l,t,n[n.length-1],n.slice(0,-1),r,i),h),t,n,r,i,s,a))}else if("@"===l[0]){let e=!1;const a=l.slice(1,-2);switch(a){case"scalar":t&&["object","function"].includes(typeof t)||(e=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===a&&(e=!0);break;case"integer":!Number.isFinite(t)||t%1||(e=!0);break;case"number":Number.isFinite(t)&&(e=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(e=!0);break;case"object":t&&typeof t===a&&(e=!0);break;case"array":Array.isArray(t)&&(e=!0);break;case"other":e=this.currOtherTypeCallback(t,n,r,i);break;case"null":null===t&&(e=!0);break;default:throw new TypeError("Unknown value type "+a)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,s,"value"),c}else if("`"===l[0]&&t&&we.call(t,l.slice(1))){const e=l.slice(1);p(this._trace(h,t[e],Be(n,e),t,e,s,a,!0))}else if(l.includes(",")){const e=l.split(",");for(const a of e)p(this._trace(Fe(a,h),t,n,r,i,s,!0))}else!o&&t&&we.call(t,l)&&p(this._trace(h,t[l],Be(n,l),t,l,s,a,!0))}if(this._hasParentSelector)for(let e=0;e{t(e)}))},He.prototype._slice=function(e,t,n,r,i,s,a){if(!Array.isArray(n))return;const o=n.length,c=e.split(":"),l=c[2]&&Number.parseInt(c[2])||1;let h=c[0]&&Number.parseInt(c[0])||0,u=c[1]&&Number.parseInt(c[1])||o;h=h<0?Math.max(0,h+o):Math.min(o,h),u=u<0?Math.max(0,u+o):Math.min(o,u);const p=[];for(let e=h;e{p.push(e)}))}return p},He.prototype._eval=function(e,t,n,r,i,s){this.currSandbox._$_parentProperty=s,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;const a=e.includes("@path");a&&(this.currSandbox._$_path=He.toPathString(r.concat([n])));const o="script:"+e;if(!He.cache[o]){let t=e.replace(/@parentProperty/gu,"_$_parentProperty").replace(/@parent/gu,"_$_parent").replace(/@property/gu,"_$_property").replace(/@root/gu,"_$_root").replace(/@([.\s)[])/gu,"_$_v$1");a&&(t=t.replace(/@path/gu,"_$_path")),He.cache[o]=new this.vm.Script(t)}try{return He.cache[o].runInNewContext(this.currSandbox)}catch(t){throw new Error("jsonPath: "+t.message+": "+e)}},He.cache={},He.toPathString=function(e){const t=e,n=t.length;let r="$";for(let e=1;e":">"},i=/[&"'<>]/g,s=e.exports={};function a(e,t){return n.hasOwnProperty.call(e,t)}function o(e){return r[e]}function c(e,t,n){var r,i,s;if(e instanceof Error&&(e=(i=e).name+": "+i.message),Object.setPrototypeOf?(r=new Error(e),Object.setPrototypeOf(r,c.prototype)):(r=this,Object.defineProperty(r,"message",{enumerable:!1,writable:!0,value:e})),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),i){var a=Object.getOwnPropertyDescriptor(i,"stack");(s=a&&(a.get||function(){return a.value}))||(s=function(){return i.stack})}else{var o=new Error(e).stack;s=function(){return o}}return Object.defineProperty(r,"stack",{get:function(){return s.call(r)}}),Object.defineProperty(r,"cause",{value:i}),r.lineno=t,r.colno=n,r.firstUpdate=!0,r.Update=function(e){var t="("+(e||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?t+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(t+=" [Line "+this.lineno+"]")),t+="\n ",this.firstUpdate&&(t+=" "),this.message=t+(this.message||""),this.firstUpdate=!1,this},r}function l(e){return"[object Function]"===n.toString.call(e)}function h(e){return"[object Array]"===n.toString.call(e)}function u(e){return"[object String]"===n.toString.call(e)}function p(e){return"[object Object]"===n.toString.call(e)}function f(e){var t=function(e){return e?"string"==typeof e?e.split("."):[e]:[]}(e);return function(e){for(var n=e,r=0;r1)for(var n=1;n0&&a.length>i){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=a.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(o)}}else a=s[t]=n,++e._eventsCount;return e}function bt(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function Ot(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function yt(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function Lt(){var e;Tt.call(this),this.__emitError=(e=this,function(t){e.emit("error",t)})}function kt(){return new Lt}mt.prototype=Object.create(null),Tt.EventEmitter=Tt,Tt.usingDomains=!1,Tt.prototype.domain=void 0,Tt.prototype._events=void 0,Tt.prototype._maxListeners=void 0,Tt.defaultMaxListeners=10,Tt.init=function(){this.domain=null,Tt.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new mt,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Tt.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Tt.prototype.getMaxListeners=function(){return _t(this)},Tt.prototype.emit=function(e){var t,n,r,i,s,a,o,c="error"===e;if(a=this._events)c=c&&null==a.error;else if(!c)return!1;if(o=this.domain,c){if(t=arguments[1],!o){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=o,t.domainThrown=!1,o.emit("error",t),!1}if(!(n=a[e]))return!1;var h="function"==typeof n;switch(r=arguments.length){case 1:At(n,h,this);break;case 2:gt(n,h,this,arguments[1]);break;case 3:Nt(n,h,this,arguments[1],arguments[2]);break;case 4:Ct(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),s=1;s0;)if(n[s]===t||n[s].listener&&n[s].listener===t){a=n[s].listener,i=s;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new mt,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r0?Reflect.ownKeys(this._events):[]},("function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e})(Lt,Tt),Lt.prototype.add=function(e){e.on("error",this.__emitError)},Lt.prototype.remove=function(e){e.removeListener("error",this.__emitError)},Lt.prototype.bind=function(e){var t=this.__emitError;return function(){var n=Array.prototype.slice.call(arguments);try{e.apply(null,n)}catch(e){t(e)}}},Lt.prototype.intercept=function(e){var t=this.__emitError;return function(n){if(n)t(n);else{var r=Array.prototype.slice.call(arguments,1);try{e.apply(null,r)}catch(n){t(n)}}}},Lt.prototype.run=function(e){var t=this.__emitError;try{e()}catch(e){t(e)}return this},Lt.prototype.dispose=function(){return this.removeAllListeners(),this},Lt.prototype.enter=Lt.prototype.exit=function(){return this};var vt,Dt={Domain:Lt,createDomain:kt,create:kt},Rt="function"==typeof setImmediate,Mt=Pt;function Pt(e){xt.length||(Ut(),wt=!0),xt[xt.length]=e}var xt=[],wt=!1,Bt=0;function Ft(){for(;Bt1024){for(var t=0,n=xt.length-Bt;t=!".indexOf(r)){this.forward();var o,c=["==","===","!=","!==","<=",">=","//","**"],l=r+this.current();switch(-1!==je.indexOf(c,l)&&(this.forward(),r=l,-1!==je.indexOf(c,l+this.current())&&(r=l+this.current(),this.forward())),r){case"(":o="left-paren";break;case")":o="right-paren";break;case"[":o="left-bracket";break;case"]":o="right-bracket";break;case"{":o="left-curly";break;case"}":o="right-curly";break;case",":o="comma";break;case":":o="colon";break;case"~":o="tilde";break;case"|":o="pipe";break;default:o="operator"}return Kt(o,r,t,n)}if((e=this._extractUntil(" \n\t\r ()[]{}%*-+~/#,:|.<>=!")).match(/^[-+]?[0-9]+$/))return"."===this.current()?(this.forward(),Kt("float",e+"."+this._extract("0123456789"),t,n)):Kt("int",e,t,n);if(e.match(/^(true|false)$/))return Kt("boolean",e,t,n);if("none"===e)return Kt("none",e,t,n);if("null"===e)return Kt("none",e,t,n);if(e)return Kt("symbol",e,t,n);throw new Error("Unexpected value while parsing: "+e)}var h,u=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((e=this._extractString(this.tags.BLOCK_START+"-"))||(e=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,Kt("block-start",e,t,n);if((e=this._extractString(this.tags.VARIABLE_START+"-"))||(e=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,Kt("variable-start",e,t,n);e="";var p=!1;for(this._matches(this.tags.COMMENT_START)&&(p=!0,e=this._extractString(this.tags.COMMENT_START));null!==(h=this._extractUntil(u));){if(e+=h,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!p){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=e.length){var f=e.slice(-this.colno);if(/^\s+$/.test(f)&&!(e=e.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!p)throw new Error("unexpected end of comment");e+=this._extractString(this.tags.COMMENT_END);break}e+=this.current(),this.forward()}if(null===h&&p)throw new Error("expected end of comment, got end of file");return Kt(p?"comment":"data",e,t,n)},t._parseString=function(e){this.forward();for(var t="";!this.isFinished()&&this.current()!==e;){var n=this.current();if("\\"===n){switch(this.forward(),this.current()){case"n":t+="\n";break;case"t":t+="\t";break;case"r":t+="\r";break;default:t+=this.current()}this.forward()}else t+=n,this.forward()}return this.forward(),t},t._matches=function(e){return this.index+e.length>this.len?null:this.str.slice(this.index,this.index+e.length)===e},t._extractString=function(e){return this._matches(e)?(this.forwardN(e.length),e):null},t._extractUntil=function(e){return this._extractMatching(!0,e||"")},t._extract=function(e){return this._extractMatching(!1,e)},t._extractMatching=function(e,t){if(this.isFinished())return null;var n=t.indexOf(this.current());if(e&&-1===n||!e&&-1!==n){var r=this.current();this.forward();for(var i=t.indexOf(this.current());(e&&-1===i||!e&&-1!==i)&&!this.isFinished();)r+=this.current(),this.forward(),i=t.indexOf(this.current());return r}return""},t._extractRegex=function(e){var t=this.currentStr().match(e);return t?(this.forwardN(t[0].length),t):null},t.isFinished=function(){return this.index>=this.len},t.forwardN=function(e){for(var t=0;t2?i-2:0),a=2;a0||!n)&&Et.stdout.write(" ".repeat(t));var s=i===r.length-1?"":"\n";Et.stdout.write(""+e+s)}))}var hr={Node:on,Root:hn,NodeList:ln,Value:cn,Literal:un,Symbol:pn,Group:fn,Array:dn,Pair:En,Dict:mn,Output:Un,Capture:Hn,TemplateData:Gn,If:_n,IfAsync:An,InlineIf:gn,For:Nn,AsyncEach:Cn,AsyncAll:In,Macro:Sn,Caller:bn,Import:On,FromImport:yn,FunCall:Ln,Filter:kn,FilterAsync:vn,KeywordArgs:Dn,Block:Rn,Super:Mn,Extends:Pn,Include:xn,Set:wn,Switch:Bn,Case:Fn,LookupVal:Tn,BinOp:qn,In:Kn,Is:jn,Or:Vn,And:Wn,Not:Qn,Add:Xn,Concat:$n,Sub:zn,Mul:Jn,Div:Zn,FloorDiv:er,Mod:tr,Pow:nr,Neg:rr,Pos:ir,Compare:sr,CompareOperand:ar,CallExtension:or,CallExtensionAsync:cr,printNodes:function e(t,n){if(n=n||0,lr(t.typename+": ",n),t instanceof ln)lr("\n"),t.children.forEach((function(t){e(t,n+2)}));else if(t instanceof or)lr(t.extName+"."+t.prop+"\n"),t.args&&e(t.args,n+2),t.contentArgs&&t.contentArgs.forEach((function(t){e(t,n+2)}));else{var r=[],i=null;t.iterFields((function(e,t){e instanceof on?r.push([t,e]):(i=i||{})[t]=e})),i?lr(JSON.stringify(i,null,2)+"\n",null,!0):lr("\n"),r.forEach((function(t){var r=t[0],i=t[1];lr("["+r+"] =>",n+2),e(i,n+4)}))}}};function ur(e,t){return ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ur(e,t)}hr.Node,hr.Root,hr.NodeList,hr.Value,hr.Literal,hr.Group,hr.Pair,hr.Dict,hr.Output,hr.Capture,hr.TemplateData,hr.If,hr.IfAsync,hr.InlineIf,hr.For,hr.AsyncEach,hr.AsyncAll,hr.Macro,hr.Caller,hr.Import,hr.FromImport,hr.FunCall,hr.Filter,hr.FilterAsync,hr.KeywordArgs,hr.Block,hr.Super,hr.Extends,hr.Include,hr.Switch,hr.Case,hr.LookupVal,hr.BinOp,hr.In,hr.Is,hr.Or,hr.And,hr.Not,hr.Add,hr.Concat,hr.Sub,hr.Mul,hr.Div,hr.FloorDiv,hr.Mod,hr.Pow,hr.Neg,hr.Pos,hr.Compare,hr.CompareOperand,hr.CallExtension,hr.CallExtensionAsync,hr.printNodes;var pr=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ur(t,n);var i=r.prototype;return i.init=function(e){this.tokens=e,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},i.nextToken=function(e){var t;if(this.peeked){if(e||this.peeked.type!==Vt.TOKEN_WHITESPACE)return t=this.peeked,this.peeked=null,t;this.peeked=null}if(t=this.tokens.nextToken(),!e)for(;t&&t.type===Vt.TOKEN_WHITESPACE;)t=this.tokens.nextToken();return t},i.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},i.pushToken=function(e){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=e},i.error=function(e,t,n){if(void 0===t||void 0===n){var r=this.peekToken()||{};t=r.lineno,n=r.colno}return void 0!==t&&(t+=1),void 0!==n&&(n+=1),new je.TemplateError(e,t,n)},i.fail=function(e,t,n){throw this.error(e,t,n)},i.skip=function(e){var t=this.nextToken();return!(!t||t.type!==e)||(this.pushToken(t),!1)},i.expect=function(e){var t=this.nextToken();return t.type!==e&&this.fail("expected "+e+", got "+t.type,t.lineno,t.colno),t},i.skipValue=function(e,t){var n=this.nextToken();return!(!n||n.type!==e||n.value!==t)||(this.pushToken(n),!1)},i.skipSymbol=function(e){return this.skipValue(Vt.TOKEN_SYMBOL,e)},i.advanceAfterBlockEnd=function(e){var t;return e||((t=this.peekToken())||this.fail("unexpected end of file"),t.type!==Vt.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),e=this.nextToken().value),(t=this.nextToken())&&t.type===Vt.TOKEN_BLOCK_END?"-"===t.value.charAt(0)&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+e+" statement"),t},i.advanceAfterVariableEnd=function(){var e=this.nextToken();e&&e.type===Vt.TOKEN_VARIABLE_END?this.dropLeadingWhitespace="-"===e.value.charAt(e.value.length-this.tokens.tags.VARIABLE_END.length-1):(this.pushToken(e),this.fail("expected variable end"))},i.parseFor=function(){var e,t,n=this.peekToken();if(this.skipSymbol("for")?(e=new hr.For(n.lineno,n.colno),t="endfor"):this.skipSymbol("asyncEach")?(e=new hr.AsyncEach(n.lineno,n.colno),t="endeach"):this.skipSymbol("asyncAll")?(e=new hr.AsyncAll(n.lineno,n.colno),t="endall"):this.fail("parseFor: expected for{Async}",n.lineno,n.colno),e.name=this.parsePrimary(),e.name instanceof hr.Symbol||this.fail("parseFor: variable name expected for loop"),this.peekToken().type===Vt.TOKEN_COMMA){var r=e.name;for(e.name=new hr.Array(r.lineno,r.colno),e.name.addChild(r);this.skip(Vt.TOKEN_COMMA);){var i=this.parsePrimary();e.name.addChild(i)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',n.lineno,n.colno),e.arr=this.parseExpression(),this.advanceAfterBlockEnd(n.value),e.body=this.parseUntilBlocks(t,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),e.else_=this.parseUntilBlocks(t)),this.advanceAfterBlockEnd(),e},i.parseMacro=function(){var e=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var t=this.parsePrimary(!0),n=this.parseSignature(),r=new hr.Macro(e.lineno,e.colno,t,n);return this.advanceAfterBlockEnd(e.value),r.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),r},i.parseCall=function(){var e=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var t=this.parseSignature(!0)||new hr.NodeList,n=this.parsePrimary();this.advanceAfterBlockEnd(e.value);var r=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var i=new hr.Symbol(e.lineno,e.colno,"caller"),s=new hr.Caller(e.lineno,e.colno,i,t,r),a=n.args.children;return a[a.length-1]instanceof hr.KeywordArgs||a.push(new hr.KeywordArgs),a[a.length-1].addChild(new hr.Pair(e.lineno,e.colno,i,s)),new hr.Output(e.lineno,e.colno,[n])},i.parseWithContext=function(){var e=this.peekToken(),t=null;return this.skipSymbol("with")?t=!0:this.skipSymbol("without")&&(t=!1),null!==t&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",e.lineno,e.colno)),t},i.parseImport=function(){var e=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",e.lineno,e.colno);var t=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',e.lineno,e.colno);var n=this.parseExpression(),r=this.parseWithContext(),i=new hr.Import(e.lineno,e.colno,t,n,r);return this.advanceAfterBlockEnd(e.value),i},i.parseFrom=function(){var e=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var t=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",e.lineno,e.colno);for(var n,r=new hr.NodeList;;){var i=this.peekToken();if(i.type===Vt.TOKEN_BLOCK_END){r.children.length||this.fail("parseFrom: Expected at least one import name",e.lineno,e.colno),"-"===i.value.charAt(0)&&(this.dropLeadingWhitespace=!0),this.nextToken();break}r.children.length>0&&!this.skip(Vt.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var s=this.parsePrimary();if("_"===s.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",s.lineno,s.colno),this.skipSymbol("as")){var a=this.parsePrimary();r.addChild(new hr.Pair(s.lineno,s.colno,s,a))}else r.addChild(s);n=this.parseWithContext()}return new hr.FromImport(e.lineno,e.colno,t,r,n)},i.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var t=new hr.Block(e.lineno,e.colno);t.name=this.parsePrimary(),t.name instanceof hr.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(t.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),t},i.parseExtends=function(){var e="extends",t=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected extends");var n=new hr.Extends(t.lineno,t.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),n},i.parseInclude=function(){var e="include",t=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected include");var n=new hr.Include(t.lineno,t.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),n},i.parseIf=function(){var e,t=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?e=new hr.If(t.lineno,t.colno):this.skipSymbol("ifAsync")?e=new hr.IfAsync(t.lineno,t.colno):this.fail("parseIf: expected if, elif, or elseif",t.lineno,t.colno),e.cond=this.parseExpression(),this.advanceAfterBlockEnd(t.value),e.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":e.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),e.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":e.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return e},i.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var t,n=new hr.Set(e.lineno,e.colno,[]);(t=this.parsePrimary())&&(n.targets.push(t),this.skip(Vt.TOKEN_COMMA)););return this.skipValue(Vt.TOKEN_OPERATOR,"=")?(n.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(Vt.TOKEN_BLOCK_END)?(n.body=new hr.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),n.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),n},i.parseSwitch=function(){var e="switch",t="endswitch",n="case",r="default",i=this.peekToken();this.skipSymbol(e)||this.skipSymbol(n)||this.skipSymbol(r)||this.fail('parseSwitch: expected "switch," "case" or "default"',i.lineno,i.colno);var s=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(n,r,t);var a,o=this.peekToken(),c=[];do{this.skipSymbol(n);var l=this.parseExpression();this.advanceAfterBlockEnd(e);var h=this.parseUntilBlocks(n,r,t);c.push(new hr.Case(o.line,o.col,l,h)),o=this.peekToken()}while(o&&o.value===n);switch(o.value){case r:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(t),this.advanceAfterBlockEnd();break;case t:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new hr.Switch(i.lineno,i.colno,s,c,a)},i.parseStatement=function(){var e=this.peekToken();if(e.type!==Vt.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&-1!==je.indexOf(this.breakOnBlocks,e.value))return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var t=0;t0;){var o=s[0],c=s[1],l=s[2];l===e?r+=1:l===t&&(r-=1),0===r?(i+=c,this.tokens.backN(o.length-c.length)):i+=o}return new hr.Output(a.lineno,a.colno,[new hr.TemplateData(a.lineno,a.colno,i)])},i.parsePostfix=function(e){for(var t,n=this.peekToken();n;){if(n.type===Vt.TOKEN_LEFT_PAREN)e=new hr.FunCall(n.lineno,n.colno,e,this.parseSignature());else if(n.type===Vt.TOKEN_LEFT_BRACKET)(t=this.parseAggregate()).children.length>1&&this.fail("invalid index"),e=new hr.LookupVal(n.lineno,n.colno,e,t.children[0]);else{if(n.type!==Vt.TOKEN_OPERATOR||"."!==n.value)break;this.nextToken();var r=this.nextToken();r.type!==Vt.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+r.value,r.lineno,r.colno),t=new hr.Literal(r.lineno,r.colno,r.value),e=new hr.LookupVal(n.lineno,n.colno,e,t)}n=this.peekToken()}return e},i.parseExpression=function(){return this.parseInlineIf()},i.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var t=this.parseOr(),n=e;(e=new hr.InlineIf(e.lineno,e.colno)).body=n,e.cond=t,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},i.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var t=this.parseAnd();e=new hr.Or(e.lineno,e.colno,e,t)}return e},i.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var t=this.parseNot();e=new hr.And(e.lineno,e.colno,e,t)}return e},i.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new hr.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},i.parseIn=function(){for(var e=this.parseIs();;){var t=this.nextToken();if(!t)break;var n=t.type===Vt.TOKEN_SYMBOL&&"not"===t.value;if(n||this.pushToken(t),!this.skipSymbol("in")){n&&this.pushToken(t);break}var r=this.parseIs();e=new hr.In(e.lineno,e.colno,e,r),n&&(e=new hr.Not(e.lineno,e.colno,e))}return e},i.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var t=this.skipSymbol("not"),n=this.parseCompare();e=new hr.Is(e.lineno,e.colno,e,n),t&&(e=new hr.Not(e.lineno,e.colno,e))}return e},i.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],t=this.parseConcat(),n=[];;){var r=this.nextToken();if(!r)break;if(-1===e.indexOf(r.value)){this.pushToken(r);break}n.push(new hr.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return n.length?new hr.Compare(n[0].lineno,n[0].colno,t,n):t},i.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(Vt.TOKEN_TILDE,"~");){var t=this.parseAdd();e=new hr.Concat(e.lineno,e.colno,e,t)}return e},i.parseAdd=function(){for(var e=this.parseSub();this.skipValue(Vt.TOKEN_OPERATOR,"+");){var t=this.parseSub();e=new hr.Add(e.lineno,e.colno,e,t)}return e},i.parseSub=function(){for(var e=this.parseMul();this.skipValue(Vt.TOKEN_OPERATOR,"-");){var t=this.parseMul();e=new hr.Sub(e.lineno,e.colno,e,t)}return e},i.parseMul=function(){for(var e=this.parseDiv();this.skipValue(Vt.TOKEN_OPERATOR,"*");){var t=this.parseDiv();e=new hr.Mul(e.lineno,e.colno,e,t)}return e},i.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(Vt.TOKEN_OPERATOR,"/");){var t=this.parseFloorDiv();e=new hr.Div(e.lineno,e.colno,e,t)}return e},i.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(Vt.TOKEN_OPERATOR,"//");){var t=this.parseMod();e=new hr.FloorDiv(e.lineno,e.colno,e,t)}return e},i.parseMod=function(){for(var e=this.parsePow();this.skipValue(Vt.TOKEN_OPERATOR,"%");){var t=this.parsePow();e=new hr.Mod(e.lineno,e.colno,e,t)}return e},i.parsePow=function(){for(var e=this.parseUnary();this.skipValue(Vt.TOKEN_OPERATOR,"**");){var t=this.parseUnary();e=new hr.Pow(e.lineno,e.colno,e,t)}return e},i.parseUnary=function(e){var t,n=this.peekToken();return t=this.skipValue(Vt.TOKEN_OPERATOR,"-")?new hr.Neg(n.lineno,n.colno,this.parseUnary(!0)):this.skipValue(Vt.TOKEN_OPERATOR,"+")?new hr.Pos(n.lineno,n.colno,this.parseUnary(!0)):this.parsePrimary(),e||(t=this.parseFilter(t)),t},i.parsePrimary=function(e){var t,n=this.nextToken(),r=null;if(n?n.type===Vt.TOKEN_STRING?t=n.value:n.type===Vt.TOKEN_INT?t=parseInt(n.value,10):n.type===Vt.TOKEN_FLOAT?t=parseFloat(n.value):n.type===Vt.TOKEN_BOOLEAN?"true"===n.value?t=!0:"false"===n.value?t=!1:this.fail("invalid boolean: "+n.value,n.lineno,n.colno):n.type===Vt.TOKEN_NONE?t=null:n.type===Vt.TOKEN_REGEX&&(t=new RegExp(n.value.body,n.value.flags)):this.fail("expected expression, got end of file"),void 0!==t?r=new hr.Literal(n.lineno,n.colno,t):n.type===Vt.TOKEN_SYMBOL?r=new hr.Symbol(n.lineno,n.colno,n.value):(this.pushToken(n),r=this.parseAggregate()),e||(r=this.parsePostfix(r)),r)return r;throw this.error("unexpected token: "+n.value,n.lineno,n.colno)},i.parseFilterName=function(){for(var e=this.expect(Vt.TOKEN_SYMBOL),t=e.value;this.skipValue(Vt.TOKEN_OPERATOR,".");)t+="."+this.expect(Vt.TOKEN_SYMBOL).value;return new hr.Symbol(e.lineno,e.colno,t)},i.parseFilterArgs=function(e){return this.peekToken().type===Vt.TOKEN_LEFT_PAREN?this.parsePostfix(e).args.children:[]},i.parseFilter=function(e){for(;this.skip(Vt.TOKEN_PIPE);){var t=this.parseFilterName();e=new hr.Filter(t.lineno,t.colno,t,new hr.NodeList(t.lineno,t.colno,[e].concat(this.parseFilterArgs(e))))}return e},i.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var t=this.parseFilterName(),n=this.parseFilterArgs(t);this.advanceAfterBlockEnd(e.value);var r=new hr.Capture(t.lineno,t.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var i=new hr.Filter(t.lineno,t.colno,t,new hr.NodeList(t.lineno,t.colno,[r].concat(n)));return new hr.Output(t.lineno,t.colno,[i])},i.parseAggregate=function(){var e,t=this.nextToken();switch(t.type){case Vt.TOKEN_LEFT_PAREN:e=new hr.Group(t.lineno,t.colno);break;case Vt.TOKEN_LEFT_BRACKET:e=new hr.Array(t.lineno,t.colno);break;case Vt.TOKEN_LEFT_CURLY:e=new hr.Dict(t.lineno,t.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===Vt.TOKEN_RIGHT_PAREN||n===Vt.TOKEN_RIGHT_BRACKET||n===Vt.TOKEN_RIGHT_CURLY){this.nextToken();break}if(e.children.length>0&&(this.skip(Vt.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",t.lineno,t.colno)),e instanceof hr.Dict){var r=this.parsePrimary();this.skip(Vt.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",t.lineno,t.colno);var i=this.parseExpression();e.addChild(new hr.Pair(r.lineno,r.colno,r,i))}else{var s=this.parseExpression();e.addChild(s)}}return e},i.parseSignature=function(e,t){var n=this.peekToken();if(!t&&n.type!==Vt.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===Vt.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var r=new hr.NodeList(n.lineno,n.colno),i=new hr.KeywordArgs(n.lineno,n.colno),s=!1;;){if(n=this.peekToken(),!t&&n.type===Vt.TOKEN_RIGHT_PAREN){this.nextToken();break}if(t&&n.type===Vt.TOKEN_BLOCK_END)break;if(s&&!this.skip(Vt.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var a=this.parseExpression();this.skipValue(Vt.TOKEN_OPERATOR,"=")?i.addChild(new hr.Pair(a.lineno,a.colno,a,this.parseExpression())):r.addChild(a)}s=!0}return i.children.length&&r.addChild(i),r},i.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,t=arguments.length,n=new Array(t),r=0;re.length)a=i.slice(0,e.length),i.slice(a.length,o).forEach((function(e,n){n":">","<=":"<=",">=":">="},Pr=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,vr(t,n);var i=r.prototype;return i.init=function(e,t){this.templateName=e,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=t},i.fail=function(e,t,n){throw void 0!==t&&(t+=1),void 0!==n&&(n+=1),new Dr(e,t,n)},i._pushBuffer=function(){var e=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=e,this._emit("var "+this.buffer+' = "";'),e},i._popBuffer=function(){this.buffer=this.bufferStack.pop()},i._emit=function(e){this.codebuf.push(e)},i._emitLine=function(e){this._emit(e+"\n")},i._emitLines=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r0&&i._emit(","),i.compile(e,t)})),r&&this._emit(r)},i._compileExpression=function(e,t){this.assertType(e,hr.Literal,hr.Symbol,hr.Group,hr.Array,hr.Dict,hr.FunCall,hr.Caller,hr.Filter,hr.LookupVal,hr.Compare,hr.InlineIf,hr.In,hr.Is,hr.And,hr.Or,hr.Not,hr.Add,hr.Concat,hr.Sub,hr.Mul,hr.Div,hr.FloorDiv,hr.Mod,hr.Pow,hr.Neg,hr.Pos,hr.Compare,hr.NodeList),this.compile(e,t)},i.assertType=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&r._emit(","),e){r._emitLine("function(cb) {"),r._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var i=r._pushBuffer();r._withScopedSyntax((function(){r.compile(e,t),r._emitLine("cb(null, "+i+");")})),r._popBuffer(),r._emitLine("return "+i+";"),r._emitLine("}")}else r._emit("null")})),n){var o=this._tmpid();this._emitLine(", "+this._makeCallback(o)),this._emitLine(this.buffer+" += runtime.suppressValue("+o+", "+a+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+a+" && env.opts.autoescape);\n")},i.compileCallExtensionAsync=function(e,t){this.compileCallExtension(e,t,!0)},i.compileNodeList=function(e,t){this._compileChildren(e,t)},i.compileLiteral=function(e){if("string"==typeof e.value){var t=e.value.replace(/\\/g,"\\\\");t=(t=(t=(t=(t=t.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this._emit('"'+t+'"')}else null===e.value?this._emit("null"):this._emit(e.value.toString())},i.compileSymbol=function(e,t){var n=e.value,r=t.lookup(n);r?this._emit(r):this._emit('runtime.contextOrFrameLookup(context, frame, "'+n+'")')},i.compileGroup=function(e,t){this._compileAggregate(e,t,"(",")")},i.compileArray=function(e,t){this._compileAggregate(e,t,"[","]")},i.compileDict=function(e,t){this._compileAggregate(e,t,"{","}")},i.compilePair=function(e,t){var n=e.key,r=e.value;n instanceof hr.Symbol?n=new hr.Literal(n.lineno,n.colno,n.value):n instanceof hr.Literal&&"string"==typeof n.value||this.fail("compilePair: Dict keys must be strings or names",n.lineno,n.colno),this.compile(n,t),this._emit(": "),this._compileExpression(r,t)},i.compileInlineIf=function(e,t){this._emit("("),this.compile(e.cond,t),this._emit("?"),this.compile(e.body,t),this._emit(":"),null!==e.else_?this.compile(e.else_,t):this._emit('""'),this._emit(")")},i.compileIn=function(e,t){this._emit("runtime.inOperator("),this.compile(e.left,t),this._emit(","),this.compile(e.right,t),this._emit(")")},i.compileIs=function(e,t){var n=e.right.name?e.right.name.value:e.right.value;this._emit('env.getTest("'+n+'").call(context, '),this.compile(e.left,t),e.right.args&&(this._emit(","),this.compile(e.right.args,t)),this._emit(") === true")},i._binOpEmitter=function(e,t,n){this.compile(e.left,t),this._emit(n),this.compile(e.right,t)},i.compileOr=function(e,t){return this._binOpEmitter(e,t," || ")},i.compileAnd=function(e,t){return this._binOpEmitter(e,t," && ")},i.compileAdd=function(e,t){return this._binOpEmitter(e,t," + ")},i.compileConcat=function(e,t){return this._binOpEmitter(e,t,' + "" + ')},i.compileSub=function(e,t){return this._binOpEmitter(e,t," - ")},i.compileMul=function(e,t){return this._binOpEmitter(e,t," * ")},i.compileDiv=function(e,t){return this._binOpEmitter(e,t," / ")},i.compileMod=function(e,t){return this._binOpEmitter(e,t," % ")},i.compileNot=function(e,t){this._emit("!"),this.compile(e.target,t)},i.compileFloorDiv=function(e,t){this._emit("Math.floor("),this.compile(e.left,t),this._emit(" / "),this.compile(e.right,t),this._emit(")")},i.compilePow=function(e,t){this._emit("Math.pow("),this.compile(e.left,t),this._emit(", "),this.compile(e.right,t),this._emit(")")},i.compileNeg=function(e,t){this._emit("-"),this.compile(e.target,t)},i.compilePos=function(e,t){this._emit("+"),this.compile(e.target,t)},i.compileCompare=function(e,t){var n=this;this.compile(e.expr,t),e.ops.forEach((function(e){n._emit(" "+Mr[e.type]+" "),n.compile(e.expr,t)}))},i.compileLookupVal=function(e,t){this._emit("runtime.memberLookup(("),this._compileExpression(e.target,t),this._emit("),"),this._compileExpression(e.val,t),this._emit(")")},i._getNodeName=function(e){switch(e.typename){case"Symbol":return e.value;case"FunCall":return"the return value of ("+this._getNodeName(e.name)+")";case"LookupVal":return this._getNodeName(e.target)+'["'+this._getNodeName(e.val)+'"]';case"Literal":return e.value.toString();default:return"--expression--"}},i.compileFunCall=function(e,t){this._emit("(lineno = "+e.lineno+", colno = "+e.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(e.name,t),this._emit(', "'+this._getNodeName(e.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(e.args,t,"[","])"),this._emit(")")},i.compileFilter=function(e,t){var n=e.name;this.assertType(n,hr.Symbol),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emit(")")},i.compileFilterAsync=function(e,t){var n=e.name,r=e.symbol.value;this.assertType(n,hr.Symbol),t.set(r,r),this._emit('env.getFilter("'+n.value+'").call(context, '),this._compileAggregate(e.args,t),this._emitLine(", "+this._makeCallback(r)),this._addScopeLevel()},i.compileKeywordArgs=function(e,t){this._emit("runtime.makeKeywordArgs("),this.compileDict(e,t),this._emit(")")},i.compileSet=function(e,t){var n=this,r=[];e.targets.forEach((function(e){var i=e.value,s=t.lookup(i);null==s&&(s=n._tmpid(),n._emitLine("var "+s+";")),r.push(s)})),e.value?(this._emit(r.join(" = ")+" = "),this._compileExpression(e.value,t),this._emitLine(";")):(this._emit(r.join(" = ")+" = "),this.compile(e.body,t),this._emitLine(";")),e.targets.forEach((function(e,t){var i=r[t],s=e.value;n._emitLine('frame.set("'+s+'", '+i+", true);"),n._emitLine("if(frame.topLevel) {"),n._emitLine('context.setVariable("'+s+'", '+i+");"),n._emitLine("}"),"_"!==s.charAt(0)&&(n._emitLine("if(frame.topLevel) {"),n._emitLine('context.addExport("'+s+'", '+i+");"),n._emitLine("}"))}))},i.compileSwitch=function(e,t){var n=this;this._emit("switch ("),this.compile(e.expr,t),this._emit(") {"),e.cases.forEach((function(e,r){n._emit("case "),n.compile(e.cond,t),n._emit(": "),n.compile(e.body,t),e.body.children.length&&n._emitLine("break;")})),e.default&&(this._emit("default:"),this.compile(e.default,t)),this._emit("}")},i.compileIf=function(e,t,n){var r=this;this._emit("if("),this._compileExpression(e.cond,t),this._emitLine(") {"),this._withScopedSyntax((function(){r.compile(e.body,t),n&&r._emit("cb()")})),e.else_?(this._emitLine("}\nelse {"),this._withScopedSyntax((function(){r.compile(e.else_,t),n&&r._emit("cb()")}))):n&&(this._emitLine("}\nelse {"),this._emit("cb()")),this._emitLine("}")},i.compileIfAsync=function(e,t){this._emit("(function(cb) {"),this.compileIf(e,t,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},i._emitLoopBindings=function(e,t,n,r){var i=this;[{name:"index",val:n+" + 1"},{name:"index0",val:n},{name:"revindex",val:r+" - "+n},{name:"revindex0",val:r+" - "+n+" - 1"},{name:"first",val:n+" === 0"},{name:"last",val:n+" === "+r+" - 1"},{name:"length",val:r}].forEach((function(e){i._emitLine('frame.set("loop.'+e.name+'", '+e.val+");")}))},i.compileFor=function(e,t){var n=this,r=this._tmpid(),i=this._tmpid(),s=this._tmpid();if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+s+" = "),this._compileExpression(e.arr,t),this._emitLine(";"),this._emit("if("+s+") {"),this._emitLine(s+" = runtime.fromIterator("+s+");"),e.name instanceof hr.Array){this._emitLine("var "+r+";"),this._emitLine("if(runtime.isArray("+s+")) {"),this._emitLine("var "+i+" = "+s+".length;"),this._emitLine("for("+r+"=0; "+r+" < "+s+".length; "+r+"++) {"),e.name.children.forEach((function(i,a){var o=n._tmpid();n._emitLine("var "+o+" = "+s+"["+r+"]["+a+"];"),n._emitLine('frame.set("'+i+'", '+s+"["+r+"]["+a+"]);"),t.set(e.name.children[a].value,o)})),this._emitLoopBindings(e,s,r,i),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("} else {");var a=e.name.children,o=a[0],c=a[1],l=this._tmpid(),h=this._tmpid();t.set(o.value,l),t.set(c.value,h),this._emitLine(r+" = -1;"),this._emitLine("var "+i+" = runtime.keys("+s+").length;"),this._emitLine("for(var "+l+" in "+s+") {"),this._emitLine(r+"++;"),this._emitLine("var "+h+" = "+s+"["+l+"];"),this._emitLine('frame.set("'+o.value+'", '+l+");"),this._emitLine('frame.set("'+c.value+'", '+h+");"),this._emitLoopBindings(e,s,r,i),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}"),this._emitLine("}")}else{var u=this._tmpid();t.set(e.name.value,u),this._emitLine("var "+i+" = "+s+".length;"),this._emitLine("for(var "+r+"=0; "+r+" < "+s+".length; "+r+"++) {"),this._emitLine("var "+u+" = "+s+"["+r+"];"),this._emitLine('frame.set("'+e.name.value+'", '+u+");"),this._emitLoopBindings(e,s,r,i),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("}")}this._emitLine("}"),e.else_&&(this._emitLine("if (!"+i+") {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},i._compileAsyncLoop=function(e,t,n){var r=this,i=this._tmpid(),s=this._tmpid(),a=this._tmpid(),o=n?"asyncAll":"asyncEach";if(t=t.push(),this._emitLine("frame = frame.push();"),this._emit("var "+a+" = runtime.fromIterator("),this._compileExpression(e.arr,t),this._emitLine(");"),e.name instanceof hr.Array){var c=e.name.children.length;this._emit("runtime."+o+"("+a+", "+c+", function("),e.name.children.forEach((function(e){r._emit(e.value+",")})),this._emit(i+","+s+",next) {"),e.name.children.forEach((function(e){var n=e.value;t.set(n,n),r._emitLine('frame.set("'+n+'", '+n+");")}))}else{var l=e.name.value;this._emitLine("runtime."+o+"("+a+", 1, function("+l+", "+i+", "+s+",next) {"),this._emitLine('frame.set("'+l+'", '+l+");"),t.set(l,l)}this._emitLoopBindings(e,a,i,s),this._withScopedSyntax((function(){var s;n&&(s=r._pushBuffer()),r.compile(e.body,t),r._emitLine("next("+i+(s?","+s:"")+");"),n&&r._popBuffer()}));var h=this._tmpid();this._emitLine("}, "+this._makeCallback(h)),this._addScopeLevel(),n&&this._emitLine(this.buffer+" += "+h+";"),e.else_&&(this._emitLine("if (!"+a+".length) {"),this.compile(e.else_,t),this._emitLine("}")),this._emitLine("frame = frame.pop();")},i.compileAsyncEach=function(e,t){this._compileAsyncLoop(e,t)},i.compileAsyncAll=function(e,t){this._compileAsyncLoop(e,t,!0)},i._compileMacro=function(e,t){var n=this,r=[],i=null,s="macro_"+this._tmpid(),a=void 0!==t;e.args.children.forEach((function(t,s){s===e.args.children.length-1&&t instanceof hr.Dict?i=t:(n.assertType(t,hr.Symbol),r.push(t))}));var o,c=[].concat(r.map((function(e){return"l_"+e.value})),["kwargs"]),l=r.map((function(e){return'"'+e.value+'"'})),h=(i&&i.children||[]).map((function(e){return'"'+e.key.value+'"'}));o=a?t.push(!0):new Rr,this._emitLines("var "+s+" = runtime.makeMacro(","["+l.join(", ")+"], ","["+h.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(a?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach((function(e){n._emitLine('frame.set("'+e.value+'", l_'+e.value+");"),o.set(e.value,"l_"+e.value)})),i&&i.children.forEach((function(e){var t=e.key.value;n._emit('frame.set("'+t+'", '),n._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+t+'")'),n._emit(' ? kwargs["'+t+'"] : '),n._compileExpression(e.value,o),n._emit(");")}));var u=this._pushBuffer();return this._withScopedSyntax((function(){n.compile(e.body,o)})),this._emitLine("frame = "+(a?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+u+");"),this._emitLine("});"),this._popBuffer(),s},i.compileMacro=function(e,t){var n=this._compileMacro(e),r=e.name.value;t.set(r,n),t.parent?this._emitLine('frame.set("'+r+'", '+n+");"):("_"!==e.name.value.charAt(0)&&this._emitLine('context.addExport("'+r+'");'),this._emitLine('context.setVariable("'+r+'", '+n+");"))},i.compileCaller=function(e,t){this._emit("(function (){");var n=this._compileMacro(e,t);this._emit("return "+n+";})()")},i._compileGetTemplate=function(e,t,n,r){var i=this._tmpid(),s=this._templateName(),a=this._makeCallback(i),o=n?"true":"false",c=r?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(e.template,t),this._emitLine(", "+o+", "+s+", "+c+", "+a),i},i.compileImport=function(e,t){var n=e.target.value,r=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),t.set(n,r),t.parent?this._emitLine('frame.set("'+n+'", '+r+");"):this._emitLine('context.setVariable("'+n+'", '+r+");")},i.compileFromImport=function(e,t){var n=this,r=this._compileGetTemplate(e,t,!1,!1);this._addScopeLevel(),this._emitLine(r+".getExported("+(e.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(r)),this._addScopeLevel(),e.names.children.forEach((function(e){var i,s,a=n._tmpid();e instanceof hr.Pair?(i=e.key.value,s=e.value.value):s=i=e.value,n._emitLine("if(Object.prototype.hasOwnProperty.call("+r+', "'+i+'")) {'),n._emitLine("var "+a+" = "+r+"."+i+";"),n._emitLine("} else {"),n._emitLine("cb(new Error(\"cannot import '"+i+"'\")); return;"),n._emitLine("}"),t.set(s,a),t.parent?n._emitLine('frame.set("'+s+'", '+a+");"):n._emitLine('context.setVariable("'+s+'", '+a+");")}))},i.compileBlock=function(e){var t=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+e.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(t)),this._emitLine(this.buffer+" += "+t+";"),this._addScopeLevel()},i.compileSuper=function(e,t){var n=e.blockName.value,r=e.symbol.value,i=this._makeCallback(r);this._emitLine('context.getSuper(env, "'+n+'", b_'+n+", frame, runtime, "+i),this._emitLine(r+" = runtime.markSafe("+r+");"),this._addScopeLevel(),t.set(r,r)},i.compileExtends=function(e,t){var n=this._tmpid(),r=this._compileGetTemplate(e,t,!0,!1);this._emitLine("parentTemplate = "+r),this._emitLine("for(var "+n+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+n+", parentTemplate.blocks["+n+"]);"),this._emitLine("}"),this._addScopeLevel()},i.compileInclude=function(e,t){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var n=this._compileGetTemplate(e,t,!1,e.ignoreMissing);this._emitLine("callback(null,"+n+");});"),this._emitLine("});");var r=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(r)),this._emitLine("callback(null,"+r+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},i.compileTemplateData=function(e,t){this.compileLiteral(e,t)},i.compileCapture=function(e,t){var n=this,r=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax((function(){n.compile(e.body,t)})),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=r},i.compileOutput=function(e,t){var n=this;e.children.forEach((function(r){r instanceof hr.TemplateData?r.value&&(n._emit(n.buffer+" += "),n.compileLiteral(r,t),n._emitLine(";")):(n._emit(n.buffer+" += runtime.suppressValue("),n.throwOnUndefined&&n._emit("runtime.ensureDefined("),n.compile(r,t),n.throwOnUndefined&&n._emit(","+e.lineno+","+e.colno+")"),n._emit(", env.opts.autoescape);\n"))}))},i.compileRoot=function(e,t){var n=this;t&&this.fail("compileRoot: root node can't have frame"),t=new Rr,this._emitFuncBegin(e,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(e,t),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var r=[],i=e.findAll(hr.Block);i.forEach((function(e,t){var i=e.name.value;if(-1!==r.indexOf(i))throw new Error('Block "'+i+'" defined more than once.');r.push(i),n._emitFuncBegin(e,"b_"+i);var s=new Rr;n._emitLine("var frame = frame.push(true);"),n.compile(e.body,s),n._emitFuncEnd()})),this._emitLine("return {"),i.forEach((function(e,t){var r="b_"+e.name.value;n._emitLine(r+": "+r+",")})),this._emitLine("root: root\n};")},i.compile=function(e,t){var n=this["compile"+e.typename];n?n.call(this,e,t):this.fail("compile: Cannot compile node: "+e.typename,e.lineno,e.colno)},i.getCode=function(){return this.codebuf.join("")},r}(en.Obj),xr={compile:function(e,t,n,r,i){void 0===i&&(i={});var s=new Pr(r,i.throwOnUndefined),a=(n||[]).map((function(e){return e.preprocess})).filter((function(e){return!!e})).reduce((function(e,t){return t(e)}),e);return s.compile(Nr.transform(fr.parse(a,n,i),t,r)),s.getCode()},Compiler:Pr},wr=Ke((function(e){var t=e.exports={};function n(e,t){return null==e||!1===e?t:e}function r(e){return e!=e}function i(e){var t=(e=n(e,"")).toLowerCase();return kr.copySafeness(e,t.charAt(0).toUpperCase()+t.slice(1))}function s(e){if(je.isString(e))return e.split("");if(je.isObject(e))return je._entries(e||{}).map((function(e){return{key:e[0],value:e[1]}}));if(je.isArray(e))return e;throw new je.TemplateError("list filter: type not iterable")}function a(e){return function(t,n,r){void 0===n&&(n="truthy");var i=this,s=i.env.getTest(n);return je.toArray(t).filter((function(t){return s.call(i,t,r)===e}))}}function o(e){return kr.copySafeness(e,e.replace(/^\s*|\s*$/g,""))}t.abs=Math.abs,t.batch=function(e,t,n){var r,i=[],s=[];for(r=0;r=t)return e;var r=t-e.length,i=je.repeat(" ",r/2-r%2),s=je.repeat(" ",r/2);return kr.copySafeness(e,i+e+s)},t.default=function(e,t,n){return n?e||t:void 0!==e?e:t},t.dictsort=function(e,t,n){if(!je.isObject(e))throw new je.TemplateError("dictsort filter: val must be an object");var r,i=[];for(var s in e)i.push([s,e[s]]);if(void 0===n||"key"===n)r=0;else{if("value"!==n)throw new je.TemplateError("dictsort filter: You can only sort by either key or value");r=1}return i.sort((function(e,n){var i=e[r],s=n[r];return t||(je.isString(i)&&(i=i.toUpperCase()),je.isString(s)&&(s=s.toUpperCase())),i>s?1:i===s?0:-1})),i},t.dump=function(e,t){return JSON.stringify(e,null,t)},t.escape=function(e){return e instanceof kr.SafeString?e:(e=null==e?"":e,kr.markSafe(je.escape(e.toString())))},t.safe=function(e){return e instanceof kr.SafeString?e:(e=null==e?"":e,kr.markSafe(e.toString()))},t.first=function(e){return e[0]},t.forceescape=function(e){return e=null==e?"":e,kr.markSafe(je.escape(e.toString()))},t.groupby=function(e,t){return je.groupBy(e,t,this.env.opts.throwOnUndefined)},t.indent=function(e,t,r){if(""===(e=n(e,"")))return"";t=t||4;var i=e.split("\n"),s=je.repeat(" ",t),a=i.map((function(e,t){return 0!==t||r?""+s+e:e})).join("\n");return kr.copySafeness(e,a)},t.join=function(e,t,n){return t=t||"",n&&(e=je.map(e,(function(e){return e[n]}))),e.join(t)},t.last=function(e){return e[e.length-1]},t.length=function(e){var t=n(e,"");return void 0!==t?"function"==typeof Map&&t instanceof Map||"function"==typeof Set&&t instanceof Set?t.size:!je.isObject(t)||t instanceof kr.SafeString?t.length:je.keys(t).length:0},t.list=s,t.lower=function(e){return(e=n(e,"")).toLowerCase()},t.nl2br=function(e){return null==e?"":kr.copySafeness(e,e.replace(/\r\n|\n/g,"
\n"))},t.random=function(e){return e[Math.floor(Math.random()*e.length)]},t.reject=a(!1),t.rejectattr=function(e,t){return e.filter((function(e){return!e[t]}))},t.select=a(!0),t.selectattr=function(e,t){return e.filter((function(e){return!!e[t]}))},t.replace=function(e,t,n,r){var i=e;if(t instanceof RegExp)return e.replace(t,n);void 0===r&&(r=-1);var s="";if("number"==typeof t)t=""+t;else if("string"!=typeof t)return e;if("number"==typeof e&&(e=""+e),"string"!=typeof e&&!(e instanceof kr.SafeString))return e;if(""===t)return s=n+e.split("").join(n)+n,kr.copySafeness(e,s);var a=e.indexOf(t);if(0===r||-1===a)return e;for(var o=0,c=0;a>-1&&(-1===r||c=i&&h.push(n),s.push(h)}return s},t.sum=function(e,t,n){return void 0===n&&(n=0),t&&(e=je.map(e,(function(e){return e[t]}))),n+e.reduce((function(e,t){return e+t}),0)},t.sort=kr.makeMacro(["value","reverse","case_sensitive","attribute"],[],(function(e,t,n,r){var i=this,s=je.map(e,(function(e){return e})),a=je.getAttrGetter(r);return s.sort((function(e,s){var o=r?a(e):e,c=r?a(s):s;if(i.env.opts.throwOnUndefined&&r&&(void 0===o||void 0===c))throw new TypeError('sort: attribute "'+r+'" resolved to undefined');return!n&&je.isString(o)&&je.isString(c)&&(o=o.toLowerCase(),c=c.toLowerCase()),oc?t?-1:1:0})),s})),t.string=function(e){return kr.copySafeness(e,e)},t.striptags=function(e,t){var r=o((e=n(e,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|/gi,"")),i="";return i=t?r.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):r.replace(/\s+/gi," "),kr.copySafeness(e,i)},t.title=function(e){var t=(e=n(e,"")).split(" ").map((function(e){return i(e)}));return kr.copySafeness(e,t.join(" "))},t.trim=o,t.truncate=function(e,t,r,i){var s=e;if(t=t||255,(e=n(e,"")).length<=t)return e;if(r)e=e.substring(0,t);else{var a=e.lastIndexOf(" ",t);-1===a&&(a=t),e=e.substring(0,a)}return e+=null!=i?i:"...",kr.copySafeness(s,e)},t.upper=function(e){return(e=n(e,"")).toUpperCase()},t.urlencode=function(e){var t=encodeURIComponent;return je.isString(e)?t(e):(je.isArray(e)?e:je._entries(e)).map((function(e){var n=e[0],r=e[1];return t(n)+"="+t(r)})).join("&")};var c=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,l=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,h=/^https?:\/\/.*$/,u=/^www\./,p=/\.(?:org|net|com)(?:\:|\/|$)/;t.urlize=function(e,t,n){r(t)&&(t=1/0);var i=!0===n?' rel="nofollow"':"";return e.split(/(\s+)/).filter((function(e){return e&&e.length})).map((function(e){var n=e.match(c),r=n?n[1]:e,s=r.substr(0,t);return h.test(r)?'"+s+"":u.test(r)?'"+s+"":l.test(r)?''+r+"":p.test(r)?'"+s+"":e})).join("")},t.wordcount=function(e){var t=(e=n(e,""))?e.match(/\w+/g):null;return t?t.length:null},t.float=function(e,t){var n=parseFloat(e);return r(n)?t:n};var f=kr.makeMacro(["value","default","base"],[],(function(e,t,n){void 0===n&&(n=10);var i=parseInt(e,n);return r(i)?t:i}));t.int=f,t.d=t.default,t.e=t.escape})),Br={};function Fr(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var Ur=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Hr=function(e){return Ur.exec(e).slice(1)};function Gr(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=Fr(jr(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function Yr(e){var t=qr(e),n="/"===Vr(e,-1);return(e=Fr(jr(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function qr(e){return"/"===e.charAt(0)}var Kr={extname:function(e){return Hr(e)[3]},basename:function(e,t){var n=Hr(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=Hr(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=Gr(e).substr(1),t=Gr(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),s=Math.min(r.length,i.length),a=s,o=0;o=t},t.greaterthan=function(e,t){return e>t},t.gt=t.greaterthan,t.le=function(e,t){return e<=t},t.lessthan=function(e,t){return e=e.length&&(t=0),this.current=e[t],this.current}}}ni.callable,ni.defined,ni.divisibleby,ni.escaped,ni.equalto,ni.eq,ni.sameas,ni.even,ni.falsy,ni.ge,ni.greaterthan,ni.gt,ni.le,ni.lessthan,ni.lt,ni.lower,ni.ne,ni.number,ni.odd,ni.string,ni.truthy,ni.undefined,ni.upper,ni.iterable,ni.mapping;var ii=function(){return{range:function(e,t,n){void 0===t?(t=e,e=0,n=1):n||(n=1);var r=[];if(n>0)for(var i=e;it;s+=n)r.push(s);return r},cycler:function(){return ri(Array.prototype.slice.call(arguments))},joiner:function(e){return function(e){e=e||",";var t=!0;return function(){var n=t?"":e;return t=!1,n}}(e)}}};function si(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ai(e,t)}function ai(e,t){return ai=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ai(e,t)}var oi=ti.FileSystemLoader,ci=ti.WebLoader,li=ti.PrecompiledLoader,hi=en.Obj,ui=en.EmitterObj,pi=kr.handleError,fi=kr.Frame;function di(e,t,n){Gt((function(){e(t,n)}))}var Ei={type:"code",obj:{root:function(e,t,n,r,i){try{i(null,"")}catch(e){i(pi(e,null,null))}}}},mi=function(e){function t(){return e.apply(this,arguments)||this}si(t,e);var n=t.prototype;return n.init=function(e,t){var n=this;t=this.opts=t||{},this.opts.dev=!!t.dev,this.opts.autoescape=null==t.autoescape||t.autoescape,this.opts.throwOnUndefined=!!t.throwOnUndefined,this.opts.trimBlocks=!!t.trimBlocks,this.opts.lstripBlocks=!!t.lstripBlocks,this.loaders=[],e?this.loaders=je.isArray(e)?e:[e]:oi?this.loaders=[new oi("views")]:ci&&(this.loaders=[new ci("/views")]),"undefined"!=typeof window&&window.jinja2Precompiled&&this.loaders.unshift(new li(window.jinja2Precompiled)),this._initLoaders(),this.globals=ii(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],je._entries(wr).forEach((function(e){var t=e[0],r=e[1];return n.addFilter(t,r)})),je._entries(ni).forEach((function(e){var t=e[0],r=e[1];return n.addTest(t,r)}))},n._initLoaders=function(){var e=this;this.loaders.forEach((function(t){t.cache={},"function"==typeof t.on&&(t.on("update",(function(n,r){t.cache[n]=null,e.emit("update",n,r,t)})),t.on("load",(function(n,r){e.emit("load",n,r,t)})))}))},n.invalidateCache=function(){this.loaders.forEach((function(e){e.cache={}}))},n.addExtension=function(e,t){return t.__name=e,this.extensions[e]=t,this.extensionsList.push(t),this},n.removeExtension=function(e){var t=this.getExtension(e);t&&(this.extensionsList=je.without(this.extensionsList,t),delete this.extensions[e])},n.getExtension=function(e){return this.extensions[e]},n.hasExtension=function(e){return!!this.extensions[e]},n.addGlobal=function(e,t){return this.globals[e]=t,this},n.getGlobal=function(e){if(void 0===this.globals[e])throw new Error("global not found: "+e);return this.globals[e]},n.addFilter=function(e,t,n){var r=t;return n&&this.asyncFilters.push(e),this.filters[e]=r,this},n.getFilter=function(e){if(!this.filters[e])throw new Error("filter not found: "+e);return this.filters[e]},n.addTest=function(e,t){return this.tests[e]=t,this},n.getTest=function(e){if(!this.tests[e])throw new Error("test not found: "+e);return this.tests[e]},n.resolveTemplate=function(e,t,n){return!(!e.isRelative||!t)&&e.isRelative(n)&&e.resolve?e.resolve(t,n):n},n.getTemplate=function(e,t,n,r,i){var s,a=this,o=this,c=null;if(e&&e.raw&&(e=e.raw),je.isFunction(n)&&(i=n,n=null,t=t||!1),je.isFunction(t)&&(i=t,t=!1),e instanceof _i)c=e;else{if("string"!=typeof e)throw new Error("template names must be a string: "+e);for(var l=0;le.length-3)return!1;var n=e.charCodeAt(t+1);return(n>=Pi.LowerA&&n<=Pi.LowerZ||n>=Pi.UpperA&&n<=Pi.UpperZ||n===Pi.Exclamation)&&e.includes(">",t+2)}!function(e){e[e.LowerA=97]="LowerA",e[e.LowerZ=122]="LowerZ",e[e.UpperA=65]="UpperA",e[e.UpperZ=90]="UpperZ",e[e.Exclamation=33]="Exclamation"}(Pi||(Pi={}));var Hi=Object.prototype.hasOwnProperty,Gi=/\s+/,Yi={null:null,true:!0,false:!1},qi=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Ki=/^{[^]*}$|^\[[^]*]$/;function ji(e,t,n){var r;if(e&&I(e))return null!==(r=e.attribs)&&void 0!==r||(e.attribs={}),t?Hi.call(e.attribs,t)?!n&&qi.test(t)?t:e.attribs[t]:"option"===e.name&&"value"===t?Li(e.children):"input"!==e.name||"radio"!==e.attribs.type&&"checkbox"!==e.attribs.type||"value"!==t?void 0:"on":e.attribs}function Vi(e,t,n){null===n?zi(e,t):e.attribs[t]="".concat(n)}function Wi(e,t,n){return t in e?e[t]:!n&&qi.test(t)?void 0!==ji(e,t,!1):ji(e,t,n)}function Qi(e,t,n,r){t in e?e[t]=n:Vi(e,t,!r&&qi.test(t)?n?"":null:"".concat(n))}function Xi(e,t,n){var r,i=e;null!==(r=i.data)&&void 0!==r||(i.data={}),"object"==typeof t?Object.assign(i.data,t):"string"==typeof t&&void 0!==n&&(i.data[t]=n)}function $i(e,t){var n,r,i,s;null==t?r=(n=Object.keys(e.attribs).filter((function(e){return e.startsWith("data-")}))).map((function(e){return e.slice("data-".length).replace(/[_.-](\w|$)/g,(function(e,t){return t.toUpperCase()}))})):(n=["data-"+(s=t,s.replace(/[A-Z]/g,"-$&").toLowerCase())],r=[t]);for(var a=0;a1?this:ji(this[0],e,this.options.xmlMode)},prop:function(e,t){var n,r=this;if("string"==typeof e&&void 0===t){var i=this[0];if(!i||!I(i))return;switch(e){case"style":var s=this.css(),a=Object.keys(s);return a.forEach((function(e,t){s[t]=e})),s.length=a.length,s;case"tagName":case"nodeName":return i.name.toUpperCase();case"href":case"src":var o=null===(n=i.attribs)||void 0===n?void 0:n[e];return"undefined"==typeof URL||("href"!==e||"a"!==i.tagName&&"link"!==i.name)&&("src"!==e||"img"!==i.tagName&&"iframe"!==i.tagName&&"audio"!==i.tagName&&"video"!==i.tagName&&"source"!==i.tagName)||void 0===o||!this.options.baseURI?o:new URL(o,this.options.baseURI).href;case"innerText":return J(i);case"textContent":return z(i);case"outerHTML":return this.clone().wrap("").parent().html();case"innerHTML":return this.html();default:return Wi(i,e,this.options.xmlMode)}}if("object"==typeof e||void 0!==t){if("function"==typeof t){if("object"==typeof e)throw new Error("Bad combination of arguments.");return Bi(this,(function(n,i){I(n)&&Qi(n,e,t.call(n,i,Wi(n,e,r.options.xmlMode)),r.options.xmlMode)}))}return Bi(this,(function(n){I(n)&&("object"==typeof e?Object.keys(e).forEach((function(t){var i=e[t];Qi(n,t,i,r.options.xmlMode)})):Qi(n,e,t,r.options.xmlMode))}))}},data:function(e,t){var n,r=this[0];if(r&&I(r)){var i=r;return null!==(n=i.data)&&void 0!==n||(i.data={}),e?"object"==typeof e||void 0!==t?(Bi(this,(function(n){I(n)&&("object"==typeof e?Xi(n,e):Xi(n,e,t))})),this):Hi.call(i.data,e)?i.data[e]:$i(i,e):$i(i)}},val:function(e){var t=0===arguments.length,n=this[0];if(!n||!I(n))return t?void 0:this;switch(n.name){case"textarea":return this.text(e);case"select":var r=this.find("option:selected");if(!t){if(null==this.attr("multiple")&&"object"==typeof e)return this;this.find("option").removeAttr("selected");for(var i="object"!=typeof e?[e]:e,s=0;s-1;){var i=r+e.length;if((0===r||Gi.test(n[r-1]))&&(i===n.length||Gi.test(n[i])))return!0}return!1}))},addClass:function e(t){if("function"==typeof t)return Bi(this,(function(n,r){if(I(n)){var i=n.attribs.class||"";e.call([n],t.call(n,r,i))}}));if(!t||"string"!=typeof t)return this;for(var n=t.split(Gi),r=this.length,i=0;i=0&&(t.splice(o,1),s=!0,a--)}s&&(e.attribs.class=t.join(" "))}}))},toggleClass:function e(t,n){if("function"==typeof t)return Bi(this,(function(r,i){I(r)&&e.call([r],t.call(r,i,r.attribs.class||"",n),n)}));if(!t||"string"!=typeof t)return this;for(var r=t.split(Gi),i=r.length,s="boolean"==typeof n?n?1:-1:0,a=this.length,o=0;o=0&&u<0?l.push(r[h]):s<=0&&u>=0&&l.splice(u,1)}c.attribs.class=l.join(" ")}}return this}});!function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"}(Zi||(Zi={})),function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"}(es||(es={}));const ns=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,rs=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,is=new Map([[126,es.Element],[94,es.Start],[36,es.End],[42,es.Any],[33,es.Not],[124,es.Hyphen]]),ss=new Set(["has","not","matches","is","where","host","host-context"]);function as(e){switch(e.type){case Zi.Adjacent:case Zi.Child:case Zi.Descendant:case Zi.Parent:case Zi.Sibling:case Zi.ColumnCombinator:return!0;default:return!1}}const os=new Set(["contains","icontains"]);function cs(e,t,n){const r=parseInt(t,16)-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)}function ls(e){return e.replace(rs,cs)}function hs(e){return 39===e||34===e}function us(e){return 32===e||9===e||10===e||12===e||13===e}function ps(e){const t=[],n=fs(t,`${e}`,0);if(n0&&n0&&as(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function l(e){r.length>0&&r[r.length-1].type===Zi.Descendant?r[r.length-1].type=e:(c(),r.push({type:e}))}function h(e,t){r.push({type:Zi.Attribute,name:e,action:t,value:i(1),namespace:null,ignoreCase:"quirks"})}function u(){if(r.length&&r[r.length-1].type===Zi.Descendant&&r.pop(),0===r.length)throw new Error("Empty sub-selector");e.push(r)}if(s(0),t.length===n)return n;e:for(;n=0&&r>=1)):e.type===Zi.Pseudo&&(e.data?"has"===e.name||"contains"===e.name?r=0:Array.isArray(e.data)?(r=Math.min(...e.data.map((e=>Math.min(...e.map(gs))))),r<0&&(r=0)):r=2:r=3),r}const Ns=/[-[\]{}()*+?.,\\^$|#\s]/g;function Cs(e){return e.replace(Ns,"\\$&")}const Is=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function Ss(e,t){return"boolean"==typeof e.ignoreCase?e.ignoreCase:"quirks"===e.ignoreCase?!!t.quirksMode:!t.xmlMode&&Is.has(e.name)}const bs={equals(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;return Ss(t,n)?(s=s.toLowerCase(),t=>{const n=r.getAttributeValue(t,i);return null!=n&&n.length===s.length&&n.toLowerCase()===s&&e(t)}):t=>r.getAttributeValue(t,i)===s&&e(t)},hyphen(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const a=s.length;return Ss(t,n)?(s=s.toLowerCase(),function(t){const n=r.getAttributeValue(t,i);return null!=n&&(n.length===a||"-"===n.charAt(a))&&n.substr(0,a).toLowerCase()===s&&e(t)}):function(t){const n=r.getAttributeValue(t,i);return null!=n&&(n.length===a||"-"===n.charAt(a))&&n.substr(0,a)===s&&e(t)}},element(e,t,n){const{adapter:r}=n,{name:i,value:s}=t;if(/\s/.test(s))return ds.falseFunc;const a=new RegExp(`(?:^|\\s)${Cs(s)}(?:$|\\s)`,Ss(t,n)?"i":"");return function(t){const n=r.getAttributeValue(t,i);return null!=n&&n.length>=s.length&&a.test(n)&&e(t)}},exists:(e,{name:t},{adapter:n})=>r=>n.hasAttrib(r,t)&&e(r),start(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const a=s.length;return 0===a?ds.falseFunc:Ss(t,n)?(s=s.toLowerCase(),t=>{const n=r.getAttributeValue(t,i);return null!=n&&n.length>=a&&n.substr(0,a).toLowerCase()===s&&e(t)}):t=>{var n;return!!(null===(n=r.getAttributeValue(t,i))||void 0===n?void 0:n.startsWith(s))&&e(t)}},end(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;const a=-s.length;return 0===a?ds.falseFunc:Ss(t,n)?(s=s.toLowerCase(),t=>{var n;return(null===(n=r.getAttributeValue(t,i))||void 0===n?void 0:n.substr(a).toLowerCase())===s&&e(t)}):t=>{var n;return!!(null===(n=r.getAttributeValue(t,i))||void 0===n?void 0:n.endsWith(s))&&e(t)}},any(e,t,n){const{adapter:r}=n,{name:i,value:s}=t;if(""===s)return ds.falseFunc;if(Ss(t,n)){const t=new RegExp(Cs(s),"i");return function(n){const a=r.getAttributeValue(n,i);return null!=a&&a.length>=s.length&&t.test(a)&&e(n)}}return t=>{var n;return!!(null===(n=r.getAttributeValue(t,i))||void 0===n?void 0:n.includes(s))&&e(t)}},not(e,t,n){const{adapter:r}=n,{name:i}=t;let{value:s}=t;return""===s?t=>!!r.getAttributeValue(t,i)&&e(t):Ss(t,n)?(s=s.toLowerCase(),t=>{const n=r.getAttributeValue(t,i);return(null==n||n.length!==s.length||n.toLowerCase()!==s)&&e(t)}):t=>r.getAttributeValue(t,i)!==s&&e(t)}};var Os=Ke((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;var n=new Set([9,10,12,13,32]),r="0".charCodeAt(0),i="9".charCodeAt(0);t.parse=function(e){if("even"===(e=e.trim().toLowerCase()))return[2,0];if("odd"===e)return[2,1];var t=0,s=0,a=c(),o=l();if(t=r&&e.charCodeAt(t)<=i;)s=10*s+(e.charCodeAt(t)-r),t++;return t===n?null:s}function h(){for(;t=n};var r=Math.abs(t),i=(n%r+r)%r;return t>1?function(e){return e>=n&&e%r===i}:function(e){return e<=n&&e%r===i}}}));qe(ys),ys.compile;var Ls=Os,ks=ys,vs=Ke((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.compile=t.parse=void 0,Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return Ls.parse}}),Object.defineProperty(t,"compile",{enumerable:!0,get:function(){return ks.compile}}),t.default=function(e){return(0,ks.compile)((0,Ls.parse)(e))}})),Ds=qe(vs);function Rs(e,t){return n=>{const r=t.getParent(n);return null!=r&&t.isTag(r)&&e(n)}}vs.compile,vs.parse;const Ms={contains:(e,t,{adapter:n})=>function(r){return e(r)&&n.getText(r).includes(t)},icontains(e,t,{adapter:n}){const r=t.toLowerCase();return function(t){return e(t)&&n.getText(t).toLowerCase().includes(r)}},"nth-child"(e,t,{adapter:n,equals:r}){const i=Ds(t);return i===ds.falseFunc?ds.falseFunc:i===ds.trueFunc?Rs(e,n):function(t){const s=n.getSiblings(t);let a=0;for(let e=0;e=0&&!r(t,s[e]);e--)n.isTag(s[e])&&a++;return i(a)&&e(t)}},"nth-of-type"(e,t,{adapter:n,equals:r}){const i=Ds(t);return i===ds.falseFunc?ds.falseFunc:i===ds.trueFunc?Rs(e,n):function(t){const s=n.getSiblings(t);let a=0;for(let e=0;e=0;e--){const i=s[e];if(r(t,i))break;n.isTag(i)&&n.getName(i)===n.getName(t)&&a++}return i(a)&&e(t)}},root:(e,t,{adapter:n})=>t=>{const r=n.getParent(t);return(null==r||!n.isTag(r))&&e(t)},scope(e,t,n,r){const{equals:i}=n;return r&&0!==r.length?1===r.length?t=>i(r[0],t)&&e(t):t=>r.includes(t)&&e(t):Ms.root(e,t,n)},hover:Ps("isHovered"),visited:Ps("isVisited"),active:Ps("isActive")};function Ps(e){return function(t,n,{adapter:r}){const i=r[e];return"function"!=typeof i?ds.falseFunc:function(e){return i(e)&&t(e)}}}const xs={empty:(e,{adapter:t})=>!t.getChildren(e).some((e=>t.isTag(e)||""!==t.getText(e))),"first-child"(e,{adapter:t,equals:n}){if(t.prevElementSibling)return null==t.prevElementSibling(e);const r=t.getSiblings(e).find((e=>t.isTag(e)));return null!=r&&n(e,r)},"last-child"(e,{adapter:t,equals:n}){const r=t.getSiblings(e);for(let i=r.length-1;i>=0;i--){if(n(e,r[i]))return!0;if(t.isTag(r[i]))break}return!1},"first-of-type"(e,{adapter:t,equals:n}){const r=t.getSiblings(e),i=t.getName(e);for(let s=0;s=0;s--){const a=r[s];if(n(e,a))return!0;if(t.isTag(a)&&t.getName(a)===i)break}return!1},"only-of-type"(e,{adapter:t,equals:n}){const r=t.getName(e);return t.getSiblings(e).every((i=>n(e,i)||!t.isTag(i)||t.getName(i)!==r))},"only-child":(e,{adapter:t,equals:n})=>t.getSiblings(e).every((r=>n(e,r)||!t.isTag(r)))};function ws(e,t,n,r){if(null===n){if(e.length>r)throw new Error(`Pseudo-class :${t} requires an argument`)}else if(e.length===r)throw new Error(`Pseudo-class :${t} doesn't have any arguments`)}const Bs={"any-link":":is(a, area, link)[href]",link:":any-link:not(:visited)",disabled:":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Fs={};function Us(e,t){const n=t.getSiblings(e);if(n.length<=1)return[];const r=n.indexOf(e);return r<0||r===n.length-1?[]:n.slice(r+1).filter(t.isTag)}function Hs(e){return{xmlMode:!!e.xmlMode,lowerCaseAttributeNames:!!e.lowerCaseAttributeNames,lowerCaseTags:!!e.lowerCaseTags,quirksMode:!!e.quirksMode,cacheResults:!!e.cacheResults,pseudos:e.pseudos,adapter:e.adapter,equals:e.equals}}const Gs=(e,t,n,r,i)=>{const s=i(t,Hs(n),r);return s===ds.trueFunc?e:s===ds.falseFunc?ds.falseFunc:t=>s(t)&&e(t)},Ys={is:Gs,matches:Gs,where:Gs,not(e,t,n,r,i){const s=i(t,Hs(n),r);return s===ds.falseFunc?e:s===ds.trueFunc?ds.falseFunc:t=>!s(t)&&e(t)},has(e,t,n,r,i){const{adapter:s}=n,a=Hs(n);a.relativeSelector=!0;const o=t.some((e=>e.some(Ts)))?[Fs]:void 0,c=i(t,a,o);if(c===ds.falseFunc)return ds.falseFunc;const l=function(e,t){return e===ds.falseFunc?ds.falseFunc:n=>t.isTag(n)&&e(n)}(c,s);if(o&&c!==ds.trueFunc){const{shouldTestNextSiblings:t=!1}=c;return n=>{if(!e(n))return!1;o[0]=n;const r=s.getChildren(n),i=t?[...r,...Us(n,s)]:r;return s.existsOne(l,i)}}return t=>e(t)&&s.existsOne(l,s.getChildren(t))}};function qs(e,t){const n=t.getParent(e);return n&&t.isTag(n)?n:null}function Ks(e,t,n,r,i){const{adapter:s,equals:a}=n;switch(t.type){case Zi.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case Zi.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case Zi.Attribute:if(null!=t.namespace)throw new Error("Namespaced attributes are not yet supported by css-select");return n.xmlMode&&!n.lowerCaseAttributeNames||(t.name=t.name.toLowerCase()),bs[t.action](e,t,n);case Zi.Pseudo:return function(e,t,n,r,i){var s;const{name:a,data:o}=t;if(Array.isArray(o)){if(!(a in Ys))throw new Error(`Unknown pseudo-class :${a}(${o})`);return Ys[a](e,o,n,r,i)}const c=null===(s=n.pseudos)||void 0===s?void 0:s[a],l="string"==typeof c?c:Bs[a];if("string"==typeof l){if(null!=o)throw new Error(`Pseudo ${a} doesn't have any arguments`);const t=ps(l);return Ys.is(e,t,n,r,i)}if("function"==typeof c)return ws(c,a,o,1),t=>c(t,o)&&e(t);if(a in Ms)return Ms[a](e,o,n,r);if(a in xs){const t=xs[a];return ws(t,a,o,2),r=>t(r,n,o)&&e(r)}throw new Error(`Unknown pseudo-class :${a}`)}(e,t,n,r,i);case Zi.Tag:{if(null!=t.namespace)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:r}=t;return n.xmlMode&&!n.lowerCaseTags||(r=r.toLowerCase()),function(t){return s.getName(t)===r&&e(t)}}case Zi.Descendant:{if(!1===n.cacheResults||"undefined"==typeof WeakSet)return function(t){let n=t;for(;n=qs(n,s);)if(e(n))return!0;return!1};const t=new WeakSet;return function(n){let r=n;for(;r=qs(r,s);)if(!t.has(r)){if(s.isTag(r)&&e(r))return!0;t.add(r)}return!1}}case"_flexibleDescendant":return function(t){let n=t;do{if(e(n))return!0}while(n=qs(n,s));return!1};case Zi.Parent:return function(t){return s.getChildren(t).some((t=>s.isTag(t)&&e(t)))};case Zi.Child:return function(t){const n=s.getParent(t);return null!=n&&s.isTag(n)&&e(n)};case Zi.Sibling:return function(t){const n=s.getSiblings(t);for(let r=0;re.some(js))))}const Vs={type:Zi.Descendant},Ws={type:"_flexibleDescendant"},Qs={type:Zi.Pseudo,name:"scope",data:null};function Xs(e,t,n){var r;e.forEach(As),n=null!==(r=t.context)&&void 0!==r?r:n;const i=Array.isArray(n),s=n&&(Array.isArray(n)?n:[n]);if(!1!==t.relativeSelector)!function(e,{adapter:t},n){const r=!!(null==n?void 0:n.every((e=>{const n=t.isTag(e)&&t.getParent(e);return e===Fs||n&&t.isTag(n)})));for(const t of e){if(t.length>0&&Ts(t[0])&&t[0].type!==Zi.Descendant);else{if(!r||t.some(js))continue;t.unshift(Vs)}t.unshift(Qs)}}(e,t,s);else if(e.some((e=>e.length>0&&Ts(e[0]))))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let a=!1;const o=e.map((e=>{if(e.length>=2){const[t,n]=e;t.type!==Zi.Pseudo||"scope"!==t.name||(i&&n.type===Zi.Descendant?e[1]=Ws:n.type!==Zi.Adjacent&&n.type!==Zi.Sibling||(a=!0))}return function(e,t,n){var r;return e.reduce(((e,r)=>e===ds.falseFunc?ds.falseFunc:Ks(e,r,t,n,Xs)),null!==(r=t.rootFunc)&&void 0!==r?r:ds.trueFunc)}(e,t,s)})).reduce($s,ds.falseFunc);return o.shouldTestNextSiblings=a,o}function $s(e,t){return t===ds.falseFunc||e===ds.trueFunc?e:e===ds.falseFunc||t===ds.trueFunc?t:function(n){return e(n)||t(n)}}const zs=(e,t)=>e===t,Js={adapter:Se,equals:zs};const Zs=(ea=Xs,function(e,t,n){const r=function(e){var t,n,r,i;const s=null!=e?e:Js;return null!==(t=s.adapter)&&void 0!==t||(s.adapter=Se),null!==(n=s.equals)&&void 0!==n||(s.equals=null!==(i=null===(r=s.adapter)||void 0===r?void 0:r.equals)&&void 0!==i?i:zs),s}(t);return ea(e,r,n)});var ea;function ta(e,t,n=!1){return n&&(e=function(e,t){const n=Array.isArray(e)?e.slice(0):[e],r=n.length;for(let e=0;ee.some(ra))))}function ia(e){const t=[],n=[];for(const r of e)r.some(ra)?t.push(r):n.push(r);return[n,t]}const sa={type:Zi.Universal,namespace:null},aa={type:Zi.Pseudo,name:"scope",data:null};function oa(e,t,n={}){return ca([e],t,n)}function ca(e,t,n={}){if("function"==typeof t)return e.some(t);const[r,i]=ia(ps(t));return r.length>0&&e.some(Zs(r,n))||i.some((t=>ua(t,e,n).length>0))}function la(e,t,n={}){return ha(ps(e),t,n)}function ha(e,t,n){if(0===t.length)return[];const[r,i]=ia(e);let s;if(r.length){const e=Ea(t,r,n);if(0===i.length)return e;e.length&&(s=new Set(e))}for(let e=0;eI(e)&&!s.has(e))):t;if(0===a.length)break;const o=ua(r,t,n);if(o.length)if(s)o.forEach((e=>s.add(e)));else{if(e===i.length-1)return o;s=new Set(o)}}return void 0!==s?s.size===t.length?t:t.filter((e=>s.has(e))):[]}function ua(e,t,n){var r;if(e.some(as)){const i=null!==(r=n.root)&&void 0!==r?r:function(e){for(;e.parent;)e=e.parent;return e}(t[0]),s={...n,context:t,relativeSelector:!1};return e.push(aa),pa(i,e,s,!0,t.length)}return pa(t,e,n,!1,t.length)}function pa(e,t,n,r,i){const s=t.findIndex(ra),a=t.slice(0,s),o=t[s],c=t.length-1===s?i:1/0,l=function(e,t,n){const r=null!=t?parseInt(t,10):NaN;switch(e){case"first":return 1;case"nth":case"eq":return isFinite(r)?r>=0?r+1:1/0:0;case"lt":return isFinite(r)?r>=0?Math.min(r,n):1/0:0;case"gt":return isFinite(r)?1/0:0;case"odd":return 2*n;case"even":return 2*n-1;case"last":case"not":return 1/0}}(o.name,o.data,c);if(0===l)return[];const h=(0!==a.length||Array.isArray(e)?0===a.length?(Array.isArray(e)?e:[e]).filter(I):r||a.some(as)?fa(e,[a],n,l):Ea(e,[a],n):Z(e).filter(I)).slice(0,l);let u=function(e,t,n,r){const i="string"==typeof n?parseInt(n,10):NaN;switch(e){case"first":case"lt":return t;case"last":return t.length>0?[t[t.length-1]]:t;case"nth":case"eq":return isFinite(i)&&Math.abs(i)t%2==0));case"odd":return t.filter(((e,t)=>t%2==1));case"not":{const e=new Set(ha(n,t,r));return t.filter((t=>!e.has(t)))}}}(o.name,h,o.data,n);if(0===u.length||t.length===s+1)return u;const p=t.slice(s+1),f=p.some(as);if(f){if(as(p[0])){const{type:e}=p[0];e!==Zi.Sibling&&e!==Zi.Adjacent||(u=ta(u,Se,!0)),p.unshift(sa)}n={...n,relativeSelector:!1,rootFunc:e=>u.includes(e)}}else n.rootFunc&&n.rootFunc!==Es&&(n={...n,rootFunc:Es});return p.some(ra)?pa(u,p,n,!1,i):f?fa(u,[p],n,i):Ea(u,[p],n)}function fa(e,t,n,r){return da(e,Zs(t,n,e),r)}function da(e,t,n=1/0){return ae((e=>I(e)&&t(e)),ta(e,Se,t.shouldTestNextSiblings),!0,n)}function Ea(e,t,n){const r=(Array.isArray(e)?e:[e]).filter(I);if(0===r.length)return r;const i=Zs(t,n);return i===Es?r:r.filter(i)}var ma=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i1&&s.length>1?n.reduce((function(e,t){return t(e)}),s):s)}}}var Aa=_a((function(e,t){for(var n,r=[],i=0;ipa(t,e,n,!0,r)));return i.length&&a.push(fa(t,i,n,r)),0===a.length?[]:1===a.length?a[0]:Ee(a.reduce(((e,t)=>[...e,...t])))}(e,i,s))},parent:Ia,parents:Sa,parentsUntil:ba,closest:function(e){var t,n=[];if(!e)return this._make(n);var r={xmlMode:this.options.xmlMode,root:null===(t=this._root)||void 0===t?void 0:t[0]},i="string"==typeof e?function(t){return oa(t,e,r)}:Pa(e);return Bi(this,(function(e){for(;e&&I(e);){if(i(e,0)){n.includes(e)||n.push(e);break}e=e.parent}})),this._make(n)},next:Oa,nextAll:ya,nextUntil:La,prev:ka,prevAll:va,prevUntil:Da,siblings:Ra,children:Ma,contents:function(){var e=this.toArray().reduce((function(e,t){return k(t)?e.concat(t.children):e}),[]);return this._make(e)},each:function(e){for(var t=0,n=this.length;t0})},first:function(){return this.length>1?this._make(this[0]):this},last:function(){return this.length>0?this._make(this[this.length-1]):this},eq:function(e){var t;return 0===(e=+e)&&this.length<=1?this:(e<0&&(e=this.length+e),this._make(null!==(t=this[e])&&void 0!==t?t:[]))},get:function(e){return null==e?this.toArray():this[e<0?this.length+e:e]},toArray:function(){return Array.prototype.slice.call(this)},index:function(e){var t,n;return null==e?(t=this.parent().children(),n=this[0]):"string"==typeof e?(t=this._make(e),n=this[0]):(t=this,n=wi(e)?e[0]:e),Array.prototype.indexOf.call(t,n)},slice:function(e,t){return this._make(Array.prototype.slice.call(this,e,t))},end:function(){var e;return null!==(e=this.prevObject)&&void 0!==e?e:this._make([])},add:function(e,t){var n=this._make(e,t),r=Ee(ma(ma([],this.get(),!0),n.get(),!0));return this._make(r)},addBack:function(e){return this.prevObject?this.add(e?this.prevObject.filter(e):this.prevObject):this}});function Ba(e,t){var n=Array.isArray(e)?e:[e];t?t.children=n:t=null;for(var r=0;r=e.length?null:e[t+n],h=0;h-1&&(p.children.splice(f,1),i===p&&t>f&&o[0]--)}u.parent=i,u.prev&&(u.prev.next=null!==(s=u.next)&&void 0!==s?s:null),u.next&&(u.next.prev=null!==(a=u.prev)&&void 0!==a?a:null),u.prev=0===h?c:r[h-1],u.next=h===r.length-1?l:r[h+1]}return c&&(c.next=r[0]),l&&(l.prev=r[r.length-1]),e.splice.apply(e,o)}var Ga=Ua((function(e,t,n){Ha(t,t.length,0,e,n)})),Ya=Ua((function(e,t,n){Ha(t,0,0,e,n)}));function qa(e){return function(t){for(var n=this.length-1,r=this.parents().last(),i=0;i0&&void 0!==t&&(n[t]+=";".concat(o))}else n[t=s.slice(0,a).trim()]=s.slice(a+1).trim()}return n}(e.attribs.style);if("string"==typeof t)return n[t];if(Array.isArray(t)){var r={};return t.forEach((function(e){null!=n[e]&&(r[e]=n[e])})),r}return n}}var Xa=Object.freeze({__proto__:null,css:function(e,t){return null!=e&&null!=t||"object"==typeof e&&!Array.isArray(e)?Bi(this,(function(n,r){I(n)&&Wa(n,e,t,r)})):0!==this.length?Qa(this[0],e):void 0}}),$a=/%20/g,za=/\r?\n/g;var Ja=Object.freeze({__proto__:null,serialize:function(){var e=this.serializeArray().map((function(e){return"".concat(encodeURIComponent(e.name),"=").concat(encodeURIComponent(e.value))}));return e.join("&").replace($a,"+")},serializeArray:function(){var e=this;return this.map((function(t,n){var r=e._make(n);return I(n)&&"form"===n.name?r.find("input,select,textarea,keygen").toArray():r.filter("input,select,textarea,keygen").toArray()})).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((function(t,n){var r,i=e._make(n),s=i.attr("name"),a=null!==(r=i.val())&&void 0!==r?r:"";return Array.isArray(a)?a.map((function(e){return{name:s,value:e.replace(za,"\r\n")}})):{name:s,value:a.replace(za,"\r\n")}})).toArray()}}),Za=function(e,t,n){if(this.length=0,this.options=n,this._root=t,e){for(var r=0;r=55296&&e<=57343}function po(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159}function fo(e){return e>=64976&&e<=65007||ro.has(e)}var Eo;!function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"}(Eo=Eo||(Eo={}));class mo{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e){const{line:t,col:n,offset:r}=this;return{code:e,startLine:t,endLine:t,startCol:n,endCol:n,startOffset:r,endOffset:r}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,io.EOF;return this._err(Eo.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t=this.html.length?(this.endOfChunkHit=!this.lastChunkWritten,io.EOF):this.html.charCodeAt(t)}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,io.EOF;let e=this.html.charCodeAt(this.pos);if(e===io.CARRIAGE_RETURN)return this.isEol=!0,this.skipNextNewLine=!0,io.LINE_FEED;if(e===io.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine))return this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance();this.skipNextNewLine=!1,uo(e)&&(e=this._processSurrogate(e));return null===this.handler.onParseError||e>31&&e<127||e===io.LINE_FEED||e===io.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e}_checkForProblematicCharacters(e){po(e)?this._err(Eo.controlCharacterInInputStream):fo(e)&&this._err(Eo.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}!function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"}(To=To||(To={}));var Ao=Ke((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((function(e){return e.charCodeAt(0)})))}));qe(Ao);var go=Ke((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((function(e){return e.charCodeAt(0)})))}));qe(go);var No=Ke((function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var r=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function i(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=r.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(n=String.fromCodePoint)&&void 0!==n?n:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)},t.replaceCodePoint=i,t.default=function(e){return(0,t.fromCodePoint)(i(e))}}));qe(No),No.replaceCodePoint,No.fromCodePoint;var Co=Ao,Io=go,So=No,bo=Ke((function(e,t){var n=Ge&&Ge.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTML=t.determineBranch=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var r=n(Co);t.htmlDecodeTree=r.default;var i=n(Io);t.xmlDecodeTree=i.default;var s=n(So);t.decodeCodePoint=s.default;var a,o,c=So;function l(e){return function(t,n){for(var r="",i=0,c=0;(c=t.indexOf("&",c))>=0;)if(r+=t.slice(i,c),i=c,c+=1,t.charCodeAt(c)!==a.NUM){for(var l=0,u=1,p=0,f=e[p];c>14)-1))break;p+=E}}if(0!==l)r+=1===(E=(e[l]&o.VALUE_LENGTH)>>14)?String.fromCharCode(e[l]&~o.VALUE_LENGTH):2===E?String.fromCharCode(e[l+1]):String.fromCharCode(e[l+1],e[l+2]),i=c-u+1}else{var m=c+1,T=10,_=t.charCodeAt(m);(_|a.To_LOWER_BIT)===a.LOWER_X&&(T=16,c+=1,m+=1);do{_=t.charCodeAt(++c)}while(_>=a.ZERO&&_<=a.NINE||16===T&&(_|a.To_LOWER_BIT)>=a.LOWER_A&&(_|a.To_LOWER_BIT)<=a.LOWER_F);if(m!==c){var A=t.substring(m,c),g=parseInt(A,T);if(t.charCodeAt(c)===a.SEMI)c+=1;else if(n)continue;r+=(0,s.default)(g),i=c}}return r+t.slice(i)}}function h(e,t,n,r){var i=(t&o.BRANCH_LENGTH)>>7,s=t&o.JUMP_TABLE;if(0===i)return 0!==s&&r===s?n:-1;if(s){var a=r-s;return a<0||a>=i?-1:e[n+a]-1}for(var c=n,l=c+i-1;c<=l;){var h=c+l>>>1,u=e[h];if(ur))return e[h+i];l=h-1}}return-1}Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return c.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return c.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.To_LOWER_BIT=32]="To_LOWER_BIT"}(a||(a={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(o=t.BinTrieFlags||(t.BinTrieFlags={})),t.determineBranch=h;var u=l(r.default),p=l(i.default);t.decodeHTML=function(e){return u(e,!1)},t.decodeHTMLStrict=function(e){return u(e,!0)},t.decodeXML=function(e){return p(e,!0)}}));qe(bo),bo.decodeXML,bo.decodeHTMLStrict,bo.decodeHTML;var Oo=bo.determineBranch,yo=bo.BinTrieFlags,Lo=bo.fromCodePoint,ko=bo.replaceCodePoint;bo.decodeCodePoint;var vo,Do,Ro,Mo,Po,xo=bo.xmlDecodeTree,wo=bo.htmlDecodeTree;!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"}(vo=vo||(vo={})),function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"}(Do=Do||(Do={})),function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"}(Ro=Ro||(Ro={})),function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"}(Mo=Mo||(Mo={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SECTION=94]="SECTION",e[e.SELECT=95]="SELECT",e[e.SOURCE=96]="SOURCE",e[e.SMALL=97]="SMALL",e[e.SPAN=98]="SPAN",e[e.STRIKE=99]="STRIKE",e[e.STRONG=100]="STRONG",e[e.STYLE=101]="STYLE",e[e.SUB=102]="SUB",e[e.SUMMARY=103]="SUMMARY",e[e.SUP=104]="SUP",e[e.TABLE=105]="TABLE",e[e.TBODY=106]="TBODY",e[e.TEMPLATE=107]="TEMPLATE",e[e.TEXTAREA=108]="TEXTAREA",e[e.TFOOT=109]="TFOOT",e[e.TD=110]="TD",e[e.TH=111]="TH",e[e.THEAD=112]="THEAD",e[e.TITLE=113]="TITLE",e[e.TR=114]="TR",e[e.TRACK=115]="TRACK",e[e.TT=116]="TT",e[e.U=117]="U",e[e.UL=118]="UL",e[e.SVG=119]="SVG",e[e.VAR=120]="VAR",e[e.WBR=121]="WBR",e[e.XMP=122]="XMP"}(Po=Po||(Po={}));const Bo=new Map([[Mo.A,Po.A],[Mo.ADDRESS,Po.ADDRESS],[Mo.ANNOTATION_XML,Po.ANNOTATION_XML],[Mo.APPLET,Po.APPLET],[Mo.AREA,Po.AREA],[Mo.ARTICLE,Po.ARTICLE],[Mo.ASIDE,Po.ASIDE],[Mo.B,Po.B],[Mo.BASE,Po.BASE],[Mo.BASEFONT,Po.BASEFONT],[Mo.BGSOUND,Po.BGSOUND],[Mo.BIG,Po.BIG],[Mo.BLOCKQUOTE,Po.BLOCKQUOTE],[Mo.BODY,Po.BODY],[Mo.BR,Po.BR],[Mo.BUTTON,Po.BUTTON],[Mo.CAPTION,Po.CAPTION],[Mo.CENTER,Po.CENTER],[Mo.CODE,Po.CODE],[Mo.COL,Po.COL],[Mo.COLGROUP,Po.COLGROUP],[Mo.DD,Po.DD],[Mo.DESC,Po.DESC],[Mo.DETAILS,Po.DETAILS],[Mo.DIALOG,Po.DIALOG],[Mo.DIR,Po.DIR],[Mo.DIV,Po.DIV],[Mo.DL,Po.DL],[Mo.DT,Po.DT],[Mo.EM,Po.EM],[Mo.EMBED,Po.EMBED],[Mo.FIELDSET,Po.FIELDSET],[Mo.FIGCAPTION,Po.FIGCAPTION],[Mo.FIGURE,Po.FIGURE],[Mo.FONT,Po.FONT],[Mo.FOOTER,Po.FOOTER],[Mo.FOREIGN_OBJECT,Po.FOREIGN_OBJECT],[Mo.FORM,Po.FORM],[Mo.FRAME,Po.FRAME],[Mo.FRAMESET,Po.FRAMESET],[Mo.H1,Po.H1],[Mo.H2,Po.H2],[Mo.H3,Po.H3],[Mo.H4,Po.H4],[Mo.H5,Po.H5],[Mo.H6,Po.H6],[Mo.HEAD,Po.HEAD],[Mo.HEADER,Po.HEADER],[Mo.HGROUP,Po.HGROUP],[Mo.HR,Po.HR],[Mo.HTML,Po.HTML],[Mo.I,Po.I],[Mo.IMG,Po.IMG],[Mo.IMAGE,Po.IMAGE],[Mo.INPUT,Po.INPUT],[Mo.IFRAME,Po.IFRAME],[Mo.KEYGEN,Po.KEYGEN],[Mo.LABEL,Po.LABEL],[Mo.LI,Po.LI],[Mo.LINK,Po.LINK],[Mo.LISTING,Po.LISTING],[Mo.MAIN,Po.MAIN],[Mo.MALIGNMARK,Po.MALIGNMARK],[Mo.MARQUEE,Po.MARQUEE],[Mo.MATH,Po.MATH],[Mo.MENU,Po.MENU],[Mo.META,Po.META],[Mo.MGLYPH,Po.MGLYPH],[Mo.MI,Po.MI],[Mo.MO,Po.MO],[Mo.MN,Po.MN],[Mo.MS,Po.MS],[Mo.MTEXT,Po.MTEXT],[Mo.NAV,Po.NAV],[Mo.NOBR,Po.NOBR],[Mo.NOFRAMES,Po.NOFRAMES],[Mo.NOEMBED,Po.NOEMBED],[Mo.NOSCRIPT,Po.NOSCRIPT],[Mo.OBJECT,Po.OBJECT],[Mo.OL,Po.OL],[Mo.OPTGROUP,Po.OPTGROUP],[Mo.OPTION,Po.OPTION],[Mo.P,Po.P],[Mo.PARAM,Po.PARAM],[Mo.PLAINTEXT,Po.PLAINTEXT],[Mo.PRE,Po.PRE],[Mo.RB,Po.RB],[Mo.RP,Po.RP],[Mo.RT,Po.RT],[Mo.RTC,Po.RTC],[Mo.RUBY,Po.RUBY],[Mo.S,Po.S],[Mo.SCRIPT,Po.SCRIPT],[Mo.SECTION,Po.SECTION],[Mo.SELECT,Po.SELECT],[Mo.SOURCE,Po.SOURCE],[Mo.SMALL,Po.SMALL],[Mo.SPAN,Po.SPAN],[Mo.STRIKE,Po.STRIKE],[Mo.STRONG,Po.STRONG],[Mo.STYLE,Po.STYLE],[Mo.SUB,Po.SUB],[Mo.SUMMARY,Po.SUMMARY],[Mo.SUP,Po.SUP],[Mo.TABLE,Po.TABLE],[Mo.TBODY,Po.TBODY],[Mo.TEMPLATE,Po.TEMPLATE],[Mo.TEXTAREA,Po.TEXTAREA],[Mo.TFOOT,Po.TFOOT],[Mo.TD,Po.TD],[Mo.TH,Po.TH],[Mo.THEAD,Po.THEAD],[Mo.TITLE,Po.TITLE],[Mo.TR,Po.TR],[Mo.TRACK,Po.TRACK],[Mo.TT,Po.TT],[Mo.U,Po.U],[Mo.UL,Po.UL],[Mo.SVG,Po.SVG],[Mo.VAR,Po.VAR],[Mo.WBR,Po.WBR],[Mo.XMP,Po.XMP]]);function Fo(e){var t;return null!==(t=Bo.get(e))&&void 0!==t?t:Po.UNKNOWN}const Uo=Po,Ho={[vo.HTML]:new Set([Uo.ADDRESS,Uo.APPLET,Uo.AREA,Uo.ARTICLE,Uo.ASIDE,Uo.BASE,Uo.BASEFONT,Uo.BGSOUND,Uo.BLOCKQUOTE,Uo.BODY,Uo.BR,Uo.BUTTON,Uo.CAPTION,Uo.CENTER,Uo.COL,Uo.COLGROUP,Uo.DD,Uo.DETAILS,Uo.DIR,Uo.DIV,Uo.DL,Uo.DT,Uo.EMBED,Uo.FIELDSET,Uo.FIGCAPTION,Uo.FIGURE,Uo.FOOTER,Uo.FORM,Uo.FRAME,Uo.FRAMESET,Uo.H1,Uo.H2,Uo.H3,Uo.H4,Uo.H5,Uo.H6,Uo.HEAD,Uo.HEADER,Uo.HGROUP,Uo.HR,Uo.HTML,Uo.IFRAME,Uo.IMG,Uo.INPUT,Uo.LI,Uo.LINK,Uo.LISTING,Uo.MAIN,Uo.MARQUEE,Uo.MENU,Uo.META,Uo.NAV,Uo.NOEMBED,Uo.NOFRAMES,Uo.NOSCRIPT,Uo.OBJECT,Uo.OL,Uo.P,Uo.PARAM,Uo.PLAINTEXT,Uo.PRE,Uo.SCRIPT,Uo.SECTION,Uo.SELECT,Uo.SOURCE,Uo.STYLE,Uo.SUMMARY,Uo.TABLE,Uo.TBODY,Uo.TD,Uo.TEMPLATE,Uo.TEXTAREA,Uo.TFOOT,Uo.TH,Uo.THEAD,Uo.TITLE,Uo.TR,Uo.TRACK,Uo.UL,Uo.WBR,Uo.XMP]),[vo.MATHML]:new Set([Uo.MI,Uo.MO,Uo.MN,Uo.MS,Uo.MTEXT,Uo.ANNOTATION_XML]),[vo.SVG]:new Set([Uo.TITLE,Uo.FOREIGN_OBJECT,Uo.DESC]),[vo.XLINK]:new Set,[vo.XML]:new Set,[vo.XMLNS]:new Set};function Go(e){return e===Uo.H1||e===Uo.H2||e===Uo.H3||e===Uo.H4||e===Uo.H5||e===Uo.H6}const Yo=new Set([Mo.STYLE,Mo.SCRIPT,Mo.XMP,Mo.IFRAME,Mo.NOEMBED,Mo.NOFRAMES,Mo.PLAINTEXT]);const qo=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);var Ko;!function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.NAMED_CHARACTER_REFERENCE=72]="NAMED_CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=73]="AMBIGUOUS_AMPERSAND",e[e.NUMERIC_CHARACTER_REFERENCE=74]="NUMERIC_CHARACTER_REFERENCE",e[e.HEXADEMICAL_CHARACTER_REFERENCE_START=75]="HEXADEMICAL_CHARACTER_REFERENCE_START",e[e.HEXADEMICAL_CHARACTER_REFERENCE=76]="HEXADEMICAL_CHARACTER_REFERENCE",e[e.DECIMAL_CHARACTER_REFERENCE=77]="DECIMAL_CHARACTER_REFERENCE",e[e.NUMERIC_CHARACTER_REFERENCE_END=78]="NUMERIC_CHARACTER_REFERENCE_END"}(Ko||(Ko={}));const jo={DATA:Ko.DATA,RCDATA:Ko.RCDATA,RAWTEXT:Ko.RAWTEXT,SCRIPT_DATA:Ko.SCRIPT_DATA,PLAINTEXT:Ko.PLAINTEXT,CDATA_SECTION:Ko.CDATA_SECTION};function Vo(e){return e>=io.DIGIT_0&&e<=io.DIGIT_9}function Wo(e){return e>=io.LATIN_CAPITAL_A&&e<=io.LATIN_CAPITAL_Z}function Qo(e){return function(e){return e>=io.LATIN_SMALL_A&&e<=io.LATIN_SMALL_Z}(e)||Wo(e)}function Xo(e){return Qo(e)||Vo(e)}function $o(e){return e>=io.LATIN_CAPITAL_A&&e<=io.LATIN_CAPITAL_F}function zo(e){return e>=io.LATIN_SMALL_A&&e<=io.LATIN_SMALL_F}function Jo(e){return e+32}function Zo(e){return e===io.SPACE||e===io.LINE_FEED||e===io.TABULATION||e===io.FORM_FEED}function ec(e){return Zo(e)||e===io.SOLIDUS||e===io.GREATER_THAN_SIGN}class tc{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=Ko.DATA,this.returnState=Ko.DATA,this.charRefCode=-1,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new mo(t),this.currentLocation=this.getCurrentLocation(-1)}_err(e){var t,n;null===(n=(t=this.handler).onParseError)||void 0===n||n.call(t,this.preprocessor.getError(e))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,this.inLoop||(this._runParsingLoop(),this.paused||null==e||e())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||null==n||n()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return!!this.preprocessor.endOfChunkHit&&(this._unconsume(this.consumedAfterSnapshot),this.active=!1,!0)}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(e){this.consumedAfterSnapshot-=e,this.preprocessor.retreat(e)}_reconsumeInState(e,t){this.state=e,this._callState(t)}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t0&&this._err(Eo.endTagWithAttributes),e.selfClosing&&this._err(Eo.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case To.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case To.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case To.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:To.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e)return void(this.currentCharacterToken.chars+=t);this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){const t=Zo(e)?To.WHITESPACE_CHARACTER:e===io.NULL?To.NULL_CHARACTER:To.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(To.CHARACTER,e)}_matchNamedCharacterReference(e){let t=null,n=0,r=!1;for(let s=0,a=wo[0];s>=0&&(s=Oo(wo,a,s+1,e),!(s<0));e=this._consume()){n+=1,a=wo[s];const o=a&yo.VALUE_LENGTH;if(o){const a=(o>>14)-1;if(e!==io.SEMICOLON&&this._isCharacterReferenceInAttribute()&&((i=this.preprocessor.peek(1))===io.EQUALS_SIGN||Xo(i))?(t=[io.AMPERSAND],s+=a):(t=0===a?[wo[s]&~yo.VALUE_LENGTH]:1===a?[wo[++s]]:[wo[++s],wo[++s]],n=0,r=e!==io.SEMICOLON),0===a){this._consume();break}}}var i;return this._unconsume(n),r&&!this.preprocessor.endOfChunkHit&&this._err(Eo.missingSemicolonAfterCharacterReference),this._unconsume(1),t}_isCharacterReferenceInAttribute(){return this.returnState===Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ko.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Ko.DATA:this._stateData(e);break;case Ko.RCDATA:this._stateRcdata(e);break;case Ko.RAWTEXT:this._stateRawtext(e);break;case Ko.SCRIPT_DATA:this._stateScriptData(e);break;case Ko.PLAINTEXT:this._statePlaintext(e);break;case Ko.TAG_OPEN:this._stateTagOpen(e);break;case Ko.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Ko.TAG_NAME:this._stateTagName(e);break;case Ko.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Ko.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Ko.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Ko.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Ko.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Ko.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Ko.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Ko.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Ko.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Ko.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Ko.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Ko.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Ko.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Ko.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Ko.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Ko.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Ko.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Ko.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Ko.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Ko.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Ko.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Ko.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Ko.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Ko.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Ko.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Ko.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Ko.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Ko.BOGUS_COMMENT:this._stateBogusComment(e);break;case Ko.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Ko.COMMENT_START:this._stateCommentStart(e);break;case Ko.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Ko.COMMENT:this._stateComment(e);break;case Ko.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Ko.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Ko.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Ko.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Ko.COMMENT_END:this._stateCommentEnd(e);break;case Ko.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Ko.DOCTYPE:this._stateDoctype(e);break;case Ko.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Ko.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Ko.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Ko.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Ko.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Ko.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Ko.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Ko.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Ko.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Ko.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Ko.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Ko.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Ko.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Ko.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Ko.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Ko.CDATA_SECTION:this._stateCdataSection(e);break;case Ko.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Ko.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Ko.CHARACTER_REFERENCE:this._stateCharacterReference(e);break;case Ko.NAMED_CHARACTER_REFERENCE:this._stateNamedCharacterReference(e);break;case Ko.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;case Ko.NUMERIC_CHARACTER_REFERENCE:this._stateNumericCharacterReference(e);break;case Ko.HEXADEMICAL_CHARACTER_REFERENCE_START:this._stateHexademicalCharacterReferenceStart(e);break;case Ko.HEXADEMICAL_CHARACTER_REFERENCE:this._stateHexademicalCharacterReference(e);break;case Ko.DECIMAL_CHARACTER_REFERENCE:this._stateDecimalCharacterReference(e);break;case Ko.NUMERIC_CHARACTER_REFERENCE_END:this._stateNumericCharacterReferenceEnd(e);break;default:throw new Error("Unknown state")}}_stateData(e){switch(e){case io.LESS_THAN_SIGN:this.state=Ko.TAG_OPEN;break;case io.AMPERSAND:this.returnState=Ko.DATA,this.state=Ko.CHARACTER_REFERENCE;break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this._emitCodePoint(e);break;case io.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case io.AMPERSAND:this.returnState=Ko.RCDATA,this.state=Ko.CHARACTER_REFERENCE;break;case io.LESS_THAN_SIGN:this.state=Ko.RCDATA_LESS_THAN_SIGN;break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this._emitChars("�");break;case io.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case io.LESS_THAN_SIGN:this.state=Ko.RAWTEXT_LESS_THAN_SIGN;break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this._emitChars("�");break;case io.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case io.LESS_THAN_SIGN:this.state=Ko.SCRIPT_DATA_LESS_THAN_SIGN;break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this._emitChars("�");break;case io.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case io.NULL:this._err(Eo.unexpectedNullCharacter),this._emitChars("�");break;case io.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Qo(e))this._createStartTagToken(),this.state=Ko.TAG_NAME,this._stateTagName(e);else switch(e){case io.EXCLAMATION_MARK:this.state=Ko.MARKUP_DECLARATION_OPEN;break;case io.SOLIDUS:this.state=Ko.END_TAG_OPEN;break;case io.QUESTION_MARK:this._err(Eo.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ko.BOGUS_COMMENT,this._stateBogusComment(e);break;case io.EOF:this._err(Eo.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break;default:this._err(Eo.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ko.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Qo(e))this._createEndTagToken(),this.state=Ko.TAG_NAME,this._stateTagName(e);else switch(e){case io.GREATER_THAN_SIGN:this._err(Eo.missingEndTagName),this.state=Ko.DATA;break;case io.EOF:this._err(Eo.eofBeforeTagName),this._emitChars("");break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this.state=Ko.SCRIPT_DATA_ESCAPED,this._emitChars("�");break;case io.EOF:this._err(Eo.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Ko.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===io.SOLIDUS?this.state=Ko.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Qo(e)?(this._emitChars("<"),this.state=Ko.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Ko.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Qo(e)?(this.state=Ko.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break;case io.NULL:this._err(Eo.unexpectedNullCharacter),this.state=Ko.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars("�");break;case io.EOF:this._err(Eo.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Ko.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===io.SOLIDUS?(this.state=Ko.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ko.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(co,!1)&&ec(this.preprocessor.peek(co.length))){this._emitCodePoint(e);for(let e=0;e1114111)this._err(Eo.characterReferenceOutsideUnicodeRange),this.charRefCode=io.REPLACEMENT_CHARACTER;else if(uo(this.charRefCode))this._err(Eo.surrogateCharacterReference),this.charRefCode=io.REPLACEMENT_CHARACTER;else if(fo(this.charRefCode))this._err(Eo.noncharacterCharacterReference);else if(po(this.charRefCode)||this.charRefCode===io.CARRIAGE_RETURN){this._err(Eo.controlCharacterReference);const e=qo.get(this.charRefCode);void 0!==e&&(this.charRefCode=e)}this._flushCodePointConsumedAsCharacterReference(this.charRefCode),this._reconsumeInState(this.returnState,e)}}const nc=new Set([Po.DD,Po.DT,Po.LI,Po.OPTGROUP,Po.OPTION,Po.P,Po.RB,Po.RP,Po.RT,Po.RTC]),rc=new Set([...nc,Po.CAPTION,Po.COLGROUP,Po.TBODY,Po.TD,Po.TFOOT,Po.TH,Po.THEAD,Po.TR]),ic=new Map([[Po.APPLET,vo.HTML],[Po.CAPTION,vo.HTML],[Po.HTML,vo.HTML],[Po.MARQUEE,vo.HTML],[Po.OBJECT,vo.HTML],[Po.TABLE,vo.HTML],[Po.TD,vo.HTML],[Po.TEMPLATE,vo.HTML],[Po.TH,vo.HTML],[Po.ANNOTATION_XML,vo.MATHML],[Po.MI,vo.MATHML],[Po.MN,vo.MATHML],[Po.MO,vo.MATHML],[Po.MS,vo.MATHML],[Po.MTEXT,vo.MATHML],[Po.DESC,vo.SVG],[Po.FOREIGN_OBJECT,vo.SVG],[Po.TITLE,vo.SVG]]),sc=[Po.H1,Po.H2,Po.H3,Po.H4,Po.H5,Po.H6],ac=[Po.TR,Po.TEMPLATE,Po.HTML],oc=[Po.TBODY,Po.TFOOT,Po.THEAD,Po.TEMPLATE,Po.HTML],cc=[Po.TABLE,Po.TEMPLATE,Po.HTML],lc=[Po.TD,Po.TH];class hc{constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Po.UNKNOWN,this.current=e}get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Po.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===vo.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){const r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do{t=this.tagIDs.lastIndexOf(e,t-1)}while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==vo.HTML);this.shortenToLength(t<0?0:t)}shortenToLength(e){for(;this.stackTop>=e;){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop=0;n--)if(e.includes(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){const n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(cc,vo.HTML)}clearBackToTableBodyContext(){this.clearBackTo(oc,vo.HTML)}clearBackToTableRowContext(){this.clearBackTo(ac,vo.HTML)}remove(e){const t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Po.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.tagIDs[0]===Po.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===vo.HTML)return!0;if(ic.get(n)===r)return!1}return!0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e],n=this.treeAdapter.getNamespaceURI(this.items[e]);if(Go(t)&&n===vo.HTML)return!0;if(ic.get(t)===n)return!1}return!0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===vo.HTML)return!0;if((n===Po.UL||n===Po.OL)&&r===vo.HTML||ic.get(n)===r)return!1}return!0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t],r=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&r===vo.HTML)return!0;if(n===Po.BUTTON&&r===vo.HTML||ic.get(n)===r)return!1}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===vo.HTML){if(n===e)return!0;if(n===Po.TABLE||n===Po.TEMPLATE||n===Po.HTML)return!1}}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.tagIDs[e];if(this.treeAdapter.getNamespaceURI(this.items[e])===vo.HTML){if(t===Po.TBODY||t===Po.THEAD||t===Po.TFOOT)return!0;if(t===Po.TABLE||t===Po.HTML)return!1}}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];if(this.treeAdapter.getNamespaceURI(this.items[t])===vo.HTML){if(n===e)return!0;if(n!==Po.OPTION&&n!==Po.OPTGROUP)return!1}}return!0}generateImpliedEndTags(){for(;nc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;rc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==e&&rc.has(this.currentTagId);)this.pop()}}var uc;!function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"}(uc=uc||(uc={}));const pc={type:uc.Marker};class fc{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){const n=[],r=t.length,i=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e);for(let e=0;e[e.name,e.value])));let i=0;for(let e=0;er.get(e.name)===e.value))&&(i+=1,i>=3&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(pc)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:uc.Element,element:e,token:t})}insertElementAfterBookmark(e,t){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:uc.Element,element:e,token:t})}removeEntry(e){const t=this.entries.indexOf(e);t>=0&&this.entries.splice(t,1)}clearToLastMarker(){const e=this.entries.indexOf(pc);e>=0?this.entries.splice(0,e+1):this.entries.length=0}getElementEntryInScopeWithTagName(e){const t=this.entries.find((t=>t.type===uc.Marker||this.treeAdapter.getTagName(t.element)===e));return t&&t.type===uc.Element?t:null}getElementEntry(e){return this.entries.find((t=>t.type===uc.Element&&t.element===e))}}function dc(e){return{nodeName:"#text",value:e,parentNode:null}}const Ec={createDocument:()=>({nodeName:"#document",mode:Ro.NO_QUIRKS,childNodes:[]}),createDocumentFragment:()=>({nodeName:"#document-fragment",childNodes:[]}),createElement:(e,t,n)=>({nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}),createCommentNode:e=>({nodeName:"#comment",data:e,parentNode:null}),appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent:e=>e.content,setDocumentType(e,t,n,r){const i=e.childNodes.find((e=>"#documentType"===e.nodeName));if(i)i.name=t,i.publicId=n,i.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ec.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode:e=>e.mode,detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ec.isTextNode(n))return void(n.value+=t)}Ec.appendChild(e,dc(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ec.isTextNode(r)?r.value+=t:Ec.insertBefore(e,dc(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map((e=>e.name)));for(let r=0;re.childNodes[0],getChildNodes:e=>e.childNodes,getParentNode:e=>e.parentNode,getAttrList:e=>e.attrs,getTagName:e=>e.tagName,getNamespaceURI:e=>e.namespaceURI,getTextNodeContent:e=>e.value,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName:e=>e.name,getDocumentTypeNodePublicId:e=>e.publicId,getDocumentTypeNodeSystemId:e=>e.systemId,isTextNode:e=>"#text"===e.nodeName,isCommentNode:e=>"#comment"===e.nodeName,isDocumentTypeNode:e=>"#documentType"===e.nodeName,isElementNode:e=>Object.prototype.hasOwnProperty.call(e,"tagName"),setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},mc=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Tc=[...mc,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],_c=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ac=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],gc=[...Ac,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Nc(e,t){return t.some((t=>e.startsWith(t)))}const Cc="text/html",Ic="application/xhtml+xml",Sc=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),bc=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:vo.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:vo.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:vo.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:vo.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:vo.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:vo.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:vo.XLINK}],["xml:base",{prefix:"xml",name:"base",namespace:vo.XML}],["xml:lang",{prefix:"xml",name:"lang",namespace:vo.XML}],["xml:space",{prefix:"xml",name:"space",namespace:vo.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:vo.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:vo.XMLNS}]]),Oc=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),yc=new Set([Po.B,Po.BIG,Po.BLOCKQUOTE,Po.BODY,Po.BR,Po.CENTER,Po.CODE,Po.DD,Po.DIV,Po.DL,Po.DT,Po.EM,Po.EMBED,Po.H1,Po.H2,Po.H3,Po.H4,Po.H5,Po.H6,Po.HEAD,Po.HR,Po.I,Po.IMG,Po.LI,Po.LISTING,Po.MENU,Po.META,Po.NOBR,Po.OL,Po.P,Po.PRE,Po.RUBY,Po.S,Po.SMALL,Po.SPAN,Po.STRONG,Po.STRIKE,Po.SUB,Po.SUP,Po.TABLE,Po.TT,Po.U,Po.UL,Po.VAR]);function Lc(e){for(let t=0;t0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),null===(r=(n=this.treeAdapter).onItemPop)||void 0===r||r.call(n,e,this.openElements.current),t){let e,t;0===this.openElements.stackTop&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):({current:e,currentTagId:t}=this.openElements),this._setContextModes(e,t)}}_setContextModes(e,t){const n=e===this.document||this.treeAdapter.getNamespaceURI(e)===vo.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,vo.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Rc.TEXT}switchToPlaintextParsing(){this.insertionMode=Rc.TEXT,this.originalInsertionMode=Rc.IN_BODY,this.tokenizer.state=jo.PLAINTEXT}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Mo.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===vo.HTML)switch(this.fragmentContextID){case Po.TITLE:case Po.TEXTAREA:this.tokenizer.state=jo.RCDATA;break;case Po.STYLE:case Po.XMP:case Po.IFRAME:case Po.NOEMBED:case Po.NOFRAMES:case Po.NOSCRIPT:this.tokenizer.state=jo.RAWTEXT;break;case Po.SCRIPT:this.tokenizer.state=jo.SCRIPT_DATA;break;case Po.PLAINTEXT:this.tokenizer.state=jo.PLAINTEXT}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",r=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){const t=this.treeAdapter.getChildNodes(this.document).find((e=>this.treeAdapter.isDocumentTypeNode(e)));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){const n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t,e)}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){const n=this.treeAdapter.createElement(e,vo.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,vo.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Mo.HTML,vo.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Po.HTML)}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?(({parent:t,beforeElement:n}=this._findFosterParentingLocation()),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;const r=this.treeAdapter.getChildNodes(t),i=n?r.lastIndexOf(n):r.length,s=r[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===To.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return 0===this.openElements.stackTop&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):({current:t,currentTagId:n}=this.openElements),(e.tagID!==Po.SVG||this.treeAdapter.getTagName(t)!==Mo.ANNOTATION_XML||this.treeAdapter.getNamespaceURI(t)!==vo.MATHML)&&(this.tokenizer.inForeignNode||(e.tagID===Po.MGLYPH||e.tagID===Po.MALIGNMARK)&&!this._isIntegrationPoint(n,t,vo.HTML))}_processToken(e){switch(e.type){case To.CHARACTER:this.onCharacter(e);break;case To.NULL_CHARACTER:this.onNullCharacter(e);break;case To.COMMENT:this.onComment(e);break;case To.DOCTYPE:this.onDoctype(e);break;case To.START_TAG:this._processStartTag(e);break;case To.END_TAG:this.onEndTag(e);break;case To.EOF:this.onEof(e);break;case To.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Dc(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const t=this.activeFormattingElements.entries.findIndex((e=>e.type===uc.Marker||this.openElements.contains(e.element)));for(let n=t<0?e-1:t-1;n>=0;n--){const e=this.activeFormattingElements.entries[n];this._insertElement(e.token,this.treeAdapter.getNamespaceURI(e.element)),e.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Rc.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(Po.P),this.openElements.popUntilTagNamePopped(Po.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(0===e&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Po.TR:return void(this.insertionMode=Rc.IN_ROW);case Po.TBODY:case Po.THEAD:case Po.TFOOT:return void(this.insertionMode=Rc.IN_TABLE_BODY);case Po.CAPTION:return void(this.insertionMode=Rc.IN_CAPTION);case Po.COLGROUP:return void(this.insertionMode=Rc.IN_COLUMN_GROUP);case Po.TABLE:return void(this.insertionMode=Rc.IN_TABLE);case Po.BODY:return void(this.insertionMode=Rc.IN_BODY);case Po.FRAMESET:return void(this.insertionMode=Rc.IN_FRAMESET);case Po.SELECT:return void this._resetInsertionModeForSelect(e);case Po.TEMPLATE:return void(this.insertionMode=this.tmplInsertionModeStack[0]);case Po.HTML:return void(this.insertionMode=this.headElement?Rc.AFTER_HEAD:Rc.BEFORE_HEAD);case Po.TD:case Po.TH:if(e>0)return void(this.insertionMode=Rc.IN_CELL);break;case Po.HEAD:if(e>0)return void(this.insertionMode=Rc.IN_HEAD)}this.insertionMode=Rc.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.tagIDs[t];if(e===Po.TEMPLATE)break;if(e===Po.TABLE)return void(this.insertionMode=Rc.IN_SELECT_IN_TABLE)}this.insertionMode=Rc.IN_SELECT}_isElementCausesFosterParenting(e){return Pc.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case Po.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===vo.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Po.TABLE:{const n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){const n=this.treeAdapter.getNamespaceURI(e);return Ho[n].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){e._insertCharacters(t),e.framesetOk=!1}(this,e);else switch(this.insertionMode){case Rc.INITIAL:Vc(this,e);break;case Rc.BEFORE_HTML:Wc(this,e);break;case Rc.BEFORE_HEAD:Qc(this,e);break;case Rc.IN_HEAD:zc(this,e);break;case Rc.IN_HEAD_NO_SCRIPT:Jc(this,e);break;case Rc.AFTER_HEAD:Zc(this,e);break;case Rc.IN_BODY:case Rc.IN_CAPTION:case Rc.IN_CELL:case Rc.IN_TEMPLATE:nl(this,e);break;case Rc.TEXT:case Rc.IN_SELECT:case Rc.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Rc.IN_TABLE:case Rc.IN_TABLE_BODY:case Rc.IN_ROW:ul(this,e);break;case Rc.IN_TABLE_TEXT:ml(this,e);break;case Rc.IN_COLUMN_GROUP:gl(this,e);break;case Rc.AFTER_BODY:kl(this,e);break;case Rc.AFTER_AFTER_BODY:vl(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)!function(e,t){t.chars="�",e._insertCharacters(t)}(this,e);else switch(this.insertionMode){case Rc.INITIAL:Vc(this,e);break;case Rc.BEFORE_HTML:Wc(this,e);break;case Rc.BEFORE_HEAD:Qc(this,e);break;case Rc.IN_HEAD:zc(this,e);break;case Rc.IN_HEAD_NO_SCRIPT:Jc(this,e);break;case Rc.AFTER_HEAD:Zc(this,e);break;case Rc.TEXT:this._insertCharacters(e);break;case Rc.IN_TABLE:case Rc.IN_TABLE_BODY:case Rc.IN_ROW:ul(this,e);break;case Rc.IN_COLUMN_GROUP:gl(this,e);break;case Rc.AFTER_BODY:kl(this,e);break;case Rc.AFTER_AFTER_BODY:vl(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)Kc(this,e);else switch(this.insertionMode){case Rc.INITIAL:case Rc.BEFORE_HTML:case Rc.BEFORE_HEAD:case Rc.IN_HEAD:case Rc.IN_HEAD_NO_SCRIPT:case Rc.AFTER_HEAD:case Rc.IN_BODY:case Rc.IN_TABLE:case Rc.IN_CAPTION:case Rc.IN_COLUMN_GROUP:case Rc.IN_TABLE_BODY:case Rc.IN_ROW:case Rc.IN_CELL:case Rc.IN_SELECT:case Rc.IN_SELECT_IN_TABLE:case Rc.IN_TEMPLATE:case Rc.IN_FRAMESET:case Rc.AFTER_FRAMESET:Kc(this,e);break;case Rc.IN_TABLE_TEXT:Tl(this,e);break;case Rc.AFTER_BODY:!function(e,t){e._appendCommentNode(t,e.openElements.items[0])}(this,e);break;case Rc.AFTER_AFTER_BODY:case Rc.AFTER_AFTER_FRAMESET:!function(e,t){e._appendCommentNode(t,e.document)}(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Rc.INITIAL:!function(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ro.QUIRKS:function(e){if("html"!==e.name)return Ro.QUIRKS;const{systemId:t}=e;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return Ro.QUIRKS;let{publicId:n}=e;if(null!==n){if(n=n.toLowerCase(),_c.has(n))return Ro.QUIRKS;let e=null===t?Tc:mc;if(Nc(n,e))return Ro.QUIRKS;if(e=null===t?Ac:gc,Nc(n,e))return Ro.LIMITED_QUIRKS}return Ro.NO_QUIRKS}(t);(function(e){return"html"===e.name&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err(t,Eo.nonConformingDoctype);e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Rc.BEFORE_HTML}(this,e);break;case Rc.BEFORE_HEAD:case Rc.IN_HEAD:case Rc.IN_HEAD_NO_SCRIPT:case Rc.AFTER_HEAD:this._err(e,Eo.misplacedDoctype);break;case Rc.IN_TABLE_TEXT:Tl(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,Eo.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?function(e,t){if(function(e){const t=e.tagID;return t===Po.FONT&&e.attrs.some((({name:e})=>e===Do.COLOR||e===Do.SIZE||e===Do.FACE))||yc.has(t)}(t))Dl(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===vo.MATHML?Lc(t):r===vo.SVG&&(!function(e){const t=Oc.get(e.tagName);null!=t&&(e.tagName=t,e.tagID=Fo(e.tagName))}(t),kc(t)),vc(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Rc.INITIAL:Vc(this,e);break;case Rc.BEFORE_HTML:!function(e,t){t.tagID===Po.HTML?(e._insertElement(t,vo.HTML),e.insertionMode=Rc.BEFORE_HEAD):Wc(e,t)}(this,e);break;case Rc.BEFORE_HEAD:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.HEAD:e._insertElement(t,vo.HTML),e.headElement=e.openElements.current,e.insertionMode=Rc.IN_HEAD;break;default:Qc(e,t)}}(this,e);break;case Rc.IN_HEAD:Xc(this,e);break;case Rc.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.BASEFONT:case Po.BGSOUND:case Po.HEAD:case Po.LINK:case Po.META:case Po.NOFRAMES:case Po.STYLE:Xc(e,t);break;case Po.NOSCRIPT:e._err(t,Eo.nestedNoscriptInHead);break;default:Jc(e,t)}}(this,e);break;case Rc.AFTER_HEAD:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.BODY:e._insertElement(t,vo.HTML),e.framesetOk=!1,e.insertionMode=Rc.IN_BODY;break;case Po.FRAMESET:e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_FRAMESET;break;case Po.BASE:case Po.BASEFONT:case Po.BGSOUND:case Po.LINK:case Po.META:case Po.NOFRAMES:case Po.SCRIPT:case Po.STYLE:case Po.TEMPLATE:case Po.TITLE:e._err(t,Eo.abandonedHeadElementChild),e.openElements.push(e.headElement,Po.HEAD),Xc(e,t),e.openElements.remove(e.headElement);break;case Po.HEAD:e._err(t,Eo.misplacedStartTagForHeadElement);break;default:Zc(e,t)}}(this,e);break;case Rc.IN_BODY:ol(this,e);break;case Rc.IN_TABLE:pl(this,e);break;case Rc.IN_TABLE_TEXT:Tl(this,e);break;case Rc.IN_CAPTION:!function(e,t){const n=t.tagID;_l.has(n)?e.openElements.hasInTableScope(Po.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Po.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Rc.IN_TABLE,pl(e,t)):ol(e,t)}(this,e);break;case Rc.IN_COLUMN_GROUP:Al(this,e);break;case Rc.IN_TABLE_BODY:Nl(this,e);break;case Rc.IN_ROW:Il(this,e);break;case Rc.IN_CELL:!function(e,t){const n=t.tagID;_l.has(n)?(e.openElements.hasInTableScope(Po.TD)||e.openElements.hasInTableScope(Po.TH))&&(e._closeTableCell(),Il(e,t)):ol(e,t)}(this,e);break;case Rc.IN_SELECT:bl(this,e);break;case Rc.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===Po.CAPTION||n===Po.TABLE||n===Po.TBODY||n===Po.TFOOT||n===Po.THEAD||n===Po.TR||n===Po.TD||n===Po.TH?(e.openElements.popUntilTagNamePopped(Po.SELECT),e._resetInsertionMode(),e._processStartTag(t)):bl(e,t)}(this,e);break;case Rc.IN_TEMPLATE:!function(e,t){switch(t.tagID){case Po.BASE:case Po.BASEFONT:case Po.BGSOUND:case Po.LINK:case Po.META:case Po.NOFRAMES:case Po.SCRIPT:case Po.STYLE:case Po.TEMPLATE:case Po.TITLE:Xc(e,t);break;case Po.CAPTION:case Po.COLGROUP:case Po.TBODY:case Po.TFOOT:case Po.THEAD:e.tmplInsertionModeStack[0]=Rc.IN_TABLE,e.insertionMode=Rc.IN_TABLE,pl(e,t);break;case Po.COL:e.tmplInsertionModeStack[0]=Rc.IN_COLUMN_GROUP,e.insertionMode=Rc.IN_COLUMN_GROUP,Al(e,t);break;case Po.TR:e.tmplInsertionModeStack[0]=Rc.IN_TABLE_BODY,e.insertionMode=Rc.IN_TABLE_BODY,Nl(e,t);break;case Po.TD:case Po.TH:e.tmplInsertionModeStack[0]=Rc.IN_ROW,e.insertionMode=Rc.IN_ROW,Il(e,t);break;default:e.tmplInsertionModeStack[0]=Rc.IN_BODY,e.insertionMode=Rc.IN_BODY,ol(e,t)}}(this,e);break;case Rc.AFTER_BODY:!function(e,t){t.tagID===Po.HTML?ol(e,t):kl(e,t)}(this,e);break;case Rc.IN_FRAMESET:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.FRAMESET:e._insertElement(t,vo.HTML);break;case Po.FRAME:e._appendElement(t,vo.HTML),t.ackSelfClosing=!0;break;case Po.NOFRAMES:Xc(e,t)}}(this,e);break;case Rc.AFTER_FRAMESET:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.NOFRAMES:Xc(e,t)}}(this,e);break;case Rc.AFTER_AFTER_BODY:!function(e,t){t.tagID===Po.HTML?ol(e,t):vl(e,t)}(this,e);break;case Rc.AFTER_AFTER_FRAMESET:!function(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.NOFRAMES:Xc(e,t)}}(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?function(e,t){if(t.tagID===Po.P||t.tagID===Po.BR)return Dl(e),void e._endTagOutsideForeignContent(t);for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===vo.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Rc.INITIAL:Vc(this,e);break;case Rc.BEFORE_HTML:!function(e,t){const n=t.tagID;n!==Po.HTML&&n!==Po.HEAD&&n!==Po.BODY&&n!==Po.BR||Wc(e,t)}(this,e);break;case Rc.BEFORE_HEAD:!function(e,t){const n=t.tagID;n===Po.HEAD||n===Po.BODY||n===Po.HTML||n===Po.BR?Qc(e,t):e._err(t,Eo.endTagWithoutMatchingOpenElement)}(this,e);break;case Rc.IN_HEAD:!function(e,t){switch(t.tagID){case Po.HEAD:e.openElements.pop(),e.insertionMode=Rc.AFTER_HEAD;break;case Po.BODY:case Po.BR:case Po.HTML:zc(e,t);break;case Po.TEMPLATE:$c(e,t);break;default:e._err(t,Eo.endTagWithoutMatchingOpenElement)}}(this,e);break;case Rc.IN_HEAD_NO_SCRIPT:!function(e,t){switch(t.tagID){case Po.NOSCRIPT:e.openElements.pop(),e.insertionMode=Rc.IN_HEAD;break;case Po.BR:Jc(e,t);break;default:e._err(t,Eo.endTagWithoutMatchingOpenElement)}}(this,e);break;case Rc.AFTER_HEAD:!function(e,t){switch(t.tagID){case Po.BODY:case Po.HTML:case Po.BR:Zc(e,t);break;case Po.TEMPLATE:$c(e,t);break;default:e._err(t,Eo.endTagWithoutMatchingOpenElement)}}(this,e);break;case Rc.IN_BODY:ll(this,e);break;case Rc.TEXT:!function(e,t){var n;t.tagID===Po.SCRIPT&&(null===(n=e.scriptHandler)||void 0===n||n.call(e,e.openElements.current));e.openElements.pop(),e.insertionMode=e.originalInsertionMode}(this,e);break;case Rc.IN_TABLE:fl(this,e);break;case Rc.IN_TABLE_TEXT:Tl(this,e);break;case Rc.IN_CAPTION:!function(e,t){const n=t.tagID;switch(n){case Po.CAPTION:case Po.TABLE:e.openElements.hasInTableScope(Po.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Po.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Rc.IN_TABLE,n===Po.TABLE&&fl(e,t));break;case Po.BODY:case Po.COL:case Po.COLGROUP:case Po.HTML:case Po.TBODY:case Po.TD:case Po.TFOOT:case Po.TH:case Po.THEAD:case Po.TR:break;default:ll(e,t)}}(this,e);break;case Rc.IN_COLUMN_GROUP:!function(e,t){switch(t.tagID){case Po.COLGROUP:e.openElements.currentTagId===Po.COLGROUP&&(e.openElements.pop(),e.insertionMode=Rc.IN_TABLE);break;case Po.TEMPLATE:$c(e,t);break;case Po.COL:break;default:gl(e,t)}}(this,e);break;case Rc.IN_TABLE_BODY:Cl(this,e);break;case Rc.IN_ROW:Sl(this,e);break;case Rc.IN_CELL:!function(e,t){const n=t.tagID;switch(n){case Po.TD:case Po.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Rc.IN_ROW);break;case Po.TABLE:case Po.TBODY:case Po.TFOOT:case Po.THEAD:case Po.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Sl(e,t));break;case Po.BODY:case Po.CAPTION:case Po.COL:case Po.COLGROUP:case Po.HTML:break;default:ll(e,t)}}(this,e);break;case Rc.IN_SELECT:Ol(this,e);break;case Rc.IN_SELECT_IN_TABLE:!function(e,t){const n=t.tagID;n===Po.CAPTION||n===Po.TABLE||n===Po.TBODY||n===Po.TFOOT||n===Po.THEAD||n===Po.TR||n===Po.TD||n===Po.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Po.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Ol(e,t)}(this,e);break;case Rc.IN_TEMPLATE:!function(e,t){t.tagID===Po.TEMPLATE&&$c(e,t)}(this,e);break;case Rc.AFTER_BODY:Ll(this,e);break;case Rc.IN_FRAMESET:!function(e,t){t.tagID!==Po.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagId===Po.FRAMESET||(e.insertionMode=Rc.AFTER_FRAMESET))}(this,e);break;case Rc.AFTER_FRAMESET:!function(e,t){t.tagID===Po.HTML&&(e.insertionMode=Rc.AFTER_AFTER_FRAMESET)}(this,e);break;case Rc.AFTER_AFTER_BODY:vl(this,e)}}onEof(e){switch(this.insertionMode){case Rc.INITIAL:Vc(this,e);break;case Rc.BEFORE_HTML:Wc(this,e);break;case Rc.BEFORE_HEAD:Qc(this,e);break;case Rc.IN_HEAD:zc(this,e);break;case Rc.IN_HEAD_NO_SCRIPT:Jc(this,e);break;case Rc.AFTER_HEAD:Zc(this,e);break;case Rc.IN_BODY:case Rc.IN_TABLE:case Rc.IN_CAPTION:case Rc.IN_COLUMN_GROUP:case Rc.IN_TABLE_BODY:case Rc.IN_ROW:case Rc.IN_CELL:case Rc.IN_SELECT:case Rc.IN_SELECT_IN_TABLE:hl(this,e);break;case Rc.TEXT:!function(e,t){e._err(t,Eo.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}(this,e);break;case Rc.IN_TABLE_TEXT:Tl(this,e);break;case Rc.IN_TEMPLATE:yl(this,e);break;case Rc.AFTER_BODY:case Rc.IN_FRAMESET:case Rc.AFTER_FRAMESET:case Rc.AFTER_AFTER_BODY:case Rc.AFTER_AFTER_FRAMESET:jc(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===io.LINE_FEED)){if(1===e.chars.length)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case Rc.IN_HEAD:case Rc.IN_HEAD_NO_SCRIPT:case Rc.AFTER_HEAD:case Rc.TEXT:case Rc.IN_COLUMN_GROUP:case Rc.IN_SELECT:case Rc.IN_SELECT_IN_TABLE:case Rc.IN_FRAMESET:case Rc.AFTER_FRAMESET:this._insertCharacters(e);break;case Rc.IN_BODY:case Rc.IN_CAPTION:case Rc.IN_CELL:case Rc.IN_TEMPLATE:case Rc.AFTER_BODY:case Rc.AFTER_AFTER_BODY:case Rc.AFTER_AFTER_FRAMESET:tl(this,e);break;case Rc.IN_TABLE:case Rc.IN_TABLE_BODY:case Rc.IN_ROW:ul(this,e);break;case Rc.IN_TABLE_TEXT:El(this,e)}}}function Bc(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):cl(e,t),n}function Fc(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(r<0?0:r),e.activeFormattingElements.removeEntry(t)),n}function Uc(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const n=e.activeFormattingElements.getElementEntry(a),o=n&&s>=3;!n||o?(o&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(a)):(a=Hc(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Hc(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Gc(e,t,n){const r=Fo(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);r===Po.TEMPLATE&&i===vo.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Yc(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function qc(e,t){for(let n=0;n<8;n++){const n=Bc(e,t);if(!n)break;const r=Fc(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;const i=Uc(e,r,n.element),s=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),s&&Gc(e,s,i),Yc(e,r,n)}}function Kc(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function jc(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){const n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Vc(e,t){e._err(t,Eo.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ro.QUIRKS),e.insertionMode=Rc.BEFORE_HTML,e._processToken(t)}function Wc(e,t){e._insertFakeRootElement(),e.insertionMode=Rc.BEFORE_HEAD,e._processToken(t)}function Qc(e,t){e._insertFakeElement(Mo.HEAD,Po.HEAD),e.headElement=e.openElements.current,e.insertionMode=Rc.IN_HEAD,e._processToken(t)}function Xc(e,t){switch(t.tagID){case Po.HTML:ol(e,t);break;case Po.BASE:case Po.BASEFONT:case Po.BGSOUND:case Po.LINK:case Po.META:e._appendElement(t,vo.HTML),t.ackSelfClosing=!0;break;case Po.TITLE:e._switchToTextParsing(t,jo.RCDATA);break;case Po.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,jo.RAWTEXT):(e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_HEAD_NO_SCRIPT);break;case Po.NOFRAMES:case Po.STYLE:e._switchToTextParsing(t,jo.RAWTEXT);break;case Po.SCRIPT:e._switchToTextParsing(t,jo.SCRIPT_DATA);break;case Po.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Rc.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Rc.IN_TEMPLATE);break;case Po.HEAD:e._err(t,Eo.misplacedStartTagForHeadElement);break;default:zc(e,t)}}function $c(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Po.TEMPLATE&&e._err(t,Eo.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Po.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Eo.endTagWithoutMatchingOpenElement)}function zc(e,t){e.openElements.pop(),e.insertionMode=Rc.AFTER_HEAD,e._processToken(t)}function Jc(e,t){const n=t.type===To.EOF?Eo.openElementsLeftAfterEof:Eo.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Rc.IN_HEAD,e._processToken(t)}function Zc(e,t){e._insertFakeElement(Mo.BODY,Po.BODY),e.insertionMode=Rc.IN_BODY,el(e,t)}function el(e,t){switch(t.type){case To.CHARACTER:nl(e,t);break;case To.WHITESPACE_CHARACTER:tl(e,t);break;case To.COMMENT:Kc(e,t);break;case To.START_TAG:ol(e,t);break;case To.END_TAG:ll(e,t);break;case To.EOF:hl(e,t)}}function tl(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function nl(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function rl(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,vo.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function il(e){const t=_o(e,Do.TYPE);return null!=t&&"hidden"===t.toLowerCase()}function sl(e,t){e._switchToTextParsing(t,jo.RAWTEXT)}function al(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML)}function ol(e,t){switch(t.tagID){case Po.I:case Po.S:case Po.B:case Po.U:case Po.EM:case Po.TT:case Po.BIG:case Po.CODE:case Po.FONT:case Po.SMALL:case Po.STRIKE:case Po.STRONG:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case Po.A:!function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Mo.A);n&&(qc(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case Po.H1:case Po.H2:case Po.H3:case Po.H4:case Po.H5:case Po.H6:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),Go(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,vo.HTML)}(e,t);break;case Po.P:case Po.DL:case Po.OL:case Po.UL:case Po.DIV:case Po.DIR:case Po.NAV:case Po.MAIN:case Po.MENU:case Po.ASIDE:case Po.CENTER:case Po.FIGURE:case Po.FOOTER:case Po.HEADER:case Po.HGROUP:case Po.DIALOG:case Po.DETAILS:case Po.ADDRESS:case Po.ARTICLE:case Po.SECTION:case Po.SUMMARY:case Po.FIELDSET:case Po.BLOCKQUOTE:case Po.FIGCAPTION:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML)}(e,t);break;case Po.LI:case Po.DD:case Po.DT:!function(e,t){e.framesetOk=!1;const n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){const r=e.openElements.tagIDs[t];if(n===Po.LI&&r===Po.LI||(n===Po.DD||n===Po.DT)&&(r===Po.DD||r===Po.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Po.ADDRESS&&r!==Po.DIV&&r!==Po.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML)}(e,t);break;case Po.BR:case Po.IMG:case Po.WBR:case Po.AREA:case Po.EMBED:case Po.KEYGEN:rl(e,t);break;case Po.HR:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._appendElement(t,vo.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}(e,t);break;case Po.RB:case Po.RTC:!function(e,t){e.openElements.hasInScope(Po.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,vo.HTML)}(e,t);break;case Po.RT:case Po.RP:!function(e,t){e.openElements.hasInScope(Po.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Po.RTC),e._insertElement(t,vo.HTML)}(e,t);break;case Po.PRE:case Po.LISTING:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}(e,t);break;case Po.XMP:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,jo.RAWTEXT)}(e,t);break;case Po.SVG:!function(e,t){e._reconstructActiveFormattingElements(),kc(t),vc(t),t.selfClosing?e._appendElement(t,vo.SVG):e._insertElement(t,vo.SVG),t.ackSelfClosing=!0}(e,t);break;case Po.HTML:!function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}(e,t);break;case Po.BASE:case Po.LINK:case Po.META:case Po.STYLE:case Po.TITLE:case Po.SCRIPT:case Po.BGSOUND:case Po.BASEFONT:case Po.TEMPLATE:Xc(e,t);break;case Po.BODY:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}(e,t);break;case Po.FORM:!function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML),n||(e.formElement=e.openElements.current))}(e,t);break;case Po.NOBR:!function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Po.NOBR)&&(qc(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,vo.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}(e,t);break;case Po.MATH:!function(e,t){e._reconstructActiveFormattingElements(),Lc(t),vc(t),t.selfClosing?e._appendElement(t,vo.MATHML):e._insertElement(t,vo.MATHML),t.ackSelfClosing=!0}(e,t);break;case Po.TABLE:!function(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ro.QUIRKS&&e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML),e.framesetOk=!1,e.insertionMode=Rc.IN_TABLE}(e,t);break;case Po.INPUT:!function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,vo.HTML),il(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}(e,t);break;case Po.PARAM:case Po.TRACK:case Po.SOURCE:!function(e,t){e._appendElement(t,vo.HTML),t.ackSelfClosing=!0}(e,t);break;case Po.IMAGE:!function(e,t){t.tagName=Mo.IMG,t.tagID=Po.IMG,rl(e,t)}(e,t);break;case Po.BUTTON:!function(e,t){e.openElements.hasInScope(Po.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Po.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML),e.framesetOk=!1}(e,t);break;case Po.APPLET:case Po.OBJECT:case Po.MARQUEE:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}(e,t);break;case Po.IFRAME:!function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,jo.RAWTEXT)}(e,t);break;case Po.SELECT:!function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Rc.IN_TABLE||e.insertionMode===Rc.IN_CAPTION||e.insertionMode===Rc.IN_TABLE_BODY||e.insertionMode===Rc.IN_ROW||e.insertionMode===Rc.IN_CELL?Rc.IN_SELECT_IN_TABLE:Rc.IN_SELECT}(e,t);break;case Po.OPTION:case Po.OPTGROUP:!function(e,t){e.openElements.currentTagId===Po.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,vo.HTML)}(e,t);break;case Po.NOEMBED:sl(e,t);break;case Po.FRAMESET:!function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_FRAMESET)}(e,t);break;case Po.TEXTAREA:!function(e,t){e._insertElement(t,vo.HTML),e.skipNextNewLine=!0,e.tokenizer.state=jo.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Rc.TEXT}(e,t);break;case Po.NOSCRIPT:e.options.scriptingEnabled?sl(e,t):al(e,t);break;case Po.PLAINTEXT:!function(e,t){e.openElements.hasInButtonScope(Po.P)&&e._closePElement(),e._insertElement(t,vo.HTML),e.tokenizer.state=jo.PLAINTEXT}(e,t);break;case Po.COL:case Po.TH:case Po.TD:case Po.TR:case Po.HEAD:case Po.FRAME:case Po.TBODY:case Po.TFOOT:case Po.THEAD:case Po.CAPTION:case Po.COLGROUP:break;default:al(e,t)}}function cl(e,t){const n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){const i=e.openElements.items[t],s=e.openElements.tagIDs[t];if(r===s&&(r!==Po.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,s))break}}function ll(e,t){switch(t.tagID){case Po.A:case Po.B:case Po.I:case Po.S:case Po.U:case Po.EM:case Po.TT:case Po.BIG:case Po.CODE:case Po.FONT:case Po.NOBR:case Po.SMALL:case Po.STRIKE:case Po.STRONG:qc(e,t);break;case Po.P:!function(e){e.openElements.hasInButtonScope(Po.P)||e._insertFakeElement(Mo.P,Po.P),e._closePElement()}(e);break;case Po.DL:case Po.UL:case Po.OL:case Po.DIR:case Po.DIV:case Po.NAV:case Po.PRE:case Po.MAIN:case Po.MENU:case Po.ASIDE:case Po.BUTTON:case Po.CENTER:case Po.FIGURE:case Po.FOOTER:case Po.HEADER:case Po.HGROUP:case Po.DIALOG:case Po.ADDRESS:case Po.ARTICLE:case Po.DETAILS:case Po.SECTION:case Po.SUMMARY:case Po.LISTING:case Po.FIELDSET:case Po.BLOCKQUOTE:case Po.FIGCAPTION:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case Po.LI:!function(e){e.openElements.hasInListItemScope(Po.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Po.LI),e.openElements.popUntilTagNamePopped(Po.LI))}(e);break;case Po.DD:case Po.DT:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}(e,t);break;case Po.H1:case Po.H2:case Po.H3:case Po.H4:case Po.H5:case Po.H6:!function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}(e);break;case Po.BR:!function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Mo.BR,Po.BR),e.openElements.pop(),e.framesetOk=!1}(e);break;case Po.BODY:!function(e,t){if(e.openElements.hasInScope(Po.BODY)&&(e.insertionMode=Rc.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}(e,t);break;case Po.HTML:!function(e,t){e.openElements.hasInScope(Po.BODY)&&(e.insertionMode=Rc.AFTER_BODY,Ll(e,t))}(e,t);break;case Po.FORM:!function(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Po.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Po.FORM):n&&e.openElements.remove(n))}(e);break;case Po.APPLET:case Po.OBJECT:case Po.MARQUEE:!function(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}(e,t);break;case Po.TEMPLATE:$c(e,t);break;default:cl(e,t)}}function hl(e,t){e.tmplInsertionModeStack.length>0?yl(e,t):jc(e,t)}function ul(e,t){if(Pc.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Rc.IN_TABLE_TEXT,t.type){case To.CHARACTER:ml(e,t);break;case To.WHITESPACE_CHARACTER:El(e,t)}else dl(e,t)}function pl(e,t){switch(t.tagID){case Po.TD:case Po.TH:case Po.TR:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Mo.TBODY,Po.TBODY),e.insertionMode=Rc.IN_TABLE_BODY,Nl(e,t)}(e,t);break;case Po.STYLE:case Po.SCRIPT:case Po.TEMPLATE:Xc(e,t);break;case Po.COL:!function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Mo.COLGROUP,Po.COLGROUP),e.insertionMode=Rc.IN_COLUMN_GROUP,Al(e,t)}(e,t);break;case Po.FORM:!function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,vo.HTML),e.formElement=e.openElements.current,e.openElements.pop())}(e,t);break;case Po.TABLE:!function(e,t){e.openElements.hasInTableScope(Po.TABLE)&&(e.openElements.popUntilTagNamePopped(Po.TABLE),e._resetInsertionMode(),e._processStartTag(t))}(e,t);break;case Po.TBODY:case Po.TFOOT:case Po.THEAD:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_TABLE_BODY}(e,t);break;case Po.INPUT:!function(e,t){il(t)?e._appendElement(t,vo.HTML):dl(e,t),t.ackSelfClosing=!0}(e,t);break;case Po.CAPTION:!function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_CAPTION}(e,t);break;case Po.COLGROUP:!function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,vo.HTML),e.insertionMode=Rc.IN_COLUMN_GROUP}(e,t);break;default:dl(e,t)}}function fl(e,t){switch(t.tagID){case Po.TABLE:e.openElements.hasInTableScope(Po.TABLE)&&(e.openElements.popUntilTagNamePopped(Po.TABLE),e._resetInsertionMode());break;case Po.TEMPLATE:$c(e,t);break;case Po.BODY:case Po.CAPTION:case Po.COL:case Po.COLGROUP:case Po.HTML:case Po.TBODY:case Po.TD:case Po.TFOOT:case Po.TH:case Po.THEAD:case Po.TR:break;default:dl(e,t)}}function dl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,el(e,t),e.fosterParentingEnabled=n}function El(e,t){e.pendingCharacterTokens.push(t)}function ml(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Tl(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===Po.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Po.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Po.OPTGROUP&&e.openElements.pop();break;case Po.OPTION:e.openElements.currentTagId===Po.OPTION&&e.openElements.pop();break;case Po.SELECT:e.openElements.hasInSelectScope(Po.SELECT)&&(e.openElements.popUntilTagNamePopped(Po.SELECT),e._resetInsertionMode());break;case Po.TEMPLATE:$c(e,t)}}function yl(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Po.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):jc(e,t)}function Ll(e,t){var n;if(t.tagID===Po.HTML){if(e.fragmentContext||(e.insertionMode=Rc.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Po.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(null===(n=e.treeAdapter.getNodeSourceCodeLocation(r))||void 0===n?void 0:n.endTag)&&e._setEndLocation(r,t)}}else kl(e,t)}function kl(e,t){e.insertionMode=Rc.IN_BODY,el(e,t)}function vl(e,t){e.insertionMode=Rc.IN_BODY,el(e,t)}function Dl(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==vo.HTML&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}var Rl=Ke((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var n=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function r(e){for(var r,i="",s=0;null!==(r=t.xmlReplacer.exec(e));){var a=r.index,o=e.charCodeAt(a),c=n.get(o);void 0!==c?(i+=e.substring(s,a)+c,s=a+1):(i+="".concat(e.substring(s,a),"&#x").concat((0,t.getCodePoint)(e,a).toString(16),";"),s=t.xmlReplacer.lastIndex+=Number(55296==(64512&o)))}return i+e.substr(s)}function i(e,t){return function(n){for(var r,i=0,s="";r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i)}}t.getCodePoint=null!=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)},t.encodeXML=r,t.escape=r,t.escapeUTF8=i(/[&<>'"]/g,n),t.escapeAttribute=i(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=i(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))}));qe(Rl);var Ml=Rl.escapeText,Pl=Rl.escapeAttribute;Rl.escapeUTF8,Rl.escape,Rl.encodeXML,Rl.getCodePoint,Rl.xmlReplacer;const xl=new Set([Mo.AREA,Mo.BASE,Mo.BASEFONT,Mo.BGSOUND,Mo.BR,Mo.COL,Mo.EMBED,Mo.FRAME,Mo.HR,Mo.IMG,Mo.INPUT,Mo.KEYGEN,Mo.LINK,Mo.META,Mo.PARAM,Mo.SOURCE,Mo.TRACK,Mo.WBR]);const wl={treeAdapter:Ec,scriptingEnabled:!0};function Bl(e,t){return Fl(e,{...wl,...t})}function Fl(e,t){return t.treeAdapter.isElementNode(e)?function(e,t){const n=t.treeAdapter.getTagName(e);return`<${n}${function(e,{treeAdapter:t}){let n="";for(const r of t.getAttrList(e)){if(n+=" ",r.namespace)switch(r.namespace){case vo.XML:n+=`xml:${r.name}`;break;case vo.XMLNS:"xmlns"!==r.name&&(n+="xmlns:"),n+=r.name;break;case vo.XLINK:n+=`xlink:${r.name}`;break;default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${Pl(r.value)}"`}return n}(e,t)}>${function(e,t){return t.treeAdapter.isElementNode(e)&&t.treeAdapter.getNamespaceURI(e)===vo.HTML&&xl.has(t.treeAdapter.getTagName(e))}(e,t)?"":`${function(e,t){let n="";const r=t.treeAdapter.isElementNode(e)&&t.treeAdapter.getTagName(e)===Mo.TEMPLATE&&t.treeAdapter.getNamespaceURI(e)===vo.HTML?t.treeAdapter.getTemplateContent(e):e,i=t.treeAdapter.getChildNodes(r);if(i)for(const e of i)n+=Fl(e,t);return n}(e,t)}`}`}(e,t):t.treeAdapter.isTextNode(e)?function(e,t){const{treeAdapter:n}=t,r=n.getTextNodeContent(e),i=n.getParentNode(e),s=i&&n.isElementNode(i)&&n.getTagName(i);return s&&n.getNamespaceURI(i)===vo.HTML&&(a=s,o=t.scriptingEnabled,Yo.has(a)||o&&a===Mo.NOSCRIPT)?r:Ml(r);var a,o}(e,t):t.treeAdapter.isCommentNode(e)?function(e,{treeAdapter:t}){return`\x3c!--${t.getCommentNodeContent(e)}--\x3e`}(e,t):t.treeAdapter.isDocumentTypeNode(e)?function(e,{treeAdapter:t}){return``}(e,t):""}function Ul(e){return new m(e)}function Hl(e){const t=e.includes('"')?"'":'"';return t+e+t}const Gl={isCommentNode:O,isElementNode:I,isTextNode:b,createDocument(){const e=new N([]);return e["x-mode"]=Ro.NO_QUIRKS,e},createDocumentFragment:()=>new N([]),createElement(e,t,n){const r=Object.create(null),i=Object.create(null),s=Object.create(null);for(let e=0;enew T(e),appendChild(e,t){const n=e.children[e.children.length-1];n&&(n.next=t,t.prev=n),e.children.push(t),t.parent=e},insertBefore(e,t,n){const r=e.children.indexOf(n),{prev:i}=n;i&&(i.next=t,t.prev=i),n.prev=t,t.next=n,e.children.splice(r,0,t),t.parent=e},setTemplateContent(e,t){Gl.appendChild(e,t)},getTemplateContent:e=>e.children[0],setDocumentType(e,t,n,r){const i=function(e,t,n){let r="!DOCTYPE ";return e&&(r+=e),t?r+=` PUBLIC ${Hl(t)}`:n&&(r+=" SYSTEM"),n&&(r+=` ${Hl(n)}`),r}(t,n,r);let s=e.children.find((e=>y(e)&&"!doctype"===e.name));s?s.data=null!=i?i:null:(s=new _("!doctype",i),Gl.appendChild(e,s)),s["x-name"]=null!=t?t:void 0,s["x-publicId"]=null!=n?n:void 0,s["x-systemId"]=null!=r?r:void 0},setDocumentMode(e,t){e["x-mode"]=t},getDocumentMode:e=>e["x-mode"],detachNode(e){if(e.parent){const t=e.parent.children.indexOf(e),{prev:n,next:r}=e;e.prev=null,e.next=null,n&&(n.next=r),r&&(r.prev=n),e.parent.children.splice(t,1),e.parent=null}},insertText(e,t){const n=e.children[e.children.length-1];n&&b(n)?n.data+=t:Gl.appendChild(e,Ul(t))},insertTextBefore(e,t,n){const r=e.children[e.children.indexOf(n)-1];r&&b(r)?r.data+=t:Gl.insertBefore(e,Ul(t),n)},adoptAttributes(e,t){for(let n=0;ne.children[0],getChildNodes:e=>e.children,getParentNode:e=>e.parent,getAttrList:e=>e.attributes,getTagName:e=>e.name,getNamespaceURI:e=>e.namespace,getTextNodeContent:e=>e.data,getCommentNodeContent:e=>e.data,getDocumentTypeNodeName(e){var t;return null!==(t=e["x-name"])&&void 0!==t?t:""},getDocumentTypeNodePublicId(e){var t;return null!==(t=e["x-publicId"])&&void 0!==t?t:""},getDocumentTypeNodeSystemId(e){var t;return null!==(t=e["x-systemId"])&&void 0!==t?t:""},isDocumentTypeNode:e=>y(e)&&"!doctype"===e.name,setNodeSourceCodeLocation(e,t){t&&(e.startIndex=t.startOffset,e.endIndex=t.endOffset),e.sourceCodeLocation=t},getNodeSourceCodeLocation:e=>e.sourceCodeLocation,updateNodeSourceCodeLocation(e,t){null!=t.endOffset&&(e.endIndex=t.endOffset),e.sourceCodeLocation={...e.sourceCodeLocation,...t}}};var Yl=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i=Kl.Zero&&e<=Kl.Nine}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Num=35]="Num",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(Kl||(Kl={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.BeforeEntity=25]="BeforeEntity",e[e.BeforeNumericEntity=26]="BeforeNumericEntity",e[e.InNamedEntity=27]="InNamedEntity",e[e.InNumericEntity=28]="InNumericEntity",e[e.InHexEntity=29]="InHexEntity"}(jl||(jl={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(Vl||(Vl={}));const zl={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])};class Jl{constructor({xmlMode:e=!1,decodeEntities:t=!0},n){this.cbs=n,this.state=jl.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=jl.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=e,this.decodeEntities=t,this.entityTrie=e?xo:wo}reset(){this.state=jl.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=jl.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=jl.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===Kl.Amp&&(this.state=jl.BeforeEntity)}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?Xl(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=jl.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===Kl.Gt||Ql(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart=Kl.LowerA&&e<=Kl.LowerZ||e>=Kl.UpperA&&e<=Kl.UpperZ}(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=jl.SpecialStartSequence}stateBeforeTagName(e){if(e===Kl.ExclamationMark)this.state=jl.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===Kl.Questionmark)this.state=jl.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const t=32|e;this.sectionStart=this.index,this.xmlMode||t!==zl.TitleEnd[2]?this.state=this.xmlMode||t!==zl.ScriptEnd[2]?jl.InTagName:jl.BeforeSpecialS:this.startSpecial(zl.TitleEnd,3)}else e===Kl.Slash?this.state=jl.BeforeClosingTagName:(this.state=jl.Text,this.stateText(e))}stateInTagName(e){Xl(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Ql(e)||(e===Kl.Gt?this.state=jl.Text:(this.state=this.isTagStartChar(e)?jl.InClosingTagName:jl.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===Kl.Gt||Ql(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===Kl.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=jl.InSpecialTag,this.sequenceIndex=0):this.state=jl.Text,this.baseState=this.state,this.sectionStart=this.index+1):e===Kl.Slash?this.state=jl.InSelfClosingTag:Ql(e)||(this.state=jl.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===Kl.Gt?(this.cbs.onselfclosingtag(this.index),this.state=jl.Text,this.baseState=jl.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Ql(e)||(this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===Kl.Eq||Xl(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=jl.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===Kl.Eq?this.state=jl.BeforeAttributeValue:e===Kl.Slash||e===Kl.Gt?(this.cbs.onattribend(Vl.NoValue,this.index),this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e)):Ql(e)||(this.cbs.onattribend(Vl.NoValue,this.index),this.state=jl.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===Kl.DoubleQuote?(this.state=jl.InAttributeValueDq,this.sectionStart=this.index+1):e===Kl.SingleQuote?(this.state=jl.InAttributeValueSq,this.sectionStart=this.index+1):Ql(e)||(this.sectionStart=this.index,this.state=jl.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===Kl.DoubleQuote?Vl.Double:Vl.Single,this.index),this.state=jl.BeforeAttributeName):this.decodeEntities&&e===Kl.Amp&&(this.baseState=this.state,this.state=jl.BeforeEntity)}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,Kl.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,Kl.SingleQuote)}stateInAttributeValueNoQuotes(e){Ql(e)||e===Kl.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Vl.Unquoted,this.index),this.state=jl.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===Kl.Amp&&(this.baseState=this.state,this.state=jl.BeforeEntity)}stateBeforeDeclaration(e){e===Kl.OpeningSquareBracket?(this.state=jl.CDATASequence,this.sequenceIndex=0):this.state=e===Kl.Dash?jl.BeforeComment:jl.InDeclaration}stateInDeclaration(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=jl.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===Kl.Dash?(this.state=jl.InCommentLike,this.currentSequence=zl.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=jl.InDeclaration}stateInSpecialComment(e){(e===Kl.Gt||this.fastForwardTo(Kl.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=jl.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const t=32|e;t===zl.ScriptEnd[3]?this.startSpecial(zl.ScriptEnd,4):t===zl.StyleEnd[3]?this.startSpecial(zl.StyleEnd,4):(this.state=jl.InTagName,this.stateInTagName(e))}stateBeforeEntity(e){this.entityExcess=1,this.entityResult=0,e===Kl.Num?this.state=jl.BeforeNumericEntity:e===Kl.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=jl.InNamedEntity,this.stateInNamedEntity(e))}stateInNamedEntity(e){if(this.entityExcess+=1,this.trieIndex=Oo(this.entityTrie,this.trieCurrent,this.trieIndex+1,e),this.trieIndex<0)return this.emitNamedEntity(),void this.index--;this.trieCurrent=this.entityTrie[this.trieIndex];const t=this.trieCurrent&yo.VALUE_LENGTH;if(t){const n=(t>>14)-1;if(this.allowLegacyEntity()||e===Kl.Semi){const e=this.index-this.entityExcess+1;e>this.sectionStart&&this.emitPartial(this.sectionStart,e),this.entityResult=this.trieIndex,this.trieIndex+=n,this.entityExcess=0,this.sectionStart=this.index+1,0===n&&this.emitNamedEntity()}else this.trieIndex+=n}}emitNamedEntity(){if(this.state=this.baseState,0===this.entityResult)return;switch((this.entityTrie[this.entityResult]&yo.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~yo.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}stateBeforeNumericEntity(e){(32|e)===Kl.LowerX?(this.entityExcess++,this.state=jl.InHexEntity):(this.state=jl.InNumericEntity,this.stateInNumericEntity(e))}emitNumericEntity(e){const t=this.index-this.entityExcess-1;t+2+Number(this.state===jl.InHexEntity)!==this.index&&(t>this.sectionStart&&this.emitPartial(this.sectionStart,t),this.sectionStart=this.index+Number(e),this.emitCodePoint(ko(this.entityResult))),this.state=this.baseState}stateInNumericEntity(e){e===Kl.Semi?this.emitNumericEntity(!0):$l(e)?(this.entityResult=10*this.entityResult+(e-Kl.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)}stateInHexEntity(e){e===Kl.Semi?this.emitNumericEntity(!0):$l(e)?(this.entityResult=16*this.entityResult+(e-Kl.Zero),this.entityExcess++):!function(e){return e>=Kl.UpperA&&e<=Kl.UpperF||e>=Kl.LowerA&&e<=Kl.LowerF}(e)?(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--):(this.entityResult=16*this.entityResult+((32|e)-Kl.LowerA+10),this.entityExcess++)}allowLegacyEntity(){return!this.xmlMode&&(this.baseState===jl.Text||this.baseState===jl.InSpecialTag)}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===jl.Text||this.state===jl.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==jl.InAttributeValueDq&&this.state!==jl.InAttributeValueSq&&this.state!==jl.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index0&&s.has(this.stack[this.stack.length-1]);){const e=this.stack.pop();null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,e,!0)}this.isVoidElement(e)||(this.stack.push(e),ah.has(e)?this.foreignContext.push(!0):oh.has(e)&&this.foreignContext.push(!1)),null===(i=(r=this.cbs).onopentagname)||void 0===i||i.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&(null===(n=(t=this.cbs).onopentag)||void 0===n||n.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var n,r,i,s,a,o;this.endIndex=t;let c=this.getSlice(e,t);if(this.lowerCaseTagNames&&(c=c.toLowerCase()),(ah.has(c)||oh.has(c))&&this.foreignContext.pop(),this.isVoidElement(c))this.options.xmlMode||"br"!==c||(null===(r=(n=this.cbs).onopentagname)||void 0===r||r.call(n,"br"),null===(s=(i=this.cbs).onopentag)||void 0===s||s.call(i,"br",{},!0),null===(o=(a=this.cbs).onclosetag)||void 0===o||o.call(a,"br",!1));else{const e=this.stack.lastIndexOf(c);if(-1!==e)if(this.cbs.onclosetag){let t=this.stack.length-e;for(;t--;)this.cbs.onclosetag(this.stack.pop(),0!==t)}else this.stack.length=e;else this.options.xmlMode||"p"!==c||(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,n;const r=this.tagname;this.endOpenTag(e),this.stack[this.stack.length-1]===r&&(null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,r,!e),this.stack.pop())}onattribname(e,t){this.startIndex=e;const n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Lo(e)}onattribend(e,t){var n,r;this.endIndex=t,null===(r=(n=this.cbs).onattribute)||void 0===r||r.call(n,this.attribname,this.attribvalue,e===Vl.Double?'"':e===Vl.Single?"'":e===Vl.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const t=e.search(ch);let n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;const n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;const n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){var r,i,s,a;this.endIndex=t,null===(i=(r=this.cbs).oncomment)||void 0===i||i.call(r,this.getSlice(e,t-n)),null===(a=(s=this.cbs).oncommentend)||void 0===a||a.call(s),this.startIndex=t+1}oncdata(e,t,n){var r,i,s,a,o,c,l,h,u,p;this.endIndex=t;const f=this.getSlice(e,t-n);this.options.xmlMode||this.options.recognizeCDATA?(null===(i=(r=this.cbs).oncdatastart)||void 0===i||i.call(r),null===(a=(s=this.cbs).ontext)||void 0===a||a.call(s,f),null===(c=(o=this.cbs).oncdataend)||void 0===c||c.call(o)):(null===(h=(l=this.cbs).oncomment)||void 0===h||h.call(l,`[CDATA[${f}]]`),null===(p=(u=this.cbs).oncommentend)||void 0===p||p.call(u)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=this.stack.length;e>0;this.cbs.onclosetag(this.stack[--e],!0));}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)}reset(){var e,t,n,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(n=this.cbs).onparserinit)||void 0===r||r.call(n,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))}end(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); - } - } else { - // Copy one word at a time - for (var j = 0; j < thatSigBytes; j += 4) { - thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; - } - } - this.sigBytes += thatSigBytes; - - // Chainable - return this; - }, - - /** - * Removes insignificant bits. - * - * @example - * - * wordArray.clamp(); - */ - clamp: function () { - // Shortcuts - var words = this.words; - var sigBytes = this.sigBytes; - - // Clamp - words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); - words.length = Math.ceil(sigBytes / 4); - }, - - /** - * Creates a copy of this word array. - * - * @return {WordArray} The clone. - * - * @example - * - * var clone = wordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone.words = this.words.slice(0); - - return clone; - }, - - /** - * Creates a word array filled with random bytes. - * - * @param {number} nBytes The number of random bytes to generate. - * - * @return {WordArray} The random word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.lib.WordArray.random(16); - */ - random: function (nBytes) { - var words = []; - - for (var i = 0; i < nBytes; i += 4) { - words.push(cryptoSecureRandomInt()); - } - - return new WordArray.init(words, nBytes); - } - }); - - /** - * Encoder namespace. - */ - var C_enc = C.enc = {}; - - /** - * Hex encoding strategy. - */ - var Hex = C_enc.Hex = { - /** - * Converts a word array to a hex string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The hex string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.enc.Hex.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var hexChars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - hexChars.push((bite >>> 4).toString(16)); - hexChars.push((bite & 0x0f).toString(16)); - } - - return hexChars.join(''); - }, - - /** - * Converts a hex string to a word array. - * - * @param {string} hexStr The hex string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Hex.parse(hexString); - */ - parse: function (hexStr) { - // Shortcut - var hexStrLength = hexStr.length; - - // Convert - var words = []; - for (var i = 0; i < hexStrLength; i += 2) { - words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); - } - - return new WordArray.init(words, hexStrLength / 2); - } - }; - - /** - * Latin1 encoding strategy. - */ - var Latin1 = C_enc.Latin1 = { - /** - * Converts a word array to a Latin1 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Latin1 string. - * - * @static - * - * @example - * - * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var latin1Chars = []; - for (var i = 0; i < sigBytes; i++) { - var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - latin1Chars.push(String.fromCharCode(bite)); - } - - return latin1Chars.join(''); - }, - - /** - * Converts a Latin1 string to a word array. - * - * @param {string} latin1Str The Latin1 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); - */ - parse: function (latin1Str) { - // Shortcut - var latin1StrLength = latin1Str.length; - - // Convert - var words = []; - for (var i = 0; i < latin1StrLength; i++) { - words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); - } - - return new WordArray.init(words, latin1StrLength); - } - }; - - /** - * UTF-8 encoding strategy. - */ - var Utf8 = C_enc.Utf8 = { - /** - * Converts a word array to a UTF-8 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-8 string. - * - * @static - * - * @example - * - * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); - */ - stringify: function (wordArray) { - try { - return decodeURIComponent(escape(Latin1.stringify(wordArray))); - } catch (e) { - throw new Error('Malformed UTF-8 data'); - } - }, - - /** - * Converts a UTF-8 string to a word array. - * - * @param {string} utf8Str The UTF-8 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); - */ - parse: function (utf8Str) { - return Latin1.parse(unescape(encodeURIComponent(utf8Str))); - } - }; - - /** - * Abstract buffered block algorithm template. - * - * The property blockSize must be implemented in a concrete subtype. - * - * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 - */ - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ - /** - * Resets this block algorithm's data buffer to its initial state. - * - * @example - * - * bufferedBlockAlgorithm.reset(); - */ - reset: function () { - // Initial values - this._data = new WordArray.init(); - this._nDataBytes = 0; - }, - - /** - * Adds new data to this block algorithm's buffer. - * - * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. - * - * @example - * - * bufferedBlockAlgorithm._append('data'); - * bufferedBlockAlgorithm._append(wordArray); - */ - _append: function (data) { - // Convert string to WordArray, else assume WordArray already - if (typeof data == 'string') { - data = Utf8.parse(data); - } - - // Append - this._data.concat(data); - this._nDataBytes += data.sigBytes; - }, - - /** - * Processes available data blocks. - * - * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. - * - * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. - * - * @return {WordArray} The processed data. - * - * @example - * - * var processedData = bufferedBlockAlgorithm._process(); - * var processedData = bufferedBlockAlgorithm._process(!!'flush'); - */ - _process: function (doFlush) { - var processedWords; - - // Shortcuts - var data = this._data; - var dataWords = data.words; - var dataSigBytes = data.sigBytes; - var blockSize = this.blockSize; - var blockSizeBytes = blockSize * 4; - - // Count blocks ready - var nBlocksReady = dataSigBytes / blockSizeBytes; - if (doFlush) { - // Round up to include partial blocks - nBlocksReady = Math.ceil(nBlocksReady); - } else { - // Round down to include only full blocks, - // less the number of blocks that must remain in the buffer - nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); - } - - // Count words ready - var nWordsReady = nBlocksReady * blockSize; - - // Count bytes ready - var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); - - // Process blocks - if (nWordsReady) { - for (var offset = 0; offset < nWordsReady; offset += blockSize) { - // Perform concrete-algorithm logic - this._doProcessBlock(dataWords, offset); - } - - // Remove processed words - processedWords = dataWords.splice(0, nWordsReady); - data.sigBytes -= nBytesReady; - } - - // Return processed words - return new WordArray.init(processedWords, nBytesReady); - }, - - /** - * Creates a copy of this object. - * - * @return {Object} The clone. - * - * @example - * - * var clone = bufferedBlockAlgorithm.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - clone._data = this._data.clone(); - - return clone; - }, - - _minBufferSize: 0 - }); - - /** - * Abstract hasher template. - * - * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) - */ - var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - */ - cfg: Base.extend(), - - /** - * Initializes a newly created hasher. - * - * @param {Object} cfg (Optional) The configuration options to use for this hash computation. - * - * @example - * - * var hasher = CryptoJS.algo.SHA256.create(); - */ - init: function (cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Set initial values - this.reset(); - }, - - /** - * Resets this hasher to its initial state. - * - * @example - * - * hasher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-hasher logic - this._doReset(); - }, - - /** - * Updates this hasher with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {Hasher} This hasher. - * - * @example - * - * hasher.update('message'); - * hasher.update(wordArray); - */ - update: function (messageUpdate) { - // Append - this._append(messageUpdate); - - // Update the hash - this._process(); - - // Chainable - return this; - }, - - /** - * Finalizes the hash computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The hash. - * - * @example - * - * var hash = hasher.finalize(); - * var hash = hasher.finalize('message'); - * var hash = hasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Final message update - if (messageUpdate) { - this._append(messageUpdate); - } - - // Perform concrete-hasher logic - var hash = this._doFinalize(); - - return hash; - }, - - blockSize: 512/32, - - /** - * Creates a shortcut function to a hasher's object interface. - * - * @param {Hasher} hasher The hasher to create a helper for. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); - */ - _createHelper: function (hasher) { - return function (message, cfg) { - return new hasher.init(cfg).finalize(message); - }; - }, - - /** - * Creates a shortcut function to the HMAC's object interface. - * - * @param {Hasher} hasher The hasher to use in this HMAC helper. - * - * @return {Function} The shortcut function. - * - * @static - * - * @example - * - * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); - */ - _createHmacHelper: function (hasher) { - return function (message, key) { - return new C_algo.HMAC.init(hasher, key).finalize(message); - }; - } - }); - - /** - * Algorithm namespace. - */ - var C_algo = C.algo = {}; - - return C; - }(Math)); - - - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var X32WordArray = C_lib.WordArray; - - /** - * x64 namespace. - */ - var C_x64 = C.x64 = {}; - - /** - * A 64-bit word. - */ - var X64Word = C_x64.Word = Base.extend({ - /** - * Initializes a newly created 64-bit word. - * - * @param {number} high The high 32 bits. - * @param {number} low The low 32 bits. - * - * @example - * - * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); - */ - init: function (high, low) { - this.high = high; - this.low = low; - } - - /** - * Bitwise NOTs this word. - * - * @return {X64Word} A new x64-Word object after negating. - * - * @example - * - * var negated = x64Word.not(); - */ - // not: function () { - // var high = ~this.high; - // var low = ~this.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ANDs this word with the passed word. - * - * @param {X64Word} word The x64-Word to AND with this word. - * - * @return {X64Word} A new x64-Word object after ANDing. - * - * @example - * - * var anded = x64Word.and(anotherX64Word); - */ - // and: function (word) { - // var high = this.high & word.high; - // var low = this.low & word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise ORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to OR with this word. - * - * @return {X64Word} A new x64-Word object after ORing. - * - * @example - * - * var ored = x64Word.or(anotherX64Word); - */ - // or: function (word) { - // var high = this.high | word.high; - // var low = this.low | word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Bitwise XORs this word with the passed word. - * - * @param {X64Word} word The x64-Word to XOR with this word. - * - * @return {X64Word} A new x64-Word object after XORing. - * - * @example - * - * var xored = x64Word.xor(anotherX64Word); - */ - // xor: function (word) { - // var high = this.high ^ word.high; - // var low = this.low ^ word.low; - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the left. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftL(25); - */ - // shiftL: function (n) { - // if (n < 32) { - // var high = (this.high << n) | (this.low >>> (32 - n)); - // var low = this.low << n; - // } else { - // var high = this.low << (n - 32); - // var low = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Shifts this word n bits to the right. - * - * @param {number} n The number of bits to shift. - * - * @return {X64Word} A new x64-Word object after shifting. - * - * @example - * - * var shifted = x64Word.shiftR(7); - */ - // shiftR: function (n) { - // if (n < 32) { - // var low = (this.low >>> n) | (this.high << (32 - n)); - // var high = this.high >>> n; - // } else { - // var low = this.high >>> (n - 32); - // var high = 0; - // } - - // return X64Word.create(high, low); - // }, - - /** - * Rotates this word n bits to the left. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotL(25); - */ - // rotL: function (n) { - // return this.shiftL(n).or(this.shiftR(64 - n)); - // }, - - /** - * Rotates this word n bits to the right. - * - * @param {number} n The number of bits to rotate. - * - * @return {X64Word} A new x64-Word object after rotating. - * - * @example - * - * var rotated = x64Word.rotR(7); - */ - // rotR: function (n) { - // return this.shiftR(n).or(this.shiftL(64 - n)); - // }, - - /** - * Adds this word with the passed word. - * - * @param {X64Word} word The x64-Word to add with this word. - * - * @return {X64Word} A new x64-Word object after adding. - * - * @example - * - * var added = x64Word.add(anotherX64Word); - */ - // add: function (word) { - // var low = (this.low + word.low) | 0; - // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; - // var high = (this.high + word.high + carry) | 0; - - // return X64Word.create(high, low); - // } - }); - - /** - * An array of 64-bit words. - * - * @property {Array} words The array of CryptoJS.x64.Word objects. - * @property {number} sigBytes The number of significant bytes in this word array. - */ - var X64WordArray = C_x64.WordArray = Base.extend({ - /** - * Initializes a newly created word array. - * - * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. - * @param {number} sigBytes (Optional) The number of significant bytes in the words. - * - * @example - * - * var wordArray = CryptoJS.x64.WordArray.create(); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ]); - * - * var wordArray = CryptoJS.x64.WordArray.create([ - * CryptoJS.x64.Word.create(0x00010203, 0x04050607), - * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) - * ], 10); - */ - init: function (words, sigBytes) { - words = this.words = words || []; - - if (sigBytes != undefined) { - this.sigBytes = sigBytes; - } else { - this.sigBytes = words.length * 8; - } - }, - - /** - * Converts this 64-bit word array to a 32-bit word array. - * - * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. - * - * @example - * - * var x32WordArray = x64WordArray.toX32(); - */ - toX32: function () { - // Shortcuts - var x64Words = this.words; - var x64WordsLength = x64Words.length; - - // Convert - var x32Words = []; - for (var i = 0; i < x64WordsLength; i++) { - var x64Word = x64Words[i]; - x32Words.push(x64Word.high); - x32Words.push(x64Word.low); - } - - return X32WordArray.create(x32Words, this.sigBytes); - }, - - /** - * Creates a copy of this word array. - * - * @return {X64WordArray} The clone. - * - * @example - * - * var clone = x64WordArray.clone(); - */ - clone: function () { - var clone = Base.clone.call(this); - - // Clone "words" array - var words = clone.words = this.words.slice(0); - - // Clone each X64Word object - var wordsLength = words.length; - for (var i = 0; i < wordsLength; i++) { - words[i] = words[i].clone(); - } - - return clone; - } - }); - }()); - - - (function () { - // Check if typed arrays are supported - if (typeof ArrayBuffer != 'function') { - return; - } - - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - - // Reference original init - var superInit = WordArray.init; - - // Augment WordArray.init to handle typed arrays - var subInit = WordArray.init = function (typedArray) { - // Convert buffers to uint8 - if (typedArray instanceof ArrayBuffer) { - typedArray = new Uint8Array(typedArray); - } - - // Convert other array views to uint8 - if ( - typedArray instanceof Int8Array || - (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || - typedArray instanceof Int16Array || - typedArray instanceof Uint16Array || - typedArray instanceof Int32Array || - typedArray instanceof Uint32Array || - typedArray instanceof Float32Array || - typedArray instanceof Float64Array - ) { - typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); - } - - // Handle Uint8Array - if (typedArray instanceof Uint8Array) { - // Shortcut - var typedArrayByteLength = typedArray.byteLength; - - // Extract bytes - var words = []; - for (var i = 0; i < typedArrayByteLength; i++) { - words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); - } - - // Initialize this word array - superInit.call(this, words, typedArrayByteLength); - } else { - // Else call normal init - superInit.apply(this, arguments); - } - }; - - subInit.prototype = WordArray; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * UTF-16 BE encoding strategy. - */ - var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { - /** - * Converts a word array to a UTF-16 BE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 BE string. - * - * @static - * - * @example - * - * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 BE string to a word array. - * - * @param {string} utf16Str The UTF-16 BE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - /** - * UTF-16 LE encoding strategy. - */ - C_enc.Utf16LE = { - /** - * Converts a word array to a UTF-16 LE string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The UTF-16 LE string. - * - * @static - * - * @example - * - * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - - // Convert - var utf16Chars = []; - for (var i = 0; i < sigBytes; i += 2) { - var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); - utf16Chars.push(String.fromCharCode(codePoint)); - } - - return utf16Chars.join(''); - }, - - /** - * Converts a UTF-16 LE string to a word array. - * - * @param {string} utf16Str The UTF-16 LE string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); - */ - parse: function (utf16Str) { - // Shortcut - var utf16StrLength = utf16Str.length; - - // Convert - var words = []; - for (var i = 0; i < utf16StrLength; i++) { - words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); - } - - return WordArray.create(words, utf16StrLength * 2); - } - }; - - function swapEndian(word) { - return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); - } - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64 encoding strategy. - */ - var Base64 = C_enc.Base64 = { - /** - * Converts a word array to a Base64 string. - * - * @param {WordArray} wordArray The word array. - * - * @return {string} The Base64 string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64.stringify(wordArray); - */ - stringify: function (wordArray) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64 string to a word array. - * - * @param {string} base64Str The Base64 string. - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64.parse(base64String); - */ - parse: function (base64Str) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); - - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' - }; - - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - var bitsCombined = bits1 | bits2; - words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_enc = C.enc; - - /** - * Base64url encoding strategy. - */ - var Base64url = C_enc.Base64url = { - /** - * Converts a word array to a Base64url string. - * - * @param {WordArray} wordArray The word array. - * - * @param {boolean} urlSafe Whether to use url safe - * - * @return {string} The Base64url string. - * - * @static - * - * @example - * - * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); - */ - stringify: function (wordArray, urlSafe=true) { - // Shortcuts - var words = wordArray.words; - var sigBytes = wordArray.sigBytes; - var map = urlSafe ? this._safe_map : this._map; - - // Clamp excess bits - wordArray.clamp(); - - // Convert - var base64Chars = []; - for (var i = 0; i < sigBytes; i += 3) { - var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; - var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; - var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; - - var triplet = (byte1 << 16) | (byte2 << 8) | byte3; - - for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { - base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); - } - } - - // Add padding - var paddingChar = map.charAt(64); - if (paddingChar) { - while (base64Chars.length % 4) { - base64Chars.push(paddingChar); - } - } - - return base64Chars.join(''); - }, - - /** - * Converts a Base64url string to a word array. - * - * @param {string} base64Str The Base64url string. - * - * @param {boolean} urlSafe Whether to use url safe - * - * @return {WordArray} The word array. - * - * @static - * - * @example - * - * var wordArray = CryptoJS.enc.Base64url.parse(base64String); - */ - parse: function (base64Str, urlSafe=true) { - // Shortcuts - var base64StrLength = base64Str.length; - var map = urlSafe ? this._safe_map : this._map; - var reverseMap = this._reverseMap; - - if (!reverseMap) { - reverseMap = this._reverseMap = []; - for (var j = 0; j < map.length; j++) { - reverseMap[map.charCodeAt(j)] = j; - } - } - - // Ignore padding - var paddingChar = map.charAt(64); - if (paddingChar) { - var paddingIndex = base64Str.indexOf(paddingChar); - if (paddingIndex !== -1) { - base64StrLength = paddingIndex; - } - } - - // Convert - return parseLoop(base64Str, base64StrLength, reverseMap); - - }, - - _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', - }; - - function parseLoop(base64Str, base64StrLength, reverseMap) { - var words = []; - var nBytes = 0; - for (var i = 0; i < base64StrLength; i++) { - if (i % 4) { - var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); - var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); - var bitsCombined = bits1 | bits2; - words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); - nBytes++; - } - } - return WordArray.create(words, nBytes); - } - }()); - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var T = []; - - // Compute constants - (function () { - for (var i = 0; i < 64; i++) { - T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; - } - }()); - - /** - * MD5 hash algorithm. - */ - var MD5 = C_algo.MD5 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - - // Shortcuts - var H = this._hash.words; - - var M_offset_0 = M[offset + 0]; - var M_offset_1 = M[offset + 1]; - var M_offset_2 = M[offset + 2]; - var M_offset_3 = M[offset + 3]; - var M_offset_4 = M[offset + 4]; - var M_offset_5 = M[offset + 5]; - var M_offset_6 = M[offset + 6]; - var M_offset_7 = M[offset + 7]; - var M_offset_8 = M[offset + 8]; - var M_offset_9 = M[offset + 9]; - var M_offset_10 = M[offset + 10]; - var M_offset_11 = M[offset + 11]; - var M_offset_12 = M[offset + 12]; - var M_offset_13 = M[offset + 13]; - var M_offset_14 = M[offset + 14]; - var M_offset_15 = M[offset + 15]; - - // Working varialbes - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - - // Computation - a = FF(a, b, c, d, M_offset_0, 7, T[0]); - d = FF(d, a, b, c, M_offset_1, 12, T[1]); - c = FF(c, d, a, b, M_offset_2, 17, T[2]); - b = FF(b, c, d, a, M_offset_3, 22, T[3]); - a = FF(a, b, c, d, M_offset_4, 7, T[4]); - d = FF(d, a, b, c, M_offset_5, 12, T[5]); - c = FF(c, d, a, b, M_offset_6, 17, T[6]); - b = FF(b, c, d, a, M_offset_7, 22, T[7]); - a = FF(a, b, c, d, M_offset_8, 7, T[8]); - d = FF(d, a, b, c, M_offset_9, 12, T[9]); - c = FF(c, d, a, b, M_offset_10, 17, T[10]); - b = FF(b, c, d, a, M_offset_11, 22, T[11]); - a = FF(a, b, c, d, M_offset_12, 7, T[12]); - d = FF(d, a, b, c, M_offset_13, 12, T[13]); - c = FF(c, d, a, b, M_offset_14, 17, T[14]); - b = FF(b, c, d, a, M_offset_15, 22, T[15]); - - a = GG(a, b, c, d, M_offset_1, 5, T[16]); - d = GG(d, a, b, c, M_offset_6, 9, T[17]); - c = GG(c, d, a, b, M_offset_11, 14, T[18]); - b = GG(b, c, d, a, M_offset_0, 20, T[19]); - a = GG(a, b, c, d, M_offset_5, 5, T[20]); - d = GG(d, a, b, c, M_offset_10, 9, T[21]); - c = GG(c, d, a, b, M_offset_15, 14, T[22]); - b = GG(b, c, d, a, M_offset_4, 20, T[23]); - a = GG(a, b, c, d, M_offset_9, 5, T[24]); - d = GG(d, a, b, c, M_offset_14, 9, T[25]); - c = GG(c, d, a, b, M_offset_3, 14, T[26]); - b = GG(b, c, d, a, M_offset_8, 20, T[27]); - a = GG(a, b, c, d, M_offset_13, 5, T[28]); - d = GG(d, a, b, c, M_offset_2, 9, T[29]); - c = GG(c, d, a, b, M_offset_7, 14, T[30]); - b = GG(b, c, d, a, M_offset_12, 20, T[31]); - - a = HH(a, b, c, d, M_offset_5, 4, T[32]); - d = HH(d, a, b, c, M_offset_8, 11, T[33]); - c = HH(c, d, a, b, M_offset_11, 16, T[34]); - b = HH(b, c, d, a, M_offset_14, 23, T[35]); - a = HH(a, b, c, d, M_offset_1, 4, T[36]); - d = HH(d, a, b, c, M_offset_4, 11, T[37]); - c = HH(c, d, a, b, M_offset_7, 16, T[38]); - b = HH(b, c, d, a, M_offset_10, 23, T[39]); - a = HH(a, b, c, d, M_offset_13, 4, T[40]); - d = HH(d, a, b, c, M_offset_0, 11, T[41]); - c = HH(c, d, a, b, M_offset_3, 16, T[42]); - b = HH(b, c, d, a, M_offset_6, 23, T[43]); - a = HH(a, b, c, d, M_offset_9, 4, T[44]); - d = HH(d, a, b, c, M_offset_12, 11, T[45]); - c = HH(c, d, a, b, M_offset_15, 16, T[46]); - b = HH(b, c, d, a, M_offset_2, 23, T[47]); - - a = II(a, b, c, d, M_offset_0, 6, T[48]); - d = II(d, a, b, c, M_offset_7, 10, T[49]); - c = II(c, d, a, b, M_offset_14, 15, T[50]); - b = II(b, c, d, a, M_offset_5, 21, T[51]); - a = II(a, b, c, d, M_offset_12, 6, T[52]); - d = II(d, a, b, c, M_offset_3, 10, T[53]); - c = II(c, d, a, b, M_offset_10, 15, T[54]); - b = II(b, c, d, a, M_offset_1, 21, T[55]); - a = II(a, b, c, d, M_offset_8, 6, T[56]); - d = II(d, a, b, c, M_offset_15, 10, T[57]); - c = II(c, d, a, b, M_offset_6, 15, T[58]); - b = II(b, c, d, a, M_offset_13, 21, T[59]); - a = II(a, b, c, d, M_offset_4, 6, T[60]); - d = II(d, a, b, c, M_offset_11, 10, T[61]); - c = II(c, d, a, b, M_offset_2, 15, T[62]); - b = II(b, c, d, a, M_offset_9, 21, T[63]); - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - - var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); - var nBitsTotalL = nBitsTotal; - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( - (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | - (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) - ); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | - (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) - ); - - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 4; i++) { - // Shortcut - var H_i = H[i]; - - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - function FF(a, b, c, d, x, s, t) { - var n = a + ((b & c) | (~b & d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function GG(a, b, c, d, x, s, t) { - var n = a + ((b & d) | (c & ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function HH(a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - function II(a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + x + t; - return ((n << s) | (n >>> (32 - s))) + b; - } - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.MD5('message'); - * var hash = CryptoJS.MD5(wordArray); - */ - C.MD5 = Hasher._createHelper(MD5); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacMD5(message, key); - */ - C.HmacMD5 = Hasher._createHmacHelper(MD5); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Reusable object - var W = []; - - /** - * SHA-1 hash algorithm. - */ - var SHA1 = C_algo.SHA1 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0x67452301, 0xefcdab89, - 0x98badcfe, 0x10325476, - 0xc3d2e1f0 - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - - // Computation - for (var i = 0; i < 80; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; - W[i] = (n << 1) | (n >>> 31); - } - - var t = ((a << 5) | (a >>> 27)) + e + W[i]; - if (i < 20) { - t += ((b & c) | (~b & d)) + 0x5a827999; - } else if (i < 40) { - t += (b ^ c ^ d) + 0x6ed9eba1; - } else if (i < 60) { - t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; - } else /* if (i < 80) */ { - t += (b ^ c ^ d) - 0x359d3e2a; - } - - e = d; - d = c; - c = (b << 30) | (b >>> 2); - b = a; - a = t; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA1('message'); - * var hash = CryptoJS.SHA1(wordArray); - */ - C.SHA1 = Hasher._createHelper(SHA1); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA1(message, key); - */ - C.HmacSHA1 = Hasher._createHmacHelper(SHA1); - }()); - - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Initialization and round constants tables - var H = []; - var K = []; - - // Compute constants - (function () { - function isPrime(n) { - var sqrtN = Math.sqrt(n); - for (var factor = 2; factor <= sqrtN; factor++) { - if (!(n % factor)) { - return false; - } - } - - return true; - } - - function getFractionalBits(n) { - return ((n - (n | 0)) * 0x100000000) | 0; - } - - var n = 2; - var nPrime = 0; - while (nPrime < 64) { - if (isPrime(n)) { - if (nPrime < 8) { - H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); - } - K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); - - nPrime++; - } - - n++; - } - }()); - - // Reusable object - var W = []; - - /** - * SHA-256 hash algorithm. - */ - var SHA256 = C_algo.SHA256 = Hasher.extend({ - _doReset: function () { - this._hash = new WordArray.init(H.slice(0)); - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var H = this._hash.words; - - // Working variables - var a = H[0]; - var b = H[1]; - var c = H[2]; - var d = H[3]; - var e = H[4]; - var f = H[5]; - var g = H[6]; - var h = H[7]; - - // Computation - for (var i = 0; i < 64; i++) { - if (i < 16) { - W[i] = M[offset + i] | 0; - } else { - var gamma0x = W[i - 15]; - var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ - ((gamma0x << 14) | (gamma0x >>> 18)) ^ - (gamma0x >>> 3); - - var gamma1x = W[i - 2]; - var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ - ((gamma1x << 13) | (gamma1x >>> 19)) ^ - (gamma1x >>> 10); - - W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; - } - - var ch = (e & f) ^ (~e & g); - var maj = (a & b) ^ (a & c) ^ (b & c); - - var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); - var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); - - var t1 = h + sigma1 + ch + K[i] + W[i]; - var t2 = sigma0 + maj; - - h = g; - g = f; - f = e; - e = (d + t1) | 0; - d = c; - c = b; - b = a; - a = (t1 + t2) | 0; - } - - // Intermediate hash value - H[0] = (H[0] + a) | 0; - H[1] = (H[1] + b) | 0; - H[2] = (H[2] + c) | 0; - H[3] = (H[3] + d) | 0; - H[4] = (H[4] + e) | 0; - H[5] = (H[5] + f) | 0; - H[6] = (H[6] + g) | 0; - H[7] = (H[7] + h) | 0; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Return final computed hash - return this._hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA256('message'); - * var hash = CryptoJS.SHA256(wordArray); - */ - C.SHA256 = Hasher._createHelper(SHA256); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA256(message, key); - */ - C.HmacSHA256 = Hasher._createHmacHelper(SHA256); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA256 = C_algo.SHA256; - - /** - * SHA-224 hash algorithm. - */ - var SHA224 = C_algo.SHA224 = SHA256.extend({ - _doReset: function () { - this._hash = new WordArray.init([ - 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, - 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 - ]); - }, - - _doFinalize: function () { - var hash = SHA256._doFinalize.call(this); - - hash.sigBytes -= 4; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA224('message'); - * var hash = CryptoJS.SHA224(wordArray); - */ - C.SHA224 = SHA256._createHelper(SHA224); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA224(message, key); - */ - C.HmacSHA224 = SHA256._createHmacHelper(SHA224); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - - function X64Word_create() { - return X64Word.create.apply(X64Word, arguments); - } - - // Constants - var K = [ - X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), - X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), - X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), - X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), - X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), - X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), - X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), - X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), - X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), - X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), - X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), - X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), - X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), - X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), - X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), - X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), - X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), - X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), - X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), - X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), - X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), - X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), - X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), - X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), - X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), - X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), - X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), - X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), - X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), - X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), - X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), - X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), - X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), - X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), - X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), - X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), - X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), - X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), - X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), - X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) - ]; - - // Reusable objects - var W = []; - (function () { - for (var i = 0; i < 80; i++) { - W[i] = X64Word_create(); - } - }()); - - /** - * SHA-512 hash algorithm. - */ - var SHA512 = C_algo.SHA512 = Hasher.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), - new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), - new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), - new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) - ]); - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var H = this._hash.words; - - var H0 = H[0]; - var H1 = H[1]; - var H2 = H[2]; - var H3 = H[3]; - var H4 = H[4]; - var H5 = H[5]; - var H6 = H[6]; - var H7 = H[7]; - - var H0h = H0.high; - var H0l = H0.low; - var H1h = H1.high; - var H1l = H1.low; - var H2h = H2.high; - var H2l = H2.low; - var H3h = H3.high; - var H3l = H3.low; - var H4h = H4.high; - var H4l = H4.low; - var H5h = H5.high; - var H5l = H5.low; - var H6h = H6.high; - var H6l = H6.low; - var H7h = H7.high; - var H7l = H7.low; - - // Working variables - var ah = H0h; - var al = H0l; - var bh = H1h; - var bl = H1l; - var ch = H2h; - var cl = H2l; - var dh = H3h; - var dl = H3l; - var eh = H4h; - var el = H4l; - var fh = H5h; - var fl = H5l; - var gh = H6h; - var gl = H6l; - var hh = H7h; - var hl = H7l; - - // Rounds - for (var i = 0; i < 80; i++) { - var Wil; - var Wih; - - // Shortcut - var Wi = W[i]; - - // Extend message - if (i < 16) { - Wih = Wi.high = M[offset + i * 2] | 0; - Wil = Wi.low = M[offset + i * 2 + 1] | 0; - } else { - // Gamma0 - var gamma0x = W[i - 15]; - var gamma0xh = gamma0x.high; - var gamma0xl = gamma0x.low; - var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); - var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); - - // Gamma1 - var gamma1x = W[i - 2]; - var gamma1xh = gamma1x.high; - var gamma1xl = gamma1x.low; - var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); - var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); - - // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] - var Wi7 = W[i - 7]; - var Wi7h = Wi7.high; - var Wi7l = Wi7.low; - - var Wi16 = W[i - 16]; - var Wi16h = Wi16.high; - var Wi16l = Wi16.low; - - Wil = gamma0l + Wi7l; - Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); - Wil = Wil + gamma1l; - Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); - Wil = Wil + Wi16l; - Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); - - Wi.high = Wih; - Wi.low = Wil; - } - - var chh = (eh & fh) ^ (~eh & gh); - var chl = (el & fl) ^ (~el & gl); - var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); - var majl = (al & bl) ^ (al & cl) ^ (bl & cl); - - var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); - var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); - var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); - var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); - - // t1 = h + sigma1 + ch + K[i] + W[i] - var Ki = K[i]; - var Kih = Ki.high; - var Kil = Ki.low; - - var t1l = hl + sigma1l; - var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); - var t1l = t1l + chl; - var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); - var t1l = t1l + Kil; - var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); - var t1l = t1l + Wil; - var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); - - // t2 = sigma0 + maj - var t2l = sigma0l + majl; - var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); - - // Update working variables - hh = gh; - hl = gl; - gh = fh; - gl = fl; - fh = eh; - fl = el; - el = (dl + t1l) | 0; - eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; - dh = ch; - dl = cl; - ch = bh; - cl = bl; - bh = ah; - bl = al; - al = (t1l + t2l) | 0; - ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; - } - - // Intermediate hash value - H0l = H0.low = (H0l + al); - H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); - H1l = H1.low = (H1l + bl); - H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); - H2l = H2.low = (H2l + cl); - H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); - H3l = H3.low = (H3l + dl); - H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); - H4l = H4.low = (H4l + el); - H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); - H5l = H5.low = (H5l + fl); - H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); - H6l = H6.low = (H6l + gl); - H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); - H7l = H7.low = (H7l + hl); - H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); - dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Convert hash to 32-bit word array before returning - var hash = this._hash.toX32(); - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - }, - - blockSize: 1024/32 - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA512('message'); - * var hash = CryptoJS.SHA512(wordArray); - */ - C.SHA512 = Hasher._createHelper(SHA512); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA512(message, key); - */ - C.HmacSHA512 = Hasher._createHmacHelper(SHA512); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var X64WordArray = C_x64.WordArray; - var C_algo = C.algo; - var SHA512 = C_algo.SHA512; - - /** - * SHA-384 hash algorithm. - */ - var SHA384 = C_algo.SHA384 = SHA512.extend({ - _doReset: function () { - this._hash = new X64WordArray.init([ - new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), - new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), - new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), - new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) - ]); - }, - - _doFinalize: function () { - var hash = SHA512._doFinalize.call(this); - - hash.sigBytes -= 16; - - return hash; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA384('message'); - * var hash = CryptoJS.SHA384(wordArray); - */ - C.SHA384 = SHA512._createHelper(SHA384); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA384(message, key); - */ - C.HmacSHA384 = SHA512._createHmacHelper(SHA384); - }()); - - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_x64 = C.x64; - var X64Word = C_x64.Word; - var C_algo = C.algo; - - // Constants tables - var RHO_OFFSETS = []; - var PI_INDEXES = []; - var ROUND_CONSTANTS = []; - - // Compute Constants - (function () { - // Compute rho offset constants - var x = 1, y = 0; - for (var t = 0; t < 24; t++) { - RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; - - var newX = y % 5; - var newY = (2 * x + 3 * y) % 5; - x = newX; - y = newY; - } - - // Compute pi index constants - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; - } - } - - // Compute round constants - var LFSR = 0x01; - for (var i = 0; i < 24; i++) { - var roundConstantMsw = 0; - var roundConstantLsw = 0; - - for (var j = 0; j < 7; j++) { - if (LFSR & 0x01) { - var bitPosition = (1 << j) - 1; - if (bitPosition < 32) { - roundConstantLsw ^= 1 << bitPosition; - } else /* if (bitPosition >= 32) */ { - roundConstantMsw ^= 1 << (bitPosition - 32); - } - } - - // Compute next LFSR - if (LFSR & 0x80) { - // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 - LFSR = (LFSR << 1) ^ 0x71; - } else { - LFSR <<= 1; - } - } - - ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); - } - }()); - - // Reusable objects for temporary values - var T = []; - (function () { - for (var i = 0; i < 25; i++) { - T[i] = X64Word.create(); - } - }()); - - /** - * SHA-3 hash algorithm. - */ - var SHA3 = C_algo.SHA3 = Hasher.extend({ - /** - * Configuration options. - * - * @property {number} outputLength - * The desired number of bits in the output hash. - * Only values permitted are: 224, 256, 384, 512. - * Default: 512 - */ - cfg: Hasher.cfg.extend({ - outputLength: 512 - }), - - _doReset: function () { - var state = this._state = [] - for (var i = 0; i < 25; i++) { - state[i] = new X64Word.init(); - } - - this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; - }, - - _doProcessBlock: function (M, offset) { - // Shortcuts - var state = this._state; - var nBlockSizeLanes = this.blockSize / 2; - - // Absorb - for (var i = 0; i < nBlockSizeLanes; i++) { - // Shortcuts - var M2i = M[offset + 2 * i]; - var M2i1 = M[offset + 2 * i + 1]; - - // Swap endian - M2i = ( - (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | - (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) - ); - M2i1 = ( - (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | - (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) - ); - - // Absorb message into state - var lane = state[i]; - lane.high ^= M2i1; - lane.low ^= M2i; - } - - // Rounds - for (var round = 0; round < 24; round++) { - // Theta - for (var x = 0; x < 5; x++) { - // Mix column lanes - var tMsw = 0, tLsw = 0; - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - tMsw ^= lane.high; - tLsw ^= lane.low; - } - - // Temporary values - var Tx = T[x]; - Tx.high = tMsw; - Tx.low = tLsw; - } - for (var x = 0; x < 5; x++) { - // Shortcuts - var Tx4 = T[(x + 4) % 5]; - var Tx1 = T[(x + 1) % 5]; - var Tx1Msw = Tx1.high; - var Tx1Lsw = Tx1.low; - - // Mix surrounding columns - var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); - var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); - for (var y = 0; y < 5; y++) { - var lane = state[x + 5 * y]; - lane.high ^= tMsw; - lane.low ^= tLsw; - } - } - - // Rho Pi - for (var laneIndex = 1; laneIndex < 25; laneIndex++) { - var tMsw; - var tLsw; - - // Shortcuts - var lane = state[laneIndex]; - var laneMsw = lane.high; - var laneLsw = lane.low; - var rhoOffset = RHO_OFFSETS[laneIndex]; - - // Rotate lanes - if (rhoOffset < 32) { - tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); - tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); - } else /* if (rhoOffset >= 32) */ { - tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); - tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); - } - - // Transpose lanes - var TPiLane = T[PI_INDEXES[laneIndex]]; - TPiLane.high = tMsw; - TPiLane.low = tLsw; - } - - // Rho pi at x = y = 0 - var T0 = T[0]; - var state0 = state[0]; - T0.high = state0.high; - T0.low = state0.low; - - // Chi - for (var x = 0; x < 5; x++) { - for (var y = 0; y < 5; y++) { - // Shortcuts - var laneIndex = x + 5 * y; - var lane = state[laneIndex]; - var TLane = T[laneIndex]; - var Tx1Lane = T[((x + 1) % 5) + 5 * y]; - var Tx2Lane = T[((x + 2) % 5) + 5 * y]; - - // Mix rows - lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); - lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); - } - } - - // Iota - var lane = state[0]; - var roundConstant = ROUND_CONSTANTS[round]; - lane.high ^= roundConstant.high; - lane.low ^= roundConstant.low; - } - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - var blockSizeBits = this.blockSize * 32; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); - dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; - data.sigBytes = dataWords.length * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var state = this._state; - var outputLengthBytes = this.cfg.outputLength / 8; - var outputLengthLanes = outputLengthBytes / 8; - - // Squeeze - var hashWords = []; - for (var i = 0; i < outputLengthLanes; i++) { - // Shortcuts - var lane = state[i]; - var laneMsw = lane.high; - var laneLsw = lane.low; - - // Swap endian - laneMsw = ( - (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | - (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) - ); - laneLsw = ( - (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | - (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) - ); - - // Squeeze state to retrieve hash - hashWords.push(laneLsw); - hashWords.push(laneMsw); - } - - // Return final computed hash - return new WordArray.init(hashWords, outputLengthBytes); - }, - - clone: function () { - var clone = Hasher.clone.call(this); - - var state = clone._state = this._state.slice(0); - for (var i = 0; i < 25; i++) { - state[i] = state[i].clone(); - } - - return clone; - } - }); - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.SHA3('message'); - * var hash = CryptoJS.SHA3(wordArray); - */ - C.SHA3 = Hasher._createHelper(SHA3); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacSHA3(message, key); - */ - C.HmacSHA3 = Hasher._createHmacHelper(SHA3); - }(Math)); - - - /** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - (function (Math) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var Hasher = C_lib.Hasher; - var C_algo = C.algo; - - // Constants table - var _zl = WordArray.create([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); - var _zr = WordArray.create([ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); - var _sl = WordArray.create([ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); - var _sr = WordArray.create([ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); - - var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); - var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); - - /** - * RIPEMD160 hash algorithm. - */ - var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ - _doReset: function () { - this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); - }, - - _doProcessBlock: function (M, offset) { - - // Swap endian - for (var i = 0; i < 16; i++) { - // Shortcuts - var offset_i = offset + i; - var M_offset_i = M[offset_i]; - - // Swap - M[offset_i] = ( - (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | - (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) - ); - } - // Shortcut - var H = this._hash.words; - var hl = _hl.words; - var hr = _hr.words; - var zl = _zl.words; - var zr = _zr.words; - var sl = _sl.words; - var sr = _sr.words; - - // Working variables - var al, bl, cl, dl, el; - var ar, br, cr, dr, er; - - ar = al = H[0]; - br = bl = H[1]; - cr = cl = H[2]; - dr = dl = H[3]; - er = el = H[4]; - // Computation - var t; - for (var i = 0; i < 80; i += 1) { - t = (al + M[offset+zl[i]])|0; - if (i<16){ - t += f1(bl,cl,dl) + hl[0]; - } else if (i<32) { - t += f2(bl,cl,dl) + hl[1]; - } else if (i<48) { - t += f3(bl,cl,dl) + hl[2]; - } else if (i<64) { - t += f4(bl,cl,dl) + hl[3]; - } else {// if (i<80) { - t += f5(bl,cl,dl) + hl[4]; - } - t = t|0; - t = rotl(t,sl[i]); - t = (t+el)|0; - al = el; - el = dl; - dl = rotl(cl, 10); - cl = bl; - bl = t; - - t = (ar + M[offset+zr[i]])|0; - if (i<16){ - t += f5(br,cr,dr) + hr[0]; - } else if (i<32) { - t += f4(br,cr,dr) + hr[1]; - } else if (i<48) { - t += f3(br,cr,dr) + hr[2]; - } else if (i<64) { - t += f2(br,cr,dr) + hr[3]; - } else {// if (i<80) { - t += f1(br,cr,dr) + hr[4]; - } - t = t|0; - t = rotl(t,sr[i]) ; - t = (t+er)|0; - ar = er; - er = dr; - dr = rotl(cr, 10); - cr = br; - br = t; - } - // Intermediate hash value - t = (H[1] + cl + dr)|0; - H[1] = (H[2] + dl + er)|0; - H[2] = (H[3] + el + ar)|0; - H[3] = (H[4] + al + br)|0; - H[4] = (H[0] + bl + cr)|0; - H[0] = t; - }, - - _doFinalize: function () { - // Shortcuts - var data = this._data; - var dataWords = data.words; - - var nBitsTotal = this._nDataBytes * 8; - var nBitsLeft = data.sigBytes * 8; - - // Add padding - dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); - dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( - (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | - (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) - ); - data.sigBytes = (dataWords.length + 1) * 4; - - // Hash final blocks - this._process(); - - // Shortcuts - var hash = this._hash; - var H = hash.words; - - // Swap endian - for (var i = 0; i < 5; i++) { - // Shortcut - var H_i = H[i]; - - // Swap - H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | - (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); - } - - // Return final computed hash - return hash; - }, - - clone: function () { - var clone = Hasher.clone.call(this); - clone._hash = this._hash.clone(); - - return clone; - } - }); - - - function f1(x, y, z) { - return ((x) ^ (y) ^ (z)); - - } - - function f2(x, y, z) { - return (((x)&(y)) | ((~x)&(z))); - } - - function f3(x, y, z) { - return (((x) | (~(y))) ^ (z)); - } - - function f4(x, y, z) { - return (((x) & (z)) | ((y)&(~(z)))); - } - - function f5(x, y, z) { - return ((x) ^ ((y) |(~(z)))); - - } - - function rotl(x,n) { - return (x<>>(32-n)); - } - - - /** - * Shortcut function to the hasher's object interface. - * - * @param {WordArray|string} message The message to hash. - * - * @return {WordArray} The hash. - * - * @static - * - * @example - * - * var hash = CryptoJS.RIPEMD160('message'); - * var hash = CryptoJS.RIPEMD160(wordArray); - */ - C.RIPEMD160 = Hasher._createHelper(RIPEMD160); - - /** - * Shortcut function to the HMAC's object interface. - * - * @param {WordArray|string} message The message to hash. - * @param {WordArray|string} key The secret key. - * - * @return {WordArray} The HMAC. - * - * @static - * - * @example - * - * var hmac = CryptoJS.HmacRIPEMD160(message, key); - */ - C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); - }(Math)); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var C_algo = C.algo; - - /** - * HMAC algorithm. - */ - var HMAC = C_algo.HMAC = Base.extend({ - /** - * Initializes a newly created HMAC. - * - * @param {Hasher} hasher The hash algorithm to use. - * @param {WordArray|string} key The secret key. - * - * @example - * - * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); - */ - init: function (hasher, key) { - // Init hasher - hasher = this._hasher = new hasher.init(); - - // Convert string to WordArray, else assume WordArray already - if (typeof key == 'string') { - key = Utf8.parse(key); - } - - // Shortcuts - var hasherBlockSize = hasher.blockSize; - var hasherBlockSizeBytes = hasherBlockSize * 4; - - // Allow arbitrary length keys - if (key.sigBytes > hasherBlockSizeBytes) { - key = hasher.finalize(key); - } - - // Clamp excess bits - key.clamp(); - - // Clone key for inner and outer pads - var oKey = this._oKey = key.clone(); - var iKey = this._iKey = key.clone(); - - // Shortcuts - var oKeyWords = oKey.words; - var iKeyWords = iKey.words; - - // XOR keys with pad constants - for (var i = 0; i < hasherBlockSize; i++) { - oKeyWords[i] ^= 0x5c5c5c5c; - iKeyWords[i] ^= 0x36363636; - } - oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; - - // Set initial values - this.reset(); - }, - - /** - * Resets this HMAC to its initial state. - * - * @example - * - * hmacHasher.reset(); - */ - reset: function () { - // Shortcut - var hasher = this._hasher; - - // Reset - hasher.reset(); - hasher.update(this._iKey); - }, - - /** - * Updates this HMAC with a message. - * - * @param {WordArray|string} messageUpdate The message to append. - * - * @return {HMAC} This HMAC instance. - * - * @example - * - * hmacHasher.update('message'); - * hmacHasher.update(wordArray); - */ - update: function (messageUpdate) { - this._hasher.update(messageUpdate); - - // Chainable - return this; - }, - - /** - * Finalizes the HMAC computation. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} messageUpdate (Optional) A final message update. - * - * @return {WordArray} The HMAC. - * - * @example - * - * var hmac = hmacHasher.finalize(); - * var hmac = hmacHasher.finalize('message'); - * var hmac = hmacHasher.finalize(wordArray); - */ - finalize: function (messageUpdate) { - // Shortcut - var hasher = this._hasher; - - // Compute HMAC - var innerHash = hasher.finalize(messageUpdate); - hasher.reset(); - var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); - - return hmac; - } - }); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var SHA1 = C_algo.SHA1; - var HMAC = C_algo.HMAC; - - /** - * Password-Based Key Derivation Function 2 algorithm. - */ - var PBKDF2 = C_algo.PBKDF2 = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hasher to use. Default: SHA1 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: SHA1, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.PBKDF2.create(); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - // Shortcut - var cfg = this.cfg; - - // Init HMAC - var hmac = HMAC.create(cfg.hasher, password); - - // Initial values - var derivedKey = WordArray.create(); - var blockIndex = WordArray.create([0x00000001]); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var blockIndexWords = blockIndex.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - var block = hmac.update(salt).finalize(blockIndex); - hmac.reset(); - - // Shortcuts - var blockWords = block.words; - var blockWordsLength = blockWords.length; - - // Iterations - var intermediate = block; - for (var i = 1; i < iterations; i++) { - intermediate = hmac.finalize(intermediate); - hmac.reset(); - - // Shortcut - var intermediateWords = intermediate.words; - - // XOR intermediate with block - for (var j = 0; j < blockWordsLength; j++) { - blockWords[j] ^= intermediateWords[j]; - } - } - - derivedKey.concat(block); - blockIndexWords[0]++; - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Computes the Password-Based Key Derivation Function 2. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.PBKDF2(password, salt); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); - * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.PBKDF2 = function (password, salt, cfg) { - return PBKDF2.create(cfg).compute(password, salt); - }; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var C_algo = C.algo; - var MD5 = C_algo.MD5; - - /** - * This key derivation function is meant to conform with EVP_BytesToKey. - * www.openssl.org/docs/crypto/EVP_BytesToKey.html - */ - var EvpKDF = C_algo.EvpKDF = Base.extend({ - /** - * Configuration options. - * - * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) - * @property {Hasher} hasher The hash algorithm to use. Default: MD5 - * @property {number} iterations The number of iterations to perform. Default: 1 - */ - cfg: Base.extend({ - keySize: 128/32, - hasher: MD5, - iterations: 1 - }), - - /** - * Initializes a newly created key derivation function. - * - * @param {Object} cfg (Optional) The configuration options to use for the derivation. - * - * @example - * - * var kdf = CryptoJS.algo.EvpKDF.create(); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); - * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); - */ - init: function (cfg) { - this.cfg = this.cfg.extend(cfg); - }, - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * - * @return {WordArray} The derived key. - * - * @example - * - * var key = kdf.compute(password, salt); - */ - compute: function (password, salt) { - var block; - - // Shortcut - var cfg = this.cfg; - - // Init hasher - var hasher = cfg.hasher.create(); - - // Initial values - var derivedKey = WordArray.create(); - - // Shortcuts - var derivedKeyWords = derivedKey.words; - var keySize = cfg.keySize; - var iterations = cfg.iterations; - - // Generate key - while (derivedKeyWords.length < keySize) { - if (block) { - hasher.update(block); - } - block = hasher.update(password).finalize(salt); - hasher.reset(); - - // Iterations - for (var i = 1; i < iterations; i++) { - block = hasher.finalize(block); - hasher.reset(); - } - - derivedKey.concat(block); - } - derivedKey.sigBytes = keySize * 4; - - return derivedKey; - } - }); - - /** - * Derives a key from a password. - * - * @param {WordArray|string} password The password. - * @param {WordArray|string} salt A salt. - * @param {Object} cfg (Optional) The configuration options to use for this computation. - * - * @return {WordArray} The derived key. - * - * @static - * - * @example - * - * var key = CryptoJS.EvpKDF(password, salt); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); - * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); - */ - C.EvpKDF = function (password, salt, cfg) { - return EvpKDF.create(cfg).compute(password, salt); - }; - }()); - - - /** - * Cipher core components. - */ - CryptoJS.lib.Cipher || (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var Base = C_lib.Base; - var WordArray = C_lib.WordArray; - var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; - var C_enc = C.enc; - var Utf8 = C_enc.Utf8; - var Base64 = C_enc.Base64; - var C_algo = C.algo; - var EvpKDF = C_algo.EvpKDF; - - /** - * Abstract base cipher template. - * - * @property {number} keySize This cipher's key size. Default: 4 (128 bits) - * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) - * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. - * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. - */ - var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ - /** - * Configuration options. - * - * @property {WordArray} iv The IV to use for this operation. - */ - cfg: Base.extend(), - - /** - * Creates this cipher in encryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); - */ - createEncryptor: function (key, cfg) { - return this.create(this._ENC_XFORM_MODE, key, cfg); - }, - - /** - * Creates this cipher in decryption mode. - * - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {Cipher} A cipher instance. - * - * @static - * - * @example - * - * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); - */ - createDecryptor: function (key, cfg) { - return this.create(this._DEC_XFORM_MODE, key, cfg); - }, - - /** - * Initializes a newly created cipher. - * - * @param {number} xformMode Either the encryption or decryption transormation mode constant. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @example - * - * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); - */ - init: function (xformMode, key, cfg) { - // Apply config defaults - this.cfg = this.cfg.extend(cfg); - - // Store transform mode and key - this._xformMode = xformMode; - this._key = key; - - // Set initial values - this.reset(); - }, - - /** - * Resets this cipher to its initial state. - * - * @example - * - * cipher.reset(); - */ - reset: function () { - // Reset data buffer - BufferedBlockAlgorithm.reset.call(this); - - // Perform concrete-cipher logic - this._doReset(); - }, - - /** - * Adds data to be encrypted or decrypted. - * - * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. - * - * @return {WordArray} The data after processing. - * - * @example - * - * var encrypted = cipher.process('data'); - * var encrypted = cipher.process(wordArray); - */ - process: function (dataUpdate) { - // Append - this._append(dataUpdate); - - // Process available blocks - return this._process(); - }, - - /** - * Finalizes the encryption or decryption process. - * Note that the finalize operation is effectively a destructive, read-once operation. - * - * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. - * - * @return {WordArray} The data after final processing. - * - * @example - * - * var encrypted = cipher.finalize(); - * var encrypted = cipher.finalize('data'); - * var encrypted = cipher.finalize(wordArray); - */ - finalize: function (dataUpdate) { - // Final data update - if (dataUpdate) { - this._append(dataUpdate); - } - - // Perform concrete-cipher logic - var finalProcessedData = this._doFinalize(); - - return finalProcessedData; - }, - - keySize: 128/32, - - ivSize: 128/32, - - _ENC_XFORM_MODE: 1, - - _DEC_XFORM_MODE: 2, - - /** - * Creates shortcut functions to a cipher's object interface. - * - * @param {Cipher} cipher The cipher to create a helper for. - * - * @return {Object} An object with encrypt and decrypt shortcut functions. - * - * @static - * - * @example - * - * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); - */ - _createHelper: (function () { - function selectCipherStrategy(key) { - if (typeof key == 'string') { - return PasswordBasedCipher; - } else { - return SerializableCipher; - } - } - - return function (cipher) { - return { - encrypt: function (message, key, cfg) { - return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); - }, - - decrypt: function (ciphertext, key, cfg) { - return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); - } - }; - }; - }()) - }); - - /** - * Abstract base stream cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) - */ - var StreamCipher = C_lib.StreamCipher = Cipher.extend({ - _doFinalize: function () { - // Process partial blocks - var finalProcessedBlocks = this._process(!!'flush'); - - return finalProcessedBlocks; - }, - - blockSize: 1 - }); - - /** - * Mode namespace. - */ - var C_mode = C.mode = {}; - - /** - * Abstract base block cipher mode template. - */ - var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ - /** - * Creates this mode for encryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); - */ - createEncryptor: function (cipher, iv) { - return this.Encryptor.create(cipher, iv); - }, - - /** - * Creates this mode for decryption. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @static - * - * @example - * - * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); - */ - createDecryptor: function (cipher, iv) { - return this.Decryptor.create(cipher, iv); - }, - - /** - * Initializes a newly created mode. - * - * @param {Cipher} cipher A block cipher instance. - * @param {Array} iv The IV words. - * - * @example - * - * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); - */ - init: function (cipher, iv) { - this._cipher = cipher; - this._iv = iv; - } - }); - - /** - * Cipher Block Chaining mode. - */ - var CBC = C_mode.CBC = (function () { - /** - * Abstract base CBC mode. - */ - var CBC = BlockCipherMode.extend(); - - /** - * CBC encryptor. - */ - CBC.Encryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // XOR and encrypt - xorBlock.call(this, words, offset, blockSize); - cipher.encryptBlock(words, offset); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - /** - * CBC decryptor. - */ - CBC.Decryptor = CBC.extend({ - /** - * Processes the data block at offset. - * - * @param {Array} words The data words to operate on. - * @param {number} offset The offset where the block starts. - * - * @example - * - * mode.processBlock(data.words, offset); - */ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - // Decrypt and XOR - cipher.decryptBlock(words, offset); - xorBlock.call(this, words, offset, blockSize); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function xorBlock(words, offset, blockSize) { - var block; - - // Shortcut - var iv = this._iv; - - // Choose mixing block - if (iv) { - block = iv; - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - block = this._prevBlock; - } - - // XOR blocks - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= block[i]; - } - } - - return CBC; - }()); - - /** - * Padding namespace. - */ - var C_pad = C.pad = {}; - - /** - * PKCS #5/7 padding strategy. - */ - var Pkcs7 = C_pad.Pkcs7 = { - /** - * Pads data using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to pad. - * @param {number} blockSize The multiple that the data should be padded to. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.pad(wordArray, 4); - */ - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Create padding word - var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; - - // Create padding - var paddingWords = []; - for (var i = 0; i < nPaddingBytes; i += 4) { - paddingWords.push(paddingWord); - } - var padding = WordArray.create(paddingWords, nPaddingBytes); - - // Add padding - data.concat(padding); - }, - - /** - * Unpads data that had been padded using the algorithm defined in PKCS #5/7. - * - * @param {WordArray} data The data to unpad. - * - * @static - * - * @example - * - * CryptoJS.pad.Pkcs7.unpad(wordArray); - */ - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - /** - * Abstract base block cipher template. - * - * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) - */ - var BlockCipher = C_lib.BlockCipher = Cipher.extend({ - /** - * Configuration options. - * - * @property {Mode} mode The block mode to use. Default: CBC - * @property {Padding} padding The padding strategy to use. Default: Pkcs7 - */ - cfg: Cipher.cfg.extend({ - mode: CBC, - padding: Pkcs7 - }), - - reset: function () { - var modeCreator; - - // Reset cipher - Cipher.reset.call(this); - - // Shortcuts - var cfg = this.cfg; - var iv = cfg.iv; - var mode = cfg.mode; - - // Reset block mode - if (this._xformMode == this._ENC_XFORM_MODE) { - modeCreator = mode.createEncryptor; - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - modeCreator = mode.createDecryptor; - // Keep at least one block in the buffer for unpadding - this._minBufferSize = 1; - } - - if (this._mode && this._mode.__creator == modeCreator) { - this._mode.init(this, iv && iv.words); - } else { - this._mode = modeCreator.call(mode, this, iv && iv.words); - this._mode.__creator = modeCreator; - } - }, - - _doProcessBlock: function (words, offset) { - this._mode.processBlock(words, offset); - }, - - _doFinalize: function () { - var finalProcessedBlocks; - - // Shortcut - var padding = this.cfg.padding; - - // Finalize - if (this._xformMode == this._ENC_XFORM_MODE) { - // Pad data - padding.pad(this._data, this.blockSize); - - // Process final blocks - finalProcessedBlocks = this._process(!!'flush'); - } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { - // Process final blocks - finalProcessedBlocks = this._process(!!'flush'); - - // Unpad data - padding.unpad(finalProcessedBlocks); - } - - return finalProcessedBlocks; - }, - - blockSize: 128/32 - }); - - /** - * A collection of cipher parameters. - * - * @property {WordArray} ciphertext The raw ciphertext. - * @property {WordArray} key The key to this ciphertext. - * @property {WordArray} iv The IV used in the ciphering operation. - * @property {WordArray} salt The salt used with a key derivation function. - * @property {Cipher} algorithm The cipher algorithm. - * @property {Mode} mode The block mode used in the ciphering operation. - * @property {Padding} padding The padding scheme used in the ciphering operation. - * @property {number} blockSize The block size of the cipher. - * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. - */ - var CipherParams = C_lib.CipherParams = Base.extend({ - /** - * Initializes a newly created cipher params object. - * - * @param {Object} cipherParams An object with any of the possible cipher parameters. - * - * @example - * - * var cipherParams = CryptoJS.lib.CipherParams.create({ - * ciphertext: ciphertextWordArray, - * key: keyWordArray, - * iv: ivWordArray, - * salt: saltWordArray, - * algorithm: CryptoJS.algo.AES, - * mode: CryptoJS.mode.CBC, - * padding: CryptoJS.pad.PKCS7, - * blockSize: 4, - * formatter: CryptoJS.format.OpenSSL - * }); - */ - init: function (cipherParams) { - this.mixIn(cipherParams); - }, - - /** - * Converts this cipher params object to a string. - * - * @param {Format} formatter (Optional) The formatting strategy to use. - * - * @return {string} The stringified cipher params. - * - * @throws Error If neither the formatter nor the default formatter is set. - * - * @example - * - * var string = cipherParams + ''; - * var string = cipherParams.toString(); - * var string = cipherParams.toString(CryptoJS.format.OpenSSL); - */ - toString: function (formatter) { - return (formatter || this.formatter).stringify(this); - } - }); - - /** - * Format namespace. - */ - var C_format = C.format = {}; - - /** - * OpenSSL formatting strategy. - */ - var OpenSSLFormatter = C_format.OpenSSL = { - /** - * Converts a cipher params object to an OpenSSL-compatible string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The OpenSSL-compatible string. - * - * @static - * - * @example - * - * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); - */ - stringify: function (cipherParams) { - var wordArray; - - // Shortcuts - var ciphertext = cipherParams.ciphertext; - var salt = cipherParams.salt; - - // Format - if (salt) { - wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); - } else { - wordArray = ciphertext; - } - - return wordArray.toString(Base64); - }, - - /** - * Converts an OpenSSL-compatible string to a cipher params object. - * - * @param {string} openSSLStr The OpenSSL-compatible string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); - */ - parse: function (openSSLStr) { - var salt; - - // Parse base64 - var ciphertext = Base64.parse(openSSLStr); - - // Shortcut - var ciphertextWords = ciphertext.words; - - // Test for salt - if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { - // Extract salt - salt = WordArray.create(ciphertextWords.slice(2, 4)); - - // Remove salt from ciphertext - ciphertextWords.splice(0, 4); - ciphertext.sigBytes -= 16; - } - - return CipherParams.create({ ciphertext: ciphertext, salt: salt }); - } - }; - - /** - * A cipher wrapper that returns ciphertext as a serializable cipher params object. - */ - var SerializableCipher = C_lib.SerializableCipher = Base.extend({ - /** - * Configuration options. - * - * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL - */ - cfg: Base.extend({ - format: OpenSSLFormatter - }), - - /** - * Encrypts a message. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); - * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Encrypt - var encryptor = cipher.createEncryptor(key, cfg); - var ciphertext = encryptor.finalize(message); - - // Shortcut - var cipherCfg = encryptor.cfg; - - // Create and return serializable cipher params - return CipherParams.create({ - ciphertext: ciphertext, - key: key, - iv: cipherCfg.iv, - algorithm: cipher, - mode: cipherCfg.mode, - padding: cipherCfg.padding, - blockSize: cipher.blockSize, - formatter: cfg.format - }); - }, - - /** - * Decrypts serialized ciphertext. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {WordArray} key The key. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, key, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Decrypt - var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); - - return plaintext; - }, - - /** - * Converts serialized ciphertext to CipherParams, - * else assumed CipherParams already and returns ciphertext unchanged. - * - * @param {CipherParams|string} ciphertext The ciphertext. - * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. - * - * @return {CipherParams} The unserialized ciphertext. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); - */ - _parse: function (ciphertext, format) { - if (typeof ciphertext == 'string') { - return format.parse(ciphertext, this); - } else { - return ciphertext; - } - } - }); - - /** - * Key derivation function namespace. - */ - var C_kdf = C.kdf = {}; - - /** - * OpenSSL key derivation function. - */ - var OpenSSLKdf = C_kdf.OpenSSL = { - /** - * Derives a key and IV from a password. - * - * @param {string} password The password to derive from. - * @param {number} keySize The size in words of the key to generate. - * @param {number} ivSize The size in words of the IV to generate. - * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. - * - * @return {CipherParams} A cipher params object with the key, IV, and salt. - * - * @static - * - * @example - * - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); - * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); - */ - execute: function (password, keySize, ivSize, salt) { - // Generate random salt - if (!salt) { - salt = WordArray.random(64/8); - } - - // Derive key and IV - var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); - - // Separate key and IV - var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); - key.sigBytes = keySize * 4; - - // Return params - return CipherParams.create({ key: key, iv: iv, salt: salt }); - } - }; - - /** - * A serializable cipher wrapper that derives the key from a password, - * and returns ciphertext as a serializable cipher params object. - */ - var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ - /** - * Configuration options. - * - * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL - */ - cfg: SerializableCipher.cfg.extend({ - kdf: OpenSSLKdf - }), - - /** - * Encrypts a message using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {WordArray|string} message The message to encrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {CipherParams} A cipher params object. - * - * @static - * - * @example - * - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); - * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); - */ - encrypt: function (cipher, message, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Encrypt - var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); - - // Mix in derived params - ciphertext.mixIn(derivedParams); - - return ciphertext; - }, - - /** - * Decrypts serialized ciphertext using a password. - * - * @param {Cipher} cipher The cipher algorithm to use. - * @param {CipherParams|string} ciphertext The ciphertext to decrypt. - * @param {string} password The password. - * @param {Object} cfg (Optional) The configuration options to use for this operation. - * - * @return {WordArray} The plaintext. - * - * @static - * - * @example - * - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); - * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); - */ - decrypt: function (cipher, ciphertext, password, cfg) { - // Apply config defaults - cfg = this.cfg.extend(cfg); - - // Convert string to CipherParams - ciphertext = this._parse(ciphertext, cfg.format); - - // Derive key and other params - var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); - - // Add IV to config - cfg.iv = derivedParams.iv; - - // Decrypt - var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); - - return plaintext; - } - }); - }()); - - - /** - * Cipher Feedback block mode. - */ - CryptoJS.mode.CFB = (function () { - var CFB = CryptoJS.lib.BlockCipherMode.extend(); - - CFB.Encryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // Remember this block to use with next block - this._prevBlock = words.slice(offset, offset + blockSize); - } - }); - - CFB.Decryptor = CFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher; - var blockSize = cipher.blockSize; - - // Remember this block to use with next block - var thisBlock = words.slice(offset, offset + blockSize); - - generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); - - // This block becomes the previous block - this._prevBlock = thisBlock; - } - }); - - function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { - var keystream; - - // Shortcut - var iv = this._iv; - - // Generate keystream - if (iv) { - keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } else { - keystream = this._prevBlock; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - - return CFB; - }()); - - - /** - * Counter block mode. - */ - CryptoJS.mode.CTR = (function () { - var CTR = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = CTR.Encryptor = CTR.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Increment counter - counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTR.Decryptor = Encryptor; - - return CTR; - }()); - - - /** @preserve - * Counter block mode compatible with Dr Brian Gladman fileenc.c - * derived from CryptoJS.mode.CTR - * Jan Hruby jhruby.web@gmail.com - */ - CryptoJS.mode.CTRGladman = (function () { - var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); - - function incWord(word) - { - if (((word >> 24) & 0xff) === 0xff) { //overflow - var b1 = (word >> 16)&0xff; - var b2 = (word >> 8)&0xff; - var b3 = word & 0xff; - - if (b1 === 0xff) // overflow b1 - { - b1 = 0; - if (b2 === 0xff) - { - b2 = 0; - if (b3 === 0xff) - { - b3 = 0; - } - else - { - ++b3; - } - } - else - { - ++b2; - } - } - else - { - ++b1; - } - - word = 0; - word += (b1 << 16); - word += (b2 << 8); - word += b3; - } - else - { - word += (0x01 << 24); - } - return word; - } - - function incCounter(counter) - { - if ((counter[0] = incWord(counter[0])) === 0) - { - // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 - counter[1] = incWord(counter[1]); - } - return counter; - } - - var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var counter = this._counter; - - // Generate keystream - if (iv) { - counter = this._counter = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - - incCounter(counter); - - var keystream = counter.slice(0); - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - CTRGladman.Decryptor = Encryptor; - - return CTRGladman; - }()); - - - - - /** - * Output Feedback block mode. - */ - CryptoJS.mode.OFB = (function () { - var OFB = CryptoJS.lib.BlockCipherMode.extend(); - - var Encryptor = OFB.Encryptor = OFB.extend({ - processBlock: function (words, offset) { - // Shortcuts - var cipher = this._cipher - var blockSize = cipher.blockSize; - var iv = this._iv; - var keystream = this._keystream; - - // Generate keystream - if (iv) { - keystream = this._keystream = iv.slice(0); - - // Remove IV for subsequent blocks - this._iv = undefined; - } - cipher.encryptBlock(keystream, 0); - - // Encrypt - for (var i = 0; i < blockSize; i++) { - words[offset + i] ^= keystream[i]; - } - } - }); - - OFB.Decryptor = Encryptor; - - return OFB; - }()); - - - /** - * Electronic Codebook block mode. - */ - CryptoJS.mode.ECB = (function () { - var ECB = CryptoJS.lib.BlockCipherMode.extend(); - - ECB.Encryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.encryptBlock(words, offset); - } - }); - - ECB.Decryptor = ECB.extend({ - processBlock: function (words, offset) { - this._cipher.decryptBlock(words, offset); - } - }); - - return ECB; - }()); - - - /** - * ANSI X.923 padding strategy. - */ - CryptoJS.pad.AnsiX923 = { - pad: function (data, blockSize) { - // Shortcuts - var dataSigBytes = data.sigBytes; - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; - - // Compute last byte position - var lastBytePos = dataSigBytes + nPaddingBytes - 1; - - // Pad - data.clamp(); - data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); - data.sigBytes += nPaddingBytes; - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - /** - * ISO 10126 padding strategy. - */ - CryptoJS.pad.Iso10126 = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Count padding bytes - var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; - - // Pad - data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). - concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); - }, - - unpad: function (data) { - // Get number of padding bytes from last byte - var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; - - // Remove padding - data.sigBytes -= nPaddingBytes; - } - }; - - - /** - * ISO/IEC 9797-1 Padding Method 2. - */ - CryptoJS.pad.Iso97971 = { - pad: function (data, blockSize) { - // Add 0x80 byte - data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); - - // Zero pad the rest - CryptoJS.pad.ZeroPadding.pad(data, blockSize); - }, - - unpad: function (data) { - // Remove zero padding - CryptoJS.pad.ZeroPadding.unpad(data); - - // Remove one more byte -- the 0x80 byte - data.sigBytes--; - } - }; - - - /** - * Zero padding strategy. - */ - CryptoJS.pad.ZeroPadding = { - pad: function (data, blockSize) { - // Shortcut - var blockSizeBytes = blockSize * 4; - - // Pad - data.clamp(); - data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); - }, - - unpad: function (data) { - // Shortcut - var dataWords = data.words; - - // Unpad - var i = data.sigBytes - 1; - for (var i = data.sigBytes - 1; i >= 0; i--) { - if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { - data.sigBytes = i + 1; - break; - } - } - } - }; - - - /** - * A noop padding strategy. - */ - CryptoJS.pad.NoPadding = { - pad: function () { - }, - - unpad: function () { - } - }; - - - (function (undefined) { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var CipherParams = C_lib.CipherParams; - var C_enc = C.enc; - var Hex = C_enc.Hex; - var C_format = C.format; - - var HexFormatter = C_format.Hex = { - /** - * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. - * - * @param {CipherParams} cipherParams The cipher params object. - * - * @return {string} The hexadecimally encoded string. - * - * @static - * - * @example - * - * var hexString = CryptoJS.format.Hex.stringify(cipherParams); - */ - stringify: function (cipherParams) { - return cipherParams.ciphertext.toString(Hex); - }, - - /** - * Converts a hexadecimally encoded ciphertext string to a cipher params object. - * - * @param {string} input The hexadecimally encoded string. - * - * @return {CipherParams} The cipher params object. - * - * @static - * - * @example - * - * var cipherParams = CryptoJS.format.Hex.parse(hexString); - */ - parse: function (input) { - var ciphertext = Hex.parse(input); - return CipherParams.create({ ciphertext: ciphertext }); - } - }; - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Lookup tables - var SBOX = []; - var INV_SBOX = []; - var SUB_MIX_0 = []; - var SUB_MIX_1 = []; - var SUB_MIX_2 = []; - var SUB_MIX_3 = []; - var INV_SUB_MIX_0 = []; - var INV_SUB_MIX_1 = []; - var INV_SUB_MIX_2 = []; - var INV_SUB_MIX_3 = []; - - // Compute lookup tables - (function () { - // Compute double table - var d = []; - for (var i = 0; i < 256; i++) { - if (i < 128) { - d[i] = i << 1; - } else { - d[i] = (i << 1) ^ 0x11b; - } - } - - // Walk GF(2^8) - var x = 0; - var xi = 0; - for (var i = 0; i < 256; i++) { - // Compute sbox - var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); - sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; - SBOX[x] = sx; - INV_SBOX[sx] = x; - - // Compute multiplication - var x2 = d[x]; - var x4 = d[x2]; - var x8 = d[x4]; - - // Compute sub bytes, mix columns tables - var t = (d[sx] * 0x101) ^ (sx * 0x1010100); - SUB_MIX_0[x] = (t << 24) | (t >>> 8); - SUB_MIX_1[x] = (t << 16) | (t >>> 16); - SUB_MIX_2[x] = (t << 8) | (t >>> 24); - SUB_MIX_3[x] = t; - - // Compute inv sub bytes, inv mix columns tables - var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); - INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); - INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); - INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); - INV_SUB_MIX_3[sx] = t; - - // Compute next counter - if (!x) { - x = xi = 1; - } else { - x = x2 ^ d[d[d[x8 ^ x2]]]; - xi ^= d[d[xi]]; - } - } - }()); - - // Precomputed Rcon lookup - var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; - - /** - * AES block cipher algorithm. - */ - var AES = C_algo.AES = BlockCipher.extend({ - _doReset: function () { - var t; - - // Skip reset of nRounds has been set before and key did not change - if (this._nRounds && this._keyPriorReset === this._key) { - return; - } - - // Shortcuts - var key = this._keyPriorReset = this._key; - var keyWords = key.words; - var keySize = key.sigBytes / 4; - - // Compute number of rounds - var nRounds = this._nRounds = keySize + 6; - - // Compute number of key schedule rows - var ksRows = (nRounds + 1) * 4; - - // Compute key schedule - var keySchedule = this._keySchedule = []; - for (var ksRow = 0; ksRow < ksRows; ksRow++) { - if (ksRow < keySize) { - keySchedule[ksRow] = keyWords[ksRow]; - } else { - t = keySchedule[ksRow - 1]; - - if (!(ksRow % keySize)) { - // Rot word - t = (t << 8) | (t >>> 24); - - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - - // Mix Rcon - t ^= RCON[(ksRow / keySize) | 0] << 24; - } else if (keySize > 6 && ksRow % keySize == 4) { - // Sub word - t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; - } - - keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; - } - } - - // Compute inv key schedule - var invKeySchedule = this._invKeySchedule = []; - for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { - var ksRow = ksRows - invKsRow; - - if (invKsRow % 4) { - var t = keySchedule[ksRow]; - } else { - var t = keySchedule[ksRow - 4]; - } - - if (invKsRow < 4 || ksRow <= 4) { - invKeySchedule[invKsRow] = t; - } else { - invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ - INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; - } - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); - }, - - decryptBlock: function (M, offset) { - // Swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - - this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); - - // Inv swap 2nd and 4th rows - var t = M[offset + 1]; - M[offset + 1] = M[offset + 3]; - M[offset + 3] = t; - }, - - _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { - // Shortcut - var nRounds = this._nRounds; - - // Get input, add round key - var s0 = M[offset] ^ keySchedule[0]; - var s1 = M[offset + 1] ^ keySchedule[1]; - var s2 = M[offset + 2] ^ keySchedule[2]; - var s3 = M[offset + 3] ^ keySchedule[3]; - - // Key schedule row counter - var ksRow = 4; - - // Rounds - for (var round = 1; round < nRounds; round++) { - // Shift rows, sub bytes, mix columns, add round key - var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; - var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; - var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; - var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; - - // Update state - s0 = t0; - s1 = t1; - s2 = t2; - s3 = t3; - } - - // Shift rows, sub bytes, add round key - var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; - var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; - var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; - var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; - - // Set output - M[offset] = t0; - M[offset + 1] = t1; - M[offset + 2] = t2; - M[offset + 3] = t3; - }, - - keySize: 256/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); - */ - C.AES = BlockCipher._createHelper(AES); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var WordArray = C_lib.WordArray; - var BlockCipher = C_lib.BlockCipher; - var C_algo = C.algo; - - // Permuted Choice 1 constants - var PC1 = [ - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, 27, 19, 11, 3, - 60, 52, 44, 36, 63, 55, 47, 39, - 31, 23, 15, 7, 62, 54, 46, 38, - 30, 22, 14, 6, 61, 53, 45, 37, - 29, 21, 13, 5, 28, 20, 12, 4 - ]; - - // Permuted Choice 2 constants - var PC2 = [ - 14, 17, 11, 24, 1, 5, - 3, 28, 15, 6, 21, 10, - 23, 19, 12, 4, 26, 8, - 16, 7, 27, 20, 13, 2, - 41, 52, 31, 37, 47, 55, - 30, 40, 51, 45, 33, 48, - 44, 49, 39, 56, 34, 53, - 46, 42, 50, 36, 29, 32 - ]; - - // Cumulative bit shift constants - var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; - - // SBOXes and round permutation constants - var SBOX_P = [ - { - 0x0: 0x808200, - 0x10000000: 0x8000, - 0x20000000: 0x808002, - 0x30000000: 0x2, - 0x40000000: 0x200, - 0x50000000: 0x808202, - 0x60000000: 0x800202, - 0x70000000: 0x800000, - 0x80000000: 0x202, - 0x90000000: 0x800200, - 0xa0000000: 0x8200, - 0xb0000000: 0x808000, - 0xc0000000: 0x8002, - 0xd0000000: 0x800002, - 0xe0000000: 0x0, - 0xf0000000: 0x8202, - 0x8000000: 0x0, - 0x18000000: 0x808202, - 0x28000000: 0x8202, - 0x38000000: 0x8000, - 0x48000000: 0x808200, - 0x58000000: 0x200, - 0x68000000: 0x808002, - 0x78000000: 0x2, - 0x88000000: 0x800200, - 0x98000000: 0x8200, - 0xa8000000: 0x808000, - 0xb8000000: 0x800202, - 0xc8000000: 0x800002, - 0xd8000000: 0x8002, - 0xe8000000: 0x202, - 0xf8000000: 0x800000, - 0x1: 0x8000, - 0x10000001: 0x2, - 0x20000001: 0x808200, - 0x30000001: 0x800000, - 0x40000001: 0x808002, - 0x50000001: 0x8200, - 0x60000001: 0x200, - 0x70000001: 0x800202, - 0x80000001: 0x808202, - 0x90000001: 0x808000, - 0xa0000001: 0x800002, - 0xb0000001: 0x8202, - 0xc0000001: 0x202, - 0xd0000001: 0x800200, - 0xe0000001: 0x8002, - 0xf0000001: 0x0, - 0x8000001: 0x808202, - 0x18000001: 0x808000, - 0x28000001: 0x800000, - 0x38000001: 0x200, - 0x48000001: 0x8000, - 0x58000001: 0x800002, - 0x68000001: 0x2, - 0x78000001: 0x8202, - 0x88000001: 0x8002, - 0x98000001: 0x800202, - 0xa8000001: 0x202, - 0xb8000001: 0x808200, - 0xc8000001: 0x800200, - 0xd8000001: 0x0, - 0xe8000001: 0x8200, - 0xf8000001: 0x808002 - }, - { - 0x0: 0x40084010, - 0x1000000: 0x4000, - 0x2000000: 0x80000, - 0x3000000: 0x40080010, - 0x4000000: 0x40000010, - 0x5000000: 0x40084000, - 0x6000000: 0x40004000, - 0x7000000: 0x10, - 0x8000000: 0x84000, - 0x9000000: 0x40004010, - 0xa000000: 0x40000000, - 0xb000000: 0x84010, - 0xc000000: 0x80010, - 0xd000000: 0x0, - 0xe000000: 0x4010, - 0xf000000: 0x40080000, - 0x800000: 0x40004000, - 0x1800000: 0x84010, - 0x2800000: 0x10, - 0x3800000: 0x40004010, - 0x4800000: 0x40084010, - 0x5800000: 0x40000000, - 0x6800000: 0x80000, - 0x7800000: 0x40080010, - 0x8800000: 0x80010, - 0x9800000: 0x0, - 0xa800000: 0x4000, - 0xb800000: 0x40080000, - 0xc800000: 0x40000010, - 0xd800000: 0x84000, - 0xe800000: 0x40084000, - 0xf800000: 0x4010, - 0x10000000: 0x0, - 0x11000000: 0x40080010, - 0x12000000: 0x40004010, - 0x13000000: 0x40084000, - 0x14000000: 0x40080000, - 0x15000000: 0x10, - 0x16000000: 0x84010, - 0x17000000: 0x4000, - 0x18000000: 0x4010, - 0x19000000: 0x80000, - 0x1a000000: 0x80010, - 0x1b000000: 0x40000010, - 0x1c000000: 0x84000, - 0x1d000000: 0x40004000, - 0x1e000000: 0x40000000, - 0x1f000000: 0x40084010, - 0x10800000: 0x84010, - 0x11800000: 0x80000, - 0x12800000: 0x40080000, - 0x13800000: 0x4000, - 0x14800000: 0x40004000, - 0x15800000: 0x40084010, - 0x16800000: 0x10, - 0x17800000: 0x40000000, - 0x18800000: 0x40084000, - 0x19800000: 0x40000010, - 0x1a800000: 0x40004010, - 0x1b800000: 0x80010, - 0x1c800000: 0x0, - 0x1d800000: 0x4010, - 0x1e800000: 0x40080010, - 0x1f800000: 0x84000 - }, - { - 0x0: 0x104, - 0x100000: 0x0, - 0x200000: 0x4000100, - 0x300000: 0x10104, - 0x400000: 0x10004, - 0x500000: 0x4000004, - 0x600000: 0x4010104, - 0x700000: 0x4010000, - 0x800000: 0x4000000, - 0x900000: 0x4010100, - 0xa00000: 0x10100, - 0xb00000: 0x4010004, - 0xc00000: 0x4000104, - 0xd00000: 0x10000, - 0xe00000: 0x4, - 0xf00000: 0x100, - 0x80000: 0x4010100, - 0x180000: 0x4010004, - 0x280000: 0x0, - 0x380000: 0x4000100, - 0x480000: 0x4000004, - 0x580000: 0x10000, - 0x680000: 0x10004, - 0x780000: 0x104, - 0x880000: 0x4, - 0x980000: 0x100, - 0xa80000: 0x4010000, - 0xb80000: 0x10104, - 0xc80000: 0x10100, - 0xd80000: 0x4000104, - 0xe80000: 0x4010104, - 0xf80000: 0x4000000, - 0x1000000: 0x4010100, - 0x1100000: 0x10004, - 0x1200000: 0x10000, - 0x1300000: 0x4000100, - 0x1400000: 0x100, - 0x1500000: 0x4010104, - 0x1600000: 0x4000004, - 0x1700000: 0x0, - 0x1800000: 0x4000104, - 0x1900000: 0x4000000, - 0x1a00000: 0x4, - 0x1b00000: 0x10100, - 0x1c00000: 0x4010000, - 0x1d00000: 0x104, - 0x1e00000: 0x10104, - 0x1f00000: 0x4010004, - 0x1080000: 0x4000000, - 0x1180000: 0x104, - 0x1280000: 0x4010100, - 0x1380000: 0x0, - 0x1480000: 0x10004, - 0x1580000: 0x4000100, - 0x1680000: 0x100, - 0x1780000: 0x4010004, - 0x1880000: 0x10000, - 0x1980000: 0x4010104, - 0x1a80000: 0x10104, - 0x1b80000: 0x4000004, - 0x1c80000: 0x4000104, - 0x1d80000: 0x4010000, - 0x1e80000: 0x4, - 0x1f80000: 0x10100 - }, - { - 0x0: 0x80401000, - 0x10000: 0x80001040, - 0x20000: 0x401040, - 0x30000: 0x80400000, - 0x40000: 0x0, - 0x50000: 0x401000, - 0x60000: 0x80000040, - 0x70000: 0x400040, - 0x80000: 0x80000000, - 0x90000: 0x400000, - 0xa0000: 0x40, - 0xb0000: 0x80001000, - 0xc0000: 0x80400040, - 0xd0000: 0x1040, - 0xe0000: 0x1000, - 0xf0000: 0x80401040, - 0x8000: 0x80001040, - 0x18000: 0x40, - 0x28000: 0x80400040, - 0x38000: 0x80001000, - 0x48000: 0x401000, - 0x58000: 0x80401040, - 0x68000: 0x0, - 0x78000: 0x80400000, - 0x88000: 0x1000, - 0x98000: 0x80401000, - 0xa8000: 0x400000, - 0xb8000: 0x1040, - 0xc8000: 0x80000000, - 0xd8000: 0x400040, - 0xe8000: 0x401040, - 0xf8000: 0x80000040, - 0x100000: 0x400040, - 0x110000: 0x401000, - 0x120000: 0x80000040, - 0x130000: 0x0, - 0x140000: 0x1040, - 0x150000: 0x80400040, - 0x160000: 0x80401000, - 0x170000: 0x80001040, - 0x180000: 0x80401040, - 0x190000: 0x80000000, - 0x1a0000: 0x80400000, - 0x1b0000: 0x401040, - 0x1c0000: 0x80001000, - 0x1d0000: 0x400000, - 0x1e0000: 0x40, - 0x1f0000: 0x1000, - 0x108000: 0x80400000, - 0x118000: 0x80401040, - 0x128000: 0x0, - 0x138000: 0x401000, - 0x148000: 0x400040, - 0x158000: 0x80000000, - 0x168000: 0x80001040, - 0x178000: 0x40, - 0x188000: 0x80000040, - 0x198000: 0x1000, - 0x1a8000: 0x80001000, - 0x1b8000: 0x80400040, - 0x1c8000: 0x1040, - 0x1d8000: 0x80401000, - 0x1e8000: 0x400000, - 0x1f8000: 0x401040 - }, - { - 0x0: 0x80, - 0x1000: 0x1040000, - 0x2000: 0x40000, - 0x3000: 0x20000000, - 0x4000: 0x20040080, - 0x5000: 0x1000080, - 0x6000: 0x21000080, - 0x7000: 0x40080, - 0x8000: 0x1000000, - 0x9000: 0x20040000, - 0xa000: 0x20000080, - 0xb000: 0x21040080, - 0xc000: 0x21040000, - 0xd000: 0x0, - 0xe000: 0x1040080, - 0xf000: 0x21000000, - 0x800: 0x1040080, - 0x1800: 0x21000080, - 0x2800: 0x80, - 0x3800: 0x1040000, - 0x4800: 0x40000, - 0x5800: 0x20040080, - 0x6800: 0x21040000, - 0x7800: 0x20000000, - 0x8800: 0x20040000, - 0x9800: 0x0, - 0xa800: 0x21040080, - 0xb800: 0x1000080, - 0xc800: 0x20000080, - 0xd800: 0x21000000, - 0xe800: 0x1000000, - 0xf800: 0x40080, - 0x10000: 0x40000, - 0x11000: 0x80, - 0x12000: 0x20000000, - 0x13000: 0x21000080, - 0x14000: 0x1000080, - 0x15000: 0x21040000, - 0x16000: 0x20040080, - 0x17000: 0x1000000, - 0x18000: 0x21040080, - 0x19000: 0x21000000, - 0x1a000: 0x1040000, - 0x1b000: 0x20040000, - 0x1c000: 0x40080, - 0x1d000: 0x20000080, - 0x1e000: 0x0, - 0x1f000: 0x1040080, - 0x10800: 0x21000080, - 0x11800: 0x1000000, - 0x12800: 0x1040000, - 0x13800: 0x20040080, - 0x14800: 0x20000000, - 0x15800: 0x1040080, - 0x16800: 0x80, - 0x17800: 0x21040000, - 0x18800: 0x40080, - 0x19800: 0x21040080, - 0x1a800: 0x0, - 0x1b800: 0x21000000, - 0x1c800: 0x1000080, - 0x1d800: 0x40000, - 0x1e800: 0x20040000, - 0x1f800: 0x20000080 - }, - { - 0x0: 0x10000008, - 0x100: 0x2000, - 0x200: 0x10200000, - 0x300: 0x10202008, - 0x400: 0x10002000, - 0x500: 0x200000, - 0x600: 0x200008, - 0x700: 0x10000000, - 0x800: 0x0, - 0x900: 0x10002008, - 0xa00: 0x202000, - 0xb00: 0x8, - 0xc00: 0x10200008, - 0xd00: 0x202008, - 0xe00: 0x2008, - 0xf00: 0x10202000, - 0x80: 0x10200000, - 0x180: 0x10202008, - 0x280: 0x8, - 0x380: 0x200000, - 0x480: 0x202008, - 0x580: 0x10000008, - 0x680: 0x10002000, - 0x780: 0x2008, - 0x880: 0x200008, - 0x980: 0x2000, - 0xa80: 0x10002008, - 0xb80: 0x10200008, - 0xc80: 0x0, - 0xd80: 0x10202000, - 0xe80: 0x202000, - 0xf80: 0x10000000, - 0x1000: 0x10002000, - 0x1100: 0x10200008, - 0x1200: 0x10202008, - 0x1300: 0x2008, - 0x1400: 0x200000, - 0x1500: 0x10000000, - 0x1600: 0x10000008, - 0x1700: 0x202000, - 0x1800: 0x202008, - 0x1900: 0x0, - 0x1a00: 0x8, - 0x1b00: 0x10200000, - 0x1c00: 0x2000, - 0x1d00: 0x10002008, - 0x1e00: 0x10202000, - 0x1f00: 0x200008, - 0x1080: 0x8, - 0x1180: 0x202000, - 0x1280: 0x200000, - 0x1380: 0x10000008, - 0x1480: 0x10002000, - 0x1580: 0x2008, - 0x1680: 0x10202008, - 0x1780: 0x10200000, - 0x1880: 0x10202000, - 0x1980: 0x10200008, - 0x1a80: 0x2000, - 0x1b80: 0x202008, - 0x1c80: 0x200008, - 0x1d80: 0x0, - 0x1e80: 0x10000000, - 0x1f80: 0x10002008 - }, - { - 0x0: 0x100000, - 0x10: 0x2000401, - 0x20: 0x400, - 0x30: 0x100401, - 0x40: 0x2100401, - 0x50: 0x0, - 0x60: 0x1, - 0x70: 0x2100001, - 0x80: 0x2000400, - 0x90: 0x100001, - 0xa0: 0x2000001, - 0xb0: 0x2100400, - 0xc0: 0x2100000, - 0xd0: 0x401, - 0xe0: 0x100400, - 0xf0: 0x2000000, - 0x8: 0x2100001, - 0x18: 0x0, - 0x28: 0x2000401, - 0x38: 0x2100400, - 0x48: 0x100000, - 0x58: 0x2000001, - 0x68: 0x2000000, - 0x78: 0x401, - 0x88: 0x100401, - 0x98: 0x2000400, - 0xa8: 0x2100000, - 0xb8: 0x100001, - 0xc8: 0x400, - 0xd8: 0x2100401, - 0xe8: 0x1, - 0xf8: 0x100400, - 0x100: 0x2000000, - 0x110: 0x100000, - 0x120: 0x2000401, - 0x130: 0x2100001, - 0x140: 0x100001, - 0x150: 0x2000400, - 0x160: 0x2100400, - 0x170: 0x100401, - 0x180: 0x401, - 0x190: 0x2100401, - 0x1a0: 0x100400, - 0x1b0: 0x1, - 0x1c0: 0x0, - 0x1d0: 0x2100000, - 0x1e0: 0x2000001, - 0x1f0: 0x400, - 0x108: 0x100400, - 0x118: 0x2000401, - 0x128: 0x2100001, - 0x138: 0x1, - 0x148: 0x2000000, - 0x158: 0x100000, - 0x168: 0x401, - 0x178: 0x2100400, - 0x188: 0x2000001, - 0x198: 0x2100000, - 0x1a8: 0x0, - 0x1b8: 0x2100401, - 0x1c8: 0x100401, - 0x1d8: 0x400, - 0x1e8: 0x2000400, - 0x1f8: 0x100001 - }, - { - 0x0: 0x8000820, - 0x1: 0x20000, - 0x2: 0x8000000, - 0x3: 0x20, - 0x4: 0x20020, - 0x5: 0x8020820, - 0x6: 0x8020800, - 0x7: 0x800, - 0x8: 0x8020000, - 0x9: 0x8000800, - 0xa: 0x20800, - 0xb: 0x8020020, - 0xc: 0x820, - 0xd: 0x0, - 0xe: 0x8000020, - 0xf: 0x20820, - 0x80000000: 0x800, - 0x80000001: 0x8020820, - 0x80000002: 0x8000820, - 0x80000003: 0x8000000, - 0x80000004: 0x8020000, - 0x80000005: 0x20800, - 0x80000006: 0x20820, - 0x80000007: 0x20, - 0x80000008: 0x8000020, - 0x80000009: 0x820, - 0x8000000a: 0x20020, - 0x8000000b: 0x8020800, - 0x8000000c: 0x0, - 0x8000000d: 0x8020020, - 0x8000000e: 0x8000800, - 0x8000000f: 0x20000, - 0x10: 0x20820, - 0x11: 0x8020800, - 0x12: 0x20, - 0x13: 0x800, - 0x14: 0x8000800, - 0x15: 0x8000020, - 0x16: 0x8020020, - 0x17: 0x20000, - 0x18: 0x0, - 0x19: 0x20020, - 0x1a: 0x8020000, - 0x1b: 0x8000820, - 0x1c: 0x8020820, - 0x1d: 0x20800, - 0x1e: 0x820, - 0x1f: 0x8000000, - 0x80000010: 0x20000, - 0x80000011: 0x800, - 0x80000012: 0x8020020, - 0x80000013: 0x20820, - 0x80000014: 0x20, - 0x80000015: 0x8020000, - 0x80000016: 0x8000000, - 0x80000017: 0x8000820, - 0x80000018: 0x8020820, - 0x80000019: 0x8000020, - 0x8000001a: 0x8000800, - 0x8000001b: 0x0, - 0x8000001c: 0x20800, - 0x8000001d: 0x820, - 0x8000001e: 0x20020, - 0x8000001f: 0x8020800 - } - ]; - - // Masks that select the SBOX input - var SBOX_MASK = [ - 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, - 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f - ]; - - /** - * DES block cipher algorithm. - */ - var DES = C_algo.DES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - - // Select 56 bits according to PC1 - var keyBits = []; - for (var i = 0; i < 56; i++) { - var keyBitPos = PC1[i] - 1; - keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; - } - - // Assemble 16 subkeys - var subKeys = this._subKeys = []; - for (var nSubKey = 0; nSubKey < 16; nSubKey++) { - // Create subkey - var subKey = subKeys[nSubKey] = []; - - // Shortcut - var bitShift = BIT_SHIFTS[nSubKey]; - - // Select 48 bits according to PC2 - for (var i = 0; i < 24; i++) { - // Select from the left 28 key bits - subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); - - // Select from the right 28 key bits - subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); - } - - // Since each subkey is applied to an expanded 32-bit input, - // the subkey can be broken into 8 values scaled to 32-bits, - // which allows the key to be used without expansion - subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); - for (var i = 1; i < 7; i++) { - subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); - } - subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); - } - - // Compute inverse subkeys - var invSubKeys = this._invSubKeys = []; - for (var i = 0; i < 16; i++) { - invSubKeys[i] = subKeys[15 - i]; - } - }, - - encryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._subKeys); - }, - - decryptBlock: function (M, offset) { - this._doCryptBlock(M, offset, this._invSubKeys); - }, - - _doCryptBlock: function (M, offset, subKeys) { - // Get input - this._lBlock = M[offset]; - this._rBlock = M[offset + 1]; - - // Initial permutation - exchangeLR.call(this, 4, 0x0f0f0f0f); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeRL.call(this, 2, 0x33333333); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeLR.call(this, 1, 0x55555555); - - // Rounds - for (var round = 0; round < 16; round++) { - // Shortcuts - var subKey = subKeys[round]; - var lBlock = this._lBlock; - var rBlock = this._rBlock; - - // Feistel function - var f = 0; - for (var i = 0; i < 8; i++) { - f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; - } - this._lBlock = rBlock; - this._rBlock = lBlock ^ f; - } - - // Undo swap from last round - var t = this._lBlock; - this._lBlock = this._rBlock; - this._rBlock = t; - - // Final permutation - exchangeLR.call(this, 1, 0x55555555); - exchangeRL.call(this, 8, 0x00ff00ff); - exchangeRL.call(this, 2, 0x33333333); - exchangeLR.call(this, 16, 0x0000ffff); - exchangeLR.call(this, 4, 0x0f0f0f0f); - - // Set output - M[offset] = this._lBlock; - M[offset + 1] = this._rBlock; - }, - - keySize: 64/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - // Swap bits across the left and right words - function exchangeLR(offset, mask) { - var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; - this._rBlock ^= t; - this._lBlock ^= t << offset; - } - - function exchangeRL(offset, mask) { - var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; - this._lBlock ^= t; - this._rBlock ^= t << offset; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); - */ - C.DES = BlockCipher._createHelper(DES); - - /** - * Triple-DES block cipher algorithm. - */ - var TripleDES = C_algo.TripleDES = BlockCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - // Make sure the key length is valid (64, 128 or >= 192 bit) - if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { - throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); - } - - // Extend the key according to the keying options defined in 3DES standard - var key1 = keyWords.slice(0, 2); - var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); - var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); - - // Create DES instances - this._des1 = DES.createEncryptor(WordArray.create(key1)); - this._des2 = DES.createEncryptor(WordArray.create(key2)); - this._des3 = DES.createEncryptor(WordArray.create(key3)); - }, - - encryptBlock: function (M, offset) { - this._des1.encryptBlock(M, offset); - this._des2.decryptBlock(M, offset); - this._des3.encryptBlock(M, offset); - }, - - decryptBlock: function (M, offset) { - this._des3.decryptBlock(M, offset); - this._des2.encryptBlock(M, offset); - this._des1.decryptBlock(M, offset); - }, - - keySize: 192/32, - - ivSize: 64/32, - - blockSize: 64/32 - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); - * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); - */ - C.TripleDES = BlockCipher._createHelper(TripleDES); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - /** - * RC4 stream cipher algorithm. - */ - var RC4 = C_algo.RC4 = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var key = this._key; - var keyWords = key.words; - var keySigBytes = key.sigBytes; - - // Init sbox - var S = this._S = []; - for (var i = 0; i < 256; i++) { - S[i] = i; - } - - // Key setup - for (var i = 0, j = 0; i < 256; i++) { - var keyByteIndex = i % keySigBytes; - var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; - - j = (j + S[i] + keyByte) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - } - - // Counters - this._i = this._j = 0; - }, - - _doProcessBlock: function (M, offset) { - M[offset] ^= generateKeystreamWord.call(this); - }, - - keySize: 256/32, - - ivSize: 0 - }); - - function generateKeystreamWord() { - // Shortcuts - var S = this._S; - var i = this._i; - var j = this._j; - - // Generate keystream word - var keystreamWord = 0; - for (var n = 0; n < 4; n++) { - i = (i + 1) % 256; - j = (j + S[i]) % 256; - - // Swap - var t = S[i]; - S[i] = S[j]; - S[j] = t; - - keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); - } - - // Update counters - this._i = i; - this._j = j; - - return keystreamWord; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); - */ - C.RC4 = StreamCipher._createHelper(RC4); - - /** - * Modified RC4 stream cipher algorithm. - */ - var RC4Drop = C_algo.RC4Drop = RC4.extend({ - /** - * Configuration options. - * - * @property {number} drop The number of keystream words to drop. Default 192 - */ - cfg: RC4.cfg.extend({ - drop: 192 - }), - - _doReset: function () { - RC4._doReset.call(this); - - // Drop - for (var i = this.cfg.drop; i > 0; i--) { - generateKeystreamWord.call(this); - } - } - }); - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); - */ - C.RC4Drop = StreamCipher._createHelper(RC4Drop); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm - */ - var Rabbit = C_algo.Rabbit = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Swap endian - for (var i = 0; i < 4; i++) { - K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | - (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); - } - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); - * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); - */ - C.Rabbit = StreamCipher._createHelper(Rabbit); - }()); - - - (function () { - // Shortcuts - var C = CryptoJS; - var C_lib = C.lib; - var StreamCipher = C_lib.StreamCipher; - var C_algo = C.algo; - - // Reusable objects - var S = []; - var C_ = []; - var G = []; - - /** - * Rabbit stream cipher algorithm. - * - * This is a legacy version that neglected to convert the key to little-endian. - * This error doesn't affect the cipher's security, - * but it does affect its compatibility with other implementations. - */ - var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ - _doReset: function () { - // Shortcuts - var K = this._key.words; - var iv = this.cfg.iv; - - // Generate initial state values - var X = this._X = [ - K[0], (K[3] << 16) | (K[2] >>> 16), - K[1], (K[0] << 16) | (K[3] >>> 16), - K[2], (K[1] << 16) | (K[0] >>> 16), - K[3], (K[2] << 16) | (K[1] >>> 16) - ]; - - // Generate initial counter values - var C = this._C = [ - (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), - (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), - (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), - (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) - ]; - - // Carry bit - this._b = 0; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - - // Modify the counters - for (var i = 0; i < 8; i++) { - C[i] ^= X[(i + 4) & 7]; - } - - // IV setup - if (iv) { - // Shortcuts - var IV = iv.words; - var IV_0 = IV[0]; - var IV_1 = IV[1]; - - // Generate four subvectors - var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); - var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); - var i1 = (i0 >>> 16) | (i2 & 0xffff0000); - var i3 = (i2 << 16) | (i0 & 0x0000ffff); - - // Modify counter values - C[0] ^= i0; - C[1] ^= i1; - C[2] ^= i2; - C[3] ^= i3; - C[4] ^= i0; - C[5] ^= i1; - C[6] ^= i2; - C[7] ^= i3; - - // Iterate the system four times - for (var i = 0; i < 4; i++) { - nextState.call(this); - } - } - }, - - _doProcessBlock: function (M, offset) { - // Shortcut - var X = this._X; - - // Iterate the system - nextState.call(this); - - // Generate four keystream words - S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); - S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); - S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); - S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); - - for (var i = 0; i < 4; i++) { - // Swap endian - S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | - (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); - - // Encrypt - M[offset + i] ^= S[i]; - } - }, - - blockSize: 128/32, - - ivSize: 64/32 - }); - - function nextState() { - // Shortcuts - var X = this._X; - var C = this._C; - - // Save old counter values - for (var i = 0; i < 8; i++) { - C_[i] = C[i]; - } - - // Calculate new counter values - C[0] = (C[0] + 0x4d34d34d + this._b) | 0; - C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; - C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; - C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; - C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; - C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; - C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; - C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; - this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; - - // Calculate the g-values - for (var i = 0; i < 8; i++) { - var gx = X[i] + C[i]; - - // Construct high and low argument for squaring - var ga = gx & 0xffff; - var gb = gx >>> 16; - - // Calculate high and low result of squaring - var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; - var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); - - // High XOR low - G[i] = gh ^ gl; - } - - // Calculate new state values - X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; - X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; - X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; - X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; - X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; - X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; - X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; - X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; - } - - /** - * Shortcut functions to the cipher's object interface. - * - * @example - * - * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); - * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); - */ - C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); - }()); - - - return CryptoJS; - -})); \ No newline at end of file diff --git a/lib/dongchenok.jar b/lib/dongchenok.jar deleted file mode 100644 index ca3ff93..0000000 Binary files a/lib/dongchenok.jar and /dev/null differ diff --git a/lib/drpy.min.js b/lib/drpy.min.js deleted file mode 100644 index 6e5ccca..0000000 --- a/lib/drpy.min.js +++ /dev/null @@ -1,2111 +0,0 @@ -import cheerio from "cheerio.min.js"; -import "crypto-js.js"; -import 模板 from "模板.js"; -import { - gbkTool -} -from "gbk.js"; - -function init_test() { - console.log("init_test_start"); - console.log("当前版本号:" + VERSION); - console.log(RKEY); - console.log(JSON.stringify(rule)); - console.log("init_test_end") -} -function pre() { - if (typeof rule.预处理 === "string" && rule.预处理 && rule.预处理.trim()) { - let code = rule.预处理.trim(); - console.log("执行预处理代码:" + code); - if (code.startsWith("js:")) { - code = code.replace("js:", "") - } - try { - eval(code) - } catch (e) { - console.log("预处理执行失败:" + e.message) - } - } -} -let rule = {}; -let vercode = typeof pdfl === "function" ? "drpy2.1" : "drpy2"; -const VERSION = vercode + " 3.9.49beta38 202400414"; -const MOBILE_UA = "Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36"; -const PC_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36"; -const UA = "Mozilla/5.0"; -const UC_UA = "Mozilla/5.0 (Linux; U; Android 9; zh-CN; MI 9 Build/PKQ1.181121.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.5.5.1035 Mobile Safari/537.36"; -const IOS_UA = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"; -const RULE_CK = "cookie"; -const CATE_EXCLUDE = "首页|留言|APP|下载|资讯|新闻|动态"; -const TAB_EXCLUDE = "猜你|喜欢|下载|剧情|热播"; -const OCR_RETRY = 3; -const OCR_API = "http://drpy.nokia.press:8028/ocr/drpy/text"; -if (typeof MY_URL === "undefined") { - var MY_URL -} -var HOST; -var RKEY; -var fetch; -var print; -var log; -var rule_fetch_params; -var fetch_params; -var oheaders; -var _pdfh; -var _pdfa; -var _pd; -const DOM_CHECK_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/; -const SPECIAL_URL = /^(ftp|magnet|thunder|ws):/; -const NOADD_INDEX = /:eq|:lt|:gt|:first|:last|^body$|^#/; -const URLJOIN_ATTR = /(url|src|href|-original|-src|-play|-url|style)$/; -const SELECT_REGEX = /:eq|:lt|:gt|#/g; -const SELECT_REGEX_A = /:eq|:lt|:gt/g; -if (typeof Object.assign != "function") { - Object.assign = function() { - var target = arguments[0]; - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - return target - } -} -if (!String.prototype.includes) { - String.prototype.includes = function(search, start) { - if (typeof start !== "number") { - start = 0 - } - if (start + search.length > this.length) { - return false - } else { - return this.indexOf(search, start) !== -1 - } - } -} -if (!Array.prototype.includes) { - Object.defineProperty(Array.prototype, "includes", { - value: function(searchElement, fromIndex) { - if (this == null) { - throw new TypeError('"this" is null or not defined') - } - var o = Object(this); - var len = o.length >>> 0; - if (len === 0) { - return false - } - var n = fromIndex | 0; - var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - while (k < len) { - if (o[k] === searchElement) { - return true - } - k++ - } - return false - } - }) -} -if (typeof String.prototype.startsWith != "function") { - String.prototype.startsWith = function(prefix) { - return this.slice(0, prefix.length) === prefix - } -} -if (typeof String.prototype.endsWith != "function") { - String.prototype.endsWith = function(suffix) { - return this.indexOf(suffix, this.length - suffix.length) !== -1 - } -} -Object.prototype.myValues = function(obj) { - if (obj == null) { - throw new TypeError("Cannot convert undefined or null to object") - } - var res = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - res.push(obj[k]) - } - } - return res -}; -if (typeof Object.prototype.values != "function") { - Object.prototype.values = function(obj) { - if (obj == null) { - throw new TypeError("Cannot convert undefined or null to object") - } - var res = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - res.push(obj[k]) - } - } - return res - } -} -if (typeof Array.prototype.join != "function") { - Array.prototype.join = function(emoji) { - emoji = emoji || ""; - let self = this; - let str = ""; - let i = 0; - if (!Array.isArray(self)) { - throw String(self) + "is not Array" - } - if (self.length === 0) { - return "" - } - if (self.length === 1) { - return String(self[0]) - } - i = 1; - str = this[0]; - for (; i < self.length; i++) { - str += String(emoji) + String(self[i]) - } - return str - } -} -String.prototype.rstrip = function(chars) { - let regex = new RegExp(chars + "$"); - return this.replace(regex, "") -}; -Array.prototype.append = Array.prototype.push; -String.prototype.strip = String.prototype.trim; - -function 是否正版(vipUrl) { - let flag = new RegExp("qq.com|iqiyi.com|youku.com|mgtv.com|bilibili.com|sohu.com|ixigua.com|pptv.com|miguvideo.com|le.com|1905.com|fun.tv"); - return flag.test(vipUrl) -} -function urlDeal(vipUrl) { - if (!vipUrl) { - return "" - } - if (!是否正版(vipUrl)) { - return vipUrl - } - if (!/miguvideo/.test(vipUrl)) { - vipUrl = vipUrl.split("#")[0].split("?")[0] - } - return vipUrl -} -function setResult(d) { - if (!Array.isArray(d)) { - return [] - } - VODS = []; - d.forEach(function(it) { - let obj = { - vod_id: it.url || "", - vod_name: it.title || "", - vod_remarks: it.desc || "", - vod_content: it.content || "", - vod_pic: it.pic_url || it.img || "" - }; - let keys = Object.keys(it); - if (keys.includes("tname")) { - obj.type_name = it.tname || "" - } - if (keys.includes("tid")) { - obj.type_id = it.tid || "" - } - if (keys.includes("year")) { - obj.vod_year = it.year || "" - } - if (keys.includes("actor")) { - obj.vod_actor = it.actor || "" - } - if (keys.includes("director")) { - obj.vod_director = it.director || "" - } - if (keys.includes("area")) { - obj.vod_area = it.area || "" - } - VODS.push(obj) - }); - return VODS -} -function setResult2(res) { - VODS = res.list || []; - return VODS -} -function setHomeResult(res) { - if (!res || typeof res !== "object") { - return [] - } - return setResult(res.list) -} -function rc(js) { - if (js === "maomi_aes.js") { - var a = CryptoJS.enc.Utf8.parse("625222f9149e961d"); - var t = CryptoJS.enc.Utf8.parse("5efdtf6060e2o330"); - return { - De: function(word) { - word = CryptoJS.enc.Hex.parse(word); - return CryptoJS.AES.decrypt(CryptoJS.enc.Base64.stringify(word), a, { - iv: t, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }) - .toString(CryptoJS.enc.Utf8) - }, - En: function(word) { - var Encrypted = CryptoJS.AES.encrypt(word, a, { - iv: t, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - }); - return Encrypted.ciphertext.toString() - } - } - } - return {} -} -function maoss(jxurl, ref, key) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - eval(getCryptoJS()); - try { - var getVideoInfo = function(text) { - return CryptoJS.AES.decrypt(text, key, { - iv: iv, - padding: CryptoJS.pad.Pkcs7 - }) - .toString(CryptoJS.enc.Utf8) - }; - var token_key = key == undefined ? "dvyYRQlnPRCMdQSe" : key; - if (ref) { - var html = request(jxurl, { - headers: { - Referer: ref - } - }) - } else { - var html = request(jxurl) - } - if (html.indexOf("&btwaf=") != -1) { - html = request(jxurl + "&btwaf" + html.match(/&btwaf(.*?)"/)[1], { - headers: { - Referer: ref - } - }) - } - var token_iv = html.split('_token = "')[1].split('"')[0]; - var key = CryptoJS.enc.Utf8.parse(token_key); - var iv = CryptoJS.enc.Utf8.parse(token_iv); - eval(html.match(/var config = {[\s\S]*?}/)[0] + ""); - if (!config.url.startsWith("http")) { - config.url = CryptoJS.AES.decrypt(config.url, key, { - iv: iv, - padding: CryptoJS.pad.Pkcs7 - }) - .toString(CryptoJS.enc.Utf8) - } - return config.url - } catch (e) { - return "" - } -} -function urlencode(str) { - str = (str + "") - .toString(); - return encodeURIComponent(str) - .replace(/!/g, "%21") - .replace(/'/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A") - .replace(/%20/g, "+") -} -function base64Encode(text) { - return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(text)) -} -function base64Decode(text) { - return CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(text)) -} -function md5(text) { - return CryptoJS.MD5(text) - .toString() -} -function encodeStr(input, encoding) { - encoding = encoding || "gbk"; - if (encoding.startsWith("gb")) { - const strTool = gbkTool(); - input = strTool.encode(input) - } - return input -} -function decodeStr(input, encoding) { - encoding = encoding || "gbk"; - if (encoding.startsWith("gb")) { - const strTool = gbkTool(); - input = strTool.decode(input) - } - return input -} -function getCryptoJS() { - return 'console.log("CryptoJS已装载");' -} -const RSA = { - encode: function(data, key, option) { - if (typeof rsaEncrypt === "function") { - if (!option || typeof option !== "object") { - return rsaEncrypt(data, key) - } else { - return rsaEncrypt(data, key, option) - } - } else { - return false - } - }, - decode: function(data, key, option) { - if (typeof rsaDecrypt === "function") { - if (!option || typeof option !== "object") { - return rsaDecrypt(data, key) - } else { - return rsaDecrypt(data, key, option) - } - } else { - return false - } - } -}; - -function getProxyUrl() { - if (typeof getProxy === "function") { - return getProxy(true) - } else { - return "http://127.0.0.1:9978/proxy?do=js" - } -} -function forceOrder(lists, key, option) { - let start = Math.floor(lists.length / 2); - let end = Math.min(lists.length - 1, start + 1); - if (start >= end) { - return lists - } - let first = lists[start]; - let second = lists[end]; - if (key) { - try { - first = first[key]; - second = second[key] - } catch (e) {} - } - if (option && typeof option === "function") { - try { - first = option(first); - second = option(second) - } catch (e) {} - } - first += ""; - second += ""; - if (first.match(/(\d+)/) && second.match(/(\d+)/)) { - let num1 = Number(first.match(/(\d+)/)[1]); - let num2 = Number(second.match(/(\d+)/)[1]); - if (num1 > num2) { - lists.reverse() - } - } - return lists -} -let VODS = []; -let VOD = {}; -let TABS = []; -let LISTS = []; -globalThis.encodeUrl = urlencode; -globalThis.urlencode = urlencode; - -function urljoin(fromPath, nowPath) { - fromPath = fromPath || ""; - nowPath = nowPath || ""; - return joinUrl(fromPath, nowPath) -} -var urljoin2 = urljoin; -const defaultParser = { - pdfh: pdfh, - pdfa: pdfa, - pd: pd -}; - -function pdfh2(html, parse) { - let html2 = html; - try { - if (typeof html !== "string") { - html2 = html.rr(html.ele) - .toString() - } - } catch (e) { - print("html对象转文本发生了错误:" + e.message) - } - let result = defaultParser.pdfh(html2, parse); - let option = parse.includes("&&") ? parse.split("&&") - .slice(-1)[0] : parse.split(" ") - .slice(-1)[0]; - if (/style/.test(option.toLowerCase()) && /url\(/.test(result)) { - try { - result = result.match(/url\((.*?)\)/)[1]; - result = result.replace(/^['|"](.*)['|"]$/, "$1") - } catch (e) {} - } - return result -} -function pdfa2(html, parse) { - let html2 = html; - try { - if (typeof html !== "string") { - html2 = html.rr(html.ele) - .toString() - } - } catch (e) { - print("html对象转文本发生了错误:" + e.message) - } - return defaultParser.pdfa(html2, parse) -} -function pd2(html, parse, uri) { - let ret = pdfh2(html, parse); - if (typeof uri === "undefined" || !uri) { - uri = "" - } - if (DOM_CHECK_ATTR.test(parse) && !SPECIAL_URL.test(ret)) { - if (/http/.test(ret)) { - ret = ret.substr(ret.indexOf("http")) - } else { - ret = urljoin(MY_URL, ret) - } - } - return ret -} -const parseTags = { - jsp: { - pdfh: pdfh2, - pdfa: pdfa2, - pd: pd2 - }, - json: { - pdfh(html, parse) { - if (!parse || !parse.trim()) { - return "" - } - if (typeof html === "string") { - html = JSON.parse(html) - } - parse = parse.trim(); - if (!parse.startsWith("$.")) { - parse = "$." + parse - } - parse = parse.split("||"); - for (let ps of parse) { - let ret = cheerio.jp(ps, html); - if (Array.isArray(ret)) { - ret = ret[0] || "" - } else { - ret = ret || "" - } - if (ret && typeof ret !== "string") { - ret = ret.toString() - } - if (ret) { - return ret - } - } - return "" - }, pdfa(html, parse) { - if (!parse || !parse.trim()) { - return "" - } - if (typeof html === "string") { - html = JSON.parse(html) - } - parse = parse.trim(); - if (!parse.startsWith("$.")) { - parse = "$." + parse - } - let ret = cheerio.jp(parse, html); - if (Array.isArray(ret) && Array.isArray(ret[0]) && ret.length === 1) { - return ret[0] || [] - } - return ret || [] - }, pd(html, parse) { - let ret = parseTags.json.pdfh(html, parse); - if (ret) { - return urljoin(MY_URL, ret) - } - return ret - } - }, - jq: { - pdfh(html, parse) { - if (!html || !parse || !parse.trim()) { - return "" - } - parse = parse.trim(); - let result = defaultParser.pdfh(html, parse); - return result - }, pdfa(html, parse) { - if (!html || !parse || !parse.trim()) { - return [] - } - parse = parse.trim(); - let result = defaultParser.pdfa(html, parse); - print(`pdfa解析${parse}=>${result.length}`); - return result - }, pd(html, parse, base_url) { - if (!html || !parse || !parse.trim()) { - return "" - } - parse = parse.trim(); - base_url = base_url || MY_URL; - return defaultParser.pd(html, parse, base_url) - } - }, - getParse(p0) { - if (p0.startsWith("jsp:")) { - return this.jsp - } else if (p0.startsWith("json:")) { - return this.json - } else if (p0.startsWith("jq:")) { - return this.jq - } else { - return this.jq - } - } -}; -const stringify = JSON.stringify; -const jsp = parseTags.jsp; -const jq = parseTags.jq; - -function readFile(filePath) { - filePath = filePath || "./uri.min.js"; - var fd = os.open(filePath); - var buffer = new ArrayBuffer(1024); - var len = os.read(fd, buffer, 0, 1024); - console.log(len); - let text = String.fromCharCode.apply(null, new Uint8Array(buffer)); - console.log(text); - return text -} -function dealJson(html) { - try { - html = html.trim(); - if (!(html.startsWith("{") && html.endsWith("}") || html.startsWith("[") && html.endsWith("]"))) { - html = "{" + html.match(/.*?\{(.*)\}/m)[1] + "}" - } - } catch (e) {} - try { - html = JSON.parse(html) - } catch (e) {} - return html -} -var OcrApi = { - api: OCR_API, - classification: function(img) { - let code = ""; - try { - log("通过drpy_ocr验证码接口过验证..."); - let html = request(OCR_API, { - data: { - img: img - }, - headers: { - "User-Agent": PC_UA - }, - method: "POST" - }, true); - code = html || "" - } catch (e) { - log(`OCR识别验证码发生错误:${e.message}`) - } - return code - } -}; - -function verifyCode(url) { - let cnt = 0; - let host = getHome(url); - let cookie = ""; - while (cnt < OCR_RETRY) { - try { - let yzm_url = `${host}/index.php/verify/index.html`; - console.log(`验证码链接:${yzm_url}`); - let hhtml = request(yzm_url, { - withHeaders: true, - toBase64: true - }, true); - let json = JSON.parse(hhtml); - if (!cookie) { - let setCk = Object.keys(json) - .find(it => it.toLowerCase() === "set-cookie"); - cookie = setCk ? json[setCk].split(";")[0] : "" - } - console.log("cookie:" + cookie); - let img = json.body; - let code = OcrApi.classification(img); - console.log(`第${cnt+1}次验证码识别结果:${code}`); - let submit_url = `${host}/index.php/ajax/verify_check?type=search&verify=${code}`; - console.log(submit_url); - let html = request(submit_url, { - headers: { - Cookie: cookie, - "User-Agent": MOBILE_UA - }, - method: "POST" - }); - html = JSON.parse(html); - if (html.msg === "ok") { - console.log(`第${cnt+1}次验证码提交成功`); - return cookie - } else if (html.msg !== "ok" && cnt + 1 >= OCR_RETRY) { - cookie = "" - } - } catch (e) { - console.log(`第${cnt+1}次验证码提交失败:${e.message}`); - if (cnt + 1 >= OCR_RETRY) { - cookie = "" - } - } - cnt += 1 - } - return cookie -} -function setItem(k, v) { - local.set(RKEY, k, v); - console.log(`规则${RKEY}设置${k} => ${v}`) -} -function getItem(k, v) { - return local.get(RKEY, k) || v -} -function clearItem(k) { - local.delete(RKEY, k) -} -function getHome(url) { - if (!url) { - return "" - } - let tmp = url.split("//"); - url = tmp[0] + "//" + tmp[1].split("/")[0]; - try { - url = decodeURIComponent(url) - } catch (e) {} - return url -} -function buildUrl(url, obj) { - obj = obj || {}; - if (url.indexOf("?") < 0) { - url += "?" - } - let param_list = []; - let keys = Object.keys(obj); - keys.forEach(it => { - param_list.push(it + "=" + obj[it]) - }); - let prs = param_list.join("&"); - if (keys.length > 0 && !url.endsWith("?")) { - url += "&" - } - url += prs; - return url -} -function require(url) { - eval(request(url)) -} -function request(url, obj, ocr_flag) { - ocr_flag = ocr_flag || false; - if (typeof obj === "undefined" || !obj || obj === {}) { - if (!fetch_params || !fetch_params.headers) { - let headers = { - "User-Agent": MOBILE_UA - }; - if (rule.headers) { - Object.assign(headers, rule.headers) - } - if (!fetch_params) { - fetch_params = {} - } - fetch_params.headers = headers - } - if (!fetch_params.headers.Referer) { - fetch_params.headers.Referer = getHome(url) - } - obj = fetch_params - } else { - let headers = obj.headers || {}; - let keys = Object.keys(headers) - .map(it => it.toLowerCase()); - if (!keys.includes("user-agent")) { - headers["User-Agent"] = MOBILE_UA - } - if (!keys.includes("referer")) { - headers["Referer"] = getHome(url) - } - obj.headers = headers - } - if (rule.encoding && rule.encoding !== "utf-8" && !ocr_flag) { - if (!obj.headers.hasOwnProperty("Content-Type") && !obj.headers.hasOwnProperty("content-type")) { - obj.headers["Content-Type"] = "text/html; charset=" + rule.encoding - } - } - if (typeof obj.body != "undefined" && obj.body && typeof obj.body === "string") { - if (!obj.headers.hasOwnProperty("Content-Type") && !obj.headers.hasOwnProperty("content-type")) { - obj.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=" + rule.encoding - } - } else if (typeof obj.body != "undefined" && obj.body && typeof obj.body === "object") { - obj.data = obj.body; - delete obj.body - } - if (!url) { - return obj.withHeaders ? "{}" : "" - } - if (obj.toBase64) { - obj.buffer = 2; - delete obj.toBase64 - } - if (obj.redirect === false) { - obj.redirect = 0 - } - console.log(JSON.stringify(obj.headers)); - console.log("request:" + url + `|method:${obj.method||"GET"}|body:${obj.body||""}`); - let res = req(url, obj); - let html = res.content || ""; - if (obj.withHeaders) { - let htmlWithHeaders = res.headers; - htmlWithHeaders.body = html; - return JSON.stringify(htmlWithHeaders) - } else { - return html - } -} -function post(url, obj) { - obj.method = "POST"; - return request(url, obj) -} -fetch = request; -print = function(data) { - data = data || ""; - if (typeof data == "object" && Object.keys(data) - .length > 0) { - try { - data = JSON.stringify(data); - console.log(data) - } catch (e) { - console.log(typeof data + ":" + data.length); - return - } - } else if (typeof data == "object" && Object.keys(data) - .length < 1) { - console.log("null object") - } else { - console.log(data) - } -}; -log = print; - -function checkHtml(html, url, obj) { - if (/\?btwaf=/.test(html)) { - let btwaf = html.match(/btwaf(.*?)"/)[1]; - url = url.split("#")[0] + "?btwaf" + btwaf; - print("宝塔验证访问链接:" + url); - html = request(url, obj) - } - return html -} -function getCode(url, obj) { - let html = request(url, obj); - html = checkHtml(html, url, obj); - return html -} -function getHtml(url) { - let obj = {}; - if (rule.headers) { - obj.headers = rule.headers - } - let cookie = getItem(RULE_CK, ""); - if (cookie) { - if (obj.headers && !Object.keys(obj.headers) - .map(it => it.toLowerCase()) - .includes("cookie")) { - log("历史无cookie,新增过验证后的cookie"); - obj.headers["Cookie"] = cookie - } else if (obj.headers && obj.headers.cookie && obj.headers.cookie !== cookie) { - obj.headers["Cookie"] = cookie; - log("历史有小写过期的cookie,更新过验证后的cookie") - } else if (obj.headers && obj.headers.Cookie && obj.headers.Cookie !== cookie) { - obj.headers["Cookie"] = cookie; - log("历史有大写过期的cookie,更新过验证后的cookie") - } else if (!obj.headers) { - obj.headers = { - Cookie: cookie - }; - log("历史无headers,更新过验证后的含cookie的headers") - } - } - let html = getCode(url, obj); - return html -} -function homeParse(homeObj) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let classes = []; - if (homeObj.class_name && homeObj.class_url) { - let names = homeObj.class_name.split("&"); - let urls = homeObj.class_url.split("&"); - let cnt = Math.min(names.length, urls.length); - for (let i = 0; i < cnt; i++) { - classes.push({ - type_id: urls[i], - type_name: names[i] - }) - } - } - if (homeObj.class_parse) { - let p = homeObj.class_parse.split(";"); - let _ps = parseTags.getParse(p[0]); - _pdfa = _ps.pdfa; - _pdfh = _ps.pdfh; - _pd = _ps.pd; - MY_URL = rule.url; - if (p.length >= 3) { - try { - let html = getHtml(homeObj.MY_URL); - if (html) { - homeHtmlCache = html; - let list = _pdfa(html, p[0]); - if (list && list.length > 0) { - list.forEach((it, idex) => { - try { - let name = _pdfh(it, p[1]); - if (homeObj.cate_exclude && new RegExp(homeObj.cate_exclude) - .test(name)) { - return - } - let url = _pd(it, p[2]); - if (p.length > 3 && p[3]) { - let exp = new RegExp(p[3]); - url = url.match(exp)[1] - } - classes.push({ - type_id: url.trim(), - type_name: name.trim() - }) - } catch (e) { - console.log(`分类列表定位第${idex}个元素正常报错:${e.message}`) - } - }) - } - } - } catch (e) { - console.log(e.message) - } - } - } - classes = classes.filter(it => !homeObj.cate_exclude || !new RegExp(homeObj.cate_exclude) - .test(it.type_name)); - let resp = { - class: classes - }; - if (homeObj.filter) { - resp.filters = homeObj.filter - } - console.log(JSON.stringify(resp)); - return JSON.stringify(resp) -} -function getPP(p, pn, pp, ppn) { - try { - let ps = p[pn] === "*" && pp.length > ppn ? pp[ppn] : p[pn]; - return ps - } catch (e) { - return "" - } -} -function homeVodParse(homeVodObj) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let d = []; - MY_URL = homeVodObj.homeUrl; - console.log(MY_URL); - let t1 = (new Date) - .getTime(); - let p = homeVodObj.推荐; - print("p:" + p); - if (p === "*" && rule.一级) { - p = rule.一级; - homeVodObj.double = false - } - if (!p || typeof p !== "string") { - return "{}" - } - p = p.trim(); - let pp = rule.一级.split(";"); - if (p.startsWith("js:")) { - const TYPE = "home"; - var input = MY_URL; - HOST = rule.host; - eval(p.replace("js:", "")); - d = VODS - } else { - p = p.split(";"); - if (!homeVodObj.double && p.length < 5) { - return "{}" - } else if (homeVodObj.double && p.length < 6) { - return "{}" - } - let p0 = getPP(p, 0, pp, 0); - let _ps = parseTags.getParse(p0); - _pdfa = _ps.pdfa; - _pdfh = _ps.pdfh; - _pd = _ps.pd; - let is_json = p0.startsWith("json:"); - p0 = p0.replace(/^(jsp:|json:|jq:)/, ""); - let html = homeHtmlCache || getHtml(MY_URL); - homeHtmlCache = undefined; - if (is_json) { - html = dealJson(html) - } - try { - console.log("double:" + homeVodObj.double); - if (homeVodObj.double) { - let items = _pdfa(html, p0); - let p1 = getPP(p, 1, pp, 0); - let p2 = getPP(p, 2, pp, 1); - let p3 = getPP(p, 3, pp, 2); - let p4 = getPP(p, 4, pp, 3); - let p5 = getPP(p, 5, pp, 4); - let p6 = getPP(p, 6, pp, 5); - for (let item of items) { - let items2 = _pdfa(item, p1); - for (let item2 of items2) { - try { - let title = _pdfh(item2, p2); - let img = ""; - try { - img = _pd(item2, p3) - } catch (e) {} - let desc = ""; - try { - desc = _pdfh(item2, p4) - } catch (e) {} - let links = []; - for (let _p5 of p5.split("+")) { - let link = !homeVodObj.detailUrl ? _pd(item2, _p5, MY_URL) : _pdfh(item2, _p5); - links.push(link) - } - let content; - if (p.length > 6 && p[6]) { - content = _pdfh(item2, p6) - } else { - content = "" - } - let vid = links.join("$"); - if (rule.二级 === "*") { - vid = vid + "@@" + title + "@@" + img - } - let vod = { - vod_name: title, - vod_pic: img, - vod_remarks: desc, - vod_content: content, - vod_id: vid - }; - d.push(vod) - } catch (e) { - console.log("首页列表双层定位处理发生错误:" + e.message) - } - } - } - } else { - let items = _pdfa(html, p0); - let p1 = getPP(p, 1, pp, 1); - let p2 = getPP(p, 2, pp, 2); - let p3 = getPP(p, 3, pp, 3); - let p4 = getPP(p, 4, pp, 4); - let p5 = getPP(p, 5, pp, 5); - for (let item of items) { - try { - let title = _pdfh(item, p1); - let img = ""; - try { - img = _pd(item, p2, MY_URL) - } catch (e) {} - let desc = ""; - try { - desc = _pdfh(item, p3) - } catch (e) {} - let links = []; - for (let _p5 of p4.split("+")) { - let link = !homeVodObj.detailUrl ? _pd(item, _p5, MY_URL) : _pdfh(item, _p5); - links.push(link) - } - let content; - if (p.length > 5 && p[5]) { - content = _pdfh(item, p5) - } else { - content = "" - } - let vid = links.join("$"); - if (rule.二级 === "*") { - vid = vid + "@@" + title + "@@" + img - } - let vod = { - vod_name: title, - vod_pic: img, - vod_remarks: desc, - vod_content: content, - vod_id: vid - }; - d.push(vod) - } catch (e) { - console.log("首页列表单层定位处理发生错误:" + e.message) - } - } - } - } catch (e) {} - } - let t2 = (new Date) - .getTime(); - console.log("加载首页推荐耗时:" + (t2 - t1) + "毫秒"); - if (rule.图片替换 && rule.图片替换.includes("=>")) { - let replace_from = rule.图片替换.split("=>")[0]; - let replace_to = rule.图片替换.split("=>")[1]; - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic.replace(replace_from, replace_to) - } - }) - } - if (rule.图片来源) { - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic + rule.图片来源 - } - }) - } - if (d.length > 0) { - print(d.slice(0, 2)) - } - return JSON.stringify({ - list: d - }) -} -function categoryParse(cateObj) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let p = cateObj.一级; - if (!p || typeof p !== "string") { - return "{}" - } - let d = []; - let url = cateObj.url.replaceAll("fyclass", cateObj.tid); - if (cateObj.pg === 1 && url.includes("[") && url.includes("]")) { - url = url.split("[")[1].split("]")[0] - } else if (cateObj.pg > 1 && url.includes("[") && url.includes("]")) { - url = url.split("[")[0] - } - if (rule.filter_url) { - if (!/fyfilter/.test(url)) { - if (!url.endsWith("&") && !rule.filter_url.startsWith("&")) { - url += "&" - } - url += rule.filter_url - } else { - url = url.replace("fyfilter", rule.filter_url) - } - let fl = cateObj.filter ? cateObj.extend : {}; - if (rule.filter_def && typeof rule.filter_def === "object") { - try { - if (Object.keys(rule.filter_def) - .length > 0 && rule.filter_def.hasOwnProperty(cateObj.tid)) { - let self_fl_def = rule.filter_def[cateObj.tid]; - if (self_fl_def && typeof self_fl_def === "object") { - let fl_def = JSON.parse(JSON.stringify(self_fl_def)); - fl = Object.assign(fl_def, fl) - } - } - } catch (e) { - print("合并不同分类对应的默认筛选出错:" + e.message) - } - } - let new_url; - new_url = cheerio.jinja2(url, { - fl: fl - }); - url = new_url - } - if (/fypage/.test(url)) { - if (url.includes("(") && url.includes(")")) { - let url_rep = url.match(/.*?\((.*)\)/)[1]; - let cnt_page = url_rep.replaceAll("fypage", cateObj.pg); - let cnt_pg = eval(cnt_page); - url = url.replaceAll(url_rep, cnt_pg) - .replaceAll("(", "") - .replaceAll(")", "") - } else { - url = url.replaceAll("fypage", cateObj.pg) - } - } - MY_URL = url; - console.log(MY_URL); - p = p.trim(); - const MY_CATE = cateObj.tid; - if (p.startsWith("js:")) { - var MY_FL = cateObj.extend; - const TYPE = "cate"; - var input = MY_URL; - const MY_PAGE = cateObj.pg; - var desc = ""; - eval(p.trim() - .replace("js:", "")); - d = VODS - } else { - p = p.split(";"); - if (p.length < 5) { - return "{}" - } - let _ps = parseTags.getParse(p[0]); - _pdfa = _ps.pdfa; - _pdfh = _ps.pdfh; - _pd = _ps.pd; - let is_json = p[0].startsWith("json:"); - p[0] = p[0].replace(/^(jsp:|json:|jq:)/, ""); - try { - let html = getHtml(MY_URL); - if (html) { - if (is_json) { - html = dealJson(html) - } - let list = _pdfa(html, p[0]); - list.forEach(it => { - let links = p[4].split("+") - .map(p4 => { - return !rule.detailUrl ? _pd(it, p4, MY_URL) : _pdfh(it, p4) - }); - let link = links.join("$"); - let vod_id = rule.detailUrl ? MY_CATE + "$" + link : link; - let vod_name = _pdfh(it, p[1]) - .replace(/\n|\t/g, "") - .trim(); - let vod_pic = _pd(it, p[2], MY_URL); - if (rule.二级 === "*") { - vod_id = vod_id + "@@" + vod_name + "@@" + vod_pic - } - d.push({ - vod_id: vod_id, - vod_name: vod_name, - vod_pic: vod_pic, - vod_remarks: _pdfh(it, p[3]) - .replace(/\n|\t/g, "") - .trim() - }) - }) - } - } catch (e) { - console.log(e.message) - } - } - if (rule.图片替换 && rule.图片替换.includes("=>")) { - let replace_from = rule.图片替换.split("=>")[0]; - let replace_to = rule.图片替换.split("=>")[1]; - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic.replace(replace_from, replace_to) - } - }) - } - if (rule.图片来源) { - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic + rule.图片来源 - } - }) - } - if (d.length > 0) { - print(d.slice(0, 2)) - } - let pagecount = 0; - if (rule.pagecount && typeof rule.pagecount === "object" && rule.pagecount.hasOwnProperty(MY_CATE)) { - print(`MY_CATE:${MY_CATE},pagecount:${JSON.stringify(rule.pagecount)}`); - pagecount = parseInt(rule.pagecount[MY_CATE]) - } - let nodata = { - list: [{ - vod_name: "无数据,防无限请求", - vod_id: "no_data", - vod_remarks: "不要点,会崩的", - vod_pic: "https://ghproxy.net/https://raw.githubusercontent.com/hjdhnx/dr_py/main/404.jpg" - }], - total: 1, - pagecount: 1, - page: 1, - limit: 1 - }; - let vod = d.length < 1 ? JSON.stringify(nodata) : JSON.stringify({ - page: parseInt(cateObj.pg), - pagecount: pagecount || 999, - limit: 20, - total: 999, - list: d - }); - return vod -} -function searchParse(searchObj) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let d = []; - if (!searchObj.searchUrl) { - return "{}" - } - let p = searchObj.搜索 === "*" && rule.一级 ? rule.一级 : searchObj.搜索; - if (!p || typeof p !== "string") { - return "{}" - } - p = p.trim(); - let pp = rule.一级.split(";"); - let url = searchObj.searchUrl.replaceAll("**", searchObj.wd); - if (searchObj.pg === 1 && url.includes("[") && url.includes("]") && !url.includes("#")) { - url = url.split("[")[1].split("]")[0] - } else if (searchObj.pg > 1 && url.includes("[") && url.includes("]") && !url.includes("#")) { - url = url.split("[")[0] - } - if (/fypage/.test(url)) { - if (url.includes("(") && url.includes(")")) { - let url_rep = url.match(/.*?\((.*)\)/)[1]; - let cnt_page = url_rep.replaceAll("fypage", searchObj.pg); - let cnt_pg = eval(cnt_page); - url = url.replaceAll(url_rep, cnt_pg) - .replaceAll("(", "") - .replaceAll(")", "") - } else { - url = url.replaceAll("fypage", searchObj.pg) - } - } - MY_URL = url; - console.log(MY_URL); - if (p.startsWith("js:")) { - const TYPE = "search"; - const MY_PAGE = searchObj.pg; - const KEY = searchObj.wd; - var input = MY_URL; - var detailUrl = rule.detailUrl || ""; - eval(p.trim() - .replace("js:", "")); - d = VODS - } else { - p = p.split(";"); - if (p.length < 5) { - return "{}" - } - let p0 = getPP(p, 0, pp, 0); - let _ps = parseTags.getParse(p0); - _pdfa = _ps.pdfa; - _pdfh = _ps.pdfh; - _pd = _ps.pd; - let is_json = p0.startsWith("json:"); - p0 = p0.replace(/^(jsp:|json:|jq:)/, ""); - try { - let req_method = MY_URL.split(";") - .length > 1 ? MY_URL.split(";")[1].toLowerCase() : "get"; - let html; - if (req_method === "post") { - let rurls = MY_URL.split(";")[0].split("#"); - let rurl = rurls[0]; - let params = rurls.length > 1 ? rurls[1] : ""; - print(`post=》rurl:${rurl},params:${params}`); - let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let postData = { - body: params - }; - Object.assign(_fetch_params, postData); - html = post(rurl, _fetch_params) - } else if (req_method === "postjson") { - let rurls = MY_URL.split(";")[0].split("#"); - let rurl = rurls[0]; - let params = rurls.length > 1 ? rurls[1] : ""; - print(`postjson-》rurl:${rurl},params:${params}`); - try { - params = JSON.parse(params) - } catch (e) { - params = "{}" - } - let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let postData = { - body: params - }; - Object.assign(_fetch_params, postData); - html = post(rurl, _fetch_params) - } else { - html = getHtml(MY_URL) - } - if (html) { - if (/系统安全验证|输入验证码/.test(html)) { - let cookie = verifyCode(MY_URL); - if (cookie) { - console.log(`本次成功过验证,cookie:${cookie}`); - setItem(RULE_CK, cookie) - } else { - console.log(`本次自动过搜索验证失败,cookie:${cookie}`) - } - html = getHtml(MY_URL) - } - if (!html.includes(searchObj.wd)) { - console.log("搜索结果源码未包含关键字,疑似搜索失败,正为您打印结果源码"); - console.log(html) - } - if (is_json) { - html = dealJson(html) - } - let list = _pdfa(html, p0); - let p1 = getPP(p, 1, pp, 1); - let p2 = getPP(p, 2, pp, 2); - let p3 = getPP(p, 3, pp, 3); - let p4 = getPP(p, 4, pp, 4); - let p5 = getPP(p, 5, pp, 5); - list.forEach(it => { - let links = p4.split("+") - .map(_p4 => { - return !rule.detailUrl ? _pd(it, _p4, MY_URL) : _pdfh(it, _p4) - }); - let link = links.join("$"); - let content; - if (p.length > 5 && p[5]) { - content = _pdfh(it, p5) - } else { - content = "" - } - let vod_id = link; - let vod_name = _pdfh(it, p1) - .replace(/\n|\t/g, "") - .trim(); - let vod_pic = _pd(it, p2, MY_URL); - if (rule.二级 === "*") { - vod_id = vod_id + "@@" + vod_name + "@@" + vod_pic - } - let ob = { - vod_id: vod_id, - vod_name: vod_name, - vod_pic: vod_pic, - vod_remarks: _pdfh(it, p3) - .replace(/\n|\t/g, "") - .trim(), - vod_content: content.replace(/\n|\t/g, "") - .trim() - }; - d.push(ob) - }) - } - } catch (e) { - print("搜索发生错误:" + e.message); - return "{}" - } - } - if (rule.图片替换 && rule.图片替换.includes("=>")) { - let replace_from = rule.图片替换.split("=>")[0]; - let replace_to = rule.图片替换.split("=>")[1]; - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic.replace(replace_from, replace_to) - } - }) - } - if (rule.图片来源) { - d.forEach(it => { - if (it.vod_pic && it.vod_pic.startsWith("http")) { - it.vod_pic = it.vod_pic + rule.图片来源 - } - }) - } - return JSON.stringify({ - page: parseInt(searchObj.pg), - pagecount: 10, - limit: 20, - total: 100, - list: d - }) -} -function detailParse(detailObj) { - let t1 = (new Date) - .getTime(); - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - let orId = detailObj.orId; - let vod_name = "片名"; - let vod_pic = ""; - let vod_id = orId; - if (rule.二级 === "*") { - let extra = orId.split("@@"); - vod_name = extra.length > 1 ? extra[1] : vod_name; - vod_pic = extra.length > 2 ? extra[2] : vod_pic - } - let vod = { - vod_id: vod_id, - vod_name: vod_name, - vod_pic: vod_pic, - type_name: "类型", - vod_year: "年份", - vod_area: "地区", - vod_remarks: "更新信息", - vod_actor: "主演", - vod_director: "导演", - vod_content: "简介" - }; - let p = detailObj.二级; - let url = detailObj.url; - let detailUrl = detailObj.detailUrl; - let fyclass = detailObj.fyclass; - let tab_exclude = detailObj.tab_exclude; - let html = detailObj.html || ""; - MY_URL = url; - if (detailObj.二级访问前) { - try { - print(`尝试在二级访问前执行代码:${detailObj.二级访问前}`); - eval(detailObj.二级访问前.trim() - .replace("js:", "")) - } catch (e) { - print(`二级访问前执行代码出现错误:${e.message}`) - } - } - if (p === "*") { - vod.vod_play_from = "道长在线"; - vod.vod_remarks = detailUrl; - vod.vod_actor = "没有二级,只有一级链接直接嗅探播放"; - vod.vod_content = MY_URL; - vod.vod_play_url = "嗅探播放$" + MY_URL.split("@@")[0] - } else if (typeof p === "string" && p.trim() - .startsWith("js:")) { - const TYPE = "detail"; - var input = MY_URL; - var play_url = ""; - eval(p.trim() - .replace("js:", "")); - vod = VOD; - console.log(JSON.stringify(vod)) - } else if (p && typeof p === "object") { - let tt1 = (new Date) - .getTime(); - if (!html) { - html = getHtml(MY_URL) - } - print(`二级${MY_URL}仅获取源码耗时:${(new Date).getTime()-tt1}毫秒`); - let _ps; - if (p.is_json) { - print("二级是json"); - _ps = parseTags.json; - html = dealJson(html) - } else if (p.is_jsp) { - print("二级是jsp"); - _ps = parseTags.jsp - } else if (p.is_jq) { - print("二级是jq"); - _ps = parseTags.jq - } else { - print("二级默认jq"); - _ps = parseTags.jq - } - let tt2 = (new Date) - .getTime(); - print(`二级${MY_URL}获取并装载源码耗时:${tt2-tt1}毫秒`); - _pdfa = _ps.pdfa; - _pdfh = _ps.pdfh; - _pd = _ps.pd; - if (p.title) { - let p1 = p.title.split(";"); - vod.vod_name = _pdfh(html, p1[0]) - .replace(/\n|\t/g, "") - .trim(); - let type_name = p1.length > 1 ? _pdfh(html, p1[1]) - .replace(/\n|\t/g, "") - .replace(/ /g, "") - .trim() : ""; - vod.type_name = type_name || vod.type_name - } - if (p.desc) { - try { - let p1 = p.desc.split(";"); - vod.vod_remarks = _pdfh(html, p1[0]) - .replace(/\n|\t/g, "") - .trim(); - vod.vod_year = p1.length > 1 ? _pdfh(html, p1[1]) - .replace(/\n|\t/g, "") - .trim() : ""; - vod.vod_area = p1.length > 2 ? _pdfh(html, p1[2]) - .replace(/\n|\t/g, "") - .trim() : ""; - vod.vod_actor = p1.length > 3 ? _pdfh(html, p1[3]) - .replace(/\n|\t/g, "") - .trim() : ""; - vod.vod_director = p1.length > 4 ? _pdfh(html, p1[4]) - .replace(/\n|\t/g, "") - .trim() : "" - } catch (e) {} - } - if (p.content) { - try { - let p1 = p.content.split(";"); - vod.vod_content = _pdfh(html, p1[0]) - .replace(/\n|\t/g, "") - .trim() - } catch (e) {} - } - if (p.img) { - try { - let p1 = p.img.split(";"); - vod.vod_pic = _pd(html, p1[0], MY_URL) - } catch (e) {} - } - let vod_play_from = "$$$"; - let playFrom = []; - if (p.重定向 && p.重定向.startsWith("js:")) { - print("开始执行重定向代码:" + p.重定向); - html = eval(p.重定向.replace("js:", "")) - } - if (p.tabs) { - if (p.tabs.startsWith("js:")) { - print("开始执行tabs代码:" + p.tabs); - var input = MY_URL; - eval(p.tabs.replace("js:", "")); - playFrom = TABS - } else { - let p_tab = p.tabs.split(";")[0]; - let vHeader = _pdfa(html, p_tab); - console.log(vHeader.length); - let tab_text = p.tab_text || "body&&Text"; - let new_map = {}; - for (let v of vHeader) { - let v_title = _pdfh(v, tab_text) - .trim(); - console.log(v_title); - if (tab_exclude && new RegExp(tab_exclude) - .test(v_title)) { - continue - } - if (!new_map.hasOwnProperty(v_title)) { - new_map[v_title] = 1 - } else { - new_map[v_title] += 1 - } - if (new_map[v_title] > 1) { - v_title += Number(new_map[v_title] - 1) - } - playFrom.push(v_title) - } - } - console.log(JSON.stringify(playFrom)) - } else { - playFrom = ["道长在线"] - } - vod.vod_play_from = playFrom.join(vod_play_from); - let vod_play_url = "$$$"; - let vod_tab_list = []; - if (p.lists) { - if (p.lists.startsWith("js:")) { - print("开始执行lists代码:" + p.lists); - try { - var input = MY_URL; - var play_url = ""; - eval(p.lists.replace("js:", "")); - for (let i in LISTS) { - if (LISTS.hasOwnProperty(i)) { - try { - LISTS[i] = LISTS[i].map(it => it.split("$") - .slice(0, 2) - .join("$")) - } catch (e) { - print("格式化LISTS发生错误:" + e.message) - } - } - } - vod_play_url = LISTS.map(it => it.join("#")) - .join(vod_play_url) - } catch (e) { - print("js执行lists: 发生错误:" + e.message) - } - } else { - let list_text = p.list_text || "body&&Text"; - let list_url = p.list_url || "a&&href"; - let is_tab_js = p.tabs.trim() - .startsWith("js:"); - for (let i = 0; i < playFrom.length; i++) { - let tab_name = playFrom[i]; - let tab_ext = p.tabs.split(";") - .length > 1 && !is_tab_js ? p.tabs.split(";")[1] : ""; - let p1 = p.lists.replaceAll("#idv", tab_name) - .replaceAll("#id", i); - tab_ext = tab_ext.replaceAll("#idv", tab_name) - .replaceAll("#id", i); - let tabName = tab_ext ? _pdfh(html, tab_ext) : tab_name; - console.log(tabName); - let new_vod_list = []; - let tt1 = (new Date) - .getTime(); - if (typeof pdfl === "function") { - new_vod_list = pdfl(html, p1, list_text, list_url, MY_URL) - } else { - let vodList = []; - try { - vodList = _pdfa(html, p1); - console.log("len(vodList):" + vodList.length) - } catch (e) {} - for (let i = 0; i < vodList.length; i++) { - let it = vodList[i]; - new_vod_list.push(_pdfh(it, list_text) - .trim() + "$" + _pd(it, list_url, MY_URL)) - } - } - if (new_vod_list.length > 0) { - new_vod_list = forceOrder(new_vod_list, "", x => x.split("$")[0]); - console.log(`drpy影响性能代码共计列表数循环次数:${new_vod_list.length},耗时:${(new Date).getTime()-tt1}毫秒`) - } - let vlist = new_vod_list.join("#"); - vod_tab_list.push(vlist) - } - vod_play_url = vod_tab_list.join(vod_play_url) - } - } - vod.vod_play_url = vod_play_url - } - if (rule.图片替换 && rule.图片替换.includes("=>")) { - let replace_from = rule.图片替换.split("=>")[0]; - let replace_to = rule.图片替换.split("=>")[1]; - vod.vod_pic = vod.vod_pic.replace(replace_from, replace_to) - } - if (rule.图片来源 && vod.vod_pic && vod.vod_pic.startsWith("http")) { - vod.vod_pic = vod.vod_pic + rule.图片来源 - } - if (!vod.vod_id || vod_id.includes("$") && vod.vod_id !== vod_id) { - vod.vod_id = vod_id - } - let t2 = (new Date) - .getTime(); - console.log(`加载二级界面${MY_URL}耗时:${t2-t1}毫秒`); - vod = vodDeal(vod); - return JSON.stringify({ - list: [vod] - }) -} -function get_tab_index(vod) { - let obj = {}; - vod.vod_play_from.split("$$$") - .forEach((it, index) => { - obj[it] = index - }); - return obj -} -function vodDeal(vod) { - let vod_play_from = vod.vod_play_from.split("$$$"); - let vod_play_url = vod.vod_play_url.split("$$$"); - let tab_removed_list = vod_play_from; - let tab_ordered_list = vod_play_from; - let tab_renamed_list = vod_play_from; - let tab_list = vod_play_from; - let play_ordered_list = vod_play_url; - if (rule.tab_remove && rule.tab_remove.length > 0 || rule.tab_order && rule.tab_order.length > 0) { - let tab_index_dict = get_tab_index(vod); - if (rule.tab_remove && rule.tab_remove.length > 0) { - tab_removed_list = vod_play_from.filter(it => !rule.tab_remove.includes(it)); - tab_list = tab_removed_list - } - if (rule.tab_order && rule.tab_order.length > 0) { - let tab_order = rule.tab_order; - tab_ordered_list = tab_removed_list.sort((a, b) => { - return (tab_order.indexOf(a) === -1 ? 9999 : tab_order.indexOf(a)) - (tab_order.indexOf(b) === -1 ? 9999 : tab_order.indexOf(b)) - }); - tab_list = tab_ordered_list - } - play_ordered_list = tab_list.map(it => vod_play_url[tab_index_dict[it]]) - } - if (rule.tab_rename && typeof rule.tab_rename === "object" & Object.keys(rule.tab_rename) - .length > 0) { - tab_renamed_list = tab_list.map(it => rule.tab_rename[it] || it); - tab_list = tab_renamed_list - } - vod.vod_play_from = tab_list.join("$$$"); - vod.vod_play_url = play_ordered_list.join("$$$"); - return vod -} -function tellIsJx(url) { - try { - let is_vip = !/\.(m3u8|mp4|m4a)$/.test(url.split("?")[0]) && 是否正版(url); - return is_vip ? 1 : 0 - } catch (e) { - return 1 - } -} -function playParse(playObj) { - fetch_params = JSON.parse(JSON.stringify(rule_fetch_params)); - MY_URL = playObj.url; - var MY_FLAG = playObj.flag; - if (!/http/.test(MY_URL)) { - try { - MY_URL = base64Decode(MY_URL) - } catch (e) {} - } - MY_URL = decodeURIComponent(MY_URL); - var input = MY_URL; - var flag = MY_FLAG; - let common_play = { - parse: 1, - url: input, - flag: flag, - jx: tellIsJx(input) - }; - let lazy_play; - if (!rule.play_parse || !rule.lazy) { - lazy_play = common_play - } else if (rule.play_parse && rule.lazy && typeof rule.lazy === "string") { - try { - let lazy_code = rule.lazy.replace("js:", "") - .trim(); - print("开始执行js免嗅=>" + lazy_code); - eval(lazy_code); - lazy_play = typeof input === "object" ? input : { - parse: 1, - jx: tellIsJx(input), - url: input - } - } catch (e) { - print("js免嗅错误:" + e.message); - lazy_play = common_play - } - } else { - lazy_play = common_play - } - if (Array.isArray(rule.play_json) && rule.play_json.length > 0) { - let web_url = lazy_play.url; - for (let pjson of rule.play_json) { - if (pjson.re && (pjson.re === "*" || web_url.match(new RegExp(pjson.re)))) { - if (pjson.json && typeof pjson.json === "object") { - let base_json = pjson.json; - lazy_play = Object.assign(lazy_play, base_json); - break - } - } - } - } else if (rule.play_json && !Array.isArray(rule.play_json)) { - let base_json = { - jx: 1, - parse: 1 - }; - lazy_play = Object.assign(lazy_play, base_json) - } else if (!rule.play_json) { - let base_json = { - jx: 0, - parse: 1 - }; - lazy_play = Object.assign(lazy_play, base_json) - } - console.log(JSON.stringify(lazy_play)); - return JSON.stringify(lazy_play) -} -function proxyParse(proxyObj) { - var input = proxyObj.params; - if (proxyObj.proxy_rule) { - log("准备执行本地代理规则:\n" + proxyObj.proxy_rule); - try { - eval(proxyObj.proxy_rule); - if (input && input !== proxyObj.params && Array.isArray(input) && input.length === 3) { - return input - } else { - return [404, "text/plain", "Not Found"] - } - } catch (e) { - return [500, "text/plain", "代理规则错误:" + e.message] - } - } else { - return [404, "text/plain", "Not Found"] - } -} -function isVideoParse(isVideoObj) { - var input = isVideoObj.url; - if (!isVideoObj.t) { - let re_matcher = new RegExp(isVideoObj.isVideo, "i"); - return re_matcher.test(input) - } else { - try { - eval(isVideoObj.isVideo); - if (typeof input === "boolean") { - return input - } else { - return false - } - } catch (e) { - log("执行嗅探规则发生错误:" + e.message); - return false - } - } -} -function init(ext) { - console.log("init"); - try { - let muban = 模板.getMubans(); - if (typeof ext == "object") { - rule = ext - } else if (typeof ext == "string") { - if (ext.startsWith("http")) { - let js = request(ext, { - method: "GET" - }); - if (js) { - eval(js.replace("var rule", "rule")) - } - } else { - eval(ext.replace("var rule", "rule")) - } - } - if (rule.模板 && muban.hasOwnProperty(rule.模板)) { - print("继承模板:" + rule.模板); - rule = Object.assign(muban[rule.模板], rule) - } - let rule_cate_excludes = (rule.cate_exclude || "") - .split("|") - .filter(it => it.trim()); - let rule_tab_excludes = (rule.tab_exclude || "") - .split("|") - .filter(it => it.trim()); - rule_cate_excludes = rule_cate_excludes.concat(CATE_EXCLUDE.split("|") - .filter(it => it.trim())); - rule_tab_excludes = rule_tab_excludes.concat(TAB_EXCLUDE.split("|") - .filter(it => it.trim())); - rule.cate_exclude = rule_cate_excludes.join("|"); - rule.tab_exclude = rule_tab_excludes.join("|"); - rule.host = (rule.host || "") - .rstrip("/"); - HOST = rule.host; - if (rule.hostJs) { - console.log(`检测到hostJs,准备执行...`); - try { - eval(rule.hostJs); - rule.host = HOST.rstrip("/") - } catch (e) { - console.log(`执行${rule.hostJs}获取host发生错误:` + e.message) - } - } - rule.url = rule.url || ""; - rule.double = rule.double || false; - rule.homeUrl = rule.homeUrl || ""; - rule.detailUrl = rule.detailUrl || ""; - rule.searchUrl = rule.searchUrl || ""; - rule.homeUrl = rule.host && rule.homeUrl ? urljoin(rule.host, rule.homeUrl) : rule.homeUrl || rule.host; - rule.detailUrl = rule.host && rule.detailUrl ? urljoin(rule.host, rule.detailUrl) : rule.detailUrl; - rule.二级访问前 = rule.二级访问前 || ""; - if (rule.url.includes("[") && rule.url.includes("]")) { - let u1 = rule.url.split("[")[0]; - let u2 = rule.url.split("[")[1].split("]")[0]; - rule.url = rule.host && rule.url ? urljoin(rule.host, u1) + "[" + urljoin(rule.host, u2) + "]" : rule.url - } else { - rule.url = rule.host && rule.url ? urljoin(rule.host, rule.url) : rule.url - } - if (rule.searchUrl.includes("[") && rule.searchUrl.includes("]") && !rule.searchUrl.includes("#")) { - let u1 = rule.searchUrl.split("[")[0]; - let u2 = rule.searchUrl.split("[")[1].split("]")[0]; - rule.searchUrl = rule.host && rule.searchUrl ? urljoin(rule.host, u1) + "[" + urljoin(rule.host, u2) + "]" : rule.searchUrl - } else { - rule.searchUrl = rule.host && rule.searchUrl ? urljoin(rule.host, rule.searchUrl) : rule.searchUrl - } - rule.timeout = rule.timeout || 5e3; - rule.encoding = rule.编码 || rule.encoding || "utf-8"; - rule.search_encoding = rule.搜索编码 || rule.search_encoding || ""; - rule.图片来源 = rule.图片来源 || ""; - rule.图片替换 = rule.图片替换 || ""; - rule.play_json = rule.hasOwnProperty("play_json") ? rule.play_json : []; - rule.pagecount = rule.hasOwnProperty("pagecount") ? rule.pagecount : {}; - rule.proxy_rule = rule.hasOwnProperty("proxy_rule") ? rule.proxy_rule : ""; - rule.sniffer = rule.hasOwnProperty("sniffer") ? rule.sniffer : ""; - rule.sniffer = !! (rule.sniffer && rule.sniffer !== "0" && rule.sniffer !== "false"); - rule.isVideo = rule.hasOwnProperty("isVideo") ? rule.isVideo : ""; - rule.tab_remove = rule.hasOwnProperty("tab_remove") ? rule.tab_remove : []; - rule.tab_order = rule.hasOwnProperty("tab_order") ? rule.tab_order : []; - rule.tab_rename = rule.hasOwnProperty("tab_rename") ? rule.tab_rename : {}; - if (rule.headers && typeof rule.headers === "object") { - try { - let header_keys = Object.keys(rule.headers); - for (let k of header_keys) { - if (k.toLowerCase() === "user-agent") { - let v = rule.headers[k]; - console.log(v); - if (["MOBILE_UA", "PC_UA", "UC_UA", "IOS_UA", "UA"].includes(v)) { - rule.headers[k] = eval(v) - } - } else if (k.toLowerCase() === "cookie") { - let v = rule.headers[k]; - if (v && v.startsWith("http")) { - console.log(v); - try { - v = fetch(v); - console.log(v); - rule.headers[k] = v - } catch (e) { - console.log(`从${v}获取cookie发生错误:` + e.message) - } - } - } - } - } catch (e) { - console.log("处理headers发生错误:" + e.message) - } - } - rule_fetch_params = { - headers: rule.headers || false, - timeout: rule.timeout, - encoding: rule.encoding - }; - oheaders = rule.headers || {}; - RKEY = typeof key !== "undefined" && key ? key : "drpy_" + (rule.title || rule.host); - pre(); - init_test() - } catch (e) { - console.log("init_test发生错误:" + e.message) - } -} -let homeHtmlCache = undefined; - -function home(filter) { - console.log("home"); - let homeObj = { - filter: rule.filter || false, - MY_URL: rule.homeUrl, - class_name: rule.class_name || "", - class_url: rule.class_url || "", - class_parse: rule.class_parse || "", - cate_exclude: rule.cate_exclude - }; - return homeParse(homeObj) -} -function homeVod(params) { - console.log("homeVod"); - let homeVodObj = { - "推荐": rule.推荐, - double: rule.double, - homeUrl: rule.homeUrl, - detailUrl: rule.detailUrl - }; - return homeVodParse(homeVodObj) -} -function category(tid, pg, filter, extend) { - let cateObj = { - url: rule.url, - "一级": rule.一级, - tid: tid, - pg: parseInt(pg), - filter: filter, - extend: extend - }; - return categoryParse(cateObj) -} -function detail(vod_url) { - let orId = vod_url; - let fyclass = ""; - log("orId:" + orId); - if (vod_url.indexOf("$") > -1) { - let tmp = vod_url.split("$"); - fyclass = tmp[0]; - vod_url = tmp[1] - } - let detailUrl = vod_url.split("@@")[0]; - let url; - if (!detailUrl.startsWith("http") && !detailUrl.includes("/")) { - url = rule.detailUrl.replaceAll("fyid", detailUrl) - .replaceAll("fyclass", fyclass) - } else if (detailUrl.includes("/")) { - url = urljoin(rule.homeUrl, detailUrl) - } else { - url = detailUrl - } - let detailObj = { - orId: orId, - url: url, - "二级": rule.二级, - "二级访问前": rule.二级访问前, - detailUrl: detailUrl, - fyclass: fyclass, - tab_exclude: rule.tab_exclude - }; - return detailParse(detailObj) -} -function play(flag, id, flags) { - let playObj = { - url: id, - flag: flag, - flags: flags - }; - return playParse(playObj) -} -function search(wd, quick, pg) { - if (rule.search_encoding) { - if (rule.search_encoding.toLowerCase() !== "utf-8") { - wd = encodeStr(wd, rule.search_encoding) - } - } else if (rule.encoding && rule.encoding.toLowerCase() !== "utf-8") { - wd = encodeStr(wd, rule.encoding) - } - let searchObj = { - searchUrl: rule.searchUrl, - "搜索": rule.搜索, - wd: wd, - pg: pg || 1, - quick: quick - }; - return searchParse(searchObj) -} -function proxy(params) { - if (rule.proxy_rule && rule.proxy_rule.trim()) { - rule.proxy_rule = rule.proxy_rule.trim() - } - if (rule.proxy_rule.startsWith("js:")) { - rule.proxy_rule = rule.proxy_rule.replace("js:", "") - } - let proxyObj = { - params: params, - proxy_rule: rule.proxy_rule - }; - return proxyParse(proxyObj) -} -function sniffer() { - let enable_sniffer = rule.sniffer || false; - if (enable_sniffer) { - log("开始执行辅助嗅探代理规则...") - } - return enable_sniffer -} -function isVideo(url) { - let t = 0; - let is_video; - if (rule.isVideo && rule.isVideo.trim()) { - is_video = rule.isVideo.trim() - } - if (is_video.startsWith("js:")) { - is_video = is_video.replace("js:", ""); - t = 1 - } - let isVideoObj = { - url: url, - isVideo: is_video, - t: t - }; - let result = isVideoParse(isVideoObj); - if (result) { - log("成功执行辅助嗅探规则并检测到视频地址:\n" + rule.isVideo) - } - return result -} -function DRPY() { - return { - init: init, - home: home, - homeVod: homeVod, - category: category, - detail: detail, - play: play, - search: search, - proxy: proxy, - sniffer: sniffer, - isVideo: isVideo - } -} -export -default { - init: init, - home: home, - homeVod: homeVod, - category: category, - detail: detail, - play: play, - search: search, - proxy: proxy, - sniffer: sniffer, - isVideo: isVideo, - DRPY: DRPY -}; \ No newline at end of file diff --git a/lib/动漫岛.js b/lib/动漫岛.js deleted file mode 100644 index 0f11389..0000000 --- a/lib/动漫岛.js +++ /dev/null @@ -1,32 +0,0 @@ -var rule = { - title:'动漫岛', - // host:'http://www.dmd85.com', - // host:'http://www.88dmw.com', - host:'http://www.dmd77.com', - // url:'/vod-list-id-fyclass-pg-fypage-order--by-{by}-class-{class}-year-{year}-letter--area--lang-.html', - url:'/vod-list-id-fyclass-pg-fypage-order-fyfilter-area--lang-.html', - filterable:1,//是否启用分类筛选, - filter_url:'-by-{{fl.by}}-class-{{fl.class}}-year-{{fl.year}}-letter-{{fl.letter}}', - filter: {"1":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"1"},{"n":"热血","v":"2"},{"n":"奇幻","v":"3"},{"n":"恋爱","v":"4"},{"n":"校园","v":"5"},{"n":"后宫","v":"6"},{"n":"搞笑","v":"7"},{"n":"青春","v":"8"},{"n":"百合","v":"9"},{"n":"科幻","v":"14"},{"n":"推理","v":"13"},{"n":"魔法","v":"12"},{"n":"神魔","v":"11"},{"n":"治愈","v":"10"},{"n":"竞技","v":"59"},{"n":"悬疑","v":"60"},{"n":"战争","v":"62"},{"n":"萝莉","v":"63"},{"n":"魔幻","v":"64"},{"n":"战斗","v":"65"},{"n":"歌舞","v":"98"},{"n":"历史","v":"99"},{"n":"励志","v":"108"},{"n":"偶像","v":"118"},{"n":"职场","v":"121"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"time"},{"n":"得分","v":"score"},{"n":"总排行","v":"hits"}]}],"3":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"36"},{"n":"热血","v":"37"},{"n":"奇幻","v":"38"},{"n":"恋爱","v":"39"},{"n":"恋爱","v":"40"},{"n":"恋爱","v":"40"},{"n":"搞笑","v":"42"},{"n":"治愈","v":"43"},{"n":"神魔","v":"44"},{"n":"魔法","v":"45"},{"n":"百合","v":"46"},{"n":"推理","v":"47"},{"n":"科幻","v":"48"},{"n":"竞技","v":"49"},{"n":"悬疑","v":"66"},{"n":"战争","v":"68"},{"n":"萝莉","v":"69"},{"n":"魔幻","v":"70"},{"n":"战斗","v":"71"},{"n":"青春","v":"72"},{"n":"历史","v":"100"},{"n":"歌舞","v":"101"},{"n":"恐怖","v":"104"},{"n":"职场","v":"107"},{"n":"励志","v":"109"},{"n":"偶像","v":"119"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"time"},{"n":"得分","v":"score"},{"n":"总排行","v":"hits"}]}],"4":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"50"},{"n":"热血","v":"51"},{"n":"武侠","v":"52"},{"n":"奇幻","v":"53"},{"n":"玄幻","v":"54"},{"n":"竞技","v":"55"},{"n":"魔幻","v":"56"},{"n":"科幻","v":"57"},{"n":"恋爱","v":"58"},{"n":"历史","v":"73"},{"n":"战斗","v":"74"},{"n":"搞笑","v":"75"},{"n":"神魔","v":"76"},{"n":"战争","v":"97"},{"n":"古风","v":"111"},{"n":"少女","v":"112"},{"n":"萝莉","v":"113"},{"n":"治愈","v":"114"},{"n":"日常","v":"115"},{"n":"歌舞","v":"116"},{"n":"偶像","v":"120"},{"n":"职场","v":"123"},{"n":"仙侠","v":"125"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"time"},{"n":"得分","v":"score"},{"n":"总排行","v":"hits"}]}],"16":[{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"77"},{"n":"热血","v":"78"},{"n":"奇幻","v":"79"},{"n":"恋爱","v":"80"},{"n":"校园","v":"81"},{"n":"后宫","v":"82"},{"n":"搞笑","v":"83"},{"n":"青春","v":"84"},{"n":"百合","v":"85"},{"n":"治愈","v":"86"},{"n":"神魔","v":"87"},{"n":"魔法","v":"88"},{"n":"推理","v":"89"},{"n":"科幻","v":"90"},{"n":"竞技","v":"91"},{"n":"悬疑","v":"92"},{"n":"战争","v":"93"},{"n":"萝莉","v":"94"},{"n":"魔幻","v":"95"},{"n":"战斗","v":"96"},{"n":"历史","v":"102"},{"n":"歌舞","v":"103"},{"n":"恐怖","v":"105"},{"n":"职场","v":"106"},{"n":"励志","v":"110"},{"n":"偶像","v":"117"},{"n":"职场","v":"124"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"time"},{"n":"得分","v":"score"},{"n":"总排行","v":"hits"}]}]}, - searchUrl:'/search-pg-fypage-wd-**.html', - searchable:2,//是否启用全局搜索, - quickSearch:0,//是否启用快速搜索, - headers:{ - 'User-Agent':'PC_UA', - }, - class_parse:'.secNacUl li;a&&Text;a&&href;.*/(\\d+)-1.html', - play_parse:true, - lazy:'', - limit:6, - 推荐:'.c1_l_wap_contact li;*;img&&src;.time:eq(0)&&Text;*', - 一级:'.list3_cn_box .cn_box2;a&&title;.list_pic&&src;.list_20 li:eq(1) span&&Text;a&&href', - 二级:{ - "title":"h1&&Text;.o_r_contact&&li:eq(0)&&Text", - "img":".o_big_img_bg_b img&&src", - "desc":".o_r_contact&&li:eq(6)&&Text;.o_r_contact&&li:eq(5)&&Text;.o_r_contact&&li:eq(3)&&Text;.o_r_contact&&li:eq(2)&&Text;.o_r_contact&&li:eq(1)&&Text", - "content":".des_box&&Text", - "tabs":".from-tabs&&label", - "lists":".mn_list_li_movie:eq(#id) li" - }, - 搜索:'*', -} \ No newline at end of file diff --git a/lib/动漫巴士.json b/lib/动漫巴士.json deleted file mode 100644 index b921c62..0000000 --- a/lib/动漫巴士.json +++ /dev/null @@ -1,161 +0,0 @@ - { - "作者":"荷城茶秀", - - "站名":"动漫巴士", - - "数组":"
&&
", - - "图片":"data-bg=\"&&\"", - - "标题":"\"title\"*>&&", - - "副标题":"&&", - - "分类url":"https://dm84.tv/show-{cateId}--{by}-{class}--{year}-{catePg}.html", - - "分类":"国产动漫$1#日本动漫$2#欧美动漫$3#电影$4", - - "筛选":{ - "1":[ - {"key":"class","name":"类型","value":[ - {"n":"全部","v":"全部"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"战斗","v":"战斗"}, - {"n":"玄幻","v":"玄幻"}, - {"n":"穿越","v":"穿越"}, - {"n":"科幻","v":"科幻"}, - {"n":"武侠","v":"武侠"}, - {"n":"热血","v":"热血"}, - {"n":"耽美","v":"耽美"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"动态漫画","v":"动态漫画"} - ] - }, - {"key":"year","name":"时间","value":[ - {"n":"全部","v":"全部"}, - {"n":"2023","v":"2023"}, - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"} - ] - }, - {"key":"by","name":"排序","value":[ - {"n":"按时间","v":"time"}, - {"n":"按人气","v":"hits"}, - {"n":"按评分","v":"score"} - ] - } - ], - "2":[ - {"key":"class","name":"类型","value":[ - {"n":"全部","v":"全部"}, - {"n":"冒险","v":"冒险"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"战斗","v":"战斗"}, - {"n":"后宫","v":"后宫"}, - {"n":"热血","v":"热血"}, - {"n":"励志","v":"励志"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"校园","v":"校园"}, - {"n":"机战","v":"机战"}, - {"n":"悬疑","v":"悬疑"}, - {"n":"治愈","v":"治愈"}, - {"n":"百合","v":"百合"}, - {"n":"恐怖","v":"恐怖"}, - {"n":"泡面番","v":"泡面番"}, - {"n":"恋爱","v":"恋爱"}, - {"n":"推理","v":"推理"} - ] - }, - {"key":"year","name":"时间","value":[ - {"n":"全部","v":"全部"}, - {"n":"2023","v":"2023"}, - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"} - ] - }, - {"key":"by","name":"排序","value":[ - {"n":"按时间","v":"time"}, - {"n":"按人气","v":"hits"}, - {"n":"按评分","v":"score"} - ] - } - ], - "3":[ - {"key":"class","name":"类型","value":[ - {"n":"全部","v":"全部"}, - {"n":"科幻","v":"科幻"}, - {"n":"冒险","v":"冒险"}, - {"n":"战斗","v":"战斗"}, - {"n":"百合","v":"百合"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"热血","v":"热血"}, - {"n":"搞笑","v":"搞笑"} - ] - }, - {"key":"year","name":"时间","value":[ - {"n":"全部","v":"全部"}, - {"n":"2023","v":"2023"}, - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"} - ] - }, - {"key":"by","name":"排序","value":[ - {"n":"按时间","v":"time"}, - {"n":"按人气","v":"hits"}, - {"n":"按评分","v":"score"} - ] - } - ], - "4":[ - {"key":"class","name":"类型","value":[ - {"n":"全部","v":"全部"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"治愈","v":"治愈"}, - {"n":"科幻","v":"科幻"}, - {"n":"喜剧","v":"喜剧"}, - {"n":"冒险","v":"冒险"}, - {"n":"动作","v":"动作"}, - {"n":"爱情","v":"爱情"} - ] - }, - {"key":"year","name":"时间","value":[ - {"n":"全部","v":"全部"}, - {"n":"2023","v":"2023"}, - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"} - ] - }, - {"key":"by","name":"排序","value":[ - {"n":"按时间","v":"time"}, - {"n":"按人气","v":"hits"}, - {"n":"按评分","v":"score"} - ] - } - ] - } - } \ No newline at end of file diff --git a/lib/去看吧.js b/lib/去看吧.js deleted file mode 100644 index a8e1393..0000000 --- a/lib/去看吧.js +++ /dev/null @@ -1,19 +0,0 @@ -muban.vfed.二级.title = 'h1&&Text;.fed-col-md3--span:eq(0)&&Text'; -muban.vfed.二级.desc = '.fed-col-md3:eq(3)&&Text;;;.fed-col-md6:eq(0)&&Text;.fed-col-md6--span:eq(1)&&Text'; -var rule = { - title: '去看吧', - 模板:'vfed', - host: 'https://www.k9dm.com', - // url: '/index.php/vod/show/id/fyclass/page/fypage.html', - url: '/index.php/vod/show/id/fyclassfyfilter.html', - filterable:1,//是否启用分类筛选, - filter_url:'{{fl.area}}{{fl.by}}{{fl.class}}/page/fypage{{fl.year}}', - filter:{ - "33":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"/class/搞笑"},{"n":"经典","v":"/class/经典"},{"n":"热血","v":"/class/热血"},{"n":"催泪","v":"/class/催泪"},{"n":"治愈","v":"/class/治愈"},{"n":"猎奇","v":"/class/猎奇"},{"n":"励志","v":"/class/励志"},{"n":"战斗","v":"/class/战斗"},{"n":"后宫","v":"/class/后宫"},{"n":"机战","v":"/class/机战"},{"n":"恋爱","v":"/class/恋爱"},{"n":"百合","v":"/class/百合"},{"n":"科幻","v":"/class/科幻"},{"n":"奇幻","v":"/class/奇幻"},{"n":"推理","v":"/class/推理"},{"n":"校园","v":"/class/校园"},{"n":"运动","v":"/class/运动"},{"n":"魔法","v":"/class/魔法"},{"n":"历史","v":"/class/历史"},{"n":"伪娘","v":"/class/伪娘"},{"n":"美少女","v":"/class/美少女"},{"n":"萝莉","v":"/class/萝莉"},{"n":"亲子","v":"/class/亲子"},{"n":"青春","v":"/class/青春"},{"n":"冒险","v":"/class/冒险"},{"n":"竞技","v":"/class/竞技"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"},{"n":"1999","v":"/year/1999"},{"n":"1998","v":"/year/1998"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "21":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"/class/搞笑"},{"n":"经典","v":"/class/经典"},{"n":"热血","v":"/class/热血"},{"n":"催泪","v":"/class/催泪"},{"n":"治愈","v":"/class/治愈"},{"n":"猎奇","v":"/class/猎奇"},{"n":"励志","v":"/class/励志"},{"n":"战斗","v":"/class/战斗"},{"n":"后宫","v":"/class/后宫"},{"n":"机战","v":"/class/机战"},{"n":"恋爱","v":"/class/恋爱"},{"n":"百合","v":"/class/百合"},{"n":"科幻","v":"/class/科幻"},{"n":"奇幻","v":"/class/奇幻"},{"n":"推理","v":"/class/推理"},{"n":"校园","v":"/class/校园"},{"n":"运动","v":"/class/运动"},{"n":"魔法","v":"/class/魔法"},{"n":"历史","v":"/class/历史"},{"n":"伪娘","v":"/class/伪娘"},{"n":"美少女","v":"/class/美少女"},{"n":"萝莉","v":"/class/萝莉"},{"n":"亲子","v":"/class/亲子"},{"n":"青春","v":"/class/青春"},{"n":"冒险","v":"/class/冒险"},{"n":"竞技","v":"/class/竞技"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"/area/大陆"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"其它","v":"/area/其它"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"},{"n":"1999","v":"/year/1999"},{"n":"1998","v":"/year/1998"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "50":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"/class/搞笑"},{"n":"经典","v":"/class/经典"},{"n":"热血","v":"/class/热血"},{"n":"催泪","v":"/class/催泪"},{"n":"治愈","v":"/class/治愈"},{"n":"猎奇","v":"/class/猎奇"},{"n":"励志","v":"/class/励志"},{"n":"战斗","v":"/class/战斗"},{"n":"后宫","v":"/class/后宫"},{"n":"机战","v":"/class/机战"},{"n":"恋爱","v":"/class/恋爱"},{"n":"百合","v":"/class/百合"},{"n":"科幻","v":"/class/科幻"},{"n":"奇幻","v":"/class/奇幻"},{"n":"推理","v":"/class/推理"},{"n":"校园","v":"/class/校园"},{"n":"运动","v":"/class/运动"},{"n":"魔法","v":"/class/魔法"},{"n":"历史","v":"/class/历史"},{"n":"伪娘","v":"/class/伪娘"},{"n":"美少女","v":"/class/美少女"},{"n":"萝莉","v":"/class/萝莉"},{"n":"亲子","v":"/class/亲子"},{"n":"青春","v":"/class/青春"},{"n":"冒险","v":"/class/冒险"},{"n":"竞技","v":"/class/竞技"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"/area/大陆"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"其它","v":"/area/其它"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"},{"n":"1999","v":"/year/1999"},{"n":"1998","v":"/year/1998"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "24":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"/class/搞笑"},{"n":"经典","v":"/class/经典"},{"n":"热血","v":"/class/热血"},{"n":"催泪","v":"/class/催泪"},{"n":"治愈","v":"/class/治愈"},{"n":"猎奇","v":"/class/猎奇"},{"n":"励志","v":"/class/励志"},{"n":"战斗","v":"/class/战斗"},{"n":"后宫","v":"/class/后宫"},{"n":"机战","v":"/class/机战"},{"n":"恋爱","v":"/class/恋爱"},{"n":"百合","v":"/class/百合"},{"n":"科幻","v":"/class/科幻"},{"n":"奇幻","v":"/class/奇幻"},{"n":"推理","v":"/class/推理"},{"n":"校园","v":"/class/校园"},{"n":"运动","v":"/class/运动"},{"n":"魔法","v":"/class/魔法"},{"n":"历史","v":"/class/历史"},{"n":"伪娘","v":"/class/伪娘"},{"n":"美少女","v":"/class/美少女"},{"n":"萝莉","v":"/class/萝莉"},{"n":"亲子","v":"/class/亲子"},{"n":"青春","v":"/class/青春"},{"n":"冒险","v":"/class/冒险"},{"n":"竞技","v":"/class/竞技"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"/area/大陆"},{"n":"美国","v":"/area/美国"},{"n":"韩国","v":"/area/韩国"},{"n":"日本","v":"/area/日本"},{"n":"泰国","v":"/area/泰国"},{"n":"新加坡","v":"/area/新加坡"},{"n":"马来西亚","v":"/area/马来西亚"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"俄罗斯","v":"/area/俄罗斯"},{"n":"其它","v":"/area/其它"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"},{"n":"1999","v":"/year/1999"},{"n":"1998","v":"/year/1998"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "22":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"/class/搞笑"},{"n":"经典","v":"/class/经典"},{"n":"热血","v":"/class/热血"},{"n":"催泪","v":"/class/催泪"},{"n":"治愈","v":"/class/治愈"},{"n":"猎奇","v":"/class/猎奇"},{"n":"励志","v":"/class/励志"},{"n":"战斗","v":"/class/战斗"},{"n":"后宫","v":"/class/后宫"},{"n":"机战","v":"/class/机战"},{"n":"恋爱","v":"/class/恋爱"},{"n":"百合","v":"/class/百合"},{"n":"科幻","v":"/class/科幻"},{"n":"奇幻","v":"/class/奇幻"},{"n":"推理","v":"/class/推理"},{"n":"校园","v":"/class/校园"},{"n":"运动","v":"/class/运动"},{"n":"魔法","v":"/class/魔法"},{"n":"历史","v":"/class/历史"},{"n":"伪娘","v":"/class/伪娘"},{"n":"美少女","v":"/class/美少女"},{"n":"萝莉","v":"/class/萝莉"},{"n":"亲子","v":"/class/亲子"},{"n":"青春","v":"/class/青春"},{"n":"冒险","v":"/class/冒险"},{"n":"竞技","v":"/class/竞技"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"/area/日本"},{"n":"欧美","v":"/area/欧美"},{"n":"其他","v":"/area/其他"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"},{"n":"1999","v":"/year/1999"},{"n":"1998","v":"/year/1998"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}] - }, - class_parse: '.fed-pops-list:eq(0)&&li:gt(0):lt(6);a&&Text;a&&href;.*/(.*?).html', -} \ No newline at end of file diff --git a/lib/喵次元.js b/lib/喵次元.js deleted file mode 100644 index 02e19ad..0000000 --- a/lib/喵次元.js +++ /dev/null @@ -1,237 +0,0 @@ -globalThis.getTime = function(){ -let ts= Math.round(new Date().getTime()/1000).toString(); -log('获取时间戳:'+ts); -return ts -} - -globalThis.signUrl=function(json){ -// 获取所有节点的名称并按字母顺序排序 -let json1=JSON.parse(json); -var sortedKeys = Object.keys(json1).sort(); -// 遍历排好序的节点名称列表,并打印相应的值 -let s=''; -for (let key in sortedKeys){ - let value=json1[sortedKeys[key]]; - if(value!=undefined){ - s=s+value; - } -} -//log(s); -//log(md5(s+"alskeuscli")); -s=json.slice(0,-1)+",\"sign\":\""+md5(s+"alskeuscli")+"\"\}"; -log(s); -return s; -} - -globalThis.posturl=function(url,json){ - let html= fetch(url, { - body: JSON.parse(signUrl(json)), - headers: {"User-Agent": "okhttp/3.12.3"}, - method: "POST" - }, true); - return JSON.parse(html); -} -var rule = { - title: '喵次元[APP]', - host: 'https://cym.fengche.tv/api.php/', - hostJs:` - var json2 = '{"versionName":"5.6.9","uuid":"9cc01079c64e2495","version":"4835d0a2","versionCode":"35","ctime":"'+getTime()+'"}'; - let url="https://cym.fengche.tv/api.php/type/get_list"; - let jo=posturl(url,json2).data.list; - let filters = {}; - let cb={"class":"类型","area":"地区","lang":"语言","year":"年份","star":"演员","director":"导演","state":"状态","version":"版本"}; - let class1=[]; - jo.forEach(function(tp) { - rule.class_name=rule.class_name +"&"+tp['type_name']; - rule.class_url=rule.class_url +"&"+tp['type_id']; - let ep=tp['type_extend']; - let classes = []; - for (let key in ep){ - let value=ep[key]; - - if (value.length>1){ - class1.append(key); - //写成{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"大陆","v":"大陆"}]}这种格式 - let dd=value.toString().split(','); - var s=[]; - dd.forEach(function(i){ - s.append({'n':i,'v':i}); - }) - let ss={"key":key,"name":cb[key],"value":s}; - classes.append(ss); - } - } - filters[tp['type_id']]=classes; - }); - class1=Array.from(new Set(class1)).sort(); - let s="" - class1.forEach(function(tp) { - s=s+"&" + tp +"={{fl."+tp+"}}"; - }) - log(s); - rule.filter_url=s; - rule.filter=filters; - log(rule.filter); - log(rule.class_name); - log(rule.class_url); -`, - - homeUrl:'?hpindigo=**&page=fypage', - url:'?t=fyclass&page=fypage', - filter_url:'', - filter: {}, - detailUrl:'?ids=', - searchUrl: '?hpindigo=**&page=fypage', - searchable: 2, - quickSearch: 0, - filterable:1,//是否启用分类筛选, - headers:{'User-Agent':'MOBILE_UA'}, - timeout:10000, - class_name:'全部', // 分类筛选 /api.php/app/nav - class_url:'0', - play_parse:true, - lazy:`js: - log("*************测试*************"); - let dd=input.split("&"); - let ju_id=dd[0]; - let plyer=dd[1]; - let video_id=dd[2]; - var json2 = '{"player_id":"'+plyer+'","ju_id":"'+ju_id+'","vod_id":"'+video_id+'","versionName":"5.6.9","uuid":"3899af59c0b12b98","version":"4835d0a2","versionCode":"35","ctime":"'+getTime()+'"}'; - let url="https://cym.fengche.tv/api.php/video/get_definition"; - let html = posturl(url,json2).data[0].url.trim(); - log(html); - //input=aesX("AES/CBC/PKCS7",false,html,true,"sLunqcoH85Nm/jDmFKns7A==","fedcba9876543210",false); - //log(input); - eval(getCryptoJS); - var key = CryptoJS.enc.Hex.parse("734C756E71636F4838354E6D2F6A446D464B6E7337413D3D0000000000000000"); - var iv = CryptoJS.enc.Utf8.parse("fedcba9876543210"); - input=(CryptoJS.AES.decrypt(html, key, { - iv: iv, - mode: CryptoJS.mode.CBC, - padding: CryptoJS.pad.Pkcs7 - })).toString(CryptoJS.enc.Utf8) - log(input) - `, - //lazy:'js:input=/m3u8|mp4|flv/.test(input)?{jx:0,url:input,parse:0}:{jx:1,url:input,parse:1}', - limit:6, - // 推荐:'json:items;*;*;*;*', - 推荐:'json:data.sections[0].items;*;*;*;*', - 推荐:`js: - log(input); - let page=input.split("&")[1].split("=")[1]; - log(page); - var json2 = '{"page":"'+page+'","versionName":"5.6.9","uuid":"9cc01079c64e2495","version":"4835d0a2","versionCode":"35","ctime":"'+getTime()+'"}'; - let url="https://cym.fengche.tv/api.php/video/index"; - let jo = posturl(url,json2); - let vodList = jo.data; - log(vodList); - let videos=[]; - vodList.forEach(function(vod) { - vod.video.forEach(function(vod1) { - let aid = (vod1["vod_id"]); - let title = vod1["vod_name"]; - let img = vod1["vod_pic"]; - let remark = vod1["vod_remarks"]; - videos.push({ - vod_id: aid, - vod_name: title, - vod_pic: img, - vod_remarks: remark - }) - }) - }) - - VODS=videos; - `, - 一级:`js: - log(input); - let canshu=input.split("?")[1].split("&"); - let dd={}; - canshu.forEach(function(key){ - log(key); - let k=key.split("="); - dd[k[0]]=k[1]; - }) - var json2 = '{"type_id":"'+dd["t"]+'","vod_year":"'+dd["year"]+'","limit":"20","orderby":"","vod_area":"'+dd["area"]+'","vod_class":"'+dd["class"]+'","page":"'+dd["page"]+'","versionName":"5.6.9","uuid":"9cc01079c64e2495","version":"4835d0a2","vod_name":"","versionCode":"35","ctime":"'+getTime()+'"}'; - log(json2); - let url="https://cym.fengche.tv/api.php/video/get_list"; - let jo = posturl(url,json2); - var d=[]; - jo.data.list.forEach(function(it){ - d.push({ - title:it.vod_name, - img:it.vod_pic, - desc:it.vod_remarks, - url:it.vod_id, - content:it.vod_blurb}) - }); - setResult(d); - `, - 二级:`js: - log(orId); - var json2 = '{"vod_id":"'+orId+'","versionName":"5.6.9","uuid":"3899af59c0b12b98","version":"4835d0a2","versionCode":"35","ctime":"'+getTime()+'"}'; - log(json2); - let url="https://cym.fengche.tv/api.php/video/get_detail"; - let jo = posturl(url,json2); - let node = jo.data; - VOD = { - vod_id: node["vod_id"], - vod_name: node["vod_name"], - vod_pic: node["vod_pic"], - type_name: node["vod_class"], - vod_year: node["vod_year"], - vod_area: node["vod_area"], - vod_remarks: node["vod_remarks"], - vod_actor: node["vod_actor"], - vod_director: node["vod_director"], - vod_content: node["vod_content"] - }; - let episodes = node.player; - let playMap = {}; - episodes.forEach(function(ep) { - let playurls = ep["code"]; - let source = ep["name"]; - log (playurls); - log (source); - //这里分别获取线路 - var json2 = '{"limit":"5000","vod_id":"'+orId+'","page":"1","versionName":"5.6.9","uuid":"9cc01079c64e2495","version":"4835d0a2","versionCode":"35","player":"'+playurls+'","ctime":"'+getTime()+'"}'; - log(json2); - let url="https://cym.fengche.tv/api.php/video/get_player"; - let jo1 = posturl(url,json2); - jo1.data.list.forEach(function(playurl) { - if (!playMap.hasOwnProperty(source)) { - playMap[source] = [] - } - playMap[source].append(playurl["drama"]+"$"+playurl["ju_id"]+"&"+playurl["plyer"]+"&"+playurl["video_id"]) - }) - }); - - let playFrom = []; - let playList = []; - - Object.keys(playMap) - .forEach(function(key) { - playFrom.append(key); - playList.append(playMap[key].join("#")) - }); - let vod_play_from = playFrom.join("$$$"); - let vod_play_url = playList.join("$$$"); - VOD["vod_play_from"] = vod_play_from; - VOD["vod_play_url"] = vod_play_url - `, - 搜索:`js: - let page=input.split("&")[1].split("=")[1]; - log(page); - var json2 = '{"vod_year":"","limit":"20","orderby":"up","vod_area":"","vod_class":"","page":"'+page+'","versionName":"5.6.9","uuid":"9cc01079c64e2495","version":"4835d0a2","vod_name":"'+KEY+'","versionCode":"35","ctime":"'+getTime()+'"}'; - let url="https://cym.fengche.tv/api.php/video/get_list"; - let jo = posturl(url,json2); - var d=[]; - jo.data.list.forEach(function(it){ - d.push({ - title:it.vod_name, - img:it.vod_pic, - desc:it.vod_remarks, - url:it.vod_id}) - }); - setResult(d);`, -} \ No newline at end of file diff --git a/lib/喵物次元.js b/lib/喵物次元.js deleted file mode 100644 index 9d8ea54..0000000 --- a/lib/喵物次元.js +++ /dev/null @@ -1,23 +0,0 @@ -var rule = { - title: '喵物次元', - host: 'https://catw.moe', - 模板:'短视2', - searchUrl: '/index.php/vod/search/wd/**.html', - url:'index.php/vod/show/id/fyclass/page/fypage.html', - searchable: 2,//是否启用全局搜索, - quickSearch: 1,//是否启用快速搜索, - filterable: 0,//是否启用分类筛选, - headers: { - 'User-Agent': 'MOBILE_UA' - }, - play_parse: true, - lazy: '', - limit: 6, - tab_rename:{'喵物次元':'LR',}, - class_name:'TV动画&剧场版&特摄剧', - class_url:'1&2&20', - double: false, // 推荐内容是否双层定位 - 推荐: '*', - 一级: '.public-list-exp;a&&title;img&&data-src;.ft2&&Text;a&&href', - 搜索: '.public-list-box;.thumb-txt&&Text;.public-list-exp&&img&&data-src;.public-list-prb&&Text;a&&href' - } diff --git a/lib/奇米动漫.js b/lib/奇米动漫.js deleted file mode 100644 index 678df00..0000000 --- a/lib/奇米动漫.js +++ /dev/null @@ -1,52 +0,0 @@ -var rule={ - title:'奇米动漫', - host:'http://www.qimiqimi.net', - url:'/show/fyclassfyfilter.html', - filterable:1,//是否启用分类筛选, - filter_url:'{{fl.area}}{{fl.by}}{{fl.class}}{{fl.letter}}/page/fypage{{fl.year}}', - filter: { - "xinfan":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"冒险","v":"/class/冒险"},{"n":"热血","v":"/class/热血"},{"n":"奇幻","v":"/class/奇幻"},{"n":"恋爱","v":"/class/恋爱"},{"n":"校园","v":"/class/校园"},{"n":"后宫","v":"/class/后宫"},{"n":"搞笑","v":"/class/搞笑"},{"n":"治愈","v":"/class/治愈"},{"n":"神魔","v":"/class/神魔"},{"n":"魔法","v":"/class/魔法"},{"n":"百合","v":"/class/百合"},{"n":"推理","v":"/class/推理"},{"n":"科幻","v":"/class/科幻"},{"n":"竞技","v":"/class/竞技"},{"n":"悬疑","v":"/class/悬疑"},{"n":"青春","v":"/class/青春"},{"n":"战争","v":"/class/战争"},{"n":"萝莉","v":"/class/萝莉"},{"n":"魔幻","v":"/class/魔幻"},{"n":"战斗","v":"/class/战斗"},{"n":"日常","v":"/class/日常"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"/area/日本/"},{"n":"大陆","v":"/area/中国/"},{"n":"欧美","v":"/area/欧美/"},{"n":"韩国","v":"/area/韩国/"},{"n":"港台","v":"/area/港台/"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"}]},{"key":"letter","name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"/letter/A"},{"n":"B","v":"/letter/B"},{"n":"C","v":"/letter/C"},{"n":"D","v":"/letter/D"},{"n":"E","v":"/letter/E"},{"n":"F","v":"/letter/F"},{"n":"G","v":"/letter/G"},{"n":"H","v":"/letter/H"},{"n":"I","v":"/letter/I"},{"n":"J","v":"/letter/J"},{"n":"K","v":"/letter/K"},{"n":"L","v":"/letter/L"},{"n":"M","v":"/letter/M"},{"n":"N","v":"/letter/N"},{"n":"O","v":"/letter/O"},{"n":"P","v":"/letter/P"},{"n":"Q","v":"/letter/Q"},{"n":"R","v":"/letter/R"},{"n":"S","v":"/letter/S"},{"n":"T","v":"/letter/T"},{"n":"U","v":"/letter/U"},{"n":"V","v":"/letter/V"},{"n":"W","v":"/letter/W"},{"n":"X","v":"/letter/X"},{"n":"Y","v":"/letter/Y"},{"n":"Z","v":"/letter/Z"},{"n":"0-9","v":"/letter/0-9"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "riman":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"冒险","v":"/class/冒险"},{"n":"热血","v":"/class/热血"},{"n":"奇幻","v":"/class/奇幻"},{"n":"恋爱","v":"/class/恋爱"},{"n":"校园","v":"/class/校园"},{"n":"后宫","v":"/class/后宫"},{"n":"搞笑","v":"/class/搞笑"},{"n":"治愈","v":"/class/治愈"},{"n":"神魔","v":"/class/神魔"},{"n":"魔法","v":"/class/魔法"},{"n":"百合","v":"/class/百合"},{"n":"推理","v":"/class/推理"},{"n":"科幻","v":"/class/科幻"},{"n":"竞技","v":"/class/竞技"},{"n":"悬疑","v":"/class/悬疑"},{"n":"青春","v":"/class/青春"},{"n":"战争","v":"/class/战争"},{"n":"萝莉","v":"/class/萝莉"},{"n":"魔幻","v":"/class/魔幻"},{"n":"战斗","v":"/class/战斗"},{"n":"日常","v":"/class/日常"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"/area/日本/"},{"n":"大陆","v":"/area/中国/"},{"n":"欧美","v":"/area/欧美/"},{"n":"韩国","v":"/area/韩国/"},{"n":"港台","v":"/area/港台/"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"}]},{"key":"letter","name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"/letter/A"},{"n":"B","v":"/letter/B"},{"n":"C","v":"/letter/C"},{"n":"D","v":"/letter/D"},{"n":"E","v":"/letter/E"},{"n":"F","v":"/letter/F"},{"n":"G","v":"/letter/G"},{"n":"H","v":"/letter/H"},{"n":"I","v":"/letter/I"},{"n":"J","v":"/letter/J"},{"n":"K","v":"/letter/K"},{"n":"L","v":"/letter/L"},{"n":"M","v":"/letter/M"},{"n":"N","v":"/letter/N"},{"n":"O","v":"/letter/O"},{"n":"P","v":"/letter/P"},{"n":"Q","v":"/letter/Q"},{"n":"R","v":"/letter/R"},{"n":"S","v":"/letter/S"},{"n":"T","v":"/letter/T"},{"n":"U","v":"/letter/U"},{"n":"V","v":"/letter/V"},{"n":"W","v":"/letter/W"},{"n":"X","v":"/letter/X"},{"n":"Y","v":"/letter/Y"},{"n":"Z","v":"/letter/Z"},{"n":"0-9","v":"/letter/0-9"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "guoman":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"冒险","v":"/class/冒险"},{"n":"热血","v":"/class/热血"},{"n":"奇幻","v":"/class/奇幻"},{"n":"恋爱","v":"/class/恋爱"},{"n":"校园","v":"/class/校园"},{"n":"后宫","v":"/class/后宫"},{"n":"搞笑","v":"/class/搞笑"},{"n":"治愈","v":"/class/治愈"},{"n":"神魔","v":"/class/神魔"},{"n":"魔法","v":"/class/魔法"},{"n":"百合","v":"/class/百合"},{"n":"推理","v":"/class/推理"},{"n":"科幻","v":"/class/科幻"},{"n":"竞技","v":"/class/竞技"},{"n":"悬疑","v":"/class/悬疑"},{"n":"青春","v":"/class/青春"},{"n":"战争","v":"/class/战争"},{"n":"萝莉","v":"/class/萝莉"},{"n":"魔幻","v":"/class/魔幻"},{"n":"战斗","v":"/class/战斗"},{"n":"日常","v":"/class/日常"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"/area/日本/"},{"n":"大陆","v":"/area/中国/"},{"n":"欧美","v":"/area/欧美/"},{"n":"韩国","v":"/area/韩国/"},{"n":"港台","v":"/area/港台/"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"}]},{"key":"letter","name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"/letter/A"},{"n":"B","v":"/letter/B"},{"n":"C","v":"/letter/C"},{"n":"D","v":"/letter/D"},{"n":"E","v":"/letter/E"},{"n":"F","v":"/letter/F"},{"n":"G","v":"/letter/G"},{"n":"H","v":"/letter/H"},{"n":"I","v":"/letter/I"},{"n":"J","v":"/letter/J"},{"n":"K","v":"/letter/K"},{"n":"L","v":"/letter/L"},{"n":"M","v":"/letter/M"},{"n":"N","v":"/letter/N"},{"n":"O","v":"/letter/O"},{"n":"P","v":"/letter/P"},{"n":"Q","v":"/letter/Q"},{"n":"R","v":"/letter/R"},{"n":"S","v":"/letter/S"},{"n":"T","v":"/letter/T"},{"n":"U","v":"/letter/U"},{"n":"V","v":"/letter/V"},{"n":"W","v":"/letter/W"},{"n":"X","v":"/letter/X"},{"n":"Y","v":"/letter/Y"},{"n":"Z","v":"/letter/Z"},{"n":"0-9","v":"/letter/0-9"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], - "jcdm":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"冒险","v":"/class/冒险"},{"n":"热血","v":"/class/热血"},{"n":"奇幻","v":"/class/奇幻"},{"n":"恋爱","v":"/class/恋爱"},{"n":"校园","v":"/class/校园"},{"n":"后宫","v":"/class/后宫"},{"n":"搞笑","v":"/class/搞笑"},{"n":"治愈","v":"/class/治愈"},{"n":"神魔","v":"/class/神魔"},{"n":"魔法","v":"/class/魔法"},{"n":"百合","v":"/class/百合"},{"n":"推理","v":"/class/推理"},{"n":"科幻","v":"/class/科幻"},{"n":"竞技","v":"/class/竞技"},{"n":"悬疑","v":"/class/悬疑"},{"n":"青春","v":"/class/青春"},{"n":"战争","v":"/class/战争"},{"n":"萝莉","v":"/class/萝莉"},{"n":"魔幻","v":"/class/魔幻"},{"n":"战斗","v":"/class/战斗"},{"n":"日常","v":"/class/日常"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"/area/日本/"},{"n":"大陆","v":"/area/中国/"},{"n":"欧美","v":"/area/欧美/"},{"n":"韩国","v":"/area/韩国/"},{"n":"港台","v":"/area/港台/"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"},{"n":"2003","v":"/year/2003"},{"n":"2002","v":"/year/2002"},{"n":"2001","v":"/year/2001"},{"n":"2000","v":"/year/2000"}]},{"key":"letter","name":"字母","value":[{"n":"字母","v":""},{"n":"A","v":"/letter/A"},{"n":"B","v":"/letter/B"},{"n":"C","v":"/letter/C"},{"n":"D","v":"/letter/D"},{"n":"E","v":"/letter/E"},{"n":"F","v":"/letter/F"},{"n":"G","v":"/letter/G"},{"n":"H","v":"/letter/H"},{"n":"I","v":"/letter/I"},{"n":"J","v":"/letter/J"},{"n":"K","v":"/letter/K"},{"n":"L","v":"/letter/L"},{"n":"M","v":"/letter/M"},{"n":"N","v":"/letter/N"},{"n":"O","v":"/letter/O"},{"n":"P","v":"/letter/P"},{"n":"Q","v":"/letter/Q"},{"n":"R","v":"/letter/R"},{"n":"S","v":"/letter/S"},{"n":"T","v":"/letter/T"},{"n":"U","v":"/letter/U"},{"n":"V","v":"/letter/V"},{"n":"W","v":"/letter/W"},{"n":"X","v":"/letter/X"},{"n":"Y","v":"/letter/Y"},{"n":"Z","v":"/letter/Z"},{"n":"0-9","v":"/letter/0-9"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}] - }, - searchable:2,//是否启用全局搜索, - headers:{//网站的请求头,完整支持所有的,常带ua和cookies - 'User-Agent': 'PC_UA', - }, - class_parse: '#nav li;a&&Text;a&&href;.*/(\\w+).html', - cate_exclude:'番组专题|最近更新', - play_parse: true, - lazy:`js: - var html = JSON.parse(request(input).match(/r player_.*?=(.*?) { - TABS.push(pdfh(it, 'a&&alt')) - }); - `, - // "lists": ".content_playlist:not(.list_scroll):eq(#id) a" - "lists": "div.playlist_full:eq(#id) li" - }, - 搜索:'li.searchlist_item;*;*;*;*', -} \ No newline at end of file diff --git a/lib/怡萱动漫.js b/lib/怡萱动漫.js deleted file mode 100644 index 65d7eca..0000000 --- a/lib/怡萱动漫.js +++ /dev/null @@ -1,69 +0,0 @@ -// 发布页 https://acgfans.org/pub.html -var rule={ - title:'怡萱动漫', - // host:'https://www.yxdmlove.com', - host:'https://acgfans.org/pub.html', - hostJs:'print(HOST);let html=request(HOST,{headers:{"User-Agent":PC_UA}});let src = jsp.pdfh(html,"p:eq(0)&&a&&Text");print(src);HOST=src',//网页域名根动态抓取js代码。通过HOST=赋值 - // url:'/category.html?channel=17&zhonglei=fyclass&orderby=pubdate&totalresult=2999&pageno=fypage', - url:'/category.html?channel=17&zhonglei=fyclassfyfilter&pageno=fypage', - filterable:1,//是否启用分类筛选, - filter_url:'&{{fl.by or "orderby=pubdate"}}&{{fl.year}}&{{fl.area}}&{{fl.sta}}&{{fl.class}}', - filter: { - "TV":[{"key":"sta","name":"进度","value":[{"n":"全部","v":""},{"n":"连载中","v":"status=连载中"},{"n":"已完结","v":"status=已完结"},{"n":"未播放","v":"status=未播放"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"area=日本"},{"n":"中国","v":"area=中国"},{"n":"欧美","v":"area=欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"year=2024"},{"n":"2023","v":"year=2023"},{"n":"2022","v":"year=2022"},{"n":"2021","v":"year=2021"},{"n":"2020","v":"year=2020"},{"n":"2019","v":"year=2019"},{"n":"2018","v":"year=2018"},{"n":"2017","v":"year=2017"},{"n":"2016","v":"year=2016"},{"n":"2015","v":"year=2015"},{"n":"2014","v":"year=2014"},{"n":"2013","v":"year=2013"},{"n":"2012","v":"year=2012"},{"n":"2011","v":"year=2011"},{"n":"2010","v":"year=2010"},{"n":"更早","v":"year=2010前"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"jqlx=冒险"},{"n":"热血","v":"jqlx=热血"},{"n":"爱情","v":"jqlx=爱情"},{"n":"搞笑","v":"jqlx=搞笑"},{"n":"后宫","v":"jqlx=后宫"},{"n":"校园","v":"jqlx=校园"},{"n":"机战","v":"jqlx=机战"},{"n":"幻想","v":"jqlx=幻想"},{"n":"科幻","v":"jqlx=科幻"},{"n":"竞技","v":"jqlx=竞技"},{"n":"百合","v":"jqlx=百合"},{"n":"耽美","v":"jqlx=耽美"},{"n":"悬疑","v":"jqlx=悬疑"},{"n":"剧情","v":"jqlx=剧情"},{"n":"战争","v":"jqlx=战争"},{"n":"恐怖","v":"jqlx=恐怖"},{"n":"运动","v":"jqlx=运动"},{"n":"动作","v":"jqlx=动作"},{"n":"童话","v":"jqlx=童话"},{"n":"历史","v":"jqlx=历史"},{"n":"真人","v":"jqlx=真人"},{"n":"女性向","v":"jqlx=女性向"},{"n":"泡面番","v":"jqlx=泡面番"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"orderby=pubdate"},{"n":"热度","v":"orderby=click"}]}], - "剧场版":[{"key":"sta","name":"进度","value":[{"n":"全部","v":""},{"n":"连载中","v":"status=连载中"},{"n":"已完结","v":"status=已完结"},{"n":"未播放","v":"status=未播放"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"area=日本"},{"n":"中国","v":"area=中国"},{"n":"欧美","v":"area=欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"year=2024"},{"n":"2023","v":"year=2023"},{"n":"2022","v":"year=2022"},{"n":"2021","v":"year=2021"},{"n":"2020","v":"year=2020"},{"n":"2019","v":"year=2019"},{"n":"2018","v":"year=2018"},{"n":"2017","v":"year=2017"},{"n":"2016","v":"year=2016"},{"n":"2015","v":"year=2015"},{"n":"2014","v":"year=2014"},{"n":"2013","v":"year=2013"},{"n":"2012","v":"year=2012"},{"n":"2011","v":"year=2011"},{"n":"2010","v":"year=2010"},{"n":"更早","v":"year=2010前"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"jqlx=冒险"},{"n":"热血","v":"jqlx=热血"},{"n":"爱情","v":"jqlx=爱情"},{"n":"搞笑","v":"jqlx=搞笑"},{"n":"后宫","v":"jqlx=后宫"},{"n":"校园","v":"jqlx=校园"},{"n":"机战","v":"jqlx=机战"},{"n":"幻想","v":"jqlx=幻想"},{"n":"科幻","v":"jqlx=科幻"},{"n":"竞技","v":"jqlx=竞技"},{"n":"百合","v":"jqlx=百合"},{"n":"耽美","v":"jqlx=耽美"},{"n":"悬疑","v":"jqlx=悬疑"},{"n":"剧情","v":"jqlx=剧情"},{"n":"战争","v":"jqlx=战争"},{"n":"恐怖","v":"jqlx=恐怖"},{"n":"运动","v":"jqlx=运动"},{"n":"动作","v":"jqlx=动作"},{"n":"童话","v":"jqlx=童话"},{"n":"历史","v":"jqlx=历史"},{"n":"真人","v":"jqlx=真人"},{"n":"女性向","v":"jqlx=女性向"},{"n":"泡面番","v":"jqlx=泡面番"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"orderby=pubdate"},{"n":"热度","v":"orderby=click"}]}], - "OVA":[{"key":"sta","name":"进度","value":[{"n":"全部","v":""},{"n":"连载中","v":"status=连载中"},{"n":"已完结","v":"status=已完结"},{"n":"未播放","v":"status=未播放"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"area=日本"},{"n":"中国","v":"area=中国"},{"n":"欧美","v":"area=欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"year=2024"},{"n":"2023","v":"year=2023"},{"n":"2022","v":"year=2022"},{"n":"2021","v":"year=2021"},{"n":"2020","v":"year=2020"},{"n":"2019","v":"year=2019"},{"n":"2018","v":"year=2018"},{"n":"2017","v":"year=2017"},{"n":"2016","v":"year=2016"},{"n":"2015","v":"year=2015"},{"n":"2014","v":"year=2014"},{"n":"2013","v":"year=2013"},{"n":"2012","v":"year=2012"},{"n":"2011","v":"year=2011"},{"n":"2010","v":"year=2010"},{"n":"更早","v":"year=2010前"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"jqlx=冒险"},{"n":"热血","v":"jqlx=热血"},{"n":"爱情","v":"jqlx=爱情"},{"n":"搞笑","v":"jqlx=搞笑"},{"n":"后宫","v":"jqlx=后宫"},{"n":"校园","v":"jqlx=校园"},{"n":"机战","v":"jqlx=机战"},{"n":"幻想","v":"jqlx=幻想"},{"n":"科幻","v":"jqlx=科幻"},{"n":"竞技","v":"jqlx=竞技"},{"n":"百合","v":"jqlx=百合"},{"n":"耽美","v":"jqlx=耽美"},{"n":"悬疑","v":"jqlx=悬疑"},{"n":"剧情","v":"jqlx=剧情"},{"n":"战争","v":"jqlx=战争"},{"n":"恐怖","v":"jqlx=恐怖"},{"n":"运动","v":"jqlx=运动"},{"n":"动作","v":"jqlx=动作"},{"n":"童话","v":"jqlx=童话"},{"n":"历史","v":"jqlx=历史"},{"n":"真人","v":"jqlx=真人"},{"n":"女性向","v":"jqlx=女性向"},{"n":"泡面番","v":"jqlx=泡面番"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"orderby=pubdate"},{"n":"热度","v":"orderby=click"}]}], - "其他":[{"key":"sta","name":"进度","value":[{"n":"全部","v":""},{"n":"连载中","v":"status=连载中"},{"n":"已完结","v":"status=已完结"},{"n":"未播放","v":"status=未播放"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"area=日本"},{"n":"中国","v":"area=中国"},{"n":"欧美","v":"area=欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"year=2024"},{"n":"2023","v":"year=2023"},{"n":"2022","v":"year=2022"},{"n":"2021","v":"year=2021"},{"n":"2020","v":"year=2020"},{"n":"2019","v":"year=2019"},{"n":"2018","v":"year=2018"},{"n":"2017","v":"year=2017"},{"n":"2016","v":"year=2016"},{"n":"2015","v":"year=2015"},{"n":"2014","v":"year=2014"},{"n":"2013","v":"year=2013"},{"n":"2012","v":"year=2012"},{"n":"2011","v":"year=2011"},{"n":"2010","v":"year=2010"},{"n":"更早","v":"year=2010前"}]},{"key":"class","name":"剧情","value":[{"n":"全部","v":""},{"n":"冒险","v":"jqlx=冒险"},{"n":"热血","v":"jqlx=热血"},{"n":"爱情","v":"jqlx=爱情"},{"n":"搞笑","v":"jqlx=搞笑"},{"n":"后宫","v":"jqlx=后宫"},{"n":"校园","v":"jqlx=校园"},{"n":"机战","v":"jqlx=机战"},{"n":"幻想","v":"jqlx=幻想"},{"n":"科幻","v":"jqlx=科幻"},{"n":"竞技","v":"jqlx=竞技"},{"n":"百合","v":"jqlx=百合"},{"n":"耽美","v":"jqlx=耽美"},{"n":"悬疑","v":"jqlx=悬疑"},{"n":"剧情","v":"jqlx=剧情"},{"n":"战争","v":"jqlx=战争"},{"n":"恐怖","v":"jqlx=恐怖"},{"n":"运动","v":"jqlx=运动"},{"n":"动作","v":"jqlx=动作"},{"n":"童话","v":"jqlx=童话"},{"n":"历史","v":"jqlx=历史"},{"n":"真人","v":"jqlx=真人"},{"n":"女性向","v":"jqlx=女性向"},{"n":"泡面番","v":"jqlx=泡面番"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"orderby=pubdate"},{"n":"热度","v":"orderby=click"}]}] - }, - // filter_def:{ - // TV:{by:'orderby=pubdate'}, - // 剧场版:{by:'orderby=pubdate'}, - // OVA:{by:'orderby=pubdate'}, - // 其他:{by:'orderby=pubdate'} - // }, - searchUrl:'/search.html?keyword=**&PageNo=fypage', - searchable:2,//是否启用全局搜索, - headers:{//网站的请求头,完整支持所有的,常带ua和cookies - 'User-Agent': 'PC_UA', - }, - class_name:'TV&剧场版&OVA&其他', - class_url:'TV&剧场版&OVA&其他', - play_parse: true, - lazy:'', - limit:6, - // 推荐:'.dhnew.adj li;*;*;*;*', - 推荐:'.dhnew.adj li;a&&title;img&&src;p:eq(-1)&&Text;a&&href', - // 一级:'.dhnew li;a&&title;img&&src;p:eq(-1)&&Text;a&&href', - 一级:`js: - let d = []; - pdfh = jsp.pdfh;pdfa = jsp.pdfa;pd = jsp.pd; - let html = ''; - let totalresult = getItem("totalresult_" + MY_CATE, '') - if (totalresult == '') { - html = request(input); - totalresult = pdfh(html, ".pageinfo&&strong&&Text"); - setItem("totalresult_" + MY_CATE, totalresult) - } - input += '&totalresult=' + getItem("totalresult_" + MY_CATE, ''); - html = request(input); - let list = pdfa(html, ".dhnew&&li"); - list.forEach(it => { - d.push({ - title: pdfh(it, "a&&title"), - desc: pdfh(it, "p:eq(-1)&&Text"), - pic_url: pd(it, "img&&src"), - url: pd(it, "a&&href") - }) - }); - setResult(d) - `, - 二级:{ - "title":"h1&&Text;.dhxx p:eq(4)&&Text", - "img":".anime-img&&img&&src", - "desc":".info1-left li:eq(1)&&Text;.dhxx p:eq(3)&&Text;.dhxx p:eq(2)&&Text;.info1-left li:eq(0)&&Text;.info1-left li:eq(2)&&Text", - "content":".info2--strong&&Text", - "tabs":".ol-select li", - "lists":".ol-content:eq(#id) li" - }, - // 搜索:'*;*;*;p:eq(3)&&Text;*', - 搜索:'.dhnew li;a&&title;img&&src;p:eq(3)&&Text;a&&href', -} \ No newline at end of file diff --git a/lib/曲奇动漫.js b/lib/曲奇动漫.js deleted file mode 100644 index e80c89f..0000000 --- a/lib/曲奇动漫.js +++ /dev/null @@ -1,38 +0,0 @@ -var rule={ - title:'曲奇动漫', - // host:'https://www.quqidm.net', - host:'https://www.quqim.net', - // url:'/list/?genre=fyclass&pagesize=24&pageindex=fypage', - url:'/list/?genre=fyclassfyfilter', - filterable:1,//是否启用分类筛选, - filter_url:'&pagesize=24&pageindex=(fypage-1)®ion={{fl.area}}&order={{fl.by}}&label={{fl.class}}&letter={{fl.letter}}&year={{fl.year}}', - filter:{ - "TV":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"日本"},{"n":"中国","v":"中国"},{"n":"欧美","v":"欧美"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000"}]},{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"恋爱","v":"恋爱"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":""},{"n":"名称","v":"名称"},{"n":"点击量","v":"点击量"}]}], - "剧场版":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"日本"},{"n":"中国","v":"中国"},{"n":"欧美","v":"欧美"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000"}]},{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"恋爱","v":"恋爱"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":""},{"n":"名称","v":"名称"},{"n":"点击量","v":"点击量"}]}], - "OVA":[{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"日本"},{"n":"中国","v":"中国"},{"n":"欧美","v":"欧美"}]},{"key":"letter","name":"字母","value":[{"n":"全部","v":""},{"n":"A","v":"A"},{"n":"B","v":"B"},{"n":"C","v":"C"},{"n":"D","v":"D"},{"n":"E","v":"E"},{"n":"F","v":"F"},{"n":"G","v":"G"},{"n":"H","v":"H"},{"n":"I","v":"I"},{"n":"J","v":"J"},{"n":"K","v":"K"},{"n":"L","v":"L"},{"n":"M","v":"M"},{"n":"N","v":"N"},{"n":"O","v":"O"},{"n":"P","v":"P"},{"n":"Q","v":"Q"},{"n":"R","v":"R"},{"n":"S","v":"S"},{"n":"T","v":"T"},{"n":"U","v":"U"},{"n":"V","v":"V"},{"n":"W","v":"W"},{"n":"X","v":"X"},{"n":"Y","v":"Y"},{"n":"Z","v":"Z"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000以前","v":"2000"}]},{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"运动","v":"运动"},{"n":"励志","v":"励志"},{"n":"热血","v":"热血"},{"n":"战斗","v":"战斗"},{"n":"竞技","v":"竞技"},{"n":"校园","v":"校园"},{"n":"青春","v":"青春"},{"n":"爱情","v":"爱情"},{"n":"恋爱","v":"恋爱"},{"n":"冒险","v":"冒险"},{"n":"后宫","v":"后宫"},{"n":"百合","v":"百合"},{"n":"治愈","v":"治愈"},{"n":"萝莉","v":"萝莉"},{"n":"魔法","v":"魔法"},{"n":"悬疑","v":"悬疑"},{"n":"推理","v":"推理"},{"n":"奇幻","v":"奇幻"},{"n":"科幻","v":"科幻"},{"n":"游戏","v":"游戏"},{"n":"神魔","v":"神魔"},{"n":"恐怖","v":"恐怖"},{"n":"血腥","v":"血腥"},{"n":"机战","v":"机战"},{"n":"战争","v":"战争"},{"n":"犯罪","v":"犯罪"},{"n":"历史","v":"历史"},{"n":"社会","v":"社会"},{"n":"职场","v":"职场"},{"n":"剧情","v":"剧情"},{"n":"伪娘","v":"伪娘"},{"n":"耽美","v":"耽美"},{"n":"童年","v":"童年"},{"n":"教育","v":"教育"},{"n":"亲子","v":"亲子"},{"n":"真人","v":"真人"},{"n":"歌舞","v":"歌舞"},{"n":"肉番","v":"肉番"},{"n":"美少女","v":"美少女"},{"n":"轻小说","v":"轻小说"},{"n":"吸血鬼","v":"吸血鬼"},{"n":"女性向","v":"女性向"},{"n":"泡面番","v":"泡面番"},{"n":"欢乐向","v":"欢乐向"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":""},{"n":"名称","v":"名称"},{"n":"点击量","v":"点击量"}]}] - }, - searchUrl:'/s_all?ex=fypage&kw=**', - searchable:2,//是否启用全局搜索, - quickSearch:0,//是否启用快速搜索, - headers:{ - 'User-Agent':'MOBILE_UA', - }, - class_name:'TV&剧场版&OVA', - class_url:'TV&剧场版&OVA', - play_parse:true, - detailUrl:'', - lazy:"", - limit:6, - 推荐:'.img&&ul;li;*;*;p:eq(1)&&Text;*', - double:true, // 推荐内容是否双层定位 - 一级:'.lpic&&li;img&&alt;img&&src;.red&&Text;a&&href', - 二级:{ - "title":"h1&&Text;.sinfo&&span--label:eq(2)&&Text", - "img":".thumb&&img&&src", - "desc":".score&&Text;.sinfo&&span--label:eq(0)&&Text;.sinfo&&span--label:eq(1)&&Text;.sinfo&&p:eq(0)&&Text;.sinfo&&p:eq(1)&&Text", - "content":".info&&Text", - "tabs":"#menu0&&li", - "lists":".movurl:eq(#id)&&li" - }, - 搜索:'*', -} \ No newline at end of file diff --git a/lib/爱弹幕.js b/lib/爱弹幕.js deleted file mode 100644 index da2ee21..0000000 --- a/lib/爱弹幕.js +++ /dev/null @@ -1,59 +0,0 @@ -muban.短视2.二级.img = '.detail-pic&&img&&data-src'; -var rule = { - title: '爱弹幕', - 模板:'短视2', - host: 'https://anime.girigirilove.com', - homeUrl:'/map/', - // url:'/show/fyclass--------fypage---/' - url: '/show/fyclassfyfilter/', - filterable:1,//是否启用分类筛选, - filter_url:'-{{fl.area}}-{{fl.by}}-{{fl.class}}-{{fl.lang}}-{{fl.letter}}---fypage---{{fl.year}}', - filter: { - "2":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"喜剧","v":"喜剧"},{"n":"爱情","v":"爱情"},{"n":"恐怖","v":"恐怖"},{"n":"动作","v":"动作"},{"n":"科幻","v":"科幻"},{"n":"剧情","v":"剧情"},{"n":"战争","v":"战争"},{"n":"奇幻","v":"奇幻"},{"n":"冒险","v":"冒险"},{"n":"悬疑","v":"悬疑"},{"n":"校园","v":"校园"},{"n":"后宫","v":"后宫"},{"n":"热血","v":"热血"},{"n":"运动","v":"运动"},{"n":"百合","v":"百合"},{"n":"乙女","v":"乙女"},{"n":"机甲","v":"机甲"},{"n":"日常","v":"日常"},{"n":"魔法少女","v":"魔法少女"},{"n":"异世界","v":"异世界"},{"n":"爱抖露","v":"爱抖露"},{"n":"音乐","v":"音乐"},{"n":"萌","v":"萌"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"一月","v":"一月"},{"n":"四月","v":"四月"},{"n":"七月","v":"七月"},{"n":"十月","v":"十月"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"},{"n":"2002","v":"2002"},{"n":"2001","v":"2001"},{"n":"2000","v":"2000"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"日语","v":"日语"},{"n":"国语","v":"国语"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}], - "3":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"搞笑","v":"搞笑"},{"n":"爱情","v":"爱情"},{"n":"恐怖","v":"恐怖"},{"n":"动作","v":"动作"},{"n":"科幻","v":"科幻"},{"n":"剧情","v":"剧情"},{"n":"战争","v":"战争"},{"n":"奇幻","v":"奇幻"},{"n":"冒险","v":"冒险"},{"n":"悬疑","v":"悬疑"},{"n":"校园","v":"校园"},{"n":"后宫","v":"后宫"},{"n":"热血","v":"热血"},{"n":"运动","v":"运动"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"内地","v":"内地"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"国语","v":"国语"},{"n":"英语","v":"英语"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}], - "21":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"喜剧","v":"喜剧"},{"n":"爱情","v":"爱情"},{"n":"恐怖","v":"恐怖"},{"n":"动作","v":"动作"},{"n":"科幻","v":"科幻"},{"n":"剧情","v":"剧情"},{"n":"战争","v":"战争"},{"n":"奇幻","v":"奇幻"},{"n":"冒险","v":"冒险"},{"n":"悬疑","v":"悬疑"},{"n":"校园","v":"校园"},{"n":"后宫","v":"后宫"},{"n":"热血","v":"热血"},{"n":"运动","v":"运动"},{"n":"百合","v":"百合"},{"n":"耽美","v":"耽美"},{"n":"机甲","v":"机甲"},{"n":"日常","v":"日常"},{"n":"魔法少女","v":"魔法少女"},{"n":"异世界","v":"异世界"},{"n":"爱抖露","v":"爱抖露"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004","v":"2004"},{"n":"2003","v":"2003"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"日语","v":"日语"},{"n":"中文","v":"中文"},{"n":"英语","v":"英语"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}], - "20":[{"key":"class","name":"类型","value":[{"n":"全部","v":""},{"n":"爱情","v":"爱情"},{"n":"科幻","v":"科幻"},{"n":"经典","v":"经典"},{"n":"冒险","v":"冒险"},{"n":"剧情","v":"剧情"},{"n":"动作","v":"动作"},{"n":"同性","v":"同性"},{"n":"喜剧","v":"喜剧"},{"n":"奇幻","v":"奇幻"},{"n":"恐怖","v":"恐怖"},{"n":"悬疑.惊悚","v":"悬疑.惊悚"},{"n":"战争","v":"战争"},{"n":"欧美","v":"欧美"},{"n":"歌舞","v":"歌舞"},{"n":"灾难","v":"灾难"},{"n":"记录.泰剧","v":"记录.泰剧"},{"n":"体育","v":"体育"},{"n":"烧脑","v":"烧脑"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":""},{"n":"日本","v":"日本"},{"n":"欧美","v":"欧美"},{"n":"泰国","v":"泰国"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"2024"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"2014","v":"2014"},{"n":"2013","v":"2013"},{"n":"2012","v":"2012"},{"n":"2011","v":"2011"},{"n":"2010","v":"2010"},{"n":"2009","v":"2009"},{"n":"2008","v":"2008"},{"n":"2007","v":"2007"},{"n":"2006","v":"2006"},{"n":"2005","v":"2005"},{"n":"2004.2003","v":"2004.2003"}]},{"key":"lang","name":"语言","value":[{"n":"全部","v":""},{"n":"日语","v":"日语"},{"n":"英语","v":"英语"},{"n":"泰语","v":"泰语"}]},{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}], - "24":[{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}], - "26":[{"key":"by","name":"排序","value":[{"n":"最新","v":"time"},{"n":"最热","v":"hits"},{"n":"评分","v":"score"}]}] - }, - searchUrl: '/search/**----------fypage---/', - class_name:'日番&美番&劇場版&真人番劇&BD副音軌&其他', - class_url:'2&3&21&20&24&26', - play_parse:true, - lazy:`js: - var html = JSON.parse(request(input).match(/r player_.*?=(.*?)&&", - - "图片":"data-echo=\"&&\"", - - "分类url":"https://www.uiviki.com/anime-select-{cateId}-{area}--{class}-{lang}----{catePg}---{year}.html", - - "分类":"连载动漫$lianzai#日本动漫$riman#国产动漫$guoman", - - "筛选":{ - "lianzai":[ - {"key":"class","name":"类型","value":[ - {"n":"轻改","v":"轻改"}, - {"n":"游改","v":"游改"}, - {"n":"漫改","v":"漫改"}, - {"n":"原创","v":"原创"}, - {"n":"后宫","v":"后宫"}, - {"n":"乙女","v":"乙女"}, - {"n":"耽美","v":"耽美"}, - {"n":"百合","v":"百合"}, - {"n":"萌系","v":"萌系"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"热血","v":"热血"}, - {"n":"催泪","v":"催泪"}, - {"n":"机战","v":"机战"}, - {"n":"恋爱","v":"恋爱"}, - {"n":"伪娘","v":"伪娘"}, - {"n":"科幻","v":"科幻"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"推理","v":"推理"}, - {"n":"音乐","v":"音乐"}, - {"n":"校园","v":"校园"}, - {"n":"偶像","v":"偶像"}, - {"n":"异界","v":"异界"}, - {"n":"运动","v":"运动"}, - {"n":"少女","v":"少女"}, - {"n":"斗智","v":"斗智"}, - {"n":"战斗","v":"战斗"}, - {"n":"日常","v":"日常"}, - {"n":"魔法","v":"魔法"}, - {"n":"装逼","v":"装逼"}, - {"n":"治愈","v":"治愈"}, - {"n":"战争","v":"战争"}, - {"n":"历史","v":"历史"}, - {"n":"猎奇","v":"猎奇"}, - {"n":"致郁","v":"致郁"}, - {"n":"修仙","v":"修仙"}, - {"n":"美食","v":"美食"}, - {"n":"卖肉","v":"卖肉"}, - {"n":"励志","v":"励志"}, - {"n":"职场","v":"职场"}, - {"n":"神魔","v":"神魔"}, - {"n":"萝莉","v":"萝莉"}, - {"n":"御姐","v":"御姐"}, - {"n":"武侠","v":"武侠"}, - {"n":"穿越","v":"穿越"}, - {"n":"冒险","v":"冒险"} - ] - }, - {"key":"area","name":"地区","value":[ - {"n":"日本","v":"日本"}, - {"n":"韩国","v":"韩国"}, - {"n":"大陆","v":"大陆"}, - {"n":"台湾","v":"台湾"}, - {"n":"香港","v":"香港"}, - {"n":"美国","v":"美国"} - ] - }, - {"key":"lang","name":"语言","value":[ - {"n":"日语","v":"日语"}, - {"n":"英语","v":"英语"}, - {"n":"国语","v":"国语"}, - {"n":"台语","v":"台语"}, - {"n":"粤语","v":"粤语"}, - {"n":"韩语","v":"韩语"} - ] - }, - {"key":"yera","name":"时间","value":[ - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"}, - {"n":"2014","v":"2014"}, - {"n":"2013","v":"2013"}, - {"n":"2012","v":"2012"}, - {"n":"2011","v":"2011"}, - {"n":"2010","v":"2010"}, - {"n":"2009","v":"2009"}, - {"n":"2008","v":"2008"} - ] - } - ], - "riman":[ - {"key":"class","name":"类型","value":[ - {"n":"轻改","v":"轻改"}, - {"n":"游改","v":"游改"}, - {"n":"漫改","v":"漫改"}, - {"n":"原创","v":"原创"}, - {"n":"后宫","v":"后宫"}, - {"n":"乙女","v":"乙女"}, - {"n":"耽美","v":"耽美"}, - {"n":"百合","v":"百合"}, - {"n":"萌系","v":"萌系"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"热血","v":"热血"}, - {"n":"催泪","v":"催泪"}, - {"n":"机战","v":"机战"}, - {"n":"恋爱","v":"恋爱"}, - {"n":"伪娘","v":"伪娘"}, - {"n":"科幻","v":"科幻"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"推理","v":"推理"}, - {"n":"音乐","v":"音乐"}, - {"n":"校园","v":"校园"}, - {"n":"偶像","v":"偶像"}, - {"n":"异界","v":"异界"}, - {"n":"运动","v":"运动"}, - {"n":"少女","v":"少女"}, - {"n":"斗智","v":"斗智"}, - {"n":"战斗","v":"战斗"}, - {"n":"日常","v":"日常"}, - {"n":"魔法","v":"魔法"}, - {"n":"装逼","v":"装逼"}, - {"n":"治愈","v":"治愈"}, - {"n":"战争","v":"战争"}, - {"n":"历史","v":"历史"}, - {"n":"猎奇","v":"猎奇"}, - {"n":"致郁","v":"致郁"}, - {"n":"修仙","v":"修仙"}, - {"n":"美食","v":"美食"}, - {"n":"卖肉","v":"卖肉"}, - {"n":"励志","v":"励志"}, - {"n":"职场","v":"职场"}, - {"n":"神魔","v":"神魔"}, - {"n":"萝莉","v":"萝莉"}, - {"n":"御姐","v":"御姐"}, - {"n":"武侠","v":"武侠"}, - {"n":"穿越","v":"穿越"}, - {"n":"冒险","v":"冒险"} - ] - }, - {"key":"area","name":"地区","value":[ - {"n":"日本","v":"日本"}, - {"n":"韩国","v":"韩国"}, - {"n":"大陆","v":"大陆"}, - {"n":"台湾","v":"台湾"}, - {"n":"香港","v":"香港"}, - {"n":"美国","v":"美国"} - ] - }, - {"key":"lang","name":"语言","value":[ - {"n":"日语","v":"日语"}, - {"n":"英语","v":"英语"}, - {"n":"国语","v":"国语"}, - {"n":"台语","v":"台语"}, - {"n":"粤语","v":"粤语"}, - {"n":"韩语","v":"韩语"} - ] - }, - {"key":"yera","name":"时间","value":[ - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"}, - {"n":"2014","v":"2014"}, - {"n":"2013","v":"2013"}, - {"n":"2012","v":"2012"}, - {"n":"2011","v":"2011"}, - {"n":"2010","v":"2010"}, - {"n":"2009","v":"2009"}, - {"n":"2008","v":"2008"} - ] - } - ], - "guoman":[ - {"key":"class","name":"类型","value":[ - {"n":"轻改","v":"轻改"}, - {"n":"游改","v":"游改"}, - {"n":"漫改","v":"漫改"}, - {"n":"原创","v":"原创"}, - {"n":"后宫","v":"后宫"}, - {"n":"乙女","v":"乙女"}, - {"n":"耽美","v":"耽美"}, - {"n":"百合","v":"百合"}, - {"n":"萌系","v":"萌系"}, - {"n":"搞笑","v":"搞笑"}, - {"n":"热血","v":"热血"}, - {"n":"催泪","v":"催泪"}, - {"n":"机战","v":"机战"}, - {"n":"恋爱","v":"恋爱"}, - {"n":"伪娘","v":"伪娘"}, - {"n":"科幻","v":"科幻"}, - {"n":"奇幻","v":"奇幻"}, - {"n":"推理","v":"推理"}, - {"n":"音乐","v":"音乐"}, - {"n":"校园","v":"校园"}, - {"n":"偶像","v":"偶像"}, - {"n":"异界","v":"异界"}, - {"n":"运动","v":"运动"}, - {"n":"少女","v":"少女"}, - {"n":"斗智","v":"斗智"}, - {"n":"战斗","v":"战斗"}, - {"n":"日常","v":"日常"}, - {"n":"魔法","v":"魔法"}, - {"n":"装逼","v":"装逼"}, - {"n":"治愈","v":"治愈"}, - {"n":"战争","v":"战争"}, - {"n":"历史","v":"历史"}, - {"n":"猎奇","v":"猎奇"}, - {"n":"致郁","v":"致郁"}, - {"n":"修仙","v":"修仙"}, - {"n":"美食","v":"美食"}, - {"n":"卖肉","v":"卖肉"}, - {"n":"励志","v":"励志"}, - {"n":"职场","v":"职场"}, - {"n":"神魔","v":"神魔"}, - {"n":"萝莉","v":"萝莉"}, - {"n":"御姐","v":"御姐"}, - {"n":"武侠","v":"武侠"}, - {"n":"穿越","v":"穿越"}, - {"n":"冒险","v":"冒险"} - ] - }, - {"key":"area","name":"地区","value":[ - {"n":"日本","v":"日本"}, - {"n":"韩国","v":"韩国"}, - {"n":"大陆","v":"大陆"}, - {"n":"台湾","v":"台湾"}, - {"n":"香港","v":"香港"}, - {"n":"美国","v":"美国"} - ] - }, - {"key":"lang","name":"语言","value":[ - {"n":"日语","v":"日语"}, - {"n":"英语","v":"英语"}, - {"n":"国语","v":"国语"}, - {"n":"台语","v":"台语"}, - {"n":"粤语","v":"粤语"}, - {"n":"韩语","v":"韩语"} - ] - }, - {"key":"yera","name":"时间","value":[ - {"n":"2022","v":"2022"}, - {"n":"2021","v":"2021"}, - {"n":"2020","v":"2020"}, - {"n":"2019","v":"2019"}, - {"n":"2018","v":"2018"}, - {"n":"2017","v":"2017"}, - {"n":"2016","v":"2016"}, - {"n":"2015","v":"2015"}, - {"n":"2014","v":"2014"}, - {"n":"2013","v":"2013"}, - {"n":"2012","v":"2012"}, - {"n":"2011","v":"2011"}, - {"n":"2010","v":"2010"}, - {"n":"2009","v":"2009"}, - {"n":"2008","v":"2008"} - ] - } - ] - } - } \ No newline at end of file diff --git a/lib/路漫漫.js b/lib/路漫漫.js deleted file mode 100644 index dc10b5d..0000000 --- a/lib/路漫漫.js +++ /dev/null @@ -1,47 +0,0 @@ -var rule = { - title:'路漫漫', - // host:'https://www.96ba.com', - host:'https://m.lmm52.com', - // url:'/vod/show/id/fyclass/page/fypage.html', - url:'/vod/show/id/fyclassfyfilter.html', - filterable:1,//是否启用分类筛选, - filter_url:'{{fl.by}}/page/fypage{{fl.year}}', - filter:{ - "ribendongman":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}], - "guochandongman":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}], - "oumeidongman":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}], - "ribendonghuadianying":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}], - "guochandonghuadianying":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}], - "oumeidonghuadianying":[{"key":"year","name":"年份","value":[{"n":"全部","v":""},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"更早","v":"/year/2013-1980"}]},{"key":"by","name":"排序","value":[{"n":"更新","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"},{"n":"点赞","v":"/by/up"}]}] - }, - searchUrl:'/vod/search/page/fypage/wd/**.html', - searchable: 2,//是否启用全局搜索, - quickSearch: 0,//是否启用快速搜索, - headers: { - 'User-Agent': 'MOBILE_UA', - }, - class_parse:'.container&&.tag.text-light;a&&Text;a&&href;.*/(.*?).html', - play_parse: true, - lazy:`js: - var html = JSON.parse(request(input).match(/r player_.*?=(.*?)