1var b=Object.defineProperty;var y=(i,t,e)=>t in i?b(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>y(i,typeof t!="symbol"?t+"":t,e);import{m as V,i as d,o as h,k as w,am as A,D as q,s as M,R as U,aB as T,ae as k,bG as L,j as s,a as o,ao as m,E as N,d as P,av as v,ci as S}from"./index-gMe9H88Y.js";import{A as R,L as x}from"./Layout-DlAsL32I.js";import{A as C}from"./ArtistAutoComplete-Ep57U86W.js";import{s as _,a as I}from"./ui-DbMe5zwn.js";import{g as B}from"./utils-functions-Bh68SegF.js";import{T as j}from"./Trans-rGsNC8W2.js";import"./EntryAutoComplete-8EfM9cl2.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};i.__faroBundleId_vocadb_frontend="1774128384054d7495f5124"}catch{}})();var E=Object.defineProperty,u=(i,t,e,a)=>{for(var n=void 0,p=i.length-1,g;p>=0;p--)(g=i[p])&&(n=g(t,e,n)||n);return n&&E(t,e,n),n};class l{constructor(t,e){r(this,"linkToProof","");r(this,"message","");r(this,"privateMessage",!1);r(this,"selectedArtist");r(this,"submitting",!1);r(this,"clearArtist",()=>{this.selectedArtist=void 0});r(this,"setArtist",async t=>{const e=await this.artistRepo.getOne({id:t,lang:this.values.languagePreference});d(()=>{this.selectedArtist=e})});r(this,"submit",async t=>{if(this.selectedArtist)try{this.submitting=!0,await this.artistRepo.requestVerification(t,{artistId:this.selectedArtist.id,message:this.message,linkToProof:this.linkToProof,privateMessage:this.privateMessage})}finally{d(()=>{this.submitting=!1})}});this.values=t,this.artistRepo=e,V(this)}}u([h],l.prototype,"linkToProof");u([h],l.prototype,"message");u([h],l.prototype,"privateMessage");u([h],l.prototype,"selectedArtist");u([h],l.prototype,"submitting");u([w],l.prototype,"submit");const Q=A(()=>{const i=q(),t=M(),[e]=U.useState(()=>new l(i.values,T)),{t:a,ready:n}=k(["ViewRes","ViewRes.User"]),{t:p}=L(),g=a("ViewRes.User:RequestVerification.PageTitle");return s(x,{pageTitle:g,ready:n,title:g,children:o("div",{className:"row-fluid",children:[t.isLoggedIn?o("form",{onSubmit:async f=>{f.preventDefault();try{const c=await S.getToken();await e.submit(c),_("Request sent")}catch(c){throw I(c.response&&c.response.status?B(c.response.status):"Unable to send request."),c}},className:"span6 form",children:[s("label",{children:a("ViewRes.User:RequestVerification.ArtistTitle")}),e.selectedArtist?o("div",{children:[s(m,{to:N.details(P.Artist,e.selectedArtist.id),children:e.selectedArtist.name})," ",s(v,{onClick:e.clearArtist,variant:"danger",className:"btn-mini",children:a("ViewRes:Shared.Clear")})]}):s("div",{children:s(C,{type:"text",maxLength:128,placeholder:a("ViewRes:Shared.Search"),className:"input-xlarge",required:!0,properties:{acceptSelection:e.setArtist}})}),s("br",{}),o("label",{children:[s("input",{type:"radio",checked:e.privateMessage===!1,onChange:()=>d(()=>{e.privateMessage=!1})})," ",a("ViewRes.User:RequestVerification.NoPrivateMessage")]}),o("label",{children:[s("input",{type:"radio",checked:e.privateMessage===!0,onChange:()=>d(()=>{e.privateMessage=!0})})," ",a("ViewRes.User:RequestVerification.PrivateMessage")]}),!e.privateMessage&&o("div",{children:[s("label",{children:a("ViewRes.User:RequestVerification.URL")}),o("div",{className:"inline input-prepend",children:[s("span",{className:"add-on",title:"URL",children:s("i",{className:"icon-globe"})}),s("input",{type:"text",className:"input-xlarge",maxLength:255,required:!0,value:e.linkToProof,onChange:f=>d(()=>{e.linkToProof=f.target.value})})]})]}),s("br",{}),s("label",{children:a("ViewRes.User:RequestVerification.MessageTitle")}),s("textarea",{className:"span11",cols:50,rows:10,value:e.message,onChange:f=>d(()=>{e.message=f.target.value})}),s("br",{}),s(v,{type:"submit",variant:"primary",disabled:!e.selectedArtist||e.submitting,children:a("ViewRes.User:RequestVerification.Send")})]}):s(R,{className:"span6",children:s(j,{i18nKey:"ViewRes.User:RequestVerification.NotLoggedInMessage",components:{1:s(m,{to:"/User/Login",children:a("ViewRes.User:RequestVerification.Login")}),2:s(m,{to:"/User/Create",children:a("ViewRes.User:RequestVerification.Create")})}})}),s(R,{variant:"info",className:"span4",children:s("span",{dangerouslySetInnerHTML:{__html:p("UserRes.RequestVerificationInfo")}})})]})})});export{Q as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.