var Danbooru;!function(){var t,e={9958:function(t,e,n){var a={"./autocomplete.js.erb":8939,"./blacklists.js":2370,"./blips.js":956,"./comments.js":6616,"./common.js":4031,"./cookie.js":1728,"./dtext.js":1263,"./favorites.js":3233,"./forum_posts.js":2689,"./forum_topics.js":5472,"./guest_warning.js":4027,"./mascots.js":2388,"./mod_queue.js":9396,"./models/Filter.js":9309,"./models/PostCache.js":9855,"./news_updates.js":1028,"./notes.js":4177,"./pools.js":6211,"./post_delete.js":8924,"./post_mode_menu.js":9900,"./post_replacement.js":4319,"./post_sets.js":9182,"./post_versions.js":42,"./posts.js":8980,"./related_tag.js":1506,"./replacer.js":6512,"./responsive.js":356,"./send_queue.js":9840,"./shortcuts.js":7395,"./tag_relationships.js":4068,"./tag_script.js":5536,"./takedowns.js":2472,"./themes.js":3564,"./thumbnails.js":1111,"./uploader.js":7442,"./user_warning.js":7886,"./utility.js":5520,"./utility/filter_util.js":3692,"./utility/page.js":4596,"./utility/storage.js":7742,"./utility/storage_util.js":621,"./vote_manager.js":9186,"src/javascripts/autocomplete.js.erb":8939,"src/javascripts/blacklists.js":2370,"src/javascripts/blips.js":956,"src/javascripts/comments.js":6616,"src/javascripts/common.js":4031,"src/javascripts/cookie.js":1728,"src/javascripts/dtext.js":1263,"src/javascripts/favorites.js":3233,"src/javascripts/forum_posts.js":2689,"src/javascripts/forum_topics.js":5472,"src/javascripts/guest_warning.js":4027,"src/javascripts/mascots.js":2388,"src/javascripts/mod_queue.js":9396,"src/javascripts/models/Filter.js":9309,"src/javascripts/models/PostCache.js":9855,"src/javascripts/news_updates.js":1028,"src/javascripts/notes.js":4177,"src/javascripts/pools.js":6211,"src/javascripts/post_delete.js":8924,"src/javascripts/post_mode_menu.js":9900,"src/javascripts/post_replacement.js":4319,"src/javascripts/post_sets.js":9182,"src/javascripts/post_versions.js":42,"src/javascripts/posts.js":8980,"src/javascripts/related_tag.js":1506,"src/javascripts/replacer.js":6512,"src/javascripts/responsive.js":356,"src/javascripts/send_queue.js":9840,"src/javascripts/shortcuts.js":7395,"src/javascripts/tag_relationships.js":4068,"src/javascripts/tag_script.js":5536,"src/javascripts/takedowns.js":2472,"src/javascripts/themes.js":3564,"src/javascripts/thumbnails.js":1111,"src/javascripts/uploader.js":7442,"src/javascripts/user_warning.js":7886,"src/javascripts/utility.js":5520,"src/javascripts/utility/filter_util.js":3692,"src/javascripts/utility/page.js":4596,"src/javascripts/utility/storage.js":7742,"src/javascripts/utility/storage_util.js":621,"src/javascripts/vote_manager.js":9186};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=9958},6013:function(t,e,n){"use strict";n.r(e),n.d(e,{$:function(){return o.a},Autocomplete:function(){return r.default},Blacklist:function(){return s.default},Blip:function(){return l.default},Comment:function(){return c.default},DText:function(){return u.default},Note:function(){return d.default},Post:function(){return f.default},PostDeletion:function(){return p.default},PostModeMenu:function(){return g.default},PostReplacement:function(){return h.default},PostVersions:function(){return v.default},Replacer:function(){return m.default},Shortcuts:function(){return b.default},TagRelationships:function(){return _.default},Takedown:function(){return w.default},Theme:function(){return k.default},Thumbnails:function(){return x.default},Uploader:function(){return j.default},Utility:function(){return y.default},VoteManager:function(){return S.default},error:function(){return C},notice:function(){return D}});var a=n(2726),o=n.n(a),i=n(6519),r=n(8939),s=n(2370),l=n(956),c=n(6616),u=n(1263),d=n(4177),f=n(8980),p=n(8924),g=n(9900),h=n(4319),v=n(42),m=n(6512),b=n(7395),y=n(5520),_=n(4068),w=n(2472),k=n(3564),x=n(1111),j=n(7442),S=n(9186);i.A.start();var T;function C(t){$(window).trigger("danbooru:error",t)}function D(t){$(window).trigger("danbooru:notice",t)}n(789),n(97),n(8481),n(3574),n(1758),n(5285),n(8604),n(9460),n(8041),n(5081),n(2017),n(544),n(4245),n(1574),n(9542),n(3535),(T=n(9958)).keys().forEach(T),n(452)},2370:function(t,e,n){"use strict";n.r(e);var a=n(9309),o=n(9855),i=n(5520),r=n(7742);function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,o,i,r,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=i.call(n)).done)&&(s.push(a.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw o}}return s}}(t,e)||f(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){for(var n=0;n=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 f(t,e){if(t){if("string"===typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n").attr({name:"blacklisted-tags",content:"[]"}).appendTo("head")),$("body").data("user-is-anonymous")&&(g.isAnonymous=!0,t.attr("content",r.default.Blacklist.AnonymousBlacklist))},g.init_blacklist_editor=function(){var t=$(window).width(),e=$(window).height();$("#blacklist-edit-dialog").dialog({autoOpen:!1,width:t>400?400:t,height:e>400?400:e}),$("#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?/));g.isAnonymous?r.default.Blacklist.AnonymousBlacklist=e:$.ajax("/users/"+i.default.meta("current-user-id")+".json",{method:"PUT",data:{"user[blacklisted_tags]":t}}).done((function(){i.default.notice("Blacklist updated")})).fail((function(){i.default.error("Failed to update blacklist")})),$("#blacklist-edit-dialog").dialog("close"),$("meta[name=blacklisted-tags]").attr("content",e),g.regenerate_filters(),g.add_posts(o.default.sample()),g.update_visibility()})),$("#blacklist-edit-link").on("click",(function(t){t.preventDefault();var e=JSON.parse(i.default.meta("blacklisted-tags")||"[]");$("#blacklist-edit").val(e.join("\n")),$("#blacklist-edit-dialog").dialog("open")}))},g.init_reveal_on_click=function(){$("#c-posts #a-show").length&&$("#image-container").on("click",(function(t){$(t.currentTarget).removeClass("blacklisted")}))},g.regenerate_filters=function(){var t;g.filters={};try{t=JSON.parse(i.default.meta("blacklisted-tags")||"[]")}catch(p){console.error(p),t=[]}var e,n=d(t);try{for(n.s();!(e=n.n()).done;){var o=e.value,s=a.default.create(o);s&&(g.filters[s.text]=s)}}catch(h){n.e(h)}finally{n.f()}var l,c=Object.keys(g.filters),u=d(r.default.Blacklist.FilterState);try{for(u.s();!(l=u.n()).done;){var f=l.value;c.includes(f)||r.default.Blacklist.FilterState.delete(f)}}catch(h){u.e(h)}finally{u.f()}},g.init_comment_blacklist=function(){if("true"===i.default.meta("blacklist-users"))for(var t=0,e=Object.values(g.filters);t0))var t=$("#image-container[data-file-ext='webm']").on("blk:hide",(function(){var e=t.find("video");e.length&&e[0].pause()}))}));var h=function(){return t=function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$element=e,this.$counter=e.find(".blacklisted-count"),this.post=parseInt(e.attr("post")),this.hasPost=!Number.isNaN(this.post),e.attr("collapsed",r.default.Blacklist.Collapsed).find(".blacklist-header").on("click",(function(){var t="true"!==n.$element.attr("collapsed");n.$element.attr("collapsed",t),r.default.Blacklist.Collapsed=t})),this.$toggle=e.find(".blacklist-toggle-all").text("Disable All Filters").on("click",(function(){if("true"==n.$toggle.attr("is-enabling")){for(var t=0,e=Object.values(g.filters);t").attr("enabled",l.enabled).on("click",(function(){l.enabled=!l.enabled})).appendTo(t.$container),u=$("").attr("href","/posts?tags="+encodeURIComponent(r)).html(r.replace(/_/g,"​_").replace(/ -/," ‑")).on("click",(function(t){t.preventDefault()})).appendTo(c);$("").text(l.matchIDs.size).appendTo(u)},o=0,i=Object.entries(g.filters);o0)}}])&&l(t.prototype,e),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();e.default=g},956:function(t,e,n){"use strict";n.r(e);var a=n(5520),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},6616:function(t,e,n){"use strict";n.r(e);var a=n(1263),o=n(5520),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(){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(){$('.comment[data-comment-id="'.concat(e,'"] div.author h1')).append(" (hidden)"),$('.comment[data-comment-id="'.concat(e,'"]')).attr("data-is-deleted","true")})).fail((function(){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(){var t=$('.comment[data-comment-id="'.concat(e,'"] div.author h1'));t.text(t.text().replace(" (hidden)","")),$('.comment[data-comment-id="'.concat(e,'"]')).attr("data-is-deleted","false")})).fail((function(){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(){e.remove()})).fail((function(){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},4031:function(t,e,n){"use strict";n.r(e);var a=n(1728),o=n(5520),i=n(7742);$((function(){$("#theme-switcher").change((function(){var t=$(this).val();i.default.put("theme",t),$("body").attr("data-th-main",t)}));var t,e,n,r=i.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(){location.reload()})).fail((function(){o.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()}},1728:function(t,e,n){"use strict";n.r(e);var a=n(5520),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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n2&&void 0!==arguments[2]&&arguments[2],o=t.val().trim();if(!o)return e.text(""),void t.removeData("cache");if(t.data("cache")==o)return;t.data("cache",o),e.html("").attr("loading","true"),a.SendQueue.add((function(){$.ajax({type:"post",url:"/dtext_preview.json",dataType:"json",data:{body:o,allow_color:n},success:function(n){"true"===e.attr("loading")&&t.data("cache")===o&&(e.attr("loading","false").html(n.html),$(window).trigger("e621:add_deferred_posts",n.posts))},error:function(){e.attr("loading","false").text("Unable to fetch DText preview."),t.removeData("cache")}})}))}(n,e,i)):(t.attr("data-editing","true"),e.attr("loading","false"))}));var s=o.attr("data-limit")||0;n.on("input.danbooru.formatter",(function(){var t=(n.val()+"").length;o.toggleClass("overfill",t>=s).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},3233:function(t,e,n){"use strict";n.r(e);var a=n(8980),o=n(5520),i=n(9840),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){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){o.default.error("Error: "+t.responseJSON.message)}))}))}};$(r.initialize_actions),e.default=r},2689:function(t,e,n){"use strict";n.r(e);var a=n(5520),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(){$(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(){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(){$('.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(){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(){var t=$('.forum-post[data-forum-post-id="'.concat(e,'"] div.author h4'));t.text(t.text().replace(" (hidden)","")),$('.forum-post[data-forum-post-id="'.concat(e,'"]')).attr("data-is-hidden","false")})).fail((function(){a.default.error("Failed to unhide post.")}))}},$(document).ready((function(){o.initialize_all()})),e.default=o},5472:function(t,e,n){"use strict";n.r(e);var a={init_mark_all_as_read:function(){$("#subnav-mark-all-as-read-link").on("click.danbooru",(function(){return confirm("Are you sure that you want to mark all ".concat($("body").data("controller").replace(/-/g," ")," as read?"))}))}};$((function(){a.init_mark_all_as_read()})),e.default=a},4027:function(t,e,n){"use strict";n.r(e);var a=n(1728),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},2388:function(t,e,n){"use strict";n.r(e);var a=n(7742),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.Site.Mascot=o.current}$((function(){$("#c-static > #a-home").length&&function(){$("#change-mascot").on("click",r);var t=window.mascots;if(o.current=a.default.Site.Mascot,!t[o.current]){var e=Object.keys(t),n=Math.floor(Math.random()*e.length);o.current=e[n]}i(t[o.current])}()}))},9396:function(t,e,n){"use strict";n.r(e);var a=n(5520),o=n(8980),i=n(7742),r={detailed_rejection_dialog:function(){var t=$(this).data("post-id");return $("#post_disapproval_post_id").val(t),$("#detailed-rejection-dialog").find("form")[0].reset(),$("#new_post_disapproval").off("submit.danbooru").on("submit.danbooru",(function(){return o.default.disapprove(t,$("#post_disapproval_reason").val(),$("#post_disapproval_message").val()),!1})),a.default.dialog("Detailed Rejection","#detailed-rejection-dialog"),!1}};$((function(){if($("body").data("user-is-approver")){var t=i.default.Posts.JanitorToolbar,e=$("#pending-approval-notice");t&&e.addClass("enabled");var n=$("#janitor-toolbar-toggle").on("click",(function(a){return a.preventDefault(),t=!t,i.default.Posts.JanitorToolbar=t,e.toggleClass("enabled"),n.text(t?"Approvals: On":"Approvals: Off"),!1})).text(t?"Approvals: On":"Approvals: Off");$(document).on("click.danbooru",".quick-mod .detailed-rejection-link",r.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=r},9309:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return p}});var a=n(2370),o=n(3692),i=n(7742),r=n(9855);function s(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 l(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 l(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 l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n1){var o,i=s(t.get());try{for(i.s();!(o=i.n()).done;){var l=o.value;this.update($(l))}}catch(v){i.e(v)}finally{i.f()}}else{var c=r.default.fromThumbnail(t);if(!this.matchIDs.has(c.id)){var u=!0;if(this.tokens.length){var d,f=s(this.tokens);try{for(f.s();!(d=f.n()).done;){if(!(u=d.value.test(c)))break}}catch(v){f.e(v)}finally{f.f()}}if(u&&this.optional.length){var p,g=!1,h=s(this.optional);try{for(h.s();!(p=h.n()).done;){if(g=p.value.test(c))break}}catch(v){h.e(v)}finally{h.f()}g||(u=!1)}!0===u?this.matchIDs.add(c.id):!1===u&&this.matchIDs.delete(c.id)}}}}],[{key:"create",value:function(e){return!(e=e.trim())||e.startsWith("#")?null:new t(e=e.toLowerCase().replace(/ #.*$/,""))}}])}(),g=function(){return d((function t(e){if(c(this,t),e=e.trim().toLowerCase(),this.optional=e.startsWith("~"),this.optional&&(e=e.slice(1)),this.inverted=e.startsWith("-"),this.inverted&&(e=e.slice(1)),this.type=o.default.getFilterType(e),"tag"!==this.type)e=e.slice(this.type.length+1);else if(e.includes("*"))return this.value=new RegExp(e.replace(/\*/g,".*")),void(this.type="wildcard");if(this.comparison=o.default.getComparison(e),"="!=this.comparison&&".."!=this.comparison&&(e=e.slice(this.comparison.length)),".."==this.comparison)if(e.startsWith(".."))this.comparison="<=",this.value=o.default.normalizeData(e.slice(2),this.type);else if(e.endsWith(".."))this.comparison=">=",this.value=o.default.normalizeData(e.slice(0,-2),this.type);else{var n=e.split("..");2!=n.length?(this.comparison="=",this.value=NaN):this.value=[o.default.normalizeData(n[0],this.type),o.default.normalizeData(n[1],this.type)]}else this.value=o.default.normalizeData(e,this.type)}),[{key:"test",value:function(t){var e=o.default.FilterTests[this.type](this,t);return this.inverted?!e:e}}])}()},9855: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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n");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(){o.Box.update_data_attributes(n)}}),n.resizable({containment:$("#image"),handles:"se, nw",stop:function(){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()}})),"Anonymous"!==a.default.meta("current-user-name")?t.on("dblclick.danbooru",(function(e){if("A"!==e.target.tagName){var n=t.data("id"),a=o.Body.find(n);o.Edit.show(a)}e.stopPropagation()})):t.on("dblclick.danbooru",(function(e){var n=t.data("id");"A"!==o.Body.find(n).tagName&&a.default.error("You must be logged in to edit notes"),e.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){a.default.error("Error: "+(t.responseJSON.reason||t.responseJSON.reasons.join("; ")))},success_handler:function(t){var e=null;if(t.html_id){var n=o.Body.find(t.html_id);e=o.Box.find(t.html_id),n.data("id",String(t.id)).attr("data-id",t.id),e.data("id",String(t.id)).attr("data-id",t.id),e.find(".note-box-inner-border").removeClass("unsaved")}else(e=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..."),$.post("/dtext_preview.json",{body:r,allow_color:!0}).then((function(t){o.Body.set_text(a,i,t.html),o.Box.resize_inner_border(i),a.show(),$(window).trigger("e621:add_deferred_posts",t.posts)})),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..."),$.post("/dtext_preview.json",{body:i,allow_color:!0}).then((function(t){o.Body.set_text(a,r,t.html),a.show(),$(window).trigger("e621:add_deferred_posts",t.posts)}))},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,l){var c=o.Box.create(e),u=o.Body.create(e);c.data("x",n),c.data("y",a),c.data("width",i),c.data("height",r),t.appendChild(c[0]),t.appendChild(u[0]),u.data("original-body",s),o.Box.scale(c),o.Body.display_text(u,l)},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},6211:function(t,e,n){"use strict";n.r(e);var a=n(5520),o={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){o.dialog_setup||($("#add-to-pool-dialog").dialog({autoOpen:!1}),o.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){t.preventDefault(),$.ajax({type:"post",url:t.target.action,data:$("#sortable").sortable("serialize")+"&"+$(t.target).serialize()+"&format=json"}).done((function(){window.location.href=t.target.action})).fail((function(t){a.default.error("Error: ".concat(t.responseText))}))}))}};$(document).ready((function(){o.initialize_all()})),e.default=o},8924: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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)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},9900:function(t,e,n){"use strict";n.r(e);var a=n(5520),o=n(8980),i=n(3233),r=n(9182),s=n(5536),l=n(9840),c=n(6519),u=n(7395),d=n(7742),f={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(),f.change())},initialize_shortcuts:function(){u.default.keydown("1 2 3 4 5 6 7 8 9 0","change_tag_script",f.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()){t.preventDefault();var e=Number(t.key);console.log(e,d.default.Posts.TagScript.ID),e&&e!=d.default.Posts.TagScript.ID&&(d.default.Posts.TagScript.ID=e,console.log("settings",d.default.Posts.TagScript.ID,d.default.Posts.TagScript.Content),$("#tag-script-field").val(d.default.Posts.TagScript.Content),f.show_notice(e))}},initialize_selector:function(){$("#mode-box-mode").val(d.default.Posts.Mode),$("#mode-box-mode").on("change.danbooru",(function(){f.change(),$("#tag-script-field:visible").focus().select()}))},initialize_preview_link:function(){$(".post-preview").on("click.danbooru",f.click)},initialize_edit_form:function(){$("#quick-edit-div").hide(),$("#quick-edit-form input[value=Cancel]").on("click.danbooru",(function(t){f.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(){c.A.enableElement(document.getElementById("quick-edit-form"))},success:function(t){o.default.update_data(t),a.default.notice("Post #"+t.post.id+" updated"),f.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").on("blur",(function(){var t=$(this).val();d.default.Posts.TagScript.Content=t})),$("#tag-script-all").on("click",f.tag_script_apply_all)},tag_script_apply_all:function(t){t.preventDefault(),$("article.post-preview").trigger("click")},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){d.default.Posts.Set=t.target.value})),t.empty();var n=d.default.Posts.Set;["Owned","Maintained"].forEach((function(a){var o=$("",{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},3564:function(t,e,n){"use strict";n.r(e);var a=n(4596),o=n(7742);function i(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 r(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 r(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,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw i}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n=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,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw i}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n").addClass("post-thumbnail").toggleClass("dtext",l.hasClass("thumb-placeholder-link"));for(var f in Danbooru.Blacklist.hiddenPosts.has(c)&&d.addClass("blacklisted"),u)d.attr("data-"+f.replace(/_/g,"-"),u[f]);var p=$("").attr("href","/posts/".concat(u.id)).appendTo(d);$("").attr({src:u.preview_url||"/images/deleted-preview.png",height:u.preview_url?u.preview_height:150,width:u.preview_url?u.preview_width:150,title:"Rating: ".concat(u.rating,"\r\nID: ").concat(u.id,"\r\nStatus: ").concat(u.flags,"\r\nDate: ").concat(u.created_at,"\r\n\r\n").concat(u.tags),alt:u.tags,class:"post-thumbnail-img"}).appendTo(p),l.replaceWith(d),n.push(d)}else g(l)}else g(l)}}catch(h){r.e(h)}finally{r.f()}function g(t){t.hasClass("thumb-placeholder-link")?t.removeClass("thumb-placeholder-link"):t.empty()}n.length>0&&(a.default.add_posts(n),a.default.update_styles(),a.default.update_visibility())}};$((function(){s.initialize(),$(window).on("e621:add_deferred_posts",(function(t,e){window.___deferred_posts=window.___deferred_posts||{},window.___deferred_posts=$.extend(window.___deferred_posts,e),s.initialize()})),$(document).on("thumbnails:apply",s.initialize)})),e.default=s},7442:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return Ut}});var a=n(7746),o=n(1332),i=n(3674),r={class:"flex-grid-outer"},s={class:"col box-section",style:{flex:"2 0 0"}},l={class:"flex-grid border-bottom"},c=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label",for:"post_file"},"File"),(0,a.eW)(),(0,a.Lk)("div",{class:"hint"},[(0,a.Lk)("a",{href:"/help/supported_filetypes"},"Supported Formats")])],-1),u={class:"col2"},d={class:"flex-grid border-bottom"},f=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label",for:"post_sources"},"Sources"),(0,a.eW)(),(0,a.Lk)("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),p={class:"col2"},g={class:"flex-grid border-bottom"},h=(0,a.Fv)('
    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"},b=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label",for:"post_sex_tags"},"Characters"),(0,a.eW)(),(0,a.Lk)("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.eW)(),(0,a.Lk)("div",null,[(0,a.Lk)("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),y={class:"col2"},_={class:"flex-wrap"},w=(0,a.Lk)("hr",null,null,-1),k={class:"flex-wrap"},x=(0,a.Lk)("hr",null,null,-1),j={class:"flex-wrap"},S={class:"flex-grid border-bottom"},T=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Body Types and Species"),(0,a.eW)(),(0,a.Lk)("div",null,"One listed body type per visible character, listed options are mutually exclusive.")],-1),C={class:"col2"},D={class:"flex-wrap"},E={class:"flex-grid border-bottom"},L=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Contentious Content"),(0,a.eW)(),(0,a.Lk)("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),A={class:"col2"},P={class:"flex-grid border-bottom"},z=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Rating"),(0,a.eW)(),(0,a.Lk)("div",null,[(0,a.eW)("Explicit tags include sex, pussy, penis, masturbation, fellatio, etc.\n ("),(0,a.Lk)("a",{href:"/help/ratings",target:"_blank"},"help"),(0,a.eW)(")\n ")])],-1),O={class:"col2"},I={key:0,class:"box-section background-red"},W={class:"flex-grid come-together-now"},U=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label",for:"post_tags"},"Other Tags"),(0,a.eW)(),(0,a.Lk)("div",null,[(0,a.eW)("\n Separate tags with spaces. ("),(0,a.Lk)("a",{href:"/help/tags",target:"_blank"},"help"),(0,a.eW)(")\n ")]),(0,a.eW)(),(0,a.Lk)("div",null,[(0,a.Lk)("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),M={class:"col2"},R={class:"box-section background-red"},F={class:"related-tag-functions"},B={class:"flex-grid border-bottom over-me"},X={class:"flex-grid border-bottom"},N=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Parent Post ID")],-1),V={class:"col2"},q={key:1,class:"flex-grid border-bottom"},J=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Locked Tags")],-1),G={class:"col2"},Q={key:2,class:"flex-grid border-bottom"},Y=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Lock Rating")],-1),H={class:"col2"},K={class:"flex-grid border-bottom"},Z=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label",for:"post_description"},"Description")],-1),tt={class:"col2"},et={class:"dtext-formatter","data-editing":"true","data-initialized":"false","data-allow-color":"true"},nt=(0,a.Lk)("div",{class:"dtext-formatter-tabs"},[(0,a.Lk)("a",{"data-action":"edit",role:"tab"},"Write"),(0,a.eW)(),(0,a.Lk)("a",{"data-action":"show",role:"tab"},"Preview")],-1),at=(0,a.Lk)("div",{class:"dtext-formatter-buttons",role:"toolbar"},[(0,a.Lk)("a",{title:"Bold","data-content":"[b]%selection%[/b]"},[(0,a.Lk)("i",{class:"fa-solid fa-bold"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Italics","data-content":"[i]%selection%[/i]"},[(0,a.Lk)("i",{class:"fa-solid fa-italic"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Strikethrough","data-content":"[s]%selection%[/s]"},[(0,a.Lk)("i",{class:"fa-solid fa-strikethrough"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Underline","data-content":"[u]%selection%[/u]"},[(0,a.Lk)("i",{class:"fa-solid fa-underline"})]),(0,a.eW)(),(0,a.Lk)("span",{class:"spacer"}),(0,a.eW)(),(0,a.Lk)("a",{title:"Header","data-content":"h2.%selection%"},[(0,a.Lk)("i",{class:"fa-solid fa-heading"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Spoiler","data-content":"[spoiler]%selection%[/spoiler]"},[(0,a.Lk)("i",{class:"fa-solid fa-eye-slash"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Code","data-content":"[code]%selection%[/code]"},[(0,a.Lk)("i",{class:"fa-solid fa-code"})]),(0,a.eW)(),(0,a.Lk)("a",{title:"Quote","data-content":"[quote]%selection%[/quote]"},[(0,a.Lk)("i",{class:"fa-solid fa-quote-right"})])],-1),ot=(0,a.Lk)("div",{class:"dtext-formatter-preview dtext-container"},null,-1),it=(0,a.Lk)("div",{class:"dtext-formatter-charcount","data-limit":"50000","data-count":"0"},null,-1),rt=(0,a.Lk)("span",{class:"hint"},[(0,a.eW)("All text is formatted using "),(0,a.Lk)("a",{href:"/help/dtext",target:"_blank",rel:"noopener",tabindex:"-1"},"DText")],-1),st={key:3,class:"flex-grid border-bottom"},lt=(0,a.Lk)("div",{class:"col"},[(0,a.Lk)("label",{class:"section-label"},"Upload as Pending"),(0,a.eW)(),(0,a.Lk)("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),ct={class:"col2"},ut={class:"flex-grid"},dt=(0,a.Lk)("div",{class:"col"},null,-1),ft={class:"col2"},pt={class:"box-section background-red"},gt={class:"box-section background-green"},ht={class:"box-section background-red"},vt=["href"],mt=["disabled"],bt={id:"preview-sidebar",class:"col box-section",style:{"margin-left":"10px",padding:"10px"}};var yt=n(1430);var _t={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,"_")}}},wt=n(2443);var kt=(0,wt.A)(_t,[["render",function(t,e,n,o,r,s){return(0,a.uX)(),(0,a.CE)("button",{class:(0,i.C4)(["toggle-button",{active:s.value}]),onClick:e[0]||(e[0]=function(t){return s.value=!s.value})},(0,i.v_)(n.check.name),3)}]]),$t=n(9699),xt=n(399),jt=n(6728),St=n(808);function Tt(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 Ct(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 Ct(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 Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);ne.name?1:-1}function zt(){if(!(this.allowNavigate||""===this.uploadValue&&""===this.tags))return!0}var Ot={components:{sources:yt.A,"image-checkbox":kt,"related-tags":$t.A,"tag-preview":xt.A,"file-preview":jt.A,"file-input":St.A},data:function(){var t={},e=function(e){"undefined"===typeof e.tag?t[e.name.toLowerCase().replace(" ","_")]=!0:t[e.tag]=!0};return Dt.forEach(e),Et.forEach(e),Lt.forEach(e),At.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:Dt,pairing:Et,count:Lt,body:At,selected:{},all:t},tagEntries:{artist:"",character:"",species:"",content:"",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=zt.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(){var n=["tags-artist","tags-character","tags-species","tags-content"];if(e.has("tags")&&t.importTags(e.get("tags"),"other"),t.normalMode){var a,o=Tt(n);try{for(o.s();!(a=o.n()).done;){var i=a.value;e.has(i)&&t.importTags(e.get(i),i.replace("tags-",""))}}catch(u){o.e(u)}finally{o.f()}}else{var r,s=[],l=Tt(n);try{for(l.s();!(r=l.n()).done;){var c=r.value;e.has(c)&&s.push(e.get(c))}}catch(u){l.e(u)}finally{l.f()}s.length>0&&t.importTags(s.join(" "),"other")}}(),function(){if(e.has("rating")){var n=e.get("rating")[0].toLowerCase();/[sqe]/.test(n)&&(t.rating=n)}}(),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(" ")+" "}},importTags:function(t,e){var n=this;this.tagPreview.show=!1;var a=(t+"").trim().split(" ").filter((function(t){return t})),o=this.normalMode?[]:(this.tagEntries.other||"").trim().split(" ");a.forEach((function(t){o.indexOf(t)>=0||(n.normalMode&&"undefined"!==typeof n.checkboxes.all[t]&&n.setCheck(t,!0),o.push(t))})),this.tagEntries[this.normalMode?e:"other"]=o.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(Pt)});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.artist,this.tagEntries.character,this.tagEntries.species,this.tagEntries.content]).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 It=(0,wt.A)(Ot,[["render",function(t,e,n,$,yt,_t){var wt=(0,a.g2)("file-input"),kt=(0,a.g2)("file-preview"),$t=(0,a.g2)("sources"),xt=(0,a.g2)("image-checkbox"),jt=(0,a.g2)("tag-preview"),St=(0,a.g2)("related-tags");return(0,a.uX)(),(0,a.CE)("div",r,[(0,a.Lk)("div",s,[(0,a.Lk)("div",l,[c,(0,a.eW)(),(0,a.Lk)("div",u,[(0,a.bF)(wt,{onUploadValueChanged:e[0]||(e[0]=function(t){return yt.uploadValue=t}),onPreviewChanged:e[1]||(e[1]=function(t){return yt.previewData=t}),onInvalidUploadValueChanged:e[2]||(e[2]=function(t){return yt.invalidUploadValue=t})})])]),(0,a.eW)(),(0,a.bF)(kt,{classes:"box-section in-editor below-upload",data:yt.previewData},null,8,["data"]),(0,a.eW)(),(0,a.Lk)("div",d,[f,(0,a.eW)(),(0,a.Lk)("div",p,[(0,a.bF)($t,{maxSources:10,showErrors:yt.showErrors,sources:yt.sources,"onUpdate:sources":e[3]||(e[3]=function(t){return yt.sources=t}),onSourceWarning:e[4]||(e[4]=function(t){return yt.sourceWarning=t})},null,8,["showErrors","sources"])])]),(0,a.eW)(),yt.normalMode?((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("div",g,[h,(0,a.eW)(),(0,a.Lk)("div",v,[(0,a.Lk)("div",null,[(0,a.bo)((0,a.Lk)("textarea",{class:"tag-textarea","onUpdate:modelValue":e[5]||(e[5]=function(t){return yt.tagEntries.artist=t}),id:"post_artist",rows:"2",placeholder:"Ex: artist_name, unknown_artist, anonymous_artist etc.","data-autocomplete":"tag-edit"},null,512),[[o.Jo,yt.tagEntries.artist]])])])]),(0,a.eW)(),(0,a.Lk)("div",m,[b,(0,a.eW)(),(0,a.Lk)("div",y,[(0,a.Lk)("div",_,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(yt.checkboxes.sex,(function(t){return(0,a.uX)(),(0,a.Wv)(xt,{check:t,checks:yt.checkboxes.selected,onSet:_t.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.eW)(),w,(0,a.eW)(),(0,a.Lk)("div",k,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(yt.checkboxes.count,(function(t){return(0,a.uX)(),(0,a.Wv)(xt,{check:t,checks:yt.checkboxes.selected,onSet:_t.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.eW)(),x,(0,a.eW)(),(0,a.Lk)("div",j,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(yt.checkboxes.pairing,(function(t){return(0,a.uX)(),(0,a.Wv)(xt,{check:t,checks:yt.checkboxes.selected,onSet:_t.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("textarea",{class:"tag-textarea",rows:"2","onUpdate:modelValue":e[6]||(e[6]=function(t){return yt.tagEntries.character=t}),id:"post_character",placeholder:"Ex: character_name solo_focus etc.","data-autocomplete":"tag-edit"},null,512),[[o.Jo,yt.tagEntries.character]])])]),(0,a.eW)(),(0,a.Lk)("div",S,[T,(0,a.eW)(),(0,a.Lk)("div",C,[(0,a.Lk)("div",D,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(yt.checkboxes.body,(function(t){return(0,a.uX)(),(0,a.Wv)(xt,{check:t,checks:yt.checkboxes.selected,onSet:_t.setCheck,key:t.name},null,8,["check","checks","onSet"])})),128))]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("textarea",{class:"tag-textarea",rows:"2","onUpdate:modelValue":e[7]||(e[7]=function(t){return yt.tagEntries.species=t}),id:"post_species",placeholder:"Ex: bear dragon hyena rat newt etc.","data-autocomplete":"tag-edit"},null,512),[[o.Jo,yt.tagEntries.species]])])]),(0,a.eW)(),(0,a.Lk)("div",E,[L,(0,a.eW)(),(0,a.Lk)("div",A,[(0,a.bo)((0,a.Lk)("textarea",{class:"tag-textarea","onUpdate:modelValue":e[8]||(e[8]=function(t){return yt.tagEntries.content=t}),id:"post_content",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.Jo,yt.tagEntries.content]])])])],64)):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("div",P,[z,(0,a.eW)(),(0,a.Lk)("div",O,[yt.showErrors&&_t.invalidRating?((0,a.uX)(),(0,a.CE)("div",I,"\n You must select an appropriate rating for this image.\n ")):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("div",null,[yt.safe?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)(a.FK,{key:0},[(0,a.Lk)("button",{class:(0,i.C4)(["toggle-button rating-e",{active:"e"===yt.rating}]),onClick:e[9]||(e[9]=function(t){return yt.rating="e"})},"\n Explicit\n ",2),(0,a.eW)(),(0,a.Lk)("button",{class:(0,i.C4)(["toggle-button rating-q",{active:"q"===yt.rating}]),onClick:e[10]||(e[10]=function(t){return yt.rating="q"})},"\n Questionable\n ",2)],64)),(0,a.eW)(),(0,a.Lk)("button",{class:(0,i.C4)(["toggle-button rating-s",{active:"s"===yt.rating}]),onClick:e[11]||(e[11]=function(t){return yt.rating="s"})},"Safe\n ",2)])])]),(0,a.eW)(),(0,a.Lk)("div",W,[U,(0,a.eW)(),(0,a.Lk)("div",M,[(0,a.bF)(kt,{classes:"box-section in-editor",data:yt.previewData},null,8,["data"]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",R,[(0,a.eW)("\n You must provide at least "),(0,a.Lk)("b",null,(0,i.v_)(4-_t.tagCount),1),(0,a.eW)(" more tags. Tags in other sections count\n towards this total.\n ")],512),[[o.aG,yt.showErrors&&_t.notEnoughTags]]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",null,[(0,a.bo)((0,a.Lk)("textarea",{class:"tag-textarea",id:"post_tags","onUpdate:modelValue":e[12]||(e[12]=function(t){return yt.tagEntries.other=t}),rows:"5",ref:"otherTags","data-autocomplete":"tag-edit"},null,512),[[o.Jo,yt.tagEntries.other]])],512),[[o.aG,!yt.tagPreview.show]]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",null,[(0,a.bF)(jt,{tags:yt.tagPreview.tags,loading:yt.tagPreview.loading,onClose:_t.previewFinalTags},null,8,["tags","loading","onClose"])],512),[[o.aG,yt.tagPreview.show]]),(0,a.eW)(),(0,a.Lk)("div",F,[(0,a.eW)("\n Related:\n "),(0,a.Lk)("a",{href:"#",onClick:e[13]||(e[13]=(0,o.D$)((function(t){return _t.findRelated()}),["prevent"]))},"Tags"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[14]||(e[14]=(0,o.D$)((function(t){return _t.findRelated(1)}),["prevent"]))},"Artists"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[15]||(e[15]=(0,o.D$)((function(t){return _t.findRelated(3)}),["prevent"]))},"Copyrights"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[16]||(e[16]=(0,o.D$)((function(t){return _t.findRelated(4)}),["prevent"]))},"Characters"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[17]||(e[17]=(0,o.D$)((function(t){return _t.findRelated(5)}),["prevent"]))},"Species"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[18]||(e[18]=(0,o.D$)((function(t){return _t.findRelated(7)}),["prevent"]))},"Metatags"),(0,a.eW)(" |\n "),(0,a.Lk)("a",{href:"#",onClick:e[19]||(e[19]=(0,o.D$)((function(){return _t.previewFinalTags&&_t.previewFinalTags.apply(_t,arguments)}),["prevent"]))},"Preview Final Tags")])])]),(0,a.eW)(),(0,a.Lk)("div",B,[yt.relatedTags.length?((0,a.uX)(),(0,a.Wv)(St,{key:0,tags:_t.tagsArray,related:yt.relatedTags,loading:yt.loadingRelated,onTagActive:_t.pushTag},null,8,["tags","related","loading","onTagActive"])):(0,a.Q3)("",!0)]),(0,a.eW)(),(0,a.Lk)("div",X,[N,(0,a.eW)(),(0,a.Lk)("div",V,[(0,a.bo)((0,a.Lk)("input",{"onUpdate:modelValue":e[20]||(e[20]=function(t){return yt.parentID=t}),placeholder:"Ex. 12345"},null,512),[[o.Jo,yt.parentID,void 0,{number:!0}]])])]),(0,a.eW)(),yt.allowLockedTags?((0,a.uX)(),(0,a.CE)("div",q,[J,(0,a.eW)(),(0,a.Lk)("div",G,[(0,a.bo)((0,a.Lk)("input",{type:"text","onUpdate:modelValue":e[21]||(e[21]=function(t){return yt.lockedTags=t}),"data-autocomplete":"tag-query"},null,512),[[o.Jo,yt.lockedTags]])])])):(0,a.Q3)("",!0),(0,a.eW)(),yt.allowRatingLock?((0,a.uX)(),(0,a.CE)("div",Q,[Y,(0,a.eW)(),(0,a.Lk)("div",H,[(0,a.Lk)("label",null,[(0,a.bo)((0,a.Lk)("input",{type:"checkbox","onUpdate:modelValue":e[22]||(e[22]=function(t){return yt.ratingLocked=t})},null,512),[[o.lH,yt.ratingLocked]]),(0,a.eW)(" Lock Rating")])])])):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("div",K,[Z,(0,a.eW)(),(0,a.Lk)("div",tt,[(0,a.Lk)("div",et,[nt,(0,a.eW)(),at,(0,a.eW)(),(0,a.bo)((0,a.Lk)("textarea",{class:"dtext-formatter-input tag-textarea dtext",id:"post_description",rows:"10","onUpdate:modelValue":e[23]||(e[23]=function(t){return yt.description=t})},null,512),[[o.Jo,yt.description]]),(0,a.eW)(),ot,(0,a.eW)(),it]),(0,a.eW)(),rt])]),(0,a.eW)(),yt.allowUploadAsPending?((0,a.uX)(),(0,a.CE)("div",st,[lt,(0,a.eW)(),(0,a.Lk)("div",ct,[(0,a.Lk)("label",null,[(0,a.bo)((0,a.Lk)("input",{type:"checkbox","onUpdate:modelValue":e[24]||(e[24]=function(t){return yt.uploadAsPending=t})},null,512),[[o.lH,yt.uploadAsPending]]),(0,a.eW)(" Upload as Pending")])])])):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("div",ut,[dt,(0,a.eW)(),(0,a.Lk)("div",ft,[(0,a.bo)((0,a.Lk)("div",pt,"\n Unmet requirements above prevent the submission of the post.\n ",512),[[o.aG,_t.preventUpload&&yt.showErrors]]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",gt,"\n Submitting your post, please wait.\n ",512),[[o.aG,yt.submitting]]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",{class:"box-section background-red"},(0,i.v_)(yt.error),513),[[o.aG,yt.error]]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",ht,[(0,a.eW)("\n Post is a duplicate of "),(0,a.Lk)("a",{href:_t.duplicatePath},"post #"+(0,i.v_)(yt.duplicateId)+".",9,vt)],512),[[o.aG,yt.duplicateId]]),(0,a.eW)(),(0,a.Lk)("button",{onClick:e[25]||(e[25]=function(){return _t.submit&&_t.submit.apply(_t,arguments)}),disabled:yt.showErrors&&_t.preventUpload||yt.submitting,accesskey:"s"},(0,i.v_)(yt.submitting?"Uploading...":"Upload"),9,mt)])])]),(0,a.eW)(),(0,a.Lk)("div",bt,[(0,a.bF)(kt,{classes:"in-sidebar",data:yt.previewData},null,8,["data"])])])}]]);var Wt=It,Ut={init:function(){(0,o.Ef)(Wt).mount("#uploader")}}},7886:function(t,e,n){"use strict";n.r(e);var a=n(956),o=n(6616),i=n(1263),r=n(2689),s=n(5520);function l(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},3692: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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n=0},rating:function(t,e){return e.rating===t.value},type:function(t,e){return e.file_ext===t.value},width:function(t,e){return i.compare(e.width,t)},height:function(t,e){return i.compare(e.height,t)},filesize:function(t,e){return i.compare(e.size,t)},score:function(t,e){return i.compare(e.score,t)},favcount:function(t,e){return i.compare(e.fav_count,t)},fav:function(t,e){return e.is_favorited},uploader:function(t,e){return i.FilterTests.user(t,e)},user:function(t,e){return t.value.startsWith("!")?e.uploader_id===parseInt(t.value.slice(1)):e.uploader===t.value},userid:function(t,e){return i.compare(e.uploader_id,t)},username:function(t,e){return e.uploader===t.value},pool:function(t,e){return e.pools.includes(parseInt(t.value)||0)},wildcard:function(t,e){return i.wildcardTagMatchesFilter(e,t.value)}};var r=Object.keys(i.FilterTests);i.getFilterType=function(t){if(1==(t=t.split(":")).length)return"tag";t=t[0];for(var e=0,n=r;e=":">=","=<":"<=","=>":">=","<":"<",">":">"};i.getComparison=function(t){if(-1!=t.indexOf(".."))return"..";var e=t.match(/^[<>=]{1,2}/);return e&&s[e[0]]||"="},i.normalizeData=function(t,e){switch(e){case"tag":return t;case"tagcount":case"id":case"width":case"height":case"score":case"favcout":case"userid":return parseInt(t);case"rating":return i.parseRating(t);case"filesize":return i.parseFilesize(t)}return t},i.compare=function(t,e){switch(e.comparison){case"=":return t==e.value;case"<":return t":return t>e.value;case">=":return t>=e.value;case"..":return t>=e.value[0]&&t<=e.value[1]}return!1},i.tagsMatchesFilter=function(t,e){return t.tags.indexOf(e)>=0},i.wildcardTagMatchesFilter=function(t,e){var n,o=a(t.tags);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(e.test(i))return!0}}catch(r){o.e(r)}finally{o.f()}return!1},i.parseRating=function(t){switch(t){case"safe":case"s":return"s";case"questionable":case"q":return"q";case"explicit":case"e":return"e";default:return"x"}},i.parseFilesize=function(t){return/^\d+b?$/.test(t)?parseInt(t):/^\d+kb$/.test(t)?1024*parseInt(t):/^\d+mb$/.test(t)?1048576*parseInt(t):0},e.default=i},4596:function(t,e,n){"use strict";function a(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"";return this._controller||this._init(),e?this._controller==t&&this._action==e:this._controller==t}}],(e=null)&&a(t.prototype,e),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();o(r,"_controller",void 0),o(r,"_action",void 0)},7742:function(t,e,n){"use strict";n.r(e);var a=n(621);function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return i(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 i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);nt.length)&&(e=t.length);for(var n=0,a=new Array(e);n=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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw r}}}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]);try{for(n.s();!(e=n.n()).done;){var a=e.value;r.bootstrap(t,a,t[a][0],t[a][1])}}catch(i){n.e(i)}finally{n.f()}},r.bootstrapMany=function(t){for(var e=0,n=Object.entries(t);etbody>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(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();e.default=r},8939:function(t,e,n){"use strict";n.r(e);var a=n(5520),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","artverified"],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 l=e.post_count;l>=1e3&&(l=Math.floor(l/1e3)+"k");var c=$("").addClass("post-count").css("float","right").text(l);n.append(c)}if("tag"===e.type)n.addClass("tag-type-"+e.category);else if("user"===e.type){var u="user-"+e.level.replace(/ /g,"-").toLowerCase();n.addClass(u),"true"===a.default.meta("style-usernames")&&n.addClass("with-style")}else"pool"===e.type&&n.addClass("pool-category-"+e.category);var d=$("
    ").append(n),f=$("
  • ").data("item.autocomplete",e).append(d);return["id","type","source","antecedent","value","category","post_count","weight"].forEach((function(t){f.attr("data-autocomplete-".concat(t.replace(/_/g,"-")),e[t])})),f.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[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},3535:function(t,e,n){"use strict";n.r(e)},808:function(t,e,n){"use strict";n.d(e,{A:function(){return z}});var a=n(7746),o=n(3674),i=n(1332),r=["file-enabled","link-enabled"],s={key:0,class:"fileinput-wrapper"},l={key:0,class:"box-section background-red"},c=(0,a.Lk)("br",null,null,-1),u=(0,a.Lk)("a",{href:"/help/supported_filetypes"},"the Supported Formats",-1),d=["dragging"],f=["disabled"],p={class:"title"},g={key:0},h={key:1},v={class:"subtitle"},m={key:0},b={key:1},y=(0,a.Lk)("u",null,"Browse for file",-1),_={key:1,class:"linkinput-wrapper"},w={key:0,class:"box-section background-red"},k=(0,a.Lk)("br",null,null,-1),x=(0,a.Lk)("a",{href:"/wiki_pages/howto:sites_and_sources"},"the sourcing guide",-1),j={class:"linkinput"},S={class:"linkinput-or"},T=["disabled"],C={key:0},D={key:1},E={key:0},L=(0,a.Lk)("a",{href:"/upload_whitelists"},"View whitelisted domains",-1);var A={data:function(){return{whitelist:{visible:!1,allowed:!1,reason:"",domain:"",oldDomain:""},uploader:{dragging:!1},uploadURL:new URLSearchParams(window.location.search).get("upload_url")||"",fileTooLarge:!1,exceededFileSize:0,maxFileSize:window.uploaderSettings.maxFileSize,maxFileSizeMap:window.uploaderSettings.maxFileSizeMap,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(),0===this.uploadURL.length&&this.setEmptyThumb()}},invalidUploadValue:function(){this.$emit("invalidUploadValueChanged",this.invalidUploadValue)}},methods:{fileDragover:function(t){t.preventDefault(),this.uploader.dragging=!0},fileDragleave:function(t){t.preventDefault(),this.uploader.dragging=!1},fileDrop:function(t){t.preventDefault(),this.uploader.dragging=!1,this.$refs.post_file.files=t.dataTransfer.files,this.updatePreviewFile()},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()},getFileURL:function(){return this.$refs.post_file.files[0]},updatePreviewFile:function(){var t,e,n=this.getFileURL(),a=null!==(t=this.maxFileSizeMap[null===(e=n.type.split("/"))||void 0===e?void 0:e[1]])&&void 0!==t?t:this.maxFileSize;n.size>a?(this.fileTooLarge=!0,this.exceededFileSize=a):(this.fileTooLarge=!1,this.exceededFileSize=0);var o=URL.createObjectURL(n);this.disableURLUpload=!0,this.uploadValueChanged(n),this.previewChanged(o,"video/webm"===n.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 P=(0,n(2443).A)(A,[["render",function(t,e,n,$,A,P){return(0,a.uX)(),(0,a.CE)("span",{class:"uploader-file-input","file-enabled":!A.disableFileUpload,"link-enabled":!A.disableURLUpload},[A.disableFileUpload?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("div",s,[A.fileTooLarge?((0,a.uX)(),(0,a.CE)("div",l,[(0,a.eW)("\n The file you are trying to upload is too large. Maximum allowed is "+(0,o.v_)(this.exceededFileSize/1048576)+" MiB.",1),c,(0,a.eW)("\n Check out "),u,(0,a.eW)(" for more information.\n ")])):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("label",{class:"fileinput",for:"file-input",onDragover:e[1]||(e[1]=function(){return P.fileDragover&&P.fileDragover.apply(P,arguments)}),onDragleave:e[2]||(e[2]=function(){return P.fileDragleave&&P.fileDragleave.apply(P,arguments)}),onDrop:e[3]||(e[3]=function(){return P.fileDrop&&P.fileDrop.apply(P,arguments)}),dragging:A.uploader.dragging},[(0,a.Lk)("input",{type:"file",ref:"post_file",id:"file-input",accept:"image/png,image/apng,image/jpeg,image/gif,video/webm,.png,.apng,.jpg,.jpeg,.gif,.webm",onChange:e[0]||(e[0]=function(){return P.updatePreviewFile&&P.updatePreviewFile.apply(P,arguments)}),disabled:A.disableFileUpload},null,40,f),(0,a.eW)(),(0,a.Lk)("span",p,[A.uploader.dragging?((0,a.uX)(),(0,a.CE)("div",g,"Release to drop a file here")):((0,a.uX)(),(0,a.CE)("div",h,"Choose an image or video to upload"))]),(0,a.eW)(),(0,a.Lk)("span",v,[A.disableURLUpload?((0,a.uX)(),(0,a.CE)("div",m,(0,o.v_)(this.getFileURL().name),1)):((0,a.uX)(),(0,a.CE)("div",b,[y,(0,a.eW)(" or drag and drop")]))])],40,d),(0,a.eW)(),(0,a.bo)((0,a.Lk)("button",{class:"btn-clear",onClick:e[4]||(e[4]=(0,i.D$)((function(){return P.clearFileUpload&&P.clearFileUpload.apply(P,arguments)}),["prevent"]))},"Clear",512),[[i.aG,A.disableURLUpload]])])),(0,a.eW)(),A.disableURLUpload?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("div",_,[P.badDirectURL?((0,a.uX)(),(0,a.CE)("div",w,[(0,a.eW)("\n The direct URL entered has the following problem: "+(0,o.v_)(P.directURLProblem),1),k,(0,a.eW)("\n You should review "),x,(0,a.eW)(".\n ")])):(0,a.Q3)("",!0),(0,a.eW)(),(0,a.Lk)("label",j,[(0,a.Lk)("span",S,(0,o.v_)(A.disableFileUpload?"URL":"OR"),1),(0,a.eW)(),(0,a.bo)((0,a.Lk)("input",{type:"text",size:"50",placeholder:"Paste image URL","onUpdate:modelValue":e[5]||(e[5]=function(t){return A.uploadURL=t}),disabled:A.disableURLUpload},null,8,T),[[i.Jo,A.uploadURL]])]),(0,a.eW)(),(0,a.bo)((0,a.Lk)("div",{id:"whitelist-warning",class:(0,o.C4)({"whitelist-warning-allowed":A.whitelist.allowed,"whitelist-warning-disallowed":!A.whitelist.allowed})},[A.whitelist.allowed?((0,a.uX)(),(0,a.CE)("span",C,[(0,a.eW)("Uploads from "),(0,a.Lk)("b",null,(0,o.v_)(A.whitelist.domain),1),(0,a.eW)(" are permitted.")])):(0,a.Q3)("",!0),(0,a.eW)(),A.whitelist.allowed?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("span",D,[(0,a.eW)("Uploads from "),(0,a.Lk)("b",null,(0,o.v_)(A.whitelist.domain),1),(0,a.eW)(" are not permitted.\n "),A.whitelist.reason?((0,a.uX)(),(0,a.CE)("span",E,"Reason given: "+(0,o.v_)(A.whitelist.reason),1)):(0,a.Q3)("",!0),(0,a.eW)("\n ("),L,(0,a.eW)(")")]))],2),[[i.aG,A.whitelist.visible]])]))],8,r)}]]);var z=P},6728:function(t,e,n){"use strict";n.d(e,{A:function(){return g}});var a=n(7746),o=n(3674),i=n(1332),r={class:"box-section background-red"},s={key:0},l={class:"upload_preview_dims"},c=["src"],u=["src"],d={key:1,class:"preview-fail box-section background-yellow"},f=(0,a.Lk)("p",null,"The preview for this file failed to load. Please, double check that the URL you provided is correct.",-1);var p={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(2443).A)(p,[["render",function(t,e,n,p,g,h){return(0,a.uX)(),(0,a.CE)("div",{class:(0,o.C4)(["upload_preview_container",n.classes])},[(0,a.bo)((0,a.Lk)("div",r,"\n One of the image dimensions is above the maximum allowed of 15,000px and will fail to upload.\n ",512),[[i.aG,g.overDims]]),(0,a.eW)(),g.failed?((0,a.uX)(),(0,a.CE)("div",d,[f,(0,a.eW)("\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.uX)(),(0,a.CE)("div",s,[(0,a.Lk)("div",l,(0,o.v_)(h.previewDimensions),1),(0,a.eW)(),n.data.isVideo?((0,a.uX)(),(0,a.CE)("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,c)):((0,a.uX)(),(0,a.CE)("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,u))]))],2)}]])},9699:function(t,e,n){"use strict";n.d(e,{A:function(){return d}});var a=n(7746),o=n(3674),i=n(1332),r={class:"related-tags flex-wrap"},s={key:0,class:"related-title"},l=["href","onClick"];function c(t,e){return t.name>e.name?1:-1}var u={props:["tags","related","loading"],data:function(){return{uploaded:window.uploaderSettings.uploadTags||[],recent:(window.uploaderSettings.recentTags||[]).sort(c)}},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 p=(0,u.A)(f,[["render",function(t,e,n,l,c,u){var d=(0,a.g2)("file-source");return(0,a.uX)(),(0,a.CE)(a.FK,null,[(0,a.bo)((0,a.Lk)("div",i,"\n A source must be provided or you must select that there is no available source.\n ",512),[[o.aG,n.showErrors&&u.sourceWarning]]),(0,a.eW)(),c.noSource?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("div",r,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(n.sources,(function(t,e){return(0,a.uX)(),(0,a.Wv)(d,{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 u.removeSource(e)},onAdd:u.addSource,key:e},null,8,["maxSources","last","index","modelValue","onUpdate:modelValue","onDelete","onAdd"])})),128))])),(0,a.eW)(),(0,a.Lk)("div",null,[(0,a.Lk)("label",s,[(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"no_source","onUpdate:modelValue":e[0]||(e[0]=function(t){return c.noSource=t})},null,512),[[o.lH,c.noSource]]),(0,a.eW)("\n No available source.\n ")])])],64)}]])},399:function(t,e,n){"use strict";n.d(e,{A:function(){return v}});var a=n(7746),o=n(1332),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"},l={key:2,class:"tag-preview"};var c=n(3674),u=["href"];var d={props:["tagType","name"]},f=n(2443);var p={components:{"tag-link":(0,f.A)(d,[["render",function(t,e,n,o,i,r){return(0,a.uX)(),(0,a.CE)("a",{class:(0,c.C4)("tag-type-"+n.tagType),href:"/wiki_pages/show_or_new?title="+n.name,target:"_blank"},(0,c.v_)(n.name),11,u)}]])},props:["tag"]};var g={props:["tags","loading"],components:{"tag-preview-tag":(0,f.A)(p,[["render",function(t,e,n,o,i,c){var u=(0,a.g2)("tag-link");return"alias"===n.tag.type?((0,a.uX)(),(0,a.CE)("span",r,[(0,a.Lk)("del",null,[(0,a.bF)(u,{name:n.tag.a,tagType:n.tag.tagTypeA},null,8,["name","tagType"])]),(0,a.eW)("\n \u2192 "),(0,a.bF)(u,{name:n.tag.b,tagType:n.tag.tagTypeB},null,8,["name","tagType"])])):"implication"===n.tag.type?((0,a.uX)(),(0,a.CE)("span",s,[(0,a.bF)(u,{name:n.tag.a,tagType:n.tag.tagTypeA},null,8,["name","tagType"]),(0,a.eW)("\n \u21d2 "),(0,a.bF)(u,{name:n.tag.b,tagType:n.tag.tagTypeB},null,8,["name","tagType"])])):((0,a.uX)(),(0,a.CE)("span",l,[(0,a.bF)(u,{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[l])}))?n.splice(l--,1):(s=!1,i0&&t[u-1][2]>i;u--)t[u]=t[u-1];t[u]=[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={543:0};a.O.j=function(e){return 0===t[e]};var e=function(e,n){var o,i,r=n[0],s=n[1],l=n[2],c=0;if(r.some((function(e){return 0!==t[e]}))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(l)var u=l(a)}for(e&&e(n);c