@flesh-and-blood/search 4.0.74 → 4.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/shorthands.js +0 -76
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ur=Object.create;var J=Object.defineProperty;var fr=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var yr=(e,r)=>{for(var t in r)J(e,t,{get:r[t],enumerable:!0})},Le=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of gr(r))!mr.call(e,a)&&a!==t&&J(e,a,{get:()=>r[a],enumerable:!(i=fr(r,a))||i.enumerable});return e};var br=(e,r,t)=>(t=e!=null?ur(hr(e)):{},Le(r||!e||!e.__esModule?J(t,"default",{value:e,enumerable:!0}):t,e)),Cr=e=>Le(J({},"__esModule",{value:!0}),e);var yt={};yr(yt,{FilterProperty:()=>Re,PUNCTUATION:()=>d,RARITY_VALUES_MAPPING:()=>Pe,abbreviations:()=>de,availableExclusions:()=>sr,availableModifiers:()=>ar,default:()=>lr,filterCard:()=>cr,filtersToCardPropertyMappings:()=>oe,getAbbreviation:()=>Q,getAbbreviationByCard:()=>Fr,getCardByName:()=>be,getCleanText:()=>ye,getExcludedMetaFilters:()=>fe,getKeywordsAndAppliedFiltersFromText:()=>we,getMetaFilters:()=>ue,getNormalizedText:()=>z,getRelatedCards:()=>Ce,getRelatedCardsByName:()=>te,getTokensReferencedByCards:()=>Dr,multiWordShorthands:()=>he,shorthands:()=>ge,singleWordShorthands:()=>me});module.exports=Cr(yt);var ne=require("@flesh-and-blood/types"),Se=br(require("fuse.js"),1);var d=/[!"#$%&'’(),./:;<=>?@[\]^_`|~]/g;var l=require("@flesh-and-blood/types");var Q=e=>de.find(({abbreviations:r})=>r.find(t=>t.toLowerCase()===e)),Fr=e=>de.find(({card:r})=>r.toLowerCase()===e.name.toLowerCase()),de=[{abbreviations:["10k"],card:"10,000 Year Reunion"},{abbreviations:["Pajamas","PJs"],card:"Alluvion Constellas"},{abbreviations:["Slippy","Arakni Slipped Through the Cracks","Arakni, Slipped Through the Cracks"],card:"Arakni, 5L!p3d 7hRu 7h3 cR4X"},{abbreviations:["Dullcap"],card:"Arcanite Skullcap"},{abbreviations:["ALS"],card:"Arc Light Sentinel"},{abbreviations:["AoW"],card:"Art of War"},{abbreviations:["BBD"],card:"Barraging Beatdown"},{abbreviations:["BBS"],card:"Big Blue Sky"},{abbreviations:["Starvo"],card:"Bravo, Star of the Show"},{abbreviations:["BEB"],card:"Bull's Eye Bracers"},{abbreviations:["BLW"],card:"Be Like Water"},{abbreviations:["BoJ"],card:"Balance of Justice"},{abbreviations:["BOHH"],card:"Blood on Her Hands"},{abbreviations:["BRB"],card:"Bloodrush Bellow"},{abbreviations:["Breezies"],card:"Breeze Rider Boots"},{abbreviations:["BTA"],card:"Burn Them All"},{abbreviations:["CStrike","C-Strike","C Strike"],card:"Celestial Cataclysm"},{abbreviations:["CBelly"],card:"Cerebellum Processor"},{abbreviations:["CLF"],card:"Channel Lake Frigid"},{abbreviations:["CLV"],card:"Channel Lightning Valley"},{abbreviations:["CMH"],card:"Channel Mount Heroic"},{abbreviations:["CMI"],card:"Channel Mount Isen"},{abbreviations:["CMT"],card:"Channel the Millennium Tree"},{abbreviations:["CnC","C&C"],card:"Command and Conquer"},{abbreviations:["Sea and Sea"],card:"Conqueror of the High Seas"},{abbreviations:["CYB"],card:"Count Your Blessings"},{abbreviations:["Cat","Kitty"],card:"Crouching Tiger"},{abbreviations:["CoD"],card:"Crown of Dominion"},{abbreviations:["CoP"],card:"Crown of Providence"},{abbreviations:["CtW"],card:"Crush the Weak"},{abbreviations:["DD"],card:"Death Dealer"},{abbreviations:["DnD"],card:"Devotion Never Dies"},{abbreviations:["DIO"],card:"Dash I/O"},{abbreviations:["EBTT"],card:"Even Bigger Than That!"},{abbreviations:["NewNigma"],card:"Enigma, New Moon"},{abbreviations:["EPot","E Pot"],card:"Energy Potion"},{abbreviations:["EStrike","E-Strike","E Strike"],card:"Enlightened Strike"},{abbreviations:["FFS"],card:"Fyendal's Fighting Spirit"},{abbreviations:["FoN"],card:"Force of Nature"},{abbreviations:["Frosty","\u{1F976}","\u{1F9CA}","\u2744\uFE0F"],card:"Frostbite"},{abbreviations:["Yum yum"],card:"Fruits of the Forest"},{abbreviations:["GnT"],card:"Give and Take"},{abbreviations:["Habibi"],card:"Hanabi Blaster"},{abbreviations:["HMH"],card:"Hope Merchant's Hood"},{abbreviations:["HoI"],card:"Heart of Ice"},{abbreviations:["Pumpkin"],card:"Jack-o'-lantern"},{abbreviations:["RKO","Cheato"],card:"Kayo, Underhanded Cheat"},{abbreviations:["KKBB"],card:"Knick Knack Bric-a-brac"},{abbreviations:["BStrike"],card:"Levels of Enlightenment"},{abbreviations:["LAG","Twominaris"],card:"Luminaris, Angel's Glow"},{abbreviations:["LCF","Newminaris"],card:"Luminaris, Celestial Fury"},{abbreviations:["LDE"],card:"Last Ditch Effort"},{abbreviations:["LtC"],card:"Lead the Charge"},{abbreviations:["LNW"],card:"Leave No Witnesses"},{abbreviations:["LFaL","L4aL"],card:"Life for a Life"},{abbreviations:["LiT"],card:"Lost in Thought"},{abbreviations:["MMB"],card:"Mage Master Boots"},{abbreviations:["MaxV"],card:"Maximum Velocity"},{abbreviations:["MoM"],card:"Mask of Momentum"},{abbreviations:["MoPL"],card:"Mask of the Pouncing Lynx"},{abbreviations:["MnG"],card:"Meat and Greet"},{abbreviations:["Cake","\u{1F382}"],card:"Ninth Blade of the Blood Oath"},{abbreviations:["PoM"],card:"Peace of Mind"},{abbreviations:["P-Bone"],card:"Performance Bonus"},{abbreviations:["PF","\u{1F525}"],card:"Phoenix Flame"},{abbreviations:["PtW"],card:"Poison the Well"},{abbreviations:["Thanos","Infinity Gauntlet"],card:"Polarity Reversal Script"},{abbreviations:["DPot","D Pot"],card:"Potion of D\xE9j\xE0 Vu"},{abbreviations:["Ponder Run"],card:"Premeditate"},{abbreviations:["Qi Unbound"],card:"Qi Unleashed"},{abbreviations:["RitL"],card:"Red in the Ledger"},{abbreviations:["Cats","Ghost cat","Ghost cats"],card:"Restless Coalescence"},{abbreviations:["Eugene"],card:"Rhinar, Reckless Rampage",isHidden:!0},{abbreviations:["SSGB"],card:"Sandscour Greatbow"},{abbreviations:["SSP"],card:"Sand Sketched Plan"},{abbreviations:["SFaS","S4aS"],card:"Scar for a Scar"},{abbreviations:["Tyler"],card:"Scurv, Stowaway",isHidden:!0},{abbreviations:["SWOMB"],card:"Shifting Winds of the Mystic Beast"},{abbreviations:["Snaps"],card:"Snapdragon Scalers"},{abbreviations:["SWK"],card:"Spinning Wheel Kick"},{abbreviations:["SFTL"],card:"Swing Fist, Think Later"},{abbreviations:["TTT"],card:"Take the Tempo"},{abbreviations:["Ultron"],card:"Teklovossen, the Mechropotent"},{abbreviations:["ToS"],card:"Test of Strength"},{abbreviations:["TAYG"],card:"That All You Got?"},{abbreviations:["TROM"],card:"This Round's on Me"},{abbreviations:["3oak"],card:"Three of a Kind"},{abbreviations:["Pox Malone","Post Malone"],card:"Virulent Touch"},{abbreviations:["Cast Homes"],card:"Visit Goldmane Estate"},{abbreviations:["Frosty Hammer"],card:"Winter's Wail"},{abbreviations:["Wreckless Wing"],card:"War Cry of Bellona"},{abbreviations:["ZTS"],card:"Zero to Sixty"}];var L=require("@flesh-and-blood/types");var Re=(i=>(i.BannedFormats="bannedFormats",i.LegalFormats="legalFormats",i.LegalHeroes="legalHeroes",i))(Re||{}),re=Array.from(Array(50).keys()).map(e=>`${e}`),Mr=[{format:L.Format.ClassicConstructed,nicknames:["cc","classic"]},{format:L.Format.LivingLegend,nicknames:["cc ll","classic constructed ll","ll cc","ll","living legend"]},{format:L.Format.SilverAge,nicknames:["sage"]},{format:L.Format.GoldenAge,nicknames:["gage"]},{format:L.Format.UltimatePitFight,nicknames:["upf"]}],vr=Object.values(L.Format).map(e=>{let r=Mr.find(({format:i})=>i===e),t=e.toLowerCase().replaceAll(d,"");return r?{...r,format:t}:{format:t}}),Ar=[{hero:L.Hero.DataDoll,nicknames:["data","datadoll"]},{hero:L.Hero.Dorinthea,nicknames:["dori"]},{hero:L.Hero.Genis,nicknames:["genis"]},{hero:L.Hero.GravyBones,nicknames:["gravy"]},{hero:L.Hero.Iyslander,nicknames:["islander"]}],Tr=Object.values(L.Hero).map(e=>{let r=Ar.find(({hero:i})=>i===e),t=e.toLowerCase().replaceAll(d,"");return r?{...r,hero:t}:{hero:t}}),Z=["common","rare","super rare","majestic","legendary","fabled"],xr=(e,r,t,i)=>{let a=[];if(!r)a.push(...e);else for(let s of e)switch(r){case">=":{let n=!1;for(let o of Z)n?a.push(o):o===s&&(n=!0,a.push(o));break}case">":{let n=!1;for(let o of Z)n?a.push(o):o===s&&(n=!0);break}case"<=":{let n=!1;for(let o of Z.slice().reverse())n?a.push(o):o===s&&(n=!0,a.push(o));break}case"<":{let n=!1;for(let o of Z.slice().reverse())n?a.push(o):o===s&&(n=!0);break}default:break}return{filterToPropertyMapping:{nestedProperty:"rarity",property:"printings",isArray:!0},isExcluded:t,isOptional:i,isOr:!0,values:a}},Ee=(e,r,t,i,a)=>{let s=i.map(h=>({hero:h.toLowerCase().replaceAll(d,"")})),n=[],o=[],c=[];for(let h of e){let g=vr.find(({format:p,nicknames:b})=>p===h||!!b&&b.includes(h));if(g)o.push(g.format);else{let p=Tr.find(({hero:b,nicknames:M})=>b===h||!!M&&M.includes(h))||s.find(({hero:b})=>b===h);p&&c.push(p.hero)}}let m=a||"legalFormats";return o.length>0&&n.push({filterToPropertyMapping:{property:m,isArray:!0},values:o,isOr:!0,isExcluded:r,isOptional:t}),c.length>0&&n.push({filterToPropertyMapping:{property:"legalHeroes",isArray:!0},values:c,isOr:!0,isExcluded:r,isOptional:t}),n},Pr=(e,r,t,i)=>Ee(e,r,t,i,"bannedFormats"),ue=(e,r,t,i,a,s)=>{let n=[];return kr(t)?n.push(...Ee(i,e,r,s)):Rr(t)?n.push(...Pr(i,e,r,s)):Br(t)&&n.push(xr(i,a,e,r)),n},K=[{filterToPropertyMapping:{property:"cost",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialCost",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]}],V=[{filterToPropertyMapping:{property:"defense",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialDefense",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["hero","placeholder","token","weapon"]}],X=[{filterToPropertyMapping:{property:"pitch",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]},{filterToPropertyMapping:{property:"isCardBack",isBoolean:!0},isExcluded:!0,values:["true"]}],U=[{filterToPropertyMapping:{property:"power",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialPower",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token"]}],ee=[{filterToPropertyMapping:{property:"talents",isArray:!0},isExcluded:!0,values:Object.values(L.Talent).map(e=>e.toLowerCase())}],wr={"!co":K,"-co":K,"!cost":K,"-cost":K,"!color":K,"-color":K,"!b":V,"-b":V,"!block":V,"-block":V,"!d":V,"-d":V,"!def":V,"-def":V,"!defense":V,"-defense":V,"!pitch":X,"-pitch":X,"!p":X,"-p":X,"!attack":U,"-attack":U,"!power":U,"-power":U,"!pwr":U,"-pwr":U,"!pow":U,"-pow":U,"!talents":ee,"-talents":ee,"!tal":ee,"-tal":ee},fe=e=>{let r=[],t=wr[e];return t&&r.push(...t),r},Sr=["l","legal","hero"],kr=e=>Sr.includes(e),Lr=["banned"],Rr=e=>Lr.includes(e),Er=["r","rarity"],Br=e=>Er.includes(e);var N=require("@flesh-and-blood/types"),ge=[{description:"Attack actions",expanded:["st:attack"],filters:{subtypes:[N.Subtype.Attack]},isCardProperty:!1,shorthands:["AA"]},{description:"Arcane barrier",expanded:['k:"arcane barrier"'],filters:{keywords:[N.Keyword.ArcaneBarrier]},isCardProperty:!1,shorthands:["AB"]},{description:"Attack reactions",expanded:['t:"attack reaction"'],filters:{types:[N.Type.AttackReaction]},isCardProperty:!1,shorthands:["AR"]},{description:"Defense reactions",expanded:['t:"defense reaction"'],filters:{types:[N.Type.DefenseReaction]},isCardProperty:!1,shorthands:["DR"]},{description:"Disease",expanded:['st:"disease"'],filters:{subtypes:[N.Subtype.Disease]},isCardProperty:!1,shorthands:["Disease"]},{description:"Gain life",expanded:["gain {h}"],filters:{functionalText:"gain {h}"},isCardProperty:!1,shorthands:["Gain life","Gains life"]},{description:"Go again",expanded:['k:"go again"'],filters:{keywords:[N.Keyword.GoAgain]},isCardProperty:!1,shorthands:["GA"]},{description:"Non-attack actions",expanded:["t:action","st:non-attack"],filters:{subtypes:[N.Subtype.NonAttack],types:[N.Type.Action]},isCardProperty:!1,shorthands:["NAA"]},{description:"Plus defense",expanded:["+ {d}"],filters:{functionalText:"+ {d}"},isCardProperty:!1,shorthands:["Pump defense","Pumps defense","Buff defense","Buffs defense"]},{description:"Spellvoid",expanded:['k:"spellvoid"'],filters:{keywords:[N.Keyword.Spellvoid]},isCardProperty:!1,shorthands:["SV"]}],he=ge.filter(({shorthands:e})=>e.some(r=>r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)})),me=ge.filter(({shorthands:e})=>e.some(r=>!r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>!r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)}));var be=(e,r)=>{let t=r.find(i=>ye(i.name)===e);return t||(t=r.find(i=>ye(i.name).includes(e))),t},ye=e=>z(e.toLowerCase().trim().replace(d,"")),z=e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"");var j=require("@flesh-and-blood/types");var _=require("@flesh-and-blood/types"),Nr={"Dawnblade, Resplendent":"Dawnblade"},Be=e=>Nr[e.name]||e.name,Ne=e=>e.functionalText?.replaceAll(e.name,""),te=(e,r)=>{let t=r.find(i=>i.name.toLowerCase().replace(d,"")===e);return t||(t=r.find(i=>i.name.toLowerCase().replace(d,"").includes(e))),Ce(t,r)},Ce=(e,r,t)=>{let i={},a={},s={};if(e){let m=[],h=[],g=Be(e);for(let p of r){let b=Be(p),M=g===b,T=e.cardIdentifier!==p.cardIdentifier,G=e.pitch!==p.pitch;if(M&&T&&G)i[p.cardIdentifier]=p;else if(!M&&!t?.shouldSkipReferences){let x=e.name==="Seismic Surge",k=p.keywords?.includes(_.Keyword.Heave),u=x&&k,D=e.name==="Marked",f=p.keywords?.includes(_.Keyword.Mark),y=D&&f,A=Ne(p),C=A?.includes(g)||e.traits?.some(pe=>A?.includes(pe)),P=Ne(e);(C||u||y)&&m.push(p);let B=new RegExp(b,"g"),q=new RegExp(`\\*\\*${b}\\*\\*`,"g"),W=P?.match(B)||[],v=P?.match(q)||[],E=W.length===v.length,w=P?.includes(b)&&!E,H=(p.traits||[]).some(pe=>P?.includes(pe)),I=w||H,R=p.name==="Seismic Surge",S=e.keywords?.includes(_.Keyword.Heave),ce=R&&S,pr=p.name==="Marked",dr=e.keywords?.includes(_.Keyword.Mark);(I||ce||pr&&dr)&&h.push(p)}}for(let p of m)a[p.cardIdentifier]=p;for(let p of h){let b=p.name;g!==b&&!h.some(M=>{let T=M.name;return T!==b&&T?.includes(b)})&&(s[p.cardIdentifier]=p)}}let n=Object.values(i),o=Object.values(a),c=Object.values(s);return{otherPitches:n,referencedBy:o,references:c}},Or=["cash-in-yellow"],Ir={[j.Hero.Crackni]:{traits:[j.Trait.AgentOfChaos]},[j.Hero.Maxx]:{tokens:["hyper-driver"]}},Dr=(e,r,t)=>{let i=new Set;for(let a of e.filter(({cardIdentifier:s})=>!Or.includes(s))){let{references:s}=Ce(a,r);for(let n of s.filter(o=>{let c=o.name==="Hyper Driver",m=t===j.Hero.Maxx;return!c||m}))i.add(n)}if(t){let a=Ir[t];if(a){if(a.cards)for(let s of e)a.cards?.includes(s.cardIdentifier)&&i.add(s);if(a.tokens)for(let s of r)a.tokens?.includes(s.cardIdentifier)&&i.add(s)}}return Array.from(i)};var ar=[">=",">","<=","<"],sr=["!","-"],Hr={property:"arcane",specialProperty:"specialArcane",isNumber:!0,partialMatch:!0},Fe={property:"artists",isArray:!0,partialMatch:!0},Oe={property:"n/a",isMeta:!0},Ie={property:"bonds",isArray:!0},Vr={property:"n/a"},De={property:"classes",isArray:!0,partialMatch:!0},He={property:"cost",specialProperty:"specialCost",isNumber:!0,partialMatch:!0},$={property:"defense",specialProperty:"specialDefense",isNumber:!0},Ve={property:"flows",isArray:!0},Ge={nestedProperty:"foiling",property:"printings",isArray:!0},Ue={property:"fusions",isArray:!0},We={property:"intellect",isNumber:!0},Ke={property:"keywords",isArray:!0},Me={property:"n/a",isMeta:!0},je={property:"life",specialProperty:"specialLife",isNumber:!0},xe={property:"meta",isArray:!0},qe={property:"name",isString:!0,partialMatch:!0},ve={property:"pitch",isNumber:!0},ze={property:"firstReleaseDate",isDate:!0},ie={property:"power",specialProperty:"specialPower",isNumber:!0},Gr={property:"setIdentifiers",isArray:!0,partialMatch:!0},_e={property:"n/a",isMeta:!0},Ur={property:"n/a"},Wr={property:"n/a"},$e={property:"sets",isArray:!0,partialMatch:!0},Ae={property:"shorthands",isArray:!0,partialMatch:!0},ae={property:"specializations",isArray:!0,partialMatch:!0},Ye={property:"subtypes",isArray:!0},Je={property:"types",isArray:!0},Qe={property:"talents",isArray:!0},Kr={property:"functionalText",isString:!0,partialMatch:!0},jr={property:"traits",isArray:!0,partialMatch:!0},qr={property:"typeText",isString:!0,partialMatch:!0},se={nestedProperty:"treatments",property:"printings",isArray:!0,isNestedPropertyArray:!0},zr={property:"firstReleaseDate",isString:!0,partialMatch:!0},oe={arcane:Hr,a:Fe,artist:Fe,art:Fe,attack:ie,b:$,block:$,banned:Oe,bond:Ie,bonds:Ie,c:De,class:De,chain:Vr,co:He,cost:He,color:ve,d:$,def:$,defense:$,flow:Ve,flows:Ve,f:Ue,fusion:Ue,foil:Ge,foiling:Ge,i:We,intellect:We,is:xe,k:Ke,keyword:Ke,l:Me,legal:Me,hero:Me,li:je,life:je,meta:xe,n:qe,name:qe,p:ve,pitch:ve,pwr:ie,pow:ie,power:ie,print:Gr,r:_e,rarity:_e,referencedby:Ur,references:Wr,rf:Oe,s:$e,set:$e,short:Ae,shorthand:Ae,shorthands:Ae,sp:ae,spec:ae,specialization:ae,specializations:ae,st:Ye,subtype:Ye,t:Je,type:Je,tal:Qe,talent:Qe,text:Kr,trait:jr,treat:se,treatment:se,var:se,variation:se,x:qr,year:zr},_r=[{text:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase(),override:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase().replaceAll(d,"")}],$r=e=>{let r=[],t=e.replaceAll("\u201D",'"');for(let{text:a,override:s}of _r)t.includes(a)&&(t=t.replace(a,s));if(Q(t)?.card)r.push(t);else{let a=t.split(/[ ]+/),s="",n=0;for(let o of a)n===2&&(r.push(s.trim().replaceAll('"',"")),s="",n=0),n<2&&o.split('"').length===2?(s+=" "+o,n++):n===0&&s===""?r.push(o):n===1&&(s+=" "+o);n===2&&(r.push(s.trim().replaceAll('"',"")),s="",n=0)}return r},we=(e,r,t=[],i=[],a=rt())=>{let s=e.trim().toLowerCase();for(let{expanded:x,shorthands:k}of he)for(let u of k)if(s.includes(u)){s=s.replace(u,x.join(" "));break}for(let[x,k]of Object.entries(l.setToSetIdentifierMappings))s.includes(x.toLowerCase())&&(s=s.replace(x.toLowerCase(),k[0]));let n=$r(s),o=[];for(let x of n){let k=me.find(({shorthands:u})=>u.includes(x));k&&!k.isCardProperty?o.push(...k.expanded):o.push(x)}let c=[],m=[],h=[],g=[],p=!1,b=[],M=[],T=[],G=[];for(let x of o)if(lt(x)){let[k,u]=x.split(":"),{modifier:D,values:f,isAnd:y,isOr:A}=ot(u),{filterKey:C,isExcluded:P,isOptional:B,isMeta:q}=nt(k),W=!1;if(q){if(["rarity","r"].includes(C)){let v=st(f);P||(M=[...v]),f=v.map(E=>E.toLowerCase())}["legal","l","hero"].includes(C),c.push(...ue(P,B,C,f,D,t))}else{if(["chain"].includes(C)){let v=R=>R.name.toLowerCase().replaceAll(d,""),E=f.map(R=>be(R,r)).filter(R=>!!R).map(v),w=new Set(E);C="name",A=!0;let O=20,H=0,I=R=>{if(!R.types.includes(l.Type.Hero)){let S=v(R);w.add(S),E.includes(S)||E.push(S)}};for(let R of E){if(H>O)break;let{referencedBy:S,references:ce}=te(R,r);ce.forEach(I),H===0&&S.forEach(I),H++}f=Array.from(w)}else if(["referencedby","references"].includes(C)){let v=C,E=[...f].filter(w=>!!w);f=[],C="name",A=!0;for(let w of E){let{referencedBy:O,references:H}=te(w,r);["referencedby"].includes(v)?f.push(...H.map(({name:I})=>I.toLowerCase().replaceAll(d,""))):["references"].includes(v)&&f.push(...O.map(({name:I})=>I.toLowerCase().replaceAll(d,"")))}}else if(["art","artist"].includes(C))m=f;else if(["print","prints","printing","printings"].includes(C))b=f;else if(["is","meta"].includes(C)){let v=[],E=[],w=[],O=[];for(let S of f)Zr.includes(S)?v.push(S):Xr.includes(S)?E.push(S):et.includes(S)?w.push(S):O.push(S);v.length>0&&(c.push({filterToPropertyMapping:xe,values:[l.Meta.Reprint.toLowerCase().replaceAll(d,"")],isAnd:y,isOr:A,isExcluded:!P,isOptional:B}),W=O.length===0);let H=E.length>0;H&&c.push({filterToPropertyMapping:ze,values:[a],isAnd:y,isOr:A,isExcluded:P,isOptional:B});let I=w.length>0;I&&c.push({filterToPropertyMapping:ze,values:[a],isAnd:y,isOr:A,isExcluded:!P,isOptional:B}),(H||I)&&(W=O.length===0);let R=tt(O);f=R.map(S=>S.toLowerCase().replaceAll(d,"")),R.includes(l.Meta.Expansion)&&!P&&(p=!0)}else["foiling","foil"].includes(C)?(g=it(f),f=g.map(v=>v.toLowerCase())):["treat","treatment","var","variation"].includes(C)?(G=at(f),f=G.map(v=>v.toLowerCase())):["set","s"].includes(C)?(T=Yr(f,i),f=T.map(v=>v.toLowerCase().replaceAll(d,""))):["pitch","p","color"].includes(C)&&(f=Qr(f));oe[C]&&!W&&c.push({filterToPropertyMapping:oe[C],values:f,isAnd:y,isOr:A,modifier:D,isExcluded:P,isOptional:B})}}else if(x){let k=Q(x)?.card,u=fe(x);k?h.push(`"${k.toLowerCase().replace(d,"")}"`):u&&u.length>0?c.push(...u):h.push(x.replace(d,""))}return{appliedFilters:c,attributes:{artists:m,foilings:g,isExpansionSlot:p,prints:b,rarities:M,releases:T,treatments:G},keywords:h}},Yr=(e,r=[])=>{let t=[];for(let i of e)t.push(...Jr(i,r));return t},Jr=(e,r=[])=>{let t=[],i=Object.values(l.Release).find(a=>a.toLowerCase().replaceAll(d,"")===e);if(i&&t.push(i),t.length===0){let a=l.setIdentifierToSetMappings[e];a&&t.push(a)}if(t.length===0){let a=Object.values(l.Release).filter(s=>s.toLowerCase().includes(e));a.length>0&&t.push(...a)}if(t.length===0){let a=r.find(s=>s.toLowerCase().replaceAll(d,"")===e);a&&t.push(a)}return t},Te={purple:4,blue:3,yellow:2,red:1,white:0},Qr=e=>{let r=[];for(let t of e)Te[t]||Te[t]===0?r.push(Te[t].toString()):r.push(t);return r},Zr=["unique"],Xr=["preview","spoiler","unreleased"],et=["released"],rt=()=>{let e=new Date,r=`${e.getMonth()+1}`.padStart(2,"0"),t=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${r}-${t}`},Ze={dual:l.Meta.DualClass,exp:l.Meta.Expansion,expansion:l.Meta.Expansion,expansionSlot:l.Meta.Expansion,rainbow:l.Meta.Rainbow,reprint:l.Meta.Reprint,reprints:l.Meta.Reprint},tt=e=>{let r=[];for(let t of e)Ze[t]?r.push(Ze[t]):l.Meta[t]&&r.push(l.Meta[t]);if(e.length>0&&r.length===0){for(let t of Object.values(l.Meta))for(let i of e)if(t.toLowerCase().includes(i)){r.push(t);break}}return r},Xe={r:l.Foiling.Rainbow,rf:l.Foiling.Rainbow,rainbow:l.Foiling.Rainbow,c:l.Foiling.Cold,cf:l.Foiling.Cold,cold:l.Foiling.Cold,g:l.Foiling.Gold,gf:l.Foiling.Gold,gold:l.Foiling.Gold},it=e=>{let r=[];for(let t of e)Xe[t]&&r.push(Xe[t]);return r},er={...Object.values(l.Treatment).reduce((e,r)=>(e[r.toLowerCase()]=r,e),{}),aa:l.Treatment.AA,alt:l.Treatment.AA,"alt art":l.Treatment.AA,ab:l.Treatment.AB,"alt border":l.Treatment.AB,at:l.Treatment.AT,"alt text":l.Treatment.AT,ea:l.Treatment.EA,extended:l.Treatment.EA,"extended art":l.Treatment.EA,fa:l.Treatment.FA,full:l.Treatment.FA,"full art":l.Treatment.FA},at=e=>{let r=[];for(let t of e)er[t]?r.push(er[t]):l.Treatment[t.toUpperCase()]&&r.push(l.Treatment[t.toUpperCase()]);return r},Pe={b:l.Rarity.Basic,c:l.Rarity.Common,f:l.Rarity.Fabled,l:l.Rarity.Legendary,m:l.Rarity.Majestic,p:l.Rarity.Promo,r:l.Rarity.Rare,s:l.Rarity.SuperRare,t:l.Rarity.Token,v:l.Rarity.Marvel},st=e=>{let r=[];for(let t of e)Pe[t]?r.push(Pe[t]):r.push(t);return r},ot=e=>{let r=[],t,i,a=ar.find(s=>e.includes(s));if(a){let[,s]=e.split(a);rr(s)?(t=!0,r.push(...s.trim().split("+").map(n=>n.replace(d,"")))):tr(s)?(i=!0,r.push(...s.trim().split(",").map(n=>n.replace(d,"")))):r.push(s.trim().replace(d,""))}else rr(e)?(t=!0,r.push(...e.trim().split("+").map(s=>s.replace(d,"")))):tr(e)?(i=!0,r.push(...e.trim().split(",").map(s=>s.replace(d,"")))):e.startsWith('"')&&e.endsWith('"')?r.push(e.trim().replaceAll('"',"").replace(d,"")):r.push(e.trim().replace(d,""));return{modifier:a,values:r,isAnd:t,isOr:i}},nt=e=>{let r=ct(e);if(r){let[,t]=e.split(r);return{filterKey:t,isExcluded:!0,isOptional:!1,isMeta:ir(t)}}else return{filterKey:e,isExcluded:!1,isOptional:!1,isMeta:ir(e)}},lt=e=>e.indexOf(":")>=0,rr=e=>e.indexOf("+")>=0,tr=e=>e.indexOf(",")>=0,ir=e=>!!oe[e]?.isMeta,ct=e=>sr.find(r=>e.includes(r))?.slice(0,1);var F=require("@flesh-and-blood/types"),or={artists:["Hoodwill"],cardIdentifier:"fangs-a-lot-blue",classes:[F.Class.Generic],defaultImage:"FNG000",firstReleaseDate:"2022-06-02",functionalText:"If Fangs A Lot is put into your banished zone from your graveyard, instead put it into your hand.",legalFormats:[],legalHeroes:[F.Hero.Kayo,F.Hero.Levia,F.Hero.Rhinar],printings:[{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000",print:"FNG000",rarity:F.Rarity.Rare,set:F.Release.Promos},{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000_Marvel",print:`FNG000-${F.Treatment.FA}`,rarity:F.Rarity.Marvel,set:F.Release.Promos,treatment:F.Treatment.FA}],name:"Fangs A Lot",rarities:[F.Rarity.Rare,F.Rarity.Marvel],rarity:F.Rarity.Rare,sets:[F.Release.Promos],setIdentifiers:["FNG000"],specialImage:"FNG000_Marvel",subtypes:[F.Subtype.Attack],types:[F.Type.Action],typeText:"Generic Action - Attack"},nr=[{keyword:or.name.toLowerCase(),card:or}];var ke=class{constructor(r,t=[],i=[],a=!1){this.log=(r,...t)=>{this.debug&&console.log(r,...t)};this.search=(r,t)=>{let i,{appliedFilters:a,attributes:s,keywords:n}=we(r,this.cards,this.additionalHeroes,this.additionalSets),o=n.join(" "),c=t?nr.filter(u=>u.keyword===o):[];if(c.length>0?i=c.map(({card:u})=>u):n.length?i=this.fuse.search(o).map(u=>u.item):i=[...this.cards],a.length&&(i=i.filter(u=>u&&cr(u,a))),n.length===0){let u="";if(s.releases.length===1)try{let y=s.releases[0];u=ne.setToSetIdentifierMappings[y][0].toUpperCase()}catch(y){console.error("Error getting set identifier from search",y)}if(!u&&s.prints.length===1)try{let y=s.prints[0];ne.setIdentifierToSetMappings[y]&&(u=y.toUpperCase())}catch(y){console.error("Error getting set identifier from search",y)}u?i.sort((y,A)=>{let C=y.setIdentifiers.find(B=>B.includes(u))?.replace(u,""),P=A.setIdentifiers.find(B=>B.includes(u))?.replace(u,"");return C&&P?C.localeCompare(P):-1}):i.sort((y,A)=>y.name===A.name?`${y.pitch}`.localeCompare(`${A.pitch}`):y.name.localeCompare(A.name))}else{let u=[],D=[],f=n.map(y=>y.toLowerCase().replace(d,"")).join(" ");for(let y of i)y.name.toLowerCase().replace(d,"")===f?u.push(y):D.push(y);i=[...u,...D]}let m,{artists:h,isExpansionSlot:g,foilings:p,prints:b,rarities:M,releases:T,treatments:G}=s;(h.length>0||g||p.length>0||b.length>0||M.length>0||T.length>0||G.length>0)&&(m=i.map(u=>{let D=u.printings.filter(f=>{let y=!!f.image,A=h.length===0||h.some(w=>f.artists.find(O=>O.replace(d,"").toLowerCase().includes(w))),C=!g||g===f.isExpansionSlot,P=p.length===0||p.includes(f.foiling),B=b.length===0||b.some(w=>f.identifier.includes(w.toUpperCase())),q=M.length===0||M.includes(f.rarity),W=T.length===0||T.includes(f.set),v=G.length===0||f.treatments?.some(w=>G.includes(w));return y&&A&&C&&P&&B&&q&&W&&v});return{...u,matchingPrintings:D}}));let k=m?.length>0?m:i;return{appliedFilters:a,attributes:s,keywords:n,searchResults:k}};let s={getFn:(n,o)=>{let c=Se.default.config.getFn(n,o);return c&&(Array.isArray(c)?c.map(m=>z(m.replace(d,""))):z(c).replace(d,""))},ignoreLocation:!0,includeScore:!0,keys:[{name:"name",weight:10},{name:"functionalText",weight:6},{name:"shorthands",weight:4},{name:"setIdentifiers",weight:2},{name:"traits",weight:4},{name:"typeText",weight:6}],threshold:.15,useExtendedSearch:!0};this.additionalHeroes=t,this.additionalSets=i,this.cards=[...r],this.debug=a,this.fuse=new Se.default([...r],s)}},lr=ke,cr=(e,r)=>{let t=!0,i=!1;for(let a of r){let s=a.isOptional,{isNumber:n,isString:o,isArray:c,isBoolean:m,isDate:h}=a.filterToPropertyMapping;if(n){let g=pt(e,a);s?g&&(i=!0):t=t&&g}else if(o){let g=dt(e,a);s?g&&(i=!0):t=t&&g}else if(c){let g=ut(e,a,r);s?g&&(i=!0):t=t&&g}else if(m){let g=ft(e,a);s?g&&(i=!0):t=t&&g}else if(h){let g=gt(e,a);s?g&&(i=!0):t=t&&g}}return t},pt=(e,r)=>{if(Y(r,e)){let{values:t,modifier:i,isExcluded:a,filterToPropertyMapping:{partialMatch:s}}=r,n=le(e,r);if(n!=null&&!isNaN(n))if(n=parseInt(n),i)switch(i){case">=":{let o=t?.some(c=>n>=parseInt(c));return a?!o:o}case">":{let o=t?.some(c=>n>parseInt(c));return a?!o:o}case"<=":{let o=t?.some(c=>n<=parseInt(c));return a?!o:o}case"<":{let o=t?.some(c=>n<parseInt(c));return a?!o:o}default:return!1}else{let o=t?.some(c=>n===parseInt(c));return a?!o:o}else{let o=mt(e,r)?.toLowerCase(),c=s?t?.some(m=>o?.includes(m)):t?.some(m=>o===m);return a?!c:c}}else return!0},dt=(e,r)=>{if(Y(r,e)){let{values:t,isAnd:i,isExcluded:a,filterToPropertyMapping:{partialMatch:s}}=r,n=le(e,r)?.replaceAll(d,"");if(s){let o=i?t?.every(c=>n?.toLowerCase().includes(c)):t?.some(c=>n?.toLowerCase().includes(c));return a?!o:o}else{let o=i?t?.every(c=>n?.toLowerCase()===c):t?.some(c=>n?.toLowerCase()===c);return a?!o:o}}else return!0},ut=(e,r,t)=>{if(Y(r,e)){let{values:i,isAnd:a,isExcluded:s,filterToPropertyMapping:{partialMatch:n}}=r,o=ht(e,r,t).map(c=>c?.replaceAll(d,""));if(n){let c=a?i.every(h=>o?.some(g=>g?.toLowerCase().includes(h))):i.some(h=>o?.some(g=>g?.toLowerCase().includes(h))),m=o.length===0;return s?!c||m:c}else{let c=a?i.every(m=>o?.some(h=>h?.toLowerCase()===m)):i.some(m=>o?.some(h=>h?.toLowerCase()===m));return s?!c:c}}else return!0},ft=(e,r)=>{if(Y(r,e)){let{isExcluded:t}=r,i=le(e,r);return t?!i:i}else return!0},gt=(e,r)=>{if(Y(r,e)){let{values:t,isExcluded:i}=r,a=le(e,r),s=t?.some(n=>a>n);return i?!s:s}else return!0},le=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.property]},ht=(e,r,t)=>{let{filterToPropertyMapping:{isNestedPropertyArray:i,nestedProperty:a,property:s}}=r,n=e[s]||[],o=[],c=Object.keys(e.legalOverrides||{}).length>0,m=r.filterToPropertyMapping.property==="legalHeroes",h=t.find(({filterToPropertyMapping:p})=>p.property==="legalFormats");if(c&&m&&!!h){let p=new Set;for(let{format:b,heroes:M}of e.legalOverrides||[])if(h.values.includes(b.toLowerCase()))for(let T of M)p.add(T);o=Array.from(p)}if(o.length===0)if(a){let p=new Set;for(let b of n)if(i){let M=b[a]||[];for(let T of M)p.add(T)}else{let M=b[a];M&&p.add(M)}o=Array.from(p)}else o=n;return o},mt=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.specialProperty]},Y=({cardTypes:e},{types:r,subtypes:t})=>!e||e?.some(i=>r.map(a=>a.toLowerCase()).includes(i.toLowerCase())||t.map(a=>a.toLowerCase()).includes(i.toLowerCase()));0&&(module.exports={FilterProperty,PUNCTUATION,RARITY_VALUES_MAPPING,abbreviations,availableExclusions,availableModifiers,filterCard,filtersToCardPropertyMappings,getAbbreviation,getAbbreviationByCard,getCardByName,getCleanText,getExcludedMetaFilters,getKeywordsAndAppliedFiltersFromText,getMetaFilters,getNormalizedText,getRelatedCards,getRelatedCardsByName,getTokensReferencedByCards,multiWordShorthands,shorthands,singleWordShorthands});
|
|
1
|
+
var ur=Object.create;var J=Object.defineProperty;var fr=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var hr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var yr=(e,r)=>{for(var t in r)J(e,t,{get:r[t],enumerable:!0})},Le=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of gr(r))!mr.call(e,a)&&a!==t&&J(e,a,{get:()=>r[a],enumerable:!(i=fr(r,a))||i.enumerable});return e};var br=(e,r,t)=>(t=e!=null?ur(hr(e)):{},Le(r||!e||!e.__esModule?J(t,"default",{value:e,enumerable:!0}):t,e)),Cr=e=>Le(J({},"__esModule",{value:!0}),e);var yt={};yr(yt,{FilterProperty:()=>Re,PUNCTUATION:()=>d,RARITY_VALUES_MAPPING:()=>Pe,abbreviations:()=>de,availableExclusions:()=>sr,availableModifiers:()=>ar,default:()=>lr,filterCard:()=>cr,filtersToCardPropertyMappings:()=>oe,getAbbreviation:()=>Q,getAbbreviationByCard:()=>Fr,getCardByName:()=>be,getCleanText:()=>ye,getExcludedMetaFilters:()=>fe,getKeywordsAndAppliedFiltersFromText:()=>we,getMetaFilters:()=>ue,getNormalizedText:()=>z,getRelatedCards:()=>Ce,getRelatedCardsByName:()=>te,getTokensReferencedByCards:()=>Dr,multiWordShorthands:()=>he,shorthands:()=>ge,singleWordShorthands:()=>me});module.exports=Cr(yt);var ne=require("@flesh-and-blood/types"),Se=br(require("fuse.js"),1);var d=/[!"#$%&'’(),./:;<=>?@[\]^_`|~]/g;var l=require("@flesh-and-blood/types");var Q=e=>de.find(({abbreviations:r})=>r.find(t=>t.toLowerCase()===e)),Fr=e=>de.find(({card:r})=>r.toLowerCase()===e.name.toLowerCase()),de=[{abbreviations:["10k"],card:"10,000 Year Reunion"},{abbreviations:["Pajamas","PJs"],card:"Alluvion Constellas"},{abbreviations:["Slippy","Arakni Slipped Through the Cracks","Arakni, Slipped Through the Cracks"],card:"Arakni, 5L!p3d 7hRu 7h3 cR4X"},{abbreviations:["Dullcap"],card:"Arcanite Skullcap"},{abbreviations:["ALS"],card:"Arc Light Sentinel"},{abbreviations:["AoW"],card:"Art of War"},{abbreviations:["BBD"],card:"Barraging Beatdown"},{abbreviations:["BBS"],card:"Big Blue Sky"},{abbreviations:["Starvo"],card:"Bravo, Star of the Show"},{abbreviations:["BEB"],card:"Bull's Eye Bracers"},{abbreviations:["BLW"],card:"Be Like Water"},{abbreviations:["BoJ"],card:"Balance of Justice"},{abbreviations:["BOHH"],card:"Blood on Her Hands"},{abbreviations:["BRB"],card:"Bloodrush Bellow"},{abbreviations:["Breezies"],card:"Breeze Rider Boots"},{abbreviations:["BTA"],card:"Burn Them All"},{abbreviations:["CStrike","C-Strike","C Strike"],card:"Celestial Cataclysm"},{abbreviations:["CBelly"],card:"Cerebellum Processor"},{abbreviations:["CLF"],card:"Channel Lake Frigid"},{abbreviations:["CLV"],card:"Channel Lightning Valley"},{abbreviations:["CMH"],card:"Channel Mount Heroic"},{abbreviations:["CMI"],card:"Channel Mount Isen"},{abbreviations:["CMT"],card:"Channel the Millennium Tree"},{abbreviations:["CnC","C&C"],card:"Command and Conquer"},{abbreviations:["Sea and Sea"],card:"Conqueror of the High Seas"},{abbreviations:["CYB"],card:"Count Your Blessings"},{abbreviations:["Cat","Kitty"],card:"Crouching Tiger"},{abbreviations:["CoD"],card:"Crown of Dominion"},{abbreviations:["CoP"],card:"Crown of Providence"},{abbreviations:["CtW"],card:"Crush the Weak"},{abbreviations:["DD"],card:"Death Dealer"},{abbreviations:["DnD"],card:"Devotion Never Dies"},{abbreviations:["DIO"],card:"Dash I/O"},{abbreviations:["EBTT"],card:"Even Bigger Than That!"},{abbreviations:["NewNigma"],card:"Enigma, New Moon"},{abbreviations:["EPot","E Pot"],card:"Energy Potion"},{abbreviations:["EStrike","E-Strike","E Strike"],card:"Enlightened Strike"},{abbreviations:["FFS"],card:"Fyendal's Fighting Spirit"},{abbreviations:["FoN"],card:"Force of Nature"},{abbreviations:["Frosty","\u{1F976}","\u{1F9CA}","\u2744\uFE0F"],card:"Frostbite"},{abbreviations:["Yum yum"],card:"Fruits of the Forest"},{abbreviations:["GnT"],card:"Give and Take"},{abbreviations:["Habibi"],card:"Hanabi Blaster"},{abbreviations:["HMH"],card:"Hope Merchant's Hood"},{abbreviations:["HoI"],card:"Heart of Ice"},{abbreviations:["Pumpkin"],card:"Jack-o'-lantern"},{abbreviations:["RKO","Cheato"],card:"Kayo, Underhanded Cheat"},{abbreviations:["KKBB"],card:"Knick Knack Bric-a-brac"},{abbreviations:["BStrike"],card:"Levels of Enlightenment"},{abbreviations:["LAG","Twominaris"],card:"Luminaris, Angel's Glow"},{abbreviations:["LCF","Newminaris"],card:"Luminaris, Celestial Fury"},{abbreviations:["LDE"],card:"Last Ditch Effort"},{abbreviations:["LtC"],card:"Lead the Charge"},{abbreviations:["LNW"],card:"Leave No Witnesses"},{abbreviations:["LFaL","L4aL"],card:"Life for a Life"},{abbreviations:["LiT"],card:"Lost in Thought"},{abbreviations:["MMB"],card:"Mage Master Boots"},{abbreviations:["MaxV"],card:"Maximum Velocity"},{abbreviations:["MoM"],card:"Mask of Momentum"},{abbreviations:["MoPL"],card:"Mask of the Pouncing Lynx"},{abbreviations:["MnG"],card:"Meat and Greet"},{abbreviations:["Cake","\u{1F382}"],card:"Ninth Blade of the Blood Oath"},{abbreviations:["PoM"],card:"Peace of Mind"},{abbreviations:["P-Bone"],card:"Performance Bonus"},{abbreviations:["PF","\u{1F525}"],card:"Phoenix Flame"},{abbreviations:["PtW"],card:"Poison the Well"},{abbreviations:["Thanos","Infinity Gauntlet"],card:"Polarity Reversal Script"},{abbreviations:["DPot","D Pot"],card:"Potion of D\xE9j\xE0 Vu"},{abbreviations:["Ponder Run"],card:"Premeditate"},{abbreviations:["Qi Unbound"],card:"Qi Unleashed"},{abbreviations:["RitL"],card:"Red in the Ledger"},{abbreviations:["Cats","Ghost cat","Ghost cats"],card:"Restless Coalescence"},{abbreviations:["Eugene"],card:"Rhinar, Reckless Rampage",isHidden:!0},{abbreviations:["SSGB"],card:"Sandscour Greatbow"},{abbreviations:["SSP"],card:"Sand Sketched Plan"},{abbreviations:["SFaS","S4aS"],card:"Scar for a Scar"},{abbreviations:["Tyler"],card:"Scurv, Stowaway",isHidden:!0},{abbreviations:["SWOMB"],card:"Shifting Winds of the Mystic Beast"},{abbreviations:["Snaps"],card:"Snapdragon Scalers"},{abbreviations:["SWK"],card:"Spinning Wheel Kick"},{abbreviations:["SFTL"],card:"Swing Fist, Think Later"},{abbreviations:["TTT"],card:"Take the Tempo"},{abbreviations:["Ultron"],card:"Teklovossen, the Mechropotent"},{abbreviations:["ToS"],card:"Test of Strength"},{abbreviations:["TAYG"],card:"That All You Got?"},{abbreviations:["TROM"],card:"This Round's on Me"},{abbreviations:["3oak"],card:"Three of a Kind"},{abbreviations:["Pox Malone","Post Malone"],card:"Virulent Touch"},{abbreviations:["Cast Homes"],card:"Visit Goldmane Estate"},{abbreviations:["Frosty Hammer"],card:"Winter's Wail"},{abbreviations:["Wreckless Wing"],card:"War Cry of Bellona"},{abbreviations:["ZTS"],card:"Zero to Sixty"}];var L=require("@flesh-and-blood/types");var Re=(i=>(i.BannedFormats="bannedFormats",i.LegalFormats="legalFormats",i.LegalHeroes="legalHeroes",i))(Re||{}),re=Array.from(Array(50).keys()).map(e=>`${e}`),Mr=[{format:L.Format.ClassicConstructed,nicknames:["cc","classic"]},{format:L.Format.LivingLegend,nicknames:["cc ll","classic constructed ll","ll cc","ll","living legend"]},{format:L.Format.SilverAge,nicknames:["sage"]},{format:L.Format.GoldenAge,nicknames:["gage"]},{format:L.Format.UltimatePitFight,nicknames:["upf"]}],vr=Object.values(L.Format).map(e=>{let r=Mr.find(({format:i})=>i===e),t=e.toLowerCase().replaceAll(d,"");return r?{...r,format:t}:{format:t}}),Ar=[{hero:L.Hero.DataDoll,nicknames:["data","datadoll"]},{hero:L.Hero.Dorinthea,nicknames:["dori"]},{hero:L.Hero.Genis,nicknames:["genis"]},{hero:L.Hero.GravyBones,nicknames:["gravy"]},{hero:L.Hero.Iyslander,nicknames:["islander"]}],Tr=Object.values(L.Hero).map(e=>{let r=Ar.find(({hero:i})=>i===e),t=e.toLowerCase().replaceAll(d,"");return r?{...r,hero:t}:{hero:t}}),Z=["common","rare","super rare","majestic","legendary","fabled"],xr=(e,r,t,i)=>{let a=[];if(!r)a.push(...e);else for(let s of e)switch(r){case">=":{let n=!1;for(let o of Z)n?a.push(o):o===s&&(n=!0,a.push(o));break}case">":{let n=!1;for(let o of Z)n?a.push(o):o===s&&(n=!0);break}case"<=":{let n=!1;for(let o of Z.slice().reverse())n?a.push(o):o===s&&(n=!0,a.push(o));break}case"<":{let n=!1;for(let o of Z.slice().reverse())n?a.push(o):o===s&&(n=!0);break}default:break}return{filterToPropertyMapping:{nestedProperty:"rarity",property:"printings",isArray:!0},isExcluded:t,isOptional:i,isOr:!0,values:a}},Ee=(e,r,t,i,a)=>{let s=i.map(h=>({hero:h.toLowerCase().replaceAll(d,"")})),n=[],o=[],c=[];for(let h of e){let g=vr.find(({format:p,nicknames:b})=>p===h||!!b&&b.includes(h));if(g)o.push(g.format);else{let p=Tr.find(({hero:b,nicknames:M})=>b===h||!!M&&M.includes(h))||s.find(({hero:b})=>b===h);p&&c.push(p.hero)}}let m=a||"legalFormats";return o.length>0&&n.push({filterToPropertyMapping:{property:m,isArray:!0},values:o,isOr:!0,isExcluded:r,isOptional:t}),c.length>0&&n.push({filterToPropertyMapping:{property:"legalHeroes",isArray:!0},values:c,isOr:!0,isExcluded:r,isOptional:t}),n},Pr=(e,r,t,i)=>Ee(e,r,t,i,"bannedFormats"),ue=(e,r,t,i,a,s)=>{let n=[];return kr(t)?n.push(...Ee(i,e,r,s)):Rr(t)?n.push(...Pr(i,e,r,s)):Br(t)&&n.push(xr(i,a,e,r)),n},K=[{filterToPropertyMapping:{property:"cost",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialCost",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]}],V=[{filterToPropertyMapping:{property:"defense",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialDefense",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["hero","placeholder","token","weapon"]}],X=[{filterToPropertyMapping:{property:"pitch",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token","weapon"]},{filterToPropertyMapping:{property:"isCardBack",isBoolean:!0},isExcluded:!0,values:["true"]}],U=[{filterToPropertyMapping:{property:"power",isNumber:!0},isExcluded:!0,values:re},{filterToPropertyMapping:{property:"specialPower",isString:!0,partialMatch:!0},isExcluded:!0,values:["*","x"]},{filterToPropertyMapping:{property:"types",isArray:!0,partialMatch:!0},isExcluded:!0,values:["equipment","hero","placeholder","token"]}],ee=[{filterToPropertyMapping:{property:"talents",isArray:!0},isExcluded:!0,values:Object.values(L.Talent).map(e=>e.toLowerCase())}],wr={"!co":K,"-co":K,"!cost":K,"-cost":K,"!color":K,"-color":K,"!b":V,"-b":V,"!block":V,"-block":V,"!d":V,"-d":V,"!def":V,"-def":V,"!defense":V,"-defense":V,"!pitch":X,"-pitch":X,"!p":X,"-p":X,"!attack":U,"-attack":U,"!power":U,"-power":U,"!pwr":U,"-pwr":U,"!pow":U,"-pow":U,"!talents":ee,"-talents":ee,"!tal":ee,"-tal":ee},fe=e=>{let r=[],t=wr[e];return t&&r.push(...t),r},Sr=["l","legal","hero"],kr=e=>Sr.includes(e),Lr=["banned"],Rr=e=>Lr.includes(e),Er=["r","rarity"],Br=e=>Er.includes(e);var I=require("@flesh-and-blood/types"),ge=[{description:"Attack actions",expanded:["st:attack"],filters:{subtypes:[I.Subtype.Attack]},isCardProperty:!1,shorthands:["AA"]},{description:"Arcane barrier",expanded:['k:"arcane barrier"'],filters:{keywords:[I.Keyword.ArcaneBarrier]},isCardProperty:!1,shorthands:["AB"]},{description:"Attack reactions",expanded:['t:"attack reaction"'],filters:{types:[I.Type.AttackReaction]},isCardProperty:!1,shorthands:["AR"]},{description:"Defense reactions",expanded:['t:"defense reaction"'],filters:{types:[I.Type.DefenseReaction]},isCardProperty:!1,shorthands:["DR"]},{description:"Gain life",expanded:["gain {h}"],filters:{functionalText:"gain {h}"},isCardProperty:!1,shorthands:["Gain life","Gains life"]},{description:"Go again",expanded:['k:"go again"'],filters:{keywords:[I.Keyword.GoAgain]},isCardProperty:!1,shorthands:["GA"]},{description:"Non-attack actions",expanded:["t:action","st:non-attack"],filters:{subtypes:[I.Subtype.NonAttack],types:[I.Type.Action]},isCardProperty:!1,shorthands:["NAA"]},{description:"Plus defense",expanded:["+ {d}"],filters:{functionalText:"+ {d}"},isCardProperty:!1,shorthands:["Pump defense","Pumps defense","Buff defense","Buffs defense"]},{description:"Spellvoid",expanded:['k:"spellvoid"'],filters:{keywords:[I.Keyword.Spellvoid]},isCardProperty:!1,shorthands:["SV"]}],he=ge.filter(({shorthands:e})=>e.some(r=>r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)})),me=ge.filter(({shorthands:e})=>e.some(r=>!r.includes(" "))).map(e=>({...e,shorthands:e.shorthands.filter(r=>!r.includes(" ")).map(r=>r.toLowerCase()).sort((r,t)=>t.length-r.length)}));var be=(e,r)=>{let t=r.find(i=>ye(i.name)===e);return t||(t=r.find(i=>ye(i.name).includes(e))),t},ye=e=>z(e.toLowerCase().trim().replace(d,"")),z=e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"");var j=require("@flesh-and-blood/types");var _=require("@flesh-and-blood/types"),Nr={"Dawnblade, Resplendent":"Dawnblade"},Be=e=>Nr[e.name]||e.name,Ne=e=>e.functionalText?.replaceAll(e.name,""),te=(e,r)=>{let t=r.find(i=>i.name.toLowerCase().replace(d,"")===e);return t||(t=r.find(i=>i.name.toLowerCase().replace(d,"").includes(e))),Ce(t,r)},Ce=(e,r,t)=>{let i={},a={},s={};if(e){let m=[],h=[],g=Be(e);for(let p of r){let b=Be(p),M=g===b,T=e.cardIdentifier!==p.cardIdentifier,G=e.pitch!==p.pitch;if(M&&T&&G)i[p.cardIdentifier]=p;else if(!M&&!t?.shouldSkipReferences){let x=e.name==="Seismic Surge",k=p.keywords?.includes(_.Keyword.Heave),u=x&&k,D=e.name==="Marked",f=p.keywords?.includes(_.Keyword.Mark),y=D&&f,A=Ne(p),C=A?.includes(g)||e.traits?.some(pe=>A?.includes(pe)),P=Ne(e);(C||u||y)&&m.push(p);let B=new RegExp(b,"g"),q=new RegExp(`\\*\\*${b}\\*\\*`,"g"),W=P?.match(B)||[],v=P?.match(q)||[],E=W.length===v.length,w=P?.includes(b)&&!E,H=(p.traits||[]).some(pe=>P?.includes(pe)),O=w||H,R=p.name==="Seismic Surge",S=e.keywords?.includes(_.Keyword.Heave),ce=R&&S,pr=p.name==="Marked",dr=e.keywords?.includes(_.Keyword.Mark);(O||ce||pr&&dr)&&h.push(p)}}for(let p of m)a[p.cardIdentifier]=p;for(let p of h){let b=p.name;g!==b&&!h.some(M=>{let T=M.name;return T!==b&&T?.includes(b)})&&(s[p.cardIdentifier]=p)}}let n=Object.values(i),o=Object.values(a),c=Object.values(s);return{otherPitches:n,referencedBy:o,references:c}},Or=["cash-in-yellow"],Ir={[j.Hero.Crackni]:{traits:[j.Trait.AgentOfChaos]},[j.Hero.Maxx]:{tokens:["hyper-driver"]}},Dr=(e,r,t)=>{let i=new Set;for(let a of e.filter(({cardIdentifier:s})=>!Or.includes(s))){let{references:s}=Ce(a,r);for(let n of s.filter(o=>{let c=o.name==="Hyper Driver",m=t===j.Hero.Maxx;return!c||m}))i.add(n)}if(t){let a=Ir[t];if(a){if(a.cards)for(let s of e)a.cards?.includes(s.cardIdentifier)&&i.add(s);if(a.tokens)for(let s of r)a.tokens?.includes(s.cardIdentifier)&&i.add(s)}}return Array.from(i)};var ar=[">=",">","<=","<"],sr=["!","-"],Hr={property:"arcane",specialProperty:"specialArcane",isNumber:!0,partialMatch:!0},Fe={property:"artists",isArray:!0,partialMatch:!0},Oe={property:"n/a",isMeta:!0},Ie={property:"bonds",isArray:!0},Vr={property:"n/a"},De={property:"classes",isArray:!0,partialMatch:!0},He={property:"cost",specialProperty:"specialCost",isNumber:!0,partialMatch:!0},$={property:"defense",specialProperty:"specialDefense",isNumber:!0},Ve={property:"flows",isArray:!0},Ge={nestedProperty:"foiling",property:"printings",isArray:!0},Ue={property:"fusions",isArray:!0},We={property:"intellect",isNumber:!0},Ke={property:"keywords",isArray:!0},Me={property:"n/a",isMeta:!0},je={property:"life",specialProperty:"specialLife",isNumber:!0},xe={property:"meta",isArray:!0},qe={property:"name",isString:!0,partialMatch:!0},ve={property:"pitch",isNumber:!0},ze={property:"firstReleaseDate",isDate:!0},ie={property:"power",specialProperty:"specialPower",isNumber:!0},Gr={property:"setIdentifiers",isArray:!0,partialMatch:!0},_e={property:"n/a",isMeta:!0},Ur={property:"n/a"},Wr={property:"n/a"},$e={property:"sets",isArray:!0,partialMatch:!0},Ae={property:"shorthands",isArray:!0,partialMatch:!0},ae={property:"specializations",isArray:!0,partialMatch:!0},Ye={property:"subtypes",isArray:!0},Je={property:"types",isArray:!0},Qe={property:"talents",isArray:!0},Kr={property:"functionalText",isString:!0,partialMatch:!0},jr={property:"traits",isArray:!0,partialMatch:!0},qr={property:"typeText",isString:!0,partialMatch:!0},se={nestedProperty:"treatments",property:"printings",isArray:!0,isNestedPropertyArray:!0},zr={property:"firstReleaseDate",isString:!0,partialMatch:!0},oe={arcane:Hr,a:Fe,artist:Fe,art:Fe,attack:ie,b:$,block:$,banned:Oe,bond:Ie,bonds:Ie,c:De,class:De,chain:Vr,co:He,cost:He,color:ve,d:$,def:$,defense:$,flow:Ve,flows:Ve,f:Ue,fusion:Ue,foil:Ge,foiling:Ge,i:We,intellect:We,is:xe,k:Ke,keyword:Ke,l:Me,legal:Me,hero:Me,li:je,life:je,meta:xe,n:qe,name:qe,p:ve,pitch:ve,pwr:ie,pow:ie,power:ie,print:Gr,r:_e,rarity:_e,referencedby:Ur,references:Wr,rf:Oe,s:$e,set:$e,short:Ae,shorthand:Ae,shorthands:Ae,sp:ae,spec:ae,specialization:ae,specializations:ae,st:Ye,subtype:Ye,t:Je,type:Je,tal:Qe,talent:Qe,text:Kr,trait:jr,treat:se,treatment:se,var:se,variation:se,x:qr,year:zr},_r=[{text:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase(),override:l.Release.ClassicBattlesRhinarDorinthea.toLowerCase().replaceAll(d,"")}],$r=e=>{let r=[],t=e.replaceAll("\u201D",'"');for(let{text:a,override:s}of _r)t.includes(a)&&(t=t.replace(a,s));if(Q(t)?.card)r.push(t);else{let a=t.split(/[ ]+/),s="",n=0;for(let o of a)n===2&&(r.push(s.trim().replaceAll('"',"")),s="",n=0),n<2&&o.split('"').length===2?(s+=" "+o,n++):n===0&&s===""?r.push(o):n===1&&(s+=" "+o);n===2&&(r.push(s.trim().replaceAll('"',"")),s="",n=0)}return r},we=(e,r,t=[],i=[],a=rt())=>{let s=e.trim().toLowerCase();for(let{expanded:x,shorthands:k}of he)for(let u of k)if(s.includes(u)){s=s.replace(u,x.join(" "));break}for(let[x,k]of Object.entries(l.setToSetIdentifierMappings))s.includes(x.toLowerCase())&&(s=s.replace(x.toLowerCase(),k[0]));let n=$r(s),o=[];for(let x of n){let k=me.find(({shorthands:u})=>u.includes(x));k&&!k.isCardProperty?o.push(...k.expanded):o.push(x)}let c=[],m=[],h=[],g=[],p=!1,b=[],M=[],T=[],G=[];for(let x of o)if(lt(x)){let[k,u]=x.split(":"),{modifier:D,values:f,isAnd:y,isOr:A}=ot(u),{filterKey:C,isExcluded:P,isOptional:B,isMeta:q}=nt(k),W=!1;if(q){if(["rarity","r"].includes(C)){let v=st(f);P||(M=[...v]),f=v.map(E=>E.toLowerCase())}["legal","l","hero"].includes(C),c.push(...ue(P,B,C,f,D,t))}else{if(["chain"].includes(C)){let v=R=>R.name.toLowerCase().replaceAll(d,""),E=f.map(R=>be(R,r)).filter(R=>!!R).map(v),w=new Set(E);C="name",A=!0;let N=20,H=0,O=R=>{if(!R.types.includes(l.Type.Hero)){let S=v(R);w.add(S),E.includes(S)||E.push(S)}};for(let R of E){if(H>N)break;let{referencedBy:S,references:ce}=te(R,r);ce.forEach(O),H===0&&S.forEach(O),H++}f=Array.from(w)}else if(["referencedby","references"].includes(C)){let v=C,E=[...f].filter(w=>!!w);f=[],C="name",A=!0;for(let w of E){let{referencedBy:N,references:H}=te(w,r);["referencedby"].includes(v)?f.push(...H.map(({name:O})=>O.toLowerCase().replaceAll(d,""))):["references"].includes(v)&&f.push(...N.map(({name:O})=>O.toLowerCase().replaceAll(d,"")))}}else if(["art","artist"].includes(C))m=f;else if(["print","prints","printing","printings"].includes(C))b=f;else if(["is","meta"].includes(C)){let v=[],E=[],w=[],N=[];for(let S of f)Zr.includes(S)?v.push(S):Xr.includes(S)?E.push(S):et.includes(S)?w.push(S):N.push(S);v.length>0&&(c.push({filterToPropertyMapping:xe,values:[l.Meta.Reprint.toLowerCase().replaceAll(d,"")],isAnd:y,isOr:A,isExcluded:!P,isOptional:B}),W=N.length===0);let H=E.length>0;H&&c.push({filterToPropertyMapping:ze,values:[a],isAnd:y,isOr:A,isExcluded:P,isOptional:B});let O=w.length>0;O&&c.push({filterToPropertyMapping:ze,values:[a],isAnd:y,isOr:A,isExcluded:!P,isOptional:B}),(H||O)&&(W=N.length===0);let R=tt(N);f=R.map(S=>S.toLowerCase().replaceAll(d,"")),R.includes(l.Meta.Expansion)&&!P&&(p=!0)}else["foiling","foil"].includes(C)?(g=it(f),f=g.map(v=>v.toLowerCase())):["treat","treatment","var","variation"].includes(C)?(G=at(f),f=G.map(v=>v.toLowerCase())):["set","s"].includes(C)?(T=Yr(f,i),f=T.map(v=>v.toLowerCase().replaceAll(d,""))):["pitch","p","color"].includes(C)&&(f=Qr(f));oe[C]&&!W&&c.push({filterToPropertyMapping:oe[C],values:f,isAnd:y,isOr:A,modifier:D,isExcluded:P,isOptional:B})}}else if(x){let k=Q(x)?.card,u=fe(x);k?h.push(`"${k.toLowerCase().replace(d,"")}"`):u&&u.length>0?c.push(...u):h.push(x.replace(d,""))}return{appliedFilters:c,attributes:{artists:m,foilings:g,isExpansionSlot:p,prints:b,rarities:M,releases:T,treatments:G},keywords:h}},Yr=(e,r=[])=>{let t=[];for(let i of e)t.push(...Jr(i,r));return t},Jr=(e,r=[])=>{let t=[],i=Object.values(l.Release).find(a=>a.toLowerCase().replaceAll(d,"")===e);if(i&&t.push(i),t.length===0){let a=l.setIdentifierToSetMappings[e];a&&t.push(a)}if(t.length===0){let a=Object.values(l.Release).filter(s=>s.toLowerCase().includes(e));a.length>0&&t.push(...a)}if(t.length===0){let a=r.find(s=>s.toLowerCase().replaceAll(d,"")===e);a&&t.push(a)}return t},Te={purple:4,blue:3,yellow:2,red:1,white:0},Qr=e=>{let r=[];for(let t of e)Te[t]||Te[t]===0?r.push(Te[t].toString()):r.push(t);return r},Zr=["unique"],Xr=["preview","spoiler","unreleased"],et=["released"],rt=()=>{let e=new Date,r=`${e.getMonth()+1}`.padStart(2,"0"),t=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${r}-${t}`},Ze={dual:l.Meta.DualClass,exp:l.Meta.Expansion,expansion:l.Meta.Expansion,expansionSlot:l.Meta.Expansion,rainbow:l.Meta.Rainbow,reprint:l.Meta.Reprint,reprints:l.Meta.Reprint},tt=e=>{let r=[];for(let t of e)Ze[t]?r.push(Ze[t]):l.Meta[t]&&r.push(l.Meta[t]);if(e.length>0&&r.length===0){for(let t of Object.values(l.Meta))for(let i of e)if(t.toLowerCase().includes(i)){r.push(t);break}}return r},Xe={r:l.Foiling.Rainbow,rf:l.Foiling.Rainbow,rainbow:l.Foiling.Rainbow,c:l.Foiling.Cold,cf:l.Foiling.Cold,cold:l.Foiling.Cold,g:l.Foiling.Gold,gf:l.Foiling.Gold,gold:l.Foiling.Gold},it=e=>{let r=[];for(let t of e)Xe[t]&&r.push(Xe[t]);return r},er={...Object.values(l.Treatment).reduce((e,r)=>(e[r.toLowerCase()]=r,e),{}),aa:l.Treatment.AA,alt:l.Treatment.AA,"alt art":l.Treatment.AA,ab:l.Treatment.AB,"alt border":l.Treatment.AB,at:l.Treatment.AT,"alt text":l.Treatment.AT,ea:l.Treatment.EA,extended:l.Treatment.EA,"extended art":l.Treatment.EA,fa:l.Treatment.FA,full:l.Treatment.FA,"full art":l.Treatment.FA},at=e=>{let r=[];for(let t of e)er[t]?r.push(er[t]):l.Treatment[t.toUpperCase()]&&r.push(l.Treatment[t.toUpperCase()]);return r},Pe={b:l.Rarity.Basic,c:l.Rarity.Common,f:l.Rarity.Fabled,l:l.Rarity.Legendary,m:l.Rarity.Majestic,p:l.Rarity.Promo,r:l.Rarity.Rare,s:l.Rarity.SuperRare,t:l.Rarity.Token,v:l.Rarity.Marvel},st=e=>{let r=[];for(let t of e)Pe[t]?r.push(Pe[t]):r.push(t);return r},ot=e=>{let r=[],t,i,a=ar.find(s=>e.includes(s));if(a){let[,s]=e.split(a);rr(s)?(t=!0,r.push(...s.trim().split("+").map(n=>n.replace(d,"")))):tr(s)?(i=!0,r.push(...s.trim().split(",").map(n=>n.replace(d,"")))):r.push(s.trim().replace(d,""))}else rr(e)?(t=!0,r.push(...e.trim().split("+").map(s=>s.replace(d,"")))):tr(e)?(i=!0,r.push(...e.trim().split(",").map(s=>s.replace(d,"")))):e.startsWith('"')&&e.endsWith('"')?r.push(e.trim().replaceAll('"',"").replace(d,"")):r.push(e.trim().replace(d,""));return{modifier:a,values:r,isAnd:t,isOr:i}},nt=e=>{let r=ct(e);if(r){let[,t]=e.split(r);return{filterKey:t,isExcluded:!0,isOptional:!1,isMeta:ir(t)}}else return{filterKey:e,isExcluded:!1,isOptional:!1,isMeta:ir(e)}},lt=e=>e.indexOf(":")>=0,rr=e=>e.indexOf("+")>=0,tr=e=>e.indexOf(",")>=0,ir=e=>!!oe[e]?.isMeta,ct=e=>sr.find(r=>e.includes(r))?.slice(0,1);var F=require("@flesh-and-blood/types"),or={artists:["Hoodwill"],cardIdentifier:"fangs-a-lot-blue",classes:[F.Class.Generic],defaultImage:"FNG000",firstReleaseDate:"2022-06-02",functionalText:"If Fangs A Lot is put into your banished zone from your graveyard, instead put it into your hand.",legalFormats:[],legalHeroes:[F.Hero.Kayo,F.Hero.Levia,F.Hero.Rhinar],printings:[{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000",print:"FNG000",rarity:F.Rarity.Rare,set:F.Release.Promos},{artists:["Hoodwill"],identifier:"FNG000",image:"FNG000_Marvel",print:`FNG000-${F.Treatment.FA}`,rarity:F.Rarity.Marvel,set:F.Release.Promos,treatment:F.Treatment.FA}],name:"Fangs A Lot",rarities:[F.Rarity.Rare,F.Rarity.Marvel],rarity:F.Rarity.Rare,sets:[F.Release.Promos],setIdentifiers:["FNG000"],specialImage:"FNG000_Marvel",subtypes:[F.Subtype.Attack],types:[F.Type.Action],typeText:"Generic Action - Attack"},nr=[{keyword:or.name.toLowerCase(),card:or}];var ke=class{constructor(r,t=[],i=[],a=!1){this.log=(r,...t)=>{this.debug&&console.log(r,...t)};this.search=(r,t)=>{let i,{appliedFilters:a,attributes:s,keywords:n}=we(r,this.cards,this.additionalHeroes,this.additionalSets),o=n.join(" "),c=t?nr.filter(u=>u.keyword===o):[];if(c.length>0?i=c.map(({card:u})=>u):n.length?i=this.fuse.search(o).map(u=>u.item):i=[...this.cards],a.length&&(i=i.filter(u=>u&&cr(u,a))),n.length===0){let u="";if(s.releases.length===1)try{let y=s.releases[0];u=ne.setToSetIdentifierMappings[y][0].toUpperCase()}catch(y){console.error("Error getting set identifier from search",y)}if(!u&&s.prints.length===1)try{let y=s.prints[0];ne.setIdentifierToSetMappings[y]&&(u=y.toUpperCase())}catch(y){console.error("Error getting set identifier from search",y)}u?i.sort((y,A)=>{let C=y.setIdentifiers.find(B=>B.includes(u))?.replace(u,""),P=A.setIdentifiers.find(B=>B.includes(u))?.replace(u,"");return C&&P?C.localeCompare(P):-1}):i.sort((y,A)=>y.name===A.name?`${y.pitch}`.localeCompare(`${A.pitch}`):y.name.localeCompare(A.name))}else{let u=[],D=[],f=n.map(y=>y.toLowerCase().replace(d,"")).join(" ");for(let y of i)y.name.toLowerCase().replace(d,"")===f?u.push(y):D.push(y);i=[...u,...D]}let m,{artists:h,isExpansionSlot:g,foilings:p,prints:b,rarities:M,releases:T,treatments:G}=s;(h.length>0||g||p.length>0||b.length>0||M.length>0||T.length>0||G.length>0)&&(m=i.map(u=>{let D=u.printings.filter(f=>{let y=!!f.image,A=h.length===0||h.some(w=>f.artists.find(N=>N.replace(d,"").toLowerCase().includes(w))),C=!g||g===f.isExpansionSlot,P=p.length===0||p.includes(f.foiling),B=b.length===0||b.some(w=>f.identifier.includes(w.toUpperCase())),q=M.length===0||M.includes(f.rarity),W=T.length===0||T.includes(f.set),v=G.length===0||f.treatments?.some(w=>G.includes(w));return y&&A&&C&&P&&B&&q&&W&&v});return{...u,matchingPrintings:D}}));let k=m?.length>0?m:i;return{appliedFilters:a,attributes:s,keywords:n,searchResults:k}};let s={getFn:(n,o)=>{let c=Se.default.config.getFn(n,o);return c&&(Array.isArray(c)?c.map(m=>z(m.replace(d,""))):z(c).replace(d,""))},ignoreLocation:!0,includeScore:!0,keys:[{name:"name",weight:10},{name:"functionalText",weight:6},{name:"shorthands",weight:4},{name:"setIdentifiers",weight:2},{name:"traits",weight:4},{name:"typeText",weight:6}],threshold:.15,useExtendedSearch:!0};this.additionalHeroes=t,this.additionalSets=i,this.cards=[...r],this.debug=a,this.fuse=new Se.default([...r],s)}},lr=ke,cr=(e,r)=>{let t=!0,i=!1;for(let a of r){let s=a.isOptional,{isNumber:n,isString:o,isArray:c,isBoolean:m,isDate:h}=a.filterToPropertyMapping;if(n){let g=pt(e,a);s?g&&(i=!0):t=t&&g}else if(o){let g=dt(e,a);s?g&&(i=!0):t=t&&g}else if(c){let g=ut(e,a,r);s?g&&(i=!0):t=t&&g}else if(m){let g=ft(e,a);s?g&&(i=!0):t=t&&g}else if(h){let g=gt(e,a);s?g&&(i=!0):t=t&&g}}return t},pt=(e,r)=>{if(Y(r,e)){let{values:t,modifier:i,isExcluded:a,filterToPropertyMapping:{partialMatch:s}}=r,n=le(e,r);if(n!=null&&!isNaN(n))if(n=parseInt(n),i)switch(i){case">=":{let o=t?.some(c=>n>=parseInt(c));return a?!o:o}case">":{let o=t?.some(c=>n>parseInt(c));return a?!o:o}case"<=":{let o=t?.some(c=>n<=parseInt(c));return a?!o:o}case"<":{let o=t?.some(c=>n<parseInt(c));return a?!o:o}default:return!1}else{let o=t?.some(c=>n===parseInt(c));return a?!o:o}else{let o=mt(e,r)?.toLowerCase(),c=s?t?.some(m=>o?.includes(m)):t?.some(m=>o===m);return a?!c:c}}else return!0},dt=(e,r)=>{if(Y(r,e)){let{values:t,isAnd:i,isExcluded:a,filterToPropertyMapping:{partialMatch:s}}=r,n=le(e,r)?.replaceAll(d,"");if(s){let o=i?t?.every(c=>n?.toLowerCase().includes(c)):t?.some(c=>n?.toLowerCase().includes(c));return a?!o:o}else{let o=i?t?.every(c=>n?.toLowerCase()===c):t?.some(c=>n?.toLowerCase()===c);return a?!o:o}}else return!0},ut=(e,r,t)=>{if(Y(r,e)){let{values:i,isAnd:a,isExcluded:s,filterToPropertyMapping:{partialMatch:n}}=r,o=ht(e,r,t).map(c=>c?.replaceAll(d,""));if(n){let c=a?i.every(h=>o?.some(g=>g?.toLowerCase().includes(h))):i.some(h=>o?.some(g=>g?.toLowerCase().includes(h))),m=o.length===0;return s?!c||m:c}else{let c=a?i.every(m=>o?.some(h=>h?.toLowerCase()===m)):i.some(m=>o?.some(h=>h?.toLowerCase()===m));return s?!c:c}}else return!0},ft=(e,r)=>{if(Y(r,e)){let{isExcluded:t}=r,i=le(e,r);return t?!i:i}else return!0},gt=(e,r)=>{if(Y(r,e)){let{values:t,isExcluded:i}=r,a=le(e,r),s=t?.some(n=>a>n);return i?!s:s}else return!0},le=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.property]},ht=(e,r,t)=>{let{filterToPropertyMapping:{isNestedPropertyArray:i,nestedProperty:a,property:s}}=r,n=e[s]||[],o=[],c=Object.keys(e.legalOverrides||{}).length>0,m=r.filterToPropertyMapping.property==="legalHeroes",h=t.find(({filterToPropertyMapping:p})=>p.property==="legalFormats");if(c&&m&&!!h){let p=new Set;for(let{format:b,heroes:M}of e.legalOverrides||[])if(h.values.includes(b.toLowerCase()))for(let T of M)p.add(T);o=Array.from(p)}if(o.length===0)if(a){let p=new Set;for(let b of n)if(i){let M=b[a]||[];for(let T of M)p.add(T)}else{let M=b[a];M&&p.add(M)}o=Array.from(p)}else o=n;return o},mt=(e,r)=>{let{filterToPropertyMapping:t}=r;return e[t.specialProperty]},Y=({cardTypes:e},{types:r,subtypes:t})=>!e||e?.some(i=>r.map(a=>a.toLowerCase()).includes(i.toLowerCase())||t.map(a=>a.toLowerCase()).includes(i.toLowerCase()));0&&(module.exports={FilterProperty,PUNCTUATION,RARITY_VALUES_MAPPING,abbreviations,availableExclusions,availableModifiers,filterCard,filtersToCardPropertyMappings,getAbbreviation,getAbbreviationByCard,getCardByName,getCleanText,getExcludedMetaFilters,getKeywordsAndAppliedFiltersFromText,getMetaFilters,getNormalizedText,getRelatedCards,getRelatedCardsByName,getTokensReferencedByCards,multiWordShorthands,shorthands,singleWordShorthands});
|
package/dist/shorthands.js
CHANGED
|
@@ -36,24 +36,6 @@ const shorthands = [
|
|
|
36
36
|
isCardProperty: false,
|
|
37
37
|
shorthands: ["DR"]
|
|
38
38
|
},
|
|
39
|
-
{
|
|
40
|
-
description: "Disease",
|
|
41
|
-
expanded: ['st:"disease"'],
|
|
42
|
-
filters: {
|
|
43
|
-
subtypes: [Subtype.Disease]
|
|
44
|
-
},
|
|
45
|
-
isCardProperty: false,
|
|
46
|
-
shorthands: ["Disease"]
|
|
47
|
-
},
|
|
48
|
-
// {
|
|
49
|
-
// description: "Flick daggers",
|
|
50
|
-
// expanded: ["dagger you control deal 1 damage"],
|
|
51
|
-
// filters: {
|
|
52
|
-
// functionalText: "dagger you control deal 1 damage",
|
|
53
|
-
// },
|
|
54
|
-
// isCardProperty: true,
|
|
55
|
-
// shorthands: ["Flick", "Hurl", "Throw"],
|
|
56
|
-
// },
|
|
57
39
|
{
|
|
58
40
|
description: "Gain life",
|
|
59
41
|
expanded: ["gain {h}"],
|
|
@@ -96,46 +78,6 @@ const shorthands = [
|
|
|
96
78
|
"Buffs defense"
|
|
97
79
|
]
|
|
98
80
|
},
|
|
99
|
-
// {
|
|
100
|
-
// description: "Plus power",
|
|
101
|
-
// expanded: ["+ {p}"],
|
|
102
|
-
// filters: {
|
|
103
|
-
// functionalText: "+ {p}",
|
|
104
|
-
// },
|
|
105
|
-
// isCardProperty: false,
|
|
106
|
-
// shorthands: [
|
|
107
|
-
// "Pumps",
|
|
108
|
-
// "Pump",
|
|
109
|
-
// "Buff",
|
|
110
|
-
// "Buffs",
|
|
111
|
-
// "Pump attack",
|
|
112
|
-
// "Pump attacks",
|
|
113
|
-
// "Pumps attack",
|
|
114
|
-
// "Pumps attacks",
|
|
115
|
-
// "Buff attack",
|
|
116
|
-
// "Buff attacks",
|
|
117
|
-
// "Buffs attack",
|
|
118
|
-
// "Buffs attacks",
|
|
119
|
-
// "Pump power",
|
|
120
|
-
// "Pumps power",
|
|
121
|
-
// "Buff power",
|
|
122
|
-
// "Buffs power",
|
|
123
|
-
// ],
|
|
124
|
-
// },
|
|
125
|
-
// {
|
|
126
|
-
// description: "Poppers",
|
|
127
|
-
// expanded: ["!c:illusionist", "st:attack", "pwr:>=6", "def:>=0"],
|
|
128
|
-
// filters: {
|
|
129
|
-
// defenseGreaterThanOrEqualTo: 0,
|
|
130
|
-
// notClass: [Class.Illusionist],
|
|
131
|
-
// powerGreaterThanOrEqualTo: 6,
|
|
132
|
-
// subtypes: [Subtype.Attack],
|
|
133
|
-
// },
|
|
134
|
-
// isCardProperty: false,
|
|
135
|
-
// helper:
|
|
136
|
-
// '6+ power non-Illusionist attacks that can "pop" phantasm attacks when defending',
|
|
137
|
-
// shorthands: ["Poppers", "Popper"],
|
|
138
|
-
// },
|
|
139
81
|
{
|
|
140
82
|
description: "Spellvoid",
|
|
141
83
|
expanded: ['k:"spellvoid"'],
|
|
@@ -145,24 +87,6 @@ const shorthands = [
|
|
|
145
87
|
isCardProperty: false,
|
|
146
88
|
shorthands: ["SV"]
|
|
147
89
|
}
|
|
148
|
-
// {
|
|
149
|
-
// description: "Tap",
|
|
150
|
-
// expanded: ["{t}"],
|
|
151
|
-
// filters: {
|
|
152
|
-
// functionalText: "{t}",
|
|
153
|
-
// },
|
|
154
|
-
// isCardProperty: true,
|
|
155
|
-
// shorthands: ["Tap"],
|
|
156
|
-
// },
|
|
157
|
-
// {
|
|
158
|
-
// description: "Untap",
|
|
159
|
-
// expanded: ["{u}"],
|
|
160
|
-
// filters: {
|
|
161
|
-
// functionalText: "{u}",
|
|
162
|
-
// },
|
|
163
|
-
// isCardProperty: true,
|
|
164
|
-
// shorthands: ["Untap"],
|
|
165
|
-
// },
|
|
166
90
|
];
|
|
167
91
|
const multiWordShorthands = shorthands.filter(
|
|
168
92
|
({ shorthands: shorthands2 }) => shorthands2.some((shorthand) => shorthand.includes(" "))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flesh-and-blood/search",
|
|
3
3
|
"description": "TypeScript search engine for Flesh and Blood cards",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.76",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "dist/index.cjs",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@flesh-and-blood/types": "^4.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@flesh-and-blood/cards": "^4.0.
|
|
50
|
-
"@flesh-and-blood/types": "^4.0.
|
|
49
|
+
"@flesh-and-blood/cards": "^4.0.76",
|
|
50
|
+
"@flesh-and-blood/types": "^4.0.75",
|
|
51
51
|
"@types/jest": "^29.5.11",
|
|
52
52
|
"@types/node": "^20.10.5",
|
|
53
53
|
"esbuild": "^0.19.10",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"FAB",
|
|
78
78
|
"FABTCG"
|
|
79
79
|
],
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "bba19c8a552b3c0a832c834b6ca740b6f5e72ae4"
|
|
81
81
|
}
|