1"use strict";(self.webpackChunkusagi=self.webpackChunkusagi||[]).push([[2133],{13644(e,t,o){o.d(t,{Aw:()=>l,Fe:()=>d,ev:()=>a});var n=o(52673);function i(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const s="visited_count_for_pwa_mini_info_bar",r=new class{constructor(){i(this,"count",void 0),i(this,"beforeInstallPromptEvent",void 0),i(this,"listeners",void 0),this.visitedCount=+(n.v.getItem(s)||0),this.listeners=[]}registerEvent(){window.addEventListener("beforeinstallprompt",(e=>{e.preventDefault(),this.visitedCount%2!=1&&(this.visitedCount<0||(this.beforeInstallPromptEvent=e,this.listeners.forEach((e=>"function"==typeof e&&e(this.beforeInstallPromptEvent)))))}))}addEventListener(e){this.listeners.push(e)}get visitedCount(){return this.count}set visitedCount(e){this.count=e,n.v.setItem(s,e+"")}incrementCount(){this.visitedCount=this.count+1}accepted(){this.visitedCount=-1}closed(){this.visitedCount=-2}},a=e=>{const t=(()=>{try{return navigator.serviceWorker}catch(e){if(e instanceof DOMException&&"SecurityError"===e.name)return;throw e}})();if(!t)return;if(null!=e&&e.loadPWAManifest){const e="/js/manifest.json",t=document.createElement("link");t.rel="manifest",t.href=e,t.setAttribute("crossOrigin","use-credentials"),document.head.appendChild(t),r.registerEvent()}let o="/sw.js";null!=e&&e.offlineCache&&(o="/sw-offline-caching.js"),t.register(o,{scope:"/"})},d=()=>{const e=document.querySelector(".offline-banner");e&&(navigator.onLine||e.classList.remove("hidden"))},l=()=>{r.visitedCount>=0&&r.incrementCount(),r.addEventListener((e=>{const t=document.querySelector(".js-pwa-mini-infobar-wrapper");null==t||t.classList.remove("hidden");const o=document.querySelector(".js-pwa-mini-infobar-add2hs-btn");null==o||o.addEventListener("click",(()=>{null==t||t.classList.add("hidden"),e.prompt(),e.userChoice.then((e=>{"accepted"===e.outcome?r.accepted():e.outcome}))}));const n=document.querySelector(".js-pwa-mini-infobar-close-btn");null==n||n.addEventListener("click",(()=>{r.closed(),null==t||t.classList.add("hidden")}))}))}},76599(e,t,o){o.d(t,{A:()=>i});var n=o(50084);const i=()=>{if(n.T.msedge)return!1;const e=document.createElement("div");return"-webkit-mask-image"in e.style||"mask-image"in e.style}},96664(e,t,o){o.r(t),o.d(t,{entrypoint:()=>Q});var n=o(41669),i=o.n(n),s=o(91238),r=o(3404),a=o(50084);var d=o(13644),l=(o(3362),o(27495),o(90561)),c=o.n(l),u=o(22287),h=o(46618),w=o(39335),m=o(12376),v=o(97358),g=o(52012),p=o(6813);function f(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}class b extends h.${constructor(e,t){var o;super(e),f(this,"downloadQueue",void 0),f(this,"type",void 0),f(this,"id",void 0),f(this,"disabled",void 0),f(this,"haveDownloaded",void 0),f(this,"downloading",void 0),f(this,"downloadCanceledError",void 0),f(this,"downloadManager",void 0),f(this,"downloadProduct",void 0),this.disabled=!1,null!==(o=navigator.serviceWorker)&&void 0!==o&&o.controller?(this.downloadQueue=new(c())({concurrency:8}),this.haveDownloaded=!1,this.downloading=!1,this.downloadCanceledError=null,this.downloadManager=new m.q({maxAge:t.maxAge,limitCount:t.limitCount}),this.type=t.type,this.id=t.id):(this.view.disableDownloadButton(),this.disabled=!0)}setup(){var e,t;this.disabled||(window.addEventListener("unload",(()=>{this.downloading&&(this.downloadQueue.stop(),this.downloadQueue.slice(0,0),this.purgeCache())})),null===(e=navigator.serviceWorker)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"message",(e=>{if(this.downloading&&"quota_exceeded_error"===e.data.action)return this.cancelDownloadWithQuota()})),this.setupProductInfo())}cancelDownloadWithQuota(){this.downloading=!1,this.downloadCanceledError="quota_exceeded_error",confirm("ãã©ã¦ã¶ã®ç©ºã容éãè¶³ãã¾ããããã§ã«ãã£ãã·ã¥ããã¦ãã話ãªã©ãæ¶ãã¦ãå©ç¨ãã ããããã¡ãããåé¤ãå¯è½ã§ãã")&&(location.href="/history"),this.view.resetUI()}setupProductInfo(){const e=this.type,t=this.id;p.A.get(location.pathname+".json",{credentials:"include"}).then((e=>e.json())).then((o=>{const n=o.readableProduct,i=new g.Pg(n.pageStructure).imageUrls,s=(0,w.R)({id:t,title:n.title,permaLink:location.href,imageUrls:i,type:e,imageUrisDigest:n.imageUrisDigest});if(null==s||!s.readable)throw this.view.hiddenButton(),new Error("cannot read this product");return s})).then((async e=>{if(this.haveDownloaded=this.downloadManager.haveDownloaded(e.id),this.downloadProduct=e,this.haveDownloaded){let o;try{o=await e.cacheExistCheck()}catch(t){}if(void 0===o)throw new Error("cannot check caches");return o}return!1})).then((e=>{this.haveDownloaded&&!e&&(alert("æ°ãããã¼ã¸ã§ã³ãããã¾ããåã³ãã£ãã·ã¥ããé¡ããã¾ãã"),this.haveDownloaded=!1),this.haveDownloaded&&this.view.toggleButton("downloaded"),this.view.enableDownloadButton()})).catch((()=>{this.view.hiddenButton()}))}checkQuota(){return new Promise(((e,t)=>{const o=navigator.storage;if(!o)return e();o.estimate().then((o=>{const{quota:n,usage:i}=o,s=15728640;n-i>s?e():(this.cancelDownloadWithQuota(),t("usable storage quota is less than limit (15728640 byte)"))}))}))}preventLargePageNumber(){return new Promise(((e,t)=>{var o;if(!a.T.safari)return e();if(null===(o=this.downloadProduct)||void 0===o||!o.imageUrls)return t();return this.downloadProduct.imageUrls.length<80?e():(alert("æ¬ãã©ã¦ã¶ã§ã¯ãã¼ã¸æ°ã80ãã¼ã¸ãè¶
ããå ´åãªãã©ã¤ã³æ©è½ã¯ãå©ç¨ããã ãã¾ããã"),t("Page length is larger than SAFARI_CACHABLE_PAGE_LIMIT"))}))}startDownload(){this.checkQuota().then((()=>this.preventLargePageNumber())).then((()=>this.downloading=!0)).then((()=>new Promise(this.execDownload.bind(this)))).then((()=>this.finishDownload())).catch((e=>{this.downloading=!1,this.view.resetUI(),this.purgeCache(),(0,u.C)(e)}))}purgeCache(){var e,t;null!==(e=this.downloadProduct)&&void 0!==e&&e.imageUrls&&(null===(t=navigator.serviceWorker)||void 0===t||null===(t=t.controller)||void 0===t||t.postMessage({action:"remove",urls:this.downloadProduct.imageUrls}))}get pageResourceUrls(){const e=document.getElementById("bundleJsElement"),t=document.getElementById("styleSheetCssElement"),o=document.querySelector(".js-series-header-image");return[location.pathname+"?sw-dl",location.pathname+".json?sw-dl",null==e?void 0:e.getAttribute("src"),null==t?void 0:t.getAttribute("href"),null==o?void 0:o.getAttribute("src")].filter((e=>!!e))}execDownload(e,t){var o;if(null===(o=this.downloadProduct)||void 0===o||!o.imageUrls)return t();let n=0;const i=this.downloadProduct.imageUrls.length;
1this.downloading=!0,this.downloadProduct.imageUrls.forEach((e=>{this.downloadQueue.push((t=>{p.A.get(e+"?sw-dl").then((()=>{this.view.showDownloadProgress(++n/i),null==t||t()}))}))})),this.downloadQueue.start((()=>{n===i&&Promise.all(this.pageResourceUrls.map((e=>{let t="same-origin";try{t=new URL(e).hostname===location.hostname?"same-origin":"no-cors"}catch(o){}return p.A.get(e,{mode:t})}))).then((()=>new Promise(((e,t)=>{if(this.downloadCanceledError)return t(this.downloadCanceledError);setTimeout((()=>{if(this.downloadCanceledError)return t(this.downloadCanceledError);e()}),1200)})))).then((()=>e())).catch((e=>{this.downloadCanceledError=null,t(e)}))}))}finishDownload(){this.downloadProduct&&this.downloadManager.add(this.downloadProduct),this.view.finishDownload(),this.haveDownloaded=!0,this.downloading=!1}removeDownloadedProduct(){this.downloadProduct&&(this.downloadManager.removeById(this.id),this.haveDownloaded=!1)}}class y extends h.S{constructor(e){super(e)}initMembers(e){this.downloadButton=e.downloadButton,this.downloading=!1,this.progressElement=document.querySelector(".js-download-progress"),this.maxAge=e.maxAge,this.limitCount=e.limitCount}registerEvents(){v.B.addOnLeaveListenerHelper(window,"beforeunload",(e=>{if(!this.downloading)return;const t="ã¿ããéããã¨åã³ãã£ãã·ã¥ãå¿
è¦ã§ã";return e.returnValue=t,t})),v.B.addOnLeaveListenerHelper(this.downloadButton,"click",(()=>this.onClick()))}onClick(){this.downloading||this.presenter.haveDownloaded||this.startDownload()}createPresenter(){const{type:e,id:t}=this.downloadButton.dataset,o={type:e,id:t,maxAge:this.maxAge,limitCount:this.limitCount};return new b(this,o)}toggleButton(e){let t=!1,o="ãªãã©ã¤ã³ã§èªã β";switch(this.downloadButton.classList.remove("download-finished"),e){case"downloading":o="ä¿åä¸ã§ã",t=!0;break;case"downloaded":o='ãã£ãã·ã¥ããã¾ãã <a href="/history">å±¥æ´</a>',this.downloadButton.classList.add("download-finished")}this.downloadButton.disabled=t,t?this.downloadButton.classList.add("hidden"):this.downloadButton.classList.remove("hidden"),this.downloadButton.innerHTML=o}detectType(e){let t=e.dataset.type;if(!t){const e=location.pathname.match(/^\/(.+)\/\d+$/);t=null==e?void 0:e[1]}return t}startDownload(){this.downloading=!0,this.toggleButton("downloading"),this.presenter.startDownload()}showDownloadProgress(e){const t=Math.round(100*e);this.progressElement instanceof HTMLProgressElement?(this.progressElement.classList.remove("hidden"),this.progressElement.setAttribute("max","100"),this.progressElement.setAttribute("value",t+"")):this.progressElement&&(this.progressElement.textContent=t+"%")}finishDownload(){var e;this.downloading=!1,this.toggleButton("downloaded"),null===(e=this.progressElement)||void 0===e||e.classList.add("hidden")}resetUI(){var e;this.downloading=!1,this.toggleButton("enable"),null===(e=this.progressElement)||void 0===e||e.classList.add("hidden")}hiddenButton(){this.downloadButton.classList.add("hidden")}disableDownloadButton(){const e=document.querySelector(".viewer-offline");null!=e&&e.parentNode&&e.parentNode.removeChild(e)}enableDownloadButton(){const e=document.querySelector(".viewer-offline");e&&e.classList.remove("hidden")}}var S=o(34767);o(25440);const E=e=>{e.forEach((e=>{const t=e.getAttribute("width"),o=e.getAttribute("height"),n=e.dataset.src;n&&t&&o&&(e.src=((e,t,o)=>e.replace("{width}",t.toString()).replace("{height}",o.toString()))(n,Number(t),Number(o)))}))},j=()=>{const e=document.querySelectorAll(".js-thumbnail-uri-template");E(e),i()(".js-newcomer-banners-slick-wrapper").slick({autoplaySpeed:3e3,slidesToScroll:1,arrows:!1,autoplay:!0,infinite:!0,centerMode:!0,dots:!0,touchMove:!0,pauseOnFocus:!0,pauseOnHover:!0,variableWidth:!0})},A=()=>{const e=document.querySelectorAll(".js-thumbnail-uri-template");E(e)},k=()=>{const e=document.querySelectorAll(".js-thumbnail-uri-template");E(e)},C=()=>{const e=document.querySelectorAll(".js-thumbnail-uri-template");E(e)};var P=o(19450);function D(){document.querySelectorAll(".js-publication-date-container").forEach((e=>{const t=e.querySelector(".js-date-short"),o=e.querySelector(".js-day-of-week");if(t){const e=t.dateTime;if(!e)return;t.innerText=(0,P.kz)(new Date(e),{separator:"."})}if(o){const e=o.dateTime;if(!e)return;o.innerText=`(${(0,P.N2)(new Date(e))})`}e.classList.remove("invisible")}))}const L=()=>{D(),i()(".js-comics-banners-slick-wrapper").slick({autoplaySpeed:3e3,slidesToScroll:1,arrows:!1,autoplay:!0,infinite:!0,centerMode:!0,dots:!1,touchMove:!0,pauseOnFocus:!0,pauseOnHover:!0,variableWidth:!0})};var T=o(94618),B=o(76599);class q{constructor(e){let t;t=(0,B.A)()?e.find(".koma-stream-wrapper-css"):e.find(".koma-stream-wrapper-svg"),t.find(".koma-stream-list").slick({speed:450,slidesToShow:1,slidesToScroll:1,centerMode:!0,variableWidth:!0,dots:!1,touchMove:!0,rows:0}),t.show()}}var M=o(10400),_=o(24304),x=o(3032),I=o(81588),U=o(71372);const W=()=>{const e=e=>{const t=document.querySelector(e);
1if(!t)return;const o=t.querySelector("button.js-read-more-button"),n=t.querySelector(".js-update-series");o&&n&&new T.gg({readMoreButton:o,readContainer:n})};e(".js-original-series-items"),e(".js-tameshiyomi-series-items"),new q(i()(".js-koma-stream-wrapper")),new U.A(new x.c,new I.o).getNotifications().then((e=>{if(e.length>0){document.querySelector(".js-update-notification-list-container").classList.remove("hidden"),(0,_.G)(),(0,M.x)()}})),i()(".top-carousel-banner-items").slick({infinite:!0,speed:450,centerMode:!0,slidesToShow:1,slidesToScroll:1,variableWidth:!0,autoplay:!0,dots:!0,touchMove:!0,arrows:!1,rows:0}),i()(".koma-stream-ranking-list").slick({speed:450,slidesToShow:1,slidesToScroll:1,centerMode:!1,variableWidth:!0,arrows:!1,dots:!1,touchMove:!0,rows:0}),i()(".tj-comics-list").slick({infinite:!1,arrows:!1,dots:!1,speed:600,variableWidth:!0,slidesToShow:5,slidesToScroll:5,centerMode:!1,autoplay:!1,touchMove:!0,draggable:!0,responsive:[{breakpoint:1180,settings:{slidesToShow:4,slidesToScroll:4}},{breakpoint:940,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:700,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:460,settings:{slidesToShow:1,slidesToScroll:1}}]}),D()},O=()=>{const e=document.querySelectorAll(".js-thumbnail-uri-template");E(e)},Q=()=>{s.A.always((()=>{(0,d.ev)({offlineCache:!0})})),s.A.connect("media:tonarino_yj:top",W),s.A.connect("media:tonarino_yj:serial:oneshot",(()=>
1{Array.from(document.querySelectorAll(".js-oneshot")).forEach((e=>{const t=i()(e).find(".js-oneshot-serial-read-more");t.length&&new r.l8(t,i()(e).find(".js-oneshot-serial-list li"))}))})),s.A.connect("media:tonarino_yj:paperback",L),s.A.connect("media:tonarino_yj:newcomer:newcomer",j),s.A.connect("media:tonarino_yj:serial:oneshot_202107",A),s.A.connect("media:tonarino_yj:serial:serial_202107",k),s.A.connect("media:tonarino_yj:serial:trial_202107",C),s.A.connect("media:tonarino_yj:serial:ynjn",O),s.A.connect("core:viewer",(()=>{v.B.addOnTransition((()=>{requestIdleCallback((()=>{(0,d.Fe)(),(()=>{const e=document.querySelector(".js-viewer-content");e&&a.T.mobile&&e.classList.add("selectable")})();const e=document.querySelector(".js-download-button");e&&new y({downloadButton:e,maxAge:6048e5})}))}))})),(0,S.zz)(s.A)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.