Plugin Directory

Changeset 3278128


Ignore:
Timestamp:
04/21/2025 12:16:35 PM (10 months ago)
Author:
yo35
Message:

Release 8.0.5

Location:
rpb-chessboard/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • rpb-chessboard/trunk/build/index.asset.php

    r3215679 r3278128  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-primitives'), 'version' => 'c21e95ce5e6bc4efbe49');
     1<?php return array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-primitives'), 'version' => '88cb8a0a8371b3caf8a4');
  • rpb-chessboard/trunk/build/index.js

    r3215679 r3278128  
    1 (()=>{var e={8387:(e,t,i)=>{i.p=RPBChessboard.publicURL+"build/"},9830:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Database=void 0,t.isValidGameIndex=n;const r=i(8698);function n(e){return Number.isInteger(e)&&e>=0}t.Database=class{constructor(){}gameCount(){return this.doGameCount()}game(e){if(!n(e))throw new r.IllegalArgument("Database.game()");return this.doGame(e)}games(){const e=this.doGameCount(),t=e=>this.doGame(e);return{[Symbol.iterator]:()=>new o(e,t)}}};class o{constructor(e,t){this.gameIndex=0,this.gameCount=e,this.gameLoader=t}next(){for(;this.gameIndex<this.gameCount;)try{return{done:!1,value:this.gameLoader(this.gameIndex++)}}catch(e){if(!(e instanceof r.InvalidPGN))throw e}return{done:!0,value:void 0}}}},4633:function(e,t,i){"use strict";var r,n,o,s,a=this&&this.__classPrivateFieldSet||function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},l=this&&this.__classPrivateFieldGet||function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValue=void 0;const c=i(8698);class u{constructor(e,t,i){if(r.set(this,void 0),n.set(this,void 0),o.set(this,void 0),s.set(this,void 0),e instanceof Date)a(this,r,"ymd","f"),a(this,n,e.getFullYear(),"f"),a(this,o,e.getMonth()+1,"f"),a(this,s,e.getDate(),"f");else{const l=p(e,t,i);if(!l)throw new c.IllegalArgument("DateValue()");a(this,r,l,"f"),a(this,n,e,"f"),a(this,o,t??void 0,"f"),a(this,s,i??void 0,"f")}}type(){return l(this,r,"f")}year(){return l(this,n,"f")}month(){if(void 0===l(this,o,"f"))throw new c.IllegalArgument("DateValue.month()");return l(this,o,"f")}day(){if(void 0===l(this,s,"f"))throw new c.IllegalArgument("DateValue.day()");return l(this,s,"f")}toDate(){const e=void 0===l(this,o,"f")?0:l(this,o,"f")-1,t=void 0===l(this,s,"f")?1:l(this,s,"f");return new Date(l(this,n,"f"),e,t)}toString(){return d(l(this,n,"f"),l(this,o,"f"),l(this,s,"f"),"-","**")}static fromString(e){if("string"!=typeof e)throw new c.IllegalArgument("DateValue.fromString()");return h(e,/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/,/^([0-9]{4})-([0-9]{2})-\*\*$/,/^([0-9]{4})-\*\*-\*\*$/,!1)}toPGNString(){return d(l(this,n,"f"),l(this,o,"f"),l(this,s,"f"),".","??")}static fromPGNString(e){if("string"!=typeof e)throw new c.IllegalArgument("DateValue.fromPGNString()");return h(e,/^([0-9]{4})\.([0-9]{2})\.([0-9]{2})$/,/^([0-9]{4})\.([0-9]{2})\.\?\?$/,/^([0-9]{4})(?:\.\?\?\.\?\?)?$/,!0)}toHumanReadableString(e){switch(l(this,r,"f")){case"ymd":{const t=new Date(l(this,n,"f"),l(this,o,"f")-1,l(this,s,"f"));return new Intl.DateTimeFormat(e,{dateStyle:"long"}).format(t)}case"ym":{const t=new Date(l(this,n,"f"),l(this,o,"f")-1,1);return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}default:return String(l(this,n,"f"))}}static isValid(e,t,i){return Boolean(p(e,t,i))}}function d(e,t,i,r,n){return String(e).padStart(4,"0")+r+(void 0===t?n:String(t).padStart(2,"0"))+r+(void 0===i?n:String(i).padStart(2,"0"))}function h(e,t,i,r,n){if(t.test(e)){const e=RegExp.$1,t=RegExp.$2,i=RegExp.$3,r=parseInt(e,10),o=parseInt(t,10),s=parseInt(i,10);return u.isValid(r,o,s)?new u(r,o,s):n?u.isValid(r,o)?new u(r,o):new u(r):void 0}if(i.test(e)){const e=RegExp.$1,t=RegExp.$2,i=parseInt(e,10),r=parseInt(t,10);return u.isValid(i,r)?new u(i,r):n?new u(i):void 0}if(r.test(e)){const e=parseInt(RegExp.$1,10);return new u(e)}}function p(e,t,i){return null!=i?!!(f(e)&&g(t)&&Number.isInteger(i)&&i>=1&&i<=function(e,t){return new Date(e,t,0).getDate()}(e,t))&&"ymd":null!=t?!(!f(e)||!g(t))&&"ym":!!f(e)&&"y"}function f(e){return Number.isInteger(e)&&e>=0}function g(e){return Number.isInteger(e)&&e>=1&&e<=12}t.DateValue=u,r=new WeakMap,n=new WeakMap,o=new WeakMap,s=new WeakMap},8698:(e,t)=>{"use strict";function i(e,t){return e.replace(/{(\d+)}/g,((e,i)=>{const r=Number(i);return r<t.length?String(t[r]):e}))}function r(e,t){return e+" -> "+t}Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidPOJO=t.InvalidPGN=t.InvalidNotation=t.InvalidFEN=t.IllegalArgument=void 0,t.IllegalArgument=class{constructor(e){this.functionName=e}toString(){return`Illegal argument in function ${this.functionName}`}},t.InvalidFEN=class{constructor(e,t,...r){this.fen=e,this.message=i(t,r)}toString(){return r("InvalidFEN",this.message)}},t.InvalidNotation=class{constructor(e,t,r,...n){this.fen=e,this.notation=t,this.message=i(r,n)}toString(){return r("InvalidNotation",this.message)}},t.InvalidPGN=class{constructor(e,t,r,n,...o){this.pgn=e,this.index=t,this.lineNumber=r,this.message=i(n,o)}toString(){return r("InvalidPGN",`[character=${this.index} line=${this.lineNumber}] ${this.message}`)}},t.InvalidPOJO=class{constructor(e,t,r,...n){this.pojo=e,this.fieldName=t,this.message=i(r,n)}toString(){return r("InvalidPOJO",this.message)}}},2525:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Game=void 0;const r=i(4633),n=i(8698),o=i(999),s=i(9955),a=i(6472),l=i(2493),c=i(943),u=i(9013),d=i(9457);class h{constructor(){this._playerName=[void 0,void 0],this._playerElo=[void 0,void 0],this._playerTitle=[void 0,void 0],this._round=[void 0,void 0,void 0],this._result=3,this._moveTreeRoot=new c.MoveTreeRoot}clearHeaders(){this._playerName=[void 0,void 0],this._playerElo=[void 0,void 0],this._playerTitle=[void 0,void 0],this._event=void 0,this._round=[void 0,void 0,void 0],this._date=void 0,this._site=void 0,this._annotator=void 0,this._eco=void 0,this._opening=void 0,this._openingVariation=void 0,this._openingSubVariation=void 0,this._termination=void 0,this._result=3}playerName(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerName()");if(1===arguments.length)return this._playerName[i];this._playerName[i]=p(t)}playerElo(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerElo()");if(1===arguments.length)return this._playerElo[i];if(void 0!==(t=f(t))&&!(0,l.isValidElo)(t))throw new n.IllegalArgument("Game.playerElo()");this._playerElo[i]=t}playerTitle(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerTitle()");if(1===arguments.length)return this._playerTitle[i];this._playerTitle[i]=p(t)}event(e){if(0===arguments.length)return this._event;this._event=p(e)}round(e){if(0===arguments.length)return this._round[0];this._setRoundPart(0,e,"Game.round()")}subRound(e){if(0===arguments.length)return this._round[1];this._setRoundPart(1,e,"Game.subRound()")}subSubRound(e){if(0===arguments.length)return this._round[2];this._setRoundPart(2,e,"Game.subSubRound()")}_setRoundPart(e,t,i){if(void 0!==(t=f(t))&&!(0,l.isValidRound)(t))throw new n.IllegalArgument(i);this._round[e]=t}fullRound(){return b(this._round[0],this._round[1],this._round[2],"?")}date(e,t,i){switch(arguments.length){case 0:return this._date;case 1:if(null==e)this._date=void 0;else if(e instanceof r.DateValue)this._date=e;else if(e instanceof Date)this._date=new r.DateValue(e);else{if(!r.DateValue.isValid(e))throw new n.IllegalArgument("Game.date()");this._date=new r.DateValue(e)}break;default:if(!r.DateValue.isValid(e,t,i))throw new n.IllegalArgument("Game.date()");this._date=new r.DateValue(e,t,i)}}dateAsDate(){return void 0===this._date?void 0:this._date.toDate()}dateAsString(e){return void 0===this._date?void 0:this._date.toHumanReadableString(e)}site(e){if(0===arguments.length)return this._site;this._site=p(e)}annotator(e){if(0===arguments.length)return this._annotator;this._annotator=p(e)}eco(e){if(0===arguments.length)return this._eco;if(void 0!==(e=p(e))&&!(0,o.isValidECO)(e))throw new n.IllegalArgument("Game.eco()");this._eco=e}opening(e){if(0===arguments.length)return this._opening;this._opening=p(e)}openingVariation(e){if(0===arguments.length)return this._openingVariation;this._openingVariation=p(e)}openingSubVariation(e){if(0===arguments.length)return this._openingSubVariation;this._openingSubVariation=p(e)}termination(e){if(0===arguments.length)return this._termination;this._termination=p(e)}result(e){if(0===arguments.length)return(0,d.resultToString)(this._result);{const t=(0,d.resultFromString)(e);if(t<0)throw new n.IllegalArgument("Game.result()");this._result=t}}variant(){return this._moveTreeRoot._position.variant()}initialPosition(e,t){if(0===arguments.length)return new a.Position(this._moveTreeRoot._position);if(!(e instanceof a.Position))throw new n.IllegalArgument("Game.initialPosition()");if(arguments.length>=2){if(!Number.isInteger(t))throw new n.IllegalArgument("Game.initialPosition()");this._moveTreeRoot._fullMoveNumber=t}else this._moveTreeRoot._fullMoveNumber=1;this._moveTreeRoot._position=new a.Position(e),this._moveTreeRoot.clearTree()}initialFEN(){return this._moveTreeRoot._position.fen({fiftyMoveClock:0,fullMoveNumber:this._moveTreeRoot._fullMoveNumber})}initialFullMoveNumber(){return this._moveTreeRoot._fullMoveNumber}finalPosition(){return this._moveTreeRoot.mainVariation().finalPosition()}finalFEN(){return this._moveTreeRoot.mainVariation().finalFEN()}mainVariation(){return this._moveTreeRoot.mainVariation()}nodes(e=!1){if(!e)return this.mainVariation().nodes();const t=[];return function e(i){for(const r of i.nodes()){for(const t of r.variations())e(t);t.push(r)}}(this.mainVariation()),t}plyCount(){return this._moveTreeRoot.mainVariation().plyCount()}findById(e,t=!0){return this._moveTreeRoot.findById(e,t)}pojo(){const e={};function t(e,t){return void 0===e._playerName[t]&&void 0===e._playerElo[t]&&void 0===e._playerTitle[t]}function i(e,t){const i={};return void 0!==e._playerName[t]&&(i.name=e._playerName[t]),void 0!==e._playerElo[t]&&(i.elo=e._playerElo[t]),void 0!==e._playerTitle[t]&&(i.title=e._playerTitle[t]),i}return t(this,0)||(e.white=i(this,0)),t(this,1)||(e.black=i(this,1)),void 0!==this._event&&(e.event=this._event),void 0!==this._round[0]&&(e.round=this._round[0]),void 0!==this._round[1]&&(e.subRound=this._round[1]),void 0!==this._round[2]&&(e.subSubRound=this._round[2]),void 0!==this._date&&(e.date=this._date.toString()),void 0!==this._site&&(e.site=this._site),void 0!==this._annotator&&(e.annotator=this._annotator),void 0!==this._eco&&(e.eco=this._eco),void 0!==this._opening&&(e.opening=this._opening),void 0!==this._openingVariation&&(e.openingVariation=this._openingVariation),void 0!==this._openingSubVariation&&(e.openingSubVariation=this._openingSubVariation),void 0!==this._termination&&(e.termination=this._termination),3!==this._result&&(e.result=this.result()),this._moveTreeRoot.getPojo(e),e}static fromPOJO(e){if("object"!=typeof e||null===e)throw new n.InvalidPOJO(e,"",s.i18n.POJO_MUST_BE_AN_OBJECT);const t=new h,i=new u.POJOExceptionBuilder(e);function a(e,r){(0,u.decodeStringField)(e,"name",i,(e=>{t._playerName[r]=e})),(0,u.decodeNumberField)(e,"elo",i,(e=>{if(!(0,l.isValidElo)(e))throw i.build(s.i18n.INVALID_ELO_IN_POJO);t._playerElo[r]=e})),(0,u.decodeStringField)(e,"title",i,(e=>{t._playerTitle[r]=e}))}function c(e,r){if(!(0,l.isValidRound)(e))throw i.build(s.i18n.INVALID_ROUND_IN_POJO);t._round[r]=e}return(0,u.decodeObjectField)(e,"white",i,(e=>{a(e,0)})),(0,u.decodeObjectField)(e,"black",i,(e=>{a(e,1)})),(0,u.decodeStringField)(e,"event",i,(e=>{t._event=e})),(0,u.decodeNumberField)(e,"round",i,(e=>{c(e,0)})),(0,u.decodeNumberField)(e,"subRound",i,(e=>{c(e,1)})),(0,u.decodeNumberField)(e,"subSubRound",i,(e=>{c(e,2)})),(0,u.decodeStringField)(e,"date",i,(e=>{const n=r.DateValue.fromString(e);if(void 0===n)throw i.build(s.i18n.INVALID_DATE_IN_POJO);t._date=n})),(0,u.decodeStringField)(e,"site",i,(e=>{t._site=e})),(0,u.decodeStringField)(e,"annotator",i,(e=>{t._annotator=e})),(0,u.decodeStringField)(e,"eco",i,(e=>{if(!(0,o.isValidECO)(e))throw i.build(s.i18n.INVALID_ECO_CODE_IN_POJO);t._eco=e})),(0,u.decodeStringField)(e,"opening",i,(e=>{t._opening=e})),(0,u.decodeStringField)(e,"openingVariation",i,(e=>{t._openingVariation=e})),(0,u.decodeStringField)(e,"openingSubVariation",i,(e=>{t._openingSubVariation=e})),(0,u.decodeStringField)(e,"termination",i,(e=>{t._termination=e})),(0,u.decodeStringField)(e,"result",i,(e=>{const r=(0,d.resultFromString)(e);if(r<0)throw i.build(s.i18n.INVALID_RESULT_IN_POJO);t._result=r})),t._moveTreeRoot.setPojo(e,i),t}ascii(){const e=[];function t(t){void 0!==t&&e.push(t)}t(function(e,t,i,r){if(void 0===e&&void 0===t&&void 0===i&&void 0===r)return;let n=void 0===e?"Event: <undefined>":`Event: ${g(e)}`;const o=b(t,i,r,"*");return void 0!==o&&(n+=` (${o})`),n}(this._event,this._round[0],this._round[1],this._round[2])),t(m("Site",this._site)),t(m("Date",this.dateAsString("en-us"))),t(v("White",this._playerName[0],this._playerElo[0],this._playerTitle[0])),t(v("Black",this._playerName[1],this._playerElo[1],this._playerTitle[1])),t(m("Annotator",this._annotator)),t(m("ECO",this._eco)),t(function(e,t,i){if(void 0===e&&void 0===t&&void 0===i)return;let r=void 0===e?"Opening: <undefined>":`Opening: ${g(e)}`;return void 0!==i?r+=` (${void 0===t?"<undefined>":g(t)}, ${g(i)})`:void 0!==t&&(r+=` (${g(t)})`),r}(this._opening,this._openingVariation,this._openingSubVariation)),t(m("Termination",this._termination));const i=this._moveTreeRoot._position.variant();function r(e){return void 0!==e.first()||e.nags().length>0||e.tags().length>0||void 0!==e.comment()}function n(t,i,n){const o=i+t.fullMoveNumber()+("w"===t.moveColor()?".":"...")+t.notation(),a=_(t);e.push(0===a.length?o:o+" "+a.join(" "));let l=!1;for(const o of t.variations())r(o)&&(e.push(i+" |"),s(o,i+(n?" |  ":"    "),i+" +- ",!1),l=!0);return l}function s(t,i,r,o){const s=_(t);s.length>0&&e.push(r+s.join(" "));let a=t.first(),l=!1,c=!0;for(;void 0!==a;){l&&e.push(i+" |");const t=a.next();l=n(a,c&&0===s.length?r:i,o||void 0!==t),c=!1,a=t}}return"regular"!==i&&e.push("Variant: "+i),(0,o.variantWithCanonicalStartPosition)(i)&&a.Position.isEqual(this._moveTreeRoot._position,new a.Position(i))||e.push(this._moveTreeRoot._position.ascii()),s(this._moveTreeRoot.mainVariation(),"","",!1),e.push((0,d.resultToString)(this._result)),e.join("\n")}}function p(e){return null==e?void 0:String(e)}function f(e){return null==e?void 0:Number(e)}function g(e){return""===(e=(0,l.trimAndCollapseSpaces)(e))?"<empty>":e}function m(e,t){return void 0===t?void 0:`${e}: ${g(t)}`}function b(e,t,i,r){if(void 0===e&&void 0===t&&void 0===i)return;let n=void 0===e?r:String(e);return void 0===t&&void 0===i||(n+="."+(t??r)),void 0!==i&&(n+="."+i),n}function v(e,t,i,r){if(void 0===t&&void 0===i&&void 0===r)return;let n=void 0===t?`${e}: <undefined>`:`${e}: ${g(t)}`;return void 0!==i&&void 0!==r?n+=` (${g(r)} ${i})`:void 0!==i?n+=` (${i})`:void 0!==r&&(n+=` (${g(r)})`),n}function _(e){const t=[];for(const i of e.nags())t.push((0,o.nagSymbol)(i));for(const i of e.tags())t.push(`${i}={${(0,l.trimAndCollapseSpaces)(e.tag(i))}}`);const i=e.comment();return void 0!==i&&t.push(g(i)),t}t.Game=h},999:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isColor=function(e){return(0,n.colorFromString)(e)>=0},t.isPiece=function(e){return(0,n.pieceFromString)(e)>=0},t.isColoredPiece=function(e){return(0,n.coloredPieceFromString)(e)>=0},t.isFile=function(e){return(0,n.fileFromString)(e)>=0},t.isRank=function(e){return(0,n.rankFromString)(e)>=0},t.isSquare=function(e){return(0,n.squareFromString)(e)>=0},t.isSquareCouple=function(e){return"string"==typeof e&&/^[a-h][1-8][a-h][1-8]$/.test(e)},t.isCastle=function(e){return"string"==typeof e&&/^[wb][kq]$/.test(e)},t.isCastle960=function(e){return"string"==typeof e&&/^[wb][a-h]$/.test(e)},t.isGameResult=function(e){return(0,n.resultFromString)(e)>=0},t.isGameVariant=function(e){return(0,n.variantFromString)(e)>=0},t.forEachSquare=function(e){for(let t=0;t<8;++t)for(let i=0;i<8;++i)e((0,n.squareToString)(16*t+i))},t.squareColor=function(e){const t=(0,n.squareFromString)(e);if(t<0)throw new r.IllegalArgument("squareColor()");return(0,n.colorToString)((0,n.squareColorImpl)(t))},t.squareToCoordinates=function(e){const t=(0,n.squareFromString)(e);if(t<0)throw new r.IllegalArgument("squareToCoordinates()");return{rank:Math.trunc(t/16),file:t%16}},t.coordinatesToSquare=function(e,t){const i="number"==typeof e?e:e.file,o="number"==typeof e?t:e.rank;if(!Number.isInteger(i)||!Number.isInteger(o)||i<0||i>=8||o<0||o>=8)throw new r.IllegalArgument("coordinatesToSquare()");return(0,n.fileToString)(i)+(0,n.rankToString)(o)},t.oppositeColor=function(e){const t=(0,n.colorFromString)(e);if(t<0)throw new r.IllegalArgument("oppositeColor()");return(0,n.colorToString)(1-t)},t.variantWithCanonicalStartPosition=function(e){const t=(0,n.variantFromString)(e);if(t<0)throw new r.IllegalArgument("variantWithCanonicalStartPosition()");return(0,o.hasCanonicalStartPosition)(t)},t.nagSymbol=function(e){if(!(0,s.isValidNag)(e))throw new r.IllegalArgument("nagSymbol()");return a.get(e)??"$"+e},t.isValidECO=function(e){return"string"==typeof e&&/^[A-E][0-9][0-9]$/.test(e)};const r=i(8698),n=i(9457),o=i(6585),s=i(2493),a=new Map;a.set(1,"!"),a.set(2,"?"),a.set(3,"!!"),a.set(4,"??"),a.set(5,"!?"),a.set(6,"?!"),a.set(7,"□"),a.set(8,"□"),a.set(9,"☒"),a.set(10,"="),a.set(11,"="),a.set(13,"∞"),a.set(14,"⩲"),a.set(15,"⩱"),a.set(16,"±"),a.set(17,"∓"),a.set(18,"+−"),a.set(19,"−+"),a.set(20,"+−−"),a.set(21,"−−+"),a.set(22,"⨀"),a.set(32,"⟳"),a.set(36,"↑"),a.set(40,"→"),a.set(44,"⯹"),a.set(132,"⇆"),a.set(138,"⨁"),a.set(140,"∆"),a.set(141,"∇"),a.set(142,"⌓"),a.set(143,"≤"),a.set(145,"RR"),a.set(146,"N")},9955:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.i18n=void 0,function(e){e.WRONG_NUMBER_OF_FEN_FIELDS="A FEN string must contain exactly 6 space-separated fields.",e.WRONG_NUMBER_OF_SUBFIELDS_IN_BOARD_FIELD="The 1st field of a FEN string must contain exactly 8 `/`-separated subfields.",e.UNEXPECTED_CHARACTER_IN_BOARD_FIELD="Unexpected character in the 1st field of the FEN string: `{0}`.",e.UNEXPECTED_END_OF_SUBFIELD_IN_BOARD_FIELD="Subfield {0} of the FEN string 1st field is unexpectedly short.",e.INVALID_TURN_FIELD="The 2nd field of a FEN string must be either `w` or `b`.",e.INVALID_CASTLING_FIELD="The 3rd field of a FEN string must be either `-` or a list of characters among `K`, `Q`, `k` and `q` (in this order).",e.INVALID_EN_PASSANT_FIELD="The 4th field of a FEN string must be either `-` or a square from the 3rd or 6th rank where en-passant is allowed.",e.WRONG_RANK_IN_EN_PASSANT_FIELD="The rank number indicated in the FEN string 4th field is inconsistent with respect to the 2nd field.",e.INEFFECTIVE_EN_PASSANT_FIELD="No en-passant capture can happen on file {0} in the position defined in the FEN string.",e.INVALID_HALF_MOVE_COUNT_FIELD="The 5th field of a FEN string must be a number, indicating the number of half-move since the last pawn move or capture.",e.INVALID_MOVE_NUMBER_FIELD="The 6th field of a FEN string must be a number, indicating the move number of the game.",e.INVALID_VARIANT_PREFIX="Invalid variant prefix: `{0}`.",e.INVALID_UCI_NOTATION_SYNTAX="The syntax of the UCI notation is invalid.",e.ILLEGAL_UCI_MOVE="The UCI move is not legal.",e.INVALID_MOVE_NOTATION_SYNTAX="The syntax of the move notation is invalid.",e.ILLEGAL_POSITION="The position is not legal.",e.ILLEGAL_NO_KING_CASTLING="Castling is not legal in the considered position as it has no king.",e.ILLEGAL_QUEEN_SIDE_CASTLING="Queen-side castling is not legal in the considered position.",e.ILLEGAL_KING_SIDE_CASTLING="King-side castling is not legal in the considered position.",e.NO_PIECE_CAN_MOVE_TO="No {0} can move to {1}.",e.NO_PIECE_CAN_MOVE_TO_DISAMBIGUATION="No {0} on the specified rank/file can move to {1}.",e.REQUIRE_DISAMBIGUATION="Cannot determine uniquely which {0} is supposed to move to {1}.",e.WRONG_DISAMBIGUATION_SYMBOL="Wrong disambiguation symbol (expected: `{0}`, observed: `{1}`).",e.CASTLING_MOVE_ENCODED_WITH_ZERO="Capital O must be used for castling moves (instead of digit 0).",e.TRYING_TO_CAPTURE_YOUR_OWN_PIECES="Capturing its own pieces is not legal.",e.CAPTURE_IS_MANDATORY="Capture is mandatory.",e.INVALID_PIECE_SYMBOL="Character `{0}` is not a valid piece symbol.",e.INVALID_PIECE_SYMBOL_COLOR="Invalid color for piece symbol `{0}`.",e.INVALID_CAPTURING_PAWN_MOVE="Invalid capturing pawn move.",e.INVALID_NON_CAPTURING_PAWN_MOVE="Invalid non-capturing pawn move.",e.NOT_SAFE_FOR_WHITE_KING="This move would let the white king in check.",e.NOT_SAFE_FOR_BLACK_KING="This move would let the black king in check.",e.MISSING_PROMOTION="A promoted piece must be specified for this move.",e.MISSING_PROMOTION_SYMBOL="Character `=` is required to specify a promoted piece.",e.INVALID_PROMOTED_PIECE="{0} cannot be specified as a promoted piece.",e.ILLEGAL_PROMOTION="Specifying a promoted piece is illegal for this move.",e.ILLEGAL_NULL_MOVE="Cannot play a null-move in this position.",e.MISSING_CAPTURE_SYMBOL="Capture symbol `x` is missing.",e.INVALID_CAPTURE_SYMBOL="This move is not a capture move.",e.WRONG_CHECK_CHECKMATE_SYMBOL="Wrong check/checkmate symbol (expected: `{0}`, observed: `{1}`).",e.INVALID_PGN_TOKEN="Unrecognized character or group of characters.",e.INVALID_MOVE_IN_PGN_TEXT="Invalid move ({0}). {1}",e.INVALID_FEN_IN_PGN_TEXT="Invalid FEN string in the initial position header. {0}",e.UNEXPECTED_PGN_HEADER="Unexpected PGN game header.",e.MISSING_PGN_HEADER_ID="Missing or invalid PGN game header ID.",e.MISSING_PGN_HEADER_VALUE="Missing or invalid PGN game header value.",e.MISSING_END_OF_PGN_HEADER="Missing or invalid end of PGN game header.",e.UNEXPECTED_BEGIN_OF_VARIATION="Unexpected begin of variation.",e.UNEXPECTED_END_OF_VARIATION="Unexpected end of variation.",e.UNEXPECTED_END_OF_GAME="Unexpected end of game: there are pending variations.",e.INVALID_GAME_INDEX="Game index {0} is invalid (only {1} game(s) found in the PGN data).",e.UNKNOWN_VARIANT="Unknown chess game variant ({0}).",e.VARIANT_WITHOUT_FEN="For game variant {0}, the FEN header is mandatory.",e.POJO_MUST_BE_AN_OBJECT="Unexpected non-object value passed as POJO.",e.INVALID_POJO_STRING_FIELD="Invalid value (must be a string).",e.INVALID_POJO_NUMBER_FIELD="Invalid value (must be a number).",e.INVALID_POJO_BOOLEAN_FIELD="Invalid value (must be a boolean).",e.INVALID_POJO_OBJECT_FIELD="Invalid value (must be an object).",e.INVALID_POJO_ARRAY_FIELD="Invalid value (must be an array).",e.INVALID_ELO_IN_POJO="Ill-formed elo.",e.INVALID_ROUND_IN_POJO="Ill-formed round, sub-round or sub-sub-round.",e.INVALID_DATE_IN_POJO="Ill-formed date.",e.INVALID_ECO_CODE_IN_POJO="Ill-formed ECO code.",e.INVALID_RESULT_IN_POJO="Ill-formed result.",e.INVALID_VARIANT_IN_POJO="Ill-formed variant.",e.INVALID_NAG_IN_POJO="Invalid NAG ({0}).",e.INVALID_TAG_IN_POJO="Invalid tag ({0}).",e.INVALID_MOVE_IN_POJO="Invalid move ({0}). {1}",e.INVALID_FEN_IN_POJO="Invalid initial position FEN. {0}",e.MISSING_INITIAL_POSITION_IN_POJO="For game variant {0}, the initial position field is mandatory.",e.INVALID_OR_MISSING_NODE_ARRAY="Invalid or missing node POJO array.",e.INVALID_OR_MISSING_NOTATION_FIELD="Invalid or missing node POJO.",e.NOT_A_NODE_POJO="A node POJO must be either a string or an object.",e.NOT_A_VARIATION_POJO="A variation POJO must be either an array or an object."}(i||(t.i18n=i={}))},3219:(e,t,i)=>{"use strict";t.oG=t.Wm=t.Zt=t.mD=t.bP=t.yX=t.PP=t.nH=t.VD=t.i9=t.cc=t.TL=t.WD=t.kf=t.qz=t.Sz=t.exception=t.Ru=void 0;var r=i(9955);Object.defineProperty(t,"Ru",{enumerable:!0,get:function(){return r.i18n}}),t.exception=i(8698);var n=i(999);Object.defineProperty(t,"Sz",{enumerable:!0,get:function(){return n.isSquare}}),Object.defineProperty(t,"qz",{enumerable:!0,get:function(){return n.isSquareCouple}}),Object.defineProperty(t,"kf",{enumerable:!0,get:function(){return n.isGameVariant}}),Object.defineProperty(t,"WD",{enumerable:!0,get:function(){return n.forEachSquare}}),Object.defineProperty(t,"TL",{enumerable:!0,get:function(){return n.squareColor}}),Object.defineProperty(t,"cc",{enumerable:!0,get:function(){return n.squareToCoordinates}}),Object.defineProperty(t,"i9",{enumerable:!0,get:function(){return n.coordinatesToSquare}}),Object.defineProperty(t,"VD",{enumerable:!0,get:function(){return n.oppositeColor}}),Object.defineProperty(t,"nH",{enumerable:!0,get:function(){return n.nagSymbol}});i(4633);var o=i(3616);Object.defineProperty(t,"PP",{enumerable:!0,get:function(){return o.MoveDescriptor}});var s=i(6472);Object.defineProperty(t,"yX",{enumerable:!0,get:function(){return s.Position}});var a=i(7781);Object.defineProperty(t,"bP",{enumerable:!0,get:function(){return a.Node}}),Object.defineProperty(t,"mD",{enumerable:!0,get:function(){return a.Variation}});var l=i(2525);Object.defineProperty(t,"Zt",{enumerable:!0,get:function(){return l.Game}});var c=i(9830);Object.defineProperty(t,"Wm",{enumerable:!0,get:function(){return c.Database}});var u=i(7698);Object.defineProperty(t,"oG",{enumerable:!0,get:function(){return u.pgnRead}})},3616:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveDescriptor=void 0,t.isMoveDescriptor=function(e){return e instanceof i};class i{constructor(){}toString(){let e=this.from()+this.to();return this.isPromotion()?e+=this.promotion().toUpperCase():this.isCastling()&&(e+="O"),e}}t.MoveDescriptor=i},7781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variation=t.Node=t.AbstractNode=void 0;class i{constructor(){}}t.AbstractNode=i,t.Node=class extends i{constructor(){super()}isVariation(){return!1}toString(){return`${this.id()}[${this.notation()}]`}},t.Variation=class extends i{constructor(){super()}isVariation(){return!0}toString(){return this.id()}}},7698:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pgnRead=function(e,t){if("string"!=typeof e)throw new n.IllegalArgument("pgnRead()");if(1===arguments.length)return(0,s.readDatabase)(e);if(!(0,r.isValidGameIndex)(t))throw new n.IllegalArgument("pgnRead()");return(0,s.readOneGame)(e,t)},t.pgnWrite=function(e,t){if(null==t&&(t={}),e instanceof o.Game)return(0,a.writeGame)(e,t);if(Array.isArray(e)&&e.every((e=>e instanceof o.Game)))return(0,a.writeGames)(e,t);throw new n.IllegalArgument("pgnWrite()")};const r=i(9830),n=i(8698),o=i(2525),s=i(7020),a=i(989)},6472:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Position=void 0;const r=i(8698),n=i(999),o=i(9955),s=i(6838),a=i(9457),l=i(2778),c=i(6585),u=i(5116),d=i(1789),h=i(3055),p=i(7261),f=i(9988);class g{constructor(e,t){switch(arguments.length){case 0:this._impl=(0,c.makeInitial)(0);break;case 1:if("start"===e)this._impl=(0,c.makeInitial)(0);else if("empty"===e)this._impl=(0,c.makeEmpty)(0);else if(e instanceof g)this._impl=(0,c.makeCopy)(e._impl);else{const t=(0,a.variantFromString)(e);if(t>=0){if(!(0,c.hasCanonicalStartPosition)(t))throw new r.IllegalArgument("Position()");this._impl=(0,c.makeInitial)(t)}else{if("string"!=typeof e)throw new r.IllegalArgument("Position()");{const t=e.indexOf(":");if(t<0)this._impl=(0,l.parseFEN)(0,e,!1).position;else{const i=e.substring(0,t),n=(0,a.variantFromString)(i);if(n<0)throw new r.InvalidFEN(e,o.i18n.INVALID_VARIANT_PREFIX,i);this._impl=(0,l.parseFEN)(n,e.substring(t+1),!1).position}}}}break;default:{const i=(0,a.variantFromString)(e);if(i<0)throw new r.IllegalArgument("Position()");if("start"===t){if(!(0,c.hasCanonicalStartPosition)(i))throw new r.IllegalArgument("Position()");this._impl=(0,c.makeInitial)(i)}else if("empty"===t)this._impl=(0,c.makeEmpty)(i);else if("number"==typeof t){if(1!==i||!m(t))throw new r.IllegalArgument("Position()");this._impl=(0,c.make960FromScharnagl)(t)}else{if("string"!=typeof t)throw new r.IllegalArgument("Position()");this._impl=(0,l.parseFEN)(i,t,!1).position}break}}}clear(e="regular"){const t=(0,a.variantFromString)(e);if(t<0)throw new r.IllegalArgument("Position.clear()");this._impl=(0,c.makeEmpty)(t)}reset(){this._impl=(0,c.makeInitial)(0)}reset960(e){if(!m(e))throw new r.IllegalArgument("Position.reset960()");this._impl=(0,c.make960FromScharnagl)(e)}resetAntichess(){this._impl=(0,c.makeInitial)(5)}resetHorde(){this._impl=(0,c.makeInitial)(6)}static isEqual(e,t){return e instanceof g&&t instanceof g&&(0,u.isEqual)(e._impl,t._impl)}ascii(){return(0,l.ascii)(this._impl)}fen(e,t){if(0===arguments.length)return(0,l.getFEN)(this._impl);if(1===arguments.length&&"object"==typeof e){const t=(i=e,function(e,t,n){if(void 0===i[e])return t;{const t=i[e];if(!n(t))throw new r.IllegalArgument("Position.fen()");return t}}),n=t("fiftyMoveClock",0,(e=>Number.isInteger(e))),o=t("fullMoveNumber",1,(e=>Number.isInteger(e))),s=t("withVariant",!1,(e=>"boolean"==typeof e)),c=t("regularFENIfPossible",!1,(e=>"boolean"==typeof e));return(s?(0,a.variantToString)(this._impl.variant)+":":"")+(0,l.getFEN)(this._impl,n,o,c)}if(1===arguments.length&&"string"==typeof e){const t=(0,l.parseFEN)(this._impl.variant,e,!1);return this._impl=t.position,{fiftyMoveClock:t.fiftyMoveClock,fullMoveNumber:t.fullMoveNumber}}if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t){const i=(0,l.parseFEN)(this._impl.variant,e,t);return this._impl=i.position,{fiftyMoveClock:i.fiftyMoveClock,fullMoveNumber:i.fullMoveNumber}}throw new r.IllegalArgument("Position.fen()");var i}variant(){return(0,a.variantToString)(this._impl.variant)}square(e,t){const i=(0,a.squareFromString)(e);if(i<0)throw new r.IllegalArgument("Position.square()");if(1===arguments.length){const e=this._impl.board[i];return-1===e?"-":(0,a.coloredPieceToString)(e)}if("-"===t)this._impl.board[i]=-1,this._impl.legal=null,this._impl.effectiveCastling=null,this._impl.effectiveEnPassant=null;else{const e=(0,a.coloredPieceFromString)(t);if(e<0)throw new r.IllegalArgument("Position.square()");this._impl.board[i]=e,this._impl.legal=null,this._impl.effectiveCastling=null,this._impl.effectiveEnPassant=null}}turn(e){if(0===arguments.length)return(0,a.colorToString)(this._impl.turn);{const t=(0,a.colorFromString)(e);if(t<0)throw new r.IllegalArgument("Position.turn()");this._impl.turn=t,this._impl.legal=null,this._impl.effectiveEnPassant=null}}castling(e,t){if(!(1===this._impl.variant?(0,n.isCastle960)(e):(0,n.isCastle)(e)))throw new r.IllegalArgument("Position.castling()");const i=(0,a.colorFromString)(e[0]),o=1===this._impl.variant?(0,a.fileFromString)(e[1]):"k"===e[1]?7:0;if(1===arguments.length)return!!(this._impl.castling[i]&1<<o);if("boolean"!=typeof t)throw new r.IllegalArgument("Position.castling()");t?this._impl.castling[i]|=1<<o:this._impl.castling[i]&=~(1<<o),this._impl.effectiveCastling=null}effectiveCastling(e){if(!(1===this._impl.variant?(0,n.isCastle960)(e):(0,n.isCastle)(e)))throw new r.IllegalArgument("Position.effectiveCastling()");const t=(0,a.colorFromString)(e[0]),i=1===this._impl.variant?(0,a.fileFromString)(e[1]):"k"===e[1]?7:0;return(0,u.refreshEffectiveCastling)(this._impl),!!(this._impl.effectiveCastling[t]&1<<i)}enPassant(e){if(0===arguments.length)return this._impl.enPassant<0?"-":(0,a.fileToString)(this._impl.enPassant);if("-"===e)this._impl.enPassant=-1,this._impl.effectiveEnPassant=-1;else{const t=(0,a.fileFromString)(e);if(t<0)throw new r.IllegalArgument("Position.enPassant()");this._impl.enPassant=t,this._impl.effectiveEnPassant=null}}effectiveEnPassant(){return(0,u.refreshEffectiveEnPassant)(this._impl),this._impl.effectiveEnPassant<0?"-":(0,a.fileToString)(this._impl.effectiveEnPassant)}isAttacked(e,t){const i=(0,a.squareFromString)(e),n=(0,a.colorFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.isAttacked()");return(0,s.isAttacked)(this._impl,i,n)}getAttacks(e,t){const i=(0,a.squareFromString)(e),n=(0,a.colorFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.getAttacks()");return(0,s.getAttacks)(this._impl,i,n).map(a.squareToString)}isLegal(){return(0,u.isLegal)(this._impl)}kingSquare(e){const t=(0,a.colorFromString)(e);if(t<0)throw new r.IllegalArgument("Position.kingSquare()");(0,u.refreshLegalFlagAndKingSquares)(this._impl);const i=this._impl.king[t];return!(i<0)&&(0,a.squareToString)(i)}isCheck(){return(0,h.isCheck)(this._impl)}isCheckmate(){return(0,h.isCheckmate)(this._impl)}isStalemate(){return(0,h.isStalemate)(this._impl)}isDead(e=!1){return(0,h.isDead)(this._impl,e)}hasMove(){return(0,h.hasMove)(this._impl)}moves(){return(0,h.moves)(this._impl)}isMoveLegal(e,t){const i=(0,a.squareFromString)(e),n=(0,a.squareFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.isMoveLegal()");const o=(0,h.isMoveLegal)(this._impl,i,n);if(!o)return!1;switch(o.type){case"promotion":{const e=e=>{const t=(0,a.pieceFromString)(e);if(t>=0){const e=o.moveDescriptorFactory(t);if(e)return e}throw new r.IllegalArgument("Position.isMoveLegal()")};return e.status="promotion",e}case"regular":{const e=()=>o.moveDescriptor;return e.status="regular",e}}}play(e){if("string"!=typeof e){if(e instanceof d.MoveDescriptorImpl)return(0,h.play)(this._impl,e),!0;throw new r.IllegalArgument("Position.play()")}try{return(0,h.play)(this._impl,(0,p.parseNotation)(this._impl,e,!1,"standard")),!0}catch(e){if(e instanceof r.InvalidNotation)return!1;throw e}}isNullMoveLegal(){return(0,h.isNullMoveLegal)(this._impl)}playNullMove(){return(0,h.playNullMove)(this._impl)}notation(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,p.getNotation)(this._impl,e,"standard");if(1===arguments.length&&"string"==typeof e)return(0,p.parseNotation)(this._impl,e,!1,"standard");if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,p.parseNotation)(this._impl,e,t,"standard");throw new r.IllegalArgument("Position.notation()")}figurineNotation(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,p.getNotation)(this._impl,e,"figurine");if(1===arguments.length&&"string"==typeof e)return(0,p.parseNotation)(this._impl,e,!1,"figurine");if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,p.parseNotation)(this._impl,e,t,"figurine");throw new r.IllegalArgument("Position.figurineNotation()")}uci(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,f.getUCINotation)(this._impl,e,!1);if(arguments.length>=2&&e instanceof d.MoveDescriptorImpl&&"boolean"==typeof t)return(0,f.getUCINotation)(this._impl,e,t);if(1===arguments.length&&"string"==typeof e)return(0,f.parseUCINotation)(this._impl,e,!1);if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,f.parseUCINotation)(this._impl,e,t);throw new r.IllegalArgument("Position.uci()")}}function m(e){return Number.isInteger(e)&&e>=0&&e<960}t.Position=g},2493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimAndCollapseSpaces=function(e){return e.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},t.isValidNag=function(e){return Number.isInteger(e)&&e>=0},t.isValidElo=function(e){return Number.isInteger(e)&&e>=0},t.isValidRound=function(e){return Number.isInteger(e)&&e>=0}},943:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveTreeRoot=void 0;const r=i(8698),n=i(999),o=i(9955),s=i(7781),a=i(6472),l=i(2493),c=i(9013),u=i(9457);class d{constructor(){this._position=new a.Position,this._fullMoveNumber=1,this._mainVariationData=N(this,!0)}clearTree(){this._mainVariationData=N(this,!0)}mainVariation(){return new B(this._mainVariationData,this._position)}findById(e,t){const i=e.split("-");if(i.length%2!=1)return;const r=new a.Position(this._position);let n=this._mainVariationData;for(let e=0;e+1<i.length;e+=2){const t=h(n,i[e],r);if(void 0===t)return;const o=/^v(\d+)$/.exec(i[e+1]);if(!o)return;const s=parseInt(o[1]);if(s>=t.variations.length)return;n=t.variations[s]}const o=i[i.length-1];if("start"===o)return new B(n,r);if(t&&"end"===o){if(void 0===n.child)return new B(n,r);{let e=n.child;for(;void 0!==e.child;)S(r,e),e=e.child;return new M(e,r)}}{const e=h(n,o,r);return void 0===e?void 0:new M(e,r)}}getPojo(e){const t=this._position.variant();"regular"!==t&&(e.variant=t),(0,n.variantWithCanonicalStartPosition)(t)&&a.Position.isEqual(this._position,new a.Position(t))&&1===this._fullMoveNumber||(e.initialPosition=this._position.fen({fullMoveNumber:this._fullMoveNumber}));const i=p(new a.Position(this._position),this._mainVariationData,!0);(!Array.isArray(i)||i.length>0)&&(e.mainVariation=i)}setPojo(e,t){let i="regular",s=!1;if((0,c.decodeStringField)(e,"variant",t,(e=>{if((0,u.variantFromString)(e)<0)throw t.build(o.i18n.INVALID_VARIANT_IN_POJO);i=e})),(0,c.decodeStringField)(e,"initialPosition",t,(e=>{this._position=new a.Position(i,"empty");try{const{fullMoveNumber:t}=this._position.fen(e);this._fullMoveNumber=t,s=!0}catch(e){throw e instanceof r.InvalidFEN?t.build(o.i18n.INVALID_FEN_IN_POJO,e.message):e}})),"regular"!==i&&!s){if(!(0,n.variantWithCanonicalStartPosition)(i))throw t.push("initialPosition"),t.build(o.i18n.MISSING_INITIAL_POSITION_IN_POJO,i);this._position=new a.Position(i),this._fullMoveNumber=1}"mainVariation"in e&&void 0!==e.mainVariation?(t.push("mainVariation"),this._mainVariationData=m(e.mainVariation,this,this._position,0,this._fullMoveNumber,!0,t),t.pop()):this.clearTree()}}function h(e,t,i){let r=e.child;for(;void 0!==r;){if(t===r.fullMoveNumber+r.moveColor)return r;S(i,r),r=r.child}}function p(e,t,i){const r=[];let n=t.child;for(;void 0!==n;)r.push(f(e,n)),S(e,n),n=n.child;const o={nodes:r};let s=!0;return t.isLongVariation!==i&&(o.isLongVariation=t.isLongVariation,s=!1),g(o,t)&&(s=!1),s?o.nodes:o}function f(e,t){const i={notation:null===t.moveDescriptor?"--":e.notation(t.moveDescriptor)};let r=!0;return t.variations.length>0&&(i.variations=t.variations.map((t=>p(new a.Position(e),t,!1))),r=!1),g(i,t)&&(r=!1),r?i.notation:i}function g(e,t){let i=!1;return void 0!==t.comment&&(e.comment=t.comment,t.isLongComment&&(e.isLongComment=!0),i=!0),t.nags.size>0&&(e.nags=x(t),i=!0),t.tags.size>0&&(e.tags=function(e){const t={};for(const[i,r]of e.tags.entries())t[i]=r;return t}(t),i=!0),i}function m(e,t,i,r,n,s,l){let u,d;if(Array.isArray(e))u=N(t,s),d=e;else{if("object"!=typeof e||null===e)throw l.build(o.i18n.NOT_A_VARIATION_POJO);{let i=s;if((0,c.decodeBooleanField)(e,"isLongVariation",l,(e=>{i=e})),u=N(t,i),_(e,u,l),l.push("nodes"),!("nodes"in e)||!Array.isArray(e.nodes))throw l.build(o.i18n.INVALID_OR_MISSING_NODE_ARRAY);d=e.nodes}}let h=u;i=new a.Position(i);for(let e=0;e<d.length;++e)l.push(e),h.child=b(d[e],u,i,r,n,l),l.pop(),h=h.child,S(i,h),r=E(h),"w"===i.turn()&&++n;return Array.isArray(e)||l.pop(),u}function b(e,t,i,r,n,s){let a;if("string"==typeof e)a=v(i,e,s);else{if("object"!=typeof e||null===e)throw s.build(o.i18n.NOT_A_NODE_POJO);if(s.push("notation"),!("notation"in e)||"string"!=typeof e.notation)throw s.build(o.i18n.INVALID_OR_MISSING_NOTATION_FIELD);a=v(i,e.notation,s),s.pop()}const l=I(t,i.turn(),r,n,a);return"object"==typeof e&&null!==e&&(_(e,l,s),(0,c.decodeArrayField)(e,"variations",s,(e=>{for(let t=0;t<e.length;++t)s.push(t),l.variations.push(m(e[t],l,i,r,n,!1,s)),s.pop()}))),l}function v(e,t,i){try{return w(e,t)}catch(e){throw e instanceof r.InvalidNotation?i.build(o.i18n.INVALID_MOVE_IN_POJO,t,e.message):e}}function _(e,t,i){(0,c.decodeStringField)(e,"comment",i,(e=>{t.comment=e})),(0,c.decodeBooleanField)(e,"isLongComment",i,(e=>{t.isLongComment=e})),(0,c.decodeArrayField)(e,"nags",i,(e=>{for(let r=0;r<e.length;++r){const n=e[r];if(void 0!==n){if(!(0,l.isValidNag)(n))throw i.push(r),i.build(o.i18n.INVALID_NAG_IN_POJO,n);t.nags.add(n)}}})),(0,c.decodeObjectField)(e,"tags",i,(e=>{for(const r in e){if(!L(r))throw i.push(`[${r}]`),i.build(o.i18n.INVALID_TAG_IN_POJO,r);const n=e[r];if(void 0!==n){if("string"!=typeof n)throw i.push(r),i.build(o.i18n.INVALID_TAG_IN_POJO,r);t.tags.set(r,n)}}}))}function I(e,t,i,r,n){return{parentVariation:e,child:void 0,variations:[],moveColor:t,fiftyMoveClock:i,fullMoveNumber:r,moveDescriptor:n,nags:new Set,tags:new Map,comment:void 0,isLongComment:!1}}function N(e,t){return{parent:e,child:void 0,isLongVariation:t,nags:new Set,tags:new Map,comment:void 0,isLongComment:!1}}function w(e,t){if("--"===t){if(!e.isNullMoveLegal())throw new r.InvalidNotation(e.fen(),"--",o.i18n.ILLEGAL_NULL_MOVE);return null}return e.notation(t)}function S(e,t){null===t.moveDescriptor?e.playNullMove():e.play(t.moveDescriptor)}function E(e){return null===e.moveDescriptor?e.fiftyMoveClock:e.moveDescriptor.isCapture()||"p"===e.moveDescriptor.movingPiece()?0:e.fiftyMoveClock+1}function y(e){return"w"===e.moveColor?e.fullMoveNumber:e.fullMoveNumber+1}function C(e){if(e.parent instanceof d)return new a.Position(e.parent._position);{let t=e.parent.parentVariation.child;const i=C(e.parent.parentVariation);for(;t!==e.parent;)S(i,t),t=t.child;return i}}function A(e){return T(e.parentVariation)+e.fullMoveNumber+e.moveColor}function T(e){return e.parent instanceof d?"":`${A(e.parent)}-v${e.parent.variations.indexOf(e)}-`}function P(e){for(;;){if(!e.isLongVariation)return!1;if(e.parent instanceof d)return!0;e=e.parent.parentVariation}}function k(e,t){return Number.isInteger(e)&&e>=0&&e<t.variations.length}function x(e){const t=[];for(const i of e.nags)t.push(i);return t.sort(((e,t)=>e-t))}function O(e,t){const i=new Set;for(const r of e.nags)t(r)&&i.add(r);e.nags=i}function L(e){return"string"==typeof e&&/^\w+$/.test(e)}function D(e){const t=[];for(const i of e.tags.keys())t.push(i);return t.sort()}function R(e,t){const i=new Map;for(const[r,n]of e.tags.entries())t(r,n)&&i.set(r,n);e.tags=i}t.MoveTreeRoot=d;class M extends s.Node{constructor(e,t){super(),this._data=e,this._positionBefore=t}id(){return A(this._data)}nags(){return x(this._data)}hasNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.hasNag()");return this._data.nags.has(e)}addNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.addNag()");return this._data.nags.add(e)}removeNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.removeNag()");return this._data.nags.delete(e)}clearNags(){this._data.nags.clear()}filterNags(e){O(this._data,e)}tags(){return D(this._data)}tag(e,t){if(!L(e))throw new r.IllegalArgument("Node.tag()");if(1===arguments.length)return this._data.tags.get(e);null==t?this._data.tags.delete(e):this._data.tags.set(e,String(t))}clearTags(){this._data.tags.clear()}filterTags(e){R(this._data,e)}comment(e,t){if(0===arguments.length)return this._data.comment;null==e?(this._data.comment=void 0,this._data.isLongComment=!1):(this._data.comment=String(e),this._data.isLongComment=Boolean(t))}isLongComment(){return this._data.isLongComment&&P(this._data.parentVariation)}parentVariation(){const e=C(this._data.parentVariation);return new B(this._data.parentVariation,e)}previous(){let e=this._data.parentVariation.child;if(e===this._data)return;const t=C(this._data.parentVariation);for(;e.child!==this._data;)S(t,e),e=e.child;return new M(e,t)}next(){if(void 0===this._data.child)return;const e=new a.Position(this._positionBefore);return S(e,this._data),new M(this._data.child,e)}notation(){return null===this._data.moveDescriptor?"--":this._positionBefore.notation(this._data.moveDescriptor)}figurineNotation(){return null===this._data.moveDescriptor?"--":this._positionBefore.figurineNotation(this._data.moveDescriptor)}positionBefore(){return new a.Position(this._positionBefore)}position(){const e=new a.Position(this._positionBefore);return S(e,this._data),e}fen(){return this.position().fen({fiftyMoveClock:E(this._data),fullMoveNumber:y(this._data)})}fiftyMoveClock(){return E(this._data)}fullMoveNumber(){return this._data.fullMoveNumber}moveColor(){return this._data.moveColor}variations(){return this._data.variations.map((e=>new B(e,this._positionBefore)))}play(e){const t=new a.Position(this._positionBefore);S(t,this._data);const i=t.turn(),r=E(this._data),n=y(this._data);return this._data.child=I(this._data.parentVariation,i,r,n,w(t,e)),new M(this._data.child,t)}removePrecedingMoves(){const e=function(e){let t=e;for(;!(t instanceof d);)t=t.parentVariation.parent;return t}(this._data);e._position=this._positionBefore,e._fullMoveNumber=this._data.fullMoveNumber,e._mainVariationData=N(e,!0),e._mainVariationData.child=this._data,q(this._data,e._mainVariationData),V(this._data,0)}removeFollowingMoves(){this._data.child=void 0}addVariation(e){const t=N(this._data,e??!1);return this._data.variations.push(t),new B(t,this._positionBefore)}removeVariation(e){if(!k(e,this._data))throw new r.IllegalArgument("Node.removeVariation()");this._data.variations=this._data.variations.slice(0,e).concat(this._data.variations.slice(e+1))}swapVariations(e,t){if(!k(e,this._data)||!k(t,this._data))throw new r.IllegalArgument("Node.swapVariations()");const i=this._data.variations[e];this._data.variations[e]=this._data.variations[t],this._data.variations[t]=i}promoteVariation(e){if(!k(e,this._data)||void 0===this._data.variations[e].child)throw new r.IllegalArgument("Node.promoteVariation()");const t=this._data,i=this._data.variations[e].child,n=t.variations;t.variations=[],n[e]=N(i,!1),n[e].child=t,this._data=i,i.variations=n.concat(i.variations),(function(e){let t=e.parentVariation;for(;t.child!==e;)t=t.child;return t}(t)).child=i,q(i,t.parentVariation),q(t,n[e]);for(const e of i.variations)e.parent=i}}function q(e,t){let i=e;for(;void 0!==i;)i.parentVariation=t,i=i.child}function V(e,t){let i=e;for(;void 0!==i;){i.fiftyMoveClock=t;for(const e of i.variations)V(e.child,t);t=E(i),i=i.child}}class B extends s.Variation{constructor(e,t){super(),this._data=e,this._initialPosition=t}id(){return T(this._data)+"start"}nags(){return x(this._data)}hasNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.hasNag()");return this._data.nags.has(e)}addNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.addNag()");return this._data.nags.add(e)}removeNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.removeNag()");return this._data.nags.delete(e)}clearNags(){this._data.nags.clear()}filterNags(e){O(this._data,e)}tags(){return D(this._data)}tag(e,t){if(!L(e))throw new r.IllegalArgument("Variation.tag()");if(1===arguments.length)return this._data.tags.get(e);null==t?this._data.tags.delete(e):this._data.tags.set(e,String(t))}clearTags(){this._data.tags.clear()}filterTags(e){R(this._data,e)}comment(e,t){if(0===arguments.length)return this._data.comment;null==e?(this._data.comment=void 0,this._data.isLongComment=!1):(this._data.comment=String(e),this._data.isLongComment=Boolean(t))}isLongComment(){return this._data.isLongComment&&P(this._data)}parentNode(){return this._data.parent instanceof d?void 0:new M(this._data.parent,this._initialPosition)}first(){return void 0===this._data.child?void 0:new M(this._data.child,this._initialPosition)}nodes(){const e=[];let t,i=this._data.child,r=this._initialPosition;for(;void 0!==i;)r=new a.Position(r),void 0!==t&&S(r,t),e.push(new M(i,r)),t=i,i=i.child;return e}plyCount(){let e=0,t=this._data.child;for(;void 0!==t;)++e,t=t.child;return e}isLongVariation(){return P(this._data)}initialPosition(){return new a.Position(this._initialPosition)}initialFEN(){return this._initialPosition.fen({fiftyMoveClock:this.initialFiftyMoveClock(),fullMoveNumber:this.initialFullMoveNumber()})}initialFiftyMoveClock(){return this._data.parent instanceof d?0:this._data.parent.fiftyMoveClock}initialFullMoveNumber(){return this._data.parent instanceof d?this._data.parent._fullMoveNumber:this._data.parent.fullMoveNumber}finalPosition(){const e=new a.Position(this._initialPosition);for(let t=this._data.child;void 0!==t;t=t.child)S(e,t);return e}finalFEN(){if(void 0===this._data.child)return this.initialFEN();const e=new a.Position(this._initialPosition);let t=this._data.child;for(;S(e,t),void 0!==t.child;)t=t.child;return e.fen({fiftyMoveClock:E(t),fullMoveNumber:y(t)})}play(e){const t=this._initialPosition.turn(),i=this.initialFiftyMoveClock(),r=this.initialFullMoveNumber();return this._data.child=I(this._data,t,i,r,w(this._initialPosition,e)),new M(this._data.child,this._initialPosition)}clearMoves(){this._data.child=void 0}}},9013:function(e,t,i){"use strict";var r,n,o=this&&this.__classPrivateFieldSet||function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},s=this&&this.__classPrivateFieldGet||function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.POJOExceptionBuilder=void 0,t.decodeStringField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("string"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_STRING_FIELD);i.pop()},t.decodeNumberField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("number"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_NUMBER_FIELD);i.pop()},t.decodeBooleanField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("boolean"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_BOOLEAN_FIELD);i.pop()},t.decodeArrayField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if(Array.isArray(n))r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_ARRAY_FIELD);i.pop()},t.decodeObjectField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("object"==typeof n&&null!==n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_OBJECT_FIELD);i.pop()};const a=i(8698),l=i(9955);t.POJOExceptionBuilder=class{constructor(e){r.set(this,void 0),n.set(this,[]),o(this,r,e,"f")}push(e){s(this,n,"f").push(e)}pop(){s(this,n,"f").pop()}build(e,...t){let i="",o=!0;for(const e of s(this,n,"f"))i+="number"==typeof e?`[${e}]`:o?e:"."+e,o=!1;return new a.InvalidPOJO(s(this,r,"f"),i,e,...t)}},r=new WeakMap,n=new WeakMap},7020:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readDatabase=function(e){return new b(e)},t.readOneGame=function(e,t){const i=new d.TokenStream(e);let r=0;for(;r!==t;){if(!i.skipGame())throw new o.InvalidPGN(e,-1,-1,l.i18n.INVALID_GAME_INDEX,t,r);++r}const{game:n,atLeastOneTokenFound:s}=m(i);if(!s)throw new o.InvalidPGN(e,-1,-1,l.i18n.INVALID_GAME_INDEX,t,r);return n};const r=i(9830),n=i(4633),o=i(8698),s=i(2525),a=i(999),l=i(9955),c=i(7781),u=i(6472),d=i(5299);function h(e){return"?"===e?void 0:e}function p(e){if(/^\d+$/.test(e)){const t=Number(e);if(Number.isInteger(t))return t}}function f(e,t,i,r,s,c,u){switch(s=s.trim(),r){case"White":t.playerName("w",h(s));break;case"Black":t.playerName("b",h(s));break;case"WhiteElo":t.playerElo("w",p(s));break;case"BlackElo":t.playerElo("b",p(s));break;case"WhiteTitle":t.playerTitle("w",s);break;case"BlackTitle":t.playerTitle("b",s);break;case"Event":t.event(h(s));break;case"Round":{const{round:e,subRound:i,subSubRound:r}=function(e){if(/^(\?|\d+)(?:\.(\?|\d+)(?:\.(\?|\d+)(?:\.(?:\?|\d+))*)?)?$/.test(e)){const e=Number(RegExp.$1),t=RegExp.$2?Number(RegExp.$2):void 0,i=RegExp.$3?Number(RegExp.$3):void 0;return{round:Number.isInteger(e)?e:void 0,subRound:Number.isInteger(t)?t:void 0,subSubRound:Number.isInteger(i)?i:void 0}}return{round:void 0,subRound:void 0,subSubRound:void 0}}(s);t.round(e),t.subRound(i),t.subSubRound(r);break}case"Date":t.date(n.DateValue.fromPGNString(s));break;case"Site":t.site(h(s));break;case"Annotator":t.annotator(s);break;case"ECO":t.eco(function(e){return(0,a.isValidECO)(e)?e:void 0}(s));break;case"Opening":t.opening(s);break;case"Variation":t.openingVariation(s);break;case"SubVariation":t.openingSubVariation(s);break;case"Termination":t.termination(s);break;case"FEN":i.fen=s,i.fenTokenCharacterIndex=c,i.fenTokenLineIndex=u;break;case"Variant":if(i.variant=function(e){return"regular"===(e=e.toLowerCase())||"standard"===e?"regular":"fischerandom"===e||/^chess[ -]?960$/.test(e)?"chess960":/^no[ -]king$/.test(e)?"no-king":/^white[ -]king[ -]only$/.test(e)?"white-king-only":/^black[ -]king[ -]only$/.test(e)?"black-king-only":/^anti[ -]?chess/.test(e)?"antichess":"horde"===e?"horde":void 0}(s),void 0===i.variant)throw new o.InvalidPGN(e.text(),c,u,l.i18n.UNKNOWN_VARIANT,s);i.variantTokenCharacterIndex=c,i.variantTokenLineIndex=u}}function g(e,t,i){if(void 0!==i.fen)try{const e=void 0===i.variant?new u.Position:new u.Position(i.variant,"empty"),r=e.fen(i.fen);t.initialPosition(e,r.fullMoveNumber)}catch(t){throw t instanceof o.InvalidFEN?new o.InvalidPGN(e.text(),i.fenTokenCharacterIndex,i.fenTokenLineIndex,l.i18n.INVALID_FEN_IN_PGN_TEXT,t.message):t}else if(void 0!==i.variant){if(!(0,a.variantWithCanonicalStartPosition)(i.variant))throw new o.InvalidPGN(e.text(),i.variantTokenCharacterIndex,i.variantTokenLineIndex,l.i18n.VARIANT_WITHOUT_FEN,i.variant);{const e=new u.Position(i.variant,"start");t.initialPosition(e,1)}}}function m(e){const t=new s.Game;let i=!1,r=!1,n=null;const a=[],u={};for(;!i&&e.consumeToken();)switch(r=!0,e.isMoveTextSection()&&null===n&&(g(e,t,u),n=t.mainVariation()),e.token()){case 1:{if(null!==n)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_PGN_HEADER);if(!e.consumeToken()||3!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_PGN_HEADER_ID);const i=e.tokenValue();if(!e.consumeToken()||4!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_PGN_HEADER_VALUE);const r=e.tokenValue(),s=e.tokenCharacterIndex(),a=e.tokenLineIndex();if(!e.consumeToken()||2!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_END_OF_PGN_HEADER);f(e,t,u,i,r,s,a);break}case 5:break;case 6:try{n=n.play(e.tokenValue())}catch(t){throw t instanceof o.InvalidNotation?new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.INVALID_MOVE_IN_PGN_TEXT,t.notation,t.message):t}break;case 7:n.addNag(e.tokenValue());break;case 8:{const{comment:t,tags:i}=e.tokenValue();for(const[e,t]of i)n.tag(e,t);if(void 0!==t)if(void 0===n.comment()){const i=n instanceof c.Variation?e.emptyLineAfterToken():e.emptyLineBeforeToken();n.comment(t,i)}else{const e=n.isLongComment();n.comment(n.comment()+" "+t,e)}break}case 9:if(n instanceof c.Variation)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_BEGIN_OF_VARIATION);a.push(n),n=n.addVariation(e.emptyLineBeforeToken());break;case 10:if(0===a.length)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_END_OF_VARIATION);n=a.pop();break;case 11:i=!0,t.result(e.tokenValue());break;default:throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.INVALID_PGN_TOKEN)}if(0!==a.length)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_END_OF_GAME);return{game:t,atLeastOneTokenFound:r}}class b extends r.Database{constructor(e){for(super(),this._currentGameIndex=-1,this._text=e,this._gameLocations=[],this._stream=new d.TokenStream(e);;){const e=this._stream.currentLocation();if(!this._stream.skipGame())break;this._gameLocations.push(e)}}doGameCount(){return this._gameLocations.length}doGame(e){if(e>=this._gameLocations.length)throw new o.InvalidPGN(this._text,-1,-1,l.i18n.INVALID_GAME_INDEX,e,this._gameLocations.length);this._currentGameIndex!==e&&(this._stream=new d.TokenStream(this._text,this._gameLocations[e])),this._currentGameIndex=-1;const{game:t}=m(this._stream);return this._currentGameIndex=e+1,t}}},989:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writeGame=g,t.writeGames=function(e,t){return e.map((e=>g(e,t))).join("\n\n")};const r=i(999),n=i(7781),o=i(6472),s=i(2493);function a(e){return e.replace(/([\\"])/g,"\\$1")}function l(e){return e.replace(/([\\}])/g,"\\$1")}function c(e){return void 0!==e&&(e=(0,s.trimAndCollapseSpaces)(e)),e?a(e):"?"}function u(e,t){return void 0!==t&&(t=(0,s.trimAndCollapseSpaces)(t)),t?`[${e} "${a(t)}"]\n`:""}function d(e,t){return void 0===t?"":`[${e} "${t}"]\n`}function h(e,t,i,r){for(const t of e.nags())i("$"+t,!1,!1);let o=e.comment();void 0!==o&&(o=(0,s.trimAndCollapseSpaces)(o));const a=e.tags(),c=new Map;let u=!1;for(const t of a){const i=(0,s.trimAndCollapseSpaces)(e.tag(t).replace(/[[\]]/g,""));i&&(c.set(t,i),u=!0)}if(u||o){o&&e.isLongComment()&&e instanceof n.Node&&r(),i("{",!1,!0);for(const e of a){const t=c.get(e);t&&i(`[%${e} ${l(t)}]`,!0,!1)}if(o)for(const e of l(o).split(" "))i(e,!1,!1);return i("}",!0,!1),o&&e.isLongComment()&&t&&r(),!0}return!1}function p(e,t,i,r,n){"w"===e.moveColor()?r(e.fullMoveNumber()+".",!1,!1):t&&r(e.fullMoveNumber()+"...",!1,!1),r(e.notation(),!1,!1);const o=e.variations();let s=-1;for(let e=o.length-1;e>=0;--e)if(void 0!==o[e].first()){s=e;break}let a=h(e,(i||void 0!==e.next())&&s<0,r,n);for(let e=0;e<o.length;++e){const t=o[e];void 0!==t.first()&&(t.isLongVariation()&&n(),r("(",!1,!0),f(t,!1,r,n),r(")",!0,!1),e===s&&t.isLongVariation()&&n(),a=!0)}return a}function f(e,t,i,r){h(e,!0,i,r);let n=e.first(),o=!0;for(;void 0!==n;)o=p(n,o,t,i,r),n=n.next()}function g(e,t){let i="";var n,s;i+=`[Event "${c(e.event())}"]\n`,i+=`[Site "${c(e.site())}"]\n`,i+=`[Date "${n=e.date(),void 0===n?"????.??.??":n.toPGNString()}"]\n`,i+=`[Round "${s=e.fullRound(),s??"?"}"]\n`,i+=`[White "${c(e.playerName("w"))}"]\n`,i+=`[Black "${c(e.playerName("b"))}"]\n`,i+=`[Result "${e.result()}"]\n`;const a=e.variant(),l=e.initialPosition(),h=!(0,r.variantWithCanonicalStartPosition)(a)||!o.Position.isEqual(l,new o.Position(a))||1!==e.initialFullMoveNumber();i+=u("Annotator",e.annotator()),i+=d("BlackElo",e.playerElo("b")),i+=u("BlackTitle",e.playerTitle("b")),i+=u("ECO",e.eco()),h&&(i+=`[FEN "${l.fen({fullMoveNumber:e.initialFullMoveNumber(),regularFENIfPossible:!0})}"]\n`),i+=u("Opening",e.opening()),t.withPlyCount&&(i+=`[PlyCount "${e.plyCount()}"]\n`),h&&(i+='[SetUp "1"]\n'),i+=u("SubVariation",e.openingSubVariation()),i+=u("Termination",e.termination()),i+=u("Variant",function(e){switch(e){case"regular":return;case"chess960":return"Fischerandom";case"antichess":return"Antichess";case"horde":return"Horde";default:return e}}(a)),i+=u("Variation",e.openingVariation()),i+=d("WhiteElo",e.playerElo("w")),i+=u("WhiteTitle",e.playerTitle("w")),i+="\n";let p="",g=!1;function m(e,t,r){0===p.length?p=e:p.length+e.length+(g||t?0:1)<=80?p+=(g||t?"":" ")+e:(i+=p+"\n",p=e),g=r}return f(e.mainVariation(),!0,m,(function(){i+=p+"\n",i+="\n",p="",g=!1})),m(e.result(),!1,!1),i+=p+"\n",i}},5299:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenStream=void 0;const r=i(8698),n=i(9955),o=i(2493);function s(e,t){const i=e;return i.needIncrementLineIndex=void 0!==t&&t,i.matchedIndex=-1,i.matched=null,i}const a=new Map;a.set("!!",3),a.set("!",1),a.set("!?",5),a.set("?!",6),a.set("?",2),a.set("??",4),a.set("+-",18),a.set("+/-",16),a.set("+/=",14),a.set("+=",14),a.set("=",10),a.set("~",13),a.set("inf",13),a.set("=/+",15),a.set("=+",15),a.set("-/+",17),a.set("-+",19),a.set("RR",145),a.set("N",146),t.TokenStream=class{constructor(e,t){this._pos=0,this._lineIndex=1,this._token=0,this._tokenValue=null,this._tokenCharacterIndex=-1,this._tokenLineIndex=-1,this._emptyLineBeforeToken=!1,this._emptyLineAfterToken=!1,this._matchSpaces=s(/[ \f\t\v]+/g),this._matchLineBreak=s(/\r?\n|\r/g,!0),this._matchFastAdvance=s(/[^ \f\t\v\r\n"{][^ \f\t\v\r\n"{10*]*/g),this._matchBeginHeader=s(/\[/g),this._matchEndHeader=s(/\]/g),this._matchHeaderId=s(/(\w+)/g),this._matchEnterHeaderValue=s(/"/g),this._matchMoveNumber=s(/[0-9]+\.(?:\.\.)?/g),this._matchMove=s(/(?:O-O(?:-O)?|0-0(?:-0)?|[KQRBN][a-h]?[1-8]?x?[a-h][1-8]|(?:[a-h]x?)?[a-h][1-8](?:=?[KQRBNP])?)[+#]?|--/g),this._matchNag=s(/([!?][!?]?|\+\/?[-=]|[-=]\/?\+|=|inf|~|RR|N)|\$([1-9][0-9]*)/g),this._matchEnterComment=s(/\{/g),this._matchBeginVariation=s(/\(/g),this._matchEndVariation=s(/\)/g),this._matchEndOfGame=s(/1-0|0-1|1\/2-1\/2|\*/g),this._headerValueMode=s(/((?:[^\\"\f\t\v\r\n]|\\[^\f\t\v\r\n])*)"/g),this._headerValueDegradedMode=s(/[^\r\n]*/g),this._commentMode=s(/((?:[^\\}]|\\(?:.|[\r\n]))*)\}/g,!0),65279===e.codePointAt(0)&&(e=e.substring(1)),this._text=e,void 0!==t&&(this._pos=t.pos,this._lineIndex=t.lineIndex)}text(){return this._text}currentLocation(){return{pos:this._pos,lineIndex:this._lineIndex}}emptyLineBeforeToken(){return this._emptyLineBeforeToken}emptyLineAfterToken(){return this._emptyLineAfterToken}token(){return this._token}tokenValue(){return this._tokenValue}tokenCharacterIndex(){return this._tokenCharacterIndex}tokenLineIndex(){return this._tokenLineIndex}isMoveTextSection(){return this._token>=5&&this._token<=11}consumeToken(){if(this._emptyLineBeforeToken=0===this._token||11===this._token?this.skipBlanks():this._emptyLineAfterToken,this._pos>=this._text.length)return this._tokenCharacterIndex=this._text.length,this._tokenLineIndex=this._lineIndex,!1;if(this._tokenCharacterIndex=this._pos,this._tokenLineIndex=this._lineIndex,this.testAtPos(this._matchMoveNumber))this._token=5,this._tokenValue=null;else if(this.testAtPos(this._matchMove))this._token=6,this._tokenValue=this._matchMove.matched[0];else if(this.testAtPos(this._matchNag))this._token=7,this._tokenValue=void 0===this._matchNag.matched[2]?a.get(this._matchNag.matched[1]):parseInt(this._matchNag.matched[2],10);else if(this.testAtPos(this._matchEnterComment)){if(!this.testAtPos(this._commentMode))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);this._token=8,this._tokenValue=function(e){e=e.replace(/\\([\\}])/g,"$1");const t=new Map;let i=e.replace(/\[%(\w+)\s([^[\]]*)\]/g,((e,i,r)=>(""!==(r=(0,o.trimAndCollapseSpaces)(r))&&t.set(i,r)," ")));return i=(0,o.trimAndCollapseSpaces)(i),""===i&&(i=void 0),{comment:i,tags:t}}(this._commentMode.matched[1])}else if(this.testAtPos(this._matchBeginVariation))this._token=9,this._tokenValue=null;else if(this.testAtPos(this._matchEndVariation))this._token=10,this._tokenValue=null;else if(this.testAtPos(this._matchEndOfGame))this._token=11,this._tokenValue=this._matchEndOfGame.matched[0];else if(this.testAtPos(this._matchBeginHeader))this._token=1,this._tokenValue=null;else if(this.testAtPos(this._matchEndHeader))this._token=2,this._tokenValue=null;else if(this.testAtPos(this._matchHeaderId))this._token=3,this._tokenValue=this._matchHeaderId.matched[1];else{if(!this.testAtPos(this._matchEnterHeaderValue))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);if(!this.testAtPos(this._headerValueMode))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);this._token=4,this._tokenValue=(e=this._headerValueMode.matched[1],(0,o.trimAndCollapseSpaces)(e.replace(/\\([\\"])/g,"$1")))}var e;return this._emptyLineAfterToken=11!==this._token&&this.skipBlanks(),!0}skipGame(){let e=!1;for(this._token=0;;){if(this.skipBlanks(),this._pos>=this._text.length)return e;if(e=!0,this.testAtPos(this._matchEnterComment)){if(!this.testAtPos(this._commentMode))return this._pos=this._text.length,!0}else if(this.testAtPos(this._matchEnterHeaderValue))this.testAtPos(this._headerValueMode)||this.testAtPos(this._headerValueDegradedMode);else{if(this.testAtPos(this._matchEndOfGame))return!0;this.testAtPos(this._matchFastAdvance)}}}skipBlanks(){let e=0;for(;this._pos<this._text.length;)if(this.testAtPos(this._matchSpaces));else{if(!this.testAtPos(this._matchLineBreak))break;++e}return e>=2}testAtPos(e){if(e.matchedIndex<this._pos&&(e.lastIndex=this._pos,e.matched=e.exec(this._text),e.matchedIndex=null===e.matched?this._text.length:e.matched.index),e.matchedIndex===this._pos){if(this._pos=e.lastIndex,e.needIncrementLineIndex){const t=/\r?\n|\r/g;for(;t.exec(e.matched[0]);)++this._lineIndex}return!0}return!1}}},6838:(e,t)=>{"use strict";function i(e,i,r){for(const n of t.ATTACK_DIRECTIONS[r]){const t=i-n;if(!(136&t)&&e.board[t]===r)return!0}return!1}function r(e,i,r,n){for(const o of t.ATTACK_DIRECTIONS[r]){let t=i;for(;;){if(t-=o,!(136&t)){const i=e.board[t];if(-1===i)continue;if(i===r||i===n)return!0}break}}return!1}function n(e,i,r,n){for(const o of t.ATTACK_DIRECTIONS[n]){const t=i-o;136&t||e.board[t]!==n||r.push(t)}}function o(e,i,r,n,o){for(const s of t.ATTACK_DIRECTIONS[n]){let t=i;for(;;){if(t-=s,!(136&t)){const i=e.board[t];if(-1===i)continue;i!==n&&i!==o||r.push(t)}break}}}Object.defineProperty(t,"__esModule",{value:!0}),t.ATTACK_DIRECTIONS=void 0,t.isAttacked=function(e,t,n){return i(e,t,0+n)||i(e,t,8+n)||i(e,t,10+n)||r(e,t,4+n,2+n)||r(e,t,6+n,2+n)},t.getAttacks=function(e,t,i){const r=[];return n(e,t,r,0+i),n(e,t,r,8+i),n(e,t,r,10+i),o(e,t,r,4+i,2+i),o(e,t,r,6+i,2+i),r},t.ATTACK_DIRECTIONS=[[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-16,-1,1,16],[-16,-1,1,16],[-17,-15,15,17],[-17,-15,15,17],[-33,-31,-18,-14,14,18,31,33],[-33,-31,-18,-14,14,18,31,33],[15,17],[-17,-15]]},9457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.colorToString=function(e){return i[e]},t.pieceToString=function(e){return r[e]},t.fileToString=function(e){return n[e]},t.rankToString=function(e){return o[e]},t.resultToString=function(e){return s[e]},t.variantToString=function(e){return a[e]},t.colorFromString=function(e){return"string"==typeof e?i.indexOf(e):-1},t.pieceFromString=function(e){return"string"==typeof e?r.indexOf(e):-1},t.fileFromString=function(e){return"string"==typeof e?n.indexOf(e):-1},t.rankFromString=function(e){return"string"==typeof e?o.indexOf(e):-1},t.resultFromString=function(e){return"string"==typeof e?s.indexOf(e):-1},t.variantFromString=function(e){return"string"==typeof e?a.indexOf(e):-1},t.squareToString=function(e){return n[e%16]+o[Math.trunc(e/16)]},t.squareFromString=function(e){if("string"!=typeof e||!/^[a-h][1-8]$/.test(e))return-1;const t=n.indexOf(e[0]);return 16*o.indexOf(e[1])+t},t.coloredPieceToString=function(e){return i[e%2]+r[Math.trunc(e/2)]},t.coloredPieceFromString=function(e){if("string"!=typeof e||!/^[wb][kqrbnp]$/.test(e))return-1;const t=i.indexOf(e[0]);return 2*r.indexOf(e[1])+t},t.figurineToString=function(e){return l[e]},t.figurineFromString=function(e){return l.indexOf(String(e))},t.squareColorImpl=function(e){return 1&(~e^e>>4)};const i=[..."wb"],r=[..."kqrbnp"],n=[..."abcdefgh"],o=[..."12345678"],s=["1-0","0-1","1/2-1/2","*"],a=["regular","chess960","no-king","white-king-only","black-king-only","antichess","horde"],l=[..."♔♚♕♛♖♜♗♝♘♞♙♟"]},2778:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ascii=function(e){let t="+---+---+---+---+---+---+---+---+\n";for(let i=7;i>=0;--i){for(let r=0;r<8;++r){const n=e.board[16*i+r];t+="| "+(-1===n?" ":l[n])+" "}t+="|\n",t+="+---+---+---+---+---+---+---+---+\n"}return t+=(0,r.colorToString)(e.turn)+" "+u(e)+" "+h(e),0!==e.variant&&(t+=" ("+(0,r.variantToString)(e.variant)+")"),t},t.getFEN=function(e,t=0,i=1,n=!1){let o="";for(let t=7;t>=0;--t){let i=0;for(let r=0;r<8;++r){const n=e.board[16*t+r];-1===n?++i:(i>0&&(o+=i,i=0),o+=l[n])}i>0&&(o+=i),t>0&&(o+="/")}return o+=" "+(0,r.colorToString)(e.turn)+" "+u(e,n)+" "+h(e),o+=" "+t+" "+i,o},t.parseFEN=function(e,t,i){const u=i?t.split(" "):t.replace(/^\s+|\s+$/g,"").split(/\s+/);if(6!==u.length)throw new s.InvalidFEN(t,a.i18n.WRONG_NUMBER_OF_FEN_FIELDS);const d=u[0].split("/");if(8!==d.length)throw new s.InvalidFEN(t,a.i18n.WRONG_NUMBER_OF_SUBFIELDS_IN_BOARD_FIELD);const h=(0,n.makeEmpty)(e);h.legal=null,h.effectiveCastling=null,h.effectiveEnPassant=null;for(let e=7;e>=0;--e){const i=d[7-e];let r=0,n=0;for(;r<i.length&&n<8;){const o=i[r],c=l.indexOf(o);if(/^[1-8]$/.test(o))n+=parseInt(o,10);else{if(!(c>=0))throw new s.InvalidFEN(t,a.i18n.UNEXPECTED_CHARACTER_IN_BOARD_FIELD,o);h.board[16*e+n]=c,++n}++r}if(r!==i.length||8!==n)throw new s.InvalidFEN(t,a.i18n.UNEXPECTED_END_OF_SUBFIELD_IN_BOARD_FIELD,8-e)}if(h.turn=(0,r.colorFromString)(u[1]),h.turn<0)throw new s.InvalidFEN(t,a.i18n.INVALID_TURN_FIELD);const p=1===e?function(e,t,i){const n=[0,0];if("-"===e)return n;if(!(t?/^[A-H]{0,2}[a-h]{0,2}$/:/^[A-Ha-h]*|[KQkq]*$/).test(e))return null;function o(e){const t=4+e,r=0+e;for(let n=112*e;n<112*e+8;++n){if(i[n]===t)return n%8;if(i[n]===r)break}return 0}function s(e){const t=4+e,r=0+e;for(let n=112*e+7;n>=112*e;--n){if(i[n]===t)return n%8;if(i[n]===r)break}return 7}t||(e.indexOf("K")>=0&&(n[0]|=1<<s(0)),e.indexOf("Q")>=0&&(n[0]|=1<<o(0)),e.indexOf("k")>=0&&(n[1]|=1<<s(1)),e.indexOf("q")>=0&&(n[1]|=1<<o(1)));for(let t=0;t<8;++t){const i=(0,r.fileToString)(t);e.indexOf(i.toUpperCase())>=0&&(n[0]|=1<<t),e.indexOf(i)>=0&&(n[1]|=1<<t)}return n}(u[2],i,h.board):function(e,t){const i=[0,0];return"-"===e?i:(t?/^K?Q?k?q?$/:/^[KQkq]*$/).test(e)?(e.indexOf("K")>=0&&(i[0]|=128),e.indexOf("Q")>=0&&(i[0]|=1),e.indexOf("k")>=0&&(i[1]|=128),e.indexOf("q")>=0&&(i[1]|=1),i):null}(u[2],i);if(null===p)throw new s.InvalidFEN(t,a.i18n.INVALID_CASTLING_FIELD);h.castling=p;const f=u[3];if("-"!==f){if(!/^[a-h][36]$/.test(f))throw new s.InvalidFEN(t,a.i18n.INVALID_EN_PASSANT_FIELD);if(h.enPassant=(0,r.fileFromString)(f[0]),i){if(f[1]!==c[h.turn])throw new s.InvalidFEN(t,a.i18n.WRONG_RANK_IN_EN_PASSANT_FIELD);if((0,o.refreshEffectiveEnPassant)(h),h.enPassant!==h.effectiveEnPassant)throw new s.InvalidFEN(t,a.i18n.INEFFECTIVE_EN_PASSANT_FIELD,(0,r.fileToString)(h.enPassant))}}const g=i?/^(?:0|[1-9][0-9]*)$/:/^[0-9]+$/;if(!g.test(u[4]))throw new s.InvalidFEN(t,a.i18n.INVALID_HALF_MOVE_COUNT_FIELD);if(!g.test(u[5]))throw new s.InvalidFEN(t,a.i18n.INVALID_MOVE_NUMBER_FIELD);return{position:h,fiftyMoveClock:parseInt(u[4],10),fullMoveNumber:parseInt(u[5],10)}};const r=i(9457),n=i(6585),o=i(5116),s=i(8698),a=i(9955),l=[..."KkQqRrBbNnPp"],c=["6","3"];function u(e,t=!1){if((0,o.refreshEffectiveCastling)(e),1===e.variant){if(t){const t=d(e,0),i=d(e,1);if(!1!==t&&!1!==i)return""===t&&""===i?"-":t.toUpperCase()+i}let i="",n="";for(let t=0;t<8;++t)e.effectiveCastling[0]&1<<t&&(i+=(0,r.fileToString)(t)),e.effectiveCastling[1]&1<<t&&(n+=(0,r.fileToString)(t));return""===i&&""===n?"-":i.toUpperCase()+n}{let t="";return 128&e.effectiveCastling[0]&&(t+="K"),1&e.effectiveCastling[0]&&(t+="Q"),128&e.effectiveCastling[1]&&(t+="k"),1&e.effectiveCastling[1]&&(t+="q"),""===t?"-":t}}function d(e,t){const i=1<<e.king[t]%16,r=e.effectiveCastling[t]&~(i|i-1),n=e.effectiveCastling[t]&i-1;let o="";const s=112*t,a=112*t+7,l=4+t;if(0!==r){let i=!1;for(let r=e.king[t]+1;r<=a;++r)if(e.board[r]===l){if(i)return!1;i=!0}o+="k"}if(0!==n){let i=!1;for(let r=e.king[t]-1;r>=s;--r)if(e.board[r]===l){if(i)return!1;i=!0}o+="q"}return o}function h(e){return(0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant<0?"-":(0,r.fileToString)(e.effectiveEnPassant)+c[e.turn]}},6585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCanonicalStartPosition=function(e){return null!==n[e]},t.makeEmpty=function(e){return{board:i.slice(),turn:0,castling:[0,0],enPassant:-1,variant:e,legal:2===e,king:[-1,-1],effectiveCastling:[0,0],effectiveEnPassant:-1}},t.makeInitial=function(e){const t=n[e];return{board:t.board.slice(),turn:0,castling:t.castling.slice(),enPassant:-1,variant:e,legal:!0,king:t.king.slice(),effectiveCastling:t.castling.slice(),effectiveEnPassant:-1}},t.make960FromScharnagl=function(e){const t=function(e){const t=[-1,-1,-1,-1,-1,-1,-1,-1];let i=0,r=-1;function n(e){let i=0;for(let r=0;r<8;++r)t[r]>=0||(e(r,i),++i)}function o(e,i,r){n(((n,o)=>{o!==i&&o!==r||(t[n]=e)}))}switch(t[e%4*2+1]=3,e=Math.trunc(e/4),t[e%4*2]=3,o(1,(e=Math.trunc(e/4))%6,-1),e=Math.trunc(e/6)){case 0:o(4,0,1);break;case 1:o(4,0,2);break;case 2:o(4,0,3);break;case 3:o(4,0,4);break;case 4:o(4,1,2);break;case 5:o(4,1,3);break;case 6:o(4,1,4);break;case 7:o(4,2,3);break;case 8:o(4,2,4);break;case 9:o(4,3,4)}return n(((e,n)=>{1===n?(t[e]=0,r=e):(t[e]=2,i|=1<<e)})),{pieceScheme:t,castling:i,kingFile:r}}(e),i=t.pieceScheme.map((e=>2*e+0)),r=t.pieceScheme.map((e=>2*e+1));return{board:[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]],turn:0,castling:[t.castling,t.castling],enPassant:-1,variant:1,legal:!0,king:[0+t.kingFile,112+t.kingFile],effectiveCastling:[t.castling,t.castling],effectiveEnPassant:-1}},t.makeCopy=function(e){return{board:e.board.slice(),turn:e.turn,castling:e.castling.slice(),enPassant:e.enPassant,variant:e.variant,legal:e.legal,king:e.king.slice(),effectiveCastling:null===e.effectiveCastling?null:e.effectiveCastling.slice(),effectiveEnPassant:e.effectiveEnPassant}};const i=[-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1],r=[4,8,6,2,0,6,8,4,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,5,9,7,3,1,7,9,5],n=[{board:r,castling:[129,129],king:[4,116]},null,null,null,null,{board:r,castling:[0,0],king:[-1,-1]},{board:[10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,10,10,-1,-1,10,10,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,5,9,7,3,1,7,9,5],castling:[0,129],king:[-1,116]}]},5116:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLegal=function(e){return n(e),e.legal},t.refreshLegalFlagAndKingSquares=n,t.isKingSafeAfterMove=a,t.refreshEffectiveCastling=l,t.refreshEffectiveEnPassant=d,t.isEqual=function(e,t){if(e.turn!==t.turn||e.variant!==t.variant)return!1;for(let i=0;i<120;i+=7&~i?1:9)if(e.board[i]!==t.board[i])return!1;return l(e),l(t),e.effectiveCastling[0]===t.effectiveCastling[0]&&e.effectiveCastling[1]===t.effectiveCastling[1]&&(d(e),d(t),e.effectiveEnPassant===t.effectiveEnPassant)};const r=i(6838);function n(e){if(null!==e.legal)return;e.legal=!1;const t=o(e,0),i=o(e,1);if(!t||!i)return;if(5===e.variant){if(!s(e,1-e.turn))return}else if(6===e.variant&&1===e.turn&&!s(e,0))return;if(e.king[1-e.turn]>=0&&(0,r.isAttacked)(e,e.king[1-e.turn],e.turn))return;const n=6===e.variant?-2:10;for(let t=0;t<8;++t){const i=e.board[0+t],r=e.board[112+t];if(i===n||10===r||11===i||11===r)return}e.legal=!0}function o(e,t){const i=0+t;if(e.king[t]=-1,5===e.variant)return!0;if(2===e.variant||e.variant===4-t||6===e.variant&&0===t){for(let t=0;t<120;t+=7&~t?1:9)if(e.board[t]===i)return!1;return!0}for(let r=0;r<120;r+=7&~r?1:9)if(e.board[r]===i){if(!(e.king[t]<0))return e.king[t]=-1,!1;e.king[t]=r}return e.king[t]>=0}function s(e,t){for(let i=0;i<120;i+=7&~i?1:9)if(-1!==e.board[i]&&e.board[i]%2===t)return!0;return!1}function a(e,t,i,n=-1){if(e.king[e.turn]<0)return!0;const o=e.board[t],s=e.board[i],a=Math.trunc(o/2);e.board[i]=o,e.board[t]=-1,n>=0&&(e.board[n]=-1);try{return!(0,r.isAttacked)(e,0===a?i:e.king[e.turn],1-e.turn)}finally{e.board[t]=o,e.board[i]=s,n>=0&&(e.board[n]=11-e.turn)}}function l(e){null===e.effectiveCastling&&(n(e),e.effectiveCastling=1===e.variant?[u(e,0),u(e,1)]:[c(e,0),c(e,1)])}function c(e,t){const i=112*t;if(e.king[t]!==i+4||0===e.castling[t])return 0;const r=4+t;let n=0;return 1&e.castling[t]&&e.board[i]===r&&(n|=1),128&e.castling[t]&&e.board[i+7]===r&&(n|=128),n}function u(e,t){const i=112*t;if(e.king[t]<=i||e.king[t]>=i+7||0===e.castling[t])return 0;const r=4+t;let n=0,o=-1;for(let n=e.king[t]%16-1;n>=0;--n)if(e.castling[t]&1<<n&&e.board[i+n]===r){if(!(o<0)){o=-1;break}o=n}o>=0&&(n|=1<<o);let s=-1;for(let n=e.king[t]%16+1;n<8;++n)if(e.castling[t]&1<<n&&e.board[i+n]===r){if(!(s<0)){s=-1;break}s=n}return s>=0&&(n|=1<<s),n}function d(e){if(null!==e.effectiveEnPassant)return;if(e.effectiveEnPassant=-1,e.enPassant<0)return;const t=16*(6-5*e.turn)+e.enPassant,i=16*(5-3*e.turn)+e.enPassant,r=16*(4-e.turn)+e.enPassant,o=10+e.turn,s=11-e.turn;if(-1!==e.board[t]||-1!==e.board[i]||e.board[r]!==s)return;const l=!(r-1&136)&&e.board[r-1]===o,c=!(r+1&136)&&e.board[r+1]===o;(l||c)&&(n(e),(l&&a(e,r-1,i,r)||c&&a(e,r+1,i,r))&&(e.effectiveEnPassant=e.enPassant))}},1789:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveDescriptorImpl=void 0;const r=i(9457),n=i(8698),o=i(3616);class s extends o.MoveDescriptor{static make(e,t,i,r){return new s(-1===r?0:4,e,t,i,i,r,-1,-1)}static makeCastling(e,t,i,r,n){const o=0+n;return new s(1,e,t,o,o,4+n,i,r)}static makeEnPassant(e,t,i,r){const n=10+r;return new s(6,e,t,n,n,11-r,i,-1)}static makePromotion(e,t,i,r,n){return new s(8|(-1===r?0:4),e,t,10+i,2*n+i,r,-1,-1)}constructor(e,t,i,r,n,o,s,a){super(),this._flags=e,this._from=t,this._to=i,this._movingColoredPiece=r,this._finalColoredPiece=n,this._optionalColoredPiece=o,this._optionalSquare1=s,this._optionalSquare2=a}isCastling(){return!!(1&this._flags)}isEnPassant(){return!!(2&this._flags)}isCapture(){return!!(4&this._flags)}isPromotion(){return!!(8&this._flags)}from(){return(0,r.squareToString)(this._from)}to(){return(0,r.squareToString)(this._to)}color(){return(0,r.colorToString)(this._movingColoredPiece%2)}movingPiece(){return(0,r.pieceToString)(Math.trunc(this._movingColoredPiece/2))}movingColoredPiece(){return(0,r.coloredPieceToString)(this._movingColoredPiece)}capturedPiece(){if(!this.isCapture())throw new n.IllegalArgument("MoveDescriptor.capturedPiece()");return(0,r.pieceToString)(Math.trunc(this._optionalColoredPiece/2))}capturedColoredPiece(){if(!this.isCapture())throw new n.IllegalArgument("MoveDescriptor.capturedColoredPiece()");return(0,r.coloredPieceToString)(this._optionalColoredPiece)}rookFrom(){if(!this.isCastling())throw new n.IllegalArgument("MoveDescriptor.rookFrom()");return(0,r.squareToString)(this._optionalSquare1)}rookTo(){if(!this.isCastling())throw new n.IllegalArgument("MoveDescriptor.rookTo()");return(0,r.squareToString)(this._optionalSquare2)}enPassantSquare(){if(!this.isEnPassant())throw new n.IllegalArgument("MoveDescriptor.enPassantSquare()");return(0,r.squareToString)(this._optionalSquare1)}promotion(){if(!this.isPromotion())throw new n.IllegalArgument("MoveDescriptor.promotion()");return(0,r.pieceToString)(Math.trunc(this._finalColoredPiece/2))}coloredPromotion(){if(!this.isPromotion())throw new n.IllegalArgument("MoveDescriptor.coloredPromotion()");return(0,r.coloredPieceToString)(this._finalColoredPiece)}}t.MoveDescriptorImpl=s},3055:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCheck=function(e){return(0,o.isLegal)(e)&&u(e)},t.isCheckmate=function(e){return!(!(0,o.isLegal)(e)||d(e))&&(5===e.variant||(6===e.variant&&0===e.turn?!c(e,0):u(e)))},t.isStalemate=function(e){return!(!(0,o.isLegal)(e)||d(e))&&(5===e.variant||(6===e.variant&&0===e.turn?c(e,0):!u(e)))},t.isDead=function(e,t){return!!(0,o.isLegal)(e)&&((0===e.variant||1===e.variant)&&(t?function(e){const t=[0,0],i=[-1,-1];for(let r=0;r<120;r+=7&~r?1:9){const o=e.board[r];if(-1===o)continue;const s=o%2,a=Math.trunc(o/2);if(3===a){const e=(0,n.squareColorImpl)(r);if(i[s]===e)continue;i[s]=e}if(3===a||4===a){if(t[s]+=3===a?2:1,t[s]>=3)return!1}else if(0!==a)return!1}return!0}(e):function(e){let t=!1,i=-1;for(let r=0;r<120;r+=7&~r?1:9){const o=e.board[r];if(-1===o)continue;const s=Math.trunc(o/2);if(3===s){const e=(0,n.squareColorImpl)(r);if(i===e)continue;i=e}if(3===s||4===s){if(t)return!1;t=!0}else if(0!==s)return!1}return!0}(e)))},t.hasMove=d,t.moves=function(e){const t=[];return h(e,(e=>{t.push(e)})),t},t.isCaptureMandatory=f,t.isCastlingMoveLegal=g,t.isMoveLegal=function(e,t,i){if(!(0,o.isLegal)(e))return!1;const r=e.board[t],n=e.board[i],c=Math.trunc(r/2);if(-1===r||r%2!==e.turn)return!1;const u=i-t+119;let d=-1,h=!1;const p=5===c&&(i<8||i>=112),m=f(e);if(0===c&&!m&&((0,o.refreshEffectiveCastling)(e),0!==e.effectiveCastling[e.turn])){const r=g(e,t,i);if(r)return{type:"regular",moveDescriptor:r}}if(!(a[u]&1<<r)){if(5!==c||u!==151-64*e.turn)return!1;{const i=96*e.turn;if(t<i||t>=i+24)return!1;h=!0}}if(5===c){if((0,o.refreshEffectiveEnPassant)(e),u===135-32*e.turn||h){if(m||-1!==n)return!1}else if(-1===n){if(i!==16*(5-3*e.turn)+e.effectiveEnPassant)return!1;d=16*(4-e.turn)+e.effectiveEnPassant}else if(n%2===e.turn)return!1}else if(-1===n?m:n%2===e.turn)return!1;if(3===c||2===c||1===c){const r=l[u];for(let n=t+r;n!==i;n+=r)if(-1!==e.board[n])return!1}else if(h&&-1!==e.board[(t+i)/2])return!1;return!!(0,o.isKingSafeAfterMove)(e,t,i,d)&&(p?{type:"promotion",moveDescriptorFactory:b(t,i,e.variant,e.turn,n)}:{type:"regular",moveDescriptor:d>=0?s.MoveDescriptorImpl.makeEnPassant(t,i,d,e.turn):s.MoveDescriptorImpl.make(t,i,r,n)})},t.play=function(e,t){(0,o.refreshEffectiveCastling)(e),e.board[t._from]=-1,t.isEnPassant()?e.board[t._optionalSquare1]=-1:t.isCastling()&&(e.board[t._optionalSquare1]=-1,e.board[t._optionalSquare2]=t._optionalColoredPiece),e.board[t._to]=t._finalColoredPiece;const i=Math.trunc(t._movingColoredPiece/2);if(0===i&&(e.effectiveCastling[e.turn]=0),t._from<8&&(e.effectiveCastling[0]&=~(1<<t._from)),t._to<8&&(e.effectiveCastling[0]&=~(1<<t._to)),t._from>=112&&(e.effectiveCastling[1]&=~(1<<t._from%16)),t._to>=112&&(e.effectiveCastling[1]&=~(1<<t._to%16)),e.castling[0]=e.effectiveCastling[0],e.castling[1]=e.effectiveCastling[1],e.enPassant=-1,e.effectiveEnPassant=-1,5===i&&32===Math.abs(t._from-t._to)){const i=16*(1+5*e.turn);if(t._from>=i&&t._from<i+8){const i=1^t._movingColoredPiece;(t._to-1&136||e.board[t._to-1]!==i)&&(t._to+1&136||e.board[t._to+1]!==i)||(e.enPassant=t._to%16,e.effectiveEnPassant=null)}}0===i&&e.king[e.turn]>=0&&(e.king[e.turn]=t._to),e.turn=1-e.turn},t.isNullMoveLegal=v,t.playNullMove=function(e){return!!v(e)&&(e.turn=1-e.turn,e.enPassant=-1,e.effectiveEnPassant=-1,!0)};const r=i(6838),n=i(9457),o=i(5116),s=i(1789),a=[204,0,0,0,0,0,0,60,0,0,0,0,0,0,204,0,0,204,0,0,0,0,0,60,0,0,0,0,0,204,0,0,0,0,204,0,0,0,0,60,0,0,0,0,204,0,0,0,0,0,0,204,0,0,0,60,0,0,0,204,0,0,0,0,0,0,0,0,204,0,0,60,0,0,204,0,0,0,0,0,0,0,0,0,0,204,768,60,768,204,0,0,0,0,0,0,0,0,0,0,0,768,2255,2111,2255,768,0,0,0,0,0,0,60,60,60,60,60,60,63,0,63,60,60,60,60,60,60,0,0,0,0,0,0,768,1231,1087,1231,768,0,0,0,0,0,0,0,0,0,0,0,204,768,60,768,204,0,0,0,0,0,0,0,0,0,0,204,0,0,60,0,0,204,0,0,0,0,0,0,0,0,204,0,0,0,60,0,0,0,204,0,0,0,0,0,0,204,0,0,0,0,60,0,0,0,0,204,0,0,0,0,204,0,0,0,0,0,60,0,0,0,0,0,204,0,0,204,0,0,0,0,0,0,60,0,0,0,0,0,0,204,0],l=[-17,0,0,0,0,0,0,-16,0,0,0,0,0,0,-15,0,0,-17,0,0,0,0,0,-16,0,0,0,0,0,-15,0,0,0,0,-17,0,0,0,0,-16,0,0,0,0,-15,0,0,0,0,0,0,-17,0,0,0,-16,0,0,0,-15,0,0,0,0,0,0,0,0,-17,0,0,-16,0,0,-15,0,0,0,0,0,0,0,0,0,0,-17,0,-16,0,-15,0,0,0,0,0,0,0,0,0,0,0,0,-17,-16,-15,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,15,16,17,0,0,0,0,0,0,0,0,0,0,0,0,15,0,16,0,17,0,0,0,0,0,0,0,0,0,0,15,0,0,16,0,0,17,0,0,0,0,0,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,0,0,0,15,0,0,0,0,16,0,0,0,0,17,0,0,0,0,15,0,0,0,0,0,16,0,0,0,0,0,17,0,0,15,0,0,0,0,0,0,16,0,0,0,0,0,0,17,0];function c(e,t){for(let i=0;i<120;i+=7&~i?1:9)if(-1!==e.board[i]&&e.board[i]%2===t)return!0;return!1}function u(e){return e.king[e.turn]>=0&&(0,r.isAttacked)(e,e.king[e.turn],1-e.turn)}function d(e){class t{}try{return h(e,(()=>{throw new t})),!1}catch(e){if(e instanceof t)return!0;throw e}}function h(e,t){if(!(0,o.isLegal)(e))return;const i=!f(e);if((0,o.refreshEffectiveCastling)(e),i&&0!==e.effectiveCastling[e.turn]){const i=112*e.turn;for(let r=0;r<8;++r)if(e.effectiveCastling[e.turn]&1<<r){const n=i+r,o=i+(n<e.king[e.turn]?3:5),a=i+(n<e.king[e.turn]?2:6);m(e,e.king[e.turn],a,n,o)&&t(s.MoveDescriptorImpl.makeCastling(e.king[e.turn],a,n,o,e.turn))}}if((0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant>=0){const i=16*(5-3*e.turn)+e.effectiveEnPassant,r=16*(4-e.turn)+e.effectiveEnPassant,n=10+e.turn;r-1&136||e.board[r-1]!==n||!(0,o.isKingSafeAfterMove)(e,r-1,i,r)||t(s.MoveDescriptorImpl.makeEnPassant(r-1,i,r,e.turn)),r+1&136||e.board[r+1]!==n||!(0,o.isKingSafeAfterMove)(e,r+1,i,r)||t(s.MoveDescriptorImpl.makeEnPassant(r+1,i,r,e.turn))}for(let n=0;n<120;n+=7&~n?1:9){const a=e.board[n],l=Math.trunc(a/2);if(-1!==a&&a%2===e.turn)if(5===l){for(const i of r.ATTACK_DIRECTIONS[a]){const r=n+i;136&r||-1===e.board[r]||e.board[r]%2===e.turn||!(0,o.isKingSafeAfterMove)(e,n,r)||p(e,n,r,t)}if(i){const i=16-32*e.turn;let r=n+i;if(-1===e.board[r]){(0,o.isKingSafeAfterMove)(e,n,r)&&p(e,n,r,t);const l=96*e.turn;n>=l&&n<l+24&&(r+=i,-1===e.board[r]&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,-1)))}}}else if(4===l||0===l)for(const l of r.ATTACK_DIRECTIONS[a]){const r=n+l;if(!(136&r)){const l=e.board[r];(-1===l?i:l%2!==e.turn)&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,l))}}else for(const l of r.ATTACK_DIRECTIONS[a])for(let r=n+l;!(136&r);r+=l){const l=e.board[r];if((-1===l?i:l%2!==e.turn)&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,l)),-1!==l)break}}}function p(e,t,i,r){const n=e.board[i];i<8||i>=112?(r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,1)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,2)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,3)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,4)),5===e.variant&&r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,0))):r(s.MoveDescriptorImpl.make(t,i,10+e.turn,n))}function f(e){if(5!==e.variant)return!1;for(let t=0;t<120;t+=7&~t?1:9){const i=e.board[t];if(-1!==i&&i%2!==e.turn&&(0,r.isAttacked)(e,t,e.turn))return!0}return(0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant>=0}function g(e,t,i){let r=-1,n=-1;if(1===e.variant){const o=i%16;if(Math.trunc(i/16)!==7*e.turn||!(e.effectiveCastling[e.turn]&1<<o))return!1;r=i,n=(t>i?3:5)+112*e.turn,i=(t>i?2:6)+112*e.turn}else if(i===2+112*e.turn){if(!(1&e.effectiveCastling[e.turn]))return!1;r=112*e.turn,n=3+112*e.turn}else{if(i!==6+112*e.turn)return!1;if(!(128&e.effectiveCastling[e.turn]))return!1;r=7+112*e.turn,n=5+112*e.turn}return!!m(e,t,i,r,n)&&s.MoveDescriptorImpl.makeCastling(t,i,r,n,e.turn)}function m(e,t,i,n,o){e.board[t]=-1,e.board[n]=-1;try{for(let r=Math.min(t,i,n,o);r<=Math.max(t,i,n,o);++r)if(-1!==e.board[r])return!1;const s=1-e.turn;for(let n=Math.min(t,i);n<=Math.max(t,i);++n)if((0,r.isAttacked)(e,n,s))return!1;return!0}finally{e.board[t]=0+e.turn,e.board[n]=4+e.turn}}function b(e,t,i,r,n){return o=>5!==o&&(0!==o||5===i)&&s.MoveDescriptorImpl.makePromotion(e,t,r,n,o)}function v(e){return(0,o.isLegal)(e)&&!u(e)}},7261:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNotation=function(e,t,i){let r="";return t.isCastling()?r=t._to%16==6?"O-O":"O-O-O":5===Math.trunc(t._movingColoredPiece/2)?(t.isCapture()&&(r+=(0,n.fileToString)(t._from%16)+"x"),r+=(0,n.squareToString)(t._to),t.isPromotion()&&(r+="="+h(t._finalColoredPiece,i))):(r+=h(t._movingColoredPiece,i),r+=f(e,t._from,t._to),t.isCapture()&&(r+="x"),r+=(0,n.squareToString)(t._to)),r+=p(e,t),r},t.parseNotation=function(e,t,i,s){const h=/^(?:(O-O-O|0-0-0)|(O-O|0-0)|([A-Z\u2654-\u265f])([a-h])?([1-8])?(x)?([a-h][1-8])|(?:([a-h])(x)?)?([a-h][1-8])(?:(=)?([A-Z\u2654-\u265f]))?)([+#])?$/.exec(t);if(null===h)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_MOVE_NOTATION_SYNTAX);if(!(0,a.isLegal)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_POSITION);let g=!1;if(g=void 0!==h[1]||void 0!==h[2]?function(e,t,i,r,n){const s=e.king[e.turn];if(s<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_NO_KING_CASTLING);(0,a.refreshEffectiveCastling)(e);const l=void 0!==n,h=function(e,t){if(1===e.variant){if(0!==e.effectiveCastling[e.turn]){const i=0+e.turn;for(let r=t?7:0;e.board[r+112*e.turn]!==i;r+=t?-1:1)if(e.effectiveCastling[e.turn]&1<<r)return r}return-1}return t?6:2}(e,l),p=h>=0&&(0,c.isCastlingMoveLegal)(e,s,h+112*e.turn);if(!p){const i=l?d.i18n.ILLEGAL_KING_SIDE_CASTLING:d.i18n.ILLEGAL_QUEEN_SIDE_CASTLING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(i&&"0"===(l?n:r).charAt(0))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CASTLING_MOVE_ENCODED_WITH_ZERO);return p}(e,t,i,h[1],h[2]):void 0!==h[3]?function(e,t,i,s,h,p,g,m){const v=2*b(e,t,h,i,s)+e.turn,_=(0,n.squareFromString)(m),I=e.board[_];if(-1!==I&&I%2===e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.TRYING_TO_CAPTURE_YOUR_OWN_PIECES);if(-1===I&&(0,c.isCaptureMandatory)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CAPTURE_IS_MANDATORY);let N=(0,r.getAttacks)(e,_,e.turn).filter((t=>e.board[t]===v));if(void 0!==p){const e=(0,n.fileFromString)(p);N=N.filter((t=>t%16===e))}if(void 0!==g){const e=(0,n.rankFromString)(g);N=N.filter((t=>Math.trunc(t/16)===e))}if(0===N.length){const i=void 0===p&&void 0===g?d.i18n.NO_PIECE_CAN_MOVE_TO:d.i18n.NO_PIECE_CAN_MOVE_TO_DISAMBIGUATION;throw new u.InvalidNotation((0,o.getFEN)(e),t,i,h,m)}let w=!1;for(const i of N)if((0,a.isKingSafeAfterMove)(e,i,_)){if(w)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.REQUIRE_DISAMBIGUATION,h,m);w=l.MoveDescriptorImpl.make(i,_,v,I)}if(!w){const i=0===e.turn?d.i18n.NOT_SAFE_FOR_WHITE_KING:d.i18n.NOT_SAFE_FOR_BLACK_KING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(i){const i=f(e,w._from,_),r=(p??"")+(g??"");if(i!==r)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.WRONG_DISAMBIGUATION_SYMBOL,i,r)}return w}(e,t,i,s,h[3],h[4],h[5],h[7]):function(e,t,i,r,s,h,p,f){const g=10+e.turn,m=(0,n.squareFromString)(h),v=e.board[m],_=16-32*e.turn;let I=m-_,N=-1;if(void 0!==s){if(136&I)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);const i=(0,n.fileFromString)(s),r=m%16;if(r-i==1)I-=1;else{if(r-i!=-1)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);I+=1}if(e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);if(-1===v){if((0,a.refreshEffectiveEnPassant)(e),m!==16*(5-3*e.turn)+e.effectiveEnPassant)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);N=16*(4-e.turn)+e.effectiveEnPassant}else if(v%2===e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE)}else{if((0,c.isCaptureMandatory)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CAPTURE_IS_MANDATORY);if(136&I)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE);if(-1!==v)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE);if(-1===e.board[I]){I-=_;const i=96*e.turn;if(I<i||I>=i+24||e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE)}else if(e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE)}if(!(0,a.isKingSafeAfterMove)(e,I,m,N)){const i=0===e.turn?d.i18n.NOT_SAFE_FOR_WHITE_KING:d.i18n.NOT_SAFE_FOR_BLACK_KING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(m<8||m>=112){if(void 0===f)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.MISSING_PROMOTION);const n=b(e,t,f,i,r);if(5===n||0===n&&5!==e.variant)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PROMOTED_PIECE,f);if(i&&void 0===p)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.MISSING_PROMOTION_SYMBOL);return l.MoveDescriptorImpl.makePromotion(I,m,e.turn,v,n)}if(void 0!==f)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_PROMOTION);return N>=0?l.MoveDescriptorImpl.makeEnPassant(I,m,N,e.turn):l.MoveDescriptorImpl.make(I,m,g,v)}(e,t,i,s,h[8],h[10],h[11],h[12]),i){const i=void 0!==h[6]||void 0!==h[9];if(g.isCapture()!==i){const i=g.isCapture()?d.i18n.MISSING_CAPTURE_SYMBOL:d.i18n.INVALID_CAPTURE_SYMBOL;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}const r=p(e,g),n=h[13]??"";if(r!==n)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.WRONG_CHECK_CHECKMATE_SYMBOL,r,n)}return g};const r=i(6838),n=i(9457),o=i(2778),s=i(6585),a=i(5116),l=i(1789),c=i(3055),u=i(8698),d=i(9955);function h(e,t){switch(t){case"figurine":return(0,n.figurineToString)(e);case"standard":return(0,n.pieceToString)(Math.trunc(e/2)).toUpperCase()}}function p(e,t){const i=(0,s.makeCopy)(e);return(0,c.play)(i,t),(0,c.isCheckmate)(i)?"#":(0,c.isCheck)(i)?"+":""}function f(e,t,i){const o=(0,r.getAttacks)(e,i,e.turn).filter((i=>e.board[i]===e.board[t]));if(o.length<2)return"";let s=!1,a=!1,l=!1;const c=Math.trunc(t/16),u=t%16;for(const r of o)r===t||g(e,r,i)||(s=!0,c===Math.trunc(r/16)&&(a=!0),u===r%16&&(l=!0));return l?a?(0,n.squareToString)(t):(0,n.rankToString)(c):s?(0,n.fileToString)(u):""}function g(e,t,i){const r=e.king[e.turn];if(r<0)return!1;const n=Math.abs(r-t),o=Math.abs(i-t),s=3-e.turn,a=5-e.turn,l=7-e.turn;return n<8?o>=8&&m(e,r,t,r<t?1:-1,a,s):n%16==0?o%16!=0&&m(e,r,t,r<t?16:-16,a,s):n%15==0?o%15!=0&&m(e,r,t,r<t?15:-15,l,s):n%17==0&&o%17!=0&&m(e,r,t,r<t?17:-17,l,s)}function m(e,t,i,r,n,o){for(let n=t+r;n!==i;n+=r)if(-1!==e.board[n])return!1;for(let t=i+r;!(136&t);t+=r)if(-1!==e.board[t])return e.board[t]===n||e.board[t]===o;return!1}function b(e,t,i,r,s){switch(s){case"figurine":{const s=(0,n.figurineFromString)(i);if(s<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL,i);if(r&&s%2!==e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL_COLOR,i);return Math.trunc(s/2)}case"standard":{const r=(0,n.pieceFromString)(i.toLowerCase());if(r<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL,i);return r}}}},9988:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUCINotation=function(e,t,i){let r=t.from();return t.isCastling()?r+=i||1===e.variant?t.rookFrom():t.to():r+=t.to(),t.isPromotion()&&(r+=t.promotion()),r},t.parseUCINotation=function(e,t,i){const c=/^([a-h][1-8])([a-h][1-8])([kqrbnp]?)$/.exec(t);if(null===c)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.INVALID_UCI_NOTATION_SYNTAX);if(!(0,o.isLegal)(e))throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_POSITION);const u=(0,r.squareFromString)(c[1]);let d=(0,r.squareFromString)(c[2]),h=!1,p=-1;if(1!==e.variant&&!i&&-1!==e.board[u]&&-1!==e.board[d]&&e.board[u]%2==e.board[d]%2){const t=Math.trunc(e.board[u]/2),i=Math.trunc(e.board[d]/2);0===t&&2===i&&(h=!0,p=d,d=112*e.turn+(u<d?6:2))}const f=(0,s.isMoveLegal)(e,u,d);let g=!1;if(!f)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);if("promotion"===f.type){if(""===c[3])throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);if(g=f.moveDescriptorFactory((0,r.pieceFromString)(c[3])),!g)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE)}else{if(""!==c[3])throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);g=f.moveDescriptor}if(h&&(!g.isCastling()||p!==g._optionalSquare1))throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);return g};const r=i(9457),n=i(2778),o=i(5116),s=i(3055),a=i(8698),l=i(9955)},2694:(e,t,i)=>{"use strict";var r=i(9306);function n(){}function o(){}o.resetWarningCache=n,e.exports=function(){function e(e,t,i,n,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:n};return i.PropTypes=i,i}},5556:(e,t,i)=>{e.exports=i(2694)()},9306:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338:(e,t,i)=>{"use strict";var r=i(5795);t.H=r.createRoot,r.hydrateRoot},5795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{"use strict";i(8387);const e=window.React;var t,r=i.n(e),n=i(5338);!function(e){e.LINE="line {0}",e.INVALID_FEN_ERROR_TITLE="Invalid FEN string.",e.INVALID_NOTATION_ERROR_TITLE="Invalid move notation.",e.TOOLTIP_GO_FIRST="Go to the beginning of the game",e.TOOLTIP_GO_PREVIOUS="Go to the previous move",e.TOOLTIP_GO_NEXT="Go to the next move",e.TOOLTIP_GO_LAST="Go to the end of the game",e.TOOLTIP_PLAY_STOP="Play/stop the game",e.TOOLTIP_FLIP="Flip the board",e.PIECE_SYMBOLS={K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"},e.ANNOTATED_BY="Annotated by {0}",e.INVALID_PGN_ERROR_TITLE="Invalid PGN string."}(t||(t={}));var o=i(3219);class s{constructor(e,t){this.functionOrComponentName=e,this.argumentName=t}toString(){return`Illegal argument '${this.argumentName}' in function or component ${this.functionOrComponentName}`}}const a=12,l=96;function c(e){return"string"==typeof e&&/^(?:[A-Za-z0-9]|plus|times|dot|circle)$/.test(e)}function u(e){return"b"===e||"g"===e||"r"===e||"y"===e}function d(e){if("string"!=typeof e)throw new s("parseSquareMarkers()","markers");return f(e,(e=>/^([BGRY])([a-h][1-8])$/.test(e)?{key:RegExp.$2,value:RegExp.$1.toLowerCase()}:void 0))}function h(e){if("string"!=typeof e)throw new s("parseTextMarkers()","markers");return f(e,(e=>/^([BGRY])(?:([A-Za-z0-9])|\((plus|times|dot|circle)\))([a-h][1-8])$/.test(e)?{key:RegExp.$4,value:{symbol:RegExp.$2||RegExp.$3,color:RegExp.$1.toLowerCase()}}:void 0))}function p(e){if("string"!=typeof e)throw new s("parseArrowMarkers()","markers");return f(e,(e=>/^([BGRY])([a-h][1-8][a-h][1-8])$/.test(e)?{key:RegExp.$2,value:RegExp.$1.toLowerCase()}:void 0))}function f(e,t){const i={};return e.split(",").map((e=>t(e.trim()))).forEach((e=>{e&&(i[e.key]=e.value)})),i}function g(e){return String(e)}function m(e){return Boolean(e)}function b(e,t){if(null==e)return{};if("object"!=typeof e)throw t();return e}function v(e,t){if("number"!=typeof e||!Number.isFinite(e))throw t();return Math.round(e)}function _(e,t,i,r){return Math.min(Math.max(v(e,r),t),i)}function I(e,t){return null==e?void 0:t(e)}function N(){const e=new Uint32Array(8);crypto.getRandomValues(e);let t="";for(const i of e)t+=i.toString(16);return t}function w(e,...t){return e.replace(/{(\d+)}/g,((e,i)=>{const r=Number(i);return r<t.length?String(t[r]):e}))}const S=5,E=36,y=4;function C({title:i,message:r,text:n,errorIndex:o,lineNumber:s}){let a;return i=g(i),r=g(r),n=I(n,g),o=Number.isInteger(o)?o:void 0,s=Number.isInteger(s)?s:void 0,n&&void 0!==o&&o>=0&&o<n.length&&(a=e.createElement("div",{className:"kokopu-errorExcerpt"},function(e,i,r){let n=i-S,o=!0;for(let t=0;t<=S+y;++t){const r=i-t-1;if(r<0||"\n"===e.charAt(r)||"\r"===e.charAt(r)){n=r+1,o=!1;break}}let s=i+E,a=!0;for(let t=0;t<=E+y;++t){const r=i+t+1;if(r>=e.length||"\n"===e.charAt(r)||"\r"===e.charAt(r)){s=r-1,a=!1;break}}let l=(o?"... ":"")+e.substring(n,s+1)+(a?" ...":"");l=l.replace(/\s/g," ");let c=" ".repeat(i-n+(o?y:0))+"^";return r&&r>=1&&(c+=` (${w(t.LINE,r)})`),l+"\n"+c}(n,o,s))),e.createElement("div",{className:"kokopu-errorBox"},e.createElement("div",{className:"kokopu-errorTitle"},i),e.createElement("div",{className:"kokopu-errorMessage"},r),a)}function A({size:t,color:i="currentcolor"}){t=_(t,a,l,(()=>new s("SquareMarkerIcon","size"))),i=g(i);const r=Math.round(.1*t),n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-squareMarkerIcon",viewBox:n,width:t,height:t},e.createElement("rect",{x:r,y:r,width:t-2*r,height:t-2*r,fill:i}))}const T=.1,P=.15,k=.425;function x({x:t,y:i,size:r,symbol:n,color:o}){if("dot"===n)return e.createElement("circle",{cx:t,cy:i,r:r*P,fill:o});if("circle"===n){const n=r*T;return e.createElement("circle",{className:"kokopu-symbolCircle",cx:t,cy:i,r:r*k,stroke:o,strokeWidth:n})}{const s="plus"===n?"+":"times"===n?"×":n;return e.createElement("text",{className:"kokopu-symbolText",x:t,y:i,fill:o,fontSize:r},s)}}function O({size:t,symbol:i,color:r="currentcolor"}){if(t=_(t,a,l,(()=>new s("TextMarkerIcon","size"))),!c(i))throw new s("TextMarkerIcon","symbol");r=g(r);const n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-textMarkerIcon",viewBox:n,width:t,height:t},e.createElement(x,{x:t/2,y:t/2,size:t,symbol:i,color:r}))}function L({id:t,color:i}){return e.createElement("marker",{id:t,markerWidth:4,markerHeight:4,refX:2.5,refY:2,orient:"auto"},e.createElement("path",{fill:i,d:"M 4,2 L 0,4 L 1,2 L 0,0 Z"}))}class D extends e.Component{constructor(){super(...arguments),this.arrowTipId=N()}render(){const t=_(this.props.size,a,l,(()=>new s("ArrowMarkerIcon","size"))),i=g(this.props.color),r=.2*t/2,n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-arrowMarkerIcon",viewBox:n,width:t,height:t},e.createElement("defs",null,e.createElement(L,{id:this.arrowTipId,color:this.props.color})),e.createElement("line",{className:"kokopu-arrow",x1:r,y1:t/2,x2:t-3*r,y2:t/2,stroke:i,strokeWidth:2*r,markerEnd:`url(#${this.arrowTipId})`}))}}D.defaultProps={color:"currentcolor"};const R=i.p+"images/cburnett-bb.ea6f2416.png",M=i.p+"images/cburnett-bk.67fd6fca.png",q=i.p+"images/cburnett-bn.62fa7cdc.png",V=i.p+"images/cburnett-bp.3dcf0707.png",B=i.p+"images/cburnett-bq.d415cc0d.png",F=i.p+"images/cburnett-br.9cdfc5eb.png",G=i.p+"images/cburnett-wb.1d040321.png",U=i.p+"images/cburnett-wk.4efa4472.png",j=i.p+"images/cburnett-wn.9d8079de.png",z=i.p+"images/cburnett-wp.11023b5f.png",$=i.p+"images/cburnett-wq.321bc82a.png",H=i.p+"images/cburnett-wr.9f11cd25.png",W=i.p+"images/cburnett-bx.a6030f67.png",K=i.p+"images/cburnett-wx.73aad9cd.png",J=i.p+"images/celtic-bb.e9ae0c1c.png",Y=i.p+"images/celtic-bk.0843ad22.png",Q=i.p+"images/celtic-bn.cffcfa13.png",X=i.p+"images/celtic-bp.3c1d61a4.png",Z=i.p+"images/celtic-bq.0151721c.png",ee=i.p+"images/celtic-br.c933978d.png",te=i.p+"images/celtic-wb.5411c112.png",ie=i.p+"images/celtic-wk.6bff280b.png",re=i.p+"images/celtic-wn.b84697e8.png",ne=i.p+"images/celtic-wp.bdbcd1cb.png",oe=i.p+"images/celtic-wq.c5b97b97.png",se=i.p+"images/celtic-wr.bde80e59.png",ae=i.p+"images/eyes-bb.5771ab48.png",le=i.p+"images/eyes-bk.12aae1e0.png",ce=i.p+"images/eyes-bn.44e7f8a3.png",ue=i.p+"images/eyes-bp.3a05ea2f.png",de=i.p+"images/eyes-bq.df12f0e7.png",he=i.p+"images/eyes-br.6416a13c.png",pe=i.p+"images/eyes-wb.232d2808.png",fe=i.p+"images/eyes-wk.be8ddec7.png",ge=i.p+"images/eyes-wn.91dfea2b.png",me=i.p+"images/eyes-wp.46827b3b.png",be=i.p+"images/eyes-wq.9179d6d2.png",ve=i.p+"images/eyes-wr.259c8532.png",_e=i.p+"images/fantasy-bb.f88f7da6.png",Ie=i.p+"images/fantasy-bk.98149195.png",Ne=i.p+"images/fantasy-bn.5b46eaf4.png",we=i.p+"images/fantasy-bp.c1f332e7.png",Se=i.p+"images/fantasy-bq.6df46574.png",Ee=i.p+"images/fantasy-br.d8c4a5e4.png",ye=i.p+"images/fantasy-wb.6a57ff26.png",Ce=i.p+"images/fantasy-wk.5c9d9df8.png",Ae=i.p+"images/fantasy-wn.df2c0f14.png",Te=i.p+"images/fantasy-wp.1f5a89d4.png",Pe=i.p+"images/fantasy-wq.8ac6e3dc.png",ke=i.p+"images/fantasy-wr.b17912d1.png",xe=i.p+"images/skulls-bb.9fa6d142.png",Oe=i.p+"images/skulls-bk.0b3db3da.png",Le=i.p+"images/skulls-bn.7fa7cc9a.png",De=i.p+"images/skulls-bp.202dfbe9.png",Re=i.p+"images/skulls-bq.29bb4a1f.png",Me=i.p+"images/skulls-br.a6226fad.png",qe=i.p+"images/skulls-wb.18e5791d.png",Ve=i.p+"images/skulls-wk.c6a350c3.png",Be=i.p+"images/skulls-wn.0979559c.png",Fe=i.p+"images/skulls-wp.8d7c1334.png",Ge=i.p+"images/skulls-wq.a92fae95.png",Ue=i.p+"images/skulls-wr.b8d35bb3.png",je=i.p+"images/spatial-bb.2e7e83ee.png",ze=i.p+"images/spatial-bk.638dc5a7.png",$e=i.p+"images/spatial-bn.49f37ab7.png",He=i.p+"images/spatial-bp.4c496f6e.png",We=i.p+"images/spatial-bq.04bbb72a.png",Ke=i.p+"images/spatial-br.f7fc8f08.png",Je=i.p+"images/spatial-wb.befe4896.png",Ye=i.p+"images/spatial-wk.013e12c3.png",Qe=i.p+"images/spatial-wn.b68afa3e.png",Xe=i.p+"images/spatial-wp.c3d78661.png",Ze=i.p+"images/spatial-wq.d34a46a1.png",et=i.p+"images/spatial-wr.6f451ecf.png",tt=i.p+"images/celtic-bx.bfb13cd3.png",it=i.p+"images/celtic-wx.0e93181b.png",rt=i.p+"images/eyes-spatial-bx.2257ef49.png",nt=i.p+"images/eyes-spatial-wx.abb4bf3b.png",ot=i.p+"images/fantasy-bx.6136a6ab.png",st=i.p+"images/fantasy-wx.271b66c5.png",at=i.p+"images/skulls-bx.921e2a33.png",lt=i.p+"images/skulls-wx.e2d2b43b.png",ct={};ct.cburnett={bb:R,bk:M,bn:q,bp:V,bq:B,br:F,bx:W,wb:G,wk:U,wn:j,wp:z,wq:$,wr:H,wx:K},ct.celtic={bb:J,bk:Y,bn:Q,bp:X,bq:Z,br:ee,bx:tt,wb:te,wk:ie,wn:re,wp:ne,wq:oe,wr:se,wx:it},ct.eyes={bb:ae,bk:le,bn:ce,bp:ue,bq:de,br:he,bx:rt,wb:pe,wk:fe,wn:ge,wp:me,wq:be,wr:ve,wx:nt},ct.fantasy={bb:_e,bk:Ie,bn:Ne,bp:we,bq:Se,br:Ee,bx:ot,wb:ye,wk:Ce,wn:Ae,wp:Te,wq:Pe,wr:ke,wx:st},ct.skulls={bb:xe,bk:Oe,bn:Le,bp:De,bq:Re,br:Me,bx:at,wb:qe,wk:Ve,wn:Be,wp:Fe,wq:Ge,wr:Ue,wx:lt},ct.spatial={bb:je,bk:ze,bn:$e,bp:He,bq:We,br:Ke,bx:rt,wb:Je,wk:Ye,wn:Qe,wp:Xe,wq:Ze,wr:et,wx:nt};const ut={original:{b:"#b5876b",w:"#f0dec7",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},gray:{b:"#bbbbbb",w:"#f8f8f8",cb:"#04f",cg:"#0a0",cr:"#d00",cy:"#a90"},scid:{b:"#7389b6",w:"#f3f3f3",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},wikipedia:{b:"#d18b47",w:"#ffce9e",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},xboard:{b:"#77a26d",w:"#c8c365",cb:"#04f",cg:"#0f0",cr:"#d00",cy:"#ff0"},coral:{b:"rgb(112,162,163)",w:"rgb(177,228,185)",cb:"#04f",cg:"#080",cr:"#d00",cy:"#ff0"},dusk:{b:"rgb(112,102,119)",w:"rgb(204,183,174)",cb:"#04f",cg:"#3f3",cr:"#f20",cy:"#ff0"},emerald:{b:"rgb(111,143,114)",w:"rgb(173,189,143)",cb:"#04f",cg:"#6f6",cr:"#d00",cy:"#ff0"},marine:{b:"rgb(111,115,210)",w:"rgb(157,172,255)",cb:"#04f",cg:"#6f6",cr:"#f50",cy:"#ff0"},sandcastle:{b:"rgb(184,139,74)",w:"rgb(227,193,111)",cb:"#04f",cg:"#0c3",cr:"#d02",cy:"#ff0"},wheat:{b:"rgb(187,190,100)",w:"rgb(234,240,206)",cb:"#04f",cg:"#0c3",cr:"#d00",cy:"#ff3"}};class dt extends e.Component{constructor(){super(...arguments),this.innerRef=e.createRef(),this.mouseDownListener=e=>this.handleMouseDown(e),this.mouseMoveListener=e=>this.handleMouseMove(e),this.mouseUpListener=e=>this.handleMouseUp(e),this.touchStartListener=e=>this.handleTouchStart(e),this.touchMoveListener=e=>this.handleTouchMove(e),this.touchEndListener=e=>this.handleTouchEnd(e),this.touchCancelListener=e=>this.handleTouchCancel(e)}componentDidMount(){this.innerRef.current.addEventListener("mousedown",this.mouseDownListener),window.addEventListener("mousemove",this.mouseMoveListener),window.addEventListener("mouseup",this.mouseUpListener),this.innerRef.current.addEventListener("touchstart",this.touchStartListener,{passive:!1}),window.addEventListener("touchmove",this.touchMoveListener,{passive:!1}),window.addEventListener("touchend",this.touchEndListener),window.addEventListener("touchcancel",this.touchCancelListener)}componentWillUnmount(){this.innerRef.current.removeEventListener("mousedown",this.mouseDownListener),window.removeEventListener("mousemove",this.mouseMoveListener),window.removeEventListener("mouseup",this.mouseUpListener),this.innerRef.current.removeEventListener("touchstart",this.touchStartListener),window.removeEventListener("touchmove",this.touchMoveListener),window.removeEventListener("touchend",this.touchEndListener),window.removeEventListener("touchcancel",this.touchCancelListener)}render(){const t=["kokopu-handle",this.props.isArrowHandle?"kokopu-arrowDraggable":"kokopu-pieceDraggable"];return e.createElement("rect",{ref:this.innerRef,className:t.join(" "),x:this.props.x,y:this.props.y,width:this.props.width,height:this.props.height})}handleTouchStart(e){this.dragData||1!==e.touches.length||(e.preventDefault(),this.doInitDrag(e.target,e.touches[0]))}handleTouchMove(e){this.dragData&&(e.preventDefault(),1===e.touches.length?this.doUpdateDrag(e.touches[0]):this.doCancelDrag())}handleTouchEnd(e){this.dragData&&(e.preventDefault(),0===e.touches.length&&1===e.changedTouches.length?this.doEndDrag(e.changedTouches[0]):this.doCancelDrag())}handleTouchCancel(e){this.dragData&&(e.preventDefault(),this.doCancelDrag())}handleMouseDown(e){this.dragData||0!==e.button||(e.preventDefault(),this.doInitDrag(e.target,e))}handleMouseMove(e){this.dragData&&(e.preventDefault(),this.doUpdateDrag(e))}handleMouseUp(e){this.dragData&&(e.preventDefault(),this.doEndDrag(e))}doInitDrag(e,{pageX:t,pageY:i,clientX:r,clientY:n}){this.dragData={originX:t,originY:i};const o=e.getBoundingClientRect(),s=r-o.left,a=n-o.top;this.props.onDragStart&&this.props.onDragStart(s,a)}doUpdateDrag({pageX:e,pageY:t}){const{originX:i,originY:r}=this.dragData;this.props.onDrag&&this.props.onDrag(e-i,t-r)}doEndDrag({pageX:e,pageY:t}){const{originX:i,originY:r}=this.dragData;this.dragData=void 0,this.props.onDragStop&&this.props.onDragStop(e-i,t-r)}doCancelDrag(){this.props.onDragCanceled&&this.props.onDragCanceled()}}class ht extends e.Component{constructor(e){super(e),this.state={cursor:0},this.cursorStop=1;const t=window.__kokopu_debug_freeze_motion;"number"==typeof t&&t>=0&&t<=1&&(this.cursorStop=t)}componentDidMount(){this.animationFrameId=window.requestAnimationFrame((e=>this.handleAnimationStep(e)))}componentWillUnmount(){void 0!==this.animationFrameId&&(window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}handleAnimationStep(e){void 0===this.initialTimestamp&&(this.initialTimestamp=e);let t=(e-this.initialTimestamp)/this.props.duration;t<0?t=0:t>this.cursorStop&&(t=this.cursorStop),this.setState({cursor:t}),t===this.cursorStop?this.animationFrameId=void 0:this.animationFrameId=window.requestAnimationFrame((e=>this.handleAnimationStep(e)))}render(){return this.props.children(this.state.cursor)}}const pt=.15,ft=.3;class gt extends e.Component{constructor(e){super(e),this.arrowTipIdSuffix=N(),this.state={}}render(){let t=0;const i=[];(0,o.WD)((e=>i.push(this.renderSquare(e))));const r=[],n=[];if(this.props.coordinateVisible){t=mt(this.props.squareSize);for(let e=0;e<8;++e)r.push(this.renderRankCoordinate(t,e)),n.push(this.renderFileCoordinate(t,e))}const s=Math.round(-1*t),a=this.props.turnVisible?9*this.props.squareSize+Math.round(.1*this.props.squareSize):8*this.props.squareSize,l=8*this.props.squareSize+Math.round(1.4*t),c=`${s} 0 ${a-s} ${l-0}`;return e.createElement("svg",{className:"kokopu-chessboard",viewBox:c,width:a-s,height:l-0},e.createElement("defs",null,this.renderArrowTip("b"),this.renderArrowTip("g"),this.renderArrowTip("r"),this.renderArrowTip("y")),i,r,n,this.renderBoardContent())}renderBoardContent(){return this.props.move&&this.props.animated?e.createElement(ht,{duration:150},(e=>1===e?this.renderBoardContentStill():this.renderBoardContentAnimated(e))):this.renderBoardContentStill()}renderBoardContentAnimated(t){const i=[];return(0,o.WD)((e=>i.push(this.renderPieceAnimated(t,e)))),e.createElement(e.Fragment,null,i,this.renderMoveArrow(t),this.renderTurnFlag((0,o.VD)(this.props.position.turn())))}renderBoardContentStill(){const t=this.getPositionStill(),i=[],r=[];return(0,o.WD)((e=>{i.push(this.renderPiece(t,e)),this.props.interactionMode&&r.push(this.renderSquareHandle(t,e))})),e.createElement(e.Fragment,null,this.renderSquareMarkers(),this.renderHoveredSquare(),i,this.renderTextMarkers(),this.renderArrowMarkers(),this.renderMoveArrow(1),r,this.renderPromotionDrawer(t),this.renderDraggedPiece(t),this.renderDraggedArrow(),this.renderTurnFlag(t.turn()))}renderSquare(t){const{x:i,y:r}=this.getSquareCoordinates(t);return e.createElement("rect",{key:t,x:i,y:r,width:this.props.squareSize,height:this.props.squareSize,fill:this.props.colorset[(0,o.TL)(t)]})}renderHoveredSquare(){if(!this.state.hoveredSquare)return;const{x:t,y:i}=this.getSquareCoordinates(this.state.hoveredSquare),r=Math.max(2,Math.round(.1*this.props.squareSize)),n=this.props.squareSize-r,o=this.getColorForAnnotation("editArrows"===this.props.interactionMode?this.props.editedArrowColor:this.props.moveArrowColor);return e.createElement("rect",{className:"kokopu-hoveredSquare",x:t+r/2,y:i+r/2,width:n,height:n,stroke:o,strokeWidth:r})}renderPiece(t,i){const r=t.square(i);if("-"===r||this.state.inhibitedSquare===i)return;const{x:n,y:o}=this.getSquareCoordinates(i);return e.createElement("image",{key:"piece-"+i,x:n,y:o,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[r]})}renderPieceAnimated(t,i){const r=this.props.move;let n=this.props.position.square(i);if("-"===n||r.to()===i||r.isEnPassant()&&r.enPassantSquare()===i)return;let{x:o,y:s}=this.getSquareCoordinates(i);if(i===r.from()){const{x:e,y:i}=this.getSquareCoordinates(r.to());o=e*t+o*(1-t),s=i*t+s*(1-t),r.isPromotion()&&t>.8&&(n=r.coloredPromotion())}else if(r.isCastling()&&i===r.rookFrom()){const{x:e,y:i}=this.getSquareCoordinates(r.rookTo());o=e*t+o*(1-t),s=i*t+s*(1-t)}return e.createElement("image",{key:"piece-"+i,x:o,y:s,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[n]})}renderDraggedPiece(t){if("movePieces"!==this.props.interactionMode&&"playMoves"!==this.props.interactionMode||!this.state.draggedSquare)return;const i=t.square(this.state.draggedSquare);let{x:r,y:n}=this.getSquareCoordinates(this.state.draggedSquare);return r=Math.min(Math.max(r+this.state.dragPosition.x,0),7*this.props.squareSize),n=Math.min(Math.max(n+this.state.dragPosition.y,0),7*this.props.squareSize),e.createElement("image",{className:"kokopu-pieceDraggable kokopu-dragging",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[i]})}renderDraggedArrow(){if("editArrows"!==this.props.interactionMode||!this.state.draggedSquare)return;const{x:t,y:i}=this.getSquareCoordinates(this.state.draggedSquare),r=t+this.props.squareSize/2,n=i+this.props.squareSize/2,o=Math.min(Math.max(t+this.state.dragPosition.x+this.state.cursorOffset.x,this.props.squareSize/2),15*this.props.squareSize/2),s=Math.min(Math.max(i+this.state.dragPosition.y+this.state.cursorOffset.y,this.props.squareSize/2),15*this.props.squareSize/2);if(r===o&&n===s)return;const a=this.props.squareSize*pt,l=this.props.editedArrowColor;return e.createElement("line",{className:"kokopu-annotation kokopu-arrow kokopu-arrowDraggable kokopu-dragging",x1:r,y1:n,x2:o,y2:s,strokeWidth:a,stroke:this.getColorForAnnotation(l),markerEnd:`url(#${this.getArrowTipId(l)})`})}renderPromotionDrawer(t){if(!this.state.promotionDrawer)return;const{x:i,y:r}=this.getSquareCoordinates(this.state.promotionDrawer.origin),n=t.turn()===(this.props.flipped?"w":"b"),o=n?r-this.props.squareSize*(this.state.promotionDrawer.buttons.length-1):r,s=this.state.promotionDrawer.buttons.map(((o,s)=>{const a=t.turn()+o;return e.createElement("image",{key:"drawer-piece-"+o,className:"kokopu-clickable",x:i,y:r+s*(n?-this.props.squareSize:this.props.squareSize),width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[a],onClick:()=>this.handleDrawerButtonClicked(o)})}));return e.createElement(e.Fragment,null,e.createElement("rect",{className:"kokopu-handle",x:0,y:0,width:8*this.props.squareSize,height:8*this.props.squareSize,onClick:()=>this.handleDrawerCancelButtonClicked()}),e.createElement("rect",{x:i,y:o,width:this.props.squareSize,height:this.props.squareSize*this.state.promotionDrawer.buttons.length,fill:this.props.colorset.b}),e.createElement("rect",{className:"kokopu-drawerMask",x:i,y:o,width:this.props.squareSize,height:this.props.squareSize*this.state.promotionDrawer.buttons.length,fill:this.props.colorset.w}),s)}renderSquareHandle(t,i){const{x:r,y:n}=this.getSquareCoordinates(i),o="movePieces"===this.props.interactionMode&&"-"!==t.square(i),s="editArrows"===this.props.interactionMode,a="playMoves"===this.props.interactionMode&&!this.state.promotionDrawer&&t.isLegal()&&t.square(i).startsWith(t.turn());return o||s||a?e.createElement(dt,{key:"handle-"+i,x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,isArrowHandle:s,onDragStart:(e,t)=>this.handleDragStart(i,e,t),onDrag:(e,t)=>this.handleDrag(i,e,t),onDragStop:(e,t)=>this.handleDragStop(i,e,t),onDragCanceled:()=>this.handleDragCanceled()}):"clickSquares"===this.props.interactionMode?e.createElement("rect",{key:"handle-"+i,className:"kokopu-handle kokopu-clickable",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,onClick:()=>this.handleSquareClicked(i)}):void 0}renderSquareMarkers(){if(this.props.squareMarkers)return Object.entries(this.props.squareMarkers).map((([t,i])=>{const{x:r,y:n}=this.getSquareCoordinates(t);return e.createElement("rect",{key:"sqm-"+t,className:"kokopu-annotation",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,fill:this.getColorForAnnotation(i)})}))}renderTextMarkers(){if(this.props.textMarkers)return Object.entries(this.props.textMarkers).map((([t,i])=>{let{x:r,y:n}=this.getSquareCoordinates(t);return r+=this.props.squareSize/2,n+=this.props.squareSize/2,e.createElement("g",{key:"txtm-"+t,className:"kokopu-annotation"},e.createElement(x,{x:r,y:n,size:this.props.squareSize,symbol:i.symbol,color:this.getColorForAnnotation(i.color)}))}))}renderArrowMarkers(){if(!this.props.arrowMarkers)return;const t=this.props.squareSize*pt;return Object.entries(this.props.arrowMarkers).map((([i,r])=>{const n=i.substring(0,2),o=i.substring(2,4);if(n===o)return;let{x:s,y:a}=this.getSquareCoordinates(n),{x:l,y:c}=this.getSquareCoordinates(o);return s+=this.props.squareSize/2,a+=this.props.squareSize/2,l+=this.props.squareSize/2,c+=this.props.squareSize/2,l+=Math.sign(s-l)*ft*this.props.squareSize,c+=Math.sign(a-c)*ft*this.props.squareSize,e.createElement("line",{key:"arm-"+i,className:"kokopu-annotation kokopu-arrow",x1:s,y1:a,x2:l,y2:c,strokeWidth:t,stroke:this.getColorForAnnotation(r),markerEnd:`url(#${this.getArrowTipId(r)})`})}))}renderMoveArrow(t){if(!this.props.move||t<.1||!this.props.moveArrowVisible||this.props.move.from()===this.props.move.to())return;const i=this.props.squareSize*pt;let{x:r,y:n}=this.getSquareCoordinates(this.props.move.from());r+=this.props.squareSize/2,n+=this.props.squareSize/2;let{x:o,y:s}=this.getSquareCoordinates(this.props.move.to());o+=this.props.squareSize/2,s+=this.props.squareSize/2,o+=Math.sign(r-o)*ft*this.props.squareSize,s+=Math.sign(n-s)*ft*this.props.squareSize;const a=o*t+r*(1-t),l=s*t+n*(1-t);return e.createElement("line",{className:"kokopu-annotation kokopu-arrow",x1:r,y1:n,x2:a,y2:l,strokeWidth:i,stroke:this.getColorForAnnotation(this.props.moveArrowColor),markerEnd:`url(#${this.getArrowTipId(this.props.moveArrowColor)})`})}renderArrowTip(t){return e.createElement(L,{id:this.getArrowTipId(t),color:this.getColorForAnnotation(t)})}renderTurnFlag(t){if(!this.props.turnVisible)return;const i=8*this.props.squareSize+Math.round(.1*this.props.squareSize),r=t===(this.props.flipped?"b":"w")?7*this.props.squareSize:0;return e.createElement("image",{key:"turn-"+t,x:i,y:r,width:this.props.squareSize,height:this.props.squareSize,href:this.getURLForTurnFlag(t)})}renderRankCoordinate(t,i){const r=Math.round(-1*t)/2,n=(this.props.flipped?i+.5:7.5-i)*this.props.squareSize,o="12345678"[i];return e.createElement("text",{key:"rank-"+o,className:"kokopu-coordinate",x:r,y:n,fontSize:t},o)}renderFileCoordinate(t,i){const r=(this.props.flipped?7.5-i:.5+i)*this.props.squareSize,n=8*this.props.squareSize+Math.round(1.4*t)/2,o="abcdefgh"[i];return e.createElement("text",{key:"file-"+o,className:"kokopu-coordinate",x:r,y:n,fontSize:t},o)}handleDragStart(e,t,i){this.setState({inhibitedSquare:"movePieces"===this.props.interactionMode||"playMoves"===this.props.interactionMode?e:void 0,draggedSquare:e,hoveredSquare:e,cursorOffset:{x:t,y:i},dragPosition:{x:0,y:0}})}handleDrag(e,t,i){const{x:r,y:n}=this.getSquareCoordinates(e),o=this.getSquareAt(r+t+this.state.cursorOffset.x,n+i+this.state.cursorOffset.y);this.setState({hoveredSquare:o,dragPosition:{x:t,y:i}})}handleDragStop(e,t,i){const{x:r,y:n}=this.getSquareCoordinates(e),o=this.getSquareAt(r+t+this.state.cursorOffset.x,n+i+this.state.cursorOffset.y);if(this.setState({inhibitedSquare:void 0,draggedSquare:void 0,hoveredSquare:void 0}),e!==o&&o)if("movePieces"===this.props.interactionMode&&this.props.onPieceMoved)this.props.onPieceMoved(e,o);else if("editArrows"===this.props.interactionMode&&this.props.onArrowEdited)this.props.onArrowEdited(e,o);else if("playMoves"===this.props.interactionMode){const t=this.getPositionStill(),i=t.isMoveLegal(e,o);if(!i)return;switch(i.status){case"regular":this.props.onMovePlayed&&this.props.onMovePlayed(t.notation(i()));break;case"promotion":this.setState({inhibitedSquare:e,promotionDrawer:{origin:o,buttons:"antichess"===t.variant()?["q","r","b","n","k"]:["q","r","b","n"],builder:e=>t.notation(i(e))}})}}}handleDragCanceled(){this.setState({inhibitedSquare:void 0,draggedSquare:void 0,hoveredSquare:void 0})}handleDrawerCancelButtonClicked(){this.setState({inhibitedSquare:void 0,promotionDrawer:void 0})}handleDrawerButtonClicked(e){const t=this.state.promotionDrawer.builder;this.setState({inhibitedSquare:void 0,promotionDrawer:void 0}),this.props.onMovePlayed&&this.props.onMovePlayed(t(e))}handleSquareClicked(e){this.props.onSquareClicked&&this.props.onSquareClicked(e)}getPositionStill(){if(!this.props.move)return this.props.position;const e=new o.yX(this.props.position);return e.play(this.props.move),e}getSquareCoordinates(e){const{file:t,rank:i}=(0,o.cc)(e);return{x:this.props.flipped?(7-t)*this.props.squareSize:t*this.props.squareSize,y:this.props.flipped?i*this.props.squareSize:(7-i)*this.props.squareSize}}getSquareAt(e,t){const i=this.props.flipped?7-Math.floor(e/this.props.squareSize):Math.floor(e/this.props.squareSize),r=this.props.flipped?Math.floor(t/this.props.squareSize):7-Math.floor(t/this.props.squareSize);return i>=0&&i<8&&r>=0&&r<8?(0,o.i9)(i,r):void 0}getArrowTipId(e){return`kokopu-arrowTip-${e}-${this.arrowTipIdSuffix}`}getColorForAnnotation(e){return this.props.colorset["c"+e]}getURLForTurnFlag(e){return this.props.pieceset[e+"x"]}}function mt(e){return e<=32?8:8+.2*(e-32)}function bt(i,r,n){if(i instanceof o.Zt)return{error:!1,game:i};if(!(i instanceof o.Wm||"string"==typeof i))throw new s(n,"game");if(!Number.isInteger(r)||r<0)throw new s(n,"gameIndex");try{return{error:!1,game:i instanceof o.Wm?i.game(r):(0,o.oG)(i,r)}}catch(i){if(i instanceof o.exception.InvalidPGN)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_PGN_ERROR_TITLE,message:i.message,text:i.pgn,errorIndex:i.index,lineNumber:i.lineNumber})};throw i}}class vt extends e.Component{constructor(e){super(e),this.windowResizeListener=()=>this.handleWindowResize(),this.state={windowWidth:window.innerWidth}}componentDidMount(){window.addEventListener("resize",this.windowResizeListener)}componentWillUnmount(){window.removeEventListener("resize",this.windowResizeListener)}handleWindowResize(){this.setState({windowWidth:window.innerWidth})}render(){const i=function(i,r){if(i instanceof o.yX)return{error:!1,position:i};if("start"===i||"empty"===i)return{error:!1,position:new o.yX(i)};if("string"!=typeof i)throw new s(r,"position");try{const{variant:e,fen:t}=function(e){const t=e.indexOf(":");if(t<0)return{variant:"regular",fen:e};const i=e.substring(0,t);return(0,o.kf)(i)?{variant:i,fen:e.substring(t+1)}:{variant:"regular",fen:e}}(i),r=new o.yX(e,"empty");return r.fen(t),{error:!1,position:r}}catch(i){if(i instanceof o.exception.InvalidFEN)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_FEN_ERROR_TITLE,message:i.message})};throw i}}(this.props.position,"Chessboard");if(i.error)return i.errorBox;let r=i.position;const n=function(i,r){if(null==r)return{error:!1,type:"none"};if(r instanceof o.PP)return{error:!1,type:"regular",move:r};if("string"!=typeof r)throw new s("Chessboard","move");if("--"===r)return i.isNullMoveLegal()?{error:!1,type:"null-move"}:{error:!0,errorBox:e.createElement(C,{title:t.INVALID_NOTATION_ERROR_TITLE,message:o.Ru.ILLEGAL_NULL_MOVE})};try{return{error:!1,type:"regular",move:i.notation(r)}}catch(i){if(i instanceof o.exception.InvalidNotation)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_NOTATION_ERROR_TITLE,message:i.message})};throw i}}(r,this.props.move);if(n.error)return n.errorBox;const c="regular"===n.type?n.move:void 0;"null-move"===n.type&&(r=new o.yX(r),r.playNullMove());const f=Et(this.props.squareMarkers,"squareMarkers",d,o.Sz,u),g=Et(this.props.textMarkers,"textMarkers",h,o.Sz,yt),b=Et(this.props.arrowMarkers,"arrowMarkers",p,o.qz,u),v=m(this.props.flipped),I=_(this.props.squareSize,a,l,(()=>new s("Chessboard","squareSize"))),N=m(this.props.coordinateVisible),w=m(this.props.turnVisible),S=m(this.props.moveArrowVisible);if(!u(this.props.moveArrowColor))throw new s("Chessboard","moveArrowColor");const E=m(this.props.animated),y=ut[this.props.colorset];if(!y)throw new s("Chessboard","colorset");const A=ct[this.props.pieceset];if(!A)throw new s("Chessboard","pieceset");const T=Ct(this.props.smallScreenLimits,(()=>new s("Chessboard","smallScreenLimits"))),P=It(I,T,this.state.windowWidth),k=Nt(N,T,this.state.windowWidth),x=wt(w,T,this.state.windowWidth),O={squareSize:P,coordinateVisible:k,turnVisible:x},L=this.getInteractionModeAndValidateEditedArrowColor(),{onPieceMoved:D,onSquareClicked:R,onArrowEdited:M,onMovePlayed:q}=this.props,V=`${r.variant()}|${r.fen()}|${c?r.notation(c):""}`;return e.createElement(e.Fragment,null,this.props.topComponent?this.props.topComponent(O):void 0,e.createElement(gt,{key:V,position:r,move:c,squareMarkers:f,textMarkers:g,arrowMarkers:b,flipped:v,squareSize:P,coordinateVisible:k,turnVisible:x,moveArrowVisible:S,moveArrowColor:this.props.moveArrowColor,animated:E,colorset:y,pieceset:A,interactionMode:L,editedArrowColor:this.props.editedArrowColor,onPieceMoved:D,onSquareClicked:R,onArrowEdited:M,onMovePlayed:q}),this.props.bottomComponent?this.props.bottomComponent(O):void 0)}getInteractionModeAndValidateEditedArrowColor(){const e=I(this.props.interactionMode,g);if(void 0===e||"movePieces"===e||"clickSquares"===e||"playMoves"===e)return e;if("editArrows"===e){if(!u(this.props.editedArrowColor))throw new s("Chessboard","editedArrowColor");return e}throw new s("Chessboard","interactionMode")}static size(e){const{squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,topComponent:o,bottomComponent:c}=b(e,(()=>new s("Chessboard.size()","attr")));let u=void 0===t?40:_(t,a,l,(()=>new s("Chessboard.size()","squareSize"))),d=void 0===i||m(i),h=void 0===r||m(r);const p=Ct(n,(()=>new s("Chessboard.size()","smallScreenLimits")));return"undefined"!=typeof window&&(u=It(u,p,window.innerWidth),d=Nt(d,p,window.innerWidth),h=wt(h,p,window.innerWidth)),_t(u,d,h,o,c)}static adaptSquareSize(e,t,i){const{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,topComponent:c,bottomComponent:u}=b(i,(()=>new s("Chessboard.adaptSquareSize()","attr")));e=v(e,(()=>new s("Chessboard.adaptSquareSize()","width"))),t=v(t,(()=>new s("Chessboard.adaptSquareSize()","height")));let d=void 0===r||m(r),h=void 0===n||m(n);const p=Ct(o,(()=>new s("Chessboard.adaptSquareSize()","smallScreenLimits")));let f=l;function g(i){const{width:r,height:n}=_t(i,d,h,c,u);return r<=e&&n<=t}if("undefined"!=typeof window&&(f=It(f,p,window.innerWidth),d=Nt(d,p,window.innerWidth),h=wt(h,p,window.innerWidth)),g(f))return f;if(!g(a))return a;let _=a,I=f;for(;_+1<I;){const e=Math.floor((_+I)/2);g(e)?_=e:I=e}return _}static minSquareSize(){return a}static maxSquareSize(){return l}static colorsets(){return ut}static piecesets(){return ct}}function _t(e,t,i,r,n){let{width:o,height:s}=function(e,t,i){let r=8*e,n=8*e;if(i&&(r+=e+Math.round(.1*e)),t){const t=mt(e);r+=Math.round(1*t),n+=Math.round(1.4*t)}return{width:r,height:n}}(e,t,i);const a={squareSize:e,coordinateVisible:t,turnVisible:i};if(r){const{width:e,height:t}=r(a);o=Math.max(o,e),s+=t}if(n){const{width:e,height:t}=n(a);o=Math.max(o,e),s+=t}return{width:o,height:s}}function It(e,t,i){const r=St(t,i,(e=>e.squareSize));return void 0===r?e:Math.min(e,r)}function Nt(e,t,i){const r=St(t,i,(e=>e.coordinateVisible));return void 0===r?e:e&&r}function wt(e,t,i){const r=St(t,i,(e=>e.turnVisible));return void 0===r?e:e&&r}function St(e,t,i){let r,n=1/0;for(const o of e)t>o.width||void 0===i(o)||o.width<n&&(n=o.width,r=i(o));return r}function Et(e,t,i,r,n){if(null!=e){if("string"==typeof e)return i(e);if("object"==typeof e){const t={};return Object.entries(e).forEach((([e,i])=>{r(e)&&n(i)&&(t[e]=i)})),t}throw new s("Chessboard",t)}}function yt(e){return"object"==typeof e&&null!==e&&c(e.symbol)&&u(e.color)}function Ct(e,t){if(null==e)return[];if(Array.isArray(e))return e.map((e=>{if("object"!=typeof e||null===e)throw t();return{width:v(e.width,t),squareSize:I(e.squareSize,(e=>_(e,a,l,t))),coordinateVisible:I(e.coordinateVisible,m),turnVisible:I(e.turnVisible,m)}}));throw t()}function At(i){if("native"===i)return e=>e;if("localized"===i){const e=t.PIECE_SYMBOLS;return t=>Tt(e,t)}if("figurines"===i)return t=>function(t,i){const r=[];let n=0,o=0;for(let t=0;t<i.length;++t){const s=i.charAt(t);if("K"===s||"Q"===s||"R"===s||"B"===s||"N"===s||"P"===s){t>n&&r.push(i.substring(n,t)),n=t+1;const a="symbol-"+o++;r.push(e.createElement("span",{className:"kokopu-font-alpha",key:a},s))}}return n<i.length&&r.push(i.substring(n)),e.createElement(e.Fragment,null,r)}(0,t);if("object"==typeof(r=i)&&null!==r&&"string"==typeof r.K&&"string"==typeof r.Q&&"string"==typeof r.R&&"string"==typeof r.B&&"string"==typeof r.N&&"string"==typeof r.P)return e=>Tt(i,e);throw new s("moveFormatter","pieceSymbols");var r}function Tt(e,t){return t.replace(/[KQRBNP]/g,(t=>e[t]))}vt.defaultProps={squareSize:40,coordinateVisible:!0,turnVisible:!0,colorset:"original",pieceset:"cburnett",moveArrowVisible:!0,moveArrowColor:"b",animated:!1,position:"start",flipped:!1};class Pt extends e.Component{constructor(){super(...arguments),this.focusFieldRef=e.createRef()}render(){return e.createElement("div",{className:"kokopu-focusFieldContainer"},e.createElement("a",{className:"kokopu-focusField",href:"#",ref:this.focusFieldRef,onKeyDown:e=>this.handleKeyDown(e)}))}handleKeyDown(e){kt(e,"Home",this.props.onFirstPressed)||kt(e,"ArrowLeft",this.props.onPreviousPressed)||kt(e,"ArrowRight",this.props.onNextPressed)||kt(e,"End",this.props.onLastPressed)||kt(e,"Escape",this.props.onExitPressed)}focus(){const e=this.focusFieldRef.current;e&&e.focus()}}function kt(e,t,i){return e.key===t&&(i&&(e.preventDefault(),i()),!0)}function xt(e,t){if(e.findById(t))return"start"===t?void 0:"start"}function Ot(e,t){let i=e.findById(t);if(i&&(!(i instanceof o.mD)||(i=i.parentNode(),i))){for(;i;){const e=i.previous();if(e)return e.id();i=i.parentVariation().parentNode()}return"start"}}function Lt(e,t){const i=e.findById(t);if(!i)return;const r=i instanceof o.mD?i.first():i.next();return r?r.id():void 0}function Dt(e,t){let i=e.findById(t);if(!i)return;if(i=i instanceof o.mD?i.first():i.next(),!i)return;let r=i;for(;;){const e=r.next();if(!e)return r.id();r=e}}const Rt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e=>e.charCodeAt(0)))),Mt=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e=>e.charCodeAt(0))));var qt;const Vt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Bt=null!==(qt=String.fromCodePoint)&&void 0!==qt?qt:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var Ft,Gt,Ut,jt,zt,$t,Ht,Wt;function Kt(e){return e>=Ft.ZERO&&e<=Ft.NINE}!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(Ft||(Ft={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(Gt||(Gt={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(Ut||(Ut={})),(zt=jt||(jt={}))[zt.Legacy=0]="Legacy",zt[zt.Strict=1]="Strict",zt[zt.Attribute=2]="Attribute";class Jt{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=Ut.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jt.Strict}startEntity(e){this.decodeMode=e,this.state=Ut.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ut.EntityStart:return e.charCodeAt(t)===Ft.NUM?(this.state=Ut.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ut.NamedEntity,this.stateNamedEntity(e,t));case Ut.NumericStart:return this.stateNumericStart(e,t);case Ut.NumericDecimal:return this.stateNumericDecimal(e,t);case Ut.NumericHex:return this.stateNumericHex(e,t);case Ut.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===Ft.LOWER_X?(this.state=Ut.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ut.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,r){if(t!==i){const n=i-t;this.result=this.result*Math.pow(r,n)+parseInt(e.substr(t,n),r),this.consumed+=n}}stateNumericHex(e,t){const i=t;for(;t<e.length;){const n=e.charCodeAt(t);if(!(Kt(n)||(r=n,r>=Ft.UPPER_A&&r<=Ft.UPPER_F||r>=Ft.LOWER_A&&r<=Ft.LOWER_F)))return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(n,3);t+=1}var r;return this.addToNumericResult(e,i,t,16),-1}stateNumericDecimal(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Kt(r))return this.addToNumericResult(e,i,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,i,t,10),-1}emitNumericEntity(e,t){var i;if(this.consumed<=t)return null===(i=this.errors)||void 0===i||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ft.SEMI)this.consumed+=1;else if(this.decodeMode===jt.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=Vt.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==Ft.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let r=i[this.treeIndex],n=(r&Gt.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=Qt(i,r,this.treeIndex+Math.max(1,n),s),this.treeIndex<0)return 0===this.result||this.decodeMode===jt.Attribute&&(0===n||((o=s)===Ft.EQUALS||function(e){return e>=Ft.UPPER_A&&e<=Ft.UPPER_Z||e>=Ft.LOWER_A&&e<=Ft.LOWER_Z||Kt(e)}(o)))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],n=(r&Gt.VALUE_LENGTH)>>14,0!==n){if(s===Ft.SEMI)return this.emitNamedEntityData(this.treeIndex,n,this.consumed+this.excess);this.decodeMode!==jt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var o;return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,r=(i[t]&Gt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~Gt.VALUE_LENGTH:r[e+1],i),3===t&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Ut.NamedEntity:return 0===this.result||this.decodeMode===jt.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Ut.NumericDecimal:return this.emitNumericEntity(0,2);case Ut.NumericHex:return this.emitNumericEntity(0,3);case Ut.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ut.EntityStart:return 0}}}function Yt(e){let t="";const i=new Jt(e,(e=>t+=Bt(e)));return function(e,r){let n=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(n,o),i.startEntity(r);const s=i.write(e,o+1);if(s<0){n=o+i.end();break}n=o+s,o=0===s?n+1:n}const s=t+e.slice(n);return t="",s}}function Qt(e,t,i,r){const n=(t&Gt.BRANCH_LENGTH)>>7,o=t&Gt.JUMP_TABLE;if(0===n)return 0!==o&&r===o?i:-1;if(o){const t=r-o;return t<0||t>=n?-1:e[i+t]-1}let s=i,a=s+n-1;for(;s<=a;){const t=s+a>>>1,i=e[t];if(i<r)s=t+1;else{if(!(i>r))return e[t+n];a=t-1}}return-1}function Xt(e){return e===$t.Space||e===$t.NewLine||e===$t.Tab||e===$t.FormFeed||e===$t.CarriageReturn}function Zt(e){return e===$t.Slash||e===$t.Gt||Xt(e)}Yt(Rt),Yt(Mt),function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}($t||($t={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"}(Ht||(Ht={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(Wt||(Wt={}));const ei={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class ti{constructor({xmlMode:e=!1,decodeEntities:t=!0},i){this.cbs=i,this.state=Ht.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=Ht.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=t,this.entityDecoder=new Jt(e?Mt:Rt,((e,t)=>this.emitCodePoint(e,t)))}reset(){this.state=Ht.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=Ht.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===$t.Lt||!this.decodeEntities&&this.fastForwardTo($t.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=Ht.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?Zt(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=Ht.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===$t.Gt||Xt(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart<t){const e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}return this.isSpecial=!1,this.sectionStart=t+2,void this.stateInClosingTagName(e)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===ei.TitleEnd?this.decodeEntities&&e===$t.Amp&&this.startEntity():this.fastForwardTo($t.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===$t.Lt)}stateCDATASequence(e){e===ei.Cdata[this.sequenceIndex]?++this.sequenceIndex===ei.Cdata.length&&(this.state=Ht.InCommentLike,this.currentSequence=ei.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=Ht.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ei.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=Ht.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Zt(e):function(e){return e>=$t.LowerA&&e<=$t.LowerZ||e>=$t.UpperA&&e<=$t.UpperZ}(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=Ht.SpecialStartSequence}stateBeforeTagName(e){if(e===$t.ExclamationMark)this.state=Ht.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===$t.Questionmark)this.state=Ht.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const t=32|e;this.sectionStart=this.index,this.xmlMode?this.state=Ht.InTagName:t===ei.ScriptEnd[2]?this.state=Ht.BeforeSpecialS:t===ei.TitleEnd[2]?this.state=Ht.BeforeSpecialT:this.state=Ht.InTagName}else e===$t.Slash?this.state=Ht.BeforeClosingTagName:(this.state=Ht.Text,this.stateText(e))}stateInTagName(e){Zt(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Xt(e)||(e===$t.Gt?this.state=Ht.Text:(this.state=this.isTagStartChar(e)?Ht.InClosingTagName:Ht.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===$t.Gt||Xt(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=Ht.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===$t.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=Ht.InSpecialTag,this.sequenceIndex=0):this.state=Ht.Text,this.sectionStart=this.index+1):e===$t.Slash?this.state=Ht.InSelfClosingTag:Xt(e)||(this.state=Ht.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===$t.Gt?(this.cbs.onselfclosingtag(this.index),this.state=Ht.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Xt(e)||(this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===$t.Eq||Zt(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=Ht.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===$t.Eq?this.state=Ht.BeforeAttributeValue:e===$t.Slash||e===$t.Gt?(this.cbs.onattribend(Wt.NoValue,this.sectionStart),this.sectionStart=-1,this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e)):Xt(e)||(this.cbs.onattribend(Wt.NoValue,this.sectionStart),this.state=Ht.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===$t.DoubleQuote?(this.state=Ht.InAttributeValueDq,this.sectionStart=this.index+1):e===$t.SingleQuote?(this.state=Ht.InAttributeValueSq,this.sectionStart=this.index+1):Xt(e)||(this.sectionStart=this.index,this.state=Ht.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===$t.DoubleQuote?Wt.Double:Wt.Single,this.index+1),this.state=Ht.BeforeAttributeName):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,$t.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,$t.SingleQuote)}stateInAttributeValueNoQuotes(e){Xt(e)||e===$t.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Wt.Unquoted,this.index),this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===$t.OpeningSquareBracket?(this.state=Ht.CDATASequence,this.sequenceIndex=0):this.state=e===$t.Dash?Ht.BeforeComment:Ht.InDeclaration}stateInDeclaration(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=Ht.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===$t.Dash?(this.state=Ht.InCommentLike,this.currentSequence=ei.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=Ht.InDeclaration}stateInSpecialComment(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const t=32|e;t===ei.ScriptEnd[3]?this.startSpecial(ei.ScriptEnd,4):t===ei.StyleEnd[3]?this.startSpecial(ei.StyleEnd,4):(this.state=Ht.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const t=32|e;t===ei.TitleEnd[3]?this.startSpecial(ei.TitleEnd,4):t===ei.TextareaEnd[3]?this.startSpecial(ei.TextareaEnd,4):(this.state=Ht.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=Ht.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?jt.Strict:this.baseState===Ht.Text||this.baseState===Ht.InSpecialTag?jt.Legacy:jt.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,0===e&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===Ht.Text||this.state===Ht.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==Ht.InAttributeValueDq&&this.state!==Ht.InAttributeValueSq&&this.state!==Ht.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case Ht.Text:this.stateText(e);break;case Ht.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case Ht.InSpecialTag:this.stateInSpecialTag(e);break;case Ht.CDATASequence:this.stateCDATASequence(e);break;case Ht.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case Ht.InAttributeName:this.stateInAttributeName(e);break;case Ht.InCommentLike:this.stateInCommentLike(e);break;case Ht.InSpecialComment:this.stateInSpecialComment(e);break;case Ht.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case Ht.InTagName:this.stateInTagName(e);break;case Ht.InClosingTagName:this.stateInClosingTagName(e);break;case Ht.BeforeTagName:this.stateBeforeTagName(e);break;case Ht.AfterAttributeName:this.stateAfterAttributeName(e);break;case Ht.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case Ht.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case Ht.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case Ht.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case Ht.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case Ht.BeforeSpecialT:this.stateBeforeSpecialT(e);break;case Ht.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case Ht.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case Ht.InDeclaration:this.stateInDeclaration(e);break;case Ht.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case Ht.BeforeComment:this.stateBeforeComment(e);break;case Ht.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case Ht.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===Ht.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===Ht.InCommentLike?this.currentSequence===ei.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===Ht.InTagName||this.state===Ht.BeforeAttributeName||this.state===Ht.BeforeAttributeValue||this.state===Ht.AfterAttributeName||this.state===Ht.InAttributeName||this.state===Ht.InAttributeValueSq||this.state===Ht.InAttributeValueDq||this.state===Ht.InAttributeValueNq||this.state===Ht.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==Ht.Text&&this.baseState!==Ht.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const ii=new Set(["input","option","optgroup","select","button","datalist","textarea"]),ri=new Set(["p"]),ni=new Set(["thead","tbody"]),oi=new Set(["dd","dt"]),si=new Set(["rt","rp"]),ai=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",ri],["h1",ri],["h2",ri],["h3",ri],["h4",ri],["h5",ri],["h6",ri],["select",ii],["input",ii],["output",ii],["button",ii],["datalist",ii],["textarea",ii],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",oi],["dt",oi],["address",ri],["article",ri],["aside",ri],["blockquote",ri],["details",ri],["div",ri],["dl",ri],["fieldset",ri],["figcaption",ri],["figure",ri],["footer",ri],["form",ri],["header",ri],["hr",ri],["main",ri],["nav",ri],["ol",ri],["pre",ri],["section",ri],["table",ri],["ul",ri],["rt",si],["rp",si],["tbody",ni],["tfoot",ni]]),li=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ci=new Set(["math","svg"]),ui=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),di=/\s|\//;class hi{constructor(e,t={}){var i,r,n,o,s,a;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=null!==(i=t.lowerCaseTags)&&void 0!==i?i:this.htmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:this.htmlMode,this.recognizeSelfClosing=null!==(n=t.recognizeSelfClosing)&&void 0!==n?n:!this.htmlMode,this.tokenizer=new(null!==(o=t.Tokenizer)&&void 0!==o?o:ti)(this.options,this),this.foreignContext=[!this.htmlMode],null===(a=(s=this.cbs).onparserinit)||void 0===a||a.call(s,this)}ontext(e,t){var i,r;const n=this.getSlice(e,t);this.endIndex=t-1,null===(r=(i=this.cbs).ontext)||void 0===r||r.call(i,n),this.startIndex=t}ontextentity(e,t){var i,r;this.endIndex=t-1,null===(r=(i=this.cbs).ontext)||void 0===r||r.call(i,Bt(e)),this.startIndex=t}isVoidElement(e){return this.htmlMode&&li.has(e)}onopentagname(e,t){this.endIndex=t;let i=this.getSlice(e,t);this.lowerCaseTagNames&&(i=i.toLowerCase()),this.emitOpenTag(i)}emitOpenTag(e){var t,i,r,n;this.openTagStart=this.startIndex,this.tagname=e;const o=this.htmlMode&&ai.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[0]);){const e=this.stack.shift();null===(i=(t=this.cbs).onclosetag)||void 0===i||i.call(t,e,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ci.has(e)?this.foreignContext.unshift(!0):ui.has(e)&&this.foreignContext.unshift(!1))),null===(n=(r=this.cbs).onopentagname)||void 0===n||n.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,i;this.startIndex=this.openTagStart,this.attribs&&(null===(i=(t=this.cbs).onopentag)||void 0===i||i.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var i,r,n,o,s,a,l,c;this.endIndex=t;let u=this.getSlice(e,t);if(this.lowerCaseTagNames&&(u=u.toLowerCase()),this.htmlMode&&(ci.has(u)||ui.has(u))&&this.foreignContext.shift(),this.isVoidElement(u))this.htmlMode&&"br"===u&&(null===(o=(n=this.cbs).onopentagname)||void 0===o||o.call(n,"br"),null===(a=(s=this.cbs).onopentag)||void 0===a||a.call(s,"br",{},!0),null===(c=(l=this.cbs).onclosetag)||void 0===c||c.call(l,"br",!1));else{const e=this.stack.indexOf(u);if(-1!==e)for(let t=0;t<=e;t++){const n=this.stack.shift();null===(r=(i=this.cbs).onclosetag)||void 0===r||r.call(i,n,t!==e)}else this.htmlMode&&"p"===u&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,i;const r=this.tagname;this.endOpenTag(e),this.stack[0]===r&&(null===(i=(t=this.cbs).onclosetag)||void 0===i||i.call(t,r,!e),this.stack.shift())}onattribname(e,t){this.startIndex=e;const i=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?i.toLowerCase():i}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Bt(e)}onattribend(e,t){var i,r;this.endIndex=t,null===(r=(i=this.cbs).onattribute)||void 0===r||r.call(i,this.attribname,this.attribvalue,e===Wt.Double?'"':e===Wt.Single?"'":e===Wt.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const t=e.search(di);let i=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(i=i.toLowerCase()),i}ondeclaration(e,t){this.endIndex=t;const i=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(i);this.cbs.onprocessinginstruction(`!${e}`,`!${i}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;const i=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(i);this.cbs.onprocessinginstruction(`?${e}`,`?${i}`)}this.startIndex=t+1}oncomment(e,t,i){var r,n,o,s;this.endIndex=t,null===(n=(r=this.cbs).oncomment)||void 0===n||n.call(r,this.getSlice(e,t-i)),null===(s=(o=this.cbs).oncommentend)||void 0===s||s.call(o),this.startIndex=t+1}oncdata(e,t,i){var r,n,o,s,a,l,c,u,d,h;this.endIndex=t;const p=this.getSlice(e,t-i);!this.htmlMode||this.options.recognizeCDATA?(null===(n=(r=this.cbs).oncdatastart)||void 0===n||n.call(r),null===(s=(o=this.cbs).ontext)||void 0===s||s.call(o,p),null===(l=(a=this.cbs).oncdataend)||void 0===l||l.call(a)):(null===(u=(c=this.cbs).oncomment)||void 0===u||u.call(c,`[CDATA[${p}]]`),null===(h=(d=this.cbs).oncommentend)||void 0===h||h.call(d)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)}reset(){var e,t,i,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(i=this.cbs).onparserinit)||void 0===r||r.call(i,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let i=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),i+=this.buffers[0].slice(0,t-this.bufferOffset);return i}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,i;this.ended?null===(i=(t=this.cbs).onerror)||void 0===i||i.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))}end(e){var t,i;this.ended?null===(i=(t=this.cbs).onerror)||void 0===i||i.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}var pi,fi;(fi=pi||(pi={})).Root="root",fi.Text="text",fi.Directive="directive",fi.Comment="comment",fi.Script="script",fi.Style="style",fi.Tag="tag",fi.CDATA="cdata",fi.Doctype="doctype",pi.Root,pi.Text,pi.Directive,pi.Comment,pi.Script,pi.Style,pi.Tag,pi.CDATA,pi.Doctype;class gi{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return Ei(this,e)}}class mi extends gi{constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}}class bi extends mi{constructor(){super(...arguments),this.type=pi.Text}get nodeType(){return 3}}class vi extends mi{constructor(){super(...arguments),this.type=pi.Comment}get nodeType(){return 8}}class _i extends mi{constructor(e,t){super(t),this.name=e,this.type=pi.Directive}get nodeType(){return 1}}class Ii extends gi{constructor(e){super(),this.children=e}get firstChild(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class Ni extends Ii{constructor(){super(...arguments),this.type=pi.CDATA}get nodeType(){return 4}}class wi extends Ii{constructor(){super(...arguments),this.type=pi.Root}get nodeType(){return 9}}class Si extends Ii{constructor(e,t,i=[],r=("script"===e?pi.Script:"style"===e?pi.Style:pi.Tag)){super(i),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map((e=>{var t,i;return{name:e,value:this.attribs[e],namespace:null===(t=this["x-attribsNamespace"])||void 0===t?void 0:t[e],prefix:null===(i=this["x-attribsPrefix"])||void 0===i?void 0:i[e]}}))}}function Ei(e,t=!1){let i;if(function(e){return e.type===pi.Text}(e))i=new bi(e.data);else if(function(e){return e.type===pi.Comment}(e))i=new vi(e.data);else if(function(e){return(t=e).type===pi.Tag||t.type===pi.Script||t.type===pi.Style;var t}(e)){const r=t?yi(e.children):[],n=new Si(e.name,{...e.attribs},r);r.forEach((e=>e.parent=n)),null!=e.namespace&&(n.namespace=e.namespace),e["x-attribsNamespace"]&&(n["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(n["x-attribsPrefix"]={...e["x-attribsPrefix"]}),i=n}else if(function(e){return e.type===pi.CDATA}(e)){const r=t?yi(e.children):[],n=new Ni(r);r.forEach((e=>e.parent=n)),i=n}else if(function(e){return e.type===pi.Root}(e)){const r=t?yi(e.children):[],n=new wi(r);r.forEach((e=>e.parent=n)),e["x-mode"]&&(n["x-mode"]=e["x-mode"]),i=n}else{if(!function(e){return e.type===pi.Directive}(e))throw new Error(`Not implemented yet: ${e.type}`);{const t=new _i(e.name,e.data);null!=e["x-name"]&&(t["x-name"]=e["x-name"],t["x-publicId"]=e["x-publicId"],t["x-systemId"]=e["x-systemId"]),i=t}}return i.startIndex=e.startIndex,i.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(i.sourceCodeLocation=e.sourceCodeLocation),i}function yi(e){const t=e.map((e=>Ei(e,!0)));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}const Ci={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class Ai{constructor(e,t,i){this.dom=[],this.root=new wi(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(i=t,t=Ci),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:Ci,this.elementCB=null!=i?i:null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new wi(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){const i=this.options.xmlMode?pi.Tag:void 0,r=new Si(e,t,void 0,i);this.addNode(r),this.tagStack.push(r)}ontext(e){const{lastNode:t}=this;if(t&&t.type===pi.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{const t=new bi(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===pi.Comment)return void(this.lastNode.data+=e);const t=new vi(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){const e=new bi(""),t=new Ni([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){const i=new _i(e,t);this.addNode(i)}handleCallback(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e}addNode(e){const t=this.tagStack[this.tagStack.length-1],i=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),i&&(e.prev=i,i.next=e),e.parent=t,this.lastNode=null}}function Ti(e){for(let t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}new Map(Ti([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(Ti([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(Ti([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(Ti([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));const Pi=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);function ki(e,t){return function(i){let r,n=0,o="";for(;r=e.exec(i);)n!==r.index&&(o+=i.substring(n,r.index)),o+=t.get(r[0].charCodeAt(0)),n=r.index+1;return o+i.substring(n)}}var xi,Oi,Li;String.prototype.codePointAt,ki(/[&<>'"]/g,Pi),ki(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),ki(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(xi||(xi={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(Oi||(Oi={})),new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),new Set(["svg","math"]),function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(Li||(Li={}));var Di,Ri,Mi,qi=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},Vi=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};const Bi=new Set(["br","hr","img"]);function Fi(e){let t=["span","a","b","strong","i","em","del","ins","s","u","sub","sup","abbr","q","cite","mark","small"];const i={"*":["class","id","title"],a:["href","target"]};"comment"===e&&(t=t.concat(["div","h1","h2","h3","h4","h5","h6","p","br","blockquote","img","pre","ul","ol","li"]),Object.assign(i,{img:["alt","src","height","width"]}));const r=new Gi({allowedTags:t,allowedAttributes:i});return e=>r.parse(e)}class Gi{constructor({allowedTags:e,allowedAttributes:t}){Di.set(this,void 0),Ri.set(this,void 0),Mi.set(this,0),qi(this,Di,e?new Set(e):new Set,"f"),qi(this,Ri,t?new Map(Object.entries(t).map((([e,t])=>[e,new Set(t)]))):new Map,"f")}parse(t){const i=function(e,t){const i=new Ai(void 0,t);return new hi(i,t).end(e),i.root}(t);if("root"!==i.type)return;const r=[];return i.children.forEach((e=>{const t=this.processNode(e);t&&r.push(t)})),0===r.length?void 0:1===r.length?r[0]:e.createElement(e.Fragment,{key:this.allocateKey()},r)}processNode(t){if("text"===t.type)return t.data;if("tag"===t.type){const i=Bi.has(t.name)?void 0:t.children.map((e=>this.processNode(e)));if(Vi(this,Di,"f").has(t.name)){const r=this.filterAttributes(t.name,t.attribs);return r.key=this.allocateKey(),e.createElement(t.name,r,i)}return i?e.createElement(e.Fragment,{key:this.allocateKey()},i):void 0}}filterAttributes(e,t){const i={};for(const[r,n]of Object.entries(t))this.isAttributeAllowed(e,r)&&(i["class"===r?"className":r]=n);return i}isAttributeAllowed(e,t){if("key"===t||"ref"===t||"className"===t)return!1;const i=Vi(this,Ri,"f").get(e);if(i&&i.has(t))return!0;const r=Vi(this,Ri,"f").get("*");return!(!r||!r.has(t))}allocateKey(){var e,t;return"auto-"+(qi(this,Mi,(t=Vi(this,Mi,"f"),e=t++,t),"f"),e)}}Di=new WeakMap,Ri=new WeakMap,Mi=new WeakMap;class Ui extends e.Component{constructor(){super(...arguments),this.navigationFieldRef=e.createRef()}render(){return e.createElement("div",{className:"kokopu-movetext"},this.renderHeaders(),this.renderBody(),this.renderNavigationField())}renderHeaders(){if(!this.props.headerVisible)return;const t=Fi("header"),i=[];return i.push(this.renderPlayerHeaders(t,"w")),i.push(this.renderPlayerHeaders(t,"b")),i.push(this.renderEventRoundHeaders(t)),i.push(this.renderDateSiteHeaders(t)),i.push(this.renderAnnotatorHeader(t)),i.some((e=>void 0!==e))?e.createElement("div",{className:"kokopu-headers"},i):void 0}renderPlayerHeaders(t,i){const r=this.props.game.playerName(i);if(void 0===r)return;const n=this.props.game.playerTitle(i),o=this.props.game.playerElo(i),s=["kokopu-headerGroup-player","w"===i?"kokopu-headerGroup-whitePlayer":"kokopu-headerGroup-blackPlayer"],a=e.createElement("span",{className:"kokopu-colorTag"}),l=e.createElement("span",{className:"kokopu-header-playerName"},t(r)),c=void 0===n?void 0:e.createElement("span",{className:"kokopu-header-playerTitle"},t(n)),u=void 0===o?void 0:e.createElement("span",{className:"kokopu-header-playerRating"},o),d=void 0===n||void 0===o?void 0:" ",h=void 0===n&&void 0===o?void 0:e.createElement("span",{className:"kokopu-headerGroup-titleRating"},c,d,u);return e.createElement("div",{className:s.join(" "),key:"player-"+i},a,l,h)}renderEventRoundHeaders(t){const i=this.props.game.event();if(void 0===i)return;const r=this.props.game.fullRound(),n=void 0===r?void 0:e.createElement("span",{className:"kokopu-header-round"},r),o=e.createElement("span",{className:"kokopu-header-event"},t(i));return e.createElement("div",{className:"kokopu-headerGroup-eventRound",key:"event-round"},o,n)}renderDateSiteHeaders(t){const i=this.props.game.dateAsString(),r=this.props.game.site();if(void 0===i&&void 0===r)return;const n=void 0===i?void 0:e.createElement("span",{className:"kokopu-header-date"},0===(o=i).length?"":o.charAt(0).toUpperCase()+o.slice(1));var o;const s=void 0===r?void 0:e.createElement("span",{className:"kokopu-header-site"},t(r)),a=void 0===i||void 0===r?void 0:" – ";return e.createElement("div",{className:"kokopu-headerGroup-dateSite",key:"date-site"},n,a,s)}renderAnnotatorHeader(i){const r=this.props.game.annotator();if(void 0!==r)return e.createElement("div",{className:"kokopu-header-annotator",key:"annotator"},i(w(t.ANNOTATED_BY,r)))}renderNavigationField(){if("selectMove"===this.props.interactionMode)return e.createElement(Pt,{ref:this.navigationFieldRef,onFirstPressed:()=>this.handleNavigationPressed(xt,"key-first"),onPreviousPressed:()=>this.handleNavigationPressed(Ot,"key-previous"),onNextPressed:()=>this.handleNavigationPressed(Lt,"key-next"),onLastPressed:()=>this.handleNavigationPressed(Dt,"key-last"),onExitPressed:()=>this.handleExitPressed()})}renderBody(){const e=Fi("comment");return this.renderVariation(e,this.props.game.mainVariation(),!0,this.props.game.result())}renderVariation(t,i,r,n){const o=[];let s=[];function a(){i.isLongVariation()&&0!==s.length&&(o.push(e.createElement("div",{className:"kokopu-moveGroup",key:"group-"+o.length},s)),s=[])}const l=this.extractComment(i);void 0!==l&&(i.isLongComment()?o.push(this.renderComment(t,i,l)):s.push(this.renderComment(t,i,l)));let c=!0,u=i.first();for(;void 0!==u;){s.push(this.renderMove(u,c));const e=this.extractComment(u);void 0!==e&&(u.isLongComment()?(a(),o.push(this.renderComment(t,u,e))):s.push(this.renderComment(t,u,e)));let i=!1;for(const e of u.variations()){const r=this.renderVariation(t,e,!1);r&&(e.isLongVariation()?(a(),o.push(r)):s.push(r),i=!0)}c=void 0!==e||i,u=u.next()}r&&"*"!==n&&s.push(e.createElement("span",{className:"kokopu-gameResult",key:"game-result"},function(e){switch(e){case"1/2-1/2":return"½–½";case"1-0":return"1–0";case"0-1":return"0–1"}}(n))),a();const d=i.isLongVariation()?o:s;if(0!==d.length)return r?e.createElement("div",{className:"kokopu-variation kokopu-mainVariation",key:i.id()},d):i.isLongVariation()?e.createElement("div",{className:"kokopu-variation kokopu-subVariation",key:i.id()},d):e.createElement("span",{className:"kokopu-variation kokopu-subVariation",key:i.id()},d)}renderMove(t,i){let r;if(i||"w"===t.moveColor()){const i=t.fullMoveNumber()+("w"===t.moveColor()?".":"…");r=e.createElement("span",{className:"kokopu-moveNumber"},i)}const n=this.props.moveFormatter(t.notation()),s=t.nags().map((t=>e.createElement("span",{className:"kokopu-nag",key:t},(0,o.nH)(t)))),a=t.id(),l=["kokopu-move"];let c;return this.props.selection&&this.props.selection===a&&l.push("kokopu-selectedMove"),"selectMove"===this.props.interactionMode&&(l.push("kokopu-clickableMove"),c=()=>this.handleNodeClicked(a)),e.createElement("span",{className:l.join(" "),key:t.id()},e.createElement("span",{className:"kokopu-moveContent",onClick:c},r,e.createElement("span",{className:"kokopu-moveNotation"},n),0===s.length?void 0:s))}renderComment(t,i,r){let n;if(this.props.diagramVisible&&r.includes("[#]")){const s=[];let a=!0,l=0;for(let n of r.split("[#]")){if(!a){const t=i instanceof o.mD?i.initialPosition():i.position(),r=e.createElement(vt,{position:t,squareMarkers:i.tag("csl"),arrowMarkers:i.tag("cal"),textMarkers:i.tag("ctl"),flipped:this.props.diagramOptions.flipped,squareSize:this.props.diagramOptions.squareSize,coordinateVisible:this.props.diagramOptions.coordinateVisible,turnVisible:this.props.diagramOptions.turnVisible,colorset:this.props.diagramOptions.colorset,pieceset:this.props.diagramOptions.pieceset,smallScreenLimits:this.props.diagramOptions.smallScreenLimits});s.push(e.createElement("div",{className:"kokopu-diagram",key:"diagram-"+l++},r))}a=!1,n=n.trim(),0!==n.length&&s.push(t(n))}n=s}else n=t(r);const s=i.id()+"-comment";return i.isLongComment()?e.createElement("div",{className:"kokopu-comment",key:s},n):e.createElement("span",{className:"kokopu-comment",key:s},n)}extractComment(e){let t=e.comment();return t&&(this.props.diagramVisible||(t=t.replace(/\[#\]/g," ")),t=t.replace(/\s+/g," ").trim()),t||void 0}handleNavigationPressed(e,t){this.props.selection&&this.fireMoveSelected(e(this.props.game,this.props.selection),t)}handleExitPressed(){this.props.selection&&this.props.game.findById(this.props.selection)&&this.fireMoveSelected(void 0,"key-exit")}fireMoveSelected(e,t){(e||"key-exit"===t)&&this.props.onMoveSelected&&this.props.onMoveSelected(e,t)}handleNodeClicked(e){this.focus(),this.props.onMoveSelected&&this.props.onMoveSelected(e===this.props.selection?void 0:e,"click")}focus(){const e=this.navigationFieldRef.current;e&&e.focus()}}class ji extends e.Component{constructor(){super(...arguments),this.implRef=e.createRef()}render(){const t=bt(this.props.game,this.props.gameIndex,"Movetext");if(t.error)return t.errorBox;if("object"!=typeof this.props.diagramOptions||null===this.props.diagramOptions)throw new s("Movetext","diagramOptions");const i=At(this.props.pieceSymbols),r=m(this.props.diagramVisible),n=m(this.props.headerVisible),o=I(this.props.selection,g),a=this.getInteractionMode(),{onMoveSelected:l}=this.props;return e.createElement(Ui,{ref:this.implRef,game:t.game,diagramOptions:this.props.diagramOptions,moveFormatter:i,diagramVisible:r,headerVisible:n,selection:o,interactionMode:a,onMoveSelected:l})}getInteractionMode(){const e=I(this.props.interactionMode,g);if(void 0===e||"selectMove"===e)return e;throw new s("Movetext","interactionMode")}focus(){const e=this.implRef.current;e&&e.focus()}static firstNodeId(e,t){return xt(e,t)}static previousNodeId(e,t){return Ot(e,t)}static nextNodeId(e,t){return Lt(e,t)}static lastNodeId(e,t){return Dt(e,t)}}function zi(e,t,i){const r=e-2*i*Math.sqrt(2)/2,n=e-i*(7+2/Math.sqrt(2)/2),o=e-i*(7-2/Math.sqrt(2)/2),s=e+2*i*Math.sqrt(2)/2;return`M ${r} ${t} L ${n} ${t-i*(7-2/Math.sqrt(2)/2)} L ${o} ${t-i*(7+2/Math.sqrt(2)/2)} L ${s} ${t} L ${o} ${t+i*(7+2/Math.sqrt(2)/2)} L ${n} ${t+i*(7-2/Math.sqrt(2)/2)} Z`}function $i(e,t,i){const r=e-i*(5+2/Math.sqrt(2)/2),n=e-i*(5-2/Math.sqrt(2)/2),o=e-2*i/2,s=e+2*i/2,a=e+i*(5-2/Math.sqrt(2)/2),l=e+i*(5+2/Math.sqrt(2)/2),c=t-2*i*Math.sqrt(2)/2,u=c-i*(5-2/Math.sqrt(2)/2),d=c-i*(5+2/Math.sqrt(2)/2),h=d+(o-n);return`M ${e} ${t} L ${r} ${u} L ${n} ${d} L ${o} ${h} V ${t-16*i} H ${s} V ${h} L ${a} ${d} L ${l} ${u} Z`}ji.defaultProps={game:new o.Zt,gameIndex:0,diagramOptions:{},pieceSymbols:"native",diagramVisible:!0,headerVisible:!0};const Hi=zi(14,16,-1)+" "+zi(10,16,-1),Wi=zi(12,16,-1),Ki=zi(20,16,1),Ji=zi(18,16,1)+" "+zi(22,16,1),Yi=$i(11,25,1)+" "+$i(21,7,-1);function Qi(e){return"object"==typeof e&&null!==e&&!("string"!=typeof e.iconPath||void 0!==e.tooltip&&"string"!=typeof e.tooltip||void 0!==e.enabled&&"boolean"!=typeof e.enabled||void 0!==e.onClick&&"function"!=typeof e.onClick)}function Xi(e){if(Array.isArray(e)){for(const t of e)if("button"!==t&&"spacer"!==t)return!1;return!0}return!1}function Zi({squareSize:t,buttons:i}){const r=ir(t),n=rr(t),o=[];let s=!1;for(let t=0;t<i.length;++t){const a=i[t];"spacer"!==a&&(s&&"spacer"===i[t-1]&&o.push(e.createElement("div",{key:o.length,className:"kokopu-navigationSpacer",style:{width:n}})),s=!0,o.push(e.createElement(er,{key:o.length,tooltip:a.tooltip,iconPath:a.iconPath,enabled:a.enabled,onClick:a.onClick,size:r,spaceOnLeft:0===t||"spacer"===i[t-1],spaceOnRight:t===i.length-1||"spacer"===i[t+1]})))}return e.createElement("div",{className:"kokopu-navigationToolbar",style:{marginTop:nr(t)}},o)}function er({size:t,spaceOnLeft:i,spaceOnRight:r,iconPath:n,tooltip:o,enabled:s,onClick:a}){const l=i?"A 16 16 0 0 0 16 32":"L 1 0 L 1 32 L 16 32",c=r?"A 16 16 0 0 0 16 0":"L 31 32 L 31 0 L 16 0",u=s??!0;return e.createElement("div",{className:u?"kokopu-enabledNavigationButton":"kokopu-disabledNavigationButton",title:o,onClick:u?a:void 0},e.createElement("svg",{viewBox:"0 0 32 32",width:t,height:t},e.createElement("path",{d:`M 16 0 ${l} ${c} Z ${n}`,fill:"currentcolor"})))}function tr(e,t){const i=ir(e),r=rr(e);let n=0,o=!1;for(let e=0;e<t.length;++e)"spacer"!==t[e]&&(o&&"spacer"===t[e-1]&&(n+=r),o=!0,n+=i);return{width:n,height:i+nr(e)}}function ir(e){return Math.round((2*e+116)/7)}function rr(e){return Math.round((2*e+116)/14)}function nr(e){return Math.round((2*e+116)/28)}class or extends e.Component{constructor(t){super(t),this.navigationFieldRef=e.createRef(),this.state={nodeIdAsUncontrolled:g(t.initialNodeId),isPlayingAsUncontrolled:m(t.initialIsPlaying),flippedAsUncontrolled:m(t.initialFlipped)}}componentWillUnmount(){this.cancelCurrentTimeout()}render(){this.cancelCurrentTimeout();const t=bt(this.props.game,this.props.gameIndex,"NavigationBoard");if(t.error)return t.errorBox;const i=I(this.props.nodeId,g)??this.state.nodeIdAsUncontrolled,r=t.game.findById(i)??t.game.mainVariation(),n=I(this.props.isPlaying,m)??this.state.isPlayingAsUncontrolled,o=I(this.props.flipped,m)??this.state.flippedAsUncontrolled;return e.createElement("div",{className:"kokopu-navigationBoard"},this.renderBoard(t.game,r,n,o),this.renderNavigationField(t.game,r.id()))}renderBoard(t,i,r,n){const s=i instanceof o.bP?i.positionBefore():i.initialPosition(),a=i instanceof o.bP?i.notation():void 0;return e.createElement(vt,{position:s,move:a,flipped:n,squareMarkers:i.tag("csl"),arrowMarkers:i.tag("cal"),textMarkers:i.tag("ctl"),squareSize:this.props.squareSize,coordinateVisible:this.props.coordinateVisible,turnVisible:this.props.turnVisible,colorset:this.props.colorset,pieceset:this.props.pieceset,smallScreenLimits:this.props.smallScreenLimits,moveArrowVisible:this.props.moveArrowVisible,moveArrowColor:this.props.moveArrowColor,animated:this.props.animated,bottomComponent:({squareSize:e})=>this.renderToolbar(t,i,e,r)})}renderNavigationField(t,i){return e.createElement(Pt,{ref:this.navigationFieldRef,onFirstPressed:()=>this.handleNavClicked(xt(t,i)),onPreviousPressed:()=>this.handleNavClicked(Ot(t,i)),onNextPressed:()=>this.handleNavClicked(Lt(t,i)),onLastPressed:()=>this.handleNavClicked(Dt(t,i))})}renderToolbar(i,r,n,a){const l=[],c=r.id(),u="start"!==c,d=void 0!==(r instanceof o.mD?r.first():r.next());if(l.push({iconPath:Hi,tooltip:t.TOOLTIP_GO_FIRST,enabled:u,onClick:()=>this.handleNavClicked(xt(i,c))}),l.push({iconPath:Wi,tooltip:t.TOOLTIP_GO_PREVIOUS,enabled:u,onClick:()=>this.handleNavClicked(Ot(i,c))}),m(this.props.playButtonVisible)&&l.push({iconPath:a?"M 11 11 H 21 V 21 H 11 Z":"M 23 16 L 12 23 V 9 Z",tooltip:t.TOOLTIP_PLAY_STOP,enabled:d,onClick:()=>this.handlePlayStopClicked(!a)}),l.push({iconPath:Ki,tooltip:t.TOOLTIP_GO_NEXT,enabled:d,onClick:()=>this.handleNavClicked(Lt(i,c))}),l.push({iconPath:Ji,tooltip:t.TOOLTIP_GO_LAST,enabled:d,onClick:()=>this.handleNavClicked(Dt(i,c))}),l.push("spacer"),m(this.props.flipButtonVisible)&&l.push({iconPath:Yi,tooltip:t.TOOLTIP_FLIP,onClick:()=>this.handleFlipButtonClicked()}),l.push("spacer"),a&&(this.timeoutId=d?window.setTimeout((()=>this.handleNavClicked(Lt(i,c),!1)),1e3):window.setTimeout((()=>this.handlePlayStopClicked(!1,!1)),0)),!function(e){if(Array.isArray(e)){for(const t of e)if(!Qi(t)&&"spacer"!==t)return!1;return!0}return!1}(this.props.additionalButtons))throw new s("NavigationBoard","additionalButtons");for(const e of this.props.additionalButtons)l.push(e);return e.createElement(Zi,{squareSize:n,buttons:l})}handleNavClicked(e,t=!0){t&&this.focus(),void 0!==e&&(void 0===this.props.nodeId?this.setState({nodeIdAsUncontrolled:e}):this.props.onNodeIdChanged&&this.props.onNodeIdChanged(e))}handlePlayStopClicked(e,t=!0){t&&this.focus(),void 0===this.props.isPlaying?this.setState({isPlayingAsUncontrolled:e}):this.props.onIsPlayingChanged&&this.props.onIsPlayingChanged(e)}handleFlipButtonClicked(){this.focus(),void 0===this.props.flipped?this.setState({flippedAsUncontrolled:!this.state.flippedAsUncontrolled}):this.props.onFlippedChanged&&this.props.onFlippedChanged(!this.props.flipped)}cancelCurrentTimeout(){void 0!==this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=void 0)}focus(){const e=this.navigationFieldRef.current;e&&e.focus()}static size(e){const{squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,playButtonVisible:o,flipButtonVisible:a,additionalButtons:l}=b(e,(()=>new s("NavigationBoard.size()","attr"))),c=I(o,m),u=I(a,m);if(void 0!==l&&!Xi(l))throw new s("NavigationBoard.size()","additionalButtons");const d=sr(c,u,l);return vt.size({squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,bottomComponent:({squareSize:e})=>tr(e,d)})}static adaptSquareSize(e,t,i){const{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,playButtonVisible:a,flipButtonVisible:l,additionalButtons:c}=b(i,(()=>new s("NavigationBoard.adaptSquareSize()","attr"))),u=I(a,m),d=I(l,m);if(void 0!==c&&!Xi(c))throw new s("NavigationBoard.adaptSquareSize()","additionalButtons");const h=sr(u,d,c);return vt.adaptSquareSize(e,t,{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,bottomComponent:({squareSize:e})=>tr(e,h)})}}function sr(e,t,i){const r=[];if(r.push("button"),r.push("button"),(e??or.defaultProps.playButtonVisible)&&r.push("button"),r.push("button"),r.push("button"),r.push("spacer"),(t??or.defaultProps.flipButtonVisible)&&r.push("button"),r.push("spacer"),void 0!==i)for(const e of i)r.push(e);return r}or.defaultProps={squareSize:40,coordinateVisible:!0,turnVisible:!0,colorset:"original",pieceset:"cburnett",moveArrowVisible:!0,moveArrowColor:"b",animated:!1,game:new o.Zt,gameIndex:0,initialNodeId:"start",initialIsPlaying:!1,initialFlipped:!1,playButtonVisible:!1,flipButtonVisible:!0,additionalButtons:[]};var ar=i(5556),lr=i.n(ar),cr=i(5795),ur=i.n(cr);const dr=function(e){const t=e-1*(5+2/Math.sqrt(2)/2),i=e-1*(5-2/Math.sqrt(2)/2),r=e+1*(5-2/Math.sqrt(2)/2),n=e+1*(5+2/Math.sqrt(2)/2),o=22-2*Math.sqrt(2)/2,s=o-1*(5-2/Math.sqrt(2)/2),a=o-1*(5+2/Math.sqrt(2)/2),l=a+(15-i);return`M 16 22 L ${t} ${s} L ${i} ${a} L 15 ${l} V 6 H 17 V ${l} L ${r} ${a} L ${n} ${s} Z`}(16)+" M 8 22 H 24 V 24 H 8 Z",hr=window.ReactJSXRuntime;let pr=!1,fr=!1,gr=!1,mr=!1;function br(e){return function(){if(pr)return;fr={squareSize:RPBChessboard.defaultSettings.nboSquareSize,coordinateVisible:RPBChessboard.defaultSettings.nboCoordinateVisible,turnVisible:RPBChessboard.defaultSettings.nboTurnVisible,colorset:RPBChessboard.defaultSettings.nboColorset,pieceset:RPBChessboard.defaultSettings.nboPieceset,animated:RPBChessboard.defaultSettings.animated,moveArrowVisible:RPBChessboard.defaultSettings.moveArrowVisible,moveArrowColor:RPBChessboard.defaultSettings.moveArrowColor,smallScreenLimits:RPBChessboard.smallScreenLimits,playButtonVisible:RPBChessboard.defaultSettings.playButtonVisible,turnButtonVisible:RPBChessboard.defaultSettings.turnButtonVisible,downloadButtonVisible:RPBChessboard.defaultSettings.downloadButtonVisible,additionalButtons:RPBChessboard.defaultSettings.downloadButtonVisible?["button"]:[]};const e=document.createElement("div");function t(){const t=or.size(fr);e.style.minWidth=`${t.width}px`,e.style.minHeight=`${t.height}px`}function i(){gr&&gr.focus()}t();const r=document.createElement("div");r.id="rpbchessboard-navigationFrame",r.onclick=i,pr=document.createElement("div"),r.appendChild(e),e.appendChild(pr);const n=window.jQuery;n("body").append(r),n("#rpbchessboard-navigationFrame").dialog({create:e=>n(e.target).parent().css("position","fixed"),resizeStart:e=>n(e.target).parent().css("position","fixed"),resizeStop:e=>n(e.target).parent().css("position","fixed"),autoOpen:!1,dialogClass:"wp-dialog",width:"auto",close:()=>{gr&&gr.handleMoveSelected(void 0,"external")}}),n("#rpbchessboard-navigationFrame").on("dialogresize",((e,i)=>{if(!mr){const e=or.size(fr);mr={reservedWidth:i.originalSize.width-e.width,reservedHeight:i.originalSize.height-e.height}}const r=i.size.width-mr.reservedWidth,n=i.size.height-mr.reservedHeight,o=or.adaptSquareSize(r,n,fr);fr={...fr},fr.squareSize=o,t(),gr.setState({popupBoardOptions:fr})})),n("#rpbchessboard-navigationFrame").on("dialogopen",i),n("#rpbchessboard-navigationFrame").on("dialogdragstop",i),n("#rpbchessboard-navigationFrame").on("dialogresizestop",i)}(),gr&&gr!==e&&gr.handleMoveSelected(void 0,"external"),gr=e,function(){const e=(0,window.jQuery)("#rpbchessboard-navigationFrame");e.dialog("isOpen")||(e.dialog("option","position",{my:"center",at:"center",of:window}),e.dialog("open"))}(),{anchor:pr,boardOptions:fr,setTitle:e=>function(e){if(!pr)return;const t=window.jQuery,i=t(".ui-dialog-title",t("#rpbchessboard-navigationFrame").closest(".ui-dialog")).get(0);(0,n.H)(i).render((0,hr.jsx)("span",{children:e}))}(e)}}function vr(e){gr===e&&(gr=!1,pr&&(0,window.jQuery)("#rpbchessboard-navigationFrame").dialog("close"))}function _r(e,...t){return e.replace(/{(\d+)}/g,((e,i)=>(i=Number(i))<t.length?t[i]:e))}function Ir(e){const t=/^([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*)$/.exec(e);return!!t&&{K:t[1],Q:t[2],R:t[3],B:t[4],N:t[5],P:t[6]}}function Nr(e){return[..."KQRBNP"].map((t=>e[t].replace(/[^A-Za-z]/g,""))).join(",")}const wr=RPBChessboard.i18n;class Sr extends r().Component{constructor(e){super(e),this.state={selection:!!Er(this.props.navigationBoard)&&this.props.initialSelection,isPlaying:!1,withAdditionalFlip:!1,urlFetchStatus:!1},this.movetextRef=r().createRef(),this.blobDownloadLinkRef=r().createRef(),this.dynamicURL=!1}componentWillUnmount(){this.releaseDynamicURL(),"frame"===this.props.navigationBoard&&vr(this)}render(){let e="";if(this.props.url){if("ok"!==this.state.urlFetchStatus)return"error"===this.state.urlFetchStatus?(0,hr.jsx)(C,{title:wr.PGN_DOWNLOAD_ERROR_TITLE,message:this.state.urlError}):(async function(e){const t=await fetch(e);return t.ok?t.text():Promise.reject(_r(wr.PGN_DOWNLOAD_ERROR_MESSAGE,e,t.status))}(this.props.url).then((e=>this.setState({urlFetchStatus:"ok",urlData:e}))).catch((e=>this.setState({urlFetchStatus:"error",urlError:e}))),(0,hr.jsx)("div",{}));e=this.state.urlData}else e=this.props.pgn;const t=this.parseGame(e);if(!t.valid)return(0,hr.jsx)(C,{title:wr.PGN_PARSING_ERROR_TITLE,message:t.message,text:t.pgn,errorIndex:t.errorIndex,lineNumber:t.lineNumber});const i=this.getNodeId(t.game);if("above"===this.props.navigationBoard)return(0,hr.jsxs)("div",{children:[this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions),this.renderMovetext(t.game,i,!0)]});if("below"===this.props.navigationBoard)return(0,hr.jsxs)("div",{children:[this.renderMovetext(t.game,i,!0),this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions)]});if("floatLeft"===this.props.navigationBoard||"floatRight"===this.props.navigationBoard)return(0,hr.jsxs)("div",{className:"floatLeft"===this.props.navigationBoard?"rpbchessboard-indentWithFloatLeft":"",children:[this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions),this.renderMovetext(t.game,i,!0),(0,hr.jsx)("div",{className:"rpbchessboard-clearFloat"})]});if("scrollLeft"===this.props.navigationBoard||"scrollRight"===this.props.navigationBoard){const e=this.props.navigationBoardOptions,{height:r}=or.size(e);return(0,hr.jsxs)("div",{className:"rpbchessboard-scrollBox-"+this.props.navigationBoard,children:[this.renderNavigationBoard(t.game,i,e),(0,hr.jsx)("div",{className:"rpbchessboard-scrollArea",style:{"max-height":r},children:this.renderMovetext(t.game,i,!0)})]})}return"frame"===this.props.navigationBoard?(0,hr.jsxs)("div",{children:[this.renderMovetext(t.game,i,!0),this.renderNavigationBoardInPopup(t.game,i)]}):(0,hr.jsx)("div",{children:this.renderMovetext(t.game,i,!1)})}renderMovetext(e,t,i){return(0,hr.jsx)(ji,{ref:this.movetextRef,game:e,selection:t,interactionMode:i?"selectMove":void 0,onMoveSelected:(e,t)=>this.handleMoveSelected(e,t),pieceSymbols:this.getPieceSymbols(),diagramOptions:this.props.diagramOptions})}renderNavigationBoardInPopup(e,t){if(void 0!==t&&this.state.popupAnchor)return ur().createPortal(this.renderNavigationBoard(e,t,this.state.popupBoardOptions,this.state.setPopupTitle),this.state.popupAnchor)}renderNavigationBoard(e,t,i,r){r&&r(this.getPopupTitle(e,t));const n=["rpbchessboard-navigationBoard","rpbchessboard-navigationBoard-"+this.props.navigationBoard],o=[];return i.downloadButtonVisible&&o.push({iconPath:dr,tooltip:wr.PGN_TOOLTIP_DOWNLOAD,onClick:()=>this.handleDownloadClicked()}),(0,hr.jsxs)("div",{className:n.join(" "),children:[(0,hr.jsx)(or,{game:e,nodeId:t,flipped:this.props.navigationBoardOptions.flipped^this.state.withAdditionalFlip,isPlaying:this.state.isPlaying,squareSize:i.squareSize,coordinateVisible:i.coordinateVisible,turnVisible:i.turnVisible,colorset:i.colorset,pieceset:i.pieceset,smallScreenLimits:i.smallScreenLimits,animated:i.animated,moveArrowVisible:i.moveArrowVisible,moveArrowColor:i.moveArrowColor,playButtonVisible:i.playButtonVisible,flipButtonVisible:i.flipButtonVisible,onNodeIdChanged:e=>this.handleNavClicked(e),onIsPlayingChanged:e=>this.handleIsPlayingClicked(e),onFlippedChanged:()=>this.handleFlipClicked(),additionalButtons:o}),this.renderDownloadLink(i.downloadButtonVisible)]})}renderDownloadLink(e){if(e)return(0,hr.jsx)("a",{ref:this.blobDownloadLinkRef,className:"rpbchessboard-blobDownloadLink",href:"#",download:"game.pgn"})}getPopupTitle(e,t){if("start"===t)return wr.PGN_INITIAL_POSITION;{const i=e.findById(t),r=i.fullMoveNumber()+("w"===i.moveColor()?".":"…")+i.notation();return function(e,t){return At(e)(t)}(this.getPieceSymbols(),r)}}getPieceSymbols(){return Ir(this.props.pieceSymbols)||("native"===this.props.pieceSymbols||"localized"===this.props.pieceSymbols||"figurines"===this.props.pieceSymbols?this.props.pieceSymbols:void 0)}parseGame(e){try{return{valid:!0,game:(0,o.oG)(e,this.props.gameIndex)}}catch(e){if(e instanceof o.exception.InvalidPGN)return{valid:!1,message:e.message,pgn:e.pgn,errorIndex:e.index,lineNumber:e.lineNumber};throw e}}getNodeId(e){let t=this.state.selection?e.findById(this.state.selection):void 0;return t instanceof o.mD&&void 0!==t.parentNode()&&(t=t.parentNode()),Er(this.props.navigationBoard)?void 0===t?"start":t.id():"frame"===this.props.navigationBoard?void 0===t?void 0:t.id():void 0}handleMoveSelected(e,t){if(e?this.setState({selection:e}):"frame"===this.props.navigationBoard&&this.setState({selection:!1}),"frame"===this.props.navigationBoard&&"external"!==t)if(e){const{anchor:e,boardOptions:t,setTitle:i}=br(this);this.setState({popupAnchor:e,popupBoardOptions:t,setPopupTitle:i})}else vr(this)}handleNavClicked(e){this.movetextRef.current.focus(),this.setState({selection:e})}handleIsPlayingClicked(e){this.movetextRef.current.focus(),this.setState({isPlaying:e})}handleFlipClicked(){this.movetextRef.current.focus(),this.setState({withAdditionalFlip:!this.state.withAdditionalFlip})}handleDownloadClicked(){if(this.props.url)window.location.href=this.props.url;else{const e=new Blob([this.props.pgn],{type:"text/plain"});this.releaseDynamicURL(),this.dynamicURL=window.URL.createObjectURL(e);const t=this.blobDownloadLinkRef.current;t.href=this.dynamicURL,t.click()}}releaseDynamicURL(){this.dynamicURL&&(window.URL.revokeObjectURL(this.dynamicURL),this.dynamicURL=!1)}focus(){this.movetextRef.current.focus()}}function Er(e){return"above"===e||"below"===e||"floatLeft"===e||"floatRight"===e||"scrollLeft"===e||"scrollRight"===e}Sr.propTypes={url:lr().string,pgn:lr().string,gameIndex:lr().number,initialSelection:lr().string,pieceSymbols:lr().oneOfType([lr().oneOf(["native","localized","figurines"]),lr().string]),navigationBoard:lr().oneOf(["none","frame","floatLeft","floatRight","scrollLeft","scrollRight","above","below"]),navigationBoardOptions:lr().shape({flipped:lr().bool,squareSize:lr().number,coordinateVisible:lr().bool,turnVisible:lr().bool,smallScreenLimits:lr().arrayOf(lr().shape({width:lr().number.isRequired,squareSize:lr().number,coordinateVisible:lr().bool})),colorset:lr().string,pieceset:lr().string,animated:lr().bool,moveArrowVisible:lr().bool,flipButtonVisible:lr().bool,downloadButtonVisible:lr().bool}),diagramOptions:lr().shape({flipped:lr().bool,squareSize:lr().number,coordinateVisible:lr().bool,turnVisible:lr().bool,smallScreenLimits:lr().arrayOf(lr().shape({width:lr().number.isRequired,squareSize:lr().number,coordinateVisible:lr().bool})),colorset:lr().string,pieceset:lr().string})},Sr.defaultProps={pgn:"",gameIndex:0,initialSelection:!1,pieceSymbols:"native",navigationBoard:"none",navigationBoardOptions:{},diagramOptions:{}};const yr=window.wp.blocks,Cr=window.wp.blockEditor,Ar=window.wp.components,Tr=window.wp.primitives,Pr=(0,hr.jsx)(Tr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hr.jsx)(Tr.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})}),kr=(0,hr.jsx)(Tr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hr.jsx)(Tr.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),xr=RPBChessboard.i18n;function Or({label:e,value:t,available:i,onChange:r}){const n=[{value:"",label:"<"+xr.FEN_EDITOR_USE_DEFAULT+">"}];return Object.keys(i).sort().forEach((e=>n.push({value:e,label:i[e]}))),(0,hr.jsx)(Ar.ComboboxControl,{label:e,value:t,options:n,onChange:r})}function Lr(e){const t=0===e.squareSize,i=t?void 0:(0,hr.jsx)(Ar.RangeControl,{label:xr.FEN_EDITOR_CONTROL_SQUARE_SIZE,value:e.squareSize,min:RPBChessboard.availableSquareSize.min,max:RPBChessboard.availableSquareSize.max,step:1,onChange:e.onSquareSizeChanged});return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Ar.ToggleControl,{label:xr.FEN_EDITOR_CONTROL_USE_DEFAULT_SIZE,checked:t,onChange:()=>e.onSquareSizeChanged(t?e.defaultSquareSize:0)}),i,(0,hr.jsx)(Ar.RadioControl,{label:xr.FEN_EDITOR_CONTROL_COORDINATES,selected:e.coordinateVisible,onChange:e.onCoordinateVisibleChanged,options:[{label:xr.FEN_EDITOR_USE_DEFAULT,value:""},{label:xr.FEN_EDITOR_OPTION_HIDDEN,value:"false"},{label:xr.FEN_EDITOR_OPTION_VISIBLE,value:"true"}]}),(0,hr.jsx)(Ar.RadioControl,{label:xr.FEN_EDITOR_CONTROL_TURN_FLAG,selected:e.turnVisible,onChange:e.onTurnVisibleChanged,options:[{label:xr.FEN_EDITOR_USE_DEFAULT,value:""},{label:xr.FEN_EDITOR_OPTION_HIDDEN,value:"false"},{label:xr.FEN_EDITOR_OPTION_VISIBLE,value:"true"}]}),(0,hr.jsx)(Or,{label:xr.FEN_EDITOR_CONTROL_COLORSET,value:e.colorset,available:RPBChessboard.availableColorsets,onChange:e.onColorsetChanged}),(0,hr.jsx)(Or,{label:xr.FEN_EDITOR_CONTROL_PIECESET,value:e.pieceset,available:RPBChessboard.availablePiecesets,onChange:e.onPiecesetChanged})]})}Or.propTypes={label:lr().string.isRequired,value:lr().string.isRequired,available:lr().arrayOf(lr().object).isRequired,onChange:lr().func.isRequired},Lr.propTypes={defaultSquareSize:lr().number.isRequired,squareSize:lr().number.isRequired,coordinateVisible:lr().string.isRequired,turnVisible:lr().string.isRequired,colorset:lr().string.isRequired,pieceset:lr().string.isRequired,onSquareSizeChanged:lr().func.isRequired,onCoordinateVisibleChanged:lr().func.isRequired,onTurnVisibleChanged:lr().func.isRequired,onColorsetChanged:lr().func.isRequired,onPiecesetChanged:lr().func.isRequired};const Dr=i.p+"images/add-w.bb64049f.png",Rr=i.p+"images/add-b.51fdd0c7.png",Mr=i.p+"images/toggle-turn.1a534377.png",qr={w:Dr,b:Rr},Vr=RPBChessboard.i18n,Br=vt.colorsets().original,Fr=vt.piecesets().cburnett;function Gr(){const e=[];for(let t=0;t<4;++t)for(let i=1-t%2;i<4;i+=2)e.push((0,hr.jsx)("rect",{x:t,y:i,width:1,height:1}));return(0,hr.jsx)("svg",{viewBox:"0 0 4 4",children:e})}class Ur extends r().Component{constructor(e){super(e),this.state={interactionMode:"movePieces",textMarkerMode:"circle"}}handleAttributeChanged(e,t){const i={...this.props.attributes};i[e]=t,this.props.setAttributes(i)}handlePieceMoved(e,t){if("movePieces"===this.state.interactionMode){const i=new o.yX(this.props.attributes.position);i.square(t,i.square(e)),i.square(e,"-"),this.props.setAttributes({...this.props.attributes,position:i.fen()})}}handleSquareClicked(e){if(/addPiece-([wb][pnbrqk])/.test(this.state.interactionMode)){const t=RegExp.$1,i=new o.yX(this.props.attributes.position);i.square(e,i.square(e)===t?"-":t),this.props.setAttributes({...this.props.attributes,position:i.fen()})}else if(/addSquareMarker-([bgry])/.test(this.state.interactionMode)){const t=RegExp.$1,i={...this.props.attributes.squareMarkers};i[e]===t?delete i[e]:i[e]=t,this.props.setAttributes({...this.props.attributes,squareMarkers:i})}else if(/addTextMarker-([bgry])/.test(this.state.interactionMode)){const t=RegExp.$1,i={...this.props.attributes.textMarkers};i[e]&&i[e].symbol===this.state.textMarkerMode&&i[e].color===t?delete i[e]:i[e]={symbol:this.state.textMarkerMode,color:t},this.props.setAttributes({...this.props.attributes,textMarkers:i})}}handleArrowEdited(e,t){if(/addArrowMarker-([bgry])/.test(this.state.interactionMode)){const i=RegExp.$1,r=e+t,n={...this.props.attributes.arrowMarkers};n[r]===i?delete n[r]:n[r]=i,this.props.setAttributes({...this.props.attributes,arrowMarkers:n})}}handleToggleTurnClicked(){const e=new o.yX(this.props.attributes.position);e.turn((0,o.VD)(e.turn())),this.props.setAttributes({...this.props.attributes,position:e.fen()})}handleFlipClicked(){const e=!this.props.attributes.flipped;this.props.setAttributes({...this.props.attributes,flipped:e})}handleClearAnnotationsClicked(){this.props.setAttributes({...this.props.attributes,squareMarkers:{},arrowMarkers:{},textMarkers:{}})}render(){const e=e=>this.setState({interactionMode:e}),t=this.parsePositionAttribute();let i,r="",n="";if("movePieces"===this.state.interactionMode)r="movePieces",i=(0,hr.jsx)("div",{style:{width:"24px",height:"24px"},children:Pr});else if(/addPiece-([wb][pnbrqk])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)("img",{src:Fr[e],width:24,height:24})}else if(/addSquareMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)(A,{size:24,color:Br["c"+e]})}else if(/addArrowMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="editArrows",n=e,i=(0,hr.jsx)(D,{size:24,color:Br["c"+e]})}else if(/addTextMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)(O,{size:24,color:Br["c"+e],symbol:this.state.textMarkerMode})}return(0,hr.jsxs)("div",{...this.props.blockProps,children:[this.renderToolbar(e),this.renderSidePanel(t.fen,i,e),this.renderBlockContent(t,r,n)]})}renderToolbar(e){function t({color:t}){return(0,hr.jsx)(Ar.Dropdown,{renderToggle:({isOpen:e,onToggle:i})=>{const r=(0,hr.jsx)("img",{src:qr[t],width:24,height:24});return(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_ADD_PIECES[t],icon:r,onClick:i,"aria-expanded":e})},renderContent:({onClose:i})=>{function r({coloredPiece:t}){const r=(0,hr.jsx)("img",{src:Fr[t],width:24,height:24});return(0,hr.jsx)(Ar.Button,{label:Vr.FEN_EDITOR_LABEL_ADD_PIECE[t],icon:r,onClick:()=>{e("addPiece-"+t),i()}})}return(0,hr.jsxs)("div",{children:[(0,hr.jsx)(r,{coloredPiece:t+"p"}),(0,hr.jsx)(r,{coloredPiece:t+"n"}),(0,hr.jsx)(r,{coloredPiece:t+"b"}),(0,hr.jsx)(r,{coloredPiece:t+"r"}),(0,hr.jsx)(r,{coloredPiece:t+"q"}),(0,hr.jsx)(r,{coloredPiece:t+"k"})]})}})}const i=(0,hr.jsx)("img",{src:Mr,width:24,height:24});return(0,hr.jsxs)(Cr.BlockControls,{children:[(0,hr.jsxs)(Ar.ToolbarGroup,{children:[(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_MOVE_PIECES,icon:Pr,onClick:()=>e("movePieces")}),(0,hr.jsx)(t,{color:"w"}),(0,hr.jsx)(t,{color:"b"}),(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_TOGGLE_TURN,icon:i,onClick:()=>this.handleToggleTurnClicked()})]}),(0,hr.jsx)(Ar.ToolbarGroup,{children:(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_FLIP,icon:kr,onClick:()=>this.handleFlipClicked()})})]})}renderSidePanel(e,t,i){return(0,hr.jsxs)(Cr.InspectorControls,{children:[this.renderPositionAndAnnotationPanel(e,t,i),this.renderChessboardAspectPanel()]})}renderPositionAndAnnotationPanel(e,t,i){function r({iconBuilder:e,interactionModePrefix:t}){function r({color:r}){return(0,hr.jsx)(Ar.Button,{icon:e(r),onClick:()=>i(t+r)})}return(0,hr.jsxs)(Ar.ButtonGroup,{children:[(0,hr.jsx)(r,{color:"b"}),(0,hr.jsx)(r,{color:"g"}),(0,hr.jsx)(r,{color:"r"}),(0,hr.jsx)(r,{color:"y"})]})}function n({value:e,onChange:t}){const i=["plus","times","dot","circle"].concat([..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"]).map((e=>{const t=_r(Vr.FEN_EDITOR_LABEL_TEXT_MARKER,function(e){switch(e){case"plus":return"+";case"times":return"×";case"dot":return"•";case"circle":return"○";default:return e}}(e));return{value:e,label:t}}));return(0,hr.jsx)(Ar.SelectControl,{value:e,options:i,onChange:t})}return(0,hr.jsxs)(Ar.PanelBody,{title:Vr.FEN_EDITOR_PANEL_POSITION,children:[(0,hr.jsxs)(Ar.PanelRow,{children:[(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_RESET_POSITION,label:Vr.FEN_EDITOR_TOOLTIP_RESET_POSITION,onClick:()=>this.handleAttributeChanged("position","start")}),(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_CLEAR_POSITION,label:Vr.FEN_EDITOR_TOOLTIP_CLEAR_POSITION,onClick:()=>this.handleAttributeChanged("position","empty")}),(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_CLEAR_ANNOTATIONS,label:Vr.FEN_EDITOR_TOOLTIP_CLEAR_ANNOTATIONS,onClick:()=>this.handleClearAnnotationsClicked()})]}),(0,hr.jsx)(Ar.PanelRow,{className:"rpbchessboard-fixMarginBottom rpbchessboard-fixWidth",children:(0,hr.jsx)(Ar.TextControl,{label:Vr.FEN_EDITOR_LABEL_FEN,value:e,onChange:e=>this.handleAttributeChanged("position",e)})}),(0,hr.jsxs)(Ar.PanelRow,{className:"rpbchessboard-editionModeRow",children:[(0,hr.jsx)("span",{children:Vr.FEN_EDITOR_CURRENT_EDITION_MODE}),t]}),(0,hr.jsxs)(Ar.PanelRow,{children:[Vr.FEN_EDITOR_LABEL_SQUARE_MARKER,(0,hr.jsx)(r,{interactionModePrefix:"addSquareMarker-",iconBuilder:e=>(0,hr.jsx)(A,{size:24,color:Br["c"+e]})})]}),(0,hr.jsxs)(Ar.PanelRow,{children:[Vr.FEN_EDITOR_LABEL_ARROW_MARKER,(0,hr.jsx)(r,{interactionModePrefix:"addArrowMarker-",iconBuilder:e=>(0,hr.jsx)(D,{size:24,color:Br["c"+e]})})]}),(0,hr.jsxs)(Ar.PanelRow,{className:"rpbchessboard-fixMarginBottom",children:[(0,hr.jsx)(n,{value:this.state.textMarkerMode,onChange:e=>this.setState({textMarkerMode:e})}),(0,hr.jsx)(r,{interactionModePrefix:"addTextMarker-",iconBuilder:e=>(0,hr.jsx)(O,{size:24,color:Br["c"+e],symbol:this.state.textMarkerMode})})]}),(0,hr.jsx)(Ar.PanelRow,{children:(0,hr.jsx)(Ar.ToggleControl,{className:"rpbchessboard-fixMissingMarginTop",label:Vr.FEN_EDITOR_CONTROL_FLIP,checked:this.props.attributes.flipped,onChange:()=>this.handleFlipClicked()})})]})}renderChessboardAspectPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:Vr.FEN_EDITOR_PANEL_APPEARANCE,initialOpen:!1,children:[(0,hr.jsx)(Ar.RadioControl,{label:Vr.FEN_EDITOR_CONTROL_ALIGNMENT,selected:this.props.attributes.align,onChange:e=>this.handleAttributeChanged("align",e),options:[{label:Vr.FEN_EDITOR_USE_DEFAULT,value:""},{label:Vr.FEN_EDITOR_OPTION_CENTER,value:"center"},{label:Vr.FEN_EDITOR_OPTION_FLOAT_LEFT,value:"floatLeft"},{label:Vr.FEN_EDITOR_OPTION_FLOAT_RIGHT,value:"floatRight"}]}),(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.sdoSquareSize,flipped:this.props.attributes.flipped,squareSize:this.props.attributes.squareSize,coordinateVisible:this.props.attributes.coordinateVisible,turnVisible:this.props.attributes.turnVisible,colorset:this.props.attributes.colorset,pieceset:this.props.attributes.pieceset,onFlipChanged:()=>this.handleFlipClicked(),onSquareSizeChanged:e=>this.handleAttributeChanged("squareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("coordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("turnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("colorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("pieceset",e)})]})}renderBlockContent(e,t,i){return e.valid?(0,hr.jsx)(vt,{position:e.position,flipped:this.props.attributes.flipped,squareSize:40,interactionMode:t,editedArrowColor:i,squareMarkers:this.props.attributes.squareMarkers,arrowMarkers:this.props.attributes.arrowMarkers,textMarkers:this.props.attributes.textMarkers,coordinateVisible:""===this.props.attributes.coordinateVisible?RPBChessboard.defaultSettings.sdoCoordinateVisible:"true"===this.props.attributes.coordinateVisible,turnVisible:""===this.props.attributes.turnVisible?RPBChessboard.defaultSettings.sdoTurnVisible:"true"===this.props.attributes.turnVisible,colorset:""===this.props.attributes.colorset?RPBChessboard.defaultSettings.sdoColorset:this.props.attributes.colorset,pieceset:""===this.props.attributes.pieceset?RPBChessboard.defaultSettings.sdoPieceset:this.props.attributes.pieceset,onPieceMoved:(e,t)=>this.handlePieceMoved(e,t),onSquareClicked:e=>this.handleSquareClicked(e),onArrowEdited:(e,t)=>this.handleArrowEdited(e,t)}):(0,hr.jsx)(C,{title:Vr.FEN_PARSING_ERROR_TITLE,message:e.message})}parsePositionAttribute(){try{const e=new o.yX(this.props.attributes.position);return{valid:!0,position:e,fen:e.fen()}}catch(e){if(e instanceof o.exception.InvalidFEN)return{valid:!1,message:e.message,fen:this.props.attributes.position};throw e}}}Ur.propTypes={blockProps:lr().object,attributes:lr().object,setAttributes:lr().func};const jr=window.wp.data,zr=RPBChessboard.i18n,$r=vt.colorsets().original;function Hr(){const e=[];for(let t=0;t<4;++t)for(let i=1-t%2;i<4;i+=2)e.push((0,hr.jsx)("rect",{x:4*t,y:4*i+4,width:4,height:4}));for(let t=0;t<5;++t)e.push((0,hr.jsx)("rect",{x:t<1||t>=4?0:18,y:5*t+1,width:t<1||t>=4?24:6,height:2}));return(0,hr.jsx)("svg",{viewBox:"0 0 24 24",children:e})}const Wr=(0,jr.withSelect)(((e,t)=>{const i=e("core").getMedia(t.attachmentId);return{url:i?i.source_url:void 0}}))((e=>{var t;return(0,hr.jsx)("input",{className:"rpbchessboard-fixMarginBottom rpbchessboard-fixPadding",type:"text",readOnly:!0,value:null!==(t=e.url)&&void 0!==t?t:""})}));class Kr extends r().Component{constructor(e){super(e),this.state={sourceType:this.props.attributes.attachmentId>=0?"url":"inline",localPgn:this.props.attributes.pgn,localAttachementId:this.props.attributes.attachmentId,localGameIndex:this.props.attributes.gameIndex}}handleAttributeChanged(e,t){const i={...this.props.attributes};i[e]=t,this.props.setAttributes(i)}handleInitialSelectionCodeChanged(e){const t="custom"===e?"1w":e;this.props.setAttributes({...this.props.attributes,initialSelection:t})}handlePieceSymbolCodeChanged(e,t){const i="custom"===e?Nr(t):e;this.props.setAttributes({...this.props.attributes,pieceSymbols:i})}handlePieceSymbolChanged(e,t,i){const r={...i};r[e]=t,this.props.setAttributes({...this.props.attributes,pieceSymbols:Nr(r)})}handleFlipClicked(){const e=!this.props.attributes.flipped;this.props.setAttributes({...this.props.attributes,flipped:e})}handleSourceTypeChanged(e){const t={...this.props.attributes};switch(t.pgn="",t.attachmentId=-1,t.gameIndex=0,e){case"inline":t.pgn=this.state.localPgn;break;case"url":t.attachmentId=this.state.localAttachementId,t.gameIndex=this.state.localGameIndex}this.setState({sourceType:e}),this.props.setAttributes(t)}handleInlineSourceChanged(e){this.setState({localPgn:e}),this.handleAttributeChanged("pgn",e)}handleUrlSourceChanged(e){this.setState({localAttachementId:e}),this.handleAttributeChanged("attachmentId",e)}handleGameIndexChanged(e){this.setState({localGameIndex:e}),this.handleAttributeChanged("gameIndex",e)}handleUploadClicked(){this.mediaFrame||(this.mediaFrame=wp.media({title:zr.PGN_EDITOR_MEDIA_FRAME_TITLE,button:{text:zr.PGN_EDITOR_MEDIA_FRAME_BUTTON_LABEL},multiple:!1}),this.mediaFrame.on("select",(()=>{const e=this.mediaFrame.state().get("selection").first().toJSON();this.handleUrlSourceChanged(e.id)}))),this.mediaFrame.open()}render(){return(0,hr.jsxs)("div",{...this.props.blockProps,children:[this.renderSidePanel(),this.renderBlockContent()]})}renderSidePanel(){return(0,hr.jsxs)(Cr.InspectorControls,{children:[this.renderGameOptionPanel(),this.renderPieceSymbolsPanel(),this.renderNavigationBoardPanel(),this.renderDiagramOptionPanel()]})}renderGameOptionPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_GAME_OPTIONS,children:[(0,hr.jsx)(Ar.ToggleControl,{label:zr.PGN_EDITOR_CONTROL_FLIP,checked:this.props.attributes.flipped,onChange:()=>this.handleFlipClicked()}),this.renderInitialSelectionSelector()]})}renderInitialSelectionSelector(){const e=""===this.props.attributes.navigationBoard?RPBChessboard.defaultSettings.navigationBoard:this.props.attributes.navigationBoard;if("none"===e||"frame"===e)return;const t="start"===this.props.attributes.initialSelection||"end"===this.props.attributes.initialSelection?this.props.attributes.initialSelection:"custom",i="custom"===t?(0,hr.jsx)(Ar.TextControl,{value:this.props.attributes.initialSelection,onChange:e=>this.handleAttributeChanged("initialSelection",e),help:zr.PGN_EDITOR_HELP_INITIAL_SELECTION}):void 0;return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_INITIAL_SELECTION,selected:t,onChange:e=>this.handleInitialSelectionCodeChanged(e),options:[{label:zr.PGN_EDITOR_OPTION_START,value:"start"},{label:zr.PGN_EDITOR_OPTION_END,value:"end"},{label:zr.PGN_EDITOR_OPTION_CUSTOM_MOVE,value:"custom"}]}),i]})}renderPieceSymbolsPanel(){const e=[..."KQRBNP"].some((e=>zr.PIECE_SYMBOLS[e]!==e)),{code:t,elements:i,futureElements:r}=this.getPieceSymbols(e),n=[];n.push({label:zr.PGN_EDITOR_USE_DEFAULT,value:""}),n.push({label:zr.PGN_EDITOR_OPTION_NATIVE,value:"native"}),e&&n.push({label:zr.PGN_EDITOR_OPTION_LOCALIZED,value:"localized"}),n.push({label:zr.PGN_EDITOR_OPTION_FIGURINES,value:"figurines"}),n.push({label:zr.PGN_EDITOR_OPTION_CUSTOM,value:"custom"});const o="custom"!==t;return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_PIECE_SYMBOLS,initialOpen:!1,children:[(0,hr.jsx)(Ar.PanelRow,{children:(0,hr.jsx)(Ar.RadioControl,{selected:t,onChange:e=>this.handlePieceSymbolCodeChanged(e,r),options:n})}),(0,hr.jsxs)(Ar.PanelRow,{children:[(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.K,disabled:o,onChange:e=>this.handlePieceSymbolChanged("K",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.Q,disabled:o,onChange:e=>this.handlePieceSymbolChanged("Q",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.R,disabled:o,onChange:e=>this.handlePieceSymbolChanged("R",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.B,disabled:o,onChange:e=>this.handlePieceSymbolChanged("B",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.N,disabled:o,onChange:e=>this.handlePieceSymbolChanged("N",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.P,disabled:o,onChange:e=>this.handlePieceSymbolChanged("P",e,r)})]})]})}renderNavigationBoardPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_NAVIGATION_BOARD,initialOpen:!1,children:[(0,hr.jsx)(Ar.RadioControl,{selected:this.props.attributes.navigationBoard,onChange:e=>this.handleAttributeChanged("navigationBoard",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_NONE,value:"none"},{label:zr.PGN_EDITOR_OPTION_FRAME,value:"frame"},{label:zr.PGN_EDITOR_OPTION_ABOVE,value:"above"},{label:zr.PGN_EDITOR_OPTION_BELOW,value:"below"},{label:zr.PGN_EDITOR_OPTION_FLOAT_LEFT,value:"floatLeft"},{label:zr.PGN_EDITOR_OPTION_FLOAT_RIGHT,value:"floatRight"},{label:zr.PGN_EDITOR_OPTION_SCROLL_LEFT,value:"scrollLeft"},{label:zr.PGN_EDITOR_OPTION_SCROLL_RIGHT,value:"scrollRight"}]}),this.renderNavigationBoardOptionFields()]})}renderNavigationBoardOptionFields(){const e=""===this.props.attributes.navigationBoard?RPBChessboard.defaultSettings.navigationBoard:this.props.attributes.navigationBoard;if("none"===e||"frame"===e)return;const t=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_PLAY_BUTTON,selected:this.props.attributes.withPlayButton,onChange:e=>this.handleAttributeChanged("withPlayButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),i=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_FLIP_BUTTON,selected:this.props.attributes.withFlipButton,onChange:e=>this.handleAttributeChanged("withFlipButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),r=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_DOWNLOAD_BUTTON,selected:this.props.attributes.withDownloadButton,onChange:e=>this.handleAttributeChanged("withDownloadButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]});return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.nboSquareSize,squareSize:this.props.attributes.nboSquareSize,coordinateVisible:this.props.attributes.nboCoordinateVisible,turnVisible:this.props.attributes.nboTurnVisible,colorset:this.props.attributes.nboColorset,pieceset:this.props.attributes.nboPieceset,onSquareSizeChanged:e=>this.handleAttributeChanged("nboSquareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("nboCoordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("nboTurnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("nboColorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("nboPieceset",e)}),(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_ANIMATED,selected:this.props.attributes.nboAnimated,onChange:e=>this.handleAttributeChanged("nboAnimated",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_DISABLED,value:"false"},{label:zr.PGN_EDITOR_OPTION_ENABLED,value:"true"}]}),(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_MOVE_ARROW,selected:this.props.attributes.nboMoveArrowVisible,onChange:e=>this.handleAttributeChanged("nboMoveArrowVisible",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),this.renderMoveArrowColorFields(),t,i,r]})}renderMoveArrowColorFields(){if(!(""===this.props.attributes.nboMoveArrowVisible?RPBChessboard.defaultSettings.moveArrowVisible:"true"===this.props.attributes.nboMoveArrowVisible))return;const e=""===this.props.attributes.nboMoveArrowColor,t=(0,hr.jsx)(Ar.ToggleControl,{label:zr.PGN_EDITOR_USE_DEFAULT_MOVE_ARROW_COLOR,checked:e,onChange:()=>this.handleAttributeChanged("nboMoveArrowColor",e?RPBChessboard.defaultSettings.moveArrowColor:"")});if(e)return t;function i({color:e}){return(0,hr.jsx)(Ar.__experimentalRadio,{value:e,children:(0,hr.jsx)(D,{color:$r["c"+e],size:24})})}return(0,hr.jsxs)(hr.Fragment,{children:[t,(0,hr.jsxs)(Ar.__experimentalRadioGroup,{className:"rpbchessboard-restoreMarginBottom",checked:this.props.attributes.nboMoveArrowColor,onChange:e=>this.handleAttributeChanged("nboMoveArrowColor",e),children:[(0,hr.jsx)(i,{color:"b"}),(0,hr.jsx)(i,{color:"g"}),(0,hr.jsx)(i,{color:"r"}),(0,hr.jsx)(i,{color:"y"})]})]})}renderDiagramOptionPanel(){return(0,hr.jsx)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_DIAGRAM_OPTIONS,initialOpen:!1,children:(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.idoSquareSize,squareSize:this.props.attributes.idoSquareSize,coordinateVisible:this.props.attributes.idoCoordinateVisible,turnVisible:this.props.attributes.idoTurnVisible,colorset:this.props.attributes.idoColorset,pieceset:this.props.attributes.idoPieceset,onSquareSizeChanged:e=>this.handleAttributeChanged("idoSquareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("idoCoordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("idoTurnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("idoColorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("idoPieceset",e)})})}renderBlockContent(){return(0,hr.jsxs)("div",{className:"components-placeholder rpbchessboard-fixPlaceholder",children:[this.renderSourceTypeSelector(),this.renderTextAreaIfSourceIsInline(),this.renderMediaSelectorIfSourceIsURL()]})}renderSourceTypeSelector(){return(0,hr.jsxs)(Ar.__experimentalRadioGroup,{className:"rpbchessboard-pgnSourceTypeSelector",checked:this.state.sourceType,onChange:e=>this.handleSourceTypeChanged(e),children:[(0,hr.jsx)(Ar.__experimentalRadio,{value:"inline",children:"PGN text"}),(0,hr.jsx)(Ar.__experimentalRadio,{value:"url",children:"PGN file"})]})}renderTextAreaIfSourceIsInline(){if("inline"===this.state.sourceType)return(0,hr.jsx)("textarea",{className:"block-editor-plain-text blocks-shortcode__textarea rpbchessboard-fixMarginBottom rpbchessboard-pgnTextarea",value:this.props.attributes.pgn,onChange:e=>this.handleInlineSourceChanged(e.target.value)})}renderMediaSelectorIfSourceIsURL(){if("url"!==this.state.sourceType)return;const e=this.props.attributes.attachmentId;return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsxs)("div",{className:"rpbchessboard-pgnFileSelector",children:[(0,hr.jsx)(Ar.Button,{variant:"primary",text:zr.PGN_EDITOR_UPLOAD_BUTTON_LABEL,onClick:()=>this.handleUploadClicked()}),e>=0?(0,hr.jsx)(Wr,{attachmentId:e}):void 0]}),(0,hr.jsx)(Ar.__experimentalNumberControl,{label:zr.PGN_EDITOR_CONTROL_GAME_INDEX,labelPosition:"side",min:0,value:this.props.attributes.gameIndex,onChange:e=>this.handleGameIndexChanged(Number(e))})]})}getPieceSymbols(e){const t=""===this.props.attributes.pieceSymbols,i=t?RPBChessboard.defaultSettings.pieceSymbols:this.props.attributes.pieceSymbols,r=Ir(i);if(r)return{code:t?"":"custom",elements:r,futureElements:r};if("figurines"===i)return{code:t?"":"figurines",elements:{K:"-",Q:"-",R:"-",B:"-",N:"-",P:"-"},futureElements:{K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"}};if("localized"===i&&e){const e={K:zr.PIECE_SYMBOLS.K,Q:zr.PIECE_SYMBOLS.Q,R:zr.PIECE_SYMBOLS.R,B:zr.PIECE_SYMBOLS.B,N:zr.PIECE_SYMBOLS.N,P:zr.PIECE_SYMBOLS.P};return{code:t?"":"localized",elements:e,futureElements:e}}{const e={K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"};return{code:t?"":"native",elements:e,futureElements:e}}}}Kr.propTypes={blockProps:lr().object,attributes:lr().object,setAttributes:lr().func},RPBChessboard.renderAdminFENIcon=function(e){(0,n.H)(e).render((0,hr.jsx)(Gr,{}))},RPBChessboard.renderAdminPGNIcon=function(e){(0,n.H)(e).render((0,hr.jsx)(Hr,{}))},RPBChessboard.renderAdminArrowMarkerIcon=function(e,t){const i=(0,hr.jsx)(D,{...t});(0,n.H)(e).render(i)},RPBChessboard.renderAdminChessboard=function(e,t){const i=(0,hr.jsx)(vt,{...t});(0,n.H)(e).render(i)},RPBChessboard.renderAdminNavigationBoard=function(e,t){const i=t.downloadButtonVisible?[{iconPath:dr,tooltip:RPBChessboard.i18n.PGN_TOOLTIP_DOWNLOAD}]:[],r=(0,hr.jsx)(or,{...t,additionalButtons:i});(0,n.H)(e).render(r)},RPBChessboard.renderFEN=function(e,t){const i=(0,hr.jsx)(vt,{position:t.position,squareMarkers:t.squareMarkers,arrowMarkers:t.arrowMarkers,textMarkers:t.textMarkers,flipped:t.flipped,squareSize:t.squareSize,coordinateVisible:t.coordinateVisible,turnVisible:t.turnVisible,colorset:t.colorset,pieceset:t.pieceset,smallScreenLimits:RPBChessboard.smallScreenLimits});(0,n.H)(document.getElementById(e)).render(i)},RPBChessboard.renderPGN=function(e,t){const i={flipped:t.flipped,squareSize:t.idoSquareSize,coordinateVisible:t.idoCoordinateVisible,turnVisible:t.idoTurnVisible,colorset:t.idoColorset,pieceset:t.idoPieceset,smallScreenLimits:RPBChessboard.smallScreenLimits},r={flipped:t.flipped,squareSize:t.nboSquareSize,coordinateVisible:t.nboCoordinateVisible,turnVisible:t.nboTurnVisible,colorset:t.nboColorset,pieceset:t.nboPieceset,animated:t.nboAnimated,moveArrowVisible:t.nboMoveArrowVisible,moveArrowColor:t.nboMoveArrowColor,smallScreenLimits:RPBChessboard.smallScreenLimits,playButtonVisible:t.withPlayButton,flipButtonVisible:t.withFlipButton,downloadButtonVisible:t.withDownloadButton},o=(0,hr.jsx)(Sr,{url:t.url,pgn:t.pgn,gameIndex:t.gameIndex,initialSelection:t.initialSelection,pieceSymbols:t.pieceSymbols,diagramOptions:i,navigationBoardOptions:r,navigationBoard:t.navigationBoard});(0,n.H)(document.getElementById(e)).render(o)};try{t.INVALID_FEN_ERROR_TITLE=RPBChessboard.i18n.FEN_PARSING_ERROR_TITLE,t.ANNOTATED_BY=RPBChessboard.i18n.PGN_ANNOTATED_BY,t.LINE=RPBChessboard.i18n.PGN_LINE_REF,t.PIECE_SYMBOLS={K:RPBChessboard.i18n.PIECE_SYMBOLS.K,Q:RPBChessboard.i18n.PIECE_SYMBOLS.Q,R:RPBChessboard.i18n.PIECE_SYMBOLS.R,B:RPBChessboard.i18n.PIECE_SYMBOLS.B,N:RPBChessboard.i18n.PIECE_SYMBOLS.N,P:RPBChessboard.i18n.PIECE_SYMBOLS.P},t.TOOLTIP_GO_FIRST=RPBChessboard.i18n.PGN_TOOLTIP_GO_FIRST,t.TOOLTIP_GO_PREVIOUS=RPBChessboard.i18n.PGN_TOOLTIP_GO_PREVIOUS,t.TOOLTIP_GO_NEXT=RPBChessboard.i18n.PGN_TOOLTIP_GO_NEXT,t.TOOLTIP_GO_LAST=RPBChessboard.i18n.PGN_TOOLTIP_GO_LAST,t.TOOLTIP_PLAY_STOP=RPBChessboard.i18n.PGN_TOOLTIP_PLAY_STOP,t.TOOLTIP_FLIP=RPBChessboard.i18n.PGN_TOOLTIP_FLIP,RPBChessboard.availableSquareSize={min:vt.minSquareSize(),max:vt.maxSquareSize()},Object.assign(vt.colorsets(),RPBChessboard.customColorsets),Object.assign(vt.piecesets(),RPBChessboard.customPiecesets),RPBChessboard.colorsetData=vt.colorsets(),RPBChessboard.piecesetData=vt.piecesets(),RPBChessboard.editColorset=vt.colorsets()._edit_={},RPBChessboard.editPieceset=vt.piecesets()._edit_={},(0,yr.registerBlockType)("rpb-chessboard/fen",{apiVersion:2,title:Vr.FEN_EDITOR_TITLE,icon:(0,hr.jsx)(Gr,{}),category:"media",attributes:{position:{type:"string",default:"start"},flipped:{type:"boolean",default:!1},squareMarkers:{type:"object",default:{}},arrowMarkers:{type:"object",default:{}},textMarkers:{type:"object",default:{}},align:{type:"string",default:""},squareSize:{type:"number",default:0},coordinateVisible:{type:"string",default:""},turnVisible:{type:"string",default:""},colorset:{type:"string",default:""},pieceset:{type:"string",default:""}},example:{attributes:{squareSize:32}},edit:({attributes:e,setAttributes:t})=>{const i=(0,Cr.useBlockProps)();return(0,hr.jsx)(Ur,{blockProps:i,attributes:e,setAttributes:t})}}),(0,yr.registerBlockType)("rpb-chessboard/pgn",{apiVersion:2,title:zr.PGN_EDITOR_TITLE,icon:(0,hr.jsx)(Hr,{}),category:"media",attributes:{pgn:{type:"string",default:""},attachmentId:{type:"number",default:-1},gameIndex:{type:"number",default:0},flipped:{type:"boolean",default:!1},initialSelection:{type:"string",default:"start"},pieceSymbols:{type:"string",default:""},navigationBoard:{type:"string",default:""},nboSquareSize:{type:"number",default:0},nboCoordinateVisible:{type:"string",default:""},nboTurnVisible:{type:"string",default:""},nboColorset:{type:"string",default:""},nboPieceset:{type:"string",default:""},nboAnimated:{type:"string",default:""},nboMoveArrowVisible:{type:"string",default:""},nboMoveArrowColor:{type:"string",default:""},idoSquareSize:{type:"number",default:0},idoCoordinateVisible:{type:"string",default:""},idoTurnVisible:{type:"string",default:""},idoColorset:{type:"string",default:""},idoPieceset:{type:"string",default:""},withPlayButton:{type:"string",default:""},withFlipButton:{type:"string",default:""},withDownloadButton:{type:"string",default:""}},edit:({attributes:e,setAttributes:t})=>{const i=(0,Cr.useBlockProps)();return(0,hr.jsx)(Kr,{blockProps:i,attributes:e,setAttributes:t})}})}catch(e){console.error("Error while initializing RPB Chessboard: the plugin may not work properly.",e)}})()})();
     1(()=>{var e={8387:(e,t,i)=>{i.p=RPBChessboard.publicURL+"build/"},9830:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Database=void 0,t.isValidGameIndex=n;const r=i(8698);function n(e){return Number.isInteger(e)&&e>=0}t.Database=class{constructor(){}gameCount(){return this.doGameCount()}game(e){if(!n(e))throw new r.IllegalArgument("Database.game()");return this.doGame(e)}games(){const e=this.doGameCount(),t=e=>this.doGame(e);return{[Symbol.iterator]:()=>new o(e,t)}}};class o{constructor(e,t){this.gameIndex=0,this.gameCount=e,this.gameLoader=t}next(){for(;this.gameIndex<this.gameCount;)try{return{done:!1,value:this.gameLoader(this.gameIndex++)}}catch(e){if(!(e instanceof r.InvalidPGN))throw e}return{done:!0,value:void 0}}}},4633:function(e,t,i){"use strict";var r,n,o,s,a=this&&this.__classPrivateFieldSet||function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},l=this&&this.__classPrivateFieldGet||function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValue=void 0;const c=i(8698);class u{constructor(e,t,i){if(r.set(this,void 0),n.set(this,void 0),o.set(this,void 0),s.set(this,void 0),e instanceof Date)a(this,r,"ymd","f"),a(this,n,e.getFullYear(),"f"),a(this,o,e.getMonth()+1,"f"),a(this,s,e.getDate(),"f");else{const l=p(e,t,i);if(!l)throw new c.IllegalArgument("DateValue()");a(this,r,l,"f"),a(this,n,e,"f"),a(this,o,t??void 0,"f"),a(this,s,i??void 0,"f")}}type(){return l(this,r,"f")}year(){return l(this,n,"f")}month(){if(void 0===l(this,o,"f"))throw new c.IllegalArgument("DateValue.month()");return l(this,o,"f")}day(){if(void 0===l(this,s,"f"))throw new c.IllegalArgument("DateValue.day()");return l(this,s,"f")}toDate(){const e=void 0===l(this,o,"f")?0:l(this,o,"f")-1,t=void 0===l(this,s,"f")?1:l(this,s,"f");return new Date(l(this,n,"f"),e,t)}toString(){return d(l(this,n,"f"),l(this,o,"f"),l(this,s,"f"),"-","**")}static fromString(e){if("string"!=typeof e)throw new c.IllegalArgument("DateValue.fromString()");return h(e,/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/,/^([0-9]{4})-([0-9]{2})-\*\*$/,/^([0-9]{4})-\*\*-\*\*$/,!1)}toPGNString(){return d(l(this,n,"f"),l(this,o,"f"),l(this,s,"f"),".","??")}static fromPGNString(e){if("string"!=typeof e)throw new c.IllegalArgument("DateValue.fromPGNString()");return h(e,/^([0-9]{4})\.([0-9]{2})\.([0-9]{2})$/,/^([0-9]{4})\.([0-9]{2})\.\?\?$/,/^([0-9]{4})(?:\.\?\?\.\?\?)?$/,!0)}toHumanReadableString(e){switch(l(this,r,"f")){case"ymd":{const t=new Date(l(this,n,"f"),l(this,o,"f")-1,l(this,s,"f"));return new Intl.DateTimeFormat(e,{dateStyle:"long"}).format(t)}case"ym":{const t=new Date(l(this,n,"f"),l(this,o,"f")-1,1);return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}default:return String(l(this,n,"f"))}}static isValid(e,t,i){return Boolean(p(e,t,i))}}function d(e,t,i,r,n){return String(e).padStart(4,"0")+r+(void 0===t?n:String(t).padStart(2,"0"))+r+(void 0===i?n:String(i).padStart(2,"0"))}function h(e,t,i,r,n){if(t.test(e)){const e=RegExp.$1,t=RegExp.$2,i=RegExp.$3,r=parseInt(e,10),o=parseInt(t,10),s=parseInt(i,10);return u.isValid(r,o,s)?new u(r,o,s):n?u.isValid(r,o)?new u(r,o):new u(r):void 0}if(i.test(e)){const e=RegExp.$1,t=RegExp.$2,i=parseInt(e,10),r=parseInt(t,10);return u.isValid(i,r)?new u(i,r):n?new u(i):void 0}if(r.test(e)){const e=parseInt(RegExp.$1,10);return new u(e)}}function p(e,t,i){return null!=i?!!(f(e)&&g(t)&&Number.isInteger(i)&&i>=1&&i<=function(e,t){return new Date(e,t,0).getDate()}(e,t))&&"ymd":null!=t?!(!f(e)||!g(t))&&"ym":!!f(e)&&"y"}function f(e){return Number.isInteger(e)&&e>=0}function g(e){return Number.isInteger(e)&&e>=1&&e<=12}t.DateValue=u,r=new WeakMap,n=new WeakMap,o=new WeakMap,s=new WeakMap},8698:(e,t)=>{"use strict";function i(e,t){return e.replace(/{(\d+)}/g,((e,i)=>{const r=Number(i);return r<t.length?String(t[r]):e}))}function r(e,t){return e+" -> "+t}Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidPOJO=t.InvalidPGN=t.InvalidNotation=t.InvalidFEN=t.IllegalArgument=void 0,t.IllegalArgument=class{constructor(e){this.functionName=e}toString(){return`Illegal argument in function ${this.functionName}`}},t.InvalidFEN=class{constructor(e,t,...r){this.fen=e,this.message=i(t,r)}toString(){return r("InvalidFEN",this.message)}},t.InvalidNotation=class{constructor(e,t,r,...n){this.fen=e,this.notation=t,this.message=i(r,n)}toString(){return r("InvalidNotation",this.message)}},t.InvalidPGN=class{constructor(e,t,r,n,...o){this.pgn=e,this.index=t,this.lineNumber=r,this.message=i(n,o)}toString(){return r("InvalidPGN",`[character=${this.index} line=${this.lineNumber}] ${this.message}`)}},t.InvalidPOJO=class{constructor(e,t,r,...n){this.pojo=e,this.fieldName=t,this.message=i(r,n)}toString(){return r("InvalidPOJO",this.message)}}},2525:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Game=void 0;const r=i(4633),n=i(8698),o=i(999),s=i(9955),a=i(6472),l=i(2493),c=i(943),u=i(9013),d=i(9457);class h{constructor(){this._playerName=[void 0,void 0],this._playerElo=[void 0,void 0],this._playerTitle=[void 0,void 0],this._round=[void 0,void 0,void 0],this._result=3,this._moveTreeRoot=new c.MoveTreeRoot}clearHeaders(){this._playerName=[void 0,void 0],this._playerElo=[void 0,void 0],this._playerTitle=[void 0,void 0],this._event=void 0,this._round=[void 0,void 0,void 0],this._date=void 0,this._site=void 0,this._annotator=void 0,this._eco=void 0,this._opening=void 0,this._openingVariation=void 0,this._openingSubVariation=void 0,this._termination=void 0,this._result=3}playerName(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerName()");if(1===arguments.length)return this._playerName[i];this._playerName[i]=p(t)}playerElo(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerElo()");if(1===arguments.length)return this._playerElo[i];if(void 0!==(t=f(t))&&!(0,l.isValidElo)(t))throw new n.IllegalArgument("Game.playerElo()");this._playerElo[i]=t}playerTitle(e,t){const i=(0,d.colorFromString)(e);if(i<0)throw new n.IllegalArgument("Game.playerTitle()");if(1===arguments.length)return this._playerTitle[i];this._playerTitle[i]=p(t)}event(e){if(0===arguments.length)return this._event;this._event=p(e)}round(e){if(0===arguments.length)return this._round[0];this._setRoundPart(0,e,"Game.round()")}subRound(e){if(0===arguments.length)return this._round[1];this._setRoundPart(1,e,"Game.subRound()")}subSubRound(e){if(0===arguments.length)return this._round[2];this._setRoundPart(2,e,"Game.subSubRound()")}_setRoundPart(e,t,i){if(void 0!==(t=f(t))&&!(0,l.isValidRound)(t))throw new n.IllegalArgument(i);this._round[e]=t}fullRound(){return b(this._round[0],this._round[1],this._round[2],"?")}date(e,t,i){switch(arguments.length){case 0:return this._date;case 1:if(null==e)this._date=void 0;else if(e instanceof r.DateValue)this._date=e;else if(e instanceof Date)this._date=new r.DateValue(e);else{if(!r.DateValue.isValid(e))throw new n.IllegalArgument("Game.date()");this._date=new r.DateValue(e)}break;default:if(!r.DateValue.isValid(e,t,i))throw new n.IllegalArgument("Game.date()");this._date=new r.DateValue(e,t,i)}}dateAsDate(){return void 0===this._date?void 0:this._date.toDate()}dateAsString(e){return void 0===this._date?void 0:this._date.toHumanReadableString(e)}site(e){if(0===arguments.length)return this._site;this._site=p(e)}annotator(e){if(0===arguments.length)return this._annotator;this._annotator=p(e)}eco(e){if(0===arguments.length)return this._eco;if(void 0!==(e=p(e))&&!(0,o.isValidECO)(e))throw new n.IllegalArgument("Game.eco()");this._eco=e}opening(e){if(0===arguments.length)return this._opening;this._opening=p(e)}openingVariation(e){if(0===arguments.length)return this._openingVariation;this._openingVariation=p(e)}openingSubVariation(e){if(0===arguments.length)return this._openingSubVariation;this._openingSubVariation=p(e)}termination(e){if(0===arguments.length)return this._termination;this._termination=p(e)}result(e){if(0===arguments.length)return(0,d.resultToString)(this._result);{const t=(0,d.resultFromString)(e);if(t<0)throw new n.IllegalArgument("Game.result()");this._result=t}}variant(){return this._moveTreeRoot._position.variant()}initialPosition(e,t){if(0===arguments.length)return new a.Position(this._moveTreeRoot._position);if(!(e instanceof a.Position))throw new n.IllegalArgument("Game.initialPosition()");if(arguments.length>=2){if(!Number.isInteger(t))throw new n.IllegalArgument("Game.initialPosition()");this._moveTreeRoot._fullMoveNumber=t}else this._moveTreeRoot._fullMoveNumber=1;this._moveTreeRoot._position=new a.Position(e),this._moveTreeRoot.clearTree()}initialFEN(){return this._moveTreeRoot._position.fen({fiftyMoveClock:0,fullMoveNumber:this._moveTreeRoot._fullMoveNumber})}initialFullMoveNumber(){return this._moveTreeRoot._fullMoveNumber}finalPosition(){return this._moveTreeRoot.mainVariation().finalPosition()}finalFEN(){return this._moveTreeRoot.mainVariation().finalFEN()}mainVariation(){return this._moveTreeRoot.mainVariation()}nodes(e=!1){if(!e)return this.mainVariation().nodes();const t=[];return function e(i){for(const r of i.nodes()){for(const t of r.variations())e(t);t.push(r)}}(this.mainVariation()),t}plyCount(){return this._moveTreeRoot.mainVariation().plyCount()}findById(e,t=!0){return this._moveTreeRoot.findById(e,t)}pojo(){const e={};function t(e,t){return void 0===e._playerName[t]&&void 0===e._playerElo[t]&&void 0===e._playerTitle[t]}function i(e,t){const i={};return void 0!==e._playerName[t]&&(i.name=e._playerName[t]),void 0!==e._playerElo[t]&&(i.elo=e._playerElo[t]),void 0!==e._playerTitle[t]&&(i.title=e._playerTitle[t]),i}return t(this,0)||(e.white=i(this,0)),t(this,1)||(e.black=i(this,1)),void 0!==this._event&&(e.event=this._event),void 0!==this._round[0]&&(e.round=this._round[0]),void 0!==this._round[1]&&(e.subRound=this._round[1]),void 0!==this._round[2]&&(e.subSubRound=this._round[2]),void 0!==this._date&&(e.date=this._date.toString()),void 0!==this._site&&(e.site=this._site),void 0!==this._annotator&&(e.annotator=this._annotator),void 0!==this._eco&&(e.eco=this._eco),void 0!==this._opening&&(e.opening=this._opening),void 0!==this._openingVariation&&(e.openingVariation=this._openingVariation),void 0!==this._openingSubVariation&&(e.openingSubVariation=this._openingSubVariation),void 0!==this._termination&&(e.termination=this._termination),3!==this._result&&(e.result=this.result()),this._moveTreeRoot.getPojo(e),e}static fromPOJO(e){if("object"!=typeof e||null===e)throw new n.InvalidPOJO(e,"",s.i18n.POJO_MUST_BE_AN_OBJECT);const t=new h,i=new u.POJOExceptionBuilder(e);function a(e,r){(0,u.decodeStringField)(e,"name",i,(e=>{t._playerName[r]=e})),(0,u.decodeNumberField)(e,"elo",i,(e=>{if(!(0,l.isValidElo)(e))throw i.build(s.i18n.INVALID_ELO_IN_POJO);t._playerElo[r]=e})),(0,u.decodeStringField)(e,"title",i,(e=>{t._playerTitle[r]=e}))}function c(e,r){if(!(0,l.isValidRound)(e))throw i.build(s.i18n.INVALID_ROUND_IN_POJO);t._round[r]=e}return(0,u.decodeObjectField)(e,"white",i,(e=>{a(e,0)})),(0,u.decodeObjectField)(e,"black",i,(e=>{a(e,1)})),(0,u.decodeStringField)(e,"event",i,(e=>{t._event=e})),(0,u.decodeNumberField)(e,"round",i,(e=>{c(e,0)})),(0,u.decodeNumberField)(e,"subRound",i,(e=>{c(e,1)})),(0,u.decodeNumberField)(e,"subSubRound",i,(e=>{c(e,2)})),(0,u.decodeStringField)(e,"date",i,(e=>{const n=r.DateValue.fromString(e);if(void 0===n)throw i.build(s.i18n.INVALID_DATE_IN_POJO);t._date=n})),(0,u.decodeStringField)(e,"site",i,(e=>{t._site=e})),(0,u.decodeStringField)(e,"annotator",i,(e=>{t._annotator=e})),(0,u.decodeStringField)(e,"eco",i,(e=>{if(!(0,o.isValidECO)(e))throw i.build(s.i18n.INVALID_ECO_CODE_IN_POJO);t._eco=e})),(0,u.decodeStringField)(e,"opening",i,(e=>{t._opening=e})),(0,u.decodeStringField)(e,"openingVariation",i,(e=>{t._openingVariation=e})),(0,u.decodeStringField)(e,"openingSubVariation",i,(e=>{t._openingSubVariation=e})),(0,u.decodeStringField)(e,"termination",i,(e=>{t._termination=e})),(0,u.decodeStringField)(e,"result",i,(e=>{const r=(0,d.resultFromString)(e);if(r<0)throw i.build(s.i18n.INVALID_RESULT_IN_POJO);t._result=r})),t._moveTreeRoot.setPojo(e,i),t}ascii(){const e=[];function t(t){void 0!==t&&e.push(t)}t(function(e,t,i,r){if(void 0===e&&void 0===t&&void 0===i&&void 0===r)return;let n=void 0===e?"Event: <undefined>":`Event: ${g(e)}`;const o=b(t,i,r,"*");return void 0!==o&&(n+=` (${o})`),n}(this._event,this._round[0],this._round[1],this._round[2])),t(m("Site",this._site)),t(m("Date",this.dateAsString("en-us"))),t(v("White",this._playerName[0],this._playerElo[0],this._playerTitle[0])),t(v("Black",this._playerName[1],this._playerElo[1],this._playerTitle[1])),t(m("Annotator",this._annotator)),t(m("ECO",this._eco)),t(function(e,t,i){if(void 0===e&&void 0===t&&void 0===i)return;let r=void 0===e?"Opening: <undefined>":`Opening: ${g(e)}`;return void 0!==i?r+=` (${void 0===t?"<undefined>":g(t)}, ${g(i)})`:void 0!==t&&(r+=` (${g(t)})`),r}(this._opening,this._openingVariation,this._openingSubVariation)),t(m("Termination",this._termination));const i=this._moveTreeRoot._position.variant();function r(e){return void 0!==e.first()||e.nags().length>0||e.tags().length>0||void 0!==e.comment()}function n(t,i,n){const o=i+t.fullMoveNumber()+("w"===t.moveColor()?".":"...")+t.notation(),a=_(t);e.push(0===a.length?o:o+" "+a.join(" "));let l=!1;for(const o of t.variations())r(o)&&(e.push(i+" |"),s(o,i+(n?" |  ":"    "),i+" +- ",!1),l=!0);return l}function s(t,i,r,o){const s=_(t);s.length>0&&e.push(r+s.join(" "));let a=t.first(),l=!1,c=!0;for(;void 0!==a;){l&&e.push(i+" |");const t=a.next();l=n(a,c&&0===s.length?r:i,o||void 0!==t),c=!1,a=t}}return"regular"!==i&&e.push("Variant: "+i),(0,o.variantWithCanonicalStartPosition)(i)&&a.Position.isEqual(this._moveTreeRoot._position,new a.Position(i))||e.push(this._moveTreeRoot._position.ascii()),s(this._moveTreeRoot.mainVariation(),"","",!1),e.push((0,d.resultToString)(this._result)),e.join("\n")}}function p(e){return null==e?void 0:String(e)}function f(e){return null==e?void 0:Number(e)}function g(e){return""===(e=(0,l.trimAndCollapseSpaces)(e))?"<empty>":e}function m(e,t){return void 0===t?void 0:`${e}: ${g(t)}`}function b(e,t,i,r){if(void 0===e&&void 0===t&&void 0===i)return;let n=void 0===e?r:String(e);return void 0===t&&void 0===i||(n+="."+(t??r)),void 0!==i&&(n+="."+i),n}function v(e,t,i,r){if(void 0===t&&void 0===i&&void 0===r)return;let n=void 0===t?`${e}: <undefined>`:`${e}: ${g(t)}`;return void 0!==i&&void 0!==r?n+=` (${g(r)} ${i})`:void 0!==i?n+=` (${i})`:void 0!==r&&(n+=` (${g(r)})`),n}function _(e){const t=[];for(const i of e.nags())t.push((0,o.nagSymbol)(i));for(const i of e.tags())t.push(`${i}={${(0,l.trimAndCollapseSpaces)(e.tag(i))}}`);const i=e.comment();return void 0!==i&&t.push(g(i)),t}t.Game=h},999:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isColor=function(e){return(0,n.colorFromString)(e)>=0},t.isPiece=function(e){return(0,n.pieceFromString)(e)>=0},t.isColoredPiece=function(e){return(0,n.coloredPieceFromString)(e)>=0},t.isFile=function(e){return(0,n.fileFromString)(e)>=0},t.isRank=function(e){return(0,n.rankFromString)(e)>=0},t.isSquare=function(e){return(0,n.squareFromString)(e)>=0},t.isSquareCouple=function(e){return"string"==typeof e&&/^[a-h][1-8][a-h][1-8]$/.test(e)},t.isCastle=function(e){return"string"==typeof e&&/^[wb][kq]$/.test(e)},t.isCastle960=function(e){return"string"==typeof e&&/^[wb][a-h]$/.test(e)},t.isGameResult=function(e){return(0,n.resultFromString)(e)>=0},t.isGameVariant=function(e){return(0,n.variantFromString)(e)>=0},t.forEachSquare=function(e){for(let t=0;t<8;++t)for(let i=0;i<8;++i)e((0,n.squareToString)(16*t+i))},t.squareColor=function(e){const t=(0,n.squareFromString)(e);if(t<0)throw new r.IllegalArgument("squareColor()");return(0,n.colorToString)((0,n.squareColorImpl)(t))},t.squareToCoordinates=function(e){const t=(0,n.squareFromString)(e);if(t<0)throw new r.IllegalArgument("squareToCoordinates()");return{rank:Math.trunc(t/16),file:t%16}},t.coordinatesToSquare=function(e,t){const i="number"==typeof e?e:e.file,o="number"==typeof e?t:e.rank;if(!Number.isInteger(i)||!Number.isInteger(o)||i<0||i>=8||o<0||o>=8)throw new r.IllegalArgument("coordinatesToSquare()");return(0,n.fileToString)(i)+(0,n.rankToString)(o)},t.oppositeColor=function(e){const t=(0,n.colorFromString)(e);if(t<0)throw new r.IllegalArgument("oppositeColor()");return(0,n.colorToString)(1-t)},t.variantWithCanonicalStartPosition=function(e){const t=(0,n.variantFromString)(e);if(t<0)throw new r.IllegalArgument("variantWithCanonicalStartPosition()");return(0,o.hasCanonicalStartPosition)(t)},t.nagSymbol=function(e){if(!(0,s.isValidNag)(e))throw new r.IllegalArgument("nagSymbol()");return a.get(e)??"$"+e},t.isValidECO=function(e){return"string"==typeof e&&/^[A-E][0-9][0-9]$/.test(e)};const r=i(8698),n=i(9457),o=i(6585),s=i(2493),a=new Map;a.set(1,"!"),a.set(2,"?"),a.set(3,"!!"),a.set(4,"??"),a.set(5,"!?"),a.set(6,"?!"),a.set(7,"□"),a.set(8,"□"),a.set(9,"☒"),a.set(10,"="),a.set(11,"="),a.set(13,"∞"),a.set(14,"⩲"),a.set(15,"⩱"),a.set(16,"±"),a.set(17,"∓"),a.set(18,"+−"),a.set(19,"−+"),a.set(20,"+−−"),a.set(21,"−−+"),a.set(22,"⨀"),a.set(32,"⟳"),a.set(36,"↑"),a.set(40,"→"),a.set(44,"⯹"),a.set(132,"⇆"),a.set(138,"⨁"),a.set(140,"∆"),a.set(141,"∇"),a.set(142,"⌓"),a.set(143,"≤"),a.set(145,"RR"),a.set(146,"N")},9955:(e,t)=>{"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.i18n=void 0,function(e){e.WRONG_NUMBER_OF_FEN_FIELDS="A FEN string must contain exactly 6 space-separated fields.",e.WRONG_NUMBER_OF_SUBFIELDS_IN_BOARD_FIELD="The 1st field of a FEN string must contain exactly 8 `/`-separated subfields.",e.UNEXPECTED_CHARACTER_IN_BOARD_FIELD="Unexpected character in the 1st field of the FEN string: `{0}`.",e.UNEXPECTED_END_OF_SUBFIELD_IN_BOARD_FIELD="Subfield {0} of the FEN string 1st field is unexpectedly short.",e.INVALID_TURN_FIELD="The 2nd field of a FEN string must be either `w` or `b`.",e.INVALID_CASTLING_FIELD="The 3rd field of a FEN string must be either `-` or a list of characters among `K`, `Q`, `k` and `q` (in this order).",e.INVALID_EN_PASSANT_FIELD="The 4th field of a FEN string must be either `-` or a square from the 3rd or 6th rank where en-passant is allowed.",e.WRONG_RANK_IN_EN_PASSANT_FIELD="The rank number indicated in the FEN string 4th field is inconsistent with respect to the 2nd field.",e.INEFFECTIVE_EN_PASSANT_FIELD="No en-passant capture can happen on file {0} in the position defined in the FEN string.",e.INVALID_HALF_MOVE_COUNT_FIELD="The 5th field of a FEN string must be a number, indicating the number of half-move since the last pawn move or capture.",e.INVALID_MOVE_NUMBER_FIELD="The 6th field of a FEN string must be a number, indicating the move number of the game.",e.INVALID_VARIANT_PREFIX="Invalid variant prefix: `{0}`.",e.INVALID_UCI_NOTATION_SYNTAX="The syntax of the UCI notation is invalid.",e.ILLEGAL_UCI_MOVE="The UCI move is not legal.",e.INVALID_MOVE_NOTATION_SYNTAX="The syntax of the move notation is invalid.",e.ILLEGAL_POSITION="The position is not legal.",e.ILLEGAL_NO_KING_CASTLING="Castling is not legal in the considered position as it has no king.",e.ILLEGAL_QUEEN_SIDE_CASTLING="Queen-side castling is not legal in the considered position.",e.ILLEGAL_KING_SIDE_CASTLING="King-side castling is not legal in the considered position.",e.NO_PIECE_CAN_MOVE_TO="No {0} can move to {1}.",e.NO_PIECE_CAN_MOVE_TO_DISAMBIGUATION="No {0} on the specified rank/file can move to {1}.",e.REQUIRE_DISAMBIGUATION="Cannot determine uniquely which {0} is supposed to move to {1}.",e.WRONG_DISAMBIGUATION_SYMBOL="Wrong disambiguation symbol (expected: `{0}`, observed: `{1}`).",e.CASTLING_MOVE_ENCODED_WITH_ZERO="Capital O must be used for castling moves (instead of digit 0).",e.TRYING_TO_CAPTURE_YOUR_OWN_PIECES="Capturing its own pieces is not legal.",e.CAPTURE_IS_MANDATORY="Capture is mandatory.",e.INVALID_PIECE_SYMBOL="Character `{0}` is not a valid piece symbol.",e.INVALID_PIECE_SYMBOL_COLOR="Invalid color for piece symbol `{0}`.",e.INVALID_CAPTURING_PAWN_MOVE="Invalid capturing pawn move.",e.INVALID_NON_CAPTURING_PAWN_MOVE="Invalid non-capturing pawn move.",e.NOT_SAFE_FOR_WHITE_KING="This move would let the white king in check.",e.NOT_SAFE_FOR_BLACK_KING="This move would let the black king in check.",e.MISSING_PROMOTION="A promoted piece must be specified for this move.",e.MISSING_PROMOTION_SYMBOL="Character `=` is required to specify a promoted piece.",e.INVALID_PROMOTED_PIECE="{0} cannot be specified as a promoted piece.",e.ILLEGAL_PROMOTION="Specifying a promoted piece is illegal for this move.",e.ILLEGAL_NULL_MOVE="Cannot play a null-move in this position.",e.MISSING_CAPTURE_SYMBOL="Capture symbol `x` is missing.",e.INVALID_CAPTURE_SYMBOL="This move is not a capture move.",e.WRONG_CHECK_CHECKMATE_SYMBOL="Wrong check/checkmate symbol (expected: `{0}`, observed: `{1}`).",e.INVALID_PGN_TOKEN="Unrecognized character or group of characters.",e.INVALID_MOVE_IN_PGN_TEXT="Invalid move ({0}). {1}",e.INVALID_FEN_IN_PGN_TEXT="Invalid FEN string in the initial position header. {0}",e.UNEXPECTED_PGN_HEADER="Unexpected PGN game header.",e.MISSING_PGN_HEADER_ID="Missing or invalid PGN game header ID.",e.MISSING_PGN_HEADER_VALUE="Missing or invalid PGN game header value.",e.MISSING_END_OF_PGN_HEADER="Missing or invalid end of PGN game header.",e.UNEXPECTED_BEGIN_OF_VARIATION="Unexpected begin of variation.",e.UNEXPECTED_END_OF_VARIATION="Unexpected end of variation.",e.UNEXPECTED_END_OF_GAME="Unexpected end of game: there are pending variations.",e.INVALID_GAME_INDEX="Game index {0} is invalid (only {1} game(s) found in the PGN data).",e.UNKNOWN_VARIANT="Unknown chess game variant ({0}).",e.VARIANT_WITHOUT_FEN="For game variant {0}, the FEN header is mandatory.",e.POJO_MUST_BE_AN_OBJECT="Unexpected non-object value passed as POJO.",e.INVALID_POJO_STRING_FIELD="Invalid value (must be a string).",e.INVALID_POJO_NUMBER_FIELD="Invalid value (must be a number).",e.INVALID_POJO_BOOLEAN_FIELD="Invalid value (must be a boolean).",e.INVALID_POJO_OBJECT_FIELD="Invalid value (must be an object).",e.INVALID_POJO_ARRAY_FIELD="Invalid value (must be an array).",e.INVALID_ELO_IN_POJO="Ill-formed elo.",e.INVALID_ROUND_IN_POJO="Ill-formed round, sub-round or sub-sub-round.",e.INVALID_DATE_IN_POJO="Ill-formed date.",e.INVALID_ECO_CODE_IN_POJO="Ill-formed ECO code.",e.INVALID_RESULT_IN_POJO="Ill-formed result.",e.INVALID_VARIANT_IN_POJO="Ill-formed variant.",e.INVALID_NAG_IN_POJO="Invalid NAG ({0}).",e.INVALID_TAG_IN_POJO="Invalid tag ({0}).",e.INVALID_MOVE_IN_POJO="Invalid move ({0}). {1}",e.INVALID_FEN_IN_POJO="Invalid initial position FEN. {0}",e.MISSING_INITIAL_POSITION_IN_POJO="For game variant {0}, the initial position field is mandatory.",e.INVALID_OR_MISSING_NODE_ARRAY="Invalid or missing node POJO array.",e.INVALID_OR_MISSING_NOTATION_FIELD="Invalid or missing node POJO.",e.NOT_A_NODE_POJO="A node POJO must be either a string or an object.",e.NOT_A_VARIATION_POJO="A variation POJO must be either an array or an object."}(i||(t.i18n=i={}))},3219:(e,t,i)=>{"use strict";t.oG=t.Wm=t.Zt=t.mD=t.bP=t.yX=t.PP=t.nH=t.VD=t.i9=t.cc=t.TL=t.WD=t.kf=t.qz=t.Sz=t.exception=t.Ru=void 0;var r=i(9955);Object.defineProperty(t,"Ru",{enumerable:!0,get:function(){return r.i18n}}),t.exception=i(8698);var n=i(999);Object.defineProperty(t,"Sz",{enumerable:!0,get:function(){return n.isSquare}}),Object.defineProperty(t,"qz",{enumerable:!0,get:function(){return n.isSquareCouple}}),Object.defineProperty(t,"kf",{enumerable:!0,get:function(){return n.isGameVariant}}),Object.defineProperty(t,"WD",{enumerable:!0,get:function(){return n.forEachSquare}}),Object.defineProperty(t,"TL",{enumerable:!0,get:function(){return n.squareColor}}),Object.defineProperty(t,"cc",{enumerable:!0,get:function(){return n.squareToCoordinates}}),Object.defineProperty(t,"i9",{enumerable:!0,get:function(){return n.coordinatesToSquare}}),Object.defineProperty(t,"VD",{enumerable:!0,get:function(){return n.oppositeColor}}),Object.defineProperty(t,"nH",{enumerable:!0,get:function(){return n.nagSymbol}});i(4633);var o=i(3616);Object.defineProperty(t,"PP",{enumerable:!0,get:function(){return o.MoveDescriptor}});var s=i(6472);Object.defineProperty(t,"yX",{enumerable:!0,get:function(){return s.Position}});var a=i(7781);Object.defineProperty(t,"bP",{enumerable:!0,get:function(){return a.Node}}),Object.defineProperty(t,"mD",{enumerable:!0,get:function(){return a.Variation}});var l=i(2525);Object.defineProperty(t,"Zt",{enumerable:!0,get:function(){return l.Game}});var c=i(9830);Object.defineProperty(t,"Wm",{enumerable:!0,get:function(){return c.Database}});var u=i(7698);Object.defineProperty(t,"oG",{enumerable:!0,get:function(){return u.pgnRead}})},3616:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveDescriptor=void 0,t.isMoveDescriptor=function(e){return e instanceof i};class i{constructor(){}toString(){let e=this.from()+this.to();return this.isPromotion()?e+=this.promotion().toUpperCase():this.isCastling()&&(e+="O"),e}}t.MoveDescriptor=i},7781:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variation=t.Node=t.AbstractNode=void 0;class i{constructor(){}}t.AbstractNode=i,t.Node=class extends i{constructor(){super()}isVariation(){return!1}toString(){return`${this.id()}[${this.notation()}]`}},t.Variation=class extends i{constructor(){super()}isVariation(){return!0}toString(){return this.id()}}},7698:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pgnRead=function(e,t){if("string"!=typeof e)throw new n.IllegalArgument("pgnRead()");if(1===arguments.length)return(0,s.readDatabase)(e);if(!(0,r.isValidGameIndex)(t))throw new n.IllegalArgument("pgnRead()");return(0,s.readOneGame)(e,t)},t.pgnWrite=function(e,t){if(null==t&&(t={}),e instanceof o.Game)return(0,a.writeGame)(e,t);if(Array.isArray(e)&&e.every((e=>e instanceof o.Game)))return(0,a.writeGames)(e,t);throw new n.IllegalArgument("pgnWrite()")};const r=i(9830),n=i(8698),o=i(2525),s=i(7020),a=i(989)},6472:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Position=void 0;const r=i(8698),n=i(999),o=i(9955),s=i(6838),a=i(9457),l=i(2778),c=i(6585),u=i(5116),d=i(1789),h=i(3055),p=i(7261),f=i(9988);class g{constructor(e,t){switch(arguments.length){case 0:this._impl=(0,c.makeInitial)(0);break;case 1:if("start"===e)this._impl=(0,c.makeInitial)(0);else if("empty"===e)this._impl=(0,c.makeEmpty)(0);else if(e instanceof g)this._impl=(0,c.makeCopy)(e._impl);else{const t=(0,a.variantFromString)(e);if(t>=0){if(!(0,c.hasCanonicalStartPosition)(t))throw new r.IllegalArgument("Position()");this._impl=(0,c.makeInitial)(t)}else{if("string"!=typeof e)throw new r.IllegalArgument("Position()");{const t=e.indexOf(":");if(t<0)this._impl=(0,l.parseFEN)(0,e,!1).position;else{const i=e.substring(0,t),n=(0,a.variantFromString)(i);if(n<0)throw new r.InvalidFEN(e,o.i18n.INVALID_VARIANT_PREFIX,i);this._impl=(0,l.parseFEN)(n,e.substring(t+1),!1).position}}}}break;default:{const i=(0,a.variantFromString)(e);if(i<0)throw new r.IllegalArgument("Position()");if("start"===t){if(!(0,c.hasCanonicalStartPosition)(i))throw new r.IllegalArgument("Position()");this._impl=(0,c.makeInitial)(i)}else if("empty"===t)this._impl=(0,c.makeEmpty)(i);else if("number"==typeof t){if(1!==i||!m(t))throw new r.IllegalArgument("Position()");this._impl=(0,c.make960FromScharnagl)(t)}else{if("string"!=typeof t)throw new r.IllegalArgument("Position()");this._impl=(0,l.parseFEN)(i,t,!1).position}break}}}clear(e="regular"){const t=(0,a.variantFromString)(e);if(t<0)throw new r.IllegalArgument("Position.clear()");this._impl=(0,c.makeEmpty)(t)}reset(){this._impl=(0,c.makeInitial)(0)}reset960(e){if(!m(e))throw new r.IllegalArgument("Position.reset960()");this._impl=(0,c.make960FromScharnagl)(e)}resetAntichess(){this._impl=(0,c.makeInitial)(5)}resetHorde(){this._impl=(0,c.makeInitial)(6)}static isEqual(e,t){return e instanceof g&&t instanceof g&&(0,u.isEqual)(e._impl,t._impl)}ascii(e){return(0,l.ascii)(this._impl,e??{})}fen(e,t){if(0===arguments.length)return(0,l.getFEN)(this._impl);if(1===arguments.length&&"object"==typeof e){const t=(i=e,function(e,t,n){if(void 0===i[e])return t;{const t=i[e];if(!n(t))throw new r.IllegalArgument("Position.fen()");return t}}),n=t("fiftyMoveClock",0,(e=>Number.isInteger(e))),o=t("fullMoveNumber",1,(e=>Number.isInteger(e))),s=t("withVariant",!1,(e=>"boolean"==typeof e)),c=t("regularFENIfPossible",!1,(e=>"boolean"==typeof e));return(s?(0,a.variantToString)(this._impl.variant)+":":"")+(0,l.getFEN)(this._impl,n,o,c)}if(1===arguments.length&&"string"==typeof e){const t=(0,l.parseFEN)(this._impl.variant,e,!1);return this._impl=t.position,{fiftyMoveClock:t.fiftyMoveClock,fullMoveNumber:t.fullMoveNumber}}if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t){const i=(0,l.parseFEN)(this._impl.variant,e,t);return this._impl=i.position,{fiftyMoveClock:i.fiftyMoveClock,fullMoveNumber:i.fullMoveNumber}}throw new r.IllegalArgument("Position.fen()");var i}variant(){return(0,a.variantToString)(this._impl.variant)}square(e,t){const i=(0,a.squareFromString)(e);if(i<0)throw new r.IllegalArgument("Position.square()");if(1===arguments.length){const e=this._impl.board[i];return-1===e?"-":(0,a.coloredPieceToString)(e)}if("-"===t)this._impl.board[i]=-1,this._impl.legal=null,this._impl.effectiveCastling=null,this._impl.effectiveEnPassant=null;else{const e=(0,a.coloredPieceFromString)(t);if(e<0)throw new r.IllegalArgument("Position.square()");this._impl.board[i]=e,this._impl.legal=null,this._impl.effectiveCastling=null,this._impl.effectiveEnPassant=null}}turn(e){if(0===arguments.length)return(0,a.colorToString)(this._impl.turn);{const t=(0,a.colorFromString)(e);if(t<0)throw new r.IllegalArgument("Position.turn()");this._impl.turn=t,this._impl.legal=null,this._impl.effectiveEnPassant=null}}castling(e,t){if(!(1===this._impl.variant?(0,n.isCastle960)(e):(0,n.isCastle)(e)))throw new r.IllegalArgument("Position.castling()");const i=(0,a.colorFromString)(e[0]),o=1===this._impl.variant?(0,a.fileFromString)(e[1]):"k"===e[1]?7:0;if(1===arguments.length)return!!(this._impl.castling[i]&1<<o);if("boolean"!=typeof t)throw new r.IllegalArgument("Position.castling()");t?this._impl.castling[i]|=1<<o:this._impl.castling[i]&=~(1<<o),this._impl.effectiveCastling=null}effectiveCastling(e){if(!(1===this._impl.variant?(0,n.isCastle960)(e):(0,n.isCastle)(e)))throw new r.IllegalArgument("Position.effectiveCastling()");const t=(0,a.colorFromString)(e[0]),i=1===this._impl.variant?(0,a.fileFromString)(e[1]):"k"===e[1]?7:0;return(0,u.refreshEffectiveCastling)(this._impl),!!(this._impl.effectiveCastling[t]&1<<i)}enPassant(e){if(0===arguments.length)return this._impl.enPassant<0?"-":(0,a.fileToString)(this._impl.enPassant);if("-"===e)this._impl.enPassant=-1,this._impl.effectiveEnPassant=-1;else{const t=(0,a.fileFromString)(e);if(t<0)throw new r.IllegalArgument("Position.enPassant()");this._impl.enPassant=t,this._impl.effectiveEnPassant=null}}effectiveEnPassant(){return(0,u.refreshEffectiveEnPassant)(this._impl),this._impl.effectiveEnPassant<0?"-":(0,a.fileToString)(this._impl.effectiveEnPassant)}isAttacked(e,t){const i=(0,a.squareFromString)(e),n=(0,a.colorFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.isAttacked()");return(0,s.isAttacked)(this._impl,i,n)}getAttacks(e,t){const i=(0,a.squareFromString)(e),n=(0,a.colorFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.getAttacks()");return(0,s.getAttacks)(this._impl,i,n).map(a.squareToString)}isLegal(){return(0,u.isLegal)(this._impl)}kingSquare(e){const t=(0,a.colorFromString)(e);if(t<0)throw new r.IllegalArgument("Position.kingSquare()");(0,u.refreshLegalFlagAndKingSquares)(this._impl);const i=this._impl.king[t];return!(i<0)&&(0,a.squareToString)(i)}isCheck(){return(0,h.isCheck)(this._impl)}isCheckmate(){return(0,h.isCheckmate)(this._impl)}isStalemate(){return(0,h.isStalemate)(this._impl)}isDead(e=!1){return(0,h.isDead)(this._impl,e)}hasMove(){return(0,h.hasMove)(this._impl)}moves(){return(0,h.moves)(this._impl)}isMoveLegal(e,t){const i=(0,a.squareFromString)(e),n=(0,a.squareFromString)(t);if(i<0||n<0)throw new r.IllegalArgument("Position.isMoveLegal()");const o=(0,h.isMoveLegal)(this._impl,i,n);if(!o)return!1;switch(o.type){case"promotion":{const e=e=>{const t=(0,a.pieceFromString)(e);if(t>=0){const e=o.moveDescriptorFactory(t);if(e)return e}throw new r.IllegalArgument("Position.isMoveLegal()")};return e.status="promotion",e}case"regular":{const e=()=>o.moveDescriptor;return e.status="regular",e}}}play(e){if("string"!=typeof e){if(e instanceof d.MoveDescriptorImpl)return(0,h.play)(this._impl,e),!0;throw new r.IllegalArgument("Position.play()")}try{return(0,h.play)(this._impl,(0,p.parseNotation)(this._impl,e,!1,"standard")),!0}catch(e){if(e instanceof r.InvalidNotation)return!1;throw e}}isNullMoveLegal(){return(0,h.isNullMoveLegal)(this._impl)}playNullMove(){return(0,h.playNullMove)(this._impl)}notation(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,p.getNotation)(this._impl,e,"standard");if(1===arguments.length&&"string"==typeof e)return(0,p.parseNotation)(this._impl,e,!1,"standard");if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,p.parseNotation)(this._impl,e,t,"standard");throw new r.IllegalArgument("Position.notation()")}figurineNotation(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,p.getNotation)(this._impl,e,"figurine");if(1===arguments.length&&"string"==typeof e)return(0,p.parseNotation)(this._impl,e,!1,"figurine");if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,p.parseNotation)(this._impl,e,t,"figurine");throw new r.IllegalArgument("Position.figurineNotation()")}uci(e,t){if(1===arguments.length&&e instanceof d.MoveDescriptorImpl)return(0,f.getUCINotation)(this._impl,e,!1);if(arguments.length>=2&&e instanceof d.MoveDescriptorImpl&&"boolean"==typeof t)return(0,f.getUCINotation)(this._impl,e,t);if(1===arguments.length&&"string"==typeof e)return(0,f.parseUCINotation)(this._impl,e,!1);if(arguments.length>=2&&"string"==typeof e&&"boolean"==typeof t)return(0,f.parseUCINotation)(this._impl,e,t);throw new r.IllegalArgument("Position.uci()")}}function m(e){return Number.isInteger(e)&&e>=0&&e<960}t.Position=g},2493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trimAndCollapseSpaces=function(e){return e.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},t.isValidNag=function(e){return Number.isInteger(e)&&e>=0},t.isValidElo=function(e){return Number.isInteger(e)&&e>=0},t.isValidRound=function(e){return Number.isInteger(e)&&e>=0}},943:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveTreeRoot=void 0;const r=i(8698),n=i(999),o=i(9955),s=i(7781),a=i(6472),l=i(2493),c=i(9013),u=i(9457);class d{constructor(){this._position=new a.Position,this._fullMoveNumber=1,this._mainVariationData=N(this,!0)}clearTree(){this._mainVariationData=N(this,!0)}mainVariation(){return new B(this._mainVariationData,this._position)}findById(e,t){const i=e.split("-");if(i.length%2!=1)return;const r=new a.Position(this._position);let n=this._mainVariationData;for(let e=0;e+1<i.length;e+=2){const t=h(n,i[e],r);if(void 0===t)return;const o=/^v(\d+)$/.exec(i[e+1]);if(!o)return;const s=parseInt(o[1]);if(s>=t.variations.length)return;n=t.variations[s]}const o=i[i.length-1];if("start"===o)return new B(n,r);if(t&&"end"===o){if(void 0===n.child)return new B(n,r);{let e=n.child;for(;void 0!==e.child;)S(r,e),e=e.child;return new M(e,r)}}{const e=h(n,o,r);return void 0===e?void 0:new M(e,r)}}getPojo(e){const t=this._position.variant();"regular"!==t&&(e.variant=t),(0,n.variantWithCanonicalStartPosition)(t)&&a.Position.isEqual(this._position,new a.Position(t))&&1===this._fullMoveNumber||(e.initialPosition=this._position.fen({fullMoveNumber:this._fullMoveNumber}));const i=p(new a.Position(this._position),this._mainVariationData,!0);(!Array.isArray(i)||i.length>0)&&(e.mainVariation=i)}setPojo(e,t){let i="regular",s=!1;if((0,c.decodeStringField)(e,"variant",t,(e=>{if((0,u.variantFromString)(e)<0)throw t.build(o.i18n.INVALID_VARIANT_IN_POJO);i=e})),(0,c.decodeStringField)(e,"initialPosition",t,(e=>{this._position=new a.Position(i,"empty");try{const{fullMoveNumber:t}=this._position.fen(e);this._fullMoveNumber=t,s=!0}catch(e){throw e instanceof r.InvalidFEN?t.build(o.i18n.INVALID_FEN_IN_POJO,e.message):e}})),"regular"!==i&&!s){if(!(0,n.variantWithCanonicalStartPosition)(i))throw t.push("initialPosition"),t.build(o.i18n.MISSING_INITIAL_POSITION_IN_POJO,i);this._position=new a.Position(i),this._fullMoveNumber=1}"mainVariation"in e&&void 0!==e.mainVariation?(t.push("mainVariation"),this._mainVariationData=m(e.mainVariation,this,this._position,0,this._fullMoveNumber,!0,t),t.pop()):this.clearTree()}}function h(e,t,i){let r=e.child;for(;void 0!==r;){if(t===r.fullMoveNumber+r.moveColor)return r;S(i,r),r=r.child}}function p(e,t,i){const r=[];let n=t.child;for(;void 0!==n;)r.push(f(e,n)),S(e,n),n=n.child;const o={nodes:r};let s=!0;return t.isLongVariation!==i&&(o.isLongVariation=t.isLongVariation,s=!1),g(o,t)&&(s=!1),s?o.nodes:o}function f(e,t){const i={notation:null===t.moveDescriptor?"--":e.notation(t.moveDescriptor)};let r=!0;return t.variations.length>0&&(i.variations=t.variations.map((t=>p(new a.Position(e),t,!1))),r=!1),g(i,t)&&(r=!1),r?i.notation:i}function g(e,t){let i=!1;return void 0!==t.comment&&(e.comment=t.comment,t.isLongComment&&(e.isLongComment=!0),i=!0),t.nags.size>0&&(e.nags=x(t),i=!0),t.tags.size>0&&(e.tags=function(e){const t={};for(const[i,r]of e.tags.entries())t[i]=r;return t}(t),i=!0),i}function m(e,t,i,r,n,s,l){let u,d;if(Array.isArray(e))u=N(t,s),d=e;else{if("object"!=typeof e||null===e)throw l.build(o.i18n.NOT_A_VARIATION_POJO);{let i=s;if((0,c.decodeBooleanField)(e,"isLongVariation",l,(e=>{i=e})),u=N(t,i),_(e,u,l),l.push("nodes"),!("nodes"in e)||!Array.isArray(e.nodes))throw l.build(o.i18n.INVALID_OR_MISSING_NODE_ARRAY);d=e.nodes}}let h=u;i=new a.Position(i);for(let e=0;e<d.length;++e)l.push(e),h.child=b(d[e],u,i,r,n,l),l.pop(),h=h.child,S(i,h),r=E(h),"w"===i.turn()&&++n;return Array.isArray(e)||l.pop(),u}function b(e,t,i,r,n,s){let a;if("string"==typeof e)a=v(i,e,s);else{if("object"!=typeof e||null===e)throw s.build(o.i18n.NOT_A_NODE_POJO);if(s.push("notation"),!("notation"in e)||"string"!=typeof e.notation)throw s.build(o.i18n.INVALID_OR_MISSING_NOTATION_FIELD);a=v(i,e.notation,s),s.pop()}const l=I(t,i.turn(),r,n,a);return"object"==typeof e&&null!==e&&(_(e,l,s),(0,c.decodeArrayField)(e,"variations",s,(e=>{for(let t=0;t<e.length;++t)s.push(t),l.variations.push(m(e[t],l,i,r,n,!1,s)),s.pop()}))),l}function v(e,t,i){try{return w(e,t)}catch(e){throw e instanceof r.InvalidNotation?i.build(o.i18n.INVALID_MOVE_IN_POJO,t,e.message):e}}function _(e,t,i){(0,c.decodeStringField)(e,"comment",i,(e=>{t.comment=e})),(0,c.decodeBooleanField)(e,"isLongComment",i,(e=>{t.isLongComment=e})),(0,c.decodeArrayField)(e,"nags",i,(e=>{for(let r=0;r<e.length;++r){const n=e[r];if(void 0!==n){if(!(0,l.isValidNag)(n))throw i.push(r),i.build(o.i18n.INVALID_NAG_IN_POJO,n);t.nags.add(n)}}})),(0,c.decodeObjectField)(e,"tags",i,(e=>{for(const r in e){if(!L(r))throw i.push(`[${r}]`),i.build(o.i18n.INVALID_TAG_IN_POJO,r);const n=e[r];if(void 0!==n){if("string"!=typeof n)throw i.push(r),i.build(o.i18n.INVALID_TAG_IN_POJO,r);t.tags.set(r,n)}}}))}function I(e,t,i,r,n){return{parentVariation:e,child:void 0,variations:[],moveColor:t,fiftyMoveClock:i,fullMoveNumber:r,moveDescriptor:n,nags:new Set,tags:new Map,comment:void 0,isLongComment:!1}}function N(e,t){return{parent:e,child:void 0,isLongVariation:t,nags:new Set,tags:new Map,comment:void 0,isLongComment:!1}}function w(e,t){if("--"===t){if(!e.isNullMoveLegal())throw new r.InvalidNotation(e.fen(),"--",o.i18n.ILLEGAL_NULL_MOVE);return null}return e.notation(t)}function S(e,t){null===t.moveDescriptor?e.playNullMove():e.play(t.moveDescriptor)}function E(e){return null===e.moveDescriptor?e.fiftyMoveClock:e.moveDescriptor.isCapture()||"p"===e.moveDescriptor.movingPiece()?0:e.fiftyMoveClock+1}function y(e){return"w"===e.moveColor?e.fullMoveNumber:e.fullMoveNumber+1}function C(e){if(e.parent instanceof d)return new a.Position(e.parent._position);{let t=e.parent.parentVariation.child;const i=C(e.parent.parentVariation);for(;t!==e.parent;)S(i,t),t=t.child;return i}}function A(e){return T(e.parentVariation)+e.fullMoveNumber+e.moveColor}function T(e){return e.parent instanceof d?"":`${A(e.parent)}-v${e.parent.variations.indexOf(e)}-`}function P(e){for(;;){if(!e.isLongVariation)return!1;if(e.parent instanceof d)return!0;e=e.parent.parentVariation}}function k(e,t){return Number.isInteger(e)&&e>=0&&e<t.variations.length}function x(e){const t=[];for(const i of e.nags)t.push(i);return t.sort(((e,t)=>e-t))}function O(e,t){const i=new Set;for(const r of e.nags)t(r)&&i.add(r);e.nags=i}function L(e){return"string"==typeof e&&/^\w+$/.test(e)}function D(e){const t=[];for(const i of e.tags.keys())t.push(i);return t.sort()}function R(e,t){const i=new Map;for(const[r,n]of e.tags.entries())t(r,n)&&i.set(r,n);e.tags=i}t.MoveTreeRoot=d;class M extends s.Node{constructor(e,t){super(),this._data=e,this._positionBefore=t}id(){return A(this._data)}nags(){return x(this._data)}hasNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.hasNag()");return this._data.nags.has(e)}addNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.addNag()");return this._data.nags.add(e)}removeNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Node.removeNag()");return this._data.nags.delete(e)}clearNags(){this._data.nags.clear()}filterNags(e){O(this._data,e)}tags(){return D(this._data)}tag(e,t){if(!L(e))throw new r.IllegalArgument("Node.tag()");if(1===arguments.length)return this._data.tags.get(e);null==t?this._data.tags.delete(e):this._data.tags.set(e,String(t))}clearTags(){this._data.tags.clear()}filterTags(e){R(this._data,e)}comment(e,t){if(0===arguments.length)return this._data.comment;null==e?(this._data.comment=void 0,this._data.isLongComment=!1):(this._data.comment=String(e),this._data.isLongComment=Boolean(t))}isLongComment(){return this._data.isLongComment&&P(this._data.parentVariation)}parentVariation(){const e=C(this._data.parentVariation);return new B(this._data.parentVariation,e)}previous(){let e=this._data.parentVariation.child;if(e===this._data)return;const t=C(this._data.parentVariation);for(;e.child!==this._data;)S(t,e),e=e.child;return new M(e,t)}next(){if(void 0===this._data.child)return;const e=new a.Position(this._positionBefore);return S(e,this._data),new M(this._data.child,e)}notation(){return null===this._data.moveDescriptor?"--":this._positionBefore.notation(this._data.moveDescriptor)}figurineNotation(){return null===this._data.moveDescriptor?"--":this._positionBefore.figurineNotation(this._data.moveDescriptor)}positionBefore(){return new a.Position(this._positionBefore)}position(){const e=new a.Position(this._positionBefore);return S(e,this._data),e}fen(){return this.position().fen({fiftyMoveClock:E(this._data),fullMoveNumber:y(this._data)})}fiftyMoveClock(){return E(this._data)}fullMoveNumber(){return this._data.fullMoveNumber}moveColor(){return this._data.moveColor}variations(){return this._data.variations.map((e=>new B(e,this._positionBefore)))}play(e){const t=new a.Position(this._positionBefore);S(t,this._data);const i=t.turn(),r=E(this._data),n=y(this._data);return this._data.child=I(this._data.parentVariation,i,r,n,w(t,e)),new M(this._data.child,t)}removePrecedingMoves(){const e=function(e){let t=e;for(;!(t instanceof d);)t=t.parentVariation.parent;return t}(this._data);e._position=this._positionBefore,e._fullMoveNumber=this._data.fullMoveNumber,e._mainVariationData=N(e,!0),e._mainVariationData.child=this._data,q(this._data,e._mainVariationData),V(this._data,0)}removeFollowingMoves(){this._data.child=void 0}addVariation(e){const t=N(this._data,e??!1);return this._data.variations.push(t),new B(t,this._positionBefore)}removeVariation(e){if(!k(e,this._data))throw new r.IllegalArgument("Node.removeVariation()");this._data.variations=this._data.variations.slice(0,e).concat(this._data.variations.slice(e+1))}swapVariations(e,t){if(!k(e,this._data)||!k(t,this._data))throw new r.IllegalArgument("Node.swapVariations()");const i=this._data.variations[e];this._data.variations[e]=this._data.variations[t],this._data.variations[t]=i}promoteVariation(e){if(!k(e,this._data)||void 0===this._data.variations[e].child)throw new r.IllegalArgument("Node.promoteVariation()");const t=this._data,i=this._data.variations[e].child,n=t.variations;t.variations=[],n[e]=N(i,!1),n[e].child=t,this._data=i,i.variations=n.concat(i.variations),(function(e){let t=e.parentVariation;for(;t.child!==e;)t=t.child;return t}(t)).child=i,q(i,t.parentVariation),q(t,n[e]);for(const e of i.variations)e.parent=i}}function q(e,t){let i=e;for(;void 0!==i;)i.parentVariation=t,i=i.child}function V(e,t){let i=e;for(;void 0!==i;){i.fiftyMoveClock=t;for(const e of i.variations)V(e.child,t);t=E(i),i=i.child}}class B extends s.Variation{constructor(e,t){super(),this._data=e,this._initialPosition=t}id(){return T(this._data)+"start"}nags(){return x(this._data)}hasNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.hasNag()");return this._data.nags.has(e)}addNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.addNag()");return this._data.nags.add(e)}removeNag(e){if(!(0,l.isValidNag)(e))throw new r.IllegalArgument("Variation.removeNag()");return this._data.nags.delete(e)}clearNags(){this._data.nags.clear()}filterNags(e){O(this._data,e)}tags(){return D(this._data)}tag(e,t){if(!L(e))throw new r.IllegalArgument("Variation.tag()");if(1===arguments.length)return this._data.tags.get(e);null==t?this._data.tags.delete(e):this._data.tags.set(e,String(t))}clearTags(){this._data.tags.clear()}filterTags(e){R(this._data,e)}comment(e,t){if(0===arguments.length)return this._data.comment;null==e?(this._data.comment=void 0,this._data.isLongComment=!1):(this._data.comment=String(e),this._data.isLongComment=Boolean(t))}isLongComment(){return this._data.isLongComment&&P(this._data)}parentNode(){return this._data.parent instanceof d?void 0:new M(this._data.parent,this._initialPosition)}first(){return void 0===this._data.child?void 0:new M(this._data.child,this._initialPosition)}nodes(){const e=[];let t,i=this._data.child,r=this._initialPosition;for(;void 0!==i;)r=new a.Position(r),void 0!==t&&S(r,t),e.push(new M(i,r)),t=i,i=i.child;return e}plyCount(){let e=0,t=this._data.child;for(;void 0!==t;)++e,t=t.child;return e}isLongVariation(){return P(this._data)}initialPosition(){return new a.Position(this._initialPosition)}initialFEN(){return this._initialPosition.fen({fiftyMoveClock:this.initialFiftyMoveClock(),fullMoveNumber:this.initialFullMoveNumber()})}initialFiftyMoveClock(){return this._data.parent instanceof d?0:this._data.parent.fiftyMoveClock}initialFullMoveNumber(){return this._data.parent instanceof d?this._data.parent._fullMoveNumber:this._data.parent.fullMoveNumber}finalPosition(){const e=new a.Position(this._initialPosition);for(let t=this._data.child;void 0!==t;t=t.child)S(e,t);return e}finalFEN(){if(void 0===this._data.child)return this.initialFEN();const e=new a.Position(this._initialPosition);let t=this._data.child;for(;S(e,t),void 0!==t.child;)t=t.child;return e.fen({fiftyMoveClock:E(t),fullMoveNumber:y(t)})}play(e){const t=this._initialPosition.turn(),i=this.initialFiftyMoveClock(),r=this.initialFullMoveNumber();return this._data.child=I(this._data,t,i,r,w(this._initialPosition,e)),new M(this._data.child,this._initialPosition)}clearMoves(){this._data.child=void 0}}},9013:function(e,t,i){"use strict";var r,n,o=this&&this.__classPrivateFieldSet||function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},s=this&&this.__classPrivateFieldGet||function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.POJOExceptionBuilder=void 0,t.decodeStringField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("string"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_STRING_FIELD);i.pop()},t.decodeNumberField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("number"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_NUMBER_FIELD);i.pop()},t.decodeBooleanField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("boolean"==typeof n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_BOOLEAN_FIELD);i.pop()},t.decodeArrayField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if(Array.isArray(n))r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_ARRAY_FIELD);i.pop()},t.decodeObjectField=function(e,t,i,r){if(!(t in e))return;i.push(t);const n=e[t];if("object"==typeof n&&null!==n)r(n);else if(void 0!==n)throw i.build(l.i18n.INVALID_POJO_OBJECT_FIELD);i.pop()};const a=i(8698),l=i(9955);t.POJOExceptionBuilder=class{constructor(e){r.set(this,void 0),n.set(this,[]),o(this,r,e,"f")}push(e){s(this,n,"f").push(e)}pop(){s(this,n,"f").pop()}build(e,...t){let i="",o=!0;for(const e of s(this,n,"f"))i+="number"==typeof e?`[${e}]`:o?e:"."+e,o=!1;return new a.InvalidPOJO(s(this,r,"f"),i,e,...t)}},r=new WeakMap,n=new WeakMap},7020:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readDatabase=function(e){return new b(e)},t.readOneGame=function(e,t){const i=new d.TokenStream(e);let r=0;for(;r!==t;){if(!i.skipGame())throw new o.InvalidPGN(e,-1,-1,l.i18n.INVALID_GAME_INDEX,t,r);++r}const{game:n,atLeastOneTokenFound:s}=m(i);if(!s)throw new o.InvalidPGN(e,-1,-1,l.i18n.INVALID_GAME_INDEX,t,r);return n};const r=i(9830),n=i(4633),o=i(8698),s=i(2525),a=i(999),l=i(9955),c=i(7781),u=i(6472),d=i(5299);function h(e){return"?"===e?void 0:e}function p(e){if(/^\d+$/.test(e)){const t=Number(e);if(Number.isInteger(t))return t}}function f(e,t,i,r,s,c,u){switch(s=s.trim(),r){case"White":t.playerName("w",h(s));break;case"Black":t.playerName("b",h(s));break;case"WhiteElo":t.playerElo("w",p(s));break;case"BlackElo":t.playerElo("b",p(s));break;case"WhiteTitle":t.playerTitle("w",s);break;case"BlackTitle":t.playerTitle("b",s);break;case"Event":t.event(h(s));break;case"Round":{const{round:e,subRound:i,subSubRound:r}=function(e){if(/^(\?|\d+)(?:\.(\?|\d+)(?:\.(\?|\d+)(?:\.(?:\?|\d+))*)?)?$/.test(e)){const e=Number(RegExp.$1),t=RegExp.$2?Number(RegExp.$2):void 0,i=RegExp.$3?Number(RegExp.$3):void 0;return{round:Number.isInteger(e)?e:void 0,subRound:Number.isInteger(t)?t:void 0,subSubRound:Number.isInteger(i)?i:void 0}}return{round:void 0,subRound:void 0,subSubRound:void 0}}(s);t.round(e),t.subRound(i),t.subSubRound(r);break}case"Date":t.date(n.DateValue.fromPGNString(s));break;case"Site":t.site(h(s));break;case"Annotator":t.annotator(s);break;case"ECO":t.eco(function(e){return(0,a.isValidECO)(e)?e:void 0}(s));break;case"Opening":t.opening(s);break;case"Variation":t.openingVariation(s);break;case"SubVariation":t.openingSubVariation(s);break;case"Termination":t.termination(s);break;case"FEN":i.fen=s,i.fenTokenCharacterIndex=c,i.fenTokenLineIndex=u;break;case"Variant":if(i.variant=function(e){return"regular"===(e=e.toLowerCase())||"standard"===e?"regular":"fischerandom"===e||/^chess[ -]?960$/.test(e)?"chess960":/^no[ -]king$/.test(e)?"no-king":/^white[ -]king[ -]only$/.test(e)?"white-king-only":/^black[ -]king[ -]only$/.test(e)?"black-king-only":/^anti[ -]?chess/.test(e)?"antichess":"horde"===e?"horde":void 0}(s),void 0===i.variant)throw new o.InvalidPGN(e.text(),c,u,l.i18n.UNKNOWN_VARIANT,s);i.variantTokenCharacterIndex=c,i.variantTokenLineIndex=u}}function g(e,t,i){if(void 0!==i.fen)try{const e=void 0===i.variant?new u.Position:new u.Position(i.variant,"empty"),r=e.fen(i.fen);t.initialPosition(e,r.fullMoveNumber)}catch(t){throw t instanceof o.InvalidFEN?new o.InvalidPGN(e.text(),i.fenTokenCharacterIndex,i.fenTokenLineIndex,l.i18n.INVALID_FEN_IN_PGN_TEXT,t.message):t}else if(void 0!==i.variant){if(!(0,a.variantWithCanonicalStartPosition)(i.variant))throw new o.InvalidPGN(e.text(),i.variantTokenCharacterIndex,i.variantTokenLineIndex,l.i18n.VARIANT_WITHOUT_FEN,i.variant);{const e=new u.Position(i.variant,"start");t.initialPosition(e,1)}}}function m(e){const t=new s.Game;let i=!1,r=!1,n=null;const a=[],u={};for(;!i&&e.consumeToken();)switch(r=!0,e.isMoveTextSection()&&null===n&&(g(e,t,u),n=t.mainVariation()),e.token()){case 1:{if(null!==n)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_PGN_HEADER);if(!e.consumeToken()||3!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_PGN_HEADER_ID);const i=e.tokenValue();if(!e.consumeToken()||4!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_PGN_HEADER_VALUE);const r=e.tokenValue(),s=e.tokenCharacterIndex(),a=e.tokenLineIndex();if(!e.consumeToken()||2!==e.token())throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.MISSING_END_OF_PGN_HEADER);f(e,t,u,i,r,s,a);break}case 5:break;case 6:try{n=n.play(e.tokenValue())}catch(t){throw t instanceof o.InvalidNotation?new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.INVALID_MOVE_IN_PGN_TEXT,t.notation,t.message):t}break;case 7:n.addNag(e.tokenValue());break;case 8:{const{comment:t,tags:i}=e.tokenValue();for(const[e,t]of i)n.tag(e,t);if(void 0!==t)if(void 0===n.comment()){const i=n instanceof c.Variation?e.emptyLineAfterToken():e.emptyLineBeforeToken();n.comment(t,i)}else{const e=n.isLongComment();n.comment(n.comment()+" "+t,e)}break}case 9:if(n instanceof c.Variation)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_BEGIN_OF_VARIATION);a.push(n),n=n.addVariation(e.emptyLineBeforeToken());break;case 10:if(0===a.length)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_END_OF_VARIATION);n=a.pop();break;case 11:i=!0,t.result(e.tokenValue());break;default:throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.INVALID_PGN_TOKEN)}if(0!==a.length)throw new o.InvalidPGN(e.text(),e.tokenCharacterIndex(),e.tokenLineIndex(),l.i18n.UNEXPECTED_END_OF_GAME);return{game:t,atLeastOneTokenFound:r}}class b extends r.Database{constructor(e){for(super(),this._currentGameIndex=-1,this._text=e,this._gameLocations=[],this._stream=new d.TokenStream(e);;){const e=this._stream.currentLocation();if(!this._stream.skipGame())break;this._gameLocations.push(e)}}doGameCount(){return this._gameLocations.length}doGame(e){if(e>=this._gameLocations.length)throw new o.InvalidPGN(this._text,-1,-1,l.i18n.INVALID_GAME_INDEX,e,this._gameLocations.length);this._currentGameIndex!==e&&(this._stream=new d.TokenStream(this._text,this._gameLocations[e])),this._currentGameIndex=-1;const{game:t}=m(this._stream);return this._currentGameIndex=e+1,t}}},989:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writeGame=g,t.writeGames=function(e,t){return e.map((e=>g(e,t))).join("\n\n")};const r=i(999),n=i(7781),o=i(6472),s=i(2493);function a(e){return e.replace(/([\\"])/g,"\\$1")}function l(e){return e.replace(/([\\}])/g,"\\$1")}function c(e){return void 0!==e&&(e=(0,s.trimAndCollapseSpaces)(e)),e?a(e):"?"}function u(e,t){return void 0!==t&&(t=(0,s.trimAndCollapseSpaces)(t)),t?`[${e} "${a(t)}"]\n`:""}function d(e,t){return void 0===t?"":`[${e} "${t}"]\n`}function h(e,t,i,r){for(const t of e.nags())i("$"+t,!1,!1);let o=e.comment();void 0!==o&&(o=(0,s.trimAndCollapseSpaces)(o));const a=e.tags(),c=new Map;let u=!1;for(const t of a){const i=(0,s.trimAndCollapseSpaces)(e.tag(t).replace(/[[\]]/g,""));i&&(c.set(t,i),u=!0)}if(u||o){o&&e.isLongComment()&&e instanceof n.Node&&r(),i("{",!1,!0);for(const e of a){const t=c.get(e);t&&i(`[%${e} ${l(t)}]`,!0,!1)}if(o)for(const e of l(o).split(" "))i(e,!1,!1);return i("}",!0,!1),o&&e.isLongComment()&&t&&r(),!0}return!1}function p(e,t,i,r,n){"w"===e.moveColor()?r(e.fullMoveNumber()+".",!1,!1):t&&r(e.fullMoveNumber()+"...",!1,!1),r(e.notation(),!1,!1);const o=e.variations();let s=-1;for(let e=o.length-1;e>=0;--e)if(void 0!==o[e].first()){s=e;break}let a=h(e,(i||void 0!==e.next())&&s<0,r,n);for(let e=0;e<o.length;++e){const t=o[e];void 0!==t.first()&&(t.isLongVariation()&&n(),r("(",!1,!0),f(t,!1,r,n),r(")",!0,!1),e===s&&t.isLongVariation()&&n(),a=!0)}return a}function f(e,t,i,r){h(e,!0,i,r);let n=e.first(),o=!0;for(;void 0!==n;)o=p(n,o,t,i,r),n=n.next()}function g(e,t){let i="";var n,s;i+=`[Event "${c(e.event())}"]\n`,i+=`[Site "${c(e.site())}"]\n`,i+=`[Date "${n=e.date(),void 0===n?"????.??.??":n.toPGNString()}"]\n`,i+=`[Round "${s=e.fullRound(),s??"?"}"]\n`,i+=`[White "${c(e.playerName("w"))}"]\n`,i+=`[Black "${c(e.playerName("b"))}"]\n`,i+=`[Result "${e.result()}"]\n`;const a=e.variant(),l=e.initialPosition(),h=!(0,r.variantWithCanonicalStartPosition)(a)||!o.Position.isEqual(l,new o.Position(a))||1!==e.initialFullMoveNumber();i+=u("Annotator",e.annotator()),i+=d("BlackElo",e.playerElo("b")),i+=u("BlackTitle",e.playerTitle("b")),i+=u("ECO",e.eco()),h&&(i+=`[FEN "${l.fen({fullMoveNumber:e.initialFullMoveNumber(),regularFENIfPossible:!0})}"]\n`),i+=u("Opening",e.opening()),t.withPlyCount&&(i+=`[PlyCount "${e.plyCount()}"]\n`),h&&(i+='[SetUp "1"]\n'),i+=u("SubVariation",e.openingSubVariation()),i+=u("Termination",e.termination()),i+=u("Variant",function(e){switch(e){case"regular":return;case"chess960":return"Fischerandom";case"antichess":return"Antichess";case"horde":return"Horde";default:return e}}(a)),i+=u("Variation",e.openingVariation()),i+=d("WhiteElo",e.playerElo("w")),i+=u("WhiteTitle",e.playerTitle("w")),i+="\n";let p="",g=!1;function m(e,t,r){0===p.length?p=e:p.length+e.length+(g||t?0:1)<=80?p+=(g||t?"":" ")+e:(i+=p+"\n",p=e),g=r}return f(e.mainVariation(),!0,m,(function(){i+=p+"\n",i+="\n",p="",g=!1})),m(e.result(),!1,!1),i+=p+"\n",i}},5299:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenStream=void 0;const r=i(8698),n=i(9955),o=i(2493);function s(e,t){const i=e;return i.needIncrementLineIndex=void 0!==t&&t,i.matchedIndex=-1,i.matched=null,i}const a=new Map;a.set("!!",3),a.set("!",1),a.set("!?",5),a.set("?!",6),a.set("?",2),a.set("??",4),a.set("+-",18),a.set("+/-",16),a.set("+/=",14),a.set("+=",14),a.set("=",10),a.set("~",13),a.set("inf",13),a.set("=/+",15),a.set("=+",15),a.set("-/+",17),a.set("-+",19),a.set("RR",145),a.set("N",146),t.TokenStream=class{constructor(e,t){this._pos=0,this._lineIndex=1,this._token=0,this._tokenValue=null,this._tokenCharacterIndex=-1,this._tokenLineIndex=-1,this._emptyLineBeforeToken=!1,this._emptyLineAfterToken=!1,this._matchSpaces=s(/[ \f\t\v]+/g),this._matchLineBreak=s(/\r?\n|\r/g,!0),this._matchFastAdvance=s(/[^ \f\t\v\r\n"{][^ \f\t\v\r\n"{10*]*/g),this._matchBeginHeader=s(/\[/g),this._matchEndHeader=s(/\]/g),this._matchHeaderId=s(/(\w+)/g),this._matchEnterHeaderValue=s(/"/g),this._matchMoveNumber=s(/[0-9]+\.(?:\.\.)?/g),this._matchMove=s(/(?:O-O(?:-O)?|0-0(?:-0)?|[KQRBN][a-h]?[1-8]?x?[a-h][1-8]|(?:[a-h]x?)?[a-h][1-8](?:=?[KQRBNP])?)[+#]?|--/g),this._matchNag=s(/([!?][!?]?|\+\/?[-=]|[-=]\/?\+|=|inf|~|RR|N)|\$([1-9][0-9]*)/g),this._matchEnterComment=s(/\{/g),this._matchBeginVariation=s(/\(/g),this._matchEndVariation=s(/\)/g),this._matchEndOfGame=s(/1-0|0-1|1\/2-1\/2|\*/g),this._headerValueMode=s(/((?:[^\\"\f\t\v\r\n]|\\[^\f\t\v\r\n])*)"/g),this._headerValueDegradedMode=s(/[^\r\n]*/g),this._commentMode=s(/((?:[^\\}]|\\(?:.|[\r\n]))*)\}/g,!0),65279===e.codePointAt(0)&&(e=e.substring(1)),this._text=e,void 0!==t&&(this._pos=t.pos,this._lineIndex=t.lineIndex)}text(){return this._text}currentLocation(){return{pos:this._pos,lineIndex:this._lineIndex}}emptyLineBeforeToken(){return this._emptyLineBeforeToken}emptyLineAfterToken(){return this._emptyLineAfterToken}token(){return this._token}tokenValue(){return this._tokenValue}tokenCharacterIndex(){return this._tokenCharacterIndex}tokenLineIndex(){return this._tokenLineIndex}isMoveTextSection(){return this._token>=5&&this._token<=11}consumeToken(){if(this._emptyLineBeforeToken=0===this._token||11===this._token?this.skipBlanks():this._emptyLineAfterToken,this._pos>=this._text.length)return this._tokenCharacterIndex=this._text.length,this._tokenLineIndex=this._lineIndex,!1;if(this._tokenCharacterIndex=this._pos,this._tokenLineIndex=this._lineIndex,this.testAtPos(this._matchMoveNumber))this._token=5,this._tokenValue=null;else if(this.testAtPos(this._matchMove))this._token=6,this._tokenValue=this._matchMove.matched[0];else if(this.testAtPos(this._matchNag))this._token=7,this._tokenValue=void 0===this._matchNag.matched[2]?a.get(this._matchNag.matched[1]):parseInt(this._matchNag.matched[2],10);else if(this.testAtPos(this._matchEnterComment)){if(!this.testAtPos(this._commentMode))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);this._token=8,this._tokenValue=function(e){e=e.replace(/\\([\\}])/g,"$1");const t=new Map;let i=e.replace(/\[%(\w+)\s([^[\]]*)\]/g,((e,i,r)=>(""!==(r=(0,o.trimAndCollapseSpaces)(r))&&t.set(i,r)," ")));return i=(0,o.trimAndCollapseSpaces)(i),""===i&&(i=void 0),{comment:i,tags:t}}(this._commentMode.matched[1])}else if(this.testAtPos(this._matchBeginVariation))this._token=9,this._tokenValue=null;else if(this.testAtPos(this._matchEndVariation))this._token=10,this._tokenValue=null;else if(this.testAtPos(this._matchEndOfGame))this._token=11,this._tokenValue=this._matchEndOfGame.matched[0];else if(this.testAtPos(this._matchBeginHeader))this._token=1,this._tokenValue=null;else if(this.testAtPos(this._matchEndHeader))this._token=2,this._tokenValue=null;else if(this.testAtPos(this._matchHeaderId))this._token=3,this._tokenValue=this._matchHeaderId.matched[1];else{if(!this.testAtPos(this._matchEnterHeaderValue))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);if(!this.testAtPos(this._headerValueMode))throw new r.InvalidPGN(this._text,this._pos,this._lineIndex,n.i18n.INVALID_PGN_TOKEN);this._token=4,this._tokenValue=(e=this._headerValueMode.matched[1],(0,o.trimAndCollapseSpaces)(e.replace(/\\([\\"])/g,"$1")))}var e;return this._emptyLineAfterToken=11!==this._token&&this.skipBlanks(),!0}skipGame(){let e=!1;for(this._token=0;;){if(this.skipBlanks(),this._pos>=this._text.length)return e;if(e=!0,this.testAtPos(this._matchEnterComment)){if(!this.testAtPos(this._commentMode))return this._pos=this._text.length,!0}else if(this.testAtPos(this._matchEnterHeaderValue))this.testAtPos(this._headerValueMode)||this.testAtPos(this._headerValueDegradedMode);else{if(this.testAtPos(this._matchEndOfGame))return!0;this.testAtPos(this._matchFastAdvance)}}}skipBlanks(){let e=0;for(;this._pos<this._text.length;)if(this.testAtPos(this._matchSpaces));else{if(!this.testAtPos(this._matchLineBreak))break;++e}return e>=2}testAtPos(e){if(e.matchedIndex<this._pos&&(e.lastIndex=this._pos,e.matched=e.exec(this._text),e.matchedIndex=null===e.matched?this._text.length:e.matched.index),e.matchedIndex===this._pos){if(this._pos=e.lastIndex,e.needIncrementLineIndex){const t=/\r?\n|\r/g;for(;t.exec(e.matched[0]);)++this._lineIndex}return!0}return!1}}},6838:(e,t)=>{"use strict";function i(e,i,r){for(const n of t.ATTACK_DIRECTIONS[r]){const t=i-n;if(!(136&t)&&e.board[t]===r)return!0}return!1}function r(e,i,r,n){for(const o of t.ATTACK_DIRECTIONS[r]){let t=i;for(;;){if(t-=o,!(136&t)){const i=e.board[t];if(-1===i)continue;if(i===r||i===n)return!0}break}}return!1}function n(e,i,r,n){for(const o of t.ATTACK_DIRECTIONS[n]){const t=i-o;136&t||e.board[t]!==n||r.push(t)}}function o(e,i,r,n,o){for(const s of t.ATTACK_DIRECTIONS[n]){let t=i;for(;;){if(t-=s,!(136&t)){const i=e.board[t];if(-1===i)continue;i!==n&&i!==o||r.push(t)}break}}}Object.defineProperty(t,"__esModule",{value:!0}),t.ATTACK_DIRECTIONS=void 0,t.isAttacked=function(e,t,n){return i(e,t,0+n)||i(e,t,8+n)||i(e,t,10+n)||r(e,t,4+n,2+n)||r(e,t,6+n,2+n)},t.getAttacks=function(e,t,i){const r=[];return n(e,t,r,0+i),n(e,t,r,8+i),n(e,t,r,10+i),o(e,t,r,4+i,2+i),o(e,t,r,6+i,2+i),r},t.ATTACK_DIRECTIONS=[[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-17,-16,-15,-1,1,15,16,17],[-16,-1,1,16],[-16,-1,1,16],[-17,-15,15,17],[-17,-15,15,17],[-33,-31,-18,-14,14,18,31,33],[-33,-31,-18,-14,14,18,31,33],[15,17],[-17,-15]]},9457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.colorToString=function(e){return i[e]},t.pieceToString=function(e){return r[e]},t.fileToString=function(e){return n[e]},t.rankToString=function(e){return o[e]},t.resultToString=function(e){return s[e]},t.variantToString=function(e){return a[e]},t.colorFromString=function(e){return"string"==typeof e?i.indexOf(e):-1},t.pieceFromString=function(e){return"string"==typeof e?r.indexOf(e):-1},t.fileFromString=function(e){return"string"==typeof e?n.indexOf(e):-1},t.rankFromString=function(e){return"string"==typeof e?o.indexOf(e):-1},t.resultFromString=function(e){return"string"==typeof e?s.indexOf(e):-1},t.variantFromString=function(e){return"string"==typeof e?a.indexOf(e):-1},t.squareToString=function(e){return n[e%16]+o[Math.trunc(e/16)]},t.squareFromString=function(e){if("string"!=typeof e||!/^[a-h][1-8]$/.test(e))return-1;const t=n.indexOf(e[0]);return 16*o.indexOf(e[1])+t},t.coloredPieceToString=function(e){return i[e%2]+r[Math.trunc(e/2)]},t.coloredPieceFromString=function(e){if("string"!=typeof e||!/^[wb][kqrbnp]$/.test(e))return-1;const t=i.indexOf(e[0]);return 2*r.indexOf(e[1])+t},t.figurineToString=function(e){return l[e]},t.figurineFromString=function(e){return l.indexOf(String(e))},t.squareColorImpl=function(e){return 1&(~e^e>>4)};const i=[..."wb"],r=[..."kqrbnp"],n=[..."abcdefgh"],o=[..."12345678"],s=["1-0","0-1","1/2-1/2","*"],a=["regular","chess960","no-king","white-king-only","black-king-only","antichess","horde"],l=[..."♔♚♕♛♖♜♗♝♘♞♙♟"]},2778:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ascii=function(e,{flipped:t=!1,prefix:i="",coordinateVisible:n=!1}){const o=i+(n?"  ":"")+"+---+---+---+---+---+---+---+---+\n",s=t?[0,1,2,3,4,5,6,7]:[7,6,5,4,3,2,1,0],a=t?[7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7];let c=o;for(const t of s){c+=i,n&&(c+=t+1+" ");for(const i of a){const r=e.board[16*t+i];c+="| "+(-1===r?" ":l[r])+" "}c+="|\n",c+=o}return n&&(c+=i+(t?"    h   g   f   e   d   c   b   a\n":"    a   b   c   d   e   f   g   h\n")),c+=i+(0,r.colorToString)(e.turn)+" "+u(e)+" "+h(e),0!==e.variant&&(c+=" ("+(0,r.variantToString)(e.variant)+")"),c},t.getFEN=function(e,t=0,i=1,n=!1){let o="";for(let t=7;t>=0;--t){let i=0;for(let r=0;r<8;++r){const n=e.board[16*t+r];-1===n?++i:(i>0&&(o+=i,i=0),o+=l[n])}i>0&&(o+=i),t>0&&(o+="/")}return o+=" "+(0,r.colorToString)(e.turn)+" "+u(e,n)+" "+h(e),o+=" "+t+" "+i,o},t.parseFEN=function(e,t,i){const u=i?t.split(" "):t.replace(/^\s+|\s+$/g,"").split(/\s+/);if(6!==u.length)throw new s.InvalidFEN(t,a.i18n.WRONG_NUMBER_OF_FEN_FIELDS);const d=u[0].split("/");if(8!==d.length)throw new s.InvalidFEN(t,a.i18n.WRONG_NUMBER_OF_SUBFIELDS_IN_BOARD_FIELD);const h=(0,n.makeEmpty)(e);h.legal=null,h.effectiveCastling=null,h.effectiveEnPassant=null;for(let e=7;e>=0;--e){const i=d[7-e];let r=0,n=0;for(;r<i.length&&n<8;){const o=i[r],c=l.indexOf(o);if(/^[1-8]$/.test(o))n+=parseInt(o,10);else{if(!(c>=0))throw new s.InvalidFEN(t,a.i18n.UNEXPECTED_CHARACTER_IN_BOARD_FIELD,o);h.board[16*e+n]=c,++n}++r}if(r!==i.length||8!==n)throw new s.InvalidFEN(t,a.i18n.UNEXPECTED_END_OF_SUBFIELD_IN_BOARD_FIELD,8-e)}if(h.turn=(0,r.colorFromString)(u[1]),h.turn<0)throw new s.InvalidFEN(t,a.i18n.INVALID_TURN_FIELD);const p=1===e?function(e,t,i){const n=[0,0];if("-"===e)return n;if(!(t?/^[A-H]{0,2}[a-h]{0,2}$/:/^[A-Ha-h]*|[KQkq]*$/).test(e))return null;function o(e){const t=4+e,r=0+e;for(let n=112*e;n<112*e+8;++n){if(i[n]===t)return n%8;if(i[n]===r)break}return 0}function s(e){const t=4+e,r=0+e;for(let n=112*e+7;n>=112*e;--n){if(i[n]===t)return n%8;if(i[n]===r)break}return 7}t||(e.indexOf("K")>=0&&(n[0]|=1<<s(0)),e.indexOf("Q")>=0&&(n[0]|=1<<o(0)),e.indexOf("k")>=0&&(n[1]|=1<<s(1)),e.indexOf("q")>=0&&(n[1]|=1<<o(1)));for(let t=0;t<8;++t){const i=(0,r.fileToString)(t);e.indexOf(i.toUpperCase())>=0&&(n[0]|=1<<t),e.indexOf(i)>=0&&(n[1]|=1<<t)}return n}(u[2],i,h.board):function(e,t){const i=[0,0];return"-"===e?i:(t?/^K?Q?k?q?$/:/^[KQkq]*$/).test(e)?(e.indexOf("K")>=0&&(i[0]|=128),e.indexOf("Q")>=0&&(i[0]|=1),e.indexOf("k")>=0&&(i[1]|=128),e.indexOf("q")>=0&&(i[1]|=1),i):null}(u[2],i);if(null===p)throw new s.InvalidFEN(t,a.i18n.INVALID_CASTLING_FIELD);h.castling=p;const f=u[3];if("-"!==f){if(!/^[a-h][36]$/.test(f))throw new s.InvalidFEN(t,a.i18n.INVALID_EN_PASSANT_FIELD);if(h.enPassant=(0,r.fileFromString)(f[0]),i){if(f[1]!==c[h.turn])throw new s.InvalidFEN(t,a.i18n.WRONG_RANK_IN_EN_PASSANT_FIELD);if((0,o.refreshEffectiveEnPassant)(h),h.enPassant!==h.effectiveEnPassant)throw new s.InvalidFEN(t,a.i18n.INEFFECTIVE_EN_PASSANT_FIELD,(0,r.fileToString)(h.enPassant))}}const g=i?/^(?:0|[1-9][0-9]*)$/:/^[0-9]+$/;if(!g.test(u[4]))throw new s.InvalidFEN(t,a.i18n.INVALID_HALF_MOVE_COUNT_FIELD);if(!g.test(u[5]))throw new s.InvalidFEN(t,a.i18n.INVALID_MOVE_NUMBER_FIELD);return{position:h,fiftyMoveClock:parseInt(u[4],10),fullMoveNumber:parseInt(u[5],10)}};const r=i(9457),n=i(6585),o=i(5116),s=i(8698),a=i(9955),l=[..."KkQqRrBbNnPp"],c=["6","3"];function u(e,t=!1){if((0,o.refreshEffectiveCastling)(e),1===e.variant){if(t){const t=d(e,0),i=d(e,1);if(!1!==t&&!1!==i)return""===t&&""===i?"-":t.toUpperCase()+i}let i="",n="";for(let t=0;t<8;++t)e.effectiveCastling[0]&1<<t&&(i+=(0,r.fileToString)(t)),e.effectiveCastling[1]&1<<t&&(n+=(0,r.fileToString)(t));return""===i&&""===n?"-":i.toUpperCase()+n}{let t="";return 128&e.effectiveCastling[0]&&(t+="K"),1&e.effectiveCastling[0]&&(t+="Q"),128&e.effectiveCastling[1]&&(t+="k"),1&e.effectiveCastling[1]&&(t+="q"),""===t?"-":t}}function d(e,t){const i=1<<e.king[t]%16,r=e.effectiveCastling[t]&~(i|i-1),n=e.effectiveCastling[t]&i-1;let o="";const s=112*t,a=112*t+7,l=4+t;if(0!==r){let i=!1;for(let r=e.king[t]+1;r<=a;++r)if(e.board[r]===l){if(i)return!1;i=!0}o+="k"}if(0!==n){let i=!1;for(let r=e.king[t]-1;r>=s;--r)if(e.board[r]===l){if(i)return!1;i=!0}o+="q"}return o}function h(e){return(0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant<0?"-":(0,r.fileToString)(e.effectiveEnPassant)+c[e.turn]}},6585:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCanonicalStartPosition=function(e){return null!==n[e]},t.makeEmpty=function(e){return{board:i.slice(),turn:0,castling:[0,0],enPassant:-1,variant:e,legal:2===e,king:[-1,-1],effectiveCastling:[0,0],effectiveEnPassant:-1}},t.makeInitial=function(e){const t=n[e];return{board:t.board.slice(),turn:0,castling:t.castling.slice(),enPassant:-1,variant:e,legal:!0,king:t.king.slice(),effectiveCastling:t.castling.slice(),effectiveEnPassant:-1}},t.make960FromScharnagl=function(e){const t=function(e){const t=[-1,-1,-1,-1,-1,-1,-1,-1];let i=0,r=-1;function n(e){let i=0;for(let r=0;r<8;++r)t[r]>=0||(e(r,i),++i)}function o(e,i,r){n(((n,o)=>{o!==i&&o!==r||(t[n]=e)}))}switch(t[e%4*2+1]=3,e=Math.trunc(e/4),t[e%4*2]=3,o(1,(e=Math.trunc(e/4))%6,-1),e=Math.trunc(e/6)){case 0:o(4,0,1);break;case 1:o(4,0,2);break;case 2:o(4,0,3);break;case 3:o(4,0,4);break;case 4:o(4,1,2);break;case 5:o(4,1,3);break;case 6:o(4,1,4);break;case 7:o(4,2,3);break;case 8:o(4,2,4);break;case 9:o(4,3,4)}return n(((e,n)=>{1===n?(t[e]=0,r=e):(t[e]=2,i|=1<<e)})),{pieceScheme:t,castling:i,kingFile:r}}(e),i=t.pieceScheme.map((e=>2*e+0)),r=t.pieceScheme.map((e=>2*e+1));return{board:[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]],turn:0,castling:[t.castling,t.castling],enPassant:-1,variant:1,legal:!0,king:[0+t.kingFile,112+t.kingFile],effectiveCastling:[t.castling,t.castling],effectiveEnPassant:-1}},t.makeCopy=function(e){return{board:e.board.slice(),turn:e.turn,castling:e.castling.slice(),enPassant:e.enPassant,variant:e.variant,legal:e.legal,king:e.king.slice(),effectiveCastling:null===e.effectiveCastling?null:e.effectiveCastling.slice(),effectiveEnPassant:e.effectiveEnPassant}};const i=[-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1],r=[4,8,6,2,0,6,8,4,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,5,9,7,3,1,7,9,5],n=[{board:r,castling:[129,129],king:[4,116]},null,null,null,null,{board:r,castling:[0,0],king:[-1,-1]},{board:[10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,10,10,10,10,10,10,10,10,-2,-2,-2,-2,-2,-2,-2,-2,-1,10,10,-1,-1,10,10,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,11,11,11,11,11,11,11,11,-2,-2,-2,-2,-2,-2,-2,-2,5,9,7,3,1,7,9,5],castling:[0,129],king:[-1,116]}]},5116:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLegal=function(e){return n(e),e.legal},t.refreshLegalFlagAndKingSquares=n,t.isKingSafeAfterMove=a,t.refreshEffectiveCastling=l,t.refreshEffectiveEnPassant=d,t.isEqual=function(e,t){if(e.turn!==t.turn||e.variant!==t.variant)return!1;for(let i=0;i<120;i+=7&~i?1:9)if(e.board[i]!==t.board[i])return!1;return l(e),l(t),e.effectiveCastling[0]===t.effectiveCastling[0]&&e.effectiveCastling[1]===t.effectiveCastling[1]&&(d(e),d(t),e.effectiveEnPassant===t.effectiveEnPassant)};const r=i(6838);function n(e){if(null!==e.legal)return;e.legal=!1;const t=o(e,0),i=o(e,1);if(!t||!i)return;if(5===e.variant){if(!s(e,1-e.turn))return}else if(6===e.variant&&1===e.turn&&!s(e,0))return;if(e.king[1-e.turn]>=0&&(0,r.isAttacked)(e,e.king[1-e.turn],e.turn))return;const n=6===e.variant?-2:10;for(let t=0;t<8;++t){const i=e.board[0+t],r=e.board[112+t];if(i===n||10===r||11===i||11===r)return}e.legal=!0}function o(e,t){const i=0+t;if(e.king[t]=-1,5===e.variant)return!0;if(2===e.variant||e.variant===4-t||6===e.variant&&0===t){for(let t=0;t<120;t+=7&~t?1:9)if(e.board[t]===i)return!1;return!0}for(let r=0;r<120;r+=7&~r?1:9)if(e.board[r]===i){if(!(e.king[t]<0))return e.king[t]=-1,!1;e.king[t]=r}return e.king[t]>=0}function s(e,t){for(let i=0;i<120;i+=7&~i?1:9)if(-1!==e.board[i]&&e.board[i]%2===t)return!0;return!1}function a(e,t,i,n=-1){if(e.king[e.turn]<0)return!0;const o=e.board[t],s=e.board[i],a=Math.trunc(o/2);e.board[i]=o,e.board[t]=-1,n>=0&&(e.board[n]=-1);try{return!(0,r.isAttacked)(e,0===a?i:e.king[e.turn],1-e.turn)}finally{e.board[t]=o,e.board[i]=s,n>=0&&(e.board[n]=11-e.turn)}}function l(e){null===e.effectiveCastling&&(n(e),e.effectiveCastling=1===e.variant?[u(e,0),u(e,1)]:[c(e,0),c(e,1)])}function c(e,t){const i=112*t;if(e.king[t]!==i+4||0===e.castling[t])return 0;const r=4+t;let n=0;return 1&e.castling[t]&&e.board[i]===r&&(n|=1),128&e.castling[t]&&e.board[i+7]===r&&(n|=128),n}function u(e,t){const i=112*t;if(e.king[t]<=i||e.king[t]>=i+7||0===e.castling[t])return 0;const r=4+t;let n=0,o=-1;for(let n=e.king[t]%16-1;n>=0;--n)if(e.castling[t]&1<<n&&e.board[i+n]===r){if(!(o<0)){o=-1;break}o=n}o>=0&&(n|=1<<o);let s=-1;for(let n=e.king[t]%16+1;n<8;++n)if(e.castling[t]&1<<n&&e.board[i+n]===r){if(!(s<0)){s=-1;break}s=n}return s>=0&&(n|=1<<s),n}function d(e){if(null!==e.effectiveEnPassant)return;if(e.effectiveEnPassant=-1,e.enPassant<0)return;const t=16*(6-5*e.turn)+e.enPassant,i=16*(5-3*e.turn)+e.enPassant,r=16*(4-e.turn)+e.enPassant,o=10+e.turn,s=11-e.turn;if(-1!==e.board[t]||-1!==e.board[i]||e.board[r]!==s)return;const l=!(r-1&136)&&e.board[r-1]===o,c=!(r+1&136)&&e.board[r+1]===o;(l||c)&&(n(e),(l&&a(e,r-1,i,r)||c&&a(e,r+1,i,r))&&(e.effectiveEnPassant=e.enPassant))}},1789:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MoveDescriptorImpl=void 0;const r=i(9457),n=i(8698),o=i(3616);class s extends o.MoveDescriptor{static make(e,t,i,r){return new s(-1===r?0:4,e,t,i,i,r,-1,-1)}static makeCastling(e,t,i,r,n){const o=0+n;return new s(1,e,t,o,o,4+n,i,r)}static makeEnPassant(e,t,i,r){const n=10+r;return new s(6,e,t,n,n,11-r,i,-1)}static makePromotion(e,t,i,r,n){return new s(8|(-1===r?0:4),e,t,10+i,2*n+i,r,-1,-1)}constructor(e,t,i,r,n,o,s,a){super(),this._flags=e,this._from=t,this._to=i,this._movingColoredPiece=r,this._finalColoredPiece=n,this._optionalColoredPiece=o,this._optionalSquare1=s,this._optionalSquare2=a}isCastling(){return!!(1&this._flags)}isEnPassant(){return!!(2&this._flags)}isCapture(){return!!(4&this._flags)}isPromotion(){return!!(8&this._flags)}from(){return(0,r.squareToString)(this._from)}to(){return(0,r.squareToString)(this._to)}color(){return(0,r.colorToString)(this._movingColoredPiece%2)}movingPiece(){return(0,r.pieceToString)(Math.trunc(this._movingColoredPiece/2))}movingColoredPiece(){return(0,r.coloredPieceToString)(this._movingColoredPiece)}capturedPiece(){if(!this.isCapture())throw new n.IllegalArgument("MoveDescriptor.capturedPiece()");return(0,r.pieceToString)(Math.trunc(this._optionalColoredPiece/2))}capturedColoredPiece(){if(!this.isCapture())throw new n.IllegalArgument("MoveDescriptor.capturedColoredPiece()");return(0,r.coloredPieceToString)(this._optionalColoredPiece)}rookFrom(){if(!this.isCastling())throw new n.IllegalArgument("MoveDescriptor.rookFrom()");return(0,r.squareToString)(this._optionalSquare1)}rookTo(){if(!this.isCastling())throw new n.IllegalArgument("MoveDescriptor.rookTo()");return(0,r.squareToString)(this._optionalSquare2)}enPassantSquare(){if(!this.isEnPassant())throw new n.IllegalArgument("MoveDescriptor.enPassantSquare()");return(0,r.squareToString)(this._optionalSquare1)}promotion(){if(!this.isPromotion())throw new n.IllegalArgument("MoveDescriptor.promotion()");return(0,r.pieceToString)(Math.trunc(this._finalColoredPiece/2))}coloredPromotion(){if(!this.isPromotion())throw new n.IllegalArgument("MoveDescriptor.coloredPromotion()");return(0,r.coloredPieceToString)(this._finalColoredPiece)}}t.MoveDescriptorImpl=s},3055:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCheck=function(e){return(0,o.isLegal)(e)&&u(e)},t.isCheckmate=function(e){return!(!(0,o.isLegal)(e)||d(e))&&(5===e.variant||(6===e.variant&&0===e.turn?!c(e,0):u(e)))},t.isStalemate=function(e){return!(!(0,o.isLegal)(e)||d(e))&&(5===e.variant||(6===e.variant&&0===e.turn?c(e,0):!u(e)))},t.isDead=function(e,t){return!!(0,o.isLegal)(e)&&((0===e.variant||1===e.variant)&&(t?function(e){const t=[0,0],i=[-1,-1];for(let r=0;r<120;r+=7&~r?1:9){const o=e.board[r];if(-1===o)continue;const s=o%2,a=Math.trunc(o/2);if(3===a){const e=(0,n.squareColorImpl)(r);if(i[s]===e)continue;i[s]=e}if(3===a||4===a){if(t[s]+=3===a?2:1,t[s]>=3)return!1}else if(0!==a)return!1}return!0}(e):function(e){let t=!1,i=-1;for(let r=0;r<120;r+=7&~r?1:9){const o=e.board[r];if(-1===o)continue;const s=Math.trunc(o/2);if(3===s){const e=(0,n.squareColorImpl)(r);if(i===e)continue;i=e}if(3===s||4===s){if(t)return!1;t=!0}else if(0!==s)return!1}return!0}(e)))},t.hasMove=d,t.moves=function(e){const t=[];return h(e,(e=>{t.push(e)})),t},t.isCaptureMandatory=f,t.isCastlingMoveLegal=g,t.isMoveLegal=function(e,t,i){if(!(0,o.isLegal)(e))return!1;const r=e.board[t],n=e.board[i],c=Math.trunc(r/2);if(-1===r||r%2!==e.turn)return!1;const u=i-t+119;let d=-1,h=!1;const p=5===c&&(i<8||i>=112),m=f(e);if(0===c&&!m&&((0,o.refreshEffectiveCastling)(e),0!==e.effectiveCastling[e.turn])){const r=g(e,t,i);if(r)return{type:"regular",moveDescriptor:r}}if(!(a[u]&1<<r)){if(5!==c||u!==151-64*e.turn)return!1;{const i=96*e.turn;if(t<i||t>=i+24)return!1;h=!0}}if(5===c){if((0,o.refreshEffectiveEnPassant)(e),u===135-32*e.turn||h){if(m||-1!==n)return!1}else if(-1===n){if(i!==16*(5-3*e.turn)+e.effectiveEnPassant)return!1;d=16*(4-e.turn)+e.effectiveEnPassant}else if(n%2===e.turn)return!1}else if(-1===n?m:n%2===e.turn)return!1;if(3===c||2===c||1===c){const r=l[u];for(let n=t+r;n!==i;n+=r)if(-1!==e.board[n])return!1}else if(h&&-1!==e.board[(t+i)/2])return!1;return!!(0,o.isKingSafeAfterMove)(e,t,i,d)&&(p?{type:"promotion",moveDescriptorFactory:b(t,i,e.variant,e.turn,n)}:{type:"regular",moveDescriptor:d>=0?s.MoveDescriptorImpl.makeEnPassant(t,i,d,e.turn):s.MoveDescriptorImpl.make(t,i,r,n)})},t.play=function(e,t){(0,o.refreshEffectiveCastling)(e),e.board[t._from]=-1,t.isEnPassant()?e.board[t._optionalSquare1]=-1:t.isCastling()&&(e.board[t._optionalSquare1]=-1,e.board[t._optionalSquare2]=t._optionalColoredPiece),e.board[t._to]=t._finalColoredPiece;const i=Math.trunc(t._movingColoredPiece/2);if(0===i&&(e.effectiveCastling[e.turn]=0),t._from<8&&(e.effectiveCastling[0]&=~(1<<t._from)),t._to<8&&(e.effectiveCastling[0]&=~(1<<t._to)),t._from>=112&&(e.effectiveCastling[1]&=~(1<<t._from%16)),t._to>=112&&(e.effectiveCastling[1]&=~(1<<t._to%16)),e.castling[0]=e.effectiveCastling[0],e.castling[1]=e.effectiveCastling[1],e.enPassant=-1,e.effectiveEnPassant=-1,5===i&&32===Math.abs(t._from-t._to)){const i=16*(1+5*e.turn);if(t._from>=i&&t._from<i+8){const i=1^t._movingColoredPiece;(t._to-1&136||e.board[t._to-1]!==i)&&(t._to+1&136||e.board[t._to+1]!==i)||(e.enPassant=t._to%16,e.effectiveEnPassant=null)}}0===i&&e.king[e.turn]>=0&&(e.king[e.turn]=t._to),e.turn=1-e.turn},t.isNullMoveLegal=v,t.playNullMove=function(e){return!!v(e)&&(e.turn=1-e.turn,e.enPassant=-1,e.effectiveEnPassant=-1,!0)};const r=i(6838),n=i(9457),o=i(5116),s=i(1789),a=[204,0,0,0,0,0,0,60,0,0,0,0,0,0,204,0,0,204,0,0,0,0,0,60,0,0,0,0,0,204,0,0,0,0,204,0,0,0,0,60,0,0,0,0,204,0,0,0,0,0,0,204,0,0,0,60,0,0,0,204,0,0,0,0,0,0,0,0,204,0,0,60,0,0,204,0,0,0,0,0,0,0,0,0,0,204,768,60,768,204,0,0,0,0,0,0,0,0,0,0,0,768,2255,2111,2255,768,0,0,0,0,0,0,60,60,60,60,60,60,63,0,63,60,60,60,60,60,60,0,0,0,0,0,0,768,1231,1087,1231,768,0,0,0,0,0,0,0,0,0,0,0,204,768,60,768,204,0,0,0,0,0,0,0,0,0,0,204,0,0,60,0,0,204,0,0,0,0,0,0,0,0,204,0,0,0,60,0,0,0,204,0,0,0,0,0,0,204,0,0,0,0,60,0,0,0,0,204,0,0,0,0,204,0,0,0,0,0,60,0,0,0,0,0,204,0,0,204,0,0,0,0,0,0,60,0,0,0,0,0,0,204,0],l=[-17,0,0,0,0,0,0,-16,0,0,0,0,0,0,-15,0,0,-17,0,0,0,0,0,-16,0,0,0,0,0,-15,0,0,0,0,-17,0,0,0,0,-16,0,0,0,0,-15,0,0,0,0,0,0,-17,0,0,0,-16,0,0,0,-15,0,0,0,0,0,0,0,0,-17,0,0,-16,0,0,-15,0,0,0,0,0,0,0,0,0,0,-17,0,-16,0,-15,0,0,0,0,0,0,0,0,0,0,0,0,-17,-16,-15,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,15,16,17,0,0,0,0,0,0,0,0,0,0,0,0,15,0,16,0,17,0,0,0,0,0,0,0,0,0,0,15,0,0,16,0,0,17,0,0,0,0,0,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,0,0,0,15,0,0,0,0,16,0,0,0,0,17,0,0,0,0,15,0,0,0,0,0,16,0,0,0,0,0,17,0,0,15,0,0,0,0,0,0,16,0,0,0,0,0,0,17,0];function c(e,t){for(let i=0;i<120;i+=7&~i?1:9)if(-1!==e.board[i]&&e.board[i]%2===t)return!0;return!1}function u(e){return e.king[e.turn]>=0&&(0,r.isAttacked)(e,e.king[e.turn],1-e.turn)}function d(e){class t{}try{return h(e,(()=>{throw new t})),!1}catch(e){if(e instanceof t)return!0;throw e}}function h(e,t){if(!(0,o.isLegal)(e))return;const i=!f(e);if((0,o.refreshEffectiveCastling)(e),i&&0!==e.effectiveCastling[e.turn]){const i=112*e.turn;for(let r=0;r<8;++r)if(e.effectiveCastling[e.turn]&1<<r){const n=i+r,o=i+(n<e.king[e.turn]?3:5),a=i+(n<e.king[e.turn]?2:6);m(e,e.king[e.turn],a,n,o)&&t(s.MoveDescriptorImpl.makeCastling(e.king[e.turn],a,n,o,e.turn))}}if((0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant>=0){const i=16*(5-3*e.turn)+e.effectiveEnPassant,r=16*(4-e.turn)+e.effectiveEnPassant,n=10+e.turn;r-1&136||e.board[r-1]!==n||!(0,o.isKingSafeAfterMove)(e,r-1,i,r)||t(s.MoveDescriptorImpl.makeEnPassant(r-1,i,r,e.turn)),r+1&136||e.board[r+1]!==n||!(0,o.isKingSafeAfterMove)(e,r+1,i,r)||t(s.MoveDescriptorImpl.makeEnPassant(r+1,i,r,e.turn))}for(let n=0;n<120;n+=7&~n?1:9){const a=e.board[n],l=Math.trunc(a/2);if(-1!==a&&a%2===e.turn)if(5===l){for(const i of r.ATTACK_DIRECTIONS[a]){const r=n+i;136&r||-1===e.board[r]||e.board[r]%2===e.turn||!(0,o.isKingSafeAfterMove)(e,n,r)||p(e,n,r,t)}if(i){const i=16-32*e.turn;let r=n+i;if(-1===e.board[r]){(0,o.isKingSafeAfterMove)(e,n,r)&&p(e,n,r,t);const l=96*e.turn;n>=l&&n<l+24&&(r+=i,-1===e.board[r]&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,-1)))}}}else if(4===l||0===l)for(const l of r.ATTACK_DIRECTIONS[a]){const r=n+l;if(!(136&r)){const l=e.board[r];(-1===l?i:l%2!==e.turn)&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,l))}}else for(const l of r.ATTACK_DIRECTIONS[a])for(let r=n+l;!(136&r);r+=l){const l=e.board[r];if((-1===l?i:l%2!==e.turn)&&(0,o.isKingSafeAfterMove)(e,n,r)&&t(s.MoveDescriptorImpl.make(n,r,a,l)),-1!==l)break}}}function p(e,t,i,r){const n=e.board[i];i<8||i>=112?(r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,1)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,2)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,3)),r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,4)),5===e.variant&&r(s.MoveDescriptorImpl.makePromotion(t,i,e.turn,n,0))):r(s.MoveDescriptorImpl.make(t,i,10+e.turn,n))}function f(e){if(5!==e.variant)return!1;for(let t=0;t<120;t+=7&~t?1:9){const i=e.board[t];if(-1!==i&&i%2!==e.turn&&(0,r.isAttacked)(e,t,e.turn))return!0}return(0,o.refreshEffectiveEnPassant)(e),e.effectiveEnPassant>=0}function g(e,t,i){let r=-1,n=-1;if(1===e.variant){const o=i%16;if(Math.trunc(i/16)!==7*e.turn||!(e.effectiveCastling[e.turn]&1<<o))return!1;r=i,n=(t>i?3:5)+112*e.turn,i=(t>i?2:6)+112*e.turn}else if(i===2+112*e.turn){if(!(1&e.effectiveCastling[e.turn]))return!1;r=112*e.turn,n=3+112*e.turn}else{if(i!==6+112*e.turn)return!1;if(!(128&e.effectiveCastling[e.turn]))return!1;r=7+112*e.turn,n=5+112*e.turn}return!!m(e,t,i,r,n)&&s.MoveDescriptorImpl.makeCastling(t,i,r,n,e.turn)}function m(e,t,i,n,o){e.board[t]=-1,e.board[n]=-1;try{for(let r=Math.min(t,i,n,o);r<=Math.max(t,i,n,o);++r)if(-1!==e.board[r])return!1;const s=1-e.turn;for(let n=Math.min(t,i);n<=Math.max(t,i);++n)if((0,r.isAttacked)(e,n,s))return!1;return!0}finally{e.board[t]=0+e.turn,e.board[n]=4+e.turn}}function b(e,t,i,r,n){return o=>5!==o&&(0!==o||5===i)&&s.MoveDescriptorImpl.makePromotion(e,t,r,n,o)}function v(e){return(0,o.isLegal)(e)&&!u(e)}},7261:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNotation=function(e,t,i){let r="";return t.isCastling()?r=t._to%16==6?"O-O":"O-O-O":5===Math.trunc(t._movingColoredPiece/2)?(t.isCapture()&&(r+=(0,n.fileToString)(t._from%16)+"x"),r+=(0,n.squareToString)(t._to),t.isPromotion()&&(r+="="+h(t._finalColoredPiece,i))):(r+=h(t._movingColoredPiece,i),r+=f(e,t._from,t._to),t.isCapture()&&(r+="x"),r+=(0,n.squareToString)(t._to)),r+=p(e,t),r},t.parseNotation=function(e,t,i,s){const h=/^(?:(O-O-O|0-0-0)|(O-O|0-0)|([A-Z\u2654-\u265f])([a-h])?([1-8])?(x)?([a-h][1-8])|(?:([a-h])(x)?)?([a-h][1-8])(?:(=)?([A-Z\u2654-\u265f]))?)([+#])?$/.exec(t);if(null===h)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_MOVE_NOTATION_SYNTAX);if(!(0,a.isLegal)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_POSITION);let g=!1;if(g=void 0!==h[1]||void 0!==h[2]?function(e,t,i,r,n){const s=e.king[e.turn];if(s<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_NO_KING_CASTLING);(0,a.refreshEffectiveCastling)(e);const l=void 0!==n,h=function(e,t){if(1===e.variant){if(0!==e.effectiveCastling[e.turn]){const i=0+e.turn;for(let r=t?7:0;e.board[r+112*e.turn]!==i;r+=t?-1:1)if(e.effectiveCastling[e.turn]&1<<r)return r}return-1}return t?6:2}(e,l),p=h>=0&&(0,c.isCastlingMoveLegal)(e,s,h+112*e.turn);if(!p){const i=l?d.i18n.ILLEGAL_KING_SIDE_CASTLING:d.i18n.ILLEGAL_QUEEN_SIDE_CASTLING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(i&&"0"===(l?n:r).charAt(0))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CASTLING_MOVE_ENCODED_WITH_ZERO);return p}(e,t,i,h[1],h[2]):void 0!==h[3]?function(e,t,i,s,h,p,g,m){const v=2*b(e,t,h,i,s)+e.turn,_=(0,n.squareFromString)(m),I=e.board[_];if(-1!==I&&I%2===e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.TRYING_TO_CAPTURE_YOUR_OWN_PIECES);if(-1===I&&(0,c.isCaptureMandatory)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CAPTURE_IS_MANDATORY);let N=(0,r.getAttacks)(e,_,e.turn).filter((t=>e.board[t]===v));if(void 0!==p){const e=(0,n.fileFromString)(p);N=N.filter((t=>t%16===e))}if(void 0!==g){const e=(0,n.rankFromString)(g);N=N.filter((t=>Math.trunc(t/16)===e))}if(0===N.length){const i=void 0===p&&void 0===g?d.i18n.NO_PIECE_CAN_MOVE_TO:d.i18n.NO_PIECE_CAN_MOVE_TO_DISAMBIGUATION;throw new u.InvalidNotation((0,o.getFEN)(e),t,i,h,m)}let w=!1;for(const i of N)if((0,a.isKingSafeAfterMove)(e,i,_)){if(w)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.REQUIRE_DISAMBIGUATION,h,m);w=l.MoveDescriptorImpl.make(i,_,v,I)}if(!w){const i=0===e.turn?d.i18n.NOT_SAFE_FOR_WHITE_KING:d.i18n.NOT_SAFE_FOR_BLACK_KING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(i){const i=f(e,w._from,_),r=(p??"")+(g??"");if(i!==r)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.WRONG_DISAMBIGUATION_SYMBOL,i,r)}return w}(e,t,i,s,h[3],h[4],h[5],h[7]):function(e,t,i,r,s,h,p,f){const g=10+e.turn,m=(0,n.squareFromString)(h),v=e.board[m],_=16-32*e.turn;let I=m-_,N=-1;if(void 0!==s){if(136&I)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);const i=(0,n.fileFromString)(s),r=m%16;if(r-i==1)I-=1;else{if(r-i!=-1)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);I+=1}if(e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);if(-1===v){if((0,a.refreshEffectiveEnPassant)(e),m!==16*(5-3*e.turn)+e.effectiveEnPassant)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE);N=16*(4-e.turn)+e.effectiveEnPassant}else if(v%2===e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_CAPTURING_PAWN_MOVE)}else{if((0,c.isCaptureMandatory)(e))throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.CAPTURE_IS_MANDATORY);if(136&I)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE);if(-1!==v)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE);if(-1===e.board[I]){I-=_;const i=96*e.turn;if(I<i||I>=i+24||e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE)}else if(e.board[I]!==g)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_NON_CAPTURING_PAWN_MOVE)}if(!(0,a.isKingSafeAfterMove)(e,I,m,N)){const i=0===e.turn?d.i18n.NOT_SAFE_FOR_WHITE_KING:d.i18n.NOT_SAFE_FOR_BLACK_KING;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}if(m<8||m>=112){if(void 0===f)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.MISSING_PROMOTION);const n=b(e,t,f,i,r);if(5===n||0===n&&5!==e.variant)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PROMOTED_PIECE,f);if(i&&void 0===p)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.MISSING_PROMOTION_SYMBOL);return l.MoveDescriptorImpl.makePromotion(I,m,e.turn,v,n)}if(void 0!==f)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.ILLEGAL_PROMOTION);return N>=0?l.MoveDescriptorImpl.makeEnPassant(I,m,N,e.turn):l.MoveDescriptorImpl.make(I,m,g,v)}(e,t,i,s,h[8],h[10],h[11],h[12]),i){const i=void 0!==h[6]||void 0!==h[9];if(g.isCapture()!==i){const i=g.isCapture()?d.i18n.MISSING_CAPTURE_SYMBOL:d.i18n.INVALID_CAPTURE_SYMBOL;throw new u.InvalidNotation((0,o.getFEN)(e),t,i)}const r=p(e,g),n=h[13]??"";if(r!==n)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.WRONG_CHECK_CHECKMATE_SYMBOL,r,n)}return g};const r=i(6838),n=i(9457),o=i(2778),s=i(6585),a=i(5116),l=i(1789),c=i(3055),u=i(8698),d=i(9955);function h(e,t){switch(t){case"figurine":return(0,n.figurineToString)(e);case"standard":return(0,n.pieceToString)(Math.trunc(e/2)).toUpperCase()}}function p(e,t){const i=(0,s.makeCopy)(e);return(0,c.play)(i,t),(0,c.isCheckmate)(i)?"#":(0,c.isCheck)(i)?"+":""}function f(e,t,i){const o=(0,r.getAttacks)(e,i,e.turn).filter((i=>e.board[i]===e.board[t]));if(o.length<2)return"";let s=!1,a=!1,l=!1;const c=Math.trunc(t/16),u=t%16;for(const r of o)r===t||g(e,r,i)||(s=!0,c===Math.trunc(r/16)&&(a=!0),u===r%16&&(l=!0));return l?a?(0,n.squareToString)(t):(0,n.rankToString)(c):s?(0,n.fileToString)(u):""}function g(e,t,i){const r=e.king[e.turn];if(r<0)return!1;const n=Math.abs(r-t),o=Math.abs(i-t),s=3-e.turn,a=5-e.turn,l=7-e.turn;return n<8?o>=8&&m(e,r,t,r<t?1:-1,a,s):n%16==0?o%16!=0&&m(e,r,t,r<t?16:-16,a,s):n%15==0?o%15!=0&&m(e,r,t,r<t?15:-15,l,s):n%17==0&&o%17!=0&&m(e,r,t,r<t?17:-17,l,s)}function m(e,t,i,r,n,o){for(let n=t+r;n!==i;n+=r)if(-1!==e.board[n])return!1;for(let t=i+r;!(136&t);t+=r)if(-1!==e.board[t])return e.board[t]===n||e.board[t]===o;return!1}function b(e,t,i,r,s){switch(s){case"figurine":{const s=(0,n.figurineFromString)(i);if(s<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL,i);if(r&&s%2!==e.turn)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL_COLOR,i);return Math.trunc(s/2)}case"standard":{const r=(0,n.pieceFromString)(i.toLowerCase());if(r<0)throw new u.InvalidNotation((0,o.getFEN)(e),t,d.i18n.INVALID_PIECE_SYMBOL,i);return r}}}},9988:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUCINotation=function(e,t,i){let r=t.from();return t.isCastling()?r+=i||1===e.variant?t.rookFrom():t.to():r+=t.to(),t.isPromotion()&&(r+=t.promotion()),r},t.parseUCINotation=function(e,t,i){const c=/^([a-h][1-8])([a-h][1-8])([kqrbnp]?)$/.exec(t);if(null===c)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.INVALID_UCI_NOTATION_SYNTAX);if(!(0,o.isLegal)(e))throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_POSITION);const u=(0,r.squareFromString)(c[1]);let d=(0,r.squareFromString)(c[2]),h=!1,p=-1;if(1!==e.variant&&!i&&-1!==e.board[u]&&-1!==e.board[d]&&e.board[u]%2==e.board[d]%2){const t=Math.trunc(e.board[u]/2),i=Math.trunc(e.board[d]/2);0===t&&2===i&&(h=!0,p=d,d=112*e.turn+(u<d?6:2))}const f=(0,s.isMoveLegal)(e,u,d);let g=!1;if(!f)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);if("promotion"===f.type){if(""===c[3])throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);if(g=f.moveDescriptorFactory((0,r.pieceFromString)(c[3])),!g)throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE)}else{if(""!==c[3])throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);g=f.moveDescriptor}if(h&&(!g.isCastling()||p!==g._optionalSquare1))throw new a.InvalidNotation((0,n.getFEN)(e),t,l.i18n.ILLEGAL_UCI_MOVE);return g};const r=i(9457),n=i(2778),o=i(5116),s=i(3055),a=i(8698),l=i(9955)},2694:(e,t,i)=>{"use strict";var r=i(9306);function n(){}function o(){}o.resetWarningCache=n,e.exports=function(){function e(e,t,i,n,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:n};return i.PropTypes=i,i}},5556:(e,t,i)=>{e.exports=i(2694)()},9306:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5338:(e,t,i)=>{"use strict";var r=i(5795);t.H=r.createRoot,r.hydrateRoot},5795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function i(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{"use strict";i(8387);const e=window.React;var t,r=i.n(e),n=i(5338);!function(e){e.LINE="line {0}",e.INVALID_FEN_ERROR_TITLE="Invalid FEN string.",e.INVALID_NOTATION_ERROR_TITLE="Invalid move notation.",e.TOOLTIP_GO_FIRST="Go to the beginning of the game",e.TOOLTIP_GO_PREVIOUS="Go to the previous move",e.TOOLTIP_GO_NEXT="Go to the next move",e.TOOLTIP_GO_LAST="Go to the end of the game",e.TOOLTIP_PLAY_STOP="Play/stop the game",e.TOOLTIP_FLIP="Flip the board",e.PIECE_SYMBOLS={K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"},e.ANNOTATED_BY="Annotated by {0}",e.INVALID_PGN_ERROR_TITLE="Invalid PGN string."}(t||(t={}));var o=i(3219);class s{constructor(e,t){this.functionOrComponentName=e,this.argumentName=t}toString(){return`Illegal argument '${this.argumentName}' in function or component ${this.functionOrComponentName}`}}const a=12,l=96;function c(e){return"string"==typeof e&&/^(?:[A-Za-z0-9]|plus|times|dot|circle)$/.test(e)}function u(e){return"b"===e||"g"===e||"r"===e||"y"===e}function d(e){if("string"!=typeof e)throw new s("parseSquareMarkers()","markers");return f(e,(e=>/^([BGRY])([a-h][1-8])$/.test(e)?{key:RegExp.$2,value:RegExp.$1.toLowerCase()}:void 0))}function h(e){if("string"!=typeof e)throw new s("parseTextMarkers()","markers");return f(e,(e=>/^([BGRY])(?:([A-Za-z0-9])|\((plus|times|dot|circle)\))([a-h][1-8])$/.test(e)?{key:RegExp.$4,value:{symbol:RegExp.$2||RegExp.$3,color:RegExp.$1.toLowerCase()}}:void 0))}function p(e){if("string"!=typeof e)throw new s("parseArrowMarkers()","markers");return f(e,(e=>/^([BGRY])([a-h][1-8][a-h][1-8])$/.test(e)?{key:RegExp.$2,value:RegExp.$1.toLowerCase()}:void 0))}function f(e,t){const i={};return e.split(",").map((e=>t(e.trim()))).forEach((e=>{e&&(i[e.key]=e.value)})),i}function g(e){return String(e)}function m(e){return Boolean(e)}function b(e,t){if(null==e)return{};if("object"!=typeof e)throw t();return e}function v(e,t){if("number"!=typeof e||!Number.isFinite(e))throw t();return Math.round(e)}function _(e,t,i,r){return Math.min(Math.max(v(e,r),t),i)}function I(e,t){return null==e?void 0:t(e)}function N(){const e=new Uint32Array(8);crypto.getRandomValues(e);let t="";for(const i of e)t+=i.toString(16);return t}function w(e,...t){return e.replace(/{(\d+)}/g,((e,i)=>{const r=Number(i);return r<t.length?String(t[r]):e}))}const S=5,E=36,y=4;function C({title:i,message:r,text:n,errorIndex:o,lineNumber:s}){let a;return i=g(i),r=g(r),n=I(n,g),o=Number.isInteger(o)?o:void 0,s=Number.isInteger(s)?s:void 0,n&&void 0!==o&&o>=0&&o<n.length&&(a=e.createElement("div",{className:"kokopu-errorExcerpt"},function(e,i,r){let n=i-S,o=!0;for(let t=0;t<=S+y;++t){const r=i-t-1;if(r<0||"\n"===e.charAt(r)||"\r"===e.charAt(r)){n=r+1,o=!1;break}}let s=i+E,a=!0;for(let t=0;t<=E+y;++t){const r=i+t+1;if(r>=e.length||"\n"===e.charAt(r)||"\r"===e.charAt(r)){s=r-1,a=!1;break}}let l=(o?"... ":"")+e.substring(n,s+1)+(a?" ...":"");l=l.replace(/\s/g," ");let c=" ".repeat(i-n+(o?y:0))+"^";return r&&r>=1&&(c+=` (${w(t.LINE,r)})`),l+"\n"+c}(n,o,s))),e.createElement("div",{className:"kokopu-errorBox"},e.createElement("div",{className:"kokopu-errorTitle"},i),e.createElement("div",{className:"kokopu-errorMessage"},r),a)}function A({size:t,color:i="currentcolor"}){t=_(t,a,l,(()=>new s("SquareMarkerIcon","size"))),i=g(i);const r=Math.round(.1*t),n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-squareMarkerIcon",viewBox:n,width:t,height:t},e.createElement("rect",{x:r,y:r,width:t-2*r,height:t-2*r,fill:i}))}const T=.1,P=.15,k=.425;function x({x:t,y:i,size:r,symbol:n,color:o}){if("dot"===n)return e.createElement("circle",{cx:t,cy:i,r:r*P,fill:o});if("circle"===n){const n=r*T;return e.createElement("circle",{className:"kokopu-symbolCircle",cx:t,cy:i,r:r*k,stroke:o,strokeWidth:n})}{const s="plus"===n?"+":"times"===n?"×":n;return e.createElement("text",{className:"kokopu-symbolText",x:t,y:i,fill:o,fontSize:r},s)}}function O({size:t,symbol:i,color:r="currentcolor"}){if(t=_(t,a,l,(()=>new s("TextMarkerIcon","size"))),!c(i))throw new s("TextMarkerIcon","symbol");r=g(r);const n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-textMarkerIcon",viewBox:n,width:t,height:t},e.createElement(x,{x:t/2,y:t/2,size:t,symbol:i,color:r}))}function L({id:t,color:i}){return e.createElement("marker",{id:t,markerWidth:4,markerHeight:4,refX:2.5,refY:2,orient:"auto"},e.createElement("path",{fill:i,d:"M 4,2 L 0,4 L 1,2 L 0,0 Z"}))}class D extends e.Component{constructor(){super(...arguments),this.arrowTipId=N()}render(){const t=_(this.props.size,a,l,(()=>new s("ArrowMarkerIcon","size"))),i=g(this.props.color),r=.2*t/2,n=`0 0 ${t} ${t}`;return e.createElement("svg",{className:"kokopu-arrowMarkerIcon",viewBox:n,width:t,height:t},e.createElement("defs",null,e.createElement(L,{id:this.arrowTipId,color:this.props.color})),e.createElement("line",{className:"kokopu-arrow",x1:r,y1:t/2,x2:t-3*r,y2:t/2,stroke:i,strokeWidth:2*r,markerEnd:`url(#${this.arrowTipId})`}))}}D.defaultProps={color:"currentcolor"};const R=i.p+"images/cburnett-bb.ea6f2416.png",M=i.p+"images/cburnett-bk.67fd6fca.png",q=i.p+"images/cburnett-bn.62fa7cdc.png",V=i.p+"images/cburnett-bp.3dcf0707.png",B=i.p+"images/cburnett-bq.d415cc0d.png",F=i.p+"images/cburnett-br.9cdfc5eb.png",G=i.p+"images/cburnett-wb.1d040321.png",U=i.p+"images/cburnett-wk.4efa4472.png",j=i.p+"images/cburnett-wn.9d8079de.png",z=i.p+"images/cburnett-wp.11023b5f.png",$=i.p+"images/cburnett-wq.321bc82a.png",H=i.p+"images/cburnett-wr.9f11cd25.png",W=i.p+"images/cburnett-bx.a6030f67.png",K=i.p+"images/cburnett-wx.73aad9cd.png",J=i.p+"images/celtic-bb.e9ae0c1c.png",Y=i.p+"images/celtic-bk.0843ad22.png",Q=i.p+"images/celtic-bn.cffcfa13.png",X=i.p+"images/celtic-bp.3c1d61a4.png",Z=i.p+"images/celtic-bq.0151721c.png",ee=i.p+"images/celtic-br.c933978d.png",te=i.p+"images/celtic-wb.5411c112.png",ie=i.p+"images/celtic-wk.6bff280b.png",re=i.p+"images/celtic-wn.b84697e8.png",ne=i.p+"images/celtic-wp.bdbcd1cb.png",oe=i.p+"images/celtic-wq.c5b97b97.png",se=i.p+"images/celtic-wr.bde80e59.png",ae=i.p+"images/eyes-bb.5771ab48.png",le=i.p+"images/eyes-bk.12aae1e0.png",ce=i.p+"images/eyes-bn.44e7f8a3.png",ue=i.p+"images/eyes-bp.3a05ea2f.png",de=i.p+"images/eyes-bq.df12f0e7.png",he=i.p+"images/eyes-br.6416a13c.png",pe=i.p+"images/eyes-wb.232d2808.png",fe=i.p+"images/eyes-wk.be8ddec7.png",ge=i.p+"images/eyes-wn.91dfea2b.png",me=i.p+"images/eyes-wp.46827b3b.png",be=i.p+"images/eyes-wq.9179d6d2.png",ve=i.p+"images/eyes-wr.259c8532.png",_e=i.p+"images/fantasy-bb.f88f7da6.png",Ie=i.p+"images/fantasy-bk.98149195.png",Ne=i.p+"images/fantasy-bn.5b46eaf4.png",we=i.p+"images/fantasy-bp.c1f332e7.png",Se=i.p+"images/fantasy-bq.6df46574.png",Ee=i.p+"images/fantasy-br.d8c4a5e4.png",ye=i.p+"images/fantasy-wb.6a57ff26.png",Ce=i.p+"images/fantasy-wk.5c9d9df8.png",Ae=i.p+"images/fantasy-wn.df2c0f14.png",Te=i.p+"images/fantasy-wp.1f5a89d4.png",Pe=i.p+"images/fantasy-wq.8ac6e3dc.png",ke=i.p+"images/fantasy-wr.b17912d1.png",xe=i.p+"images/skulls-bb.9fa6d142.png",Oe=i.p+"images/skulls-bk.0b3db3da.png",Le=i.p+"images/skulls-bn.7fa7cc9a.png",De=i.p+"images/skulls-bp.202dfbe9.png",Re=i.p+"images/skulls-bq.29bb4a1f.png",Me=i.p+"images/skulls-br.a6226fad.png",qe=i.p+"images/skulls-wb.18e5791d.png",Ve=i.p+"images/skulls-wk.c6a350c3.png",Be=i.p+"images/skulls-wn.0979559c.png",Fe=i.p+"images/skulls-wp.8d7c1334.png",Ge=i.p+"images/skulls-wq.a92fae95.png",Ue=i.p+"images/skulls-wr.b8d35bb3.png",je=i.p+"images/spatial-bb.2e7e83ee.png",ze=i.p+"images/spatial-bk.638dc5a7.png",$e=i.p+"images/spatial-bn.49f37ab7.png",He=i.p+"images/spatial-bp.4c496f6e.png",We=i.p+"images/spatial-bq.04bbb72a.png",Ke=i.p+"images/spatial-br.f7fc8f08.png",Je=i.p+"images/spatial-wb.befe4896.png",Ye=i.p+"images/spatial-wk.013e12c3.png",Qe=i.p+"images/spatial-wn.b68afa3e.png",Xe=i.p+"images/spatial-wp.c3d78661.png",Ze=i.p+"images/spatial-wq.d34a46a1.png",et=i.p+"images/spatial-wr.6f451ecf.png",tt=i.p+"images/celtic-bx.bfb13cd3.png",it=i.p+"images/celtic-wx.0e93181b.png",rt=i.p+"images/eyes-spatial-bx.2257ef49.png",nt=i.p+"images/eyes-spatial-wx.abb4bf3b.png",ot=i.p+"images/fantasy-bx.6136a6ab.png",st=i.p+"images/fantasy-wx.271b66c5.png",at=i.p+"images/skulls-bx.921e2a33.png",lt=i.p+"images/skulls-wx.e2d2b43b.png",ct={};ct.cburnett={bb:R,bk:M,bn:q,bp:V,bq:B,br:F,bx:W,wb:G,wk:U,wn:j,wp:z,wq:$,wr:H,wx:K},ct.celtic={bb:J,bk:Y,bn:Q,bp:X,bq:Z,br:ee,bx:tt,wb:te,wk:ie,wn:re,wp:ne,wq:oe,wr:se,wx:it},ct.eyes={bb:ae,bk:le,bn:ce,bp:ue,bq:de,br:he,bx:rt,wb:pe,wk:fe,wn:ge,wp:me,wq:be,wr:ve,wx:nt},ct.fantasy={bb:_e,bk:Ie,bn:Ne,bp:we,bq:Se,br:Ee,bx:ot,wb:ye,wk:Ce,wn:Ae,wp:Te,wq:Pe,wr:ke,wx:st},ct.skulls={bb:xe,bk:Oe,bn:Le,bp:De,bq:Re,br:Me,bx:at,wb:qe,wk:Ve,wn:Be,wp:Fe,wq:Ge,wr:Ue,wx:lt},ct.spatial={bb:je,bk:ze,bn:$e,bp:He,bq:We,br:Ke,bx:rt,wb:Je,wk:Ye,wn:Qe,wp:Xe,wq:Ze,wr:et,wx:nt};const ut={original:{b:"#b5876b",w:"#f0dec7",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},gray:{b:"#bbbbbb",w:"#f8f8f8",cb:"#04f",cg:"#0a0",cr:"#d00",cy:"#a90"},scid:{b:"#7389b6",w:"#f3f3f3",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},wikipedia:{b:"#d18b47",w:"#ffce9e",cb:"#04f",cg:"#0e0",cr:"#d00",cy:"#db0"},xboard:{b:"#77a26d",w:"#c8c365",cb:"#04f",cg:"#0f0",cr:"#d00",cy:"#ff0"},coral:{b:"rgb(112,162,163)",w:"rgb(177,228,185)",cb:"#04f",cg:"#080",cr:"#d00",cy:"#ff0"},dusk:{b:"rgb(112,102,119)",w:"rgb(204,183,174)",cb:"#04f",cg:"#3f3",cr:"#f20",cy:"#ff0"},emerald:{b:"rgb(111,143,114)",w:"rgb(173,189,143)",cb:"#04f",cg:"#6f6",cr:"#d00",cy:"#ff0"},marine:{b:"rgb(111,115,210)",w:"rgb(157,172,255)",cb:"#04f",cg:"#6f6",cr:"#f50",cy:"#ff0"},sandcastle:{b:"rgb(184,139,74)",w:"rgb(227,193,111)",cb:"#04f",cg:"#0c3",cr:"#d02",cy:"#ff0"},wheat:{b:"rgb(187,190,100)",w:"rgb(234,240,206)",cb:"#04f",cg:"#0c3",cr:"#d00",cy:"#ff3"}};class dt extends e.Component{constructor(){super(...arguments),this.innerRef=e.createRef(),this.mouseDownListener=e=>this.handleMouseDown(e),this.mouseMoveListener=e=>this.handleMouseMove(e),this.mouseUpListener=e=>this.handleMouseUp(e),this.touchStartListener=e=>this.handleTouchStart(e),this.touchMoveListener=e=>this.handleTouchMove(e),this.touchEndListener=e=>this.handleTouchEnd(e),this.touchCancelListener=e=>this.handleTouchCancel(e)}componentDidMount(){this.innerRef.current.addEventListener("mousedown",this.mouseDownListener),window.addEventListener("mousemove",this.mouseMoveListener),window.addEventListener("mouseup",this.mouseUpListener),this.innerRef.current.addEventListener("touchstart",this.touchStartListener,{passive:!1}),window.addEventListener("touchmove",this.touchMoveListener,{passive:!1}),window.addEventListener("touchend",this.touchEndListener),window.addEventListener("touchcancel",this.touchCancelListener)}componentWillUnmount(){this.innerRef.current.removeEventListener("mousedown",this.mouseDownListener),window.removeEventListener("mousemove",this.mouseMoveListener),window.removeEventListener("mouseup",this.mouseUpListener),this.innerRef.current.removeEventListener("touchstart",this.touchStartListener),window.removeEventListener("touchmove",this.touchMoveListener),window.removeEventListener("touchend",this.touchEndListener),window.removeEventListener("touchcancel",this.touchCancelListener)}render(){const t=["kokopu-handle",this.props.isArrowHandle?"kokopu-arrowDraggable":"kokopu-pieceDraggable"];return e.createElement("rect",{ref:this.innerRef,className:t.join(" "),x:this.props.x,y:this.props.y,width:this.props.width,height:this.props.height})}handleTouchStart(e){this.dragData||1!==e.touches.length||(e.preventDefault(),this.doInitDrag(e.target,e.touches[0]))}handleTouchMove(e){this.dragData&&(e.preventDefault(),1===e.touches.length?this.doUpdateDrag(e.touches[0]):this.doCancelDrag())}handleTouchEnd(e){this.dragData&&(e.preventDefault(),0===e.touches.length&&1===e.changedTouches.length?this.doEndDrag(e.changedTouches[0]):this.doCancelDrag())}handleTouchCancel(e){this.dragData&&(e.preventDefault(),this.doCancelDrag())}handleMouseDown(e){this.dragData||0!==e.button||(e.preventDefault(),this.doInitDrag(e.target,e))}handleMouseMove(e){this.dragData&&(e.preventDefault(),this.doUpdateDrag(e))}handleMouseUp(e){this.dragData&&(e.preventDefault(),this.doEndDrag(e))}doInitDrag(e,{pageX:t,pageY:i,clientX:r,clientY:n}){this.dragData={originX:t,originY:i};const o=e.getBoundingClientRect(),s=r-o.left,a=n-o.top;this.props.onDragStart&&this.props.onDragStart(s,a)}doUpdateDrag({pageX:e,pageY:t}){const{originX:i,originY:r}=this.dragData;this.props.onDrag&&this.props.onDrag(e-i,t-r)}doEndDrag({pageX:e,pageY:t}){const{originX:i,originY:r}=this.dragData;this.dragData=void 0,this.props.onDragStop&&this.props.onDragStop(e-i,t-r)}doCancelDrag(){this.props.onDragCanceled&&this.props.onDragCanceled()}}class ht extends e.Component{constructor(e){super(e),this.state={cursor:0},this.cursorStop=1;const t=window.__kokopu_debug_freeze_motion;"number"==typeof t&&t>=0&&t<=1&&(this.cursorStop=t)}componentDidMount(){this.animationFrameId=window.requestAnimationFrame((e=>this.handleAnimationStep(e)))}componentWillUnmount(){void 0!==this.animationFrameId&&(window.cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}handleAnimationStep(e){void 0===this.initialTimestamp&&(this.initialTimestamp=e);let t=(e-this.initialTimestamp)/this.props.duration;t<0?t=0:t>this.cursorStop&&(t=this.cursorStop),this.setState({cursor:t}),t===this.cursorStop?this.animationFrameId=void 0:this.animationFrameId=window.requestAnimationFrame((e=>this.handleAnimationStep(e)))}render(){return this.props.children(this.state.cursor)}}const pt=.15,ft=.3;class gt extends e.Component{constructor(e){super(e),this.arrowTipIdSuffix=N(),this.state={}}render(){let t=0;const i=[];(0,o.WD)((e=>i.push(this.renderSquare(e))));const r=[],n=[];if(this.props.coordinateVisible){t=mt(this.props.squareSize);for(let e=0;e<8;++e)r.push(this.renderRankCoordinate(t,e)),n.push(this.renderFileCoordinate(t,e))}const s=Math.round(-1*t),a=this.props.turnVisible?9*this.props.squareSize+Math.round(.1*this.props.squareSize):8*this.props.squareSize,l=8*this.props.squareSize+Math.round(1.4*t),c=`${s} 0 ${a-s} ${l-0}`;return e.createElement("svg",{className:"kokopu-chessboard",viewBox:c,width:a-s,height:l-0},e.createElement("defs",null,this.renderArrowTip("b"),this.renderArrowTip("g"),this.renderArrowTip("r"),this.renderArrowTip("y")),i,r,n,this.renderBoardContent())}renderBoardContent(){return this.props.move&&this.props.animated?e.createElement(ht,{duration:150},(e=>1===e?this.renderBoardContentStill():this.renderBoardContentAnimated(e))):this.renderBoardContentStill()}renderBoardContentAnimated(t){const i=[];return(0,o.WD)((e=>i.push(this.renderPieceAnimated(t,e)))),e.createElement(e.Fragment,null,i,this.renderMoveArrow(t),this.renderTurnFlag((0,o.VD)(this.props.position.turn())))}renderBoardContentStill(){const t=this.getPositionStill(),i=[],r=[];return(0,o.WD)((e=>{i.push(this.renderPiece(t,e)),this.props.interactionMode&&r.push(this.renderSquareHandle(t,e))})),e.createElement(e.Fragment,null,this.renderSquareMarkers(),this.renderHoveredSquare(),i,this.renderTextMarkers(),this.renderArrowMarkers(),this.renderMoveArrow(1),r,this.renderPromotionDrawer(t),this.renderDraggedPiece(t),this.renderDraggedArrow(),this.renderTurnFlag(t.turn()))}renderSquare(t){const{x:i,y:r}=this.getSquareCoordinates(t);return e.createElement("rect",{key:t,x:i,y:r,width:this.props.squareSize,height:this.props.squareSize,fill:this.props.colorset[(0,o.TL)(t)]})}renderHoveredSquare(){if(!this.state.hoveredSquare)return;const{x:t,y:i}=this.getSquareCoordinates(this.state.hoveredSquare),r=Math.max(2,Math.round(.1*this.props.squareSize)),n=this.props.squareSize-r,o=this.getColorForAnnotation("editArrows"===this.props.interactionMode?this.props.editedArrowColor:this.props.moveArrowColor);return e.createElement("rect",{className:"kokopu-hoveredSquare",x:t+r/2,y:i+r/2,width:n,height:n,stroke:o,strokeWidth:r})}renderPiece(t,i){const r=t.square(i);if("-"===r||this.state.inhibitedSquare===i)return;const{x:n,y:o}=this.getSquareCoordinates(i);return e.createElement("image",{key:"piece-"+i,x:n,y:o,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[r]})}renderPieceAnimated(t,i){const r=this.props.move;let n=this.props.position.square(i);if("-"===n||r.to()===i||r.isEnPassant()&&r.enPassantSquare()===i)return;let{x:o,y:s}=this.getSquareCoordinates(i);if(i===r.from()){const{x:e,y:i}=this.getSquareCoordinates(r.to());o=e*t+o*(1-t),s=i*t+s*(1-t),r.isPromotion()&&t>.8&&(n=r.coloredPromotion())}else if(r.isCastling()&&i===r.rookFrom()){const{x:e,y:i}=this.getSquareCoordinates(r.rookTo());o=e*t+o*(1-t),s=i*t+s*(1-t)}return e.createElement("image",{key:"piece-"+i,x:o,y:s,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[n]})}renderDraggedPiece(t){if("movePieces"!==this.props.interactionMode&&"playMoves"!==this.props.interactionMode||!this.state.draggedSquare)return;const i=t.square(this.state.draggedSquare);let{x:r,y:n}=this.getSquareCoordinates(this.state.draggedSquare);return r=Math.min(Math.max(r+this.state.dragPosition.x,0),7*this.props.squareSize),n=Math.min(Math.max(n+this.state.dragPosition.y,0),7*this.props.squareSize),e.createElement("image",{className:"kokopu-pieceDraggable kokopu-dragging",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[i]})}renderDraggedArrow(){if("editArrows"!==this.props.interactionMode||!this.state.draggedSquare)return;const{x:t,y:i}=this.getSquareCoordinates(this.state.draggedSquare),r=t+this.props.squareSize/2,n=i+this.props.squareSize/2,o=Math.min(Math.max(t+this.state.dragPosition.x+this.state.cursorOffset.x,this.props.squareSize/2),15*this.props.squareSize/2),s=Math.min(Math.max(i+this.state.dragPosition.y+this.state.cursorOffset.y,this.props.squareSize/2),15*this.props.squareSize/2);if(r===o&&n===s)return;const a=this.props.squareSize*pt,l=this.props.editedArrowColor;return e.createElement("line",{className:"kokopu-annotation kokopu-arrow kokopu-arrowDraggable kokopu-dragging",x1:r,y1:n,x2:o,y2:s,strokeWidth:a,stroke:this.getColorForAnnotation(l),markerEnd:`url(#${this.getArrowTipId(l)})`})}renderPromotionDrawer(t){if(!this.state.promotionDrawer)return;const{x:i,y:r}=this.getSquareCoordinates(this.state.promotionDrawer.origin),n=t.turn()===(this.props.flipped?"w":"b"),o=n?r-this.props.squareSize*(this.state.promotionDrawer.buttons.length-1):r,s=this.state.promotionDrawer.buttons.map(((o,s)=>{const a=t.turn()+o;return e.createElement("image",{key:"drawer-piece-"+o,className:"kokopu-clickable",x:i,y:r+s*(n?-this.props.squareSize:this.props.squareSize),width:this.props.squareSize,height:this.props.squareSize,href:this.props.pieceset[a],onClick:()=>this.handleDrawerButtonClicked(o)})}));return e.createElement(e.Fragment,null,e.createElement("rect",{className:"kokopu-handle",x:0,y:0,width:8*this.props.squareSize,height:8*this.props.squareSize,onClick:()=>this.handleDrawerCancelButtonClicked()}),e.createElement("rect",{x:i,y:o,width:this.props.squareSize,height:this.props.squareSize*this.state.promotionDrawer.buttons.length,fill:this.props.colorset.b}),e.createElement("rect",{className:"kokopu-drawerMask",x:i,y:o,width:this.props.squareSize,height:this.props.squareSize*this.state.promotionDrawer.buttons.length,fill:this.props.colorset.w}),s)}renderSquareHandle(t,i){const{x:r,y:n}=this.getSquareCoordinates(i),o="movePieces"===this.props.interactionMode&&"-"!==t.square(i),s="editArrows"===this.props.interactionMode,a="playMoves"===this.props.interactionMode&&!this.state.promotionDrawer&&t.isLegal()&&t.square(i).startsWith(t.turn());return o||s||a?e.createElement(dt,{key:"handle-"+i,x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,isArrowHandle:s,onDragStart:(e,t)=>this.handleDragStart(i,e,t),onDrag:(e,t)=>this.handleDrag(i,e,t),onDragStop:(e,t)=>this.handleDragStop(i,e,t),onDragCanceled:()=>this.handleDragCanceled()}):"clickSquares"===this.props.interactionMode?e.createElement("rect",{key:"handle-"+i,className:"kokopu-handle kokopu-clickable",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,onClick:()=>this.handleSquareClicked(i)}):void 0}renderSquareMarkers(){if(this.props.squareMarkers)return Object.entries(this.props.squareMarkers).map((([t,i])=>{const{x:r,y:n}=this.getSquareCoordinates(t);return e.createElement("rect",{key:"sqm-"+t,className:"kokopu-annotation",x:r,y:n,width:this.props.squareSize,height:this.props.squareSize,fill:this.getColorForAnnotation(i)})}))}renderTextMarkers(){if(this.props.textMarkers)return Object.entries(this.props.textMarkers).map((([t,i])=>{let{x:r,y:n}=this.getSquareCoordinates(t);return r+=this.props.squareSize/2,n+=this.props.squareSize/2,e.createElement("g",{key:"txtm-"+t,className:"kokopu-annotation"},e.createElement(x,{x:r,y:n,size:this.props.squareSize,symbol:i.symbol,color:this.getColorForAnnotation(i.color)}))}))}renderArrowMarkers(){if(!this.props.arrowMarkers)return;const t=this.props.squareSize*pt;return Object.entries(this.props.arrowMarkers).map((([i,r])=>{const n=i.substring(0,2),o=i.substring(2,4);if(n===o)return;let{x:s,y:a}=this.getSquareCoordinates(n),{x:l,y:c}=this.getSquareCoordinates(o);return s+=this.props.squareSize/2,a+=this.props.squareSize/2,l+=this.props.squareSize/2,c+=this.props.squareSize/2,l+=Math.sign(s-l)*ft*this.props.squareSize,c+=Math.sign(a-c)*ft*this.props.squareSize,e.createElement("line",{key:"arm-"+i,className:"kokopu-annotation kokopu-arrow",x1:s,y1:a,x2:l,y2:c,strokeWidth:t,stroke:this.getColorForAnnotation(r),markerEnd:`url(#${this.getArrowTipId(r)})`})}))}renderMoveArrow(t){if(!this.props.move||t<.1||!this.props.moveArrowVisible||this.props.move.from()===this.props.move.to())return;const i=this.props.squareSize*pt;let{x:r,y:n}=this.getSquareCoordinates(this.props.move.from());r+=this.props.squareSize/2,n+=this.props.squareSize/2;let{x:o,y:s}=this.getSquareCoordinates(this.props.move.to());o+=this.props.squareSize/2,s+=this.props.squareSize/2,o+=Math.sign(r-o)*ft*this.props.squareSize,s+=Math.sign(n-s)*ft*this.props.squareSize;const a=o*t+r*(1-t),l=s*t+n*(1-t);return e.createElement("line",{className:"kokopu-annotation kokopu-arrow",x1:r,y1:n,x2:a,y2:l,strokeWidth:i,stroke:this.getColorForAnnotation(this.props.moveArrowColor),markerEnd:`url(#${this.getArrowTipId(this.props.moveArrowColor)})`})}renderArrowTip(t){return e.createElement(L,{id:this.getArrowTipId(t),color:this.getColorForAnnotation(t)})}renderTurnFlag(t){if(!this.props.turnVisible)return;const i=8*this.props.squareSize+Math.round(.1*this.props.squareSize),r=t===(this.props.flipped?"b":"w")?7*this.props.squareSize:0;return e.createElement("image",{key:"turn-"+t,x:i,y:r,width:this.props.squareSize,height:this.props.squareSize,href:this.getURLForTurnFlag(t)})}renderRankCoordinate(t,i){const r=Math.round(-1*t)/2,n=(this.props.flipped?i+.5:7.5-i)*this.props.squareSize,o="12345678"[i];return e.createElement("text",{key:"rank-"+o,className:"kokopu-coordinate",x:r,y:n,fontSize:t},o)}renderFileCoordinate(t,i){const r=(this.props.flipped?7.5-i:.5+i)*this.props.squareSize,n=8*this.props.squareSize+Math.round(1.4*t)/2,o="abcdefgh"[i];return e.createElement("text",{key:"file-"+o,className:"kokopu-coordinate",x:r,y:n,fontSize:t},o)}handleDragStart(e,t,i){this.setState({inhibitedSquare:"movePieces"===this.props.interactionMode||"playMoves"===this.props.interactionMode?e:void 0,draggedSquare:e,hoveredSquare:e,cursorOffset:{x:t,y:i},dragPosition:{x:0,y:0}})}handleDrag(e,t,i){const{x:r,y:n}=this.getSquareCoordinates(e),o=this.getSquareAt(r+t+this.state.cursorOffset.x,n+i+this.state.cursorOffset.y);this.setState({hoveredSquare:o,dragPosition:{x:t,y:i}})}handleDragStop(e,t,i){const{x:r,y:n}=this.getSquareCoordinates(e),o=this.getSquareAt(r+t+this.state.cursorOffset.x,n+i+this.state.cursorOffset.y);if(this.setState({inhibitedSquare:void 0,draggedSquare:void 0,hoveredSquare:void 0}),e!==o&&o)if("movePieces"===this.props.interactionMode&&this.props.onPieceMoved)this.props.onPieceMoved(e,o);else if("editArrows"===this.props.interactionMode&&this.props.onArrowEdited)this.props.onArrowEdited(e,o);else if("playMoves"===this.props.interactionMode){const t=this.getPositionStill(),i=t.isMoveLegal(e,o);if(!i)return;switch(i.status){case"regular":this.props.onMovePlayed&&this.props.onMovePlayed(t.notation(i()));break;case"promotion":this.setState({inhibitedSquare:e,promotionDrawer:{origin:o,buttons:"antichess"===t.variant()?["q","r","b","n","k"]:["q","r","b","n"],builder:e=>t.notation(i(e))}})}}}handleDragCanceled(){this.setState({inhibitedSquare:void 0,draggedSquare:void 0,hoveredSquare:void 0})}handleDrawerCancelButtonClicked(){this.setState({inhibitedSquare:void 0,promotionDrawer:void 0})}handleDrawerButtonClicked(e){const t=this.state.promotionDrawer.builder;this.setState({inhibitedSquare:void 0,promotionDrawer:void 0}),this.props.onMovePlayed&&this.props.onMovePlayed(t(e))}handleSquareClicked(e){this.props.onSquareClicked&&this.props.onSquareClicked(e)}getPositionStill(){if(!this.props.move)return this.props.position;const e=new o.yX(this.props.position);return e.play(this.props.move),e}getSquareCoordinates(e){const{file:t,rank:i}=(0,o.cc)(e);return{x:this.props.flipped?(7-t)*this.props.squareSize:t*this.props.squareSize,y:this.props.flipped?i*this.props.squareSize:(7-i)*this.props.squareSize}}getSquareAt(e,t){const i=this.props.flipped?7-Math.floor(e/this.props.squareSize):Math.floor(e/this.props.squareSize),r=this.props.flipped?Math.floor(t/this.props.squareSize):7-Math.floor(t/this.props.squareSize);return i>=0&&i<8&&r>=0&&r<8?(0,o.i9)(i,r):void 0}getArrowTipId(e){return`kokopu-arrowTip-${e}-${this.arrowTipIdSuffix}`}getColorForAnnotation(e){return this.props.colorset["c"+e]}getURLForTurnFlag(e){return this.props.pieceset[e+"x"]}}function mt(e){return e<=32?8:8+.2*(e-32)}function bt(i,r,n){if(i instanceof o.Zt)return{error:!1,game:i};if(!(i instanceof o.Wm||"string"==typeof i))throw new s(n,"game");if(!Number.isInteger(r)||r<0)throw new s(n,"gameIndex");try{return{error:!1,game:i instanceof o.Wm?i.game(r):(0,o.oG)(i,r)}}catch(i){if(i instanceof o.exception.InvalidPGN)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_PGN_ERROR_TITLE,message:i.message,text:i.pgn,errorIndex:i.index,lineNumber:i.lineNumber})};throw i}}class vt extends e.Component{constructor(e){super(e),this.windowResizeListener=()=>this.handleWindowResize(),this.state={windowWidth:window.innerWidth}}componentDidMount(){window.addEventListener("resize",this.windowResizeListener)}componentWillUnmount(){window.removeEventListener("resize",this.windowResizeListener)}handleWindowResize(){this.setState({windowWidth:window.innerWidth})}render(){const i=function(i,r){if(i instanceof o.yX)return{error:!1,position:i};if("start"===i||"empty"===i)return{error:!1,position:new o.yX(i)};if("string"!=typeof i)throw new s(r,"position");try{const{variant:e,fen:t}=function(e){const t=e.indexOf(":");if(t<0)return{variant:"regular",fen:e};const i=e.substring(0,t);return(0,o.kf)(i)?{variant:i,fen:e.substring(t+1)}:{variant:"regular",fen:e}}(i),r=new o.yX(e,"empty");return r.fen(t),{error:!1,position:r}}catch(i){if(i instanceof o.exception.InvalidFEN)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_FEN_ERROR_TITLE,message:i.message})};throw i}}(this.props.position,"Chessboard");if(i.error)return i.errorBox;let r=i.position;const n=function(i,r){if(null==r)return{error:!1,type:"none"};if(r instanceof o.PP)return{error:!1,type:"regular",move:r};if("string"!=typeof r)throw new s("Chessboard","move");if("--"===r)return i.isNullMoveLegal()?{error:!1,type:"null-move"}:{error:!0,errorBox:e.createElement(C,{title:t.INVALID_NOTATION_ERROR_TITLE,message:o.Ru.ILLEGAL_NULL_MOVE})};try{return{error:!1,type:"regular",move:i.notation(r)}}catch(i){if(i instanceof o.exception.InvalidNotation)return{error:!0,errorBox:e.createElement(C,{title:t.INVALID_NOTATION_ERROR_TITLE,message:i.message})};throw i}}(r,this.props.move);if(n.error)return n.errorBox;const c="regular"===n.type?n.move:void 0;"null-move"===n.type&&(r=new o.yX(r),r.playNullMove());const f=Et(this.props.squareMarkers,"squareMarkers",d,o.Sz,u),g=Et(this.props.textMarkers,"textMarkers",h,o.Sz,yt),b=Et(this.props.arrowMarkers,"arrowMarkers",p,o.qz,u),v=m(this.props.flipped),I=_(this.props.squareSize,a,l,(()=>new s("Chessboard","squareSize"))),N=m(this.props.coordinateVisible),w=m(this.props.turnVisible),S=m(this.props.moveArrowVisible);if(!u(this.props.moveArrowColor))throw new s("Chessboard","moveArrowColor");const E=m(this.props.animated),y=ut[this.props.colorset];if(!y)throw new s("Chessboard","colorset");const A=ct[this.props.pieceset];if(!A)throw new s("Chessboard","pieceset");const T=Ct(this.props.smallScreenLimits,(()=>new s("Chessboard","smallScreenLimits"))),P=It(I,T,this.state.windowWidth),k=Nt(N,T,this.state.windowWidth),x=wt(w,T,this.state.windowWidth),O={squareSize:P,coordinateVisible:k,turnVisible:x},L=this.getInteractionModeAndValidateEditedArrowColor(),{onPieceMoved:D,onSquareClicked:R,onArrowEdited:M,onMovePlayed:q}=this.props,V=`${r.variant()}|${r.fen()}|${c?r.notation(c):""}`;return e.createElement(e.Fragment,null,this.props.topComponent?this.props.topComponent(O):void 0,e.createElement(gt,{key:V,position:r,move:c,squareMarkers:f,textMarkers:g,arrowMarkers:b,flipped:v,squareSize:P,coordinateVisible:k,turnVisible:x,moveArrowVisible:S,moveArrowColor:this.props.moveArrowColor,animated:E,colorset:y,pieceset:A,interactionMode:L,editedArrowColor:this.props.editedArrowColor,onPieceMoved:D,onSquareClicked:R,onArrowEdited:M,onMovePlayed:q}),this.props.bottomComponent?this.props.bottomComponent(O):void 0)}getInteractionModeAndValidateEditedArrowColor(){const e=I(this.props.interactionMode,g);if(void 0===e||"movePieces"===e||"clickSquares"===e||"playMoves"===e)return e;if("editArrows"===e){if(!u(this.props.editedArrowColor))throw new s("Chessboard","editedArrowColor");return e}throw new s("Chessboard","interactionMode")}static size(e){const{squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,topComponent:o,bottomComponent:c}=b(e,(()=>new s("Chessboard.size()","attr")));let u=void 0===t?40:_(t,a,l,(()=>new s("Chessboard.size()","squareSize"))),d=void 0===i||m(i),h=void 0===r||m(r);const p=Ct(n,(()=>new s("Chessboard.size()","smallScreenLimits")));return"undefined"!=typeof window&&(u=It(u,p,window.innerWidth),d=Nt(d,p,window.innerWidth),h=wt(h,p,window.innerWidth)),_t(u,d,h,o,c)}static adaptSquareSize(e,t,i){const{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,topComponent:c,bottomComponent:u}=b(i,(()=>new s("Chessboard.adaptSquareSize()","attr")));e=v(e,(()=>new s("Chessboard.adaptSquareSize()","width"))),t=v(t,(()=>new s("Chessboard.adaptSquareSize()","height")));let d=void 0===r||m(r),h=void 0===n||m(n);const p=Ct(o,(()=>new s("Chessboard.adaptSquareSize()","smallScreenLimits")));let f=l;function g(i){const{width:r,height:n}=_t(i,d,h,c,u);return r<=e&&n<=t}if("undefined"!=typeof window&&(f=It(f,p,window.innerWidth),d=Nt(d,p,window.innerWidth),h=wt(h,p,window.innerWidth)),g(f))return f;if(!g(a))return a;let _=a,I=f;for(;_+1<I;){const e=Math.floor((_+I)/2);g(e)?_=e:I=e}return _}static minSquareSize(){return a}static maxSquareSize(){return l}static colorsets(){return ut}static piecesets(){return ct}}function _t(e,t,i,r,n){let{width:o,height:s}=function(e,t,i){let r=8*e,n=8*e;if(i&&(r+=e+Math.round(.1*e)),t){const t=mt(e);r+=Math.round(1*t),n+=Math.round(1.4*t)}return{width:r,height:n}}(e,t,i);const a={squareSize:e,coordinateVisible:t,turnVisible:i};if(r){const{width:e,height:t}=r(a);o=Math.max(o,e),s+=t}if(n){const{width:e,height:t}=n(a);o=Math.max(o,e),s+=t}return{width:o,height:s}}function It(e,t,i){const r=St(t,i,(e=>e.squareSize));return void 0===r?e:Math.min(e,r)}function Nt(e,t,i){const r=St(t,i,(e=>e.coordinateVisible));return void 0===r?e:e&&r}function wt(e,t,i){const r=St(t,i,(e=>e.turnVisible));return void 0===r?e:e&&r}function St(e,t,i){let r,n=1/0;for(const o of e)t>o.width||void 0===i(o)||o.width<n&&(n=o.width,r=i(o));return r}function Et(e,t,i,r,n){if(null!=e){if("string"==typeof e)return i(e);if("object"==typeof e){const t={};return Object.entries(e).forEach((([e,i])=>{r(e)&&n(i)&&(t[e]=i)})),t}throw new s("Chessboard",t)}}function yt(e){return"object"==typeof e&&null!==e&&c(e.symbol)&&u(e.color)}function Ct(e,t){if(null==e)return[];if(Array.isArray(e))return e.map((e=>{if("object"!=typeof e||null===e)throw t();return{width:v(e.width,t),squareSize:I(e.squareSize,(e=>_(e,a,l,t))),coordinateVisible:I(e.coordinateVisible,m),turnVisible:I(e.turnVisible,m)}}));throw t()}function At(i){if("native"===i)return e=>e;if("localized"===i){const e=t.PIECE_SYMBOLS;return t=>Tt(e,t)}if("figurines"===i)return t=>function(t,i){const r=[];let n=0,o=0;for(let t=0;t<i.length;++t){const s=i.charAt(t);if("K"===s||"Q"===s||"R"===s||"B"===s||"N"===s||"P"===s){t>n&&r.push(i.substring(n,t)),n=t+1;const a="symbol-"+o++;r.push(e.createElement("span",{className:"kokopu-font-alpha",key:a},s))}}return n<i.length&&r.push(i.substring(n)),e.createElement(e.Fragment,null,r)}(0,t);if("object"==typeof(r=i)&&null!==r&&"string"==typeof r.K&&"string"==typeof r.Q&&"string"==typeof r.R&&"string"==typeof r.B&&"string"==typeof r.N&&"string"==typeof r.P)return e=>Tt(i,e);throw new s("moveFormatter","pieceSymbols");var r}function Tt(e,t){return t.replace(/[KQRBNP]/g,(t=>e[t]))}vt.defaultProps={squareSize:40,coordinateVisible:!0,turnVisible:!0,colorset:"original",pieceset:"cburnett",moveArrowVisible:!0,moveArrowColor:"b",animated:!1,position:"start",flipped:!1};class Pt extends e.Component{constructor(){super(...arguments),this.focusFieldRef=e.createRef()}render(){return e.createElement("div",{className:"kokopu-focusFieldContainer"},e.createElement("a",{className:"kokopu-focusField",href:"#",ref:this.focusFieldRef,onKeyDown:e=>this.handleKeyDown(e)}))}handleKeyDown(e){kt(e,"Home",this.props.onFirstPressed)||kt(e,"ArrowLeft",this.props.onPreviousPressed)||kt(e,"ArrowRight",this.props.onNextPressed)||kt(e,"End",this.props.onLastPressed)||kt(e,"Escape",this.props.onExitPressed)}focus(){const e=this.focusFieldRef.current;e&&e.focus()}}function kt(e,t,i){return e.key===t&&(i&&(e.preventDefault(),i()),!0)}function xt(e,t){if(e.findById(t))return"start"===t?void 0:"start"}function Ot(e,t){let i=e.findById(t);if(i&&(!(i instanceof o.mD)||(i=i.parentNode(),i))){for(;i;){const e=i.previous();if(e)return e.id();i=i.parentVariation().parentNode()}return"start"}}function Lt(e,t){const i=e.findById(t);if(!i)return;const r=i instanceof o.mD?i.first():i.next();return r?r.id():void 0}function Dt(e,t){let i=e.findById(t);if(!i)return;if(i=i instanceof o.mD?i.first():i.next(),!i)return;let r=i;for(;;){const e=r.next();if(!e)return r.id();r=e}}const Rt=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e=>e.charCodeAt(0)))),Mt=new Uint16Array("Ȁaglq\tɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e=>e.charCodeAt(0))));var qt;const Vt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Bt=null!==(qt=String.fromCodePoint)&&void 0!==qt?qt:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e),t};var Ft,Gt,Ut,jt,zt,$t,Ht,Wt;function Kt(e){return e>=Ft.ZERO&&e<=Ft.NINE}!function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(Ft||(Ft={})),function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(Gt||(Gt={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(Ut||(Ut={})),(zt=jt||(jt={}))[zt.Legacy=0]="Legacy",zt[zt.Strict=1]="Strict",zt[zt.Attribute=2]="Attribute";class Jt{constructor(e,t,i){this.decodeTree=e,this.emitCodePoint=t,this.errors=i,this.state=Ut.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=jt.Strict}startEntity(e){this.decodeMode=e,this.state=Ut.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Ut.EntityStart:return e.charCodeAt(t)===Ft.NUM?(this.state=Ut.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ut.NamedEntity,this.stateNamedEntity(e,t));case Ut.NumericStart:return this.stateNumericStart(e,t);case Ut.NumericDecimal:return this.stateNumericDecimal(e,t);case Ut.NumericHex:return this.stateNumericHex(e,t);case Ut.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===Ft.LOWER_X?(this.state=Ut.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ut.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,i,r){if(t!==i){const n=i-t;this.result=this.result*Math.pow(r,n)+parseInt(e.substr(t,n),r),this.consumed+=n}}stateNumericHex(e,t){const i=t;for(;t<e.length;){const n=e.charCodeAt(t);if(!(Kt(n)||(r=n,r>=Ft.UPPER_A&&r<=Ft.UPPER_F||r>=Ft.LOWER_A&&r<=Ft.LOWER_F)))return this.addToNumericResult(e,i,t,16),this.emitNumericEntity(n,3);t+=1}var r;return this.addToNumericResult(e,i,t,16),-1}stateNumericDecimal(e,t){const i=t;for(;t<e.length;){const r=e.charCodeAt(t);if(!Kt(r))return this.addToNumericResult(e,i,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,i,t,10),-1}emitNumericEntity(e,t){var i;if(this.consumed<=t)return null===(i=this.errors)||void 0===i||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ft.SEMI)this.consumed+=1;else if(this.decodeMode===jt.Strict)return 0;return this.emitCodePoint(function(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=Vt.get(e))&&void 0!==t?t:e}(this.result),this.consumed),this.errors&&(e!==Ft.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:i}=this;let r=i[this.treeIndex],n=(r&Gt.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const s=e.charCodeAt(t);if(this.treeIndex=Qt(i,r,this.treeIndex+Math.max(1,n),s),this.treeIndex<0)return 0===this.result||this.decodeMode===jt.Attribute&&(0===n||((o=s)===Ft.EQUALS||function(e){return e>=Ft.UPPER_A&&e<=Ft.UPPER_Z||e>=Ft.LOWER_A&&e<=Ft.LOWER_Z||Kt(e)}(o)))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],n=(r&Gt.VALUE_LENGTH)>>14,0!==n){if(s===Ft.SEMI)return this.emitNamedEntityData(this.treeIndex,n,this.consumed+this.excess);this.decodeMode!==jt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}var o;return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:i}=this,r=(i[t]&Gt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,i){const{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~Gt.VALUE_LENGTH:r[e+1],i),3===t&&this.emitCodePoint(r[e+2],i),i}end(){var e;switch(this.state){case Ut.NamedEntity:return 0===this.result||this.decodeMode===jt.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case Ut.NumericDecimal:return this.emitNumericEntity(0,2);case Ut.NumericHex:return this.emitNumericEntity(0,3);case Ut.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ut.EntityStart:return 0}}}function Yt(e){let t="";const i=new Jt(e,(e=>t+=Bt(e)));return function(e,r){let n=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(n,o),i.startEntity(r);const s=i.write(e,o+1);if(s<0){n=o+i.end();break}n=o+s,o=0===s?n+1:n}const s=t+e.slice(n);return t="",s}}function Qt(e,t,i,r){const n=(t&Gt.BRANCH_LENGTH)>>7,o=t&Gt.JUMP_TABLE;if(0===n)return 0!==o&&r===o?i:-1;if(o){const t=r-o;return t<0||t>=n?-1:e[i+t]-1}let s=i,a=s+n-1;for(;s<=a;){const t=s+a>>>1,i=e[t];if(i<r)s=t+1;else{if(!(i>r))return e[t+n];a=t-1}}return-1}function Xt(e){return e===$t.Space||e===$t.NewLine||e===$t.Tab||e===$t.FormFeed||e===$t.CarriageReturn}function Zt(e){return e===$t.Slash||e===$t.Gt||Xt(e)}Yt(Rt),Yt(Mt),function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}($t||($t={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.BeforeSpecialT=23]="BeforeSpecialT",e[e.SpecialStartSequence=24]="SpecialStartSequence",e[e.InSpecialTag=25]="InSpecialTag",e[e.InEntity=26]="InEntity"}(Ht||(Ht={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(Wt||(Wt={}));const ei={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class ti{constructor({xmlMode:e=!1,decodeEntities:t=!0},i){this.cbs=i,this.state=Ht.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=Ht.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=t,this.entityDecoder=new Jt(e?Mt:Rt,((e,t)=>this.emitCodePoint(e,t)))}reset(){this.state=Ht.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=Ht.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===$t.Lt||!this.decodeEntities&&this.fastForwardTo($t.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=Ht.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?Zt(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=Ht.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===$t.Gt||Xt(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart<t){const e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}return this.isSpecial=!1,this.sectionStart=t+2,void this.stateInClosingTagName(e)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===ei.TitleEnd?this.decodeEntities&&e===$t.Amp&&this.startEntity():this.fastForwardTo($t.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===$t.Lt)}stateCDATASequence(e){e===ei.Cdata[this.sequenceIndex]?++this.sequenceIndex===ei.Cdata.length&&(this.state=Ht.InCommentLike,this.currentSequence=ei.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=Ht.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===ei.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=Ht.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Zt(e):function(e){return e>=$t.LowerA&&e<=$t.LowerZ||e>=$t.UpperA&&e<=$t.UpperZ}(e)}startSpecial(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=Ht.SpecialStartSequence}stateBeforeTagName(e){if(e===$t.ExclamationMark)this.state=Ht.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===$t.Questionmark)this.state=Ht.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const t=32|e;this.sectionStart=this.index,this.xmlMode?this.state=Ht.InTagName:t===ei.ScriptEnd[2]?this.state=Ht.BeforeSpecialS:t===ei.TitleEnd[2]?this.state=Ht.BeforeSpecialT:this.state=Ht.InTagName}else e===$t.Slash?this.state=Ht.BeforeClosingTagName:(this.state=Ht.Text,this.stateText(e))}stateInTagName(e){Zt(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Xt(e)||(e===$t.Gt?this.state=Ht.Text:(this.state=this.isTagStartChar(e)?Ht.InClosingTagName:Ht.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===$t.Gt||Xt(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=Ht.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===$t.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=Ht.InSpecialTag,this.sequenceIndex=0):this.state=Ht.Text,this.sectionStart=this.index+1):e===$t.Slash?this.state=Ht.InSelfClosingTag:Xt(e)||(this.state=Ht.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===$t.Gt?(this.cbs.onselfclosingtag(this.index),this.state=Ht.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Xt(e)||(this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===$t.Eq||Zt(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=Ht.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===$t.Eq?this.state=Ht.BeforeAttributeValue:e===$t.Slash||e===$t.Gt?(this.cbs.onattribend(Wt.NoValue,this.sectionStart),this.sectionStart=-1,this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e)):Xt(e)||(this.cbs.onattribend(Wt.NoValue,this.sectionStart),this.state=Ht.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===$t.DoubleQuote?(this.state=Ht.InAttributeValueDq,this.sectionStart=this.index+1):e===$t.SingleQuote?(this.state=Ht.InAttributeValueSq,this.sectionStart=this.index+1):Xt(e)||(this.sectionStart=this.index,this.state=Ht.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===$t.DoubleQuote?Wt.Double:Wt.Single,this.index+1),this.state=Ht.BeforeAttributeName):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,$t.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,$t.SingleQuote)}stateInAttributeValueNoQuotes(e){Xt(e)||e===$t.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Wt.Unquoted,this.index),this.state=Ht.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===$t.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===$t.OpeningSquareBracket?(this.state=Ht.CDATASequence,this.sequenceIndex=0):this.state=e===$t.Dash?Ht.BeforeComment:Ht.InDeclaration}stateInDeclaration(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=Ht.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===$t.Dash?(this.state=Ht.InCommentLike,this.currentSequence=ei.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=Ht.InDeclaration}stateInSpecialComment(e){(e===$t.Gt||this.fastForwardTo($t.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=Ht.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const t=32|e;t===ei.ScriptEnd[3]?this.startSpecial(ei.ScriptEnd,4):t===ei.StyleEnd[3]?this.startSpecial(ei.StyleEnd,4):(this.state=Ht.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const t=32|e;t===ei.TitleEnd[3]?this.startSpecial(ei.TitleEnd,4):t===ei.TextareaEnd[3]?this.startSpecial(ei.TextareaEnd,4):(this.state=Ht.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=Ht.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?jt.Strict:this.baseState===Ht.Text||this.baseState===Ht.InSpecialTag?jt.Legacy:jt.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,0===e&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===Ht.Text||this.state===Ht.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==Ht.InAttributeValueDq&&this.state!==Ht.InAttributeValueSq&&this.state!==Ht.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case Ht.Text:this.stateText(e);break;case Ht.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case Ht.InSpecialTag:this.stateInSpecialTag(e);break;case Ht.CDATASequence:this.stateCDATASequence(e);break;case Ht.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case Ht.InAttributeName:this.stateInAttributeName(e);break;case Ht.InCommentLike:this.stateInCommentLike(e);break;case Ht.InSpecialComment:this.stateInSpecialComment(e);break;case Ht.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case Ht.InTagName:this.stateInTagName(e);break;case Ht.InClosingTagName:this.stateInClosingTagName(e);break;case Ht.BeforeTagName:this.stateBeforeTagName(e);break;case Ht.AfterAttributeName:this.stateAfterAttributeName(e);break;case Ht.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case Ht.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case Ht.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case Ht.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case Ht.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case Ht.BeforeSpecialT:this.stateBeforeSpecialT(e);break;case Ht.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case Ht.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case Ht.InDeclaration:this.stateInDeclaration(e);break;case Ht.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case Ht.BeforeComment:this.stateBeforeComment(e);break;case Ht.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case Ht.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===Ht.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===Ht.InCommentLike?this.currentSequence===ei.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===Ht.InTagName||this.state===Ht.BeforeAttributeName||this.state===Ht.BeforeAttributeValue||this.state===Ht.AfterAttributeName||this.state===Ht.InAttributeName||this.state===Ht.InAttributeValueSq||this.state===Ht.InAttributeValueDq||this.state===Ht.InAttributeValueNq||this.state===Ht.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){this.baseState!==Ht.Text&&this.baseState!==Ht.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const ii=new Set(["input","option","optgroup","select","button","datalist","textarea"]),ri=new Set(["p"]),ni=new Set(["thead","tbody"]),oi=new Set(["dd","dt"]),si=new Set(["rt","rp"]),ai=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",ri],["h1",ri],["h2",ri],["h3",ri],["h4",ri],["h5",ri],["h6",ri],["select",ii],["input",ii],["output",ii],["button",ii],["datalist",ii],["textarea",ii],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",oi],["dt",oi],["address",ri],["article",ri],["aside",ri],["blockquote",ri],["details",ri],["div",ri],["dl",ri],["fieldset",ri],["figcaption",ri],["figure",ri],["footer",ri],["form",ri],["header",ri],["hr",ri],["main",ri],["nav",ri],["ol",ri],["pre",ri],["section",ri],["table",ri],["ul",ri],["rt",si],["rp",si],["tbody",ni],["tfoot",ni]]),li=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ci=new Set(["math","svg"]),ui=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),di=/\s|\//;class hi{constructor(e,t={}){var i,r,n,o,s,a;this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=null!==(i=t.lowerCaseTags)&&void 0!==i?i:this.htmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:this.htmlMode,this.recognizeSelfClosing=null!==(n=t.recognizeSelfClosing)&&void 0!==n?n:!this.htmlMode,this.tokenizer=new(null!==(o=t.Tokenizer)&&void 0!==o?o:ti)(this.options,this),this.foreignContext=[!this.htmlMode],null===(a=(s=this.cbs).onparserinit)||void 0===a||a.call(s,this)}ontext(e,t){var i,r;const n=this.getSlice(e,t);this.endIndex=t-1,null===(r=(i=this.cbs).ontext)||void 0===r||r.call(i,n),this.startIndex=t}ontextentity(e,t){var i,r;this.endIndex=t-1,null===(r=(i=this.cbs).ontext)||void 0===r||r.call(i,Bt(e)),this.startIndex=t}isVoidElement(e){return this.htmlMode&&li.has(e)}onopentagname(e,t){this.endIndex=t;let i=this.getSlice(e,t);this.lowerCaseTagNames&&(i=i.toLowerCase()),this.emitOpenTag(i)}emitOpenTag(e){var t,i,r,n;this.openTagStart=this.startIndex,this.tagname=e;const o=this.htmlMode&&ai.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[0]);){const e=this.stack.shift();null===(i=(t=this.cbs).onclosetag)||void 0===i||i.call(t,e,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ci.has(e)?this.foreignContext.unshift(!0):ui.has(e)&&this.foreignContext.unshift(!1))),null===(n=(r=this.cbs).onopentagname)||void 0===n||n.call(r,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var t,i;this.startIndex=this.openTagStart,this.attribs&&(null===(i=(t=this.cbs).onopentag)||void 0===i||i.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){var i,r,n,o,s,a,l,c;this.endIndex=t;let u=this.getSlice(e,t);if(this.lowerCaseTagNames&&(u=u.toLowerCase()),this.htmlMode&&(ci.has(u)||ui.has(u))&&this.foreignContext.shift(),this.isVoidElement(u))this.htmlMode&&"br"===u&&(null===(o=(n=this.cbs).onopentagname)||void 0===o||o.call(n,"br"),null===(a=(s=this.cbs).onopentag)||void 0===a||a.call(s,"br",{},!0),null===(c=(l=this.cbs).onclosetag)||void 0===c||c.call(l,"br",!1));else{const e=this.stack.indexOf(u);if(-1!==e)for(let t=0;t<=e;t++){const n=this.stack.shift();null===(r=(i=this.cbs).onclosetag)||void 0===r||r.call(i,n,t!==e)}else this.htmlMode&&"p"===u&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var t,i;const r=this.tagname;this.endOpenTag(e),this.stack[0]===r&&(null===(i=(t=this.cbs).onclosetag)||void 0===i||i.call(t,r,!e),this.stack.shift())}onattribname(e,t){this.startIndex=e;const i=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?i.toLowerCase():i}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Bt(e)}onattribend(e,t){var i,r;this.endIndex=t,null===(r=(i=this.cbs).onattribute)||void 0===r||r.call(i,this.attribname,this.attribvalue,e===Wt.Double?'"':e===Wt.Single?"'":e===Wt.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const t=e.search(di);let i=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(i=i.toLowerCase()),i}ondeclaration(e,t){this.endIndex=t;const i=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(i);this.cbs.onprocessinginstruction(`!${e}`,`!${i}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;const i=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){const e=this.getInstructionName(i);this.cbs.onprocessinginstruction(`?${e}`,`?${i}`)}this.startIndex=t+1}oncomment(e,t,i){var r,n,o,s;this.endIndex=t,null===(n=(r=this.cbs).oncomment)||void 0===n||n.call(r,this.getSlice(e,t-i)),null===(s=(o=this.cbs).oncommentend)||void 0===s||s.call(o),this.startIndex=t+1}oncdata(e,t,i){var r,n,o,s,a,l,c,u,d,h;this.endIndex=t;const p=this.getSlice(e,t-i);!this.htmlMode||this.options.recognizeCDATA?(null===(n=(r=this.cbs).oncdatastart)||void 0===n||n.call(r),null===(s=(o=this.cbs).ontext)||void 0===s||s.call(o,p),null===(l=(a=this.cbs).oncdataend)||void 0===l||l.call(a)):(null===(u=(c=this.cbs).oncomment)||void 0===u||u.call(c,`[CDATA[${p}]]`),null===(h=(d=this.cbs).oncommentend)||void 0===h||h.call(d)),this.startIndex=t+1}onend(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)}reset(){var e,t,i,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(i=this.cbs).onparserinit)||void 0===r||r.call(i,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let i=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),i+=this.buffers[0].slice(0,t-this.bufferOffset);return i}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var t,i;this.ended?null===(i=(t=this.cbs).onerror)||void 0===i||i.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))}end(e){var t,i;this.ended?null===(i=(t=this.cbs).onerror)||void 0===i||i.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}var pi,fi;(fi=pi||(pi={})).Root="root",fi.Text="text",fi.Directive="directive",fi.Comment="comment",fi.Script="script",fi.Style="style",fi.Tag="tag",fi.CDATA="cdata",fi.Doctype="doctype",pi.Root,pi.Text,pi.Directive,pi.Comment,pi.Script,pi.Style,pi.Tag,pi.CDATA,pi.Doctype;class gi{constructor(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}get parentNode(){return this.parent}set parentNode(e){this.parent=e}get previousSibling(){return this.prev}set previousSibling(e){this.prev=e}get nextSibling(){return this.next}set nextSibling(e){this.next=e}cloneNode(e=!1){return Ei(this,e)}}class mi extends gi{constructor(e){super(),this.data=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e}}class bi extends mi{constructor(){super(...arguments),this.type=pi.Text}get nodeType(){return 3}}class vi extends mi{constructor(){super(...arguments),this.type=pi.Comment}get nodeType(){return 8}}class _i extends mi{constructor(e,t){super(t),this.name=e,this.type=pi.Directive}get nodeType(){return 1}}class Ii extends gi{constructor(e){super(),this.children=e}get firstChild(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null}get lastChild(){return this.children.length>0?this.children[this.children.length-1]:null}get childNodes(){return this.children}set childNodes(e){this.children=e}}class Ni extends Ii{constructor(){super(...arguments),this.type=pi.CDATA}get nodeType(){return 4}}class wi extends Ii{constructor(){super(...arguments),this.type=pi.Root}get nodeType(){return 9}}class Si extends Ii{constructor(e,t,i=[],r=("script"===e?pi.Script:"style"===e?pi.Style:pi.Tag)){super(i),this.name=e,this.attribs=t,this.type=r}get nodeType(){return 1}get tagName(){return this.name}set tagName(e){this.name=e}get attributes(){return Object.keys(this.attribs).map((e=>{var t,i;return{name:e,value:this.attribs[e],namespace:null===(t=this["x-attribsNamespace"])||void 0===t?void 0:t[e],prefix:null===(i=this["x-attribsPrefix"])||void 0===i?void 0:i[e]}}))}}function Ei(e,t=!1){let i;if(function(e){return e.type===pi.Text}(e))i=new bi(e.data);else if(function(e){return e.type===pi.Comment}(e))i=new vi(e.data);else if(function(e){return(t=e).type===pi.Tag||t.type===pi.Script||t.type===pi.Style;var t}(e)){const r=t?yi(e.children):[],n=new Si(e.name,{...e.attribs},r);r.forEach((e=>e.parent=n)),null!=e.namespace&&(n.namespace=e.namespace),e["x-attribsNamespace"]&&(n["x-attribsNamespace"]={...e["x-attribsNamespace"]}),e["x-attribsPrefix"]&&(n["x-attribsPrefix"]={...e["x-attribsPrefix"]}),i=n}else if(function(e){return e.type===pi.CDATA}(e)){const r=t?yi(e.children):[],n=new Ni(r);r.forEach((e=>e.parent=n)),i=n}else if(function(e){return e.type===pi.Root}(e)){const r=t?yi(e.children):[],n=new wi(r);r.forEach((e=>e.parent=n)),e["x-mode"]&&(n["x-mode"]=e["x-mode"]),i=n}else{if(!function(e){return e.type===pi.Directive}(e))throw new Error(`Not implemented yet: ${e.type}`);{const t=new _i(e.name,e.data);null!=e["x-name"]&&(t["x-name"]=e["x-name"],t["x-publicId"]=e["x-publicId"],t["x-systemId"]=e["x-systemId"]),i=t}}return i.startIndex=e.startIndex,i.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(i.sourceCodeLocation=e.sourceCodeLocation),i}function yi(e){const t=e.map((e=>Ei(e,!0)));for(let e=1;e<t.length;e++)t[e].prev=t[e-1],t[e-1].next=t[e];return t}const Ci={withStartIndices:!1,withEndIndices:!1,xmlMode:!1};class Ai{constructor(e,t,i){this.dom=[],this.root=new wi(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(i=t,t=Ci),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:Ci,this.elementCB=null!=i?i:null}onparserinit(e){this.parser=e}onreset(){this.dom=[],this.root=new wi(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null}onend(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))}onerror(e){this.handleCallback(e)}onclosetag(){this.lastNode=null;const e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)}onopentag(e,t){const i=this.options.xmlMode?pi.Tag:void 0,r=new Si(e,t,void 0,i);this.addNode(r),this.tagStack.push(r)}ontext(e){const{lastNode:t}=this;if(t&&t.type===pi.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{const t=new bi(e);this.addNode(t),this.lastNode=t}}oncomment(e){if(this.lastNode&&this.lastNode.type===pi.Comment)return void(this.lastNode.data+=e);const t=new vi(e);this.addNode(t),this.lastNode=t}oncommentend(){this.lastNode=null}oncdatastart(){const e=new bi(""),t=new Ni([e]);this.addNode(t),e.parent=t,this.lastNode=e}oncdataend(){this.lastNode=null}onprocessinginstruction(e,t){const i=new _i(e,t);this.addNode(i)}handleCallback(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e}addNode(e){const t=this.tagStack[this.tagStack.length-1],i=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),i&&(e.prev=i,i.next=e),e.parent=t,this.lastNode=null}}function Ti(e){for(let t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}new Map(Ti([[9,"&Tab;"],[0,"&NewLine;"],[22,"&excl;"],[0,"&quot;"],[0,"&num;"],[0,"&dollar;"],[0,"&percnt;"],[0,"&amp;"],[0,"&apos;"],[0,"&lpar;"],[0,"&rpar;"],[0,"&ast;"],[0,"&plus;"],[0,"&comma;"],[1,"&period;"],[0,"&sol;"],[10,"&colon;"],[0,"&semi;"],[0,{v:"&lt;",n:8402,o:"&nvlt;"}],[0,{v:"&equals;",n:8421,o:"&bne;"}],[0,{v:"&gt;",n:8402,o:"&nvgt;"}],[0,"&quest;"],[0,"&commat;"],[26,"&lbrack;"],[0,"&bsol;"],[0,"&rbrack;"],[0,"&Hat;"],[0,"&lowbar;"],[0,"&DiacriticalGrave;"],[5,{n:106,o:"&fjlig;"}],[20,"&lbrace;"],[0,"&verbar;"],[0,"&rbrace;"],[34,"&nbsp;"],[0,"&iexcl;"],[0,"&cent;"],[0,"&pound;"],[0,"&curren;"],[0,"&yen;"],[0,"&brvbar;"],[0,"&sect;"],[0,"&die;"],[0,"&copy;"],[0,"&ordf;"],[0,"&laquo;"],[0,"&not;"],[0,"&shy;"],[0,"&circledR;"],[0,"&macr;"],[0,"&deg;"],[0,"&PlusMinus;"],[0,"&sup2;"],[0,"&sup3;"],[0,"&acute;"],[0,"&micro;"],[0,"&para;"],[0,"&centerdot;"],[0,"&cedil;"],[0,"&sup1;"],[0,"&ordm;"],[0,"&raquo;"],[0,"&frac14;"],[0,"&frac12;"],[0,"&frac34;"],[0,"&iquest;"],[0,"&Agrave;"],[0,"&Aacute;"],[0,"&Acirc;"],[0,"&Atilde;"],[0,"&Auml;"],[0,"&angst;"],[0,"&AElig;"],[0,"&Ccedil;"],[0,"&Egrave;"],[0,"&Eacute;"],[0,"&Ecirc;"],[0,"&Euml;"],[0,"&Igrave;"],[0,"&Iacute;"],[0,"&Icirc;"],[0,"&Iuml;"],[0,"&ETH;"],[0,"&Ntilde;"],[0,"&Ograve;"],[0,"&Oacute;"],[0,"&Ocirc;"],[0,"&Otilde;"],[0,"&Ouml;"],[0,"&times;"],[0,"&Oslash;"],[0,"&Ugrave;"],[0,"&Uacute;"],[0,"&Ucirc;"],[0,"&Uuml;"],[0,"&Yacute;"],[0,"&THORN;"],[0,"&szlig;"],[0,"&agrave;"],[0,"&aacute;"],[0,"&acirc;"],[0,"&atilde;"],[0,"&auml;"],[0,"&aring;"],[0,"&aelig;"],[0,"&ccedil;"],[0,"&egrave;"],[0,"&eacute;"],[0,"&ecirc;"],[0,"&euml;"],[0,"&igrave;"],[0,"&iacute;"],[0,"&icirc;"],[0,"&iuml;"],[0,"&eth;"],[0,"&ntilde;"],[0,"&ograve;"],[0,"&oacute;"],[0,"&ocirc;"],[0,"&otilde;"],[0,"&ouml;"],[0,"&div;"],[0,"&oslash;"],[0,"&ugrave;"],[0,"&uacute;"],[0,"&ucirc;"],[0,"&uuml;"],[0,"&yacute;"],[0,"&thorn;"],[0,"&yuml;"],[0,"&Amacr;"],[0,"&amacr;"],[0,"&Abreve;"],[0,"&abreve;"],[0,"&Aogon;"],[0,"&aogon;"],[0,"&Cacute;"],[0,"&cacute;"],[0,"&Ccirc;"],[0,"&ccirc;"],[0,"&Cdot;"],[0,"&cdot;"],[0,"&Ccaron;"],[0,"&ccaron;"],[0,"&Dcaron;"],[0,"&dcaron;"],[0,"&Dstrok;"],[0,"&dstrok;"],[0,"&Emacr;"],[0,"&emacr;"],[2,"&Edot;"],[0,"&edot;"],[0,"&Eogon;"],[0,"&eogon;"],[0,"&Ecaron;"],[0,"&ecaron;"],[0,"&Gcirc;"],[0,"&gcirc;"],[0,"&Gbreve;"],[0,"&gbreve;"],[0,"&Gdot;"],[0,"&gdot;"],[0,"&Gcedil;"],[1,"&Hcirc;"],[0,"&hcirc;"],[0,"&Hstrok;"],[0,"&hstrok;"],[0,"&Itilde;"],[0,"&itilde;"],[0,"&Imacr;"],[0,"&imacr;"],[2,"&Iogon;"],[0,"&iogon;"],[0,"&Idot;"],[0,"&imath;"],[0,"&IJlig;"],[0,"&ijlig;"],[0,"&Jcirc;"],[0,"&jcirc;"],[0,"&Kcedil;"],[0,"&kcedil;"],[0,"&kgreen;"],[0,"&Lacute;"],[0,"&lacute;"],[0,"&Lcedil;"],[0,"&lcedil;"],[0,"&Lcaron;"],[0,"&lcaron;"],[0,"&Lmidot;"],[0,"&lmidot;"],[0,"&Lstrok;"],[0,"&lstrok;"],[0,"&Nacute;"],[0,"&nacute;"],[0,"&Ncedil;"],[0,"&ncedil;"],[0,"&Ncaron;"],[0,"&ncaron;"],[0,"&napos;"],[0,"&ENG;"],[0,"&eng;"],[0,"&Omacr;"],[0,"&omacr;"],[2,"&Odblac;"],[0,"&odblac;"],[0,"&OElig;"],[0,"&oelig;"],[0,"&Racute;"],[0,"&racute;"],[0,"&Rcedil;"],[0,"&rcedil;"],[0,"&Rcaron;"],[0,"&rcaron;"],[0,"&Sacute;"],[0,"&sacute;"],[0,"&Scirc;"],[0,"&scirc;"],[0,"&Scedil;"],[0,"&scedil;"],[0,"&Scaron;"],[0,"&scaron;"],[0,"&Tcedil;"],[0,"&tcedil;"],[0,"&Tcaron;"],[0,"&tcaron;"],[0,"&Tstrok;"],[0,"&tstrok;"],[0,"&Utilde;"],[0,"&utilde;"],[0,"&Umacr;"],[0,"&umacr;"],[0,"&Ubreve;"],[0,"&ubreve;"],[0,"&Uring;"],[0,"&uring;"],[0,"&Udblac;"],[0,"&udblac;"],[0,"&Uogon;"],[0,"&uogon;"],[0,"&Wcirc;"],[0,"&wcirc;"],[0,"&Ycirc;"],[0,"&ycirc;"],[0,"&Yuml;"],[0,"&Zacute;"],[0,"&zacute;"],[0,"&Zdot;"],[0,"&zdot;"],[0,"&Zcaron;"],[0,"&zcaron;"],[19,"&fnof;"],[34,"&imped;"],[63,"&gacute;"],[65,"&jmath;"],[142,"&circ;"],[0,"&caron;"],[16,"&breve;"],[0,"&DiacriticalDot;"],[0,"&ring;"],[0,"&ogon;"],[0,"&DiacriticalTilde;"],[0,"&dblac;"],[51,"&DownBreve;"],[127,"&Alpha;"],[0,"&Beta;"],[0,"&Gamma;"],[0,"&Delta;"],[0,"&Epsilon;"],[0,"&Zeta;"],[0,"&Eta;"],[0,"&Theta;"],[0,"&Iota;"],[0,"&Kappa;"],[0,"&Lambda;"],[0,"&Mu;"],[0,"&Nu;"],[0,"&Xi;"],[0,"&Omicron;"],[0,"&Pi;"],[0,"&Rho;"],[1,"&Sigma;"],[0,"&Tau;"],[0,"&Upsilon;"],[0,"&Phi;"],[0,"&Chi;"],[0,"&Psi;"],[0,"&ohm;"],[7,"&alpha;"],[0,"&beta;"],[0,"&gamma;"],[0,"&delta;"],[0,"&epsi;"],[0,"&zeta;"],[0,"&eta;"],[0,"&theta;"],[0,"&iota;"],[0,"&kappa;"],[0,"&lambda;"],[0,"&mu;"],[0,"&nu;"],[0,"&xi;"],[0,"&omicron;"],[0,"&pi;"],[0,"&rho;"],[0,"&sigmaf;"],[0,"&sigma;"],[0,"&tau;"],[0,"&upsi;"],[0,"&phi;"],[0,"&chi;"],[0,"&psi;"],[0,"&omega;"],[7,"&thetasym;"],[0,"&Upsi;"],[2,"&phiv;"],[0,"&piv;"],[5,"&Gammad;"],[0,"&digamma;"],[18,"&kappav;"],[0,"&rhov;"],[3,"&epsiv;"],[0,"&backepsilon;"],[10,"&IOcy;"],[0,"&DJcy;"],[0,"&GJcy;"],[0,"&Jukcy;"],[0,"&DScy;"],[0,"&Iukcy;"],[0,"&YIcy;"],[0,"&Jsercy;"],[0,"&LJcy;"],[0,"&NJcy;"],[0,"&TSHcy;"],[0,"&KJcy;"],[1,"&Ubrcy;"],[0,"&DZcy;"],[0,"&Acy;"],[0,"&Bcy;"],[0,"&Vcy;"],[0,"&Gcy;"],[0,"&Dcy;"],[0,"&IEcy;"],[0,"&ZHcy;"],[0,"&Zcy;"],[0,"&Icy;"],[0,"&Jcy;"],[0,"&Kcy;"],[0,"&Lcy;"],[0,"&Mcy;"],[0,"&Ncy;"],[0,"&Ocy;"],[0,"&Pcy;"],[0,"&Rcy;"],[0,"&Scy;"],[0,"&Tcy;"],[0,"&Ucy;"],[0,"&Fcy;"],[0,"&KHcy;"],[0,"&TScy;"],[0,"&CHcy;"],[0,"&SHcy;"],[0,"&SHCHcy;"],[0,"&HARDcy;"],[0,"&Ycy;"],[0,"&SOFTcy;"],[0,"&Ecy;"],[0,"&YUcy;"],[0,"&YAcy;"],[0,"&acy;"],[0,"&bcy;"],[0,"&vcy;"],[0,"&gcy;"],[0,"&dcy;"],[0,"&iecy;"],[0,"&zhcy;"],[0,"&zcy;"],[0,"&icy;"],[0,"&jcy;"],[0,"&kcy;"],[0,"&lcy;"],[0,"&mcy;"],[0,"&ncy;"],[0,"&ocy;"],[0,"&pcy;"],[0,"&rcy;"],[0,"&scy;"],[0,"&tcy;"],[0,"&ucy;"],[0,"&fcy;"],[0,"&khcy;"],[0,"&tscy;"],[0,"&chcy;"],[0,"&shcy;"],[0,"&shchcy;"],[0,"&hardcy;"],[0,"&ycy;"],[0,"&softcy;"],[0,"&ecy;"],[0,"&yucy;"],[0,"&yacy;"],[1,"&iocy;"],[0,"&djcy;"],[0,"&gjcy;"],[0,"&jukcy;"],[0,"&dscy;"],[0,"&iukcy;"],[0,"&yicy;"],[0,"&jsercy;"],[0,"&ljcy;"],[0,"&njcy;"],[0,"&tshcy;"],[0,"&kjcy;"],[1,"&ubrcy;"],[0,"&dzcy;"],[7074,"&ensp;"],[0,"&emsp;"],[0,"&emsp13;"],[0,"&emsp14;"],[1,"&numsp;"],[0,"&puncsp;"],[0,"&ThinSpace;"],[0,"&hairsp;"],[0,"&NegativeMediumSpace;"],[0,"&zwnj;"],[0,"&zwj;"],[0,"&lrm;"],[0,"&rlm;"],[0,"&dash;"],[2,"&ndash;"],[0,"&mdash;"],[0,"&horbar;"],[0,"&Verbar;"],[1,"&lsquo;"],[0,"&CloseCurlyQuote;"],[0,"&lsquor;"],[1,"&ldquo;"],[0,"&CloseCurlyDoubleQuote;"],[0,"&bdquo;"],[1,"&dagger;"],[0,"&Dagger;"],[0,"&bull;"],[2,"&nldr;"],[0,"&hellip;"],[9,"&permil;"],[0,"&pertenk;"],[0,"&prime;"],[0,"&Prime;"],[0,"&tprime;"],[0,"&backprime;"],[3,"&lsaquo;"],[0,"&rsaquo;"],[3,"&oline;"],[2,"&caret;"],[1,"&hybull;"],[0,"&frasl;"],[10,"&bsemi;"],[7,"&qprime;"],[7,{v:"&MediumSpace;",n:8202,o:"&ThickSpace;"}],[0,"&NoBreak;"],[0,"&af;"],[0,"&InvisibleTimes;"],[0,"&ic;"],[72,"&euro;"],[46,"&tdot;"],[0,"&DotDot;"],[37,"&complexes;"],[2,"&incare;"],[4,"&gscr;"],[0,"&hamilt;"],[0,"&Hfr;"],[0,"&Hopf;"],[0,"&planckh;"],[0,"&hbar;"],[0,"&imagline;"],[0,"&Ifr;"],[0,"&lagran;"],[0,"&ell;"],[1,"&naturals;"],[0,"&numero;"],[0,"&copysr;"],[0,"&weierp;"],[0,"&Popf;"],[0,"&Qopf;"],[0,"&realine;"],[0,"&real;"],[0,"&reals;"],[0,"&rx;"],[3,"&trade;"],[1,"&integers;"],[2,"&mho;"],[0,"&zeetrf;"],[0,"&iiota;"],[2,"&bernou;"],[0,"&Cayleys;"],[1,"&escr;"],[0,"&Escr;"],[0,"&Fouriertrf;"],[1,"&Mellintrf;"],[0,"&order;"],[0,"&alefsym;"],[0,"&beth;"],[0,"&gimel;"],[0,"&daleth;"],[12,"&CapitalDifferentialD;"],[0,"&dd;"],[0,"&ee;"],[0,"&ii;"],[10,"&frac13;"],[0,"&frac23;"],[0,"&frac15;"],[0,"&frac25;"],[0,"&frac35;"],[0,"&frac45;"],[0,"&frac16;"],[0,"&frac56;"],[0,"&frac18;"],[0,"&frac38;"],[0,"&frac58;"],[0,"&frac78;"],[49,"&larr;"],[0,"&ShortUpArrow;"],[0,"&rarr;"],[0,"&darr;"],[0,"&harr;"],[0,"&updownarrow;"],[0,"&nwarr;"],[0,"&nearr;"],[0,"&LowerRightArrow;"],[0,"&LowerLeftArrow;"],[0,"&nlarr;"],[0,"&nrarr;"],[1,{v:"&rarrw;",n:824,o:"&nrarrw;"}],[0,"&Larr;"],[0,"&Uarr;"],[0,"&Rarr;"],[0,"&Darr;"],[0,"&larrtl;"],[0,"&rarrtl;"],[0,"&LeftTeeArrow;"],[0,"&mapstoup;"],[0,"&map;"],[0,"&DownTeeArrow;"],[1,"&hookleftarrow;"],[0,"&hookrightarrow;"],[0,"&larrlp;"],[0,"&looparrowright;"],[0,"&harrw;"],[0,"&nharr;"],[1,"&lsh;"],[0,"&rsh;"],[0,"&ldsh;"],[0,"&rdsh;"],[1,"&crarr;"],[0,"&cularr;"],[0,"&curarr;"],[2,"&circlearrowleft;"],[0,"&circlearrowright;"],[0,"&leftharpoonup;"],[0,"&DownLeftVector;"],[0,"&RightUpVector;"],[0,"&LeftUpVector;"],[0,"&rharu;"],[0,"&DownRightVector;"],[0,"&dharr;"],[0,"&dharl;"],[0,"&RightArrowLeftArrow;"],[0,"&udarr;"],[0,"&LeftArrowRightArrow;"],[0,"&leftleftarrows;"],[0,"&upuparrows;"],[0,"&rightrightarrows;"],[0,"&ddarr;"],[0,"&leftrightharpoons;"],[0,"&Equilibrium;"],[0,"&nlArr;"],[0,"&nhArr;"],[0,"&nrArr;"],[0,"&DoubleLeftArrow;"],[0,"&DoubleUpArrow;"],[0,"&DoubleRightArrow;"],[0,"&dArr;"],[0,"&DoubleLeftRightArrow;"],[0,"&DoubleUpDownArrow;"],[0,"&nwArr;"],[0,"&neArr;"],[0,"&seArr;"],[0,"&swArr;"],[0,"&lAarr;"],[0,"&rAarr;"],[1,"&zigrarr;"],[6,"&larrb;"],[0,"&rarrb;"],[15,"&DownArrowUpArrow;"],[7,"&loarr;"],[0,"&roarr;"],[0,"&hoarr;"],[0,"&forall;"],[0,"&comp;"],[0,{v:"&part;",n:824,o:"&npart;"}],[0,"&exist;"],[0,"&nexist;"],[0,"&empty;"],[1,"&Del;"],[0,"&Element;"],[0,"&NotElement;"],[1,"&ni;"],[0,"&notni;"],[2,"&prod;"],[0,"&coprod;"],[0,"&sum;"],[0,"&minus;"],[0,"&MinusPlus;"],[0,"&dotplus;"],[1,"&Backslash;"],[0,"&lowast;"],[0,"&compfn;"],[1,"&radic;"],[2,"&prop;"],[0,"&infin;"],[0,"&angrt;"],[0,{v:"&ang;",n:8402,o:"&nang;"}],[0,"&angmsd;"],[0,"&angsph;"],[0,"&mid;"],[0,"&nmid;"],[0,"&DoubleVerticalBar;"],[0,"&NotDoubleVerticalBar;"],[0,"&and;"],[0,"&or;"],[0,{v:"&cap;",n:65024,o:"&caps;"}],[0,{v:"&cup;",n:65024,o:"&cups;"}],[0,"&int;"],[0,"&Int;"],[0,"&iiint;"],[0,"&conint;"],[0,"&Conint;"],[0,"&Cconint;"],[0,"&cwint;"],[0,"&ClockwiseContourIntegral;"],[0,"&awconint;"],[0,"&there4;"],[0,"&becaus;"],[0,"&ratio;"],[0,"&Colon;"],[0,"&dotminus;"],[1,"&mDDot;"],[0,"&homtht;"],[0,{v:"&sim;",n:8402,o:"&nvsim;"}],[0,{v:"&backsim;",n:817,o:"&race;"}],[0,{v:"&ac;",n:819,o:"&acE;"}],[0,"&acd;"],[0,"&VerticalTilde;"],[0,"&NotTilde;"],[0,{v:"&eqsim;",n:824,o:"&nesim;"}],[0,"&sime;"],[0,"&NotTildeEqual;"],[0,"&cong;"],[0,"&simne;"],[0,"&ncong;"],[0,"&ap;"],[0,"&nap;"],[0,"&ape;"],[0,{v:"&apid;",n:824,o:"&napid;"}],[0,"&backcong;"],[0,{v:"&asympeq;",n:8402,o:"&nvap;"}],[0,{v:"&bump;",n:824,o:"&nbump;"}],[0,{v:"&bumpe;",n:824,o:"&nbumpe;"}],[0,{v:"&doteq;",n:824,o:"&nedot;"}],[0,"&doteqdot;"],[0,"&efDot;"],[0,"&erDot;"],[0,"&Assign;"],[0,"&ecolon;"],[0,"&ecir;"],[0,"&circeq;"],[1,"&wedgeq;"],[0,"&veeeq;"],[1,"&triangleq;"],[2,"&equest;"],[0,"&ne;"],[0,{v:"&Congruent;",n:8421,o:"&bnequiv;"}],[0,"&nequiv;"],[1,{v:"&le;",n:8402,o:"&nvle;"}],[0,{v:"&ge;",n:8402,o:"&nvge;"}],[0,{v:"&lE;",n:824,o:"&nlE;"}],[0,{v:"&gE;",n:824,o:"&ngE;"}],[0,{v:"&lnE;",n:65024,o:"&lvertneqq;"}],[0,{v:"&gnE;",n:65024,o:"&gvertneqq;"}],[0,{v:"&ll;",n:new Map(Ti([[824,"&nLtv;"],[7577,"&nLt;"]]))}],[0,{v:"&gg;",n:new Map(Ti([[824,"&nGtv;"],[7577,"&nGt;"]]))}],[0,"&between;"],[0,"&NotCupCap;"],[0,"&nless;"],[0,"&ngt;"],[0,"&nle;"],[0,"&nge;"],[0,"&lesssim;"],[0,"&GreaterTilde;"],[0,"&nlsim;"],[0,"&ngsim;"],[0,"&LessGreater;"],[0,"&gl;"],[0,"&NotLessGreater;"],[0,"&NotGreaterLess;"],[0,"&pr;"],[0,"&sc;"],[0,"&prcue;"],[0,"&sccue;"],[0,"&PrecedesTilde;"],[0,{v:"&scsim;",n:824,o:"&NotSucceedsTilde;"}],[0,"&NotPrecedes;"],[0,"&NotSucceeds;"],[0,{v:"&sub;",n:8402,o:"&NotSubset;"}],[0,{v:"&sup;",n:8402,o:"&NotSuperset;"}],[0,"&nsub;"],[0,"&nsup;"],[0,"&sube;"],[0,"&supe;"],[0,"&NotSubsetEqual;"],[0,"&NotSupersetEqual;"],[0,{v:"&subne;",n:65024,o:"&varsubsetneq;"}],[0,{v:"&supne;",n:65024,o:"&varsupsetneq;"}],[1,"&cupdot;"],[0,"&UnionPlus;"],[0,{v:"&sqsub;",n:824,o:"&NotSquareSubset;"}],[0,{v:"&sqsup;",n:824,o:"&NotSquareSuperset;"}],[0,"&sqsube;"],[0,"&sqsupe;"],[0,{v:"&sqcap;",n:65024,o:"&sqcaps;"}],[0,{v:"&sqcup;",n:65024,o:"&sqcups;"}],[0,"&CirclePlus;"],[0,"&CircleMinus;"],[0,"&CircleTimes;"],[0,"&osol;"],[0,"&CircleDot;"],[0,"&circledcirc;"],[0,"&circledast;"],[1,"&circleddash;"],[0,"&boxplus;"],[0,"&boxminus;"],[0,"&boxtimes;"],[0,"&dotsquare;"],[0,"&RightTee;"],[0,"&dashv;"],[0,"&DownTee;"],[0,"&bot;"],[1,"&models;"],[0,"&DoubleRightTee;"],[0,"&Vdash;"],[0,"&Vvdash;"],[0,"&VDash;"],[0,"&nvdash;"],[0,"&nvDash;"],[0,"&nVdash;"],[0,"&nVDash;"],[0,"&prurel;"],[1,"&LeftTriangle;"],[0,"&RightTriangle;"],[0,{v:"&LeftTriangleEqual;",n:8402,o:"&nvltrie;"}],[0,{v:"&RightTriangleEqual;",n:8402,o:"&nvrtrie;"}],[0,"&origof;"],[0,"&imof;"],[0,"&multimap;"],[0,"&hercon;"],[0,"&intcal;"],[0,"&veebar;"],[1,"&barvee;"],[0,"&angrtvb;"],[0,"&lrtri;"],[0,"&bigwedge;"],[0,"&bigvee;"],[0,"&bigcap;"],[0,"&bigcup;"],[0,"&diam;"],[0,"&sdot;"],[0,"&sstarf;"],[0,"&divideontimes;"],[0,"&bowtie;"],[0,"&ltimes;"],[0,"&rtimes;"],[0,"&leftthreetimes;"],[0,"&rightthreetimes;"],[0,"&backsimeq;"],[0,"&curlyvee;"],[0,"&curlywedge;"],[0,"&Sub;"],[0,"&Sup;"],[0,"&Cap;"],[0,"&Cup;"],[0,"&fork;"],[0,"&epar;"],[0,"&lessdot;"],[0,"&gtdot;"],[0,{v:"&Ll;",n:824,o:"&nLl;"}],[0,{v:"&Gg;",n:824,o:"&nGg;"}],[0,{v:"&leg;",n:65024,o:"&lesg;"}],[0,{v:"&gel;",n:65024,o:"&gesl;"}],[2,"&cuepr;"],[0,"&cuesc;"],[0,"&NotPrecedesSlantEqual;"],[0,"&NotSucceedsSlantEqual;"],[0,"&NotSquareSubsetEqual;"],[0,"&NotSquareSupersetEqual;"],[2,"&lnsim;"],[0,"&gnsim;"],[0,"&precnsim;"],[0,"&scnsim;"],[0,"&nltri;"],[0,"&NotRightTriangle;"],[0,"&nltrie;"],[0,"&NotRightTriangleEqual;"],[0,"&vellip;"],[0,"&ctdot;"],[0,"&utdot;"],[0,"&dtdot;"],[0,"&disin;"],[0,"&isinsv;"],[0,"&isins;"],[0,{v:"&isindot;",n:824,o:"&notindot;"}],[0,"&notinvc;"],[0,"&notinvb;"],[1,{v:"&isinE;",n:824,o:"&notinE;"}],[0,"&nisd;"],[0,"&xnis;"],[0,"&nis;"],[0,"&notnivc;"],[0,"&notnivb;"],[6,"&barwed;"],[0,"&Barwed;"],[1,"&lceil;"],[0,"&rceil;"],[0,"&LeftFloor;"],[0,"&rfloor;"],[0,"&drcrop;"],[0,"&dlcrop;"],[0,"&urcrop;"],[0,"&ulcrop;"],[0,"&bnot;"],[1,"&profline;"],[0,"&profsurf;"],[1,"&telrec;"],[0,"&target;"],[5,"&ulcorn;"],[0,"&urcorn;"],[0,"&dlcorn;"],[0,"&drcorn;"],[2,"&frown;"],[0,"&smile;"],[9,"&cylcty;"],[0,"&profalar;"],[7,"&topbot;"],[6,"&ovbar;"],[1,"&solbar;"],[60,"&angzarr;"],[51,"&lmoustache;"],[0,"&rmoustache;"],[2,"&OverBracket;"],[0,"&bbrk;"],[0,"&bbrktbrk;"],[37,"&OverParenthesis;"],[0,"&UnderParenthesis;"],[0,"&OverBrace;"],[0,"&UnderBrace;"],[2,"&trpezium;"],[4,"&elinters;"],[59,"&blank;"],[164,"&circledS;"],[55,"&boxh;"],[1,"&boxv;"],[9,"&boxdr;"],[3,"&boxdl;"],[3,"&boxur;"],[3,"&boxul;"],[3,"&boxvr;"],[7,"&boxvl;"],[7,"&boxhd;"],[7,"&boxhu;"],[7,"&boxvh;"],[19,"&boxH;"],[0,"&boxV;"],[0,"&boxdR;"],[0,"&boxDr;"],[0,"&boxDR;"],[0,"&boxdL;"],[0,"&boxDl;"],[0,"&boxDL;"],[0,"&boxuR;"],[0,"&boxUr;"],[0,"&boxUR;"],[0,"&boxuL;"],[0,"&boxUl;"],[0,"&boxUL;"],[0,"&boxvR;"],[0,"&boxVr;"],[0,"&boxVR;"],[0,"&boxvL;"],[0,"&boxVl;"],[0,"&boxVL;"],[0,"&boxHd;"],[0,"&boxhD;"],[0,"&boxHD;"],[0,"&boxHu;"],[0,"&boxhU;"],[0,"&boxHU;"],[0,"&boxvH;"],[0,"&boxVh;"],[0,"&boxVH;"],[19,"&uhblk;"],[3,"&lhblk;"],[3,"&block;"],[8,"&blk14;"],[0,"&blk12;"],[0,"&blk34;"],[13,"&square;"],[8,"&blacksquare;"],[0,"&EmptyVerySmallSquare;"],[1,"&rect;"],[0,"&marker;"],[2,"&fltns;"],[1,"&bigtriangleup;"],[0,"&blacktriangle;"],[0,"&triangle;"],[2,"&blacktriangleright;"],[0,"&rtri;"],[3,"&bigtriangledown;"],[0,"&blacktriangledown;"],[0,"&dtri;"],[2,"&blacktriangleleft;"],[0,"&ltri;"],[6,"&loz;"],[0,"&cir;"],[32,"&tridot;"],[2,"&bigcirc;"],[8,"&ultri;"],[0,"&urtri;"],[0,"&lltri;"],[0,"&EmptySmallSquare;"],[0,"&FilledSmallSquare;"],[8,"&bigstar;"],[0,"&star;"],[7,"&phone;"],[49,"&female;"],[1,"&male;"],[29,"&spades;"],[2,"&clubs;"],[1,"&hearts;"],[0,"&diamondsuit;"],[3,"&sung;"],[2,"&flat;"],[0,"&natural;"],[0,"&sharp;"],[163,"&check;"],[3,"&cross;"],[8,"&malt;"],[21,"&sext;"],[33,"&VerticalSeparator;"],[25,"&lbbrk;"],[0,"&rbbrk;"],[84,"&bsolhsub;"],[0,"&suphsol;"],[28,"&LeftDoubleBracket;"],[0,"&RightDoubleBracket;"],[0,"&lang;"],[0,"&rang;"],[0,"&Lang;"],[0,"&Rang;"],[0,"&loang;"],[0,"&roang;"],[7,"&longleftarrow;"],[0,"&longrightarrow;"],[0,"&longleftrightarrow;"],[0,"&DoubleLongLeftArrow;"],[0,"&DoubleLongRightArrow;"],[0,"&DoubleLongLeftRightArrow;"],[1,"&longmapsto;"],[2,"&dzigrarr;"],[258,"&nvlArr;"],[0,"&nvrArr;"],[0,"&nvHarr;"],[0,"&Map;"],[6,"&lbarr;"],[0,"&bkarow;"],[0,"&lBarr;"],[0,"&dbkarow;"],[0,"&drbkarow;"],[0,"&DDotrahd;"],[0,"&UpArrowBar;"],[0,"&DownArrowBar;"],[2,"&Rarrtl;"],[2,"&latail;"],[0,"&ratail;"],[0,"&lAtail;"],[0,"&rAtail;"],[0,"&larrfs;"],[0,"&rarrfs;"],[0,"&larrbfs;"],[0,"&rarrbfs;"],[2,"&nwarhk;"],[0,"&nearhk;"],[0,"&hksearow;"],[0,"&hkswarow;"],[0,"&nwnear;"],[0,"&nesear;"],[0,"&seswar;"],[0,"&swnwar;"],[8,{v:"&rarrc;",n:824,o:"&nrarrc;"}],[1,"&cudarrr;"],[0,"&ldca;"],[0,"&rdca;"],[0,"&cudarrl;"],[0,"&larrpl;"],[2,"&curarrm;"],[0,"&cularrp;"],[7,"&rarrpl;"],[2,"&harrcir;"],[0,"&Uarrocir;"],[0,"&lurdshar;"],[0,"&ldrushar;"],[2,"&LeftRightVector;"],[0,"&RightUpDownVector;"],[0,"&DownLeftRightVector;"],[0,"&LeftUpDownVector;"],[0,"&LeftVectorBar;"],[0,"&RightVectorBar;"],[0,"&RightUpVectorBar;"],[0,"&RightDownVectorBar;"],[0,"&DownLeftVectorBar;"],[0,"&DownRightVectorBar;"],[0,"&LeftUpVectorBar;"],[0,"&LeftDownVectorBar;"],[0,"&LeftTeeVector;"],[0,"&RightTeeVector;"],[0,"&RightUpTeeVector;"],[0,"&RightDownTeeVector;"],[0,"&DownLeftTeeVector;"],[0,"&DownRightTeeVector;"],[0,"&LeftUpTeeVector;"],[0,"&LeftDownTeeVector;"],[0,"&lHar;"],[0,"&uHar;"],[0,"&rHar;"],[0,"&dHar;"],[0,"&luruhar;"],[0,"&ldrdhar;"],[0,"&ruluhar;"],[0,"&rdldhar;"],[0,"&lharul;"],[0,"&llhard;"],[0,"&rharul;"],[0,"&lrhard;"],[0,"&udhar;"],[0,"&duhar;"],[0,"&RoundImplies;"],[0,"&erarr;"],[0,"&simrarr;"],[0,"&larrsim;"],[0,"&rarrsim;"],[0,"&rarrap;"],[0,"&ltlarr;"],[1,"&gtrarr;"],[0,"&subrarr;"],[1,"&suplarr;"],[0,"&lfisht;"],[0,"&rfisht;"],[0,"&ufisht;"],[0,"&dfisht;"],[5,"&lopar;"],[0,"&ropar;"],[4,"&lbrke;"],[0,"&rbrke;"],[0,"&lbrkslu;"],[0,"&rbrksld;"],[0,"&lbrksld;"],[0,"&rbrkslu;"],[0,"&langd;"],[0,"&rangd;"],[0,"&lparlt;"],[0,"&rpargt;"],[0,"&gtlPar;"],[0,"&ltrPar;"],[3,"&vzigzag;"],[1,"&vangrt;"],[0,"&angrtvbd;"],[6,"&ange;"],[0,"&range;"],[0,"&dwangle;"],[0,"&uwangle;"],[0,"&angmsdaa;"],[0,"&angmsdab;"],[0,"&angmsdac;"],[0,"&angmsdad;"],[0,"&angmsdae;"],[0,"&angmsdaf;"],[0,"&angmsdag;"],[0,"&angmsdah;"],[0,"&bemptyv;"],[0,"&demptyv;"],[0,"&cemptyv;"],[0,"&raemptyv;"],[0,"&laemptyv;"],[0,"&ohbar;"],[0,"&omid;"],[0,"&opar;"],[1,"&operp;"],[1,"&olcross;"],[0,"&odsold;"],[1,"&olcir;"],[0,"&ofcir;"],[0,"&olt;"],[0,"&ogt;"],[0,"&cirscir;"],[0,"&cirE;"],[0,"&solb;"],[0,"&bsolb;"],[3,"&boxbox;"],[3,"&trisb;"],[0,"&rtriltri;"],[0,{v:"&LeftTriangleBar;",n:824,o:"&NotLeftTriangleBar;"}],[0,{v:"&RightTriangleBar;",n:824,o:"&NotRightTriangleBar;"}],[11,"&iinfin;"],[0,"&infintie;"],[0,"&nvinfin;"],[4,"&eparsl;"],[0,"&smeparsl;"],[0,"&eqvparsl;"],[5,"&blacklozenge;"],[8,"&RuleDelayed;"],[1,"&dsol;"],[9,"&bigodot;"],[0,"&bigoplus;"],[0,"&bigotimes;"],[1,"&biguplus;"],[1,"&bigsqcup;"],[5,"&iiiint;"],[0,"&fpartint;"],[2,"&cirfnint;"],[0,"&awint;"],[0,"&rppolint;"],[0,"&scpolint;"],[0,"&npolint;"],[0,"&pointint;"],[0,"&quatint;"],[0,"&intlarhk;"],[10,"&pluscir;"],[0,"&plusacir;"],[0,"&simplus;"],[0,"&plusdu;"],[0,"&plussim;"],[0,"&plustwo;"],[1,"&mcomma;"],[0,"&minusdu;"],[2,"&loplus;"],[0,"&roplus;"],[0,"&Cross;"],[0,"&timesd;"],[0,"&timesbar;"],[1,"&smashp;"],[0,"&lotimes;"],[0,"&rotimes;"],[0,"&otimesas;"],[0,"&Otimes;"],[0,"&odiv;"],[0,"&triplus;"],[0,"&triminus;"],[0,"&tritime;"],[0,"&intprod;"],[2,"&amalg;"],[0,"&capdot;"],[1,"&ncup;"],[0,"&ncap;"],[0,"&capand;"],[0,"&cupor;"],[0,"&cupcap;"],[0,"&capcup;"],[0,"&cupbrcap;"],[0,"&capbrcup;"],[0,"&cupcup;"],[0,"&capcap;"],[0,"&ccups;"],[0,"&ccaps;"],[2,"&ccupssm;"],[2,"&And;"],[0,"&Or;"],[0,"&andand;"],[0,"&oror;"],[0,"&orslope;"],[0,"&andslope;"],[1,"&andv;"],[0,"&orv;"],[0,"&andd;"],[0,"&ord;"],[1,"&wedbar;"],[6,"&sdote;"],[3,"&simdot;"],[2,{v:"&congdot;",n:824,o:"&ncongdot;"}],[0,"&easter;"],[0,"&apacir;"],[0,{v:"&apE;",n:824,o:"&napE;"}],[0,"&eplus;"],[0,"&pluse;"],[0,"&Esim;"],[0,"&Colone;"],[0,"&Equal;"],[1,"&ddotseq;"],[0,"&equivDD;"],[0,"&ltcir;"],[0,"&gtcir;"],[0,"&ltquest;"],[0,"&gtquest;"],[0,{v:"&leqslant;",n:824,o:"&nleqslant;"}],[0,{v:"&geqslant;",n:824,o:"&ngeqslant;"}],[0,"&lesdot;"],[0,"&gesdot;"],[0,"&lesdoto;"],[0,"&gesdoto;"],[0,"&lesdotor;"],[0,"&gesdotol;"],[0,"&lap;"],[0,"&gap;"],[0,"&lne;"],[0,"&gne;"],[0,"&lnap;"],[0,"&gnap;"],[0,"&lEg;"],[0,"&gEl;"],[0,"&lsime;"],[0,"&gsime;"],[0,"&lsimg;"],[0,"&gsiml;"],[0,"&lgE;"],[0,"&glE;"],[0,"&lesges;"],[0,"&gesles;"],[0,"&els;"],[0,"&egs;"],[0,"&elsdot;"],[0,"&egsdot;"],[0,"&el;"],[0,"&eg;"],[2,"&siml;"],[0,"&simg;"],[0,"&simlE;"],[0,"&simgE;"],[0,{v:"&LessLess;",n:824,o:"&NotNestedLessLess;"}],[0,{v:"&GreaterGreater;",n:824,o:"&NotNestedGreaterGreater;"}],[1,"&glj;"],[0,"&gla;"],[0,"&ltcc;"],[0,"&gtcc;"],[0,"&lescc;"],[0,"&gescc;"],[0,"&smt;"],[0,"&lat;"],[0,{v:"&smte;",n:65024,o:"&smtes;"}],[0,{v:"&late;",n:65024,o:"&lates;"}],[0,"&bumpE;"],[0,{v:"&PrecedesEqual;",n:824,o:"&NotPrecedesEqual;"}],[0,{v:"&sce;",n:824,o:"&NotSucceedsEqual;"}],[2,"&prE;"],[0,"&scE;"],[0,"&precneqq;"],[0,"&scnE;"],[0,"&prap;"],[0,"&scap;"],[0,"&precnapprox;"],[0,"&scnap;"],[0,"&Pr;"],[0,"&Sc;"],[0,"&subdot;"],[0,"&supdot;"],[0,"&subplus;"],[0,"&supplus;"],[0,"&submult;"],[0,"&supmult;"],[0,"&subedot;"],[0,"&supedot;"],[0,{v:"&subE;",n:824,o:"&nsubE;"}],[0,{v:"&supE;",n:824,o:"&nsupE;"}],[0,"&subsim;"],[0,"&supsim;"],[2,{v:"&subnE;",n:65024,o:"&varsubsetneqq;"}],[0,{v:"&supnE;",n:65024,o:"&varsupsetneqq;"}],[2,"&csub;"],[0,"&csup;"],[0,"&csube;"],[0,"&csupe;"],[0,"&subsup;"],[0,"&supsub;"],[0,"&subsub;"],[0,"&supsup;"],[0,"&suphsub;"],[0,"&supdsub;"],[0,"&forkv;"],[0,"&topfork;"],[0,"&mlcp;"],[8,"&Dashv;"],[1,"&Vdashl;"],[0,"&Barv;"],[0,"&vBar;"],[0,"&vBarv;"],[1,"&Vbar;"],[0,"&Not;"],[0,"&bNot;"],[0,"&rnmid;"],[0,"&cirmid;"],[0,"&midcir;"],[0,"&topcir;"],[0,"&nhpar;"],[0,"&parsim;"],[9,{v:"&parsl;",n:8421,o:"&nparsl;"}],[44343,{n:new Map(Ti([[56476,"&Ascr;"],[1,"&Cscr;"],[0,"&Dscr;"],[2,"&Gscr;"],[2,"&Jscr;"],[0,"&Kscr;"],[2,"&Nscr;"],[0,"&Oscr;"],[0,"&Pscr;"],[0,"&Qscr;"],[1,"&Sscr;"],[0,"&Tscr;"],[0,"&Uscr;"],[0,"&Vscr;"],[0,"&Wscr;"],[0,"&Xscr;"],[0,"&Yscr;"],[0,"&Zscr;"],[0,"&ascr;"],[0,"&bscr;"],[0,"&cscr;"],[0,"&dscr;"],[1,"&fscr;"],[1,"&hscr;"],[0,"&iscr;"],[0,"&jscr;"],[0,"&kscr;"],[0,"&lscr;"],[0,"&mscr;"],[0,"&nscr;"],[1,"&pscr;"],[0,"&qscr;"],[0,"&rscr;"],[0,"&sscr;"],[0,"&tscr;"],[0,"&uscr;"],[0,"&vscr;"],[0,"&wscr;"],[0,"&xscr;"],[0,"&yscr;"],[0,"&zscr;"],[52,"&Afr;"],[0,"&Bfr;"],[1,"&Dfr;"],[0,"&Efr;"],[0,"&Ffr;"],[0,"&Gfr;"],[2,"&Jfr;"],[0,"&Kfr;"],[0,"&Lfr;"],[0,"&Mfr;"],[0,"&Nfr;"],[0,"&Ofr;"],[0,"&Pfr;"],[0,"&Qfr;"],[1,"&Sfr;"],[0,"&Tfr;"],[0,"&Ufr;"],[0,"&Vfr;"],[0,"&Wfr;"],[0,"&Xfr;"],[0,"&Yfr;"],[1,"&afr;"],[0,"&bfr;"],[0,"&cfr;"],[0,"&dfr;"],[0,"&efr;"],[0,"&ffr;"],[0,"&gfr;"],[0,"&hfr;"],[0,"&ifr;"],[0,"&jfr;"],[0,"&kfr;"],[0,"&lfr;"],[0,"&mfr;"],[0,"&nfr;"],[0,"&ofr;"],[0,"&pfr;"],[0,"&qfr;"],[0,"&rfr;"],[0,"&sfr;"],[0,"&tfr;"],[0,"&ufr;"],[0,"&vfr;"],[0,"&wfr;"],[0,"&xfr;"],[0,"&yfr;"],[0,"&zfr;"],[0,"&Aopf;"],[0,"&Bopf;"],[1,"&Dopf;"],[0,"&Eopf;"],[0,"&Fopf;"],[0,"&Gopf;"],[1,"&Iopf;"],[0,"&Jopf;"],[0,"&Kopf;"],[0,"&Lopf;"],[0,"&Mopf;"],[1,"&Oopf;"],[3,"&Sopf;"],[0,"&Topf;"],[0,"&Uopf;"],[0,"&Vopf;"],[0,"&Wopf;"],[0,"&Xopf;"],[0,"&Yopf;"],[1,"&aopf;"],[0,"&bopf;"],[0,"&copf;"],[0,"&dopf;"],[0,"&eopf;"],[0,"&fopf;"],[0,"&gopf;"],[0,"&hopf;"],[0,"&iopf;"],[0,"&jopf;"],[0,"&kopf;"],[0,"&lopf;"],[0,"&mopf;"],[0,"&nopf;"],[0,"&oopf;"],[0,"&popf;"],[0,"&qopf;"],[0,"&ropf;"],[0,"&sopf;"],[0,"&topf;"],[0,"&uopf;"],[0,"&vopf;"],[0,"&wopf;"],[0,"&xopf;"],[0,"&yopf;"],[0,"&zopf;"]]))}],[8906,"&fflig;"],[0,"&filig;"],[0,"&fllig;"],[0,"&ffilig;"],[0,"&ffllig;"]]));const Pi=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);function ki(e,t){return function(i){let r,n=0,o="";for(;r=e.exec(i);)n!==r.index&&(o+=i.substring(n,r.index)),o+=t.get(r[0].charCodeAt(0)),n=r.index+1;return o+i.substring(n)}}var xi,Oi,Li;String.prototype.codePointAt,ki(/[&<>'"]/g,Pi),ki(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),ki(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(xi||(xi={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(Oi||(Oi={})),new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((e=>[e.toLowerCase(),e]))),new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((e=>[e.toLowerCase(),e]))),new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),new Set(["svg","math"]),function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(Li||(Li={}));var Di,Ri,Mi,qi=function(e,t,i,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,i):n?n.value=i:t.set(e,i),i},Vi=function(e,t,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(e):r?r.value:t.get(e)};const Bi=new Set(["br","hr","img"]);function Fi(e){let t=["span","a","b","strong","i","em","del","ins","s","u","sub","sup","abbr","q","cite","mark","small"];const i={"*":["class","id","title"],a:["href","target"]};"comment"===e&&(t=t.concat(["div","h1","h2","h3","h4","h5","h6","p","br","blockquote","img","pre","ul","ol","li"]),Object.assign(i,{img:["alt","src","height","width"]}));const r=new Gi({allowedTags:t,allowedAttributes:i});return e=>r.parse(e)}class Gi{constructor({allowedTags:e,allowedAttributes:t}){Di.set(this,void 0),Ri.set(this,void 0),Mi.set(this,0),qi(this,Di,e?new Set(e):new Set,"f"),qi(this,Ri,t?new Map(Object.entries(t).map((([e,t])=>[e,new Set(t)]))):new Map,"f")}parse(t){const i=function(e,t){const i=new Ai(void 0,t);return new hi(i,t).end(e),i.root}(t);if("root"!==i.type)return;const r=[];return i.children.forEach((e=>{const t=this.processNode(e);t&&r.push(t)})),0===r.length?void 0:1===r.length?r[0]:e.createElement(e.Fragment,{key:this.allocateKey()},r)}processNode(t){if("text"===t.type)return t.data;if("tag"===t.type){const i=Bi.has(t.name)?void 0:t.children.map((e=>this.processNode(e)));if(Vi(this,Di,"f").has(t.name)){const r=this.filterAttributes(t.name,t.attribs);return r.key=this.allocateKey(),e.createElement(t.name,r,i)}return i?e.createElement(e.Fragment,{key:this.allocateKey()},i):void 0}}filterAttributes(e,t){const i={};for(const[r,n]of Object.entries(t))this.isAttributeAllowed(e,r)&&(i["class"===r?"className":r]=n);return i}isAttributeAllowed(e,t){if("key"===t||"ref"===t||"className"===t)return!1;const i=Vi(this,Ri,"f").get(e);if(i&&i.has(t))return!0;const r=Vi(this,Ri,"f").get("*");return!(!r||!r.has(t))}allocateKey(){var e,t;return"auto-"+(qi(this,Mi,(t=Vi(this,Mi,"f"),e=t++,t),"f"),e)}}Di=new WeakMap,Ri=new WeakMap,Mi=new WeakMap;class Ui extends e.Component{constructor(){super(...arguments),this.navigationFieldRef=e.createRef()}render(){return e.createElement("div",{className:"kokopu-movetext"},this.renderHeaders(),this.renderBody(),this.renderNavigationField())}renderHeaders(){if(!this.props.headerVisible)return;const t=Fi("header"),i=[];return i.push(this.renderPlayerHeaders(t,"w")),i.push(this.renderPlayerHeaders(t,"b")),i.push(this.renderEventRoundHeaders(t)),i.push(this.renderDateSiteHeaders(t)),i.push(this.renderAnnotatorHeader(t)),i.some((e=>void 0!==e))?e.createElement("div",{className:"kokopu-headers"},i):void 0}renderPlayerHeaders(t,i){const r=this.props.game.playerName(i);if(void 0===r)return;const n=this.props.game.playerTitle(i),o=this.props.game.playerElo(i),s=["kokopu-headerGroup-player","w"===i?"kokopu-headerGroup-whitePlayer":"kokopu-headerGroup-blackPlayer"],a=e.createElement("span",{className:"kokopu-colorTag"}),l=e.createElement("span",{className:"kokopu-header-playerName"},t(r)),c=void 0===n?void 0:e.createElement("span",{className:"kokopu-header-playerTitle"},t(n)),u=void 0===o?void 0:e.createElement("span",{className:"kokopu-header-playerRating"},o),d=void 0===n||void 0===o?void 0:" ",h=void 0===n&&void 0===o?void 0:e.createElement("span",{className:"kokopu-headerGroup-titleRating"},c,d,u);return e.createElement("div",{className:s.join(" "),key:"player-"+i},a,l,h)}renderEventRoundHeaders(t){const i=this.props.game.event();if(void 0===i)return;const r=this.props.game.fullRound(),n=void 0===r?void 0:e.createElement("span",{className:"kokopu-header-round"},r),o=e.createElement("span",{className:"kokopu-header-event"},t(i));return e.createElement("div",{className:"kokopu-headerGroup-eventRound",key:"event-round"},o,n)}renderDateSiteHeaders(t){const i=this.props.game.dateAsString(),r=this.props.game.site();if(void 0===i&&void 0===r)return;const n=void 0===i?void 0:e.createElement("span",{className:"kokopu-header-date"},0===(o=i).length?"":o.charAt(0).toUpperCase()+o.slice(1));var o;const s=void 0===r?void 0:e.createElement("span",{className:"kokopu-header-site"},t(r)),a=void 0===i||void 0===r?void 0:" – ";return e.createElement("div",{className:"kokopu-headerGroup-dateSite",key:"date-site"},n,a,s)}renderAnnotatorHeader(i){const r=this.props.game.annotator();if(void 0!==r)return e.createElement("div",{className:"kokopu-header-annotator",key:"annotator"},i(w(t.ANNOTATED_BY,r)))}renderNavigationField(){if("selectMove"===this.props.interactionMode)return e.createElement(Pt,{ref:this.navigationFieldRef,onFirstPressed:()=>this.handleNavigationPressed(xt,"key-first"),onPreviousPressed:()=>this.handleNavigationPressed(Ot,"key-previous"),onNextPressed:()=>this.handleNavigationPressed(Lt,"key-next"),onLastPressed:()=>this.handleNavigationPressed(Dt,"key-last"),onExitPressed:()=>this.handleExitPressed()})}renderBody(){const e=Fi("comment");return this.renderVariation(e,this.props.game.mainVariation(),!0,this.props.game.result())}renderVariation(t,i,r,n){const o=[];let s=[];function a(){i.isLongVariation()&&0!==s.length&&(o.push(e.createElement("div",{className:"kokopu-moveGroup",key:"group-"+o.length},s)),s=[])}const l=this.extractComment(i);void 0!==l&&(i.isLongComment()?o.push(this.renderComment(t,i,l)):s.push(this.renderComment(t,i,l)));let c=!0,u=i.first();for(;void 0!==u;){s.push(this.renderMove(u,c));const e=this.extractComment(u);void 0!==e&&(u.isLongComment()?(a(),o.push(this.renderComment(t,u,e))):s.push(this.renderComment(t,u,e)));let i=!1;for(const e of u.variations()){const r=this.renderVariation(t,e,!1);r&&(e.isLongVariation()?(a(),o.push(r)):s.push(r),i=!0)}c=void 0!==e||i,u=u.next()}r&&"*"!==n&&s.push(e.createElement("span",{className:"kokopu-gameResult",key:"game-result"},function(e){switch(e){case"1/2-1/2":return"½–½";case"1-0":return"1–0";case"0-1":return"0–1"}}(n))),a();const d=i.isLongVariation()?o:s;if(0!==d.length)return r?e.createElement("div",{className:"kokopu-variation kokopu-mainVariation",key:i.id()},d):i.isLongVariation()?e.createElement("div",{className:"kokopu-variation kokopu-subVariation",key:i.id()},d):e.createElement("span",{className:"kokopu-variation kokopu-subVariation",key:i.id()},d)}renderMove(t,i){let r;if(i||"w"===t.moveColor()){const i=t.fullMoveNumber()+("w"===t.moveColor()?".":"…");r=e.createElement("span",{className:"kokopu-moveNumber"},i)}const n=this.props.moveFormatter(t.notation()),s=t.nags().map((t=>e.createElement("span",{className:"kokopu-nag",key:t},(0,o.nH)(t)))),a=t.id(),l=["kokopu-move"];let c;return this.props.selection&&this.props.selection===a&&l.push("kokopu-selectedMove"),"selectMove"===this.props.interactionMode&&(l.push("kokopu-clickableMove"),c=()=>this.handleNodeClicked(a)),e.createElement("span",{className:l.join(" "),key:t.id()},e.createElement("span",{className:"kokopu-moveContent",onClick:c},r,e.createElement("span",{className:"kokopu-moveNotation"},n),0===s.length?void 0:s))}renderComment(t,i,r){let n;if(this.props.diagramVisible&&r.includes("[#]")){const s=[];let a=!0,l=0;for(let n of r.split("[#]")){if(!a){const t=i instanceof o.mD?i.initialPosition():i.position(),r=e.createElement(vt,{position:t,squareMarkers:i.tag("csl"),arrowMarkers:i.tag("cal"),textMarkers:i.tag("ctl"),flipped:this.props.diagramOptions.flipped,squareSize:this.props.diagramOptions.squareSize,coordinateVisible:this.props.diagramOptions.coordinateVisible,turnVisible:this.props.diagramOptions.turnVisible,colorset:this.props.diagramOptions.colorset,pieceset:this.props.diagramOptions.pieceset,smallScreenLimits:this.props.diagramOptions.smallScreenLimits});s.push(e.createElement("div",{className:"kokopu-diagram",key:"diagram-"+l++},r))}a=!1,n=n.trim(),0!==n.length&&s.push(t(n))}n=s}else n=t(r);const s=i.id()+"-comment";return i.isLongComment()?e.createElement("div",{className:"kokopu-comment",key:s},n):e.createElement("span",{className:"kokopu-comment",key:s},n)}extractComment(e){let t=e.comment();return t&&(this.props.diagramVisible||(t=t.replace(/\[#\]/g," ")),t=t.replace(/\s+/g," ").trim()),t||void 0}handleNavigationPressed(e,t){this.props.selection&&this.fireMoveSelected(e(this.props.game,this.props.selection),t)}handleExitPressed(){this.props.selection&&this.props.game.findById(this.props.selection)&&this.fireMoveSelected(void 0,"key-exit")}fireMoveSelected(e,t){(e||"key-exit"===t)&&this.props.onMoveSelected&&this.props.onMoveSelected(e,t)}handleNodeClicked(e){this.focus(),this.props.onMoveSelected&&this.props.onMoveSelected(e===this.props.selection?void 0:e,"click")}focus(){const e=this.navigationFieldRef.current;e&&e.focus()}}class ji extends e.Component{constructor(){super(...arguments),this.implRef=e.createRef()}render(){const t=bt(this.props.game,this.props.gameIndex,"Movetext");if(t.error)return t.errorBox;if("object"!=typeof this.props.diagramOptions||null===this.props.diagramOptions)throw new s("Movetext","diagramOptions");const i=At(this.props.pieceSymbols),r=m(this.props.diagramVisible),n=m(this.props.headerVisible),o=I(this.props.selection,g),a=this.getInteractionMode(),{onMoveSelected:l}=this.props;return e.createElement(Ui,{ref:this.implRef,game:t.game,diagramOptions:this.props.diagramOptions,moveFormatter:i,diagramVisible:r,headerVisible:n,selection:o,interactionMode:a,onMoveSelected:l})}getInteractionMode(){const e=I(this.props.interactionMode,g);if(void 0===e||"selectMove"===e)return e;throw new s("Movetext","interactionMode")}focus(){const e=this.implRef.current;e&&e.focus()}static firstNodeId(e,t){return xt(e,t)}static previousNodeId(e,t){return Ot(e,t)}static nextNodeId(e,t){return Lt(e,t)}static lastNodeId(e,t){return Dt(e,t)}}function zi(e,t,i){const r=e-2*i*Math.sqrt(2)/2,n=e-i*(7+2/Math.sqrt(2)/2),o=e-i*(7-2/Math.sqrt(2)/2),s=e+2*i*Math.sqrt(2)/2;return`M ${r} ${t} L ${n} ${t-i*(7-2/Math.sqrt(2)/2)} L ${o} ${t-i*(7+2/Math.sqrt(2)/2)} L ${s} ${t} L ${o} ${t+i*(7+2/Math.sqrt(2)/2)} L ${n} ${t+i*(7-2/Math.sqrt(2)/2)} Z`}function $i(e,t,i){const r=e-i*(5+2/Math.sqrt(2)/2),n=e-i*(5-2/Math.sqrt(2)/2),o=e-2*i/2,s=e+2*i/2,a=e+i*(5-2/Math.sqrt(2)/2),l=e+i*(5+2/Math.sqrt(2)/2),c=t-2*i*Math.sqrt(2)/2,u=c-i*(5-2/Math.sqrt(2)/2),d=c-i*(5+2/Math.sqrt(2)/2),h=d+(o-n);return`M ${e} ${t} L ${r} ${u} L ${n} ${d} L ${o} ${h} V ${t-16*i} H ${s} V ${h} L ${a} ${d} L ${l} ${u} Z`}ji.defaultProps={game:new o.Zt,gameIndex:0,diagramOptions:{},pieceSymbols:"native",diagramVisible:!0,headerVisible:!0};const Hi=zi(14,16,-1)+" "+zi(10,16,-1),Wi=zi(12,16,-1),Ki=zi(20,16,1),Ji=zi(18,16,1)+" "+zi(22,16,1),Yi=$i(11,25,1)+" "+$i(21,7,-1);function Qi(e){return"object"==typeof e&&null!==e&&!("string"!=typeof e.iconPath||void 0!==e.tooltip&&"string"!=typeof e.tooltip||void 0!==e.enabled&&"boolean"!=typeof e.enabled||void 0!==e.onClick&&"function"!=typeof e.onClick)}function Xi(e){if(Array.isArray(e)){for(const t of e)if("button"!==t&&"spacer"!==t)return!1;return!0}return!1}function Zi({squareSize:t,buttons:i}){const r=ir(t),n=rr(t),o=[];let s=!1;for(let t=0;t<i.length;++t){const a=i[t];"spacer"!==a&&(s&&"spacer"===i[t-1]&&o.push(e.createElement("div",{key:o.length,className:"kokopu-navigationSpacer",style:{width:n}})),s=!0,o.push(e.createElement(er,{key:o.length,tooltip:a.tooltip,iconPath:a.iconPath,enabled:a.enabled,onClick:a.onClick,size:r,spaceOnLeft:0===t||"spacer"===i[t-1],spaceOnRight:t===i.length-1||"spacer"===i[t+1]})))}return e.createElement("div",{className:"kokopu-navigationToolbar",style:{marginTop:nr(t)}},o)}function er({size:t,spaceOnLeft:i,spaceOnRight:r,iconPath:n,tooltip:o,enabled:s,onClick:a}){const l=i?"A 16 16 0 0 0 16 32":"L 1 0 L 1 32 L 16 32",c=r?"A 16 16 0 0 0 16 0":"L 31 32 L 31 0 L 16 0",u=s??!0;return e.createElement("div",{className:u?"kokopu-enabledNavigationButton":"kokopu-disabledNavigationButton",title:o,onClick:u?a:void 0},e.createElement("svg",{viewBox:"0 0 32 32",width:t,height:t},e.createElement("path",{d:`M 16 0 ${l} ${c} Z ${n}`,fill:"currentcolor"})))}function tr(e,t){const i=ir(e),r=rr(e);let n=0,o=!1;for(let e=0;e<t.length;++e)"spacer"!==t[e]&&(o&&"spacer"===t[e-1]&&(n+=r),o=!0,n+=i);return{width:n,height:i+nr(e)}}function ir(e){return Math.round((2*e+116)/7)}function rr(e){return Math.round((2*e+116)/14)}function nr(e){return Math.round((2*e+116)/28)}class or extends e.Component{constructor(t){super(t),this.navigationFieldRef=e.createRef(),this.state={nodeIdAsUncontrolled:g(t.initialNodeId),isPlayingAsUncontrolled:m(t.initialIsPlaying),flippedAsUncontrolled:m(t.initialFlipped)}}componentWillUnmount(){this.cancelCurrentTimeout()}render(){this.cancelCurrentTimeout();const t=bt(this.props.game,this.props.gameIndex,"NavigationBoard");if(t.error)return t.errorBox;const i=I(this.props.nodeId,g)??this.state.nodeIdAsUncontrolled,r=t.game.findById(i)??t.game.mainVariation(),n=I(this.props.isPlaying,m)??this.state.isPlayingAsUncontrolled,o=I(this.props.flipped,m)??this.state.flippedAsUncontrolled;return e.createElement("div",{className:"kokopu-navigationBoard"},this.renderBoard(t.game,r,n,o),this.renderNavigationField(t.game,r.id()))}renderBoard(t,i,r,n){const s=i instanceof o.bP?i.positionBefore():i.initialPosition(),a=i instanceof o.bP?i.notation():void 0;return e.createElement(vt,{position:s,move:a,flipped:n,squareMarkers:i.tag("csl"),arrowMarkers:i.tag("cal"),textMarkers:i.tag("ctl"),squareSize:this.props.squareSize,coordinateVisible:this.props.coordinateVisible,turnVisible:this.props.turnVisible,colorset:this.props.colorset,pieceset:this.props.pieceset,smallScreenLimits:this.props.smallScreenLimits,moveArrowVisible:this.props.moveArrowVisible,moveArrowColor:this.props.moveArrowColor,animated:this.props.animated,bottomComponent:({squareSize:e})=>this.renderToolbar(t,i,e,r)})}renderNavigationField(t,i){return e.createElement(Pt,{ref:this.navigationFieldRef,onFirstPressed:()=>this.handleNavClicked(xt(t,i)),onPreviousPressed:()=>this.handleNavClicked(Ot(t,i)),onNextPressed:()=>this.handleNavClicked(Lt(t,i)),onLastPressed:()=>this.handleNavClicked(Dt(t,i))})}renderToolbar(i,r,n,a){const l=[],c=r.id(),u="start"!==c,d=void 0!==(r instanceof o.mD?r.first():r.next());if(l.push({iconPath:Hi,tooltip:t.TOOLTIP_GO_FIRST,enabled:u,onClick:()=>this.handleNavClicked(xt(i,c))}),l.push({iconPath:Wi,tooltip:t.TOOLTIP_GO_PREVIOUS,enabled:u,onClick:()=>this.handleNavClicked(Ot(i,c))}),m(this.props.playButtonVisible)&&l.push({iconPath:a?"M 11 11 H 21 V 21 H 11 Z":"M 23 16 L 12 23 V 9 Z",tooltip:t.TOOLTIP_PLAY_STOP,enabled:d,onClick:()=>this.handlePlayStopClicked(!a)}),l.push({iconPath:Ki,tooltip:t.TOOLTIP_GO_NEXT,enabled:d,onClick:()=>this.handleNavClicked(Lt(i,c))}),l.push({iconPath:Ji,tooltip:t.TOOLTIP_GO_LAST,enabled:d,onClick:()=>this.handleNavClicked(Dt(i,c))}),l.push("spacer"),m(this.props.flipButtonVisible)&&l.push({iconPath:Yi,tooltip:t.TOOLTIP_FLIP,onClick:()=>this.handleFlipButtonClicked()}),l.push("spacer"),a&&(this.timeoutId=d?window.setTimeout((()=>this.handleNavClicked(Lt(i,c),!1)),1e3):window.setTimeout((()=>this.handlePlayStopClicked(!1,!1)),0)),!function(e){if(Array.isArray(e)){for(const t of e)if(!Qi(t)&&"spacer"!==t)return!1;return!0}return!1}(this.props.additionalButtons))throw new s("NavigationBoard","additionalButtons");for(const e of this.props.additionalButtons)l.push(e);return e.createElement(Zi,{squareSize:n,buttons:l})}handleNavClicked(e,t=!0){t&&this.focus(),void 0!==e&&(void 0===this.props.nodeId?this.setState({nodeIdAsUncontrolled:e}):this.props.onNodeIdChanged&&this.props.onNodeIdChanged(e))}handlePlayStopClicked(e,t=!0){t&&this.focus(),void 0===this.props.isPlaying?this.setState({isPlayingAsUncontrolled:e}):this.props.onIsPlayingChanged&&this.props.onIsPlayingChanged(e)}handleFlipButtonClicked(){this.focus(),void 0===this.props.flipped?this.setState({flippedAsUncontrolled:!this.state.flippedAsUncontrolled}):this.props.onFlippedChanged&&this.props.onFlippedChanged(!this.props.flipped)}cancelCurrentTimeout(){void 0!==this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=void 0)}focus(){const e=this.navigationFieldRef.current;e&&e.focus()}static size(e){const{squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,playButtonVisible:o,flipButtonVisible:a,additionalButtons:l}=b(e,(()=>new s("NavigationBoard.size()","attr"))),c=I(o,m),u=I(a,m);if(void 0!==l&&!Xi(l))throw new s("NavigationBoard.size()","additionalButtons");const d=sr(c,u,l);return vt.size({squareSize:t,coordinateVisible:i,turnVisible:r,smallScreenLimits:n,bottomComponent:({squareSize:e})=>tr(e,d)})}static adaptSquareSize(e,t,i){const{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,playButtonVisible:a,flipButtonVisible:l,additionalButtons:c}=b(i,(()=>new s("NavigationBoard.adaptSquareSize()","attr"))),u=I(a,m),d=I(l,m);if(void 0!==c&&!Xi(c))throw new s("NavigationBoard.adaptSquareSize()","additionalButtons");const h=sr(u,d,c);return vt.adaptSquareSize(e,t,{coordinateVisible:r,turnVisible:n,smallScreenLimits:o,bottomComponent:({squareSize:e})=>tr(e,h)})}}function sr(e,t,i){const r=[];if(r.push("button"),r.push("button"),(e??or.defaultProps.playButtonVisible)&&r.push("button"),r.push("button"),r.push("button"),r.push("spacer"),(t??or.defaultProps.flipButtonVisible)&&r.push("button"),r.push("spacer"),void 0!==i)for(const e of i)r.push(e);return r}or.defaultProps={squareSize:40,coordinateVisible:!0,turnVisible:!0,colorset:"original",pieceset:"cburnett",moveArrowVisible:!0,moveArrowColor:"b",animated:!1,game:new o.Zt,gameIndex:0,initialNodeId:"start",initialIsPlaying:!1,initialFlipped:!1,playButtonVisible:!1,flipButtonVisible:!0,additionalButtons:[]};var ar=i(5556),lr=i.n(ar),cr=i(5795),ur=i.n(cr);const dr=function(e){const t=e-1*(5+2/Math.sqrt(2)/2),i=e-1*(5-2/Math.sqrt(2)/2),r=e+1*(5-2/Math.sqrt(2)/2),n=e+1*(5+2/Math.sqrt(2)/2),o=22-2*Math.sqrt(2)/2,s=o-1*(5-2/Math.sqrt(2)/2),a=o-1*(5+2/Math.sqrt(2)/2),l=a+(15-i);return`M 16 22 L ${t} ${s} L ${i} ${a} L 15 ${l} V 6 H 17 V ${l} L ${r} ${a} L ${n} ${s} Z`}(16)+" M 8 22 H 24 V 24 H 8 Z",hr=window.ReactJSXRuntime;let pr=!1,fr=!1,gr=!1,mr=!1;function br(e){return function(){if(pr)return;fr={squareSize:RPBChessboard.defaultSettings.nboSquareSize,coordinateVisible:RPBChessboard.defaultSettings.nboCoordinateVisible,turnVisible:RPBChessboard.defaultSettings.nboTurnVisible,colorset:RPBChessboard.defaultSettings.nboColorset,pieceset:RPBChessboard.defaultSettings.nboPieceset,animated:RPBChessboard.defaultSettings.animated,moveArrowVisible:RPBChessboard.defaultSettings.moveArrowVisible,moveArrowColor:RPBChessboard.defaultSettings.moveArrowColor,smallScreenLimits:RPBChessboard.smallScreenLimits,playButtonVisible:RPBChessboard.defaultSettings.playButtonVisible,turnButtonVisible:RPBChessboard.defaultSettings.turnButtonVisible,downloadButtonVisible:RPBChessboard.defaultSettings.downloadButtonVisible,additionalButtons:RPBChessboard.defaultSettings.downloadButtonVisible?["button"]:[]};const e=document.createElement("div");function t(){const t=or.size(fr);e.style.minWidth=`${t.width}px`,e.style.minHeight=`${t.height}px`}function i(){gr&&gr.focus()}t();const r=document.createElement("div");r.id="rpbchessboard-navigationFrame",r.onclick=i,pr=document.createElement("div"),r.appendChild(e),e.appendChild(pr);const n=window.jQuery;n("body").append(r),n("#rpbchessboard-navigationFrame").dialog({create:e=>n(e.target).parent().css("position","fixed"),resizeStart:e=>n(e.target).parent().css("position","fixed"),resizeStop:e=>n(e.target).parent().css("position","fixed"),autoOpen:!1,dialogClass:"wp-dialog",width:"auto",close:()=>{gr&&gr.handleMoveSelected(void 0,"external")}}),n("#rpbchessboard-navigationFrame").on("dialogresize",((e,i)=>{if(!mr){const e=or.size(fr);mr={reservedWidth:i.originalSize.width-e.width,reservedHeight:i.originalSize.height-e.height}}const r=i.size.width-mr.reservedWidth,n=i.size.height-mr.reservedHeight,o=or.adaptSquareSize(r,n,fr);fr={...fr},fr.squareSize=o,t(),gr.setState({popupBoardOptions:fr})})),n("#rpbchessboard-navigationFrame").on("dialogopen",i),n("#rpbchessboard-navigationFrame").on("dialogdragstop",i),n("#rpbchessboard-navigationFrame").on("dialogresizestop",i)}(),gr&&gr!==e&&gr.handleMoveSelected(void 0,"external"),gr=e,function(){const e=(0,window.jQuery)("#rpbchessboard-navigationFrame");e.dialog("isOpen")||(e.dialog("option","position",{my:"center",at:"center",of:window}),e.dialog("open"))}(),{anchor:pr,boardOptions:fr,setTitle:e=>function(e){if(!pr)return;const t=window.jQuery,i=t(".ui-dialog-title",t("#rpbchessboard-navigationFrame").closest(".ui-dialog")).get(0);(0,n.H)(i).render((0,hr.jsx)("span",{children:e}))}(e)}}function vr(e){gr===e&&(gr=!1,pr&&(0,window.jQuery)("#rpbchessboard-navigationFrame").dialog("close"))}function _r(e,...t){return e.replace(/{(\d+)}/g,((e,i)=>(i=Number(i))<t.length?t[i]:e))}function Ir(e){const t=/^([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*),([A-Za-z]*)$/.exec(e);return!!t&&{K:t[1],Q:t[2],R:t[3],B:t[4],N:t[5],P:t[6]}}function Nr(e){return[..."KQRBNP"].map((t=>e[t].replace(/[^A-Za-z]/g,""))).join(",")}const wr=RPBChessboard.i18n;class Sr extends r().Component{constructor(e){super(e),this.state={selection:!!Er(this.props.navigationBoard)&&this.props.initialSelection,isPlaying:!1,withAdditionalFlip:!1,urlFetchStatus:!1},this.movetextRef=r().createRef(),this.blobDownloadLinkRef=r().createRef(),this.dynamicURL=!1}componentWillUnmount(){this.releaseDynamicURL(),"frame"===this.props.navigationBoard&&vr(this)}render(){let e="";if(this.props.url){if("ok"!==this.state.urlFetchStatus)return"error"===this.state.urlFetchStatus?(0,hr.jsx)(C,{title:wr.PGN_DOWNLOAD_ERROR_TITLE,message:this.state.urlError}):(async function(e){const t=await fetch(e);return t.ok?t.text():Promise.reject(_r(wr.PGN_DOWNLOAD_ERROR_MESSAGE,e,t.status))}(this.props.url).then((e=>this.setState({urlFetchStatus:"ok",urlData:e}))).catch((e=>this.setState({urlFetchStatus:"error",urlError:e}))),(0,hr.jsx)("div",{}));e=this.state.urlData}else e=this.props.pgn;const t=this.parseGame(e);if(!t.valid)return(0,hr.jsx)(C,{title:wr.PGN_PARSING_ERROR_TITLE,message:t.message,text:t.pgn,errorIndex:t.errorIndex,lineNumber:t.lineNumber});const i=this.getNodeId(t.game);if("above"===this.props.navigationBoard)return(0,hr.jsxs)("div",{children:[this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions),this.renderMovetext(t.game,i,!0)]});if("below"===this.props.navigationBoard)return(0,hr.jsxs)("div",{children:[this.renderMovetext(t.game,i,!0),this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions)]});if("floatLeft"===this.props.navigationBoard||"floatRight"===this.props.navigationBoard)return(0,hr.jsxs)("div",{className:"floatLeft"===this.props.navigationBoard?"rpbchessboard-indentWithFloatLeft":"",children:[this.renderNavigationBoard(t.game,i,this.props.navigationBoardOptions),this.renderMovetext(t.game,i,!0),(0,hr.jsx)("div",{className:"rpbchessboard-clearFloat"})]});if("scrollLeft"===this.props.navigationBoard||"scrollRight"===this.props.navigationBoard){const e=this.props.navigationBoardOptions,{height:r}=or.size(e);return(0,hr.jsxs)("div",{className:"rpbchessboard-scrollBox-"+this.props.navigationBoard,children:[this.renderNavigationBoard(t.game,i,e),(0,hr.jsx)("div",{className:"rpbchessboard-scrollArea",style:{"max-height":r},children:this.renderMovetext(t.game,i,!0)})]})}return"frame"===this.props.navigationBoard?(0,hr.jsxs)("div",{children:[this.renderMovetext(t.game,i,!0),this.renderNavigationBoardInPopup(t.game,i)]}):(0,hr.jsx)("div",{children:this.renderMovetext(t.game,i,!1)})}renderMovetext(e,t,i){return(0,hr.jsx)(ji,{ref:this.movetextRef,game:e,selection:t,interactionMode:i?"selectMove":void 0,onMoveSelected:(e,t)=>this.handleMoveSelected(e,t),pieceSymbols:this.getPieceSymbols(),diagramOptions:this.props.diagramOptions})}renderNavigationBoardInPopup(e,t){if(void 0!==t&&this.state.popupAnchor)return ur().createPortal(this.renderNavigationBoard(e,t,this.state.popupBoardOptions,this.state.setPopupTitle),this.state.popupAnchor)}renderNavigationBoard(e,t,i,r){r&&r(this.getPopupTitle(e,t));const n=["rpbchessboard-navigationBoard","rpbchessboard-navigationBoard-"+this.props.navigationBoard],o=[];return i.downloadButtonVisible&&o.push({iconPath:dr,tooltip:wr.PGN_TOOLTIP_DOWNLOAD,onClick:()=>this.handleDownloadClicked()}),(0,hr.jsxs)("div",{className:n.join(" "),children:[(0,hr.jsx)(or,{game:e,nodeId:t,flipped:this.props.navigationBoardOptions.flipped^this.state.withAdditionalFlip,isPlaying:this.state.isPlaying,squareSize:i.squareSize,coordinateVisible:i.coordinateVisible,turnVisible:i.turnVisible,colorset:i.colorset,pieceset:i.pieceset,smallScreenLimits:i.smallScreenLimits,animated:i.animated,moveArrowVisible:i.moveArrowVisible,moveArrowColor:i.moveArrowColor,playButtonVisible:i.playButtonVisible,flipButtonVisible:i.flipButtonVisible,onNodeIdChanged:e=>this.handleNavClicked(e),onIsPlayingChanged:e=>this.handleIsPlayingClicked(e),onFlippedChanged:()=>this.handleFlipClicked(),additionalButtons:o}),this.renderDownloadLink(i.downloadButtonVisible)]})}renderDownloadLink(e){if(e)return(0,hr.jsx)("a",{ref:this.blobDownloadLinkRef,className:"rpbchessboard-blobDownloadLink",href:"#",download:"game.pgn"})}getPopupTitle(e,t){if("start"===t)return wr.PGN_INITIAL_POSITION;{const i=e.findById(t),r=i.fullMoveNumber()+("w"===i.moveColor()?".":"…")+i.notation();return function(e,t){return At(e)(t)}(this.getPieceSymbols(),r)}}getPieceSymbols(){return Ir(this.props.pieceSymbols)||("native"===this.props.pieceSymbols||"localized"===this.props.pieceSymbols||"figurines"===this.props.pieceSymbols?this.props.pieceSymbols:void 0)}parseGame(e){try{return{valid:!0,game:(0,o.oG)(e,this.props.gameIndex)}}catch(e){if(e instanceof o.exception.InvalidPGN)return{valid:!1,message:e.message,pgn:e.pgn,errorIndex:e.index,lineNumber:e.lineNumber};throw e}}getNodeId(e){let t=this.state.selection?e.findById(this.state.selection):void 0;return t instanceof o.mD&&void 0!==t.parentNode()&&(t=t.parentNode()),Er(this.props.navigationBoard)?void 0===t?"start":t.id():"frame"===this.props.navigationBoard?void 0===t?void 0:t.id():void 0}handleMoveSelected(e,t){if(e?this.setState({selection:e}):"frame"===this.props.navigationBoard&&this.setState({selection:!1}),"frame"===this.props.navigationBoard&&"external"!==t)if(e){const{anchor:e,boardOptions:t,setTitle:i}=br(this);this.setState({popupAnchor:e,popupBoardOptions:t,setPopupTitle:i})}else vr(this)}handleNavClicked(e){this.movetextRef.current.focus(),this.setState({selection:e})}handleIsPlayingClicked(e){this.movetextRef.current.focus(),this.setState({isPlaying:e})}handleFlipClicked(){this.movetextRef.current.focus(),this.setState({withAdditionalFlip:!this.state.withAdditionalFlip})}handleDownloadClicked(){if(this.props.url)window.location.href=this.props.url;else{const e=new Blob([this.props.pgn],{type:"text/plain"});this.releaseDynamicURL(),this.dynamicURL=window.URL.createObjectURL(e);const t=this.blobDownloadLinkRef.current;t.href=this.dynamicURL,t.click()}}releaseDynamicURL(){this.dynamicURL&&(window.URL.revokeObjectURL(this.dynamicURL),this.dynamicURL=!1)}focus(){this.movetextRef.current.focus()}}function Er(e){return"above"===e||"below"===e||"floatLeft"===e||"floatRight"===e||"scrollLeft"===e||"scrollRight"===e}Sr.propTypes={url:lr().string,pgn:lr().string,gameIndex:lr().number,initialSelection:lr().string,pieceSymbols:lr().oneOfType([lr().oneOf(["native","localized","figurines"]),lr().string]),navigationBoard:lr().oneOf(["none","frame","floatLeft","floatRight","scrollLeft","scrollRight","above","below"]),navigationBoardOptions:lr().shape({flipped:lr().bool,squareSize:lr().number,coordinateVisible:lr().bool,turnVisible:lr().bool,smallScreenLimits:lr().arrayOf(lr().shape({width:lr().number.isRequired,squareSize:lr().number,coordinateVisible:lr().bool})),colorset:lr().string,pieceset:lr().string,animated:lr().bool,moveArrowVisible:lr().bool,flipButtonVisible:lr().bool,downloadButtonVisible:lr().bool}),diagramOptions:lr().shape({flipped:lr().bool,squareSize:lr().number,coordinateVisible:lr().bool,turnVisible:lr().bool,smallScreenLimits:lr().arrayOf(lr().shape({width:lr().number.isRequired,squareSize:lr().number,coordinateVisible:lr().bool})),colorset:lr().string,pieceset:lr().string})},Sr.defaultProps={pgn:"",gameIndex:0,initialSelection:!1,pieceSymbols:"native",navigationBoard:"none",navigationBoardOptions:{},diagramOptions:{}};const yr=window.wp.blocks,Cr=window.wp.blockEditor,Ar=window.wp.components,Tr=window.wp.primitives,Pr=(0,hr.jsx)(Tr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hr.jsx)(Tr.Path,{d:"M19.75 9c0-1.257-.565-2.197-1.39-2.858-.797-.64-1.827-1.017-2.815-1.247-1.802-.42-3.703-.403-4.383-.396L11 4.5V6l.177-.001c.696-.006 2.416-.02 4.028.356.887.207 1.67.518 2.216.957.52.416.829.945.829 1.688 0 .592-.167.966-.407 1.23-.255.281-.656.508-1.236.674-1.19.34-2.82.346-4.607.346h-.077c-1.692 0-3.527 0-4.942.404-.732.209-1.424.545-1.935 1.108-.526.579-.796 1.33-.796 2.238 0 1.257.565 2.197 1.39 2.858.797.64 1.827 1.017 2.815 1.247 1.802.42 3.703.403 4.383.396L13 19.5h.714V22L18 18.5 13.714 15v3H13l-.177.001c-.696.006-2.416.02-4.028-.356-.887-.207-1.67-.518-2.216-.957-.52-.416-.829-.945-.829-1.688 0-.592.167-.966.407-1.23.255-.281.656-.508 1.237-.674 1.189-.34 2.819-.346 4.606-.346h.077c1.692 0 3.527 0 4.941-.404.732-.209 1.425-.545 1.936-1.108.526-.579.796-1.33.796-2.238z"})}),kr=(0,hr.jsx)(Tr.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,hr.jsx)(Tr.Path,{d:"M12 4V2.2L9 4.8l3 2.5V5.5c3.6 0 6.5 2.9 6.5 6.5 0 2.9-1.9 5.3-4.5 6.2v.2l-.1-.2c-.4.1-.7.2-1.1.2l.2 1.5c.3 0 .6-.1 1-.2 3.5-.9 6-4 6-7.7 0-4.4-3.6-8-8-8zm-7.9 7l1.5.2c.1-1.2.5-2.3 1.2-3.2l-1.1-.9C4.8 8.2 4.3 9.6 4.1 11zm1.5 1.8l-1.5.2c.1.7.3 1.4.5 2 .3.7.6 1.3 1 1.8l1.2-.8c-.3-.5-.6-1-.8-1.5s-.4-1.1-.4-1.7zm1.5 5.5c1.1.9 2.4 1.4 3.8 1.6l.2-1.5c-1.1-.1-2.2-.5-3.1-1.2l-.9 1.1z"})}),xr=RPBChessboard.i18n;function Or({label:e,value:t,available:i,onChange:r}){const n=[{value:"",label:"<"+xr.FEN_EDITOR_USE_DEFAULT+">"}];return Object.keys(i).sort().forEach((e=>n.push({value:e,label:i[e]}))),(0,hr.jsx)(Ar.ComboboxControl,{label:e,value:t,options:n,onChange:r})}function Lr(e){const t=0===e.squareSize,i=t?void 0:(0,hr.jsx)(Ar.RangeControl,{label:xr.FEN_EDITOR_CONTROL_SQUARE_SIZE,value:e.squareSize,min:RPBChessboard.availableSquareSize.min,max:RPBChessboard.availableSquareSize.max,step:1,onChange:e.onSquareSizeChanged});return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Ar.ToggleControl,{label:xr.FEN_EDITOR_CONTROL_USE_DEFAULT_SIZE,checked:t,onChange:()=>e.onSquareSizeChanged(t?e.defaultSquareSize:0)}),i,(0,hr.jsx)(Ar.RadioControl,{label:xr.FEN_EDITOR_CONTROL_COORDINATES,selected:e.coordinateVisible,onChange:e.onCoordinateVisibleChanged,options:[{label:xr.FEN_EDITOR_USE_DEFAULT,value:""},{label:xr.FEN_EDITOR_OPTION_HIDDEN,value:"false"},{label:xr.FEN_EDITOR_OPTION_VISIBLE,value:"true"}]}),(0,hr.jsx)(Ar.RadioControl,{label:xr.FEN_EDITOR_CONTROL_TURN_FLAG,selected:e.turnVisible,onChange:e.onTurnVisibleChanged,options:[{label:xr.FEN_EDITOR_USE_DEFAULT,value:""},{label:xr.FEN_EDITOR_OPTION_HIDDEN,value:"false"},{label:xr.FEN_EDITOR_OPTION_VISIBLE,value:"true"}]}),(0,hr.jsx)(Or,{label:xr.FEN_EDITOR_CONTROL_COLORSET,value:e.colorset,available:RPBChessboard.availableColorsets,onChange:e.onColorsetChanged}),(0,hr.jsx)(Or,{label:xr.FEN_EDITOR_CONTROL_PIECESET,value:e.pieceset,available:RPBChessboard.availablePiecesets,onChange:e.onPiecesetChanged})]})}Or.propTypes={label:lr().string.isRequired,value:lr().string.isRequired,available:lr().arrayOf(lr().object).isRequired,onChange:lr().func.isRequired},Lr.propTypes={defaultSquareSize:lr().number.isRequired,squareSize:lr().number.isRequired,coordinateVisible:lr().string.isRequired,turnVisible:lr().string.isRequired,colorset:lr().string.isRequired,pieceset:lr().string.isRequired,onSquareSizeChanged:lr().func.isRequired,onCoordinateVisibleChanged:lr().func.isRequired,onTurnVisibleChanged:lr().func.isRequired,onColorsetChanged:lr().func.isRequired,onPiecesetChanged:lr().func.isRequired};const Dr=i.p+"images/add-w.bb64049f.png",Rr=i.p+"images/add-b.51fdd0c7.png",Mr=i.p+"images/toggle-turn.1a534377.png",qr={w:Dr,b:Rr},Vr=RPBChessboard.i18n,Br=vt.colorsets().original,Fr=vt.piecesets().cburnett;function Gr(){const e=[];for(let t=0;t<4;++t)for(let i=1-t%2;i<4;i+=2)e.push((0,hr.jsx)("rect",{x:t,y:i,width:1,height:1}));return(0,hr.jsx)("svg",{viewBox:"0 0 4 4",children:e})}class Ur extends r().Component{constructor(e){super(e),this.state={interactionMode:"movePieces",textMarkerMode:"circle"},this.blockContentRef=r().createRef()}componentDidUpdate(){if(this.blockContentRef.current)for(const e of this.blockContentRef.current.getElementsByTagName("svg"))e.setAttribute("draggable","true")}handleAttributeChanged(e,t){const i={...this.props.attributes};i[e]=t,this.props.setAttributes(i)}handlePieceMoved(e,t){if("movePieces"===this.state.interactionMode){const i=new o.yX(this.props.attributes.position);i.square(t,i.square(e)),i.square(e,"-"),this.props.setAttributes({...this.props.attributes,position:i.fen()})}}handleSquareClicked(e){if(/addPiece-([wb][pnbrqk])/.test(this.state.interactionMode)){const t=RegExp.$1,i=new o.yX(this.props.attributes.position);i.square(e,i.square(e)===t?"-":t),this.props.setAttributes({...this.props.attributes,position:i.fen()})}else if(/addSquareMarker-([bgry])/.test(this.state.interactionMode)){const t=RegExp.$1,i={...this.props.attributes.squareMarkers};i[e]===t?delete i[e]:i[e]=t,this.props.setAttributes({...this.props.attributes,squareMarkers:i})}else if(/addTextMarker-([bgry])/.test(this.state.interactionMode)){const t=RegExp.$1,i={...this.props.attributes.textMarkers};i[e]&&i[e].symbol===this.state.textMarkerMode&&i[e].color===t?delete i[e]:i[e]={symbol:this.state.textMarkerMode,color:t},this.props.setAttributes({...this.props.attributes,textMarkers:i})}}handleArrowEdited(e,t){if(/addArrowMarker-([bgry])/.test(this.state.interactionMode)){const i=RegExp.$1,r=e+t,n={...this.props.attributes.arrowMarkers};n[r]===i?delete n[r]:n[r]=i,this.props.setAttributes({...this.props.attributes,arrowMarkers:n})}}handleToggleTurnClicked(){const e=new o.yX(this.props.attributes.position);e.turn((0,o.VD)(e.turn())),this.props.setAttributes({...this.props.attributes,position:e.fen()})}handleFlipClicked(){const e=!this.props.attributes.flipped;this.props.setAttributes({...this.props.attributes,flipped:e})}handleClearAnnotationsClicked(){this.props.setAttributes({...this.props.attributes,squareMarkers:{},arrowMarkers:{},textMarkers:{}})}render(){const e=e=>this.setState({interactionMode:e}),t=this.parsePositionAttribute();let i,r="",n="";if("movePieces"===this.state.interactionMode)r="movePieces",i=(0,hr.jsx)("div",{style:{width:"24px",height:"24px"},children:Pr});else if(/addPiece-([wb][pnbrqk])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)("img",{src:Fr[e],width:24,height:24})}else if(/addSquareMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)(A,{size:24,color:Br["c"+e]})}else if(/addArrowMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="editArrows",n=e,i=(0,hr.jsx)(D,{size:24,color:Br["c"+e]})}else if(/addTextMarker-([bgry])/.test(this.state.interactionMode)){const e=RegExp.$1;r="clickSquares",i=(0,hr.jsx)(O,{size:24,color:Br["c"+e],symbol:this.state.textMarkerMode})}return(0,hr.jsxs)("div",{...this.props.blockProps,children:[this.renderToolbar(e),this.renderSidePanel(t.fen,i,e),this.renderBlockContent(t,r,n)]})}renderToolbar(e){function t({color:t}){return(0,hr.jsx)(Ar.Dropdown,{renderToggle:({isOpen:e,onToggle:i})=>{const r=(0,hr.jsx)("img",{src:qr[t],width:24,height:24});return(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_ADD_PIECES[t],icon:r,onClick:i,"aria-expanded":e})},renderContent:({onClose:i})=>{function r({coloredPiece:t}){const r=(0,hr.jsx)("img",{src:Fr[t],width:24,height:24});return(0,hr.jsx)(Ar.Button,{label:Vr.FEN_EDITOR_LABEL_ADD_PIECE[t],icon:r,onClick:()=>{e("addPiece-"+t),i()}})}return(0,hr.jsxs)("div",{children:[(0,hr.jsx)(r,{coloredPiece:t+"p"}),(0,hr.jsx)(r,{coloredPiece:t+"n"}),(0,hr.jsx)(r,{coloredPiece:t+"b"}),(0,hr.jsx)(r,{coloredPiece:t+"r"}),(0,hr.jsx)(r,{coloredPiece:t+"q"}),(0,hr.jsx)(r,{coloredPiece:t+"k"})]})}})}const i=(0,hr.jsx)("img",{src:Mr,width:24,height:24});return(0,hr.jsxs)(Cr.BlockControls,{children:[(0,hr.jsxs)(Ar.ToolbarGroup,{children:[(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_MOVE_PIECES,icon:Pr,onClick:()=>e("movePieces")}),(0,hr.jsx)(t,{color:"w"}),(0,hr.jsx)(t,{color:"b"}),(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_TOGGLE_TURN,icon:i,onClick:()=>this.handleToggleTurnClicked()})]}),(0,hr.jsx)(Ar.ToolbarGroup,{children:(0,hr.jsx)(Ar.ToolbarButton,{label:Vr.FEN_EDITOR_LABEL_FLIP,icon:kr,onClick:()=>this.handleFlipClicked()})})]})}renderSidePanel(e,t,i){return(0,hr.jsxs)(Cr.InspectorControls,{children:[this.renderPositionAndAnnotationPanel(e,t,i),this.renderChessboardAspectPanel()]})}renderPositionAndAnnotationPanel(e,t,i){function r({iconBuilder:e,interactionModePrefix:t}){function r({color:r}){return(0,hr.jsx)(Ar.Button,{icon:e(r),onClick:()=>i(t+r)})}return(0,hr.jsxs)(Ar.ButtonGroup,{children:[(0,hr.jsx)(r,{color:"b"}),(0,hr.jsx)(r,{color:"g"}),(0,hr.jsx)(r,{color:"r"}),(0,hr.jsx)(r,{color:"y"})]})}function n({value:e,onChange:t}){const i=["plus","times","dot","circle"].concat([..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"]).map((e=>{const t=_r(Vr.FEN_EDITOR_LABEL_TEXT_MARKER,function(e){switch(e){case"plus":return"+";case"times":return"×";case"dot":return"•";case"circle":return"○";default:return e}}(e));return{value:e,label:t}}));return(0,hr.jsx)(Ar.SelectControl,{value:e,options:i,onChange:t})}return(0,hr.jsxs)(Ar.PanelBody,{title:Vr.FEN_EDITOR_PANEL_POSITION,children:[(0,hr.jsxs)(Ar.PanelRow,{children:[(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_RESET_POSITION,label:Vr.FEN_EDITOR_TOOLTIP_RESET_POSITION,onClick:()=>this.handleAttributeChanged("position","start")}),(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_CLEAR_POSITION,label:Vr.FEN_EDITOR_TOOLTIP_CLEAR_POSITION,onClick:()=>this.handleAttributeChanged("position","empty")}),(0,hr.jsx)(Ar.Button,{isSecondary:!0,text:Vr.FEN_EDITOR_LABEL_CLEAR_ANNOTATIONS,label:Vr.FEN_EDITOR_TOOLTIP_CLEAR_ANNOTATIONS,onClick:()=>this.handleClearAnnotationsClicked()})]}),(0,hr.jsx)(Ar.PanelRow,{className:"rpbchessboard-fixMarginBottom rpbchessboard-fixWidth",children:(0,hr.jsx)(Ar.TextControl,{label:Vr.FEN_EDITOR_LABEL_FEN,value:e,onChange:e=>this.handleAttributeChanged("position",e)})}),(0,hr.jsxs)(Ar.PanelRow,{className:"rpbchessboard-editionModeRow",children:[(0,hr.jsx)("span",{children:Vr.FEN_EDITOR_CURRENT_EDITION_MODE}),t]}),(0,hr.jsxs)(Ar.PanelRow,{children:[Vr.FEN_EDITOR_LABEL_SQUARE_MARKER,(0,hr.jsx)(r,{interactionModePrefix:"addSquareMarker-",iconBuilder:e=>(0,hr.jsx)(A,{size:24,color:Br["c"+e]})})]}),(0,hr.jsxs)(Ar.PanelRow,{children:[Vr.FEN_EDITOR_LABEL_ARROW_MARKER,(0,hr.jsx)(r,{interactionModePrefix:"addArrowMarker-",iconBuilder:e=>(0,hr.jsx)(D,{size:24,color:Br["c"+e]})})]}),(0,hr.jsxs)(Ar.PanelRow,{className:"rpbchessboard-fixMarginBottom",children:[(0,hr.jsx)(n,{value:this.state.textMarkerMode,onChange:e=>this.setState({textMarkerMode:e})}),(0,hr.jsx)(r,{interactionModePrefix:"addTextMarker-",iconBuilder:e=>(0,hr.jsx)(O,{size:24,color:Br["c"+e],symbol:this.state.textMarkerMode})})]}),(0,hr.jsx)(Ar.PanelRow,{children:(0,hr.jsx)(Ar.ToggleControl,{className:"rpbchessboard-fixMissingMarginTop",label:Vr.FEN_EDITOR_CONTROL_FLIP,checked:this.props.attributes.flipped,onChange:()=>this.handleFlipClicked()})})]})}renderChessboardAspectPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:Vr.FEN_EDITOR_PANEL_APPEARANCE,initialOpen:!1,children:[(0,hr.jsx)(Ar.RadioControl,{label:Vr.FEN_EDITOR_CONTROL_ALIGNMENT,selected:this.props.attributes.align,onChange:e=>this.handleAttributeChanged("align",e),options:[{label:Vr.FEN_EDITOR_USE_DEFAULT,value:""},{label:Vr.FEN_EDITOR_OPTION_CENTER,value:"center"},{label:Vr.FEN_EDITOR_OPTION_FLOAT_LEFT,value:"floatLeft"},{label:Vr.FEN_EDITOR_OPTION_FLOAT_RIGHT,value:"floatRight"}]}),(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.sdoSquareSize,flipped:this.props.attributes.flipped,squareSize:this.props.attributes.squareSize,coordinateVisible:this.props.attributes.coordinateVisible,turnVisible:this.props.attributes.turnVisible,colorset:this.props.attributes.colorset,pieceset:this.props.attributes.pieceset,onFlipChanged:()=>this.handleFlipClicked(),onSquareSizeChanged:e=>this.handleAttributeChanged("squareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("coordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("turnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("colorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("pieceset",e)})]})}renderBlockContent(e,t,i){return e.valid?(0,hr.jsx)("div",{ref:this.blockContentRef,children:(0,hr.jsx)(vt,{position:e.position,flipped:this.props.attributes.flipped,squareSize:40,interactionMode:t,editedArrowColor:i,squareMarkers:this.props.attributes.squareMarkers,arrowMarkers:this.props.attributes.arrowMarkers,textMarkers:this.props.attributes.textMarkers,coordinateVisible:""===this.props.attributes.coordinateVisible?RPBChessboard.defaultSettings.sdoCoordinateVisible:"true"===this.props.attributes.coordinateVisible,turnVisible:""===this.props.attributes.turnVisible?RPBChessboard.defaultSettings.sdoTurnVisible:"true"===this.props.attributes.turnVisible,colorset:""===this.props.attributes.colorset?RPBChessboard.defaultSettings.sdoColorset:this.props.attributes.colorset,pieceset:""===this.props.attributes.pieceset?RPBChessboard.defaultSettings.sdoPieceset:this.props.attributes.pieceset,onPieceMoved:(e,t)=>this.handlePieceMoved(e,t),onSquareClicked:e=>this.handleSquareClicked(e),onArrowEdited:(e,t)=>this.handleArrowEdited(e,t)})}):(0,hr.jsx)(C,{title:Vr.FEN_PARSING_ERROR_TITLE,message:e.message})}parsePositionAttribute(){try{const e=new o.yX(this.props.attributes.position);return{valid:!0,position:e,fen:e.fen()}}catch(e){if(e instanceof o.exception.InvalidFEN)return{valid:!1,message:e.message,fen:this.props.attributes.position};throw e}}}Ur.propTypes={blockProps:lr().object,attributes:lr().object,setAttributes:lr().func};const jr=window.wp.data,zr=RPBChessboard.i18n,$r=vt.colorsets().original;function Hr(){const e=[];for(let t=0;t<4;++t)for(let i=1-t%2;i<4;i+=2)e.push((0,hr.jsx)("rect",{x:4*t,y:4*i+4,width:4,height:4}));for(let t=0;t<5;++t)e.push((0,hr.jsx)("rect",{x:t<1||t>=4?0:18,y:5*t+1,width:t<1||t>=4?24:6,height:2}));return(0,hr.jsx)("svg",{viewBox:"0 0 24 24",children:e})}const Wr=(0,jr.withSelect)(((e,t)=>{const i=e("core").getMedia(t.attachmentId);return{url:i?i.source_url:void 0}}))((e=>{var t;return(0,hr.jsx)("input",{className:"rpbchessboard-fixMarginBottom rpbchessboard-fixPadding",type:"text",readOnly:!0,value:null!==(t=e.url)&&void 0!==t?t:""})}));class Kr extends r().Component{constructor(e){super(e),this.state={sourceType:this.props.attributes.attachmentId>=0?"url":"inline",localPgn:this.props.attributes.pgn,localAttachementId:this.props.attributes.attachmentId,localGameIndex:this.props.attributes.gameIndex}}handleAttributeChanged(e,t){const i={...this.props.attributes};i[e]=t,this.props.setAttributes(i)}handleInitialSelectionCodeChanged(e){const t="custom"===e?"1w":e;this.props.setAttributes({...this.props.attributes,initialSelection:t})}handlePieceSymbolCodeChanged(e,t){const i="custom"===e?Nr(t):e;this.props.setAttributes({...this.props.attributes,pieceSymbols:i})}handlePieceSymbolChanged(e,t,i){const r={...i};r[e]=t,this.props.setAttributes({...this.props.attributes,pieceSymbols:Nr(r)})}handleFlipClicked(){const e=!this.props.attributes.flipped;this.props.setAttributes({...this.props.attributes,flipped:e})}handleSourceTypeChanged(e){const t={...this.props.attributes};switch(t.pgn="",t.attachmentId=-1,t.gameIndex=0,e){case"inline":t.pgn=this.state.localPgn;break;case"url":t.attachmentId=this.state.localAttachementId,t.gameIndex=this.state.localGameIndex}this.setState({sourceType:e}),this.props.setAttributes(t)}handleInlineSourceChanged(e){this.setState({localPgn:e}),this.handleAttributeChanged("pgn",e)}handleUrlSourceChanged(e){this.setState({localAttachementId:e}),this.handleAttributeChanged("attachmentId",e)}handleGameIndexChanged(e){this.setState({localGameIndex:e}),this.handleAttributeChanged("gameIndex",e)}handleUploadClicked(){this.mediaFrame||(this.mediaFrame=wp.media({title:zr.PGN_EDITOR_MEDIA_FRAME_TITLE,button:{text:zr.PGN_EDITOR_MEDIA_FRAME_BUTTON_LABEL},multiple:!1}),this.mediaFrame.on("select",(()=>{const e=this.mediaFrame.state().get("selection").first().toJSON();this.handleUrlSourceChanged(e.id)}))),this.mediaFrame.open()}render(){return(0,hr.jsxs)("div",{...this.props.blockProps,children:[this.renderSidePanel(),this.renderBlockContent()]})}renderSidePanel(){return(0,hr.jsxs)(Cr.InspectorControls,{children:[this.renderGameOptionPanel(),this.renderPieceSymbolsPanel(),this.renderNavigationBoardPanel(),this.renderDiagramOptionPanel()]})}renderGameOptionPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_GAME_OPTIONS,children:[(0,hr.jsx)(Ar.ToggleControl,{label:zr.PGN_EDITOR_CONTROL_FLIP,checked:this.props.attributes.flipped,onChange:()=>this.handleFlipClicked()}),this.renderInitialSelectionSelector()]})}renderInitialSelectionSelector(){const e=""===this.props.attributes.navigationBoard?RPBChessboard.defaultSettings.navigationBoard:this.props.attributes.navigationBoard;if("none"===e||"frame"===e)return;const t="start"===this.props.attributes.initialSelection||"end"===this.props.attributes.initialSelection?this.props.attributes.initialSelection:"custom",i="custom"===t?(0,hr.jsx)(Ar.TextControl,{value:this.props.attributes.initialSelection,onChange:e=>this.handleAttributeChanged("initialSelection",e),help:zr.PGN_EDITOR_HELP_INITIAL_SELECTION}):void 0;return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_INITIAL_SELECTION,selected:t,onChange:e=>this.handleInitialSelectionCodeChanged(e),options:[{label:zr.PGN_EDITOR_OPTION_START,value:"start"},{label:zr.PGN_EDITOR_OPTION_END,value:"end"},{label:zr.PGN_EDITOR_OPTION_CUSTOM_MOVE,value:"custom"}]}),i]})}renderPieceSymbolsPanel(){const e=[..."KQRBNP"].some((e=>zr.PIECE_SYMBOLS[e]!==e)),{code:t,elements:i,futureElements:r}=this.getPieceSymbols(e),n=[];n.push({label:zr.PGN_EDITOR_USE_DEFAULT,value:""}),n.push({label:zr.PGN_EDITOR_OPTION_NATIVE,value:"native"}),e&&n.push({label:zr.PGN_EDITOR_OPTION_LOCALIZED,value:"localized"}),n.push({label:zr.PGN_EDITOR_OPTION_FIGURINES,value:"figurines"}),n.push({label:zr.PGN_EDITOR_OPTION_CUSTOM,value:"custom"});const o="custom"!==t;return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_PIECE_SYMBOLS,initialOpen:!1,children:[(0,hr.jsx)(Ar.PanelRow,{children:(0,hr.jsx)(Ar.RadioControl,{selected:t,onChange:e=>this.handlePieceSymbolCodeChanged(e,r),options:n})}),(0,hr.jsxs)(Ar.PanelRow,{children:[(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.K,disabled:o,onChange:e=>this.handlePieceSymbolChanged("K",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.Q,disabled:o,onChange:e=>this.handlePieceSymbolChanged("Q",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.R,disabled:o,onChange:e=>this.handlePieceSymbolChanged("R",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.B,disabled:o,onChange:e=>this.handlePieceSymbolChanged("B",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.N,disabled:o,onChange:e=>this.handlePieceSymbolChanged("N",e,r)}),(0,hr.jsx)(Ar.TextControl,{className:"rpbchessboard-pieceSymbolJsField rpbchessboard-fixMarginBottom",value:i.P,disabled:o,onChange:e=>this.handlePieceSymbolChanged("P",e,r)})]})]})}renderNavigationBoardPanel(){return(0,hr.jsxs)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_NAVIGATION_BOARD,initialOpen:!1,children:[(0,hr.jsx)(Ar.RadioControl,{selected:this.props.attributes.navigationBoard,onChange:e=>this.handleAttributeChanged("navigationBoard",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_NONE,value:"none"},{label:zr.PGN_EDITOR_OPTION_FRAME,value:"frame"},{label:zr.PGN_EDITOR_OPTION_ABOVE,value:"above"},{label:zr.PGN_EDITOR_OPTION_BELOW,value:"below"},{label:zr.PGN_EDITOR_OPTION_FLOAT_LEFT,value:"floatLeft"},{label:zr.PGN_EDITOR_OPTION_FLOAT_RIGHT,value:"floatRight"},{label:zr.PGN_EDITOR_OPTION_SCROLL_LEFT,value:"scrollLeft"},{label:zr.PGN_EDITOR_OPTION_SCROLL_RIGHT,value:"scrollRight"}]}),this.renderNavigationBoardOptionFields()]})}renderNavigationBoardOptionFields(){const e=""===this.props.attributes.navigationBoard?RPBChessboard.defaultSettings.navigationBoard:this.props.attributes.navigationBoard;if("none"===e||"frame"===e)return;const t=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_PLAY_BUTTON,selected:this.props.attributes.withPlayButton,onChange:e=>this.handleAttributeChanged("withPlayButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),i=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_FLIP_BUTTON,selected:this.props.attributes.withFlipButton,onChange:e=>this.handleAttributeChanged("withFlipButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),r=(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_DOWNLOAD_BUTTON,selected:this.props.attributes.withDownloadButton,onChange:e=>this.handleAttributeChanged("withDownloadButton",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]});return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.nboSquareSize,squareSize:this.props.attributes.nboSquareSize,coordinateVisible:this.props.attributes.nboCoordinateVisible,turnVisible:this.props.attributes.nboTurnVisible,colorset:this.props.attributes.nboColorset,pieceset:this.props.attributes.nboPieceset,onSquareSizeChanged:e=>this.handleAttributeChanged("nboSquareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("nboCoordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("nboTurnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("nboColorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("nboPieceset",e)}),(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_ANIMATED,selected:this.props.attributes.nboAnimated,onChange:e=>this.handleAttributeChanged("nboAnimated",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_DISABLED,value:"false"},{label:zr.PGN_EDITOR_OPTION_ENABLED,value:"true"}]}),(0,hr.jsx)(Ar.RadioControl,{label:zr.PGN_EDITOR_CONTROL_MOVE_ARROW,selected:this.props.attributes.nboMoveArrowVisible,onChange:e=>this.handleAttributeChanged("nboMoveArrowVisible",e),options:[{label:zr.PGN_EDITOR_USE_DEFAULT,value:""},{label:zr.PGN_EDITOR_OPTION_HIDDEN,value:"false"},{label:zr.PGN_EDITOR_OPTION_VISIBLE,value:"true"}]}),this.renderMoveArrowColorFields(),t,i,r]})}renderMoveArrowColorFields(){if(!(""===this.props.attributes.nboMoveArrowVisible?RPBChessboard.defaultSettings.moveArrowVisible:"true"===this.props.attributes.nboMoveArrowVisible))return;const e=""===this.props.attributes.nboMoveArrowColor,t=(0,hr.jsx)(Ar.ToggleControl,{label:zr.PGN_EDITOR_USE_DEFAULT_MOVE_ARROW_COLOR,checked:e,onChange:()=>this.handleAttributeChanged("nboMoveArrowColor",e?RPBChessboard.defaultSettings.moveArrowColor:"")});if(e)return t;function i({color:e}){return(0,hr.jsx)(Ar.__experimentalRadio,{value:e,children:(0,hr.jsx)(D,{color:$r["c"+e],size:24})})}return(0,hr.jsxs)(hr.Fragment,{children:[t,(0,hr.jsxs)(Ar.__experimentalRadioGroup,{className:"rpbchessboard-restoreMarginBottom",checked:this.props.attributes.nboMoveArrowColor,onChange:e=>this.handleAttributeChanged("nboMoveArrowColor",e),children:[(0,hr.jsx)(i,{color:"b"}),(0,hr.jsx)(i,{color:"g"}),(0,hr.jsx)(i,{color:"r"}),(0,hr.jsx)(i,{color:"y"})]})]})}renderDiagramOptionPanel(){return(0,hr.jsx)(Ar.PanelBody,{title:zr.PGN_EDITOR_PANEL_DIAGRAM_OPTIONS,initialOpen:!1,children:(0,hr.jsx)(Lr,{defaultSquareSize:RPBChessboard.defaultSettings.idoSquareSize,squareSize:this.props.attributes.idoSquareSize,coordinateVisible:this.props.attributes.idoCoordinateVisible,turnVisible:this.props.attributes.idoTurnVisible,colorset:this.props.attributes.idoColorset,pieceset:this.props.attributes.idoPieceset,onSquareSizeChanged:e=>this.handleAttributeChanged("idoSquareSize",e),onCoordinateVisibleChanged:e=>this.handleAttributeChanged("idoCoordinateVisible",e),onTurnVisibleChanged:e=>this.handleAttributeChanged("idoTurnVisible",e),onColorsetChanged:e=>this.handleAttributeChanged("idoColorset",e),onPiecesetChanged:e=>this.handleAttributeChanged("idoPieceset",e)})})}renderBlockContent(){return(0,hr.jsxs)("div",{className:"components-placeholder rpbchessboard-fixPlaceholder",children:[this.renderSourceTypeSelector(),this.renderTextAreaIfSourceIsInline(),this.renderMediaSelectorIfSourceIsURL()]})}renderSourceTypeSelector(){return(0,hr.jsxs)(Ar.__experimentalRadioGroup,{className:"rpbchessboard-pgnSourceTypeSelector",checked:this.state.sourceType,onChange:e=>this.handleSourceTypeChanged(e),children:[(0,hr.jsx)(Ar.__experimentalRadio,{value:"inline",children:"PGN text"}),(0,hr.jsx)(Ar.__experimentalRadio,{value:"url",children:"PGN file"})]})}renderTextAreaIfSourceIsInline(){if("inline"===this.state.sourceType)return(0,hr.jsx)("textarea",{className:"block-editor-plain-text blocks-shortcode__textarea rpbchessboard-fixMarginBottom rpbchessboard-pgnTextarea",value:this.props.attributes.pgn,onChange:e=>this.handleInlineSourceChanged(e.target.value)})}renderMediaSelectorIfSourceIsURL(){if("url"!==this.state.sourceType)return;const e=this.props.attributes.attachmentId;return(0,hr.jsxs)(hr.Fragment,{children:[(0,hr.jsxs)("div",{className:"rpbchessboard-pgnFileSelector",children:[(0,hr.jsx)(Ar.Button,{variant:"primary",text:zr.PGN_EDITOR_UPLOAD_BUTTON_LABEL,onClick:()=>this.handleUploadClicked()}),e>=0?(0,hr.jsx)(Wr,{attachmentId:e}):void 0]}),(0,hr.jsx)(Ar.__experimentalNumberControl,{label:zr.PGN_EDITOR_CONTROL_GAME_INDEX,labelPosition:"side",min:0,value:this.props.attributes.gameIndex,onChange:e=>this.handleGameIndexChanged(Number(e))})]})}getPieceSymbols(e){const t=""===this.props.attributes.pieceSymbols,i=t?RPBChessboard.defaultSettings.pieceSymbols:this.props.attributes.pieceSymbols,r=Ir(i);if(r)return{code:t?"":"custom",elements:r,futureElements:r};if("figurines"===i)return{code:t?"":"figurines",elements:{K:"-",Q:"-",R:"-",B:"-",N:"-",P:"-"},futureElements:{K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"}};if("localized"===i&&e){const e={K:zr.PIECE_SYMBOLS.K,Q:zr.PIECE_SYMBOLS.Q,R:zr.PIECE_SYMBOLS.R,B:zr.PIECE_SYMBOLS.B,N:zr.PIECE_SYMBOLS.N,P:zr.PIECE_SYMBOLS.P};return{code:t?"":"localized",elements:e,futureElements:e}}{const e={K:"K",Q:"Q",R:"R",B:"B",N:"N",P:"P"};return{code:t?"":"native",elements:e,futureElements:e}}}}Kr.propTypes={blockProps:lr().object,attributes:lr().object,setAttributes:lr().func},RPBChessboard.renderAdminFENIcon=function(e){(0,n.H)(e).render((0,hr.jsx)(Gr,{}))},RPBChessboard.renderAdminPGNIcon=function(e){(0,n.H)(e).render((0,hr.jsx)(Hr,{}))},RPBChessboard.renderAdminArrowMarkerIcon=function(e,t){const i=(0,hr.jsx)(D,{...t});(0,n.H)(e).render(i)},RPBChessboard.renderAdminChessboard=function(e,t){const i=(0,hr.jsx)(vt,{...t});(0,n.H)(e).render(i)},RPBChessboard.renderAdminNavigationBoard=function(e,t){const i=t.downloadButtonVisible?[{iconPath:dr,tooltip:RPBChessboard.i18n.PGN_TOOLTIP_DOWNLOAD}]:[],r=(0,hr.jsx)(or,{...t,additionalButtons:i});(0,n.H)(e).render(r)},RPBChessboard.renderFEN=function(e,t){const i=(0,hr.jsx)(vt,{position:t.position,squareMarkers:t.squareMarkers,arrowMarkers:t.arrowMarkers,textMarkers:t.textMarkers,flipped:t.flipped,squareSize:t.squareSize,coordinateVisible:t.coordinateVisible,turnVisible:t.turnVisible,colorset:t.colorset,pieceset:t.pieceset,smallScreenLimits:RPBChessboard.smallScreenLimits});(0,n.H)(document.getElementById(e)).render(i)},RPBChessboard.renderPGN=function(e,t){const i={flipped:t.flipped,squareSize:t.idoSquareSize,coordinateVisible:t.idoCoordinateVisible,turnVisible:t.idoTurnVisible,colorset:t.idoColorset,pieceset:t.idoPieceset,smallScreenLimits:RPBChessboard.smallScreenLimits},r={flipped:t.flipped,squareSize:t.nboSquareSize,coordinateVisible:t.nboCoordinateVisible,turnVisible:t.nboTurnVisible,colorset:t.nboColorset,pieceset:t.nboPieceset,animated:t.nboAnimated,moveArrowVisible:t.nboMoveArrowVisible,moveArrowColor:t.nboMoveArrowColor,smallScreenLimits:RPBChessboard.smallScreenLimits,playButtonVisible:t.withPlayButton,flipButtonVisible:t.withFlipButton,downloadButtonVisible:t.withDownloadButton},o=(0,hr.jsx)(Sr,{url:t.url,pgn:t.pgn,gameIndex:t.gameIndex,initialSelection:t.initialSelection,pieceSymbols:t.pieceSymbols,diagramOptions:i,navigationBoardOptions:r,navigationBoard:t.navigationBoard});(0,n.H)(document.getElementById(e)).render(o)};try{t.INVALID_FEN_ERROR_TITLE=RPBChessboard.i18n.FEN_PARSING_ERROR_TITLE,t.ANNOTATED_BY=RPBChessboard.i18n.PGN_ANNOTATED_BY,t.LINE=RPBChessboard.i18n.PGN_LINE_REF,t.PIECE_SYMBOLS={K:RPBChessboard.i18n.PIECE_SYMBOLS.K,Q:RPBChessboard.i18n.PIECE_SYMBOLS.Q,R:RPBChessboard.i18n.PIECE_SYMBOLS.R,B:RPBChessboard.i18n.PIECE_SYMBOLS.B,N:RPBChessboard.i18n.PIECE_SYMBOLS.N,P:RPBChessboard.i18n.PIECE_SYMBOLS.P},t.TOOLTIP_GO_FIRST=RPBChessboard.i18n.PGN_TOOLTIP_GO_FIRST,t.TOOLTIP_GO_PREVIOUS=RPBChessboard.i18n.PGN_TOOLTIP_GO_PREVIOUS,t.TOOLTIP_GO_NEXT=RPBChessboard.i18n.PGN_TOOLTIP_GO_NEXT,t.TOOLTIP_GO_LAST=RPBChessboard.i18n.PGN_TOOLTIP_GO_LAST,t.TOOLTIP_PLAY_STOP=RPBChessboard.i18n.PGN_TOOLTIP_PLAY_STOP,t.TOOLTIP_FLIP=RPBChessboard.i18n.PGN_TOOLTIP_FLIP,RPBChessboard.availableSquareSize={min:vt.minSquareSize(),max:vt.maxSquareSize()},Object.assign(vt.colorsets(),RPBChessboard.customColorsets),Object.assign(vt.piecesets(),RPBChessboard.customPiecesets),RPBChessboard.colorsetData=vt.colorsets(),RPBChessboard.piecesetData=vt.piecesets(),RPBChessboard.editColorset=vt.colorsets()._edit_={},RPBChessboard.editPieceset=vt.piecesets()._edit_={},(0,yr.registerBlockType)("rpb-chessboard/fen",{apiVersion:2,title:Vr.FEN_EDITOR_TITLE,icon:(0,hr.jsx)(Gr,{}),category:"media",attributes:{position:{type:"string",default:"start"},flipped:{type:"boolean",default:!1},squareMarkers:{type:"object",default:{}},arrowMarkers:{type:"object",default:{}},textMarkers:{type:"object",default:{}},align:{type:"string",default:""},squareSize:{type:"number",default:0},coordinateVisible:{type:"string",default:""},turnVisible:{type:"string",default:""},colorset:{type:"string",default:""},pieceset:{type:"string",default:""}},example:{attributes:{squareSize:32}},edit:({attributes:e,setAttributes:t})=>{const i=(0,Cr.useBlockProps)();return(0,hr.jsx)(Ur,{blockProps:i,attributes:e,setAttributes:t})}}),(0,yr.registerBlockType)("rpb-chessboard/pgn",{apiVersion:2,title:zr.PGN_EDITOR_TITLE,icon:(0,hr.jsx)(Hr,{}),category:"media",attributes:{pgn:{type:"string",default:""},attachmentId:{type:"number",default:-1},gameIndex:{type:"number",default:0},flipped:{type:"boolean",default:!1},initialSelection:{type:"string",default:"start"},pieceSymbols:{type:"string",default:""},navigationBoard:{type:"string",default:""},nboSquareSize:{type:"number",default:0},nboCoordinateVisible:{type:"string",default:""},nboTurnVisible:{type:"string",default:""},nboColorset:{type:"string",default:""},nboPieceset:{type:"string",default:""},nboAnimated:{type:"string",default:""},nboMoveArrowVisible:{type:"string",default:""},nboMoveArrowColor:{type:"string",default:""},idoSquareSize:{type:"number",default:0},idoCoordinateVisible:{type:"string",default:""},idoTurnVisible:{type:"string",default:""},idoColorset:{type:"string",default:""},idoPieceset:{type:"string",default:""},withPlayButton:{type:"string",default:""},withFlipButton:{type:"string",default:""},withDownloadButton:{type:"string",default:""}},edit:({attributes:e,setAttributes:t})=>{const i=(0,Cr.useBlockProps)();return(0,hr.jsx)(Kr,{blockProps:i,attributes:e,setAttributes:t})}})}catch(e){console.error("Error while initializing RPB Chessboard: the plugin may not work properly.",e)}})()})();
  • rpb-chessboard/trunk/readme.txt

    r3215679 r3278128  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHNERW43QN49E
    44Tags: chess, chessboard, fen, pgn, games
    5 Tested up to: 6.7
     5Tested up to: 6.8
    66Stable tag: trunk
    77License: GPLv3
     
    8686== Changelog ==
    8787
     88= 8.0.5 (April 21, 2024) =
     89* Tested up to WordPress 6.8.
     90* Fix drag-drop not working in the diagram editor as of WordPress 6.8.
     91
    8892= 8.0.4 (January 1, 2025) =
    8993* Minor fixes.
  • rpb-chessboard/trunk/rpb-chessboard.php

    r3215679 r3278128  
    3030License: GPLv3
    3131License URI: http://www.gnu.org/licenses/gpl-3.0.html
    32 Requires at least: 6.7
     32Requires at least: 6.8
    3333Requires PHP: 7.2
    34 Version: 8.0.4
     34Version: 8.0.5
    3535*/
    3636
    3737// Plugin version
    3838// WARNING: must corresponds to what is defined in the plugin header. Do NOT use `get_plugin_data(..)` (see #240).
    39 define( 'RPBCHESSBOARD_VERSION', '8.0.4' );
     39define( 'RPBCHESSBOARD_VERSION', '8.0.5' );
    4040
    4141// Directories
Note: See TracChangeset for help on using the changeset viewer.