@champions-digital-game/mod-sdk 0.48.0 → 0.49.0

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.
@@ -1,4 +1,4 @@
1
- import{campaignDefinitionsOf,dslFeatures,readPackInput,sha256Hex,validatePack}from"./chunk-7MEEJH7D.js";import{PACK_PREVIEW_SCHEMA_VERSION,isSafePackPath,packCardImagePath,parsePackCardImagePath}from"./chunk-JZ4GBK6N.js";import{mkdirSync,readFileSync,readdirSync,statSync,writeFileSync,existsSync}from"node:fs";import{dirname,join,relative,sep}from"node:path";import{pathToFileURL}from"node:url";import{createRequire}from"module";var require2=createRequire("/"),_a,Worker,isMarkedAsUntransferable;try{_a=require2("worker_threads"),Worker=_a.Worker,isMarkedAsUntransferable=_a.isMarkedAsUntransferable}catch{}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(eb,start){for(var b=new u16(31),i2=0;i2<31;++i2)b[i2]=start+=1<<eb[i2-1];for(var r=new i32(b[30]),i2=1;i2<30;++i2)for(var j=b[i2];j<b[i2+1];++j)r[j]=j-b[i2]<<5|i2;return{b,r}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;var _b=freb(fdeb,0),fd=_b.b,revfd=_b.r,rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>1|(i&21845)<<1,x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,rev[i]=((x&65280)>>8|(x&255)<<8)>>1;var x,i,hMap=(function(cd,mb,r){for(var s=cd.length,i2=0,l=new u16(mb);i2<s;++i2)cd[i2]&&++l[cd[i2]-1];var le=new u16(mb);for(i2=1;i2<mb;++i2)le[i2]=le[i2-1]+l[i2-1]<<1;var co;if(r){co=new u16(1<<mb);var rvb=15-mb;for(i2=0;i2<s;++i2)if(cd[i2])for(var sv=i2<<4|cd[i2],r_1=mb-cd[i2],v=le[cd[i2]-1]++<<r_1,m=v|(1<<r_1)-1;v<=m;++v)co[rev[v]>>rvb]=sv}else for(co=new u16(s),i2=0;i2<s;++i2)cd[i2]&&(co[i2]=rev[le[cd[i2]-1]++]>>15-cd[i2]);return co}),flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,flm=hMap(flt,9,0);var fdm=hMap(fdt,5,0);var shft=function(p){return(p+7)/8|0},slc=function(v,s,e){return(s==null||s<0)&&(s=0),(e==null||e>v.length)&&(e=v.length),new u8(v.subarray(s,e))};var ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(ind,msg,nt){var e=new Error(msg||ec[ind]);if(e.code=ind,Error.captureStackTrace&&Error.captureStackTrace(e,err),!nt)throw e;return e};var wbits=function(d,p,v){v<<=p&7;var o=p/8|0;d[o]|=v,d[o+1]|=v>>8},wbits16=function(d,p,v){v<<=p&7;var o=p/8|0;d[o]|=v,d[o+1]|=v>>8,d[o+2]|=v>>16},hTree=function(d,mb){for(var t=[],i2=0;i2<d.length;++i2)d[i2]&&t.push({s:i2,f:d[i2]});var s=t.length,t2=t.slice();if(!s)return{t:et,l:0};if(s==1){var v=new u8(t[0].s+1);return v[t[0].s]=1,{t:v,l:1}}t.sort(function(a,b){return a.f-b.f}),t.push({s:-1,f:25001});var l=t[0],r=t[1],i0=0,i1=1,i22=2;for(t[0]={s:-1,f:l.f+r.f,l,r};i1!=s-1;)l=t[t[i0].f<t[i22].f?i0++:i22++],r=t[i0!=i1&&t[i0].f<t[i22].f?i0++:i22++],t[i1++]={s:-1,f:l.f+r.f,l,r};for(var maxSym=t2[0].s,i2=1;i2<s;++i2)t2[i2].s>maxSym&&(maxSym=t2[i2].s);var tr=new u16(maxSym+1),mbt=ln(t[i1-1],tr,0);if(mbt>mb){var i2=0,dt=0,lft=mbt-mb,cst=1<<lft;for(t2.sort(function(a,b){return tr[b.s]-tr[a.s]||a.f-b.f});i2<s;++i2){var i2_1=t2[i2].s;if(tr[i2_1]>mb)dt+=cst-(1<<mbt-tr[i2_1]),tr[i2_1]=mb;else break}for(dt>>=lft;dt>0;){var i2_2=t2[i2].s;tr[i2_2]<mb?dt-=1<<mb-tr[i2_2]++-1:++i2}for(;i2>=0&&dt;--i2){var i2_3=t2[i2].s;tr[i2_3]==mb&&(--tr[i2_3],++dt)}mbt=mb}return{t:new u8(tr),l:mbt}},ln=function(n,l,d){return n.s==-1?Math.max(ln(n.l,l,d+1),ln(n.r,l,d+1)):l[n.s]=d},lc=function(c){for(var s=c.length;s&&!c[--s];);for(var cl=new u16(++s),cli=0,cln=c[0],cls=1,w=function(v){cl[cli++]=v},i2=1;i2<=s;++i2)if(c[i2]==cln&&i2!=s)++cls;else{if(!cln&&cls>2){for(;cls>138;cls-=138)w(32754);cls>2&&(w(cls>10?cls-11<<5|28690:cls-3<<5|12305),cls=0)}else if(cls>3){for(w(cln),--cls;cls>6;cls-=6)w(8304);cls>2&&(w(cls-3<<5|8208),cls=0)}for(;cls--;)w(cln);cls=1,cln=c[i2]}return{c:cl.subarray(0,cli),n:s}},clen=function(cf,cl){for(var l=0,i2=0;i2<cl.length;++i2)l+=cf[i2]*cl[i2];return l},wfblk=function(out,pos,dat){var s=dat.length,o=shft(pos+2);out[o]=s&255,out[o+1]=s>>8,out[o+2]=out[o]^255,out[o+3]=out[o+1]^255;for(var i2=0;i2<s;++i2)out[o+i2+4]=dat[i2];return(o+4+s)*8},wblk=function(dat,out,final,syms,lf,df,eb,li,bs,bl,p){wbits(out,p++,final),++lf[256];for(var _a2=hTree(lf,15),dlt=_a2.t,mlb=_a2.l,_b2=hTree(df,15),ddt=_b2.t,mdb=_b2.l,_c=lc(dlt),lclt=_c.c,nlc=_c.n,_d=lc(ddt),lcdt=_d.c,ndc=_d.n,lcfreq=new u16(19),i2=0;i2<lclt.length;++i2)++lcfreq[lclt[i2]&31];for(var i2=0;i2<lcdt.length;++i2)++lcfreq[lcdt[i2]&31];for(var _e=hTree(lcfreq,7),lct=_e.t,mlcb=_e.l,nlcc=19;nlcc>4&&!lct[clim[nlcc-1]];--nlcc);var flen=bl+5<<3,ftlen=clen(lf,flt)+clen(df,fdt)+eb,dtlen=clen(lf,dlt)+clen(df,ddt)+eb+14+3*nlcc+clen(lcfreq,lct)+2*lcfreq[16]+3*lcfreq[17]+7*lcfreq[18];if(bs>=0&&flen<=ftlen&&flen<=dtlen)return wfblk(out,p,dat.subarray(bs,bs+bl));var lm,ll,dm,dl;if(wbits(out,p,1+(dtlen<ftlen)),p+=2,dtlen<ftlen){lm=hMap(dlt,mlb,0),ll=dlt,dm=hMap(ddt,mdb,0),dl=ddt;var llm=hMap(lct,mlcb,0);wbits(out,p,nlc-257),wbits(out,p+5,ndc-1),wbits(out,p+10,nlcc-4),p+=14;for(var i2=0;i2<nlcc;++i2)wbits(out,p+3*i2,lct[clim[i2]]);p+=3*nlcc;for(var lcts=[lclt,lcdt],it=0;it<2;++it)for(var clct=lcts[it],i2=0;i2<clct.length;++i2){var len=clct[i2]&31;wbits(out,p,llm[len]),p+=lct[len],len>15&&(wbits(out,p,clct[i2]>>5&127),p+=clct[i2]>>12)}}else lm=flm,ll=flt,dm=fdm,dl=fdt;for(var i2=0;i2<li;++i2){var sym=syms[i2];if(sym>255){var len=sym>>18&31;wbits16(out,p,lm[len+257]),p+=ll[len+257],len>7&&(wbits(out,p,sym>>23&31),p+=fleb[len]);var dst=sym&31;wbits16(out,p,dm[dst]),p+=dl[dst],dst>3&&(wbits16(out,p,sym>>5&8191),p+=fdeb[dst])}else wbits16(out,p,lm[sym]),p+=ll[sym]}return wbits16(out,p,lm[256]),p+ll[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(dat,lvl,plvl,pre,post,st){var s=st.z||dat.length,o=new u8(pre+s+5*(1+Math.ceil(s/7e3))+post),w=o.subarray(pre,o.length-post),lst=st.l,pos=(st.r||0)&7;if(lvl){pos&&(w[0]=st.r>>3);for(var opt=deo[lvl-1],n=opt>>13,c=opt&8191,msk_1=(1<<plvl)-1,prev=st.p||new u16(32768),head=st.h||new u16(msk_1+1),bs1_1=Math.ceil(plvl/3),bs2_1=2*bs1_1,hsh=function(i3){return(dat[i3]^dat[i3+1]<<bs1_1^dat[i3+2]<<bs2_1)&msk_1},syms=new i32(25e3),lf=new u16(288),df=new u16(32),lc_1=0,eb=0,i2=st.i||0,li=0,wi=st.w||0,bs=0;i2+2<s;++i2){var hv=hsh(i2),imod=i2&32767,pimod=head[hv];if(prev[imod]=pimod,head[hv]=imod,wi<=i2){var rem=s-i2;if((lc_1>7e3||li>24576)&&(rem>423||!lst)){pos=wblk(dat,w,0,syms,lf,df,eb,li,bs,i2-bs,pos),li=lc_1=eb=0,bs=i2;for(var j=0;j<286;++j)lf[j]=0;for(var j=0;j<30;++j)df[j]=0}var l=2,d=0,ch_1=c,dif=imod-pimod&32767;if(rem>2&&hv==hsh(i2-dif))for(var maxn=Math.min(n,rem)-1,maxd=Math.min(32767,i2),ml=Math.min(258,rem);dif<=maxd&&--ch_1&&imod!=pimod;){if(dat[i2+l]==dat[i2+l-dif]){for(var nl=0;nl<ml&&dat[i2+nl]==dat[i2+nl-dif];++nl);if(nl>l){if(l=nl,d=dif,nl>maxn)break;for(var mmd=Math.min(dif,nl-2),md=0,j=0;j<mmd;++j){var ti=i2-dif+j&32767,pti=prev[ti],cd=ti-pti&32767;cd>md&&(md=cd,pimod=ti)}}}imod=pimod,pimod=prev[imod],dif+=imod-pimod&32767}if(d){syms[li++]=268435456|revfl[l]<<18|revfd[d];var lin=revfl[l]&31,din=revfd[d]&31;eb+=fleb[lin]+fdeb[din],++lf[257+lin],++df[din],wi=i2+l,++lc_1}else syms[li++]=dat[i2],++lf[dat[i2]]}}for(i2=Math.max(i2,wi);i2<s;++i2)syms[li++]=dat[i2],++lf[dat[i2]];pos=wblk(dat,w,lst,syms,lf,df,eb,li,bs,i2-bs,pos),lst||(st.r=pos&7|w[pos/8|0]<<3,pos-=7,st.h=head,st.p=prev,st.i=i2,st.w=wi)}else{for(var i2=st.w||0;i2<s+lst;i2+=65535){var e=i2+65535;e>=s&&(w[pos/8|0]=lst,e=s),pos=wfblk(w,pos+1,dat.subarray(i2,e))}st.i=s}return slc(o,0,pre+shft(pos)+post)},crct=(function(){for(var t=new Int32Array(256),i2=0;i2<256;++i2){for(var c=i2,k=9;--k;)c=(c&1&&-306674912)^c>>>1;t[i2]=c}return t})(),crc=function(){var c=-1;return{p:function(d){for(var cr=c,i2=0;i2<d.length;++i2)cr=crct[cr&255^d[i2]]^cr>>>8;c=cr},d:function(){return~c}}};var dopt=function(dat,opt,pre,post,st){if(!st&&(st={l:1},opt.dictionary)){var dict=opt.dictionary.subarray(-32768),newDat=new u8(dict.length+dat.length);newDat.set(dict),newDat.set(dat,dict.length),dat=newDat,st.w=dict.length}return dflt(dat,opt.level==null?6:opt.level,opt.mem==null?st.l?Math.ceil(Math.max(8,Math.min(13,Math.log(dat.length)))*1.5):20:12+opt.mem,pre,post,st)},mrg=function(a,b){var o={};for(var k in a)o[k]=a[k];for(var k in b)o[k]=b[k];return o};var wbytes=function(d,b,v){for(;v;++b)d[b]=v,v>>>=8};var Deflate=(function(){function Deflate2(opts,cb){if(typeof opts=="function"&&(cb=opts,opts={}),this.ondata=cb,this.o=opts||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u8(98304),this.o.dictionary){var dict=this.o.dictionary.subarray(-32768);this.b.set(dict,32768-dict.length),this.s.i=32768-dict.length}}return Deflate2.prototype.p=function(c,f){this.ondata(dopt(c,this.o,0,0,this.s),f)},Deflate2.prototype.push=function(chunk,final){this.ondata||err(5),this.s.l&&err(4);var endLen=chunk.length+this.s.z;if(endLen>this.b.length){if(endLen>2*this.b.length-32768){var newBuf=new u8(endLen&-32768);newBuf.set(this.b.subarray(0,this.s.z)),this.b=newBuf}var split=this.b.length-this.s.z;this.b.set(chunk.subarray(0,split),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(chunk.subarray(split),32768),this.s.z=chunk.length-split+32768,this.s.i=32766,this.s.w=32768}else this.b.set(chunk,this.s.z),this.s.z+=chunk.length;this.s.l=final&1,(this.s.z>this.s.w+8191||final)&&(this.p(this.b,final||!1),this.s.w=this.s.i,this.s.i-=2),final&&(this.s=this.o={},this.b=et)},Deflate2.prototype.flush=function(sync){if(this.ondata||err(5),this.s.l&&err(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,sync){var c=new u8(6);c[0]=this.s.r>>3;var ep=wfblk(c,this.s.r,et);this.s.r=0,this.ondata(c.subarray(0,ep>>3),!1)}},Deflate2})();var te=typeof TextEncoder<"u"&&new TextEncoder,td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}function strToU8(str,latin1){if(latin1){for(var ar_1=new u8(str.length),i2=0;i2<str.length;++i2)ar_1[i2]=str.charCodeAt(i2);return ar_1}if(te)return te.encode(str);for(var l=str.length,ar=new u8(str.length+(str.length>>1)),ai=0,w=function(v){ar[ai++]=v},i2=0;i2<l;++i2){if(ai+5>ar.length){var n=new u8(ai+8+(l-i2<<1));n.set(ar),ar=n}var c=str.charCodeAt(i2);c<128||latin1?w(c):c<2048?(w(192|c>>6),w(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|str.charCodeAt(++i2)&1023,w(240|c>>18),w(128|c>>12&63),w(128|c>>6&63),w(128|c&63)):(w(224|c>>12),w(128|c>>6&63),w(128|c&63))}return slc(ar,0,ai)}var dbf=function(l){return l==1?3:l<6?2:l==9?1:0};var exfl=function(ex){var le=0;if(ex)for(var k in ex){var l=ex[k].length;l>65535&&err(9),le+=l+4}return le},wzh=function(d,b,f,fn,u,c,ce,co){var fl2=fn.length,ex=f.extra,col=co&&co.length,exl=exfl(ex);wbytes(d,b,ce!=null?33639248:67324752),b+=4,ce!=null&&(d[b++]=20,d[b++]=f.os),d[b]=20,b+=2,d[b++]=f.flag<<1|(c<0&&8),d[b++]=u&&8,d[b++]=f.compression&255,d[b++]=f.compression>>8;var dt=new Date(f.mtime==null?Date.now():f.mtime),y=dt.getFullYear()-1980;if((y<0||y>119)&&err(10),wbytes(d,b,y<<25|dt.getMonth()+1<<21|dt.getDate()<<16|dt.getHours()<<11|dt.getMinutes()<<5|dt.getSeconds()>>1),b+=4,c!=-1&&(wbytes(d,b,f.crc),wbytes(d,b+4,c<0?-c-2:c),wbytes(d,b+8,f.size)),wbytes(d,b+12,fl2),wbytes(d,b+14,exl),b+=16,ce!=null&&(wbytes(d,b,col),wbytes(d,b+6,f.attrs),wbytes(d,b+10,ce),b+=14),d.set(fn,b),b+=fl2,exl)for(var k in ex){var exf=ex[k],l=exf.length;wbytes(d,b,+k),wbytes(d,b+2,l),d.set(exf,b+4),b+=4+l}return col&&(d.set(co,b),b+=col),b},wzf=function(o,b,c,d,e){wbytes(o,b,101010256),wbytes(o,b+8,c),wbytes(o,b+10,c),wbytes(o,b+12,d),wbytes(o,b+16,e)},ZipPassThrough=(function(){function ZipPassThrough2(filename){this.filename=filename,this.c=crc(),this.size=0,this.compression=0}return ZipPassThrough2.prototype.process=function(chunk,final){this.ondata(null,chunk,final)},ZipPassThrough2.prototype.push=function(chunk,final){this.ondata||err(5),this.c.p(chunk),this.size+=chunk.length,final&&(this.crc=this.c.d()),this.process(chunk,final||!1)},ZipPassThrough2})();var ZipDeflate=(function(){function ZipDeflate2(filename,opts){var _this=this;opts||(opts={}),ZipPassThrough.call(this,filename),this.d=new Deflate(opts,function(dat,final){_this.ondata(null,dat,final)}),this.compression=8,this.flag=dbf(opts.level)}return ZipDeflate2.prototype.process=function(chunk,final){try{this.d.push(chunk,final)}catch(e){this.ondata(e,null,final)}},ZipDeflate2.prototype.push=function(chunk,final){ZipPassThrough.prototype.push.call(this,chunk,final)},ZipDeflate2})();var Zip=(function(){function Zip2(cb){this.ondata=cb,this.u=[],this.d=1}return Zip2.prototype.add=function(file){var _this=this;if(this.ondata||err(5),this.d&2)this.ondata(err(4+(this.d&1)*8,0,1),null,!1);else{var f=strToU8(file.filename),fl_1=f.length,com=file.comment,o=com&&strToU8(com),u=fl_1!=file.filename.length||o&&com.length!=o.length,hl_1=fl_1+exfl(file.extra)+30;fl_1>65535&&this.ondata(err(11,0,1),null,!1);var header=new u8(hl_1);wzh(header,0,file,f,u,-1);var chks_1=[header],pAll_1=function(){for(var _i=0,chks_2=chks_1;_i<chks_2.length;_i++){var chk=chks_2[_i];_this.ondata(null,chk,!1)}chks_1=[]},tr_1=this.d;this.d=0;var ind_1=this.u.length,uf_1=mrg(file,{f,u,o,t:function(){file.terminate&&file.terminate()},r:function(){if(pAll_1(),tr_1){var nxt=_this.u[ind_1+1];nxt?nxt.r():_this.d=1}tr_1=1}}),cl_1=0;file.ondata=function(err2,dat,final){if(err2)_this.ondata(err2,dat,final),_this.terminate();else if(cl_1+=dat.length,chks_1.push(dat),final){var dd=new u8(16);wbytes(dd,0,134695760),wbytes(dd,4,file.crc),wbytes(dd,8,cl_1),wbytes(dd,12,file.size),chks_1.push(dd),uf_1.c=cl_1,uf_1.b=hl_1+cl_1+16,uf_1.crc=file.crc,uf_1.size=file.size,tr_1&&uf_1.r(),tr_1=1}else tr_1&&pAll_1()},this.u.push(uf_1)}},Zip2.prototype.end=function(){var _this=this;if(this.d&2){this.ondata(err(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){_this.d&1&&(_this.u.splice(-1,1),_this.e())},t:function(){}}),this.d=3},Zip2.prototype.e=function(){for(var bt=0,l=0,tl=0,_i=0,_a2=this.u;_i<_a2.length;_i++){var f=_a2[_i];tl+=46+f.f.length+exfl(f.extra)+(f.o?f.o.length:0)}for(var out=new u8(tl+22),_b2=0,_c=this.u;_b2<_c.length;_b2++){var f=_c[_b2];wzh(out,bt,f,f.f,f.u,-f.c-2,l,f.o),bt+=46+f.f.length+exfl(f.extra)+(f.o?f.o.length:0),l+=f.b}wzf(out,bt,this.u.length,tl,l),this.ondata(null,out,!0),this.d=2},Zip2.prototype.terminate=function(){for(var _i=0,_a2=this.u;_i<_a2.length;_i++){var f=_a2[_i];f.t()}this.d=2},Zip2})();function firstCampaignScenarioId(campaigns){let id=campaigns?.[0]?.definition?.graph?.nodes?.[0]?.scenario?.scenarioId;return typeof id=="string"?id:void 0}function featuredCardId(pack){let own=new Set(pack.cards.map(card=>card.id)),villainOf=scenarios=>{for(let scenario of scenarios){let id=scenario.villainCardId;if(typeof id=="string"&&own.has(id))return id}},firstOfType=type=>pack.cards.find(card=>card.type===type)?.id;if(pack.manifest.kind==="hero")return firstOfType("hero_identity");if(pack.manifest.kind==="house-rule"){let base=pack.manifest.languages?.base;return[...pack.files.keys()].sort().map(path=>parsePackCardImagePath(path)).find(picture=>picture!==void 0&&picture.lang===base)?.code}if(pack.manifest.kind==="campaign"){let scenarioId=firstCampaignScenarioId(pack.campaigns),scenario=(pack.scenarios??[]).find(one=>one.id===scenarioId),fromCampaign=scenario?villainOf([scenario]):void 0;if(fromCampaign)return fromCampaign}return villainOf(pack.scenarios??[])??firstOfType("villain")??firstOfType("main_scheme")??firstOfType("hero_identity")}function featuredImages(pack,cardId,images){let base=pack.manifest.languages?.base;if(!base)return[];if(pack.manifest.kind==="house-rule")return[packCardImagePath(base,cardId)].filter(path=>images.has(path));let type=pack.cards.find(card=>card.id===cardId)?.type,codes=[cardId];return type==="hero_identity"&&cardId.endsWith("a")&&codes.push(`${cardId.slice(0,-1)}b`),codes.map(code=>packCardImagePath(base,code)).filter(path=>images.has(path))}function buildPreview(pack,manifest=pack.manifest){let images=[...pack.files.keys()].filter(path=>parsePackCardImagePath(path)!==void 0).sort(),imageSet=new Set(images),cardId=featuredCardId(pack),featuredPaths=cardId?featuredImages(pack,cardId,imageSet):[],cover=typeof manifest.cover=="string"&&pack.files.has(manifest.cover)?manifest.cover:void 0;return{preview:{schema:PACK_PREVIEW_SCHEMA_VERSION,packId:manifest.id,version:manifest.version,...cardId?{featured:{cardId,images:featuredPaths}}:{},...cover?{cover}:{},images,...manifest.languages?{languages:manifest.languages}:{},cards:pack.cards,...(manifest.achievements?.length??0)>0?{achievements:manifest.achievements}:{},decks:[...pack.decks??[]].map(deck=>({id:deck.id,name:deck.name,identityCardId:deck.identityCardId,cards:deck.cards.map(entry=>({cardId:entry.cardId,quantity:entry.quantity}))}))},thumbFrom:cover??featuredPaths[0]}}var PackBuildError=class extends Error{constructor(issues){super(`pack is invalid:
1
+ import{campaignDefinitionsOf,dslFeatures,readPackInput,sha256Hex,validatePack}from"./chunk-2XS47E3T.js";import{PACK_PREVIEW_SCHEMA_VERSION,isSafePackPath,packCardImagePath,parsePackCardImagePath}from"./chunk-JYDEFRIZ.js";import{mkdirSync,readFileSync,readdirSync,statSync,writeFileSync,existsSync}from"node:fs";import{dirname,join,relative,sep}from"node:path";import{pathToFileURL}from"node:url";import{createRequire}from"module";var require2=createRequire("/"),_a,Worker,isMarkedAsUntransferable;try{_a=require2("worker_threads"),Worker=_a.Worker,isMarkedAsUntransferable=_a.isMarkedAsUntransferable}catch{}var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(eb,start){for(var b=new u16(31),i2=0;i2<31;++i2)b[i2]=start+=1<<eb[i2-1];for(var r=new i32(b[30]),i2=1;i2<30;++i2)for(var j=b[i2];j<b[i2+1];++j)r[j]=j-b[i2]<<5|i2;return{b,r}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;var _b=freb(fdeb,0),fd=_b.b,revfd=_b.r,rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>1|(i&21845)<<1,x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,rev[i]=((x&65280)>>8|(x&255)<<8)>>1;var x,i,hMap=(function(cd,mb,r){for(var s=cd.length,i2=0,l=new u16(mb);i2<s;++i2)cd[i2]&&++l[cd[i2]-1];var le=new u16(mb);for(i2=1;i2<mb;++i2)le[i2]=le[i2-1]+l[i2-1]<<1;var co;if(r){co=new u16(1<<mb);var rvb=15-mb;for(i2=0;i2<s;++i2)if(cd[i2])for(var sv=i2<<4|cd[i2],r_1=mb-cd[i2],v=le[cd[i2]-1]++<<r_1,m=v|(1<<r_1)-1;v<=m;++v)co[rev[v]>>rvb]=sv}else for(co=new u16(s),i2=0;i2<s;++i2)cd[i2]&&(co[i2]=rev[le[cd[i2]-1]++]>>15-cd[i2]);return co}),flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,flm=hMap(flt,9,0);var fdm=hMap(fdt,5,0);var shft=function(p){return(p+7)/8|0},slc=function(v,s,e){return(s==null||s<0)&&(s=0),(e==null||e>v.length)&&(e=v.length),new u8(v.subarray(s,e))};var ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(ind,msg,nt){var e=new Error(msg||ec[ind]);if(e.code=ind,Error.captureStackTrace&&Error.captureStackTrace(e,err),!nt)throw e;return e};var wbits=function(d,p,v){v<<=p&7;var o=p/8|0;d[o]|=v,d[o+1]|=v>>8},wbits16=function(d,p,v){v<<=p&7;var o=p/8|0;d[o]|=v,d[o+1]|=v>>8,d[o+2]|=v>>16},hTree=function(d,mb){for(var t=[],i2=0;i2<d.length;++i2)d[i2]&&t.push({s:i2,f:d[i2]});var s=t.length,t2=t.slice();if(!s)return{t:et,l:0};if(s==1){var v=new u8(t[0].s+1);return v[t[0].s]=1,{t:v,l:1}}t.sort(function(a,b){return a.f-b.f}),t.push({s:-1,f:25001});var l=t[0],r=t[1],i0=0,i1=1,i22=2;for(t[0]={s:-1,f:l.f+r.f,l,r};i1!=s-1;)l=t[t[i0].f<t[i22].f?i0++:i22++],r=t[i0!=i1&&t[i0].f<t[i22].f?i0++:i22++],t[i1++]={s:-1,f:l.f+r.f,l,r};for(var maxSym=t2[0].s,i2=1;i2<s;++i2)t2[i2].s>maxSym&&(maxSym=t2[i2].s);var tr=new u16(maxSym+1),mbt=ln(t[i1-1],tr,0);if(mbt>mb){var i2=0,dt=0,lft=mbt-mb,cst=1<<lft;for(t2.sort(function(a,b){return tr[b.s]-tr[a.s]||a.f-b.f});i2<s;++i2){var i2_1=t2[i2].s;if(tr[i2_1]>mb)dt+=cst-(1<<mbt-tr[i2_1]),tr[i2_1]=mb;else break}for(dt>>=lft;dt>0;){var i2_2=t2[i2].s;tr[i2_2]<mb?dt-=1<<mb-tr[i2_2]++-1:++i2}for(;i2>=0&&dt;--i2){var i2_3=t2[i2].s;tr[i2_3]==mb&&(--tr[i2_3],++dt)}mbt=mb}return{t:new u8(tr),l:mbt}},ln=function(n,l,d){return n.s==-1?Math.max(ln(n.l,l,d+1),ln(n.r,l,d+1)):l[n.s]=d},lc=function(c){for(var s=c.length;s&&!c[--s];);for(var cl=new u16(++s),cli=0,cln=c[0],cls=1,w=function(v){cl[cli++]=v},i2=1;i2<=s;++i2)if(c[i2]==cln&&i2!=s)++cls;else{if(!cln&&cls>2){for(;cls>138;cls-=138)w(32754);cls>2&&(w(cls>10?cls-11<<5|28690:cls-3<<5|12305),cls=0)}else if(cls>3){for(w(cln),--cls;cls>6;cls-=6)w(8304);cls>2&&(w(cls-3<<5|8208),cls=0)}for(;cls--;)w(cln);cls=1,cln=c[i2]}return{c:cl.subarray(0,cli),n:s}},clen=function(cf,cl){for(var l=0,i2=0;i2<cl.length;++i2)l+=cf[i2]*cl[i2];return l},wfblk=function(out,pos,dat){var s=dat.length,o=shft(pos+2);out[o]=s&255,out[o+1]=s>>8,out[o+2]=out[o]^255,out[o+3]=out[o+1]^255;for(var i2=0;i2<s;++i2)out[o+i2+4]=dat[i2];return(o+4+s)*8},wblk=function(dat,out,final,syms,lf,df,eb,li,bs,bl,p){wbits(out,p++,final),++lf[256];for(var _a2=hTree(lf,15),dlt=_a2.t,mlb=_a2.l,_b2=hTree(df,15),ddt=_b2.t,mdb=_b2.l,_c=lc(dlt),lclt=_c.c,nlc=_c.n,_d=lc(ddt),lcdt=_d.c,ndc=_d.n,lcfreq=new u16(19),i2=0;i2<lclt.length;++i2)++lcfreq[lclt[i2]&31];for(var i2=0;i2<lcdt.length;++i2)++lcfreq[lcdt[i2]&31];for(var _e=hTree(lcfreq,7),lct=_e.t,mlcb=_e.l,nlcc=19;nlcc>4&&!lct[clim[nlcc-1]];--nlcc);var flen=bl+5<<3,ftlen=clen(lf,flt)+clen(df,fdt)+eb,dtlen=clen(lf,dlt)+clen(df,ddt)+eb+14+3*nlcc+clen(lcfreq,lct)+2*lcfreq[16]+3*lcfreq[17]+7*lcfreq[18];if(bs>=0&&flen<=ftlen&&flen<=dtlen)return wfblk(out,p,dat.subarray(bs,bs+bl));var lm,ll,dm,dl;if(wbits(out,p,1+(dtlen<ftlen)),p+=2,dtlen<ftlen){lm=hMap(dlt,mlb,0),ll=dlt,dm=hMap(ddt,mdb,0),dl=ddt;var llm=hMap(lct,mlcb,0);wbits(out,p,nlc-257),wbits(out,p+5,ndc-1),wbits(out,p+10,nlcc-4),p+=14;for(var i2=0;i2<nlcc;++i2)wbits(out,p+3*i2,lct[clim[i2]]);p+=3*nlcc;for(var lcts=[lclt,lcdt],it=0;it<2;++it)for(var clct=lcts[it],i2=0;i2<clct.length;++i2){var len=clct[i2]&31;wbits(out,p,llm[len]),p+=lct[len],len>15&&(wbits(out,p,clct[i2]>>5&127),p+=clct[i2]>>12)}}else lm=flm,ll=flt,dm=fdm,dl=fdt;for(var i2=0;i2<li;++i2){var sym=syms[i2];if(sym>255){var len=sym>>18&31;wbits16(out,p,lm[len+257]),p+=ll[len+257],len>7&&(wbits(out,p,sym>>23&31),p+=fleb[len]);var dst=sym&31;wbits16(out,p,dm[dst]),p+=dl[dst],dst>3&&(wbits16(out,p,sym>>5&8191),p+=fdeb[dst])}else wbits16(out,p,lm[sym]),p+=ll[sym]}return wbits16(out,p,lm[256]),p+ll[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(dat,lvl,plvl,pre,post,st){var s=st.z||dat.length,o=new u8(pre+s+5*(1+Math.ceil(s/7e3))+post),w=o.subarray(pre,o.length-post),lst=st.l,pos=(st.r||0)&7;if(lvl){pos&&(w[0]=st.r>>3);for(var opt=deo[lvl-1],n=opt>>13,c=opt&8191,msk_1=(1<<plvl)-1,prev=st.p||new u16(32768),head=st.h||new u16(msk_1+1),bs1_1=Math.ceil(plvl/3),bs2_1=2*bs1_1,hsh=function(i3){return(dat[i3]^dat[i3+1]<<bs1_1^dat[i3+2]<<bs2_1)&msk_1},syms=new i32(25e3),lf=new u16(288),df=new u16(32),lc_1=0,eb=0,i2=st.i||0,li=0,wi=st.w||0,bs=0;i2+2<s;++i2){var hv=hsh(i2),imod=i2&32767,pimod=head[hv];if(prev[imod]=pimod,head[hv]=imod,wi<=i2){var rem=s-i2;if((lc_1>7e3||li>24576)&&(rem>423||!lst)){pos=wblk(dat,w,0,syms,lf,df,eb,li,bs,i2-bs,pos),li=lc_1=eb=0,bs=i2;for(var j=0;j<286;++j)lf[j]=0;for(var j=0;j<30;++j)df[j]=0}var l=2,d=0,ch_1=c,dif=imod-pimod&32767;if(rem>2&&hv==hsh(i2-dif))for(var maxn=Math.min(n,rem)-1,maxd=Math.min(32767,i2),ml=Math.min(258,rem);dif<=maxd&&--ch_1&&imod!=pimod;){if(dat[i2+l]==dat[i2+l-dif]){for(var nl=0;nl<ml&&dat[i2+nl]==dat[i2+nl-dif];++nl);if(nl>l){if(l=nl,d=dif,nl>maxn)break;for(var mmd=Math.min(dif,nl-2),md=0,j=0;j<mmd;++j){var ti=i2-dif+j&32767,pti=prev[ti],cd=ti-pti&32767;cd>md&&(md=cd,pimod=ti)}}}imod=pimod,pimod=prev[imod],dif+=imod-pimod&32767}if(d){syms[li++]=268435456|revfl[l]<<18|revfd[d];var lin=revfl[l]&31,din=revfd[d]&31;eb+=fleb[lin]+fdeb[din],++lf[257+lin],++df[din],wi=i2+l,++lc_1}else syms[li++]=dat[i2],++lf[dat[i2]]}}for(i2=Math.max(i2,wi);i2<s;++i2)syms[li++]=dat[i2],++lf[dat[i2]];pos=wblk(dat,w,lst,syms,lf,df,eb,li,bs,i2-bs,pos),lst||(st.r=pos&7|w[pos/8|0]<<3,pos-=7,st.h=head,st.p=prev,st.i=i2,st.w=wi)}else{for(var i2=st.w||0;i2<s+lst;i2+=65535){var e=i2+65535;e>=s&&(w[pos/8|0]=lst,e=s),pos=wfblk(w,pos+1,dat.subarray(i2,e))}st.i=s}return slc(o,0,pre+shft(pos)+post)},crct=(function(){for(var t=new Int32Array(256),i2=0;i2<256;++i2){for(var c=i2,k=9;--k;)c=(c&1&&-306674912)^c>>>1;t[i2]=c}return t})(),crc=function(){var c=-1;return{p:function(d){for(var cr=c,i2=0;i2<d.length;++i2)cr=crct[cr&255^d[i2]]^cr>>>8;c=cr},d:function(){return~c}}};var dopt=function(dat,opt,pre,post,st){if(!st&&(st={l:1},opt.dictionary)){var dict=opt.dictionary.subarray(-32768),newDat=new u8(dict.length+dat.length);newDat.set(dict),newDat.set(dat,dict.length),dat=newDat,st.w=dict.length}return dflt(dat,opt.level==null?6:opt.level,opt.mem==null?st.l?Math.ceil(Math.max(8,Math.min(13,Math.log(dat.length)))*1.5):20:12+opt.mem,pre,post,st)},mrg=function(a,b){var o={};for(var k in a)o[k]=a[k];for(var k in b)o[k]=b[k];return o};var wbytes=function(d,b,v){for(;v;++b)d[b]=v,v>>>=8};var Deflate=(function(){function Deflate2(opts,cb){if(typeof opts=="function"&&(cb=opts,opts={}),this.ondata=cb,this.o=opts||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u8(98304),this.o.dictionary){var dict=this.o.dictionary.subarray(-32768);this.b.set(dict,32768-dict.length),this.s.i=32768-dict.length}}return Deflate2.prototype.p=function(c,f){this.ondata(dopt(c,this.o,0,0,this.s),f)},Deflate2.prototype.push=function(chunk,final){this.ondata||err(5),this.s.l&&err(4);var endLen=chunk.length+this.s.z;if(endLen>this.b.length){if(endLen>2*this.b.length-32768){var newBuf=new u8(endLen&-32768);newBuf.set(this.b.subarray(0,this.s.z)),this.b=newBuf}var split=this.b.length-this.s.z;this.b.set(chunk.subarray(0,split),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(chunk.subarray(split),32768),this.s.z=chunk.length-split+32768,this.s.i=32766,this.s.w=32768}else this.b.set(chunk,this.s.z),this.s.z+=chunk.length;this.s.l=final&1,(this.s.z>this.s.w+8191||final)&&(this.p(this.b,final||!1),this.s.w=this.s.i,this.s.i-=2),final&&(this.s=this.o={},this.b=et)},Deflate2.prototype.flush=function(sync){if(this.ondata||err(5),this.s.l&&err(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,sync){var c=new u8(6);c[0]=this.s.r>>3;var ep=wfblk(c,this.s.r,et);this.s.r=0,this.ondata(c.subarray(0,ep>>3),!1)}},Deflate2})();var te=typeof TextEncoder<"u"&&new TextEncoder,td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}function strToU8(str,latin1){if(latin1){for(var ar_1=new u8(str.length),i2=0;i2<str.length;++i2)ar_1[i2]=str.charCodeAt(i2);return ar_1}if(te)return te.encode(str);for(var l=str.length,ar=new u8(str.length+(str.length>>1)),ai=0,w=function(v){ar[ai++]=v},i2=0;i2<l;++i2){if(ai+5>ar.length){var n=new u8(ai+8+(l-i2<<1));n.set(ar),ar=n}var c=str.charCodeAt(i2);c<128||latin1?w(c):c<2048?(w(192|c>>6),w(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|str.charCodeAt(++i2)&1023,w(240|c>>18),w(128|c>>12&63),w(128|c>>6&63),w(128|c&63)):(w(224|c>>12),w(128|c>>6&63),w(128|c&63))}return slc(ar,0,ai)}var dbf=function(l){return l==1?3:l<6?2:l==9?1:0};var exfl=function(ex){var le=0;if(ex)for(var k in ex){var l=ex[k].length;l>65535&&err(9),le+=l+4}return le},wzh=function(d,b,f,fn,u,c,ce,co){var fl2=fn.length,ex=f.extra,col=co&&co.length,exl=exfl(ex);wbytes(d,b,ce!=null?33639248:67324752),b+=4,ce!=null&&(d[b++]=20,d[b++]=f.os),d[b]=20,b+=2,d[b++]=f.flag<<1|(c<0&&8),d[b++]=u&&8,d[b++]=f.compression&255,d[b++]=f.compression>>8;var dt=new Date(f.mtime==null?Date.now():f.mtime),y=dt.getFullYear()-1980;if((y<0||y>119)&&err(10),wbytes(d,b,y<<25|dt.getMonth()+1<<21|dt.getDate()<<16|dt.getHours()<<11|dt.getMinutes()<<5|dt.getSeconds()>>1),b+=4,c!=-1&&(wbytes(d,b,f.crc),wbytes(d,b+4,c<0?-c-2:c),wbytes(d,b+8,f.size)),wbytes(d,b+12,fl2),wbytes(d,b+14,exl),b+=16,ce!=null&&(wbytes(d,b,col),wbytes(d,b+6,f.attrs),wbytes(d,b+10,ce),b+=14),d.set(fn,b),b+=fl2,exl)for(var k in ex){var exf=ex[k],l=exf.length;wbytes(d,b,+k),wbytes(d,b+2,l),d.set(exf,b+4),b+=4+l}return col&&(d.set(co,b),b+=col),b},wzf=function(o,b,c,d,e){wbytes(o,b,101010256),wbytes(o,b+8,c),wbytes(o,b+10,c),wbytes(o,b+12,d),wbytes(o,b+16,e)},ZipPassThrough=(function(){function ZipPassThrough2(filename){this.filename=filename,this.c=crc(),this.size=0,this.compression=0}return ZipPassThrough2.prototype.process=function(chunk,final){this.ondata(null,chunk,final)},ZipPassThrough2.prototype.push=function(chunk,final){this.ondata||err(5),this.c.p(chunk),this.size+=chunk.length,final&&(this.crc=this.c.d()),this.process(chunk,final||!1)},ZipPassThrough2})();var ZipDeflate=(function(){function ZipDeflate2(filename,opts){var _this=this;opts||(opts={}),ZipPassThrough.call(this,filename),this.d=new Deflate(opts,function(dat,final){_this.ondata(null,dat,final)}),this.compression=8,this.flag=dbf(opts.level)}return ZipDeflate2.prototype.process=function(chunk,final){try{this.d.push(chunk,final)}catch(e){this.ondata(e,null,final)}},ZipDeflate2.prototype.push=function(chunk,final){ZipPassThrough.prototype.push.call(this,chunk,final)},ZipDeflate2})();var Zip=(function(){function Zip2(cb){this.ondata=cb,this.u=[],this.d=1}return Zip2.prototype.add=function(file){var _this=this;if(this.ondata||err(5),this.d&2)this.ondata(err(4+(this.d&1)*8,0,1),null,!1);else{var f=strToU8(file.filename),fl_1=f.length,com=file.comment,o=com&&strToU8(com),u=fl_1!=file.filename.length||o&&com.length!=o.length,hl_1=fl_1+exfl(file.extra)+30;fl_1>65535&&this.ondata(err(11,0,1),null,!1);var header=new u8(hl_1);wzh(header,0,file,f,u,-1);var chks_1=[header],pAll_1=function(){for(var _i=0,chks_2=chks_1;_i<chks_2.length;_i++){var chk=chks_2[_i];_this.ondata(null,chk,!1)}chks_1=[]},tr_1=this.d;this.d=0;var ind_1=this.u.length,uf_1=mrg(file,{f,u,o,t:function(){file.terminate&&file.terminate()},r:function(){if(pAll_1(),tr_1){var nxt=_this.u[ind_1+1];nxt?nxt.r():_this.d=1}tr_1=1}}),cl_1=0;file.ondata=function(err2,dat,final){if(err2)_this.ondata(err2,dat,final),_this.terminate();else if(cl_1+=dat.length,chks_1.push(dat),final){var dd=new u8(16);wbytes(dd,0,134695760),wbytes(dd,4,file.crc),wbytes(dd,8,cl_1),wbytes(dd,12,file.size),chks_1.push(dd),uf_1.c=cl_1,uf_1.b=hl_1+cl_1+16,uf_1.crc=file.crc,uf_1.size=file.size,tr_1&&uf_1.r(),tr_1=1}else tr_1&&pAll_1()},this.u.push(uf_1)}},Zip2.prototype.end=function(){var _this=this;if(this.d&2){this.ondata(err(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){_this.d&1&&(_this.u.splice(-1,1),_this.e())},t:function(){}}),this.d=3},Zip2.prototype.e=function(){for(var bt=0,l=0,tl=0,_i=0,_a2=this.u;_i<_a2.length;_i++){var f=_a2[_i];tl+=46+f.f.length+exfl(f.extra)+(f.o?f.o.length:0)}for(var out=new u8(tl+22),_b2=0,_c=this.u;_b2<_c.length;_b2++){var f=_c[_b2];wzh(out,bt,f,f.f,f.u,-f.c-2,l,f.o),bt+=46+f.f.length+exfl(f.extra)+(f.o?f.o.length:0),l+=f.b}wzf(out,bt,this.u.length,tl,l),this.ondata(null,out,!0),this.d=2},Zip2.prototype.terminate=function(){for(var _i=0,_a2=this.u;_i<_a2.length;_i++){var f=_a2[_i];f.t()}this.d=2},Zip2})();function firstCampaignScenarioId(campaigns){let id=campaigns?.[0]?.definition?.graph?.nodes?.[0]?.scenario?.scenarioId;return typeof id=="string"?id:void 0}function featuredCardId(pack){let own=new Set(pack.cards.map(card=>card.id)),villainOf=scenarios=>{for(let scenario of scenarios){let id=scenario.villainCardId;if(typeof id=="string"&&own.has(id))return id}},firstOfType=type=>pack.cards.find(card=>card.type===type)?.id;if(pack.manifest.kind==="hero")return firstOfType("hero_identity");if(pack.manifest.kind==="house-rule"){let base=pack.manifest.languages?.base;return[...pack.files.keys()].sort().map(path=>parsePackCardImagePath(path)).find(picture=>picture!==void 0&&picture.lang===base)?.code}if(pack.manifest.kind==="campaign"){let scenarioId=firstCampaignScenarioId(pack.campaigns),scenario=(pack.scenarios??[]).find(one=>one.id===scenarioId),fromCampaign=scenario?villainOf([scenario]):void 0;if(fromCampaign)return fromCampaign}return villainOf(pack.scenarios??[])??firstOfType("villain")??firstOfType("main_scheme")??firstOfType("hero_identity")}function featuredImages(pack,cardId,images){let base=pack.manifest.languages?.base;if(!base)return[];if(pack.manifest.kind==="house-rule")return[packCardImagePath(base,cardId)].filter(path=>images.has(path));let type=pack.cards.find(card=>card.id===cardId)?.type,codes=[cardId];return type==="hero_identity"&&cardId.endsWith("a")&&codes.push(`${cardId.slice(0,-1)}b`),codes.map(code=>packCardImagePath(base,code)).filter(path=>images.has(path))}function buildPreview(pack,manifest=pack.manifest){let images=[...pack.files.keys()].filter(path=>parsePackCardImagePath(path)!==void 0).sort(),imageSet=new Set(images),cardId=featuredCardId(pack),featuredPaths=cardId?featuredImages(pack,cardId,imageSet):[],cover=typeof manifest.cover=="string"&&pack.files.has(manifest.cover)?manifest.cover:void 0;return{preview:{schema:PACK_PREVIEW_SCHEMA_VERSION,packId:manifest.id,version:manifest.version,...cardId?{featured:{cardId,images:featuredPaths}}:{},...cover?{cover}:{},images,...manifest.languages?{languages:manifest.languages}:{},cards:pack.cards,...(manifest.achievements?.length??0)>0?{achievements:manifest.achievements}:{},decks:[...pack.decks??[]].map(deck=>({id:deck.id,name:deck.name,identityCardId:deck.identityCardId,cards:deck.cards.map(entry=>({cardId:entry.cardId,quantity:entry.quantity}))}))},thumbFrom:cover??featuredPaths[0]}}var PackBuildError=class extends Error{constructor(issues){super(`pack is invalid:
2
2
  ${issues.map(i2=>`${i2.path}: ${i2.message}`).join(`
3
3
  `)}`);this.issues=issues;this.name="PackBuildError"}issues},encoder=new TextEncoder,json=value=>encoder.encode(`${JSON.stringify(value,null,2)}
4
4
  `);function readJsonFiles(dir){return existsSync(dir)?readdirSync(dir).filter(name=>name.endsWith(".json")).sort().map(name=>JSON.parse(readFileSync(join(dir,name),"utf8"))):[]}function walkFiles(dir){if(!existsSync(dir))return[];let out=[];for(let name of readdirSync(dir).sort()){let full=join(dir,name);statSync(full).isDirectory()?out.push(...walkFiles(full)):out.push(full)}return out}var nativeImport=path=>import(pathToFileURL(path).href);async function loadPackSource(srcDir,options={}){let author=JSON.parse(readFileSync(join(srcDir,"pack.json"),"utf8")),cards=readJsonFiles(join(srcDir,"cards")),decks=readJsonFiles(join(srcDir,"decks")),scenarios=readJsonFiles(join(srcDir,"scenarios")),encounterSets=readJsonFiles(join(srcDir,"encounter-sets")),campaigns=readJsonFiles(join(srcDir,"campaigns")),abilities={},abilitiesEntry=join(srcDir,"abilities","index.ts");if(existsSync(abilitiesEntry)){let module=await(options.importModule??nativeImport)(abilitiesEntry);if(!module.default)throw new Error("abilities/index.ts must export a default ability registry");abilities=module.default}let assets=new Map;for(let root of["art","alt-art"])for(let full of walkFiles(join(srcDir,root)))assets.set(relative(srcDir,full).split(sep).join("/"),new Uint8Array(readFileSync(full)));for(let full of walkFiles(join(srcDir,"cards"))){let path=relative(srcDir,full).split(sep).join("/");path.includes("/",6)&&assets.set(path,new Uint8Array(readFileSync(full)))}for(let name of["CREDITS.md","PERMISSION.md"]){let full=join(srcDir,name);existsSync(full)&&assets.set(name,new Uint8Array(readFileSync(full)))}let cover=author.cover;if(typeof cover=="string"&&isSafePackPath(cover)&&!assets.has(cover)){let full=join(srcDir,...cover.split("/"));existsSync(full)&&statSync(full).isFile()&&assets.set(cover,new Uint8Array(readFileSync(full)))}return{author,cards,abilities,decks,scenarios,encounterSets,campaigns,assets}}var byCode=(a,b)=>a.id<b.id?-1:a.id>b.id?1:0;function assemblePack(source){let files=new Map,cards=[...source.cards].sort(byCode),abilities=Object.fromEntries(Object.entries(source.abilities).sort(([a],[b])=>a<b?-1:1)),decks=[...source.decks].sort((a,b)=>a.id<b.id?-1:1);files.set("data/cards.json",json(cards)),Object.keys(abilities).length>0&&files.set("data/abilities.json",json(abilities)),decks.length>0&&files.set("data/decks.json",json(decks)),source.scenarios.length>0&&files.set("data/scenarios.json",json(source.scenarios));let encounterSets=[...source.encounterSets??[]].sort((a,b)=>a.id<b.id?-1:1);encounterSets.length>0&&files.set("data/encounter-sets.json",json(encounterSets));let campaigns=source.campaigns??[];campaigns.length>0&&files.set("data/campaigns.json",json(campaigns));for(let[path,bytes]of source.assets)files.set(path,bytes);let listed=[...files.entries()].sort(([a],[b])=>a<b?-1:1).map(([path,bytes])=>({path,bytes:bytes.length,sha256:sha256Hex(bytes)})),{author}=source;return{manifest:{schema:1,id:author.id,version:author.version,kind:author.kind,name:author.name,authors:author.authors,description:author.description,requires:{app:author.requires.app,dslFeatures:dslFeatures(abilities,campaignDefinitionsOf(campaigns)),packs:author.requires.packs??[]},contents:{cards:"data/cards.json",...files.has("data/abilities.json")?{abilities:"data/abilities.json"}:{},...files.has("data/scenarios.json")?{scenarios:"data/scenarios.json"}:{},...files.has("data/decks.json")?{decks:"data/decks.json"}:{},...files.has("data/encounter-sets.json")?{encounterSets:"data/encounter-sets.json"}:{},...files.has("data/campaigns.json")?{campaigns:"data/campaigns.json"}:{}},...author.pictures?{pictures:author.pictures}:{},...author.languages?{languages:author.languages}:{},...author.altArt?{altArt:author.altArt}:{},...author.houseRule?{houseRule:author.houseRule}:{},...author.permission?{permission:author.permission}:{},...author.templateCredit?{templateCredit:author.templateCredit}:{},...author.translators?{translators:author.translators}:{},...author.cover!==void 0?{cover:author.cover}:{},...author.achievements?{achievements:author.achievements}:{},...author.tags?{tags:author.tags}:{},...author.wave!==void 0?{wave:author.wave}:{},...author.unlock!==void 0?{unlock:author.unlock}:{},files:listed,totalBytes:listed.reduce((sum,file)=>sum+file.bytes,0),license:author.license},files,cards,abilities,decks,scenarios:source.scenarios,...encounterSets.length>0?{encounterSets}:{},...campaigns.length>0?{campaigns}:{}}}var ZIP_EPOCH=new Date(1980,0,1,12);function zipPack(manifest,files){let chunks=[],failure,zip=new Zip((error,chunk)=>{error?failure=error:chunks.push(chunk)}),entries=[["pack.json",json(manifest)],...[...files.keys()].sort().map(path=>[path,files.get(path)])];for(let[path,bytes]of entries){let entry=new ZipDeflate(path,{level:6});entry.mtime=ZIP_EPOCH,zip.add(entry),entry.push(bytes,!0)}if(zip.end(),failure)throw failure;let out=new Uint8Array(chunks.reduce((n,c)=>n+c.length,0)),at=0;for(let chunk of chunks)out.set(chunk,at),at+=chunk.length;return out}async function buildPack(srcDir,outDir,options={}){let{importModule,...validateOptions}=options,source=await loadPackSource(srcDir,importModule?{importModule}:{}),pack=assemblePack(source),issues=validatePack(readPackInput(pack.manifest,pack.files),validateOptions);if(issues.length>0)throw new PackBuildError(issues);let write=(path,bytes)=>{let full=join(outDir,...path.split("/"));mkdirSync(dirname(full),{recursive:!0}),writeFileSync(full,bytes)};for(let[path,bytes]of pack.files)write(path,bytes);write("pack.json",json(pack.manifest));let zip=zipPack(pack.manifest,pack.files),zipPath=join(outDir,`${pack.manifest.id}-${pack.manifest.version}.zip`);write(`${pack.manifest.id}-${pack.manifest.version}.zip`,zip);let{preview,thumbFrom}=buildPreview(pack);return write("preview.json",json(preview)),thumbFrom&&write("thumb.webp",pack.files.get(thumbFrom)),{manifest:pack.manifest,zipPath,zipBytes:zip.length,zipSha256:sha256Hex(zip)}}export{PackBuildError,loadPackSource,assemblePack,zipPack,buildPack};
package/dist/import.js CHANGED
@@ -1 +1 @@
1
- import{formatImportReport,importMarvelCdbPack,registerMarvelCdbNormalizer}from"./chunks/chunk-WGWA34S6.js";import"./chunks/chunk-XHIDOSKF.js";import"./chunks/chunk-7MEEJH7D.js";import"./chunks/chunk-JZ4GBK6N.js";export{formatImportReport,importMarvelCdbPack,registerMarvelCdbNormalizer};
1
+ import{formatImportReport,importMarvelCdbPack,registerMarvelCdbNormalizer}from"./chunks/chunk-PB6KXNXP.js";import"./chunks/chunk-URLIN52M.js";import"./chunks/chunk-2XS47E3T.js";import"./chunks/chunk-JYDEFRIZ.js";export{formatImportReport,importMarvelCdbPack,registerMarvelCdbNormalizer};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{builtinGameDeps,validateBuiltinPack}from"./chunks/chunk-YO3NIZZE.js";import{PACK_ABILITY_ID,REQUIRED_PACK_FILES,SUPPORTED_DSL_FEATURES,campaignDefinitionsOf,checkPackCampaigns,definePackAbilities,dslFeatures,isPlainJson,isUnscriptedAbilityIssue,packCampaignsOf,publishIssues,readPackInput,sha256Hex,splitIssues,validatePack}from"./chunks/chunk-7MEEJH7D.js";import{campaignDepsWithPacks,campaignGameWithPacks,cardPoolWithPack,cardPoolWithPacks,customContentOfPacks,gameDepsWithPack,gameDepsWithPacks,packCampaignDefinitionOf,packCampaignDefinitions,packCampaignRecords,packEncounterSetRecords,packModularSetChoices,packScenarioRecords,scenarioWithPacks}from"./chunks/chunk-JSSYCHZB.js";import{ANY_ASPECT_CARD,ANY_NUMBER,ANY_RESOURCE,AOA_CAMPAIGN_DEFINITION,AOA_DEFEATED,AOA_MISSIONS,AOA_NOT_DEFEATED,AOA_OVERSEERS,AOA_PROTECT_THE_PROFESSOR,AOS_CAMPAIGN_DEFINITION,AS_DRONE,BUILTIN_PACKS,CAMPAIGNS,CAN_TAKE_THIS_ATTACK,COMMUNITY_DECK_AUTHORS,CORE_ABILITIES,CORE_BUILTIN_PACK,CORE_DEPS,CUSTOM_SCENARIO_FIELDS,ENCOUNTER_CARD,ENCOUNTER_CARD_CATEGORIES,ENCOUNTER_SIDE_SCHEME,ENGINE_ONLY_DSL_EXAMPLES,FRIENDLY_CHARACTER,GMW_BALANCED_FIELD,GMW_BALANCED_TOGGLES,GMW_CAMPAIGN_DEFINITION,INFINITES_GENE_POOL_THREAT_MAX,MOJO_CAMPAIGN_DEFINITION,MTS_CAMPAIGN_DEFINITION,NEXT_EVOL_CAMPAIGN_DEFINITION,NOT_READY_PACK_CODES,PAID_CARDS,PAID_IN_PLAY_CARDS,PLAYABLE_ABILITIES,PLAYABLE_DEPS,PLAYABLE_ENCOUNTER_SETS,PLAYABLE_SCENARIO_RECORDS,PLAYER_SIDE_SCHEME,RANDOM_VILLAIN,SHADOWLAND_CAMPAIGN_DEFINITION,SM_CAMPAIGN_DEFINITION,TEAM_UP_CARD,TRAIT,TRORS_CAMPAIGN_DEFINITION,UNSCRIPTED_ENCOUNTER_SET_IDS,VILLAIN_OR_VILLAINOUS,WAVE10_ABILITIES,WAVE10_BUILTIN_PACKS,WAVE10_CARDS,WAVE10_DEPS,WAVE10_GAME_ENCOUNTER_SETS,WAVE11_ABILITIES,WAVE11_BUILTIN_PACKS,WAVE11_CARDS,WAVE11_DEPS,WAVE11_GAME_ENCOUNTER_SETS,WAVE1_ABILITIES,WAVE1_BUILTIN_PACKS,WAVE1_DEPS,WAVE1_REPRINT_ABILITIES,WAVE2_ABILITIES,WAVE2_BUILTIN_PACKS,WAVE2_DEPS,WAVE2_REPRINT_ABILITIES,WAVE3_ABILITIES,WAVE3_BUILTIN_PACKS,WAVE3_CARDS,WAVE3_DEPS,WAVE3_REPRINT_ABILITIES,WAVE4_BUILTIN_PACKS,WAVE5_BUILTIN_PACKS,WAVE6_BUILTIN_PACKS,WAVE7_ABILITIES,WAVE7_BUILTIN_PACKS,WAVE7_CARDS,WAVE7_DEPS,WAVE8_ABILITIES,WAVE8_BUILTIN_PACKS,WAVE8_CARDS,WAVE8_DEPS,WAVE9_ABILITIES,WAVE9_BUILTIN_PACKS,WAVE9_CARDS,WAVE9_DEPS,YOUR_HERO,YOUR_IDENTITY,aDifferentCard,aScheme,abilitiesForCards,accelerationTokensOn,accusationWrongGuesses,accuse,accusedWrong,actingCharacter,action,activatesBeforeVillain,activatingEnemy,activationIs,activationOrderOf,addAccelerationToken,addCounters,addMainSchemeStageToVictoryDisplay,addToVictoryDisplay,addVillain,additionalAttackCost,additionalCostToPlay,additionalCostToReady,additionalPowerCost,additionalThwartCost,adjustBoostCount,advanceMainScheme,advanceToSetAsideVillain,after,afterNextCardPlayed,agile,allOf,allowUnlabeledAttack,alterEgoAction,alterEgoInterrupt,alterEgoResponse,amount,anAttackableEnemy,anEnemy,andThen,anyIn,anyNumberOfToughStatusCards,anyOf,anyOfCards,anyPlayerEliminated,applyAsBoostCard,applyRuleUntil,areaPlayersDefeated,assignDamage,atEndOfActivation,atEndOfAttack,atEndOfPhase,atEndOfRound,atEndOfThwart,atMost,attachCard,attachCost,attachInstruction,attack,attackAnEnemy,attackDamageDealt,attackExcessAsDealt,attackInProgress,attackInitiatedAgainst,attackPreventedAmount,attackPreventedTotal,attackResolvedLabeled,attackTarget,attackTotalAtk,attackUsedAtk,attackWasPrevented,attackableAsMinion,attackedBy,attackedPlayer,attackedThisPhase,attackingEnemy,attacksDealAdditionalDamage,attacksGainKeywords,attacksLoseKeywords,baseStatOf,baseStatsFromYourHero,basicPowerBy,basicPowerCost,basicPowerIs,basicPowerStatIs,basicThwartOnlyAgainst,basicThwartsIgnore,bindTargets,blankTextBoxForPlayers,blankTextBoxUntil,blanksTextBox,boost,boostAreaIconsOn,boostCardOf,boostCardsFromSet,boostIconsCount,boostIconsOn,buildScenarioDeck,buildWave11Scenario,builtinPackProblems,campaignDefinitionOf,campaignDefinitionProblems,campaignInstructionsOf,campaignLogAtLeast,campaignLogCardCounter,campaignLogCardRecorded,campaignLogCards,campaignLogHas,campaignLogIsSet,campaignLogValue,campaignModularPickProblem,canAttachTo,canAttachToCategory,canChangeForm,canEnterPlay,canFlip,canPayResources,canPlayFromHand,canRemoveThreatFrom,canSpendDifferentResources,canTakeStatus,canUseBasicPower,cancelBoostedActivation,cancelConsequentialDamage,cancelIt,cancelRevealedCard,cancelWhenRevealed,cannotActivate,cannotAttach,cannotBeAttachedUnlessInPlay,cannotBeCanceled,cannotBeDefeated,cannotBeHealed,cannotBeReadiedByPlayerCards,cannotChangeFormUntil,cannotChooseOption,cannotChooseToDiscard,cannotEnterPlay,cannotFlip,cannotHaveStatus,cannotLeavePlay,cannotMakeBasicAttacks,cannotReadyUntil,cannotRecover,cannotResolveTriggeredAbilities,cannotThwart,cardIdsIn,cards,cardsFrom,cardsOfComposedSets,centralMainScheme,changeAdditionalForm,changeForm,changeFormCost,changeToHeroFormNamed,changeToHeroFormWithTrait,changeToOtherHeroForm,changeVillainForm,characterDidThisPhase,checkModularPickCount,checkPlayableDifficultySets,choiceFoundNothing,chooseCardCost,chooseCardType,chooseCards,chooseEncounterCardType,chooseGroup,chooseMainSchemeStages,chooseNumber,chooseOne,chooseOneBy,chooseOptions,choosePlayer,chooseTarget,chooseTargetCost,chosen,chosenGroup,chosenModularSetIds,chosenPlayer,chosenVillain,civilWarGameModes,civilWarModularSets,civilWarSidesOffer,communityDeckUrl,communityDecks,competitiveOnly,competitiveOnlyTexts,completeMainScheme,confuse,consideredToHaveHitPoints,consideredToHaveResourceIcon,constant,controllerOf2 as controllerOf,coreScenario,costIf,costModifier,costsPayableByAnyPlayer,countAmong,countBoostIcons,countOf,countTowardStartingHand,counterLimit,countersAsResource,countersOn,countsAs,coveredByEngineRule,createGameArea,createScenarioArea,createScenarioPlayArea,customContentProblems,customModularPickProblem,customModularSetChoices,customScenarioProblems,damageAnEnemy,damageCardsCost,damageOn,damageSharedVillain,damageThisCardCost,damagedAtLeast,dealAsEncounterCard,dealDamage,dealDamageCost,dealDamageToChosenCost,dealEncounterCard,dealEncounterCardsCost,dealEncounterCardsToChosenPlayerCost,dealHiddenPiles,dealIndirectDamage,dealPoolOneAtATime,dealtEncounterCards,dealtEncounterCount,deckCountOf,deckDiscardIconsCount,declareDefender,defeat,defeatExcessDamage,defeatedWithExcessConsequentialDamage,defeatedWithExcessDamage,defeatingPlayer,defenderDefForAttack,defendingCharacter,defendsWithoutExhausting,defineAbilities,defineBuiltinPack,detach,difficultySetAlternativesFor,discard,discardAtRandom,discardBoostCard,discardCardsCost,discardChosenFromEncounterDeckCost,discardDeckUntil,discardEncounterCards,discardEncounterUntil,discardFacedownBoostCards,discardFromHand,discardFromHandCombinedCost,discardFromHandCost,discardRandomFromHandCost,discardStatusCost,discardStatusesTokensAndAttachments,discardThis,discardTopOfDeckCost,discardTopOfEncounterDeckCost,discardTuckedCost,discardUpToTopOfDeckCost,distinctAspectsOf,distinctTraitsOf,divide,doesNotExhaustToDefend,doubleDamageTaken,doubleNextCardSpent,doubleStat,doublesResourcesGeneratedForThisCard,doublesResourcesWhilePayingFor,draw,drawUpTo,droneFromDeck,duringPlayerPhase,duringTurnOf,duringVillainPhaseStepOne,each,eachGroupInPod,eachPlayer,eachPlayerCost,eachTimeUntil,eitherCost,encounterCard,encounterCards,encounterCardsOf,encounterIconsInPlay,encounterLookDiscardCost,encounterSetAside,encounterSetOf,endGame,enemyActivates,enemyAttack,enemyAttacksEnemy,enemyAttacksYouCost,enemyCanAttackAnother,enemyLeader,enemyScheme,enemyTeam,enemyTeamChooses,enemyToAttack,engage,engagedPlayerOf,engineOnlyDslProblems,entersPlayExhausted,eventAmount,eventDamageTaken,eventDamageTakenBy,eventDealt,eventKindIs,eventPlayer,eventResult,eventSource,eventSourceEnemy,eventTarget,eventTargetsTogether,exactlyDefeated,exactlyDefeatedByPower,excludedFromAllyLimit,excludedFromPlayerSideSchemeLimit,exhaust,exhaustCardsCost,exhaustEachCost,exhaustThis,exhaustYourHero,exists,expertSetReplaceable,extraBoostCardsForVillain,faceNamed,fieldsIn,finalStep,find,findCard,firstAttackThisTurn,firstPlayer,firstPlayerAction,firstPlayerPicksFromHand,firstRevealGainsSurge,firstThisRound,flatten,flipCard,flipThis,focusedMainScheme,forAnIdentityNotInThisGame,forEachCard,forEachPlayer,forEachPlayerInChosenOrder,forcedAction,forcedInterrupt,forcedResponse,formChangeCost,friendlyCharacterAttacks,fromAnyAspect,gainFromHiddenPile,gainKeywordUntil,gainTraitUntil,gainTraitsOfUntil,gainsAbility,gainsIcon,gainsKeyword,gainsKeywordX,gainsKeywordsOf,gainsTrait,gainsTraitsOf,gameAreasSplit,genePoolThreatOffer,generatesAmount,generatesPerCard,gets,giveBasicPowerBoostCard,giveBoostCard,giveBoostCardsCost,giveHeldBoostCard,giveStatus,giveStatusCost,giveTough,gmwBalancedHiddenFields,grantAdditionalMulligans,grantOwnedCards,grantedTo,grantingCard,grantsPreparation,groupPlayerCount,handCountOf,handSizeOf,hasAttachment,hasNamedResource,hasPrintedBoostAbility,hasStatus,hasTaggedAbility,hasTrait,heal,healCost,healYourIdentityCost,heroAction,heroInterrupt,heroNoCharacterIsTitledAs,heroResource,heroResponse,hiddenPileCount,highestStatAmong,hitPointsOf,holdMinion,horsemanSidesOffer,host,identifyMole,identityOf,ifElse,ifThen,ignoreAbilities,ignoreBoost,ignoreBoostAbilities,ignoreBoostForThisAttack,ignores,ignoresRetaliate,inAdditionalForm,inCampaign,inCampaignLogField,inCompetitiveMode,inDiscard,inEncounterSet,inForm,inGroup,inHand,inMode,inPlay,inPlayAreaOf,inScenarioPlayArea,inVictoryDisplay,increaseDamage,increaseDamageTaken,increaseNextCardCost,infinitesGenePoolThreatRecommendation,instead,interrupt,isAlterEgo,isAttached,isBaseEncounterSetId,isBaseScenarioId,isConfused,isHero,isModularChoice,isNotReadyCard,isScenarioSpecificSet,isStunned,joinGameArea,keepsExhausted,lastPlayedThisRound,leavingPlayLoses,limitPerPaidCard,logCardList,logCardRef,logFlag,logNumber,logOption,logText,lookAt,lookAtAndRearrange,lookAtTopOfScenarioDeckThenPlace,loseKeywordUntil,loseTraitUntil,losesIcon,losesKeyword,made,mainSchemeAdvancedBy,mainSchemeMarkedBy,mainSchemePicksOffer,mainSchemeStageGist,mainSchemeStageNumber,mainSchemeStagesOffer,mainSchemeStagesProblem,max,maxDamageTaken,maxOnePerTriggeringInstance,maxSustainedDamage,mayLookAtTopOfEncounterDeckUntil,mergeCosts,mergeRegistries,min,minDamageTaken,modifyAttack,modifyBasicPower,modifyCardEffect,modifyCardEffectsUntil,modifyConsequentialDamage,modifyStat,modifyStatOf,modifyThwart,modularPickCountProblem,modularPickCountRange,modularPickProblem,modularSetContents,mojoCheckedOffSets,mojoModularSetPicks,mostCommonHandTypeCount,moveActiveCounterToNextInRow,moveActiveCounterToNextVillain,moveBoostCards,moveCards,moveCardsInto,moveCounters,moveThreat,multiplyStat,named,namedByTeamUpOf,nextAfter,not,notCountedTowardHandSize,notMatching,notOfChosenCardType,obligation,ofChosenCardType,ofClassification,ofIdentitySetTitled,ofTeamUpSet,offersEasierStart,offersGenePoolThreat,on,onChosenMainScheme,oncePerPaidCard,oncePerPhase,oncePerPhasePerEventPlayer,oncePerRound,oncePerRoundPerPlayer,oneCopyOf,onlyCharacterRemovesThreat,onlySourceRemovesThreat,onlyThwartsRemoveThreat,opsOfKind,option,otherFaceOf,otherPlayers,outsideFact,overpaidWhenPlayed,ownScriptsOf,ownerOf,packScenarioOffer,paidCards,paidInPlayCards,paidType,paidTypeCount,paidUsingResourceFrom,paidWith,paidWithCard,paidWithOnly,paidWithResourceCard,pairCards,pairLimit,partOf,passEncounterCard,payPrintedCostOf,payingFor,perHero,placeCountersCost,placeDamage,placeOnTopOrBottom,placeOnTopOrBottomOfPlayerDeck,placeThreat,placeThreatOnSharedScheme,playFromDeckIgnoringCost,playFromDeckReducingCost,playFromHandIgnoringCost,playFromHandReducingCost,playFromSeparateDeck,playNote,playOnlyIf,playSetAside,playTuckedCard,playWithTopOfDeckFaceup,playWithTopOfEncounterDeckFaceup,playableAttachments,playableScenario,playableScenarioOffer,playableScenarioWithCustom,playableStarterDeckSetup,playableTopOfDeck,playableTucked,playedThisPhase,playedThisRound,playedThisTurn,playedVia,playerOrElse,playersCannotDiscard,playersWhere,preparation,preventAllDamageTo,preventConsequentialDamage,preventDamage,preventThreat,printedBoostAreaIconsOn,printedCostAtLeast,printedCostOf,printedForm,printedHpNumeralOf,printedHpOf,printedResourcesInHandAs,printedResourcesOf,printedStatOf,printsAbility,product,putIntoPlay,putIntoPlayAsHost,putIntoPlayFacedown,putIntoPlayFromSetAside,putLinkedAllyIntoPlay,putMainSchemeStageIntoPlay,query,raiseMoment,randomCivilWarScenario,reachableFromPod,reaching,readsAtkOf,readsPaymentTypesOf,ready,readyCardsCost,recordInCampaignLog,reduceCostOfCards,reduceCostToPlay,reduceDamage,reduceDamageTo,reduceNextCardCost,reducesAttackDamageTaken,refCount,refMatches,remainingHpCompare,remainingHpOf,removeAccelerationToken,removeAllCounters,removeAllCountersFrom,removeAnAccelerationToken,removeCounter,removeCountersAmong,removeCountersFrom,removeEachCounterFrom,removeFromCampaign,removeMainSchemeStage,removeMainSchemeStages,removeStatus,removeThreat,removeThreatCost,removeThreatFromAScheme,removeThreatFromChosenCost,removeThreatUpToCost,removeUpToCounters,removeVillain,removedFromGameCards,reorderCards,repeatTimes,repeatWhile,replaceAttachHost,replaceBoostCount,replaceLeaveDestination,replaceNextVillainPhaseWithPlayerPhase,replaceStatus,replaceTuckHost,reportFact,resetHitPoints,resolveAttackAgainst,resolveBoostAbilitiesOf,resolveForcedInterruptOf,resolveForcedResponseCost,resolveForcedResponseOf,resolveModes,resolveOneTagged,resolvePreparationsOf,resolveSetups,resolveSpecialCost,resolveSpecials,resolveSpecialsOf,resolveTagged,resolveWhenDefeatedOf,resolveWhenRevealedOf,resource,resourceTypesOf,resourcesGeneratedAsWild,resourcesPaidBy,response,restrictedLimit,retargetAttack,retargetPlayerAttack,returnEachToHandCost,returnToHandAfterResolving,returnToHandCost,revealCard,revealEncounterCard,revealFromSetAsideModularSet,revealHeldMinion,revealHiddenPile,revealInstead,revealMainSchemeStage,revealNextVillainStage,revealSetAside,revealTopOfScenarioDeck,revealTopOfSeparateDeck,revealedFromEncounterDeck,revealedPileCardCount,rotateEngagement,rule,sameClassificationAs,scaled,scenarioArea,scenarioAreaCount,scenarioDeck,scenarioGameSetIds,scenarioSideClause,scenarioWithVillain,schemeStartedByAttackBoost,schemeThreatOn,searchAndReveal,searchCollection,searchEncounterIntoPlayCost,seedHiddenPiles,selectCards,self,sentence,separateDeckCards,separateDeckCountOf,setActiveVillain,setAside,setAsideDestination,setAsideModularSetCount,setDefeatDestination,setRemainingHitPoints,setVar,setVillainAside,setVillainSide,setup,sharesTitleWith,sharesTraitWith,sharesTraitWithHeroOf,shuffleDeck,shuffleEncounterDeck,shuffleInSetAsideModularSet,shuffleIntoSeparateDeck,shuffleMainSchemeStageGroup,shuffleMainSchemeStages,shuffleSeparateDeck,shuffleTopOfSeparateDeckIntoEncounterDeck,sitOut,skipNextVillainPhase,skippedCommunityDecks,skirmishOffer,special,spend,spendChosen,spendDifferentResources,spendEqualTo,spendPrinted,spendResources,spendSameType,spendUpTo,spendX,spendXResources,spendableForAnyPlayer,spendableForPlayersWhere,spendableFromTucked,standardSetReplaceable,starIconsOn,starterDeckSetup,statCompare,statOf,stateCheck,stateCheckFromEntering,statusCount,statusLimit,staysInHand,stillCountedByDiscarder,stun,sum,superlative,superlativePlayer,surge,swapCards,swapIdentity,swapMainScheme,swapVillain,swapVillainByTrait,tagged,taggedAbilitiesOn,takeAnyDamageCost,takeControl,takeDamage,takeDamageCost,takeIndirectDamageCost,takeIntoHand,takesConsequentialDamage,takesDamageOnlyFrom,takesDamageOnlyFromAttacks,takesFirstTurn,teamUpCharacter,teamUpCharacters,textBoxCannotBeBlanked,thatAttackGainsKeywords,thatPlayer,theAccused,theAffectedCard,theMainScheme,theMole,theVillain,thisCardGenerates,thisGroup,threatAtLeast,threatOn,thwart,thwartAScheme,thwartInProgress,thwartTarget,titled,toScenarioDeck,topOfDeck,topOfDeckIsFaceup,topOfDeckMatches,topOfEncounterDeckIsFaceup,topOfEncounterDeckMatches,topOfEncounterDeckShowsIcons,topOfEncounterDeckShowsNoIcons,topOfYourDeckHas,totalPrintedCost,totalPrintedResources,totalStatOf,traitEncounterDeck,traitNumber,treatAsAlly,treatAsMinion,treatAttachedAllyAsMinion,treatAttachedHeroAsMinion,treatAttachedMinionAsAlly,treatAttachedVillainAsMinion,treatSelfAsAlly,tuckCards,tuckLimit,tuckedCount,tuckedUnder,tuckedUnderRef,turnFacedown,uncancellable,undefendedAttack,upgradesCannotBeRemoved,useThwInsteadOfAtk,usingBasicPower,validateDefinition,valueAtLeast,valueAtMost,valueEquals,varAtLeast,varFor,varOf,victoryCondition,victoryDisplayCards,victoryDisplayCount,villainChoiceOf,villainChoiceOffer,villainOnSide,villainOptionOf,villainStageNumberOf,wave10Scenario,wave10StarterDeckSetup,wave11Scenario,wave11ScenarioRecord,wave11StarterDeckSetup,wave1ReprintPairs,wave1Scenario,wave1StarterDeckSetup,wave2ReprintPairs,wave2Scenario,wave2StarterDeckSetup,wave3ReprintPairs,wave3Scenario,wave3StarterDeckSetup,wave7Scenario,wave7StarterDeckSetup,wave8Scenario,wave8StarterDeckSetup,wave9Scenario,wave9StarterDeckSetup,when,whenCompleted,whenDefeated,whenRevealed,whenRevealedAlterEgo,whenRevealedHero,whenSpentGenerate,whileOnChosenMainScheme,whileTucked,withFewestCounters,withModularSetContents,withMostCounters,you,youAre,youAreNamed,youHaveTrait,yourIdentity,yourLeader,yourMainScheme,yourTeam,zone,zoneCountOf}from"./chunks/chunk-JZ4GBK6N.js";export{ANY_ASPECT_CARD,ANY_NUMBER,ANY_RESOURCE,AOA_CAMPAIGN_DEFINITION,AOA_DEFEATED,AOA_MISSIONS,AOA_NOT_DEFEATED,AOA_OVERSEERS,AOA_PROTECT_THE_PROFESSOR,AOS_CAMPAIGN_DEFINITION,AS_DRONE,BUILTIN_PACKS,CAMPAIGNS,CAN_TAKE_THIS_ATTACK,COMMUNITY_DECK_AUTHORS,CORE_ABILITIES,CORE_BUILTIN_PACK,CORE_DEPS,CUSTOM_SCENARIO_FIELDS,ENCOUNTER_CARD,ENCOUNTER_CARD_CATEGORIES,ENCOUNTER_SIDE_SCHEME,ENGINE_ONLY_DSL_EXAMPLES,FRIENDLY_CHARACTER,GMW_BALANCED_FIELD,GMW_BALANCED_TOGGLES,GMW_CAMPAIGN_DEFINITION,INFINITES_GENE_POOL_THREAT_MAX,MOJO_CAMPAIGN_DEFINITION,MTS_CAMPAIGN_DEFINITION,NEXT_EVOL_CAMPAIGN_DEFINITION,NOT_READY_PACK_CODES,PACK_ABILITY_ID,PAID_CARDS,PAID_IN_PLAY_CARDS,PLAYABLE_ABILITIES,PLAYABLE_DEPS,PLAYABLE_ENCOUNTER_SETS,PLAYABLE_SCENARIO_RECORDS,PLAYER_SIDE_SCHEME,RANDOM_VILLAIN,REQUIRED_PACK_FILES,SHADOWLAND_CAMPAIGN_DEFINITION,SM_CAMPAIGN_DEFINITION,SUPPORTED_DSL_FEATURES,TEAM_UP_CARD,TRAIT,TRORS_CAMPAIGN_DEFINITION,UNSCRIPTED_ENCOUNTER_SET_IDS,VILLAIN_OR_VILLAINOUS,WAVE10_ABILITIES,WAVE10_BUILTIN_PACKS,WAVE10_CARDS,WAVE10_DEPS,WAVE10_GAME_ENCOUNTER_SETS,WAVE11_ABILITIES,WAVE11_BUILTIN_PACKS,WAVE11_CARDS,WAVE11_DEPS,WAVE11_GAME_ENCOUNTER_SETS,WAVE1_ABILITIES,WAVE1_BUILTIN_PACKS,WAVE1_DEPS,WAVE1_REPRINT_ABILITIES,WAVE2_ABILITIES,WAVE2_BUILTIN_PACKS,WAVE2_DEPS,WAVE2_REPRINT_ABILITIES,WAVE3_ABILITIES,WAVE3_BUILTIN_PACKS,WAVE3_CARDS,WAVE3_DEPS,WAVE3_REPRINT_ABILITIES,WAVE4_BUILTIN_PACKS,WAVE5_BUILTIN_PACKS,WAVE6_BUILTIN_PACKS,WAVE7_ABILITIES,WAVE7_BUILTIN_PACKS,WAVE7_CARDS,WAVE7_DEPS,WAVE8_ABILITIES,WAVE8_BUILTIN_PACKS,WAVE8_CARDS,WAVE8_DEPS,WAVE9_ABILITIES,WAVE9_BUILTIN_PACKS,WAVE9_CARDS,WAVE9_DEPS,YOUR_HERO,YOUR_IDENTITY,aDifferentCard,aScheme,abilitiesForCards,accelerationTokensOn,accusationWrongGuesses,accuse,accusedWrong,actingCharacter,action,activatesBeforeVillain,activatingEnemy,activationIs,activationOrderOf,addAccelerationToken,addCounters,addMainSchemeStageToVictoryDisplay,addToVictoryDisplay,addVillain,additionalAttackCost,additionalCostToPlay,additionalCostToReady,additionalPowerCost,additionalThwartCost,adjustBoostCount,advanceMainScheme,advanceToSetAsideVillain,after,afterNextCardPlayed,agile,allOf,allowUnlabeledAttack,alterEgoAction,alterEgoInterrupt,alterEgoResponse,amount,anAttackableEnemy,anEnemy,andThen,anyIn,anyNumberOfToughStatusCards,anyOf,anyOfCards,anyPlayerEliminated,applyAsBoostCard,applyRuleUntil,areaPlayersDefeated,assignDamage,atEndOfActivation,atEndOfAttack,atEndOfPhase,atEndOfRound,atEndOfThwart,atMost,attachCard,attachCost,attachInstruction,attack,attackAnEnemy,attackDamageDealt,attackExcessAsDealt,attackInProgress,attackInitiatedAgainst,attackPreventedAmount,attackPreventedTotal,attackResolvedLabeled,attackTarget,attackTotalAtk,attackUsedAtk,attackWasPrevented,attackableAsMinion,attackedBy,attackedPlayer,attackedThisPhase,attackingEnemy,attacksDealAdditionalDamage,attacksGainKeywords,attacksLoseKeywords,baseStatOf,baseStatsFromYourHero,basicPowerBy,basicPowerCost,basicPowerIs,basicPowerStatIs,basicThwartOnlyAgainst,basicThwartsIgnore,bindTargets,blankTextBoxForPlayers,blankTextBoxUntil,blanksTextBox,boost,boostAreaIconsOn,boostCardOf,boostCardsFromSet,boostIconsCount,boostIconsOn,buildScenarioDeck,buildWave11Scenario,builtinGameDeps,builtinPackProblems,campaignDefinitionOf,campaignDefinitionProblems,campaignDefinitionsOf,campaignDepsWithPacks,campaignGameWithPacks,campaignInstructionsOf,campaignLogAtLeast,campaignLogCardCounter,campaignLogCardRecorded,campaignLogCards,campaignLogHas,campaignLogIsSet,campaignLogValue,campaignModularPickProblem,canAttachTo,canAttachToCategory,canChangeForm,canEnterPlay,canFlip,canPayResources,canPlayFromHand,canRemoveThreatFrom,canSpendDifferentResources,canTakeStatus,canUseBasicPower,cancelBoostedActivation,cancelConsequentialDamage,cancelIt,cancelRevealedCard,cancelWhenRevealed,cannotActivate,cannotAttach,cannotBeAttachedUnlessInPlay,cannotBeCanceled,cannotBeDefeated,cannotBeHealed,cannotBeReadiedByPlayerCards,cannotChangeFormUntil,cannotChooseOption,cannotChooseToDiscard,cannotEnterPlay,cannotFlip,cannotHaveStatus,cannotLeavePlay,cannotMakeBasicAttacks,cannotReadyUntil,cannotRecover,cannotResolveTriggeredAbilities,cannotThwart,cardIdsIn,cardPoolWithPack,cardPoolWithPacks,cards,cardsFrom,cardsOfComposedSets,centralMainScheme,changeAdditionalForm,changeForm,changeFormCost,changeToHeroFormNamed,changeToHeroFormWithTrait,changeToOtherHeroForm,changeVillainForm,characterDidThisPhase,checkModularPickCount,checkPackCampaigns,checkPlayableDifficultySets,choiceFoundNothing,chooseCardCost,chooseCardType,chooseCards,chooseEncounterCardType,chooseGroup,chooseMainSchemeStages,chooseNumber,chooseOne,chooseOneBy,chooseOptions,choosePlayer,chooseTarget,chooseTargetCost,chosen,chosenGroup,chosenModularSetIds,chosenPlayer,chosenVillain,civilWarGameModes,civilWarModularSets,civilWarSidesOffer,communityDeckUrl,communityDecks,competitiveOnly,competitiveOnlyTexts,completeMainScheme,confuse,consideredToHaveHitPoints,consideredToHaveResourceIcon,constant,controllerOf,coreScenario,costIf,costModifier,costsPayableByAnyPlayer,countAmong,countBoostIcons,countOf,countTowardStartingHand,counterLimit,countersAsResource,countersOn,countsAs,coveredByEngineRule,createGameArea,createScenarioArea,createScenarioPlayArea,customContentOfPacks,customContentProblems,customModularPickProblem,customModularSetChoices,customScenarioProblems,damageAnEnemy,damageCardsCost,damageOn,damageSharedVillain,damageThisCardCost,damagedAtLeast,dealAsEncounterCard,dealDamage,dealDamageCost,dealDamageToChosenCost,dealEncounterCard,dealEncounterCardsCost,dealEncounterCardsToChosenPlayerCost,dealHiddenPiles,dealIndirectDamage,dealPoolOneAtATime,dealtEncounterCards,dealtEncounterCount,deckCountOf,deckDiscardIconsCount,declareDefender,defeat,defeatExcessDamage,defeatedWithExcessConsequentialDamage,defeatedWithExcessDamage,defeatingPlayer,defenderDefForAttack,defendingCharacter,defendsWithoutExhausting,defineAbilities,defineBuiltinPack,definePackAbilities,detach,difficultySetAlternativesFor,discard,discardAtRandom,discardBoostCard,discardCardsCost,discardChosenFromEncounterDeckCost,discardDeckUntil,discardEncounterCards,discardEncounterUntil,discardFacedownBoostCards,discardFromHand,discardFromHandCombinedCost,discardFromHandCost,discardRandomFromHandCost,discardStatusCost,discardStatusesTokensAndAttachments,discardThis,discardTopOfDeckCost,discardTopOfEncounterDeckCost,discardTuckedCost,discardUpToTopOfDeckCost,distinctAspectsOf,distinctTraitsOf,divide,doesNotExhaustToDefend,doubleDamageTaken,doubleNextCardSpent,doubleStat,doublesResourcesGeneratedForThisCard,doublesResourcesWhilePayingFor,draw,drawUpTo,droneFromDeck,dslFeatures,duringPlayerPhase,duringTurnOf,duringVillainPhaseStepOne,each,eachGroupInPod,eachPlayer,eachPlayerCost,eachTimeUntil,eitherCost,encounterCard,encounterCards,encounterCardsOf,encounterIconsInPlay,encounterLookDiscardCost,encounterSetAside,encounterSetOf,endGame,enemyActivates,enemyAttack,enemyAttacksEnemy,enemyAttacksYouCost,enemyCanAttackAnother,enemyLeader,enemyScheme,enemyTeam,enemyTeamChooses,enemyToAttack,engage,engagedPlayerOf,engineOnlyDslProblems,entersPlayExhausted,eventAmount,eventDamageTaken,eventDamageTakenBy,eventDealt,eventKindIs,eventPlayer,eventResult,eventSource,eventSourceEnemy,eventTarget,eventTargetsTogether,exactlyDefeated,exactlyDefeatedByPower,excludedFromAllyLimit,excludedFromPlayerSideSchemeLimit,exhaust,exhaustCardsCost,exhaustEachCost,exhaustThis,exhaustYourHero,exists,expertSetReplaceable,extraBoostCardsForVillain,faceNamed,fieldsIn,finalStep,find,findCard,firstAttackThisTurn,firstPlayer,firstPlayerAction,firstPlayerPicksFromHand,firstRevealGainsSurge,firstThisRound,flatten,flipCard,flipThis,focusedMainScheme,forAnIdentityNotInThisGame,forEachCard,forEachPlayer,forEachPlayerInChosenOrder,forcedAction,forcedInterrupt,forcedResponse,formChangeCost,friendlyCharacterAttacks,fromAnyAspect,gainFromHiddenPile,gainKeywordUntil,gainTraitUntil,gainTraitsOfUntil,gainsAbility,gainsIcon,gainsKeyword,gainsKeywordX,gainsKeywordsOf,gainsTrait,gainsTraitsOf,gameAreasSplit,gameDepsWithPack,gameDepsWithPacks,genePoolThreatOffer,generatesAmount,generatesPerCard,gets,giveBasicPowerBoostCard,giveBoostCard,giveBoostCardsCost,giveHeldBoostCard,giveStatus,giveStatusCost,giveTough,gmwBalancedHiddenFields,grantAdditionalMulligans,grantOwnedCards,grantedTo,grantingCard,grantsPreparation,groupPlayerCount,handCountOf,handSizeOf,hasAttachment,hasNamedResource,hasPrintedBoostAbility,hasStatus,hasTaggedAbility,hasTrait,heal,healCost,healYourIdentityCost,heroAction,heroInterrupt,heroNoCharacterIsTitledAs,heroResource,heroResponse,hiddenPileCount,highestStatAmong,hitPointsOf,holdMinion,horsemanSidesOffer,host,identifyMole,identityOf,ifElse,ifThen,ignoreAbilities,ignoreBoost,ignoreBoostAbilities,ignoreBoostForThisAttack,ignores,ignoresRetaliate,inAdditionalForm,inCampaign,inCampaignLogField,inCompetitiveMode,inDiscard,inEncounterSet,inForm,inGroup,inHand,inMode,inPlay,inPlayAreaOf,inScenarioPlayArea,inVictoryDisplay,increaseDamage,increaseDamageTaken,increaseNextCardCost,infinitesGenePoolThreatRecommendation,instead,interrupt,isAlterEgo,isAttached,isBaseEncounterSetId,isBaseScenarioId,isConfused,isHero,isModularChoice,isNotReadyCard,isPlainJson,isScenarioSpecificSet,isStunned,isUnscriptedAbilityIssue,joinGameArea,keepsExhausted,lastPlayedThisRound,leavingPlayLoses,limitPerPaidCard,logCardList,logCardRef,logFlag,logNumber,logOption,logText,lookAt,lookAtAndRearrange,lookAtTopOfScenarioDeckThenPlace,loseKeywordUntil,loseTraitUntil,losesIcon,losesKeyword,made,mainSchemeAdvancedBy,mainSchemeMarkedBy,mainSchemePicksOffer,mainSchemeStageGist,mainSchemeStageNumber,mainSchemeStagesOffer,mainSchemeStagesProblem,max,maxDamageTaken,maxOnePerTriggeringInstance,maxSustainedDamage,mayLookAtTopOfEncounterDeckUntil,mergeCosts,mergeRegistries,min,minDamageTaken,modifyAttack,modifyBasicPower,modifyCardEffect,modifyCardEffectsUntil,modifyConsequentialDamage,modifyStat,modifyStatOf,modifyThwart,modularPickCountProblem,modularPickCountRange,modularPickProblem,modularSetContents,mojoCheckedOffSets,mojoModularSetPicks,mostCommonHandTypeCount,moveActiveCounterToNextInRow,moveActiveCounterToNextVillain,moveBoostCards,moveCards,moveCardsInto,moveCounters,moveThreat,multiplyStat,named,namedByTeamUpOf,nextAfter,not,notCountedTowardHandSize,notMatching,notOfChosenCardType,obligation,ofChosenCardType,ofClassification,ofIdentitySetTitled,ofTeamUpSet,offersEasierStart,offersGenePoolThreat,on,onChosenMainScheme,oncePerPaidCard,oncePerPhase,oncePerPhasePerEventPlayer,oncePerRound,oncePerRoundPerPlayer,oneCopyOf,onlyCharacterRemovesThreat,onlySourceRemovesThreat,onlyThwartsRemoveThreat,opsOfKind,option,otherFaceOf,otherPlayers,outsideFact,overpaidWhenPlayed,ownScriptsOf,ownerOf,packCampaignDefinitionOf,packCampaignDefinitions,packCampaignRecords,packCampaignsOf,packEncounterSetRecords,packModularSetChoices,obligation as packObligation,packScenarioOffer,packScenarioRecords,paidCards,paidInPlayCards,paidType,paidTypeCount,paidUsingResourceFrom,paidWith,paidWithCard,paidWithOnly,paidWithResourceCard,pairCards,pairLimit,partOf,passEncounterCard,payPrintedCostOf,payingFor,perHero,placeCountersCost,placeDamage,placeOnTopOrBottom,placeOnTopOrBottomOfPlayerDeck,placeThreat,placeThreatOnSharedScheme,playFromDeckIgnoringCost,playFromDeckReducingCost,playFromHandIgnoringCost,playFromHandReducingCost,playFromSeparateDeck,playNote,playOnlyIf,playSetAside,playTuckedCard,playWithTopOfDeckFaceup,playWithTopOfEncounterDeckFaceup,playableAttachments,playableScenario,playableScenarioOffer,playableScenarioWithCustom,playableStarterDeckSetup,playableTopOfDeck,playableTucked,playedThisPhase,playedThisRound,playedThisTurn,playedVia,playerOrElse,playersCannotDiscard,playersWhere,preparation,preventAllDamageTo,preventConsequentialDamage,preventDamage,preventThreat,printedBoostAreaIconsOn,printedCostAtLeast,printedCostOf,printedForm,printedHpNumeralOf,printedHpOf,printedResourcesInHandAs,printedResourcesOf,printedStatOf,printsAbility,product,publishIssues,putIntoPlay,putIntoPlayAsHost,putIntoPlayFacedown,putIntoPlayFromSetAside,putLinkedAllyIntoPlay,putMainSchemeStageIntoPlay,query,raiseMoment,randomCivilWarScenario,reachableFromPod,reaching,readPackInput,readsAtkOf,readsPaymentTypesOf,ready,readyCardsCost,recordInCampaignLog,reduceCostOfCards,reduceCostToPlay,reduceDamage,reduceDamageTo,reduceNextCardCost,reducesAttackDamageTaken,refCount,refMatches,remainingHpCompare,remainingHpOf,removeAccelerationToken,removeAllCounters,removeAllCountersFrom,removeAnAccelerationToken,removeCounter,removeCountersAmong,removeCountersFrom,removeEachCounterFrom,removeFromCampaign,removeMainSchemeStage,removeMainSchemeStages,removeStatus,removeThreat,removeThreatCost,removeThreatFromAScheme,removeThreatFromChosenCost,removeThreatUpToCost,removeUpToCounters,removeVillain,removedFromGameCards,reorderCards,repeatTimes,repeatWhile,replaceAttachHost,replaceBoostCount,replaceLeaveDestination,replaceNextVillainPhaseWithPlayerPhase,replaceStatus,replaceTuckHost,reportFact,resetHitPoints,resolveAttackAgainst,resolveBoostAbilitiesOf,resolveForcedInterruptOf,resolveForcedResponseCost,resolveForcedResponseOf,resolveModes,resolveOneTagged,resolvePreparationsOf,resolveSetups,resolveSpecialCost,resolveSpecials,resolveSpecialsOf,resolveTagged,resolveWhenDefeatedOf,resolveWhenRevealedOf,resource,resourceTypesOf,resourcesGeneratedAsWild,resourcesPaidBy,response,restrictedLimit,retargetAttack,retargetPlayerAttack,returnEachToHandCost,returnToHandAfterResolving,returnToHandCost,revealCard,revealEncounterCard,revealFromSetAsideModularSet,revealHeldMinion,revealHiddenPile,revealInstead,revealMainSchemeStage,revealNextVillainStage,revealSetAside,revealTopOfScenarioDeck,revealTopOfSeparateDeck,revealedFromEncounterDeck,revealedPileCardCount,rotateEngagement,rule,sameClassificationAs,scaled,scenarioArea,scenarioAreaCount,scenarioDeck,scenarioGameSetIds,scenarioSideClause,scenarioWithPacks,scenarioWithVillain,schemeStartedByAttackBoost,schemeThreatOn,searchAndReveal,searchCollection,searchEncounterIntoPlayCost,seedHiddenPiles,selectCards,self,sentence,separateDeckCards,separateDeckCountOf,setActiveVillain,setAside,setAsideDestination,setAsideModularSetCount,setDefeatDestination,setRemainingHitPoints,setVar,setVillainAside,setVillainSide,setup,sha256Hex,sharesTitleWith,sharesTraitWith,sharesTraitWithHeroOf,shuffleDeck,shuffleEncounterDeck,shuffleInSetAsideModularSet,shuffleIntoSeparateDeck,shuffleMainSchemeStageGroup,shuffleMainSchemeStages,shuffleSeparateDeck,shuffleTopOfSeparateDeckIntoEncounterDeck,sitOut,skipNextVillainPhase,skippedCommunityDecks,skirmishOffer,special,spend,spendChosen,spendDifferentResources,spendEqualTo,spendPrinted,spendResources,spendSameType,spendUpTo,spendX,spendXResources,spendableForAnyPlayer,spendableForPlayersWhere,spendableFromTucked,splitIssues,standardSetReplaceable,starIconsOn,starterDeckSetup,statCompare,statOf,stateCheck,stateCheckFromEntering,statusCount,statusLimit,staysInHand,stillCountedByDiscarder,stun,sum,superlative,superlativePlayer,surge,swapCards,swapIdentity,swapMainScheme,swapVillain,swapVillainByTrait,tagged,taggedAbilitiesOn,takeAnyDamageCost,takeControl,takeDamage,takeDamageCost,takeIndirectDamageCost,takeIntoHand,takesConsequentialDamage,takesDamageOnlyFrom,takesDamageOnlyFromAttacks,takesFirstTurn,teamUpCharacter,teamUpCharacters,textBoxCannotBeBlanked,thatAttackGainsKeywords,thatPlayer,theAccused,theAffectedCard,theMainScheme,theMole,theVillain,thisCardGenerates,thisGroup,threatAtLeast,threatOn,thwart,thwartAScheme,thwartInProgress,thwartTarget,titled,toScenarioDeck,topOfDeck,topOfDeckIsFaceup,topOfDeckMatches,topOfEncounterDeckIsFaceup,topOfEncounterDeckMatches,topOfEncounterDeckShowsIcons,topOfEncounterDeckShowsNoIcons,topOfYourDeckHas,totalPrintedCost,totalPrintedResources,totalStatOf,traitEncounterDeck,traitNumber,treatAsAlly,treatAsMinion,treatAttachedAllyAsMinion,treatAttachedHeroAsMinion,treatAttachedMinionAsAlly,treatAttachedVillainAsMinion,treatSelfAsAlly,tuckCards,tuckLimit,tuckedCount,tuckedUnder,tuckedUnderRef,turnFacedown,uncancellable,undefendedAttack,upgradesCannotBeRemoved,useThwInsteadOfAtk,usingBasicPower,validateBuiltinPack,validateDefinition,validatePack,valueAtLeast,valueAtMost,valueEquals,varAtLeast,varFor,varOf,victoryCondition,victoryDisplayCards,victoryDisplayCount,villainChoiceOf,villainChoiceOffer,villainOnSide,villainOptionOf,villainStageNumberOf,wave10Scenario,wave10StarterDeckSetup,wave11Scenario,wave11ScenarioRecord,wave11StarterDeckSetup,wave1ReprintPairs,wave1Scenario,wave1StarterDeckSetup,wave2ReprintPairs,wave2Scenario,wave2StarterDeckSetup,wave3ReprintPairs,wave3Scenario,wave3StarterDeckSetup,wave7Scenario,wave7StarterDeckSetup,wave8Scenario,wave8StarterDeckSetup,wave9Scenario,wave9StarterDeckSetup,when,whenCompleted,whenDefeated,whenRevealed,whenRevealedAlterEgo,whenRevealedHero,whenSpentGenerate,whileOnChosenMainScheme,whileTucked,withFewestCounters,withModularSetContents,withMostCounters,you,youAre,youAreNamed,youHaveTrait,yourIdentity,yourLeader,yourMainScheme,yourTeam,zone,zoneCountOf};
1
+ import{builtinGameDeps,validateBuiltinPack}from"./chunks/chunk-HVUCR22H.js";import{PACK_ABILITY_ID,REQUIRED_PACK_FILES,SUPPORTED_DSL_FEATURES,campaignDefinitionsOf,checkPackCampaigns,definePackAbilities,dslFeatures,isPlainJson,isUnscriptedAbilityIssue,packCampaignsOf,publishIssues,readPackInput,sha256Hex,splitIssues,validatePack}from"./chunks/chunk-2XS47E3T.js";import{campaignDepsWithPacks,campaignGameWithPacks,cardPoolWithPack,cardPoolWithPacks,customContentOfPacks,gameDepsWithPack,gameDepsWithPacks,packCampaignDefinitionOf,packCampaignDefinitions,packCampaignRecords,packEncounterSetRecords,packModularSetChoices,packScenarioRecords,scenarioWithPacks}from"./chunks/chunk-A3WBGQ2N.js";import{ANY_ASPECT_CARD,ANY_NUMBER,ANY_RESOURCE,AOA_CAMPAIGN_DEFINITION,AOA_DEFEATED,AOA_MISSIONS,AOA_NOT_DEFEATED,AOA_OVERSEERS,AOA_PROTECT_THE_PROFESSOR,AOS_CAMPAIGN_DEFINITION,AS_DRONE,BUILTIN_PACKS,CAMPAIGNS,CAN_TAKE_THIS_ATTACK,COMMUNITY_DECK_AUTHORS,CORE_ABILITIES,CORE_BUILTIN_PACK,CORE_DEPS,CUSTOM_SCENARIO_FIELDS,ENCOUNTER_CARD,ENCOUNTER_CARD_CATEGORIES,ENCOUNTER_SIDE_SCHEME,ENGINE_ONLY_DSL_EXAMPLES,FRIENDLY_CHARACTER,GMW_BALANCED_FIELD,GMW_BALANCED_TOGGLES,GMW_CAMPAIGN_DEFINITION,INFINITES_GENE_POOL_THREAT_MAX,MOJO_CAMPAIGN_DEFINITION,MTS_CAMPAIGN_DEFINITION,NEXT_EVOL_CAMPAIGN_DEFINITION,NOT_READY_PACK_CODES,PAID_CARDS,PAID_IN_PLAY_CARDS,PLAYABLE_ABILITIES,PLAYABLE_DEPS,PLAYABLE_ENCOUNTER_SETS,PLAYABLE_SCENARIO_RECORDS,PLAYER_SIDE_SCHEME,RANDOM_VILLAIN,SHADOWLAND_CAMPAIGN_DEFINITION,SM_CAMPAIGN_DEFINITION,TEAM_UP_CARD,TRAIT,TRORS_CAMPAIGN_DEFINITION,UNSCRIPTED_ENCOUNTER_SET_IDS,VILLAIN_OR_VILLAINOUS,WAVE10_ABILITIES,WAVE10_BUILTIN_PACKS,WAVE10_CARDS,WAVE10_DEPS,WAVE10_GAME_ENCOUNTER_SETS,WAVE11_ABILITIES,WAVE11_BUILTIN_PACKS,WAVE11_CARDS,WAVE11_DEPS,WAVE11_GAME_ENCOUNTER_SETS,WAVE1_ABILITIES,WAVE1_BUILTIN_PACKS,WAVE1_DEPS,WAVE1_REPRINT_ABILITIES,WAVE2_ABILITIES,WAVE2_BUILTIN_PACKS,WAVE2_DEPS,WAVE2_REPRINT_ABILITIES,WAVE3_ABILITIES,WAVE3_BUILTIN_PACKS,WAVE3_CARDS,WAVE3_DEPS,WAVE3_REPRINT_ABILITIES,WAVE4_BUILTIN_PACKS,WAVE5_BUILTIN_PACKS,WAVE6_BUILTIN_PACKS,WAVE7_ABILITIES,WAVE7_BUILTIN_PACKS,WAVE7_CARDS,WAVE7_DEPS,WAVE8_ABILITIES,WAVE8_BUILTIN_PACKS,WAVE8_CARDS,WAVE8_DEPS,WAVE9_ABILITIES,WAVE9_BUILTIN_PACKS,WAVE9_CARDS,WAVE9_DEPS,YOUR_HERO,YOUR_IDENTITY,aDifferentCard,aScheme,abilitiesForCards,accelerationTokensOn,accusationWrongGuesses,accuse,accusedWrong,actingCharacter,action,activatesBeforeVillain,activatingEnemy,activationIs,activationOrderOf,addAccelerationToken,addCounters,addMainSchemeStageToVictoryDisplay,addToVictoryDisplay,addVillain,additionalAttackCost,additionalCostToPlay,additionalCostToReady,additionalPowerCost,additionalThwartCost,adjustBoostCount,advanceMainScheme,advanceToSetAsideVillain,after,afterNextCardPlayed,agile,allOf,allowUnlabeledAttack,alterEgoAction,alterEgoInterrupt,alterEgoResponse,amount,anAttackableEnemy,anEnemy,andThen,anyIn,anyNumberOfToughStatusCards,anyOf,anyOfCards,anyPlayerEliminated,applyAsBoostCard,applyRuleUntil,areaPlayersDefeated,assignDamage,atEndOfActivation,atEndOfAttack,atEndOfPhase,atEndOfRound,atEndOfThwart,atMost,attachCard,attachCost,attachInstruction,attack,attackAnEnemy,attackDamageDealt,attackExcessAsDealt,attackInProgress,attackInitiatedAgainst,attackPreventedAmount,attackPreventedTotal,attackResolvedLabeled,attackTarget,attackTotalAtk,attackUsedAtk,attackWasPrevented,attackableAsMinion,attackedBy,attackedPlayer,attackedThisPhase,attackingEnemy,attacksDealAdditionalDamage,attacksGainKeywords,attacksLoseKeywords,baseStatOf,baseStatsFromYourHero,basicPowerBy,basicPowerCost,basicPowerIs,basicPowerStatIs,basicThwartOnlyAgainst,basicThwartsIgnore,bindTargets,blankTextBoxForPlayers,blankTextBoxUntil,blanksTextBox,boost,boostAreaIconsOn,boostCardOf,boostCardsFromSet,boostIconsCount,boostIconsOn,buildScenarioDeck,buildWave11Scenario,builtinPackProblems,campaignDefinitionOf,campaignDefinitionProblems,campaignInstructionsOf,campaignLogAtLeast,campaignLogCardCounter,campaignLogCardRecorded,campaignLogCards,campaignLogHas,campaignLogIsSet,campaignLogValue,campaignModularPickProblem,canAttachTo,canAttachToCategory,canChangeForm,canEnterPlay,canFlip,canPayResources,canPlayFromHand,canRemoveThreatFrom,canSpendDifferentResources,canTakeStatus,canUseBasicPower,cancelBoostedActivation,cancelConsequentialDamage,cancelIt,cancelRevealedCard,cancelWhenRevealed,cannotActivate,cannotAttach,cannotBeAttachedUnlessInPlay,cannotBeCanceled,cannotBeDefeated,cannotBeHealed,cannotBeReadiedByPlayerCards,cannotChangeFormUntil,cannotChooseOption,cannotChooseToDiscard,cannotEnterPlay,cannotFlip,cannotHaveStatus,cannotLeavePlay,cannotMakeBasicAttacks,cannotReadyUntil,cannotRecover,cannotResolveTriggeredAbilities,cannotThwart,cardIdsIn,cards,cardsFrom,cardsOfComposedSets,centralMainScheme,changeAdditionalForm,changeForm,changeFormCost,changeToHeroFormNamed,changeToHeroFormWithTrait,changeToOtherHeroForm,changeVillainForm,characterDidThisPhase,checkModularPickCount,checkPlayableDifficultySets,choiceFoundNothing,chooseCardCost,chooseCardType,chooseCards,chooseEncounterCardType,chooseGroup,chooseMainSchemeStages,chooseNumber,chooseOne,chooseOneBy,chooseOptions,choosePlayer,chooseTarget,chooseTargetCost,chosen,chosenGroup,chosenModularSetIds,chosenPlayer,chosenVillain,civilWarGameModes,civilWarModularSets,civilWarSidesOffer,communityDeckUrl,communityDecks,competitiveOnly,competitiveOnlyTexts,completeMainScheme,confuse,consideredToHaveHitPoints,consideredToHaveResourceIcon,constant,controllerOf2 as controllerOf,coreScenario,costIf,costModifier,costsPayableByAnyPlayer,countAmong,countBoostIcons,countOf,countTowardStartingHand,counterLimit,countersAsResource,countersOn,countsAs,coveredByEngineRule,createGameArea,createScenarioArea,createScenarioPlayArea,customContentProblems,customModularPickProblem,customModularSetChoices,customScenarioProblems,damageAnEnemy,damageCardsCost,damageOn,damageSharedVillain,damageThisCardCost,damagedAtLeast,dealAsEncounterCard,dealDamage,dealDamageCost,dealDamageToChosenCost,dealEncounterCard,dealEncounterCardsCost,dealEncounterCardsToChosenPlayerCost,dealHiddenPiles,dealIndirectDamage,dealPoolOneAtATime,dealtEncounterCards,dealtEncounterCount,deckCountOf,deckDiscardIconsCount,declareDefender,defeat,defeatExcessDamage,defeatedWithExcessConsequentialDamage,defeatedWithExcessDamage,defeatingPlayer,defenderDefForAttack,defendingCharacter,defendsWithoutExhausting,defineAbilities,defineBuiltinPack,detach,difficultySetAlternativesFor,discard,discardAtRandom,discardBoostCard,discardCardsCost,discardChosenFromEncounterDeckCost,discardDeckUntil,discardEncounterCards,discardEncounterUntil,discardFacedownBoostCards,discardFromHand,discardFromHandCombinedCost,discardFromHandCost,discardRandomFromHandCost,discardStatusCost,discardStatusesTokensAndAttachments,discardThis,discardTopOfDeckCost,discardTopOfEncounterDeckCost,discardTuckedCost,discardUpToTopOfDeckCost,distinctAspectsOf,distinctTraitsOf,divide,doesNotExhaustToDefend,doubleDamageTaken,doubleNextCardSpent,doubleStat,doublesResourcesGeneratedForThisCard,doublesResourcesWhilePayingFor,draw,drawUpTo,droneFromDeck,duringPlayerPhase,duringTurnOf,duringVillainPhaseStepOne,each,eachGroupInPod,eachPlayer,eachPlayerCost,eachTimeUntil,eitherCost,encounterCard,encounterCards,encounterCardsOf,encounterIconsInPlay,encounterLookDiscardCost,encounterSetAside,encounterSetOf,endGame,enemyActivates,enemyAttack,enemyAttacksEnemy,enemyAttacksYouCost,enemyCanAttackAnother,enemyLeader,enemyScheme,enemyTeam,enemyTeamChooses,enemyToAttack,engage,engagedPlayerOf,engineOnlyDslProblems,entersPlayExhausted,eventAmount,eventDamageTaken,eventDamageTakenBy,eventDealt,eventKindIs,eventPlayer,eventResult,eventSource,eventSourceEnemy,eventTarget,eventTargetsTogether,exactlyDefeated,exactlyDefeatedByPower,excludedFromAllyLimit,excludedFromPlayerSideSchemeLimit,exhaust,exhaustCardsCost,exhaustEachCost,exhaustThis,exhaustYourHero,exists,expertSetReplaceable,extraBoostCardsForVillain,faceNamed,fieldsIn,finalStep,find,findCard,firstAttackThisTurn,firstPlayer,firstPlayerAction,firstPlayerPicksFromHand,firstRevealGainsSurge,firstThisRound,flatten,flipCard,flipThis,focusedMainScheme,forAnIdentityNotInThisGame,forEachCard,forEachPlayer,forEachPlayerInChosenOrder,forcedAction,forcedInterrupt,forcedResponse,formChangeCost,friendlyCharacterAttacks,fromAnyAspect,gainFromHiddenPile,gainKeywordUntil,gainTraitUntil,gainTraitsOfUntil,gainsAbility,gainsIcon,gainsKeyword,gainsKeywordX,gainsKeywordsOf,gainsTrait,gainsTraitsOf,gameAreasSplit,genePoolThreatOffer,generatesAmount,generatesPerCard,gets,giveBasicPowerBoostCard,giveBoostCard,giveBoostCardsCost,giveHeldBoostCard,giveStatus,giveStatusCost,giveTough,gmwBalancedHiddenFields,grantAdditionalMulligans,grantOwnedCards,grantedTo,grantingCard,grantsPreparation,groupPlayerCount,handCountOf,handSizeOf,hasAttachment,hasNamedResource,hasPrintedBoostAbility,hasStatus,hasTaggedAbility,hasTrait,heal,healCost,healYourIdentityCost,heroAction,heroInterrupt,heroNoCharacterIsTitledAs,heroResource,heroResponse,hiddenPileCount,highestStatAmong,hitPointsOf,holdMinion,horsemanSidesOffer,host,identifyMole,identityOf,ifElse,ifThen,ignoreAbilities,ignoreBoost,ignoreBoostAbilities,ignoreBoostForThisAttack,ignores,ignoresRetaliate,inAdditionalForm,inCampaign,inCampaignLogField,inCompetitiveMode,inDiscard,inEncounterSet,inForm,inGroup,inHand,inMode,inPlay,inPlayAreaOf,inScenarioPlayArea,inVictoryDisplay,increaseDamage,increaseDamageTaken,increaseNextCardCost,infinitesGenePoolThreatRecommendation,instead,interrupt,isAlterEgo,isAttached,isBaseEncounterSetId,isBaseScenarioId,isConfused,isHero,isModularChoice,isNotReadyCard,isScenarioSpecificSet,isStunned,joinGameArea,keepsExhausted,lastPlayedThisRound,leavingPlayLoses,limitPerPaidCard,logCardList,logCardRef,logFlag,logNumber,logOption,logText,lookAt,lookAtAndRearrange,lookAtTopOfScenarioDeckThenPlace,loseKeywordUntil,loseTraitUntil,losesIcon,losesKeyword,made,mainSchemeAdvancedBy,mainSchemeMarkedBy,mainSchemePicksOffer,mainSchemeStageGist,mainSchemeStageNumber,mainSchemeStagesOffer,mainSchemeStagesProblem,max,maxDamageTaken,maxOnePerTriggeringInstance,maxSustainedDamage,mayLookAtTopOfEncounterDeckUntil,mergeCosts,mergeRegistries,min,minDamageTaken,modifyAttack,modifyBasicPower,modifyCardEffect,modifyCardEffectsUntil,modifyConsequentialDamage,modifyStat,modifyStatOf,modifyThwart,modularPickCountProblem,modularPickCountRange,modularPickProblem,modularSetContents,mojoCheckedOffSets,mojoModularSetPicks,mostCommonHandTypeCount,moveActiveCounterToNextInRow,moveActiveCounterToNextVillain,moveBoostCards,moveCards,moveCardsInto,moveCounters,moveThreat,multiplyStat,named,namedByTeamUpOf,nextAfter,not,notCountedTowardHandSize,notMatching,notOfChosenCardType,obligation,ofChosenCardType,ofClassification,ofIdentitySetTitled,ofTeamUpSet,offersEasierStart,offersGenePoolThreat,on,onChosenMainScheme,oncePerPaidCard,oncePerPhase,oncePerPhasePerEventPlayer,oncePerRound,oncePerRoundPerPlayer,oneCopyOf,onlyCharacterRemovesThreat,onlySourceRemovesThreat,onlyThwartsRemoveThreat,opsOfKind,option,otherFaceOf,otherPlayers,outsideFact,overpaidWhenPlayed,ownScriptsOf,ownerOf,packScenarioOffer,paidCards,paidInPlayCards,paidType,paidTypeCount,paidUsingResourceFrom,paidWith,paidWithCard,paidWithOnly,paidWithResourceCard,pairCards,pairLimit,partOf,passEncounterCard,payPrintedCostOf,payingFor,perHero,placeCountersCost,placeDamage,placeOnTopOrBottom,placeOnTopOrBottomOfPlayerDeck,placeThreat,placeThreatOnSharedScheme,playFromDeckIgnoringCost,playFromDeckReducingCost,playFromHandIgnoringCost,playFromHandReducingCost,playFromSeparateDeck,playNote,playOnlyIf,playSetAside,playTuckedCard,playWithTopOfDeckFaceup,playWithTopOfEncounterDeckFaceup,playableAttachments,playableScenario,playableScenarioOffer,playableScenarioWithCustom,playableStarterDeckSetup,playableTopOfDeck,playableTucked,playedThisPhase,playedThisRound,playedThisTurn,playedVia,playerOrElse,playersCannotDiscard,playersWhere,preparation,preventAllDamageTo,preventConsequentialDamage,preventDamage,preventThreat,printedBoostAreaIconsOn,printedCostAtLeast,printedCostOf,printedForm,printedHpNumeralOf,printedHpOf,printedResourcesInHandAs,printedResourcesOf,printedStatOf,printsAbility,product,putIntoPlay,putIntoPlayAsHost,putIntoPlayFacedown,putIntoPlayFromSetAside,putLinkedAllyIntoPlay,putMainSchemeStageIntoPlay,query,raiseMoment,randomCivilWarScenario,reachableFromPod,reaching,readsAtkOf,readsPaymentTypesOf,ready,readyCardsCost,recordInCampaignLog,reduceCostOfCards,reduceCostToPlay,reduceDamage,reduceDamageTo,reduceNextCardCost,reducesAttackDamageTaken,refCount,refMatches,remainingHpCompare,remainingHpOf,removeAccelerationToken,removeAllCounters,removeAllCountersFrom,removeAnAccelerationToken,removeCounter,removeCountersAmong,removeCountersFrom,removeEachCounterFrom,removeFromCampaign,removeMainSchemeStage,removeMainSchemeStages,removeStatus,removeThreat,removeThreatCost,removeThreatFromAScheme,removeThreatFromChosenCost,removeThreatUpToCost,removeUpToCounters,removeVillain,removedFromGameCards,reorderCards,repeatTimes,repeatWhile,replaceAttachHost,replaceBoostCount,replaceLeaveDestination,replaceNextVillainPhaseWithPlayerPhase,replaceStatus,replaceTuckHost,reportFact,resetHitPoints,resolveAttackAgainst,resolveBoostAbilitiesOf,resolveForcedInterruptOf,resolveForcedResponseCost,resolveForcedResponseOf,resolveModes,resolveOneTagged,resolvePreparationsOf,resolveSetups,resolveSpecialCost,resolveSpecials,resolveSpecialsOf,resolveTagged,resolveWhenDefeatedOf,resolveWhenRevealedOf,resource,resourceTypesOf,resourcesGeneratedAsWild,resourcesPaidBy,response,restrictedLimit,retargetAttack,retargetPlayerAttack,returnEachToHandCost,returnToHandAfterResolving,returnToHandCost,revealCard,revealEncounterCard,revealFromSetAsideModularSet,revealHeldMinion,revealHiddenPile,revealInstead,revealMainSchemeStage,revealNextVillainStage,revealSetAside,revealTopOfScenarioDeck,revealTopOfSeparateDeck,revealedFromEncounterDeck,revealedPileCardCount,rotateEngagement,rule,sameClassificationAs,scaled,scenarioArea,scenarioAreaCount,scenarioDeck,scenarioGameSetIds,scenarioSideClause,scenarioWithVillain,schemeStartedByAttackBoost,schemeThreatOn,searchAndReveal,searchCollection,searchEncounterIntoPlayCost,seedHiddenPiles,selectCards,self,sentence,separateDeckCards,separateDeckCountOf,setActiveVillain,setAside,setAsideDestination,setAsideModularSetCount,setDefeatDestination,setRemainingHitPoints,setVar,setVillainAside,setVillainSide,setup,sharesTitleWith,sharesTraitWith,sharesTraitWithHeroOf,shuffleDeck,shuffleEncounterDeck,shuffleInSetAsideModularSet,shuffleIntoSeparateDeck,shuffleMainSchemeStageGroup,shuffleMainSchemeStages,shuffleSeparateDeck,shuffleTopOfSeparateDeckIntoEncounterDeck,sitOut,skipNextVillainPhase,skippedCommunityDecks,skirmishOffer,special,spend,spendChosen,spendDifferentResources,spendEqualTo,spendPrinted,spendResources,spendSameType,spendUpTo,spendX,spendXResources,spendableForAnyPlayer,spendableForPlayersWhere,spendableFromTucked,standardSetReplaceable,starIconsOn,starterDeckSetup,statCompare,statOf,stateCheck,stateCheckFromEntering,statusCount,statusLimit,staysInHand,stillCountedByDiscarder,stun,sum,superlative,superlativePlayer,surge,swapCards,swapIdentity,swapMainScheme,swapVillain,swapVillainByTrait,tagged,taggedAbilitiesOn,takeAnyDamageCost,takeControl,takeDamage,takeDamageCost,takeIndirectDamageCost,takeIntoHand,takesConsequentialDamage,takesDamageOnlyFrom,takesDamageOnlyFromAttacks,takesFirstTurn,teamUpCharacter,teamUpCharacters,textBoxCannotBeBlanked,thatAttackGainsKeywords,thatPlayer,theAccused,theAffectedCard,theMainScheme,theMole,theVillain,thisCardGenerates,thisGroup,threatAtLeast,threatOn,thwart,thwartAScheme,thwartInProgress,thwartTarget,titled,toScenarioDeck,topOfDeck,topOfDeckIsFaceup,topOfDeckMatches,topOfEncounterDeckIsFaceup,topOfEncounterDeckMatches,topOfEncounterDeckShowsIcons,topOfEncounterDeckShowsNoIcons,topOfYourDeckHas,totalPrintedCost,totalPrintedResources,totalStatOf,traitEncounterDeck,traitNumber,treatAsAlly,treatAsMinion,treatAttachedAllyAsMinion,treatAttachedHeroAsMinion,treatAttachedMinionAsAlly,treatAttachedVillainAsMinion,treatSelfAsAlly,tuckCards,tuckLimit,tuckedCount,tuckedUnder,tuckedUnderRef,turnFacedown,uncancellable,undefendedAttack,upgradesCannotBeRemoved,useThwInsteadOfAtk,usingBasicPower,validateDefinition,valueAtLeast,valueAtMost,valueEquals,varAtLeast,varFor,varOf,victoryCondition,victoryDisplayCards,victoryDisplayCount,villainChoiceOf,villainChoiceOffer,villainOnSide,villainOptionOf,villainStageNumberOf,wave10Scenario,wave10StarterDeckSetup,wave11Scenario,wave11ScenarioRecord,wave11StarterDeckSetup,wave1ReprintPairs,wave1Scenario,wave1StarterDeckSetup,wave2ReprintPairs,wave2Scenario,wave2StarterDeckSetup,wave3ReprintPairs,wave3Scenario,wave3StarterDeckSetup,wave7Scenario,wave7StarterDeckSetup,wave8Scenario,wave8StarterDeckSetup,wave9Scenario,wave9StarterDeckSetup,when,whenCompleted,whenDefeated,whenRevealed,whenRevealedAlterEgo,whenRevealedHero,whenSpentGenerate,whileOnChosenMainScheme,whileTucked,withFewestCounters,withModularSetContents,withMostCounters,you,youAre,youAreNamed,youHaveTrait,yourIdentity,yourLeader,yourMainScheme,yourTeam,zone,zoneCountOf}from"./chunks/chunk-JYDEFRIZ.js";export{ANY_ASPECT_CARD,ANY_NUMBER,ANY_RESOURCE,AOA_CAMPAIGN_DEFINITION,AOA_DEFEATED,AOA_MISSIONS,AOA_NOT_DEFEATED,AOA_OVERSEERS,AOA_PROTECT_THE_PROFESSOR,AOS_CAMPAIGN_DEFINITION,AS_DRONE,BUILTIN_PACKS,CAMPAIGNS,CAN_TAKE_THIS_ATTACK,COMMUNITY_DECK_AUTHORS,CORE_ABILITIES,CORE_BUILTIN_PACK,CORE_DEPS,CUSTOM_SCENARIO_FIELDS,ENCOUNTER_CARD,ENCOUNTER_CARD_CATEGORIES,ENCOUNTER_SIDE_SCHEME,ENGINE_ONLY_DSL_EXAMPLES,FRIENDLY_CHARACTER,GMW_BALANCED_FIELD,GMW_BALANCED_TOGGLES,GMW_CAMPAIGN_DEFINITION,INFINITES_GENE_POOL_THREAT_MAX,MOJO_CAMPAIGN_DEFINITION,MTS_CAMPAIGN_DEFINITION,NEXT_EVOL_CAMPAIGN_DEFINITION,NOT_READY_PACK_CODES,PACK_ABILITY_ID,PAID_CARDS,PAID_IN_PLAY_CARDS,PLAYABLE_ABILITIES,PLAYABLE_DEPS,PLAYABLE_ENCOUNTER_SETS,PLAYABLE_SCENARIO_RECORDS,PLAYER_SIDE_SCHEME,RANDOM_VILLAIN,REQUIRED_PACK_FILES,SHADOWLAND_CAMPAIGN_DEFINITION,SM_CAMPAIGN_DEFINITION,SUPPORTED_DSL_FEATURES,TEAM_UP_CARD,TRAIT,TRORS_CAMPAIGN_DEFINITION,UNSCRIPTED_ENCOUNTER_SET_IDS,VILLAIN_OR_VILLAINOUS,WAVE10_ABILITIES,WAVE10_BUILTIN_PACKS,WAVE10_CARDS,WAVE10_DEPS,WAVE10_GAME_ENCOUNTER_SETS,WAVE11_ABILITIES,WAVE11_BUILTIN_PACKS,WAVE11_CARDS,WAVE11_DEPS,WAVE11_GAME_ENCOUNTER_SETS,WAVE1_ABILITIES,WAVE1_BUILTIN_PACKS,WAVE1_DEPS,WAVE1_REPRINT_ABILITIES,WAVE2_ABILITIES,WAVE2_BUILTIN_PACKS,WAVE2_DEPS,WAVE2_REPRINT_ABILITIES,WAVE3_ABILITIES,WAVE3_BUILTIN_PACKS,WAVE3_CARDS,WAVE3_DEPS,WAVE3_REPRINT_ABILITIES,WAVE4_BUILTIN_PACKS,WAVE5_BUILTIN_PACKS,WAVE6_BUILTIN_PACKS,WAVE7_ABILITIES,WAVE7_BUILTIN_PACKS,WAVE7_CARDS,WAVE7_DEPS,WAVE8_ABILITIES,WAVE8_BUILTIN_PACKS,WAVE8_CARDS,WAVE8_DEPS,WAVE9_ABILITIES,WAVE9_BUILTIN_PACKS,WAVE9_CARDS,WAVE9_DEPS,YOUR_HERO,YOUR_IDENTITY,aDifferentCard,aScheme,abilitiesForCards,accelerationTokensOn,accusationWrongGuesses,accuse,accusedWrong,actingCharacter,action,activatesBeforeVillain,activatingEnemy,activationIs,activationOrderOf,addAccelerationToken,addCounters,addMainSchemeStageToVictoryDisplay,addToVictoryDisplay,addVillain,additionalAttackCost,additionalCostToPlay,additionalCostToReady,additionalPowerCost,additionalThwartCost,adjustBoostCount,advanceMainScheme,advanceToSetAsideVillain,after,afterNextCardPlayed,agile,allOf,allowUnlabeledAttack,alterEgoAction,alterEgoInterrupt,alterEgoResponse,amount,anAttackableEnemy,anEnemy,andThen,anyIn,anyNumberOfToughStatusCards,anyOf,anyOfCards,anyPlayerEliminated,applyAsBoostCard,applyRuleUntil,areaPlayersDefeated,assignDamage,atEndOfActivation,atEndOfAttack,atEndOfPhase,atEndOfRound,atEndOfThwart,atMost,attachCard,attachCost,attachInstruction,attack,attackAnEnemy,attackDamageDealt,attackExcessAsDealt,attackInProgress,attackInitiatedAgainst,attackPreventedAmount,attackPreventedTotal,attackResolvedLabeled,attackTarget,attackTotalAtk,attackUsedAtk,attackWasPrevented,attackableAsMinion,attackedBy,attackedPlayer,attackedThisPhase,attackingEnemy,attacksDealAdditionalDamage,attacksGainKeywords,attacksLoseKeywords,baseStatOf,baseStatsFromYourHero,basicPowerBy,basicPowerCost,basicPowerIs,basicPowerStatIs,basicThwartOnlyAgainst,basicThwartsIgnore,bindTargets,blankTextBoxForPlayers,blankTextBoxUntil,blanksTextBox,boost,boostAreaIconsOn,boostCardOf,boostCardsFromSet,boostIconsCount,boostIconsOn,buildScenarioDeck,buildWave11Scenario,builtinGameDeps,builtinPackProblems,campaignDefinitionOf,campaignDefinitionProblems,campaignDefinitionsOf,campaignDepsWithPacks,campaignGameWithPacks,campaignInstructionsOf,campaignLogAtLeast,campaignLogCardCounter,campaignLogCardRecorded,campaignLogCards,campaignLogHas,campaignLogIsSet,campaignLogValue,campaignModularPickProblem,canAttachTo,canAttachToCategory,canChangeForm,canEnterPlay,canFlip,canPayResources,canPlayFromHand,canRemoveThreatFrom,canSpendDifferentResources,canTakeStatus,canUseBasicPower,cancelBoostedActivation,cancelConsequentialDamage,cancelIt,cancelRevealedCard,cancelWhenRevealed,cannotActivate,cannotAttach,cannotBeAttachedUnlessInPlay,cannotBeCanceled,cannotBeDefeated,cannotBeHealed,cannotBeReadiedByPlayerCards,cannotChangeFormUntil,cannotChooseOption,cannotChooseToDiscard,cannotEnterPlay,cannotFlip,cannotHaveStatus,cannotLeavePlay,cannotMakeBasicAttacks,cannotReadyUntil,cannotRecover,cannotResolveTriggeredAbilities,cannotThwart,cardIdsIn,cardPoolWithPack,cardPoolWithPacks,cards,cardsFrom,cardsOfComposedSets,centralMainScheme,changeAdditionalForm,changeForm,changeFormCost,changeToHeroFormNamed,changeToHeroFormWithTrait,changeToOtherHeroForm,changeVillainForm,characterDidThisPhase,checkModularPickCount,checkPackCampaigns,checkPlayableDifficultySets,choiceFoundNothing,chooseCardCost,chooseCardType,chooseCards,chooseEncounterCardType,chooseGroup,chooseMainSchemeStages,chooseNumber,chooseOne,chooseOneBy,chooseOptions,choosePlayer,chooseTarget,chooseTargetCost,chosen,chosenGroup,chosenModularSetIds,chosenPlayer,chosenVillain,civilWarGameModes,civilWarModularSets,civilWarSidesOffer,communityDeckUrl,communityDecks,competitiveOnly,competitiveOnlyTexts,completeMainScheme,confuse,consideredToHaveHitPoints,consideredToHaveResourceIcon,constant,controllerOf,coreScenario,costIf,costModifier,costsPayableByAnyPlayer,countAmong,countBoostIcons,countOf,countTowardStartingHand,counterLimit,countersAsResource,countersOn,countsAs,coveredByEngineRule,createGameArea,createScenarioArea,createScenarioPlayArea,customContentOfPacks,customContentProblems,customModularPickProblem,customModularSetChoices,customScenarioProblems,damageAnEnemy,damageCardsCost,damageOn,damageSharedVillain,damageThisCardCost,damagedAtLeast,dealAsEncounterCard,dealDamage,dealDamageCost,dealDamageToChosenCost,dealEncounterCard,dealEncounterCardsCost,dealEncounterCardsToChosenPlayerCost,dealHiddenPiles,dealIndirectDamage,dealPoolOneAtATime,dealtEncounterCards,dealtEncounterCount,deckCountOf,deckDiscardIconsCount,declareDefender,defeat,defeatExcessDamage,defeatedWithExcessConsequentialDamage,defeatedWithExcessDamage,defeatingPlayer,defenderDefForAttack,defendingCharacter,defendsWithoutExhausting,defineAbilities,defineBuiltinPack,definePackAbilities,detach,difficultySetAlternativesFor,discard,discardAtRandom,discardBoostCard,discardCardsCost,discardChosenFromEncounterDeckCost,discardDeckUntil,discardEncounterCards,discardEncounterUntil,discardFacedownBoostCards,discardFromHand,discardFromHandCombinedCost,discardFromHandCost,discardRandomFromHandCost,discardStatusCost,discardStatusesTokensAndAttachments,discardThis,discardTopOfDeckCost,discardTopOfEncounterDeckCost,discardTuckedCost,discardUpToTopOfDeckCost,distinctAspectsOf,distinctTraitsOf,divide,doesNotExhaustToDefend,doubleDamageTaken,doubleNextCardSpent,doubleStat,doublesResourcesGeneratedForThisCard,doublesResourcesWhilePayingFor,draw,drawUpTo,droneFromDeck,dslFeatures,duringPlayerPhase,duringTurnOf,duringVillainPhaseStepOne,each,eachGroupInPod,eachPlayer,eachPlayerCost,eachTimeUntil,eitherCost,encounterCard,encounterCards,encounterCardsOf,encounterIconsInPlay,encounterLookDiscardCost,encounterSetAside,encounterSetOf,endGame,enemyActivates,enemyAttack,enemyAttacksEnemy,enemyAttacksYouCost,enemyCanAttackAnother,enemyLeader,enemyScheme,enemyTeam,enemyTeamChooses,enemyToAttack,engage,engagedPlayerOf,engineOnlyDslProblems,entersPlayExhausted,eventAmount,eventDamageTaken,eventDamageTakenBy,eventDealt,eventKindIs,eventPlayer,eventResult,eventSource,eventSourceEnemy,eventTarget,eventTargetsTogether,exactlyDefeated,exactlyDefeatedByPower,excludedFromAllyLimit,excludedFromPlayerSideSchemeLimit,exhaust,exhaustCardsCost,exhaustEachCost,exhaustThis,exhaustYourHero,exists,expertSetReplaceable,extraBoostCardsForVillain,faceNamed,fieldsIn,finalStep,find,findCard,firstAttackThisTurn,firstPlayer,firstPlayerAction,firstPlayerPicksFromHand,firstRevealGainsSurge,firstThisRound,flatten,flipCard,flipThis,focusedMainScheme,forAnIdentityNotInThisGame,forEachCard,forEachPlayer,forEachPlayerInChosenOrder,forcedAction,forcedInterrupt,forcedResponse,formChangeCost,friendlyCharacterAttacks,fromAnyAspect,gainFromHiddenPile,gainKeywordUntil,gainTraitUntil,gainTraitsOfUntil,gainsAbility,gainsIcon,gainsKeyword,gainsKeywordX,gainsKeywordsOf,gainsTrait,gainsTraitsOf,gameAreasSplit,gameDepsWithPack,gameDepsWithPacks,genePoolThreatOffer,generatesAmount,generatesPerCard,gets,giveBasicPowerBoostCard,giveBoostCard,giveBoostCardsCost,giveHeldBoostCard,giveStatus,giveStatusCost,giveTough,gmwBalancedHiddenFields,grantAdditionalMulligans,grantOwnedCards,grantedTo,grantingCard,grantsPreparation,groupPlayerCount,handCountOf,handSizeOf,hasAttachment,hasNamedResource,hasPrintedBoostAbility,hasStatus,hasTaggedAbility,hasTrait,heal,healCost,healYourIdentityCost,heroAction,heroInterrupt,heroNoCharacterIsTitledAs,heroResource,heroResponse,hiddenPileCount,highestStatAmong,hitPointsOf,holdMinion,horsemanSidesOffer,host,identifyMole,identityOf,ifElse,ifThen,ignoreAbilities,ignoreBoost,ignoreBoostAbilities,ignoreBoostForThisAttack,ignores,ignoresRetaliate,inAdditionalForm,inCampaign,inCampaignLogField,inCompetitiveMode,inDiscard,inEncounterSet,inForm,inGroup,inHand,inMode,inPlay,inPlayAreaOf,inScenarioPlayArea,inVictoryDisplay,increaseDamage,increaseDamageTaken,increaseNextCardCost,infinitesGenePoolThreatRecommendation,instead,interrupt,isAlterEgo,isAttached,isBaseEncounterSetId,isBaseScenarioId,isConfused,isHero,isModularChoice,isNotReadyCard,isPlainJson,isScenarioSpecificSet,isStunned,isUnscriptedAbilityIssue,joinGameArea,keepsExhausted,lastPlayedThisRound,leavingPlayLoses,limitPerPaidCard,logCardList,logCardRef,logFlag,logNumber,logOption,logText,lookAt,lookAtAndRearrange,lookAtTopOfScenarioDeckThenPlace,loseKeywordUntil,loseTraitUntil,losesIcon,losesKeyword,made,mainSchemeAdvancedBy,mainSchemeMarkedBy,mainSchemePicksOffer,mainSchemeStageGist,mainSchemeStageNumber,mainSchemeStagesOffer,mainSchemeStagesProblem,max,maxDamageTaken,maxOnePerTriggeringInstance,maxSustainedDamage,mayLookAtTopOfEncounterDeckUntil,mergeCosts,mergeRegistries,min,minDamageTaken,modifyAttack,modifyBasicPower,modifyCardEffect,modifyCardEffectsUntil,modifyConsequentialDamage,modifyStat,modifyStatOf,modifyThwart,modularPickCountProblem,modularPickCountRange,modularPickProblem,modularSetContents,mojoCheckedOffSets,mojoModularSetPicks,mostCommonHandTypeCount,moveActiveCounterToNextInRow,moveActiveCounterToNextVillain,moveBoostCards,moveCards,moveCardsInto,moveCounters,moveThreat,multiplyStat,named,namedByTeamUpOf,nextAfter,not,notCountedTowardHandSize,notMatching,notOfChosenCardType,obligation,ofChosenCardType,ofClassification,ofIdentitySetTitled,ofTeamUpSet,offersEasierStart,offersGenePoolThreat,on,onChosenMainScheme,oncePerPaidCard,oncePerPhase,oncePerPhasePerEventPlayer,oncePerRound,oncePerRoundPerPlayer,oneCopyOf,onlyCharacterRemovesThreat,onlySourceRemovesThreat,onlyThwartsRemoveThreat,opsOfKind,option,otherFaceOf,otherPlayers,outsideFact,overpaidWhenPlayed,ownScriptsOf,ownerOf,packCampaignDefinitionOf,packCampaignDefinitions,packCampaignRecords,packCampaignsOf,packEncounterSetRecords,packModularSetChoices,obligation as packObligation,packScenarioOffer,packScenarioRecords,paidCards,paidInPlayCards,paidType,paidTypeCount,paidUsingResourceFrom,paidWith,paidWithCard,paidWithOnly,paidWithResourceCard,pairCards,pairLimit,partOf,passEncounterCard,payPrintedCostOf,payingFor,perHero,placeCountersCost,placeDamage,placeOnTopOrBottom,placeOnTopOrBottomOfPlayerDeck,placeThreat,placeThreatOnSharedScheme,playFromDeckIgnoringCost,playFromDeckReducingCost,playFromHandIgnoringCost,playFromHandReducingCost,playFromSeparateDeck,playNote,playOnlyIf,playSetAside,playTuckedCard,playWithTopOfDeckFaceup,playWithTopOfEncounterDeckFaceup,playableAttachments,playableScenario,playableScenarioOffer,playableScenarioWithCustom,playableStarterDeckSetup,playableTopOfDeck,playableTucked,playedThisPhase,playedThisRound,playedThisTurn,playedVia,playerOrElse,playersCannotDiscard,playersWhere,preparation,preventAllDamageTo,preventConsequentialDamage,preventDamage,preventThreat,printedBoostAreaIconsOn,printedCostAtLeast,printedCostOf,printedForm,printedHpNumeralOf,printedHpOf,printedResourcesInHandAs,printedResourcesOf,printedStatOf,printsAbility,product,publishIssues,putIntoPlay,putIntoPlayAsHost,putIntoPlayFacedown,putIntoPlayFromSetAside,putLinkedAllyIntoPlay,putMainSchemeStageIntoPlay,query,raiseMoment,randomCivilWarScenario,reachableFromPod,reaching,readPackInput,readsAtkOf,readsPaymentTypesOf,ready,readyCardsCost,recordInCampaignLog,reduceCostOfCards,reduceCostToPlay,reduceDamage,reduceDamageTo,reduceNextCardCost,reducesAttackDamageTaken,refCount,refMatches,remainingHpCompare,remainingHpOf,removeAccelerationToken,removeAllCounters,removeAllCountersFrom,removeAnAccelerationToken,removeCounter,removeCountersAmong,removeCountersFrom,removeEachCounterFrom,removeFromCampaign,removeMainSchemeStage,removeMainSchemeStages,removeStatus,removeThreat,removeThreatCost,removeThreatFromAScheme,removeThreatFromChosenCost,removeThreatUpToCost,removeUpToCounters,removeVillain,removedFromGameCards,reorderCards,repeatTimes,repeatWhile,replaceAttachHost,replaceBoostCount,replaceLeaveDestination,replaceNextVillainPhaseWithPlayerPhase,replaceStatus,replaceTuckHost,reportFact,resetHitPoints,resolveAttackAgainst,resolveBoostAbilitiesOf,resolveForcedInterruptOf,resolveForcedResponseCost,resolveForcedResponseOf,resolveModes,resolveOneTagged,resolvePreparationsOf,resolveSetups,resolveSpecialCost,resolveSpecials,resolveSpecialsOf,resolveTagged,resolveWhenDefeatedOf,resolveWhenRevealedOf,resource,resourceTypesOf,resourcesGeneratedAsWild,resourcesPaidBy,response,restrictedLimit,retargetAttack,retargetPlayerAttack,returnEachToHandCost,returnToHandAfterResolving,returnToHandCost,revealCard,revealEncounterCard,revealFromSetAsideModularSet,revealHeldMinion,revealHiddenPile,revealInstead,revealMainSchemeStage,revealNextVillainStage,revealSetAside,revealTopOfScenarioDeck,revealTopOfSeparateDeck,revealedFromEncounterDeck,revealedPileCardCount,rotateEngagement,rule,sameClassificationAs,scaled,scenarioArea,scenarioAreaCount,scenarioDeck,scenarioGameSetIds,scenarioSideClause,scenarioWithPacks,scenarioWithVillain,schemeStartedByAttackBoost,schemeThreatOn,searchAndReveal,searchCollection,searchEncounterIntoPlayCost,seedHiddenPiles,selectCards,self,sentence,separateDeckCards,separateDeckCountOf,setActiveVillain,setAside,setAsideDestination,setAsideModularSetCount,setDefeatDestination,setRemainingHitPoints,setVar,setVillainAside,setVillainSide,setup,sha256Hex,sharesTitleWith,sharesTraitWith,sharesTraitWithHeroOf,shuffleDeck,shuffleEncounterDeck,shuffleInSetAsideModularSet,shuffleIntoSeparateDeck,shuffleMainSchemeStageGroup,shuffleMainSchemeStages,shuffleSeparateDeck,shuffleTopOfSeparateDeckIntoEncounterDeck,sitOut,skipNextVillainPhase,skippedCommunityDecks,skirmishOffer,special,spend,spendChosen,spendDifferentResources,spendEqualTo,spendPrinted,spendResources,spendSameType,spendUpTo,spendX,spendXResources,spendableForAnyPlayer,spendableForPlayersWhere,spendableFromTucked,splitIssues,standardSetReplaceable,starIconsOn,starterDeckSetup,statCompare,statOf,stateCheck,stateCheckFromEntering,statusCount,statusLimit,staysInHand,stillCountedByDiscarder,stun,sum,superlative,superlativePlayer,surge,swapCards,swapIdentity,swapMainScheme,swapVillain,swapVillainByTrait,tagged,taggedAbilitiesOn,takeAnyDamageCost,takeControl,takeDamage,takeDamageCost,takeIndirectDamageCost,takeIntoHand,takesConsequentialDamage,takesDamageOnlyFrom,takesDamageOnlyFromAttacks,takesFirstTurn,teamUpCharacter,teamUpCharacters,textBoxCannotBeBlanked,thatAttackGainsKeywords,thatPlayer,theAccused,theAffectedCard,theMainScheme,theMole,theVillain,thisCardGenerates,thisGroup,threatAtLeast,threatOn,thwart,thwartAScheme,thwartInProgress,thwartTarget,titled,toScenarioDeck,topOfDeck,topOfDeckIsFaceup,topOfDeckMatches,topOfEncounterDeckIsFaceup,topOfEncounterDeckMatches,topOfEncounterDeckShowsIcons,topOfEncounterDeckShowsNoIcons,topOfYourDeckHas,totalPrintedCost,totalPrintedResources,totalStatOf,traitEncounterDeck,traitNumber,treatAsAlly,treatAsMinion,treatAttachedAllyAsMinion,treatAttachedHeroAsMinion,treatAttachedMinionAsAlly,treatAttachedVillainAsMinion,treatSelfAsAlly,tuckCards,tuckLimit,tuckedCount,tuckedUnder,tuckedUnderRef,turnFacedown,uncancellable,undefendedAttack,upgradesCannotBeRemoved,useThwInsteadOfAtk,usingBasicPower,validateBuiltinPack,validateDefinition,validatePack,valueAtLeast,valueAtMost,valueEquals,varAtLeast,varFor,varOf,victoryCondition,victoryDisplayCards,victoryDisplayCount,villainChoiceOf,villainChoiceOffer,villainOnSide,villainOptionOf,villainStageNumberOf,wave10Scenario,wave10StarterDeckSetup,wave11Scenario,wave11ScenarioRecord,wave11StarterDeckSetup,wave1ReprintPairs,wave1Scenario,wave1StarterDeckSetup,wave2ReprintPairs,wave2Scenario,wave2StarterDeckSetup,wave3ReprintPairs,wave3Scenario,wave3StarterDeckSetup,wave7Scenario,wave7StarterDeckSetup,wave8Scenario,wave8StarterDeckSetup,wave9Scenario,wave9StarterDeckSetup,when,whenCompleted,whenDefeated,whenRevealed,whenRevealedAlterEgo,whenRevealedHero,whenSpentGenerate,whileOnChosenMainScheme,whileTucked,withFewestCounters,withModularSetContents,withMostCounters,you,youAre,youAreNamed,youHaveTrait,yourIdentity,yourLeader,yourMainScheme,yourTeam,zone,zoneCountOf};
package/dist/mc-pack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{src_exports}from"./chunks/chunk-YO3NIZZE.js";import{formatImportReport,importMarvelCdbPack}from"./chunks/chunk-WGWA34S6.js";import{PackBuildError,assemblePack,buildPack,loadPackSource}from"./chunks/chunk-XHIDOSKF.js";import{publishIssues,readPackInput,splitIssues,validatePack}from"./chunks/chunk-7MEEJH7D.js";import{SMOKE_BASE_DECK,SMOKE_SCENARIOS,smokeTestPack}from"./chunks/chunk-PJX7D342.js";import"./chunks/chunk-JSSYCHZB.js";import"./chunks/chunk-JZ4GBK6N.js";import{existsSync}from"node:fs";import{join,resolve}from"node:path";import{createJiti}from"jiti";function sdkModuleNames(){let published="@champions-digital-game/mod-sdk";return published&&published!=="@mc/mod-sdk"?["@mc/mod-sdk",published]:["@mc/mod-sdk"]}function packModuleImporter(){let virtualModules=Object.fromEntries(sdkModuleNames().map(name=>[name,src_exports]));return path=>createJiti(path,{virtualModules,fsCache:!1,moduleCache:!1,interopDefault:!1}).import(path)}var EXIT_OK=0,EXIT_PACK_PROBLEM=1,EXIT_USAGE=2,consoleIo={out:line=>process.stdout.write(`${line}
2
+ import{src_exports}from"./chunks/chunk-HVUCR22H.js";import{formatImportReport,importMarvelCdbPack}from"./chunks/chunk-PB6KXNXP.js";import{PackBuildError,assemblePack,buildPack,loadPackSource}from"./chunks/chunk-URLIN52M.js";import{publishIssues,readPackInput,splitIssues,validatePack}from"./chunks/chunk-2XS47E3T.js";import{SMOKE_BASE_DECK,SMOKE_SCENARIOS,smokeTestPack}from"./chunks/chunk-DKCXOHRM.js";import"./chunks/chunk-A3WBGQ2N.js";import"./chunks/chunk-JYDEFRIZ.js";import{existsSync}from"node:fs";import{join,resolve}from"node:path";import{createJiti}from"jiti";function sdkModuleNames(){let published="@champions-digital-game/mod-sdk";return published&&published!=="@mc/mod-sdk"?["@mc/mod-sdk",published]:["@mc/mod-sdk"]}function packModuleImporter(){let virtualModules=Object.fromEntries(sdkModuleNames().map(name=>[name,src_exports]));return path=>createJiti(path,{virtualModules,fsCache:!1,moduleCache:!1,interopDefault:!1}).import(path)}var EXIT_OK=0,EXIT_PACK_PROBLEM=1,EXIT_USAGE=2,consoleIo={out:line=>process.stdout.write(`${line}
3
3
  `),err:line=>process.stderr.write(`${line}
4
4
  `)},USAGE=`mc-pack: build, check and test Marvel Champions Digital content packs
5
5
 
@@ -23,4 +23,4 @@ validate, build and test run the pack's own code: they import its abilities/inde
23
23
  user's access to files, the network and the environment. Run them only on a pack you trust, or in a sandbox (a CI
24
24
  job with no secrets).
25
25
 
26
- Exit codes: 0 success, 1 the pack has a problem, 2 usage error.`,UsageError=class extends Error{},VALUE_FLAGS=new Set(["out","games","scenario","max-commands","id","app"]),BOOLEAN_FLAGS=new Set(["allow-unscripted","publish","help","version"]);function parseArgs(argv){let positional=[],flags=new Map;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="-h")flags.set("help",!0);else if(arg==="-v")flags.set("version",!0);else if(arg.startsWith("--")){let eq=arg.indexOf("="),name=eq<0?arg.slice(2):arg.slice(2,eq);if(BOOLEAN_FLAGS.has(name)){if(eq>=0)throw new UsageError(`--${name} takes no value`);flags.set(name,!0)}else if(VALUE_FLAGS.has(name)){let value2=eq>=0?arg.slice(eq+1):argv[++i];if(value2===void 0||value2==="")throw new UsageError(`--${name} needs a value`);flags.set(name,value2)}else throw new UsageError(`unknown option --${name}`)}else positional.push(arg)}return{positional,flags}}var value=(parsed,name)=>{let v=parsed.flags.get(name);return typeof v=="string"?v:void 0};function positiveInt(parsed,name){let raw=value(parsed,name);if(raw===void 0)return;let n=Number(raw);if(!Number.isInteger(n)||n<1)throw new UsageError(`--${name} must be a whole number of at least 1`);return n}function packDir(parsed,command){let[dir,...extra]=parsed.positional;if(dir===void 0)throw new UsageError(`${command} needs a folder`);if(extra.length>0)throw new UsageError(`${command} takes one folder, got ${parsed.positional.length}`);let full=resolve(dir);if(!existsSync(full))throw new UsageError(`${dir}: no such folder`);return full}function allowOnly(parsed,command,allowed){for(let name of parsed.flags.keys())if(!allowed.includes(name))throw new UsageError(`${command} does not take --${name}`)}var errorText=error=>error instanceof Error?error.message:String(error);async function loadBuilt(dir){let pack=assemblePack(await loadPackSource(dir,{importModule:packModuleImporter()}));return readPackInput(pack.manifest,pack.files)}function formatIssues(issues){let{defects,unscripted}=splitIssues(issues),lines=[];if(defects.length>0){lines.push(`${defects.length} problem${defects.length===1?"":"s"}:`);for(let issue of defects)lines.push(` ${issue.path}: ${issue.message}`)}if(unscripted.length>0){lines.push(`${unscripted.length} unscripted abilit${unscripted.length===1?"y":"ies"} (write them in abilities/):`);for(let issue of unscripted)lines.push(` ${issue.path}: ${issue.message}`)}return lines}async function validateCommand(parsed,io){allowOnly(parsed,"validate",["allow-unscripted","publish"]);let dir=packDir(parsed,"validate"),pack=await loadBuilt(dir),publish=parsed.flags.has("publish"),draft=existsSync(join(dir,"DRAFT"));publish&&draft&&io.out(`${pack.manifest.id}: a DRAFT, never published; the publish check is skipped`);let issues=[...validatePack(pack),...publish&&!draft?publishIssues(pack.manifest):[]],{defects,unscripted}=splitIssues(issues),name=`${pack.manifest.id}@${pack.manifest.version}`;if(issues.length===0)return io.out(`${name}: valid (${pack.cards.length} cards, ${Object.keys(pack.abilities).length} abilities)`),EXIT_OK;let lines=formatIssues(issues);if(defects.length===0&&parsed.flags.has("allow-unscripted")){io.out(`${name}: valid, ${unscripted.length} abilit${unscripted.length===1?"y":"ies"} to script`);for(let line of lines)io.out(line);return EXIT_OK}io.err(`${name}: invalid`);for(let line of lines)io.err(line);return EXIT_PACK_PROBLEM}async function buildCommand(parsed,io){allowOnly(parsed,"build",["out"]);let dir=packDir(parsed,"build"),out=value(parsed,"out");if(out===void 0)throw new UsageError("build needs --out <dir>");try{let result=await buildPack(dir,resolve(out),{importModule:packModuleImporter()}),{manifest}=result;return io.out(`${manifest.id}@${manifest.version}: built ${result.zipPath}`),io.out(` ${result.zipBytes} bytes, sha256 ${result.zipSha256}`),io.out(` ${manifest.files.length} files, ${manifest.totalBytes} bytes unzipped`),io.out(` requires app ${manifest.requires.app}; DSL features: ${manifest.requires.dslFeatures.join(", ")||"none"}`),EXIT_OK}catch(error){if(!(error instanceof PackBuildError))throw error;io.err("build failed: the pack is invalid");for(let line of formatIssues(error.issues))io.err(line);return EXIT_PACK_PROBLEM}}var describeGame=game=>{let where=game.deck===SMOKE_BASE_DECK?` at ${game.campaign?`${game.campaign}/${game.node} (${game.scenario})`:game.scenario}${game.modularSet?` with ${game.modularSet}`:""}${game.difficulty?`, ${game.difficulty}`:""}`:"",head=` ${game.deck}${where} seed ${game.seed}: `;if(!game.ok)return`${head}FAILED: ${game.error??"unknown error"}`;let played=game.packCardsPlayed.length>0?`; pack cards played or revealed: ${game.packCardsPlayed.join(", ")}`:"";return`${head}${game.outcome??"ended"} in round ${game.rounds} (${game.commands} commands)${played}`};async function testCommand(parsed,io){allowOnly(parsed,"test",["games","scenario","max-commands"]);let dir=packDir(parsed,"test"),scenario=value(parsed,"scenario")??"rhino";if(!SMOKE_SCENARIOS.includes(scenario))throw new UsageError(`--scenario must be one of ${SMOKE_SCENARIOS.join(", ")}`);let games=positiveInt(parsed,"games")??3,maxCommands=positiveInt(parsed,"max-commands"),pack=await loadBuilt(dir),issues=validatePack(pack);if(issues.length>0){io.err(`${pack.manifest.id}: not tested, the pack is invalid (run mc-pack validate)`);for(let line of formatIssues(issues))io.err(line);return EXIT_PACK_PROBLEM}io.out(`${pack.manifest.id}@${pack.manifest.version}: ${games} game(s) per deck, scenario and modular set (Core scenario: ${scenario})`);let result=smokeTestPack(pack,{games,scenario,...maxCommands!==void 0?{maxCommands}:{},onGame:game=>(game.ok?io.out:io.err)(describeGame(game))});for(let note of result.notes)io.out(`note: ${note}`);let failed=result.games.filter(g=>!g.ok).length;return failed>0?(io.err(`${failed} of ${result.games.length} game(s) failed`),EXIT_PACK_PROBLEM):(io.out(`all ${result.games.length} game(s) passed`),EXIT_OK)}async function importCommand(parsed,io){allowOnly(parsed,"import-marvelcdb",["out","id","app"]);let src=packDir(parsed,"import-marvelcdb"),out=value(parsed,"out"),packId=value(parsed,"id"),app=value(parsed,"app"),report=await importMarvelCdbPack(src,{...out!==void 0?{outDir:resolve(out)}:{},...packId!==void 0?{packId}:{},...app!==void 0?{app}:{}}),text=formatImportReport(report);if(!report.normalized||report.validationIssues.length>0)return io.err(text),EXIT_PACK_PROBLEM;if(io.out(text),report.unscriptedIssues.length>0){io.out(`${report.unscriptedIssues.length} abilities to script, listed in abilities/index.ts:`);for(let issue of report.unscriptedIssues)io.out(` ${issue.path}: ${issue.message}`)}return io.out(report.outDir?`written to ${report.outDir}`:"dry run: nothing written (pass --out <dir>)"),EXIT_OK}var COMMANDS={validate:validateCommand,build:buildCommand,test:testCommand,"import-marvelcdb":importCommand};async function runCli(argv,io=consoleIo){let[command,...rest]=argv;try{if(command===void 0||command==="--help"||command==="-h"||command==="help")return io.out(USAGE),command===void 0?EXIT_USAGE:EXIT_OK;if(command==="--version"||command==="-v")return io.out("0.48.0"),EXIT_OK;let run=COMMANDS[command];if(!run)throw new UsageError(`unknown command "${command}"`);let parsed=parseArgs(rest);return parsed.flags.has("help")?(io.out(USAGE),EXIT_OK):await run(parsed,io)}catch(error){return error instanceof UsageError?(io.err(`mc-pack: ${error.message}`),io.err("run mc-pack --help for usage"),EXIT_USAGE):(io.err(`mc-pack ${command}: ${errorText(error)}`),EXIT_PACK_PROBLEM)}}process.exitCode=await runCli(process.argv.slice(2));
26
+ Exit codes: 0 success, 1 the pack has a problem, 2 usage error.`,UsageError=class extends Error{},VALUE_FLAGS=new Set(["out","games","scenario","max-commands","id","app"]),BOOLEAN_FLAGS=new Set(["allow-unscripted","publish","help","version"]);function parseArgs(argv){let positional=[],flags=new Map;for(let i=0;i<argv.length;i++){let arg=argv[i];if(arg==="-h")flags.set("help",!0);else if(arg==="-v")flags.set("version",!0);else if(arg.startsWith("--")){let eq=arg.indexOf("="),name=eq<0?arg.slice(2):arg.slice(2,eq);if(BOOLEAN_FLAGS.has(name)){if(eq>=0)throw new UsageError(`--${name} takes no value`);flags.set(name,!0)}else if(VALUE_FLAGS.has(name)){let value2=eq>=0?arg.slice(eq+1):argv[++i];if(value2===void 0||value2==="")throw new UsageError(`--${name} needs a value`);flags.set(name,value2)}else throw new UsageError(`unknown option --${name}`)}else positional.push(arg)}return{positional,flags}}var value=(parsed,name)=>{let v=parsed.flags.get(name);return typeof v=="string"?v:void 0};function positiveInt(parsed,name){let raw=value(parsed,name);if(raw===void 0)return;let n=Number(raw);if(!Number.isInteger(n)||n<1)throw new UsageError(`--${name} must be a whole number of at least 1`);return n}function packDir(parsed,command){let[dir,...extra]=parsed.positional;if(dir===void 0)throw new UsageError(`${command} needs a folder`);if(extra.length>0)throw new UsageError(`${command} takes one folder, got ${parsed.positional.length}`);let full=resolve(dir);if(!existsSync(full))throw new UsageError(`${dir}: no such folder`);return full}function allowOnly(parsed,command,allowed){for(let name of parsed.flags.keys())if(!allowed.includes(name))throw new UsageError(`${command} does not take --${name}`)}var errorText=error=>error instanceof Error?error.message:String(error);async function loadBuilt(dir){let pack=assemblePack(await loadPackSource(dir,{importModule:packModuleImporter()}));return readPackInput(pack.manifest,pack.files)}function formatIssues(issues){let{defects,unscripted}=splitIssues(issues),lines=[];if(defects.length>0){lines.push(`${defects.length} problem${defects.length===1?"":"s"}:`);for(let issue of defects)lines.push(` ${issue.path}: ${issue.message}`)}if(unscripted.length>0){lines.push(`${unscripted.length} unscripted abilit${unscripted.length===1?"y":"ies"} (write them in abilities/):`);for(let issue of unscripted)lines.push(` ${issue.path}: ${issue.message}`)}return lines}async function validateCommand(parsed,io){allowOnly(parsed,"validate",["allow-unscripted","publish"]);let dir=packDir(parsed,"validate"),pack=await loadBuilt(dir),publish=parsed.flags.has("publish"),draft=existsSync(join(dir,"DRAFT"));publish&&draft&&io.out(`${pack.manifest.id}: a DRAFT, never published; the publish check is skipped`);let issues=[...validatePack(pack),...publish&&!draft?publishIssues(pack.manifest):[]],{defects,unscripted}=splitIssues(issues),name=`${pack.manifest.id}@${pack.manifest.version}`;if(issues.length===0)return io.out(`${name}: valid (${pack.cards.length} cards, ${Object.keys(pack.abilities).length} abilities)`),EXIT_OK;let lines=formatIssues(issues);if(defects.length===0&&parsed.flags.has("allow-unscripted")){io.out(`${name}: valid, ${unscripted.length} abilit${unscripted.length===1?"y":"ies"} to script`);for(let line of lines)io.out(line);return EXIT_OK}io.err(`${name}: invalid`);for(let line of lines)io.err(line);return EXIT_PACK_PROBLEM}async function buildCommand(parsed,io){allowOnly(parsed,"build",["out"]);let dir=packDir(parsed,"build"),out=value(parsed,"out");if(out===void 0)throw new UsageError("build needs --out <dir>");try{let result=await buildPack(dir,resolve(out),{importModule:packModuleImporter()}),{manifest}=result;return io.out(`${manifest.id}@${manifest.version}: built ${result.zipPath}`),io.out(` ${result.zipBytes} bytes, sha256 ${result.zipSha256}`),io.out(` ${manifest.files.length} files, ${manifest.totalBytes} bytes unzipped`),io.out(` requires app ${manifest.requires.app}; DSL features: ${manifest.requires.dslFeatures.join(", ")||"none"}`),EXIT_OK}catch(error){if(!(error instanceof PackBuildError))throw error;io.err("build failed: the pack is invalid");for(let line of formatIssues(error.issues))io.err(line);return EXIT_PACK_PROBLEM}}var describeGame=game=>{let where=game.deck===SMOKE_BASE_DECK?` at ${game.campaign?`${game.campaign}/${game.node} (${game.scenario})`:game.scenario}${game.modularSet?` with ${game.modularSet}`:""}${game.difficulty?`, ${game.difficulty}`:""}`:"",head=` ${game.deck}${where} seed ${game.seed}: `;if(!game.ok)return`${head}FAILED: ${game.error??"unknown error"}`;let played=game.packCardsPlayed.length>0?`; pack cards played or revealed: ${game.packCardsPlayed.join(", ")}`:"";return`${head}${game.outcome??"ended"} in round ${game.rounds} (${game.commands} commands)${played}`};async function testCommand(parsed,io){allowOnly(parsed,"test",["games","scenario","max-commands"]);let dir=packDir(parsed,"test"),scenario=value(parsed,"scenario")??"rhino";if(!SMOKE_SCENARIOS.includes(scenario))throw new UsageError(`--scenario must be one of ${SMOKE_SCENARIOS.join(", ")}`);let games=positiveInt(parsed,"games")??3,maxCommands=positiveInt(parsed,"max-commands"),pack=await loadBuilt(dir),issues=validatePack(pack);if(issues.length>0){io.err(`${pack.manifest.id}: not tested, the pack is invalid (run mc-pack validate)`);for(let line of formatIssues(issues))io.err(line);return EXIT_PACK_PROBLEM}io.out(`${pack.manifest.id}@${pack.manifest.version}: ${games} game(s) per deck, scenario and modular set (Core scenario: ${scenario})`);let result=smokeTestPack(pack,{games,scenario,...maxCommands!==void 0?{maxCommands}:{},onGame:game=>(game.ok?io.out:io.err)(describeGame(game))});for(let note of result.notes)io.out(`note: ${note}`);let failed=result.games.filter(g=>!g.ok).length;return failed>0?(io.err(`${failed} of ${result.games.length} game(s) failed`),EXIT_PACK_PROBLEM):(io.out(`all ${result.games.length} game(s) passed`),EXIT_OK)}async function importCommand(parsed,io){allowOnly(parsed,"import-marvelcdb",["out","id","app"]);let src=packDir(parsed,"import-marvelcdb"),out=value(parsed,"out"),packId=value(parsed,"id"),app=value(parsed,"app"),report=await importMarvelCdbPack(src,{...out!==void 0?{outDir:resolve(out)}:{},...packId!==void 0?{packId}:{},...app!==void 0?{app}:{}}),text=formatImportReport(report);if(!report.normalized||report.validationIssues.length>0)return io.err(text),EXIT_PACK_PROBLEM;if(io.out(text),report.unscriptedIssues.length>0){io.out(`${report.unscriptedIssues.length} abilities to script, listed in abilities/index.ts:`);for(let issue of report.unscriptedIssues)io.out(` ${issue.path}: ${issue.message}`)}return io.out(report.outDir?`written to ${report.outDir}`:"dry run: nothing written (pass --out <dir>)"),EXIT_OK}var COMMANDS={validate:validateCommand,build:buildCommand,test:testCommand,"import-marvelcdb":importCommand};async function runCli(argv,io=consoleIo){let[command,...rest]=argv;try{if(command===void 0||command==="--help"||command==="-h"||command==="help")return io.out(USAGE),command===void 0?EXIT_USAGE:EXIT_OK;if(command==="--version"||command==="-v")return io.out("0.49.0"),EXIT_OK;let run=COMMANDS[command];if(!run)throw new UsageError(`unknown command "${command}"`);let parsed=parseArgs(rest);return parsed.flags.has("help")?(io.out(USAGE),EXIT_OK):await run(parsed,io)}catch(error){return error instanceof UsageError?(io.err(`mc-pack: ${error.message}`),io.err("run mc-pack --help for usage"),EXIT_USAGE):(io.err(`mc-pack ${command}: ${errorText(error)}`),EXIT_PACK_PROBLEM)}}process.exitCode=await runCli(process.argv.slice(2));
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import{SMOKE_BASE_DECK,SMOKE_SCENARIOS,playToOutcome,smokeTestPack}from"./chunks/chunk-PJX7D342.js";import"./chunks/chunk-JSSYCHZB.js";import"./chunks/chunk-JZ4GBK6N.js";export{SMOKE_BASE_DECK,SMOKE_SCENARIOS,playToOutcome,smokeTestPack};
1
+ import{SMOKE_BASE_DECK,SMOKE_SCENARIOS,playToOutcome,smokeTestPack}from"./chunks/chunk-DKCXOHRM.js";import"./chunks/chunk-A3WBGQ2N.js";import"./chunks/chunk-JYDEFRIZ.js";export{SMOKE_BASE_DECK,SMOKE_SCENARIOS,playToOutcome,smokeTestPack};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@champions-digital-game/mod-sdk",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "description": "The mod SDK for Marvel Champions Digital content packs: the pack schema, the ability DSL, and the mc-pack validate, build, test and import-marvelcdb tools.",
5
5
  "keywords": [
6
6
  "card-game",
@@ -2480,7 +2480,6 @@ export declare const on: {
2480
2480
  readonly what?: TargetQuery;
2481
2481
  readonly inDiscard?: boolean;
2482
2482
  }) => EventPattern;
2483
- /** "When/After X is defeated"; `byYou`: "after *you* defeat a minion". */
2484
2483
  /**
2485
2484
  * "After Abjuration prevents 2 or more damage from a single attack" (docs/phase7-wave4.md §3.20): this card prevented
2486
2485
  * damage — by its `preventAllDamageTo` constant or a `preventDamage` effect of its own. `fromAttack`: the damage was an
@@ -2490,6 +2489,14 @@ export declare const on: {
2490
2489
  readonly fromAttack?: boolean;
2491
2490
  readonly atLeast?: number;
2492
2491
  }) => EventPattern;
2492
+ /**
2493
+ * "When/After X is defeated". `byYou`: "after *you* defeat a minion" is the player's own doing: their identity (or an
2494
+ * event, or upgrade not on another friendly character) defeated it, **not** an ally, support or other card (RRG 1.8 "You, Your",
2495
+ * p. 49: a game function "you" perform resolves as if the identity performed it; FFG ruling January 24, 2025
2496
+ * (Change of Fortune): an event a player plays counts as the identity). An ally's attack, thwart or own ability
2497
+ * damage is the ally's, so a card that does mean "a character you control" names its own `sourceIs` (it overrides
2498
+ * this one: `{ ...on.defeated(q, { byYou: true }), sourceIs: ... }`; issue #817).
2499
+ */
2493
2500
  readonly defeated: (what: Who, opts?: {
2494
2501
  readonly byYou?: boolean;
2495
2502
  /**
@@ -2518,9 +2525,8 @@ export declare const on: {
2518
2525
  /**
2519
2526
  * "After [X] (or an event you play) defeats a minion or side scheme" (Small but Mighty, 13001a; docs/phase7-
2520
2527
  * wave2.md §17.2): matches both `characterDefeated` and `schemeDefeated` by *source* — which card dealt the
2521
- * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })`'s `playerIs` also
2522
- * accepts an ally's own attack, which a card naming a specific card ("Wasp, or an event") needs to exclude;
2523
- * `source` should therefore name the card(s), not just `controller: "you"` alone.
2528
+ * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })` is the
2529
+ * identity-or-extension reading of "you defeat" (an ally's defeat is not heard); this one names the card(s) itself.
2524
2530
  */
2525
2531
  readonly defeats: (source: TargetQuery) => EventPattern;
2526
2532
  /**
@@ -2528,7 +2534,9 @@ export declare const on: {
2528
2534
  * distinct trigger event from `defeated`, which is characters only. "When attached scheme is defeated"
2529
2535
  * (Followed, `cap` pack): `on.schemeDefeated("host")`.
2530
2536
  */
2531
- readonly schemeDefeated: (what: Who) => EventPattern;
2537
+ readonly schemeDefeated: (what: Who, opts?: {
2538
+ readonly byYou?: boolean;
2539
+ }) => EventPattern;
2532
2540
  /**
2533
2541
  * "After the last threat is removed from this scheme" (docs/phase7-wave7.md §3.34): a removal that took `what` from
2534
2542
  * some threat to none. The way a permanent side scheme answers reaching no threat without being defeated: RRG 1.8
@@ -3411,7 +3419,6 @@ export declare const when: {
3411
3419
  readonly what?: TargetQuery;
3412
3420
  readonly inDiscard?: boolean;
3413
3421
  }) => EventPattern;
3414
- /** "When/After X is defeated"; `byYou`: "after *you* defeat a minion". */
3415
3422
  /**
3416
3423
  * "After Abjuration prevents 2 or more damage from a single attack" (docs/phase7-wave4.md §3.20): this card prevented
3417
3424
  * damage — by its `preventAllDamageTo` constant or a `preventDamage` effect of its own. `fromAttack`: the damage was an
@@ -3421,6 +3428,14 @@ export declare const when: {
3421
3428
  readonly fromAttack?: boolean;
3422
3429
  readonly atLeast?: number;
3423
3430
  }) => EventPattern;
3431
+ /**
3432
+ * "When/After X is defeated". `byYou`: "after *you* defeat a minion" is the player's own doing: their identity (or an
3433
+ * event, or upgrade not on another friendly character) defeated it, **not** an ally, support or other card (RRG 1.8 "You, Your",
3434
+ * p. 49: a game function "you" perform resolves as if the identity performed it; FFG ruling January 24, 2025
3435
+ * (Change of Fortune): an event a player plays counts as the identity). An ally's attack, thwart or own ability
3436
+ * damage is the ally's, so a card that does mean "a character you control" names its own `sourceIs` (it overrides
3437
+ * this one: `{ ...on.defeated(q, { byYou: true }), sourceIs: ... }`; issue #817).
3438
+ */
3424
3439
  readonly defeated: (what: Who, opts?: {
3425
3440
  readonly byYou?: boolean;
3426
3441
  /**
@@ -3449,9 +3464,8 @@ export declare const when: {
3449
3464
  /**
3450
3465
  * "After [X] (or an event you play) defeats a minion or side scheme" (Small but Mighty, 13001a; docs/phase7-
3451
3466
  * wave2.md §17.2): matches both `characterDefeated` and `schemeDefeated` by *source* — which card dealt the
3452
- * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })`'s `playerIs` also
3453
- * accepts an ally's own attack, which a card naming a specific card ("Wasp, or an event") needs to exclude;
3454
- * `source` should therefore name the card(s), not just `controller: "you"` alone.
3467
+ * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })` is the
3468
+ * identity-or-extension reading of "you defeat" (an ally's defeat is not heard); this one names the card(s) itself.
3455
3469
  */
3456
3470
  readonly defeats: (source: TargetQuery) => EventPattern;
3457
3471
  /**
@@ -3459,7 +3473,9 @@ export declare const when: {
3459
3473
  * distinct trigger event from `defeated`, which is characters only. "When attached scheme is defeated"
3460
3474
  * (Followed, `cap` pack): `on.schemeDefeated("host")`.
3461
3475
  */
3462
- readonly schemeDefeated: (what: Who) => EventPattern;
3476
+ readonly schemeDefeated: (what: Who, opts?: {
3477
+ readonly byYou?: boolean;
3478
+ }) => EventPattern;
3463
3479
  /**
3464
3480
  * "After the last threat is removed from this scheme" (docs/phase7-wave7.md §3.34): a removal that took `what` from
3465
3481
  * some threat to none. The way a permanent side scheme answers reaching no threat without being defeated: RRG 1.8
@@ -4342,7 +4358,6 @@ export declare const after: {
4342
4358
  readonly what?: TargetQuery;
4343
4359
  readonly inDiscard?: boolean;
4344
4360
  }) => EventPattern;
4345
- /** "When/After X is defeated"; `byYou`: "after *you* defeat a minion". */
4346
4361
  /**
4347
4362
  * "After Abjuration prevents 2 or more damage from a single attack" (docs/phase7-wave4.md §3.20): this card prevented
4348
4363
  * damage — by its `preventAllDamageTo` constant or a `preventDamage` effect of its own. `fromAttack`: the damage was an
@@ -4352,6 +4367,14 @@ export declare const after: {
4352
4367
  readonly fromAttack?: boolean;
4353
4368
  readonly atLeast?: number;
4354
4369
  }) => EventPattern;
4370
+ /**
4371
+ * "When/After X is defeated". `byYou`: "after *you* defeat a minion" is the player's own doing: their identity (or an
4372
+ * event, or upgrade not on another friendly character) defeated it, **not** an ally, support or other card (RRG 1.8 "You, Your",
4373
+ * p. 49: a game function "you" perform resolves as if the identity performed it; FFG ruling January 24, 2025
4374
+ * (Change of Fortune): an event a player plays counts as the identity). An ally's attack, thwart or own ability
4375
+ * damage is the ally's, so a card that does mean "a character you control" names its own `sourceIs` (it overrides
4376
+ * this one: `{ ...on.defeated(q, { byYou: true }), sourceIs: ... }`; issue #817).
4377
+ */
4355
4378
  readonly defeated: (what: Who, opts?: {
4356
4379
  readonly byYou?: boolean;
4357
4380
  /**
@@ -4380,9 +4403,8 @@ export declare const after: {
4380
4403
  /**
4381
4404
  * "After [X] (or an event you play) defeats a minion or side scheme" (Small but Mighty, 13001a; docs/phase7-
4382
4405
  * wave2.md §17.2): matches both `characterDefeated` and `schemeDefeated` by *source* — which card dealt the
4383
- * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })`'s `playerIs` also
4384
- * accepts an ally's own attack, which a card naming a specific card ("Wasp, or an event") needs to exclude;
4385
- * `source` should therefore name the card(s), not just `controller: "you"` alone.
4406
+ * defeating damage or removed the last threat — not by player. `on.defeated({ byYou: true })` is the
4407
+ * identity-or-extension reading of "you defeat" (an ally's defeat is not heard); this one names the card(s) itself.
4386
4408
  */
4387
4409
  readonly defeats: (source: TargetQuery) => EventPattern;
4388
4410
  /**
@@ -4390,7 +4412,9 @@ export declare const after: {
4390
4412
  * distinct trigger event from `defeated`, which is characters only. "When attached scheme is defeated"
4391
4413
  * (Followed, `cap` pack): `on.schemeDefeated("host")`.
4392
4414
  */
4393
- readonly schemeDefeated: (what: Who) => EventPattern;
4415
+ readonly schemeDefeated: (what: Who, opts?: {
4416
+ readonly byYou?: boolean;
4417
+ }) => EventPattern;
4394
4418
  /**
4395
4419
  * "After the last threat is removed from this scheme" (docs/phase7-wave7.md §3.34): a removal that took `what` from
4396
4420
  * some threat to none. The way a permanent side scheme answers reaching no threat without being defeated: RRG 1.8
@@ -24,6 +24,7 @@ export declare const CROSSBONES_SET: {
24
24
  readonly "04060.crossbones-constant": import("../../../../engine/src/index.js").AbilityDefinition;
25
25
  readonly "04060.when-revealed": import("../../../../engine/src/index.js").AbilityDefinition;
26
26
  readonly "04061a.setup": import("../../../../engine/src/index.js").AbilityDefinition;
27
+ readonly "04061b.when-revealed": import("../../../../engine/src/index.js").AbilityDefinition;
27
28
  readonly "04062b.when-revealed": import("../../../../engine/src/index.js").AbilityDefinition;
28
29
  readonly "04063b.when-revealed": import("../../../../engine/src/index.js").AbilityDefinition;
29
30
  readonly "04064.crossbones-machine-gun-forced-interrupt": import("../../../../engine/src/index.js").AbilityDefinition;
@@ -7,9 +7,9 @@ import type { AbilityRegistry } from "../../../../../engine/src/index.js";
7
7
  *
8
8
  * **52001a.silk-sense** (hero form only, printed on the hero face): "Response: After you defeat a minion or side
9
9
  * scheme, or resolve a treachery card, tuck that card under here from the encounter discard pile." An optional
10
- * response with three triggers ("you defeat": the defeating player, so an ally's defeat is the ally's controller's;
11
- * "resolve": a treachery this player revealed, not a boost card). The card is bound when the event happens and tucked
12
- * only if it is in the encounter discard pile when the response resolves: a minion with Victory X sits in the victory
10
+ * response with three triggers ("you defeat": Silk's identity, or an event she plays, not an ally she controls (RRG
11
+ * 1.8 "You, Your", p. 49); "resolve": a treachery this player revealed, not a boost
12
+ * card). The card is bound when the event happens and tucked only if it is in the encounter discard pile when the response resolves: a minion with Victory X sits in the victory
13
13
  * display, and a treachery that attached or was shuffled away is elsewhere, so nothing is tucked for them.
14
14
  *
15
15
  * **52001b.cindy-moon-action** (alter-ego face): "Action: Discard a card tucked here → draw 2 cards. (Limit once per
@@ -3,7 +3,7 @@ export declare const CONTENT_VERSION = "0.0.0";
3
3
  * Schema version for the card data shape itself (independent of how many
4
4
  * cards/cycles have been ingested). Bump when a breaking shape change lands.
5
5
  */
6
- export declare const SCHEMA_VERSION = "0.48.0";
6
+ export declare const SCHEMA_VERSION = "0.49.0";
7
7
  export * from "./schema/index.js";
8
8
  export * from "./data/index.js";
9
9
  export * from "./import/index.js";
@@ -448,6 +448,18 @@ export interface ResourceDamageCost {
448
448
  readonly spender: PlayerId;
449
449
  readonly amount: number;
450
450
  }
451
+ /**
452
+ * A step of a resource ability's cost that `payCost` would push as an effects frame (Clarity of Purpose's "deal 1
453
+ * damage to attached character →", a picked `damageCards`; a `readyCards`; an `indirectDamage`), held for
454
+ * `announceResourcesSpent` instead. Pushed while paying, it would sit under the card or ability paid for, which is
455
+ * pushed after the payment, so the cost would resolve after that card (issue #813). Plain data: the `pushEffects` spec.
456
+ */
457
+ export interface ResourceCostStep {
458
+ readonly effects: readonly EffectSpec[];
459
+ readonly selfInstanceId: InstanceId;
460
+ readonly controllerId: PlayerId;
461
+ readonly bindings?: Bindings;
462
+ }
451
463
  /** Resources one player generated in a payment (docs/phase7-wave5.md §3.25). */
452
464
  export interface GeneratedByPlayer {
453
465
  readonly playerId: PlayerId;
@@ -474,19 +486,19 @@ export interface SpentPayment {
474
486
  */
475
487
  readonly countersRemoved?: readonly TriggerEvent[];
476
488
  /**
477
- * The threat costs of the resource abilities used ("remove up to 2 threat from … → generate a resource for each
478
- * threat you removed this way"; docs/phase7-wave9.md §3.7 (b)), held for `announceResourcesSpent` like
479
- * `countersRemoved`: the removal is an ordinary `removeThreat` event, which has to sit above the card or ability
480
- * paid for so that it resolves first (RRG 1.8 "Initiating Abilities", p. 24, step 5 before step 6).
489
+ * The frame-pushing cost steps of the resource abilities used, in the order they resolve: one resource ability's
490
+ * after the one paid before it in the payment (`payPayment`). Only these keep payment order: a counter cost
491
+ * (`countersRemoved` above) or an exhaust is applied when paid, before any of them. Each is held for `announceResourcesSpent`, so it
492
+ * resolves in full (damage, a defeat, the interrupts and responses to it) before the card or ability paid for
493
+ * commences (RRG 1.8 "Initiating Abilities", p. 24, step 5 before step 6; "Cost", p. 13–14). They are:
494
+ * - the threat costs ("remove up to 2 threat from … → generate a resource for each threat you removed this way";
495
+ * docs/phase7-wave9.md §3.7 (b), `ResourceThreatCost`), an ordinary `removeThreat` event;
496
+ * - the damage costs ("When you spend this card, take up to 3 damage → …"; docs/phase7-wave10-hero-packs.md H3.14,
497
+ * `ResourceDamageCost`), an ordinary deal to the spender's identity;
498
+ * - the other steps `payCost` would push (Clarity of Purpose's "deal 1 damage to attached character →", a
499
+ * `readyCards`, an `indirectDamage`; issue #813).
481
500
  */
482
- readonly threatCosts?: readonly ResourceThreatCost[];
483
- /**
484
- * The damage costs of the resource abilities used ("When you spend this card, take up to 3 damage → this card
485
- * generates 1 additional [energy] resource for each damage taken this way"; docs/phase7-wave10-hero-packs.md H3.14),
486
- * held for `announceResourcesSpent` like `threatCosts`: the damage is an ordinary deal, which has to sit above the
487
- * card or ability paid for so that it is taken first (RRG 1.8 "Initiating Abilities", p. 24, step 5 before step 6).
488
- */
489
- readonly damageCosts?: readonly ResourceDamageCost[];
501
+ readonly costSteps?: readonly ResourceCostStep[];
490
502
  }
491
503
  export declare const NOTHING_SPENT: SpentPayment;
492
504
  /** Two payments' spending together (a basic power's extra cost). */
@@ -638,15 +650,21 @@ export declare function payCost(ctx: Ctx, sourceId: InstanceId, playerId: Player
638
650
  collectCounterEvents?: TriggerEvent[],
639
651
  /**
640
652
  * Where a `removeThreat` cost's steps go instead of the stack, for the same reason: a resource ability's threat
641
- * cost (`SpentPayment.threatCosts`), pushed by `announceResourcesSpent` above the card or ability paid for.
653
+ * cost (`threatCostStep`, held in `SpentPayment.costSteps`), pushed by `announceResourcesSpent` above the card or
654
+ * ability paid for.
642
655
  */
643
656
  collectThreatCosts?: ResourceThreatCost[],
644
657
  /**
645
658
  * Where a `damageSelf` cost goes instead of the stack, for the same reason: a resource ability's damage cost
646
- * (`SpentPayment.damageCosts`), pushed by `announceResourcesSpent` above the card or ability paid for. A chosen
647
- * amount is the plan's one number (`resourceCostPlan`).
659
+ * (`damageCostStep`, held in `SpentPayment.costSteps`), pushed by `announceResourcesSpent` above the card or
660
+ * ability paid for. A chosen amount is the plan's one number (`resourceCostPlan`).
661
+ */
662
+ collectDamageCosts?: ResourceDamageCost[],
663
+ /**
664
+ * Where a picked `damageCards`, a `readyCards` and an `indirectDamage` cost go instead of the stack, for the same
665
+ * reason (`SpentPayment.costSteps`; issue #813).
648
666
  */
649
- collectDamageCosts?: ResourceDamageCost[]): void;
667
+ collectCostSteps?: ResourceCostStep[]): void;
650
668
  /** The action ability an event resolves when played from hand, if it has one. */
651
669
  /**
652
670
  * Whether an action's pre-cost condition is false right now, so the action cannot be initiated at all (docs/phase7-