var Danbooru;!function(){var t,e={5052:function(t,e,n){var a={"./artist.js":5040,"./autocomplete.js.erb":5773,"./blacklists.js":336,"./blips.js":5153,"./comments.js":8261,"./common.js":9347,"./cookie.js":2262,"./dtext.js":9561,"./favorites.js":8087,"./forum_posts.js":8162,"./guest_warning.js":4320,"./local_storage.js":1850,"./mascots.js":7414,"./mod_queue.js":3989,"./news_updates.js":910,"./notes.js":4603,"./pools.js":1010,"./post_delete.js":4984,"./post_mode_menu.js":2071,"./post_replacement.js":8002,"./post_sets.js":5204,"./post_versions.js":7199,"./posts.js":801,"./related_tag.js":7595,"./replacer.js":2114,"./responsive.js":8243,"./send_queue.js":4584,"./shortcuts.js":9807,"./tag_relationships.js":6893,"./tag_script.js":2769,"./takedowns.js":3951,"./thumbnails.js":8217,"./uploader.js":369,"./user_warning.js":8555,"./utility.js":3752,"./vote_manager.js":9324,"src/javascripts/artist.js":5040,"src/javascripts/autocomplete.js.erb":5773,"src/javascripts/blacklists.js":336,"src/javascripts/blips.js":5153,"src/javascripts/comments.js":8261,"src/javascripts/common.js":9347,"src/javascripts/cookie.js":2262,"src/javascripts/dtext.js":9561,"src/javascripts/favorites.js":8087,"src/javascripts/forum_posts.js":8162,"src/javascripts/guest_warning.js":4320,"src/javascripts/local_storage.js":1850,"src/javascripts/mascots.js":7414,"src/javascripts/mod_queue.js":3989,"src/javascripts/news_updates.js":910,"src/javascripts/notes.js":4603,"src/javascripts/pools.js":1010,"src/javascripts/post_delete.js":4984,"src/javascripts/post_mode_menu.js":2071,"src/javascripts/post_replacement.js":8002,"src/javascripts/post_sets.js":5204,"src/javascripts/post_versions.js":7199,"src/javascripts/posts.js":801,"src/javascripts/related_tag.js":7595,"src/javascripts/replacer.js":2114,"src/javascripts/responsive.js":8243,"src/javascripts/send_queue.js":4584,"src/javascripts/shortcuts.js":9807,"src/javascripts/tag_relationships.js":6893,"src/javascripts/tag_script.js":2769,"src/javascripts/takedowns.js":3951,"src/javascripts/thumbnails.js":8217,"src/javascripts/uploader.js":369,"src/javascripts/user_warning.js":8555,"src/javascripts/utility.js":3752,"src/javascripts/vote_manager.js":9324};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}o.keys=function(){return Object.keys(a)},o.resolve=i,t.exports=o,o.id=5052},4710:function(t,e,n){"use strict";n.r(e),n.d(e,{$:function(){return o.a},Artist:function(){return r.default},Autocomplete:function(){return s.default},Blacklist:function(){return c.default},Blip:function(){return l.default},Comment:function(){return d.default},DText:function(){return u.default},Note:function(){return p.default},Post:function(){return f.default},PostDeletion:function(){return g.default},PostModeMenu:function(){return h.default},PostReplacement:function(){return v.default},PostVersions:function(){return m.default},Replacer:function(){return _.default},Shortcuts:function(){return b.default},TagRelationships:function(){return y.default},Takedown:function(){return k.default},Thumbnails:function(){return x.default},Uploader:function(){return j.default},Utility:function(){return w.default},VoteManager:function(){return T.default},error:function(){return D},notice:function(){return U}});var a=n(4002),o=n.n(a),i=n(4258),r=n(5040),s=n(5773),c=n(336),l=n(5153),d=n(8261),u=n(9561),p=n(4603),f=n(801),g=n(4984),h=n(2071),v=n(8002),m=n(7199),_=n(2114),b=n(9807),w=n(3752),y=n(6893),k=n(3951),x=n(8217),j=n(369),T=n(9324);i.Z.start();var S;function D(t){$(window).trigger("danbooru:error",t)}function U(t){$(window).trigger("danbooru:notice",t)}n(7384),n(2993),n(9366),n(2466),n(7285),n(2526),n(1707),n(1406),n(9124),n(2248),n(6241),n(5618),n(5746),n(3210),n(4434),n(9769),(S=n(5052)).keys().forEach(S),n(425)},5040:function(t,e,n){"use strict";n.r(e);var a=n(3752),o=n(4584),i={};i.update=function(t,e){o.SendQueue.add((function(){$.ajax({type:"PUT",url:"/artists/"+t+".json",data:e,success:function(t){a.default.notice("Artist updated.")},error:function(e){a.default.error('There was an error updating artist #').concat(t,""))}})}))},e.default=i,$((function(){$("#c-artists").length&&$("#undelete-artist-link").on("click",(function(t){confirm("Are you sure you want to undelete this artist?")&&i.update($(t.target).data("aid"),{"artist[is_active]":!0}),t.preventDefault()}))}))},336:function(t,e,n){"use strict";n.r(e);var a=n(3752),o=n(1850),i=n(801);function r(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){c=!0,i=t},f:function(){try{r||null==n.return||n.return()}finally{if(c)throw i}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n":return">=";case"=<":return"<=";case"=":case"":return"==";default:return t}},a={tags:t,require:[],exclude:[],optional:[],disabled:!1,hits:0,score_comparison:null,username:!1,user_id:0},o=r(t.match(/\S+/g)||[]);try{for(o.s();!(e=o.n()).done;){var i=e.value;if("-"===i.charAt(0))a.exclude.push(i.slice(1));else if("~"===i.charAt(0))a.optional.push(i.slice(1));else if(i.match(/^score:[<=>]{0,2}-?\d+/)){var s=i.match(/^score:([<=>]{0,2})(-?\d+)/);a.score_comparison=[n(s[1]),parseInt(s[2],10)]}else a.require.push(i)}}catch(d){o.e(d)}finally{o.f()}var c=t.match(/user:(?!!)([\S]+)/)||[];2===c.length&&(a.username=c[1]);var l=t.match(/user(?:id)?:!?(\d+)/)||[];return 2===l.length&&(a.user_id=parseInt(l[1],10)),a},entriesParse:function(){c.entries=[];var t,e=JSON.parse(a.default.meta("blacklisted-tags")||"[]"),n=r(e=(e=e.map((function(t){return t.replace(/(rating:[qes])\w+/gi,"$1").toLowerCase()}))).filter((function(t){return""!==t.trim()})));try{for(n.s();!(t=n.n()).done;){var o=t.value,i=c.entryParse(o);c.entries.push(i)}}catch(s){n.e(s)}finally{n.f()}},domEntryToggle:function(t){t.preventDefault();var e=$(t.target).text();c.lineToggle(e),c.apply()},postHide:function(t){var e=$(t);e.addClass("blacklisted");var n=e.find("video").get(0);n&&(n.pause(),n.currentTime=0)},postShow:function(t){$(t).removeClass("blacklisted"),i.default.resize_notes()},sidebarUpdate:function(){if("1"===o.default.get("dab")?($("#disable-all-blacklists").hide(),$("#re-enable-all-blacklists").show()):($("#disable-all-blacklists").show(),$("#re-enable-all-blacklists").hide()),$("#blacklist-list").html(""),c.post_count<=0)$("#blacklist-box").hide();else{var t,e=r(this.entries);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(0!==n.hits){var a=$("
  • "),i=$(""),s=$("");i.text(n.tags),i.addClass("blacklist-toggle-link"),n.disabled&&i.addClass("entry-disabled"),i.attr("href","/posts?tags=".concat(encodeURIComponent(n.tags))),i.attr("title",n.tags),i.attr("rel","nofollow"),i.on("click.danbooru",c.domEntryToggle),s.html(n.hits),s.addClass("post-count"),a.append(i),a.append(" "),a.append(s),$("#blacklist-list").append(a)}}}catch(l){e.e(l)}finally{e.f()}$("#blacklisted-count").text("(".concat(c.post_count,")")),$("#blacklist-box").show()}},initialize_disable_all_blacklists:function(){"1"===o.default.get("dab")&&c.entriesAllSet(!1),$("#disable-all-blacklists").on("click.danbooru",(function(t){t.preventDefault(),c.entriesAllSet(!1),c.apply()})),$("#re-enable-all-blacklists").on("click.danbooru",(function(t){t.preventDefault(),c.entriesAllSet(!0),c.apply()}))},apply:function(){c.post_count=0;var t,e=r(this.entries);try{for(e.s();!(t=e.n()).done;){t.value.hits=0}}catch(b){e.e(b)}finally{e.f()}var n,o=r(this.posts());try{for(o.s();!(n=o.n()).done;){var i,s=n.value,l=0,d=r(c.entries);try{for(d.s();!(i=d.n()).done;){var u=i.value;c.postMatch(s,u)&&(u.hits+=1,u.disabled||(l+=1),c.post_count+=1)}}catch(b){d.e(b)}finally{d.f()}var p=$(s);l>0?c.postHide(p):c.postShow(p)}}catch(b){o.e(b)}finally{o.f()}if("true"===a.default.meta("blacklist-users")){var f,g=r(this.entries.filter((function(t){return!1!==t.username})));try{for(g.s();!(f=g.n()).done;){var h=f.value;$('article[data-creator="'.concat(h.username,'"]')).hide()}}catch(b){g.e(b)}finally{g.f()}var v,m=r(this.entries.filter((function(t){return 0!==t.user_id})));try{for(m.s();!(v=m.n()).done;){var _=v.value;$('article[data-creator-id="'.concat(_.user_id,'"]')).hide()}}catch(b){m.e(b)}finally{m.f()}}c.sidebarUpdate()},posts:function(){return $(".post-preview, #image-container, #c-comments .post, .post-thumbnail")},postMatch:function(t,e){var n=$(t);if(n.hasClass("post-no-blacklist"))return!1;var a={id:n.data("id"),score:parseInt(n.data("score"),10),tags:n.data("tags").toString(),rating:n.data("rating"),uploader_id:n.data("uploader-id"),user:n.data("uploader").toString().toLowerCase(),flags:n.data("flags"),is_fav:n.data("is-favorited")};return c.postMatchObject(a,e)},postMatchObject:function(t,e){var n=function(t,e){if(!Array.isArray(t)||"undefined"===typeof e||2!==t.length)return!0;switch(t[0]){case"<":return e=":return e>=t[1];case">":return e>t[1];default:return!0}}(e.score_comparison,t.score),o=t.tags.match(/\S+/g)||[];return o.push("id:".concat(t.id)),o.push("rating:".concat(t.rating)),o.push("userid:".concat(t.uploader_id)),o.push("user:!".concat(t.uploader_id)),o.push("user:".concat(t.user)),o.push("height:".concat(t.height)),o.push("width:".concat(t.width)),t.is_fav&&o.push("fav:me"),$.each(t.flags.match(/\S+/g)||[],(function(t,e){o.push("status:".concat(e))})),a.default.is_subset(o,e.require)&&n&&(!e.optional.length||a.default.intersect(o,e.optional).length)&&!a.default.intersect(o,e.exclude).length},initialize_all:function(){c.entriesParse(),c.initialize_disable_all_blacklists(),c.apply(),$("#blacklisted-hider").remove()},initialize_anonymous_blacklist:function(){if(!0===$(document.body).data("user-is-anonymous")){var t=o.default.get("anonymous-blacklist");t&&$("meta[name=blacklisted-tags]").attr("content",t)}},initialize_blacklist_editor:function(){$("#blacklist-edit-dialog").dialog({autoOpen:!1,width:$(window).width()>400?400:"auto",height:400}),$("#blacklist-cancel").on("click",(function(){$("#blacklist-edit-dialog").dialog("close")})),$("#blacklist-save").on("click",(function(){var t=$("#blacklist-edit").val(),e=JSON.stringify(t.split(/\n\r?/));!0===$(document.body).data("user-is-anonymous")?o.default.put("anonymous-blacklist",e):$.ajax("/users/"+a.default.meta("current-user-id")+".json",{method:"PUT",data:{"user[blacklisted_tags]":t}}).done((function(){a.default.notice("Blacklist updated")})).fail((function(t,e,n){a.default.error("Failed to update blacklist")})),$("#blacklist-edit-dialog").dialog("close"),$("meta[name=blacklisted-tags]").attr("content",e),c.initialize_all()})),$("#blacklist-edit-link").on("click",(function(t){t.preventDefault();var e=JSON.parse(a.default.meta("blacklisted-tags")||"[]");e=(e=e.map((function(t){return t.replace(/(rating:[qes])\w+/gi,"$1").toLowerCase()}))).filter((function(t){return""!==t.trim()})),$("#blacklist-edit").val(e.join("\n")),$("#blacklist-edit-dialog").dialog("open")}))},collapseGet:function(){return"1"===(o.default.get("bc")||"1")},collapseSet:function(t){o.default.put("bc",t?"1":"0")},collapseUpdate:function(){c.collapseGet()?($("#blacklist-list").hide(),$("#blacklist-collapse").addClass("hidden")):($("#blacklist-list").show(),$("#blacklist-collapse").removeClass("hidden"))},initialize_collapse:function(){$("#blacklist-collapse").on("click",(function(t){t.preventDefault();var e=c.collapseGet();c.collapseSet(!e),c.collapseUpdate()})),c.collapseUpdate()}};$(document).ready((function(){c.initialize_collapse(),c.initialize_anonymous_blacklist(),c.initialize_blacklist_editor(),c.initialize_all()})),e.default=c},5153:function(t,e,n){"use strict";n.r(e);var a=n(3752),o={atme:function(t){$.ajax({url:"/blips/".concat(t,".json"),type:"GET",dataType:"json",accept:"text/javascript",data:{id:t}}).done((function(t){$("#blip_body_for_")[0].value+="@"+t.creator_name.replace(/ /g,"_")+": ",$("#blip_body_for_")[0].focus(),$("#blip_response_to")[0].value=t.id})).fail((function(t){a.default.error(t.responseText)}))},quote:function(t){$.ajax({url:"/blips/".concat(t,".json"),type:"GET",dataType:"json",accept:"text/javascript",data:{id:t}}).done((function(t){var e=t.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm,"");$("#blip_body_for_")[0].value+='[quote]"'.concat(t.creator_name,'":/users/').concat(t.creator_id," said:\n").concat(e,"\n[/quote]\n\n"),$("#blip_body_for_")[0].focus(),$("#blip_response_to")[0].value=t.id})).fail((function(t){a.default.error(t.responseText)}))},initialize_all:function(){$("#c-blips").length&&($(".blip-atme-link").on("click",(function(t){o.atme($(t.target).data("bid")),t.preventDefault()})),$(".blip-reply-link").on("click",(function(t){o.quote($(t.target).data("bid")),t.preventDefault()})))},reinitialize_all:function(){$("#c-blips").length&&($(".blip-atme-link").off("click"),$(".blip-reply-link").off("click"),o.initialize_all())}};$((function(){o.initialize_all()})),e.default=o},8261:function(t,e,n){"use strict";n.r(e);var a=n(9561),o=n(3752),i={initialize_all:function(){($("#c-posts").length||$("#c-comments").length)&&($(".edit_comment_link").on("click",i.show_edit_form),$(".expand-comment-response").on("click",i.show_new_comment_form),$(".comment-vote-up-link").on("click",i.vote_up),$(".comment-vote-down-link").on("click",i.vote_down),$(".comment-reply-link").on("click",i.quote),$(".comment-hide-link").on("click",i.hide),$(".comment-unhide-link").on("click",i.unhide),$(".comment-delete-link").on("click",i.delete),$(".show-all-comments-for-post-link").on("click",i.show_all),$(".comment-tag-hide-link").on("click",i.toggle_post_tags))},reinitialize_all:function(){($("#c-posts").length||$("#c-comments").length)&&($(".comment-reply-link").off("click"),$(".comment-hide-link").off("click"),$(".comment-unhide-link").off("click"),$(".comment-delete-link").off("click"),$(".show-all-comments-for-post-link").off("click"),$(".comment-tag-hide-link").off("click"),$(".edit_comment_link").off("click"),$(".expand-comment-response").off("click"),$(".comment-vote-up-link").off("click"),$(".comment-vote-down-link").off("click"),i.initialize_all(),a.default.initialize_all_inputs())},show_all:function(t){t.preventDefault();var e=$(t.target).data("pid");$.ajax({url:"/posts/".concat(e,"/comments.json"),type:"GET",dataType:"json"}).done((function(t){$("#threshold-comments-notice-for-".concat(e)).hide(),$("div.comments-for-post[data-post-id=".concat(e,"] div.list-of-comments")).html(t.html),i.reinitialize_all(),$(window).trigger("e621:add_deferred_posts",t.posts)})).fail((function(t){o.default.error("Failed to fetch all comments for this post.")}))},hide:function(t){if(t.preventDefault(),confirm("Are you sure you want to hide this comment?")){var e=$(t.target).parents("article.comment").data("comment-id");$.ajax({url:"/comments/".concat(e,"/hide.json"),type:"POST",dataType:"json"}).done((function(t){$('.comment[data-comment-id="'.concat(e,'"] div.author h1')).append(" (hidden)"),$('.comment[data-comment-id="'.concat(e,'"]')).attr("data-is-deleted","true")})).fail((function(t){o.default.error("Failed to hide comment.")}))}},unhide:function(t){if(t.preventDefault(),confirm("Are you sure you want to unhide this comment?")){var e=$(t.target).parents("article.comment").data("comment-id");$.ajax({url:"/comments/".concat(e,"/unhide.json"),type:"POST",dataType:"json"}).done((function(t){var n=$('.comment[data-comment-id="'.concat(e,'"] div.author h1'));n.text(n.text().replace(" (hidden)","")),$('.comment[data-comment-id="'.concat(e,'"]')).attr("data-is-deleted","false")})).fail((function(t){o.default.error("Failed to unhide comment.")}))}},delete:function(t){if(t.preventDefault(),confirm("Are you sure you want to permanently delete this comment?")){var e=$(t.target).parents("article.comment"),n=e.data("comment-id");$.ajax({url:"/comments/".concat(n,".json"),type:"DELETE",dataType:"json"}).done((function(t){e.remove()})).fail((function(t){o.default.error("Failed to delete comment.")}))}},quote:function(t){t.preventDefault();var e=$(t.target).parents("article.comment"),n=e.data("post-id"),a=e.data("comment-id");$.ajax({url:"/comments/".concat(a,".json"),type:"GET",dataType:"json",accept:"text/javascript"}).done((function(t){var a=t.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm,"");a='[quote]"'.concat(e.data("creator"),'":/users/').concat(e.data("creator-id")," said:\n").concat(a,"\n[/quote]\n\n");var o=$('div.comments-for-post[data-post-id="'.concat(n,'"] div.new-comment'));o.find(".expand-comment-response").click();var i=o.find("textarea"),r=a;i.val().length>0&&(r=i.val()+"\n\n"+r),i.val(r),i.selectEnd()})).fail((function(t){o.default.error(t.responseText)}))},toggle_post_tags:function(t){t.preventDefault();var e=$(t.target);$("#post-tags-".concat(e.data("post-id"))).toggleClass("hidden")},show_new_comment_form:function(t){t.preventDefault(),$(t.target).hide();var e=$(t.target).closest("div.new-comment").find("form");e.show(),e[0].scrollIntoView(!1)},show_edit_form:function(t){t.preventDefault(),$(this).closest(".comment").find(".edit_comment").show()},vote_up:function(t){var e=$(t.target).attr("data-id");i.vote(e,1)},vote_down:function(t){var e=$(t.target).attr("data-id");i.vote(e,-1)},vote:function(t,e){$.ajax({method:"POST",url:"/comments/".concat(t,"/votes.json"),data:{score:e},dataType:"json"}).done((function(e){var n,a="score-neutral score-positive score-negative",i=t,r=e.score,s=e.our_score;$("#comment-score-"+i).removeClass(a),$("#comment-vote-up-"+i).removeClass(a),$("#comment-vote-down-"+i).removeClass(a),$("#comment-score-"+i).text(r),$("#comment-score-"+i).addClass(0===(n=r)?"score-neutral":n>0?"score-positive":"score-negative"),$("#comment-vote-up-"+i).addClass(s>0?"score-positive":"score-neutral"),$("#comment-vote-down-"+i).addClass(s<0?"score-negative":"score-neutral"),o.default.notice("Vote saved")})).fail((function(t){o.default.error(t.responseJSON.message)}))}};$(document).ready((function(){i.initialize_all()})),e.default=i},9347:function(t,e,n){"use strict";n.r(e);var a=n(2262),o=n(1850),i=n(3752);$((function(){$("#theme-switcher").change((function(t){var e=$(this).val();o.default.put("theme",e),$("body").attr("data-th-main",e)}));var t,e,n,r=o.default.get("theme")||"hexagon";$("body").attr("data-th-main",r),$("#theme-switcher").val(r),$("#hide-dmail-notice").on("click.danbooru",(function(t){var e=$("#dmail-notice");e.hide();var n=e.data("id");a.default.put("hide_dmail_notice",n),t.preventDefault()})),$("#close-notice-link").on("click.danbooru",(function(t){$("#notice").fadeOut("fast"),t.preventDefault()})),$(".revert-item-link").on("click",(function(t){t.preventDefault();var e=$(t.target),n=e.data("noun");if(confirm("Are you sure you want to revert ".concat(n," to this version?"))){var a=e.attr("href");$.ajax({method:"PUT",url:a,dataType:"json"}).done((function(t){location.reload()})).fail((function(t){i.default.error("Failed to revert to specified version.")}))}})),t=$("#searchform"),e=$("#search-form-show-link"),n=$("#search-form-hide-link"),t.length&&(e.on("click",(function(a){a.preventDefault(),t.fadeIn("fast"),e.hide(),n.show()})),n.on("click",(function(a){a.preventDefault(),t.fadeOut("fast"),e.show(),n.hide()})))})),window.submitInvisibleRecaptchaForm=function(){document.getElementById("signup-form").submit()}},2262:function(t,e,n){"use strict";n.r(e);var a=n(3752),o={put:function(t,e,n){var o="";if("session"!==n){n||(n=365);var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="expires="+i.toGMTString()+"; "}var r=t+"="+encodeURIComponent(e)+"; "+o+"path=/; SameSite=Lax";return document.cookie.length<4090-r.length?(document.cookie=r,!0):(a.default.error("You have too many cookies on this site. Consider deleting them all."),!1)},raw_get:function(t){for(var e=t+"=",n=document.cookie.split(";"),a=0;a=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw r}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n=i).attr("data-count",t)})),n.trigger("input.danbooru.formatter"),r.initialize_formatting_buttons(t),t.attr("data-initialized","true")},r.initialize_formatting_buttons=function(t){var e,n=$(".dtext-formatter-input",t),a=o($(".dtext-formatter-buttons a",t));try{var i=function(){var t=e.value,a=$(t),o=a.attr("data-content");a.off("click"),a.on("click",(function(t){t.preventDefault(),r.process_formatting(o,n)}))};for(a.s();!(e=a.n()).done;)i()}catch(s){a.e(s)}finally{a.f()}},r.process_formatting=function(t,e){var n=e.val()+"",a={start:e.prop("selectionStart"),end:e.prop("selectionEnd")},o=t.indexOf("%selection%"),i=t.length-(t.indexOf("%selection%")+11);t=t.replace(/%selection%/g,n.substring(a.start,a.end)),e.trigger("focus"),document.execCommand("insertText",!1,t)||e.val(n.substring(0,a.start)+t+n.substring(a.end,n.length)),e.prop("selectionStart",a.start+o),e.prop("selectionEnd",a.start+t.length-i),e.trigger("focus")},r.initialize_all_inputs=function(){$(".dtext-formatter[data-initialized='false']").each((function(t,e){r.initialze_input($(e))}))},$((function(){r.initialize_all_inputs()})),e.default=r},8087:function(t,e,n){"use strict";n.r(e);var a=n(801),o=n(3752),i=n(4584),r={initialize_actions:function(){$("#add-to-favorites, #add-fav-button").on("click",(function(t){t.preventDefault(),r.create($(t.target).closest(".button").data("pid"))})),$("#remove-from-favorites, #remove-fav-button").on("click",(function(t){t.preventDefault(),r.destroy($(t.target).closest(".button").data("pid"))}))},after_action:function(t,e){$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle(),$("#remove-fav-button").addClass("animate"),setTimeout((function(){$("#remove-fav-button").removeClass("animate")}),3e3);var n=$("#favcount-for-post-".concat(t)),a=parseInt(n.text(),10);n.text(a+e),$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true")},create:function(t){a.default.notice_update("inc"),i.SendQueue.add((function(){$.ajax({type:"POST",url:"/favorites.json",data:{post_id:t},dataType:"json"}).done((function(){a.default.notice_update("dec"),r.after_action(t,1),o.default.notice("Favorite added")})).fail((function(t,e,n){o.default.error("Error: "+t.responseJSON.message)}))}))},destroy:function(t){a.default.notice_update("inc"),i.SendQueue.add((function(){$.ajax({type:"DELETE",url:"/favorites/"+t+".json",dataType:"json"}).done((function(){a.default.notice_update("dec"),r.after_action(t,-1),o.default.notice("Favorite removed")})).fail((function(t,e,n){o.default.error("Error: "+t.responseJSON.message)}))}))}};$(r.initialize_actions),e.default=r},8162:function(t,e,n){"use strict";n.r(e);var a=n(3752),o={initialize_all:function(){$("#c-forum-topics #a-show,#c-forum-posts #a-show").length&&($(".edit_forum_post_link").on("click.danbooru",(function(t){var e=$(this).attr("id").match(/^edit_forum_post_link_(\d+)$/)[1];$("#edit_forum_post_"+e).fadeToggle("fast"),t.preventDefault()})),$(".edit_forum_topic_link").on("click.danbooru",(function(t){var e=$(this).attr("id").match(/^edit_forum_topic_link_(\d+)$/)[1];$("#edit_forum_topic_"+e).fadeToggle("fast"),t.preventDefault()})),$(".forum-post-reply-link").on("click",o.quote),$(".forum-post-hide-link").on("click",o.hide),$(".forum-post-unhide-link").on("click",o.unhide),$(".forum-vote-up").on("click",(function(t){return o.vote(t,1)})),$(".forum-vote-meh").on("click",(function(t){return o.vote(t,0)})),$(".forum-vote-down").on("click",(function(t){return o.vote(t,-1)})),$(document).on("click",".forum-vote-remove",o.vote_remove))},reinitialize_all:function(){$("#c-forum-topics #a-show,#c-forum-posts #a-show").length&&($(".edit_forum_post_link").off("click.danbooru"),$(".edit_forum_topic_link").off("click.danbooru"),$(".forum-post-reply-link").off("click"),$(".forum-post-hide-link").off("click"),$(".forum-post-unhide-link").off("click"),$(".forum-vote-up").off("click"),$(".forum-vote-meh").off("click"),$(".forum-vote-down").off("click"),$(document).off("click",".forum-vote-remove"),this.initialize_all())}};o.vote=function(t,e){t.preventDefault();var n=$(t.currentTarget).data("forum-id");$.ajax({url:"/forum_posts/".concat(n,"/votes.json"),type:"POST",dataType:"json",accept:"text/javascript",data:{"forum_post_vote[score]":e}}).done((function(t){var e,a,o,i,r;e=t,a={1:{fa_class:"fa-thumbs-up",e6_class:"up"},0:{fa_class:"fa-face-meh",e6_class:"meh"},"-1":{fa_class:"fa-thumbs-down",e6_class:"down"}},o=$("").attr("href","#").attr("data-forum-id",e.forum_post_id).addClass("forum-vote-remove").append($("").addClass("fa-regular").addClass(a[e.score.toString()].fa_class)),i=$("").attr("href","/users/".concat(e.creator_id)).text(e.creator_name),(r=$("
  • ").addClass("vote-score-".concat(a[e.score].e6_class)).addClass("own-forum-vote")).append(o).append(" ").append(i),$("#forum-post-votes-for-".concat(e.forum_post_id)).prepend(r),$("#forum-post-votes-for-".concat(n," .forum-post-vote-block")).hide()})).fail((function(t){var e;null!==t&&void 0!==t&&null!==(e=t.responseJSON)&&void 0!==e&&e.reason?a.default.error(t.responseJSON.reason):a.default.error("Failed to vote on forum post.")}))},o.vote_remove=function(t){t.preventDefault();var e=$(t.currentTarget).data("forum-id");$.ajax({url:"/forum_posts/".concat(e,"/votes.json"),type:"DELETE",dataType:"json",accept:"text/javascript"}).done((function(n){$(t.target).parents(".own-forum-vote").remove(),$("#forum-post-votes-for-".concat(e," .forum-post-vote-block")).show(),a.default.notice("Vote removed.")})).fail((function(t){a.default.error("Failed to unvote on forum post.")}))},o.quote=function(t){t.preventDefault();var e=$(t.target).parents("article.forum-post"),n=e.data("forum-post-id");$.ajax({url:"/forum_posts/".concat(n,".json"),type:"GET",dataType:"json",accept:"text/javascript"}).done((function(t){var n=t.body.replace(/\[quote\](?:.|\n|\r)+?\[\/quote\][\n\r]*/gm,"");n='[quote]"'.concat(e.data("creator"),'":/users/').concat(e.data("creator-id")," said:\n").concat(n,"\n[/quote]\n\n");var a=$("#forum_post_body_for_"),o=n;a.val().length>0&&(o=a.val()+"\n\n"+o),a.val(o),a.selectEnd(),$("#topic-response").show(),setTimeout((function(){$("#topic-response")[0].scrollIntoView()}),15)})).fail((function(t){a.default.error(t.responseText)}))},o.hide=function(t){if(t.preventDefault(),confirm("Are you sure you want to hide this post?")){var e=$(t.target).parents("article.forum-post").data("forum-post-id");$.ajax({url:"/forum_posts/".concat(e,"/hide.json"),type:"POST",dataType:"json"}).done((function(t){$('.forum-post[data-forum-post-id="'.concat(e,'"] div.author h4')).append(" (hidden)"),$('.forum-post[data-forum-post-id="'.concat(e,'"]')).attr("data-is-hidden","true")})).fail((function(t){a.default.error("Failed to hide post.")}))}},o.unhide=function(t){if(t.preventDefault(),confirm("Are you sure you want to unhide this post?")){var e=$(t.target).parents("article.forum-post").data("forum-post-id");$.ajax({url:"/forum_posts/".concat(e,"/unhide.json"),type:"POST",dataType:"json"}).done((function(t){var n=$('.forum-post[data-forum-post-id="'.concat(e,'"] div.author h4'));n.text(n.text().replace(" (hidden)","")),$('.forum-post[data-forum-post-id="'.concat(e,'"]')).attr("data-is-hidden","false")})).fail((function(t){a.default.error("Failed to unhide post.")}))}},$(document).ready((function(){o.initialize_all()})),e.default=o},4320:function(t,e,n){"use strict";n.r(e);var a=n(2262),o={init:function(){var t=$(".guest-warning");"seen"===a.default.get("gw")||$("#a-terms-of-service").length>0||(t.show(),$("#guest-warning-accept").on("click",(function(){a.default.put("gw","seen"),t.hide()})),$("#guest-warning-decline").on("click",(function(){a.default.put("gw","reject"),window.location.assign("https://www.google.com/")})))}};$(document).ready((function(){o.init()})),e.default=o},1850:function(t,e,n){"use strict";n.r(e);var a={put:function(t,e){localStorage[t]=e},putObject:function(t,e){this.put(t,JSON.stringify(e))},get:function(t){return localStorage[t]},getObject:function(t){var e=this.get(t);try{return JSON.parse(e)}catch(n){return null}}};e.default=a},7414:function(t,e,n){"use strict";n.r(e);var a=n(1850),o={current:0};function i(t){$("body").css("background-image","url("+t.background_url+")"),$("body").css("background-color",t.background_color),$(".mascotbox").css("background-image","url("+t.background_url+")"),$(".mascotbox").css("background-color",t.background_color);var e=$("").text("Mascot by ").append($("").text(t.artist_name).attr("href",t.artist_url));$("#mascot_artist").empty().append(e)}function r(){var t=window.mascots,e=Object.keys(t),n=e.indexOf(o.current);o.current=e[(n+1)%e.length],i(t[o.current]),a.default.put("mascot",o.current)}$((function(){$("#c-static > #a-home").length&&function(){$("#change-mascot").on("click",r);var t=window.mascots;if(o.current=a.default.get("mascot"),!t[o.current]){var e=Object.keys(t),n=Math.floor(Math.random()*e.length);o.current=e[n]}i(t[o.current])}()}))},3989:function(t,e,n){"use strict";n.r(e);var a=n(3752),o=n(801),i={detailed_rejection_dialog:function(){return $("#post_disapproval_post_id").val($(this).data("post-id")),$("#detailed-rejection-dialog").find("form")[0].reset(),a.default.dialog("Detailed Rejection","#detailed-rejection-dialog"),!1}};$((function(){$(document).on("click.danbooru",".quick-mod .detailed-rejection-link",i.detailed_rejection_dialog),$(".delete-with-reason-link").on("click",(function(t){t.preventDefault();var e=$(t.target).attr("data-post-id"),n=$(t.target).data("prompt"),a=$(t.target).data("reason");confirm("Delete post for ".concat(n,"?"))&&o.default.delete_with_reason(e,a,!0)}))})),e.default=i},910:function(t,e,n){"use strict";n.r(e);var a=n(1850),o={initialize:function(){if($("#news").length){var t=parseInt($("#news").data("id"),10);$("#news").on("click",(function(){$("#news").toggleClass("open")})),$("#news-closebutton").on("click",(function(){$("#news").hide(),a.default.put("hide_news_notice",t.toString())})),parseInt(a.default.get("hide_news_notice")||0,10)");e.addClass("note-box-inner-border"),e.css({opacity:.5});var n=$("
    ");return n.addClass("note-box"),n.data("id",String(t)),n.attr("data-id",String(t)),n.draggable({containment:$("#image"),stop:function(t,e){o.Box.update_data_attributes(n)}}),n.resizable({containment:$("#image"),handles:"se, nw",stop:function(t,e){o.Box.update_data_attributes(n)}}),n.css({position:"absolute"}),n.append(e),o.Box.bind_events(n),n},update_data_attributes:function(t){var e=$("#image"),n=$("#image-container"),a=e.width()/parseFloat(n.data("width")),o=parseFloat(t.css("left")),i=parseFloat(t.css("top")),r=parseFloat(t.css("width")),s=parseFloat(t.css("height"));o=parseInt(o/a),i=parseInt(i/a),r=parseInt(r/a),s=parseInt(s/a),t.data("x",o),t.data("y",i),t.data("width",r),t.data("height",s)},bind_events:function(t){t.on("dragstart.danbooru resizestart.danbooru",(function(t){$(t.currentTarget).find(".note-box-inner-border").addClass("unsaved"),o.dragging=!0,o.clear_timeouts(),o.Body.hide_all(),t.stopPropagation()})),t.on("resize.danbooru",(function(t){var e=$(t.currentTarget);o.Box.resize_inner_border(e),t.stopPropagation()})),t.on("dragstop.danbooru resizestop.danbooru",(function(t){o.dragging=!1,t.stopPropagation()})),t.on("mouseover.danbooru mouseout.danbooru",(function(t){if(!o.dragging){var e=$(this),n=$(t.currentTarget);"mouseover"===t.type?(o.Body.show(n.data("id")),o.editing&&(e.resizable("enable"),e.draggable("enable"))):"mouseout"===t.type&&(o.Body.hide(n.data("id")),o.editing&&(e.resizable("disable"),e.draggable("disable"))),t.stopPropagation()}}))},find:function(t){return $("#note-container div.note-box[data-id="+t+"]")},show_highlighted:function(t){var e=t.data("id");o.Body.show(e),$(".note-box-highlighted").removeClass("note-box-highlighted"),t.addClass("note-box-highlighted"),t[0].scrollIntoView(!1)},resize_inner_border:function(t){var e=t.find("div.note-box-inner-border");e.css({height:t.height()-2,width:t.width()-2}),e.width()>=t.width()-2&&t.width(e.width()+2),e.height()>=t.height()-2&&t.height(e.height()+2)},scale:function(t){var e=$("#image"),n=$("#image-container"),a=e.width()/parseFloat(n.data("width"));t.css({top:Math.ceil(parseFloat(t.data("y"))*a),left:Math.ceil(parseFloat(t.data("x"))*a),width:Math.max(5,Math.ceil(parseFloat(t.data("width"))*a)),height:Math.max(5,Math.ceil(parseFloat(t.data("height"))*a))}),o.Box.resize_inner_border(t)},scale_all:function(){var t=$("#note-container");0!==t.length&&(t.data("resizing",!0),$(".note-box").each((function(t,e){o.Box.scale($(e))})),t.data("resizing",!1))},toggle_all:function(){var t=$("#note-container");"hidden"===t.css("visibility")?t.css("visibility","visible"):t.css("visibility","hidden")}},Body:{create:function(t){var e=$("
    ");return e.addClass("note-body"),e.data("id",String(t)),e.attr("data-id",String(t)),e.hide(),o.Body.bind_events(e),e},initialize:function(t){var e=o.Box.find(t.data("id"));t.css({top:e.position().top+e.height()+5,left:e.position().left}),o.Body.bound_position(t)},bound_position:function(t){var e=$("#image"),n=e.offset().left+e.width();t.offset().left+t.width()>n&&t.css({left:t.position().left-10-(t.offset().left+t.width()-n)})},show:function(t){o.Body.hide_all(),o.clear_timeouts();var e=o.Body.find(t);e.data("resized")||(o.Body.resize(e),e.data("resized","true")),e.show(),o.Body.initialize(e)},find:function(t){return $("#note-container div.note-body[data-id="+t+"]")},hide:function(t){var e=o.Body.find(t);o.timeouts.push(setTimeout((function(){e.hide()}),350))},hide_all:function(){$("#note-container div.note-body").hide()},resize:function(t){t.css("min-width","");var e=t.width(),n=t.height(),a=1.6180339887,o=0,i=0,r=0,s=0;if(e/no)}else if(t[0].scrollWidth<=t.width()){r=20,s=e;do{i=(r+s)/2,t.css("min-width",i),t.height()>n?r=i:s=i}while(s-r>4);t.height()>n&&t.css("min-width",s)}},set_text:function(t,e,n){o.Body.display_text(t,n),o.Body.resize(t),o.Body.bound_position(t)},display_text:function(t,e){t.html(e)},bind_events:function(t){t.on("mouseover.danbooru",(function(t){var e=$(t.currentTarget);o.Body.show(e.data("id")),t.stopPropagation()})),t.on("mouseout.danbooru",(function(t){var e=$(t.currentTarget);o.Body.hide(e.data("id")),t.stopPropagation()})),"Anonymous"!==a.default.meta("current-user-name")?t.on("click.danbooru",(function(t){if("A"!==t.target.tagName){var e=$(t.currentTarget);o.Edit.show(e)}t.stopPropagation()})):t.on("click.danbooru",(function(t){"A"!==t.target.tagName&&a.default.error("You must be logged in to edit notes"),t.stopPropagation()}))}},Edit:{show:function(t){var e=t.data("id");if(!o.editing){$(".note-box").resizable("disable"),$(".note-box").draggable("disable");var n=$("");n.css({width:"97%",height:"92%",resize:"none"}),"Click to edit"!==t.html()&&n.val(t.data("original-body"));var a=$("
    ");a.append(n),a.data("id",e),a.dialog({width:360,height:210,position:{my:"right",at:"right-20",of:window},classes:{"ui-dialog":"note-edit-dialog"},title:"Edit note",buttons:{Save:o.Edit.save,Preview:o.Edit.preview,Cancel:o.Edit.cancel,Delete:o.Edit.destroy,History:o.Edit.history}}),a.data("uiDialog")._title=function(t){t.html(this.options.title)},a.dialog("option","title","Edit note #"+e+' (
    view help)'),a.on("dialogclose.danbooru",(function(){o.editing=!1,$(".note-box").resizable("enable"),$(".note-box").draggable("enable")})),n.selectEnd(),o.editing=!0}},parameterize_note:function(t,e){var n=$("#image"),o=$("#image-container"),i=parseInt(o.data("width")),r=parseInt(n.width())/i,s={note:{x:t.position().left/r,y:t.position().top/r,width:t.width()/r,height:t.height()/r,body:e.data("original-body")}};return t.data("id").match(/x/)&&(s.note.html_id=t.data("id"),s.note.post_id=a.default.meta("post-id")),s},error_handler:function(t,e,n){a.default.error("Error: "+(t.responseJSON.reason||t.responseJSON.reasons.join("; ")))},success_handler:function(t,e,n){var a=null;if(t.html_id){var i=o.Body.find(t.html_id);a=o.Box.find(t.html_id),i.data("id",String(t.id)).attr("data-id",t.id),a.data("id",String(t.id)).attr("data-id",t.id),a.find(".note-box-inner-border").removeClass("unsaved")}else(a=o.Box.find(t.id)).find(".note-box-inner-border").removeClass("unsaved")},save:function(){var t=$(this),e=t.find("textarea"),n=t.data("id"),a=o.Body.find(n),i=o.Box.find(n),r=e.val();a.data("original-body",r),o.Body.set_text(a,i,"Loading..."),$.get("/note_previews.json",{body:r}).then((function(t){o.Body.set_text(a,i,t.body),o.Box.resize_inner_border(i),a.show()})),t.dialog("close"),n.match(/\d/)?$.ajax("/notes/"+n+".json",{type:"PUT",data:o.Edit.parameterize_note(i,a),error:o.Edit.error_handler,success:o.Edit.success_handler}):$.ajax("/notes.json",{type:"POST",data:o.Edit.parameterize_note(i,a),error:o.Edit.error_handler,success:o.Edit.success_handler})},preview:function(){var t=$(this),e=t.find("textarea"),n=t.data("id"),a=o.Body.find(n),i=e.val(),r=o.Box.find(n);r.find(".note-box-inner-border").addClass("unsaved"),o.Body.set_text(a,r,"Loading..."),$.get("/note_previews.json",{body:i}).then((function(t){o.Body.set_text(a,r,t.body),a.show()}))},cancel:function(){$(this).dialog("close")},destroy:function(){if(confirm("Do you really want to delete this note?")){var t=$(this),e=t.data("id");e.match(/\d/)&&$.ajax("/notes/"+e+".json",{type:"DELETE",success:function(){o.Box.find(e).remove(),o.Body.find(e).remove(),t.dialog("close")}})}},history:function(){var t=$(this).data("id");t.match(/\d/)&&(window.location.href="/note_versions?search[note_id]="+t),$(this).dialog("close")}},TranslationMode:{active:!1,toggle:function(t){o.TranslationMode.active?o.TranslationMode.stop(t):o.TranslationMode.start(t)},start:function(t){t.preventDefault(),""!==a.default.meta("current-user-id")?o.TranslationMode.active||($("#image").css("cursor","crosshair"),o.TranslationMode.active=!0,$(document.body).addClass("mode-translation"),$("#original-file-link").click(),$("#image").off("click",o.Box.toggle_all),$("#image").on("mousedown.danbooru.note",o.TranslationMode.Drag.start),$(document).on("mouseup.danbooru.note",o.TranslationMode.Drag.stop),$("#mark-as-translated-section").show(),a.default.notice('Translation mode is on. Drag on the image to create notes. Turn translation mode off (shortcut is n).'),$("#notice a:contains(Turn translation mode off)").on("click.danbooru",o.TranslationMode.stop)):a.default.error("You must be logged in to edit notes")},stop:function(t){t.preventDefault(),o.TranslationMode.active=!1,$("#image").css("cursor","auto"),$("#image").on("click.danbooru",o.Box.toggle_all),$("#image").off("mousedown",o.TranslationMode.Drag.start),$(document).off("mouseup",o.TranslationMode.Drag.stop),$(document.body).removeClass("mode-translation"),$("#close-notice-link").click(),$("#mark-as-translated-section").hide()},create_note:function(t,e,n,a,i){var r=$("#image").offset();(a>9||i>9)&&(a<=9?a=10:i<=9&&(i=10),o.create(e-r.left,n-r.top,a,i)),$("#note-container").css("visibility","visible"),t.stopPropagation(),t.preventDefault()},Drag:{dragging:!1,dragStartX:0,dragStartY:0,dragDistanceX:0,dragDistanceY:0,x:0,y:0,w:0,h:0,start:function(t){1===t.which&&(t.preventDefault(),$(document).on("mousemove.danbooru",o.TranslationMode.Drag.drag),o.TranslationMode.Drag.dragStartX=t.pageX,o.TranslationMode.Drag.dragStartY=t.pageY)},drag:function(t){o.TranslationMode.Drag.dragDistanceX=t.pageX-o.TranslationMode.Drag.dragStartX,o.TranslationMode.Drag.dragDistanceY=t.pageY-o.TranslationMode.Drag.dragStartY;var e=$("#image"),n=e.offset(),a=e.width()-o.TranslationMode.Drag.dragStartX+n.left-1,i=n.left-o.TranslationMode.Drag.dragStartX,r=e.height()-o.TranslationMode.Drag.dragStartY+n.top-1,s=n.top-o.TranslationMode.Drag.dragStartY;o.TranslationMode.Drag.dragDistanceX>a?o.TranslationMode.Drag.dragDistanceX=a:o.TranslationMode.Drag.dragDistanceXr?o.TranslationMode.Drag.dragDistanceY=r:o.TranslationMode.Drag.dragDistanceY9&&Math.abs(o.TranslationMode.Drag.dragDistanceY)>9&&(o.TranslationMode.Drag.dragging=!0),o.TranslationMode.Drag.dragging&&(o.TranslationMode.Drag.dragDistanceX>=0?(o.TranslationMode.Drag.x=o.TranslationMode.Drag.dragStartX,o.TranslationMode.Drag.w=o.TranslationMode.Drag.dragDistanceX):(o.TranslationMode.Drag.x=o.TranslationMode.Drag.dragStartX+o.TranslationMode.Drag.dragDistanceX,o.TranslationMode.Drag.w=-o.TranslationMode.Drag.dragDistanceX),o.TranslationMode.Drag.dragDistanceY>=0?(o.TranslationMode.Drag.y=o.TranslationMode.Drag.dragStartY,o.TranslationMode.Drag.h=o.TranslationMode.Drag.dragDistanceY):(o.TranslationMode.Drag.y=o.TranslationMode.Drag.dragStartY+o.TranslationMode.Drag.dragDistanceY,o.TranslationMode.Drag.h=-o.TranslationMode.Drag.dragDistanceY),$("#note-preview").css({display:"block",left:o.TranslationMode.Drag.x+1,top:o.TranslationMode.Drag.y+1,width:o.TranslationMode.Drag.w-3,height:o.TranslationMode.Drag.h-3}))},stop:function(t){1===t.which&&0!==o.TranslationMode.Drag.dragStartX&&($(document).off("mousemove",o.TranslationMode.Drag.drag),o.TranslationMode.Drag.dragging?($("#note-preview").css({display:"none"}),o.TranslationMode.create_note(t,o.TranslationMode.Drag.x,o.TranslationMode.Drag.y,o.TranslationMode.Drag.w-1,o.TranslationMode.Drag.h-1),o.TranslationMode.Drag.dragging=!1):o.Box.toggle_all(),o.TranslationMode.Drag.dragStartX=0,o.TranslationMode.Drag.dragStartY=0)}}},id:"x",dragging:!1,editing:!1,timeouts:[],pending:{},add:function(t,e,n,a,i,r,s,c){var l=o.Box.create(e),d=o.Body.create(e);l.data("x",n),l.data("y",a),l.data("width",i),l.data("height",r),t.appendChild(l[0]),t.appendChild(d[0]),d.data("original-body",s),o.Box.scale(l),o.Body.display_text(d,c)},create:function(t,e,n,a){var i=o.Box.create(o.id),r=o.Body.create(o.id);i.css({top:e,left:t,width:n,height:a}),o.Box.update_data_attributes(i),i.find(".note-box-inner-border").addClass("unsaved"),r.html("Click to edit"),$("#note-container").append(i),$("#note-container").append(r),o.Box.resize_inner_border(i),o.id+="x"},clear_timeouts:function(){$.each(o.timeouts,(function(t,e){clearTimeout(e)})),o.timeouts=[]},load_all:function(){var t=document.createDocumentFragment();$.each($("#notes article"),(function(e,n){var a=$(n);o.add(t,a.data("id"),a.data("x"),a.data("y"),a.data("width"),a.data("height"),a.data("body"),a.html())})),$("#note-container").append(t)},initialize_all:function(){0===$("#c-posts #a-show #image").length||$("video#image").length||(o.load_all(),this.initialize_shortcuts(),this.initialize_highlight(),$(document).on("hashchange.danbooru.note",this.initialize_highlight))},initialize_shortcuts:function(){$("#translate").on("click.danbooru",o.TranslationMode.toggle),$("#image").on("click.danbooru",o.Box.toggle_all)},initialize_highlight:function(){var t=window.location.hash.match(/^#note-(\d+)$/);if(t){var e=o.Box.find(t[1]);o.Box.show_highlighted(e)}}};$((function(){o.initialize_all()})),e.default=o},1010:function(t,e,n){"use strict";n.r(e);var a={dialog_setup:!1,initialize_all:function(){$("#c-posts").length&&$("#a-show").length&&this.initialize_add_to_pool_link(),$("#c-pool-orders").length&&this.initialize_simple_edit()},initialize_add_to_pool_link:function(){$("#pool").on("click.danbooru",(function(t){a.dialog_setup||($("#add-to-pool-dialog").dialog({autoOpen:!1}),a.dialog_setup=!0),t.preventDefault(),$("#add-to-pool-dialog").dialog("open")})),$("#recent-pools li").on("click.danbooru",(function(t){t.preventDefault(),$("#pool_name").val($(this).attr("data-value"))}))},initialize_simple_edit:function(){$("#sortable").sortable({placeholder:"ui-state-placeholder"}),$("#sortable").disableSelection(),$("#ordering-form").submit((function(t){$.ajax({type:"put",url:t.target.action,data:$("#sortable").sortable("serialize")+"&"+$(t.target).serialize()}),t.preventDefault()}))}};$(document).ready((function(){a.initialize_all()})),e.default=a},4984:function(t,e,n){"use strict";function a(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,i=function(){};return{s:i,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw r}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n=0)})).each((function(t,e){var n=$(e);n.find("input[type=text]").on("input",(function(){n.trigger("e621:refresh")}))}));n.trigger("e621:refresh"),t.on("input",(function(){e=t.val()+"",n.trigger("e621:refresh")})),$("#delreason-clear").on("click",(function(){t.val("").trigger("input")}))}};$((function(){$("div#c-confirm-delete").length&&Danbooru.PostDeletion.init()})),e.default=i},2071:function(t,e,n){"use strict";n.r(e);var a=n(3752),o=n(1850),i=n(801),r=n(8087),s=n(5204),c=n(2769),l=n(4584),d=n(4258),u=n(9807),p={initialize:function(){($("#c-posts").length||$("#c-favorites").length||$("#c-pools").length)&&(this.initialize_selector(),this.initialize_preview_link(),this.initialize_edit_form(),this.initialize_tag_script_field(),this.initialize_shortcuts(),p.change())},initialize_shortcuts:function(){u.default.keydown("1 2 3 4 5 6 7 8 9 0","change_tag_script",p.change_tag_script)},show_notice:function(t){a.default.notice("Switched to tag script #"+t+". To switch tag scripts, use the number keys.")},change_tag_script:function(t){if("tag-script"===$("#mode-box-mode").val()){var e=o.default.get("current_tag_script_id")||"1",n=parseInt(t.key,10),a=o.default.get("tag-script-"+n);$("#tag-script-field").val(a),o.default.put("current_tag_script_id",n),e!==n&&p.show_notice(n),t.preventDefault()}},initialize_selector:function(){o.default.get("mode")?$("#mode-box-mode").val(o.default.get("mode")):(o.default.put("mode","view"),$("#mode-box-mode").val("view")),$("#mode-box-mode").on("change.danbooru",(function(t){p.change(),$("#tag-script-field:visible").focus().select()}))},initialize_preview_link:function(){$(".post-preview a").on("click.danbooru",p.click)},initialize_edit_form:function(){$("#quick-edit-div").hide(),$("#quick-edit-form input[value=Cancel]").on("click.danbooru",(function(t){p.close_edit_form(),t.preventDefault()})),$("#quick-edit-form").on("submit.danbooru",(function(t){$.ajax({type:"put",url:$("#quick-edit-form").attr("action"),data:{post:{tag_string:$("#post_tag_string").val()}},complete:function(){d.Z.enableElement(document.getElementById("quick-edit-form"))},success:function(t){i.default.update_data(t),a.default.notice("Post #"+t.post.id+" updated"),p.close_edit_form()}}),t.preventDefault()}))},close_edit_form:function(){u.default.disabled=!1,$("#quick-edit-div").slideUp("fast"),"true"===a.default.meta("enable-auto-complete")&&$("#post_tag_string").data("uiAutocomplete").close()},initialize_tag_script_field:function(){$("#tag-script-field").blur((function(t){var e=$(this).val(),n=o.default.get("current_tag_script_id");o.default.put("tag-script-"+n,e)}))},update_sets_menu:function(){var t=$("#set-id");t.off("change"),l.SendQueue.add((function(){$.ajax({type:"GET",url:"/post_sets/for_select.json"}).fail((function(t){$(window).trigger("danbooru:error","Error getting sets list: "+t.message)})).done((function(e){t.on("change",(function(t){o.default.put("set",t.target.value)})),t.empty();var n=o.default.get("set")||0;["Owned","Maintained"].forEach((function(a){var o=$("",{label:a});e[a].forEach((function(t){o.append($("",{label:a});e[a].forEach((function(t){o.append($("
    "}};$(document).ready((function(){$("#takedown-add-posts-ids-submit").on("click",(function(t){var e=$(t.target);o.add_posts_by_ids(e.data("tid"))})),$("#takedown-add-posts-tags-cancel").on("click",(function(){o.add_posts_by_tags_cancel()})),$("#takedown-add-posts-tags-confirm").on("click",(function(t){var e=$(t.target);o.add_posts_by_tags(e.data("tid"))})),$("#takedown-add-posts-tags-preview").on("click",(function(t){var e=$(t.target);o.add_posts_by_tags_preview(e.data("tid"))}))})),e.default=o},8217:function(t,e,n){"use strict";n.r(e);var a=n(336),o=n(1850),i={initialize:function(){var t=function(t){t.hasClass("thumb-placeholder-link")?t.removeClass("thumb-placeholder-link"):t.empty()},e=window.___deferred_posts||{},n=$(".post-thumb.placeholder, .thumb-placeholder-link"),i="1"===o.default.get("dab");$.each(n,(function(n,o){var r=$(o),s=r.data("id");if(s){var c=e[s];if(c){var l=0;$.each(a.default.entries,(function(t,e){a.default.postMatchObject(c,e)&&(e.hits+=1,l+=1)}));var d=$("
    "),u=!i&&l>0;for(var p in c)d.attr("data-"+p.replace(/_/g,"-"),c[p]);d.attr("class",u?"post-thumbnail blacklisted":"post-thumbnail"),r.hasClass("thumb-placeholder-link")&&d.addClass("dtext");var f=$("");f.attr("src",c.preview_url||"/images/deleted-preview.png"),f.attr({height:c.preview_url?c.preview_height:150,width:c.preview_url?c.preview_width:150,title:"Rating: ".concat(c.rating,"\r\nID: ").concat(c.id,"\r\nStatus: ").concat(c.status,"\r\nDate: ").concat(c.created_at,"\r\n\r\n").concat(c.tags),alt:c.tags,class:"post-thumbnail-img"});var g=$("");g.attr("href","/posts/".concat(c.id)),g.append(f),d.append(g),r.replaceWith(d)}else t(r)}else t(r)}))}};$(document).ready((function(){i.initialize(),$(window).on("e621:add_deferred_posts",(function(t,e){window.___deferred_posts=window.___deferred_posts||{},window.___deferred_posts=$.extend(window.___deferred_posts,e),i.initialize()})),$(document).on("thumbnails:apply",i.initialize)})),e.default=i},369:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return It}});var a=n(4346),o=n(1871),i=n(9858),r={class:"flex-grid-outer"},s={class:"col box-section",style:{flex:"2 0 0"}},c={class:"flex-grid border-bottom"},l=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label",for:"post_file"},"File"),(0,a.Uk)(),(0,a._)("div",{class:"hint"},[(0,a._)("a",{href:"/help/supported_filetypes"},"Supported Formats")])],-1),d={class:"col2"},u={class:"flex-grid border-bottom"},p=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label",for:"post_sources"},"Sources"),(0,a.Uk)(),(0,a._)("div",null,"You should include: A link to the artists page where this was obtained, and a link to the\n submission page where this image was obtained. No available source should ONLY be used if the\n content has never been posted online anywhere else.\n ")],-1),f={class:"col2"},g={class:"flex-grid border-bottom"},h=(0,a.uE)('
    Please don't use anonymous_artist or unknown_artist tags unless they fall under those definitions on the wiki.
    ',1),v={class:"col2"},m={class:"flex-grid border-bottom"},_=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label",for:"post_sex_tags"},"Characters"),(0,a.Uk)(),(0,a._)("div",null,"\n Select (and write in) all that apply. Character sex is based only on what is visible in the\n image.\n "),(0,a.Uk)(),(0,a._)("div",null,[(0,a._)("a",{href:"/wiki_pages/tag_what_you_see"},"\n Outside information or other images should not be used when deciding what tags are used.\n ")])],-1),b={class:"col2"},w={class:"flex-wrap"},y=(0,a._)("hr",null,null,-1),k={class:"flex-wrap"},x=(0,a._)("hr",null,null,-1),j={class:"flex-wrap"},T={class:"flex-grid border-bottom"},S=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Body Types and Species"),(0,a.Uk)(),(0,a._)("div",null,"One listed body type per visible character, listed options are mutually exclusive.")],-1),D={class:"col2"},U={class:"flex-wrap"},z={class:"flex-grid border-bottom"},C=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Contentious Content"),(0,a.Uk)(),(0,a._)("div",null,"\n Fetishes or subjects that other users may find extreme or objectionable.\n These allow users to find or blacklist content with ease. Make sure that you are tagging\n these upon initial upload.\n ")],-1),E={class:"col2"},A={class:"flex-grid border-bottom"},P=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Rating"),(0,a.Uk)(),(0,a._)("div",null,[(0,a.Uk)("Explicit tags include sex, pussy, penis, masturbation, fellatio, etc.\n ("),(0,a._)("a",{href:"/help/ratings",target:"_blank"},"help"),(0,a.Uk)(")\n ")])],-1),O={class:"col2"},M={key:0,class:"box-section sect_red"},R={class:"flex-grid come-together-now"},I=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label",for:"post_tags"},"Other Tags"),(0,a.Uk)(),(0,a._)("div",null,[(0,a.Uk)("\n Separate tags with spaces. ("),(0,a._)("a",{href:"/help/tags",target:"_blank"},"help"),(0,a.Uk)(")\n ")]),(0,a.Uk)(),(0,a._)("div",null,[(0,a._)("a",{href:"/wiki_pages/tag_what_you_see"},"\n Outside information or other images should not be used when deciding what tags are used.\n ")])],-1),L={class:"col2"},F={class:"box-section sect_red"},q={class:"related-tag-functions"},V={class:"flex-grid border-bottom over-me"},B={class:"flex-grid border-bottom"},N=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Parent Post ID")],-1),W={class:"col2"},Y={key:1,class:"flex-grid border-bottom"},G=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Locked Tags")],-1),H={class:"col2"},X={key:2,class:"flex-grid border-bottom"},J=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Lock Rating")],-1),Z={class:"col2"},Q={class:"flex-grid border-bottom"},K=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label",for:"post_description"},"Description")],-1),tt={class:"col2"},et={class:"dtext-formatter","data-editing":"true","data-initialized":"false"},nt=(0,a._)("div",{class:"dtext-formatter-tabs"},[(0,a._)("a",{"data-action":"edit",role:"tab"},"Write"),(0,a.Uk)(),(0,a._)("a",{"data-action":"show",role:"tab"},"Preview")],-1),at=(0,a._)("div",{class:"dtext-formatter-buttons",role:"toolbar"},[(0,a._)("a",{title:"Bold","data-content":"[b]%selection%[/b]"},[(0,a._)("i",{class:"fa-solid fa-bold"})]),(0,a.Uk)(),(0,a._)("a",{title:"Italics","data-content":"[i]%selection%[/i]"},[(0,a._)("i",{class:"fa-solid fa-italic"})]),(0,a.Uk)(),(0,a._)("a",{title:"Strikethrough","data-content":"[s]%selection%[/s]"},[(0,a._)("i",{class:"fa-solid fa-strikethrough"})]),(0,a.Uk)(),(0,a._)("a",{title:"Underline","data-content":"[u]%selection%[/u]"},[(0,a._)("i",{class:"fa-solid fa-underline"})]),(0,a.Uk)(),(0,a._)("span",{class:"spacer"}),(0,a.Uk)(),(0,a._)("a",{title:"Header","data-content":"h2.%selection%"},[(0,a._)("i",{class:"fa-solid fa-heading"})]),(0,a.Uk)(),(0,a._)("a",{title:"Spoiler","data-content":"[spoiler]%selection%[/spoiler]"},[(0,a._)("i",{class:"fa-solid fa-eye-slash"})]),(0,a.Uk)(),(0,a._)("a",{title:"Code","data-content":"[code]%selection%[/code]"},[(0,a._)("i",{class:"fa-solid fa-code"})]),(0,a.Uk)(),(0,a._)("a",{title:"Quote","data-content":"[quote]%selection%[/quote]"},[(0,a._)("i",{class:"fa-solid fa-quote-right"})])],-1),ot=(0,a._)("div",{class:"dtext-formatter-preview dtext-container"},null,-1),it=(0,a._)("div",{class:"dtext-formatter-charcount","data-limit":"50000","data-count":"0"},null,-1),rt=(0,a._)("span",{class:"hint"},[(0,a.Uk)("All text is formatted using "),(0,a._)("a",{href:"/help/dtext",target:"_blank",rel:"noopener",tabindex:"-1"},"DText")],-1),st={key:3,class:"flex-grid border-bottom"},ct=(0,a._)("div",{class:"col"},[(0,a._)("label",{class:"section-label"},"Upload as Pending"),(0,a.Uk)(),(0,a._)("div",null,"If you aren't sure if this particular post is up to the standards, checking this box will put it into the moderation queue.")],-1),lt={class:"col2"},dt={class:"flex-grid"},ut=(0,a._)("div",{class:"col"},null,-1),pt={class:"col2"},ft={class:"box-section sect_red"},gt={class:"box-section sect_green"},ht={class:"box-section sect_red"},vt=["href"],mt=["disabled"],_t={id:"preview-sidebar",class:"col box-section",style:{"margin-left":"10px",padding:"10px"}};var bt=n(351);var wt={props:["check","checks"],computed:{value:{get:function(){return void 0!==this.checks[this.tagName]&&this.checks[this.tagName]},set:function(t){this.$emit("set",this.tagName,t)}},tagName:function(){return this.check.tag||this.check.name.toLowerCase().replace(/ /g,"_")}}},yt=n(5007);var kt=(0,yt.Z)(wt,[["render",function(t,e,n,o,r,s){return(0,a.wg)(),(0,a.iD)("button",{class:(0,i.C_)(["toggle-button",{active:s.value}]),onClick:e[0]||(e[0]=function(t){return s.value=!s.value})},(0,i.zw)(n.check.name),3)}]]),$t=n(8155),xt=n(3877),jt=n(5344),Tt=n(110);function St(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return Dt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,r=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return r=t.done,t},e:function(t){s=!0,i=t},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw i}}}}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);ne.name?1:-1}function Pt(){if(!this.allowNavigate&&""!==this.uploadValue)return!0}var Ot={components:{sources:bt.Z,"image-checkbox":kt,"related-tags":$t.Z,"tag-preview":xt.Z,"file-preview":jt.Z,"file-input":Tt.Z},data:function(){var t={},e=function(e){"undefined"===typeof e.tag?t[e.name.toLowerCase().replace(" ","_")]=!0:t[e.tag]=!0};return Ut.forEach(e),zt.forEach(e),Ct.forEach(e),Et.forEach(e),{safe:window.uploaderSettings.safeSite,showErrors:!1,allowNavigate:!1,submitting:!1,previewData:{url:"",isVideo:!1},uploadValue:"",invalidUploadValue:!1,sourceWarning:!1,sources:[""],normalMode:!window.uploaderSettings.compactMode,checkboxes:{sex:Ut,pairing:zt,count:Ct,body:Et,selected:{},all:t},tagEntries:{character:"",sex:"",bodyType:"",theme:"",other:""},tagPreview:{loading:!1,show:!1,tags:[]},allowLockedTags:window.uploaderSettings.allowLockedTags,lockedTags:"",allowRatingLock:window.uploaderSettings.allowRatingLock,ratingLocked:!1,allowUploadAsPending:window.uploaderSettings.allowUploadAsPending,uploadAsPending:!1,relatedTags:[],lastRelatedCategoryId:void 0,loadingRelated:!1,parentID:"",description:"",rating:"",error:"",duplicateId:0}},mounted:function(){var t=this;window.onbeforeunload=Pt.bind(t);var e=new URLSearchParams(window.location.search),n=function(n,a){e.has(a)&&(t[n]=e.get(a))},a=function(n,a){e.has(a)&&(t[n]="true"===e.get(a))};n("parentID","parent"),n("description","description"),function(){if(e.has("tags")){var n,a=St(e.get("tags").split(" "));try{for(a.s();!(n=a.n()).done;){var o=n.value.trim();o&&t.pushTag(o,!0)}}catch(i){a.e(i)}finally{a.f()}}}(),e.has("sources")&&(t.sources=e.get("sources").split(",")),this.allowRatingLock&&a("ratingLocked","rating_locked"),this.allowLockedTags&&n("lockedTags","locked_tags"),this.allowUploadAsPending&&a("uploadAsPending","upload_as_pending")},methods:{setCheck:function(t,e){this.checkboxes.selected[t]=e},submit:function(){if(this.showErrors=!0,this.error="",!this.preventUpload&&!this.submitting){var t=this;this.submitting=!0;var e=new FormData;"string"===typeof this.uploadValue?e.append("upload[direct_url]",this.uploadValue):e.append("upload[file]",this.uploadValue),e.append("upload[tag_string]",this.tags),e.append("upload[rating]",this.rating),e.append("upload[source]",this.sources.join("\n")),e.append("upload[description]",this.description),e.append("upload[parent_id]",this.parentID),this.allowLockedTags&&e.append("upload[locked_tags]",this.lockedTags),this.allowRatingLock&&e.append("upload[locked_rating]",this.ratingLocked),this.allowUploadAsPending&&e.append("upload[as_pending]",this.uploadAsPending),jQuery.ajax("/uploads.json",{contentType:!1,processData:!1,method:"POST",type:"POST",data:e,success:function(e){t.submitting=!1,t.allowNavigate=!0,Danbooru.notice("Post uploaded successfully."),location.assign(e.location)},error:function(e){t.submitting=!1;var n=e.responseJSON;try{n&&"duplicate"===n.reason&&(t.duplicateId=n.post_id),n&&-1!==["duplicate","invalid"].indexOf(n.reason)?t.error=n.message:n&&n.message?t.error="Error: "+n.message:t.error="Error: "+n.reason}catch(a){t.error="Error: Unknown error! "+JSON.stringify(n)}}})}},pushTag:function(t,e){if(this.tagPreview.show=!1,"undefined"!==typeof this.checkboxes.all[t]&&this.normalMode)this.setCheck(t,e);else{var n=this.tagEntries.other?this.tagEntries.other.trim().split(" "):[],a=n.indexOf(t);if(e)-1===a&&n.push(t);else{if(-1===a)return;n.splice(a,1)}this.tagEntries.other=n.join(" ")+" "}},previewFinalTags:function(){if(!this.tagPreview.loading)if(this.tagPreview.show)this.tagPreview.show=!1;else{this.tagPreview.loading=!0,this.tagPreview.show=!0,this.tagPreview.tags=[];var t=this,e={tags:this.tags};jQuery.ajax("/tags/preview.json",{method:"POST",type:"POST",data:e,success:function(e){t.tagPreview.loading=!1,t.tagPreview.tags=e},error:function(e){t.tagPreview.loading=!1,t.tagPreview.tags=[],t.tagPreview.show=!1,Danbooru.error("Error loading tag preview "+e)}})}},findRelated:function(t){var e=this;if(!e.loadingRelated)if(e.relatedTags.length>0&&e.lastRelatedCategoryId===t)e.relatedTags=[];else{this.loadingRelated=!0,this.relatedTags=[];var n=function(){var t=e.$refs.otherTags;if(!t.hasOwnProperty("selectionStart"))return null;var n=t.selectionEnd-t.selectionStart;return n?t.value.substr(t.selectionStart,n):null}(),a=n?{query:n}:{query:this.tags};t&&(a.category_id=t),$.getJSON("/related_tag/bulk.json",a,(function(n){e.relatedTags=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&t[n].length&&e.push({title:"Related: "+n,tags:t[n].sort(At)});return e}(n),e.lastRelatedCategoryId=t})).always((function(){e.loadingRelated=!1}))}}},computed:{tags:function(){var t=this;return this.normalMode?Object.keys(this.checkboxes.selected).filter((function(e){return!0===t.checkboxes.selected[e]})).concat([this.tagEntries.other,this.tagEntries.sex,this.tagEntries.bodyType,this.tagEntries.theme,this.tagEntries.character]).join(" ").replace(","," ").trim().replace(/ +/g," "):this.tagEntries.other},tagsArray:function(){return this.tags.toLowerCase().split(" ")},tagCount:function(){return this.tags.split(" ").filter((function(t){return t})).length},notEnoughTags:function(){return this.tagCount<4},invalidRating:function(){return!this.rating},preventUpload:function(){return this.sourceWarning||this.notEnoughTags||this.invalidRating||this.invalidUploadValue},duplicatePath:function(){return"/posts/".concat(this.duplicateId)}}};const Mt=(0,yt.Z)(Ot,[["render",function(t,e,n,$,bt,wt){var yt=(0,a.up)("file-input"),kt=(0,a.up)("file-preview"),$t=(0,a.up)("sources"),xt=(0,a.up)("image-checkbox"),jt=(0,a.up)("tag-preview"),Tt=(0,a.up)("related-tags");return(0,a.wg)(),(0,a.iD)("div",r,[(0,a._)("div",s,[(0,a._)("div",c,[l,(0,a.Uk)(),(0,a._)("div",d,[(0,a.Wm)(yt,{onUploadValueChanged:e[0]||(e[0]=function(t){return bt.uploadValue=t}),onPreviewChanged:e[1]||(e[1]=function(t){return bt.previewData=t}),onInvalidUploadValueChanged:e[2]||(e[2]=function(t){return bt.invalidUploadValue=t})})])]),(0,a.Uk)(),(0,a.Wm)(kt,{classes:"box-section in-editor below-upload",data:bt.previewData},null,8,["data"]),(0,a.Uk)(),(0,a._)("div",u,[p,(0,a.Uk)(),(0,a._)("div",f,[(0,a.Wm)($t,{maxSources:10,showErrors:bt.showErrors,sources:bt.sources,"onUpdate:sources":e[3]||(e[3]=function(t){return bt.sources=t}),onSourceWarning:e[4]||(e[4]=function(t){return bt.sourceWarning=t})},null,8,["showErrors","sources"])])]),(0,a.Uk)(),bt.normalMode?((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[(0,a._)("div",g,[h,(0,a.Uk)(),(0,a._)("div",v,[(0,a._)("div",null,[(0,a.wy)((0,a._)("textarea",{class:"tag-textarea","onUpdate:modelValue":e[5]||(e[5]=function(t){return bt.tagEntries.character=t}),id:"post_characters",rows:"2",placeholder:"Ex: artist_name, unknown_artist, anonymous_artist etc.","data-autocomplete":"tag-edit"},null,512),[[o.nr,bt.tagEntries.character]])])])]),(0,a.Uk)(),(0,a._)("div",m,[_,(0,a.Uk)(),(0,a._)("div",b,[(0,a._)("div",w,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(bt.checkboxes.sex,(function(t){return(0,a.wg)(),(0,a.j4)(xt,{check:t,checks:bt.checkboxes.selected,onSet:wt.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.Uk)(),y,(0,a.Uk)(),(0,a._)("div",k,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(bt.checkboxes.count,(function(t){return(0,a.wg)(),(0,a.j4)(xt,{check:t,checks:bt.checkboxes.selected,onSet:wt.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.Uk)(),x,(0,a.Uk)(),(0,a._)("div",j,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(bt.checkboxes.pairing,(function(t){return(0,a.wg)(),(0,a.j4)(xt,{check:t,checks:bt.checkboxes.selected,onSet:wt.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.Uk)(),(0,a.wy)((0,a._)("textarea",{class:"tag-textarea",rows:"2","onUpdate:modelValue":e[6]||(e[6]=function(t){return bt.tagEntries.sex=t}),id:"post_sexes",placeholder:"Ex: character_name solo_focus etc.","data-autocomplete":"tag-edit"},null,512),[[o.nr,bt.tagEntries.sex]])])]),(0,a.Uk)(),(0,a._)("div",T,[S,(0,a.Uk)(),(0,a._)("div",D,[(0,a._)("div",U,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(bt.checkboxes.body,(function(t){return(0,a.wg)(),(0,a.j4)(xt,{check:t,checks:bt.checkboxes.selected,onSet:wt.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.Uk)(),(0,a.wy)((0,a._)("textarea",{class:"tag-textarea",rows:"2","onUpdate:modelValue":e[7]||(e[7]=function(t){return bt.tagEntries.bodyType=t}),id:"post_bodyTypes",placeholder:"Ex: bear dragon hyena rat newt etc.","data-autocomplete":"tag-edit"},null,512),[[o.nr,bt.tagEntries.bodyType]])])]),(0,a.Uk)(),(0,a._)("div",z,[C,(0,a.Uk)(),(0,a._)("div",E,[(0,a.wy)((0,a._)("textarea",{class:"tag-textarea","onUpdate:modelValue":e[8]||(e[8]=function(t){return bt.tagEntries.theme=t}),id:"post_themes",rows:"2","data-autocomplete":"tag-edit",placeholder:"Ex: young gore scat watersports diaper my_little_pony vore not_furry rape hyper etc."},null,512),[[o.nr,bt.tagEntries.theme]])])])],64)):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("div",A,[P,(0,a.Uk)(),(0,a._)("div",O,[bt.showErrors&&wt.invalidRating?((0,a.wg)(),(0,a.iD)("div",M,"\n You must select an appropriate rating for this image.\n ")):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("div",null,[bt.safe?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)(a.HY,{key:0},[(0,a._)("button",{class:(0,i.C_)(["toggle-button rating-e",{active:"e"===bt.rating}]),onClick:e[9]||(e[9]=function(t){return bt.rating="e"})},"\n Explicit\n ",2),(0,a.Uk)(),(0,a._)("button",{class:(0,i.C_)(["toggle-button rating-q",{active:"q"===bt.rating}]),onClick:e[10]||(e[10]=function(t){return bt.rating="q"})},"\n Questionable\n ",2)],64)),(0,a.Uk)(),(0,a._)("button",{class:(0,i.C_)(["toggle-button rating-s",{active:"s"===bt.rating}]),onClick:e[11]||(e[11]=function(t){return bt.rating="s"})},"Safe\n ",2)])])]),(0,a.Uk)(),(0,a._)("div",R,[I,(0,a.Uk)(),(0,a._)("div",L,[(0,a.Wm)(kt,{classes:"box-section in-editor",data:bt.previewData},null,8,["data"]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",F,[(0,a.Uk)("\n You must provide at least "),(0,a._)("b",null,(0,i.zw)(4-wt.tagCount),1),(0,a.Uk)(" more tags. Tags in other sections count\n towards this total.\n ")],512),[[o.F8,bt.showErrors&&wt.notEnoughTags]]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",null,[(0,a.wy)((0,a._)("textarea",{class:"tag-textarea",id:"post_tags","onUpdate:modelValue":e[12]||(e[12]=function(t){return bt.tagEntries.other=t}),rows:"5",ref:"otherTags","data-autocomplete":"tag-edit"},null,512),[[o.nr,bt.tagEntries.other]])],512),[[o.F8,!bt.tagPreview.show]]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",null,[(0,a.Wm)(jt,{tags:bt.tagPreview.tags,loading:bt.tagPreview.loading,onClose:wt.previewFinalTags},null,8,["tags","loading","onClose"])],512),[[o.F8,bt.tagPreview.show]]),(0,a.Uk)(),(0,a._)("div",q,[(0,a.Uk)("\n Related:\n "),(0,a._)("a",{href:"#",onClick:e[13]||(e[13]=(0,o.iM)((function(t){return wt.findRelated()}),["prevent"]))},"Tags"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[14]||(e[14]=(0,o.iM)((function(t){return wt.findRelated(1)}),["prevent"]))},"Artists"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[15]||(e[15]=(0,o.iM)((function(t){return wt.findRelated(3)}),["prevent"]))},"Copyrights"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[16]||(e[16]=(0,o.iM)((function(t){return wt.findRelated(4)}),["prevent"]))},"Characters"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[17]||(e[17]=(0,o.iM)((function(t){return wt.findRelated(5)}),["prevent"]))},"Species"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[18]||(e[18]=(0,o.iM)((function(t){return wt.findRelated(7)}),["prevent"]))},"Metatags"),(0,a.Uk)(" |\n "),(0,a._)("a",{href:"#",onClick:e[19]||(e[19]=(0,o.iM)((function(){return wt.previewFinalTags&&wt.previewFinalTags.apply(wt,arguments)}),["prevent"]))},"Preview Final Tags")])])]),(0,a.Uk)(),(0,a._)("div",V,[bt.relatedTags.length?((0,a.wg)(),(0,a.j4)(Tt,{key:0,tags:wt.tagsArray,related:bt.relatedTags,loading:bt.loadingRelated,onTagActive:wt.pushTag},null,8,["tags","related","loading","onTagActive"])):(0,a.kq)("",!0)]),(0,a.Uk)(),(0,a._)("div",B,[N,(0,a.Uk)(),(0,a._)("div",W,[(0,a.wy)((0,a._)("input",{"onUpdate:modelValue":e[20]||(e[20]=function(t){return bt.parentID=t}),placeholder:"Ex. 12345"},null,512),[[o.nr,bt.parentID,void 0,{number:!0}]])])]),(0,a.Uk)(),bt.allowLockedTags?((0,a.wg)(),(0,a.iD)("div",Y,[G,(0,a.Uk)(),(0,a._)("div",H,[(0,a.wy)((0,a._)("input",{type:"text","onUpdate:modelValue":e[21]||(e[21]=function(t){return bt.lockedTags=t}),"data-autocomplete":"tag-query"},null,512),[[o.nr,bt.lockedTags]])])])):(0,a.kq)("",!0),(0,a.Uk)(),bt.allowRatingLock?((0,a.wg)(),(0,a.iD)("div",X,[J,(0,a.Uk)(),(0,a._)("div",Z,[(0,a._)("label",null,[(0,a.wy)((0,a._)("input",{type:"checkbox","onUpdate:modelValue":e[22]||(e[22]=function(t){return bt.ratingLocked=t})},null,512),[[o.e8,bt.ratingLocked]]),(0,a.Uk)(" Lock Rating")])])])):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("div",Q,[K,(0,a.Uk)(),(0,a._)("div",tt,[(0,a._)("div",et,[nt,(0,a.Uk)(),at,(0,a.Uk)(),(0,a.wy)((0,a._)("textarea",{class:"dtext-formatter-input tag-textarea dtext",id:"post_description",rows:"10","onUpdate:modelValue":e[23]||(e[23]=function(t){return bt.description=t})},null,512),[[o.nr,bt.description]]),(0,a.Uk)(),ot,(0,a.Uk)(),it]),(0,a.Uk)(),rt])]),(0,a.Uk)(),bt.allowUploadAsPending?((0,a.wg)(),(0,a.iD)("div",st,[ct,(0,a.Uk)(),(0,a._)("div",lt,[(0,a._)("label",null,[(0,a.wy)((0,a._)("input",{type:"checkbox","onUpdate:modelValue":e[24]||(e[24]=function(t){return bt.uploadAsPending=t})},null,512),[[o.e8,bt.uploadAsPending]]),(0,a.Uk)(" Upload as Pending")])])])):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("div",dt,[ut,(0,a.Uk)(),(0,a._)("div",pt,[(0,a.wy)((0,a._)("div",ft,"\n Unmet requirements above prevent the submission of the post.\n ",512),[[o.F8,wt.preventUpload&&bt.showErrors]]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",gt,"\n Submitting your post, please wait.\n ",512),[[o.F8,bt.submitting]]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",{class:"box-section sect_red"},(0,i.zw)(bt.error),513),[[o.F8,bt.error]]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",ht,[(0,a.Uk)("\n Post is a duplicate of "),(0,a._)("a",{href:wt.duplicatePath},"post #"+(0,i.zw)(bt.duplicateId)+".",9,vt)],512),[[o.F8,bt.duplicateId]]),(0,a.Uk)(),(0,a._)("button",{onClick:e[25]||(e[25]=function(){return wt.submit&&wt.submit.apply(wt,arguments)}),disabled:bt.showErrors&&wt.preventUpload||bt.submitting,accesskey:"s"},(0,i.zw)(bt.submitting?"Uploading...":"Upload"),9,mt)])])]),(0,a.Uk)(),(0,a._)("div",_t,[(0,a.Wm)(kt,{classes:"in-sidebar",data:bt.previewData},null,8,["data"])])])}]]);var Rt=Mt,It={init:function(){(0,o.ri)(Rt).mount("#uploader")}}},8555:function(t,e,n){"use strict";n.r(e);var a=n(5153),o=n(8261),i=n(9561),r=n(8162),s=n(3752);function c(t,e){for(var n=0;n0&&e.length>0;)t[0]e[0]||n.push(t.shift()),e.shift());return n},o.regexp_escape=function(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},$.fn.selectEnd=function(){return this.each((function(){this.focus(),this.setSelectionRange(this.value.length,this.value.length)}))},$((function(){$(window).on("danbooru:notice",(function(t,e){o.notice(e)})),$(window).on("danbooru:error",(function(t,e){o.error(e)}))})),e.default=o},9324:function(t,e,n){"use strict";n.r(e);var a=n(3752);function o(t,e){for(var n=0;ntbody>tr.selected").map((function(){return $(this).attr("id").substr(1)})).get()}},{key:"lockVotes",value:function(){var t=this,e=this.selectedVotes();e.length&&$.ajax({url:"/".concat(this._type,"_votes/lock.json"),method:"post",data:{ids:e.join(",")}}).done((function(){a.default.notice("".concat(t._type," votes locked."))}))}},{key:"deleteVotes",value:function(){var t=this,e=this.selectedVotes();e.length&&$.ajax({url:"/".concat(this._type,"_votes/delete.json"),method:"post",data:{ids:e.join(",")}}).done((function(){a.default.notice("".concat(t._type," votes deleted."))}))}}])&&o(e.prototype,n),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.default=r},5773:function(t,e,n){"use strict";n.r(e);var a=n(3752),o={METATAGS:["md5","order","limit","child","randseed","ratinglocked","notelocked","statuslocked","id","filetype","type","rating","description","parent","user","user_id","approver","flagger","deletedby","delreason","source","status","pool","set","fav","favoritedby","note","locked","upvote","votedup","downvote","voteddown","voted","width","height","mpixels","ratio","filesize","duration","score","favcount","date","age","change","tagcount","commenter","comm","noter","noteupdater","gentags","arttags","copytags","chartags","spectags","invtags","metatags","lortags","comment_count","hassource","hasdescription","isparent","ischild","inpool","pending_replacements"],TAG_CATEGORIES:{general:0,gen:0,artist:1,art:1,copyright:3,copy:3,co:3,character:4,char:4,ch:4,oc:4,species:5,spec:5,invalid:6,inv:6,meta:7,lore:8,lor:8},ORDER_METATAGS:["id","id_desc","score","score_asc","favcount","favcount_asc","created_at","created_at_asc","updated","updated_desc","updated_asc","comment","comment_asc","comment_bumped","comment_bumped_asc","note","note_asc","mpixels","mpixels_asc","portrait","landscape","filesize","filesize_asc","tagcount","tagcount_asc","change","change_desc","change_asc","duration","duration_desc","duration_asc","rank","random","comment_count","gentags","gentags_asc","arttags","arttags_asc","copytags","copytags_asc","chartags","chartags_asc","spectags","spectags_asc","invtags","invtags_asc","metatags","metatags_asc","lortags","lortags_asc"]};o.TAG_PREFIXES="-|~|"+Object.keys(o.TAG_CATEGORIES).map((function(t){return t+":"})).join("|"),o.TAG_PREFIXES_REGEX=new RegExp("^("+o.TAG_PREFIXES+")(.*)$","i"),o.METATAGS_REGEX=new RegExp("^("+o.METATAGS.join("|")+"):(.*)$","i"),o.initialize_all=function(){"true"===a.default.meta("enable-auto-complete")&&($.widget("ui.autocomplete",$.ui.autocomplete,{options:{delay:225,minLength:3,autoFocus:!1,focus:function(){return!1}},_create:function(){this.element.on("keydown.Autocomplete.tab",null,"tab",o.on_tab),this._super()},_renderItem:o.render_item}),this.initialize_tag_autocomplete(),this.initialize_artist_autocomplete($('[data-autocomplete="artist"]')),this.initialize_pool_autocomplete($('[data-autocomplete="pool"]')),this.initialize_user_autocomplete($('[data-autocomplete="user"]')),this.initialize_wiki_autocomplete($('[data-autocomplete="wiki-page"]')))},o.initialize_tag_autocomplete=function(){var t=$('[data-autocomplete="tag-query"], [data-autocomplete="tag-edit"]'),e=$('[data-autocomplete="tag"]');t.autocomplete({search:function(){$(this).data("ui-autocomplete")&&($(this).data("ui-autocomplete").menu.bindings=$())},select:function(t,e){return"Enter"===t.key&&t.stopImmediatePropagation(),o.insert_completion(this,e.item.value),!1},source:function(t,e){var n=o.parse_query(t.term,this.element.get(0).selectionStart),a=n.metatag,i=n.term;if(a||i)switch(a){case"md5":case"width":case"height":case"mpixels":case"ratio":case"score":case"duration":case"favcount":case"filesize":case"source":case"id":case"date":case"age":case"limit":case"tagcount":case"gentags":case"arttags":case"copytags":case"chartags":case"spectags":case"invtags":case"metatags":case"lortags":return void e([]);case"order":case"status":case"rating":case"locked":case"child":case"parent":case"filetype":case"type":case"disapproval":return void o.static_metatag_source(i,e,a);case"user":case"approver":case"commenter":case"comm":case"noter":case"noteupdater":case"fav":case"favoritedby":case"flagger":case"upvote":case"downvote":o.user_source(i,e,a+":");break;case"pool":o.pool_source(i,e,a);break;default:o.normal_source(i,e)}else this.close()}}),e.autocomplete({search:function(){$(this).data("ui-autocomplete").menu.bindings=$()},source:function(t,e){o.normal_source(t.term,e)}})},o.initialize_artist_autocomplete=function(t){t.autocomplete({search:function(){$(this).data("ui-autocomplete").menu.bindings=$()},source:function(t,e){o.artist_source(t.term,e)}})},o.initialize_pool_autocomplete=function(t){t.autocomplete({search:function(){$(this).data("ui-autocomplete").menu.bindings=$()},source:function(t,e){o.pool_source(t.term,e)}})},o.initialize_user_autocomplete=function(t){t.autocomplete({search:function(){$(this).data("ui-autocomplete").menu.bindings=$()},source:function(t,e){o.user_source(t.term,e,"")}})},o.initialize_wiki_autocomplete=function(t){t.autocomplete({search:function(){$(this).data("ui-autocomplete").menu.bindings=$()},source:function(t,e){o.wiki_source(t.term,e)}})},o.parse_query=function(t,e){var n="",a="",i=t.substring(0,e).match(/\S+$/g);return i?((i=(a=i[0]).match(o.TAG_PREFIXES_REGEX))&&(n=i[1].toLowerCase(),a=i[2]),(i=a.match(o.METATAGS_REGEX))&&(n=i[1].toLowerCase(),a=i[2]),{metatag:n,term:a}):{}},o.insert_completion=function(t,e){var n=t.value.substring(0,t.selectionStart).trim(),a=t.value.substring(t.selectionStart).trim(),i=new RegExp("("+o.TAG_PREFIXES+")?\\S+$","g");n=n.replace(i,"$1")+e,(0===a.length||0!==a.length&&!a.startsWith(" "))&&(n+=" "),t.value=n+a,t.selectionStart=n.length,t.selectionEnd=n.length;var r=new Event("input",{bubbles:!0});t.dispatchEvent(r)},o.on_tab=function(t){var e=$(this).autocomplete("instance"),n=e.menu.element;if(n.is(":visible")){if(0===n.has(".ui-state-active").length){var a=n.find(".ui-menu-item").first().data().uiAutocompleteItem.value;o.insert_completion(this,a),e.close()}t.preventDefault()}},o.render_item=function(t,e){var n=$("");if(n.text(e.label),n.attr("href",o.get_href(e)),n.on("click.danbooru",(function(t){t.preventDefault()})),e.antecedent){var i=e.antecedent.replace(/_/g," "),r=$("").text(" \u2192 ").addClass("autocomplete-arrow"),s=$("").text(i).addClass("autocomplete-antecedent");n.prepend([s,r])}if(void 0!==e.post_count){var c=e.post_count;c>=1e3&&(c=Math.floor(c/1e3)+"k");var l=$("").addClass("post-count").css("float","right").text(c);n.append(l)}if("tag"===e.type)n.addClass("tag-type-"+e.category);else if("user"===e.type){var d="user-"+e.level.replaceAll(" ","-").toLowerCase();n.addClass(d),"true"===a.default.meta("style-usernames")&&n.addClass("with-style")}else"pool"===e.type&&n.addClass("pool-category-"+e.category);var u=$("
    ").append(n),p=$("
  • ").data("item.autocomplete",e).append(u);return["id","type","source","antecedent","value","category","post_count","weight"].forEach((function(t){p.attr("data-autocomplete-".concat(t.replace(/_/g,"-")),e[t])})),p.appendTo(t)},o.get_href=function(t){switch(t.type){case"user":return"/users/"+t.id;case"pool":return"/pools/"+t.id;case"artist":return"/artists/"+t.id;case"wiki_page":return"/wiki_pages/"+t.id;default:return"/posts?tags="+encodeURIComponent(t.value)}},o.normal_source=function(t,e){if(!(t.length<3))return $.ajax({url:"/tags/autocomplete.json",data:{"search[name_matches]":t,expiry:7},method:"get",success:function(t){var n=$.map(t,(function(t){return{id:t.id,type:"tag",label:t.name.replace(/_/g," "),antecedent:t.antecedent_name,value:t.name,category:t.category,source:t.source,weight:t.weight,post_count:t.post_count}}));e(n)}})},o.static_metatags={order:o.ORDER_METATAGS,status:["any","deleted","active","pending","flagged","modqueue"],rating:["safe","questionable","explicit"],locked:["rating","note","status"],child:["any","none"],parent:["any","none"],filetype:["jpg","png","gif","swf","webm","mp4"],type:["jpg","png","gif","swf","webm","mp4"]},o.static_metatag_source=function(t,e,n){var a=this.static_metatags[n].filter((function(e){return e.startsWith(t.toLowerCase())}));e(a=a.map((function(t){return"".concat(n,":").concat(t)})).sort().slice(0,10))},o.user_source=function(t,e,n){return $.ajax({url:"/users.json",data:{"search[order]":"post_upload_count","search[name_matches]":t+"*",limit:10},method:"get",success:function(t){e($.map(t,(function(t){return{id:t.id,type:"user",label:t.name.replace(/_/g," "),value:n+t.name,level:t.level_string}})))}})},o.pool_source=function(t,e,n){return $.ajax({url:"/pools.json",data:{"search[order]":"post_count","search[name_matches]":t,limit:10},method:"get",success:function(t){e($.map(t,(function(t){return{id:t.id,type:"pool",label:t.name.replace(/_/g," "),value:n?n+":"+t.name:t.name,post_count:t.post_count,category:t.category}})))}})},o.artist_source=function(t,e){return $.ajax({url:"/artists.json",data:{"search[name]":t.trim().replace(/\s+/g,"_")+"*","search[is_active]":!0,"search[order]":"post_count",limit:10,expiry:7},method:"get",success:function(t){e($.map(t,(function(t){return{id:t.id,type:"artist",label:t.name.replace(/_/g," "),value:t.name,category:o.TAG_CATEGORIES.artist}})))}})},o.wiki_source=function(t,e){return $.ajax({url:"/wiki_pages.json",data:{"search[title]":t+"*","search[hide_deleted]":"Yes","search[order]":"post_count",limit:10,expiry:7},method:"get",success:function(t){e($.map(t,(function(t){return{id:t.id,type:"wiki_page",label:t.title.replace(/_/g," "),value:t.title,category:t.category_id}})))}})},$(document).ready((function(){o.initialize_all()})),e.default=o},9769:function(t,e,n){"use strict";n.r(e)},110:function(t,e,n){"use strict";n.d(e,{Z:function(){return k}});var a=n(4346),o=n(9858),i=n(1871),r={key:0},s={key:0,class:"box-section sect_red"},c=(0,a._)("br",null,null,-1),l=(0,a._)("a",{href:"/help/supported_filetypes"},"the Supported Formats",-1),d=["disabled"],u={key:1},p={key:0,class:"box-section sect_red"},f=(0,a._)("br",null,null,-1),g=(0,a._)("a",{href:"/wiki_pages/howto:sites_and_sources"},"the sourcing guide",-1),h=["disabled"],v={key:0},m={key:1},_={key:0},b=(0,a._)("a",{href:"/upload_whitelists"},"View whitelisted domains",-1);var w={data:function(){return{whitelist:{visible:!1,allowed:!1,reason:"",domain:"",oldDomain:""},uploadURL:new URLSearchParams(window.location.search).get("upload_url")||"",fileTooLarge:!1,maxFileSize:window.uploaderSettings.maxFileSize,disableFileUpload:!1,disableURLUpload:!1}},computed:{directURLProblem:function(){return this.directURLCheck(this.uploadURL)},badDirectURL:function(){return!!this.directURLProblem},invalidUploadValue:function(){return this.badDirectURL||this.fileTooLarge}},watch:{uploadURL:{immediate:!0,handler:function(){this.fileTooLarge=!1,this.uploadValueChanged(this.uploadURL),this.updatePreviewURL()}},invalidUploadValue:function(){this.$emit("invalidUploadValueChanged",this.invalidUploadValue)}},methods:{whitelistWarning:function(t,e,n){this.whitelist.allowed=t,this.whitelist.domain=e,this.whitelist.reason=n,this.whitelist.visible=!0},clearWhitelistWarning:function(){this.whitelist.visible=!1,this.whitelist.domain=""},directURLCheck:function(t){for(var e=0,n=[{reason:"Thumbnail URL",test:/[at]\.(facdn|furaffinity)\.net/gi},{reason:"Sample URL",test:/pximg\.net.*\/img-master\//gi},{reason:"Sample URL",test:/d3gz42uwgl1r1y\.cloudfront\.net\/.*\/\d+x\d+\./gi},{reason:"Sample URL",test:/pbs\.twimg\.com\/media\/[\w\-_]+\.(jpg|png)(:large)?$/gi},{reason:"Sample URL",test:/pbs\.twimg\.com\/media\/[\w\-_]+\?format=(jpg|png)(?!&name=orig)/gi},{reason:"Sample URL",test:/derpicdn\.net\/.*\/large\./gi},{reason:"Sample URL",test:/metapix\.net\/files\/(preview|screen)\//gi},{reason:"Sample URL",test:/sofurryfiles\.com\/std\/preview/gi}];e").prop("href",this.uploadURL).prop("hostname");if(n&&n!==this.whitelist.oldDomain?$.getJSON("/upload_whitelists/is_allowed.json",{url:this.uploadURL},(function(t){t.domain&&(e.whitelistWarning(t.is_allowed,t.domain,t.reason),t.is_allowed||e.setEmptyThumb())})):n||(this.clearWhitelistWarning(),this.setEmptyThumb()),this.whitelist.oldDomain=n,/^(https?\:\/\/|www).*?$/.test(this.uploadURL)){var a=/^(https?\:\/\/|www).*?\.(webm)$/.test(this.uploadURL);this.previewChanged(this.uploadURL,a)}else this.setEmptyThumb()},updatePreviewFile:function(){var t=this.$refs.post_file.files[0];this.fileTooLarge=t.size>this.maxFileSize;var e=URL.createObjectURL(t);this.disableURLUpload=!0,this.uploadValueChanged(t),this.previewChanged(e,"video/webm"===t.type)},uploadValueChanged:function(t){this.$emit("uploadValueChanged",t)},setEmptyThumb:function(){this.previewChanged("",!1)},previewChanged:function(t,e){this.$emit("previewChanged",{url:t,isVideo:e})}}};const y=(0,n(5007).Z)(w,[["render",function(t,e,n,w,y,k){return(0,a.wg)(),(0,a.iD)("span",null,[y.disableFileUpload?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",r,[y.fileTooLarge?((0,a.wg)(),(0,a.iD)("div",s,[(0,a.Uk)("\n The file you are trying to upload is too large. Maximum allowed is "+(0,o.zw)(this.maxFileSize/1048576)+" MiB.",1),c,(0,a.Uk)("\n Check out "),l,(0,a.Uk)(" for more information.\n ")])):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("label",null,[(0,a.Uk)("File:\n "),(0,a._)("input",{type:"file",ref:"post_file",onChange:e[0]||(e[0]=function(){return k.updatePreviewFile&&k.updatePreviewFile.apply(k,arguments)}),accept:"image/png,image/apng,image/jpeg,image/gif,video/webm,.png,.apng,.jpg,.jpeg,.gif,.webm",disabled:y.disableFileUpload},null,40,d)]),(0,a.Uk)(),(0,a.wy)((0,a._)("button",{onClick:e[1]||(e[1]=(0,i.iM)((function(){return k.clearFileUpload&&k.clearFileUpload.apply(k,arguments)}),["prevent"]))},"Clear",512),[[i.F8,y.disableURLUpload]])])),(0,a.Uk)(),y.disableURLUpload?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",u,[k.badDirectURL?((0,a.wg)(),(0,a.iD)("div",p,[(0,a.Uk)("\n The direct URL entered has the following problem: "+(0,o.zw)(k.directURLProblem),1),f,(0,a.Uk)("\n You should review "),g,(0,a.Uk)(".\n ")])):(0,a.kq)("",!0),(0,a.Uk)(),(0,a._)("label",null,[(0,a.Uk)((0,o.zw)(y.disableFileUpload?"":"(or) ")+"URL:\n ",1),(0,a.wy)((0,a._)("input",{type:"text",size:"50","onUpdate:modelValue":e[2]||(e[2]=function(t){return y.uploadURL=t}),disabled:y.disableURLUpload},null,8,h),[[i.nr,y.uploadURL]])]),(0,a.Uk)(),(0,a.wy)((0,a._)("div",{id:"whitelist-warning",class:(0,o.C_)({"whitelist-warning-allowed":y.whitelist.allowed,"whitelist-warning-disallowed":!y.whitelist.allowed})},[y.whitelist.allowed?((0,a.wg)(),(0,a.iD)("span",v,[(0,a.Uk)("Uploads from "),(0,a._)("b",null,(0,o.zw)(y.whitelist.domain),1),(0,a.Uk)(" are permitted.")])):(0,a.kq)("",!0),(0,a.Uk)(),y.whitelist.allowed?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("span",m,[(0,a.Uk)("Uploads from "),(0,a._)("b",null,(0,o.zw)(y.whitelist.domain),1),(0,a.Uk)(" are not permitted.\n "),y.whitelist.reason?((0,a.wg)(),(0,a.iD)("span",_,"Reason given: "+(0,o.zw)(y.whitelist.reason),1)):(0,a.kq)("",!0),(0,a.Uk)("\n ("),b,(0,a.Uk)(")")]))],2),[[i.F8,y.whitelist.visible]])]))])}]]);var k=y},5344:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var a=n(4346),o=n(9858),i=n(1871),r={class:"box-section sect_red"},s={key:0},c={class:"upload_preview_dims"},l=["src"],d=["src"],u={key:1,class:"preview-fail box-section sect_yellow"},p=(0,a._)("p",null,"The preview for this file failed to load. Please, double check that the URL you provided is correct.",-1);var f={props:{classes:String,data:{validator:function(t){return"boolean"===typeof t.isVideo&&"string"===typeof t.url}}},data:function(){return{heigth:0,width:0,overDims:!1,failed:!1}},computed:{previewDimensions:function(){return this.width>1&&this.height>1?this.width+"\xd7"+this.height:""},finalPreviewUrl:function(){return""===this.data.url?"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==":this.data.url}},watch:{data:function(){this.resetFilePreview()}},methods:{updateDimensions:function(t){var e=t.target;this.height=e.naturalHeight||e.videoHeight,this.width=e.naturalWidth||e.videoWidth,this.overDims=this.height>15e3||this.width>15e3},resetFilePreview:function(){this.overDims=!1,this.width=0,this.height=0,this.failed=!1},previewFailed:function(){this.failed=!0}}};var g=(0,n(5007).Z)(f,[["render",function(t,e,n,f,g,h){return(0,a.wg)(),(0,a.iD)("div",{class:(0,o.C_)(["upload_preview_container",n.classes])},[(0,a.wy)((0,a._)("div",r,"\n One of the image dimensions is above the maximum allowed of 15,000px and will fail to upload.\n ",512),[[i.F8,g.overDims]]),(0,a.Uk)(),g.failed?((0,a.wg)(),(0,a.iD)("div",u,[p,(0,a.Uk)("\n Note that some sites intentionally prevent images they host from being displayed on other sites. The file can still be uploaded despite that.\n ")])):((0,a.wg)(),(0,a.iD)("div",s,[(0,a._)("div",c,(0,o.zw)(h.previewDimensions),1),(0,a.Uk)(),n.data.isVideo?((0,a.wg)(),(0,a.iD)("video",{key:0,class:"upload_preview_img",controls:"",src:h.finalPreviewUrl,onLoadeddata:e[0]||(e[0]=function(t){return h.updateDimensions(t)}),onError:e[1]||(e[1]=function(t){return h.previewFailed()})},null,40,l)):((0,a.wg)(),(0,a.iD)("img",{key:1,class:"upload_preview_img",src:h.finalPreviewUrl,referrerpolicy:"no-referrer",onLoad:e[2]||(e[2]=function(t){return h.updateDimensions(t)}),onError:e[3]||(e[3]=function(t){return h.previewFailed()})},null,40,d))]))],2)}]])},8155:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var a=n(4346),o=n(9858),i=n(1871),r={class:"related-tags flex-wrap"},s={key:0,class:"related-title"},c=["href","onClick"];function l(t,e){return t.name>e.name?1:-1}var d={props:["tags","related","loading"],data:function(){return{uploaded:window.uploaderSettings.uploadTags||[],recent:(window.uploaderSettings.recentTags||[]).sort(l)}},methods:{toggle:function(t){this.$emit("tag-active",t.name,!this.tagActive(t))},tagLink:function(t){return"/wiki_pages/show_or_new?title="+encodeURIComponent(t.name)},tagActive:function(t){return-1!==this.tags.indexOf(t.name)},tagClasses:function(t){var e={"tag-active":this.tagActive(t)};return e["tag-type-"+t.category_id]=!0,e},splitTags:function(t){return function(t,e){for(var n=[],a=0;a0})).length;return!this.noSource&&0===t}},watch:{sourceWarning:{immediate:!0,handler:function(){this.$emit("sourceWarning",this.sourceWarning)}}}};var f=(0,d.Z)(p,[["render",function(t,e,n,c,l,d){var u=(0,a.up)("file-source");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.wy)((0,a._)("div",i,"\n A source must be provided or you must select that there is no available source.\n ",512),[[o.F8,n.showErrors&&d.sourceWarning]]),(0,a.Uk)(),l.noSource?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",r,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(n.sources,(function(t,e){return(0,a.wg)(),(0,a.j4)(u,{maxSources:n.maxSources,last:e===n.sources.length-1,index:e,modelValue:n.sources[e],"onUpdate:modelValue":function(t){return n.sources[e]=t},onDelete:function(t){return d.removeSource(e)},onAdd:d.addSource,key:e},null,8,["maxSources","last","index","modelValue","onUpdate:modelValue","onDelete","onAdd"])})),128))])),(0,a.Uk)(),(0,a._)("div",null,[(0,a._)("label",s,[(0,a.wy)((0,a._)("input",{type:"checkbox",id:"no_source","onUpdate:modelValue":e[0]||(e[0]=function(t){return l.noSource=t})},null,512),[[o.e8,l.noSource]]),(0,a.Uk)("\n No available source.\n ")])])],64)}]])},3877:function(t,e,n){"use strict";n.d(e,{Z:function(){return v}});var a=n(4346),o=n(1871),i={class:"related-tags flex-wrap"};var r={key:0,class:"tag-preview tag-preview-alias"},s={key:1,class:"tag-preview tag-preview-implication"},c={key:2,class:"tag-preview"};var l=n(9858),d=["href"];var u={props:["tagType","name"]},p=n(5007);var f={components:{"tag-link":(0,p.Z)(u,[["render",function(t,e,n,o,i,r){return(0,a.wg)(),(0,a.iD)("a",{class:(0,l.C_)("tag-type-"+n.tagType),href:"/wiki_pages/show_or_new?title="+n.name,target:"_blank"},(0,l.zw)(n.name),11,d)}]])},props:["tag"]};var g={props:["tags","loading"],components:{"tag-preview-tag":(0,p.Z)(f,[["render",function(t,e,n,o,i,l){var d=(0,a.up)("tag-link");return"alias"===n.tag.type?((0,a.wg)(),(0,a.iD)("span",r,[(0,a._)("del",null,[(0,a.Wm)(d,{name:n.tag.a,tagType:n.tag.tagTypeA},null,8,["name","tagType"])]),(0,a.Uk)("\n \u2192 "),(0,a.Wm)(d,{name:n.tag.b,tagType:n.tag.tagTypeB},null,8,["name","tagType"])])):"implication"===n.tag.type?((0,a.wg)(),(0,a.iD)("span",s,[(0,a.Wm)(d,{name:n.tag.a,tagType:n.tag.tagTypeA},null,8,["name","tagType"]),(0,a.Uk)("\n \u21d2 "),(0,a.Wm)(d,{name:n.tag.b,tagType:n.tag.tagTypeB},null,8,["name","tagType"])])):((0,a.wg)(),(0,a.iD)("span",c,[(0,a.Wm)(d,{name:n.tag.a,tagType:n.tag.tagTypeA},null,8,["name","tagType"])]))}]])},methods:{close:function(){this.$emit("close")}},computed:{splitTags:function(){var t=this.tags.concat([]);t.sort((function(t,e){return t.a===e.a?0:t.a=i)&&Object.keys(a.O).every((function(t){return a.O[t](n[c])}))?n.splice(c--,1):(s=!1,i0&&t[d-1][2]>i;d--)t[d]=t[d-1];t[d]=[n,o,i]},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.p="/packs/",function(){var t={34:0};a.O.j=function(e){return 0===t[e]};var e=function(e,n){var o,i,r=n[0],s=n[1],c=n[2],l=0;if(r.some((function(e){return 0!==t[e]}))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(c)var d=c(a)}for(e&&e(n);l