1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1c803454-d441-4221-9273-b749940e7967",e._sentryDebugIdIdentifier="sentry-dbid-1c803454-d441-4221-9273-b749940e7967")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7714],{30859:(e,n,t)=>{t.d(n,{A:()=>o});var a=t(37876);t(14232);var r=t(37783),i=t(85254);let l=r.Ay.div.withConfig({componentId:"sc-88375103-0"})(['display:flex;flex-direction:column;align-items:center;background:#171814;border:1px solid rgba(255,255,255,0.12);border-radius:3px;box-shadow:0 0 32px 0 rgba(0,0,0,1);> label{display:flex;flex-direction:row;justify-content:space-between;align-items:center;font-family:"Russo One",sans-serif;font-size:18px;padding:8px 8px 8px 15px;width:100%;background:black;> i{padding:4px 6px;font-size:16px;cursor:pointer;&:hover{background:rgba(255,255,255,0.15);border-radius:3px;}}}']),o=e=>{let{title:n,visible:t,onClose:r,children:o}=e;return t?(0,a.jsx)(i.G2Y,{onClose:r,dismissOnClick:"background",backgroundFadeMs:200,zoomOnOpen:!0,children:(0,a.jsxs)(l,{children:[(0,a.jsxs)("label",{children:[n,(0,a.jsx)("i",{className:"fal fa-times",onClick:e=>{e.preventDefault(),e.stopPropagation(),r()}})]}),o]})}):null}},87714:(e,n,t)=>{t.r(n),t.d(n,{GamePlayerInputModal:()=>A,default:()=>_});var a=t(37876),r=t(37731),i=t(15152),l=t(14232),o=t(85254),s=t(37783),c=t(47182),d=t(69142);let u=s.Ay.span.withConfig({componentId:"sc-6e009059-0"})(["display:flex;width:100%;justify-content:space-between;align-items:center;"]),h=s.Ay.span.withConfig({componentId:"sc-6e009059-1"})(["margin-left:20px;display:inline-block;color:white;border-radius:3px;font-weight:bold;font-size:12px;padding:2px 5px;line-height:16px;i{margin-right:5px;}"]),p=[o.DuD.AUTHORIZED_ONLY,o.DuD.STAFF_ONLY,o.DuD.LOGGED_IN_USERS,o.DuD.PUBLIC,o.DuD.OFF],x=e=>{let{childrenClassName:n,includePredicate:t}=e,r=(0,o.Jru)(),{unsafeHeaders:i}=(0,c.Yk)(),l=e=>r[e].status!==o.DuD.AUTHORIZED_ONLY?()=>null:async()=>{let n=r[e];(await fetch((0,d.y0)("/features/".concat(e,"/")),{method:"POST",body:JSON.stringify({enabled:!n.enabled_for_user}),headers:{Accept:"application/json","Content-Type":"application/json",...i},mode:"cors",credentials:"include"})).ok&&window.location.reload()};return(0,a.jsx)(a.Fragment,{children:Object.entries(r).sort((e,n)=>{let[t,a]=e,[r,i]=n;return p.indexOf(a.status)-p.indexOf(i.status)||(a.name>i.name?1:-1)}).map(e=>{let[r,i]=e;return t&&!t(i)?null:(0,a.jsx)(o.tJh,{href:i.status===o.DuD.AUTHORIZED_ONLY?void 0:"https://api.mtga.untapped.gg/admin/features/feature/","data-feature":r,className:n,onClick:l(r),children:(0,a.jsxs)(u,{children:[i.name,(0,a.jsxs)(h,{style:{background:i.enabled_for_user?"#28a745":"#6c757d"},children:[i.status!==o.DuD.AUTHORIZED_ONLY?(0,a.jsx)("i",{className:"fal fa-lock"}):null,i.status]})]})},r)})})};var f=t(20500),m=t(30859),g=t(38625),y=t(36350),b=t(4110);let j=s.Ay.div.withConfig({componentId:"sc-c9c3febf-0"})(["display:flex;flex-direction:column;gap:20px;padding:20px;min-width:400px;> .button{margin:10px auto;}"]),v=e=>{let{onClose:n}=e,t=(0,l.useRef)(null),{unsafeHeaders:r}=(0,c.Yk)(),[i,s]=(0,l.useState)(!1),[u,h]=(0,l.useState)(null),[p,x]=(0,l.useState)(null),[f,v]=(0,l.useState)(!1),{data:k}=(0,y.h$)(),w=(0,l.useMemo)(()=>{var e;return null!=(e=Object.values(null!=k?k:{}).map(e=>({value:"".concat(e.current.id),label:"".concat(e.current.event_name," (").concat(e.current.id,")")})))?e:[]},[k]),[C,A]=(0,l.useState)(w[0]),{data:S,loading:O,refresh:_}=(0,y.a5)(!0),N=(0,l.useMemo)(()=>(null!=S?S:[]).filter(e=>{var n,t;return(null==C||null==(n=C.label)?void 0:n.toString().includes("Play_Brawl_Historic"))?(null==(t=e.metadata)?void 0:t.type)===g.PK.Commander:!e.metadata||e.metadata.type!==g.PK.Commander}),[S,C]),[I,D]=(0,l.useState)([]),T=(0,l.useMemo)(()=>I.length?N.filter(e=>!e.metadata||e.metadata.type!==g.PK.Color):N.filter(e=>{var n;return(null==(n=e.metadata)?void 0:n.type)===g.PK.Color}),[N,I]),[P,J]=(0,l.useState)([]),L=(0,l.useMemo)(()=>P.length?N.filter(e=>!e.metadata||e.metadata.type!==g.PK.Color):N.filter(e=>{var n;return(null==(n=e.metadata)?void 0:n.type)===g.PK.Color}),[N,P]);return(0,a.jsx)(m.A,{title:"Archetype Name Hotfix",visible:!0,onClose:n,children:(0,a.jsxs)(j,{ref:t,children:[(0,a.jsx)(o.AdA,{label:"Meta Period",children:(0,a.jsx)(o.wFK,{options:w,selectedOption:C,onChange:A,menuPortalTarget:t.current,stylesOverride:{control:()=>({minWidth:350}),menu:()=>({minWidth:350})}})}),(0,a.jsx)(o.AdA,{label:"Current Archetype",children:(0,a.jsx)(b.Ay,{primary:I,secondary:[],allTags:S||[],availableTags:T,loading:O,refreshTags:_,assignTag:async e=>new Promise(n=>{D(I.concat(e)),n(!0)}),removeTag:async e=>new Promise(n=>{D(I.filter(n=>n.id!==e.id)),n(!0)}),tagSources:null,hideLabel:!0})}),(0,a.jsx)(o.AdA,{label:"New Archetype",children:(0,a.jsx)(b.Ay,{primary:P,secondary:[],allTags:S||[],availableTags:L,loading:O,refreshTags:_,assignTag:async e=>new Promise(n=>{J(P.concat(e)),n(!0)}),removeTag:async e=>new Promise(n=>{J(P.filter(n=>n.id!==e.id)),n(!0)}),tagSources:null,hideLabel:!0})}),(0,a.jsx)(o.oVT,{text:"Refresh Queries",checked:f,onChange:v}),u?(0,a.jsx)("span",{children:u}):null,p?(0,a.jsx)("span",{style:{maxWidth:300},children:p.split(",").join(",\n")}):null,(0,a.jsx)(o.$nd,{color:"success",disabled:i,onClick:async()=>{s(!0),h(null),x(null),await fetch((0,d.y0)("archetype-override"),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...r},mode:"cors",credentials:"include",body:JSON.stringify({meta_period_id:+C.value,archetype_tags:I.map(e=>e.id),new_archetype_tags:P.map(e=>e.id),refresh_queries:f})}).then(async e=>{if(201===e.status){h("Archetype successfully created."),x(JSON.stringify(await e.json()));return}if(200===e.status)return void h("Archetype override already exists");h("Archetype override error"),x(JSON.stringify(await e.json()))}).finally(()=>s(!1))},children:"Publish Name Override"})]})})};var k=t(2823);let w=s.Ay.div.withConfig({componentId:"sc-e7fcc9d-0"})(["position:relative;margin-right:-10px;@media (max-width:1099px){width:100%;.button{width:100%;}}"]),C=s.Ay.div.withConfig({componentId:"sc-e7fcc9d-1"})(["display:flex;width:100%;> *{width:100%;}.button{width:100%;border-radius:0;}> *{&:first-of-type{.button{border-radius:3px 0 0 3px;}}&:last-of-type{.button{border-radius:0 3px 3px 0;}}}"]),A=s.Ay.div.withConfig({componentId:"sc-e7fcc9d-2"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;width:100%;background:rgba(31,33,28,0.94);position:fixed;left:0;top:0;pointer-events:all;z-index:1;"]),S=s.Ay.input.withConfig({componentId:"sc-e7fcc9d-3"}
1)(["width:200px;margin:0;border:none;outline:none;padding:5px 10px;font-size:14px;height:40px;background:white;color:black;pointer-events:all;border-radius:3px 3px 0 0;border-bottom:1px solid rgba(0,0,0,0.1);margin-bottom:20px;"]);function O(e,n){var t;return null==e||null==(t=e.Cookie.split(";").find(e=>e.trim().startsWith("".concat(n,"="))))?void 0:t.split("=")[1]}let _=()=>{let{safeHeaders:e}=(0,c.Yk)(),[n,t]=(0,l.useState)(!1),[s,d]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[g,y]=(0,l.useState)(!1),[b,j]=(0,l.useState)(""),[_,N]=(0,l.useState)(!1),I=new URL("/admin",i.QU),D=(0,l.useRef)(null),T=(0,l.useRef)(null),P=(0,l.useRef)(null),J=(0,l.useRef)(null),L=(0,l.useRef)(null),[F,R]=(0,o.KAN)(k.L5,!1),[K,M]=(0,o.KAN)(k.sW,!1),[E,U]=(0,o.KAN)(o.R$Y,!1),[Y,H]=(0,o.KAN)(k.MY,!1),[z,W]=(0,o.KAN)(k.gV,!1),[B,G]=(0,o.KAN)(k.uB,!1),Z=!!F,$=!!K,V=!!E,Q=!!Y,X=!!z,q=!!B,ee=(0,o.e59)(1100),en=(0,r.x)("devtools"),et=(0,r.x)("rnd-pages"),ea=(0,r.x)("draft-commentary-author"),er=(0,r.x)("draft-commentary-manager"),ei=ea||er,el=(0,r.x)("mulligan-tagging-author");if(!en&&!ei)return null;let eo=(e,n,t,r,i)=>(0,a.jsxs)(o.tJh,{ref:e,icon:t,onMouseEnter:()=>{var e;clearInterval(null!=(e=D.current)?e:0),d(n)},onMouseLeave:()=>D.current=setInterval(()=>d(null),200),children:[(0,a.jsx)("span",{style:{color:null!=i?i:"black"},children:r}),(0,a.jsx)("i",{className:"fas fa-chevron-right",style:{marginLeft:"auto",fontSize:12}})]}),es=(e,n,t)=>(0,a.jsx)(o.rId,{open:s===n,onMouseEnter:()=>{var e;return clearInterval(null!=(e=D.current)?e:0)},onMouseLeave:()=>d(null),onClose:()=>d(null),source:e,alignment:"right",arrow:!1,inline:!!ee,style:ee?void 0:{transform:"translateX(calc(100% + 10px))"},children:t});return(0,a.jsxs)(w,{children:[(0,a.jsx)(C,{children:(0,a.jsx)(o.m_M,{position:"bottom",data:"Admin Tools",variant:"borderless",children:(0,a.jsx)(o.$nd,{ref:T,variant:"text",icon:"code",onClick:()=>t(!n)})})}),(0,a.jsxs)(o.CzL,{feature:"devtools",children:[es(P.current,"features",(0,a.jsx)(x,{includePredicate:e=>!e.name.startsWith("uc.")})),es(J.current,"ucFeatures",(0,a.jsx)(x,{includePredicate:e=>e.name.startsWith("uc.")})),es(L.current,"viewAs",(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.tJh,{active:Z,checkbox:!0,onClick:()=>{R(!Z,{path:"/"}),window.location.reload()},children:"Anonymous Visitor"}),(0,a.jsx)(o.tJh,{active:$,checkbox:!0,onClick:()=>{M(!$,{path:"/"}),window.location.reload()},children:"Free User"}),(0,a.jsx)(o.tJh,{active:Q,checkbox:!0,onClick:()=>{H(!Q,{path:"/"}),window.location.reload()},children:"Constructed Only subscription"}),(0,a.jsx)(o.tJh,{active:X,checkbox:!0,onClick:()=>{W(!X,{path:"/"}),window.location.reload()},children:"Limited Only subscription"}),(0,a.jsx)(o.tJh,{active:V,checkbox:!0,onClick:()=>{U(!V,{path:"/"}),window.location.reload()},children:"macOS User"}),(0,a.jsx)(o.tJh,{active:q,checkbox:!0,onClick:()=>{G(!q,{path:"/"}),window.location.reload()},children:"No Collection User"})]}))]}),en?(0,a.jsxs)(o.rId,{open:n,onClose:()=>t(!1),source:T.current,alignment:"right",inline:!!ee,children:[eo(P,"features","fal fa-tags","Feature Tags"),eo(J,"ucFeatures","fal fa-tags","Feature Tags (UC)"),eo(L,"viewAs","fal fa-mask","View As",Z||$||Q||X||q?o.XDS.WarningBackground:void 0),(0,a.jsx)("hr",{}),(0,a.jsx)(o.tJh,{icon:"fal fa-external-link",children:(0,a.jsx)("a",{href:I.toString(),target:"_blank",rel:"noreferrer",children:"API Admin"})}),(0,a.jsx)(o.tJh,{icon:"fal fa-external-link",children:(0,a.jsx)("a",{href:"/admin/meta-periods",target:"_blank",children:"Meta Periods"})}),(0,a.jsx)(o.tJh,{icon:"fal fa-copy",onClick:()=>{(0,o.DkS)("SESSION_COOKIE=".concat(O(e,i.CN),"\nCSRF_TOKEN=").concat(O(e,i.KN)))},children:"Copy Session Cookies"}),(0,a.jsx)("hr",{}),et?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.tJh,{onClick:()=>N(!0),children:(0,a.jsx)("span",{children:"Archetype Name Hot-Fix"})}),(0,a.jsx)(o.tJh,{onClick:()=>h(!0),children:"Game Mulligan Stats"}),(0,a.jsx)(o.tJh,{onClick:()=>y(!0),children:"Game Sealed Recommendations"})]}):null,el?(0,a.jsx)(o.tJh,{icon:"fal fa-external-link",children:(0,a.jsx)("a",{href:"/admin/mulligan",target:"_blank",children:"Mulligan Tagging"})}):null,ei?(0,a.jsx)(o.tJh,{icon:"fal fa-external-link",children:(0,a.jsx)("a",{href:"/admin/commentaries/draft",target:"_blank",children:"Draft Commentary"})}):null]}
1):null,u?(0,a.jsx)(o.ZLI,{id:"game-player-input",children:(0,a.jsxs)(A,{onClick:()=>h(!1),children:[(0,a.jsx)(S,{type:"number",value:p,onChange:e=>m(e.target.value),onClick:e=>e.stopPropagation(),placeholder:"Insert a game player id",autoFocus:!0}),(0,a.jsx)(f.N,{href:"/admin/game/mulligan/".concat(p),passHref:!0,legacyBehavior:!0,children:(0,a.jsx)(o.$nd,{color:"primary",onClick:()=>{h(!1),m("")},children:"Load"})})]})}):null,g?(0,a.jsx)(o.ZLI,{id:"sealed-pool-input",children:(0,a.jsxs)(A,{onClick:()=>y(!1),children:[(0,a.jsx)(S,{type:"text",value:b,onChange:e=>j(e.target.value),onClick:e=>e.stopPropagation(),placeholder:"Insert the deckstring for the sealed pool",autoFocus:!0}),(0,a.jsx)(f.N,{href:"/admin/sealed/pool/".concat(b),passHref:!0,legacyBehavior:!0,children:(0,a.jsx)(o.$nd,{color:"primary",onClick:()=>{y(!1),j("")},children:"Load"})})]})}):null,_?(0,a.jsx)(v,{onClose:()=>N(!1)}):null]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.