"use strict";(self.webpackChunkkemono_2_client=self.webpackChunkkemono_2_client||[]).push([[172],{258:(e,t,n)=>{n.d(t,{J:()=>l});var o=n(744),r=n(8745);async function a(e,t){try{const s=await fetch(e,t);if(401===s.status){if(r.j)return localStorage.removeItem("logged_in"),localStorage.removeItem("favs"),localStorage.removeItem("post_favs"),void(location.href="/account/logout");const e=new URL("/account/login",location.origin).toString();return void(location=(n=e,"redir",o=location.pathname,a=new URL(n),a.searchParams.set("redir",o),a.toString()))}return s}catch(e){console.error(`Kemono request error: ${e}`)}var n,o,a}const s={retrieveFavoriteArtists:async function(){const e=new URLSearchParams([["type","artist"]]).toString();try{const t=await a(`/api/v1/account/favorites?${e}`);if(!t||!t.ok)throw new Error(`Error ${t.status}: ${t.statusText}`);return await t.text()}catch(e){console.error(e)}},favoriteArtist:async function(e,t){try{const n=await a(`/api/v1/favorites/creator/${e}/${t}`,{method:"POST"});return!(!n||!n.ok)||(alert(new o.sf(3)),!1)}catch(e){console.error(e)}},unfavoriteArtist:async function(e,t){try{const n=await a(`/api/v1/favorites/creator/${e}/${t}`,{method:"DELETE"});return!(!n||!n.ok)||(alert(new o.sf(4)),!1)}catch(e){console.error(e)}},retrieveFavoritePosts:async function(){const e=new URLSearchParams([["type","post"]]).toString();try{const t=await a(`/api/v1/account/favorites?${e}`);if(!t||!t.ok)throw new Error(`Error ${t.status}: ${t.statusText}`);const n=(await t.json()).map((e=>({id:e.id,service:e.service,user:e.user})));return JSON.stringify(n)}catch(e){console.error(e)}},favoritePost:async function(e,t,n){try{const r=await a(`/api/v1/favorites/post/${e}/${t}/${n}`,{method:"POST"});return!(!r||!r.ok)||(alert(new o.sf(1)),!1)}catch(e){console.error(e)}},unfavoritePost:async function(e,t,n){try{const r=await a(`/api/v1/favorites/post/${e}/${t}/${n}`,{method:"DELETE"});return!(!r||!r.ok)||(alert(new o.sf(2)),!1)}catch(e){console.error(e)}}},i={attemptFlag:async function(e,t,n){try{const r=await a(`/api/v1/${e}/user/${t}/post/${n}/flag`,{method:"POST"});return!(!r||!r.ok)||(alert(new o.sf(5)),!1)}catch(e){console.error(e)}}};var c=n(3374);const l={favorites:s,posts:i,api:{bans:async function(){try{const e=await a("/api/v1/creators/bans",{method:"GET"});return e&&e.ok?await e.json():(alert(new o.sf(6)),null)}catch(e){console.error(e)}},bannedArtist:async function(e,t){const n=new URLSearchParams([["service",t]]).toString();try{const t=await a(`/api/v1/lookup/cache/${e}?${n}`);return t&&t.ok?await t.json():(alert(new o.sf(7)),null)}catch(e){console.error(e)}},creators:async function(){try{const e=await a(c.Dp||"/api/v1/creators",{method:"GET"});return e&&e.ok?await e.json():(alert(new o.sf(8)),null)}catch(e){console.error(e)}},logs:async function(e){try{const t=await a(`/api/v1/importer/logs/${e}`,{method:"GET"});return t&&t.ok?await t.json():(alert(new o.sf(9)),null)}catch(e){console.error(e)}}},dms:{retrieveHasPendingDMs:async function(){try{const e=await a("/api/v1/has_pending_dms");if(!e||!e.ok)throw new Error(`Error ${e.status}: ${e.statusText}`);return await e.json()}catch(e){console.error(e)}}}}},3374:(e,t,n)=>{n.d(t,{Dp:()=>a,Kq:()=>r,QA:()=>o});const o="//img.kemono.su",r="//img.kemono.su",a="/api/v1/creators.txt"},8745:(e,t,n)=>{n.d(t,{j:()=>o});const o="yes"===localStorage.getItem("logged_in")},1823:(e,t,n)=>{n.d(t,{H:()=>r,L:()=>a});const o=new Map;function r(e){const t=e.querySelector(".component-container");t.querySelectorAll(`#${t.id} > *`).forEach((e=>{o.set(e.className.trim(),e)})),t.remove()}function a(e){const t=o.get(e);return t?t.cloneNode(!0):console.error(`Component "${e}" doesn't exist.`)}},8359:(e,t,n)=>{n.d(t,{FL:()=>l,K_:()=>c,VH:()=>r,dC:()=>s,iJ:()=>i,t8:()=>a,w8:()=>d});var o=n(258);async function r(){let e=localStorage.getItem("favs"),t=localStorage.getItem("post_favs");if(!e||"undefined"===e){const e=await o.J.favorites.retrieveFavoriteArtists();e&&localStorage.setItem("favs",e)}if(!t||"undefined"===t){const e=await o.J.favorites.retrieveFavoritePosts();e&&localStorage.setItem("post_favs",e)}}async function a(e,t){let n;try{n=JSON.parse(localStorage.getItem("favs"))}catch(n){if(n instanceof SyntaxError){const n=await async function(){try{const e=await o.J.favorites.retrieveFavoriteArtists();return e?(localStorage.setItem("favs",e),!0):(alert("Could not retrieve favorite artists"),!1)}catch(e){console.error(e)}}();if(!n)return;return await a(e,t)}}if(n)return n.find((n=>n.id===e&&n.service===t))}async function s(e,t,n){let r;try{if(r=JSON.parse(localStorage.getItem("post_favs")),!r)return;return r.find((o=>o.id===n&&o.service===e&&o.user===t))}catch(r){if(r instanceof SyntaxError){const r=await async function(){try{const e=await o.J.favorites.retrieveFavoritePosts();return e?(localStorage.setItem("post_favs",e),!0):(alert("Could not retrieve favorite posts"),!1)}catch(e){console.error(e)}}();if(!r)return;return await s(e,t,n)}}}async function i(e,t){if(!await o.J.favorites.favoriteArtist(t,e))return!1;const n=await o.J.favorites.retrieveFavoriteArtists();return localStorage.setItem("favs",n),!0}async function c(e,t){if(!await o.J.favorites.unfavoriteArtist(t,e))return!1;const n=await o.J.favorites.retrieveFavoriteArtists();return localStorage.setItem("favs",n),!0}async function l(e,t,n){if(!await o.J.favorites.favoritePost(e,t,n))return!1;const r=await o.J.favorites.retrieveFavoritePosts();return localStorage.setItem("post_favs",r),!0}async function d(e,t,n){if(!await o.J.favorites.unfavoritePost(e,t,n))return!1;const r=await o.J.favorites.retrieveFavoritePosts();return localStorage.setItem("post_favs",r),!0}},4558:(e,t,n)=>{n(2406),n(5948),n(8842),n(7147);var o=n(8745),r=n(8359),a=n(744),s=n(4133),i=n(6295),c=n(435);o.j&&((0,r.VH)(),(0,c.s)()),(0,a._K)(document.images),(0,i.i)(s.De)},6295:(e,t,n)=>{n.d(t,{i:()=>a});var o=n(3027),r=n(1823);function a(e){const t=document.querySelector(".global-sidebar"),n=document.querySelector("main"),a=document.querySelector(".global-footer"),s=n.querySelectorAll("main > .site-section");(0,r.H)(a),(0,o.Jd)(t),s.forEach((t=>{const n=/site-section--([a-z\-]+)/i.exec(t.className)[1];e.has(n)&&e.get(n).forEach((e=>{e(t)}))}))}},435:(e,t,n)=>{n.d(t,{s:()=>r});var o=n(258);async function r(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n="true"===localStorage.getItem("has_pending_review_dms"),r=parseInt(localStorage.getItem("last_checked_has_pending_review_dms"));(e||!r||r img").src=n?"/static/menu/red_dm.svg":"/static/menu/dm.svg"}},4133:(e,t,n)=>{n.d(t,{t9:()=>M,De:()=>R});var o=n(8359),r=n(3027),a=n(1823),s=n(8745),i=n(258),c=n(9650),l=n(9295),d=(n(9418),n(9497));const u={service:null,user:null,postID:null};function f(e,t){if(!e.naturalWidth)return setTimeout(f,10,e,t);e.style.maxWidth="100%",e.style.display="",t.style.display="none",t.style.opacity=""}function m(e){var t=e.target;if(t.parentNode.classList.contains("fileThumb"))if(e.preventDefault(),t.hasAttribute("data-src")){var n=document.createElement("img");n.setAttribute("src",t.parentNode.getAttribute("href")),n.style.display="none",t.parentNode.insertBefore(n,t.nextElementSibling),t.style.opacity="0.75",setTimeout(f,10,n,t)}else{var o=t.parentNode;o.firstChild.style.display="",o.removeChild(t),o.offsetTop div");if(document.getElementById("show-tag-overflow-button")&&document.getElementById("show-tag-overflow-button").remove(),e&&e.offsetWidth{e.classList.contains("show-overflow")?(e.classList.remove("show-overflow"),t.textContent="Show all»"):(e.classList.add("show-overflow"),t.textContent="« Hide")},e.parentElement.appendChild(t)}}function p(e){return t=>{if("service"===t.target.id){t.stopPropagation();const n=t.target.value;e(n)}}}function g(e,t){let n=t[e];Object.values(t).forEach((e=>e.classList.add("form__section--hidden"))),Object.values(t).forEach((e=>e.querySelectorAll("input").forEach((e=>e.required=!1)))),n&&(n.classList.remove("form__section--hidden"),n.querySelectorAll("input").forEach((e=>e.required=!0)))}function h(e,t){Object.values(t).forEach((e=>e.hidden=!0)),t[e]?t[e].hidden=!1:t.other.hidden=!1}function y(e,t,n){t[e]?(n.classList.remove("form__section--hidden"),n.querySelector("input").checked=!0):(n.classList.add("form__section--hidden"),n.querySelector("input").checked=!1)}var w=n(744),_=n(435);async function L(e,t,n){let o=await i.J.api.logs(n.importID);if(!o)return 5===n.retries?void(n.status.textContent="Fatal Error"):(await(0,w.Q5)(n.cooldown),n.retries++,await L(e,t,n));const r=o.length-e.length;if(0===r)return n.cooldown=2*n.cooldown,await(0,w.Q5)(n.cooldown),(0,_.s)(!1,1).then((()=>{})),await L(e,t,n);const a=o.slice(o.length-r),s=document.createDocumentFragment();return a.forEach((e=>{const t=S(e);s.appendChild(t)})),e.push(...a),t.appendChild(s),n.count.textContent=e.length,await(0,w.Q5)(n.cooldown),await L(e,t,n)}function S(e){const t=(0,a.L)("log-list__item");return t.textContent=e,t}function E(e){const t=e.querySelector(".card-list");if(!t)return;const{cardList:n,cardItems:a}=(0,r.CS)(t);a.forEach((async e=>{(0,r.gH)();const{postID:t,userID:n,service:a}=(0,r.y4)(e),i=s.j&&await(0,o.dC)(a,n,t),c=s.j&&await(0,o.t8)(n,a);if(i&&e.classList.add("post-card--fav"),c){const t=e.querySelector(".post-card__header"),n=e.querySelector(".post-card__footer");t.classList.add("post-card__header--fav"),n.classList.add("post-card__footer--fav")}}))}let b,C,I=parseInt(window.location.hash.substring(1).split("&").find((e=>"o"===e.split("=")[0]))?.split("=")[1])||0,x=50;const k=5,q=k-2,$=k-q;function A(e,t,n,o,r,a,s){return async i=>{T(e.value,t.value,n.value,o.value),await J(r,a,s,n.value)}}function D(e,t){return et?1:0}function T(e,t,n,o){C=b.slice(0),"desc"===e&&C.reverse(),C=C.filter((e=>e.service===(t||e.service))).sort(((t,o)=>"asc"===e?"indexed"===n?t.parsedIndexed-o.parsedIndexed:"updated"===n?t.parsedUpdated-o.parsedUpdated:D(t[n],o[n]):"indexed"===n?o.parsedIndexed-t.parsedIndexed:"updated"===n?o.parsedUpdated-t.parsedUpdated:D(o[n],t[n]))).filter((e=>e.name.match(new RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"))))}function B(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"string"==typeof t&&(n=t,t=null),"number"==typeof t?`${e}`:`
  • ${e}
  • `}function F(){const e=C.length,t=I+x1,i=o-n>k+(n-a0+t))}(0,2*k+1);return e>x?`\n Showing ${I+1} - ${t} of ${e}\n \n\n ${s||i?B("<<",s?0:"pagination-button-disabled"+(n-$-1?" pagination-desktop":"")):""}\n ${s?"":n-$-1?B("<<",0,"pagination-mobile"):o-n>$&&!i?B("<<","pagination-button-disabled pagination-mobile"):""}\n ${n>1?B("<",(n-2)*x,"prev"):B("<","pagination-button-disabled")}\n ${d.map((e=>e+a&&e+a<=o?B(e+a,e+a!=n?(e+a-1)*x:null,(e+al)&&e+a!=n?"pagination-button-optional":e+a==n?"pagination-button-disabled pagination-button-current":e+a==n+1?"pagination-button-after-current":""):"")).join("\n")}\n ${n",n*x,"next"):B(">","pagination-button-disabled"+(o?" pagination-button-after-current":""))}\n ${s||i?B(">>",i?(o-1)*x:"pagination-button-disabled"+(o-n>$?" pagination-desktop":"")):""}\n ${i?"":o-n>$?B(">>",(o-1)*x,"pagination-mobile"):n>q&&!s?B(">>","pagination-button-disabled pagination-mobile"):""}\n \n `:""}async function J(e,t,n,a){e.textContent="Displaying search results",n.top.innerHTML=F(),n.bottom.innerHTML=F();const[...i]=t.children;if(i.forEach((e=>{e.remove()})),0===C.length){const e=document.createElement("p");return e.classList.add("subtitle","card-list__item--no-results"),e.textContent="No artists found for your query.",void t.appendChild(e)}{const e=document.createDocumentFragment();for await(const t of C.slice(I,I+x)){const n="favorited"===a,i="indexed"===a,c="updated"===a,l=(0,r.Oe)(null,t,n,c,i);s.j&&await(0,o.t8)(t.id,t.service)&&l.classList.add("user-card--fav"),e.appendChild(l)}t.appendChild(e)}}var P=n(6880),N=n(8576),H=n(8386),O=n(2321);n(8957),n(6815);var j=n(7882),U=n.n(j);const M=new Map,R=(new Map,new Map([["user",[async function(e){(0,r.gH)();const t=document.head.querySelector("[name='id']")?.content,n=document.head.querySelector("[name='service']")?.content,i=e.querySelector(".user-header__actions"),c=e.querySelector(".card-list");await async function(e,t,n){const i=(0,a.L)("user-header__favourite");if(!i)return;const c=await(0,o.t8)(t,n);if(localStorage.getItem("logged_in")&&c){i.classList.add("user-header__favourite--unfav");const[e,t]=i.children;e.textContent="★",t.textContent="Unfavorite"}var l,d;i.addEventListener("click",(l=t,d=n,async e=>{const t=e.target;if(!s.j)return void(0,r.hJ)(t,(0,r.F7)(null,"Favorites"));const[n,i]=t.children,c=(0,a.L)("loading-icon");t.disabled=!0,t.classList.add("user-header__favourite--loading"),t.insertBefore(c,i);try{t.classList.contains("user-header__favourite--unfav")?await(0,o.K_)(l,d)&&(t.classList.remove("user-header__favourite--unfav"),n.textContent="☆",i.textContent="Favorite"):await(0,o.iJ)(l,d)&&(t.classList.add("user-header__favourite--unfav"),n.textContent="★",i.textContent="Unfavorite")}catch(e){console.error(e)}finally{c.remove(),t.disabled=!1,t.classList.remove("user-header__favourite--loading")}})),e?.appendChild(i)}(i,t,n);const l=document.location.pathname;l.includes("fancards")||l.includes("tags")||c&&await async function(e){const{cardItems:t}=(0,r.CS)(e);t.forEach((async e=>{const{postID:t,userID:n,service:a}=(0,r.y4)(e);s.j&&await(0,o.dC)(a,n,t)&&e.classList.add("post-card--fav")}))}(c)}]],["register",[function(e){!function(){var e=document.getElementById("serialized-favorites"),t=localStorage.getItem("favorites"),n=[];if(e&&t){t.split(",").forEach((function(e){var t=e.split(":");if(2==t.length){var o={service:t[0],artist_id:t[1]};n.push(o)}}));var o=JSON.stringify(n);e.value=o}}(),function(){const e=()=>document.getElementById("new-username"),t=()=>document.getElementById("new-password"),n=()=>document.getElementById("password-confirm"),o=()=>document.getElementById("username-char-count"),r=()=>document.getElementById("username-allowed-characters"),a=()=>document.getElementById("password-char-count"),s=()=>document.getElementById("password-confirm-matches"),i=new RegExp("^"+document.getElementById("register_form").dataset.pattern+"$"),c=new RegExp("[^a-z0-9_@+.-]","g");function l(c){let l=!1,d=e().value,u=t().value,f=n().value;d.length<3||d.length>15?(l=!0,o().classList.add("invalid")):o().classList.remove("invalid"),d.match(i)?r().classList.remove("invalid"):(l=!0,r().classList.add("invalid")),u.length<5?(l=!0,a().classList.add("invalid")):a().classList.remove("invalid"),f!==u||""===f?(l=!0,s().classList.add("invalid")):s().classList.remove("invalid"),document.getElementById("submit").disabled=l}window.addEventListener("load",(o=>{l(),e().addEventListener("input",l),e().addEventListener("input",(e=>{e.srcElement.value=e.srcElement.value.toLowerCase().replace(c,"")})),t().addEventListener("input",l),n().addEventListener("input",l)}))}()}]],["post",[async function(e){const t=e.querySelector(".post__actions");u.service=document.head.querySelector("[name='service']").content,u.user=document.head.querySelector("[name='user']").content,u.postID=document.head.querySelector("[name='id']").content;const n=e.querySelector(".post__body");e.addEventListener("click",m),function(e){const t=e.querySelector(".post__content");if(!t||!t.childElementCount&&!t.childNodes.length)return;if("fanbox"===u.service){if(!t.childElementCount&&1===t.childNodes.length){const[e]=Array.from(t.childNodes),n=document.createElement("pre");e.after(n),n.appendChild(e)}t.querySelectorAll("p").forEach((e=>{1===e.childElementCount&&"BR"===e.firstElementChild.tagName&&e.remove()}))}Array.from(document.links).forEach((e=>{if(e.hostname.includes("downloads.fanbox.cc"))if(e.classList.contains("image-link"))e.remove();else{let t=document.createElement("span");t.textContent=e.textContent,e.replaceWith(t)}}));const n=t.querySelectorAll("p:empty");Array.from(n).forEach((e=>{e.nextElementSibling&&"BR"===e.nextElementSibling.tagName?(e.nextElementSibling.remove(),e.remove()):e.remove()}))}(n),await async function(e){const t=e.querySelector(".post__flag"),n=(0,a.L)("post__fav");if(s.j&&await(0,o.dC)(u.service,u.user,u.postID)){const[e,t]=n.children;n.classList.add("post__fav--unfav"),e.textContent="★",t.textContent="Unfavorite"}var c,l,d;t.classList.contains("post__flag--flagged")||t.addEventListener("click",(c=u.service,l=u.user,d=u.postID,async e=>{const t=e.target,[n,o]=t.children,s=(0,r.Ho)(),u=confirm("Are you sure you want to flag this post for reimport? Only do this if data in the post is broken/corrupted/incomplete.\nThis is not a deletion button.");t.classList.add("post__flag--loading"),t.disabled=!0,t.insertBefore(s,o);try{if(u&&await i.J.posts.attemptFlag(c,l,d)){const e=t.parentElement,n=(0,a.L)("post__flag post__flag--flagged");e.insertBefore(n,t),t.remove()}}catch(e){console.error(e)}finally{s.remove(),t.disabled=!1,t.classList.remove("post__flag--loading")}})),n.addEventListener("click",function(e,t,n){return async a=>{const s=a.currentTarget;if("yes"!==localStorage.getItem("logged_in"))return void(0,r.hJ)(s,(0,r.F7)(null,"Favorites"));const[i,c]=s.children,l=(0,r.Ho)();s.disabled=!0,s.classList.add("post__fav--loading"),s.insertBefore(l,c);try{s.classList.contains("post__fav--unfav")?await(0,o.w8)(e,t,n)&&(s.classList.remove("post__fav--unfav"),i.textContent="☆",c.textContent="Favorite"):await(0,o.FL)(e,t,n)&&(s.classList.add("post__fav--unfav"),i.textContent="★",c.textContent="Unfavorite")}catch(e){console.error(e)}finally{l.remove(),s.disabled=!1,s.classList.remove("post__fav--loading")}}}(u.service,u.user,u.postID)),e.appendChild(n),document.addEventListener("keydown",(e=>{switch(e.key){case"ArrowLeft":document.querySelector(".post__nav-link.prev")?.click();break;case"ArrowRight":document.querySelector(".post__nav-link.next")?.click()}}))}(t),function(){let e=document.getElementById("post-revision-selection");e&&e.addEventListener("change",(e=>{let t=e.target.selectedOptions[0].value;location.pathname=t?`/${u.service}/user/${u.user}/post/${u.postID}/revision/${t}`:`/${u.service}/user/${u.user}/post/${u.postID}`}))}(),document.addEventListener("DOMContentLoaded",((e,t)=>{v()})),window.addEventListener("resize",((e,t)=>{v()})),c.Z.init(),function(){let e=function*(e){const t=Array.from(document.querySelectorAll(".comment-revisions-dialog .prose"))[Symbol.iterator]();let n=t.next();if(n.done)return;let o=t.next();for(;!o.done;)yield[n.value,o.value],n=o,o=t.next()}();for(let[t,n]of e){let e=document.createElement("span");e.classList.add("prose"),(0,l.Kx)(t.textContent,n.textContent).forEach((t=>{let n=document.createElement("span");t.added?n.classList.add("added"):t.removed&&n.classList.add("removed"),n.appendChild(document.createTextNode(t.value)),e.appendChild(n)})),t.replaceWith(e)}}(),Array.from(document.getElementsByTagName("video")).forEach(((e,t)=>{(0,d.Z)(`kemono-player${t}`,{layoutControls:{fillToContainer:!1,preload:"none"},vastOptions:{adList:window.videoAds,adTextPosition:"top left",maxAllowedVastTagRedirects:2,vastAdvanced:{vastLoadedCallback:function(){},noVastVideoCallback:function(){},vastVideoSkippedCallback:function(){},vastVideoEndedCallback:function(){}}}})}))}]],["importer",[function(e){const t="yes"===localStorage.getItem("logged_in"),n=document.forms["import-list"],o=n.querySelector("#service").value,a={fansly:n.querySelector(".fansly__notes"),onlyfans:n.querySelector(".onlyfans__notes"),other:n.querySelector(".other__notes")};h(o,a),n.addEventListener("change",p((e=>h(e,a))));const s={discord:n.querySelector("#discord-section"),onlyfans:n.querySelector("#onlyfans-section")};g(o,s),n.addEventListener("change",p((e=>g(e,s))));const i={patreon:!0,fansly:!0};y(o,i,n.querySelector("#dm-consent")),n.addEventListener("change",p((e=>y(e,i,n.querySelector("#dm-consent"))))),n.addEventListener("submit",function(e){return t=>{const n=t.target,o=n.elements["save-dms"],a=n.elements.service;o.checked&&!e&&"patreon"===a&&(t.preventDefault(),(0,r.hJ)(o,(0,r.F7)(null)))}}(t)),document.getElementById("user-agent").value=navigator.userAgent}]],["importer-status",[async function(e){const t=e.querySelector(".import__info"),[n,o]=t.children,[r,a]=n.children,s={importID:document.head.querySelector("meta[name='import_id']").content,status:r.children[1],count:a.children[1],cooldown:5e3,retries:0},c=e.querySelector(".loading-placeholder"),l=e.querySelector(".log-list");!function(e,t){const[n]=e.children;n.addEventListener("click",function(e){return t=>{e.classList.toggle("log-list--reversed")}}(t))}(o,l);const d=await i.J.api.logs(s.importID);d?(function(e,t,n){const o=document.createDocumentFragment();e.forEach((e=>{const t=S(e);o.appendChild(t)})),n.classList.add("loading-placeholder--complete"),t.appendChild(o),t.classList.add("log-list--loaded")}(d,l,c),s.status.textContent="In Progress",s.count.textContent=d.length,a.classList.remove("import__count--invisible"),(0,_.s)(!0).then((()=>{})),await(0,w.Q5)(s.cooldown),await L(d,l,s)):(c.classList.add("loading-placeholder--complete"),alert("Failed to fetch the logs, try reloading the page."))}]],["posts",[E]],["popular-posts",[E]],["artists",[async function(e){const t=document.getElementById("display-status"),n=document.getElementById("loading"),a=document.forms["search-form"],c=a.elements.order,l=a.elements.service,d=a.elements.sort_by,u=a.elements.q,f=e.querySelector(".card-list"),{cardList:m,cardContainer:v}=(0,r.CS)(f),p={top:document.getElementById("paginator-top"),bottom:document.getElementById("paginator-bottom")};Array.from(v.children).forEach((async e=>{const{id:t,service:n}=e.dataset;s.j&&await(0,o.t8)(t,n)&&e.classList.add("user-card--fav")})),e.addEventListener("click",(async e=>{const n=e.target,o=n.parentElement.classList.contains("paginator-button-ident");(n.classList.contains("paginator-button-ident")&&n.dataset&&n.dataset.value||o&&n.parentElement.dataset&&n.parentElement.dataset.value)&&(e.preventDefault(),I=Number(o?n.parentElement.dataset.value:n.dataset.value),window.location.hash="o="+I,T(c.value,l.value,d.value,u.value),await J(t,v,p,d.value))})),a.addEventListener("submit",(e=>e.preventDefault())),u.addEventListener("change",A(c,l,d,u,t,v,p)),u.addEventListener("keydown",function(e){var t=this;let n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var r=arguments.length,a=new Array(r),s=0;s{e.apply(t,a)}),o)}}(A(c,l,d,u,t,v,p),300)),l.addEventListener("change",A(c,l,d,u,t,v,p)),d.addEventListener("change",A(c,l,d,u,t,v,p)),c.addEventListener("change",A(c,l,d,u,t,v,p)),await async function(e){try{const t=await i.J.api.creators();if(!t)return null;for(const e of t)e.parsedIndexed=1e3*e.indexed,e.parsedUpdated=1e3*e.updated,e.indexed=new Date(e.parsedIndexed).toISOString(),e.updated=new Date(e.parsedUpdated).toISOString();e.innerHTML="",b=t,C=t}catch(e){console.error(e)}}(n),A(c,l,d,u,t,v,p)(null),(0,r.gH)()}]],["updated",[async function(e){(0,r.gH)();const t=e.querySelector(".card-list"),{cardContainer:n}=(0,r.CS)(t);for await(const e of n.children){const{id:t,service:n}=e.dataset;s.j&&await(0,o.t8)(t,n)&&e.classList.add("user-card--fav")}}]],["upload",[async function(e){Array.from(document.getElementsByTagName("textarea")).forEach((e=>{e.setAttribute("style","height:"+e.scrollHeight+"px;overflow-y:hidden;"),e.addEventListener("input",(function(){this.style.height="auto",this.style.height=this.scrollHeight+"px"}),!1)})),new H.ZP({restrictions:{maxTotalFileSize:2147483648,maxNumberOfFiles:10,minNumberOfFiles:1}}).use(P.Z,{note:"Up to 10 files permitted.",fileManagerSelectionType:"both",target:"#upload",inline:!1,trigger:"#upload-button",theme:"dark"}).use(O.Z,{endpoint:"http://localhost:1080/files/",retryDelays:[0,1e3,3e3,5e3]}).use(N.Z,{resultName:"uppyResult",target:"#upload-form",submitOnSuccess:!1}).on("complete",(e=>{let{successful:t}=e;t.forEach((e=>{document.getElementById("file-list").innerHTML+=`
  • ${e.meta.name}
  • `}))}))}]],["all-dms",[r.gH]],["favorites",[r.gH]],["file-hash-search",[function(){const e=document.getElementById("file-search"),t=document.getElementById("file"),n=document.getElementById("hash");e.addEventListener("submit",(async function(e){let o;e.preventDefault(),""!==t.value?o=await async function(e){const t=e.size,n=1048576;let o=0,r=new(U());for(;o{n.d(t,{CS:()=>a,M$:()=>u,Ho:()=>r,y4:()=>l,EK:()=>w,Oe:()=>d,Jd:()=>y,F7:()=>g,gH:()=>_,hJ:()=>p});var o=n(1823);function r(){return(0,o.L)("loading-icon")}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=e?function(e){const t=e.querySelector(".card-list__items"),n=e.querySelectorAll(".card-list__items > *");return{cardList:e,cardContainer:t,cardItems:Array.from(n)}}(e):function(){const e=(0,o.L)("card-list"),t=e?.querySelector(".card-list__items");return{cardList:e,cardContainer:t,cardItems:[]}}();let n;try{let e=document.cookie.split(";").reduce(((e,t)=>(e[t.split("=")[0].trim()]=decodeURIComponent(t.split("=")[1]),e)),{});n=parseInt(e?.thumbSize),n=isNaN(n)?void 0:n}catch(e){return t}var r;n||(r="thumbSize","180",399,document.cookie.split(";").find((e=>e.trim().startsWith(r+"=")))||function(e,t,n){const o=new Date;o.setTime(o.getTime()+344736e5);const r="expires="+o.toUTCString();document.cookie=e+"="+t+"; "+r+";path=/"}(r,"180"));let a=parseInt(n)===parseInt(180)?void 0:n,i=document.querySelector(".card-list__items");return i.parentNode.classList.contains("card-list--phone")||(window.addEventListener("resize",(()=>s(i,180,a))),s(i,180,a)),t}function s(e,t,n){let o=n||t;if(!n){let e=window.innerWidth-24,n=e/o;n<2&&1.512&&(o=1.5*t)}e.style.setProperty("--card-size",`${o}px`)}var i=n(744),c=n(3374);function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e?function(e){const{id:t,service:n,user:o}=e.dataset;return{postCardElement:e,postID:t,service:n,userID:o}}(e):function(e){return{postCardElement:(0,o.L)("post-card"),postID:e.id,service:e.service,userID:e.user}}(t),r=n.postCardElement.querySelector(".post-card__view");if(r){const e=r.querySelector(".post-card__button"),t=n.postCardElement.querySelector(".post-card__link");e.addEventListener("click",function(e){return t=>{e.focus()}}(t))}return n}function d(e){const t=e||function(e,t,n,r,a){let s=i.VY.kemono.user.icon(e.service,e.id),l=i.VY.kemono.user.banner(e.service,e.id);const d=i.VY.kemono.user.profile(e.service,e.id);s=c.QA+s,l=c.Kq+l;const f=(0,o.L)("user-card");f.href=d,f.style.backgroundImage=`linear-gradient(rgb(0 0 0 / 50%), rgb(0 0 0 / 80%)), url(${l})`;const m=u(null,s,s,!0,"","user-card__user-icon"),v=f.querySelector(".user-card__icon"),p=f.querySelector(".user-card__name"),g=f.querySelector(".user-card__service"),h=f.querySelector(".user-card__count"),y=f.querySelector(".user-card__updated");if(v.appendChild(m),p.textContent=e.name,g.textContent=i.Wq[e.service].title,g.style.backgroundColor=i.Wq[e.service].color,a&&f.classList.add(a),t?h.innerHTML=`${e.favorited} favorites`:h.remove(),n||r){const t=w(null,n?e.updated:e.indexed);y.appendChild(t)}else y.remove();return f}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]&&arguments[4],arguments.length>5&&void 0!==arguments[5]?arguments[5]:null);return t}function u(){let e=arguments.length>1?arguments[1]:void 0;const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||function(e,t,n,r,a){const s=(0,o.L)("fancy-image"),i=s.querySelector(".fancy-image__image");return i.src=e,i.srcset=t,i.alt=r,a&&s.classList.add(a),i.loading=n?"lazy":"eager",s}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,!(arguments.length>3&&void 0!==arguments[3])||arguments[3],arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",arguments.length>5&&void 0!==arguments[5]?arguments[5]:null);return t}const f=document.getElementById("flying-tooltip"),[m,v]=f.children;function p(e,t){const{left:n,bottom:o}=e.getBoundingClientRect();f.classList.remove("tooltip--shown"),v.replaceWith(t),f.style.setProperty("--local-x",`${n}px`),f.style.setProperty("--local-y",`${o}px`),f.classList.add("tooltip--shown")}function g(e){return e||function(e){const t=(0,o.L)("tooltip__message tooltip__message--register");return t.querySelector(".tooltip__action").textContent=e,t}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"")}m.addEventListener("click",(e=>{f.classList.remove("tooltip--shown")}));var h=n(8745);function y(e){const t=document.getElementById("burgor"),n=t.parentElement,o=document.querySelector(".backdrop"),r=document.querySelector(".content-wrapper"),a=e.querySelector(".close-sidebar"),s=function(t){let a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.classList.toggle("expanded"),e.classList.toggle("retracted"),o.classList.toggle("backdrop-hidden"),r.classList.toggle("shifted");const s=n.classList.toggle("sidebar-retracted");a&&window.innerWidth>1020&&localStorage.setItem("sidebar_state",s)};if("string"==typeof localStorage.getItem("sidebar_state")){const e="true"===localStorage.getItem("sidebar_state");window.innerWidth>1020&&e&&s()}if(window.addEventListener("resize",(()=>{if("string"!=typeof localStorage.getItem("sidebar_state"))return;const e="true"===localStorage.getItem("sidebar_state"),t=n.classList.contains("sidebar-retracted"),o=()=>{document.body.classList.add("transition-preload"),requestAnimationFrame((()=>setInterval((()=>document.body.classList.remove("transition-preload")))))};window.innerWidth<=1020?e&&t&&(o(),s(null,!1)):e&&!t&&(o(),s())})),t.addEventListener("click",s),o.addEventListener("click",s),a.addEventListener("click",s),h.j){const t=e.querySelector(".account"),o=t.querySelector(".login"),r=n.querySelector(".login"),a=t.querySelector(".register"),s=n.querySelector(".register"),i=t.querySelector(".favorites"),c=t.querySelector(".review_dms");o.classList.remove("login"),r.classList.remove("login"),r.classList.add("logout"),a.classList.remove("register"),s.classList.remove("register"),i.classList.remove("hidden"),c.classList.remove("hidden"),o.lastChild.textContent="Logout",o.firstElementChild.src="/static/menu/logout.svg",o.href="/account/logout",r.innerText="Logout",r.href="/account/logout",a.lastChild.textContent="Keys",a.firstElementChild.src="/static/menu/keys.svg",a.href="/account/keys",s.innerText="Favorites",s.href="/favorites";const l=e=>{e.preventDefault(),localStorage.removeItem("logged_in"),localStorage.removeItem("favs"),localStorage.removeItem("post_favs"),location.href="/account/logout"};o.addEventListener("click",l),r.addEventListener("click",l)}else{const t=e.querySelector(".account-header"),n=document.createElement("div");n.className="global-sidebar-entry-item header",n.innerText="Account",n.prepend(t.firstElementChild),t.parentElement.replaceChild(n,t)}}function w(e,t){const n=e||function(e,t,n){const r=(0,o.L)("timestamp");return r.dateTime=e,n&&r.classList.add(n),r.textContent=e,r}(t,0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null);return n}function _(){document.addEventListener("keydown",(e=>{switch(e.key){case"ArrowLeft":document.querySelector(".paginator .prev")?.click();break;case"ArrowRight":document.querySelector(".paginator .next")?.click()}}))}window.addEventListener("load",(()=>{document.body.classList.remove("transition-preload")}))},744:(e,t,n)=>{n.d(t,{sf:()=>r,_K:()=>a,VY:()=>i,Wq:()=>s,Q5:()=>c});const o={0:"Could not connect to server.",1:"Could not favorite post.",2:"Could not unfavorite post.",3:"Could not favorite artist.",4:"Could not unfavorite artist.",5:"There might already be a flag here.",6:"Could not retrieve the list of bans.",7:"Could not retrieve banned artist.",8:"Could not retrieve artists.",9:"Could not retrieve import logs."};class r extends Error{constructor(e){super(),this.code=String(e).padStart(3,"0"),this.message=`${this.code}: ${o[e]}`}}function a(e){Array.from(e).forEach((e=>{const t=e.closest("a");!t||t.classList.contains("user-header__profile")||t.classList.contains("user-card")||t.classList.contains("image-link")||t.classList.contains("global-sidebar-entry-item")||t.classList.add("image-link")}))}parseInt(document.documentElement.style.getPropertyValue("--duration-global"));const s={patreon:{title:"Patreon",color:"#fa5742",user:{profile:e=>`https://www.patreon.com/user?u=${e}`},post:{}},fanbox:{title:"Pixiv Fanbox",color:"#2c333c",user:{profile:e=>`https://www.pixiv.net/fanbox/creator/${e}`},post:{}},subscribestar:{title:"SubscribeStar",color:"#009688",user:{profile:e=>`https://subscribestar.adult/${e}`},post:{}},gumroad:{title:"Gumroad",color:"#2b9fa4",user:{profile:e=>`https://gumroad.com/${e}`},post:{}},discord:{title:"Discord",color:"#5165f6",user:{profile:e=>""},post:{}},dlsite:{title:"DLsite",color:"#052a83",user:{profile:e=>`https://www.dlsite.com/eng/circle/profile/=/maker_id/${e}`},post:{}},fantia:{title:"Fantia",color:"#e1097f",user:{profile:e=>`user_id: f"https://fantia.jp/fanclubs/${e}`},post:{}},boosty:{title:"Boosty",color:"#fd6035",user:{profile:e=>`https://boosty.to/${e}`},post:{}},afdian:{title:"Afdian",color:"#9169df",user:{profile:e=>""},post:{}},fansly:{title:"Fansly",color:"#2399f7",user:{profile:e=>`https://fansly.com/${e}`},post:{}},onlyfans:{title:"OnlyFans",color:"#008ccf",user:{profile:e=>`https://onlyfans.com/${e}`},post:{}}},i={kemono:{title:"Kemono",user:{profile:(e,t)=>`/${e}/${"discord"===e?"server":"user"}/${t}`,icon:(e,t)=>`/icons/${e}/${t}`,banner:(e,t)=>`/banners/${e}/${t}`},post:{link:(e,t,n)=>`/${e}/user/${t}/post/${n}`}}};function c(e){return new Promise((t=>setTimeout(t,e)))}}},e=>{e.O(0,[216],(()=>(4558,e(e.s=4558)))),e.O()}]);