',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"},M=(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),U={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,[M,(0,a.eW)(),(0,a.Lk)("div",U,[(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,Mt={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"favcount":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&&confirm("Are you sure that you want to lock ".concat(e.length," votes?"))&&$.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&&confirm("Are you sure that you want to delete ".concat(e.length," votes?"))&&$.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","conttags","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,contributor:2,contrib:2,cont:2,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","conttags","conttags_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"conttags":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=$("