1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2051],{555:e=>{e.exports={content:"activeFilters_content__3kygZ",label:"activeFilters_label__CVyQ2",button:"activeFilters_button__GUrZv",clearAll:"activeFilters_clearAll__AXHqw",smallerGap:"activeFilters_smallerGap__7SVV2"}},48811:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-cards",function(){return t(81345)}])},49379:e=>{e.exports={container:"customCardFilters_container__l4pBi",inputs:"customCardFilters_inputs__lSNPr",controls:"customCardFilters_controls__rTc_s"}},59475:e=>{e.exports={container:"customCardImageCard_container__4x5wg",controls:"customCardImageCard_controls__ZsiPH",filpButtonContainer:"customCardImageCard_filpButtonContainer__5ha_F",increaseButton:"customCardImageCard_increaseButton__8Gwab",decreaseButton:"customCardImageCard_decreaseButton__dwIpj",extraMenuContainer:"customCardImageCard_extraMenuContainer__kNLvK",extraMenu:"customCardImageCard_extraMenu__Mqrdr",deleteCardModal:"customCardImageCard_deleteCardModal___8Nwf",message:"customCardImageCard_message__U_z0I"}},68367:(e,a,t)=>{"use strict";t.d(a,{A:()=>g});var s=t(75038),r=t(76430),n=t(21159),l=t(84806),o=t(10993),c=t(40120),i=t(8682),d=t(49762),u=t(90922),m=t(14550),C=t(99364),h=t(23895),p=t(59475),y=t.n(p);let g=(0,r.memo)(({card:e,onCardEdited:a,onCardRemoved:t,noExtrasMenu:p=!1,onAddToDeckState:g})=>{let[x,_]=(0,r.useState)(!1),[j,b]=(0,r.useState)(!1),[v,f]=(0,r.useState)(!1),[k,q]=(0,r.useState)(!1),[T,S]=(0,r.useState)(!1),w=l.Yp.includes(e.layout);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:y().container,children:[(0,s.jsx)(o.A,{card:e,onDoubleClick:()=>q(!0),flipped:x}),(0,s.jsxs)("div",{className:y().controls,children:[!!g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{className:y().increaseButton,onClick:()=>g(e),children:(0,s.jsx)(c.A,{name:"add"})}),(0,s.jsx)("button",{className:y().decreaseButton,onClick:()=>g(e),disabled:!e.qty,children:(0,s.jsx)(c.A,{name:"minus"})})]}),(0,s.jsx)("button",{onClick:()=>q(!0),children:(0,s.jsx)(c.A,{name:"chevron right"})})]}),w&&(0,s.jsx)("div",{className:y().filpButtonContainer,children:(0,s.jsx)("button",{onClick:()=>_(!x),children:(0,s.jsx)(c.A,{name:"refresh"})})}),!p&&(0,s.jsx)("div",{className:y().extraMenuContainer,children:(0,s.jsx)(i.A,{menuClassName:y().extraMenu,options:[{label:"Edit custom card",icon:"edit outline",onClick:()=>q(!0)},{type:"spacer"},{label:"Add to deck",icon:"circle-plus",onClick:()=>S(!0)},{label:"Delete Custom Card",icon:"trash alternate outline",onClick:()=>b(!0),hidden:!t}]})})]}),(0,s.jsx)(m.A,{card:k?e:null,onClose:()=>q(!1),onCardEdited:a}),(0,s.jsx)(u.A,{delayEnabledTime:3e3,open:j,onClose:()=>b(!0),buttonText:`Delete Custom Card - ${e?.name}`,header:`Delete custom card - ${e?.name}`,modelClassName:y().deleteCardModal,message:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{children:"WARNING"}),(0,s.jsx)("p",{children:"Deleting a custom card will blank out this custom card from any decks it exits in. The card will become uneditable, but the existance of a blank custom card record will still be present to maintain the deck's metadata."}),(0,s.jsx)(h.A,{card:e,tableOnly:!0})]}),loadingMessage:"Removing custom card",onDelete:()=>e.customCard?.id?(f(!0),d.A.remove(e.customCard.id).then(()=>t&&t(e.customCard?.id||0)).catch(()=>n.A.create("Unable to delete Custom Card","Custom Card Service","error")).finally(()=>f(!1))):(n.A.create("Unable to delete card that has not been created","Custom Card Service","warning"),new Promise(()=>null))}),(0,s.jsx)(C.A,{open:T,card:e,onClose:()=>S(!1),parentControlled:!0})]})})},71448:(e,a,t)=>{"use strict";t.d(a,{A:()=>j});var s=t(75038);t(76430);var r=t(40120),n=t(98381),l=t(82185),o=t(8052),c=t(85785),i=t(89408),d=t(68759),u=t(555),m=t.n(u),C=t(77861);let h=["username","page","pageSize","collectionOrderBy","orderDirection","cardSearch","quantityLogic","priceSource"],p=["undefined","null","true",""],y=["types","subTypes","superTypes","colors","rarity"],g=["name","editions","types","subTypes","superTypes","formatLegality","colorIdentity","color","rarity"],x={syntaxQuery:"Syntax",treatment:"",editions:"Set code",types:"Type",subTypes:"Subtypes",superTypes:"Supertypes",formatLegality:"Format Legality",colorIdentity:"Filtering by color identity",cardName:"C
1ard name:",name:"Card name:",manaValue:"Mana value:",search:"Text search:",orderBy:"Order by:"},_={eq:"=",gt:">",lt:"<",gte:">=",lte:"<="},j=({className:e=""})=>{let a=(0,n.useRouter)(),t=e=>{let t={...a.query};Array.isArray(e)?e.forEach(e=>delete t[e]):delete t[e],Object.keys(t).some(e=>g.includes(e))||delete t.cardSearch,a.push({query:t})},l=Object.keys(a.query).reduce((e,t)=>("undefined"===a.query[t]||""===a.query[t]||h.includes(t)||e.push(t),e),[]);return 0===l.length?null:(0,s.jsxs)("div",{className:`${m().content} ${e}`,children:[(0,s.jsx)("span",{className:m().label,children:"Active filters "}),l.map(e=>{let n=`${a.query[e]}`;return"andTags"===e&&a.query.andTags?(0,s.jsx)(v,{type:"andTags",ids:a.query.andTags,queryParameter:"andTags"}):"orTags"===e&&a.query.orTags?(0,s.jsx)(v,{type:"orTags",ids:a.query.orTags,queryParameter:"orTags"}):"notTags"===e&&a.query.notTags?(0,s.jsx)(v,{type:"notTags",ids:a.query.notTags,queryParameter:"notTags"}):"condition"===e&&a.query.condition?(0,s.jsx)(b,{ids:a.query.condition,queryParameter:"condition",displayMap:o.k_}):"collectionLanguage"===e&&a.query.collectionLanguage?(0,s.jsx)(b,{ids:a.query.collectionLanguage,queryParameter:"collectionLanguage",displayMap:o.xe}):"quantity"===e&&a.query.quantity&&a.query.quantityLogic?(0,s.jsxs)("button",{onClick:()=>t(e),className:m().button,children:[(0,s.jsx)(r.A,{name:"close"}),(0,s.jsx)("span",{children:"Quantity"}),(0,s.jsx)("span",{children:_[`${a.query.quantityLogic}`]}),n]},e):"formatLegality"===e&&a.query.formatLegality?(0,s.jsx)(b,{ids:a.query.formatLegality,queryParameter:"formatLegality",displayMap:c.hZ}):"game"===e&&a.query.game?(0,s.jsxs)("button",{onClick:()=>t(e),className:m().button,children:[(0,s.jsx)(r.A,{name:"close"}),(0,s.jsx)("span",{children:"Collection type"}),(0,s.jsx)("span",{children:C.L[a.query.game]||N/A})]},e):y.includes(e)?(0,s.jsx)(b,{title:e,ids:n,queryParameter:e},e):(0,s.jsxs)("button",{onClick:()=>t(e),className:m().button,children:[(0,s.jsx)(r.A,{name:"close"})," ",x[e]??e," ",p.includes(n)?"":n]},e)}),(0,s.jsxs)("button",{className:m().clearAll,onClick:()=>(0,d.H)({},!1),children:[(0,s.jsx)(r.A,{name:"trash alternate outline"})," Clear all filters"]})]})},b=({ids:e,title:a,queryParameter:t,displayMap:l})=>{let o=(0,n.useRouter)(),c=Array.isArray(e)?e:e.split(",");return(0,s.jsx)(s.Fragment,{children:c.map(e=>(0,s.jsxs)("button",{onClick:()=>o.push({[t]:c.filter(a=>e!==a).join(",")}),className:m().button,children:[(0,s.jsx)(r.A,{name:"close"}),a&&(0,s.jsx)("span",{children:x[a]??a}),!!l&&l[e],!l&&e]},e))})},v=({ids:e,type:a})=>{let t=(0,l.GV)(e=>e.collectionV2.tags),n=Array.isArray(e)?e:e.split(",");return(0,s.jsx)(s.Fragment,{children:n.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t=n.filter(a=>e!==a).join(",");0===t.length&&(t=void 0),(0,d.H)({[a]:t})},className:m().button,children:[(0,s.jsx)(r.A,{name:"close"}),(0,s.jsx)(i.A,{className:m().smallerGap,name:t[e]?.name,color:t[e]?.color}),(0,s.jsxs)("span",{children:["(","andTags"===a?"AND":"orTags"===a?"OR":"NOT",")"]})]},e))})}},76705:e=>{e.exports={orderByMenu:"customCardsOrderByDropdown_orderByMenu__ehm5N"}},80689:(e,a,t)=>{"use strict";t.d(a,{A:()=>c});var s=t(75038),r=t(76430),n=t(7648),l=t(76705),o=t.n(l);let c=({value:e,orderByDescending:a,callBackOnDirectionChange:t,onChange:l,menuClassName:c="",triggerClassName:i})=>{let[d,u]=(0,r.useState)(e||"name"),[m,C]=(0,r.useState)(a||!1),h=e=>{u(e),l&&l(e,m?"descending":"ascending")};return(0,s.jsx)(n.A,{header:"Sort by",value:d,triggerClassName:i,menuClassName:`${o().orderByMenu} ${c}`,icon:m?"sort amount down":"sort amount up",options:[{type:"checkbox",label:"Sort descending",onChange:()=>{var e;C(e=!m),t&&l&&l(d,e?"descending":"ascending")},checked:m},{type:"spacer"},{label:"Date updated",icon:"edit outline",id:"updatedAt",onClick:()=>h("updatedAt")},{label:"Date added",icon:"calendar alternate outline",id:"createdAt",onClick:()=>h("createdAt")},{type:"spacer"},{label:"Card name",icon:"font",id:"name",onClick:()=>h("name")},{label:"Type",icon:"tag",id:"type",onClick:()=>h("type")},{label:"Edition code",icon:"clone",id:"set",onClick:()=>h("set")},{label:"Mana value",icon:"sort numeric down",id:"manaValue",onClick:()=>h("manaValue")},{label:"Power",icon:"bolt",id:"power",onClick:()=>h("power")},{label:"Toughness",icon:"shield alternate",id:"toughness",onClick:()=>h("toughness")},{label:"Loyalty",icon:"heart",id:"loyalty",onClick:()=>h("loyalty")},{label:"Artist",icon:"paint brush",id:"artist",onClick:()=>h("artist")}]})}},81345:(e,a,t)=>{"use strict";t.r(a),t.d(a,{__N_SSP:()=>k,default:()=>q});var s=t(75038),r=t(76430),n=t(98381),l=t(52030),o=t(85785),c=t(79761),i=t(68835),d=t(98419),u=t
1(56771),m=t(14550),C=t(68367),h=t(80689),p=t(81639),y=t(4444),g=t(49379),x=t.n(g);let _=({open:e,onClose:a})=>{let t=(0,n.useRouter)(),[l,o]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[m,C]=(0,r.useState)(""),[h,g]=(0,r.useState)(""),[_,j]=(0,r.useState)("");return(0,s.jsxs)(y.A,{open:e,onClose:a,className:x().container,children:[(0,s.jsx)("h2",{children:"Filter custom cards"}),(0,s.jsxs)("form",{className:x().inputs,onSubmit:e=>{e.preventDefault();let a={};l&&(a.search=l),c&&(a.name=c),m&&(a.types=m),h&&(a.manaValue=h),_&&(a.edition=_),t.push(`/custom-cards/?${p.stringify(a)}`)},children:[(0,s.jsx)(u.A,{value:l,onChange:o,header:"Full text search",placeholder:"Card name or text box"}),(0,s.jsx)(u.A,{value:c,onChange:d,header:"Card name",placeholder:"Oopsie, Walking Calamity"}),(0,s.jsx)(u.A,{value:m,onChange:C,header:"Types",placeholder:"Creature"}),(0,s.jsx)(u.A,{value:h,onChange:g,header:"Mana value",placeholder:"3"}),(0,s.jsx)(u.A,{value:_,onChange:j,header:"Edition code",placeholder:"lol"}),(0,s.jsx)("div",{className:x().controls,children:(0,s.jsx)(i.A,{icon:"search",color:"green",type:"submit",children:"Apply filters"})})]})]})};var j=t(99222),b=t(71448),v=t(95243),f=t.n(v),k=!0;let q=({customCardData:e})=>{let[a,t]=(0,r.useState)(e.results),[p,y]=(0,r.useState)(!1),g=(0,l.zm)(a),x=(0,n.useRouter)(),{page:v=1,orderBy:k="name",orderDirection:q="ascending",search:T=""}=x.query,[S,w]=(0,r.useState)(`${T}`),[M,B]=(0,r.useState)(!1),F=e=>{let s=a.findIndex(a=>a.id===e.id);if(s<0)return void t([e,...a]);let r=[...a];r[s]=e,t(r)},L=e=>{t(a.filter(a=>a.id!==e))};return(0,s.jsxs)(c.A,{className:f().container,title:"Edit custom cards",children:[(0,s.jsx)(d.A,{className:f().bannerContainer,backgroundClassName:f().banner,src:"https://cards.scryfall.io/art_crop/front/5/8/58ce16da-30d3-49ca-9c85-2dcb599f8913.jpg?1619708698",title:"Custom Card manager",style:{height:200}}),(0,s.jsxs)("div",{className:f().content,children:[(0,s.jsx)("h1",{children:"Custom Cards"}),(0,s.jsxs)("div",{className:f().controls,children:[(0,s.jsxs)("div",{className:f().left,children:[(0,s.jsx)(i.A,{color:"blue",icon:"circle-plus",onClick:()=>y(!0),children:"Add custom card"}),(0,s.jsx)(h.A,{value:`${k}`,orderByDescending:"descending"===q,onChange:(e,a)=>{x.push(`/custom-cards/?cardName=${S}&orderBy=${e}&orderDirection=${a}`)}})]}),(0,s.jsxs)("form",{className:f().right,onSubmit:e=>{e.preventDefault(),x.push(`/custom-cards/?search=${encodeURIComponent(S)}`)},children:[(0,s.jsx)(u.A,{selectOnFocus:!0,header:"Filter custom cards",placeholder:"Oopsie, Walking Calamity",value:S,onChange:w}),(0,s.jsx)(i.A,{icon:"add",type:"button",onClick:()=>B(!0),children:"Filters"})]})]}),(0,s.jsx)(b.A,{className:f().filterChips}),!g.length&&(0,s.jsx)("div",{className:f().noCustomCards,children:"No custom cards found"}),!!g.length&&(0,s.jsx)("div",{className:f().cards,children:g.map(e=>(0,s.jsx)(C.A,{card:e,onCardEdited:F,onCardRemoved:L},e.customCard?.id))}),(0,s.jsx)(j.A,{page:Number(v)||1,hideRowsPerPage:!0,totalPages:Math.ceil(e.count/60)})]}),(0,s.jsx)(m.A,{card:p?o.o5:null,onCardEdited:e=>{F(e),y(!1)},onClose:()=>y(!1)}),(0,s.jsx)(_,{open:M,onClose:()=>B(!1)})]})}},95243:e=>{e.exports={container:"customCards_container__LQhUd",content:"customCards_content__2nOlT",controls:"customCards_controls__3X3eC",cards:"customCards_cards__7BABP",paginationContainer:"customCards_paginationContainer__zLcNG",noCustomCards:"customCards_noCustomCards__M9DE_",left:"customCards_left__k0mo_",right:"customCards_right__LfZ4g",filterChips:"customCards_filterChips__a181V"}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=48811)),_N_E=e.O()}]); 2//# sourceMappingURL=custom-cards-6b03be1579e46763.js.map
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.