// maxiGos v8 Minimalist+Edit copyright 1998-2024 FM&SH, BSD license
if(typeof mxG=='undefined')mxG={};
if(!mxG.V)
{
mxG.V="8.03";
mxG.Y="2024";
mxG.C="FM&SH";
mxG.D=[];
mxG.K=0;
if(!mxG.Z)mxG.Z=[];
if(!mxG.Z.fr)mxG.Z.fr=[];
if(!mxG.Z.en)mxG.Z.en=[];
String.prototype.c2n=function(k){let n=this.charCodeAt(k);return n-((n<97)?38:96);}
String.prototype.ucF=function(){return this.charAt(0).toUpperCase()+this.slice(1);}
String.prototype.lcF=function(){return this.charAt(0).toLowerCase()+this.slice(1);}
String.prototype.noT=function(){return this.replace(//g,">");}
String.prototype.noP=function(){return this.replace(/\(/g,"(").replace(/\)/g,")");}
String.prototype.reP=function(){return this.replace(/(/g,"(").replace(/)/g,")");}
mxG.beep=function()
{
let a=new AudioContext(),o=new OscillatorNode(a);
o.connect(a.destination);
o.start(0);
o.stop(0.1);
}
mxG.getMClick=function(ev)
{
let b=this.getBoundingClientRect();
return {x:ev.clientX-b.left,y:ev.clientY-b.top};
}
mxG.getLang=function(t)
{
while(t&&!t.lang)t=t.parentNode;
return t?t.lang:(navigator.language||"en");
}
mxG.fr=function(a,b){mxG.Z.fr[a]=b;}
mxG.en=function(a,b){mxG.Z.en[a]=b;}
mxG.min1max52=function(n){return Math.max(Math.min(-(-n),52),1);}
mxG.monoProps=new Set(["B","KO","MN","W","PL",
"C","GB","GW","HO","N","UC","V","BM","DO","IT","TE",
"AP","CA","FF","GM","ST","SZ",
"AN","BR","BT","CP","DT","EV","GN","GC","ON","OT","PB","PC","PW","RE","RO","RU",
"SO","TM","US","WR","WT","BL","OB","OW","WL","FG","PM","HA","KM"]);
mxG.coreProps=new Set(["B","W","AB","AW","AE","FF","CA","GM","SZ","VW",
"EV","RO","DT","PC","PW","WR","WT","PB","BR","BT","RU","TM","OT","HA","KM","RE"]);
}
if(!mxG.N)
{
mxG.N=function(n,p,v)
{
this.Kid=[];
this.P={};
this.Dad=n;
this.Focus=0;
if(n){n.Kid.push(this);if(!n.Focus)n.Focus=1;}
if(p)this.P[p]=[v];
}
mxG.N.prototype.takeOff=function(p,k)
{
if(this.P[p])
{
if(k<0)this.P[p].splice(0,this.P[p].length);else this.P[p].splice(k,1);
if(!this.P[p].length)delete this.P[p];
}
}
mxG.N.prototype.put=function(p,v)
{
this.P[p]=(typeof(v)=="object")?v:[v];
}
mxG.N.prototype.clone=function(dad)
{
let p,k,bN=new mxG.N(dad,null,null);
for(p in this.P)if(p.match(/^[A-Z]+$/)&&this.P.hasOwnProperty(p))
bN.P[p]=this.P[p].concat();
for(k=0;k='A')&&(a<='Z'))||(a=='['))break;
K++;
}
return K;
}
mxG.P.prototype.parseProperty=function(K,p)
{
let a;
while((K='A')&&(a<='Z'))p+=a;K++;}
while((K='A')&&(a<='Z'))K=this.parseProperty(K,a);
}
return K;
}
mxG.P.prototype.parseVariation=function(K)
{
let a=this.mainOnly;
if(this.nv){if(this.v.length)this.out("v=");this.nv=0;}
else this.out("v+");
while(K=1)&&(y>=1)&&(x<=this.DX)&&(y<=this.DY);
}
mxG.R.prototype.lib=function(nat,x,y)
{
if(!this.inGoban(x,y))return 0;
if(this.nat[this.ban[x][y]]=="E")return 1;
if(this.nat[this.ban[x][y]]!=nat)return 0;
let k,km=this.s.length;
for(k=0;k1)?"A":""),
pNat=nat.slice(-1),
oNat=((pNat=="B")?"W":((pNat=="W")?"B":"E")),
m=this.play,p;
this.act[m]=act;
this.nat[m]=pNat;
this.prisoners.B[m]=this.prisoners.B[m-1];
this.prisoners.W[m]=this.prisoners.W[m-1];
this.o[m]=0;
if(this.inGoban(x,y))
{
this.x[m]=x;
this.y[m]=y;
if(act!="A")
{
this.ban[x][y]=m;
p=this.capture(oNat,x-1,y);
p+=this.capture(oNat,x+1,y);
p+=this.capture(oNat,x,y-1);
p+=this.capture(oNat,x,y+1);
if(p)this.prisoners[pNat][m]+=p;
else this.prisoners[oNat][m]+=this.capture(pNat,x,y);
}
else
{
this.setup=m;
this.ban[x][y]=(pNat!="E"?m:0);
}
}
else this.x[m]=this.y[m]=0;
}
mxG.R.prototype.back=function(play)
{
this.init(this.DX,this.DY);
for(let k=1;k<=play;k++)this.place(this.act[k]+this.nat[k],this.x[k],this.y[k]);
}
mxG.R.prototype.isOccupied=function(x,y)
{
return this.nat[this.ban[x][y]]!="E";
}
mxG.R.prototype.isOnlyOne=function(k,nat)
{
let x=this.x[k],y=this.y[k];
return !(((x>1)&&(this.nat[this.ban[x-1][y]]==nat))
||((y>1)&&(this.nat[this.ban[x][y-1]]==nat))
||((x1)&&(this.nat[this.ban[x-1][y]]=="E"))n++;
if((y>1)&&(this.nat[this.ban[x][y-1]]=="E"))n++;
if((x1;r--)
{
if((D>(r*10+g))&&!(E%f(r)))
{
let F=Math.round(E/f(r));
for(let s=1;s>1;
if((D>21)&&n)
{
if(D&1)o=this.star2(z,A,B,C,D,C-A,6,r=>r);
else o=this.star2(z,A,B,C,D,B-A,1,r=>2*r-1);
}
if((D>16)&&(D&1)&&n){if((z==A)||(z==B)||(z==C))o=1;}
else if(D>11){if((z==A)||(z==B)||((z==C)&&(D&1)&&(x==y)))o=1;}
else if((z==C)&&(D&1))o=1;
if(!o)return 0;
}
return 1;
}
mxG.S.prototype.i2x=function(i){return this.dw*(i-this.xl+0.5)+this.gbsxl;}
mxG.S.prototype.j2y=function(j){return this.dh*(j-this.yt+0.5)+this.gbsyt;}
mxG.S.prototype.isLabel=function(m){return /^\(*\|.*\|\)*$/.test(m);}
mxG.S.prototype.isMark=function(m){return /^\(*_(CR|MA|SQ|TR)_\)*$/.test(m);}
mxG.S.prototype.isVariation=function(m){return /^\(.*\)$/.test(m);}
mxG.S.prototype.isVariationOnFocus=function(m){return /^\(\([^()]*\)\)$/.test(m);}
mxG.S.prototype.removeLabelDelimiters=function(m)
{
return m.replace(/^(\(*)\|(.*)\|(\)*)$/,"$1$2$3");
}
mxG.S.prototype.removeVariationDelimiters=function(m)
{
return m.replace(/^\(+([^()]*)\)+$/,"$1");
}
mxG.S.prototype.makeText=function(txt,x,y,c,o)
{
let s=`1)
{
if(o.vertical)
{
s+=` transform="translate(0,${y-2})`
+` scale(1,0.${(txt.length>2)?33:5})`
+` translate(0,${-y})"`
+` writing-mode="vertical-rl"`;
}
else
{
let sx=(txt.length>2)?0.8:0.9;
s+=` transform="matrix(${sx},0,0,1,${Math.round(x*(1-sx)*100)/100},0)"`;
}
}
s+=` x="${x}" y="${y+5}">${txt} `;
return s;
}
mxG.S.prototype.make2dStone=function(c,x,y,r,o)
{
let s=` `;
return s;
}
mxG.S.prototype.makeStoneShadow=function(c,x,y,r,o)
{
let e=this.stoneShadowWidth,s=` `;
}
mxG.S.prototype.make3dStone1=function(c,x,y,r,o)
{
let e=this.stoneShadowWidth,s=``;
if(o.stoneShadowOn)s+=this.makeStoneShadow(c,x,y,r,o);
s+=` `;
}
mxG.S.prototype.make3dStone2=function(c,x,y,r,o)
{
let a,s=``;
if(o.stoneShadowOn)s+=this.makeStoneShadow(c,x,y,r,o);
s+=` `
+` `;
}
mxG.S.prototype.makeStone=function(c,x,y,r,o)
{
if(o.in3dOn)return this["make3dStone"+(this.p.specialStoneOn?2:1)](c,x,y,r,o);
return this.make2dStone(c,x,y,r,o);
}
mxG.S.prototype.makeAloneStone=function(nat,n,o)
{
let s,d=this.d,dd=d+2,x=dd/2,y=dd/2,z;
z=(o.in3dOn&&o.stoneShadowOn)?this.stoneShadowWidth:0;
s=``;
if(o.title)s+=`${o.title} `;
o.opacity=1;
s+=this.makeStone((nat=="B")?"Black":"White",x,y,d/2,o);
if(n)s+=this.makeText(n,dd/2,dd/2,(nat=="B")?"White":"Black",o);
if(o.title)s+=` `;
return s+` `;
}
mxG.S.prototype.makeMarkOnLast=function(c,x,y,o)
{
let z=4;
return ` `;
}
mxG.S.prototype.makeMark=function(c,x,y,o)
{
let s,z=6;
s=` `;
}
mxG.S.prototype.makeCircle=function(c,x,y,o)
{
let s,z=6.5;
s=` `;
}
mxG.S.prototype.makeTriangle=function(c,x,y,o)
{
let s,z=7.5;
s=` `;
}
mxG.S.prototype.makeSquare=function(c,x,y,o)
{
let s,z=6;
s=` `;
}
mxG.S.prototype.makeTerritoryMark=function(a,x,y,o)
{
let c=a.match(/_TB_/)?"Black":"White";
if(this.p.territoryMark=="MA")return this.makeMark(c,x,y,o);
o={opacity:1,in3dOn:this.in3dOn,stoneShadowOn:this.stoneShadowOn};
return this.makeStone(c,x,y,5,o);
}
mxG.S.prototype.makeFocusMark=function(x,y)
{
let z=this.d/2+1;
return ` `;
}
mxG.S.prototype.makeMarkOrLabel=function(i,j,nat,a)
{
let s="",c=(nat=="B")?"#fff":(nat=="W")?"#000":this.glc,
cls="mxOn"+((nat=="B")?"Black":(nat=="W")?"White":"Empty"),
x=this.i2x(i),y=this.j2y(j),o={};
if(a.match(/^\(*_TB_|_TW_\)*$/))
s+=this.makeTerritoryMark(a,x,y,{cls:"mxTerritoryMark "+cls});
else if(a.match(/^\(*_ML_\)*$/))
s+=this.makeMarkOnLast(c,x,y,{cls:"mxMarkOnLast "+cls});
else
{
if(cls=="mxOnEmpty")o.ij=i+"_"+j;
if(this.isMark(a))cls+=" mxMark";
else if(this.isLabel(a))
{
cls+=" mxLabel";
a=this.removeLabelDelimiters(a);
}
if(this.isVariation(a))
{
cls+=" mxVariation";
if(this.isVariationOnFocus(a))cls+=" mxOnFocus";
a=this.removeVariationDelimiters(a);
}
o.cls=cls;
switch(a)
{
case "_MA_":s+=this.makeMark(c,x,y,o);break;
case "_TR_":s+=this.makeTriangle(c,x,y,o);break;
case "_SQ_":s+=this.makeSquare(c,x,y,o);break;
case "_CR_":s+=this.makeCircle(c,x,y,o);break;
default:o.ignoreTextAnchor=1;s+=this.makeText(a,x,y,c,o);
}
}
return s;
}
mxG.S.prototype.k2katakana=function(ko)
{
let k=this.DX-ko,s;
s="イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセスンバボべど";
return (k3))cn="〻";
else cn=this.k2kanji(c);
return an+bn+cn;
}
mxG.S.prototype.k2n=function(k)
{
if(!this.latinCoordinates&&(this.p.oldJapaneseIndicesOn||this.p.japaneseIndicesOn))
return this.k2okanji(k);
return (this.DY+1-k)+``;
}
mxG.S.prototype.k2c=function(k)
{
if(!this.latinCoordinates&&this.p.oldJapaneseIndicesOn)return this.k2katakana(k);
if(!this.latinCoordinates&&this.p.japaneseIndicesOn)return k+``;
let r=((k-1)%25)+1;
return String.fromCharCode(r+((r>8)?65:64))+((k>25)?(k-r)/25:"");
}
mxG.S.prototype.getIndices=function(x,y)
{
if(!this.p.hideLeftIndices&&(x==0)&&(y>0)&&(y<=this.DY))return this.k2n(y);
if(!this.p.hideTopIndices&&(y==0)&&(x>0)&&(x<=this.DX))return this.k2c(x);
if(!this.p.hideRightIndices&&(x==(this.DX+1))&&(y>0)&&(y<=this.DY))return this.k2n(y);
if(!this.p.hideBottomIndices&&(y==(this.DY+1))&&(x>0)&&(x<=this.DX))return this.k2c(x);
return "";
}
mxG.S.prototype.makeIndices=function()
{
let i,j,m,o,c=this.glc,s,dx=this.grim+this.gripx,dy=this.grim+this.gripy;
s=``;
o=(this.p.japaneseIndicesOn||this.p.oldJapaneseIndicesOn)?{vertical:1}:{};
o.ignoreTextAnchor=1;
o.ignoreFillAndStroke=1;
if(this.xl==1)
{
i=0;
for(j=this.yt;j<=this.yb;j++)
{
m=this.getIndices(i,j);
s+=this.makeText(m,this.i2x(i)-dx,this.j2y(j),c,o);
}
}
if(this.yt==1)
{
j=0;
for(i=this.xl;i<=this.xr;i++)
{
m=this.getIndices(i,j);
s+=this.makeText(m,this.i2x(i),this.j2y(j)-dy,c,o);
}
}
if(this.xr==this.DX)
{
i=this.DX+1;
for(j=this.yt;j<=this.yb;j++)
{
m=this.getIndices(i,j);
s+=this.makeText(m,this.i2x(i)+dx,this.j2y(j),c,o);
}
}
if(this.yb==this.DY)
{
j=this.DY+1;
for(i=this.xl;i<=this.xr;i++)
{
m=this.getIndices(i,j);
s+=this.makeText(m,this.i2x(i),this.j2y(j)+dy,c,o);
}
}
return s+` `;
}
mxG.S.prototype.gridUnder=function(i,j,nat,str)
{
if(str&&str.match(/(_TB_)|(_TW_)/))return 1;
if((nat=="B")||(nat=="W")||str)return 0;
return 1;
}
mxG.S.prototype.makeOneYa=function(i,j)
{
let a=-(-this.e4ya),b=2*a,c=a+b,x=this.i2x(i),y=this.j2y(j);
return `M${x+c} ${y+a}h${-b}v${b}M${x+c} ${y-a}h${-b}v${-b}`
+`M${x-c} ${y-a}h${b}v${-b}M${x-c} ${y+a}h${b}v${b}`;
}
mxG.S.prototype.makeOneStar=function(i,j)
{
let rs=this.r4star,x=this.i2x(i),y=this.j2y(j),a=`A${rs} ${rs} 0 1 0 `;
return `M${x-(-rs)} ${y}${a}${x-rs} ${y}${a}${x-(-rs)} ${y}Z`;
}
mxG.S.prototype.makeGrid=function(vNat,vStr)
{
let s,m,i,j,k,x,y,a,gi;
s=`this.yt)
{
y=this.gbsyt+(j-this.yt)*this.dh;
s+=m+x+" "+y;
}
m="V";
}
}
else
{
if(m=="V")
{
y=this.gbsyt+(j-this.yt)*this.dh;
s+=m+y;
m="M";
}
}
}
}
else m="V";
this.yGridMax=y=this.gbsyt+(this.yb-this.yt+1)*this.dh-((this.yb==this.DY)?this.dh/2:0);
s+=m+((m=="V")?"":(x+" "))+y;
}
for(j=this.yt;j<=this.yb;j++)
{
this.xGridMin=x=((this.xl==1)?this.dw/2:0)+this.gbsxl;
y=this.j2y(j);
s+="M"+x+" "+y;
if(this.p.eraseGridUnder)
{
m="M";
for(i=this.xl;i<=this.xr;i++)
{
k=this.p.xy(i,j);
if(this.gridUnder(i,j,vNat[k],vStr[k]))
{
if(m=="M")
{
if(i>this.xl)
{
x=this.gbsxl+(i-this.xl)*this.dw;
s+=m+x+" "+y;
}
m="H";
}
}
else
{
if(m=="H")
{
x=this.gbsxl+(i-this.xl)*this.dw;
s+=m+x;
m="M";
}
}
}
}
else m="H";
this.xGridMax=x=this.gbsxl+(this.xr-this.xl+1)*this.dw-((this.xr==this.DX)?this.dw/2:0);
s+=m+x+((m=="H")?"":" "+y);
}
s+=`"/>`;
s+=this.p.yaOn
?` `;
return s;
}
mxG.S.prototype.makeBackground=function(r)
{
let s,x,y,bx,by,cls;
bx=this.indicesOn?this.gobp+this.dw+this.grim:0;
by=this.indicesOn?this.gobp+this.dh+this.grim:0;
if(r=="Outer")
{
x=(this.xl==1)?this.gobm:(this.dw*(1-this.xl)-bx);
y=(this.yt==1)?this.gobm:(this.dh*(1-this.yt)-by);
w=this.dw*this.DX+(this.gripx+bx)*2;
h=this.dh*this.DY+(this.gripy+by)*2;
}
else if(r=="Inner")
{
x=(this.xl==1)?this.gobm+bx:(this.dw*(1-this.xl));
y=(this.yt==1)?this.gobm+by:(this.dh*(1-this.yt));
w=this.dw*this.DX+this.gripx*2;
h=this.dh*this.DY+this.gripy*2;
}
else
{
x=y=0;
w=this.w;
h=this.h;
}
cls=`mxGobanBackground mx${r}Rect`;
return ` `;
}
mxG.S.prototype.getWRatio=function()
{
let b=this.p.getE("GobanSvg").getBoundingClientRect();
return this.w/b.width;
}
mxG.S.prototype.getHRatio=function()
{
let b=this.p.getE("GobanSvg").getBoundingClientRect();
return this.h/b.height;
}
mxG.S.prototype.getGxy=function(ev,s=0)
{
let x,y,c=this.gc.firstChild.getMClick(ev);
c.x=c.x*this.getWRatio()-this.gbsxl;
c.y=c.y*this.getHRatio()-this.gbsyt;
x=Math.floor(c.x/this.dw)+this.xl;
y=Math.floor(c.y/this.dh)+this.yt;
if(s)return {x:x,y:y};
x=Math.max(Math.min(x,this.xr),this.xl);
y=Math.max(Math.min(y,this.yb),this.yt);
return {x:x,y:y};
}
mxG.S.prototype.makeGradient1=function(c)
{
let b=(c=="Black"),r=b?50:100,
c1=b?"#999":"#fff",c2=b?"#333":"#ccc",c3=b?"#000":"#333";
return ``
+` `
+` `
+` `
+` `;
}
mxG.S.prototype.makeShellEffect=function(o)
{
let s1=` `;
return s1+(o-3)/100+s2+"0"+s3
+s1+(o-2)/100+s2+"0.0125"+s3
+s1+o/100+s2+"0.0375"+s3
+s1+(o+2)/100+s2+"0.0125"+s3
+s1+(o+3)/100+s2+"0"+s3;
}
mxG.S.prototype.makeGradient2=function(c)
{
let s=this.makeGradient1(c);
s+=``
+` `
+` `;
}
else
{
s+=` cx="33%" cy="33%" r="100%">`
+` `
+` `
+` `;
}
s+=` `;
if(c=="Black")
{
s+=``
+` `
+` `
+` `;
}
else
{
for(let k=0;k<8;k++)
{
s+=``;break;
case 1:s+=` cx="50%" cy="100%" r="120%">`;break;
case 2:s+=` cx="100%" cy="100%" r="120%">`;break;
case 3:s+=` cx="100%" cy="50%" r="120%">`;break;
case 4:s+=` cx="100%" cy="0%" r="120%">`;break;
case 5:s+=` cx="50%" cy="0%" r="120%">`;break;
case 6:s+=` cx="0%" cy="0%" r="120%">`;break;
case 7:s+=` cx="0%" cy="50%" r="120%">`;break;
}
for(let l=5;l<100;l=l+15)s+=this.makeShellEffect(l);
s+=` `;
}
}
return s;
}
mxG.S.prototype.makeGradient=function(c)
{
return this["makeGradient"+(this.p.specialStoneOn?2:1)](c);
}
mxG.S.prototype.makeGoban=function()
{
let s,e=this.p.getE("Global"),n=this.p.n;
this.vNat=[];
this.vStr=[];
this.w=this.dw*(this.xr-this.xl+1)+this.gbsxl+this.gbsxr;
this.h=this.dh*(this.yb-this.yt+1)+this.gbsyt+this.gbsyb;
e.style.setProperty("--gobanIntrinsicWidth",this.w);
e.style.setProperty("--gobanIntrinsicHeight",this.h);
s=``;
if(this.in3dOn)
s+=`${this.makeGradient("Black")+this.makeGradient("White")} `;
s+=``;
s+=this.makeBackground("Whole");
s+=this.makeBackground("Outer");
if(this.indicesOn)s+=this.makeIndices();
return s+this.makeBackground("Inner")
+` `
+` `
+` `
+` `;
}
mxG.S.prototype.setInternalParams=function()
{
let a=this.stretching.split(","),
in3dWS=-(-a[0]),in3dHS=-(-a[1]),in2dWS=-(-a[2]),in2dHS=-(-a[3]);
this.dw=this.d+(this.in3dOn?(in3dWS?in3dWS:0):(in2dWS?in2dWS:0));
this.dh=this.d+(this.in3dOn?(in3dHS?in3dHS:0):(in2dHS?in2dHS:0));
this.gripx=this.grip;
if(this.in3dOn&&Number.isInteger(in3dWS)&&(in3dWS&1))this.gripx-=0.5;
else if(!this.in3dOn&&Number.isInteger(in2dWS)&&(in2dWS&1))this.gripx-=0.5;
this.gripy=this.grip;
if(this.in3dOn&&Number.isInteger(in3dHS)&&(in3dHS&1))this.gripy-=0.5;
else if(!this.in3dOn&&Number.isInteger(in2dHS)&&(in2dHS&1))this.gripy-=0.5;
if(this.indicesOn)
{
this.gbsxl=((this.xl==1)?this.gobm+this.gobp+this.dw+this.grim:0)+this.gripx;
this.gbsyt=((this.yt==1)?this.gobm+this.gobp+this.dh+this.grim:0)+this.gripy;
this.gbsxr=((this.xr==this.DX)?this.gobm+this.gobp+this.dw+this.grim:0)+this.gripx;
this.gbsyb=((this.yb==this.DY)?this.gobm+this.gobp+this.dh+this.grim:0)+this.gripy;
}
else
{
this.gbsxl=((this.xl==1)?this.gobm:0)+this.gripx;
this.gbsyt=((this.yt==1)?this.gobm:0)+this.gripy;
this.gbsxr=((this.xr==this.DX)?this.gobm:0)+this.gripx;
this.gbsyb=((this.yb==this.DY)?this.gobm:0)+this.gripy;
}
}
mxG.S.prototype.init=function()
{
let p=this.p;
this.gc=p.gc;
this.grip=p.gridPadding;
this.grim=p.gridMargin;
this.gobp=p.gobanPadding;
this.gobm=p.gobanMargin;
}
mxG.S.prototype.getLen=function(a,str)
{
let len=0;
if(a.tagName.match(/text/i))
{
len=a.getComputedTextLength();
len=(str.length>2)?0.8*len:(str.length>1)?0.9*len:len;
len+=0.2*this.dw;
}
return Math.max(this.dw-4,Math.ceil(len));
}
mxG.S.prototype.eraseOneVerticalGridSegment=function(i,y)
{
let e,d0,d1,d2,a,b,k,km,x,y1,y2,f1,f2;
x=this.i2x(i);
e=this.p.getE("Grid").querySelector("path");
d0=e.getAttributeNS(null,"d");
re=new RegExp(`M${x} ${this.yGridMin}[^H]*?V${this.yGridMax}`);
d1=d0.match(re)[0];
a=d1.match(/[^M0-9.-][0-9.-]+/g);
km=a.length;
b=[];
for(k=0;k=y1)
{
if(a[k]=="V")d2+="V"+y1;
f1=1;
}
else
{
if(a[k]=="V")d2+="V"+b[k];
else d2+="M"+x+" "+b[k];
}
}
if(f1&&!f2)
{
if(b[k]>=y2)
{
d2+="M"+x+" "+y2;
f2=1;
}
}
if(f1&&f2&&(b[k]>y2))
{
if(a[k]=="V")d2+="V"+b[k];
else d2+="M"+x+" "+b[k];
}
}
if(d1!=d2)e.setAttributeNS(null,"d",d0.replace(d1,d2));
}
mxG.S.prototype.eraseVerticalGridSegments=function(i,j,x,y,w)
{
let i1,i2,ik,e;
i1=Math.max(this.xl,i-Math.floor(w/2/this.dw));
i2=Math.min(this.xr,i+Math.floor(w/2/this.dw));
for(ik=i1;ik<=i2;ik++)
{
if(ik!=i)
{
this.eraseOneVerticalGridSegment(ik,y);
if(this.star(ik,j))
{
e=this.p.getE("Grid").querySelector(this.p.yaOn?".mxYaMarks":".mxStars");
if(e)
{
let s=this.p.yaOn?this.makeOneYa(ik,j):this.makeOneStar(ik,j),
d=e.getAttributeNS(null,"d");
d=d.replace(s,"");
e.setAttributeNS(null,"d",d);
}
}
}
}
}
mxG.S.prototype.eraseLongGridSegment=function(i,j,x,y,w)
{
let e,d0,d1,d2,a,b,k,km,x1,x2,m,re;
e=this.p.getE("Grid").firstChild;
d0=e.getAttributeNS(null,"d");
re=new RegExp(`M${this.xGridMin} ${y}[^V]+?H${this.xGridMax}`);
d1=d0.match(re)[0];
a=d1.match(/(M|H)[0-9.-]+/g);
km=a.length;
b=[];
for(k=0;k=x1)
{
if(a[k]=="H")d2+="H"+x1;
f1=1;
}
else
{
if(a[k]=="H")d2+="H"+b[k];
else d2+="M"+b[k]+" "+y;
}
}
if(f1&&!f2)
{
if(b[k]>=x2)
{
d2+="M"+x2+" "+y;
f2=1;
}
}
if(f1&&f2&&(b[k]>x2))
{
if(a[k]=="H")d2+="H"+b[k];
else d2+="M"+b[k]+" "+y;
}
}
if(d1!=d2)e.setAttributeNS(null,"d",d0.replace(d1,d2));
this.eraseVerticalGridSegments(i,j,x,y,w);
}
mxG.S.prototype.addPointBackground=function(i,j,nat,str)
{
let a,b,p,x,y,h,w;
p=this.p.getE("Points");
if(a=p.querySelector('[data-maxigos-ij="'+i+'_'+j+'"]'))
{
let vof=this.isVariationOnFocus(str);
h=this.dh-4;
w=this.getLen(a,str);
x=this.i2x(i);
y=this.j2y(j);
b=document.createElementNS(this.xmlnsUrl,"rect");
b.setAttributeNS(null,"fill","none");
b.setAttributeNS(null,"stroke",vof?this.glc:"none");
b.setAttributeNS(null,"stroke-width",vof?this.sw4grid:"0");
b.setAttributeNS(null,"x",x-w/2);
b.setAttributeNS(null,"y",y-h/2);
b.setAttributeNS(null,"width",w);
b.setAttributeNS(null,"height",h);
b.setAttribute("class","mxPointBackground "+a.classList.value);
a.parentNode.insertBefore(b,a);
if(this.p.eraseGridUnder&&(w>this.dw))this.eraseLongGridSegment(i,j,x,y,w);
}
}
mxG.S.prototype.audouard=function(i,j)
{
let s,DX=this.DX,DY=this.DY,Cx=(DX+1)/2,Cy=(DY+1)/2;
if((i<=Cx)&&(jCx)&&(j<=Cy)){s="b ";if(j==Cy)s+=(DX+1-i);else s+=(DX+1-i)+" "+j;}
else if((i>=Cx)&&(j>Cy)){s="c ";if(i==Cx)s+=(DY+1-j);else s+=(DX+1-i)+" "+(DY+1-j);}
else if((i=Cy)){s="d ";if(j==Cy)s+=i;else s+=i+" "+(DY+1-j);}
else s=Cy;
return s;
}
mxG.S.prototype.makeOneInfoFromGameTree=function(aN,withNum)
{
let nat,s="",x,y;
if(aN.P["B"])nat="B";else if(aN.P["W"])nat="W";else nat="E";
if((nat=="B")||(nat=="W"))
{
s+=this.p.local(nat=="B"?"Black":"White");
if(withNum)s+=` '${this.p.getAsInTreeNum(aN)}'`;
if(aN.P[nat]&&aN.P[nat][0].match(/^[a-zA-Z]{2}$/))
{
x=aN.P[nat][0].c2n(0);
y=aN.P[nat][0].c2n(1);
}
else x=y=0;
if(x&&y)
{
s+=this.p.local(" at ");
if(localStorage.getItem("Audouard")=="on")s+=`'${this.audouard(x,y)}'`;
else
{
if(this.p.lang!="ja")this.latinCoordinates=1;
s+=`'${this.k2c(x)+this.k2n(y)}'`;
if(this.p.lang!="ja")this.latinCoordinates=0;
}
}
else s+=" "+this.p.local("pass");
}
else s+=this.p.local("No move");
return s;
}
mxG.S.prototype.makeOneInfoFromGoban=function(i,j,k,nat,str,sayLast)
{
let s="",last=0,ojio,jio;
if((nat=="B")||(nat=="W"))s+=this.p.local(nat=="B"?"Black":"White");
if(s&&str)s+=" ";
if(str)
{
if(str.match(/_ML_/))last=1;
else if(str.match(/_TB_/))s+=this.p.local("Black territory mark");
else if(str.match(/_TW_/))s+=this.p.local("White territory mark");
else
{
if(this.isVariation(str))
{
if(this.isVariationOnFocus(str))
s+=this.p.local("Variation on focus")+" ";
else s+=this.p.local("Variation")+" ";
str=this.removeVariationDelimiters(str);
}
if(this.isMark(str))
{
switch(str)
{
case "_MA_":s+=this.p.local("Mark");break;
case "_CR_":s+=this.p.local("Circle");break;
case "_SQ_":s+=this.p.local("Square");break;
case "_TR_":s+=this.p.local("Triangle");break;
}
}
else
{
if(this.isLabel(str))str=this.removeLabelDelimiters(str);
s+=`'${str}'`;
}
}
}
if(s)s+=this.p.local(" at ");
if(localStorage.getItem("Audouard")=="on")s+=`'${this.audouard(i,j)}'`;
else
{
if(this.p.lang!="ja")this.latinCoordinates=1;
s+=`'${this.k2c(i)+this.k2n(j)}'`;
if(this.p.lang!="ja")this.latinCoordinates=0;
}
if(sayLast&&last)s+=". "+this.p.local("Last played move");
return s;
}
mxG.S.prototype.makeCommentForDesc=function()
{
if(this.p.justMovedCursor)
{
this.p.justMovedCursor=0;
if(this.p.hasC("Solve"))
{
this.p.clearVirtualFlag();
this.p.updateSolveComment();
}
return "";
}
if(this.p.hasC("Solve"))return " "+this.p.getSolveCoreComment(this.p.cN);
if(this.p.hasC("Comment"))return " "+this.p.getCoreComment(this.p.cN);
return "";
}
mxG.S.prototype.makeShortGobanDesc=function(status)
{
let s="",xf,yf,k,nat,str;
if((xf=this.p.xFocus)&&(yf=this.p.yFocus))
{
k=this.p.xy(xf,yf);
s=this.p.local("Cursor on")+" ";
s+=this.makeOneInfoFromGoban(xf,yf,k,this.vNat[k],this.vStr[k],1);
}
if(this.p.whenVirtualNext)
{
let x,y;
x=this.p.whenVirtualNext.x;
y=this.p.whenVirtualNext.y;
k=this.p.xy(x,y);
s=this.makeOneInfoFromGoban(x,y,k,this.vNat[k],this.vStr[k],0)+". "+s;
}
if(this.p.justMovedInTree)
{
for(let i=this.xl;i<=this.xr;i++)
for(let j=this.yt;j<=this.yb;j++)
{
k=this.p.xy(i,j);
nat=this.vNat[k];
str=this.vStr[k];
if(str&&(this.isMark(str)||this.isLabel(str)||this.isVariation(str)))
s+=". "+this.makeOneInfoFromGoban(i,j,k,nat,str,0);
}
if(status!=5)this.p.justMovedInTree=0;
}
return s+".";
}
mxG.S.prototype.makeGobanTitle=function()
{
let s=this.p.local("Goban")+" "+this.DX+"x"+this.DY;
if((this.xl!=1)||(this.yt!=1)||(this.xr!=this.DX)||(this.yb!=this.DY))
{
s+=". "+this.p.local("Partial view");
if(localStorage.getItem("Audouard")=="on")
{
s+=` '${this.audouard(this.xl,this.yb)}'`;
s+=` '${this.audouard(this.xr,this.yt)}'`;
}
else
{
s+=` '${this.k2c(this.xl)+this.k2n(this.yb)}'`;
s+=` '${this.k2c(this.xr)+this.k2n(this.yt)}'`;
}
}
return s+".";
}
mxG.S.prototype.makeWhatIsOnTheGoban=function(nb,nw,ne)
{
let s="";
if(nb)s+=this.p.local("Number of black stones")+" "+nb;
if(s&&nw)s+=". ";
if(nw)s+=this.p.local("Number of white stones")+" "+nw;
if(s&&ne)s+=". ";
if(ne)s+=this.p.local("Number of marks or labels")+" "+ne;
return s;
}
mxG.S.prototype.makeLongGobanDesc=function()
{
let s="",a="",i,j,k,nat,str,nb=0,nw=0,ne=0,
wgd=localStorage.getItem("Whole goban desc");
for(i=this.xl;i<=this.xr;i++)
for(j=this.yb;j>=this.yt;j--)
{
k=this.p.xy(i,j);
nat=this.vNat[k];
str=this.vStr[k];
if((nat=="B")||(nat=="W")||str)
{
if(!wgd||(wgd=="on"))
{
if(a)a+=". ";
a+=this.makeOneInfoFromGoban(i,j,k,nat,str,0);
}
if(nat=="B")nb++;
else if(nat=="W")nw++;
else ne++;
}
}
if(!(nb+nw+ne))s=this.p.local("Empty goban");
if(s)s+=". ";
s+=this.p.local("Arrow keys to explore the goban")+". ";
if((wgd=="off")&&(nb+nw+ne))s+=this.makeWhatIsOnTheGoban(nb,nw,ne);
else s+=a;
return s+".";
}
mxG.S.prototype.setGobanFocusTitleDesc=function(status)
{
if(this.p.noLabelledBy)return;
let x=this.p.xFocus,y=this.p.yFocus,z,g=this.p.getE("GobanSvg");
if(!this.p.inView(x,y)){x=0;y=0;}
if(x&&y)this.p.getE("Focus").innerHTML=this.makeFocusMark(this.i2x(x),this.j2y(y));
else this.p.getE("Focus").innerHTML="";
if((g==document.activeElement)&&(status!=6))
g.setAttribute("aria-label",this.makeShortGobanDesc(status)+this.makeCommentForDesc());
else
g.setAttribute("aria-label",this.makeGobanTitle()+" "+this.makeShortGobanDesc(status)+" "+this.makeLongGobanDesc());
}
mxG.S.prototype.drawGoban=function(vNat,vStr)
{
let s,s1,s2,s3,s4,s5,s6,i,j,k,nat,str,c,o;
this.p.getE("Grid").innerHTML=this.makeGrid(vNat,vStr);
this.pNat=this.vNat;
this.pStr=this.vStr;
this.vNat=vNat;
this.vStr=vStr;
s=s1=s2=s3=s4=s5=s6="";
for(i=this.xl;i<=this.xr;i++)
for(j=this.yt;j<=this.yb;j++)
{
k=this.p.xy(i,j);
nat=this.vNat[k];
str=this.vStr[k];
if((nat=="B")||(nat=="W"))
{
let x=this.i2x(i),y=this.j2y(j);
c=(nat=="B")?"Black":"White";
if(this.in3dOn&&this.stoneShadowOn)
{
o={ignoreFillAndStroke:1};
s1+=this.makeStoneShadow(c,x,y,this.d/2,o);
}
o={in3dOn:this.in3dOn,stoneShadowOn:0,ignoreFillAndStroke:1};
o.opacity=((str=="_TB_")||(str=="_TW_"))?0.5:1;
if(nat=="B")s2+=this.makeStone(c,x,y,this.d/2,o);
else s3+=this.makeStone(c,x,y,this.d/2,o);
if(str&&/^[0-9]+$/.test(str))
{
c=(nat=="B")?"#fff":"#000",
o={cls:"mxOn"+((nat=="B")?"Black":"White")+" mxNumber"};
o.ignoreTextAnchor=1;
o.ignoreFillAndStroke=1;
if(this.p.oldJapaneseNumberingOn)
{
str=this.k2okanji(-(-str));
o.vertical=1;
}
if(nat=="B")s4+=this.makeText(str,x,y,c,o);
else s5+=this.makeText(str,x,y,c,o);
}
}
}
if(s1)
s+=`${s1} `;
if(s2)
{
s+=`${s2} `;
}
if(s3)
{
s+=`${s3} `;
}
if(s4)
{
s+=`${s4} `;
}
if(s5)
{
s+=`${s5} `;
}
for(i=this.xl;i<=this.xr;i++)
for(j=this.yt;j<=this.yb;j++)
{
k=this.p.xy(i,j);
nat=this.vNat[k];
str=this.vStr[k];
if(str&&!(((nat=="B")||(nat=="W"))&&/^[0-9]+$/.test(str)))
s6+=this.makeMarkOrLabel(i,j,nat,str);
}
if(s6)s+=`${s6} `;
this.p.getE("Points").innerHTML=s;
for(i=this.xl;i<=this.xr;i++)
for(j=this.yt;j<=this.yb;j++)
{
k=this.p.xy(i,j);
nat=this.vNat[k];
str=this.vStr[k];
if(str&&(nat!="B")&&(nat!="W"))this.addPointBackground(i,j,nat,str);
}
this.setGobanFocusTitleDesc(5);
}
mxG.S.prototype.makeBR=function(x)
{
return ` `;
}
mxG.S.prototype.makeBT=function(x,a)
{
let z=x+a*52;
return ` `;
}
mxG.S.prototype.makeBI=function(a)
{
let b=` role="presentation" aria-hidden="true"`;
return `${a} `;
}
}
if(!mxG.G)
{
mxG.fr("_","");
mxG.en("_","");
mxG.G=function(k,b)
{
this.k=k;
this.n="d"+k;
this.g=`mxG.D[${k}]`;
this.a={};
this.b=b;
this.c=[];
this.config="";
this.theme="";
this.j=document.currentScript;
}
mxG.G.prototype.getE=function(id){return document.getElementById(this.n+id);}
mxG.G.prototype.local=function(s)
{
if(mxG.Z[this.lang]&&(mxG.Z[this.lang][s]!==undefined))return mxG.Z[this.lang][s];
if(mxG.Z["en"][s]!==undefined)return mxG.Z["en"][s];
return s;
}
mxG.G.prototype.alias=function(s,t)
{
if(mxG.Z[this.lang]&&this[t]&&(mxG.Z[this.lang][this[t]]!==undefined))
return mxG.Z[this.lang][this[t]];
if(mxG.Z["en"][this[t]]!==undefined)
return mxG.Z["en"][this[t]];
return this.local(s);
}
mxG.G.prototype.build=function(x,a)
{
let f="build"+x;
if(mxG.Z[this.lang]&&mxG.Z[this.lang][f])return mxG.Z[this.lang][f](a);
if(this[f])return this[f](a);
return a+"";
}
mxG.G.prototype.hasC=function(a)
{
for(let z of this.c)if(z==a)return 1;
return 0;
}
mxG.G.prototype.kidOnFocus=function(aN){return aN.Focus?aN.Kid[aN.Focus-1]:null;}
mxG.G.prototype.enableBtn=function(b)
{
if(this.hasC("Score")&&this.canPlaceScore)return;
let e=this.getE(b+"Btn");
if(e)e.disabled=false;
}
mxG.G.prototype.disableBtn=function(b)
{
let e=this.getE(b+"Btn");
if(e)e.disabled=true;
}
mxG.G.prototype.addBtnClickListener=function(b)
{
let k=this.k;
this.getE(b+"Btn").addEventListener("click",function(){mxG.D[k]["do"+b]();});
}
mxG.G.prototype.addBtn=function(e,b)
{
let k=this.k,a=document.createElement("button");
a.id=this.n+b.n+"Btn";
if(b.t)a.title=b.t;
if(b.v)a.innerHTML=b.v;
if(b.tabindex)a.setAttribute("tabindex",b.tabindex);
a.classList.add("mxBtn",`mx${b.n}Btn`);
if(b.first)e.prepend(a);else e.appendChild(a);
a.addEventListener("click",function(){mxG.D[k]["do"+b.n]();});
}
mxG.G.prototype.createBtn=function(n,a="")
{
let v=this.alias(a?a:n,n.lcF()+"Alias"),
t=this.local(a?a:n),
s=`${v} `;
return s;
}
mxG.G.prototype.unselectBtn=function(btn)
{
let e=this.getE(btn+"Btn");
if(e)e.classList.remove("mxSelectedBtn");
}
mxG.G.prototype.selectBtn=function(btn)
{
let e=this.getE(btn+"Btn");
if(e)e.classList.add("mxSelectedBtn");
}
mxG.G.prototype.doDialog=function(name,content,btns)
{
let dialog=this.getE(name+"Dialog"),b=btns;
if(!dialog)
{
let s;
dialog=document.createElement("dialog");
dialog.id=this.n+name+"Dialog";
dialog.classList.add(`mx${name}Dialog`);
s=`
Le menu "Affichage" "2d/3d" : affiche le lecteur en 2d ou en 3d.
"Étirement" : rend le goban légèrement rectangulaire (les gobans physiques sont souvent légèrement rectangulaire).
"Ombre des pierres" : ajoute une ombre aux pierres (uniquement si l'affichage est en 3d).
"Couleurs" : permet de changer le fond du goban ou la couleur de ses lignes.
Pour le fond du goban, on peut choisir n\'importe quelle couleur css ou une image. Pour les lignes, on peut choisir n\'importe quelle couleur css.
"Agrandir" : agrandit la taille du goban.
"Normal" : ramène le goban à sa taille initiale.
"Réduire" : réduit la taille du goban.
"Réinitialiser" : réinitialise tous les paramètres modifiables via le menu "Affichage".
Le menu "Fenêtre" Permet de changer le fichier sgf en cours d\'édition lorsque plusieurs fichiers sont ouverts en même temps.
La barre de navigation Ses boutons permettent de se déplacer dans l\'arbre des coups.
Pour passer, il suffit de cliquer sur le bouton "Passe".
Il est aussi possible de naviguer en utilisant le clavier. Le goban ou l'arbre des coups doivent avoir le focus pour que cette fonctionalité soit activée : cliquez sur le goban ou l'arbre des coups, ou bien utilisez la touche "Tabulation" pour leur donner ce focus. Appuyez ensuite sur la touche "Majuscule" combinée à l'une des touches de la liste ci-dessous pour naviguer dans l'arbre des coups.
Touche "Flèche gauche": recule d\'un coup Touche "Flèche droite" : place un coup Touche "Page précédente" : recule de 10 coups (s\'arrête avant si un coup ayant des variations est rencontré) Touche "Page suivante" : place 10 coups (s\'arrête avant si un coup ayant des variations est rencontré) Touche "Début" : recule au premier coup Touche "Fin" : place tous les coups Touche "Flèche vers le haut" : change la variation du prochain coup (en cas de style de variation dit "enfants") ou la variation du coup courant (en cas de style de variation dit "jumeaux") Touche "Flèche vers le bas" : change la variation du prochain coup (en cas de style de variation dit "enfants") ou la variation du coup courant (en cas de style de variation dit "jumeaux") Pour changer d\'arbre de coups quand plusieurs arbres sont présents dans un enregistrement, on peut se placer sur le premier coup de l\'arbre courant, puis utiliser les touches flèche vers le haut ou flèche vers le bas tout en appuyant sur les touches "Majuscule" + "Option" ou "Alt".
Si on donne le focus au goban en ayant cliquer dessus, on pourra utiliser les touches précédentes pour se déplacer dans l'arbre des coups.
Mais on peut aussi donner le focus au goban via la touche "Tabulation". Dans ce cas, un carré s'affiche sur l'une des intersections du goban. On peut alors utiliser les touches flèche gauche, flèche droite, flèche vers le haut, flèche vers le bas (sans appuyer sur la touche "Majuscule") non pas pour se déplacer dans l\'arbre des coups, mais pour déplacer le carré, et finalement appuyer sur la touche "Retour" pour placer une pierre ou effectuer tout autre action selon l'outil qui est sélectionné dans la barre d'outil.
En utilisant les touches ci-dessus et les touches "Tabulation", "Majuscule + Tabulation", et "Retour", il est ainsi possible d\'exécuter toutes les commandes de maxiGos.
Autres boutons Les boutons "PNG" et "SVG" permettent de fabriquer et afficher une image (format PNG et SVG) représentant la position affichée sur le goban. Cette image peut par exemple être utilisées comme illustration dans vos pages web. Pour l\'enregistrer sur votre machine, vous pouvez par exemple faire un clic-droit sur cette image et sélectionner dans le menu qui s'affiche "Enregistrer l\'image sous...".
Le bouton "SGF" permet d\'afficher ce qui a été saisi au format sgf (un enregistrement sgf est en fait du texte qui peut aussi être modifier via un simple éditeur de texte). On peut aussi modifier le sgf directement dans la fenêtre qui s\'affiche, ou y copier un autre sgf.
Le bouton "Score" permet d\'ajouter ou retirer les propriétés indiquant le score (propriétés sgf TB et TW).
Vue partielle du goban Pour afficher une vue partielle du goban, cliquez sur l\'outil "Sélection" (un carré en pointillé dans la barre d\'outils), sélectionnez une partie du goban avec la souris ou son équivalent sur votre machine, en cliquant sur le coin supérieur gauche puis sur le coin inférieur droit de ce que vous voulez sélectionner (il n'est pas nécessaire de maintenir le bouton de la souris enfoncé pendant cette opération). Ensuite, cliquez sur l\'outil "Vue partielle/totale" (un petit carré à l\'intérieur d\'un grand carré dans la barre d\'outils) pour réduire le goban à la partie que vous avez sélectionnée.
Pour désélectionner la sélection sans réduire le goban, cliquez sur l\'outil "Sélection" lorsque celui-ci est déjà sélectionné.
Pour réafficher en entier le goban, cliquez sur l\'outil "Vue partielle/totale" lorsqu\'aucune sélection n\'est effectuée.
Important : la vue partielle est appliquée à partir du coup courant. Ceci veut dire que si l'on veut une vue partielle du goban pour l'ensemble d\'un arbre de coups, il faut appliquer la vue partielle via l\'outil "Vue partielle/totale" en étant placé sur le premier coup de cet arbre.
Placer un coup et ajouter/retirer une pierre On a deux outils permettant d\'ajouter ou retirer une pierre sur le goban : l\'outil "Placer un coup" et l\'outil "Ajouter/retirer une pierre". L\'outil "Placer un coup" permet de placer une succession de coups éventuellement numérotés, tandis que l\'outil "Ajouter/retirer une pierre" permet de construire une position (ceci sert par exemple à placer des pierres de handicap ou construire la position initiale d\'un problème).
L\'outil "Placer un coup" Lorsque l\'outil "Placer un coup" (une pierre noire ou blanche dans la barre d\'outils) est sélectionné, on peut placer des coups sur le goban. Si des pierres se retrouvent sans liberté, elles sont capturées automatiquement.
L\'éditeur essaie en permanence de déterminer la couleur du prochain coup qui sera placé. Il affiche alors une pierre noire ou une pierre blanche sur cet outil suivant le résultat de cette détermination.
Il est possible de changer la couleur du prochain coup qui sera posé en cliquant sur l\'outil "Placer un coup" lorque celui-ci est déjà sélectionné (il est donc possible d\'afficher deux coups de suite de la même couleur).
L\'outil "Ajouter/retirer une pierre" Lorsque l\'outil "Ajouter/retirer une pierre" (une pierre moitié noire et moitié blanche dans la barre d\'outils) est sélectionné, on peut ajouter ou retirer des pierres sur le goban. Aucune capture n\'est effectuée. Si on clique sur une intersection inoccupée, on y ajoute une noire ou une blanche (si l\'image sur l\'outil a une demi-pierre noire à gauche, on ajoute une pierre noire, et si elle a une demi-pierre blanche à gauche, on ajoute une pierre blanche). Enfin, si on clique sur une intersection occupée, on retire la pierre qui s\'y trouve.
L\'utilisation de cet outil sur une position obtenue après avoir placé une série de coups a pour effet de réinitialiser la numérotation des coups. Les numéros des coups déjà placés sont retirés et le premier coup placé à partir de cette position aura le numéro 1.
Pour changer la couleur de la prochaine pierre qui sera posée, il suffit de cliquer sur l\'outil "Ajouter/retirer une pierre" lorsque celui-ci est déjà sélectionné.
Couper une variation Pour couper une variation, afficher le premier coup de la variation sur le goban (en naviguant dans l\'arbre des coups via la barre de navigation, ou en cliquant sur la pierre correspondant au coup dans l\'arbre des coups lui-même), puis cliquez sur l\'outil "Couper une branche" (une paire de ciseaux dans la barre d\'outils).
Copier une variation Pour copier une variation, afficher le premier coup de la variation sur le goban (en naviguant dans l\'arbre des coups via la barre de navigation, ou en cliquant sur la pierre correspondant au coup dans l\'arbre des coups lui-même), puis cliquez sur l\'outil "Copier une branche" (deux feuilles se superposant dans la barre d\'outils).
Coller une variation Pour coller une variation précédemment coupée ou copiée, afficher le dernier coup précédant la variation sur le goban (en naviguant dans l\'arbre des coups via la barre de navigation, ou en cliquant sur la pierre correspondant au coup dans l\'arbre des coups lui-même), puis cliquez sur l\'outil "Coller une branche" (une feuille venant en superposition sur un support dans la barre d\'outils).
MaxiGos ne fait aucune vérification de cohérence de ce qui sera collé.
Cette fonction peut être utile quand on s\'aperçoit a posteriori qu\'on a oublié de placer un échange de coups. Il convient alors d\'aller au coup suivant l\'échange, couper la branche, placer les coups manquants, et coller la branche précédemment coupée.
Cette fonction peut aussi être utile quand on s\'aperçoit a posteriori qu\'on a placé un échange de coups en trop. Il convient alors d\'aller au coup suivant l\'échange, copier la branche, revenir au coup précédent l\'échange, coller la branche précédemment copiée, revenir sur le premier coup de l\'échange à supprimer et couper la branche qui ne contient alors plus que les deux coups de cet échange.
Marques et étiquettes Pour ajouter ou retirer une marque ou étiquette, sélectionnez l\'un des outils "Etiquette" (une lettre dans la barre d\'outils), "Marque" (une croix dans la barre d\'outils), "Triangle" (une triangle dans la barre d\'outils), "Cercle" (un cercle dans la barre d\'outils) ou "Carré" (un carré dans la barre d\'outils), puis cliquez sur l\'intersection où vous souhaitez l\'ajouter ou la retirer. Il est possible de changer le texte de la prochaine étiquette qui sera placée en cliquant sur l\'outil "Etiquette", et en entrant au clavier les caractères souhaités. L\'étiquette peut être constituée de plusieurs caractères, mais en pratique, il est préférable de se limiter à des étiquettes de un à trois caractères.
Autres outils L\'outil "Numérotation" L\'outil "Numérotation" (la pierre numérotée dans la barre d\'outils) permet d\'afficher ou cacher la numérotation des pierres placées à l\'aide de l\'outil "Placer un coup".
On peut ne modifier la numérotation qu\'à partir de la position courante si on le souhaite. Bien qu\'en théorie, on puisse le faire à n\'importe quel coup, il est conseillé de ne le faire qu\'en début de variation.
On peut aussi via cet outil afficher ou non les indices, et afficher ou non les pierres capturées "comme dans les livres".
L\'outil "Entête" L\'outil "Entête" ("E" dans la barre d\'outils), permet d\'afficher un formulaire de saisie des propriétés d\'entête des fichiers sgf (évènement, ronde, nom de noir, niveau de noir, nom de blanc, niveau de blanc, ...).
L\'outil "Comme dans les livres" L\'outil "Comme dans les livres" ("L" dans la barre d\'outils) permet de changer le mode d\'affichage des pierres capturées. Soit on affiche le goban tel qu\'il serait en partie réelle, soit on affiche le goban en laissant les pierres capturées par des coups numérotés comme dans les livres. Pour passer de l\'un à l\'autre mode, il suffit de cliquer sur l\'outil.
Note : quand aucune pierre numérotée n\'est visible, cet outil est sans effet.
L\'outil "Indices" L\'outil "Indices" ("I" dans la barre d\'outils) permet d\'afficher ou cacher des indices autour du goban. En cas de découpe du goban, les indices ne sont affichés que sur les bords visibles. En cas de sélection d\'une partie du goban contenant des bords avec des indices, ceux-ci sont ajoutés automatiquement à la sélection.
L\'outil "Marque sur les variations" L\'outil "Marque sur les variations" ("V" dans la barre d\'outils) permet d\'afficher ou cacher les marques sur les variations. Ces marques sont là uniquement pour vous aider à visualiser la liste des variations possibles à partir d\'une position donnée. Il ne faut pas y faire référence dans le commentaire car elles peuvent ne pas être affichables ou avoir des libellés différents d\'un logiciel à l\'autre. Lorsque vous avez besoin de faire référence à une intersection dans le commentaire, placez plutôt sur le goban des marques et étiquettes à l\'aide de l\'un des outils "Etiquette", "Marque", "Triangle", "Cercle" ou "Carré", ou éventuellement utilisez les indices sur le pourtour du goban. Lorsqu\'une intersection a à la fois une marque de variation et une marque ou étiquette placée à l\'aide de l\'un des outils "Etiquette", "Marque", "Triangle", "Cercle" ou "Carré", c\'est cette dernière qui est affichée.
L\'outil "Style" L\'outil "Style" ("S" dans la barre d\'outils) permet de changer le style d\'affichage des variations. Soit on affiche les alternatives au coup courant, soit on affiche les alternatives pour le coup suivant. Pour voir les marques sur les variations, n\'oubliez pas d\'activer aussi le mode "Marque sur les variations".
Les outils d\'annotation Ils permettent d\'ajouter des annotations diverses au coup courant (propriétés sgf GB, GW, DM, UC, TE, BM, DO et IT).
L\'outil "Trait" L\'outil "Trait" ("T" dans la barre d\'outils) permet d\'indiquer qui a le trait au coup suivant (propriété sgf PL). On l'utilisera en particulier quand le sgf représente la position initiale d'un problème, et qu\'aucun coup suivant n\'est spécifié.
Les outils de tranformation Ils permettent d\'effectuer une rotation, une symétrie verticale ou une symétrie horizontale du goban.
L\'arbre des coups Il permet de visualiser l\'ensemble des coups (en cliquant sur une pierre de l\'arbre, la position lorsque cette pierre a été jouée est affichée sur le goban).
Les touches flèches gauche, flèche droite, flèche vers le haut, flèche vers le bas sont utilisées pour faire défiler le contenu de cet arbre lorsqu’il déborde de son conteneur.
Mais on peut aussi se déplacer dans l\'arbre des coups en utilisant ces flèches du clavier tout en appuyant sur la touche "Majuscule" (voir le chapitre "La barre de navigation" pour plus de détails).
`);
mxG.en("Help_Data",`Help Overview With this tool you can edit go games or diagrams in sgf format.
Menus "File" menu Use it to create, open, save or send by email a sgf file.
"New": display a goban of any size (not necessarily a square). You can either create a move tree in a new record, or add a move tree to the current record (in which case the current record will contain several move trees).
"Open": open a sgf file stored on your device (not always possible with some devices).
"Close": close the current sgf file.
"Save": save what you edit in a sgf file on your device (not always possible with some devices).
"Send": send by email what you edit (useful if you cannot save what you edit on your device).
"Edit" menu "Cut", "Copy" or "Paste" a branch of a game tree (see also "Cut a branch", "Copy a branch" and "Paste a branch" below).
"Remove comments" remove all the comments from the sgf record.
"View" menu Change view (2d/3d effect, stretching, stone shadow, colors, zoom or reset all the settings done using the view menu).
For the goban lines, on can set any css color.
"Window" menu Change the current sgf file.
Navigation bar Click on the buttons of the Navigation bar to navigate in the game tree.
Click on the "Pass" button to pass.
It is also possible to navigate using the keyboard. The focus has to be on the goban or the game tree in order to activate this feature: click on the goban or the game tree or use the Tab key to give them the focus. Then press the Shift key and one of the following key.
Left Arrow key: back one move Right Arrow key: place one move Page Down key: back ten moves of the current variation or go to the previous move that has a variation Page Up key: place ten moves of the current variation or go to the next move that has a variation Home key: back to first move End key: place all moves Up Arrow key: change next move variation (if children variation style) or current move variation (if siblings variation style) Down Arrow key: change next move variation (if children variation style) or current move variation (if siblings variation style) To change the move tree when several move trees are present in a recording, go to the first move of the current tree, then use the Up or Down Arrow keys while pressing the Shift key + Option or Alt key.
If one gives focus to the goban by having clicked on it, one can use the previous keys to move in the move tree.
But you can also give focus to the goban via the Tab key. In this case, a square is displayed on one of the intersections of the goban. We can then use the Left Arrow, Right Arrow, Up Arrow, Down Arrow keys (without pressing the Shift key) not to move in the move tree, but to move the square, and finally press the Return key to place a stone or perform any other action depending on the tool that is selected in the toolbar.
Note that using above keys, Tab key, Shift + Tab key, and Return key, it is possible to execute all maxiGos commands including placement of a stone on the go board.
Other buttons "PNG" anf "SVG" buttons: to display a png or svg image of the current position. This image can for example be used as an illustration in your web pages. To save it on your machine, you can right-click on this image and select in the menu that appears "Save image as...".
"Sgf" button: to display and edit the sgf.
"Score" button: to add or remove sgf territory properties (sgf properties TB and TW).
Partial view of the goban To display a part of the goban only, click on the "Selection" tool (a dashed square in the tool bar), select it with the mouse (ot its equivalent) by clicking on its top left and bottom right corners. (it is not necessary to keep the mouse button down between the two clicks). Then click on the "Partial/full view" tool (a small square inside a bigger one in the tool bar) to finish the job.
To unselect the selection, click on the "Selection" tool again.
To display the full goban again, click on the "Partial/full view" tool when no part of the goban is selected.
Important: the partial view is applied from the current move. This means that if you want a partial view of the goban for the whole of a move tree, you must apply the partial view via the "Partial/total view" tool while being placed on the first move of the move tree.
Place a move or add/remove a stone There are two tools that allow to add/remove stones on the goban: "Place a move" and "Add/remove a stone" tools.
"Place a move" tool The "Place a move" tool (a black stone or white stone in the tool bar) allows to place a serie of moves possibly numbered.
If some stones are without liberty, they are removed automatically from the goban.
The editor tries to guess what will be the color of the next move, and changes the color of the stone displayed in the tool accordingly.
To change the color of the next move, just click again on the "Place a move" tool (thus it is possible to place two moves of the same color in succession).
"Add/remove a stone" tool The "Add/remove a stone" tool (a half white/half black stone) allows to add or remove a stone from the goban to setup a position (for instance to place handicap stones or setup the initial position of a problem).
The color of the next stone will be the color of the left half of the tool. If one clicks on an occupied intersection, the stone is removed.
To change the color of the next stone, just click again on the "Add/remove a stone" tool.
Warning: the numerotation restarts to 0 when such a stone is added.
Cut/copy/paste a branch One can cut/copy/paste a branch of the tree when one of the "Cut a branch", "Copy a branch" or "Paste a branch" tool is selected.
MaxiGos does no consistency checking of what will be pasted.
These tools can be useful when you realize a posteriori that you forgot to place some moves. It is then necessary to go to the move following the missing moves, cut the branch, place the missing moves, and paste the previously cut branch.
These tools can also be useful when you realize a posteriori that you have placed some unwanted moves. It is then necessary to go to the move following the unwanted moves, copy the branch, return to the move preceding the unwanted moves, paste the previously copied branch, return to the first unwanted move and cut the branch which does not then contain more than the unwanted moves.
Marks and labels Click on one of the "Label" (a letter in the tool bar), "Mark" (a cross in the tool bar), "Triangle" (a triangle in the tool bar), "Circle" (a circle in the tool bar) or "Square" (a square in the tool bar) tools, then click on an intersecion to add/remove the corresponding mark or label. The next label that will be add is incrementing automatically (from "A" to "Z", ...), but can be force to any text by clicking on the "Label" tool and replacing the letter in it.
Other tools "Numbering" tool The "Numbering" tool (a numbered stone in the tool bar) shows/hides numbering.
"Header" tool The "Header" tool ("H" in the tool bar) allows to edit game information properties (event, round, name of black player, name of white player, ...).
"As in book" tool The "As in book" tool ("K" in the tool bar) adds/removes captured stones on the goban as in book/as in real life.
"Indices" tool The "Indices" tool ("I" in the tool bar) shows/hides indices arround the goban.
"Mark on variation" tool The "Mark on variation" tool ("V" in the tool bar) shows/hides mark on variation.
"Style" tool The "Style" tool ("S" in the tool bar) changes variation style. One can display variations of the current move (siblings mode) or variations of the next move (children mode). To see corresponding variation marks, don\'t forget to enable "Mark on variation" mode too.
Annotation tools They add various annotations to the current move (sgf properties GB, GW, DM, UC, TE, BM, DO and IT).
"Turn" tool The "Turn" tool ("T" in the tool bar) allows to indicate the turn for the next move (PL sgf property).
Transform tools They make a rotation, a vertical symmetry or an horizontal symmetry of the goban.
Tree It allows to see all the nodes of the game tree (by clicking on a stone of the tree, one returns to the position when the corresponding move was played).
The Left Arrow, Right Arrow, Up Arrow, Down Arrow keys are used to scroll through the contents of this tree when it overflows its container.
But you can also move through the move tree using these arrows on the keyboard while pressing the Shift key (see the chapter "The navigation bar" for more details).
`);
mxG.G.prototype.doHelp=function()
{
this.doDialog("ShowHelp",this.local("Help_Data"),[{n:" Close "}]);
}
mxG.G.prototype.initHelp=function()
{
if(this.helpBtnOn)this.addBtnClickListener("Help");
}
mxG.G.prototype.createHelp=function()
{
this.helpBtnOn=this.setA("helpBtnOn",0,"bool");
this.helpAlias=this.setA("helpAlias",null,"string");
return this.helpBtnOn?this.createBtn("Help"):"";
}
}
if(!mxG.G.prototype.createImage)
{
mxG.fr(" Close ","Fermer");
mxG.fr("PNG","PNG");
mxG.fr("SVG","SVG");
mxG.fr("PNG image of the goban","Image PNG du goban");
mxG.fr("SVG image of the goban","Image SVG du goban");
mxG.G.prototype.b64EncodeUnicode=function(str)
{
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
function toSolidBytes(match,p1){return String.fromCharCode('0x'+p1);}));
}
mxG.G.prototype.svgToDataURL=function(b)
{
let e1,e2,a,r=2,z,e,s,v,rect1,rect2,mark1,mark2,list;
e1=this.getE("GobanSvg");
e2=e1.cloneNode(true);
rect1=e1.querySelector(".mxWholeRect");
if(rect1)
{
s=window.getComputedStyle(rect1,null);
v=s.getPropertyValue("fill");
rect2=e2.querySelector(".mxWholeRect");
rect2.setAttributeNS(null,"fill",v);
}
mark1=e1.querySelector(".mxMarkOnLast");
if(mark1)
{
s=window.getComputedStyle(mark1,null);
v=s.getPropertyValue("fill");
mark2=e2.querySelector(".mxMarkOnLast");
mark2.setAttributeNS(null,"fill",v);
v=s.getPropertyValue("stroke");
mark2.setAttributeNS(null,"stroke",v);
}
if(b)
{
e2.setAttribute("width",b.width*r+"");
e2.setAttribute("height",b.height*r+"");
}
else
{
e2.removeAttribute("width");
e2.removeAttribute("height");
}
e2.removeAttribute("id");
e2.removeAttribute("aria-labelledby");
e2.removeAttribute("aria-label");
e2.removeAttribute("aria-live");
e2.removeAttribute("role");
e2.removeAttribute("tabindex");
a=e2.querySelectorAll("g[id]");
if(a)for(e of a)e.removeAttribute("id");
a=e2.querySelectorAll(".mxFocus,title,desc");
if(a)for(e of a)e.remove();
a=e2.querySelectorAll("[aria-hidden]");
if(a)for(e of a)e.removeAttribute("aria-hidden");
z=e2.outerHTML;
z=z.replace(/ class="[^"]*"/g,"");
z=z.replace(/ href=/g," xlink:href=");
z=z.replace(/><\/(rect|circle|path|image|stop)>/g,"/>");
z=z.replace(/]*>/g,"");
return "data:image/svg+xml;base64,"+this.b64EncodeUnicode(z);
}
mxG.G.prototype.doSvg=function()
{
let b=this.getE("GobanSvg").getBoundingClientRect(),
s=`${this.local("SVG image of the goban")} `
+` `;
this.doDialog("ShowSvg",s,[{n:" Close "}]);
}
mxG.G.prototype.doPng=function()
{
let img,png,r=2,k=this.k,s,src;
src=`data:image/svg+xml, `;
s=`${this.local("PNG image of the goban")} `
+` `;
this.doDialog("ShowPng",s,[{n:" Close "}]);
png=this.getE("PngImg");
img=new Image();
img.onload=function()
{
let canvas=document.createElement('canvas'),w=img.width,h=img.height;
png.width=w/r;
png.height=h/r;
canvas.width=w;
canvas.height=h;
setTimeout(function(){
canvas.getContext('2d').drawImage(img,0,0);
png.src=canvas.toDataURL("image/png");
},1);
}
img.src=this.svgToDataURL(this.getE("GobanSvg").getBoundingClientRect());
}
mxG.G.prototype.initPng=function()
{
if(this.pngBtnOn)this.addBtnClickListener("Png");
}
mxG.G.prototype.initSvg=function()
{
if(this.svgBtnOn)this.addBtnClickListener("Svg");
}
mxG.G.prototype.createPng=function()
{
this.pngBtnOn=this.setA("pngBtnOn",0,"bool");
this.pngAlias=this.setA("pngAlias",null,"string");
return this.pngBtnOn?this.createBtn("Png","PNG"):"";
}
mxG.G.prototype.createSvg=function()
{
this.svgBtnOn=this.setA("svgBtnOn",0,"bool");
this.svgAlias=this.setA("svgAlias",null,"string");
return this.svgBtnOn?this.createBtn("Svg","SVG"):"";
}
mxG.G.prototype.createImage=function()
{
return ``;
}
}
if(!mxG.G.prototype.createPass)
{
mxG.fr("Pass","Passe");
mxG.G.prototype.doPass=function()
{
if(this.hasC("Edit"))this.checkEditPlay(0,0);
else if(this.hasC("Solve")&&this.canPlaceSolve)this.checkSolve(0,0);
else if(this.hasC("Variation")&&this.canPlaceVariation)this.checkVariation(0,0);
else if(this.hasC("Guess"))this.checkGuess(0,0);
}
mxG.G.prototype.isPass=function(aN)
{
let s,x,y;
if(aN.P["B"]||aN.P["W"])
{
s=aN.P["B"]?aN.P["B"][0]:aN.P["W"][0];
if(s.match(/^[a-zA-Z]{2}$/))
{
x=s.c2n(0);
y=s.c2n(1);
if((x<1)||(y<1)||(x>this.dimX)||(y>this.dimY))x=y=0;
}
else x=y=0;
return !(x||y);
}
return 0;
}
mxG.G.prototype.updatePass=function()
{
let aN=0,k,km,status,look=0,s,e=this.getE("PassBtn");
if(!e)return;
status=this.isPass(this.cN)?1:0;
if(!(this.styleMode&2))
{
if(this.styleMode&1)aN=this.cN.Dad;
else aN=this.cN;
}
if(!this.hasC("Solve")||!this.canPlaceSolve)
{
if(aN)
{
km=aN.Kid.length;
if(km)
{
if(this.styleMode&1){if(km>1)look=1;}
else look=1;
}
}
if(look)for(k=0;k`;
s+=this.local("Score")+" ("+this.local("Chinese style")+")";
if(hasC)s+="";else s+="\n";
if(hasC)s+="";
s+=this.local("Black")+this.local(": ")+cb+" + "+ib+" = "+(cb+ib);
if(hasC)s+="
";else s+="\n";
if(hasC)s+="";
s+=this.local("White")+this.local(": ")+cw+" + "+iw+" + "+komi+" = "+(cw+iw+komi);
if(hasC)s+="
";else s+="\n";
if(expectedKomi!=komi)
{
if(hasC)s+="";
s+=this.local("Unusual komi");
if(hasC)s+="
";else s+="\n";
}
}
else if(r=="J")
{
if(handicap)expectedKomi=0.5;
else expectedKomi=6.5;
if(hasC)s+=``;
s+=this.local("Score")+" ("+this.local("Japanese style")+")";
if(hasC)s+=" ";else s+="\n";
if(hasC)s+="";
s+=this.local("Black")+this.local(": ")+cb+" + "+pb+" = "+(cb+pb);
if(hasC)s+="
";else s+="\n";
if(hasC)s+="";
s+=this.local("White")+this.local(": ")+cw+" + "+pw+" + "+komi+" = "+(cw+pw+komi);
if(hasC)s+="
";else s+="\n";
if(expectedKomi!=komi)
{
if(hasC)s+="";
s+=this.local("Unusual komi");
if(hasC)s+="
";else s+="\n";
}
}
else
{
if(hasC)s+=``;
s+=this.local("Score");
if(hasC)s+=" ";else s+="\n";
s+=this.local("Unknown rules");
if(hasC)s+="
";else s+="\n";
}
if(hasC)s=`${s}
`;
return s;
}
mxG.G.prototype.getTX=function()
{
let TX=["TB","TW"];
let aN,k,aLen,s,x,y,x1,y1,x2,y2,z;
aN=this.cN4Score;
for(z=0;z<7;z++)
{
if(aN.P[TX[z]])aLen=aN.P[TX[z]].length;else aLen=0;
for(k=0;ks.w)return "B";
if(s.w>s.b)return "W";
return null;
}
mxG.G.prototype.getNatWhenScore_trivial=function(x,y)
{
return this.scoreBan.initial[x][y];
}
mxG.G.prototype.getNatWhenScore_counting=function(x,y)
{
if(this.scoreBan.initial[x][y]=="E")return "E";
if(this.scoreBan.taken[x][y])return "E";
return this.scoreBan.initial[x][y];
}
mxG.G.prototype.getNatWhenScore_propagate=function(x,y)
{
let natm;
if(this.scoreBan.initial[x][y]=="E")
{
if(this.scoreBan.modified[x][y])natm=this.scoreBan.modified[x][y];
else natm="E";
}
else
{
if(this.scoreBan.taken[x][y])natm="E";
else natm=this.scoreBan.initial[x][y];
}
return natm;
}
mxG.G.prototype.getNatWhenScore_estimate=function(x,y)
{
return this.getNatWhenScore_propagate(x,y);
}
mxG.G.prototype.getNatWhenScore=function(x,y)
{
return this["getNatWhenScore_"+this.scoreMethod](x,y);
}
mxG.G.prototype.guessNextWhenScore=function(x,y)
{
let a,b,c,po;
c=this.scoreBan.computed[x][y];
if((this.lastScoreAct.x==x)&&(this.lastScoreAct.y==y))
{
b=this.lastScoreAct.a;
if((b=="B")&&(c=="W"))a="E";
else if((b=="B")&&(c==null))a="W";
else if((b=="W")&&(c=="B"))a="E";
else if((b=="W")&&(c==null))a="B";
else if((b=="E")&&(c=="B"))a="W";
else if((b=="E")&&(c=="W"))a="B";
}
else
{
switch(c)
{
case "B":
case "W":a="E";break;
default:po=this.possibleOwner(x,y);a=po?po:"B";
}
}
return a;
}
mxG.G.prototype.hasPrisonerWhenScore=function(nat,x,y)
{
if(this.gor.inGoban(x,y))
{
let xy=this.xy(x,y);
let natm=this.getNatWhenScore(x,y);
let onat=(nat=="B"?"W":"B");
if(this.visitedWhenHasPrisoner[xy])return 0;
this.visitedWhenHasPrisoner[xy]=1;
if(this.scoreBan.taken[x][y]==onat)return 1;
if(natm!=onat)
return this.hasPrisonerWhenScore(nat,x-1,y)
|this.hasPrisonerWhenScore(nat,x+1,y)
|this.hasPrisonerWhenScore(nat,x,y-1)
|this.hasPrisonerWhenScore(nat,x,y+1);
}
return 0;
}
mxG.G.prototype.checkSurrounding=function(x,y)
{
if(this.gor.inGoban(x,y))
{
let xy=this.xy(x,y);
let natm=this.getNatWhenScore(x,y);
if(this.visitedWhenCheckSurrounding[xy])return 0;
this.visitedWhenCheckSurrounding[xy]=1;
if(natm=="E")
return this.checkSurrounding(x-1,y)
|this.checkSurrounding(x+1,y)
|this.checkSurrounding(x,y-1)
|this.checkSurrounding(x,y+1);
if(natm=="B")return 1;
if(natm=="W")return 2;
}
return 0;
}
mxG.G.prototype.canSwapWhenScore=function(nat,x,y)
{
if(this.scoreBan.computed[x][y])return 1;
this.visitedWhenHasPrisoner=[];
return !this.hasPrisonerWhenScore(nat,x,y);
}
mxG.G.prototype.swapWhenScore=function(nat,x,y,d)
{
let onat=(nat=="B")?"W":"B";
if(this.gor.inGoban(x,y))
{
let xy=this.xy(x,y);
let natm=this.getNatWhenScore(x,y);
if(this.visitedWhenSwap[xy])return 0;
this.visitedWhenSwap[xy]=1;
if((natm==nat)||(natm=="E"))
{
if(d)
{
this.scoreBan.computed[x][y]=onat;
if(this.scoreBan.initial[x][y]==nat)this.scoreBan.taken[x][y]=nat;
}
else
{
this.scoreBan.computed[x][y]=null;
if(this.scoreBan.initial[x][y]==nat)this.scoreBan.taken[x][y]=null;
}
this.swapWhenScore(nat,x-1,y,d);
this.swapWhenScore(nat,x+1,y,d);
this.swapWhenScore(nat,x,y-1,d);
this.swapWhenScore(nat,x,y+1,d);
}
}
}
mxG.G.prototype.computeScoreMarks_trivial=function(v)
{
let i,j;
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
if(this.scoreBan.modified[i][j])
{
switch(this.scoreBan.modified[i][j])
{
case "B":this.scoreBan.computed[i][j]="B";break;
case "W":this.scoreBan.computed[i][j]="W";break;
default:this.scoreBan.computed[i][j]=null;
}
}
}
}
}
mxG.G.prototype.computeScoreMarks_counting=function(v)
{
let i,j;
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
if(this.scoreBan.initial[i][j]=="E")
{
let z;
this.visitedWhenCheckSurrounding=[];
z=this.checkSurrounding(i,j);
if(z==1)this.scoreBan.computed[i][j]="B";
else if(z==2)this.scoreBan.computed[i][j]="W";
else this.scoreBan.computed[i][j]=null;
}
}
}
}
mxG.G.prototype.computeScoreMarks_propagate=function(v)
{
this.computeScoreMarks_counting(v);
}
mxG.G.prototype.computeScoreMarks_estimate=function(v)
{
let i,j;
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
if(this.scoreBan.initial[i][j]=="E")
this.scoreBan.computed[i][j]=this.possibleOwner(i,j);
else
{
let nat,onat;
nat=this.scoreBan.initial[i][j];
onat=(nat=="B"?"W":"B");
if(this.scoreBan.modified[i][j]==onat)
{
this.scoreBan.taken[i][j]=nat;
this.scoreBan.computed[i][j]=onat;
}
else
{
this.scoreBan.taken[i][j]=null;
this.scoreBan.computed[i][j]=null;
}
}
}
}
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
if(this.scoreBan.initial[i][j]=="E")
{
let z=this.checkNeighbour(i,j);
if(z==1)this.scoreBan.computed[i][j]="B";
else if(z==2)this.scoreBan.computed[i][j]="W";
}
}
}
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
this.scoreBan.buffer[i][j]=this.scoreBan.computed[i][j];
if(this.scoreBan.initial[i][j]=="E")
{
let z=this.checkNeighbour(i,j);
if((z!=1)&&(z!=2))this.scoreBan.buffer[i][j]=null;
}
}
}
for(i=1;i<=this.DX;i++)
for(j=1;j<=this.DY;j++)
{
if(!v||v[this.xy(i,j)])
{
this.scoreBan.computed[i][j]=this.scoreBan.buffer[i][j];
}
}
}
mxG.G.prototype.computeScoreMarks=function(v)
{
if(this.scoreMethod=="estimate")this.computeScoreMarks_estimate(v);
else if(this.scoreMethod=="propagate")this.computeScoreMarks_propagate(v);
else if(this.scoreMethod=="counting")this.computeScoreMarks_counting(v);
else this.computeScoreMarks_trivial(v);
}
mxG.G.prototype.checkScore_trivial=function(a,b)
{
let po,opo;
po=this.possibleOwner(a,b);
po=po?po:"B";
opo=(po=="B")?"W":"B";
switch(this.scoreBan.computed[a][b])
{
case po:
switch(this.scoreBan.initial[a][b])
{
case opo: this.scoreBan.modified[a][b]="E";break;
default: this.scoreBan.modified[a][b]=opo;
};break;
case opo:
this.scoreBan.modified[a][b]="E";break;
default:
switch(this.scoreBan.initial[a][b])
{
case po: this.scoreBan.modified[a][b]=opo;break;
default: this.scoreBan.modified[a][b]=po;
}
}
this.computeScoreMarks(null);
}
mxG.G.prototype.checkScore_counting=function(x,y)
{
let nat=this.scoreBan.initial[x][y],d=this.scoreBan.computed[x][y]?0:1,z;
if(((nat=="B")||(nat=="W"))&&this.canSwapWhenScore(nat,x,y))
{
this.visitedWhenSwap=[];
this.swapWhenScore(nat,x,y,d);
this.computeScoreMarks(this.visitedWhenSwap);
}
else if(nat=="E")
{
this.visitedWhenCheckSurrounding=[];
z=this.checkSurrounding(x,y);
this.visitedWhenSwap=[];
if(z==1)this.swapWhenScore("W",x,y,d);
else if(z==2)this.swapWhenScore("B",x,y,d);
}
}
mxG.G.prototype.clearMarkWhenScore=function(c,o,x,y)
{
if(this.gor.inGoban(x,y)&&!this.scoreBan.modified[x][y]
&&this.scoreBan.computed[x][y]&&(this.scoreBan.computed[x][y]==c))
{
this.visitedWhenSwap=[];
this.swapWhenScore(o,x,y,0);
}
}
mxG.G.prototype.checkScore_propagate=function(x,y)
{
let nat=this.scoreBan.initial[x][y],a,b,c=this.scoreBan.computed[x][y],d=c?0:1,z;
if(((nat=="B")||(nat=="W"))&&this.canSwapWhenScore(nat,x,y))
{
this.visitedWhenSwap=[];
this.swapWhenScore(nat,x,y,d);
this.computeScoreMarks(this.visitedWhenSwap);
}
else if(nat=="E")
{
if(!this.scoreBan.modified[x][y]||(this.scoreBan.modified[x][y]=="E"))
{
this.visitedWhenCheckSurrounding=[];
z=this.checkSurrounding(x,y);
if(z==1){this.visitedWhenSwap=[];this.swapWhenScore("W",x,y,d);return;}
if(z==2){this.visitedWhenSwap=[];this.swapWhenScore("B",x,y,d);return;}
}
else
{
let o=((c=="B")?"W":"B");
this.clearMarkWhenScore(c,o,x-1,y);
this.clearMarkWhenScore(c,o,x+1,y);
this.clearMarkWhenScore(c,o,x,y-1);
this.clearMarkWhenScore(c,o,x,y+1);
}
a=this.guessNextWhenScore(x,y);
this.lastScoreAct={a:(c?c:"E"),x:x,y:y};
this.scoreBan.modified[x][y]=a;
this.scoreBan.computed[x][y]=((a=="E")?null:a);
}
}
mxG.G.prototype.checkScore_estimate=function(x,y)
{
let nat=this.scoreBan.initial[x][y];
if((nat=="B")||(nat=="W"))
{
let onat=(nat=="B"?"W":"B");
if(this.scoreBan.modified[x][y]==onat)this.scoreBan.modified[x][y]="E";
else this.scoreBan.modified[x][y]=onat;
this.computeScoreMarks(null);
}
}
mxG.G.prototype.initScoreBan=function()
{
let i,j,nat;
this.scoreBan={initial:[],marked:[],modified:[],taken:[],computed:[],buffer:[]};
for(i=1;i<=this.DX;i++)
{
this.scoreBan.initial[i]=[];
this.scoreBan.marked[i]=[];
this.scoreBan.modified[i]=[];
this.scoreBan.taken[i]=[];
this.scoreBan.computed[i]=[];
this.scoreBan.buffer[i]=[];
for(j=1;j<=this.DY;j++)
{
nat=this.gor.getBanNat(i,j);
this.scoreBan.initial[i][j]=nat;
this.scoreBan.marked[i][j]=null;
this.scoreBan.modified[i][j]=null;
this.scoreBan.taken[i][j]=null;
this.scoreBan.computed[i][j]=null;
this.scoreBan.buffer[i][j]=null;
}
}
this.getTX();
this.lastScoreAct={a:"E",x:-1,y:-1};
this.computeScoreMarks(null);
this.setTX("computed");
}
mxG.G.prototype.checkScore=function(x,y)
{
if(this.scoreMethod=="estimate")this.checkScore_estimate(x,y);
else if(this.scoreMethod=="propagate")this.checkScore_propagate(x,y);
else if(this.scoreMethod=="counting")this.checkScore_counting(x,y);
else this.checkScore_trivial(x,y);
this.setTX("computed");
this.updateAll();
}
mxG.G.prototype.enableAllWhenQuitScore=function()
{
if(this.hasC("Tree"))this.enableTree();
if(this.disabledElementsWhenScore)
for(let e of this.disabledElementsWhenScore)
e.disabled=false;
this.disabledElementsWhenScore=[];
}
mxG.G.prototype.disableAllWhenEnterScore=function()
{
let scoreBtn=this.getE("ScoreBtn"),list=this.getE("Global").querySelectorAll("button,input");
for(let e of list)
{
if(!e.disabled&&(e!=scoreBtn))
{
this.disabledElementsWhenScore.push(e);
e.disabled=true;
}
}
if(this.hasC("Tree"))this.disableTree();
}
mxG.G.prototype.toggleScore=function()
{
if(this.canPlaceScore)
{
if(this.ephemeralScore)
{
this.setTX("marked");
if(this.hasC("Edit"))
this.getE("EditCommentTool").value=this.formerCommentWhenScore;
}
this.canPlaceScore=0;
this.enableAllWhenQuitScore();
this.canPlaceVariation=this.initialCanPlaceVariationForScore;
this.canPlaceGuess=this.initialCanPlaceGuessForScore;
this.canPlaceSolve=this.initialCanPlaceSolveForScore;
this.canPlaceEdit=this.initialCanPlaceEditForScore;
this.marksAndLabelsOn=this.initialmarksAndLabelsOnForScore;
this.cN4Score=null;
}
else
{
if(this.ephemeralScore&&this.hasC("Edit"))
this.formerCommentWhenScore=this.getCommentWhenEdit();
this.disableAllWhenEnterScore();
this.canPlaceScore=1;
this.initialCanPlaceVariationForScore=(this.canPlaceVariation?1:0);
this.initialCanPlaceGuessForScore=(this.canPlaceGuess?1:0);
this.initialCanPlaceSolveForScore=(this.canPlaceSolve?1:0);
this.initialCanPlaceEditForScore=(this.canPlaceEdit?1:0);
this.initialmarksAndLabelsOnForScore=(this.marksAndLabelsOn?1:0);
this.canPlaceVariation=0;
this.canPlaceGuess=0;
this.canPlaceSolve=0;
this.canPlaceEdit=0;
this.marksAndLabelsOn=1;
this.cN4Score=this.cN;
this.initScoreBan();
}
}
mxG.G.prototype.doScore=function()
{
this.toggleScore();
this.updateAll();
}
mxG.G.prototype.updateScore=function()
{
if(this.getE("ScoreBtn"))
{
if(this.canPlaceScore)this.selectBtn("Score");
else this.unselectBtn("Score");
}
}
mxG.G.prototype.initScore=function()
{
if(this.scoreBtnOn)this.addBtnClickListener("Score");
}
mxG.G.prototype.createScore=function()
{
this.canPlaceScore=0;
this.scoreBtnOn=this.setA("scoreBtnOn",0,"bool");
this.ephemeralScore=this.setA("ephemeralScore",0,"bool");
this.scoreAlias=this.setA("scoreAlias",null,"string");
this.scoreDefaultRules=this.setA("scoreDefaultRules",null,"string");
this.scoreInComment=this.setA("scoreInComment",0,"bool");
this.scoreMethod=this.setA("scoreMethod","trivial","string");
this.disabledElementsWhenScore=[];
return this.scoreBtnOn?this.createBtn("Score"):"";
}
}
if(!mxG.G.prototype.createSgf)
{
mxG.xyProps=new Set(["B","W","AB","AW","AE","LB","MA","TR","SQ","CR",
"VW","AR","DD","LN","SL"]);
mxG.fr(" Close ","Fermer");
mxG.fr("Cancel","Annuler");
mxG.fr("OK","OK");
mxG.fr("SGF","SGF");
mxG.fr("SGF_Long","Télécharger le SGF");
mxG.en("SGF_Long","Download SGF");
mxG.nl2br=function(s)
{
return (s+'').replace(/\r\n|\n\r|\r|\n/g,' ');
}
mxG.sgfEsc=function(s)
{
return (s+'').replace(/([^\\\]]?)(\\|])/g,'$1'+"\\"+'$2');
}
mxG.G.prototype.runTransform=function(x,s)
{
let n1,n2,n3,n4,r,D,DX,DY;
if(x=='SZ')
{
D=s.replace(/[^0-9:]/g,"").match(/^([0-9]+)(:([0-9]+))?$/);
if(D){DX=mxG.min1max52(D[1]);DY=D[3]?mxG.min1max52(D[3]):DX;}
else DX=DY=19;
if(this.transform==3)r=DY+((DX==DY)?"":(":"+DX));
else r=DX+((DX==DY)?"":(":"+DY));
this.sz=r;
return r;
}
if(mxG.xyProps.has(x))
{
D=this.sz.split(":");
DX=parseInt(D[0]);
DY=((D.length>1)?parseInt(D[1]):DX);
if(s.match(/^[a-zA-Z]{2}/))
{
let is5=(x!='LB')&&s.match(/^[a-zA-Z]{2}:[a-zA-Z]{2}$/);
n1=s.c2n(0);
n2=s.c2n(1);
if(this.transform==3){if((n1>DY)||(n2>DX))return s;}
else if((n1>DX)||(n2>DY))return s;
if(is5)
{
n3=s.c2n(3);
n4=s.c2n(4);
if(this.transform==3){if((n3>DY)||(n4>DX))return s;}
else if((n3>DX)||(n4>DY))return s;
}
if(this.transform==1)
{
if(is5)
{
r=this.xy2s(n1,DY+1-n4);
r+=":"+this.xy2s(n3,DY+1-n2);
}
else r=this.xy2s(n1,DY+1-n2);
}
else if(this.transform==2)
{
if(is5)
{
r=this.xy2s(DX+1-n3,n2);
r+=":"+this.xy2s(DX+1-n1,n4);
}
else r=this.xy2s(DX+1-n1,n2);
}
else if(this.transform==3)
{
if(is5)
{
r=this.xy2s(n2,DY+1-n3);
r+=":"+this.xy2s(n4,DY+1-n1);
}
else r=this.xy2s(n2,DY+1-n1);
}
if(x=='LB')r+=s.substring(2);
return r;
}
return s;
}
return s;
}
mxG.G.prototype.buildAllSgf=function(aN,only,c)
{
let rc="\n",k,x,y,ym,aText="",first,keep;
if(c===undefined)c=0;
if(this.transform&&aN.Dad&&(aN.Dad==this.rN))this.sz=(aN.P['SZ']?aN.P['SZ']+"":"19");
if((aN.Dad&&(aN.Dad==this.rN))||(aN.Dad&&(aN.Dad.Kid.length>1)))
{
if(only&4){if((aN.Dad==this.rN)&&(aN==this.kidOnFocus(aN.Dad)))aText+="(";}
else if(only&2){if((aN.Dad==this.rN)&&(aN==aN.Dad.Kid[0]))aText+="(";}
else if((aN.Dad==this.rN)&&(aN==aN.Dad.Kid[0]))aText+="(";
else{aText+=(rc+"(");c=0;}
}
if(aN!=this.rN)
{
if(aText[aText.length-1]!="(")
{
if(aN.Dad&&aN.Dad.Dad&&(aN.Dad.Dad==this.rN)){aText+=rc;c=0;}
else if(c>3){aText+=rc;c=0;}else c++;
}
first=1;
for(x in aN.P)
if(x.match(/^[A-Z]+$/)&&((only&1)?mxG.coreProps.has(x):1))
{
if(first){aText+=";";first=0;}
if(aN.Dad&&(aN.Dad==this.rN)){aText+=rc;c=0;}
else if((x=="TB")||(x=="TW")){aText+=rc;c=4;}
aText+=x;
ym=aN.P[x].length;
for(y=0;y1)))aText+=")";}
return aText;
}
mxG.G.prototype.sgfMandatory=function()
{
for(let a of this.rN.Kid)
{
a.P.FF=["4"];
a.P.CA=[this.toCharset];
a.P.GM=["1"];
a.P.AP=["maxiGos:"+mxG.V];
}
}
mxG.G.prototype.buildSomeSgf=function(only)
{
this.sgfMandatory();
return this.buildAllSgf(this.rN,only,0);
}
mxG.G.prototype.buildSgf=function()
{
this.sgfMandatory();
return this.buildAllSgf(this.rN,(this.sgfSaveCoreOnly?1:0)+(this.sgfSaveMainOnly?2:0),0);
}
mxG.G.prototype.popupSgf=function()
{
let s="\n"+this.buildSgf().noT()+"\n ";
if(this.sgfPopup&&!this.sgfPopup.closed)this.sgfPopup.close();
this.sgfPopup=window.open();
this.sgfPopup.document.open();
this.sgfPopup.document.write(s);
this.sgfPopup.document.close();
this.sgfPopup.document.title="Sgf";
}
mxG.G.prototype.canDownloadSgf=function()
{
if(this.toCharset!="UTF-8")return 0;
return (typeof document.createElement('a').download==='string')?1:0;
}
mxG.G.prototype.doDownloadSgf=function(f)
{
let u,a;
if(this.canDownloadSgf())
{
u="data:application/octet-stream;charset=utf-8,";
u+=encodeURIComponent(this.buildSgf());
a=document.createElement('a');
a.download=f;
a.href=u;
document.body.appendChild(a);
a.click();
a.remove();
}
else this.popupSgf();
}
mxG.G.prototype.doSgfOK=function()
{
let s=this.getE("EditSgfDialog").querySelector('textarea').value,sgf,k;
if(s!=this.sgfBeforeEdit)
{
k=this.rNs.indexOf(this.rN);
sgf=this.rN.sgf?this.rN.sgf:"";
if(this.getE("WindowMenu"))
{
this.rN.cN=this.cN;
}
this.rN=new mxG.P(s,this.sgfLoadCoreOnly,this.sgfLoadMainOnly);
this.rN.sgf=sgf;
if(this.getE("WindowMenu"))this.rNs[k]=this.rN;
this.backNode(this.kidOnFocus(this.rN));
if(this.hasC("Tree"))this.hasToSetTree=1;
this.updateAll();
}
}
mxG.G.prototype.doEditSgf=function()
{
let btns=[{n:"OK",a:"Sgf"},{n:"Cancel"}],s;
s="";
this.doDialog("EditSgf",s,btns);
this.sgfBeforeEdit=this.getE("EditSgfDialog").querySelector('textarea').value;
}
mxG.G.prototype.doShowSgf=function()
{
this.doDialog("ShowSgf",this.buildSgf().noT(),[{n:" Close "}]);
}
mxG.G.prototype.doSgf=function()
{
if(this.sgfAction=="download")
this.doDownloadSgf(this.rN.sgf?this.rN.sgf:"maxiGos.sgf");
else if(this.sgfAction=="edit")this.doEditSgf();
else this.doShowSgf();
}
mxG.G.prototype.initSgf=function()
{
if(this.sgfBtnOn)this.addBtnClickListener("Sgf");
}
mxG.G.prototype.createSgf=function()
{
this.sgfAction=this.setA("sgfAction","show","string");
this.sgfAlias=this.setA("sgfAlias",null,"string");
this.sgfBtnOn=this.setA("sgfBtnOn",0,"bool");
this.toCharset=this.setA("toCharset","UTF-8","string");
return this.sgfBtnOn?this.createBtn("Sgf","SGF"):"";
}
}
if(!mxG.G.prototype.createEdit)
{
mxG.fr("Cut","Couper");
mxG.fr("Copy","Copier");
mxG.fr("Paste","Coller");
mxG.fr("Remove comments","Supprimer les commentaires");
mxG.fr("Selection","Sélection");
mxG.fr("Full/partial view","Vue partielle/totale");
mxG.fr("Place a move","Placer un coup");
mxG.fr("Add/remove a stone","Ajouter/retirer une pierre");
mxG.fr("Add/remove a black stone","Ajouter/retirer une pierre noire");
mxG.fr("Add/remove a white stone","Ajouter/retirer une pierre blanche");
mxG.fr("Cut branch","Couper une branche");
mxG.fr("Copy branch","Copier une branche");
mxG.fr("Paste branch","Coller une branche");
mxG.fr("Label","Étiquette");
mxG.fr("Numbering","Numérotation");
mxG.fr("As in book","Comme dans les livres");
mxG.fr("Indices","Indices");
mxG.fr("Variation marks","Marques sur les variations");
mxG.fr("Variation style","Style des variations");
mxG.fr("Marks and labels","Marques et étiquettes");
mxG.fr("Header","Entête");
mxG.fr("K","L");
mxG.fr("I","I");
mxG.fr("V","V");
mxG.fr("H","E");
mxG.fr("S","S");
mxG.fr("OK","OK");
mxG.fr("Cancel","Annuler");
mxG.fr("New (from this point):","Nouvelle (à partir de cette position) :");
mxG.fr("Modify (only for this part of the game tree)","Modifier (seulement pour cette partie de l'arbre des coups)");
mxG.fr("Remove (only for this part of the game tree)","Supprimer (seulement pour cette partie de l'arbre des coups)");
mxG.fr("Start numbering with:","Numéroter en commençant par :");
mxG.fr("No numbering","Ne pas numéroter");
mxG.fr("Good move","Bon coup");
mxG.fr("Bad move","Mauvais coup");
mxG.fr("Doubtful move","Douteux");
mxG.fr("Interesting move","intéressant");
mxG.fr("Good for Black","Bon pour Noir");
mxG.fr("Good for White","Bon pour Blanc");
mxG.fr("Even","Équilibré");
mxG.fr("Unclear","Pas clair");
mxG.fr("Turn in Sgf","Trait dans le Sgf");
mxG.fr("Horizontal mirror","Miroir horizontal");
mxG.fr("Vertical mirror","Miroir vertical");
mxG.fr("Rotate","Rotation");
mxG.fr("Comments","Commentaire");
mxG.S.prototype.makeFromPath=function(p)
{
return ` `;
}
mxG.S.prototype.makeAloneMark=function(m)
{
let s,d=this.d,dd=d+2,x=dd/2,y=dd/2,c="#000",o={cls:"mxStrokable"};
s=``;
switch(m)
{
case "Circle":s+=this.makeCircle(c,x,y,o);break;
case "Mark":s+=this.makeMark(c,x,y,o);break;
case "Square":s+=this.makeSquare(c,x,y,o);break;
case "Triangle":s+=this.makeTriangle(c,x,y,o);break;
}
return s+` `;
}
mxG.S.prototype.makeAloneToolText=function(txt)
{
let d=this.d,dd=d+2,x=dd/2,y=dd/2,c="#000";
return ``
+`${txt} `;
}
mxG.S.prototype.makeSelectTool=function()
{
let d=this.d,dd=d+2,x=dd/2,y=dd/2,z=d*3/4,c="#000";
return ``
+` `
+` `;
}
mxG.S.prototype.makeViewTool=function()
{
let s,d=this.d,dd=d+2,x=dd/2,y=dd/2,z,c="#000";
z=d*3/4;
return ``
+``
+` `
+` `
+` `;
}
mxG.S.prototype.makeSemiCircle=function(n,x,y,r,c,o)
{
let s=` `;
}
mxG.S.prototype.makeAloneBiStone=function(nat,o)
{
let s,d=this.d,dd=d+2,x=dd/2,y=dd/2,c1,c2,r,z;
z=(this.in3dOn&&this.stoneShadowOn)?this.stoneShadowWidth:0;
if(nat[1]=="B"){c1="B";c2="W";}else{c1="W";c2="B";}
s=``
+``
+` `
+` `
+` `;
r=o.in3dOn?d/2:(d-this.sw4stone+1)/2;
if(o.in3dOn&&this.stoneShadowOn)
{
let e=this.stoneShadowWidth;
s+=` `;
}
s+=this.makeSemiCircle(1,x,y,r,c1,o);
s+=this.makeSemiCircle(2,x,y,r,c2,o);
s+=` `;
return s;
}
mxG.S.prototype.addSelect=function(xl,yt,xr,yb)
{
let dx=this.grim+this.gripx+this.gobp+this.gobm,
dy=this.grim+this.gripy+this.gobp+this.gobm,
x=this.i2x(xl)-this.dw/2-(xl==1?this.dw+dx:0),
y=this.j2y(yt)-this.dh/2-(yt==1?this.dh+dy:0),
w=this.i2x(xr)+this.dw/2-x+(xr==this.DX?this.dw+dx:0),
h=this.j2y(yb)+this.dh/2-y+(yb==this.DY?this.dh+dy:0),
b=document.createElementNS(this.xmlnsUrl,"rect");
b.setAttributeNS(null,"fill","#777");
b.setAttributeNS(null,"opacity","0.5");
b.setAttributeNS(null,"stroke","none");
b.setAttributeNS(null,"x",x);
b.setAttributeNS(null,"y",y);
b.setAttributeNS(null,"width",w);
b.setAttributeNS(null,"height",h);
b.classList.add("mxSelect");
this.gc.firstChild.appendChild(b);
}
mxG.S.prototype.removeSelect=function()
{
let a=this.gc.firstChild,b=a.querySelector('.mxSelect');
if(b)b.remove();
}
mxG.G.prototype.setViewFromSelection=function()
{
let aN,s,xl,yt,xr,yb,exXl,exYt,exXr,exYb,exXls,exYts,exXrs,exYbs;
if(this.selection)
{
xl=((this.editXrs>this.editXls)?this.editXls:this.editXrs);
yt=((this.editYbs>this.editYts)?this.editYts:this.editYbs);
xr=((this.editXrs>this.editXls)?this.editXrs:this.editXls);
yb=((this.editYbs>this.editYts)?this.editYbs:this.editYts);
if(xl<1)xl=1;
if(yt<1)yt=1;
if(xr>this.DX)xr=this.DX;
if(yb>this.DY)yb=this.DY;
this.inSelect=0;
this.unselectView();
}
else
{
xl=1;
yt=1;
xr=this.DX;
yb=this.DY;
}
if((xl==1)&&(yt==1)&&(xr==this.DX)&&(yb==this.DY))s="";
else s=this.xy2s(xl,yt)+":"+this.xy2s(xr,yb);
aN=this.cN;
if(aN.P.VW)
{
aN.takeOff("VW",-1);
if(s)aN.P.VW=[s];
}
else aN.P.VW=[s];
this.updateAll();
}
mxG.G.prototype.unselectTool=function(tool)
{
if(!tool||!this.hasEditTool(tool))return;
this.getE(tool+"Tool").className="mxUnselectedEditTool";
}
mxG.G.prototype.selectTool=function(tool)
{
if(!tool||!this.hasEditTool(tool))return;
this.getE(tool+"Tool").className="mxSelectedEditTool";
}
mxG.G.prototype.superSelectTool=function(tool)
{
if(!tool||!this.hasEditTool(tool))return;
this.getE(tool+"Tool").className="mxSuperSelectedEditTool";
}
mxG.G.prototype.disableTool=function(tool)
{
if(!tool||!this.hasEditTool(tool))return;
if(tool=="Comment")this.getE("EditCommentTool").disabled=true;
else this.getE(tool+"Tool").disabled=true;
}
mxG.G.prototype.enableTool=function(tool)
{
if(!tool||!this.hasEditTool(tool))return;
if(tool=="Comment")this.getE("EditCommentTool").disabled=false;
else this.getE(tool+"Tool").disabled=false;
}
mxG.G.prototype.disableTools=function()
{
let k,km=this.tools.length;
for(k=0;k${this.local("Numbering")}`;
if(aN!=this.cN)
{
s+=``
+`${this.local("New (from this point):")} `
+` `
+`
`;
}
if((aN.Dad!=this.rN)&&aN.P.FG)
{
s+=``
+` `
+`${this.local("Modify (only for this part of the game tree)")} `
+`
`;
}
s+=``
+` `
+`${this.local("Start numbering with:")} `
+` `
+` `
+`${this.local("No numbering")} `
+` ${this.local("As in book")} `
+` ${this.local("Indices")} `
+`
`;
if((aN.Dad!=this.rN)&&aN.P.FG)
s+=``
+` `
+`${this.local("Remove (only for this part of the game tree)")} `
+`
`;
return s;
}
mxG.G.prototype.doNumberingOK=function()
{
let aN;
if(this.getE("NewFigureBox")&&this.getE("NewFigureBox").checked)aN=this.cN;
else
{
aN=this.cN;
while((aN.Dad!=this.rN)&&!(aN.P.FG))aN=aN.Dad;
}
if(this.getE("FigureOrNot2Input")&&this.getE("FigureOrNot2Input").checked)
{
aN.takeOff("FG",0);
aN.takeOff("PM",0);
aN.takeOff("MN",0);
}
else
{
let newNumberingOn=(this.getE("NumberingOrNot1Input").checked?1:0);
let newNumWith=parseInt(this.getE("NumWithTextInput").value);
let newAsInBookOn=(this.getE("AsInBookInput").checked?1:0);
let newIndicesOn=(this.getE("IndicesInput").checked?1:0);
let newFigure=((newAsInBookOn?256:0)|(newIndicesOn?0:1));
if(aN==this.kidOnFocus(this.rN))
{
if(newFigure)aN.put("FG",newFigure);
else aN.takeOff("FG",0);
if((newNumWith>1)&&newNumberingOn)aN.put("MN",newNumWith);
else aN.takeOff("MN",0);
if(newNumberingOn!=1)aN.put("PM",newNumberingOn);
else aN.takeOff("PM",0);
}
else
{
aN.put("FG",newFigure);
aN.put("PM",newNumberingOn);
if(newNumberingOn)aN.put("MN",newNumWith);
else aN.takeOff("MN",0);
}
}
if(this.hasC("Tree"))this.hasToSetTree=1;
this.updateAll();
}
mxG.G.prototype.doNumbering=function()
{
let btns=[{n:"OK",a:"Numbering"},{n:"Cancel"}];
this.doDialog("EditNumbering",this.buildNumbering(),btns);
}
mxG.G.prototype.doVariation=function()
{
if(this.styleMode&2)this.styleMode-=2;else this.styleMode+=2;
this.kidOnFocus(this.rN).put("ST",this.styleMode&~4);
this.updateAll();
}
mxG.G.prototype.doStyle=function()
{
if(this.styleMode&1)this.styleMode-=1;else this.styleMode+=1;
this.kidOnFocus(this.rN).put("ST",this.styleMode&~4);
this.updateAll();
}
mxG.G.prototype.doPropertySwitch=function(tool)
{
let z;
if((tool!="DO")&&(tool!="IT"))z=2;else z=1;
if(this.cN.P&&this.cN.P[tool])
{
if(((this.cN.P[tool][0]+"")=="1")&&(z>1))this.cN.P[tool][0]="2";
else this.cN.takeOff(tool,0);
}
else
{
if((tool=="GB")||(tool=="GW")||(tool=="DM")||(tool=="UC"))
{
if((tool!="GB")&&this.cN.P&&this.cN.P.GB)this.cN.takeOff("GB",0);
if((tool!="GW")&&this.cN.P&&this.cN.P.GW)this.cN.takeOff("GW",0);
if((tool!="DM")&&this.cN.P&&this.cN.P.DM)this.cN.takeOff("DM",0);
if((tool!="UC")&&this.cN.P&&this.cN.P.UC)this.cN.takeOff("UC",0);
}
if((tool=="TE")||(tool=="BM")||(tool=="DO")||(tool=="IT"))
{
if((tool!="TE")&&this.cN.P&&this.cN.P.TE)this.cN.takeOff("TE",0);
if((tool!="BM")&&this.cN.P&&this.cN.P.BM)this.cN.takeOff("BM",0);
if((tool!="DO")&&this.cN.P&&this.cN.P.DO)this.cN.takeOff("DO",0);
if((tool!="IT")&&this.cN.P&&this.cN.P.IT)this.cN.takeOff("IT",0);
}
this.cN.put(tool,(z>1)?"1":"");
}
this.updateAll();
}
mxG.G.prototype.doPL=function()
{
if(this.cN.P&&this.cN.P.PL)this.cN.takeOff("PL",0);
else this.cN.put("PL",this.editNextNat);
this.updateAll();
}
mxG.G.prototype.doTransform=function(transform)
{
let s,z,a=[],aN,n,k,sgf;
if(this.hasC("Sgf"))
{
aN=this.cN;
while(aN)
{
a.push(aN.Focus);
aN=aN.Dad;
}
this.transform=transform;
s=this.buildSgf();
this.transform=0;
k=this.rNs.indexOf(this.rN);
sgf=this.rN.sgf?this.rN.sgf:"";
this.rN=new mxG.P(s,this.sgfLoadCoreOnly,this.sgfLoadMainOnly);
this.rN.Focus=a.pop();
this.rN.sgf=sgf;
this.rNs[k]=this.rN;
this.backNode(this.kidOnFocus(this.rN));
if(this.hasC("Tree"))this.hasToSetTree=1;
while(a.length){this.cN.Focus=a.pop();if(a.length)this.placeNode();}
this.updateAll();
}
}
mxG.G.prototype.doEditTool=function(newTool)
{
if(newTool=="ShowInfo"){this.doInfo();return;}
if(newTool=="Numbering"){this.doNumbering();return;}
if(newTool=="Cut"){this.doCut();return;}
if(newTool=="Copy"){this.doCopy();return;}
if(newTool=="Paste"){this.doPaste();return;}
if(newTool=="AsInBook"){this.doAsInBook();return;}
if(newTool=="Indices"){this.doIndices();return;}
if(newTool=="Variation"){this.doVariation();return;}
if(newTool=="Style"){this.doStyle();return;}
if((newTool=="GB")
||(newTool=="GW")
||(newTool=="DM")
||(newTool=="UC")
||(newTool=="TE")
||(newTool=="BM")
||(newTool=="DO")
||(newTool=="IT")){this.doPropertySwitch(newTool);return;}
if(newTool=="PL"){this.doPL();return;}
if(newTool=="View")
{
let z=this.k;
this.selectTool(newTool);
this.setViewFromSelection();
setTimeout(function(){mxG.D[z].unselectTool(newTool);},200);
if(this.editTool=="Select")this.changeSelectedTool("Play");
return;
}
if(this.selection){this.inSelect=0;this.unselectView();}
if((newTool=="Play")&&(this.editTool=="Play"))
{
if(this.editNextNat=="B"){this.editNextNat="W";this.drawSvgTool("Play");}
else if(this.editNextNat=="W"){this.editNextNat="B";this.drawSvgTool("Play");}
return;
}
if((newTool=="Setup")&&(this.editTool=="Setup"))
{
if(this.editAX=="AB"){this.editAX="AW";this.drawSvgTool("Setup");}
else if(this.editAX=="AW"){this.editAX="AB";this.drawSvgTool("Setup");}
return;
}
if((newTool=="SetupBlack")&&(this.editTool!="SetupBlack"))
{
this.editAX="AB";
this.changeSelectedTool("SetupBlack");
return;
}
if((newTool=="SetupWhite")&&(this.editTool!="SetupWhite"))
{
this.editAX="AW";
this.changeSelectedTool("SetupWhite");
return;
}
if(newTool=="VM"){this.doTransform(1);return;}
if(newTool=="HM"){this.doTransform(2);return;}
if(newTool=="R"){this.doTransform(3);return;}
this.changeSelectedTool(newTool);
}
mxG.G.prototype.doEditCommentTool=function()
{
let s=this.getE("EditCommentTool").value;
if(s)this.cN.put("C",s);
else this.cN.takeOff("C",0);
}
mxG.G.prototype.getNextEditNat=function()
{
let aN=this.cN;
if(aN.P.PL)return aN.P.PL[0];
aN=this.kidOnFocus(this.cN);
if(aN)
{
if(aN.P.B)return "B";
if(aN.P.W)return "W";
}
aN=this.cN;
if(aN.P.B)return "W";
if(aN.P.W)return "B";
if(aN.P.AB&&!aN.P.AW)return "W";
else if(aN.P.AW&&!aN.P.AB)return "B";
for(aN of this.cN.Kid)
{
if(aN.P.B)return "B";
if(aN.P.W)return "W";
}
for(aN of this.cN.Dad.Kid)
{
if(aN.P.B)return "W";
if(aN.P.W)return "B";
}
return "B";
}
mxG.G.prototype.checkEditPlay=function(a,b)
{
let nextNat=this.editNextNat,k,km;
if(!nextNat){this.plonk();return;}
if((a||b)&&this.gor.isOccupied(a,b)){this.plonk();return;}
k=0;
km=this.cN.Kid.length;
while(kthis.xri)||(c.ythis.ybi))
this.inSelect=0;
}
}
}
mxG.G.prototype.doKeydownSelect=function(x,y)
{
if(this.inSelect==2)this.inSelect=0;
else
{
this.inSelect=2;
if(this.selection)this.unselectView();
this.editXls=x;
this.editYts=y;
this.editXrs=x;
this.editYbs=y;
this.selectView();
}
}
mxG.G.prototype.checkEdit=function(x,y)
{
switch(this.editTool)
{
case "Play": this.checkEditPlay(x,y);break;
case "Setup":
case "SetupBlack":
case "SetupWhite": this.checkEditSetup(x,y,this.editTool);break;
case "Mark": this.checkEditMarkOrLabel(x,y,"MA");break;
case "Triangle": this.checkEditMarkOrLabel(x,y,"TR");break;
case "Circle": this.checkEditMarkOrLabel(x,y,"CR");break;
case "Square": this.checkEditMarkOrLabel(x,y,"SQ");break;
case "Label": this.checkEditMarkOrLabel(x,y,"LB");break;
}
}
mxG.G.prototype.drawSvgTool=function(tool)
{
let e=this.getE(tool+"Tool"),nat,txt,o;
o={in3dOn:this.in3dOn,stoneShadowOn:this.stoneShadowOn,type:"tool",role:"presentation"};
switch(tool)
{
case "Select":e.innerHTML=this.scr.makeSelectTool();break;
case "View":e.innerHTML=this.scr.makeViewTool();break;
case "Play":
nat=this.editNextNat;
if(this.hasEditTool("Setup"))s=this.scr.makeAloneStone(nat,"",o);
else s=this.scr.makeAloneBiStone(nat,o);
e.innerHTML=s;break;
case "Setup":nat=this.editAX;e.innerHTML=this.scr.makeAloneBiStone(nat,o);break;
case "SetupBlack":e.innerHTML=this.scr.makeAloneStone("B","",o);break;
case "SetupWhite":e.innerHTML=this.scr.makeAloneStone("W","",o);break;
case "Cut":
case "Copy":
case "Paste":
e.innerHTML=this.scr.makeFromPath(this[tool.toLowerCase()+"SvgPath"]);break;
case "Circle":
case "Mark":
case "Square":
case "Triangle":e.innerHTML=this.scr.makeAloneMark(tool);break;
case "Numbering":e.innerHTML=this.scr.makeAloneStone("W",5,o);break;
case "ShowInfo":e.innerHTML=this.scr.makeAloneToolText(this.local("H"));break;
case "AsInBook":e.innerHTML=this.scr.makeAloneToolText(this.local("K"));break;
case "Indices":e.innerHTML=this.scr.makeAloneToolText(this.local("I"));break;
case "Variation":e.innerHTML=this.scr.makeAloneToolText(this.local("V"));break;
case "Style":e.innerHTML=this.scr.makeAloneToolText(this.local("S"));break;
case "GB":e.innerHTML=this.scr.makeAloneToolText(this.local("●+"));break;
case "GW":e.innerHTML=this.scr.makeAloneToolText(this.local("○+"));break;
case "DM":e.innerHTML=this.scr.makeAloneToolText(this.local("="));break;
case "UC":e.innerHTML=this.scr.makeAloneToolText(this.local("~"));break;
case "TE":e.innerHTML=this.scr.makeAloneToolText(this.local("!"));break;
case "BM":e.innerHTML=this.scr.makeAloneToolText(this.local("?"));break;
case "DO":e.innerHTML=this.scr.makeAloneToolText(this.local("?!"));break;
case "IT":e.innerHTML=this.scr.makeAloneToolText(this.local("!?"));break;
case "PL":e.innerHTML=this.scr.makeAloneToolText(this.local("T"));break;
case "R":e.innerHTML=this.scr.makeAloneToolText(this.local("↺"));break;
case "VM":e.innerHTML=this.scr.makeAloneToolText(this.local("↕"));break;
case "HM":e.innerHTML=this.scr.makeAloneToolText(this.local("↔"));break;
}
}
mxG.G.prototype.drawEditTools=function()
{
let k,km=this.tools.length,tool;
for(k=0;k`:` `;
}
mxG.G.prototype.initEditTools=function()
{
let k,km=this.tools.length,tool,e;
for(k=0;k=0;
}
mxG.G.prototype.createEdit=function()
{
let s,k=0,m,mm;
this.tools=[
"Select","View","Play","Setup","Cut","Copy","Paste",
"Numbering","ShowInfo","Label","Mark","Circle","Square","Triangle",
"AsInBook","Indices","Variation","Style",
"GB","GW","DM","UC","TE","BM","DO","IT","PL","R","VM","HM"];
this.canPlaceEdit=1;
this.extraEditToolsOn=1;
this.et=1;
this.zN=null;
this.cutSvgPath="M167,252C149,252 132,255 117,265 7,333 73,500 226,458 280,443 343,472 367,490 407,521 408,522 367,554 344,571 268,594 234,586 170,571 114,590 86,628 48,679 61,748 104,778 145,806 210,809 245,772 273,740 284,710 281,674 276,619 274,615 370,593 464,570 485,574 669,644 800,694 883,714 920,705 949,698 974,684 974,676 974,667 891,632 792,597 692,562 611,528 611,521 611,513 687,480 782,448 971,381 1002,358 920,338 883,328 801,349 661,402 549,444 447,472 434,464 421,456 375,445 334,437 280,425 266,416 272,369 275,335 263,299 235,275 216,258 189,252 167,252ZM169,286C179,286 190,288 200,293 225,305 241,333 239,360 238,388 219,414 192,423 166,433 136,425 117,405 98,386 92,354 103,329 114,303 141,285 169,286ZM170,623C208,623 240,654 240,693 240,731 208,763 170,763 131,763 100,731 100,693 100,654 131,623 170,623 Z";
this.copySvgPath="M448,640V405H661 874V640 875H661 448ZM810,747C810,734 746,725 661,725 576,725 512,734 512,747 512,759 576,768 661,768 746,768 810,759 810,747ZM810,640C810,628 746,619 661,619 576,619 512,628 512,640 512,652 576,661 661,661 746,661 810,652 810,640ZM810,533C810,521 746,512 661,512 576,512 512,521 512,533 512,545 576,555 661,555 746,555 810,545 810,533ZM149,384V149H362 576V256 363H490 405V491 619H277 149ZM384,491C384,479 345,469 298,469 251,469 213,479 213,491 213,502 251,512 298,512 345,512 384,502 384,491ZM384,384C384,372 345,363 298,363 251,363 213,372 213,384 213,396 251,405 298,405 345,405 384,396 384,384ZM512,277C512,265 448,256 362,256 277,256 213,265 213,277 213,289 277,299 362,299 448,299 512,289 512,277 Z";
this.pasteSvgPath="M448,661V426H661 875V661 896H661 448ZM811,768C811,755 747,746 661,746 576,746 512,755 512,768 512,780 576,789 661,789 747,789 811,780 811,768ZM811,661C811,649 747,640 661,640 576,640 512,649 512,661 512,673 576,682 661,682 747,682 811,673 811,661ZM811,554C811,542 747,533 661,533 576,533 512,542 512,554 512,566 576,576 661,576 747,576 811,566 811,554ZM149,512C149,256 168,170 201,275 217,323 273,340 416,340 559,340 615,323 630,275 651,208 683,229 683,309V384H544 405V586 789H277 149ZM234,234C234,181 243,170 286,170 324,170 340,157 345,122 350,85 365,74 416,74 466,74 481,85 486,122 491,157 508,170 545,170 589,170 597,181 597,234V298H416 234 Z";
this.inSelect=0;
this.selection=0;
this.editTool=0;
s=``;
for(let t of this.tools)s+=this.makeTool(t);
s+=`
`;
s+=``;
this.menuEditItems=
[
{n:"Cut",v:this.local("Cut")},
{n:"Copy",v:this.local("Copy")},
{n:"Paste",v:this.local("Paste")},
{n:"RemoveComments",v:this.local("Remove comments")}
];
return s;
}
}
if(!mxG.G.prototype.createInfo)
{
mxG.fr("Info","Info");
mxG.fr("OK","OK");
mxG.fr("Cancel","Annuler");
mxG.fr("Event","Évènement");
mxG.fr("Round","Ronde");
mxG.fr("Rank","Niveau");
mxG.fr("Komi","Komi");
mxG.fr("Handicap","Handicap");
mxG.fr("Result","Résultat");
mxG.fr("Date","Date");
mxG.fr("Place","Lieu");
mxG.fr("Rules","Règle");
mxG.fr("Time limits","Temps");
mxG.fr("Overtime","Byoyomi");
mxG.fr("Annotations","Annotations");
mxG.fr("Copyright","Copyright");
mxG.fr("Source","Source");
mxG.fr("User","Utilisateur");
mxG.fr("Black team","Équipe de Noir");
mxG.fr("White team","Équipe de Blanc");
mxG.fr("Game name","Nom de la partie");
mxG.fr("Opening","Ouverture");
mxG.fr("General comment","Commentaire général");
mxG.fr("by resign","par abandon");
mxG.fr("by time","au temps");
mxG.fr("by forfeit","par forfait");
mxG.fr("by","de");
mxG.fr("on points","aux points");
mxG.fr("suspended","suspendu");
mxG.fr("Main","Informations principales");
mxG.fr("Other","Autres informations");
mxG.fr("Black","Noir");
mxG.fr("White","Blanc");
mxG.fr(" wins"," gagne");
mxG.fr("no result","sans résultat");
mxG.fr("draw","partie nulle");
mxG.fr("unknown","inconnu");
mxG.G.prototype.popInfo=function(aPropName)
{
let aN;
aN=this.kidOnFocus(this.rN);
aN.takeOff(aPropName,0);
}
mxG.G.prototype.decodeResult=function(a)
{
this.WN="";
this.HW="";
this.SC="";
if(a)
{
this.WN=a.substring(0,1);
if(this.WN=="0")this.WN="D";
if(a.substring(1,2)=="+")
{
this.WN+="+";
if(a.substring(2,3)=="R")this.HW="R";
else if(a.substring(2,3)=="T")this.HW="T";
else if(a.substring(2,3)=="F")this.HW="F";
else if(a.length>2)
{
this.HW="P";
this.SC=a.substring(2);
}
}
}
}
mxG.G.prototype.changeInfoStatus=function(el,b)
{
let c=el.className.replace(" mxBadInput","");
if(b)el.className=c;else el.className=c+" mxBadInput";
}
mxG.G.prototype.checkRank=function(el,ev)
{
this.changeInfoStatus(el,(el.value+"").search(/^([0-9]+[kdp]?)?$/)==0);
}
mxG.G.prototype.checkHandicap=function(el,ev)
{
this.changeInfoStatus(el,!el.value||(((el.value+"").search(/^[0-9]+$/)==0)&&(parseInt(el.value)>1)));
}
mxG.G.prototype.checkReal=function(el,ev)
{
this.changeInfoStatus(el,(el.value+"").search(/^([0-9]+([.]([0-9]+)?)?)?$/)==0);
}
mxG.G.prototype.encodeResult=function()
{
let e=this.getE("RE"),WN=this.getE("WN").value,HW;
if(WN=="D")e.value="Draw";
else if(WN=="V")e.value="Void";
else e.value=WN;
if((WN=="B+")||(WN=="W+"))
{
HW=this.getE("HW").value;
if (!HW||(HW=="P"))e.value+=this.getE("SC").value;
else e.value+=HW;
}
}
mxG.G.prototype.buildInfo=function()
{
this.decodeResult(this.getInfo("RE",0));
return `${this.local("Game name")} `
+`${this.local("Event")} `
+`${this.local("Round")} `
+`${this.local("Date")} `
+`${this.local("Place")} `
+`${this.local("Black")} `
+`${this.local("Rank")} `
+`${this.local("White")} `
+`${this.local("Rank")} `
+`${this.local("Komi")} `
+`${this.local("Handicap")} `
+``
+`${this.local("Result")} `
+``
+` `
+`${this.local("Black")+this.local(" wins")} `
+`${this.local("White")+this.local(" wins")} `
+`${this.local("draw")} `
+`${this.local("no result")} `
+`${this.local("unknown")} `
+` `
+``
+` `
+`${this.local("on points")} `
+`${this.local("by resign")} `
+`${this.local("by time")} `
+`${this.local("by forfeit")} `
+` `
+`${this.local("by")} `
+` `
+` `
+`
`
+`${this.local("General comment")} `
+`${this.local("Black team")} `
+`${this.local("White team")} `
+`${this.local("Rules")} `
+`${this.local("Time limits")} `
+`${this.local("Overtime")} `
+`${this.local("Opening")} `
+`${this.local("Annotations")} `
+`${this.local("Copyright")} `
+`${this.local("Source")} `
+`${this.local("User")} `;
}
mxG.G.prototype.putInfoInBox=function()
{
let p,pm,IX=["EV","RO","DT","PC","PB","BR","PW","WR","HA","KM","RE","GC","RU","TM","OT","AN","CP","SO","US","GN","BT","WT","ON"];
pm=IX.length;
for(p=0;p"Variation "+a[0]+" parmi "+a[1]);
mxG.en("buildVariationTreeNum",a=>"Variation "+a[0]+" of "+a[1]);
mxG.S.prototype.getTxy=function(ev)
{
let w=this.ddT*this.p.getTreeRatio(),
c0=this.p.getTreeOffset(),
c=this.p.tc.getMClick(ev);
return {x:Math.floor((c.x-c0.x)/w),y:Math.floor((c.y-c0.y)/w)};
}
mxG.S.prototype.makeTreePointDesc=function()
{
let aN=this.p.cN,nat,s="",x,y,n;
s+=this.makeOneInfoFromGameTree(aN,1);
pN=aN.Dad;
if((n=pN.Kid.length)>1)
{
let m=pN.Focus,desc=this.p.build("VariationTreeNum",[m,n]);
if(desc&&(desc!=([m,n]+"")))s+=". "+desc;
else s+=". "+this.p.local("Variation")+" "+m;
}
return s;
}
mxG.S.prototype.setTreeTitleDesc=function(status)
{
let s;
if(status==1)s=this.makeTreePointDesc();
else s=this.p.local("Game tree");
this.p.tb.setAttribute("aria-label",s);
}
mxG.S.prototype.makeTreeTriangle=function(x,y,d,c,cls)
{
let e,x1,y1,x2,y2,x3,y3,z;
z=d*0.32;
x1=x;
y1=y-z;
x2=x-z;
y2=y+z*0.8;
x3=x+z;
y3=y+z*0.8;
e=document.createElementNS(this.xmlnsUrl,"polygon");
e.setAttributeNS(null,"fill","none");
e.setAttributeNS(null,"stroke",c);
e.setAttributeNS(null,"stroke-width",this.sw4mark);
e.setAttributeNS(null,"points",x1+" "+y1+" "+x2+" "+y2+" "+x3+" "+y3);
e.classList.add(cls);
return e;
}
mxG.S.prototype.makeOneTreeBlockContainer=function(x,y,z)
{
let gr,dd=this.ddT,k=this.p.k,m=this.p.treeM,
n=Math.min(this.p.treeN,this.p.treeRowMax-y),
w=m*dd,h=n*dd;
gr=document.createElementNS(this.xmlnsUrl,"svg");
gr.setAttribute("id",this.p.n+"TreeBlockSvg"+this.p.idt(x,y));
gr.setAttribute("data-z",z);
gr.setAttributeNS(null,"width",w);
gr.setAttributeNS(null,"height",h);
gr.setAttributeNS(null,"viewBox","0 0 "+w+" "+h);
gr.setAttributeNS(null,"font-family",this.ff);
gr.setAttributeNS(null,"font-size",this.fs);
gr.setAttributeNS(null,"font-weight",this.fw);
gr.setAttributeNS(null,"text-anchor","middle");
gr.setAttributeNS(null,"fill","none");
gr.setAttributeNS(null,"stroke","none");
gr.setAttribute("role","presentation");
gr.setAttribute("aria-hidden","true");
gr.style.maxWidth="none";
this.p.treeObserver.observe(gr);
return gr;
}
mxG.S.prototype.drawTreeLines=function(k,p)
{
let e=document.createElementNS(this.xmlnsUrl,"path");
e.setAttributeNS(null,"stroke","#000");
e.setAttributeNS(null,"stroke-width",this.sw4grid);
e.setAttributeNS(null,"d",p);
e.classList.add("mxTreeLine");
this.p.treeBlocks[k].prepend(e);
}
mxG.S.prototype.makeTreeLine=function(s,x,y)
{
let d=this.dT,dd=this.ddT,r=this.rT,r2=this.r2T,r3=this.r3T,
xo,yo,x1,y1,x2,y2,n=this.p.treeN,k=Math.floor(y/n);
xo=x*dd;
yo=(y-k*n)*dd;
x1=xo+r2+r;
y1=yo+r2+r;
x2=xo+dd;
y2=yo+dd;
if(s=="H2L")return "M"+xo+" "+y1+"H"+(xo+r2);
if(s=="D2TL")return "M"+xo+" "+yo+"L"+(xo+r3)+" "+(yo+r3);
if(s=="H2R")return "M"+(x2-r2)+" "+y1+"H"+x2;
if(s=="D2BR")return "M"+(x2-r3)+" "+(y2-r3)+"L"+x2+" "+y2;
if(s=="V2B")return "M"+x1+" "+(y2-r2)+"V"+y2;
if(s=="V1")return "M"+x1+" "+yo+"V"+y2;
if(s=="A1")return "M"+x1+" "+yo+"V"+y1+"L"+x2+" "+y2;
if(s=="T1")return "M"+x1+" "+yo+"V"+y2+"M"+x1+" "+y1+"L"+x2+" "+y2;
return "";
}
mxG.S.prototype.drawTreePoint=function(aN)
{
let gr,e,d=this.dT,dd=this.ddT,r=this.rT,r2=this.r2T,rg,a,cx,cy,
nat,s="",x,y,xo,yo,xx,yy,c,ac,cls,good,
n=this.p.treeN,m=this.p.treeM,tree=this.p.tree,p="";
if(aN.P["B"])nat="B";else if(aN.P["W"])nat="W";else nat="E";
if(!this.p.hideTreeNumbering&&((nat=="B")||(nat=="W")))
{
if(aN.P.C&&this.p.markCommentOnTree)s="?";
else s=this.p.getAsInTreeNum(aN)+"";
}
x=aN.iTree;
y=aN.jTree;
xx=Math.floor(x/m)*m;
yy=Math.floor(y/n)*n;
xo=(x-xx)*dd;
yo=(y-yy)*dd;
cx=xo+r2+r;
cy=yo+r2+r;
gr=this.p.treeBlocks[yy/n];
if(good=this.p.hasEmphasis(aN))
{
c=this.p.getEmphasisColor(good);
cls=this.p.getEmphasisClass(good);
e=this.p.buildTreeEmphasis(cx,cy,d,c,cls);
e.setAttribute("id",this.p.n+"TreeEmphasis"+this.p.idt(x,y));
gr.appendChild(e);
}
if((nat=="B")||(nat=="W"))
{
c=(nat=="B")?"Black":"White";
ac=(nat=="B")?"White":"Black";
if(this.stoneShadowOn)
{
let sw=this.stoneShadowWidth;
e=document.createElementNS(this.xmlnsUrl,"circle");
e.setAttribute("id",this.p.n+"TreeNodeShadow"+this.p.idt(x,y));
e.setAttributeNS(null,"cx",cx+sw);
e.setAttributeNS(null,"cy",cy+sw);
e.setAttributeNS(null,"r",r);
e.setAttributeNS(null,"fill","#000");
e.setAttributeNS(null,"opacity","0.2");
e.setAttributeNS(null,"stroke","none");
gr.appendChild(e);
}
e=document.createElementNS(this.xmlnsUrl,"circle");
e.setAttribute("id",this.p.n+"TreeNode"+this.p.idt(x,y));
e.setAttributeNS(null,"cx",cx);
e.setAttributeNS(null,"cy",cy);
if(this.in3dOn)
{
rg=this.p.specialStoneOn?"A":"";
e.setAttributeNS(null,"fill","url(#"+this.p.n+c[0]+"RG"+rg+")");
e.setAttributeNS(null,"stroke","none");
e.setAttributeNS(null,"r",r);
}
else
{
e.setAttributeNS(null,"fill",c);
e.setAttributeNS(null,"stroke","Black");
e.setAttributeNS(null,"stroke-width",this.sw4stone);
e.setAttributeNS(null,"r",r-(this.sw4stone-1)/2);
}
e.classList.add("mx"+c);
gr.appendChild(e);
if(this.in3dOn&&this.p.specialStoneOn)
{
e=document.createElementNS(this.xmlnsUrl,"circle");
e.setAttribute("id",this.p.n+"TreeNodeSpecial"+this.p.idt(x,y));
e.setAttributeNS(null,"cx",cx);
e.setAttributeNS(null,"cy",cy);
e.setAttributeNS(null,"r",r);
e.classList.add("mx"+c);
a=(c=="White")?Math.floor(x*this.p.alea+y)%8:"";
e.setAttributeNS(null,"fill","url(#"+this.p.n+c[0]+"RGB"+a+")");
e.setAttributeNS(null,"stroke","none");
gr.appendChild(e);
}
if(s)
{
let dy=5;
e=document.createElementNS(this.xmlnsUrl,"text");
e.setAttributeNS(null,"x",cx);
e.setAttributeNS(null,"y",cy+dy);
e.setAttributeNS(null,"fill",ac);
if(this.sw4text!="0")
{
e.setAttributeNS(null,"stroke",ac);
e.setAttributeNS(null,"stroke-width",this.sw4text);
}
if(s.length>1)
{
let v,sx=(s.length>2)?0.8:0.9;
v="matrix("+sx+",0,0,1,"+Math.round(cx*(1-sx)*100)/100+",0)";
e.setAttributeNS(null,"transform",v);
}
e.classList.add="mxOn"+c;
e.textContent=s;
gr.appendChild(e);
}
}
else
{
e=this.makeTreeTriangle(cx,cy,d,"#000","mxMark");
e.setAttribute("id",this.p.n+"TreeNode"+this.p.idt(x,y));
gr.appendChild(e);
}
if(x)
{
if(tree[y][x-1]==aN.Dad)p+=this.makeTreeLine("H2L",x,y);
else p+=this.makeTreeLine("D2TL",x,y);
}
if(aN.Kid&&aN.Kid.length)
{
if((tree[y][x+1]!=undefined)&&(tree[y][x+1]!=undefined)&&(tree[y][x+1].Dad==aN))
p+=this.makeTreeLine("H2R",x,y);
if((tree[y+1]!=undefined)&&(tree[y+1][x+1]!=undefined)&&(tree[y+1][x+1].Dad==aN))
p+=this.makeTreeLine("D2BR",x,y);
if((tree[y+1]!=undefined)&&(tree[y+1][x]!=undefined)
&&((tree[y+1][x].Shape==-1)||(tree[y+1][x].Shape==-2)||(tree[y+1][x].Shape==-3)))
p+=this.makeTreeLine("V2B",x,y);
}
return p;
}
mxG.S.prototype.drawTreeBlock=function(k)
{
let i,j,jo,jm,nv=Math.min(this.p.treeN,this.p.treeRowMax),p="";
jo=Math.max(0,k*nv);
jm=Math.min(jo+nv,this.p.treeRowMax);
for(j=jo;jscrollLeft)e.scrollLeft=right-width;
if(topscrollTop)e.scrollTop=bottom-height;
}
mxG.G.prototype.drawTree=function()
{
let tc=this.tc;
this.treeCheck=[];
this.buildTreeBlocksContainer();
tc.replaceChildren();
for(let e of this.treeBlocks)tc.appendChild(e);
this.scrollTreeToShowFocus();
}
mxG.G.prototype.disableTree=function()
{
if(!this.tb.hasAttribute("data-maxigos-disabled"))
{
this.tb.setAttribute("data-maxigos-disabled","1");
this.tb.setAttribute("tabindex","-1");
}
}
mxG.G.prototype.enableTree=function()
{
if(this.tb.hasAttribute("data-maxigos-disabled"))
{
this.tb.removeAttribute("data-maxigos-disabled");
this.tb.setAttribute("tabindex","0");
}
}
mxG.G.prototype.isTreeDisabled=function()
{
return this.tb.hasAttribute("data-maxigos-disabled");
}
mxG.G.prototype.setTree=function()
{
let k,km=this.rN.Kid.length,aN;
this.tree=[];
this.treeRowMax=0;
this.treeColumnMax=0;
for(k=0;k`
+`
`;
}
}
if(!mxG.G.prototype.createVersion)
{
mxG.G.prototype.createVersion=function()
{
this.versionBoxOn=this.setA("versionBoxOn",0,"bool");
if(this.versionBoxOn)
return `maxiGos ${mxG.V}
`;
return "";
}
}
mxG.K++;
mxG.B=[["Menu","File","View","Goban","Navigation","Variation"],[["Help","Sgf","Png","Svg","Score","Pass"],"Edit","Info","Tree","Version"],"AfterView"];
mxG.D[mxG.K]=new mxG.G(mxG.K,mxG.B);
mxG.D[mxG.K].theme="Minimalist";
mxG.D[mxG.K].config="Edit";
mxG.D[mxG.K].style=".mxMinimalistTheme{--gobanScale:1;--gobanMaxWidth:calc(1em * var(--gobanScale) * var(--gobanIntrinsicWidth,445) / 16);--navigationMaxWidth:calc(1em * 445 / 16);--columnMaxWidth:max(var(--gobanMaxWidth),var(--navigationMaxWidth));--border:1px solid #0007;--color:#000;--btnBk:#fff;--btnBorder:1px solid #0007;--btnColor:#000;--selectedBtnBk:#000;--selectedBtnBorder:1px solid #000;--selectedBtnColor:#fff;text-align:left;& button,& select,& textarea{-webkit-appearance:none;-moz-appearance:none;}& [disabled]{cursor:default;}& input[type=file]{visibility:hidden;position:fixed;}& [data-maxigos-disabled],& [disabled]{opacity:0.5;}& form,fieldset{border:0;margin:0;padding:0;}& svg{display:block;width:100%;height:100%;}&,& input,& select,& meter,& button{font-family:sans-serif;font-size:1em;}& p:first-of-type{margin-top:0;}&{max-width:var(--columnMaxWidth);margin:0 auto;}&.mxCommentConfig,&.mxEditConfig,&.mxLessonConfig,&.mxTreeConfig{max-width:calc(var(--columnMaxWidth) * 2 + 0.25em + 4px);display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;gap:0.25em;}&.mxCommentConfig>div,&.mxEditConfig>div,&.mxLessonConfig>div,&.mxTreeConfig>div{flex:1 1 calc(var(--columnMaxWidth) + 2px);max-width:min(100%,calc(var(--columnMaxWidth) + 2px));display:flex;flex-direction:column;}& .mxSgfParent,& .mxMenuBox{margin:0;padding:min(2.5vw,0.25em);text-align:center;}& .mxSgfParent>div{display:inline-block;margin:0.25em 0;padding:0;}& .mxSgfParent button,& .mxMenuBox button,& dialog button{box-sizing:border-box;margin:min(2.5vw,0.25em);padding:0 min(5vw,0.5em);min-height:1.75em;line-height:1.75em;}& .mxSgfParent button,& .mxMenuBox button{border:var(--btnBorder);background:var(--btnBk);color:var(--btnColor);}& dialog button{border:1px solid #777;background:#fff;color:#000;}& dialog button[value=\"FileInput\"]{min-height:1.75em;height:auto;}& .mxSgfParent button.mxSelectedBtn{background:var(--selectedBtnBk);border:var(--selectedBtnBorder);color:var(--selectedBtnColor);}& dialog,& dialog *{box-sizing:border-box;}& dialog::backdrop{background: #0007;}& dialog{max-width:calc(100% - 5vw);border:0;padding:0;}& dialog .mxContentFieldset{padding:min(2.5vw,0.5em);}& dialog.mxEditOptionsDialog .mxContentFieldset{line-height:1.5em;}& dialog .mxMenuFieldset{background:#eee;min-height:3em;line-height:3em;text-align:center;}& dialog label:not([for]){display:block;}& dialog input[type=text],& dialog select{border:var(--border);background:#fff;}& dialog select{text-align:center;}& dialog a{color:#000;}& dialog img{display:block;margin:0 auto;max-width:100%;height:auto;border:0;}& dialog textarea{display:block;width:100%;border:var(--border);}& .mxEditSgfDialog{min-width:min(80%,var(--gobanMaxWidth));}& .mxEditSgfDialog textarea{font-family:monospace;white-space:pre-wrap;min-height:min(50vh,var(--gobanMaxWidth));}&.mxCommentConfig .mxCommentBox,&.mxTreeConfig .mxCommentBox{box-sizing:border-box;border:var(--border);height:8em;overflow:auto;padding:0.25em;resize:vertical;}&.mxCommentConfig .mxCommentBox{flex:auto;}& .mxGobanBox{flex:auto;display:flex;flex-direction:column;}&.mxCommentConfig .mxGobanBox,&.mxEditConfig .mxGobanBox,&.mxLessonConfig .mxGobanBox,&.mxTreeConfig .mxGobanBox{box-sizing:border-box;border:var(--border);}& .mxGobanContent{max-width:var(--gobanMaxWidth);width:100%;margin:auto;}& meter{--meterGoodColor:#fff;--meterBadColor:#0007;display:block;margin:1em;padding:0;width:calc(100% - 2em);height:0.5em;border:var(--border);border-radius:0.25em;overflow:hidden;background:var(--meterBadColor);}& ::-webkit-meter-bar{width:100%;height:0.5em;border:0;border-radius:0;background:#0000;}& ::-webkit-meter-optimum-value{background:var(--meterGoodColor);}@supports selector(::-moz-meter-bar){& :-moz-meter-optimum::-moz-meter-bar{background:var(--meterGoodColor);}}&.mxGameConfig .mxHeaderBox,&.mxKifuConfig .mxHeaderBox,&.mxReplayConfig .mxHeaderBox{padding:0 2.5%;overflow:auto;}& .mxHeaderTitle{font-weight:bold;}& .mxNavigationBox:not(:empty){max-width:var(--navigationMaxWidth);width:100%;margin:0 auto;display:flex;justify-content:space-around;align-items:center;max-height:3em;}& .mxNavigationBox button{flex:1;max-height:3em;max-width:3em;margin:0;padding:0;border:0;background:none;}& .mxNavigationBox button svg{margin:20% auto;max-width:60%;}& .mxAutoBtn[disabled],& .mxPauseBtn[disabled]{display:none;}& .mxNotSeenBox:not(:empty){max-width:var(--gobanMaxWidth);margin:0.5em auto 0 auto;}& .mxSpeedBox [type=range]{--speedColor: #000;display:block;margin:0;padding:0 1em;width:calc(100% - 2em);height:2.5em;border:0;border-radius:0;background:#0000;-webkit-appearance:none;}& .mxSpeedBox [type=range]::-webkit-slider-runnable-track{box-sizing:border-box;height:0.5em;border:0;border-radius:0.25em;background:var(--speedColor);}& .mxSpeedBox [type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-0.5em;box-sizing:border-box;width:1.5em;height:1.5em;border:0;border-radius:50%;background:var(--speedColor);}@supports selector(::-moz-range-track) and selector(::-moz-range-thumb){& .mxSpeedBox [type=range]::-moz-range-track{box-sizing:border-box;height:0.5em;border:0;border-radius:0.25em;background:var(--speedColor);}& .mxSpeedBox [type=range]::-moz-range-thumb{box-sizing:border-box;width:1.5em;height:1.5em;border:0;border-radius:50%;background:var(--speedColor);}}& .mxTreeBox{box-sizing:border-box;flex:auto;border:var(--border);height:7em;overflow:auto;resize:vertical;margin-top:0.25em;max-width:100%;}& .mxTreeContent{width:calc(1em * var(--treeIntrinsicWidth) / 16);}& .mxTreeBox svg{width:100%;height:auto;}& .mxVersionBox{text-align:center;min-height:3em;line-height:3em;}& .mxGobanSvg:not(:focus-visible){outline:0;}& .mxGobanSvg:not(:focus-visible) .mxFocus{display:none;}& .mxBtn:focus-visible{position:relative;z-index:10;}&:not(.mxDiagramConfig):not(.mxKifuConfig):not(.mxLoopConfig) .mxGobanBox svg,& button:not([disabled]),& input[type=\"range\"]:not([disabled]),& .mxTreeBox svg circle,& .mxTreeBox svg polygon,& .mxTreeBox svg rect,& .mxTreeBox svg text{cursor:pointer;}}";
mxG.D[mxG.K].style4Edit=".mxMinimalistTheme.mxEditConfig{--subBtnBk:var(--btnBk);--subBtnBorder:var(--border);--subBtnColor:var(--color);--toolBk:#0000;--toolBorder:var(--border);--toolColor:var(--color);--selectedToolBk:#0002;--selectedToolBorder:var(--border);--selectedToolColor:var(--color);--superSelectedToolBk:#0004;--superSelectedToolBorder:var(--border);--superSelectedToolColor:var(--color);--gobanMaxWidth:calc(1em * 511 / 16);max-width:calc(var(--gobanMaxWidth) * var(--gobanScale) * 2 + 0.25em + 4px);&>div{flex:1 1 calc(var(--gobanMaxWidth) * var(--gobanScale) + 2px);max-width:min(100%,calc(var(--gobanMaxWidth) * var(--gobanScale) + 2px));}& .mxGobanBox{margin:auto;width:100%;max-width:min(100%,calc(var(--gobanMaxWidth) * var(--gobanScale) + 2px));}&.mxIn3d .mxGobanBox{max-width:min(100%,calc(var(--gobanMaxWidth) * var(--gobanScale) * 491 / 511 + 2px));}&.mxIndicesOff .mxGobanBox{max-width:min(100%,calc(var(--gobanMaxWidth) * var(--gobanScale) * 463 / 511 + 2px));}&.mxIndicesOff.mxIn3d .mxGobanBox{max-width:min(100%,calc(var(--gobanMaxWidth) * var(--gobanScale) * 445 / 511 + 2px));}& .mxGobanContent{max-width:calc(var(--gobanMaxWidth) * var(--gobanScale) * var(--gobanIntrinsicWidth) / 511);}& .mxEditToolbar{display:grid;grid-template-columns:repeat(auto-fit,minmax(2.25em,1fr));gap:0.125em;}& .mxEditCommentTool{flex:initial;display:block;box-sizing:border-box;resize:vertical;height:7em;width:100%;background:transparent;margin:0.25em 0 0 0;border:var(--border);}& .mxMenuBox,& .mxMenuBox .mxSubMenu{list-style-type:none;}& .mxMenuBox{margin:0;padding:0.25em;}& .mxMenuBox>li{display:inline-block;text-align:left;margin:0;padding:0;}& .mxMenuBox .mxSubMenu{position:absolute;z-index:1;display:none;margin:0.125em 0 0 0;padding:0;}& .mxMenuBox .mxSubMenu li{margin:0;padding:0;}& .mxMenuBox .mxSubMenu.mxSubMenuOpen{display:flex;flex-flow:column;}& .mxMenuBox .mxSubMenu .mxBtn{border:var(--subBtnBorder);background:var(--subBtnBk);color:var(--subBtnColor);margin:0;width:100%;text-align:left;border-bottom:0;}& .mxMenuBox .mxSubMenu li:last-of-type button{border-bottom:var(--subBtnBorder);}& .mxMenuBox .mxSubMenu:has(.mxCochable,.mxCoched) button{padding-left:1.25em;}& .mxMenuBox .mxSubMenu .mxCoched:before{position:absolute;left:0.375em;content:\"\\2713\";}& .mxEditToolbar>*{display:block;box-sizing:border-box;padding:0.125em;background:var(--toolBk);border:var(--toolBorder);border-radius:0;}& .mxEditToolbar input{text-align:center;}& .mxEditToolbar>*{color:var(--toolColor);}& .mxEditToolbar button .mxFillable{fill:var(--toolColor);}& .mxEditToolbar button .mxStrokable{stroke:var(--toolColor);}&.mxIn2d .mxEditToolbar button circle.mxWhite{fill:#fff;stroke:var(--toolColor);}&.mxIn2d .mxEditToolbar button circle.mxBlack{fill:var(--toolColor);stroke:var(--toolColor);}&.mxIn2d .mxEditToolbar button circle.mxWhite+text{fill:var(--toolColor);}& .mxEditToolbar .mxSelectedEditTool{background:var(--selectedToolBk);border:var(--selectedToolBorder);color:var(--selectedToolColor);}& .mxEditToolbar .mxSelectedEditTool text{fill:var(--selectedToolColor);stroke:var(--selectedToolColor);}& .mxEditToolbar .mxSuperSelectedEditTool{background:var(--superSelectedToolBk);border:var(--superSelectedToolBorder);color:var(--superSelectedToolColor);}& .mxEditToolbar .mxSuperSelectedEditTool text{fill:var(--superSelectedToolColor);stroke:var(--superSelectedToolColor);}& dialog.mxShowHelpDialog{counter-reset:helpH2;}& dialog.mxShowHelpDialog h1{font-size:2em;}& dialog.mxShowHelpDialog h2{counter-reset:helpH3;}& dialog.mxShowHelpDialog h2:before{counter-increment:helpH2;content:counter(helpH2) \". \";}& dialog.mxShowHelpDialog h3:before{counter-increment:helpH3;content:counter(helpH2) \".\" counter(helpH3) \". \";}& dialog .mxFigureOrNotP+.mxTabNumberingP{padding-left:2em;}& dialog.mxEditInfoDialog{width:calc(var(--gobanMaxWidth) * 3 / 2);}& dialog.mxEditInfoDialog .mxContentFieldset{display:grid;gap:min(2.5px,0.5em);grid-template-columns:repeat(auto-fit,minmax(min(80%,9em),1fr));}& dialog.mxEditInfoDialog span,& dialog.mxEditInfoDialog span+input[type=text],& dialog.mxEditColorsDialog input[type=text],& dialog.mxEditThicknessDialog input[type=text],& dialog.mxSaveDialog input[type=text],& dialog.mxSendDialog input[type=text]{width:100%;display:block;}& dialog .mxResult,& dialog .mxGC,& dialog .mxGN{grid-column:1 / -1;}& dialog .mxResult{display:flex;flex-wrap:wrap;justify-content:space-between;gap:0.125em;}& dialog .mxResult .mxSC{white-space:nowrap;}}";
mxG.D[mxG.K].a.in3dOn=0;
mxG.D[mxG.K].a.allowStringAsSource=1;
mxG.D[mxG.K].a.allowFileAsSource=1;
mxG.D[mxG.K].a.initMethod="first";
mxG.D[mxG.K].a.stoneShadowOn=0;
mxG.D[mxG.K].a.stretching="0,0,1,1";
mxG.D[mxG.K].a.gridPadding=2;
mxG.D[mxG.K].a.gridMargin=0;
mxG.D[mxG.K].a.gobanPadding=0;
mxG.D[mxG.K].a.gobanMargin=2;
mxG.D[mxG.K].a.indicesOn=null;
mxG.D[mxG.K].a.numberingOn=null;
mxG.D[mxG.K].a.asInBookOn=null;
mxG.D[mxG.K].a.marksAndLabelsOn=1;
mxG.D[mxG.K].a.markOnLastOn=0;
mxG.D[mxG.K].a.numAsMarkOnLastOn=0;
mxG.D[mxG.K].a.japaneseIndicesOn=0;
mxG.D[mxG.K].a.oldJapaneseIndicesOn=0;
mxG.D[mxG.K].a.eraseGridUnder=1;
mxG.D[mxG.K].a.helpBtnOn=1;
mxG.D[mxG.K].a.pngBtnOn=1;
mxG.D[mxG.K].a.svgBtnOn=1;
mxG.D[mxG.K].a.infoBtnOn=0;
mxG.D[mxG.K].a.menus="File,Edit,View,Window";
mxG.D[mxG.K].a.passBtnOn=1;
mxG.D[mxG.K].a.scoreBtnOn=1;
mxG.D[mxG.K].a.toCharset="UTF-8";
mxG.D[mxG.K].a.sgfBtnOn=1;
mxG.D[mxG.K].a.sgfAction="edit";
mxG.D[mxG.K].a.variationMarksOn=0;
mxG.D[mxG.K].a.siblingsOn=0;
mxG.D[mxG.K].a.hideSingleVariationMarkOn=0;
mxG.D[mxG.K].a.variationBoxOn=0;
mxG.D[mxG.K].a.canPlaceVariation=0;
mxG.D[mxG.K].a.versionBoxOn=1;
mxG.D[mxG.K].start();