티스토리 수익 글 보기
(self.webpackChunkmusicbrainz_server=self.webpackChunkmusicbrainz_server||[]).push([[9251],{“+5o7Rtt”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>h});var i=s(“84yo5bY”),r=s.n(i),n=s(“EdqsaKW”),a=(s(“6g1DHTE”),s(“DNaZxvn”),s(“TZv5lnH”)),o=s(“B21npvo”),l=s(“cGbttel”);const c=function(e){let{area:t,showCreditedAs:s=!0,showDisambiguation:i=!0,showEditsPending:r=!0,showIcon:n=!1,…c}=e;const u={showCreditedAs:s,showDisambiguation:i,showEditsPending:r,showIcon:n},d=(0,l.jsx)(o.A,{entity:t,…c,…u},0);return t.containment?(0,a.A)([d].concat(t.containment.map(((e,t)=>(0,l.jsx)(o.A,{entity:e,…u},t+1))))):d};var u=s(“8alVwqN”),d=s(“HkNzj3j”).l;const h=function(e){let{allowNew:t,className:s,content:i,customArtistCredit:a,deletedCaption:h,disableLink:p=!1,entity:m,showCreditedAs:g=!1,showDeletedArtists:f=!0,showDisambiguation:b=!0,showEditsPending:y=!0,showIcon:w=!1,subPath:v,target:_}=e;const T={showDisambiguation:b,showEditsPending:y,showIcon:w,target:_},k={allowNew:t,className:s,content:i,deletedCaption:h,disableLink:p,showCreditedAs:g,subPath:v,target:_,…T},x=r().unwrap(a||m.artistCredit);if(“area”===m.entityType&&m.gid)return(0,l.jsx)(c,{area:m,…k});const A=(0,l.jsx)(o.A,{entity:m,…k});return(0,n.Nx)(x)?d(“{entity} by {artist}”,{artist:(0,l.jsx)(u.A,{artistCredit:x,showDeleted:f,…T}),entity:A}):”place”===m.entityType&&m.area?d(“{place} in {area}”,{area:(0,l.jsx)(c,{area:m.area,showIcon:w,…T}),place:A}):A}},”+yGjBxw”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>a});s(“60ocjtt”),s(“6g1DHTE”),s(“70YSc4n”),s(“smZuR9W”);var i=s(“75GVkWN”),r=s(“cGbttel”);function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:””,s=t;return””!==t&&(s=”(“+t+”)”),e.split(new RegExp(s,”u”))}const a=function(e){let{filter:t,newText:s,oldText:a,split:o=””}=e;const l=[],c=new RegExp(“^(?:”+o+”)$”);let u;u=””===o||a.length>1024||s.length>1024?(0,i.pJ)(a,s):(0,i.Ay)(n(a,o),n(s,o));for(let e=0;e0&&l[l.length-1].type===r;let h;e+10&&null!=h&&l[l.length-1].type===h&&””!==o&&r===i.TG&&c.test(a);d||p||l.push({text:””,type:r}),r===i.PL?l[l.length-1].text+=t===i.i?a:n:l[l.length-1].text+=r===i.i?a:n}const d=l.map(((e,s)=>{const n=e.type===i.PL?i.WJ[t]:i.WJ[e.type];return n?(0,r.jsx)(“span”,{className:n,children:e.text},s):e.text}));return d.length>1?d:d.length?d[0]:””}},”/DEQ4/f”:(e,t,s)=>{“use strict”;s.d(t,{lQ:()=>A,jN:()=>O,Ay:()=>Y});s(“60ocjtt”),s(“6g1DHTE”),s(“70YSc4n”),s(“AXfG3Yq”),s(“DNaZxvn”),s(“2e4JtF2”),s(“ik8bNVf”),s(“APt52BH”),s(“pjNe0gE”),s(“Sew0me/”),s(“D3Q32+k”),s(“v/7u+RO”);var i=s(“KmaOXyL”),r=s(“LCA85s6”),n=s(“oEgauXb”),a=s(“HMcOWk2”),o=s(“52XjgTZ”),l=s(“YDxZ9xi”),c=s(“xrv16+S”),u=s(“93z9/8f”),d=s(“jhqsV7L”),h=s(“GXDjtXZ”);function p(e){return h.A[e.entityType].sort_name?e.sort_name:e.name}var m=s(“d/wSL5Q”),g=s(“WN/X9IS”),f=s(“cGbttel”),b=s(“SKGBikk”).l,y=s(“HkNzj3j”).l;const w=””;function v(e,t){return(0,u.K)(e.targetType,t.targetType)}const _=(e,t)=>e.typeId-t.typeId||(0,n.UD)(e.textPhrase,t.textPhrase)||(e.backward?1:0)-(t.backward?1:0);function T(e,t){return _(e.linkTypeInfo[0],t.linkTypeInfo[0])}function k(e,t){return(0,d.k)(e.datePeriods[0]??null,t.datePeriods[0]??null)}const x=(e,t)=>(e.linkOrder??0)-(t.linkOrder??0)||(0,d.k)(e.earliestDatePeriod,t.earliestDatePeriod)||(0,n.UD)(e.targetCredit||p(e.target),t.targetCredit||p(t.target))||e.target.id-t.target.id,A=(e,t)=>e.typeID===t.typeID&&(e.text_value??””)===(t.text_value??””)&&(e.credited_as??””)===(t.credited_as??””),E=(e,t)=>(0,c.r1)(e.datePeriods,t.datePeriods,l.A)&&(0,c.r1)(e.attributes,t.attributes,A),I=(e,t,s)=>e.target.id===t.target.id&&e.targetCredit===t.targetCredit&&e.linkOrder===t.linkOrder&&e.hasAttributes===t.hasAttributes&&(!s.compareTracks||(null==e.tracks&&null==t.tracks||null!=e.tracks&&null!=t.tracks&&function(e,t){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}(e.tracks,t.tracks)))&&(!s.compareDatedExtraAttributesLists||(0,c.r1)(e.datedExtraAttributesList,t.datedExtraAttributesList,E)),N={compareDatedExtraAttributesLists:!1,compareTracks:!0},j=(e,t)=>I(e,t,N),S={compareDatedExtraAttributesLists:!0,compareTracks:!1},C=(e,t)=>I(e,t,S),R={compareDatedExtraAttributesLists:!0,compareTracks:!0},L=(e,t)=>I(e,t,R);function P(e){const t=e.phrase;return e.editsPending?(0,f.jsx)(“span”,{className:”mp”,children:t},e.textPhrase):t}function $(e){const t=o.Ay.link_attribute_type[e.typeID];return t.root_id!==r.INSTRUMENT_ROOT_ID&&t.root_id!==r.VOCAL_ROOT_ID}function D(e){for(let r=0;r0;let O=null;if(l){const e=n.linkTypeID+”-“+n.id;O=l.get(e)||null}let z={datedExtraAttributesList:[],earliestDatePeriod:$,editsPending:n.editsPending,hasAttributes:D,isOrderable:L,key:(0,g.NF)(),linkOrder:P,target:a,targetCredit:R,tracks:O};const Y=C.targetGroups.find((e=>j(z,e)));Y?z=Y:C.targetGroups.push(z),$!==z.earliestDatePeriod&&(0,d.k)($,z.earliestDatePeriod)<0&&(z.earliestDatePeriod=$),z.datedExtraAttributesList.push({attributes:[...(0,i.A0)(...E)],datePeriods:[$]}),z.editsPending||=n.editsPending}for(const e of h){const t=e.relationshipPhraseGroups;for(let e=0;ee.rootTypeId===n.rootTypeId)),o=s.targetGroups,l=e.targetGroups;if(a&&(0,c.r1)(o,l,L)){for(let e=0;e1?(0,a.A)(i.map(P)):P(i[0])}}return h}},”/FT4qLG”:(e,t,s)=>{“use strict”;s.d(t,{A9:()=>r});var i=s(“smZuR9W”);i.createContext({action:{name:””},flash:{},relative_uri:””,req:{body_params:{},headers:{},method:””,query_params:{},secure:!1,uri:””},session:null,sessionid:null,stash:{current_language:”en”,current_language_html:”en”}});const r=i.createContext({action:{name:””},relative_uri:””,req:{method:””,query_params:{},uri:””},session:null,stash:{current_language:”en”},user:null})},”/wdNxGF”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>a});var i=s(“smZuR9W”),r=s(“cGbttel”),n=s(“oEgauXb”).l;const a=i.memo((function(e){let{isDoneDisabled:t,onCancel:s,onDone:i}=e;return(0,r.jsxs)(“div”,{className:”buttons”,style:{marginTop:”1em”},children:[(0,r.jsx)(“button”,{className:”negative”,onClick:s,type:”button”,children:n(“Cancel”)}),(0,r.jsx)(“div”,{className:”buttons-right”,children:(0,r.jsx)(“button”,{className:”positive”,disabled:t,onClick:i,type:”button”,children:n(“Done”)})})]})}))},”0+uOLSc”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>c,S:()=>l});var i=s(“zzNunOx”),r=s(“YRn3CNN”),n=s(“PstwrNQ”),a=s(“6xVzkbe”),o=s(“cGbttel”);const l=a.S;const c=function(e){let{children:t,disabled:s=!1,field:l,label:c,required:u=!1,yearInputRef:d,…h}=e;return(0,o.jsxs)(n.A,{children:[(0,o.jsx)(r.A,{forField:l.field.year,label:c,required:u}),(0,o.jsx)(a.A,{disabled:s,field:l,yearInputRef:d,…h}),t,(0,o.jsx)(i.A,{field:l})]})}},”040n2o8″:(e,t,s)=>{“use strict”;s.d(t,{LA:()=>f,Qq:()=>y,f7:()=>p,i5:()=>b,qp:()=>g,qq:()=>h,xf:()=>m});var i=s(“oEgauXb”).g,r=s(“oEgauXb”).en;const n=1,a=2,o=4,l=8,c=16,u=64,d=128,h=(i(“View and modify your private collections”),i(“View your email address”),i(“View your public account information”),i(“View and modify your private ratings”),i(“Submit new barcodes to the database”),i(“Submit new ISRCs to the database”),r(“View and modify your private tags”,”folksonomy”),8),p=256,m=1024,g=2048,f=4096,b=8192,y=16384},”07/sqP2″:(e,t,s)=>{“use strict”;s.d(t,{A:()=>o});var i=s(“zzNunOx”),r=s(“YRn3CNN”),n=s(“PstwrNQ”),a=s(“cGbttel”);const o=function(e){let{autoComplete:t,children:s,className:o,disabled:l=!1,field:c,inputRef:u,label:d,placeholder:h,preview:p=null,required:m=!1,size:g,type:f=”text”,…b}=e;const y={autoComplete:t,className:o,disabled:l,id:”id-“+c.html_name,name:c.html_name,placeholder:h??””,ref:u,required:m,size:g,type:f},w=p??c.value??””;return b.uncontrolled?y.defaultValue=w:(y.onChange=b.onChange,y.value=w),(0,a.jsxs)(n.A,{children:[(0,a.jsx)(r.A,{forField:c,label:d,required:m}),(0,a.jsx)(“input”,{…y}),s,(0,a.jsx)(i.A,{field:c})]})}},”0LgDPGm”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});const i=/^[1-9][0-9]*$/;const r=function(e){return i.test(e)}},”127s6Wg”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});var i=s(“dL1OOKd”);const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=(0,i.A)(e);return”1″===s||”true”===s||”0″!==s&&”false”!==s&&t}},”1OgwVw9″:(e,t,s)=>{“use strict”;s.d(t,{Ay:()=>T,Ff:()=>_,SH:()=>v,sm:()=>b});s(“60ocjtt”),s(“6g1DHTE”),s(“70YSc4n”);var i=s(“FtTxbXM”),r=s(“smZuR9W”),n=s(“Vg37ZR/”),a=s(“IIDwFGn”),o=s(“UQkXO+Y”),l=s(“gtppAbj”),c=s(“NwGYEf3”),u=s(“zzNunOx”),d=s(“cJF07Nt”),h=s(“0+uOLSc”),p=s(“cGbttel”),m=s(“oEgauXb”).l,g=s(“H+29DOL”).O,f=s(“8YlDuzw”).A;function b(e){const t=e.field;return{day:(0,a.A)(t.day.value),month:(0,a.A)(t.month.value),year:(0,a.A)(t.year.value)}}function y(e){const t=e.read(),s=t.field.begin_date,i=t.field.end_date,r=[];s.pendingErrors?.length||i.pendingErrors?.length||(0,l.uJ)(b(s),b(i))||r.push(m(“The end date cannot precede the begin date.”)),e.set(“errors”,t.errors.filter((e=>r.includes(e)))).set(“pendingErrors”,r)}function w(e,t,s){if((0,h.S)(e,t),(“object”!=typeof t||null===t)&&”function”!=typeof t||”set-date”!==t.type){if((“object”!=typeof t||null===t)&&”function”!=typeof t||”show-pending-errors”!==t.type)throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+t);(0,c.oC)(s)}else y(s)}function v(e,t){const s=e.get(“field”);{const i=t;if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-begin-date”===i.type&&”action”in i){const t=i.action;w(s.get(“begin_date”),t,e)}else if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-end-date”===i.type&&”action”in i){const t=i.action;if(w(s.get(“end_date”),t,e),”set-date”===t.type){const s=t.date;(0,n.Z)(s)&&v(e,{enabled:!0,type:”set-ended”})}}else if((“object”==typeof i&&null!==i||”function”==typeof i)&&”set-ended”===i.type&&”enabled”in i){const e=i.enabled;s.set(“ended”,”value”,e)}else{if((“object”!=typeof i||null===i)&&”function”!=typeof i||”copy-date”!==i.type)throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+i);{const t=s.read().begin_date.field,i=String(t.year.value??””),r=String(t.month.value??””),a={day:String(t.day.value??””),month:r,year:i};(0,h.S)(s.get(“end_date”),{date:a,type:”set-date”}),(0,n.Z)(a)&&v(e,{enabled:!0,type:”set-ended”}),y(e),(0,c.oC)(e)}}}}function _(e,t){const s=(0,i.A)(e);return v(s,t),s.final()}const T=r.memo((function(e){let{children:t,disabled:s=!1,dispatch:i,endedLabel:r,field:a,beginArea:l,endArea:c}=e;const y=a.field,w=(0,o.A)(i);return(0,p.jsxs)(“fieldset”,{children:[(0,p.jsx)(“legend”,{children:m(“Date period”)}),(0,p.jsx)(“p”,{children:m(“Dates are in the format YYYY-MM-DD.\n Partial dates such as YYYY-MM or just YYYY are OK,\n or you can omit the date entirely.”)}),(0,p.jsx)(h.A,{disabled:s,dispatch:w.beginDateDispatch,field:y.begin_date,label:g(m(“Begin date”)),yearInputRef:w.beginYearInputRef,children:(0,p.jsx)(“button”,{className:”icon copy-date”,disabled:s,onClick:w.handleDateCopy,title:m(“Copy to end date”),type:”button”})}),l,(0,p.jsx)(h.A,{disabled:s,dispatch:w.endDateDispatch,field:y.end_date,label:g(m(“End date”)),yearInputRef:w.endYearInputRef}),c,(0,p.jsx)(u.A,{field:a,includeSubFields:!1}),f(r)?(0,p.jsx)(d.A,{disabled:s||(0,n.Z)(b(y.end_date)),field:y.ended,label:r,onChange:w.handleEndedChange}):null,t]})}))},”1hBcSWX”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n});var i=s(“cGbttel”),r=s(“8YlDuzw”).A;const n=function(e){let{id:t,onClick:s,label:n}=e;return(0,i.jsx)(“button”,{className:”add-item”+(r(n)?” with-label”:””),id:t,onClick:s,type:”button”,children:r(n)?n:null})}},”1viFeHS”:(e,t,s)=>{“use strict”;s.d(t,{wI:()=>xe,IS:()=>$e,mb:()=>De,Dc:()=>Le,Bt:()=>Oe});s(“60ocjtt”),s(“6g1DHTE”),s(“Kqb1L/m”),s(“70YSc4n”),s(“AXfG3Yq”),s(“XteD3uf”),s(“DNaZxvn”),s(“NKd1yOY”),s(“gdf1lGT”),s(“wvF7LKQ”),s(“PkUg7wA”),s(“2e4JtF2”),s(“ik8bNVf”),s(“APt52BH”),s(“pjNe0gE”),s(“Sew0me/”),s(“D3Q32+k”),s(“v/7u+RO”),s(“+zMNUwn”),s(“kvaNrFd”),s(“o5/UKe6”),s(“paccsHs”);var i=s(“bv+x2iX”),r=s(“EVdnBjI”),n=s.n(r),a=s(“84yo5bY”),o=s.n(a),l=s(“smZuR9W”),c=s(“pKdT8YG”),u=s(“Ui1Lssl”),d=s(“LCA85s6”),h=s(“oEgauXb”),p=s(“HkNzj3j”),m=s(“52XjgTZ”),g=s(“VHUgtNR”),f=s(“xrv16+S”),b=s(“xNKEMJr”),y=s(“cbdMZik”),w=s(“jhqsV7L”),v=s(“yUJAgX5”),_=s(“e3+xVn3”),T=s(“Vg37ZR/”),k=s(“HfEq/qN”),x=s(“WN/X9IS”),A=s(“VNyMmCx”),E=s(“rAs4fSN”),I=s(“n4qWIJf”),N=s(“FtTxbXM”),j=s(“PzvTjBu”),S=s(“JMEfy8P”),C=s(“l8ZfC6+”),R=s(“NwGYEf3”),L=s(“1OgwVw9”),P=s(“zzNunOx”),$=s(“07/sqP2”),D=s(“cGbttel”),O=s(“oEgauXb”).l,z=s(“H+29DOL”).O;const Y=function(e){let{dispatch:t,field:s}=e;return(0,D.jsxs)(“fieldset”,{children:[(0,D.jsx)(“legend”,{children:O(“Credit”)}),(0,D.jsx)($.A,{field:s,label:z(O(“Credited to”)),onChange:function(e){t({credit:e.currentTarget.value,type:”update-relationship-credit”})}}),(0,D.jsx)(P.A,{field:s,includeSubFields:!1})]})};var U=s(“oEgauXb”).l,W=s(“oEgauXb”).lp;const H=e=>{const t=e.relationship,s=t.begin_date,i=t.end_date,r=(0,C.Fv)(“credit”,e.creditableEntityProp?t[e.creditableEntityProp]:null),n={errors:[],field:{begin_date:(0,C.tN)(“period.begin_date”,{day:s?.day??null,month:s?.month??null,year:s?.year??null}),end_date:(0,C.tN)(“period.end_date”,{day:i?.day??null,month:i?.month??null,year:i?.year??null}),ended:(0,C.Fv)(“period.ended”,t.ended)},has_errors:!1,html_name:””,id:0,type:”compound_field”};return{credit:r,datePeriodField:n,initialDatePeriodField:n}},M=(e,t)=>{const s=(0,N.A)(e);{const e=t;if((“object”==typeof e&&null!==e||”function”==typeof e)&&”update-date-period”===e.type&&”action”in e){const t=e.action;(0,L.SH)(s.get(“datePeriodField”),t)}else if((“object”==typeof e&&null!==e||”function”==typeof e)&&”update-initial-date-period”===e.type&&”props”in e){const t=e.props;(0,S.Pu)(H(t).initialDatePeriodField,s.get(“initialDatePeriodField”))}else if((“object”!=typeof e||null===e)&&”function”!=typeof e||”reset”!==e.type)if((“object”!=typeof e||null===e)&&”function”!=typeof e||”show-all-pending-errors”!==e.type){if((“object”!=typeof e||null===e)&&”function”!=typeof e||”update-relationship-credit”!==e.type||!(“credit”in e))throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+e);{const t=e.credit;s.set(“credit”,”value”,t)}}else(0,R.oC)(s.get(“datePeriodField”));else(0,S.Pu)(s.get(“initialDatePeriodField”).read(),s.get(“datePeriodField”))}return s.final()};const B=function(e){const[t,s]=l.useState(!1),[i,r]=l.useReducer(M,e,H),n=(0,R.mJ)(i.datePeriodField);l.useEffect((()=>{r({props:e,type:”update-initial-date-period”})}),[e]);const a=l.useCallback((e=>{r({action:e,type:”update-date-period”})}),[r]),o=e=>{“Enter”===e.key&&n&&(r({type:”show-all-pending-errors”}),e.preventDefault())},c=(t,s)=>{t.stopPropagation(),t.preventDefault(),n?r({type:”show-all-pending-errors”}):(t=>{if(n)return;const s=i.datePeriodField.field,r={begin_date:(0,L.sm)(s.begin_date),end_date:(0,L.sm)(s.end_date),ended:s.ended.value};e.creditableEntityProp&&(r[e.creditableEntityProp]=i.credit.value),e.onConfirm(r),t()})(s)};return(0,D.jsx)(j.A,{buildChildren:t=>(0,D.jsxs)(“form”,{className:”external-link-attribute-dialog”,onKeyDown:o,onSubmit:e=>c(e,t),children:[(0,D.jsx)(L.Ay,{dispatch:a,endedLabel:U(“This relationship has ended.”),field:i.datePeriodField}),e.creditableEntityProp?(0,D.jsx)(Y,{dispatch:r,field:i.credit}):null,(0,D.jsxs)(“div”,{className:”buttons”,style:{display:”block”,marginTop:”1em”},children:[(0,D.jsx)(“button”,{className:”negative”,onClick:t,type:”button”,children:U(“Cancel”)}),(0,D.jsx)(“div”,{className:”buttons-right”,children:(0,D.jsx)(“button”,{className:”positive”,disabled:n,type:”submit”,children:U(“Done”)})})]})]}),buttonContent:null,buttonProps:{className:”icon edit-item”,title:W(“Edit attributes”,”interactive”)},id:”external-link-attribute-dialog”,isOpen:t,toggle:e=>{e&&r({type:”reset”}),s(e)}})};var F=s(“Ez3XeuZ”),G=s(“QBOBohR”),X=s(“6lYEAin”),K=s(“TeVBGSm”),V=s(“H+29DOL”).O,q=s(“oEgauXb”).l,Z=s(“oEgauXb”).lp;const J=function(e){let{cleanupUrl:t,link:s,onConfirm:i,validateLink:r}=e;const[n,a]=l.useState(!1),[o,c]=l.useState(s);l.useEffect((()=>{c(s)}),[s]);const u=e=>{const s=e.currentTarget.value;c({…o,rawUrl:s,url:t(s)})},d=e=>{i(o.rawUrl),e()};return(0,D.jsx)(j.A,{buildChildren:e=>{const t=r(o);return(0,D.jsxs)(“form”,{onSubmit:t=>{t.preventDefault(),t.stopPropagation(),d(e)},children:[(0,D.jsx)(“table”,{children:(0,D.jsxs)(“tbody”,{children:[(0,D.jsxs)(“tr”,{children:[(0,D.jsx)(“td”,{className:”section”,children:V(q(“URL”))}),(0,D.jsxs)(“td”,{children:[(0,D.jsx)(“input”,{className:”value raw-url”,onChange:u,style:{width:”336px”},value:o.rawUrl}),t&&t.target===K.Yb.URL?(0,D.jsx)(“div”,{className:”error field-error target-url”,”data-visible”:”1″,children:t.message}):null]})]}),o.url?(0,D.jsxs)(“tr”,{children:[(0,D.jsx)(“td”,{className:”section”,style:{whiteSpace:”nowrap”},children:V(q(“Cleaned up to”))}),(0,D.jsx)(“td”,{children:t?o.url:(0,D.jsx)(“a”,{className:”clean-url”,href:o.url,rel:”noreferrer”,style:{overflowWrap:”anywhere”},target:”_blank”,children:o.url})})]}):null]})}),(0,D.jsxs)(“div”,{className:”buttons”,style:{display:”block”,marginTop:”1em”},children:[(0,D.jsx)(“button”,{className:”negative”,onClick:()=>{c(s),a(!1)},type:”button”,children:q(“Cancel”)}),(0,D.jsx)(“div”,{className:”buttons-right”,children:(0,D.jsx)(“button”,{className:”positive”,onClick:()=>d(e),type:”button”,children:q(“Done”)})})]})]})},buttonContent:null,buttonProps:{className:”icon edit-item”,title:Z(“Edit URL”,”interactive”)},id:”url-input-popover”,isOpen:n,toggle:e=>{e||i(o.rawUrl),a(e)}})};var Q=s(“2ath9Yi”),ee=s(“KzhY9EY”),te=s(“0LgDPGm”),se=s(“hJIxiGq”);const ie=[“bruit.app”,”distrokid.com”,”trac.co”],re=[“adf.ly”,”album.link”,”allmylinks.com”,”ampl.ink”,”amu.se”,”artist.link”,”band.link”,”bfan.link”,”biglink.to”,”bio.link”,”bit.ly”,”bitly.com”,”backl.ink”,”bruit.app”,”bstlnk.to”,”cli.gs”,”deck.ly”,”distrokid.com”,”ditto.fm”,”eventlink.to”,”fanlink.to”,”ffm.to”,”found.ee”,”fty.li”,”fur.ly”,”g.co”,”gate.fm”,”geni.us”,”goo.gl”,”hypeddit.com”,”hypel.ink”,”hyperfollow.com”,”hyperurl.co”,”is.gd”,”kl.am”,”koji.game”,”koji.sh”,”laburbain.com”,”li.sten.to”,”linkco.re”,”lnkfi.re”,”linkfly.to”,”linktr.ee”,”listen.lt”,”lnk.bio”,”lnk.co”,”lnk.site”,”lnk.to”,”lsnto.me”,”many.link”,”mcaf.ee”,”mez.ink”,”moourl.com”,”music.indiefy.net”,”musics.link”,”mylink.page”,”myurls.bio”,”odesli.co”,”onerpm.link”,”orcd.co”,”owl.ly”,”page.link”,”pandora.app.link”,”podlink.to”,”pods.link”,”push.fm”,”rb.gy”,”rubyurl.com”,”share.amuse.io”,”smarturl.it”,”snd.click”,”song.link”,”songwhip.com”,”spinnup.link”,”spoti.fi”,”sptfy.com”,”spread.link”,”streamerlinks.com”,”streamlink.to”,”strm.to”,”su.pr”,”t.co”,”tiny.cc”,”tinyurl.com”,”tourlink.to”,”trac.co”,”u.nu”,”unitedmasters.com”,”untd.io”,”vyd.co”,”withkoji.com”,”yep.it”].map((e=>new RegExp(“^https?://([^/]+\\.)?”+(0,se.A)(e)+(ie.includes(e)?”/.+”:”(?:/.*)?$”),”i”)));var ne=s(“KmaOXyL”),ae=s(“r1ucMe4”),oe=s(“x5U3UhS”),le=s(“8YlDuzw”).A,ce=s(“2k2mX3K”).RL,ue=s(“HkNzj3j”).l,de=s(“SKGBikk”).l,he=s(“oEgauXb”).lp,pe=s(“H+29DOL”).O,me=s(“SKGBikk”).lp;const ge=”rel-add”,fe=”rel-edit”,be=””,ye=”rel-remove”;class we extends l.Component{constructor(e){super(e);const t=e.sourceData,s=t.entityType,i=[s,”url”].sort().join(“-“);let r=function(e){const t=e?.relationships;if(!t)return[];return t.reduce((function(t,s){const i=s.target;return”url”===i.entityType&&t.push({begin_date:s.begin_date||d.EMPTY_PARTIAL_DATE,deleted:!1,editsPending:s.editsPending,end_date:s.end_date||d.EMPTY_PARTIAL_DATE,ended:s.ended||!1,entity0:e||null,entity0_credit:s.entity0_credit||””,entity1:i,entity1_credit:s.entity1_credit||””,pendingTypes:null,rawUrl:i.name,relationship:s.id,submitted:!0,type:s.linkTypeID??null,url:i.name,video:!!s.attributes&&s.attributes.some(Se)}),t}),[])}(t);r.sort((function(e,t){const s=e.type&&m.Ay.link_type[e.type],i=t.type&&m.Ay.link_type[t.type];return(0,h.UD)(s?ce(s.link_phrase).toLowerCase():””,i?ce(i.link_phrase).toLowerCase():””)}));const n=`submittedLinks_${s}_${(0,_.A)(t.id)?t.id:”new”}`;if(this.submittedLinksWrapper={get(){if(k.go){const e=k.HI.get(n);if(e)return(0,ee.E)(JSON.parse(e)).filter((e=>!Ne(e))).map(Ee)}},remove(){k.HI.remove(n)},set(e){k.go&&k.HI.set(n,JSON.stringify((0,ee.d)(e)))}},”undefined”!=typeof window){if(“POST”===(0,y.tr)().req.method&&”release”!==s){const e=this.submittedLinksWrapper.get();e&&(r=e,this.submittedLinksWrapper.remove())}else{const e=new RegExp(“(?:\\?|&)edit-“+(“release_group”===s?”release-group”:s)+”\\.url\\.([0-9]+)\\.(text|link_type_id)=([^&]+)”,”g”),t={};let i;for(;i=e.exec(window.location.search);){const[,e,s,r]=i;switch(s){case”link_type_id”:case”text”:(t[e]||={})[s]=decodeURIComponent(r)}}for(const e of Object.values(t))r.push(Ee({rawUrl:e.text||””,relationship:(0,x.NF)(“new-“),type:parseInt(e.link_type_id,10)||null,url:Le(e.text||””)}))}}const a=[],c=[];for(const e of r)if((0,te.A)(e.relationship))a.push(e);else{const t=Le(e.url);c.push({…e,relationship:(0,x.NF)(“new-“),url:K.LS(t)||t})}const u=(0,f.$z)(a,Ie);r=a.concat(c.filter((e=>!u.has(Ie(e))))),this.typeOptions=(0,ae.linkTypeOptions)({children:m.Ay.link_type_tree[i]},/^url-/.test(i)),this.sourceType=s,this.initialLinks=r,d.ENTITIES_WITH_RELATIONSHIP_CREDITS[s]?this.creditableEntityProp=s<"url"?"entity0_credit":"entity1_credit":this.creditableEntityProp=null,this.state={links:je(r)},this.tableRef=l.createRef(),this.oldLinks=this.getOldLinksHash(),this.generalLinkTypes=this.typeOptions.filter((e=>e.disabled||!K.Rl.includes(e.data.gid))),this.errorObservable=e.errorObservable||oe.LI(o().observable(!1)),this.copyEditDataToReleaseEditor()}copyEditDataToReleaseEditor(){const e=g.A._releaseEditor;e&&e.externalLinksEditData(this.getEditData())}componentDidUpdate(){this.copyEditDataToReleaseEditor()}setLinkState(e,t,s){const i=this.state.links.slice(0);i[e]={…i[e],…t},this.setState({links:i},s)}cleanupUrl(e){return e.match(/^\w+\./)&&(e=”http://”+e),K.LS(e)||e}handleUrlChange(e,t,s){let i=s;””!==i?this.setState((t=>{const r=[…t.links];return e.forEach((e=>{const t=r[e];i.trim()!==t.url.trim()&&(i=this.cleanupUrl(i));const n={…r[e],rawUrl:s,url:i},a=new K.A$(i,this.sourceType),o=a.guessType(),l=a.getPossibleTypes(),c=this.filterTypeOptions(l);t.type&&!c.some((e=>e.data.id===t.type))&&(n.type=null),!n.type&&o&&(“string”==typeof o?n.type=m.Ay.link_type[o].id:(n.type=m.Ay.link_type[o[0]].id,n.pendingTypes=o.slice(1).map((e=>m.Ay.link_type[e].id)))),r[e]=n})),{links:je(r,-1)}})):this.removeLinks(e,t)}handleUrlBlur(e,t,s,i,r){const a={…this.state.links[e]},o=s.currentTarget.value,l=Le(o.trim());if(o!==l&&(a.url=l),””===o||!r||t&&!a.type)this.setLinkState(e,a);else if(a.submitted=!0,t){const t=s.relatedTarget;t&&t.dataset.index===i.toString()&&(a.submitted=!1),this.setLinkState(e,a,(()=>{a.submitted&&this.submitPendingTypes(a,e),n()(this.tableRef.current).find(“input[type=’url’]”).eq(0).focus()}))}else this.setLinkState(e,a,(()=>{a.submitted&&this.submitPendingTypes(a,e)}))}submitPendingTypes(e,t){const s=e.pendingTypes;s&&this.setState((i=>{let r=[…i.links];r[t]={…r[t],pendingTypes:null};const n=r.findIndex((e=>!(0,te.A)(e.relationship)&&Ne(e)));return n>0&&r.splice(n),r=r.concat(s.map((t=>Ee({…{submitted:!0,type:t,url:e.url},relationship:(0,x.NF)(“new-“)})))),{links:je(r,-1)}}))}handleLinkSubmit(e,t,s,i){const r={…this.state.links[e]},a=s.currentTarget.value,o=Le(a.trim());a!==o&&(r.url=o),””!==a&&i?(r.submitted=!0,this.setLinkState(e,r,(()=>{this.submitPendingTypes(r,e),r.type?n()(this.tableRef.current).find(`tr.external-link-item:eq(${t+1})`).find(“a,input”).eq(0).focus():n()(this.tableRef.current).find(`tr.external-link-item:eq(${t})\n + tr.relationship-item`).find(“select.link-type”).focus()}))):this.setLinkState(e,r)}handleTypeChange(e,t){const s=Number(t.currentTarget.value)||null,i={…this.state.links[e]};i.type=s,this.setLinkState(e,i)}handleTypeBlur(e,t,s,i,r){if(!s||!r)return;const a=t.relatedTarget;if(a&&a.dataset.index===i.toString())return;const o={…this.state.links[e]};o.url&&o.type&&(o.submitted=!0),this.setLinkState(e,o,(()=>{this.submitPendingTypes(o,e),n()(this.tableRef.current).find(“input[type=’url’]”).eq(0).focus()}))}handleVideoChange(e,t){this.setLinkState(e,{video:t.currentTarget.checked})}removeLink(e){this.setState((t=>{const s=t.links.slice(0),i=s[e];return(0,te.A)(i.relationship)?s[e]={…i,deleted:!i.deleted}:s.splice(e,1),{links:s}}))}removeLinks(e,t){this.setState((t=>{const s=[…t.links];for(let t=e.length-1;t>=0;–t){const i=e[t],r=s[i];(0,te.A)(r.relationship)?s[i]={…r,deleted:!r.deleted}:s.splice(i,1)}return{links:je(s,-1)}}),(()=>{n()(this.tableRef.current).find(`tr.external-link-item:eq(${t})`).find(“button.edit-item, input”).eq(0).focus()}))}addRelationship(e,t){this.setState((t=>{const s=[…t.links],i=s.length,r=s[i-1];if(“”===r.url)return s[i-1]={…r,submitted:!0,url:e},{links:je(s)};const n=Ee({relationship:(0,x.NF)(“new-“),submitted:!0,url:e});return{links:t.links.concat([n])}}),(()=>{n()(this.tableRef.current).find(`tr.add-relationship:eq(${t})`).prev().find(“select.link-type”).focus()}))}getOldLinksHash(){return(0,f.pY)(this.initialLinks.filter((e=>(0,te.A)(e.relationship))),(e=>String(e.relationship)))}getEditData(){const e=this.getOldLinksHash(),t=(0,f.pY)(this.state.links.filter((e=>!e.deleted)),(e=>String(e.relationship)));return{allLinks:new Map([…e,…t]),newLinks:t,oldLinks:e}}getFormData(e,t,s){let i=0;const r=this.sourceType>”url”,{oldLinks:n,newLinks:a,allLinks:o}=this.getEditData();for(const[l,c]of o){if(!c?.type)return;const o=e+”.”+(t+i++);(0,te.A)(l)&&(s(o,”relationship_id”,String(l)),a.has(l)||s(o,”removed”,”1″)),s(o,”text”,c.url),c.video?s(o+”.attributes.0″,”type.gid”,d.VIDEO_ATTRIBUTE_GID):n.get(l)?.video&&(s(o+”.attributes.0″,”type.gid”,d.VIDEO_ATTRIBUTE_GID),s(o+”.attributes.0″,”removed”,”1″)),r&&s(o,”backward”,”1″),s(o,”link_type_id”,String(c.type)||””),this.creditableEntityProp&&s(o,this.creditableEntityProp,c[this.creditableEntityProp]||””);const u=c.begin_date||d.EMPTY_PARTIAL_DATE,h=c.end_date||d.EMPTY_PARTIAL_DATE;s(o,”period.begin_date.year”,u.year?String(u.year):””),s(o,”period.begin_date.month”,u.month?String(u.month):””),s(o,”period.begin_date.day”,u.day?String(u.day):””),s(o,”period.end_date.year”,h.year?String(h.year):””),s(o,”period.end_date.month”,h.month?String(h.month):””),s(o,”period.end_date.day”,h.day?String(h.day):””),s(o,”period.ended”,c.ended?”1″:”0″)}}validateLink(e,t){const s=(0,f.$z)((0,f.hS)(this.state.links.concat(this.initialLinks),(e=>e.relationship)),Ie);let i=null;const r=e.type?m.Ay.link_type[e.type]:null;t||=new K.A$(e.url,this.sourceType);const n=this.oldLinks.get(String(e.relationship)),a=!(0,te.A)(e.relationship),o=n&&e.url!==n.url,l=a||o,c=n&&Number(e.type)!==Number(n.type);if(Ne(e))i=null;else if(e.url)if(l&&!Pe(e.url))i={message:ue(“Please enter a valid URL, such as “{example_url}”.”,{example_url:(0,D.jsx)(“span”,{className:”url-quote”,children:”http://example.com/”})}),target:K.Yb.URL};else if(l&&(u=e.url,/^https?:\/\/(?:[^/]+\.)?example\.(?:com|org|net)(?:\/.*)?$/.test(u)))i={message:ue(““{example_url}” is just an example.\n Please enter the actual link you want to add.”,{example_url:(0,D.jsx)(“span”,{className:”url-quote”,children:e.url})}),target:K.Yb.URL};else if(l&&function(e){return/^https?:\/\/([^/]+\.)?musicbrainz\.org/.test(e)}(e.url))i={message:(0,h.l)(“Links to MusicBrainz URLs are not allowed.\n Did you mean to paste something else?”),target:K.Yb.URL};else if(l&&function(e){return/^https?:\/\/([^/]+\.)?critiquebrainz\.org/.test(e)}(e.url))i={message:de(“Please don’t enter CritiqueBrainz links — reviews\n are automatically linked from the “{reviews_tab_name}” tab.”,{reviews_tab_name:(0,h.l)(“Reviews”)}),target:K.Yb.URL};else if(l&&(0,E.Q)(e.url))i={message:(0,h.l)(“Links to this website are not allowed\n because it is known to host malware.”),target:K.Yb.URL};else if(l&&function(e){return re.some((function(t){return null!==e.match(t)}))}(e.url))i={message:(0,h.l)(“Please don’t enter bundled/shortened URLs,\n enter the destination URL(s) instead.”),target:K.Yb.URL};else if(l&&function(e){return/^https?:\/\/([^/]+\.)?google\.[^/]+\/amp/.test(e)}(e.url))i={message:(0,h.l)(“Please don’t enter Google AMP links,\n since they are effectively an extra redirect.\n Enter the destination URL instead.”),target:K.Yb.URL};else if(l&&function(e){return/^https?:\/\/(?:[^/?#]+\.)?google\.[^/?#]+\/search/.test(e)}(e.url))i={message:(0,h.l)(“Please don’t enter links to search results.\n If you’ve found any links through your search\n that seem useful, do enter those instead.”),target:K.Yb.URL};else if(e.type){if(r&&r.deprecated&&(a||c))i={message:(0,h.l)(“This relationship type is deprecated \n and should not be used.”),target:K.Yb.RELATIONSHIP};else if((s.get(Ie(e))||[]).length>1)i={blockMerge:!0,message:(0,h.l)(“This relationship already exists.”),target:K.Yb.RELATIONSHIP};else if(r&&l){const e=t.checkRelationship(r.gid);e.result||(i={message:””,target:K.Yb.NONE},i.target=e.target||K.Yb.NONE,i.target===K.Yb.URL&&(i.message=(0,h.l)(“This URL is not allowed\n for the selected link type,\n or is incorrectly formatted.”)),i.target===K.Yb.RELATIONSHIP&&(i.message=(0,h.l)(“This URL is not allowed \n for the selected link type.”)),i.target===K.Yb.ENTITY&&(i.message=(“object”==typeof t&&null!==t||”function”==typeof t)&&”area”===t.entityType?(0,h.l)(“This URL is not allowed for areas.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”artist”===t.entityType?(0,h.l)(“This URL is not allowed for artists.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”event”===t.entityType?(0,h.l)(“This URL is not allowed for events.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”genre”===t.entityType?(0,h.l)(“This URL is not allowed for genres.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”instrument”===t.entityType?(0,h.l)(“This URL is not allowed for instruments.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”label”===t.entityType?(0,h.l)(“This URL is not allowed for labels.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”place”===t.entityType?(0,h.l)(“This URL is not allowed for places.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”recording”===t.entityType?(0,h.l)(“This URL is not allowed for recordings.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”release”===t.entityType?(0,h.l)(“This URL is not allowed for releases.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”release_group”===t.entityType?(0,h.l)(“This URL is not allowed for release groups.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”series”===t.entityType?(0,h.l)(“This URL is not allowed for series.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”work”===t.entityType?(0,h.l)(“This URL is not allowed for works.”):(“object”==typeof t&&null!==t||”function”==typeof t)&&”url”===t.entityType?””:(()=>{throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+t)})()),i.message=e.error||i.message)}}else i={message:(0,h.l)(“Please select a link type for the URL\n you’ve entered.”),target:K.Yb.RELATIONSHIP};else i={message:(0,h.l)(“Required field.”),target:K.Yb.URL};var u;return i}filterTypeOptions(e){return e?this.typeOptions.filter((t=>!!t.disabled||e.some((e=>”string”==typeof e?e===t.data.gid:e.includes(t.data.gid))))):this.generalLinkTypes}getURLHighlightType(e){const t=e[0];if(this.props.isNewEntity)return be;const s=this.oldLinks.get(String(t.relationship));return s&&t.url!==s.url?fe:e.every((e=>!(0,te.A)(e.relationship)))?ge:e.every((e=>e.deleted))?ye:be}getRelationshipHighlightType(e,t){if(this.props.isNewEntity)return be;if(e.deleted)return ye;if(!(0,te.A)(e.relationship))return ge;const s=this.oldLinks.get(String(e.relationship)),i=s&&Number(e.type)!==Number(s.type),r=s&&t&&s[t]!==e[t],n=s&&(0,w.k)(s,e);return i||r||n?fe:be}isNewOrChangedLink(e){if(!(0,te.A)(e.relationship))return!0;const t=this.oldLinks.get(String(e.relationship)),s=t&&e.url!==t.url,i=t&&Number(e.type)!==Number(t.type);return Boolean(s||i)}render(){this.errorObservable(!1);const e=function(e){const t=new Map,s=new Set;let i=0;return e.forEach(((e,r)=>{const n={…e,error:null,index:r,urlIndex:r},a=`${e.url}-${e.type??””}`,o=e.submitted&&!s.has(a)?e.url:String(e.relationship),l=t.get(o);l?(n.urlIndex=l[0].urlIndex,l.push(n)):(n.urlIndex=i++,t.set(o,[n])),s.add(a)})),t}(this.state.links),t=Array.from(e);return(0,D.jsx)(“table”,{className:”row-form”,id:”external-links-editor”,ref:this.tableRef,children:(0,D.jsx)(“tbody”,{children:t.map(((s,i)=>{const r=s[1],{url:n,rawUrl:a,entity1:o}=r[0],l=i===t.length-1,c=[…r],u=[],d=c[0].submitted?null:e.get(n);let p=null,g=!1,f=!0;const b=new K.A$(n,this.sourceType),y=b.getPossibleTypes(),w=[],v=this.filterTypeOptions(y);c.forEach((e=>{u.push(e.index);const t=e.type?m.Ay.link_type[e.type]:null;t&&w.push(t.gid);const s=this.validateLink(e,b);s&&(this.isNewOrChangedLink(e)&&(this.errorObservable(!0),g=!0),s.target===K.Yb.RELATIONSHIP?e.error=s:(f=!1,p=s),s.blockMerge&&(f=!1))}));let _=null!=c[0].pendingTypes;const T=b.checkRelationships(w,y),k=c.some((e=>this.isNewOrChangedLink(e)));T.result?_=y&&1===y.length:k&&c[0].submitted&&w.length>0&&!g&&(this.errorObservable(!0),p={message:T.error||(0,h.l)(“This relationship type combination is invalid.”),target:T.target||K.Yb.RELATIONSHIP});const x=u[0];return(0,D.jsx)(ke,{canMerge:f,cleanupUrl:e=>this.cleanupUrl(e),creditableEntityProp:this.creditableEntityProp,duplicate:d?d[0].urlIndex:null,error:p,getRelationshipHighlightType:e=>this.getRelationshipHighlightType(e,this.creditableEntityProp),handleAttributesChange:(e,t)=>this.setLinkState(e,t),handleLinkRemove:e=>this.removeLink(e),handleLinkSubmit:e=>this.handleLinkSubmit(x,i,e,f),handleUrlBlur:e=>this.handleUrlBlur(x,null!=d,e,i,f),handleUrlChange:e=>this.handleUrlChange(u,i,e),highlight:this.getURLHighlightType(c),index:i,isLastLink:l,isOnlyLink:1===t.length,onAddRelationship:e=>this.addRelationship(e,i),onTypeBlur:(e,t)=>this.handleTypeBlur(e,t,null!=d,i,f),onTypeChange:(e,t)=>this.handleTypeChange(e,t),onUrlRemove:()=>this.removeLinks(u,i),onVideoChange:(e,t)=>this.handleVideoChange(e,t),rawUrl:a,relationships:c,typeOptions:v,url:n,urlEntity:o,urlMatchesType:_,validateLink:e=>this.validateLink(e)},i)}))})})}}function ve(e){let{handleTypeBlur:t,handleTypeChange:s,options:i,type:r}=e;const n=i.some((e=>e.value===r)),a=r?m.Ay.link_type[r]:null,o=n||!a?” “:ce(a.link_phrase);return(0,D.jsxs)(“select”,{className:n||!r?”link-type”:”link-type error”,onBlur:t,onChange:s,value:r||””,children:[(0,D.jsx)(“option”,{value:””,children:o}),i.map((e=>(0,D.jsx)(“option”,{disabled:e.disabled,value:e.value,children:e.text},e.value)))]})}function _e(e){let{type:t}=e;const s=t?m.Ay.link_type[t]:null;let i=””;return s&&s.description&&(i=ue(“{description} ({url|more documentation})”,{description:(0,p.Ay)(ce(s.description)),url:”/relationship/”+s.gid})),(0,D.jsx)(F.A,{content:(0,D.jsx)(“div”,{style:{textAlign:”left”},children:i})})}const Te=e=>{const{creditableEntityProp:t,link:s,hasUrlError:i,highlight:r,urlMatchesType:n}=e,a=s.type?m.Ay.link_type[s.type]:null,o=a&&a.type1>”url”,l=(0,T.Z)(s.begin_date)||(0,T.Z)(s.end_date)||s.ended,c=!(!s.error&&!i)||!(n||Ne(s)),u=t?s[t]:null;return(0,D.jsxs)(“tr”,{className:”relationship-item”,children:[(0,D.jsx)(“td”,{}),(0,D.jsxs)(“td”,{className:”link-actions”,children:[e.isOnlyRelationship||e.urlMatchesType?null:(0,D.jsx)(X.A,{onClick:()=>e.onLinkRemove(s.index),title:he(“Remove relationship”,”interactive”)}),(0,D.jsx)(B,{creditableEntityProp:t,onConfirm:t=>e.onAttributesChange(s.index,t),relationship:s})]}),(0,D.jsxs)(“td”,{children:[(0,D.jsxs)(“div”,{className:`relationship-content ${r}`,children:[(0,D.jsx)(“label”,{children:pe((0,h.l)(“Type”))}),(0,D.jsxs)(“label”,{className:”relationship-name”,children:[c?(0,D.jsx)(ve,{handleTypeBlur:t=>e.onTypeBlur(s.index,t),handleTypeChange:t=>e.onTypeChange(s.index,t),options:e.typeOptions.reduce(((t,s,i)=>{const r=e.typeOptions[i+1];return(!s.disabled||r&&r.data.parent_id===s.value)&&t.push(s),t}),[]),type:s.type}):a?o?(0,ne.Av)(a,a.l_reverse_link_phrase??””):(0,ne.Av)(a,a.l_link_phrase??””):null,!s.url||s.error||i?null:(0,D.jsx)(_e,{type:s.type}),(0,D.jsx)(G.A,{relationship:s}),l?(0,D.jsxs)(“span”,{className:”date-period”,children:[” “,(0,b.x)((0,v.A)(s))]}):null,le(u)?(0,D.jsxs)(“span”,{className:”entity-credit”,children:[” “,(0,b.x)(me(“credited as “{credit}””,”relationship credit”,{credit:u}))]}):null]})]}),a&&Object.hasOwn(a.attributes,String(d.VIDEO_ATTRIBUTE_ID))?(0,D.jsx)(“div”,{className:”attribute-container”,children:(0,D.jsxs)(“label”,{children:[(0,D.jsx)(“input”,{checked:s.video,onChange:t=>e.onVideoChange(s.index,t),style:{verticalAlign:”text-top”},type:”checkbox”}),” “,(0,h.l)(“video”)]})}):null,s.error?(0,D.jsx)(“div”,{className:”error field-error”,”data-visible”:”1″,children:s.error.message}):null]})]},s.relationship)};class ke extends l.Component{handleKeyDown(e){“Enter”===e.key&&this.props.url&&(e.preventDefault(),this.props.handleLinkSubmit(e))}highlightDuplicate(e){if(null===e)return;const t=document.getElementById(`external-link-${e}`);t&&(t.scrollIntoView(),t.style.backgroundColor=”yellow”,setTimeout((()=>{t.style.backgroundColor=”initial”}),1e3))}render(){const e=this.props,t=e.relationships.some((e=>!Ne(e))),s=e.relationships[0],i=t?function(e,t){let s=””;for(const t of e){const e=t.type?m.Ay.link_type[t.type]:null;if(e){if(/^official (?:homepage|site)$/.test(e.name))return”home”;”blog”===e.name?s=”blog”:”review”===e.name&&(s=”review”)}}if(le(s))return s;for(const e of Object.keys(d.FAVICON_CLASSES))if(t.indexOf(e)>0)return d.FAVICON_CLASSES[e];return”no”}(e.relationships,e.url):null;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(“tr”,{className:”external-link-item”,id:`external-link-${e.index}`,children:[(0,D.jsx)(“td”,{children:i?(0,D.jsx)(“span”,{className:”favicon “+i+”-favicon”}):null}),(0,D.jsxs)(“td”,{className:”link-actions”,children:[t?(0,D.jsx)(X.A,{dataIndex:e.index,onClick:()=>e.onUrlRemove(),title:(0,h.l)(“Remove link”)}):null,Ne(e)?null:(0,D.jsx)(J,{cleanupUrl:e.cleanupUrl,link:s,onConfirm:e.handleUrlChange,validateLink:e.validateLink})]}),(0,D.jsxs)(“td”,{children:[s.submitted&&e.url?(0,D.jsx)(“a”,{className:`url ${e.highlight}`,href:e.url,rel:”noreferrer”,style:{overflowWrap:”anywhere”},target:”_blank”,children:e.url}):(0,D.jsx)(“input”,{className:”value with-button”,”data-index”:e.index,onBlur:e.handleUrlBlur,onChange:t=>{e.handleUrlChange(t.currentTarget.value)},onKeyDown:e=>this.handleKeyDown(e),placeholder:e.isOnlyLink?(0,h.l)(“Add link”):e.isLastLink?(0,h.l)(“Add another link”):””,type:”url”,value:e.rawUrl}),e.urlEntity?(0,D.jsx)(I.A,{entity:e.urlEntity}):null,e.url&&null!==e.duplicate?(0,D.jsx)(“div”,{className:”error field-error”,”data-visible”:”1″,children:ue(e.canMerge?”Note: This link already exists \n at position {position}. \n To merge, press enter or select a type.”:”Note: This link already exists \n at position {position}.”,{position:(0,D.jsx)(“a”,{href:`#external-link-${e.duplicate}`,onClick:()=>this.highlightDuplicate(e.duplicate),children:`#${e.duplicate+1}`})})}):null,e.error?(0,D.jsx)(“div”,{className:`error field-error target-${e.error.target}`,”data-visible”:”1″,children:e.error.message}):null]})]}),t&&e.relationships.map(((t,s)=>(0,D.jsx)(Te,{creditableEntityProp:e.creditableEntityProp,hasUrlError:null!=e.error,highlight:e.getRelationshipHighlightType(t,e.creditableEntityProp),isOnlyRelationship:1===e.relationships.length,link:t,onAttributesChange:e.handleAttributesChange,onLinkRemove:e.handleLinkRemove,onTypeBlur:e.onTypeBlur,onTypeChange:e.onTypeChange,onVideoChange:e.onVideoChange,typeOptions:e.typeOptions,urlMatchesType:e.urlMatchesType},s))),s.pendingTypes&&s.pendingTypes.map((e=>{const t=m.Ay.link_type[e];return(0,D.jsxs)(“tr”,{className:”relationship-item”,children:[(0,D.jsx)(“td”,{}),(0,D.jsx)(“td”,{children:(0,D.jsxs)(“div”,{className:”relationship-content”,children:[(0,D.jsx)(“label”,{children:pe((0,h.l)(“Type”))}),(0,D.jsx)(“label”,{className:”relationship-name”,children:(0,ne.Av)(t,t.l_link_phrase??””)})]})})]},e)})),t&&s.submitted&&!e.urlMatchesType?(0,D.jsxs)(“tr”,{className:”add-relationship”,children:[(0,D.jsx)(“td”,{}),(0,D.jsx)(“td”,{}),(0,D.jsx)(“td”,{className:”add-item”,children:(0,D.jsx)(“button”,{className:”add-item with-label”,onClick:()=>e.onAddRelationship(e.url),type:”button”,children:(0,h.l)(“Add another relationship”)})})]}):null]})}}const xe=(0,Q.A)(we,new Set([“link_type”,”link_attribute_type”])),Ae={begin_date:d.EMPTY_PARTIAL_DATE,deleted:!1,editsPending:!1,end_date:d.EMPTY_PARTIAL_DATE,ended:!1,entity0:null,entity0_credit:””,entity1:null,entity1_credit:””,pendingTypes:null,rawUrl:””,relationship:null,submitted:!1,type:null,url:””,video:!1};function Ee(e){return{…Ae,…e}}function Ie(e){const t=e.url.replace(/^https/,”http”);return(e.type||””)+”\0″+t}function Ne(e){return!(e.type||e.url)}function je(e,t){let s=0,i=0;const r={};return e.forEach((function(e,n){Ne(e)&&(++s,n!==t&&(r[n]=!0,i++))})),0===s?e.concat(Ee({relationship:(0,x.NF)(“new-“)})):s>1&&i>0?e.filter(((e,t)=>!r[t])):e}const Se=e=>e.type.gid===d.VIDEO_ATTRIBUTE_GID;const Ce=/^(https?|ftp):$/,Re=/^(([A-z\d]|[A-z\d][A-z\d-]*[A-z\d])\.)*([A-z\d]|[A-z\d][A-z\d-]*[A-z\d])$/;function Le(e){if(!Pe(e))return e;const t=new URL(e),s=(0,i.Pk)(t.hostname);return e.replace(t.hostname,s)}function Pe(e){const t=document.createElement(“a”);t.href=e;const s=t.hostname,r=(0,i.Pk)(s);return!(e.indexOf(s)<0&&e.indexOf(r)<0)&&(!!Re.test(s)&&(!(s.indexOf(".")<0)&&!(!e.startsWith(t.protocol)||!Ce.test(t.protocol))))}function $e(e){const t=e?.sourceData??(0,y.F_)();(0,u.A)(t);const s=n()("#external-links-editor-container")[0];let i=n()(s).data("react-root");i||(i=c.H(s),n()(s).data("react-root",i));const r=l.createRef();return i.render((0,D.jsx)(xe,{errorObservable:e?.errorObservable,isNewEntity:!t.id,ref:r,sourceData:t})),{externalLinksEditorRef:r,root:i}}function De(e){const{externalLinksEditorRef:t}=$e();n()(document).on("submit","#page form",(function(){const s=t.current;s&&Oe(e,s)}))}function Oe(e,t){let s=document.getElementById("external-links-editor-submission");s||(s=document.createElement("div"),s.setAttribute("id","external-links-editor-submission"),document.querySelector("#page form")?.appendChild(s)),(0,A.cC)("external-links-editor-submission",(function(s){t.getFormData(e+".url",0,s);const i=t.state.links;i.length&&t.submittedLinksWrapper.set(i)}))}},"1wN/8o/":(e,t,s)=>{“use strict”;s.d(t,{AH:()=>g,Ay:()=>p,Dm:()=>f,Qt:()=>m,c1:()=>d});s(“6g1DHTE”),s(“DNaZxvn”);var i=s(“LCA85s6”),r=s(“HMcOWk2”),n=s(“UjtI3Zv”),a=s(“52XjgTZ”),o=s(“9oisN5V”),l=s(“cGbttel”),c=s(“HkNzj3j”).l,u=s(“SKGBikk”).l;function d(e,t,s){const i=a.Ay.link_attribute_type[e.typeID];let r=t(i);if(i.free_text){const t=(0,o.A)(e.text_value);t&&(r=s(“{attribute}: {value}”,{attribute:r,value:t}))}if(i.creditable){const t=(0,o.A)(e.credited_as);t&&(r=s(“{attribute} [{credited_as}]”,{attribute:r,credited_as:t}))}return r}function h(e){const t=(0,n.A)(e);return e.root_id===i.INSTRUMENT_ROOT_ID?(0,l.jsx)(“a”,{href:”/instrument/”+e.gid,children:t},e.id):t}function p(e){return d(e,h,c)}function m(e){return d(e,n.A,u)}function g(e){return(0,r.A)(e.map(p))}function f(e){return(0,r.T)(e.map(m))}},”2Wx6B6n”:(e,t,s)=>{“use strict”;function i(e,t,s){let i=e.get(t);return void 0!==i||(i=s(),e.set(t,i)),i}s.d(t,{A:()=>i})},”2ath9Yi”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>f,c:()=>b});s(“6g1DHTE”),s(“DNaZxvn”),s(“2e4JtF2”),s(“ik8bNVf”),s(“APt52BH”),s(“pjNe0gE”),s(“Sew0me/”),s(“D3Q32+k”),s(“v/7u+RO”);var i=s(“smZuR9W”),r=s(“52XjgTZ”),n=s(“xrv16+S”),a=s(“WkqHeFz”),o=(s(“60ocjtt”),s(“NKd1yOY”),s(“MVH16Az”)),l=s(“UjtI3Zv”),c=s(“2k2mX3K”).RL;function u(e){const t=(0,n.$z)(e,(e=>String(e.parent_id))),s={};r.Ay.link_type=e.reduce(((e,i)=>(function(e,i){i.id&&(e[i.id]=i),i.gid&&(e[i.gid]=i);const r=t.get(String(i.id));if(r&&(i.children=r),i.l_name=c(i.name),i.link_phrase&&(i.l_link_phrase=c(i.link_phrase)),i.reverse_link_phrase&&(i.l_reverse_link_phrase=c(i.reverse_link_phrase)),i.description&&(i.l_description=c(i.description)),null==i.parent_id){const e=i.type0+”-“+i.type1;(s[e]||=[]).push(i)}}(e,i),e)),{}),r.Ay.link_type_tree=s}function d(e){const t=(0,n.$z)(e,(e=>String(e.parent_id)));r.Ay.link_attribute_type=e.reduce(((e,s)=>(function(e,s){s.id&&(e[s.id]=s),s.gid&&(e[s.gid]=s);const i=t.get(String(s.id));i&&(s.children=i),s.l_name=(0,l.A)(s),s.l_description=(0,o.A)(s)}(e,s),e)),{})}var h=s(“cGbttel”),p=s(“oEgauXb”).l;const m=new Map,g=new Set;function f(e,t){return i.forwardRef(((s,o)=>{const[l,c]=i.useState(!0),[f,b]=i.useState([]),y=i.useRef(!1),w=i.useCallback((async function(e){const t=”/ws/js/type-info/”+e,s=await fetch(t);if(!s.ok)throw new Error(“Got a “+String(s.status)+” fetching “+t);const i=(await s.json())[e+”_list”];if(“language”!==e)if(“link_attribute_type”!==e)if(“link_type”!==e)if(“series_type”!==e){if(“work_type”!==e)throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+e);r.Ay.work_type=Object.fromEntries((0,n.pY)(i,(e=>e.id)))}else r.Ay.series_type=Object.fromEntries((0,n.pY)(i,(e=>e.id)));else u(i);else d(i);else r.Ay.language=Object.fromEntries((0,n.pY)(i,(e=>e.id)));g.add(e)}),[]),v=i.useCallback((async function(){for(const e of t){if(y.current)break;if(g.has(e))continue;let t=m.get(e);null==t?(t=w(e),m.set(e,t),await t,m.delete(e)):(await t,await(0,a.A)(500))}c(!1)}),[w]);return i.useEffect((()=>(y.current=!1,v().catch((e=>{b([…f,e.message])})),()=>{y.current=!0})),[v,f]),l?f.length?(0,h.jsx)(“ul”,{className:”errors”,children:f.map(((e,t)=>(0,h.jsx)(“li”,{children:e},t)))}):(0,h.jsx)(“p”,{className:”loading-message”,children:p(“Loading…”)}):(0,h.jsx)(e,{…s,ref:o})}))}function b(e){return f(e,new Set([“link_attribute_type”,”link_type”,”series_type”,…arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]]))}},”2k2mX3K”:(e,t,s)=>{“use strict”;s.d(t,{RL:()=>r});var i=s(“GX9EKLY”);const r=i.Yi(“relationships”);i._J(“relationships”),i.A3(“relationships”)},”4SA/wF2″:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n});var i=s(“9azanlh”),r=s(“RhiE1fL”);function n(e){return e._original?(0,r.A)(e._original,e)?i.wL:i.Ar:i.jU}},”52XjgTZ”:(e,t,s)=>{“use strict”;s.d(t,{Ay:()=>n,TZ:()=>a});s(“wvF7LKQ”),s(“PkUg7wA”);function i(e){for(const t in e)return!1;return!0}const r={area:{},area_alias_type:{},area_type:{},artist:{},artist_alias_type:{},artist_type:{},collection_type:{},edit:{},editor:{},event:{},event_alias_type:{},event_type:{},genre:{},genre_alias_type:{},instrument:{},instrument_alias_type:{},instrument_type:{},label:{},label_alias_type:{},label_type:{},language:{},link_attribute_type:{},link_type:{},link_type_tree:{},place:{},place_alias_type:{},place_type:{},recording:{},recording_alias_type:{},release:{},release_alias_type:{},release_group:{},release_group_alias_type:{},release_group_primary_type:{},release_group_secondary_type:{},release_packaging:{},release_status:{},script:{},series:{},series_alias_type:{},series_ordering_type:{},series_type:{},url:{},work:{},work_alias_type:{},work_attribute_type:{},work_type:{}};Object.seal(r);const n=r;function a(e){if(e)for(const[t,s]of Object.entries(e)){if(!Object.hasOwn(r,t))throw new Error(JSON.stringify(t)+” is not a valid type assignable to linkedEntities”);null!=s&&(i(r[t])?r[t]=s:Object.assign(r[t],s))}}const o=Object.keys(r);!function(e){for(const e of o)i(r[e])||(r[e]={});e&&a(e)}({artist:void 0})},”5UtCzuy”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>c});var i=s(“Va8HfVl”),r=s(“zzNunOx”),n=s(“YRn3CNN”),a=s(“PstwrNQ”),o=s(“kgGSAAl”),l=s(“cGbttel”);const c=function(e){let{allowEmpty:t=!1,disabled:s=!1,field:c,frozen:u=!1,hasHtmlErrors:d,helpers:h,label:p,onChange:m,onFocus:g,options:f,required:b=!1,rowRef:y,uncontrolled:w=!1}=e,v=b;return t||(v=!1),(0,l.jsxs)(a.A,{rowRef:y,children:[(0,l.jsx)(n.A,{forField:c,label:p,required:v}),(0,l.jsx)(i.A,{allowEmpty:t,disabled:s||u,field:c,onChange:m,onFocus:g,options:f,required:v,uncontrolled:w}),u?(0,l.jsx)(o.A,{field:c}):null,h,(0,l.jsx)(r.A,{field:c,hasHtmlErrors:d})]})}},”6Rf1oks”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});var i=s(“jhqsV7L”);function r(e,t){return 0===(0,i.A)(e,t)}},”6lYEAin”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});var i=s(“cGbttel”);const r=function(e){let{dataIndex:t,onClick:s,title:r}=e;return(0,i.jsx)(“button”,{className:”nobutton icon remove-item”,”data-index”:t,onClick:s,title:r,type:”button”})}},”6xVzkbe”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>l,S:()=>o});s(“60ocjtt”),s(“6g1DHTE”),s(“70YSc4n”);var i=s(“gtppAbj”),r=s(“NwGYEf3”),n=s(“cGbttel”),a=s(“oEgauXb”).l;function o(e,t){{const s=t;if((“object”!=typeof s||null===s)&&”function”!=typeof s||”show-pending-errors”!==s.type){if((“object”!=typeof s||null===s)&&”function”!=typeof s||”set-date”!==s.type||!(“date”in s))throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+s);{const t=s.date,r=t.year,n=t.month,o=t.day;null!=r&&e.set(“field”,”year”,”value”,r),null!=n&&e.set(“field”,”month”,”value”,n),null!=o&&e.set(“field”,”day”,”value”,o),function(e){const t=e.read(),s=String(t.field.year.value??””),r=String(t.field.month.value??””),n=String(t.field.day.value??””),o=[];(0,i.y1)(s)?(0,i.Pz)({day:n,month:r,year:s})||o.push(a(“The date you’ve entered is not valid”)):o.push(a(“The year should have four digits. If you want to enter a year\n earlier than 1000 CE, please pad with zeros, such as “0123”.”)),e.set(“errors”,t.errors.filter((e=>o.includes(e)))).set(“pendingErrors”,o)}(e)}}else(0,r.Xz)(e)}}const l=function(e){let{disabled:t=!1,field:s,yearInputRef:i,…r}=e;const o={},l={},c={};if(r.uncontrolled)o.defaultValue=s.field.year.value,l.defaultValue=s.field.month.value,c.defaultValue=s.field.day.value;else{const e=(e,t)=>{r.dispatch({date:{[t]:e.currentTarget.value},type:”set-date”})},t=()=>{r.dispatch({type:”show-pending-errors”})};o.onBlur=t,l.onBlur=t,c.onBlur=t,o.onChange=t=>e(t,”year”),l.onChange=t=>e(t,”month”),c.onChange=t=>e(t,”day”),o.value=s.field.year.value??””,l.value=s.field.month.value??””,c.value=s.field.day.value??””}return(0,n.jsxs)(“span”,{className:”partial-date”,children:[(0,n.jsx)(“input”,{className:”partial-date-year”,disabled:t,id:”id-“+s.field.year.html_name,maxLength:4,name:s.field.year.html_name,placeholder:a(“YYYY”),ref:i,size:4,type:”text”,…o}),”-“,(0,n.jsx)(“input”,{className:”partial-date-month”,disabled:t,id:”id-“+s.field.month.html_name,maxLength:2,name:s.field.month.html_name,placeholder:a(“MM”),size:2,type:”text”,…l}),”-“,(0,n.jsx)(“input”,{className:”partial-date-day”,disabled:t,id:”id-“+s.field.day.html_name,maxLength:2,name:s.field.day.html_name,placeholder:a(“DD”),size:2,type:”text”,…c})]})}},”73Tm4xF”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>d});const i=s.p+”editor-b055e61.svg”;var r=s(“p1f4iM1”),n=s(“g0LW/UV”),a=s(“cGbttel”),o=s(“oEgauXb”).l,l=s(“8YlDuzw”).I,c=s(“8YlDuzw”).A;function u(){return(0,a.jsx)(“span”,{className:”deleted tooltip”,title:o(“This editor is missing from this server,\n and cannot be displayed correctly.”),children:(0,n.A)(o(“[missing editor]”))})}const d=function(e){let{avatarSize:t=15,content:s,editor:o,subPath:d}=e;if(!o)return(0,a.jsx)(u,{});let h=s;l(h)&&(h=o.name);const p=c(o.avatar);return(0,a.jsxs)(“a”,{href:(0,r.A)(o,d),children:[(0,a.jsx)(“img”,{alt:””,className:”avatar”+(p?””:” no-avatar”),height:t,src:p?o.avatar:i,width:t}),(0,n.A)(h)]})}},”75GVkWN”:(e,t,s)=>{“use strict”;s.d(t,{Ay:()=>g,PL:()=>d,SJ:()=>u,TG:()=>c,WJ:()=>h,i:()=>l,pJ:()=>f});s(“60ocjtt”);var i=s(“Yk1IOim”),r=s.n(i),n=s(“xjYVw2C”),a=s.n(n),o=s(“Ui1Lssl”).A;const l=1,c=2,u=3,d=4,h={[d]:””,[u]:”diff-only-a”,[c]:””,[l]:”diff-only-b”},p=new Map([[r().INSERT,l],[r().EQUAL,c],[r().DELETE,u]]);function m(e){return e.added||e.removed?e.added?l:u:c}function g(e,t,s){const i=a()(e,t,s),r=[];for(let e=0;e{“use strict”;s.d(t,{A:()=>a});var i=s(“EVdnBjI”),r=s.n(i),n=s(“Z+0BPKL”);function a(e){(0,n.Ay)(“#type-bubble”,e),r()(e).on(“change”,(function(){this.value.match(/\S/g)?(r()(“#type-bubble-default”).hide(),r()(“.type-bubble-description”).hide(),r()(`#type-bubble-description-${this.value}`).show()):(r()(“.type-bubble-description”).hide(),r()(“#type-bubble-default”).show())}))}},”79P3cHQ”:(e,t,s)=>{“use strict”;function i(e){return/^\s*$/.test(e||””)}s.d(t,{A:()=>i})},”7bj4Noj”:(e,t,s)=>{“use strict”;s.d(t,{CM:()=>r,CR:()=>a,MF:()=>u,Yw:()=>c,_8:()=>n,h4:()=>h,hI:()=>d,j6:()=>o,z7:()=>l});const i=window.__MB__.DBDefs,r=i.DB_STAGING_TESTING_FEATURES,n=(i.DEVELOPMENT_SERVER,i.DISABLE_IMAGE_EDITING,i.CRITIQUEBRAINZ_SERVER,i.GIT_BRANCH),a=i.GIT_SHA,o=i.MAPBOX_ACCESS_TOKEN,l=i.MAPBOX_MAP_ID,c=i.MTCAPTCHA_PUBLIC_KEY,u=(i.MTCAPTCHA_PRIVATE_TEST_KEY,i.SENTRY_DSN_PUBLIC),d=i.STATIC_RESOURCES_LOCATION,h=i.WEB_SERVER;i.WIKITRANS_SERVER,i.MB_LANGUAGES},”8YlDuzw”:(e,t,s)=>{“use strict”;function i(e){return null==e||””===e}function r(e){return null!=e&&””!==e}s.d(t,{A:()=>r,I:()=>i})},”8alVwqN”:(e,t,s)=>{“use strict”;s.d(t,{P:()=>u,A:()=>d});s(“60ocjtt”);const i=s.p+”information-57f9d9c.png”;var r=s(“UIUB93B”),n=s(“g0LW/UV”),a=s(“B21npvo”),o=s(“cGbttel”),l=s(“HkNzj3j”).l,c=s(“oEgauXb”).l;const u=(0,s(“KBzdQ9I”).A)(“span.ac-mp”,(function(e){let{artistCredit:t}=e,s=”/search/edits?auto_edit_filter=&order=desc&negation=0&combinator=and&conditions.0.field=type&conditions.0.operator=%3D&conditions.0.args=9&conditions.1.field=status&conditions.1.operator=%3D&conditions.1.args=1″,n=2;for(const e of t.names)s+=`&conditions.${n}.field=artist&conditions.${n}.operator=%3D&conditions.${n}.name=${encodeURIComponent(e.artist.name)}&conditions.${n}.args.0=${e.artist.id}`,n++;return(0,o.jsx)(r.A,{content:l(“This artist credit has {edit_search|open edits}.”,{edit_search:s}),target:(0,o.jsx)(“img”,{alt:c(“This artist credit has open edits.”),className:”info”,src:i})})}));const d=function(e){let{artistCredit:t,showDeleted:s=!0,showDisambiguation:i=!1,showEditsPending:r=!0,showIcon:l=!1,target:c}=e;const d=t.names,h=[];for(let e=0;e{“use strict”;function i(e,t){return et?1:0}function r(e,t){return e-t}s.d(t,{K:()=>i,S:()=>r})},”9aqWJYz”:(e,t,s)=>{“use strict”;s.d(t,{GR:()=>o,dg:()=>a,qb:()=>r,Ld:()=>l,fH:()=>n});s(“60ocjtt”),s(“wvF7LKQ”);function i(e){const t=[];for(const s of Object.keys(e)){const e=JSON.stringify(s);t.push(e+”:o[“+e+”]”)}return new Function(“o”,”return {“+t.join(“,”)+”}”)}const r=i({dialogLocation:null,entity:null,existingRelationshipsBySource:null,reducerError:null,relationshipsBySource:null}),n=i({dialogLocation:null,editNoteField:null,enterEditForm:null,entity:null,existingRelationshipsBySource:null,expandedMediums:null,loadedTracks:null,mediums:null,mediumsByRecordingId:null,reducerError:null,relationshipsBySource:null,selectedRecordings:null,selectedWorks:null,submissionError:null,submissionInProgress:null}),a=i({backward:null,phraseGroups:null,typeId:null}),o=i({relationships:null,textPhrase:null}),l=i({_lineage:null,_original:null,_status:null,attributes:null,begin_date:null,editsPending:null,end_date:null,ended:null,entity0:null,entity0_credit:null,entity1:null,entity1_credit:null,id:null,linkOrder:null,linkTypeID:null})},”9azanlh”:(e,t,s)=>{“use strict”;s.d(t,{Ar:()=>o,QJ:()=>l,jU:()=>a,v9:()=>u,wL:()=>n});var i=s(“smZuR9W”),r=s(“CJBfytL”);const n=0,a=1,o=2,l=3,c=Object.freeze({day:””,error:””,month:””,pendingError:””,year:””}),u=(Object.freeze({beginDate:c,endDate:c,ended:!1,error:””,pendingError:””}),(0,i.createContext)({existing:r.A,pending:r.A}))},”9oisN5V”:(e,t,s)=>{“use strict”;function i(e){return String(e||””).trim().replace(/\s+/g,” “)}s.d(t,{A:()=>i})},A6s5oQD:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});var i=s(“osVXT12″);function r(e,t){return e.linkTypeID===t.linkTypeID&&e.entity0.id===t.entity0.id&&e.entity1.id===t.entity1.id&&(0,i.ER)(e.attributes,t.attributes)}},”A9mh/A7”:(e,t,s)=>{“use strict”;s.d(t,{e:()=>g,A:()=>f});var i=s(“smZuR9W”),r=s(“37TQ/RL”),n=s(“Ui1Lssl”),a=s(“gF3mfE9”),o=s(“gklH9/w”),l=s(“lIm5/JO”),c=s(“cGbttel”),u=s(“8YlDuzw”).A;const d=function(e){let{children:t,className:s,id:r,onEscape:d,title:h}=e;const p=(0,a.fI)(),m=i.useCallback(((e,t)=>{e||d(t)}),[d]),{refs:g,context:f}=(0,a.we)({nodeId:p,onOpenChange:m,open:!0,strategy:”fixed”}),b=(0,a.s9)(f,{bubbles:!1,escapeKey:!0,outsidePress:!1}),{getFloatingProps:y}=(0,a.bv)([b]),w=i.useCallback((e=>{e.stopPropagation(),g.floating.current?.focus()}),[g.floating]),v=i.useRef(null);return i.useEffect((()=>{const e=g.floating.current;if(!e)return;let t=(0,n.E)(e.querySelector(“.dialog-content”),”.dialog-content node”);v.current=(0,o.H)(t,!0)})),(0,c.jsx)(a.$c,{id:p,children:(0,c.jsx)(a.XF,{id:r,children:(0,c.jsx)(a.zR,{className:”modal-backdrop”,lockScroll:!0,onClick:w,children:(0,c.jsx)(a.s3,{context:f,initialFocus:v,modal:!0,children:(0,c.jsxs)(“div”,{…y(),className:”dialog modal”+(u(s)?” “+s:””),id:r,ref:g.setFloating,role:”dialog”,tabIndex:-1,children:[(0,c.jsxs)(“div”,{className:”title-bar”,children:[(0,c.jsx)(“h1”,{children:h}),(0,c.jsx)(“button”,{className:”close-dialog icon”,onClick:e=>d(e.nativeEvent),type:”button”})]}),(0,c.jsx)(“div”,{className:”dialog-content”,children:(0,c.jsx)(l.A,{children:t})})]})})})})})};var h=s(“oEgauXb”).g,p=s(“8YlDuzw”).A,m=s(“oEgauXb”).l;const g={area:h(“Add a new area”),artist:h(“Add a new artist”),event:h(“Add a new event”),instrument:h(“Add a new instrument”),label:h(“Add a new label”),place:h(“Add a new place”),recording:h(“Add a new recording”),release_group:h(“Add a new release group”),series:h(“Add a new series”),work:h(“Add a new work”)};const f=function(e){let{callback:t,close:s,entityType:a,name:l}=e;const u=i.useRef(null),h=i.useRef(null),[f,b]=i.useState(!0);i.useEffect((()=>{h.current={close:s}}),[s,h]);let y=”/”+a+”/create”;if(p(l)){y+=”?”+(“edit-“+a.replace(“_”,”-“)+”.name”)+”=”+encodeURIComponent(l)}return(0,c.jsxs)(d,{className:”iframe-dialog”,id:”add-“+a+”-dialog”,onEscape:s,title:f?m(“Loading…”):g[a](),children:[!!f&&(0,c.jsx)(“div”,{className:”content-loading”}),(0,c.jsx)(“iframe”,{onLoad:e=>{const s=e.currentTarget.contentWindow;if(s.dialogResult)return void t(s.dialogResult);s.containingDialog=h,(0,r.flushSync)((()=>{b(!1)}));const i=(0,n.E)(u.current?.contentDocument.body,”iframe document body”);(0,o.H)(i,!0)?.focus()},ref:u,src:”/dialog?path=”+encodeURIComponent(y)})]})}},”ADQEI/t”:(e,t,s)=>{“use strict”;s.d(t,{ve:()=>r});var i=s(“GX9EKLY”);const r=i.Yi(“languages”);i._J(“languages”),i.A3(“languages”)},”Af/Fa+9″:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n});var i=s(“EVdnBjI”),r=s.n(i);const n=function(){for(var e=arguments.length,t=new Array(e),s=0;s{“use strict”;s.d(t,{A:()=>l});s(“6g1DHTE”),s(“DNaZxvn”);var i=s(“smZuR9W”),r=s(“xNKEMJr”),n=s(“cGbttel”),a=s(“SKGBikk”).l,o=s(“oEgauXb”).l;const l=function(e){let{ariaLabel:t,buildRow:s,buildRowProps:l,className:c,ContainerElement:u=”ul”,InnerElement:d=”li”,rows:h,showAllTitle:p,showLessTitle:m,toShowAfter:g,toShowBefore:f}=e;const[b,y]=i.useState(!1),w={“aria-label”:t,className:c},v=f+g+2,_=!!h&&h.length>=v;return h&&h.length?_&&!b?(0,n.jsxs)(u,{…w,children:[f>0?h.slice(0,f).map((e=>s(e,l))):null,(0,n.jsx)(d,{className:”show-all”,children:(0,n.jsx)(“a”,{href:”#”,onClick:e=>{e.preventDefault(),y(!0)},role:”button”,title:p,children:(0,r.x)(a(“show {n} more”,{n:h.length-(f+g)}))})},”show-all”),g>0?h.slice(-g).map((e=>s(e,l))):null]}):(0,n.jsxs)(u,{…w,children:[h.map((e=>s(e,l))),_&&b?(0,n.jsx)(d,{className:”show-less”,children:(0,n.jsx)(“a”,{href:”#”,onClick:e=>{e.preventDefault(),y(!1)},role:”button”,title:m,children:(0,r.x)(o(“show less”))})},”show-less”):null]}):null}},B21npvo:(e,t,s)=>{“use strict”;s.d(t,{u:()=>N,A:()=>$});s(“60ocjtt”),s(“TWjsZtY”);var i=s(“AsUdLGK”),r=s(“84yo5bY”),n=s.n(r),a=s(“smZuR9W”),o=s(“rAs4fSN”),l=s(“LCA85s6”),c=s(“TZv5lnH”),u=s(“CIf4Yly”).ci;const d=function(e){return e.iso_3166_1_codes.length?u(e.name):e.name};var h=s(“wQarZSJ”).mo,p=s(“wQarZSJ”).iD;const m=function(e){return e.comment?h(e.name,e.comment):p(e.name)};var g=s(“xNKEMJr”),f=s(“p1f4iM1”),b=s(“yUJAgX5”),y=s(“g0LW/UV”),w=s(“cGbttel”),v=s(“8YlDuzw”).A,_=s(“oEgauXb”).l,T=s(“oEgauXb”).lp,k=s(“SKGBikk”).l,x=s(“oEgauXb”).g,A=s(“8YlDuzw”).I,E=s(“2k2mX3K”).RL;function I(e,t){return e?(0,y.A)(t):t}function N(e){let{allowNew:t,className:s,deletedCaption:i,name:r,shouldIsolate:n=!0}=e;const a=v(i)?i:_(t?”This entity will be added by this edit.”:”This entity has been removed, and cannot be displayed correctly.”);return(0,w.jsx)(“span”,{className:(v(s)?s+” “:””)+(t?””:”deleted “)+”tooltip”,title:a,children:I(n,v(r)?r:T(“[removed]”,”generic entity”))})}const j={area:”arealink”,artist:”artistlink”,collection:”collectionlink”,editor:null,event:”eventlink”,genre:”genrelink”,instrument:”instrumentlink”,label:”labellink”,link_type:null,place:”placelink”,recording:”recordinglink”,release:”releaselink”,release_group:”rglink”,series:”serieslink”,track:null,url:null,work:”worklink”};function S(e){let{alias:t,className:s,comment:i}=e;const r=v(t)?(0,w.jsx)(“i”,{title:_(“Primary alias”),children:t},”primary-alias”):null;return(0,w.jsxs)(w.Fragment,{children:[” “,(0,w.jsx)(“span”,{className:s,children:(0,g.A)((0,w.jsx)(“bdi”,{children:v(r)?v(i)?(0,c.A)([r,i]):r:i},”comment”))})]})}function C(e){let{event:t,showDate:s}=e;const i=(0,b.A)(t);return i&&s||t.cancelled?(0,w.jsxs)(w.Fragment,{children:[i&&s?” “+(0,g.x)(i):null,t.cancelled?(0,w.jsx)(S,{className:”cancelled”,comment:T(“cancelled”,”event”)}):null]}):null}function R(e){let t,{area:s}=e;if(!s.ended)return null;const i=s.begin_date?s.begin_date.year:null,r=s.end_date?s.end_date.year:null;return t=null!=i&&null!=r?k(“historical, {begin}-{end}”,{begin:i,end:r}):null==r?_(“historical”):k(“historical, until {end}”,{end:r}),(0,w.jsx)(S,{className:”historical”,comment:t})}const L=x(“This link has been temporarily disabled because\n it has been reported as potentially harmful.”);function P(e){let{allowNew:t,url:s}=e;return(0,w.jsxs)(w.Fragment,{children:[(0,o.A)(s)?(0,w.jsx)(“span”,{className:”deleted”,title:L(),children:(0,y.A)(s)}):(0,w.jsx)(“a”,{className:”wrap-anywhere”,href:s,children:s}),” “,(0,w.jsx)(N,{allowNew:t,name:(0,g.x)(_(“info”),{type:”[]”})})]})}const $=function(e){let{allowNew:t=!1,content:s,deletedCaption:r,disableLink:c=!1,entity:u,nameVariation:h,showArtworkPresence:p=!1,showCreditedAs:b=!1,showDeleted:y=!0,showDisambiguation:T,showEditsPending:x=!0,showEventDate:$=!0,showIcon:D=!1,subPath:O,shouldIsolate:z=!0,…Y}=e;const U=v(s),W=u.editsPending||!1,H=v(O),M=v(u.comment)?n().unwrap(u.comment):””,B=n().unwrap(u.name),F=”area”===u.entityType&&u.typeID===l.AREA_TYPE_COUNTRY;let G=s,X=””,K=h,V=T,q=D;const Z={…Y};if(void 0===K&&v(G)&&”string”!=typeof G){const e=”Content of type “+typeof G+” cannot be compared as a string to entity name for name variation.”;0,i.Cp(new Error(e))}let J=null;b&&”string”==typeof G&&v(G)&&(J=G,G=void 0),A(G)&&(G=(e=>{if((“object”==typeof e&&null!==e||”function”==typeof e)&&”area”===e.entityType){return d(e)}if((“object”==typeof e&&null!==e||”function”==typeof e)&&”instrument”===e.entityType){return m(e)}return(“object”==typeof e&&null!==e||”function”==typeof e)&&”link_type”===e.entityType?E(B):B})(u));const Q=!F&&”instrument”!==u.entityType&&”track”!==u.entityType&&v(u.primaryAlias)&&u.primaryAlias!==G?u.primaryAlias:””;if(void 0===V&&(V=!U),”hover”===V||”artist”===u.entityType){const e=”artist”===u.entityType?u.sort_name:””,t=v(Q)?Q:e;X=v(t)?v(M)?t+” “+(0,g.x)(M):t:M}if(!n().unwrap(u.gid))return”url”===u.entityType?(0,w.jsx)(P,{allowNew:t,url:u.href_url}):y?(0,w.jsx)(N,{allowNew:t,deletedCaption:r,name:G}):null;let ee,te=(0,f.A)(u,O);if(“url”!==u.entityType||U||(G=u.pretty_name,ee=te,te=u.href_url),H||”url”===u.entityType||(void 0===K&&”string”==typeof G&&(K=G!==B),!0===K&&(X=v(X)?k(“{name} – {additional_info}”,{additional_info:X,name:B}):B)),Z.href=te,v(X)&&(Z.title=X),”url”===u.entityType&&(Z.className=”wrap-anywhere”),G=c?(0,w.jsx)(“span”,{className:”deleted”,title:”url”===u.entityType&&(0,o.A)(te)?L():null,children:I(z,G)},”deleted”):(0,w.jsx)(“a”,{…Z,children:I(z,G)},”link”),!0===K&&(G=(0,w.jsx)(“span”,{className:”name-variation”,children:G},”namevar”)),x&&!H&&W&&(G=(0,w.jsx)(“span”,{className:”mp”,children:G},”mp”)),!H&&”area”===u.entityType){const e=u.iso_3166_1_codes;e&&e.length&&(G=(0,w.jsx)(“span”,{className:”flag flag-“+e[0],children:G},”flag”),q=!1)}!H&&”recording”===u.entityType&&u.video&&(G=(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“span”,{className:”video”,title:_(“This recording is a video”)}),G]},”video”)),p&&(“event”===u.entityType&&(G=”present”===u.event_art_presence?(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“a”,{href:”/event/”+u.gid+”/event-art”,children:(0,w.jsx)(“span”,{className:”artwork-icon eaa-icon”,title:_(“This event has artwork in the Event Art Archive”)})}),G]},”eaa”):(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“span”,{className:”blank-icon”}),G]},”caa”)),”release”===u.entityType&&(G=”present”===u.cover_art_presence?(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“a”,{href:”/release/”+u.gid+”/cover-art”,children:(0,w.jsx)(“span”,{className:”artwork-icon caa-icon”,title:_(“This release has artwork in the Cover Art Archive”)})}),G]},”caa”):(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“span”,{className:”blank-icon”}),G]},”caa”)),”release_group”===u.entityType&&(G=u.hasCoverArt?(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“span”,{className:”artwork-icon caa-icon”,title:_(“This release group has artwork in the Cover Art Archive”)}),G]},”caa”):(0,w.jsxs)(a.Fragment,{children:[(0,w.jsx)(“span”,{className:”blank-icon”}),G]},”caa”))),H||”release”!==u.entityType||(2===u.quality?G=(0,w.jsxs)(a.Fragment,{children:[G,(0,w.jsx)(“span”,{className:”high-data-quality”,title:_(“High quality: All available data has been added, if possible\n including cover art with liner info that proves it”)})]},”quality”):0===u.quality&&(G=(0,w.jsxs)(a.Fragment,{children:[G,(0,w.jsx)(“span”,{className:”low-data-quality”,title:_(“Low quality: The release needs serious fixes, or its existence\n is hard to prove (but it’s not clearly fake)”)})]},”quality”)));const se=[G];return q&&se.unshift((0,w.jsx)(“span”,{className:j[u.entityType]},”icon”)),v(J)&&se.push(” “,(0,g.A)((0,w.jsx)(“span”,{children:k(“as “{credit}””,{credit:J})}))),!V&&A(ee)||(!0===V&&(“event”===u.entityType&&se.push((0,w.jsx)(C,{event:u,showDate:$},”eventdisambig”)),(v(M)||v(Q))&&se.push((0,w.jsx)(S,{alias:Q,className:”comment”,comment:M},”comment”)),”area”===u.entityType&&se.push((0,w.jsx)(R,{area:u},”areadisambig”))),v(ee)&&se.push(” “,(0,g.A)((0,w.jsx)(“a”,{href:ee,children:_(“info”)},”info”),{type:”[]”}))),se}},Bb4NJH1:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n});var i=s(“iVi/iOV”),r=s(“hPBADqi”);const n=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Date(Date.now()+31536e6);”undefined”==typeof document||”file:”===window.location.protocol?r.A[e]=t.toString():document.cookie=i.serialize(e,t.toString(),{expires:s,path:”/”})}},CIBMtSG:(e,t,s)=>{“use strict”;s.d(t,{A:()=>l});var i=s(“EVdnBjI”),r=s.n(i),n=(new Date).getTime(),a=null;function o(e,t,s){s.jqXHR=r().ajax({dataType:”json”,…e}).done((function(){if(!s.aborted){for(var e=arguments.length,i=new Array(e),r=0;r{“use strict”;s.d(t,{ci:()=>r});var i=s(“GX9EKLY”);const r=i.Yi(“countries”);i._J(“countries”),i.A3(“countries”)},E98cO72:(e,t,s)=>{“use strict”;s.d(t,{Kw:()=>ce,Ay:()=>ue,hV:()=>re,n9:()=>ae,to:()=>ne,Ff:()=>oe,SH:()=>le});s(“60ocjtt”),s(“6g1DHTE”),s(“DNaZxvn”),s(“+zMNUwn”);var i=s(“AsUdLGK”),r=(s(“mz7fKDE”),s(“smZuR9W”)),n=s(“pt6c6lh”),a=s(“/6M3xbR”),o=s(“CJBfytL”),l=s(“6Jrjhm9”),c=s(“uDzn5/g”),u=s(“YwtI3iV”),d=s(“LCA85s6”),h=s(“VHUgtNR”),p=s(“cbdMZik”),m=s(“tpyBDsx”),g=s(“e3+xVn3”),f=s(“dMORH1x”),b=s(“HfEq/qN”),y=s(“KzhY9EY”),w=s(“nyvE9PA”),v=s(“9azanlh”),_=s(“9aqWJYz”),T=s(“osVXT12”),k=s(“VVNXxwy”),x=s(“4SA/wF2”),A=s(“SmhBGrr”),E=s(“ldVMy18”),I=s(“JCI6GvU”);var N=s(“YDxZ9xi”),j=s(“Vg37ZR/”),S=s(“gtppAbj”);function C(e,t){const s=e?.year,i=t?.year,r=e?.month,n=t?.month,a=e?.day,o=t?.day;if(null!=s&&null!=i&&s!==i||null!=r&&null!=n&&r!==n||null!=a&&null!=o&&a!==o)return null;const l={day:a??o??null,month:r??n??null,year:s??i??null};return(0,S.Pz)(l)?l:null}var R=s(“A6s5oQD”),L=s(“hpDWElX”),P=s(“8YlDuzw”).A;function $(e,t){if(e.id===t.id||e.linkOrder!==t.linkOrder||!(0,R.A)(e,t))return null;if(e.entity0_credit===t.entity0_credit&&e.entity1_credit===t.entity1_credit&&(0,N.A)(e,t))return t;const s=C(e.begin_date,t.begin_date),i=C(e.end_date,t.end_date);if(!s||!i||!(0,S.uJ)(s,i))return null;const r=(0,j.A)(e.begin_date)&&(0,j.A)(e.end_date)&&!e.ended||(0,j.A)(t.begin_date)&&(0,j.A)(t.end_date)&&!t.ended,n=e.ended===t.ended;if(!r&&!n)return null;const a=(0,_.Ld)(t);return a._lineage=[…a._lineage,”merged with id=”+String(e.id)],a.begin_date=s,a.end_date=i,a.ended=!(0,j.A)(i)||(e.ended||t.ended),P(e.entity0_credit)&&(a.entity0_credit=e.entity0_credit),P(e.entity1_credit)&&(a.entity1_credit=e.entity1_credit),a._status=(0,x.A)(a),a}var D=s(“4vlrZLo”),O=s(“P3Mz6ey”),z=s(“d/wSL5Q”),Y=s(“Ui1Lssl”).A;function U(e,t,s,i){const r=(0,k.PK)(e.relationshipsBySource,s),n=(0,k._u)(r,t,s);Y(n&&(0,z.H)(t.linkTypeID,s,(0,I.A)(t,s)));const a=n.relationships,o=(i?D.A:O.A)(a,t,(0,T._V)((0,I.A)(t,s))),l=Math.max(0,t.linkOrder+(i?1:-1)),c=[],d=(e,t)=>{const s=(0,_.Ld)(e);return s._lineage=[…s._lineage,”reordered”],s.linkOrder=t,s._status=(0,x.A)(s),s};o&&o.linkOrder===l?c.push({relationship:t,throwIfNotExists:!0,type:L.S},{relationship:o,throwIfNotExists:!0,type:L.S},{onConflict:u.ET,relationship:d(t,o.linkOrder),type:L.Lm},{onConflict:u.ET,relationship:d(o,t.linkOrder),type:L.Lm}):c.push({relationship:t,throwIfNotExists:!0,type:L.S},{onConflict:u.ET,relationship:d(t,l),type:L.Lm}),(0,L.Ay)(e,c)}var W=s(“VNyMmCx”),H=s(“RhiE1fL”),M=(s(“70YSc4n”),s(“1nSlf59”)),B=s(“yBlPIGB”),F=s(“jKEtJbC”),G=s(“pu3FCox”),X=s(“Bgvmr3X”),K=s(“Ui1Lssl”),V=s(“52XjgTZ”),q=s(“Ui1Lssl”).A;const Z=e=>{const t=V.Ay.link_attribute_type[e.typeID].root_id;return e.typeID===d.TASK_ATTRIBUTE_ID||t===d.INSTRUMENT_ROOT_ID||t===d.VOCAL_ROOT_ID};function*J(e,t,s,i,r){const n=(0,k.PK)(e,i);if(!n.size)return;const a=(0,I.A)(t,i),c=a?t.entity0.entityType:t.entity1.entityType,d=()=>{const e=B.A(n,c,k.kr);return e?e[1]:o.A};function*h(e,s){if(s.id===t.id)return;const i=e.backward?”entity1_credit”:”entity0_credit”;if(s[i]!==r){const e=(0,_.Ld)(s);e._lineage=[…e._lineage,”updated entity credit”],e[i]=r,e._status=(0,x.A)(e),yield{relationship:s,throwIfNotExists:!0,type:L.S},yield{onConflict:u.XU,relationship:e,type:L.Lm}}}function*p(e){for(const t of l.A(e.phraseGroups))for(const s of l.A(t.relationships))yield*h(e,s)}if(“all”!==s)if(“same-entity-types”!==s)if(“same-relationship-type”!==s){if(“”!==s)throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+s)}else{const e=d(),s=B.A(e,{backward:a,typeId:t.linkTypeID??0},k.nl);s&&(yield*p(s))}else{const e=d();for(const t of l.A(e))yield*p(t)}else for(const[,e]of l.A(n))for(const t of l.A(e))yield*p(t)}var Q=s(“LEdQKgv”),ee=s(“cGbttel”),te=s(“Ui1Lssl”).A,se=s(“8YlDuzw”).A,ie=s(“oEgauXb”).l;function*re(e,t){for(const s of e){if(“url”===s.target_type)continue;const e=s.backward;let i=s.target;(0,g.A)(i.id)||(i={…i,id:(0,f.c7)()});const r=(0,g.A)(s.id),n={_lineage:[r?”loaded from database”:”seeded”],_original:null,_status:r?v.wL:v.jU,attributes:a.A(s.attributes.slice(0).sort(T.S1)),begin_date:s.begin_date,editsPending:s.editsPending,end_date:s.end_date,ended:s.ended,entity0:e?i:t,entity0_credit:s.entity0_credit,entity1:e?t:i,entity1_credit:s.entity1_credit,id:(0,E.A)(s),linkOrder:s.linkOrder,linkTypeID:s.linkTypeID};(0,g.A)(s.id)&&(n._original=n),yield{onConflict:u.IP,relationship:n,type:L.Lm},i.relationships&&(yield*re(i.relationships,i))}}function ne(e){const t=(0,p.tr)();let s;if(b.go&&”POST”===t.req.method){const t=e.source??(0,p.Rz)(),r=(0,W.l0)(t),n=b.HI.get(r);if(se(n))try{s=(0,y.E)(JSON.parse(n))}catch(e){(0,i.Cp)(e)}finally{setTimeout((()=>{b.HI.remove(r)}),1e3)}}return function(e,t){const{seededRelationships:s}=e,i=e.source??(0,p.Rz)();te(“release”!==i.entityType,”Cannot initialize the mini relationship editor with a release”);const r={dialogLocation:null,entity:i,existingRelationshipsBySource:o.A,reducerError:null,relationshipsBySource:o.A};return i.relationships&&(0,L.Ay)(r,re(i.relationships,i)),r.existingRelationshipsBySource=r.relationshipsBySource,s&&(0,L.Ay)(r,re(s,i)),t&&(0,L.Ay)(r,t.map((e=>({onConflict:u.XU,relationship:e,type:L.Lm})))),r}(e,s)}function*ae(e,t,s){function*i(t){const i=function(e,t,s,i){if((0,g.A)(s.id))return null;const r=(0,k._u)(e,s,i);let n=null;if(r)for(const e of l.A(r.relationships)){if(n=$(s,e),n===e)return[];if(n)return null!==(0,k.$b)(t,n,i)?null:[{relationship:e,throwIfNotExists:!0,type:L.S},{onConflict:u.XU,relationship:n,type:L.Lm}]}return null}((0,k.PK)(e.relationshipsBySource,s),(0,k.PK)(e.existingRelationshipsBySource,s),t,s);i?yield*i:yield{onConflict:u.IP,relationship:t,type:L.Lm}}const r=(0,A.A)(t);if(null!=r.attributes[d.INSTRUMENT_ROOT_ID]||null!=r.attributes[d.VOCAL_ROOT_ID]){const e=function(e){const t=[],s=(0,g.A)(e.id)?e._original:null,i=(0,K.E)(null==e.linkTypeID?null:V.Ay.link_type[e.linkTypeID]);let r=o.A,n=o.A,c=o.A,d=e.attributes??o.A,h=a.A(M.A(s?.attributes??o.A).filter(Z));const p=h.size>0;for(const e of[T.fx,T.S1,T._r])for(const t of l.A(h)){const s=B.A(d,t,e);if(s){const e=F.Sg(r,s,T.S1);e===r?n=F.eW(n,s,T.fx):r=e,d=G.Ay(d,s,T.fx),h=G.Ay(h,t,T.S1)}}for(const e of l.A(d))if(Z(e))n=F.eW(n,e,T.fx);else{const t=F.Sg(c,e,T.S1);if(c===t){const t=V.Ay.link_attribute_type[e.typeID].root_id,s=i.attributes[t];if(null==s.max||s.max>1){const s=V.Ay.link_attribute_type[t];q(s.creditable||s.free_text,”Got multiple attributes with the same type ID, but they aren’t creditable or free-text.”),n=F.eW(n,e,T.fx)}}else c=t}if(s){const i=(0,_.Ld)(e);if(i._lineage=[…i._lineage,”split attribute onto existing relationship”],n.size&&!p){let e;for(const t of l.A(n))if(Z(t)){e=t;break}e&&(n=G.Ay(n,e,T.fx),r=F.Sg(r,e,T.S1))}i.attributes=X.A(r,c,T.S1,u.ET),i._status=(0,x.A)(i),i._status===v.wL?t.push(s):(0,H.A)(i,e)?t.push(e):t.push(i)}null==s&&n.size&&1===n.size&&(0,T.ER)(d,n)&&(n=o.A);for(const s of l.A(n)){const i=(0,_.Ld)(e);i._lineage=[…i._lineage,”split attribute onto new relationship”],i.id=(0,f.c7)(),i.attributes=F.Ay(c,s,T.S1),i._original=null,i._status=v.jU,t.push(i)}return t.length||t.push(e),t}(t);for(const t of e)yield*i(t)}else yield*i(t)}h.A.relationshipEditor.getRelationshipStateId=E.A,h.A.tree=n;const oe=(0,w.A)(((e,t)=>{const s=(0,_.qb)(e);return le(s,t),s}));function le(e,t){{const r=t;if((“object”==typeof r&&null!==r||”function”==typeof r)&&”move-relationship-down”===r.type&&”relationship”in r&&”source”in r){U(e,r.relationship,r.source,!0)}else if((“object”==typeof r&&null!==r||”function”==typeof r)&&”move-relationship-up”===r.type&&”relationship”in r&&”source”in r){U(e,r.relationship,r.source,!1)}else if((“object”!=typeof r||null===r)&&”function”!=typeof r||”remove-relationship”!==r.type)if((“object”==typeof r&&null!==r||”function”==typeof r)&&”toggle-ordering”===r.type&&”hasOrdering”in r&&”linkPhraseGroup”in r){const t=r.hasOrdering,s=r.linkPhraseGroup,i=[];let n=1;for(const e of l.A(s.relationships)){const s=(0,_.Ld)(e);s._lineage=[…s._lineage,”toggled ordering”],s.linkOrder=t?n++:0,s._status=(0,x.A)(s),i.push({relationship:e,throwIfNotExists:!0,type:L.S},{onConflict:u.XU,relationship:s,type:L.Lm})}(0,L.Ay)(e,i)}else if((“object”==typeof r&&null!==r||”function”==typeof r)&&”update-dialog-location”===r.type&&”location”in r){const t=r.location;e.dialogLocation=t}else if((“object”==typeof r&&null!==r||”function”==typeof r)&&”update-entity”===r.type&&”changes”in r&&”entityType”in r){const t=r.changes,s=r.entityType;te(e.entity.entityType===s,”Cannot change the relationship editor entity type”),e.entity={…e.entity,…t}}else{if(!((“object”==typeof r&&null!==r||”function”==typeof r)&&”update-relationship-state”===r.type&&”creditsToChangeForSource”in r&&”creditsToChangeForTarget”in r&&”newRelationshipState”in r&&”oldRelationshipState”in r&&”sourceEntity”in r))throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+r);{const t=r.creditsToChangeForSource,n=r.creditsToChangeForTarget,a=r.newRelationshipState,o=r.oldRelationshipState,l=r.sourceEntity,u=null!=o&&!(0,H.A)(o,a);if(null==o||u||t||n){const r=(s=a,i=l,(0,I.A)(s,i)?s.entity0:s.entity1),d=[];null!=o&&u&&(0,L.Ay)(e,[{relationship:o,throwIfNotExists:!1,type:L.S}]),(null==o||u)&&d.push(…ae(e,a,l)),t&&d.push(…J(e.relationshipsBySource,a,t,l,(0,I.A)(a,l)?a.entity1_credit:a.entity0_credit)),n&&d.push(…J(e.relationshipsBySource,a,n,r,(0,I.A)(a,r)?a.entity1_credit:a.entity0_credit));try{(0,L.Ay)(e,d)}catch(e){if(!(e instanceof c.mq))throw e;alert(ie(“This relationship already exists.”))}}}}else{const t=r,{relationship:s}=t,i=[{relationship:s,throwIfNotExists:!0,type:L.S}];if(s._original){const e=(0,_.Ld)(s._original);e._lineage=[…e._lineage,”removed”],e._status=s._status===v.QJ?v.wL:v.QJ,i.push({onConflict:u.XU,relationship:e,type:L.Lm})}(0,L.Ay)(e,i)}}var s,i}const ce=r.memo((e=>{let{error:t}=e;return(0,ee.jsxs)(“div”,{className:”error”,children:[(0,ee.jsx)(“strong”,{className:”error”,children:ie(“Oops, something went wrong!”)}),(0,ee.jsx)(“br”,{}),(0,ee.jsx)(“pre”,{style:{whiteSpace:”pre-wrap”},children:t})]})}));const ue=function(e){let{dispatch:t,formName:s,state:n}=e;const a=n.reducerError,o=r.useRef(!1),[l,c]=r.useState(null),u=a??l;r.useEffect((()=>{const e=e=>{if(!o.current){o.current=!0;try{(0,W.Ay)(s,n)}catch(t){e.preventDefault(),(0,i.Cp)(t),c((0,m.A)(t))}}};return document.addEventListener(“submit”,e),()=>{document.removeEventListener(“submit”,e)}})),r.useEffect((()=>(h.A.relationshipEditor.dispatch=t,h.A.relationshipEditor.state=n,()=>{h.A.relationshipEditor.dispatch=null,h.A.relationshipEditor.state=null})),[t,n]);const d=r.useMemo((()=>({existing:n.existingRelationshipsBySource,pending:n.relationshipsBySource})),[n.existingRelationshipsBySource,n.relationshipsBySource]);return(0,ee.jsxs)(“fieldset”,{id:”relationship-editor”,children:[(0,ee.jsx)(“legend”,{children:ie(“Relationships”)}),(0,ee.jsxs)(“div”,{className:”relationship-editor-fieldset-content”,children:[u?(0,ee.jsx)(ce,{error:u.stack}):null,(0,ee.jsx)(v.v9.Provider,{value:d,children:(0,ee.jsx)(Q.A,{dialogLocation:n.dialogLocation,dispatch:t,releaseHasUnloadedTracks:!1,source:n.entity,targetTypeGroups:(0,k.PK)(n.relationshipsBySource,n.entity),track:null})})]})]})}},EdqsaKW:(e,t,s)=>{“use strict”;s.d(t,{Gd:()=>g,L$:()=>m,Nx:()=>u,Pg:()=>p,R2:()=>h,ch:()=>d,kP:()=>l});s(“6g1DHTE”),s(“Kqb1L/m”),s(“NKd1yOY”),s(“gdf1lGT”);var i=s(“LCA85s6”),r=s(“8YlDuzw”).A,n=s(“8YlDuzw”).I;const a=(e,t)=>e+(r(t.name)?t.name:t.artist&&r(t.artist.name)?t.artist.name:””)+(r(t.joinPhrase)?t.joinPhrase:””),o=e=>!!e.artist&&e.artist.gid===i.VARTIST_GID,l=e=>e.names.some(o),c=e=>r(e.artist?.gid),u=e=>null!=e&&e.names.length>0,d=e=>u(e)&&e.names.every(c),h=e=>p(e.names);function p(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=e.reduce(a,””);if(t&&e.length>0){const t=e[e.length-1].joinPhrase;t&&(s=s.slice(0,s.length-t.length))}return s}function m(e){const t=e.names[0];return!(!t||!c(t))&&(n(t.name)||t.artist.name!==h(e))}function g(e,t){if(e===t)return!0;const s=e.names,i=t.names;if(s.length!==i.length)return!1;for(let e=0;e{“use strict”;s.d(t,{A:()=>a});var i=s(“UIUB93B”),r=s(“cGbttel”);const n={display:”inline-block”,marginLeft:”10px”,verticalAlign:”text-top”};const a=function(e){let{content:t}=e;return(0,r.jsx)(i.A,{content:t,target:(0,r.jsx)(“span”,{className:”img icon help”,style:n})})}},Fc1ht8o:(e,t,s)=>{“use strict”;s.d(t,{A:()=>yt,q:()=>wt});s(“6g1DHTE”),s(“AXfG3Yq”),s(“wvF7LKQ”);var i=s(“AsUdLGK”),r=s(“smZuR9W”),n=s(“Imk573c”),a=s(“dMORH1x”),o=(s(“60ocjtt”),s(“NKd1yOY”),s(“gdf1lGT”),s(“2e4JtF2”),s(“ik8bNVf”),s(“APt52BH”),s(“pjNe0gE”),s(“Sew0me/”),s(“D3Q32+k”),s(“v/7u+RO”),s(“1nSlf59”)),l=s(“CJBfytL”),c=s(“Ui1Lssl”),u=s(“IX2y8RG”),d=s(“QpbAoda”),h=s(“gooNfJx”),p=s(“LCA85s6”),m=s(“52XjgTZ”),g=s(“VHUgtNR”),f=s(“xNKEMJr”),b=s(“9oisN5V”),y=s(“gklH9/w”),w=s(“e3+xVn3”),v=s(“d/wSL5Q”),_=s(“9azanlh”),T=s(“pqBraHq”),k=s(“wPS9XeD”),x=s(“VVNXxwy”),A=s(“NRi6Fhf”),E=s(“NTUlU87”),I=s(“4SA/wF2”),N=s(“brGU6uh”),j=s(“SmhBGrr”),S=s(“JCI6GvU”),C=s(“a+U3pwl”),R=s(“/wdNxGF”),L=s(“kuYEmyQ”),P=s(“Ez3XeuZ”),$=s(“cGbttel”),D=s(“oEgauXb”).lp,O=s(“oEgauXb”).l;const z=r.memo((function(e){let{dispatch:t,linkOrder:s}=e;const i=r.useCallback((e=>{let s=parseInt(e.currentTarget.value,10);Number.isNaN(s)&&(s=0),s=Math.min(s,w.b),t({newLinkOrder:s,type:”update-link-order”})}),[t]);return(0,$.jsxs)(“tr”,{className:”link-order”,children:[(0,$.jsx)(“td”,{className:”section”,children:D(“Order”,”noun”)}),(0,$.jsxs)(“td”,{className:”fields”,children:[(0,$.jsx)(“input”,{max:w.b,min:”0″,onChange:i,type:”number”,value:s}),(0,$.jsx)(P.A,{content:O(“If this relationship has a specific order among others of the\n same type, you may set its position in the list here (as an\n alternative to the up- and down-arrow buttons).”)})]})]})}));var Y=s(“x6u2RKf”),U=s(“B21npvo”),W=s(“KmaOXyL”),H=s(“1wN/8o/”),M=s(“WfSoeLz”),B=s(“zx42Bmz”),F=s(“+5o7Rtt”);const G=(e,t,s,i)=>(0,$.jsx)(F.A,{allowNew:i??!1,content:t,disableLink:(0,M.A)(s,e),entity:e});function X(e){let{allowNewEntity0:t,allowNewEntity1:s,makeEntityLink:i=G,relationship:r}=e;const n=r.backward,a=m.Ay.link_type[r.linkTypeID];let o=r.entity0,l=r.entity1;const c=a.type0||(n?r.target_type:r.source_type),u=a.type1||(n?r.source_type:r.target_type);o&&l||(n?(o=r.target,l=m.Ay[u][r.entity1_id]||{entityType:u,id:r.entity1_id}):(l=r.target,o=m.Ay[c][r.entity0_id]||{entityType:c,id:r.entity0_id}));const d=(0,W.GW)(a,r.attributes,”long_link_phrase”,!1,i(o,r.entity0_credit,r,t),i(l,r.entity1_credit,r,s)),h=(0,W.A0)(a,r.attributes,”long_link_phrase”,!1);return(0,$.jsxs)($.Fragment,{children:[d,” “,(0,B.A)(r),h?(0,$.jsxs)($.Fragment,{children:[” “,(0,f.A)((0,H.AH)(h))]}):null]})}const K=function(e){return e.relationship.editsPending?(0,$.jsx)(“span”,{className:”mp mp-rel”,children:(0,$.jsx)(X,{…e})}):(0,$.jsx)(X,{…e})};var V=s(“YDxZ9xi”),q=s(“HMcOWk2”),Z=s(“HkNzj3j”),J=s(“xrv16+S”),Q=s(“75GVkWN”),ee=s(“+yGjBxw”),te=s(“Ui1Lssl”).A,se=s(“H+29DOL”).O,ie=s(“oEgauXb”).l;const re=e=>(0,$.jsx)(“span”,{className:”diff-only-a”,children:e}),ne=e=>(0,$.jsx)(“span”,{className:”diff-only-b”,children:e}),ae=e=>String(e.typeID),oe=(e,t,s,i)=>(0,$.jsx)(F.A,{content:t,disableLink:(0,M.A)(s,e),entity:e,showCreditedAs:i});const le=r.memo((function(e){let{makeEntityLink:t=oe,newRelationship:s,oldRelationship:i}=e;const r=(0,J.pY)(i.attributes,ae),n=(0,J.pY)(s.attributes,ae),a={commaList:q.A,defaultValue:””,displayLinkAttribute(e){const t=String(e.typeID),s=(0,H.Ay)(e);return r.has(t)&&!n.get(t)?re(s):n.get(t)&&!r.has(t)?ne(s):s},expand:Z.HG},o=null==i.linkTypeID?null:m.Ay.link_type[i.linkTypeID],l=null==s.linkTypeID?null:m.Ay.link_type[s.linkTypeID];te(o&&l,”No link type found”);const c=i.entity0??(null==i.entity0_id?null:m.Ay[o.type0][i.entity0_id]),u=s.entity0??(null==s.entity0_id?null:m.Ay[l.type0][s.entity0_id]);te(c&&u,”No source entity found”);const d=i.entity1||i.target,h=s.entity1||s.target,p=c.id!==u.id||i.entity0_credit!==s.entity0_credit,g=d.id!==h.id||i.entity1_credit!==s.entity1_credit,b=t(c,i.entity0_credit,i,p),y=t(u,s.entity0_credit,s,p),w=t(d,i.entity1_credit,i,g),v=t(h,s.entity1_credit,s,g);let _=””,T=[],k=””,x=[];try{o!==l&&(Z.JL.reactTextContentHook=re),[_,T]=(0,W.Mm)(a,o,i.attributes??[],”long_link_phrase”,!1,c.id===u.id?b:re(b),d.id===h.id?w:re(w)),o!==l&&(Z.JL.reactTextContentHook=ne),[k,x]=(0,W.Mm)(a,l,s.attributes??[],”long_link_phrase”,!1,c.id===u.id?y:ne(y),d.id===h.id?v:ne(v))}finally{Z.JL.reactTextContentHook=null}const A=(0,B.A)(i),E=(0,B.A)(s);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“th”,{rowSpan:2,children:se(ie(“Relationship”))}),(0,$.jsxs)(“td”,{className:”old”,children:[_,” “,(0,$.jsx)(ee.A,{filter:Q.SJ,newText:E,oldText:A}),” “,(0,f.A)((0,H.AH)(T))]})]}),(0,$.jsx)(“tr”,{children:(0,$.jsxs)(“td”,{className:”new”,children:[k,” “,(0,$.jsx)(ee.A,{filter:Q.i,newText:E,oldText:A}),” “,(0,f.A)((0,H.AH)(x))]})})]})}));var ce=s(“KimswHD”),ue=s(“A6s5oQD”),de=s(“8YlDuzw”).A,he=s(“oEgauXb”).lp,pe=s(“H+29DOL”).O,me=s(“oEgauXb”).l;const ge=(e,t,s)=>{const i=s?e.entity0:e.entity1,r=(0,j.A)(e),n=!r||r.has_dates;return{attributes:o.A(e.attributes??l.A),backward:s,begin_date:n?e.begin_date:null,editsPending:e.editsPending,end_date:n?e.end_date:null,ended:!!n&&e.ended,entity0:e.entity0,entity0_credit:e.entity0_credit,entity0_id:e.entity0.id,entity1:e.entity1,entity1_credit:e.entity1_credit,entity1_id:e.entity1.id,id:e.id??0,linkOrder:e.linkOrder,linkTypeID:e.linkTypeID??0,source_id:t.id,source_type:t.entityType,target:i,target_type:i.entityType,verbosePhrase:””}};const fe=r.memo((function(e){let{backward:t,batchSelectionCount:s,dispatch:i,newRelationship:r,oldRelationship:n,source:a}=e;const o=t?r?.entity0.entityType:r?.entity1.entityType,l=(e,t,i)=>(0,$.jsx)(U.A,{allowNew:!0,className:”wrap-anywhere”,content:de(t)?t:(0,w.A)(e.id)||de(e.name)?””:he(“[unknown]”,”generic entity”),deletedCaption:null!=s&&e===a?(0,ce.A)(a.entityType,s):void 0,disableLink:(0,M.A)(i,e),entity:e,showDisambiguation:!0,target:”_blank”}),c=(e,s,i)=>{const r=”preview details”+(s?” “+s:””);return(0,$.jsx)(“table”,{className:r,children:(0,$.jsxs)(“tbody”,{children:[(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“th”,{children:pe(me(“Relationship”))}),(0,$.jsx)(“td”,{children:(0,$.jsx)(K,{makeEntityLink:l,relationship:ge(e,a,t)})})]}),i]})})},u=(e,t)=>e===t?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“th”,{children:pe(me(“Old order”))}),(0,$.jsx)(“td”,{className:”old”,children:e})]}),(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“th”,{children:pe(me(“New order”))}),(0,$.jsx)(“td”,{className:”new”,children:t})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(“h2”,{children:[(0,$.jsx)(“div”,{className:”heading-line”}),(0,$.jsx)(“span”,{className:”heading-text”,children:he(“Preview”,”header”)})]}),n&&r?(d=n,h=r,d.entity0_credit===h.entity0_credit&&d.entity1_credit===h.entity1_credit&&(0,ue.A)(d,h)&&(0,V.A)(d,h)?c(r,””,u(n.linkOrder,r.linkOrder)):(0,$.jsx)(“table”,{className:”preview details edit-relationship”,children:(0,$.jsxs)(“tbody”,{children:[(0,$.jsx)(le,{makeEntityLink:l,newRelationship:ge(r,a,t),oldRelationship:ge(n,a,t)}),u(n.linkOrder,r.linkOrder)]})})):r?c(r,”add-relationship”):(0,$.jsx)(“p”,{className:”required-fields-note”,children:me(“Please fill out all required fields.”)}),a.entityType===o?(0,$.jsxs)($.Fragment,{children:[” “,(0,$.jsx)(“button”,{className:”styled-button change-direction”,onClick:function(){i({type:”change-direction”})},type:”button”,children:me(“Change direction”)})]}):null]});var d,h}));var be=s(“TeVBGSm”),ye=s(“HkNzj3j”).l,we=s(“oEgauXb”).l,ve=s(“SKGBikk”).l,_e=s(“2k2mX3K”).RL;function Te(e,t){return{creditedAs:e,creditsToChange:””,releaseHasUnloadedTracks:t}}function ke(e,t){const s={…e};{const e=t;if((“object”==typeof e&&null!==e||”function”==typeof e)&&”set-credit”===e.type&&”creditedAs”in e){const t=e.creditedAs;s.creditedAs=t}else{if((“object”!=typeof e||null===e)&&”function”!=typeof e||”set-credits-to-change”!==e.type||!(“value”in e))throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+e);{const t=e.value;s.creditsToChange=t}}}return s}const xe=r.memo((function(e){let{backward:t,dispatch:s,entityName:i,forEntity:n,linkType:a,state:o,targetType:l}=e;const c=r.useRef(o.creditedAs||””),u=r.useRef(null),d=r.useId();function h(e){s({type:”set-credits-to-change”,value:e.currentTarget.value})}let m;(o.creditsToChange||””!==o.creditedAs||o.creditedAs!==c.current)&&(m=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(“br”,{}),(0,$.jsxs)(“label”,{className:”change-credits-checkbox”,children:[(0,$.jsx)(“input”,{checked:””!==o.creditsToChange,disabled:o.releaseHasUnloadedTracks,onChange:function(e){s({type:”set-credits-to-change”,value:e.currentTarget.checked?”all”:””})},type:”checkbox”}),(0,$.jsx)(“span”,{children:ye(“Change credits for other {entity} relationships\n on the page.”,{entity:(0,$.jsx)(“bdi”,{children:i})})})]}),o.releaseHasUnloadedTracks?(0,$.jsx)(“div”,{className:”form-help”,children:(0,$.jsx)(“p”,{children:we(“Some tracks/mediums haven’t been loaded yet. If you want\n to use this option, please close this dialog and load all\n tracks/mediums beforehand.”)})}):o.creditsToChange?(0,$.jsxs)(“div”,{className:”change-credits-radio-options”,children:[(0,$.jsxs)(“label”,{children:[(0,$.jsx)(“input”,{checked:”all”===o.creditsToChange,name:”changed-credits”,onChange:h,type:”radio”,value:”all”}),we(“All of these relationships.”)]}),(0,$.jsxs)(“label”,{children:[(0,$.jsx)(“input”,{checked:”same-entity-types”===o.creditsToChange,name:”changed-credits”,onChange:h,type:”radio”,value:”same-entity-types”}),(0,$.jsx)(“span”,{children:ve(“Only relationships to {entity_type} entities.”,{entity_type:p.ENTITY_NAMES[l]()})})]}),a?(0,$.jsxs)(“label”,{children:[(0,$.jsx)(“input”,{checked:”same-relationship-type”===o.creditsToChange,name:”changed-credits”,onChange:h,type:”radio”,value:”same-relationship-type”}),(0,$.jsx)(“span”,{children:ve(“Only “{relationship_type}” relationships to\n {entity_type} entities.”,{entity_type:p.ENTITY_NAMES[l](),relationship_type:(0,W.Av)(a,_e(t?a.reverse_link_phrase:a.link_phrase))})})]}):null]}):null]}));const g=we(“A credited name is optional. You can leave this field blank\n to keep the current name.”);return(0,$.jsxs)(“div”,{className:n+”-entity-credit”,children:[(0,$.jsx)(“input”,{“aria-description”:g,”aria-label”:we(“Credited as”),className:”entity-credit”,id:d,onChange:function(e){s({creditedAs:e.currentTarget.value,type:”set-credit”})},placeholder:we(“Credited as”),ref:u,type:”text”,value:o.creditedAs}),(0,$.jsx)(P.A,{content:g}),m]})}));var Ae=s(“8YlDuzw”).A,Ee=s(“oEgauXb”).l,Ie=s(“oEgauXb”).lp;function Ne(e,t){if(e&&t&&”url”===e.entityType){const s=”url”===t.type0?t.type1:t.type0,i=new be.A$(e.name,s).checkRelationship(t.gid);if(!i.result)return Ae(i.error)?i.error:Ee(“This URL is not allowed for the selected link type,\n or is incorrectly formatted.”)}return””}function je(e,t,s,i){const r=(0,j.A)(s),n=(0,S.A)(s,i);return{entityType:t,error:Ne(i,r),…Te(n?s.entity1_credit:s.entity0_credit,e)}}const Se=r.memo((function(e){let{backward:t,batchSelectionCount:s,dispatch:i,linkType:r,source:n,state:a,targetType:o}=e;const l=n.entityType;return(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“td”,{className:”required section”,children:p.ENTITY_NAMES[l]()}),(0,$.jsxs)(“td”,{className:”fields”,children:[n&&null==s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(U.A,{allowNew:!0,className:”wrap-anywhere”,content:n.name||Ie(“[unknown]”,”generic entity”),entity:n,target:”_blank”}),(0,$.jsx)(“div”,{className:”error”,children:a.error})]}):null==s?null:(0,ce.A)(l,s),p.ENTITIES_WITH_RELATIONSHIP_CREDITS[l]?(0,$.jsx)(xe,{backward:t,dispatch:i,entityName:n.name,forEntity:”source”,linkType:r,state:a,targetType:o}):null]})]})}));var Ce=s(“nXnm+DU”),Re=s(“oEgauXb”).g,Le=s(“oEgauXb”).l,Pe=s(“Ui1Lssl”).A;const $e={artist:Re(“The series you’ve selected is for artists.”),event:Re(“The series you’ve selected is for events.”),recording:Re(“The series you’ve selected is for recordings.”),release:Re(“The series you’ve selected is for releases.”),release_group:Re(“The series you’ve selected is for release groups.”),work:Re(“The series you’ve selected is for works.”)};function De(e){return null!=e&&((0,w.A)(e.id)||”work”===e.entityType&&!0===e._fromBatchCreateWorksDialog)}function Oe(e,t,s){if(!De(e))return””;if(t.entityType===e.entityType&&t.id===e.id)return Le(“Entities in a relationship cannot be the same.”);if(“series”===e.entityType){const i=e.typeID;Pe(null!=i,”Existing series must have a type set”);const r=m.Ay.series_type[i].item_entity_type;if(s&&p.PART_OF_SERIES_LINK_TYPE_GIDS.includes(s.gid)&&r!==t.entityType)return $e[r]()}return””}const ze=()=>!1;function Ye(e){const{allowedTypes:t,inputRef:s,relationshipId:i,target:r}=e,n=De(r)?r:null;return(0,Ce.U)({canChangeType:t?e=>t.some((t=>t.value===e)):ze,containerClass:”relationship-target”,entityType:r.entityType,id:”relationship-target-“+String(i),inputChangeHook:He,inputClass:”relationship-target”,inputRef:s,inputValue:r.name,required:!0,selectedItem:n?{entity:n,id:n.id,name:n.name,type:”option”}:null})}function Ue(e){const{allowedTypes:t,initialFocusRef:s,initialRelationship:i,releaseHasUnloadedTracks:r,source:n}=e,a=(0,S.A)(i,n),o=a?i.entity0:i.entity1;let l=null;return”url”!==o.entityType&&(l=Ye({allowedTypes:t,inputRef:s,relationshipId:i.id,target:o})),{…Te(a?i.entity0_credit:i.entity1_credit,r),allowedTypes:t,autocomplete:l,error:Oe(o,n,(0,j.A)(i)),relationshipId:i.id,target:o,targetType:o.entityType}}const We=/#new-work-(-[0-9]+)\s*$/;function He(e,t,s){const i=e.match(We);if(i){const e=i[1],t=m.Ay.work[Number(e)];if(t)return s({entity:t,id:t.id,name:t.name,type:”option”})}return!1}function Me(e,t){Pe(e.autocomplete),e.autocomplete=(0,d.Ay)(e.autocomplete,t.action),e.error=Oe(e.autocomplete.selectedItem?.entity,t.source,t.linkType)}const Be=r.memo((function(e){let{backward:t,dispatch:s,linkType:i,source:n,state:a}=e;const o=a.autocomplete,l=a.targetType,c=r.useCallback((e=>{s({action:e,linkType:i,source:n,type:”update-autocomplete”})}),[s,i,n]),u=r.useCallback((e=>{s({action:e,type:”update-credit”})}),[s]),d=Boolean(p.ENTITIES_WITH_RELATIONSHIP_CREDITS[l]&&o?.selectedItem?.entity);return(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“td”,{className:”required section”,children:p.ENTITY_NAMES[l]()}),(0,$.jsxs)(“td”,{className:”fields”,children:[“url”===l?(0,$.jsx)(“input”,{onChange:function(e){s({text:e.currentTarget.value,type:”update-url-text”})},type:”text”,value:a.target.name}):o?(0,$.jsx)(Ce.A,{dispatch:c,state:o}):null,(0,$.jsx)(“div”,{className:”error”,children:a.error}),d?(0,$.jsx)(xe,{backward:t,dispatch:u,entityName:a.target.name,forEntity:”target”,linkType:i,state:a,targetType:n.entityType}):null]})]})}));s(“DNaZxvn”);var Fe=s(“LIWYReX”),Ge=s(“oEgauXb”).l;const Xe=r.memo((function(e){let{dispatch:t,initialFocusRef:s,options:i,source:r,targetType:n}=e;return(0,$.jsxs)(“tr”,{children:[(0,$.jsx)(“td”,{className:”required section”,children:Ge(“Related type”)}),(0,$.jsx)(“td”,{className:”fields”,children:null==i?(0,Fe.A)(n):(0,$.jsx)(“select”,{className:”entity-type”,onChange:function(e){t({source:r,targetType:e.currentTarget.value,type:”update-target-type”})},ref:s,value:n,children:i.map((e=>(0,$.jsx)(“option”,{value:e.value,children:e.text},e.value)))})})]})}));var Ke=s(“2k2mX3K”).RL,Ve=s(“oEgauXb”).l,qe=s(“8YlDuzw”).A,Ze=s(“HkNzj3j”).l;const Je={fontWeight:”normal”};function Qe(e,t){const s=m.Ay.link_attribute_type[t.type.gid],i=s.root_id;let r=e.get(i);return null==r&&(r=[],e.set(i,r)),r.push({credited_as:t.credited_as,text_value:t.text_value,type:s}),e}function et(e){return e.reduce(Qe,new Map)}function tt(e){const t=e.initialRelationship,s=e.source,i=(0,S.A)(t,s),r=s.entityType,n=i?t.entity0.entityType:t.entity1.entityType,a=(0,A.A)(s,n),c=(0,j.A)(t)??(1===a.length?a[0].entity:null)??null,u=null!=e.targetTypeOptions&&!e.hasPreselectedTargetType,d=!u&&null==c,h=!u&&!d;return{attributes:(0,C.Ur)(c,et(o.A(t.attributes??l.A))),backward:i,datePeriod:(0,L.Ur)(t),isHelpVisible:!1,linkOrder:t.linkOrder,linkType:(0,Y.Ur)({initialFocusRef:d?e.initialFocusRef:void 0,linkType:c,source:s,targetType:n,linkTypeOptions:a,id:(0,N.A)(t),disabled:!1}),sourceEntity:je(e.releaseHasUnloadedTracks,r,t,s),targetEntity:Ue({allowedTypes:e.targetTypeOptions,initialFocusRef:h?e.initialFocusRef:void 0,initialRelationship:t,releaseHasUnloadedTracks:e.releaseHasUnloadedTracks,source:s})}}function st(e,t){const s=e.targetEntity.target,i=e.linkType.autocomplete.selectedItem?.entity?.id??null;if(“artist”===t.entityType&&”artist”===s.entityType&&null!==i&&it.has(i)){const i=null===t.typeID,r=t.typeID===p.ARTIST_TYPE_PERSON,n=null!==t.typeID&&p.ARTIST_GROUP_TYPES.has(t.typeID),a=s.typeID===p.ARTIST_TYPE_PERSON,o=null!==s.typeID&&p.ARTIST_GROUP_TYPES.has(s.typeID);(r||i)&&o?e.backward=!1:(n||i)&&a&&(e.backward=!0)}}const it=new Set([53,103,305,855,895,965]);function rt(e,t,s,i){const r=i.entityType,n=(0,A.A)(i,s);(0,h.Xb)(n,Y.Xv);const a=1===n.length?n[0].entity:null,o=e.linkType.autocomplete,l={…o,inputValue:a?(0,u.U)(a):o.selectedItem?””:o.inputValue,recentItems:null,recentItemsKey:”link_type-“+r+”-“+s,results:n,selectedItem:a?{entity:a,id:a.id,name:Ke(a.name),type:”option”}:null,staticItems:n};(0,d.ro)(l,l.inputValue),(0,d.zC)(l),e.linkType={…e.linkType,autocomplete:l},(0,Y.PB)(e,a),e.backward=r>s,e.sourceEntity={…e.sourceEntity,error:Ne(i,null)}}function nt(e,t){const s={…e};{const i=t;if((“object”!=typeof i||null===i)&&”function”!=typeof i||”change-direction”!==i.type)if((“object”==typeof i&&null!==i||”function”==typeof i)&&”set-attributes”===i.type&&”attributes”in i){const t=i.attributes;s.attributes=(0,C.Ur)(e.linkType.autocomplete.selectedItem?.entity??null,et(t))}else if((“object”!=typeof i||null===i)&&”function”!=typeof i||”toggle-help”!==i.type)if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-source-entity”===i.type&&”action”in i){const e=i.action;s.sourceEntity=function(e,t){return ke(e,t)}(s.sourceEntity,e)}else if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-target-entity”===i.type&&”action”in i&&”source”in i){const t=i.action,r=i.source;s.targetEntity=function(e,t){{const s=t;if((“object”==typeof s&&null!==s||”function”==typeof s)&&”update-autocomplete”===s.type){const t=s,i={…e};Me(i,t);const r=i.autocomplete;i.targetType=r.entityType;const a=r.selectedItem?.entity||(0,n.XH)(i.targetType,{name:r.inputValue});return e.target.entityType===a.entityType&&e.target.id===a.id&&e.target.name===a.name||(i.target=a),i}if((“object”==typeof s&&null!==s||”function”==typeof s)&&”update-credit”===s.type&&”action”in s)return ke(e,s.action);if((“object”==typeof s&&null!==s||”function”==typeof s)&&”update-url-text”===s.type&&”text”in s){const t=s.text;Pe(“url”===e.targetType);const i={…e};Pe(“url”===i.target.entityType);const r={…i.target},n=t;return r.name=n,i.target=r,i}throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+s)}}(s.targetEntity,t);const a=e.targetEntity.targetType,o=s.targetEntity.targetType;a!==o&&rt(s,0,o,r);e.targetEntity.target.gid!==s.targetEntity.target.gid&&st(s,r)}else if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-target-type”===i.type&&”source”in i&&”targetType”in i){const e=i.source,t=i.targetType,r={…s.targetEntity},a=r.targetType,o=t;if(r.targetType=o,rt(s,0,o,e),”url”===a&&”url”!==o){const t=(0,n.XH)(o);r.autocomplete=Ye({allowedTypes:r.allowedTypes,relationshipId:r.relationshipId,target:t}),r.target=t,r.error=Oe(t,e,null)}else”url”===o&&”url”!==a?(r.autocomplete=null,r.target=(0,n.dA)(),r.error=””):”url”!==o&&Me(r,{action:{entityType:o,type:”change-entity-type”},linkType:null,source:e,type:”update-autocomplete”});r.creditedAs=””,s.targetEntity=r}else if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-link-order”===i.type&&”newLinkOrder”in i){const e=i.newLinkOrder;s.linkOrder=e}else if((“object”!=typeof i||null===i)&&”function”!=typeof i||”update-link-type”!==i.type)if((“object”==typeof i&&null!==i||”function”==typeof i)&&”update-attribute”===i.type&&”action”in i){const e=i.action;s.attributes=(0,C.Ff)(s.attributes,e)}else{if((“object”!=typeof i||null===i)&&”function”!=typeof i||”update-date-period”!==i.type||!(“action”in i))throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+i);{const e=i.action;s.datePeriod=(0,L.WH)(s.datePeriod,e)}}else{const t=i;(0,Y.bF)(e,s,t)&&(s.sourceEntity={…s.sourceEntity,error:Ne(t.source,null)},st(s,t.source))}else s.isHelpVisible=!e.isHelpVisible;else s.backward=!e.backward}return s}const at=r.memo((function(e){let{attributesState:t,canEditDates:s,datePeriod:i,dispatch:n,isHelpVisible:a}=e;const o=r.useCallback((e=>{n({action:e,type:”update-attribute”})}),[n]),l=r.useCallback((e=>{n({action:e,type:”update-date-period”})}),[n]),c=(0,k.A)(“boolean”);return t.attributesList.length||s?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(“h2”,{children:[(0,$.jsx)(“div”,{className:”heading-line”}),(0,$.jsx)(“span”,{className:”heading-text”,children:Ve(“Attributes”)})]}),(0,$.jsx)(“table”,{className:”relationship-details”,children:(0,$.jsxs)(“tbody”,{onClick:c,children:[t.attributesList.length?(0,$.jsx)(C.Ay,{dispatch:o,isHelpVisible:a,state:t}):null,s?(0,$.jsx)(L.Ay,{dispatch:l,isHelpVisible:a,state:i}):null]})})]}):null}));const ot=r.memo((function(e){const{batchSelectionCount:t,closeDialog:s,hasPreselectedTargetType:i,initialFocusRef:n,initialRelationship:a,sourceDispatch:o,source:l,targetTypeOptions:u,targetTypeRef:d,title:h}=e,[p,m]=r.useReducer(nt,e,tt);r.useEffect((()=>(g.A.relationshipEditor.relationshipDialogDispatch=m,g.A.relationshipEditor.relationshipDialogState=p,()=>{g.A.relationshipEditor.relationshipDialogDispatch=null,g.A.relationshipEditor.relationshipDialogState=null})),[m,p]);const k=p.backward,A=p.linkType,j=A.autocomplete.selectedItem?.entity,S=p.sourceEntity,C=p.targetEntity,L=C.target,P=C.targetType,D=p.datePeriod.field,O=p.attributes.attributesList,U=null==A.autocomplete.selectedItem||!De(C.autocomplete?.selectedItem?.entity),W=Boolean(qe(A.error)||qe(S.error)||C.error||O.some((e=>e.error))||D.errors?.length||D.field.begin_date.errors?.length||D.field.end_date.errors?.length),H=Boolean(D.pendingErrors?.length||D.field.begin_date.pendingErrors?.length||D.field.end_date.pendingErrors?.length);r.useEffect((()=>{d&&(d.current=P)}),[d,P]);const M=r.useMemo((()=>{if(U||W)return null;L&&(0,c.A)(L.entityType===P,”The selected entity does not have type “+JSON.stringify(P));const e=j?j.id:null,t=L?L.id:null;if(null==e||null==t)return null;const s=(0,b.A)(S.creditedAs),i=(0,b.A)(C.creditedAs);let r=””,n=””;k?(r=i,n=s):(n=i,r=s);const o={…a,_lineage:a._lineage.length?[…a._lineage,”edited”]:[“added”],…p.datePeriod.result,attributes:p.attributes.resultingLinkAttributes,entity0_credit:r,entity1_credit:n,linkOrder:p.linkOrder,linkTypeID:e};return o.entity0=k?L:l,o.entity1=k?l:L,o._status=(0,I.A)(o),o}),[k,U,W,a,j,L,l,p.attributes.resultingLinkAttributes,p.linkOrder,p.datePeriod.result,S.creditedAs,C.creditedAs,P]),B=r.useContext(_.v9),F=r.useMemo((()=>{if(M)for(const e of[“pending”,”existing”]){const t=(0,x.$b)((0,x.PK)(B[e],l),M,l);if(t&&t.id!==M.id)return!0}return!1}),[B,M,l]),G=r.useRef(null),X=r.useCallback((e=>{const t=G.current;if(t){const s=new Event(“mb-close-relationship-dialog”,{bubbles:!0});s.closeEventType=e,s.dialogState=p,t.dispatchEvent(s)}s()}),[s,p]),K=r.useCallback((()=>{if(M&&j&&L&&!F){if(H)return m({action:{action:{type:”show-pending-errors”},type:”update-begin-date”},type:”update-date-period”}),void m({action:{action:{type:”show-pending-errors”},type:”update-end-date”},type:”update-date-period”});(0,c.A)(k?j.type0===L.entityType&&j.type1===l.entityType:j.type0===l.entityType&&j.type1===L.entityType,”The selected link type is invalid for these entity types”),(0,w.A)(a.id)?(0,y.s)(“edit-relationship-“+(0,N.A)(a),e):e()}function e(){o({batchSelectionCount:t,creditsToChangeForSource:S.creditsToChange,creditsToChangeForTarget:C.creditsToChange,newRelationshipState:M,oldRelationshipState:a,sourceEntity:l,type:”update-relationship-state”}),X(“accept”)}}),[k,t,H,F,j,L,l,o,S.creditsToChange,C.creditsToChange,a,M,X]),V=r.useCallback((()=>{X(“cancel”)}),[X]),q=r.useCallback((e=>{m({action:e,type:”update-source-entity”})}),[m]),Z=r.useCallback((e=>{m({action:e,source:l,type:”update-target-entity”})}),[m,l]),J=r.useCallback((e=>{m({action:e,source:l,type:”update-link-type”})}),[m,l]),Q=a._original&&a?.editsPending?(0,E.A)(a._original):null,ee=r.useCallback((e=>{e.preventDefault(),m({type:”toggle-help”})}),[m]),te=(0,T.A)(K),se=null!=j&&j.has_dates;return(0,$.jsxs)(“div”,{className:”form”,onKeyDown:te,ref:G,children:[(0,$.jsxs)(“div”,{className:”dialog-titlebar”,children:[(0,$.jsx)(“h1”,{children:h}),(0,$.jsx)(“div”,{className:”buttons-right”,children:(0,$.jsx)(“span”,{style:Je,children:(0,f.A)((0,$.jsx)(“a”,{href:”#”,onClick:ee,children:Ve(“help”)}))})})]}),null==t?null:(0,$.jsx)(“p”,{children:(ie=l.entityType,”recording”===ie?Ve(“This will add a relationship to all checked recordings.”):”work”===ie?Ve(“This will add a relationship to all checked works.”):””)}),null==Q?null:(0,$.jsx)(“p”,{className:”msg warning”,children:Ze(“Warning: This relationship has open edits. {show|Click here}\n to view these edits and make sure they do not conflict with\n your own.”,{show:{href:Q,target:”_blank”}})}),(0,$.jsx)(“table”,{className:”relationship-details”,children:(0,$.jsxs)(“tbody”,{children:[(0,$.jsx)(Se,{backward:k,batchSelectionCount:t,dispatch:q,linkType:j,source:l,state:S,targetType:P}),(0,$.jsx)(Xe,{dispatch:m,initialFocusRef:u&&!i?n:void 0,options:u,source:l,targetType:C.targetType})]})}),(0,$.jsxs)(“h2”,{children:[(0,$.jsx)(“div”,{className:”heading-line”}),(0,$.jsx)(“span”,{className:”heading-text”,children:Ve(“Relationship”)})]}),(0,$.jsx)(“table”,{className:”relationship-details”,children:(0,$.jsxs)(“tbody”,{children:[(0,$.jsx)(Y.Ay,{dispatch:J,isHelpVisible:p.isHelpVisible,source:l,state:A,targetType:C.targetType}),(0,$.jsx)(Be,{backward:k,dispatch:Z,linkType:j,source:l,state:C}),j&&(0,v.H)(j.id,l,k)?(0,$.jsx)(z,{dispatch:m,linkOrder:p.linkOrder}):null]})}),(0,$.jsx)(at,{attributesState:p.attributes,canEditDates:se,datePeriod:p.datePeriod,dispatch:m,isHelpVisible:p.isHelpVisible}),l?(0,$.jsx)(fe,{backward:k,batchSelectionCount:t,dispatch:m,newRelationship:M,oldRelationship:a._original,source:l}):null,F?(0,$.jsx)(“p”,{className:”error”,children:Ve(“This relationship already exists.”)}):null,(0,$.jsx)(R.A,{isDoneDisabled:U||W||H||F,onCancel:V,onDone:K})]});var ie}));var lt=s(“ldVMy18”),ct=(s(“70YSc4n”),s(“oEgauXb”)),ut=s(“JWGIi2B”);function dt(e,t){return”area-area”===t||”area-url”===t?(0,ut.Tu)(e):”area-instrument”!==t&&”instrument-instrument”!==t&&”instrument-url”!==t||(0,ut.CD)(e)}const ht=new Map;function pt(e){return{text:p.ENTITY_NAMES[e](),value:e}}function mt(e,t){ht.size||function(e){const t=Object.keys(m.Ay.link_type_tree);for(let s=0;s(0,A.x)(t,e))).map(pt).sort(((e,t)=>(0,ct.UD)(e.text,t.text)))}var gt=s(“VVxqhIh”),ft=s(“Ui1Lssl”).A;const bt={_lineage:[],_original:null,_status:_.jU,attributes:null,begin_date:null,editsPending:!1,end_date:null,ended:!1,entity0_credit:””,entity1_credit:””,id:null,linkOrder:0,linkTypeID:null};function yt(e){const{batchSelectionCount:t,dispatch:s,hasPreselectedTargetType:n,relationship:a,releaseHasUnloadedTracks:o,source:l,targetTypeOptions:c,targetTypeRef:u,title:d,user:h}=e;return 0===a.linkTypeID&&i.Cp(new Error(“relationship.linkTypeID is 0, but should be null”)),r.useCallback(((e,i)=>null==c||c.length?(0,$.jsx)(ot,{batchSelectionCount:t,closeDialog:e,hasPreselectedTargetType:n,initialFocusRef:i,initialRelationship:a,releaseHasUnloadedTracks:o,source:l,sourceDispatch:s,targetTypeOptions:c,targetTypeRef:u,title:d,user:h}):(0,$.jsx)(“p”,{children:”No relationship types are available for “+JSON.stringify(l.entityType)+” entities.”})),[t,s,n,a,o,l,c,u,d,h])}function wt(e){const{backward:t,buildNewRelationshipData:s,preselectedTargetType:i,releaseHasUnloadedTracks:o,source:l,targetTypeOptions:c,…u}=e,d=(0,gt.A)(),h=r.useMemo((()=>null===c?null:mt(d,l.entityType)),[c,d,l.entityType]),p=r.useRef(null),m=i||p.current||(h?.length?h.find((e=>”artist”===e.value))?.value??h[0].value:”artist”);null!=t&&ft(t?l.entityType>=m:l.entityType<=m);const g=r.useMemo((()=>(0,n.tg)(m,{id:(0,a.c7)(),name:””})),[m]),f=t??l.entityType>m;return yt({…u,hasPreselectedTargetType:null!=i,relationship:{…bt,entity0:f?g:l,entity1:f?l:g,id:(0,lt.A)(null),…s?s():null},releaseHasUnloadedTracks:o,source:l,targetTypeOptions:h,targetTypeRef:p,user:d})}},Fx12dgT:(e,t,s)=>{“use strict”;s.d(t,{A:()=>c});var i=s(“zzNunOx”),r=s(“PstwrNQ”),n=s(“cGbttel”),a=s(“oEgauXb”).lp,o=s(“HkNzj3j”).l,l=s(“oEgauXb”).l;const c=function(e){let{children:t,field:s,hideHelp:c=!1,…u}=e;const d={};return u.controlled?(d.value=s.value,d.onChange=u.onChange):d.defaultValue=s.value,(0,n.jsxs)(“fieldset”,{className:”editnote”,children:[(0,n.jsx)(“legend”,{children:a(“Edit note”,”noun”)}),c?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(“p”,{children:o(“Entering an {note|edit note} that describes where you got\n your information is highly recommended. Not only does it\n make your sources clear (both now and to users who see the\n edit years later), but it can also encourage other users\n to vote on the edit — thus making it get applied faster.”,{note:{href:”/doc/Edit_Note”,target:”_blank”}})}),(0,n.jsx)(“p”,{children:o(“Even just providing a URL or two is helpful!\n For more suggestions,\n see {doc_how_to|our guide for writing good edit notes}.”,{doc_how_to:{href:”/doc/How_to_Write_Edit_Notes”,target:”_blank”}})})]}),t,(0,n.jsxs)(r.A,{children:[(0,n.jsx)(“label”,{htmlFor:”edit-note-text”,children:l(“Edit note:”)}),(0,n.jsx)(“textarea”,{className:”edit-note”,cols:80,id:”edit-note-text”,name:s.html_name,rows:5,…d}),(0,n.jsx)(i.A,{field:s})]})]})}},GVrEMO1:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n});var i=s(“cGbttel”),r=s(“8YlDuzw”).A;const n=function(e){let{className:t,inputClassName:s,label:n,name:a,value:o}=e;return(0,i.jsx)(“span”,{className:”buttons”+(r(t)?” “+t:””),children:(0,i.jsx)(“button”,{className:s,name:a,type:”submit”,value:o,children:n})})}},GX9EKLY:(e,t,s)=>{“use strict”;s.d(t,{Yi:()=>b,_J:()=>y,A3:()=>w});var i={};s.r(i),s.d(i,{default:()=>d,jedInstance:()=>c,loadDomain:()=>u});var r=s(“+oFf+Pk”),n=s.n(r),a=s(“qeIRQns”),o=s.n(a);const l=s(“mz7fKDE”)({en:{domain:”mb_server”,locale_data:{attributes:{“”:{domain:”attributes”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},countries:{“”:{domain:”countries”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},history:{“”:{domain:”history”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},instrument_descriptions:{“”:{domain:”instrument_descriptions”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},instruments:{“”:{domain:”instruments”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},languages:{“”:{domain:”languages”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},mb_server:{“”:{domain:”mb_server”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},relationships:{“”:{domain:”relationships”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},scripts:{“”:{domain:”scripts”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}},statistics:{“”:{domain:”statistics”,lang:”en”,plural_forms:”nplurals=2; plural=(n != 1);”}}}},locale:”en”}),c=void 0,u=()=>{},d={},h=/[\r\n]/g,p=/\s+/g;function m(e){return(e||””).replace(h,” “).replace(p,” “)}let g;if(n())g=i;else{let e=window.__MB__?.jedData;null!=e&&”en”!==e.locale||(e=l),g=new(o())(e[e.locale])}function f(e){null==c||c.options.locale_data[e]||u(e)}function b(e){return function(t){f(e);const s=m(t);return g.dgettext(e,s)}}function y(e){return function(t,s,i){f(e);const r=m(t),n=m(s);return g.dngettext(e,r,n,i)}}function w(e){return function(t,s){f(e);const i=m(t);return g.dpgettext(e,s,i)}}},GXDjtXZ:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});const i={annotation:{model:”Annotation”,table:”annotation”},area:{add_edit_type:81,aliases:{add_edit_type:86,delete_edit_type:87,edit_edit_type:88,search_hint_type:3},annotations:{edit_type:85},collections:!0,custom_tabs:[“artists”,”events”,”labels”,”releases”,”recordings”,”places”,”users”,”works”],date_period:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{multiple:!0,relatable:”overview”},merging:!0,model:”Area”,plural:”areas”,plural_url:”areas”,removal:{manual:!0},table:”area”,tags:!0,type:{simple:!0},url:”area”},area_alias_type:{model:”AreaAliasType”,table:”area_alias_type”},area_type:{model:”AreaType”,table:”area_type”},artist:{add_edit_type:1,aliases:{add_edit_type:6,delete_edit_type:7,edit_edit_type:8,search_hint_type:3},annotations:{edit_type:5},collections:!0,custom_tabs:[“releases”,”recordings”,”works”,”events”],date_period:!0,disambiguation:!0,edit_table:!0,ipis:!0,isnis:!0,last_updated_column:!0,materialized_edit_status:!0,mbid:{indexable:!0,multiple:!0,relatable:”dedicated”},merging:!0,meta_table:!0,model:”Artist”,plural:”artists”,plural_url:”artists”,ratings:!0,removal:{automatic:{exempt:[1,2],extra_fks:{artist_credit_name:”artist”}}},report_filter:!0,reviews:!0,series:!0,sitemaps_lastmod_table:!0,sort_name:!0,subscriptions:{deleted:!0,entity:!0},table:”artist”,tags:!0,type:{simple:!0},url:”artist”},artist_alias_type:{model:”ArtistAliasType”,table:”artist_alias_type”},artist_credit:{mbid:{multiple:!0},model:”ArtistCredit”,table:”artist_credit”},artist_type:{model:”ArtistType”,table:”artist_type”},cdstub:{model:”CDStub”,table:”release_raw”,url:”cdstub”},cdtoc:{model:”CDTOC”,table:”cdtoc”,url:”cdtoc”},collection:{mbid:{multiple:!0,relatable:!1},model:”Collection”,plural:”collections”,plural_url:”collections”,subscriptions:{entity:!0},table:”editor_collection”,type:{simple:!0},url:”collection”},collection_type:{model:”CollectionType”,table:”editor_collection_type”},cover_art_type:{model:”CoverArtType”,table:”cover_art_archive.art_type”},editor:{last_updated_column:!0,model:”Editor”,subscriptions:{entity:!1},table:”editor”,url:”user”},event:{add_edit_type:150,aliases:{add_edit_type:155,delete_edit_type:156,edit_edit_type:157,search_hint_type:2},annotations:{edit_type:154},collections:!0,date_period:!0,disambiguation:!0,edit_table:!0,event_art:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,meta_table:!0,model:”Event”,plural:”events”,plural_url:”events”,ratings:!0,removal:{automatic:{}},reviews:!0,series:!0,table:”event”,tags:!0,type:{simple:!0},url:”event”},event_alias_type:{model:”EventAliasType”,table:”event_alias_type”},event_art_type:{cache:{id:51},model:”EventArtType”},event_type:{model:”EventType”,table:”event_type”},gender:{model:”Gender”,table:”gender”},genre:{add_edit_type:160,aliases:{add_edit_type:165,delete_edit_type:166,edit_edit_type:167,search_hint_type:2},annotations:{edit_type:164},collections:!0,disambiguation:!0,edit_table:!0,mbid:{indexable:!0,multiple:!1,relatable:”overview”},merging:!1,model:”Genre”,plural:”genres”,plural_url:”genres”,removal:{manual:!0},table:”genre”,url:”genre”},genre_alias_type:{model:”GenreAliasType”,table:”genre_alias_type”},instrument:{add_edit_type:131,aliases:{add_edit_type:136,delete_edit_type:137,edit_edit_type:138,search_hint_type:2},annotations:{edit_type:135},collections:!0,custom_tabs:[“artists”,”releases”,”recordings”],disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,model:”Instrument”,plural:”instruments”,plural_url:”instruments”,removal:{manual:!0},table:”instrument”,tags:!0,type:{simple:!0},url:”instrument”},instrument_alias_type:{model:”InstrumentAliasType”,table:”instrument_alias_type”},instrument_type:{model:”InstrumentType”,table:”instrument_type”},isrc:{model:”ISRC”,table:”isrc”,url:”isrc”},iswc:{model:”ISWC”,table:”iswc”,url:”iswc”},label:{add_edit_type:10,aliases:{add_edit_type:16,delete_edit_type:17,edit_edit_type:18,search_hint_type:2},annotations:{edit_type:15},collections:!0,date_period:!0,disambiguation:!0,edit_table:!0,ipis:!0,isnis:!0,last_updated_column:!0,materialized_edit_status:!0,mbid:{indexable:!0,multiple:!0,relatable:”dedicated”},merging:!0,meta_table:!0,model:”Label”,plural:”labels”,plural_url:”labels”,ratings:!0,removal:{automatic:{exempt:[1],extra_fks:{release_label:”label”}}},report_filter:!0,reviews:!0,sitemaps_lastmod_table:!0,subscriptions:{deleted:!0,entity:!0},table:”label”,tags:!0,type:{simple:!0},url:”label”},label_alias_type:{model:”LabelAliasType”,table:”label_alias_type”},label_type:{model:”LabelType”,table:”label_type”},language:{model:”Language”,table:”language”},link:{model:”Link”,table:”link”},link_attribute_type:{last_updated_column:!0,model:”LinkAttributeType”,table:”link_attribute_type”},link_type:{last_updated_column:!0,mbid:{relatable:!1},model:”LinkType”,table:”link_type”,url:”relationship”},medium:{mbid:{multiple:!0},model:”Medium”,table:”medium”},medium_cdtoc:{model:”MediumCDTOC”,table:”medium_cdtoc”},medium_format:{model:”MediumFormat”,table:”medium_format”},place:{add_edit_type:61,aliases:{add_edit_type:66,delete_edit_type:67,edit_edit_type:68,search_hint_type:2},annotations:{edit_type:65},collections:!0,custom_tabs:[“events”,”performances”,”map”],date_period:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,model:”Place”,plural:”places”,plural_url:”places”,ratings:!0,removal:{automatic:{}},reviews:!0,sitemaps_lastmod_table:!0,table:”place”,tags:!0,type:{simple:!0},url:”place”},place_alias_type:{model:”PlaceAliasType”,table:”place_alias_type”},place_type:{model:”PlaceType”,table:”place_type”},recording:{add_edit_type:71,aliases:{add_edit_type:711,delete_edit_type:712,edit_edit_type:713,search_hint_type:2},annotations:{edit_type:75},artist_credits:!0,collections:!0,custom_tabs:[“fingerprints”],disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{multiple:!0,relatable:”overview”},merging:!0,meta_table:!0,model:”Recording”,plural:”recordings”,plural_url:”recordings”,ratings:!0,removal:{manual:!0},report_filter:!0,reviews:!0,series:!0,sitemaps_lastmod_table:!0,table:”recording”,tags:!0,url:”recording”},recording_alias_type:{model:”RecordingAliasType”,table:”recording_alias_type”},release:{add_edit_type:31,aliases:{add_edit_type:318,delete_edit_type:319,edit_edit_type:320,search_hint_type:2},annotations:{edit_type:35},artist_credits:!0,collections:!0,cover_art:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,meta_table:!0,model:”Release”,plural:”releases”,plural_url:”releases”,removal:{manual:!0},report_filter:!0,series:!0,sitemaps_lastmod_table:!0,table:”release”,tags:!0,url:”release”},release_alias_type:{model:”ReleaseAliasType”,table:”release_alias_type”},release_group:{add_edit_type:20,aliases:{add_edit_type:26,delete_edit_type:27,edit_edit_type:28,search_hint_type:2},annotations:{edit_type:25},artist_credits:!0,collections:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,meta_table:!0,model:”ReleaseGroup”,plural:”release_groups”,plural_url:”release-groups”,ratings:!0,removal:{automatic:{extra_fks:{release:”release_group”}}},report_filter:!0,reviews:!0,series:!0,sitemaps_lastmod_table:!0,table:”release_group”,tags:!0,type:{complex:!0},url:”release-group”},release_group_alias_type:{model:”ReleaseGroupAliasType”,table:”release_group_alias_type”},release_group_secondary_type:{model:”ReleaseGroupSecondaryType”,table:”release_group_secondary_type”},release_group_type:{model:”ReleaseGroupType”,table:”release_group_primary_type”},release_packaging:{model:”ReleasePackaging”,table:”release_packaging”},release_status:{model:”ReleaseStatus”,table:”release_status”},script:{model:”Script”,table:”script”},series:{add_edit_type:140,aliases:{add_edit_type:145,delete_edit_type:146,edit_edit_type:147,search_hint_type:2},annotations:{edit_type:144},collections:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,model:”Series”,plural:”series”,plural_url:”series”,removal:{automatic:{}},report_filter:!0,subscriptions:{deleted:!0,entity:!0},table:”series”,tags:!0,type:{simple:!0},url:”series”},series_alias_type:{model:”SeriesAliasType”,table:”series_alias_type”},series_ordering_type:{model:”SeriesOrderingType”,table:”series_ordering_type”},series_type:{model:”SeriesType”,table:”series_type”},tag:{model:”Tag”,table:”tag”},track:{artist_credits:!0,last_updated_column:!0,mbid:{multiple:!0,relatable:!1},model:”Track”,plural:”tracks”,plural_url:”tracks”,table:”track”,url:”track”},url:{edit_table:!0,last_updated_column:!0,mbid:{multiple:!0,no_details:!0,relatable:”overview”},model:”URL”,plural:”urls”,plural_url:”urls”,removal:{automatic:{}},table:”url”,url:”url”},work:{add_edit_type:41,aliases:{add_edit_type:46,delete_edit_type:47,edit_edit_type:48,search_hint_type:2},annotations:{edit_type:45},collections:!0,disambiguation:!0,edit_table:!0,last_updated_column:!0,mbid:{indexable:!0,multiple:!0,relatable:”overview”},merging:!0,meta_table:!0,model:”Work”,plural:”works”,plural_url:”works”,ratings:!0,removal:{automatic:{}},report_filter:!0,reviews:!0,series:!0,sitemaps_lastmod_table:!0,table:”work”,tags:!0,type:{simple:!0},url:”work”},work_alias_type:{model:”WorkAliasType”,table:”work_alias_type”},work_attribute:{model:”WorkAttribute”,table:”work_attribute”},work_attribute_type:{model:”WorkAttributeType”,table:”work_attribute_type”},work_attribute_type_allowed_value:{model:”WorkAttributeTypeAllowedValue”,table:”work_attribute_type_allowed_value”},work_type:{model:”WorkType”,table:”work_type”}};s(“mz7fKDE”)(i);const r=i},Gwrf0XF:(e,t,s)=>{“use strict”;s.d(t,{A:()=>r});var i=s(“9azanlh”);function r(e){return(t=e._status)===i.jU?”add”:t===i.Ar?”edit”:t===i.wL?”noop”:t===i.QJ?”remove”:(()=>{throw Error(“Match: No case succesfully matched. Make exhaustive or add a wildcard case using ‘_’. Argument: “+t)})();var t}},”H+29DOL”:(e,t,s)=>{“use strict”;s.d(t,{A:()=>n,O:()=>a});var i=s(“HkNzj3j”).l,r=s(“SKGBikk”).l;function n(e){return i(“{variable}:”,{variable:e})}function a(e){return r(“{variable}:”,{variable:e})}},HMcOWk2:(e,t,s)=>{“use strict”;s.d(t,{A:()=>o,T:()=>a});var i=s(“HkNzj3j”).l,r=s(“SKGBikk”).l;function n(e,t){const s=t.length;if(!s)return””;if(1===s)return e(“{last_list_item}”,{last_list_item:t[0]});let i=e(“{almost_last_list_item} and {last_list_item}”,{almost_last_list_item:t[s-2],last_list_item:t[s-1]});for(let r=s-3;r>=0;r–)i=e(“{list_item}, {rest}”,{list_item:t[r],rest:i});return i}const a=e=>n(r,e),o=e=>n(i,e)},HR1eHg2:(e,t,s)=>{s(“vcz4isR”),s(“60ocjtt”),s(“6g1DHTE”),s(“J9/b8hK”),s(“70YSc4n”),s(“AXfG3Yq”),s(“DNaZxvn”),s(“PkUg7wA”),s(“fVvxGUI”);const i=s(“EVdnBjI”);var r,n;!function(e,t){var s,i,r=0,n=/^ui-id-\d+$/;function a(t,s){var i,r,n,a=t.nodeName.toLowerCase();return”area”===a?(r=(i=t.parentNode).name,!(!t.href||!r||”map”!==i.nodeName.toLowerCase())&&(!!(n=e(“img[usemap=#”+r+”]”)[0])&&o(n))):(/input|select|textarea|button|object/.test(a)?!t.disabled:”a”===a&&t.href||s)&&o(t)}function o(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter((function(){return”hidden”===e.css(this,”visibility”)})).length}e.ui=e.ui||{},e.extend(e.ui,{version:”1.10.3″,keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:(s=e.fn.focus,function(t,i){return”number”==typeof t?this.each((function(){var s=this;setTimeout((function(){e(s).focus(),i&&i.call(s)}),t)})):s.apply(this,arguments)}),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css(“position”))||/absolute/.test(this.css(“position”))?this.parents().filter((function(){return/(relative|absolute|fixed)/.test(e.css(this,”position”))&&/(auto|scroll)/.test(e.css(this,”overflow”)+e.css(this,”overflow-y”)+e.css(this,”overflow-x”))})).eq(0):this.parents().filter((function(){return/(auto|scroll)/.test(e.css(this,”overflow”)+e.css(this,”overflow-y”)+e.css(this,”overflow-x”))})).eq(0),/fixed/.test(this.css(“position”))||!t.length?e(document):t},zIndex:function(s){if(s!==t)return this.css(“zIndex”,s);if(this.length)for(var i,r,n=e(this[0]);n.length&&n[0]!==document;){if((“absolute”===(i=n.css(“position”))||”relative”===i||”fixed”===i)&&(r=parseInt(n.css(“zIndex”),10),!isNaN(r)&&0!==r))return r;n=n.parent()}return 0},uniqueId:function(){return this.each((function(){this.id||(this.id=”ui-id-“+ ++r)}))},removeUniqueId:function(){return this.each((function(){n.test(this.id)&&e(this).removeAttr(“id”)}))}}),e.extend(e.expr[“:”],{data:e.expr.createPseudo?e.expr.createPseudo((function(t){return function(s){return!!e.data(s,t)}})):function(t,s,i){return!!e.data(t,i[3])},focusable:function(t){return a(t,!isNaN(e.attr(t,”tabindex”)))},tabbable:function(t){var s=e.attr(t,”tabindex”),i=isNaN(s);return(i||s>=0)&&a(t,!i)}}),e(““).outerWidth(1).jquery||e.each([“Width”,”Height”],(function(s,i){var r=”Width”===i?[“Left”,”Right”]:[“Top”,”Bottom”],n=i.toLowerCase(),a={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};function o(t,s,i,n){return e.each(r,(function(){s-=parseFloat(e.css(t,”padding”+this))||0,i&&(s-=parseFloat(e.css(t,”border”+this+”Width”))||0),n&&(s-=parseFloat(e.css(t,”margin”+this))||0)})),s}e.fn[“inner”+i]=function(s){return s===t?a[“inner”+i].call(this):this.each((function(){e(this).css(n,o(this,s)+”px”)}))},e.fn[“outer”+i]=function(t,s){return”number”!=typeof t?a[“outer”+i].call(this,t):this.each((function(){e(this).css(n,o(this,t,!0,s)+”px”)}))}})),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e(““).data(“a-b”,”a”).removeData(“a-b”).data(“a-b”)&&(e.fn.removeData=(i=e.fn.removeData,function(t){return arguments.length?i.call(this,e.camelCase(t)):i.call(this)})),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart=”onselectstart”in document.createElement(“div”),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?”selectstart”:”mousedown”)+”.ui-disableSelection”,(function(e){e.preventDefault()}))},enableSelection:function(){return this.unbind(“.ui-disableSelection”)}}),e.extend(e.ui,{plugin:{add:function(t,s,i){var r,n=e.ui[t].prototype;for(r in i)n.plugins[r]=n.plugins[r]||[],n.plugins[r].push([s,i[r]])},call:function(e,t,s){var i,r=e.plugins[t];if(r&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(i=0;i0||(t[r]=1,i=t[r]>0,t[r]=0,i)}})}(i),function(e,t){var s=0,i=Array.prototype.slice,r=e.cleanData;e.cleanData=function(t){for(var s,i=0;null!=(s=t[i]);i++)try{e(s).triggerHandler(“remove”)}catch(e){}r(t)},e.widget=function(t,s,i){var r,n,a,o,l={},c=t.split(“.”)[0];t=t.split(“.”)[1],r=c+”-“+t,i||(i=s,s=e.Widget),e.expr[“:”][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[c]=e[c]||{},n=e[c][t],a=e[c][t]=function(e,t){if(!this._createWidget)return new a(e,t);arguments.length&&this._createWidget(e,t)},e.extend(a,n,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(o=new s).options=e.widget.extend({},o.options),e.each(i,(function(t,i){var r,n;e.isFunction(i)?l[t]=(r=function(){return s.prototype[t].apply(this,arguments)},n=function(e){return s.prototype[t].apply(this,e)},function(){var e,t=this._super,s=this._superApply;return this._super=r,this._superApply=n,e=i.apply(this,arguments),this._super=t,this._superApply=s,e}):l[t]=i})),a.prototype=e.widget.extend(o,{widgetEventPrefix:n?o.widgetEventPrefix:t},l,{constructor:a,namespace:c,widgetName:t,widgetFullName:r}),n?(e.each(n._childConstructors,(function(t,s){var i=s.prototype;e.widget(i.namespace+”.”+i.widgetName,a,s._proto)})),delete n._childConstructors):s._childConstructors.push(a),e.widget.bridge(t,a)},e.widget.extend=function(s){for(var r,n,a=i.call(arguments,1),o=0,l=a.length;o“,options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace=”.”+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger(“create”,null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr(“aria-disabled”).removeClass(this.widgetFullName+”-disabled ui-state-disabled”),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass(“ui-state-hover”),this.focusable.removeClass(“ui-state-focus”)},_destroy:e.noop,widget:function(){return this.element},option:function(s,i){var r,n,a,o=s;if(0===arguments.length)return e.widget.extend({},this.options);if(“string”==typeof s)if(o={},r=s.split(“.”),s=r.shift(),r.length){for(n=o[s]=e.widget.extend({},this.options[s]),a=0;a=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(e){e.ui=e.ui||{};var t,s=Math.max,i=Math.abs,r=Math.round,n=/left|center|right/,a=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,c=/%$/,u=e.fn.position;function d(e,t,s){return[parseFloat(e[0])*(c.test(e[0])?t/100:1),parseFloat(e[1])*(c.test(e[1])?s/100:1)]}function h(t,s){return parseInt(e.css(t,s),10)||0}e.position={scrollbarWidth:function(){if(undefined!==t)return t;var s,i,r=e(““),n=r.children()[0];return e(“body”).append(r),s=n.offsetWidth,r.css(“overflow”,”scroll”),s===(i=n.offsetWidth)&&(i=r[0].clientWidth),r.remove(),t=s-i},getScrollInfo:function(t){var s=t.isWindow?””:t.element.css(“overflow-x”),i=t.isWindow?””:t.element.css(“overflow-y”),r=”scroll”===s||”auto”===s&&t.width0?”right”:”center”,vertical:c<0?"top":a>0?”bottom”:”middle”};ps(i(a),i(c))?d.important=”horizontal”:d.important=”vertical”,t.using.call(this,e,d)}),o.offset(e.extend(E,{using:a}))}))},e.ui.position={fit:{left:function(e,t){var i,r=t.within,n=r.isWindow?r.scrollLeft:r.offset.left,a=r.width,o=e.left-t.collisionPosition.marginLeft,l=n-o,c=o+t.collisionWidth-a-n;t.collisionWidth>a?l>0&&c<=0?(i=e.left+l+t.collisionWidth-a-n,e.left+=l-i):e.left=c>0&&l<=0?n:l>c?n+a-t.collisionWidth:n:l>0?e.left+=l:c>0?e.left-=c:e.left=s(e.left-o,e.left)},top:function(e,t){var i,r=t.within,n=r.isWindow?r.scrollTop:r.offset.top,a=t.within.height,o=e.top-t.collisionPosition.marginTop,l=n-o,c=o+t.collisionHeight-a-n;t.collisionHeight>a?l>0&&c<=0?(i=e.top+l+t.collisionHeight-a-n,e.top+=l-i):e.top=c>0&&l<=0?n:l>c?n+a-t.collisionHeight:n:l>0?e.top+=l:c>0?e.top-=c:e.top=s(e.top-o,e.top)}},flip:{left:function(e,t){var s,r,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,c=e.left-t.collisionPosition.marginLeft,u=c-l,d=c+t.collisionWidth-o-l,h=”left”===t.my[0]?-t.elemWidth:”right”===t.my[0]?t.elemWidth:0,p=”left”===t.at[0]?t.targetWidth:”right”===t.at[0]?-t.targetWidth:0,m=-2*t.offset[0];u<0?((s=e.left+h+p+m+t.collisionWidth-o-a)<0||s0&&((r=e.left-t.collisionPosition.marginLeft+h+p+m-l)>0||i(r)u&&(r<0||r0&&(s=e.top-t.collisionPosition.marginTop+h+p+m-l,e.top+h+p+m>d&&(s>0||i(s)10&&r<11,t.innerHTML="",s.removeChild(t)}()}(i),function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var s=this.options;return!(this.helper||s.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(e(!0===s.iframeFix?”iframe”:s.iframeFix).each((function(){e(““).css({width:this.offsetWidth+”px”,height:this.offsetHeight+”px”,position:”absolute”,opacity:”0.001″,zIndex:1e3}).css(e(this).offset()).appendTo(“body”)})),!0))},_mouseStart:function(t){var s=this.options;return this.helper=this._createHelper(t),this.helper.addClass(“ui-draggable-dragging”),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css(“position”),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css(“position”),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this._setContainment(),!1===this._trigger(“start”,t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,s){if(“fixed”===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo(“absolute”),!s){var i=this._uiHash();if(!1===this._trigger(“drag”,t,i))return this._mouseUp({}),!1;this.position=i.position}return this.options.axis&&”y”===this.options.axis||(this.helper[0].style.left=this.position.left+”px”),this.options.axis&&”x”===this.options.axis||(this.helper[0].style.top=this.position.top+”px”),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var s=this,i=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(i=e.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),!(“original”===this.options.helper&&!e.contains(this.element[0].ownerDocument,this.element[0]))&&(“invalid”===this.options.revert&&!i||”valid”===this.options.revert&&i||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),(function(){!1!==s._trigger(“stop”,t)&&s._clear()})):!1!==this._trigger(“stop”,t)&&this._clear(),!1)},_mouseUp:function(t){return e(“div.ui-draggable-iframeFix”).each((function(){this.parentNode.removeChild(this)})),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(“.ui-draggable-dragging”)?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(t){var s=this.options,i=e.isFunction(s.helper)?e(s.helper.apply(this.element[0],[t])):”clone”===s.helper?this.element.clone().removeAttr(“id”):this.element;return i.parents(“body”).length||i.appendTo(“parent”===s.appendTo?this.element[0].parentNode:s.appendTo),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css(“position”))||i.css(“position”,”absolute”),i},_adjustOffsetFromHelper:function(t){“string”==typeof t&&(t=t.split(” “)),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),”left”in t&&(this.offset.click.left=t.left+this.margins.left),”right”in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),”top”in t&&(this.offset.click.top=t.top+this.margins.top),”bottom”in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return”absolute”===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&”html”===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css(“borderTopWidth”),10)||0),left:t.left+(parseInt(this.offsetParent.css(“borderLeftWidth”),10)||0)}},_getRelativeOffset:function(){if(“relative”===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css(“top”),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css(“left”),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css(“marginLeft”),10)||0,top:parseInt(this.element.css(“marginTop”),10)||0,right:parseInt(this.element.css(“marginRight”),10)||0,bottom:parseInt(this.element.css(“marginBottom”),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,s,i,r=this.options;r.containment?”window”!==r.containment?”document”!==r.containment?r.containment.constructor!==Array?(“parent”===r.containment&&(r.containment=this.helper[0].parentNode),(i=(s=e(r.containment))[0])&&(t=”hidden”!==s.css(“overflow”),this.containment=[(parseInt(s.css(“borderLeftWidth”),10)||0)+(parseInt(s.css(“paddingLeft”),10)||0),(parseInt(s.css(“borderTopWidth”),10)||0)+(parseInt(s.css(“paddingTop”),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(s.css(“borderRightWidth”),10)||0)-(parseInt(s.css(“paddingRight”),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(s.css(“borderBottomWidth”),10)||0)-(parseInt(s.css(“paddingBottom”),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=s)):this.containment=r.containment:this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,s){s||(s=this.position);var i=”absolute”===t?1:-1,r=”absolute”!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),{top:s.top+this.offset.relative.top*i+this.offset.parent.top*i-(“fixed”===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*i,left:s.left+this.offset.relative.left*i+this.offset.parent.left*i-(“fixed”===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*i}},_generatePosition:function(t){var s,i,r,n,a=this.options,o=”absolute”!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=t.pageX,c=t.pageY;return this.offset.scroll||(this.offset.scroll={top:o.scrollTop(),left:o.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(i=this.relative_container.offset(),s=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):s=this.containment,t.pageX-this.offset.click.lefts[2]&&(l=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(c=s[3]+this.offset.click.top)),a.grid&&(r=a.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,c=s?r-this.offset.click.top>=s[1]||r-this.offset.click.top>s[3]?r:r-this.offset.click.top>=s[1]?r-a.grid[1]:r+a.grid[1]:r,n=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=s?n-this.offset.click.left>=s[0]||n-this.offset.click.left>s[2]?n:n-this.offset.click.left>=s[0]?n-a.grid[0]:n+a.grid[0]:n)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(“fixed”===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(“fixed”===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass(“ui-draggable-dragging”),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,s,i){return i=i||this._uiHash(),e.ui.plugin.call(this,t,[s,i]),”drag”===t&&(this.positionAbs=this._convertPositionTo(“absolute”)),e.Widget.prototype._trigger.call(this,t,s,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add(“draggable”,”connectToSortable”,{start:function(t,s){var i=e(this).data(“ui-draggable”),r=i.options,n=e.extend({},s,{item:i.element});i.sortables=[],e(r.connectToSortable).each((function(){var s=e.data(this,”ui-sortable”);s&&!s.options.disabled&&(i.sortables.push({instance:s,shouldRevert:s.options.revert}),s.refreshPositions(),s._trigger(“activate”,t,n))}))},stop:function(t,s){var i=e(this).data(“ui-draggable”),r=e.extend({},s,{item:i.element});e.each(i.sortables,(function(){this.instance.isOver?(this.instance.isOver=0,i.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,”original”===i.options.helper&&this.instance.currentItem.css({top:”auto”,left:”auto”})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger(“deactivate”,t,r))}))},drag:function(t,s){var i=e(this).data(“ui-draggable”),r=this;e.each(i.sortables,(function(){var n=!1,a=this;this.instance.positionAbs=i.positionAbs,this.instance.helperProportions=i.helperProportions,this.instance.offset.click=i.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(n=!0,e.each(i.sortables,(function(){return this.instance.positionAbs=i.positionAbs,this.instance.helperProportions=i.helperProportions,this.instance.offset.click=i.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(a.instance.element[0],this.instance.element[0])&&(n=!1),n}))),n?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(r).clone().removeAttr(“id”).appendTo(this.instance.element).data(“ui-sortable-item”,!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return s.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=i.offset.click.top,this.instance.offset.click.left=i.offset.click.left,this.instance.offset.parent.left-=i.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=i.offset.parent.top-this.instance.offset.parent.top,i._trigger(“toSortable”,t),i.dropped=this.instance.element,i.currentItem=i.element,this.instance.fromOutside=i),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger(“out”,t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),i._trigger(“fromSortable”,t),i.dropped=!1)}))}}),e.ui.plugin.add(“draggable”,”cursor”,{start:function(){var t=e(“body”),s=e(this).data(“ui-draggable”).options;t.css(“cursor”)&&(s._cursor=t.css(“cursor”)),t.css(“cursor”,s.cursor)},stop:function(){var t=e(this).data(“ui-draggable”).options;t._cursor&&e(“body”).css(“cursor”,t._cursor)}}),e.ui.plugin.add(“draggable”,”opacity”,{start:function(t,s){var i=e(s.helper),r=e(this).data(“ui-draggable”).options;i.css(“opacity”)&&(r._opacity=i.css(“opacity”)),i.css(“opacity”,r.opacity)},stop:function(t,s){var i=e(this).data(“ui-draggable”).options;i._opacity&&e(s.helper).css(“opacity”,i._opacity)}}),e.ui.plugin.add(“draggable”,”scroll”,{start:function(){var t=e(this).data(“ui-draggable”);t.scrollParent[0]!==document&&”HTML”!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var s=e(this).data(“ui-draggable”),i=s.options,r=!1;s.scrollParent[0]!==document&&”HTML”!==s.scrollParent[0].tagName?(i.axis&&”x”===i.axis||(s.overflowOffset.top+s.scrollParent[0].offsetHeight-t.pageY=0;d–)l=(o=p.snapElements[d].left)+p.snapElements[d].width,u=(c=p.snapElements[d].top)+p.snapElements[d].height,bl+g||wu+g||!e.contains(p.snapElements[d].item.ownerDocument,p.snapElements[d].item)?(p.snapElements[d].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=!1):(“inner”!==m.snapMode&&(i=Math.abs(c-w)<=g,r=Math.abs(u-y)<=g,n=Math.abs(o-b)<=g,a=Math.abs(l-f)<=g,i&&(s.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),r&&(s.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),n&&(s.position.left=p._convertPositionTo("relative",{top:0,left:o-p.helperProportions.width}).left-p.margins.left),a&&(s.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),h=i||r||n||a,"outer"!==m.snapMode&&(i=Math.abs(c-y)<=g,r=Math.abs(u-w)<=g,n=Math.abs(o-f)<=g,a=Math.abs(l-b)<=g,i&&(s.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),r&&(s.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),n&&(s.position.left=p._convertPositionTo("relative",{top:0,left:o}).left-p.margins.left),a&&(s.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[d].snapping&&(i||r||n||a||h)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=i||r||n||a||h)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,s=this.data("ui-draggable").options,i=e.makeArray(e(s.stack)).sort((function(t,s){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(s).css("zIndex"),10)||0)}));i.length&&(t=parseInt(e(i[0]).css("zIndex"),10)||0,e(i).each((function(s){e(this).css("zIndex",t+s)})),this.css("zIndex",t+i.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,s){var i=e(s.helper),r=e(this).data("ui-draggable").options;i.css("zIndex")&&(r._zIndex=i.css("zIndex")),i.css("zIndex",r.zIndex)},stop:function(t,s){var i=e(this).data("ui-draggable").options;i._zIndex&&e(s.helper).css("zIndex",i._zIndex)}})}(i),function(e){function t(e){return parseInt(e,10)||0}function s(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,s,i,r,n=this,a=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("“).css({position:this.element.css(“position”),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css(“top”),left:this.element.css(“left”)})),this.element=this.element.parent().data(“ui-resizable”,this.element.data(“ui-resizable”)),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css(“marginLeft”),marginTop:this.originalElement.css(“marginTop”),marginRight:this.originalElement.css(“marginRight”),marginBottom:this.originalElement.css(“marginBottom”)}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css(“resize”),this.originalElement.css(“resize”,”none”),this._proportionallyResizeElements.push(this.originalElement.css({position:”static”,zoom:1,display:”block”})),this.originalElement.css({margin:this.originalElement.css(“margin”)}),this._proportionallyResize()),this.handles=a.handles||(e(“.ui-resizable-handle”,this.element).length?{n:”.ui-resizable-n”,e:”.ui-resizable-e”,s:”.ui-resizable-s”,w:”.ui-resizable-w”,se:”.ui-resizable-se”,sw:”.ui-resizable-sw”,ne:”.ui-resizable-ne”,nw:”.ui-resizable-nw”}:”e,s,se”),this.handles.constructor===String)for(“all”===this.handles&&(this.handles=”n,e,s,w,se,sw,ne,nw”),t=this.handles.split(“,”),this.handles={},s=0;s
“)).css({zIndex:a.zIndex}),”se”===i&&r.addClass(“ui-icon ui-icon-gripsmall-diagonal-se”),this.handles[i]=”.ui-resizable-“+i,this.element.append(r);this._renderAxis=function(t){var s,i,r,n;for(s in t=t||this.element,this.handles)this.handles[s].constructor===String&&(this.handles[s]=e(this.handles[s],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(i=e(this.handles[s],this.element),n=/sw|ne|nw|se|n|s/.test(s)?i.outerHeight():i.outerWidth(),r=[“padding”,/ne|nw|n/.test(s)?”Top”:/se|sw|s/.test(s)?”Bottom”:/^e$/.test(s)?”Right”:”Left”].join(“”),t.css(r,n),this._proportionallyResize()),e(this.handles[s]).length},this._renderAxis(this.element),this._handles=e(“.ui-resizable-handle”,this.element).disableSelection(),this._handles.mouseover((function(){n.resizing||(this.className&&(r=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),n.axis=r&&r[1]?r[1]:”se”)})),a.autoHide&&(this._handles.hide(),e(this.element).addClass(“ui-resizable-autohide”).mouseenter((function(){a.disabled||(e(this).removeClass(“ui-resizable-autohide”),n._handles.show())})).mouseleave((function(){a.disabled||n.resizing||(e(this).addClass(“ui-resizable-autohide”),n._handles.hide())}))),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,s=function(t){e(t).removeClass(“ui-resizable ui-resizable-disabled ui-resizable-resizing”).removeData(“resizable”).removeData(“ui-resizable”).unbind(“.resizable”).find(“.ui-resizable-handle”).remove()};return this.elementIsWrapper&&(s(this.element),t=this.element,this.originalElement.css({position:t.css(“position”),width:t.outerWidth(),height:t.outerHeight(),top:t.css(“top”),left:t.css(“left”)}).insertAfter(t),t.remove()),this.originalElement.css(“resize”,this.originalResizeStyle),s(this.originalElement),this},_mouseCapture:function(t){var s,i,r=!1;for(s in this.handles)((i=e(this.handles[s])[0])===t.target||e.contains(i,t.target))&&(r=!0);return!this.options.disabled&&r},_mouseStart:function(s){var i,r,n,a=this.options,o=this.element.position(),l=this.element;return this.resizing=!0,/absolute/.test(l.css(“position”))?l.css({position:”absolute”,top:l.css(“top”),left:l.css(“left”)}):l.is(“.ui-draggable”)&&l.css({position:”absolute”,top:o.top,left:o.left}),this._renderProxy(),i=t(this.helper.css(“left”)),r=t(this.helper.css(“top”)),a.containment&&(i+=e(a.containment).scrollLeft()||0,r+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:r},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:i,top:r},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()},this.originalMousePosition={left:s.pageX,top:s.pageY},this.aspectRatio=”number”==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(“.ui-resizable-“+this.axis).css(“cursor”),e(“body”).css(“cursor”,”auto”===n?this.axis+”-resize”:n),l.addClass(“ui-resizable-resizing”),this._propagate(“start”,s),!0},_mouseDrag:function(t){var s,i=this.helper,r={},n=this.originalMousePosition,a=this.axis,o=this.position.top,l=this.position.left,c=this.size.width,u=this.size.height,d=t.pageX-n.left||0,h=t.pageY-n.top||0,p=this._change[a];return!!p&&(s=p.apply(this,[t,d,h]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(s=this._updateRatio(s,t)),s=this._respectSize(s,t),this._updateCache(s),this._propagate(“resize”,t),this.position.top!==o&&(r.top=this.position.top+”px”),this.position.left!==l&&(r.left=this.position.left+”px”),this.size.width!==c&&(r.width=this.size.width+”px”),this.size.height!==u&&(r.height=this.size.height+”px”),i.css(r),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||this._trigger(“resize”,t,this.ui()),!1)},_mouseStop:function(t){this.resizing=!1;var s,i,r,n,a,o,l,c=this.options,u=this;return this._helper&&(r=(i=(s=this._proportionallyResizeElements).length&&/textarea/i.test(s[0].nodeName))&&e.ui.hasScroll(s[0],”left”)?0:u.sizeDiff.height,n=i?0:u.sizeDiff.width,a={width:u.helper.width()-n,height:u.helper.height()-r},o=parseInt(u.element.css(“left”),10)+(u.position.left-u.originalPosition.left)||null,l=parseInt(u.element.css(“top”),10)+(u.position.top-u.originalPosition.top)||null,c.animate||this.element.css(e.extend(a,{top:l,left:o})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!c.animate&&this._proportionallyResize()),e(“body”).css(“cursor”,”auto”),this.element.removeClass(“ui-resizable-resizing”),this._propagate(“stop”,t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,i,r,n,a,o=this.options;a={minWidth:s(o.minWidth)?o.minWidth:0,maxWidth:s(o.maxWidth)?o.maxWidth:1/0,minHeight:s(o.minHeight)?o.minHeight:0,maxHeight:s(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,r=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),r>a.minHeight&&(a.minHeight=r),i- “).addClass(“ui-autocomplete ui-front”).appendTo(this._appendTo()).menu({role:null}).hide().data(“ui-menu”),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay((function(){delete this.cancelBlur}));var s=this.menu.element[0];e(t.target).closest(“.ui-menu-item”).length||this._delay((function(){var t=this;this.document.one(“mousedown”,(function(i){i.target===t.element[0]||i.target===s||e.contains(s,i.target)||t.close()}))}))},menufocus:function(t,s){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one(“mousemove”,(function(){e(t.target).trigger(t.originalEvent)}));var i=s.item.data(“ui-autocomplete-item”);!1!==this._trigger(“focus”,t,{item:i})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value):this.liveRegion.text(i.value)},menuselect:function(e,t){var s=t.item.data(“ui-autocomplete-item”),i=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=i,this._delay((function(){this.previous=i,this.selectedItem=s}))),!1!==this._trigger(“select”,e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=e(““,{role:”status”,”aria-live”:”polite”}).addClass(“ui-helper-hidden-accessible”).insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr(“autocomplete”)}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass(“ui-autocomplete-input”).removeAttr(“autocomplete”),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),”source”===e&&this._initSource(),”appendTo”===e&&this.menu.element.appendTo(this._appendTo()),”disabled”===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(“.ui-front”)),t.length||(t=this.document[0].body),t},_initSource:function(){var t,s,i=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(s,i){i(e.ui.autocomplete.filter(t,s.term))}):”string”==typeof this.options.source?(s=this.options.source,this.source=function(t,r){i.xhr&&i.xhr.abort(),i.xhr=e.ajax({url:s,data:t,dataType:”json”,success:function(e){r(e)},error:function(){r([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay((function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))}),this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length