Pionera en el país de un deporte poco aceptado para equipos femeninos, la ex jugadora de rugby, Mónica Mottura, se dedica actualmente a fomentar y apoyar a mujeres para que rompan el estereotipo y puedan comenzar a practicar deportes de contacto. En esta nota repasa sus inicios y analiza el presente de una actividad en crecimiento.
Hace 35 años, exactamente el 23 de noviembre de 1985, se disputaba el primer partido de rugby femenino en Argentina: en la cancha del club GEI, el equipo local recibía a Alumni, en un partido totalmente amateur. Ese día, las gradas estuvieron llenas. El boca en boca hizo que la noticia llegara a todo el barrio. El paisaje era ideal: familias con mate en mano disfrutando del partido, canciones de aliento y hasta la promesa de volver cada vez que jueguen.
En ese encuentro, Mónica Mottura, ex jugadora de rugby femenino, era capitana de GEI. “Dos meses antes de jugar, habíamos empezado los entrenamientos, éramos alrededor de 18 chicas, todas amigas de las tres hijas del entrenador, Rodolfo ‘Pichi’ Ruffo, quien fue una persona fundamental para que todo esto empezara a tomar forma”, recordó.
En aquel momento, el rugby femenino era algo impensado para las mujeres. Tanto era así que Mottura no dimensionaba en ese primer entrenamiento que su vida iba a dar un giro de 180 grados. “Mi primera sensación del rugby fue hermosa, me enamoré, siempre me gustaron los deportes extremos”, expresó.
Por esos años, Argentina dejaba atrás la dictadura militar y, en ese contexto, salir de los cánones establecidos era un acto revolucionario, sumado a que, según Mottura, se trata de un deporte “machista”: “Al principio, no nos tenían fe. Yo no entendía por qué no podía jugar al rugby siendo mujer. Los hombres nos decían que vayamos a lavar los platos. Después, cuando veían que tacleábamos, hacíamos pases y jugábamos tan bien como ellos, empezaron a seguirnos”.
Su familia fue un apoyo incondicional: aunque al principio hubo ciertas dudas, la deportista se puso firme y terminó convenciendo a sus padres para practicar este deporte. “Mi mamá cuidaba a mis hijos cuando yo participaba en los torneos, fue muy importante para mí esa contención”, destacó.
Un presente ligado a la gestión
Hoy en día, ya retirada, la ex jugadora se desempeña como secretaria en la Subcomisión de Rugby Femenino de la Unión de Rugby de Buenos Aires (URBA). Su objetivo principal es fomentar y desarrollar el femenino, darle posibilidades a las chicas con torneos, brindando todos los servicios y derechos disponibles. “Hoy estoy otorgando todo lo que me hubiese encantado tener cuando jugaba. En aquella época, nadie nos organizaba ni un partido, los organizábamos entre nosotras y coordinábamos con las demás jugadoras. Éramos solo tres equipos en Buenos Aires”, recordó.
La actualidad del rugby femenino es totalmente distinta, según Mottura, aunque reconoce que falta bastante por mejorar. Si bien el rugby femenino está profesionalizado y cuentan con un equipo de Selección Nacional (Las Yaguaretés), sus integrantes sólo reciben un bono económico, el cual, en palabras de la ex rugbier, “es insuficiente”. “Es algo lógico, por un tema de tiempo. Los hombres nacieron con una pelota en la mano y a nosotras nos daban muñecas. Todavía falta más desarrollo, se necesitan más nenas en ligas infantiles que cumplan una trayectoria. Recién ahí se va a equiparar en ambos géneros”, consideró.

Por último, la ex jugadora señaló la importancia de hablar con los padres y madres de las niñas interesadas en este deporte para explicarles su dinámica. “Hay que mostrarles cómo es y cómo funciona, tienen que saber que hay profesionales que van a ayudar a sus hijas para que sean deportistas y entender que el rugby no tiene género”, concluyó.
// JavaScript needs to be enabled to play test1. Final del Mundial. Minuto 75. Vas empatando 1-1. <img src="https://resizer.glanacion.com/resizer/v2/hinchas-argentinos-en-WTYIEHAQOVGB7A3ZU3OE5AVKLU.JPG?auth=ee0fea10163299e8fd8e8bc4d1ab7f04d42b69820e5785cbe260f2a92706a199&width=1280&height=854&quality=70&smart=true" width="100%"> Tenés un cambio más. La hinchada ruge, la presión es total. [[Hacés un cambio ofensivo]] [[Cuidás el resultado]] (function(){«use strict»; var require,define;!function(){var e={},r={};require=function(i){var n=e[i];return n&&(r[i]=n[1].apply(void 0,n[0].map(require)),e[i]=void 0),r[i]},(define=function(r,i,n){if(«function»==typeof r)return r();e[r]=[i,n]}).amd=!0}();/*! * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) * and contributors, MIT License * es6-shim: v0.35.4 * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ (function(e,t){if(typeof define===»function»&&define.amd){define(t)}else if(typeof exports===»object»){module.exports=t()}else{e.returnExports=t()}})(this,function(){«use strict»;var e=Function.call.bind(Function.apply);var t=Function.call.bind(Function.call);var r=Array.isArray;var n=Object.keys;var o=function notThunker(t){return function notThunk(){return!e(t,this,arguments)}};var i=function(e){try{e();return false}catch(t){return true}};var a=function valueOrFalseIfThrows(e){try{return e()}catch(t){return false}};var u=o(i);var f=function(){return!i(function(){return Object.defineProperty({},»x»,{get:function(){}})})};var s=!!Object.defineProperty&&f();var c=function foo(){}.name===»foo»;var l=Function.call.bind(Array.prototype.forEach);var p=Function.call.bind(Array.prototype.reduce);var v=Function.call.bind(Array.prototype.filter);var y=Function.call.bind(Array.prototype.some);var h=function(e,t,r,n){if(!n&&t in e){return}if(s){Object.defineProperty(e,t,{configurable:true,enumerable:false,writable:true,value:r})}else{e[t]=r}};var b=function(e,t,r){l(n(t),function(n){var o=t[n];h(e,n,o,!!r)})};var g=Function.call.bind(Object.prototype.toString);var d=typeof/abc/===»function»?function IsCallableSlow(e){return typeof e===»function»&&g(e)===»[object Function]»}:function IsCallableFast(e){return typeof e===»function»};var m={getter:function(e,t,r){if(!s){throw new TypeError(«getters require true ES5 support»)}Object.defineProperty(e,t,{configurable:true,enumerable:false,get:r})},proxy:function(e,t,r){if(!s){throw new TypeError(«getters require true ES5 support»)}var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,{configurable:n.configurable,enumerable:n.enumerable,get:function getKey(){return e[t]},set:function setKey(r){e[t]=r}})},redefine:function(e,t,r){if(s){var n=Object.getOwnPropertyDescriptor(e,t);n.value=r;Object.defineProperty(e,t,n)}else{e[t]=r}},defineByDescriptor:function(e,t,r){if(s){Object.defineProperty(e,t,r)}else if(«value»in r){e[t]=r.value}},preserveToString:function(e,t){if(t&&d(t.toString)){h(e,»toString»,t.toString.bind(t),true)}}};var O=Object.create||function(e,t){var r=function Prototype(){};r.prototype=e;var o=new r;if(typeof t!==»undefined»){n(t).forEach(function(e){m.defineByDescriptor(o,e,t[e])})}return o};var w=function(e,t){if(!Object.setPrototypeOf){return false}return a(function(){var r=function Subclass(t){var r=new e(t);Object.setPrototypeOf(r,Subclass.prototype);return r};Object.setPrototypeOf(r,e);r.prototype=O(e.prototype,{constructor:{value:r}});return t(r)})};var j=function(){if(typeof self!==»undefined»){return self}if(typeof window!==»undefined»){return window}if(typeof global!==»undefined»){return global}throw new Error(«unable to locate global object»)};var S=j();var T=S.isFinite;var I=Function.call.bind(String.prototype.indexOf);var E=Function.apply.bind(Array.prototype.indexOf);var P=Function.call.bind(Array.prototype.concat);var C=Function.call.bind(String.prototype.slice);var M=Function.call.bind(Array.prototype.push);var x=Function.apply.bind(Array.prototype.push);var N=Function.call.bind(Array.prototype.join);var A=Function.call.bind(Array.prototype.shift);var _=Math.max;var R=Math.min;var k=Math.floor;var L=Math.abs;var F=Math.exp;var D=Math.log;var z=Math.sqrt;var q=Function.call.bind(Object.prototype.hasOwnProperty);var W;var G=function(){};var H=S.Map;var V=H&&H.prototype[«delete»];var B=H&&H.prototype.get;var U=H&&H.prototype.has;var $=H&&H.prototype.set;var J=S.Symbol||{};var X=J.species||»@@species»;var K=Number.isNaN||function isNaN(e){return e!==e};var Z=Number.isFinite||function isFinite(e){return typeof e===»number»&&T(e)};var Y=d(Math.sign)?Math.sign:function sign(e){var t=Number(e);if(t===0){return t}if(K(t)){return t}return t<0?-1:1};var Q=function log1p(e){var t=Number(e);if(t=0&&g(e)!==»[object Array]»&&g(e.callee)===»[object Function]»};var re=ee(arguments)?ee:te;var ne={primitive:function(e){return e===null||typeof e!==»function»&&typeof e!==»object»},string:function(e){return g(e)===»[object String]»},regex:function(e){return g(e)===»[object RegExp]»},symbol:function(e){return typeof S.Symbol===»function»&&typeof e===»symbol»}};var oe=function overrideNative(e,t,r){var n=e[t];h(e,t,r,true);m.preserveToString(e[t],n)};var ie=typeof J===»function»&&typeof J[«for»]===»function»&&ne.symbol(J());var ae=ne.symbol(J.iterator)?J.iterator:»_es6-shim iterator_»;if(S.Set&&typeof(new S.Set)[«@@iterator»]===»function»){ae=»@@iterator»}if(!S.Reflect){h(S,»Reflect»,{},true)}var ue=S.Reflect;var fe=String;var se=typeof document===»undefined»||!document?null:document.all;var ce=se==null?function isNullOrUndefined(e){return e==null}:function isNullOrUndefinedAndNotDocumentAll(e){return e==null&&e!==se};var le={Call:function Call(t,r){var n=arguments.length>2?arguments[2]:[];if(!le.IsCallable(t)){throw new TypeError(t+» is not a function»)}return e(t,r,n)},RequireObjectCoercible:function(e,t){if(ce(e)){throw new TypeError(t||»Cannot call method on «+e)}return e},TypeIsObject:function(e){if(e===void 0||e===null||e===true||e===false){return false}return typeof e===»function»||typeof e===»object»||e===se},ToObject:function(e,t){return Object(le.RequireObjectCoercible(e,t))},IsCallable:d,IsConstructor:function(e){return le.IsCallable(e)},ToInt32:function(e){return le.ToNumber(e)>>0},ToUint32:function(e){return le.ToNumber(e)>>>0},ToNumber:function(e){if(ie&&g(e)===»[object Symbol]»){throw new TypeError(«Cannot convert a Symbol value to a number»)}return+e},ToInteger:function(e){var t=le.ToNumber(e);if(K(t)){return 0}if(t===0||!Z(t)){return t}return(t>0?1:-1)*k(L(t))},ToLength:function(e){var t=le.ToInteger(e);if(tNumber.MAX_SAFE_INTEGER){return Number.MAX_SAFE_INTEGER}return t},SameValue:function(e,t){if(e===t){if(e===0){return 1/e===1/t}return true}return K(e)&&K(t)},SameValueZero:function(e,t){return e===t||K(e)&&K(t)},GetIterator:function(e){if(re(e)){return new W(e,»value»)}var t=le.GetMethod(e,ae);if(!le.IsCallable(t)){throw new TypeError(«value is not an iterable»)}var r=le.Call(t,e);if(!le.TypeIsObject(r)){throw new TypeError(«bad iterator»)}return r},GetMethod:function(e,t){var r=le.ToObject(e)[t];if(ce(r)){return void 0}if(!le.IsCallable(r)){throw new TypeError(«Method not callable: «+t)}return r},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var r=le.GetMethod(e,»return»);if(r===void 0){return}var n,o;try{n=le.Call(r,e)}catch(i){o=i}if(t){return}if(o){throw o}if(!le.TypeIsObject(n)){throw new TypeError(«Iterator’s return method returned a non-object.»)}},IteratorNext:function(e){var t=arguments.length>1?e.next(arguments[1]):e.next();if(!le.TypeIsObject(t)){throw new TypeError(«bad iterator»)}return t},IteratorStep:function(e){var t=le.IteratorNext(e);var r=le.IteratorComplete(t);return r?false:t},Construct:function(e,t,r,n){var o=typeof r===»undefined»?e:r;if(!n&&ue.construct){return ue.construct(e,t,o)}var i=o.prototype;if(!le.TypeIsObject(i)){i=Object.prototype}var a=O(i);var u=le.Call(e,a,t);return le.TypeIsObject(u)?u:a},SpeciesConstructor:function(e,t){var r=e.constructor;if(r===void 0){return t}if(!le.TypeIsObject(r)){throw new TypeError(«Bad constructor»)}var n=r[X];if(ce(n)){return t}if(!le.IsConstructor(n)){throw new TypeError(«Bad @@species»)}return n},CreateHTML:function(e,t,r,n){var o=le.ToString(e);var i=»»;var s=f+o;return s+»»},IsRegExp:function IsRegExp(e){if(!le.TypeIsObject(e)){return false}var t=e[J.match];if(typeof t!==»undefined»){return!!t}return ne.regex(e)},ToString:function ToString(e){if(ie&&g(e)===»[object Symbol]»){throw new TypeError(«Cannot convert a Symbol value to a number»)}return fe(e)}};if(s&&ie){var pe=function defineWellKnownSymbol(e){if(ne.symbol(J[e])){return J[e]}var t=J[«for»](«Symbol.»+e);Object.defineProperty(J,e,{configurable:false,enumerable:false,writable:false,value:t});return t};if(!ne.symbol(J.search)){var ve=pe(«search»);var ye=String.prototype.search;h(RegExp.prototype,ve,function search(e){return le.Call(ye,e,[this])});var he=function search(e){var t=le.RequireObjectCoercible(this);if(!ce(e)){var r=le.GetMethod(e,ve);if(typeof r!==»undefined»){return le.Call(r,e,[t])}}return le.Call(ye,t,[le.ToString(e)])};oe(String.prototype,»search»,he)}if(!ne.symbol(J.replace)){var be=pe(«replace»);var ge=String.prototype.replace;h(RegExp.prototype,be,function replace(e,t){return le.Call(ge,e,[this,t])});var de=function replace(e,t){var r=le.RequireObjectCoercible(this);if(!ce(e)){var n=le.GetMethod(e,be);if(typeof n!==»undefined»){return le.Call(n,e,[r,t])}}return le.Call(ge,r,[le.ToString(e),t])};oe(String.prototype,»replace»,de)}if(!ne.symbol(J.split)){var me=pe(«split»);var Oe=String.prototype.split;h(RegExp.prototype,me,function split(e,t){return le.Call(Oe,e,[this,t])});var we=function split(e,t){var r=le.RequireObjectCoercible(this);if(!ce(e)){var n=le.GetMethod(e,me);if(typeof n!==»undefined»){return le.Call(n,e,[r,t])}}return le.Call(Oe,r,[le.ToString(e),t])};oe(String.prototype,»split»,we)}var je=ne.symbol(J.match);var Se=je&&function(){var e={};e[J.match]=function(){return 42};return»a».match(e)!==42}();if(!je||Se){var Te=pe(«match»);var Ie=String.prototype.match;h(RegExp.prototype,Te,function match(e){return le.Call(Ie,e,[this])});var Ee=function match(e){var t=le.RequireObjectCoercible(this);if(!ce(e)){var r=le.GetMethod(e,Te);if(typeof r!==»undefined»){return le.Call(r,e,[t])}}return le.Call(Ie,t,[le.ToString(e)])};oe(String.prototype,»match»,Ee)}}var Pe=function wrapConstructor(e,t,r){m.preserveToString(t,e);if(Object.setPrototypeOf){Object.setPrototypeOf(e,t)}if(s){l(Object.getOwnPropertyNames(e),function(n){if(n in G||r[n]){return}m.proxy(e,n,t)})}else{l(Object.keys(e),function(n){if(n in G||r[n]){return}t[n]=e[n]})}t.prototype=e.prototype;m.redefine(e.prototype,»constructor»,t)};var Ce=function(){return this};var Me=function(e){if(s&&!q(e,X)){m.getter(e,X,Ce)}};var xe=function(e,t){var r=t||function iterator(){return this};h(e,ae,r);if(!e[ae]&&ne.symbol(ae)){e[ae]=r}};var Ne=function createDataProperty(e,t,r){if(s){Object.defineProperty(e,t,{configurable:true,enumerable:true,writable:true,value:r})}else{e[t]=r}};var Ae=function createDataPropertyOrThrow(e,t,r){Ne(e,t,r);if(!le.SameValue(e[t],r)){throw new TypeError(«property is nonconfigurable»)}};var _e=function(e,t,r,n){if(!le.TypeIsObject(e)){throw new TypeError(«Constructor requires `new`: «+t.name)}var o=t.prototype;if(!le.TypeIsObject(o)){o=r}var i=O(o);for(var a in n){if(q(n,a)){var u=n[a];h(i,a,u,true)}}return i};if(String.fromCodePoint&&String.fromCodePoint.length!==1){var Re=String.fromCodePoint;oe(String,»fromCodePoint»,function fromCodePoint(e){return le.Call(Re,this,arguments)})}var ke={fromCodePoint:function fromCodePoint(e){var t=[];var r;for(var n=0,o=arguments.length;n<o;n++){r=Number(arguments[n]);if(!le.SameValue(r,le.ToInteger(r))||r1114111){throw new RangeError(«Invalid code point «+r)}if(r>10)+55296));M(t,String.fromCharCode(r%1024+56320))}}return N(t,»»)},raw:function raw(e){var t=arguments.length-1;var r=le.ToObject(e,»bad template»);var raw=le.ToObject(r.raw,»bad raw value»);var n=raw.length;var o=le.ToLength(n);if(o<=0){return""}var i=[];var a=0;var u,f,s,c;while(a=o){break}f=a+1<arguments.length?arguments[a+1]:"";c=le.ToString(f);M(i,c);a+=1}return N(i,"")}};if(String.raw&&String.raw({raw:{0:"x",1:"y",length:2}})!=="xy"){oe(String,"raw",ke.raw)}b(String,ke);var Le=function repeat(e,t){if(t<1){return""}if(t%2){return repeat(e,t-1)+e}var r=repeat(e,t/2);return r+r};var Fe=Infinity;var De={repeat:function repeat(e){var t=le.ToString(le.RequireObjectCoercible(this));var r=le.ToInteger(e);if(r=Fe){throw new RangeError(«repeat count must be less than infinity and not overflow maximum string size»)}return Le(t,r)},startsWith:function startsWith(e){var t=le.ToString(le.RequireObjectCoercible(this));if(le.IsRegExp(e)){throw new TypeError(‘Cannot call method «startsWith» with a regex’)}var r=le.ToString(e);var n;if(arguments.length>1){n=arguments[1]}var o=_(le.ToInteger(n),0);return C(t,o,o+r.length)===r},endsWith:function endsWith(e){var t=le.ToString(le.RequireObjectCoercible(this));if(le.IsRegExp(e)){throw new TypeError(‘Cannot call method «endsWith» with a regex’)}var r=le.ToString(e);var n=t.length;var o;if(arguments.length>1){o=arguments[1]}var i=typeof o===»undefined»?n:le.ToInteger(o);var a=R(_(i,0),n);return C(t,a-r.length,a)===r},includes:function includes(e){if(le.IsRegExp(e)){throw new TypeError(‘»includes» does not accept a RegExp’)}var t=le.ToString(e);var r;if(arguments.length>1){r=arguments[1]}return I(this,t,r)!==-1},codePointAt:function codePointAt(e){var t=le.ToString(le.RequireObjectCoercible(this));var r=le.ToInteger(e);var n=t.length;if(r>=0&&r<n){var o=t.charCodeAt(r);var i=r+1===n;if(o56319||i){return o}var a=t.charCodeAt(r+1);if(a57343){return o}return(o-55296)*1024+(a-56320)+65536}}};if(String.prototype.includes&&»a».includes(«a»,Infinity)!==false){oe(String.prototype,»includes»,De.includes)}if(String.prototype.startsWith&&String.prototype.endsWith){var ze=i(function(){return»/a/».startsWith(/a/)});var qe=a(function(){return»abc».startsWith(«a»,Infinity)===false});if(!ze||!qe){oe(String.prototype,»startsWith»,De.startsWith);oe(String.prototype,»endsWith»,De.endsWith)}}if(ie){var We=a(function(){var e=/a/;e[J.match]=false;return»/a/».startsWith(e)});if(!We){oe(String.prototype,»startsWith»,De.startsWith)}var Ge=a(function(){var e=/a/;e[J.match]=false;return»/a/».endsWith(e)});if(!Ge){oe(String.prototype,»endsWith»,De.endsWith)}var He=a(function(){var e=/a/;e[J.match]=false;return»/a/».includes(e)});if(!He){oe(String.prototype,»includes»,De.includes)}}b(String.prototype,De);var Ve=[«\t\n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003″,»\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028″,»\u2029\ufeff»].join(«»);var Be=new RegExp(«(^[«+Ve+»]+)|([«+Ve+»]+$)»,»g»);var Ue=function trim(){return le.ToString(le.RequireObjectCoercible(this)).replace(Be,»»)};var $e=[«\x85″,»\u200b»,»\ufffe»].join(«»);var Je=new RegExp(«[«+$e+»]»,»g»);var Xe=/^[-+]0x[0-9a-f]+$/i;var Ke=$e.trim().length!==$e.length;h(String.prototype,»trim»,Ue,Ke);var Ze=function(e){return{value:e,done:arguments.length===0}};var Ye=function(e){le.RequireObjectCoercible(e);h(this,»_s»,le.ToString(e));h(this,»_i»,0)};Ye.prototype.next=function(){var e=this._s;var t=this._i;if(typeof e===»undefined»||t>=e.length){this._s=void 0;return Ze()}var r=e.charCodeAt(t);var n,o;if(r56319||t+1===e.length){o=1}else{n=e.charCodeAt(t+1);o=n57343?1:2}this._i=t+o;return Ze(e.substr(t,o))};xe(Ye.prototype);xe(String.prototype,function(){return new Ye(this)});var Qe={from:function from(e){var r=this;var n;if(arguments.length>1){n=arguments[1]}var o,i;if(typeof n===»undefined»){o=false}else{if(!le.IsCallable(n)){throw new TypeError(«Array.from: when provided, the second argument must be a function»)}if(arguments.length>2){i=arguments[2]}o=true}var a=typeof(re(e)||le.GetMethod(e,ae))!==»undefined»;var u,f,s;if(a){f=le.IsConstructor(r)?Object(new r):[];var c=le.GetIterator(e);var l,p;s=0;while(true){l=le.IteratorStep(c);if(l===false){break}p=l.value;try{if(o){p=typeof i===»undefined»?n(p,s):t(n,i,p,s)}f[s]=p}catch(v){le.IteratorClose(c,true);throw v}s+=1}u=s}else{var y=le.ToObject(e);u=le.ToLength(y.length);f=le.IsConstructor(r)?Object(new r(u)):new Array(u);var h;for(s=0;s<u;++s){h=y[s];if(o){h=typeof i==="undefined"?n(h,s):t(n,i,h,s)}Ae(f,s,h)}}f.length=u;return f},of:function of(){var e=arguments.length;var t=this;var n=r(t)||!le.IsCallable(t)?new Array(e):le.Construct(t,[e]);for(var o=0;o<e;++o){Ae(n,o,arguments[o])}n.length=e;return n}};b(Array,Qe);Me(Array);W=function(e,t){h(this,"i",0);h(this,"array",e);h(this,"kind",t)};b(W.prototype,{next:function(){var e=this.i;var t=this.array;if(!(this instanceof W)){throw new TypeError("Not an ArrayIterator")}if(typeof t!=="undefined"){var r=le.ToLength(t.length);if(e<r){var n=this.kind;var o;if(n==="key"){o=e}else if(n==="value"){o=t[e]}else if(n==="entry"){o=[e,t[e]]}this.i=e+1;return Ze(o)}}this.array=void 0;return Ze()}});xe(W.prototype);var et=Array.of===Qe.of||function(){var e=function Foo(e){this.length=e};e.prototype=[];var t=Array.of.apply(e,[1,2]);return t instanceof e&&t.length===2}();if(!et){oe(Array,"of",Qe.of)}var tt={copyWithin:function copyWithin(e,t){var r=le.ToObject(this);var n=le.ToLength(r.length);var o=le.ToInteger(e);var i=le.ToInteger(t);var a=o<0?_(n+o,0):R(o,n);var u=i2){f=arguments[2]}var s=typeof f===»undefined»?n:le.ToInteger(f);var c=s<0?_(n+s,0):R(s,n);var l=R(c-u,n-a);var p=1;if(u<a&&a0){if(u in r){r[a]=r[u]}else{delete r[a]}u+=p;a+=p;l-=1}return r},fill:function fill(e){var t;if(arguments.length>1){t=arguments[1]}var r;if(arguments.length>2){r=arguments[2]}var n=le.ToObject(this);var o=le.ToLength(n.length);t=le.ToInteger(typeof t===»undefined»?0:t);r=le.ToInteger(typeof r===»undefined»?o:r);var i=t<0?_(o+t,0):R(t,o);var a=r<0?o+r:r;for(var u=i;u<o&&u1?arguments[1]:null;for(var i=0,a;i1?arguments[1]:null;for(var i=0;i<n;i++){if(o){if(t(e,o,r[i],i,r)){return i}}else if(e(r[i],i,r)){return i}}return-1},keys:function keys(){return new W(this,"key")},values:function values(){return new W(this,"value")},entries:function entries(){return new W(this,"entry")}};if(Array.prototype.keys&&!le.IsCallable([1].keys().next)){delete Array.prototype.keys}if(Array.prototype.entries&&!le.IsCallable([1].entries().next)){delete Array.prototype.entries}if(Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[ae]){b(Array.prototype,{values:Array.prototype[ae]});if(ne.symbol(J.unscopables)){Array.prototype[J.unscopables].values=true}}if(c&&Array.prototype.values&&Array.prototype.values.name!=="values"){var rt=Array.prototype.values;oe(Array.prototype,"values",function values(){return le.Call(rt,this,arguments)});h(Array.prototype,ae,Array.prototype.values,true)}b(Array.prototype,tt);if(1/[true].indexOf(true,-0)<0){h(Array.prototype,"indexOf",function indexOf(e){var t=E(this,arguments);if(t===0&&1/t1&&typeof arguments[1]!==»undefined»){return le.Call(ut,this,arguments)}return t(ut,this,e)})}var ft=-(Math.pow(2,32)-1);var st=function(e,r){var n={length:ft};n[r?(n.length>>>0)-1:0]=true;return a(function(){t(e,n,function(){throw new RangeError(«should not reach here»)},[]);return true})};if(!st(Array.prototype.forEach)){var ct=Array.prototype.forEach;oe(Array.prototype,»forEach»,function forEach(e){return le.Call(ct,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.map)){var lt=Array.prototype.map;oe(Array.prototype,»map»,function map(e){return le.Call(lt,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.filter)){var pt=Array.prototype.filter;oe(Array.prototype,»filter»,function filter(e){return le.Call(pt,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.some)){var vt=Array.prototype.some;oe(Array.prototype,»some»,function some(e){return le.Call(vt,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.every)){var yt=Array.prototype.every;oe(Array.prototype,»every»,function every(e){return le.Call(yt,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.reduce)){var ht=Array.prototype.reduce;oe(Array.prototype,»reduce»,function reduce(e){return le.Call(ht,this.length>=0?this:[],arguments)})}if(!st(Array.prototype.reduceRight,true)){var bt=Array.prototype.reduceRight;oe(Array.prototype,»reduceRight»,function reduceRight(e){return le.Call(bt,this.length>=0?this:[],arguments)})}var gt=Number(«0o10»)!==8;var dt=Number(«0b10″)!==2;var mt=y($e,function(e){return Number(e+0+e)===0});if(gt||dt||mt){var Ot=Number;var wt=/^0b[01]+$/i;var jt=/^0o[0-7]+$/i;var St=wt.test.bind(wt);var Tt=jt.test.bind(jt);var It=function(e,t){var r;if(typeof e.valueOf===»function»){r=e.valueOf();if(ne.primitive(r)){return r}}if(typeof e.toString===»function»){r=e.toString();if(ne.primitive(r)){return r}}throw new TypeError(«No default value»)};var Et=Je.test.bind(Je);var Pt=Xe.test.bind(Xe);var Ct=function(){var e=function Number(t){var r;if(arguments.length>0){r=ne.primitive(t)?t:It(t,»number»)}else{r=0}if(typeof r===»string»){r=le.Call(Ue,r);if(St(r)){r=parseInt(C(r,2),2)}else if(Tt(r)){r=parseInt(C(r,2),8)}else if(Et(r)||Pt(r)){r=NaN}}var n=this;var o=a(function(){Ot.prototype.valueOf.call(n);return true});if(n instanceof e&&!o){return new Ot(r)}return Ot(r)};return e}();Pe(Ot,Ct,{});b(Ct,{NaN:Ot.NaN,MAX_VALUE:Ot.MAX_VALUE,MIN_VALUE:Ot.MIN_VALUE,NEGATIVE_INFINITY:Ot.NEGATIVE_INFINITY,POSITIVE_INFINITY:Ot.POSITIVE_INFINITY});Number=Ct;m.redefine(S,»Number»,Ct)}var Mt=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:Mt,MIN_SAFE_INTEGER:-Mt,EPSILON:2.220446049250313e-16,parseInt:S.parseInt,parseFloat:S.parseFloat,isFinite:Z,isInteger:function isInteger(e){return Z(e)&&le.ToInteger(e)===e},isSafeInteger:function isSafeInteger(e){return Number.isInteger(e)&&L(e)<=Number.MAX_SAFE_INTEGER},isNaN:K});h(Number,"parseInt",S.parseInt,Number.parseInt!==S.parseInt);if([,1].find(function(){return true})===1){oe(Array.prototype,"find",tt.find)}if([,1].findIndex(function(){return true})!==0){oe(Array.prototype,"findIndex",tt.findIndex)}var xt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable);var Nt=function ensureEnumerable(e,t){if(s&&xt(e,t)){Object.defineProperty(e,t,{enumerable:false})}};var At=function sliceArgs(){var e=Number(this);var t=arguments.length;var r=t-e;var n=new Array(r<0?0:r);for(var o=e;o<t;++o){n[o-e]=arguments[o]}return n};var _t=function assignTo(e){return function assignToSource(t,r){t[r]=e[r];return t}};var Rt=function(e,t){var r=n(Object(t));var o;if(le.IsCallable(Object.getOwnPropertySymbols)){o=v(Object.getOwnPropertySymbols(Object(t)),xt(t))}return p(P(r,o||[]),_t(t),e)};var kt={assign:function(e,t){var r=le.ToObject(e,"Cannot convert undefined or null to object");return p(le.Call(At,1,arguments),Rt,r)},is:function is(e,t){return le.SameValue(e,t)}};var Lt=Object.assign&&Object.preventExtensions&&function(){var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return e[1]==="y"}}();if(Lt){oe(Object,"assign",kt.assign)}b(Object,kt);if(s){var Ft={setPrototypeOf:function(e){var r;var n=function(e,t){if(!le.TypeIsObject(e)){throw new TypeError("cannot set prototype on a non-object")}if(!(t===null||le.TypeIsObject(t))){throw new TypeError("can only set prototype to an object or null"+t)}};var o=function(e,o){n(e,o);t(r,e,o);return e};try{r=e.getOwnPropertyDescriptor(e.prototype,"__proto__").set;t(r,{},null)}catch(i){if(e.prototype!=={}.__proto__){return}r=function(e){this.__proto__=e};o.polyfill=o(o({},null),e.prototype)instanceof e}return o}(Object)};b(Object,Ft)}if(Object.setPrototypeOf&&Object.getPrototypeOf&&Object.getPrototypeOf(Object.setPrototypeOf({},null))!==null&&Object.getPrototypeOf(Object.create(null))===null){(function(){var e=Object.create(null);var t=Object.getPrototypeOf;var r=Object.setPrototypeOf;Object.getPrototypeOf=function(r){var n=t(r);return n===e?null:n};Object.setPrototypeOf=function(t,n){var o=n===null?e:n;return r(t,o)};Object.setPrototypeOf.polyfill=false})()}var Dt=!i(function(){return Object.keys("foo")});if(!Dt){var zt=Object.keys;oe(Object,"keys",function keys(e){return zt(le.ToObject(e))});n=Object.keys}var qt=i(function(){return Object.keys(/a/g)});if(qt){var Wt=Object.keys;oe(Object,"keys",function keys(e){if(ne.regex(e)){var t=[];for(var r in e){if(q(e,r)){M(t,r)}}return t}return Wt(e)});n=Object.keys}if(Object.getOwnPropertyNames){var Gt=!i(function(){return Object.getOwnPropertyNames("foo")});if(!Gt){var Ht=typeof window==="object"?Object.getOwnPropertyNames(window):[];var Vt=Object.getOwnPropertyNames;oe(Object,"getOwnPropertyNames",function getOwnPropertyNames(e){var t=le.ToObject(e);if(g(t)==="[object Window]"){try{return Vt(t)}catch(r){return P([],Ht)}}return Vt(t)})}}if(Object.getOwnPropertyDescriptor){var Bt=!i(function(){return Object.getOwnPropertyDescriptor("foo","bar")});if(!Bt){var Ut=Object.getOwnPropertyDescriptor;oe(Object,"getOwnPropertyDescriptor",function getOwnPropertyDescriptor(e,t){return Ut(le.ToObject(e),t)})}}if(Object.seal){var $t=!i(function(){return Object.seal("foo")});if(!$t){var Jt=Object.seal;oe(Object,"seal",function seal(e){if(!le.TypeIsObject(e)){return e}return Jt(e)})}}if(Object.isSealed){var Xt=!i(function(){return Object.isSealed("foo")});if(!Xt){var Kt=Object.isSealed;oe(Object,"isSealed",function isSealed(e){if(!le.TypeIsObject(e)){return true}return Kt(e)})}}if(Object.freeze){var Zt=!i(function(){return Object.freeze("foo")});if(!Zt){var Yt=Object.freeze;oe(Object,"freeze",function freeze(e){if(!le.TypeIsObject(e)){return e}return Yt(e)})}}if(Object.isFrozen){var Qt=!i(function(){return Object.isFrozen("foo")});if(!Qt){var er=Object.isFrozen;oe(Object,"isFrozen",function isFrozen(e){if(!le.TypeIsObject(e)){return true}return er(e)})}}if(Object.preventExtensions){var tr=!i(function(){return Object.preventExtensions("foo")});if(!tr){var rr=Object.preventExtensions;oe(Object,"preventExtensions",function preventExtensions(e){if(!le.TypeIsObject(e)){return e}return rr(e)})}}if(Object.isExtensible){var nr=!i(function(){return Object.isExtensible("foo")});if(!nr){var or=Object.isExtensible;oe(Object,"isExtensible",function isExtensible(e){if(!le.TypeIsObject(e)){return false}return or(e)})}}if(Object.getPrototypeOf){var ir=!i(function(){return Object.getPrototypeOf("foo")});if(!ir){var ar=Object.getPrototypeOf;oe(Object,"getPrototypeOf",function getPrototypeOf(e){return ar(le.ToObject(e))})}}var ur=s&&function(){var e=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags");return e&&le.IsCallable(e.get)}();if(s&&!ur){var fr=function flags(){if(!le.TypeIsObject(this)){throw new TypeError("Method called on incompatible type: must be an object.")}var e="";if(this.global){e+="g"}if(this.ignoreCase){e+="i"}if(this.multiline){e+="m"}if(this.unicode){e+="u"}if(this.sticky){e+="y"}return e};m.getter(RegExp.prototype,"flags",fr)}var sr=s&&a(function(){return String(new RegExp(/a/g,"i"))==="/a/i"});var cr=ie&&s&&function(){var e=/./;e[J.match]=false;return RegExp(e)===e}();var lr=a(function(){return RegExp.prototype.toString.call({source:"abc"})==="/abc/"});var pr=lr&&a(function(){return RegExp.prototype.toString.call({source:"a",flags:"b"})==="/a/b"});if(!lr||!pr){var vr=RegExp.prototype.toString;h(RegExp.prototype,"toString",function toString(){var e=le.RequireObjectCoercible(this);if(ne.regex(e)){return t(vr,e)}var r=fe(e.source);var n=fe(e.flags);return"/"+r+"/"+n},true);m.preserveToString(RegExp.prototype.toString,vr);RegExp.prototype.toString.prototype=void 0}if(s&&(!sr||cr)){var yr=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get;var hr=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{};var br=function(){return this.source};var gr=le.IsCallable(hr.get)?hr.get:br;var dr=RegExp;var mr=function(){return function RegExp(e,t){var r=le.IsRegExp(e);var n=this instanceof RegExp;if(!n&&r&&typeof t==="undefined"&&e.constructor===RegExp){return e}var o=e;var i=t;if(ne.regex(e)){o=le.Call(gr,e);i=typeof t==="undefined"?le.Call(yr,e):t;return new RegExp(o,i)}else if(r){o=e.source;i=typeof t==="undefined"?e.flags:t}return new dr(e,t)}}();Pe(dr,mr,{$input:true});RegExp=mr;m.redefine(S,"RegExp",mr)}if(s){var Or={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};l(n(Or),function(e){if(e in RegExp&&!(Or[e]in RegExp)){m.getter(RegExp,Or[e],function get(){return RegExp[e]})}})}Me(RegExp);var wr=1/Number.EPSILON;var jr=function roundTiesToEven(e){return e+wr-wr};var Sr=Math.pow(2,-23);var Tr=Math.pow(2,127)*(2-Sr);var Ir=Math.pow(2,-126);var Er=Math.E;var Pr=Math.LOG2E;var Cr=Math.LOG10E;var Mr=Number.prototype.clz;delete Number.prototype.clz;var xr={acosh:function acosh(e){var t=Number(e);if(K(t)||e<1){return NaN}if(t===1){return 0}if(t===Infinity){return t}var r=1/(t*t);if(t<2){return Q(t-1+z(1-r)*t)}var n=t/2;return Q(n+z(1-r)*n-1)+1/Pr},asinh:function asinh(e){var t=Number(e);if(t===0||!T(t)){return t}var r=L(t);var n=r*r;var o=Y(t);if(r<1){return o*Q(r+n/(z(n+1)+1))}return o*(Q(r/2+z(1+1/n)*r/2-1)+1/Pr)},atanh:function atanh(e){var t=Number(e);if(t===0){return t}if(t===-1){return-Infinity}if(t===1){return Infinity}if(K(t)||t1){return NaN}var r=L(t);return Y(t)*Q(2*r/(1-r))/2},cbrt:function cbrt(e){var t=Number(e);if(t===0){return t}var r=t.5){return F(t)-1}var r=t;var n=0;var o=1;while(n+r!==n){n+=r;o+=1;r*=t/o}return n},hypot:function hypot(e,t){var r=0;var n=0;for(var o=0;o<arguments.length;++o){var i=L(Number(arguments[o]));if(n0?i/n*(i/n):i}}return n===Infinity?Infinity:n*z(r)},log2:function log2(e){return D(e)*Pr},log10:function log10(e){return D(e)*Cr},log1p:Q,sign:Y,sinh:function sinh(e){var t=Number(e);if(!T(t)||t===0){return t}var r=L(t);if(r=20){return 1}if(t<=-20){return-1}return(Math.expm1(t)-Math.expm1(-t))/(F(t)+F(-t))},trunc:function trunc(e){var t=Number(e);return t>>16&65535;var i=r&65535;var a=n>>>16&65535;var u=n&65535;return i*u+(o*u+i*a<>>0)|0},fround:function fround(e){var t=Number(e);if(t===0||t===Infinity||t===-Infinity||K(t)){return t}var r=Y(t);var n=L(t);if(nTr||K(i)){return r*Infinity}return r*i}};var Nr=function withinULPDistance(e,t,r){return L(1-e/t)/Number.EPSILON22025.465794806718||Ar<22025.465794806718);h(Math,"hypot",xr.hypot,Math.hypot(Infinity,NaN)!==Infinity);var _r=Math.round;var Rr=Math.round(.5-Number.EPSILON/4)===0&&Math.round(-.5+Number.EPSILON/3.99)===1;var kr=wr+1;var Lr=2*wr-1;var Fr=[kr,Lr].every(function(e){return Math.round(e)===e});h(Math,"round",function round(e){var t=k(e);var r=t===-1?-0:t+1;return e-t0){h(r.fulfillReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o0){h(r.rejectReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o2&&arguments[2]===y;if(b&&o===E){i=y}else{i=new r(o)}var g=le.IsCallable(e)?e:a;var d=le.IsCallable(t)?t:u;var m=n._promise;var O;if(m.state===f){if(m.reactionLength===0){m.fulfillReactionHandler0=g;m.rejectReactionHandler0=d;m.reactionCapability0=i}else{var w=3*(m.reactionLength-1);m[w+l]=g;m[w+p]=d;m[w+v]=i}m.reactionLength+=1}else if(m.state===s){O=m.result;h(g,i,O)}else if(m.state===c){O=m.result;h(d,i,O)}else{throw new TypeError(«unexpected Promise state»)}return i.promise}});y=new r(E);I=T.then;return E}();if(S.Promise){delete S.Promise.accept;delete S.Promise.defer;delete S.Promise.prototype.chain}if(typeof zr===»function»){b(S,{Promise:zr});var qr=w(S.Promise,function(e){return e.resolve(42).then(function(){})instanceof e});var Wr=!i(function(){return S.Promise.reject(42).then(null,5).then(null,G)});var Gr=i(function(){return S.Promise.call(3,G)});var Hr=function(e){var t=e.resolve(5);t.constructor={};var r=e.resolve(t);try{r.then(null,G).then(null,G)}catch(n){return true}return t===r}(S.Promise);var Vr=s&&function(){var e=0;var t=Object.defineProperty({},»then»,{get:function(){e+=1}});Promise.resolve(t);return e===1}();var Br=function BadResolverPromise(e){var t=new Promise(e);e(3,function(){});this.then=t.then;this.constructor=BadResolverPromise};Br.prototype=Promise.prototype;Br.all=Promise.all;var Ur=a(function(){return!!Br.all([1,2])});if(!qr||!Wr||!Gr||Hr||!Vr||Ur){Promise=zr;oe(S,»Promise»,zr)}if(Promise.all.length!==1){var $r=Promise.all;oe(Promise,»all»,function all(e){return le.Call($r,this,arguments)})}if(Promise.race.length!==1){var Jr=Promise.race;oe(Promise,»race»,function race(e){return le.Call(Jr,this,arguments)})}if(Promise.resolve.length!==1){var Xr=Promise.resolve;oe(Promise,»resolve»,function resolve(e){return le.Call(Xr,this,arguments)})}if(Promise.reject.length!==1){var Kr=Promise.reject;oe(Promise,»reject»,function reject(e){return le.Call(Kr,this,arguments)})}Nt(Promise,»all»);Nt(Promise,»race»);Nt(Promise,»resolve»);Nt(Promise,»reject»);Me(Promise)}var Zr=function(e){var t=n(p(e,function(e,t){e[t]=true;return e},{}));return e.join(«:»)===t.join(«:»)};var Yr=Zr([«z»,»a»,»bb»]);var Qr=Zr([«z»,1,»a»,»3″,2]);if(s){var en=function fastkey(e,t){if(!t&&!Yr){return null}if(ce(e)){return»^»+le.ToString(e)}else if(typeof e===»string»){return»$»+e}else if(typeof e===»number»){if(!Qr){return»n»+e}return e}else if(typeof e===»boolean»){return»b»+e}return null};var tn=function emptyObject(){return Object.create?Object.create(null):{}};var rn=function addIterableToMap(e,n,o){if(r(o)||ne.string(o)){l(o,function(e){if(!le.TypeIsObject(e)){throw new TypeError(«Iterator value «+e+» is not an entry object»)}n.set(e[0],e[1])})}else if(o instanceof e){t(e.prototype.forEach,o,function(e,t){n.set(t,e)})}else{var i,a;if(!ce(o)){a=n.set;if(!le.IsCallable(a)){throw new TypeError(«bad map»)}i=le.GetIterator(o)}if(typeof i!==»undefined»){while(true){var u=le.IteratorStep(i);if(u===false){break}var f=u.value;try{if(!le.TypeIsObject(f)){throw new TypeError(«Iterator value «+f+» is not an entry object»)}t(a,n,f[0],f[1])}catch(s){le.IteratorClose(i,true);throw s}}}}};var nn=function addIterableToSet(e,n,o){if(r(o)||ne.string(o)){l(o,function(e){n.add(e)})}else if(o instanceof e){t(e.prototype.forEach,o,function(e){n.add(e)})}else{var i,a;if(!ce(o)){a=n.add;if(!le.IsCallable(a)){throw new TypeError(«bad set»)}i=le.GetIterator(o)}if(typeof i!==»undefined»){while(true){var u=le.IteratorStep(i);if(u===false){break}var f=u.value;try{t(a,n,f)}catch(s){le.IteratorClose(i,true);throw s}}}}};var on={Map:function(){var e={};var r=function MapEntry(e,t){this.key=e;this.value=t;this.next=null;this.prev=null};r.prototype.isRemoved=function isRemoved(){return this.key===e};var n=function isMap(e){return!!e._es6map};var o=function requireMapSlot(e,t){if(!le.TypeIsObject(e)||!n(e)){throw new TypeError(«Method Map.prototype.»+t+» called on incompatible receiver «+le.ToString(e))}};var i=function MapIterator(e,t){o(e,»[[MapIterator]]»);h(this,»head»,e._head);h(this,»i»,this.head);h(this,»kind»,t)};i.prototype={isMapIterator:true,next:function next(){if(!this.isMapIterator){throw new TypeError(«Not a MapIterator»)}var e=this.i;var t=this.kind;var r=this.head;if(typeof this.i===»undefined»){return Ze()}while(e.isRemoved()&&e!==r){e=e.prev}var n;while(e.next!==r){e=e.next;if(!e.isRemoved()){if(t===»key»){n=e.key}else if(t===»value»){n=e.value}else{n=[e.key,e.value]}this.i=e;return Ze(n)}}this.i=void 0;return Ze()}};xe(i.prototype);var a;var u=function Map(){if(!(this instanceof Map)){throw new TypeError(‘Constructor Map requires «new»‘)}if(this&&this._es6map){throw new TypeError(«Bad construction»)}var e=_e(this,Map,a,{_es6map:true,_head:null,_map:H?new H:null,_size:0,_storage:tn()});var t=new r(null,null);t.next=t.prev=t;e._head=t;if(arguments.length>0){rn(Map,e,arguments[0])}return e};a=u.prototype;m.getter(a,»size»,function(){if(typeof this._size===»undefined»){throw new TypeError(«size method called on incompatible Map»)}return this._size});b(a,{get:function get(e){o(this,»get»);var t;var r=en(e,true);if(r!==null){t=this._storage[r];if(t){return t.value}return}if(this._map){t=B.call(this._map,e);if(t){return t.value}return}var n=this._head;var i=n;while((i=i.next)!==n){if(le.SameValueZero(i.key,e)){return i.value}}},has:function has(e){o(this,»has»);var t=en(e,true);if(t!==null){return typeof this._storage[t]!==»undefined»}if(this._map){return U.call(this._map,e)}var r=this._head;var n=r;while((n=n.next)!==r){if(le.SameValueZero(n.key,e)){return true}}return false},set:function set(e,t){o(this,»set»);var n=this._head;var i=n;var a;var u=en(e,true);if(u!==null){if(typeof this._storage[u]!==»undefined»){this._storage[u].value=t;return this}a=this._storage[u]=new r(e,t);i=n.prev}else if(this._map){if(U.call(this._map,e)){B.call(this._map,e).value=t}else{a=new r(e,t);$.call(this._map,e,a);i=n.prev}}while((i=i.next)!==n){if(le.SameValueZero(i.key,e)){i.value=t;return this}}a=a||new r(e,t);if(le.SameValue(-0,e)){a.key=+0}a.next=this._head;a.prev=this._head.prev;a.prev.next=a;a.next.prev=a;this._size+=1;return this},»delete»:function(t){o(this,»delete»);var r=this._head;var n=r;var i=en(t,true);if(i!==null){if(typeof this._storage[i]===»undefined»){return false}n=this._storage[i].prev;delete this._storage[i]}else if(this._map){if(!U.call(this._map,t)){return false}n=B.call(this._map,t).prev;V.call(this._map,t)}while((n=n.next)!==r){if(le.SameValueZero(n.key,t)){n.key=e;n.value=e;n.prev.next=n.next;n.next.prev=n.prev;this._size-=1;return true}}return false},clear:function clear(){o(this,»clear»);this._map=H?new H:null;this._size=0;this._storage=tn();var t=this._head;var r=t;var n=r.next;while((r=n)!==t){r.key=e;r.value=e;n=r.next;r.next=r.prev=t}t.next=t.prev=t},keys:function keys(){o(this,»keys»);return new i(this,»key»)},values:function values(){o(this,»values»);return new i(this,»value»)},entries:function entries(){o(this,»entries»);return new i(this,»key+value»)},forEach:function forEach(e){o(this,»forEach»);var r=arguments.length>1?arguments[1]:null;var n=this.entries();for(var i=n.next();!i.done;i=n.next()){if(r){t(e,r,i.value[1],i.value[0],this)}else{e(i.value[1],i.value[0],this)}}}});xe(a,a.entries);return u}(),Set:function(){var e=function isSet(e){return e._es6set&&typeof e._storage!==»undefined»};var r=function requireSetSlot(t,r){if(!le.TypeIsObject(t)||!e(t)){throw new TypeError(«Set.prototype.»+r+» called on incompatible receiver «+le.ToString(t))}};var o;var i=function Set(){if(!(this instanceof Set)){throw new TypeError(‘Constructor Set requires «new»‘)}if(this&&this._es6set){throw new TypeError(«Bad construction»)}var e=_e(this,Set,o,{_es6set:true,»[[SetData]]»:null,_storage:tn()});if(!e._es6set){throw new TypeError(«bad set»)}if(arguments.length>0){nn(Set,e,arguments[0])}return e};o=i.prototype;var a=function(e){var t=e;if(t===»^null»){return null}else if(t===»^undefined»){return void 0}var r=t.charAt(0);if(r===»$»){return C(t,1)}else if(r===»n»){return+C(t,1)}else if(r===»b»){return t===»btrue»}return+t};var u=function ensureMap(e){if(!e[«[[SetData]]»]){var t=new on.Map;e[«[[SetData]]»]=t;l(n(e._storage),function(e){var r=a(e);t.set(r,r)});e[«[[SetData]]»]=t}e._storage=null};m.getter(i.prototype,»size»,function(){r(this,»size»);if(this._storage){return n(this._storage).length}u(this);return this[«[[SetData]]»].size});b(i.prototype,{has:function has(e){r(this,»has»);var t;if(this._storage&&(t=en(e))!==null){return!!this._storage[t]}u(this);return this[«[[SetData]]»].has(e)},add:function add(e){r(this,»add»);var t;if(this._storage&&(t=en(e))!==null){this._storage[t]=true;return this}u(this);this[«[[SetData]]»].set(e,e);return this},»delete»:function(e){r(this,»delete»);var t;if(this._storage&&(t=en(e))!==null){var n=q(this._storage,t);return delete this._storage[t]&&n}u(this);return this[«[[SetData]]»][«delete»](e)},clear:function clear(){r(this,»clear»);if(this._storage){this._storage=tn()}if(this[«[[SetData]]»]){this[«[[SetData]]»].clear()}},values:function values(){r(this,»values»);u(this);return new f(this[«[[SetData]]»].values())},entries:function entries(){r(this,»entries»);u(this);return new f(this[«[[SetData]]»].entries())},forEach:function forEach(e){r(this,»forEach»);var n=arguments.length>1?arguments[1]:null;var o=this;u(o);this[«[[SetData]]»].forEach(function(r,i){if(n){t(e,n,i,i,o)}else{e(i,i,o)}})}});h(i.prototype,»keys»,i.prototype.values,true);xe(i.prototype,i.prototype.values);var f=function SetIterator(e){h(this,»it»,e)};f.prototype={isSetIterator:true,next:function next(){if(!this.isSetIterator){throw new TypeError(«Not a SetIterator»)}return this.it.next()}};xe(f.prototype);return i}()};var an=S.Set&&!Set.prototype[«delete»]&&Set.prototype.remove&&Set.prototype.items&&Set.prototype.map&&Array.isArray((new Set).keys);if(an){S.Set=on.Set}if(S.Map||S.Set){var un=a(function(){return new Map([[1,2]]).get(1)===2});if(!un){S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError(‘Constructor Map requires «new»‘)}var e=new H;if(arguments.length>0){rn(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,S.Map.prototype);return e};S.Map.prototype=O(H.prototype);h(S.Map.prototype,»constructor»,S.Map,true);m.preserveToString(S.Map,H)}var fn=new Map;var sn=function(){var e=new Map([[1,0],[2,0],[3,0],[4,0]]);e.set(-0,e);return e.get(0)===e&&e.get(-0)===e&&e.has(0)&&e.has(-0)}();var cn=fn.set(1,2)===fn;if(!sn||!cn){oe(Map.prototype,»set»,function set(e,r){t($,this,e===0?0:e,r);return this})}if(!sn){b(Map.prototype,{get:function get(e){return t(B,this,e===0?0:e)},has:function has(e){return t(U,this,e===0?0:e)}},true);m.preserveToString(Map.prototype.get,B);m.preserveToString(Map.prototype.has,U)}var ln=new Set;var pn=Set.prototype[«delete»]&&Set.prototype.add&&Set.prototype.has&&function(e){e[«delete»](0);e.add(-0);return!e.has(0)}(ln);var vn=ln.add(1)===ln;if(!pn||!vn){var yn=Set.prototype.add;Set.prototype.add=function add(e){t(yn,this,e===0?0:e);return this};m.preserveToString(Set.prototype.add,yn)}if(!pn){var hn=Set.prototype.has;Set.prototype.has=function has(e){return t(hn,this,e===0?0:e)};m.preserveToString(Set.prototype.has,hn);var bn=Set.prototype[«delete»];Set.prototype[«delete»]=function SetDelete(e){return t(bn,this,e===0?0:e)};m.preserveToString(Set.prototype[«delete»],bn)}var gn=w(S.Map,function(e){var t=new e([]);t.set(42,42);return t instanceof e});var dn=Object.setPrototypeOf&&!gn;var mn=function(){try{return!(S.Map()instanceof S.Map)}catch(e){return e instanceof TypeError}}();if(S.Map.length!==0||dn||!mn){S.Map=function Map(){if(!(this instanceof Map)){throw new TypeError(‘Constructor Map requires «new»‘)}var e=new H;if(arguments.length>0){rn(Map,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Map.prototype);return e};S.Map.prototype=H.prototype;h(S.Map.prototype,»constructor»,S.Map,true);m.preserveToString(S.Map,H)}var On=w(S.Set,function(e){var t=new e([]);t.add(42,42);return t instanceof e});var wn=Object.setPrototypeOf&&!On;var jn=function(){try{return!(S.Set()instanceof S.Set)}catch(e){return e instanceof TypeError}}();if(S.Set.length!==0||wn||!jn){var Sn=S.Set;S.Set=function Set(){if(!(this instanceof Set)){throw new TypeError(‘Constructor Set requires «new»‘)}var e=new Sn;if(arguments.length>0){nn(Set,e,arguments[0])}delete e.constructor;Object.setPrototypeOf(e,Set.prototype);return e};S.Set.prototype=Sn.prototype;h(S.Set.prototype,»constructor»,S.Set,true);m.preserveToString(S.Set,Sn)}var Tn=new S.Map;var In=!a(function(){return Tn.keys().next().done});if(typeof S.Map.prototype.clear!==»function»||(new S.Set).size!==0||Tn.size!==0||typeof S.Map.prototype.keys!==»function»||typeof S.Set.prototype.keys!==»function»||typeof S.Map.prototype.forEach!==»function»||typeof S.Set.prototype.forEach!==»function»||u(S.Map)||u(S.Set)||typeof Tn.keys().next!==»function»||In||!gn){b(S,{Map:on.Map,Set:on.Set},true)}if(S.Set.prototype.keys!==S.Set.prototype.values){h(S.Set.prototype,»keys»,S.Set.prototype.values,true)}xe(Object.getPrototypeOf((new S.Map).keys()));xe(Object.getPrototypeOf((new S.Set).keys()));if(c&&S.Set.prototype.has.name!==»has»){var En=S.Set.prototype.has;oe(S.Set.prototype,»has»,function has(e){return t(En,this,e)})}}b(S,on);Me(S.Map);Me(S.Set)}var Pn=function throwUnlessTargetIsObject(e){if(!le.TypeIsObject(e)){throw new TypeError(«target must be an object»)}};var Cn={apply:function apply(){return le.Call(le.Call,null,arguments)},construct:function construct(e,t){if(!le.IsConstructor(e)){throw new TypeError(«First argument must be a constructor.»)}var r=arguments.length>2?arguments[2]:e;if(!le.IsConstructor(r)){throw new TypeError(«new.target must be a constructor.»)}return le.Construct(e,t,r,»internal»)},deleteProperty:function deleteProperty(e,t){Pn(e);if(s){var r=Object.getOwnPropertyDescriptor(e,t);if(r&&!r.configurable){return false}}return delete e[t]},has:function has(e,t){Pn(e);return t in e}};if(Object.getOwnPropertyNames){Object.assign(Cn,{ownKeys:function ownKeys(e){Pn(e);var t=Object.getOwnPropertyNames(e);if(le.IsCallable(Object.getOwnPropertySymbols)){x(t,Object.getOwnPropertySymbols(e))}return t}})}var Mn=function ConvertExceptionToBoolean(e){return!i(e)};if(Object.preventExtensions){Object.assign(Cn,{isExtensible:function isExtensible(e){Pn(e);return Object.isExtensible(e)},preventExtensions:function preventExtensions(e){Pn(e);return Mn(function(){return Object.preventExtensions(e)})}})}if(s){var xn=function get(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(!n){var o=Object.getPrototypeOf(e);if(o===null){return void 0}return xn(o,t,r)}if(«value»in n){return n.value}if(n.get){return le.Call(n.get,r)}return void 0};var Nn=function set(e,r,n,o){var i=Object.getOwnPropertyDescriptor(e,r);if(!i){var a=Object.getPrototypeOf(e);if(a!==null){return Nn(a,r,n,o)}i={value:void 0,writable:true,enumerable:true,configurable:true}}if(«value»in i){if(!i.writable){return false}if(!le.TypeIsObject(o)){return false}var u=Object.getOwnPropertyDescriptor(o,r);if(u){return ue.defineProperty(o,r,{value:n})}return ue.defineProperty(o,r,{value:n,writable:true,enumerable:true,configurable:true})}if(i.set){t(i.set,o,n);return true}return false};Object.assign(Cn,{defineProperty:function defineProperty(e,t,r){Pn(e);return Mn(function(){return Object.defineProperty(e,t,r)})},getOwnPropertyDescriptor:function getOwnPropertyDescriptor(e,t){Pn(e);return Object.getOwnPropertyDescriptor(e,t)},get:function get(e,t){Pn(e);var r=arguments.length>2?arguments[2]:e;return xn(e,t,r)},set:function set(e,t,r){Pn(e);var n=arguments.length>3?arguments[3]:e;return Nn(e,t,r,n)}})}if(Object.getPrototypeOf){var An=Object.getPrototypeOf;Cn.getPrototypeOf=function getPrototypeOf(e){Pn(e);return An(e)}}if(Object.setPrototypeOf&&Cn.getPrototypeOf){var _n=function(e,t){var r=t;while(r){if(e===r){return true}r=Cn.getPrototypeOf(r)}return false};Object.assign(Cn,{setPrototypeOf:function setPrototypeOf(e,t){Pn(e);if(t!==null&&!le.TypeIsObject(t)){throw new TypeError(«proto must be an object or null»)}if(t===ue.getPrototypeOf(e)){return true}if(ue.isExtensible&&!ue.isExtensible(e)){return false}if(_n(e,t)){return false}Object.setPrototypeOf(e,t);return true}})}var Rn=function(e,t){if(!le.IsCallable(S.Reflect[e])){h(S.Reflect,e,t)}else{var r=a(function(){S.Reflect[e](1);S.Reflect[e](NaN);S.Reflect[e](true);return true});if(r){oe(S.Reflect,e,t)}}};Object.keys(Cn).forEach(function(e){Rn(e,Cn[e])});var kn=S.Reflect.getPrototypeOf;if(c&&kn&&kn.name!==»getPrototypeOf»){oe(S.Reflect,»getPrototypeOf»,function getPrototypeOf(e){return t(kn,S.Reflect,e)})}if(S.Reflect.setPrototypeOf){if(a(function(){S.Reflect.setPrototypeOf(1,{});return true})){oe(S.Reflect,»setPrototypeOf»,Cn.setPrototypeOf)}}if(S.Reflect.defineProperty){if(!a(function(){var e=!S.Reflect.defineProperty(1,»test»,{value:1});var t=typeof Object.preventExtensions!==»function»||!S.Reflect.defineProperty(Object.preventExtensions({}),»test»,{});return e&&t})){oe(S.Reflect,»defineProperty»,Cn.defineProperty)}}if(S.Reflect.construct){if(!a(function(){var e=function F(){};return S.Reflect.construct(function(){},[],e)instanceof e})){oe(S.Reflect,»construct»,Cn.construct)}}if(String(new Date(NaN))!==»Invalid Date»){var Ln=Date.prototype.toString;var Fn=function toString(){var e=+this;if(e!==e){return»Invalid Date»}return le.Call(Ln,this)};oe(Date.prototype,»toString»,Fn)}var Dn={anchor:function anchor(e){return le.CreateHTML(this,»a»,»name»,e)},big:function big(){return le.CreateHTML(this,»big»,»»,»»)},blink:function blink(){return le.CreateHTML(this,»blink»,»»,»»)},bold:function bold(){return le.CreateHTML(this,»b»,»»,»»)},fixed:function fixed(){return le.CreateHTML(this,»tt»,»»,»»)},fontcolor:function fontcolor(e){return le.CreateHTML(this,»font»,»color»,e)},fontsize:function fontsize(e){return le.CreateHTML(this,»font»,»size»,e)},italics:function italics(){return le.CreateHTML(this,»i»,»»,»»)},link:function link(e){return le.CreateHTML(this,»a»,»href»,e)},small:function small(){return le.CreateHTML(this,»small»,»»,»»)},strike:function strike(){return le.CreateHTML(this,»strike»,»»,»»)},sub:function sub(){return le.CreateHTML(this,»sub»,»»,»»)},sup:function sub(){return le.CreateHTML(this,»sup»,»»,»»)}};l(Object.keys(Dn),function(e){var r=String.prototype[e];var n=false;if(le.IsCallable(r)){var o=t(r,»»,’ » ‘);var i=P([],o.match(/»/g)).length;n=o!==o.toLowerCase()||i>2}else{n=true}if(n){oe(String.prototype,e,Dn[e])}});var zn=function(){if(!ie){return false}var e=typeof JSON===»object»&&typeof JSON.stringify===»function»?JSON.stringify:null;if(!e){return false}if(typeof e(J())!==»undefined»){return true}if(e([J()])!==»[null]»){return true}var t={a:J()};t[J()]=true;if(e(t)!==»{}»){return true}return false}();var qn=a(function(){if(!ie){return true}return JSON.stringify(Object(J()))===»{}»&&JSON.stringify([Object(J())])===»[{}]»});if(zn||!qn){var Wn=JSON.stringify;oe(JSON,»stringify»,function stringify(e){if(typeof e===»symbol»){return}var n;if(arguments.length>1){n=arguments[1]}var o=[e];if(!r(n)){var i=le.IsCallable(n)?n:null;var a=function(e,r){var n=i?t(i,this,e,r):r;if(typeof n!==»symbol»){if(ne.symbol(n)){return _t({})(n)}return n}};o.push(a)}else{o.push(n)}if(arguments.length>2){o.push(arguments[2])}return Wn.apply(this,o)})}return S}); //# sourceMappingURL=es6-shim.map /*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){«use strict»;»object»==typeof module&&»object»==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(«jQuery requires a window with a document»);return t(e)}:t(e)}(«undefined»!=typeof window?window:this,function(ie,e){«use strict»;var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return»function»==typeof e&&»number»!=typeof e.nodeType&&»function»!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement(«script»);if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+»»:»object»==typeof e||»function»==typeof e?n[i.call(e)]||»object»:typeof e}var t=»3.7.1″,l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&»length»in e&&e.length,n=x(e);return!v(e)&&!y(e)&&(«array»===n||0===t||»number»==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s–);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o+~]|»+ge+»)»+ge+»*»),x=new RegExp(ge+»|>»),j=new RegExp(g),A=new RegExp(«^»+t+»$»),D={ID:new RegExp(«^#(«+t+»)»),CLASS:new RegExp(«^\\.(«+t+»)»),TAG:new RegExp(«^(«+t+»|[*])»),ATTR:new RegExp(«^»+p),PSEUDO:new RegExp(«^»+g),CHILD:new RegExp(«^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(«+ge+»*(even|odd|(([+-]|)(\\d*)n|)»+ge+»*(?:([+-]|)»+ge+»*(\\d+)|))»+ge+»*\\)|)»,»i»),bool:new RegExp(«^(?:»+f+»)$»,»i»),needsContext:new RegExp(«^»+ge+»*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(«+ge+»*((?:-\\d)?\\d*)»+ge+»*\\)|)(?=[^-]|$)»,»i»)},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp(«\\\\[\\da-fA-F]{1,6}»+ge+»?|\\\\([^\\r\\n\\f])»,»g»),P=function(e,t){var n=»0x»+e.slice(1)-65536;return t||(n>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,»fieldset»)},{dir:»parentNode»,next:»legend»});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],»string»!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+» «]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute(«id»))?s=ce.escapeSelector(s):e.setAttribute(«id»,s=S)),o=(l=Y(t)).length;while(o–)l[o]=(s?»#»+s:»:scope»)+» «+Q(l[o]);c=l.join(«,»)}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute(«id»)}}}return re(t.replace(ve,»$1″),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+» «)>b.cacheLength&&delete e[r.shift()],e[t+» «]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement(«fieldset»);try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,»input»)&&e.type===t}}function _(t){return function(e){return(fe(e,»input»)||fe(e,»button»))&&e.type===t}}function z(t){return function(e){return»form»in e?e.parentNode&&!1===e.disabled?»label»in e?»label»in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:»label»in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i–)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&»undefined»!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener(«unload»,M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,»*»)}),le.scope=$(function(){return T.querySelectorAll(«:scope»)}),le.cssHas=$(function(){try{return T.querySelector(«:has(*,:jqfake)»),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute(«id»)===t}},b.find.ID=function(e,t){if(«undefined»!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t=»undefined»!=typeof e.getAttributeNode&&e.getAttributeNode(«id»);return t&&t.value===n}},b.find.ID=function(e,t){if(«undefined»!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode(«id»))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode(«id»))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return»undefined»!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if(«undefined»!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML=»«,e.querySelectorAll(«[selected]»).length||d.push(«\\[«+ge+»*(?:value|»+f+»)»),e.querySelectorAll(«[id~=»+S+»-]»).length||d.push(«~=»),e.querySelectorAll(«a#»+S+»+*»).length||d.push(«.#.+[+~]»),e.querySelectorAll(«:checked»).length||d.push(«:checked»),(t=T.createElement(«input»)).setAttribute(«type»,»hidden»),e.appendChild(t).setAttribute(«name»,»D»),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(«:disabled»).length&&d.push(«:enabled»,»:disabled»),(t=T.createElement(«input»)).setAttribute(«name»,»»),e.appendChild(t),e.querySelectorAll(«[name=»]»).length||d.push(«\\[«+ge+»*name»+ge+»*=»+ge+»*(?:»|\»\»)»)}),le.cssHas||d.push(«:has»),d=d.length&&new RegExp(d.join(«|»)),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+» «]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0«:{dir:»parentNode»,first:!0},» «:{dir:»parentNode»},»+»:{dir:»previousSibling»,first:!0},»~»:{dir:»previousSibling»}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||»»).replace(O,P),»~=»===e[2]&&(e[3]=» «+e[3]+» «),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),»nth»===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(«even»===e[3]||»odd»===e[3])),e[5]=+(e[7]+e[8]||»odd»===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||»»:n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(«)»,n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return»*»===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+» «];return t||(t=new RegExp(«(^|»+ge+»)»+e+»(«+ge+»|$)»))&&s(e,function(e){return t.test(«string»==typeof e.className&&e.className||»undefined»!=typeof e.getAttribute&&e.getAttribute(«class»)||»»)})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?»!=»===r:!r||(t+=»»,»=»===r?t===i:»!=»===r?t!==i:»^=»===r?i&&0===t.indexOf(i):»*=»===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i–)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a–)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=–r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r–)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o–)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o–)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o–)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n–)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u–,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l–)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i–){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):»string»!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*()[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,»string»==typeof e){if(!(r=»»===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l–}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,–n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t–)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?–ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<–ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n–)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t–)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r–),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e–),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){–r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a–)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a–)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement(«div»)),(be=C.createElement(«input»)).setAttribute(«type»,»radio»),be.setAttribute(«checked»,»checked»),be.setAttribute(«name»,»t»),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML=»x»,le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML=»»,le.option=!!xe.lastChild;var ke={thead:[1,»«;for(var p=m[e+1];p&&(«br»===p.type||»tag»===p.type&&/^<br\b/i.test(p.text));)b+="»,p=m[(e+=1)+1]}break;case»hr»:b+=»
«;break;case»escapedLine»:case»comment»:break;case»inlineUrl»:b+=’‘+n.text+»«;break;case»scriptStyleTag»:case»tag»:var d=n.text.toLowerCase();/^»)&&v[n.text.startsWith(«</")?"shift":"unshift"](d),b+=n.text.startsWith("$/,function(e,t){return» data-raw».concat(t?»>»)});break;case»sub»:case»sup»:case»strong»:case»em»:b+=y(n,n.type);break;case»strike»:b+=y(n,»s»);break;case»bold»:b+=y(n,»b»);break;case»italic»:b+=y(n,»i»);break;case»twineLink»:d=_slicedToArray(S.lex(«(link-goto:»+JSON.stringify(n.innerText)+»,»+JSON.stringify(n.passage)+»)»).children,1)[0];b+=»,g.code.push(d);break;case»hook»:b+=»‘,g.source.push(n.children);break;case»unclosedHook»:return b+=»‘,g.source.push(m.slice(e+1,w)),{v:b};case»verbatim»:b+=A(_(n.innerText).replace(/\n/g,»
«),»tw-verbatim»);break;case»collapsed»:b+=y(n,»tw-collapsed»);break;case»unclosedCollapsed»:return{v:b+=»»+E(m.slice(e+1,w),g)+»»};case»variable»:case»tempVariable»:case»macro»:var f=[],h=[];if(«macro»===n.type&&!function e(t){«string»!==t.type&&»hook»!==t.type&&t.children.every(e);var n=x(t.name);if(«macro»!==t.type||»prompt»!==n&&»confirm»!==n){if(«hook»===t.type&&!t.everyLeaf(function(e){return»error»!==e.type||(h.push(e),!1)}))return!1}else f.push(t);return!0}(n),h.length)return{v:T.create(«syntax»,»This code hook’s markup contained «+h.length+» error»+(h.length?»s»:»»)+»:
\u2014″+h.map(function(e){return e.message}).join(«
\u2014″)).render(_(n.text))[0].outerHTML};d=f.map(function(e){return e.blockerTree=g.blockers.length,g.blockers.push(e),e.blockerTree});b+=»,g.code.push(n);break;default:b+=n.children&&n.children.length?E(n.children,g):n.text}k=e}(k))return e.v;return b}return Object.freeze({exec:function(e){var r={code:[],blockers:[],source:[]},e=E(e=»string»==typeof e?S.lex(e).children:e,r),e=a(a.parseHTML(e,document,!0));return e.findAndFilter(«script:not([src])»).each(function(e,t){var n=t.getAttribute(«type»);n&&»text/javascript»!==n.toLowerCase()||t.setAttribute(«type»,»application/x-harlowe»)}),r.blockers=r.blockers.map(function(e){e.blockedValue=!0;e=Object.create(e);return e.blockedValue=!1,e}),e.findAndFilter(«tw-expression:not([data-raw]), tw-expression[blockers]:not([data-raw]), tw-hook:not([data-raw])»).each(function(e,t){var n;(t=a(t)).attr(«blockers»)&&(n=t.popAttr(«blockers»).split(«,»).map(function(e){return r.blockers[e]}),t.data(«blockers»,n)),t.attr(«source»)&&t.data(«source»,r.source[t.popAttr(«source»)]),t.attr(«code»)&&t.data(«code»,r.code[t.popAttr(«code»)])}),e}})}),define(«repl»,[«utils»,»markup»,»section»],function(e,t,n){e.onStartup(function(){return setTimeout(function(){e.options.debug&&(window.REPL=function(e){e=n.create().eval(t.lex(«(print:»+e+»)»));return e.TwineScript_Run?e.TwineScript_Run().source:e},window.LEX=function(e){e=t.lex(e);return 1===e.length?e[0]:e})})})}),define(«section»,[«jquery»,»utils»,»twinescript/runner»,»twinescript/operations»,»state»,»utils/operationutils»,»utils/renderutils»,»utils/scripttag»,»datatypes/changercommand»,»datatypes/colour»,»datatypes/lambda»,»datatypes/codehook»,»internaltypes/changedescriptor»,»internaltypes/varscope»,»internaltypes/twineerror»,»internaltypes/twinenotifier»],function(p,f,a,u,r,e,t,i,d,h,o,m,g,y,b,v){var w=e.printBuiltinValue,k=e.objectName,S=e.typeID,T=e.isObject,s=t.collapse,_=Object.assign,x=Object.create,O=Object.keys;function A(e,t,n){if(t&&»object»===_typeof(t)&&d.isPrototypeOf(t)){var r=n.popData(«source»)||(null==(r=n[0].cachedData)?void 0:r.source),a=(null!=(a=n[0])&&a.cachedData&&(n[0].cachedData.source=void 0),n.data(«originalSource»,r),g.create({target:n,source:r,section:this,append:»append»})),o=t.run(a);if(b.containsError(o)&&e.replaceWith(o.render(e.attr(«title»))),!this.renderInto(r,null,a))return o=f.insensitiveName(e.attr(«name»)),[«if»,»elseif»,»unless»,»else»,»testfalse»].includes(o)&&(e.addClass(«false»),»elseif»!==o)&&(this.stackTop.lastHookShown=!1),n.data(«live»)&&function(t,n,r){function a(e){p&&(d-=(e-p)*(f.options.debug&&void 0!==f.options.speedMultiplier?f.options.speedMultiplier:1)),p=e,0<d?requestAnimationFrame(a):(d=s,o())}var o,i=this,e=r.data("live"),s=e.delay,c=e.event,l=((n=_objectSpread(_objectSpread({},n),{},{append:"replace",transitionDeferred:!1,enabled:!0})).data=_objectSpread(_objectSpread({},n.data),{},{live:void 0}),r.data("originalSource")||""),u=this.stackTop.tempVariables,p=null,d=s;o=this.whenUnblocked.bind(this,function(){var e;i.inDOM()&&(e=null==c?void 0:c.filter(i,[!0],u),b.containsError(e)?e.render(i,t.attr("title")).replaceAll(t):c&&!e[0]?requestAnimationFrame(a):(i.renderInto(l,r,n,u),e||r.find("tw-expression[name='stop']").length||i.inDOM()&&requestAnimationFrame(a)))}),requestAnimationFrame(a)}.call(this,e,a,n),!0}else{if(!1===t)return o=n.popData("source")||(null==(r=n[0].cachedData)?void 0:r.source),null!=(a=n[0])&&a.cachedData&&(n[0].cachedData.source=void 0),o&&(n.cachedData&&(n.cachedData.source=void 0),n.data("originalSource",o),n.data("hidden",!0)),e.addClass("false"),!(this.stackTop.lastHookShown=!1);if(!0!==t)return!1}return this.stackTop.lastHookShown=!0}function C(e){var t,n,e=(e instanceof p?e[0]:e).nextSibling;return e&&(e instanceof Text&&!e.textContent.trim()||["br","tw-consecutive-br"].includes((e.tagName||"").toLowerCase()))?(t=(n=C(e)).whitespace,n=n.nextElem,{whitespace:p(e).add(t),nextElem:n}):{whitespace:p(),nextElem:p(e)}}function E(e){if(null!=e&&e.length)return p("»).data(«evalReplay»,e)}function c(e,t){var n=this.eval(t);e.append(E(this.evalReplay)),e.append(function(e,t){if(/a \((go-to|undo|redirect|restart):\) command/.exec(null==t?void 0:t.TwineScript_TypeName))return p(«»).data(«goto»,{section:e,command:t})}(this,n)),this.stackTop.evaluateOnly&&n&&(d.isPrototypeOf(n)||»function»==typeof n.TwineScript_Run)&&(n=b.create(«syntax»,»I can’t work out what «.concat(this.stackTop.evaluateOnly,» should evaluate to, because it contains a «).concat(d.isPrototypeOf(n)?»changer.»:»command.»),»Please rewrite this without putting changers or commands here.»));var r=p();for(i=e;d.isPrototypeOf(n);){var a=C(i),o=a.whitespace;if((i=a.nextElem)[0]&&i[0].nodeType===Node.TEXT_NODE&&»+»===i[0].textContent.trim()){var i,a=i,s=C(a),c=s.whitespace;if((i=s.nextElem).is(«tw-expression»)){var s=i.popData(«code»)||(null==(s=i[0])||null==(s=s.cachedData)?void 0:s.code),l=(null!=(l=i[0])&&l.cachedData&&(i[0].cachedData.code=void 0),this.eval(s));if(b.containsError(l)){n=l;break}s=u[«+»](n,l);p(o).add(a).add(c).remove(),n=b.containsError(s)?b.create(«operation»,»I can’t combine «+k(n)+» with «+k(l)+».»,»function»==typeof l.TwineScript_Run?»If you want to attach this changer to «.concat(k(l),», remove the + between them.»):»Changers can only be added to other changers.»):s;continue}}if(i.is(«tw-expression»)){c=i.popData(«code»)||(null==(a=i[0])||null==(a=a.cachedData)?void 0:a.code),s=(null!=(l=i[0])&&l.cachedData&&(i[0].cachedData.code=void 0),this.eval(c));if(i.append(E(this.evalReplay)),b.containsError(s)){n=s;break}if(s&&»object»===_typeof(s)&&»function»==typeof s.TwineScript_Attach){n=s.TwineScript_Attach(this,n);break}return d.isPrototypeOf(s)?void e.replaceWith(b.create(«operation»,»Changers like («.concat(n.macroName,»:) need to be combined using + between them.»),»Place the + between the changer macros, or the variables holding them. The + is absent only between a changer and its attached hook or command.»).render(e.attr(«title»))):void e.replaceWith(b.create(«operation»,»».concat(k(s),» can’t have changers like («).concat(n.macroName,»:) attached.»),»Changers placed just before hooks, links and commands will attempt to attach, but in this case it didn’t work.»).render(e.attr(«title»)))}if(i.is(«tw-hook»)){o.remove(),r=i;break}n.macroName||f.impossible(«Section.runExpression»,»changer has no macroName»);a=e.attr(«title»)||»(«+n.macroName+»: …)»;return void e.replaceWith(b.create(«syntax»,»The («.concat(n.macroName,»:) changer should be stored in a variable or attached to a hook.»),»Macros like this should appear before a hook: «.concat(a,»[Some text]»)).render(e.attr(«title»)))}e.attr(«return»,S(n)),r=r.length?r:C(e).nextElem.filter(«tw-hook»),(t=b.containsError(n))?e.replaceWith(t.render(e.attr(«title»)).append(E(this.evalReplay))):v.isPrototypeOf(n)?e.append(n.render()):n&&»function»==typeof n.TwineScript_Run?(n=n.TwineScript_Run(this),b.containsError(n)?e.replaceWith(n.render(e.attr(«title»))):g.isPrototypeOf(n)?null!=(t=n.data)&&t.live?e.replaceWith(b.create(«unimplemented»,»I currently can’t attach (live:) or (event:) macros to commands – only hooks.»).render(e.attr(«title»))):(n.section=this,n.target=i,this.renderInto(«»,i,n)):T(n)&&n.blocked?(this.stackTop.blocked=n.blocked,e.data(«code»,{type:»macro»,blockedValue:!0,text:e.attr(«title»)||»»,start:0,end:(e.attr(«title»)||»»).length})):n&&f.impossible(«Section.runExpression»,»TwineScript_Run() returned a non-ChangeDescriptor «.concat(_typeof(n),’: «‘).concat(n,'»‘))):r.length&&A.call(this,e,n,r)||(«string»==typeof n||»number»==typeof n||n instanceof Map||n instanceof Set||Array.isArray(n)||h.isPrototypeOf(n)||m.isPrototypeOf(n)||n&&»function»==typeof n.TwineScript_Print&&!d.isPrototypeOf(n)?(n=w(n),b.containsError(n)?e.replaceWith(n.render(e.attr(«title»))):»string»==typeof n||Array.isArray(n)?this.renderInto(n,e):f.impossible(«printBuiltinValue() produced a non-string non-array «.concat(_typeof(n)))):d.isPrototypeOf(n)||»boolean»==typeof n||f.impossible(«Section.runExpression»,»The expression evaluated to an unknown value: «.concat(n)))}var l={add:[],remove:[]};return Object.preventExtensions({create:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:f.storyElement,n=_(x(this),{timestamp:Date.now(),dom:e,stack:[],enchantments:[],unblockCallbacks:[],freeVariables:null,evalReplay:null,loadedGame:!1,Identifiers:{TwineScript_Identifiers:!0,it:0,get time(){var e;return null!=(e=n.stackTop)&&e.evaluateOnly?b.create("operation","'time' can't be used in ".concat(n.stackTop.evaluateOnly,".")):(Date.now()-n.timestamp)*(f.options.debug&&void 0!==f.options.speedMultiplier?f.options.speedMultiplier:1)},get turns(){return r.turns},get turn(){return r.turns},get visits(){var t=n.stackTop.speculativePassage;return r.history().filter(function(e){return e===(t||r.passage)}).length+(!t||t===r.passage)},get visit(){return n.Identifiers.visits},get exits(){var e;return null!=(e=n.stackTop)&&e.evaluateOnly?b.create("operation","'exit' and 'exits' can't be used in ".concat(n.stackTop.evaluateOnly,".")):n.dom.find("tw-enchantment, tw-link").filter(function(e,t){return(t=p(t)).data("enchantmentEvent")||t.parent().data("linkPassageName")||t.parent().data("clickEvent")}).length},get exit(){return n.Identifiers.exits},get pos(){return n.stackTop&&!n.stackTop.evaluateOnly&&n.stackTop.lambdaPos?+n.stackTop.lambdaPos||1:b.create("operation","'pos' can only be used in lambdas that aren't 'when' lambdas.")}}});return n},eval:function(t){var e,n;f.options.debug&&f.options.evalReplay&&(n=Array.isArray(t)?t.reduce(function(e,t){return e+t.text},""):t.text||"",this.evalReplay=[{code:n,fromCode:n,basis:(Array.isArray(t)?t[0]:t).start,start:0,end:n.length,diff:0}]);try{e=a(this,t)}catch(e){return null!=(n=window.console)&&n.error(e),this.evalReplay=null,b.create("","An internal error occurred while trying to run ".concat([].concat(t).map(function(e){return e.text}).join(""),"."),'The error was "'.concat(e.message,'".\nIf this is the latest version of Harlowe, please consider reporting a bug (see the documentation).'))}return this.evalReplay&&2===this.evalReplay.length&&this.evalReplay.shift(),e},get stackTop(){return this.stack[0]},inDOM:function(){return 0<f.storyElement.find(this.dom).length},evaluateTwineMarkup:function(e,t){var n=p("
«);return this.stack.unshift({desc:g.create({target:n,source:e,section:this,append:»append»}),tempVariables:this.stackTop.tempVariables,evaluateOnly:t,finalIter:!0}),this.execute(),0<(e=n.find("tw-error")).length?e:n},speculate:function(e,t,n){this.stack.unshift({evaluateOnly:n,finalIter:!0,tempVariables:_(x(y),{TwineScript_VariableStore:{type:"temp",name:n}}),speculativePassage:t});var r,n=this.evalReplay;return this.evalReplay=null,o.isPrototypeOf(e)?r=e.apply(this,{fail:!1,pass:!0}):e&&(r=a(this,e)),this.stack.shift(),this.evalReplay=n,r},renderInto:function(e,a,t){var o=this,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,i=g.create({target:a,source:e,section:this,append:"append"});if(t)if(d.isPrototypeOf(t)){var e=t.run(i);if(b.containsError(e))return e.render(a.attr("title")).replaceAll(a),!1}else _(i,t);if((a=i.target,50<=this.stack.length)&&50<=this.stack.reduce(function(e,t){return e+!!t.finalIter},0))return b.create("infinite","Printing this expression may have trapped me in an infinite loop.").render(a.attr("title")).replaceAll(a),!1;var s=function(e,t,n){var r=a instanceof p&&a.is("tw-hook")&&0<a.parents("tw-collapsed,[collapsing=true]").length;o.stack.unshift({desc:e,finalIter:n,tempVariables:t,collapses:r,evaluateOnly:o.stackTop&&o.stackTop.evaluateOnly})},r=r||x(this.stack.length?this.stackTop.tempVariables:y),t=(hasOwnProperty.call(r,"TwineScript_VariableStore")||(t=null==(e=a)?void 0:e.tag(),r.TwineScript_VariableStore={type:"temp",name:"tw-hook"===t?a.attr("name")?"?"+a.attr("name"):"an unnamed hook":"tw-expression"===t?"a "+a.attr("type")+" expression":"tw-passage"===t?"this passage":"an unknown scope"}),null==(e=this.stackTop)?void 0:e.blocked);if(O(i.loopVars).length){var c=_objectSpread({},i.loopVars),l=Math.min.apply(Math,_toConsumableArray(O(c).map(function(e){return c[e].length})));if(v.create(l+" loop"+(1!==l?"s":"")).render().prependTo(a),l){for(var n=l-1;0<=n;–n)!function(n){s(i,O(c).reduce(function(e,t){return e[t]=c[t][n],e},x(r),n===l-1))}(n);for(var u=l-1;0<=u&&!this.stackTop.blocked;–u)this.execute()}}else s(i,r,!0),this.execute();return(0===this.stack.length||!t&&null!=(e=this.stackTop)&&e.blocked)&&this.updateEnchantments(),i.enabled},execute:function(){var a=this,e=this.stackTop,t=e.desc,n=e.dom,r=e.collapses,o=e.evaluateOnly;t&&!n&&(n=t.render(),this.stackTop.dom=n,this.stackTop.desc=void 0),n.findAndFilter('tw-hook,tw-expression,script[type="application/x-harlowe"]').each(function(e,t){var n=p(t).data();t.cachedData={blockers:n.blockers,code:n.code,source:n.source}}).each(function(e,t){if(a.stackTop.blocked)return!1;var n=t.cachedData;switch(n&&(t.cachedData=void 0),(t=p(t)).tag()){case"tw-hook":var r=t.popData("source")||(null==n?void 0:n.source);(r&&t.data("originalSource",r),t.data("tempVariables",a.stackTop.tempVariables),t.popAttr("hidden"))?t.data("hidden",!0):r&&a.renderInto(r,t);break;case"tw-expression":var r=t.data("blockers")||(null==n?void 0:n.blockers);if(r){if(o)return void t.removeData("blockers").removeData("code").replaceWith(b.create("syntax","I can't use a macro like (prompt:) or (confirm:) in ".concat(o,"."),"Please rewrite this without putting such macros here.").render(t.attr("title"),t));if(r.length)return a.stackTop.blocked=!0,r=a.eval(r.shift()),b.containsError(r)&&(a.stackTop.blocked=!1,t.removeData("blockers").replaceWith(r.render(t.attr("title"),t))),!1;t.removeData("blockers")}r=t.popData("code")||(null==n?void 0:n.code);r&&c.call(a,t,r);break;case"script":if(f.reattachStoryElement(),t.text())try{i(t.text(),a.stackTop.tempVariables)}catch(e){b.isPrototypeOf(e)?t.replaceWith(e.render(t.text(),t)):(null!=(r=window.console)&&r.error(e),t.replaceWith(b.create("","A Javascript error occurred while running this element.»,’The error was «‘.concat(e,'». Check the browser console for more details.’)).render(t.text(),t)))}}}),this.stackTop.blocked||(n.length&&r&&s(n),n.findAndFilter(«tw-collapsed,[collapsing=true]»).each(function(){s(p(this))}),setTimeout(function(){return n.find(«input, textarea»).first().focus()},100),this.stack.shift())},updateEnchantments:function(){this.enchantments.forEach(function(e){e.disenchant(),e.enchantScope()})},on:function(e,t){return l[e].push(t),this},addEnchantment:function(t){var n=this;this.enchantments.push(t),l.add.forEach(function(e){return e(n,t)})},removeEnchantment:function(t){var n=this,e=this.enchantments.indexOf(t);this.enchantments.splice(e,1),t.disenchant(),l.remove.forEach(function(e){return e(n,t)})},unblock:function(e){for(this.stack.length||f.impossible(«Section.unblock»,»stack is empty»),this.stackTop.blocked=!1,void 0!==e&&(this.stackTop.blockedValues=(this.stackTop.blockedValues||[]).concat(e));this.stack.length&&!this.stackTop.blocked;)this.execute();if(!this.stack.length)for(;0<this.unblockCallbacks.length;){var t;if(this.unblockCallbacks.shift()(),null!=(t=this.stackTop)&&t.blocked)return}},whenUnblocked:function(e,t){this.stack.length&&this.stackTop.blocked?this.unblockCallbacks=this.unblockCallbacks.concat(e):(t||e)()},blockedValue:function(){var e=this.stackTop;return e?e.blockedValues&&e.blockedValues.length?e.blockedValues.shift():(f.impossible("Section.blockedValue","blockedValues is missing or empty"),0):(f.impossible("Section.blockedValue","stack is empty"),0)}})}),define("state",["jquery","utils","passages","datatypes/customcommand","utils/operationutils","markup"],function(n,y,b,v,e,t){var i,w,C=e.toSource,E=e.is,k=t.lex,o=Object.assign,h=Object.create,e=Object.defineProperty,N=Array.isArray,s=Math.imul,t=(e(Map.prototype,"toJSON",{value:void 0}),e(Set.prototype,"toJSON",{value:void 0}),["localStorage","sessionStorage"].map(function(e){try{return!!window[e]&&(window[e].setItem("test","1"),window[e].removeItem("test"),!0)}catch(e){return!1}}));function S(e,t){var n=0<arguments.length&&void 0!==e?e:String.fromCodePoint(Date.now()%1114112),e=1<arguments.length&&void 0!==t?t:0;i.seedIter=e,i.seed=n;for(var r,a=0,o=2166136261;a<n.length;a+=1)r=s(n.charCodeAt(a),3432918353),o^=s(r<>>17,461845907),o=s(o=o<>>19,5)+3864292196|0;return o^=n.length,o=s(o^=o>>>16,2246822507),o=s(o^=o>>>13,3266489909),o=((o^=o>>>16)>>>0)+1831565813*e,function(){i.seedIter+=1;var e=o+=1831565813,e=s(e^e>>>15,1|e);return(((e^=e+s(e^e>>>7,61|e))^e>>>14)>>>0)/4294967296}}function r(e,t){for(var n,r=t.variables,a=h(null),o=e.length-1;0<=o;–o){for(var i,s,c=e[o],l=0,u=["mockVisits","mockTurns","seed","seedIter"];l<u.length;l++){var p=u[l];hasOwnProperty.call(c,p)&&!hasOwnProperty.call(t,p)&&(t[p]=c[p])}for(i in c.forgetVisits&&(t.forgetVisits=Math.max(t.forgetVisits||0,c.forgetVisits)),void 0!==c.turns&&(t.turns=(t.turns||0)+c.turns),t.pastVisits||(t.pastVisits=[]),o!==e.length-1&&(void 0!==e[o+1].visits&&Array.isArray(t.pastVisits[0])?t.pastVisits[0]:t.pastVisits).unshift(c.passage),void 0!==c.pastVisits&&t.pastVisits.unshift(c.pastVisits),void 0!==c.visits&&t.pastVisits.unshift(c.visits),c.variables)if("TwineScript_TypeDefs"===i)for(var d in r[i]||(r[i]=h(null)),c.variables[i])r[i][d]||(r[i][d]=c.variables[i][d]);else i.startsWith("TwineScript_")||i in r||(null===c.variables[i]&&(a[i]=!0),a[i])||(r[i]=c.variables[i],!(s=c.valueRefs[i]))||"via"in s||t.valueRefs[i]||(t.valueRefs[i]=s)}for(n in t.valueRefs){var f=t.valueRefs[n];f&&"via"in f&&delete t.valueRefs[n]}}var a,c={passage:"",variables:h(null),visits:void 0,turns:void 0,seed:void 0,seedIter:void 0,mockVisits:void 0,mockTurns:void 0,forgetVisits:void 0,create:function(e){var t=h(c);return t.passage=e||"",t.variables=h(null),t.valueRefs=h(null),t}},l={forward:[],back:[],load:[],beforeForward:[],beforeBack:[],beforeLoad:[],forgetUndos:[]},u=[],p=-1,d=c.create(),f="";function m(){i.history=i.pastVisits.slice(i.forgetVisits).reduce(function(e,t){return e.concat(t)},[]),i.mockVisits&&(i.history=i.mockVisits.concat(i.history))}function g(){var e=c.create();e.pastVisits=[],o(e.variables,{TwineScript_ObjectName:"this story's variables",TwineScript_TypeDefs:h(null),TwineScript_VariableStore:{type:"global",name:"this story's variables"},TwineScript_Delete:function(e){delete this[e],d.variables[e]=null,delete d.valueRefs[e]},TwineScript_Set:function(e,t,n){if(this[e]=t,d.variables[e]=t,n)d.valueRefs[e]=n;else if((N(t)||t instanceof Map||t instanceof Set||"string"==typeof t)&&!y.options.uncompressedStructures)for(var r=p;0<=r;–r){var a=u[r].variables[e];if(void 0!==a){a=function e(t,n,r){var a="it"===r?"its":r+"'s",o="";if(N(n)&&N(t)&&n.length){for(var i=n.length===t.length,o="(a:",s=0;s<n.length;s+=1){var c,l,u,p=n[s];E(p,t[s])?(c=C(p),l="".concat(a," ").concat(s+1,"th"),o+=(c.length<l.length?c:l)+","):(i=!1,-1<(c=t.indexOf(p))?(l=C(p),u="".concat(a," ").concat(c+1,"th"),o+=(l.length<u.length?l:u)+","):o+=e(t[s],p,"".concat(a," ").concat(s+1,"th"))+",")}o=i?r:o.slice(0,-1)+")"}else if(n instanceof Map&&t instanceof Map&&n.size){var d,f=n.size===t.size,h=(o="(dm:",_createForOfIteratorHelper(n.entries()));try{for(h.s();!(d=h.n()).done;){var m,g,y=_slicedToArray(d.value,2),b=y[0],v=y[1];o+="".concat(C(b),","),E(v,t.get(b))?(m=C(v),g="".concat(a," (").concat(C(b),")"),o+=(m.lengthn.size?C(n):r+(S.size?»+»+C(S):»»)+(k.size?»-«+C(k):»»)}else»string»==typeof n&&»string»==typeof t&&n&&(n.startsWith(t)?o=r+»+»+C(n.slice(t.length)):n.endsWith(t)&&(o=C(n.slice(0,n.length-t.length))+»+»+r));return o?»it»===r?{via:o}:o:»it»===r?void 0:C(n)}(a,t,»it»);a&&(«it»===a.via?delete d.variables[e]:d.valueRefs[e]=a);break}}},TwineScript_GetProperty:function(e){return this[e]},TwineScript_DefineType:function(e,t){this.TwineScript_TypeDefs[e]=t,hasOwnProperty.call(d.variables,»TwineScript_TypeDefs»)||(d.variables.TwineScript_TypeDefs=h(null)),d.variables.TwineScript_TypeDefs[e]=t}}),r(u.slice(0,p+1),e),i=e,m(),w=S(e.seed,e.seedIter)}function T(e){d=c.create(e);e=a.serialise(!0),f=e.past,e=e.pastAndPresent;if(a.hasSessionStorage&&»string»==typeof e)try{sessionStorage.setItem(«Saved Session»,e)}catch(e){}}function _(e,t,n,r){for(var a in r)if(hasOwnProperty.call(r,a)&&!a.startsWith(«TwineScript_»))if(«object»===_typeof(r[a]))if(hasOwnProperty.call(r[a],»at»)){n.valueRefs[a]=r[a];var o=r[a],i=o.at,s=o.from,c=o.to,l=o.hash,u=o.seed,p=o.seedIter,o=o.blockedValues;if(!b.has(i))throw Error(‘The data refers to a passage named `»‘.concat(n.passage,»\»`, but it isn’t in this story.»));var d=b.get(i).get(«source»),f=d.slice(s,c);if(void 0!==l)for(var h=0,m=c-s;y.hash(f).toString(16)!==l;){if(h+m>=d.length)throw Error(«The value (or type) of the variable `$».concat(a,»` couldn’t be found in the passage `\»»).concat(i,'»`.’));(h+=1)===s&&(h+=1),f=d.slice(h,h+m)}c=k(f,»»,»macro»);void 0!==u&&void 0!==p&&(w=S(u,p)),void 0!==o&&(e.stackTop.blockedValues=o,c.forEach(function e(t){var n;»string»!==t.type&&»hook»!==t.type&&t.children.every(e),»macro»!==t.type||»prompt»!==(n=y.insensitiveName(t.name))&&»confirm»!==n||(t.blockedValue=!0)})),r[a]=e.eval(c)}else if(hasOwnProperty.call(r[a],»via»)){for(var g=t.length-1;0<=g;–g)if(hasOwnProperty.call(t[g].variables,a)){e.Identifiers.it=t[g].variables[a];break}r[a]=e.eval(k(r[a].via,"","macro")),e.Identifiers.it=0}else hasOwnProperty.call(r[a],"changer")&&(r[a].changer=e.eval(k(r[a].changer,"","macro")),r[a].hook=e.eval(k(r[a].hook,"","macro")),_(e,t,n,r[a].variables),r[a]=v.create(r[a]));else r[a]=e.eval(k(r[a],"","macro"));else"TwineScript_MockVisits"===a&&(n.mockVisits=r[a])}return g(),d.seed=i.seed,d.seedIter=0,(a={get passage(){return d.passage},get variables(){return i.variables},get pastLength(){return p},get turns(){return p+1+(i.turns||0)+(i.mockTurns||0)},get futureLength(){return u.length-1-p},get mockVisits(){return i.mockVisits||[]},set mockVisits(e){i.mockVisits=e,d.mockVisits=e,m()},get mockTurns(){return i.mockTurns||0},set mockTurns(e){i.mockTurns=e,d.mockTurns=e},history:function(){return i.history},forgetUndos:function(e){e<0&&(e=u.length+e);var t,e=u.splice(0,Math.min(u.length-1,e));e.length&&(p=u.length-1,t=u[0],r(e,t),t.pastVisits.push(e[e.length-1].passage),t.turns=(t.turns||0)+e.length,i.turns=(i.turns||0)+e.length,t.forgetVisits&&(t.pastVisits=t.pastVisits.slice(t.forgetVisits-t.turns),t.forgetVisits-=t.turns),f="",0===p&&n("tw-link[undo], tw-icon[alt='Undo']",y.storyElement).each(function(e,t){(n(t).closest("tw-expression, tw-hook").data("forgetUndosEvent")||Object)(t)}),l.forgetUndos.forEach(function(e){return e()}))},forgetVisits:function(e){(e=ep+i.turns&&(e=p+i.turns),d.forgetVisits=i.forgetVisits=Math.max(i.forgetVisits||0,e),m()},passageNameVisited:function(e){var t=0;if(!b.get(e))return 0;for(var n=0;n<i.history.length;n++)t+=+(e===i.history[n]);return t},get timeline(){return u},play:function(t){var e;d||y.impossible("State.play","present is undefined!"),l.beforeForward.forEach(function(e){return e()}),d.passage&&((null!=(e=d.visits)&&e.length&&Array.isArray(i.pastVisits[i.pastVisits.length-1])?i.pastVisits[i.pastVisits.length-1]:i.pastVisits).push(d.passage),i.history.push(d.passage)),d.passage=t,u=u.slice(0,p+1).concat(d),p+=1,T(t),l.forward.forEach(function(e){return e(t)})},redirect:function(e){var t;d||y.impossible("State.redirect","present is undefined!"),d.passage&&(null!=(t=d.visits)&&t.length&&Array.isArray(i.pastVisits[i.pastVisits.length-1])?i.pastVisits[i.pastVisits.length-1].push(d.passage):i.pastVisits.push([d.passage]),i.history.push(d.passage)),d.visits=(d.visits||[]).concat(e),d.passage=e},rewind:function(e){for(var t=void 0!==e?e:1,n=!1;0<t&&0<p;t–)n=!0,–p;return n&&(l.beforeBack.forEach(function(e){return e()}),f="",T(u[p].passage),g(),l.back.forEach(function(e){return e()})),n},fastForward:function(e){var t=1,n=!1;for("number"==typeof e&&(t=e);0<t&&0<u.length;t–)n=!0,p+=1;return n&&(l.beforeForward.forEach(function(e){return e()}),T(u[p].passage),g(),l.forward.forEach(function(e){return e(u[p].passage,"fastForward")})),n},on:function(e,t){if(e in l)return"function"!=typeof t||l[e].includes(t)||l[e].push(t),a;y.impossible("State.on","invalid event name")},reset:function(){l.beforeLoad.forEach(function(e){return e()}),u=[],p=-1,g(),(d=c.create()).seed=i.seed,d.seedIter=0,f="",w=S(),l.load.forEach(function(e){return e(u)})},hasStorage:t[0],hasSessionStorage:t[1],setSeed:function(e){w=S(e),d.seed=i.seed,d.seedIter=0},get seed(){return i.seed},get seedIter(){return i.seedIter},random:function(){var e=w();return d.seedIter=i.seedIter,e},shuffled:function(){for(var a=this,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce(function(e,t,n){var r=a.random()*(n+1)|0;return r===n?e.push(t):(e.push(e[r]),e[r]=t),e},[]);return d.seedIter=i.seedIter,r}}).serialise=function(e){function o(e,t){if("TwineScript_TypeDefs"===t){var n,r={};for(n in e[t])r[n]=C(e[t][n]);return r}var a;return null===e[t]?null:e[t]&&hasOwnProperty.call(e[t],"TwineScript_CustomCommand")?(a=e[t].TwineScript_CustomCommand(),{changer:C(a.changer),toSource:a.toSource,hook:C(a.hook),variables:Object.keys(a.variables).reduce(function(e,t){return e[t]=o(a.variables,t),e},{})}):C(e[t])}function t(e,t){if(c.isPrototypeOf(t)&&void 0===t.visits&&void 0===t.turns&&void 0===t.mockVisits&&void 0===t.forgetVisits&&void 0===t.pastVisits&&void 0===t.mockTurns&&void 0===t.seed&&void 0===t.seedIter&&Object.keys(t.variables).every(function(e){return e.startsWith("TwineScript_")}))return t.passage;if(!c.isPrototypeOf(this)||"valueRefs"!==e){if(c.isPrototypeOf(this)&&"variables"===e){var n,r={};for(n in this.variables)this.valueRefs[n]?r[n]=this.valueRefs[n]:r[n]=o(this.variables,n);return r}return t}}var e=u.slice(f?e?p-1:p:0,p+1),n=e.slice(0,-1),r=f;try{return{past:r=n.length?(r?r.slice(0,-1)+",":"[")+JSON.stringify(n,t).slice(1):r,pastAndPresent:r.slice(0,-1)+(r?",":"[")+JSON.stringify(e.slice(-1),t).slice(1)}}catch(e){return{past:!1,pastAndPresent:!1}}},a.deserialise=function(e,t){var n;try{n=JSON.parse(t)}catch(e){return Error("The save data is unintelligible.")}if(!N(n))return Error("The save data isn't a sequence of past turns.");for(var r=0;r<n.length;r+=1){var a=n[r];if("string"==typeof a)a={passage:a,variables:{}};else if("object"!==_typeof(a)||!hasOwnProperty.call(a,"variables")){n.splice(r–,1);continue}if(a.valueRefs=h(null),a.variables=o(h(null),a.variables),!b.hasValid(a.passage))return Error('The data refers to a passage named `"'.concat(a.passage,"\"`, but it isn't in this story."));if(hasOwnProperty.call(a.variables,"TwineScript_TypeDefs"))try{_(e,n.slice(0,r),a,a.variables.TwineScript_TypeDefs)}catch(e){return Error("The variable types on turn ".concat(r+1," couldn't be reconstructed.").concat(e.message?" (".concat(e.message,")"):""))}try{_(e,n.slice(0,r),a,a.variables)}catch(e){return Error("The variables on turn ".concat(r+1," couldn't be reconstructed.").concat(e.message?" (".concat(e.message,")"):""))}n[r]=o(h(c),a)}return p=(u=n).length-1,l.load.forEach(function(e){return e(u)}),f="",g(),T(u[p].passage),!0},Object.seal(c),Object.freeze(a)}),define("utils",["jquery","markup","utils/polyfills"],function(d){var r=String.fromCharCode,n="audio,blockquote,canvas,div,h1,h2,h3,h4,h5,hr,ol,p,pre,table,ul,video,tw-align,tw-story,tw-passage,tw-sidebar,tw-columns,tw-column,tw-meter".split(","),a="a,b,i,em,strong,sup,sub,abbr,acronym,s,strike,del,big,small,script,img,button,input,tw-link,tw-broken-link,tw-verbatim,tw-collapsed,tw-error,tw-colour,tw-icon".split(","),f=["audio"],e=_slicedToArray([function(e){return r(e)!==r(e).toLowerCase()},function(e){return r(e)!==r(e).toUpperCase()},function(e){return r(e).toLowerCase()!==r(e).toUpperCase()}].map(function(e){return"["+Array.from(Array(57343)).map(function(e,t){return t}).filter(e).map(function(e,t,n){return e===n[t-1]+1&&e===n[t+1]-1?"-":r(e)}).join("").replace(/-+/g,"-")+"]"}),3),t=e[0],o=e[1],e=e[2];function s(e){return"instant"===e?0:800}var i,c,l=[],u={},p=0,h={},m=0,g={};function y(n,r,e,a,o){var i=null,s=0,c=r+e;function l(e){var t;1&n[0].compareDocumentPosition(document)&&(c=0),i&&(c-=t=e-i),i=e,0<a&&0<p+m&&n.data("expediteAnim")(a),c<=r&&(s+=t||0,"paused"===n.css("animation-play-state"))&&n.css({visibility:"","animation-play-state":"running"}),c<=0?(n.removeData("expediteAnim"),o()):requestAnimationFrame(l)}n.data("expediteAnim",function(e){var t;c-=e=void 0===e?s:e,"running"===n.css("animation-play-state")&&n.css("animation-delay",(("ms"===(t=(t=n.css("animation-delay")).toLowerCase()).slice(-2)?+t.slice(0,-2)||0:"s"===t.slice(-1)&&1e3*+t.slice(0,-1)||0)||0)-e+"ms")}),c?requestAnimationFrame(l):l()}d(document.documentElement).on("keydown keyup mousedown mouseup",function(e){var t=e.key,n=e.button,e=e.type.includes("down"),r=t?u:h,n=t&&v.insensitiveName(t)||n;r[n]&&!e?t?p=Math.max(p-1,0):m=Math.max(m-1,0):!r[n]&&e&&(t?p+=1:m+=1),r[n]=e}).on("mousemove",function(e){var t=e.pageX,e=e.pageY;g.x=t,g.y=e});var b=/-|_/g,v={hash:function(e){for(var t=9,n=e.length;0>>9)>>>0},permutations:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,a,o=t.length,i=[[].concat(t)],s=Array(o).fill(0),c=1;c<o;)s[c]<c?(r=c%2&&s[c],a=t[c],t[c]=t[r],t[r]=a,++s[c],c=1,i.push([].concat(t))):(s[c]=0,++c);return i},nth:function(e){var t=+e+"";return e+("1"!==t[t.length-1]||1!==t.length&&"1"===t[t.length-2]?"2"!==t[t.length-1]||1!==t.length&&"1"===t[t.length-2]?"3"!==t[t.length-1]||1!==t.length&&"1"===t[t.length-2]?"th":"rd":"nd":"st")},plural:function(e,t,n){return e+" "+(1!==Math.abs(e)?n||t+"s":t)},andList:function(e){return e.length»,»<«:»»:»>»,»<":"<",'"':""","'":"'"}[e]})},insensitiveName:function(e){return(e+"").toLowerCase().replace(b,"")},allKeysDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(function(e){return u[e]})},someKeysDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function(e){return u[e]})},buttonsDown:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every(function(e){return h[e]})},anyInputDown:function(){return 0<p+m},mouseCoords:g,parentColours:function(e){for(var t,n={colour:null,backgroundColour:null},r=/^\w+a\(.+?,\s*0\s*\)$|^transparent$/;e.length&&e[0]!==document;e=e.parent())if(n.backgroundColour||(t=e.css("background-color")).match(r)||(n.backgroundColour=t),n.colour||(t=e.css("color")).match(r)||(n.colour=t),n.colour&&n.backgroundColour)return n;return{colour:"#fff",backgroundColour:"#000"}},childrenProbablyInline:function(e){var t=[];return[].every.call(e.findAndFilter("*"),function(e){if(!(e.hidden||/none|inline/.test(e.style.display)||/display: (none|inline)/.test(e.getAttribute("style")))){if(n.includes(e.tagName.toLowerCase())||/display: (?!none|inline|inherit|unset)/.test(e.getAttribute("style")))return!1;a.includes(e.tagName.toLowerCase())||t.push(e)}return!0})&&t.every(function(e){return/inline|none/.test(window.getComputedStyle(e).display)})},transitionOut:function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,a=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,i=6<arguments.length&&void 0!==arguments[6]?arguments[6]:void 0;0!==e.length&&(n=n||s(t),!(1<e.length)&&v.childrenProbablyInline(e)&&["tw-hook","tw-passage","tw-sidebar","tw-expression"].includes(e.tag())||(e=e.wrapAll("»).parent()),i&&e.css(«transform-origin»,i),e.attr(«data-t8n»,t).addClass(«transition-out»).css({«animation-duration»:»».concat(n,»ms»),»animation-delay»:»».concat(-o,»ms»),»animation-play-state»:»paused»}),requestAnimationFrame(function(){v.childrenProbablyInline(e)?e.css(«display»,»inline»):e.parent().is(«tw-backdrop,tw-story»)||e[0].setAttribute(«style»,e[0].getAttribute(«style»)+»display:block !important;width:100%»)}),y(e,n,r-o,a,function(){e.remove()}))},transitionIn:function(u,e,t){var p,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,o=6<arguments.length&&void 0!==arguments[6]?arguments[6]:void 0;0!==u.length&&(t=t||s(e),(p=1<u.length||!v.childrenProbablyInline(u)||!["tw-hook","tw-passage","tw-sidebar","tw-expression"].includes(u.tag()))&&(u=u.wrapAll("»).parent()),o&&u.css(«transform-origin»,o),u.attr(«data-t8n»,e).addClass(«transition-in»).css(_objectSpread({«animation-duration»:»».concat(t,»ms»),»animation-delay»:»».concat(-a,»ms»)},n-a?{visibility:»hidden»,»animation-play-state»:»paused»}:{})),requestAnimationFrame(function(){v.childrenProbablyInline(u)?u.css(«display»,»inline»):u.parent().is(«tw-backdrop,tw-story»)||u[0].setAttribute(«style»,u[0].getAttribute(«style»)+»display:block !important;width:100%»)}),y(u,t,n-a,r,function(){var e=0===u.filter(f.join(«,»)).length;if(p&&e){u.find(«tw-transition-container, .transition-in, .transition-out»).each(function(e,t){((t=d(t)).data(«expediteAnim»)||Object)()});for(var t=[],n=u.find(«*»),r=0;r<n.length;r+=1){var a=n[r];0===a.scrollTop&&0===a.scrollLeft||t.push([a,a.scrollLeft,a.scrollTop])}e=u.find(document.activeElement);u.contents().unwrap();for(var o=0,i=t;o<i.length;o++){var s=_slicedToArray(i[o],3),c=s[0],l=s[1],s=s[2];c.scrollLeft=l,c.scrollTop=s}e.length&&e[0].focus()}else u.removeClass("transition-in").removeAttr("data-t8n")}))},debounce:function(e){function t(){300<Date.now()-l||s<=u?(u=n=0,p=!i,o?(e(c),c=[]):e.apply(void 0,_toConsumableArray(c)),p=!1):n=requestAnimationFrame(t)}var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=r.batch,o=void 0!==a&&a,a=r.recur,i=void 0!==a&&a,a=r.maxWait,s=void 0===a?1/0:a,c=[],l=0,u=0,p=!1;return function(){var e;p||(e=Date.now(),u+=e-l,l=e,o?c.push(arguments):c=arguments,n&&cancelAnimationFrame(n),n=requestAnimationFrame(t))}},impossible:function(e,t){window.console&&console.error(e+"(): "+t)},onStartup:function(e){l?l.push(e):e()},get storyElement(){return i},detachStoryElement:function(){document.documentElement.contains(i[0])&&(c=i.parent(),i.detach())},reattachStoryElement:function(){document.documentElement.contains(i[0])||(c||d(document.body)).append(i.parents().length?i.parents().last():i)},options:{speedMultiplier:1}};return d(function(){i=d("tw-story"),l.forEach(function(e){return e()}),l=null}),Object.freeze(v)}),define("datatypes/assignmentrequest",["utils/operationutils","datatypes/typedvar","datatypes/datatype","internaltypes/varref","internaltypes/twineerror"],function(e,y,b,v,w){var k=e.objectName,S=e.matches,t=e.toSource;return Object.freeze({assignmentRequest:!0,TwineScript_TypeName:"a VariableToValue (a 'to' or 'into' expression)",TwineScript_ObjectName:"a VariableToValue (a 'to' or 'into' expression)",TwineScript_ToSource:function(){return"into"===this.operator?"".concat(t(this.src)," ").concat(this.operator," ").concat(t(this.dest)):"".concat(t(this.dest)," ").concat(this.operator," ").concat(t(this.src))},TwineScript_Unstorable:!0,set:function(){var e,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n=[],r=function e(t,n,r){var a=!(2<arguments.length&&void 0!==r)||r,o=[],i=n&&v.isPrototypeOf(n)?n.get():n;if(w.containsError(i))return i;if(Array.isArray(i)&&Array.isArray(t)){for(var s=0,c=0;s<t.length&&c<i.length;){var l=t[s],u=i[c];if(y.isPrototypeOf(l)&&l.datatype.rest||b.isPrototypeOf(l)&&l.rest){for(var p=c;c<i.length&&S(l,u);)u=i[c+=1];y.isPrototypeOf(l)?l.datatype=[l.datatype]:b.isPrototypeOf(l)&&(l=b.create("array")),o=o.concat(e(l,v.isPrototypeOf(n)?v.create(n,{first:p+1,last:c+1}):i.slice(p,c)))}else o=o.concat(e(l,v.isPrototypeOf(n)?v.create(n,c+1):u)),c+=1;s+=1}return s<t.length?a&&w.create("operation","I can't unpack this array because it needs ".concat(t.length-s," more value").concat(0<t.length-s?"s":"",".")):o}if(t instanceof Map&&i instanceof Map){var d,f=_createForOfIteratorHelper(t.entries());try{for(f.s();!(d=f.n()).done;){var h=_slicedToArray(d.value,2),m=h[0],g=h[1];if(!i.has(m))return a&&w.create("operation","I can't unpack this datamap because it needs a '"+m+"' data name.");o=o.concat(e(g,v.isPrototypeOf(n)?v.create(n,m):i.get(m)))}}catch(e){f.e(e)}finally{f.f()}return o}if(y.isPrototypeOf(t)){if("function"==typeof t.datatype.destructure)return[{dest:t,value:i,src:n}].concat(t.datatype.destructure(i));if(!S(i,t.datatype))return a&&w.create("operation","I can't put ".concat(k(i)," into ").concat(t.varRef.TwineScript_ToSource()," because it doesn't match ").concat(t.varRef.TwineScript_ToSource(),"'s datatype, ").concat(k(t.datatype),"."));o=o.concat(e(t.datatype,i))}return v.isPrototypeOf(t)||y.isPrototypeOf(t)?o.concat({dest:t,value:i,src:n}):"function"==typeof t.destructure?o.concat(t.destructure(i)):S(i,t)?o:a&&w.create("operation","I tried to unpack, but "+k(t)+" in the pattern didn't match "+k(i)+".")}(this.dest,this.src);if(e=w.containsError(r))return e;if(!r.length)return w.create("operation","I can't store a new value inside "+k(this.dest)+" that isn't in a variable.","You need a variable, or a data structure containing variables at certain positions, to store the value.");var a,o=_createForOfIteratorHelper(r.reverse());try{for(o.s();!(a=o.n()).done;){var i=a.value,s=i.dest,c=i.value,l=i.src;if(y.isPrototypeOf(s)){if(e=w.containsError(s.defineType()))return e;s=s.varRef}if(e=s.set(c,this.srcRef),w.isPrototypeOf(e))return e;t&&l&&l.delete(),n.shift(k(s)+" is now "+k(c))}}catch(e){o.e(e)}finally{o.f()}return n.join("; ")},create:function(e,t,n,r){return w.containsError(e)?e:w.containsError(t)?t:Object.assign(Object.create(this),{dest:e,src:t,operator:n,srcRef:r})}})}),define("datatypes/changercommand",["utils","utils/operationutils","internaltypes/changedescriptor","internaltypes/twineerror"],function(e,t,n,r){var i=e.plural,a=e.impossible,o=t.is,s=t.toSource,c={},l={TwineScript_TypeID:"changer",TwineScript_TypeName:"a changer",TwineScript_Print:function(){return"`[A ("+this.macroName+":) changer]`"},TwineScript_ToSource:function(){return"("+this.macroName+":"+("else"===this.name?"":this.params.map(s))+")"+(this.next?"+"+this.next.TwineScript_ToSource():"")},get TwineScript_ObjectName(){1===this.params.length&&36<(e=s(this.params[0])).length&&(e=void 0);for(var e,t="a (".concat(this.macroName,":").concat(e||"",") changer"),n=this.next,r=(n&&(t+=" combined with "),0);n&&t.length<48;){var a="(".concat(n.macroName,":)");t+=(0<r&&!n.next?" and ":"")+a+(n.next?", ":""),n=n.next,r+=1}for(var o=0;n&&o<99;)n=n.next,o+=1;return 0<o&&(t+="".concat(0<r?" and ":"").concat(i(o,"other changer"))),t},summary:function(){var e=n.create();return this.run(e),e.summary()},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)||a("ChangerCommand.create","params was not an array but "+t),Object.assign(Object.create(this),{macroName:e,params:t,next:n,canEnchant:r})},"TwineScript_+":function(e){for(var t=this.TwineScript_Clone(),n=t;n.next;)n=n.next;return n.next=e,t.canEnchant=this.canEnchant&&e.canEnchant,t},TwineScript_is:function(e){if(l.isPrototypeOf(e))return this.macroName===e.macroName&&o(this.params,e.params)&&o(this.next,e.next)},TwineScript_Clone:function(){for(var e=l.create(this.macroName,this.params,this.next),t=e;t.next;)t=t.next=t.next.TwineScript_Clone();return e.canEnchant=this.canEnchant,e},run:function(e,t){var n="output"===this.macroName?[t||this]:this.params,n=c[this.macroName].apply(c,[e].concat(_toConsumableArray(n)));if(r.containsError(n))return n;this.next&&this.next.run(e,t||this)},register:function(e,t){c[e]=t}};return Object.freeze(l)}),define("datatypes/codehook",[],function(){var t=Object.freeze({TwineScript_TypeName:"a code hook",TwineScript_ObjectName:"a code hook",TwineScript_ToSource:function(){return this.source},TwineScript_Print:function(){return this.code},TwineScript_toString:function(){return this.source},TwineScript_is:function(e){return t.isPrototypeOf(e)&&this.source===e.source},TwineScript_Clone:function(){return t.create(this.code,this.source)},create:function(e,t){return Object.assign(Object.create(this),{code:e,source:t})}});return t}),define("datatypes/colour",["jquery"],function(c){var l=Math.max,u=Math.min,a=Math.sin,o=Math.cos,i=Math.pow,p=Math.round,d=Math.floor,s=Math.atan2,f=Math.cbrt,h=Math.sqrt,m=Math.PI,g=Object.assign,y=Object.create,b=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,t=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,v=y(null);function w(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];if(0<r.length)return w.apply(void 0,[w(e,t)].concat(r));if(!t)return e;for(var o=[],i=0;i<e.length;i++){o[i]=[];for(var s=0;s<t[0].length;s++){for(var c=0,l=0;l<e[0].length;l++)c+=e[i][l]*t[l][s];o[i][s]=c}}return o}function n(e){var t,n=e.r,r=e.g,a=e.b,e=e.a,o=l(n/=255,r/=255,a/=255),i=u(n,r,a),s=(o+i)/2,c=o-i;if(o===i)return{h:0,s:0,l:s};switch(o){case n:t=(r-a)/c+(r<a?6:0);break;case r:t=(a-n)/c+2;break;case a:t=(n-r)/c+4}return{h:t=p(60*t),s:.5T?i(r[0],3):(116*r[0]-16)/S,S*TT?i(r[2],3):(116*r[2]-16)/S].map(function(e,t){return e*k[t]}),t=_slicedToArray(x(w([[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],w([[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]],_(n)))).map(function(e){return u(255,l(0,255*(.0031308<(e=e)?1.055*i(e,1/2.4)-.055:12.92*e)))}),3);return{r:t[0],g:t[1],b:t[2],a:e}}function e(e){function t(e){return 1e-5<=n[e]&&n[e]<=255-1e-5}var n=O(e);if(Object.keys(n).every(t))return n;var r=(e=_objectSpread({},e)).c,a=0;for(e.c/=2;1e-5<r-a;)n=O(e),Object.keys(n).every(t)?a=e.c:r=e.c,e.c=(r+a)/2;return O(e)}var A=Object.freeze({TwineScript_TypeID:"colour",TwineScript_TypeName:"a colour",TwineScript_ObjectName:"a colour",TwineScript_DebugName:function(){return"a colour "+this.TwineScript_Print()},"TwineScript_+":function(e){var t=this.toRGBA(),e=e.toRGBA();return A.create({r:u(p(.6*(t.r+e.r)),255),g:u(p(.6*(t.g+e.g)),255),b:u(p(.6*(t.b+e.b)),255),a:(t.a+e.a)/2})},TwineScript_Print:function(){var e=this.toRGBA();return"»},TwineScript_is:function(e){var t;return!!A.isPrototypeOf(e)&&(e.lcha&&this.lcha?e.lcha.l===this.lcha.l&&e.lcha.c===this.lcha.c&&e.lcha.h===this.lcha.h&&e.a===this.a:(t=this.toRGBA(),(e=e.toRGBA()).r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a))},TwineScript_Clone:function(){return A.create(this)},toRGBAString:function(){var e=this.toRGBA(),t=e.r,n=e.g,r=e.b,e=e.a;return»rgba(«.concat(t,», «).concat(n,», «).concat(r,», «).concat(e,»)»)},toHSLA:function(){return n(this.toRGBA())},toRGBA:function(){return this.lch?e(_objectSpread({a:this.a},this.lch)):this},toLCHA:function(){return this.lch?_objectSpread({a:this.a},this.lch):(t=(e=this).r,n=e.g,r=e.b,e=e.a,n=[116*(t=x(w([[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]],w([[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],_([t/255,n/255,r/255].map(function(e){return e<.04045?e/12.92:i((e+.055)/1.055,2.4)}))))).map(function(e,t){return e/k[t]}).map(function(e){return T<e?f(e):(S*e+16)/116}))[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])],r=180*s(n[2],n[1])/m,{l:n[0]/100,c:h(i(n[1],2)+i(n[2],2)),h:0<=r?r:360+r,a:e});var e,t,n,r},LCHRotate:function(e){e<0&&(e=360+e);var t=this.toLCHA();return t.h=(t.h+e)%360,A.create(t)},TwineScript_GetProperty:function(e){var t;return"lch"===e?(t=this.toLCHA(),new Map([["l",t.l],["c",t.c],["h",t.h]])):(t=this.toRGBA(),"h"===e||"s"===e||"l"===e?n(t)[e]:"r"===e||"g"===e||"b"===e||"a"===e?t[e]:void 0)},TwineScript_Properties:["h","s","l","r","g","b","a","lch"],TwineScript_ToSource:function(){if(0===this.a)return"transparent";var e=!this.lch&&n(this);if(1===e.l&&!e.h&&!e.s)return"white";if(0===e.l&&!e.h&&!e.s)return"black";if(.5<=e.l&&e.l<.5334&&0===e.s)return"gray";if(.5===e.l&&.8<=e.s&&e.s<.804){var t={0:"red",30:"orange",60:"yellow",90:"lime",120:"green",180:"cyan",210:"blue",240:"navy",270:"purple",300:"magenta"}[e.h];if(t)return t}return"(".concat(this.lch?"lch":"hsl",":").concat(this.lch?[this.lch.l,this.lch.c,this.lch.h]:[e.h,e.s,e.l]).concat(1!==this.a?","+this.a:"",")")},create:function(e){var t,n,r,a,o,i;return"string"==typeof e?this.create((A.isHexString(e)?function(e){return"string"!=typeof e?e:(e=(e=e.replace("#","")).replace(b,"$1$1$2$2$3$3"),{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)})}:function(e){var t;return e in v?v[e]:(t="transparent"===(t=c("
«).css(«background-color»,e).css(«background-color»))?{r:0,g:0,b:0,a:0}:t.startsWith(«rgb»)?t.match(/\d+/g).reduce(function(e,t,n){return e[«rgb»[n]]=+t,e},{}):{r:192,g:192,b:192},v[e]=t)})(e)):!(«h»in e&&»s»in e&&»l»in e)||»r»in e||»g»in e||»b»in e?(«a»in e&&»number»==typeof e.a||(e.a=1),»h»in e&&»c»in e&&!(«s»in e)&&»l»in e?g(y(this),{a:e.a,lch:{l:e.l,c:e.c,h:e.h}}):g(y(this),e)):this.create((a=(t=e).h,o=e.s,i=e.l,t=e.a,0===o?{r:e=d(255*i),g:e,b:e}:(r=2*i-(n=i<.5?i*(1+o):i+o-i*o),{r:d(255*s((a/=360)+1/3)),g:d(255*s(a)),b:d(255*s(a-1/3)),a:t})));function s(e){return e<0&&(e+=1),1<e&&–e,e<1/6?r+6*(n-r)*e:e<.5?n:e<2/3?r+(n-r)*(2/3-e)*6:r}},isHexString:function(e){return"string"==typeof e&&"#"===e[0]&&(e.slice(1).match(b)||e.slice(1).match(t))},isCSS3Function:function(e){return"string"==typeof e&&/^(?:rgb|hsl)a?\(\s*\d+(?:\.\d+)?\s*,\s*\d+(?:\.\d+)?%?\s*,\s*\d+(?:\.\d+)?%?(?:,\s*\d+(?:\.\d+)?\s*)?\)$/.test(e)}});return A}),define("datatypes/customcommand",["internaltypes/changedescriptor","internaltypes/twineerror"],function(l,u){var p=Object.assign,d=Object.create;return Object.seal({TwineScript_TypeID:"command",TwineScript_ObjectName:"a custom command",TwineScript_TypeName:"a custom command",TwineScript_Print:function(){return"`[a custom command]`"},create:function(e){var t,n=e.toSource,r=e.changer,a=e.hook,o=e.variables,i={};for(t in o)i[t]=[o[t]];var s,c=l.create({source:a,loopVars:i},r);return u.containsError(c)?c:s=p(d(this),{TwineScript_Attach:function(e,t){c.section=e;e=t.run(c);return u.containsError(e)?e:s},TwineScript_Run:function(e){c.section=e;e=c;return c=l.create({source:a,loopVars:i},r),e},TwineScript_ToSource:function(){return n},TwineScript_CustomCommand:function(){return e}})}})}),define("datatypes/custommacro",["jquery","utils","renderer","utils/operationutils","datatypes/customcommand","internaltypes/varref","internaltypes/varscope","internaltypes/twineerror","internaltypes/twinenotifier"],function(w,e,k,t,S,T,_,x,O){function n(v){return function(e){v.called+=1;for(var t=v.varNames,n=v.params,r=v.body,a=E(N(_),{TwineScript_VariableStore:{type:"temp",name:v.TwineScript_ObjectName+" call #"+v.called},TwineScript_TypeDefs:N(null)}),o=[],i=0,s=!1,c=arguments.length,l=new Array(1<c?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];for(var p=0;p<l.length;p+=1){var d=l[p],f=t[i],h=(a.TwineScript_TypeDefs[f]=n[i].datatype.rest?n[i].datatype.create("array"):n[i].datatype,T.create(a,f));if(x.containsError(h))return h;if(n[i].datatype.rest){var s=!0,m=(a[f]||[]).concat([d]);if(p<l.length-1){a[f]=m;continue}h.set(m)}else h.set(d),i+=1;o.push(O.create(A(h)+" is now "+A(a[f])))}if(!s&&null!=(g=n[i])&&g.datatype.rest){var g=T.create(a,t[i]);if(x.containsError(g))return g;g.set([]),a.TwineScript_TypeDefs[name]=n[i].datatype.create("array")}var y,g=w("
«).append(k.exec(r.code)),b=e.stack.length,r=(e.stack.unshift({tempVariables:a,dom:g,output:function(e){y=e}}),e.evalReplay);for(e.evalReplay=null,e.execute();e.stack.length>b;)e.stack.shift();e.evalReplay=r;r=g.find(«tw-error»);return r.length?(g.prepend(o.map(function(e){return e.render()}),» "),t=!!e[0].normalize&&(e.append(document.createTextNode("0-"),document.createTextNode("2"),document.createTextNode(""))[0].normalize(),1===e.contents().length))};var f="tw-collapsed,[collapsing=true]";var o=/^(=*)([^=]+)=*$/;return Object.freeze({dialog:function(){var e,t=(c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).section,n=void 0===(n=c.parent)?u.storyElement:n,r=c.cd,a=void 0===(a=c.message)?"":a,o=c.defaultValue,i=void 0===(c=c.buttons)?[{name:"OK",confirm:!0,callback:Object}]:c,s=("a code hook"===a.TwineScript_TypeName&&(a=a.code),l(""+(o||""===o?"\n":"")+""+(i.length?i.reduce(function(e,t,n){t=t.name;return e+""+t+""},""):""+i[0].name+"")+"")),c=s.find("tw-dialog");return n.append(s),t?(t.renderInto(a,c,_objectSpread(_objectSpread({},r),{},{append:"prepend"})),null!=(n=(null==r?void 0:r.transition)&&s.find("tw-dialog > tw-transition-container"))&&n.length&&n.appendTo(s).append(c.prepend(n.contents().detach()))):c.prepend(p.exec(a)),o&&((e=s.find("input").last()).val(o).on("keypress",function(e){13===e.which&&(s.remove(),i.filter(function(e){return e.confirm}).forEach(function(e){return e.callback()}))}),setTimeout(function(){return e.focus()},100)),i.reverse().forEach(function(e,t){l(s.find("tw-link").get(-t-1)).on("click",function(){u.options.debug&&u.options.ignoreClickEvents&&!l(s).is(".eval-replay, .harlowe-crash")||(s.remove(),e.callback())})}),s},realWhitespace:n,textNodeToChars:function(r){var e=_toConsumableArray(r.textContent);return 1===e.length?[r]:e.reduce(function(e,t){return t.match(n)&&e.length&&e[e.length-1].match(n)?e[e.length-1]+=t:e.push(t),e},[]).reduce(function(e,t){var n=r;return t.length<r.textContent.length&&(r=r.splitText(t.length)),e.concat(n)},[])},findTextInNodes:function e(t,n){var r=[],a="",o=[];if(!t.length||!n)return o;for(;0<t.length;){r.push(t[0]),a+=t[0].textContent,t.shift();var i=a.indexOf(n);if(-1=r[0].textContent.length;)i-=r[0].textContent.length,r.shift();if(1===r.length){var c=d(r[0],i,i+n.length);o.push(c[0]),c[1]&&t.unshift(c[1]);break}o.push(d(r[0],i,r[0].length)[0]),o.push.apply(o,_toConsumableArray(r.slice(1,-1))),c=d(r[r.length-1],0,r[r.length-1].textContent.length-s),o.push(c[0]),c[1]&&t.unshift(c[1]),o=o.filter(Boolean);break}}return[o].concat(_toConsumableArray(e(t,n)))},collapse:function(e){function n(e){return 0===l(this||e).parentsUntil(f).filter("tw-verbatim, tw-expression, [collapsing=false]").length}var t=function e(t){var n=t[0],r=t.parent();return!r.length||t.findAndFilter("tw-story").length?null:(t=(t=r.textNodes().filter(function(e){return 4&(e=e.compareDocumentPosition(n))&&!(8&e)}))[t.length-1])||e(r)}(e),r=(l(t).parents(f).length||(t=null),function e(t){var n=t[0],r=t.parent();return!r.length||t.findAndFilter("tw-story").length?null:r.textNodes().filter(function(e){return 2&(e=e.compareDocumentPosition(n))&&!(8&e)})[0]||e(r)}(e)),a=(l(r).parents(f).length||(r=null),"br:not([data-raw]),tw-consecutive-br:not([data-raw])"),o=(e.find(a).filter(n).replaceWith(document.createTextNode(" ")),(e=l(e.get().map(function(e){return l(e).filter(n).is(a)?l(document.createTextNode(" ")).replaceAll(e)[0]:e}))).textNodes()),i=0;o.reduce(function(e,t){return n(t)?(t.textContent=t.textContent.replace(s," ")," "!==t.textContent[0]||e&&e.textContent&&!(-1<e.textContent.search(/\s$/))||(t.textContent=t.textContent.slice(1)),t):document.createTextNode("A")},t),_toConsumableArray(o).reverse().every(function(e){return!(!n(e)||(e.textContent.match(/^\s*$/)?(i+=e.textContent.length,e.textContent=""):(e.textContent=e.textContent.replace(/\s+$/,function(e){return i+=e.length,""}),1)))}),0<i&&r&&(o[o.length-1].textContent+=" "),e[0]&&c()&&e[0].normalize()},geomStringRegExp:o,geomParse:function(e){var t,n,r,a;return!e||(t=e.length,n=(a=_slicedToArray(o.exec(e)||[],3))[0],r=a[1],a=a[2],!n)||a===e&&1<a.length?{marginLeft:0,size:0}:{marginLeft:r.length/t*100,size:a.length/t*100}}})}),define("utils/scripttag",["state","utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(a,o,i,s){return function(e,r){Function("script","scope","with(scope){var scope=void 0,arguments=void 0;eval([script,script=void 0][0]);}")(e,Object.create(null,Object.keys(a.variables).map(function(e){return!e.startsWith("TwineScript_")&&"$"+e}).concat(Object.keys(r).map(function(e){return!e.startsWith("TwineScript_")&&"_"+e})).reduce(function(e,n){return n&&(e[n]={get:function(){var e=("$"===n[0]?a.variables:r)[n.slice(1)];if(o.isHarloweJSValue(e))return o.clone(e);throw s.create("","The contents of the variable ".concat(n,", ").concat(o.objectName(e),", couldn't be converted to a Javascript value."),"Only booleans, strings, numbers, datamaps, datasets and arrays can be converted to Javascript values.")},set:function(e){var t="$"===n[0]?a.variables:r;if(!o.isHarloweJSValue(e))throw s.create("","The Javascript value, ".concat(e,", couldn't be converted to a Harlowe value and assigned to the variable ").concat(n,"."),"Only booleans, strings, numbers (except NaN and Infinity), Maps, Sets and Arrays can be converted to Harlowe values.");e=o.clone(e);t=i.create(t,n.slice(1)).set(e);if(s.containsError(t))throw t}}),e},{})))}}),!function(){function e(t,n,r){return function(e){return"background-color: hsla(".concat(t,",").concat(n,"%,").concat(r,"%,").concat(e,");")}}var t={boolean:"color:hsla(0,0%,30%,1.0)",array:"color:hsla(0,100%,30%,1.0)",dataset:"color:hsla(30,100%,40%,1.0)",number:"color:hsla(30,100%,30%,1.0)",datamap:"color:hsla(60,100%,30%,1.0)",changer:"color:hsla(90,100%,30%,1.0)",lambda:"color:hsla(120,100%,40%,1.0)",hookName:"color:hsla(160,100%,30%,1.0)",string:"color:hsla(180,100%,30%,1.0)",identifier:"color:hsla(200,80%,40%,1.0)",variable:"color:hsla(200,100%,30%,1.0)",tempVariable:"color:hsla(200,70%,20%,1.0)",datatype:"color:hsla(220,100%,30%,1.0)",colour:"color:hsla(280,100%,30%,1.0)",macro:"color:hsla(320,80%,30%,1.0)",twineLink:"color:hsla(240,100%,20%,1.0)"},o=(t.gradient=t.colour,t.command=t.twineLink,t.instant=t.metadata=t.any=t.customMacro=t.macro,Math.min),n=e(40,100,50),r=e(220,100,50),i=/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*(\d+\.\d+)\)/g,s="cm-harlowe-3-",a=(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n={root:"box-sizing:border-box;",hook:n(.05),"hook-2":n(.1),"hook-3":n(.15),"hook-4":n(.2),"hook-5":n(.25),"hook-6":n(.3),"hook-7":n(.35),"hook-8":n(.4),"^=hook , ^=hook-":"font-weight:bold;",unclosedHook:n(.05)+"font-weight:bold;"},"error:not([class*='"+s+"string'])","background-color: hsla(17,100%,50%,0.5) !important;"),"^=macroName","font-style:italic;"),"macroName-boolean",t.boolean),"macroName-array",t.array),"macroName-dataset",t.dataset),"macroName-datatype",t.datatype),"macroName-number",t.number),"macroName-datamap",t.datamap),"macroName-changer",t.changer),"macroName-string",t.string),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n,"macroName-colour, macroName-gradient",t.colour),"macroName-command, macroName-instant, macroName-metadata",t.command),"macroName-custommacro, macroName-macro, macroName-any",t.macro),"^=macro ","font-weight:bold;"+t.macro),"comma, spread",t.macro),"addition",t.any),"subtraction, multiplication, division",t.number),"is, and, or, not, isNot, contains, doesNotContain, isIn, isA, isNotA, isNotIn, matches, doesNotMatch",t.boolean),"bold, strong","font-weight:bold;"),"italic, em","font-style:italic;"),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n,"sup","vertical-align: super;font-size:0.8em;"),"strike","text-decoration: line-through;"),"verbatim","background-color: hsla(0,0%,50%,0.1);font:var(--font-monospaced)"),"^=bold, ^=strong, ^=italic, ^=em, ^=sup, ^=verbatim, ^=strike","font-weight:100; color: hsla(0,0%,0%,0.5)"),"^=collapsed","font-weight:bold; color: hsla(201,100%,30%,1.0);"),"unclosedCollapsed",r(.025)+"font-weight:bold; color: hsla(201,100%,30%,1.0);"),"collapsed",r(.025)),"collapsed.hook",r(.05)),"collapsed.hook-2",r(.1)),"collapsed.hook-3",r(.15)),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n,"collapsed.hook-4",r(.2)),"collapsed.hook-5",r(.25)),"collapsed.hook-6",r(.3)),"collapsed.hook-7",r(.35)),"collapsed.hook-8",r(.4)),"twineLink:not(.text)",t.twineLink),"tag, scriptStyleTag, comment","color: hsla(240,34%,25%,1.0);"),"boolean",t.boolean),"string",t.string),"number",t.number),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n,"variable",t.variable),"tempVariable",t.tempVariable),"hookName",t.hookName),"datatype",t.datatype),"colour",t.colour),"cssTime",t.number),"passageString",t.variable+";text-decoration:underline 1px;"),"tagString",t.variable+";text-decoration:underline 1px dotted;"),"variableOccurrence, hookOccurrence","background: hsla(159,50%,75%,1.0) !important;"),"^=where, ^=via, ^=with, ^=making, ^=each, ^=when",t.lambda+"; font-style:italic;"),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(n,"heading","font-weight:bold;"),"hr","background-image: linear-gradient(0deg, transparent, transparent 45%, hsla(0,0%,75%,1.0) 45%, transparent 55%, transparent);"),"align","color: hsla(14,99%,37%,1.0); background-color: hsla(14,99%,87%,0.1);"),"column","color: hsla(204,99%,37%,1.0); background-color: hsla(204,99%,87%,0.1);"),"escapedLine","font-weight:bold; color: hsla(51,100%,30%,1.0);"),"identifier, property, belongingProperty, itsProperty, belongingItProperty, belongingItOperator, possessiveOperator, belongingOperator",t.identifier),"toString",function(){var a=this;return Object.keys(this).reduce(function(e,n){var r;return"toString"!==n&&(r=n.split(", ").map(function e(t){return-1<t.indexOf(".")?t.split(/\./g).map(e).join(""):0===t.indexOf("^=")?"[class^='"+s+t.slice(2)+"']":"."+s+t}),e+=r.join(", ")+"{"+a[n]+"}",a[n].match(i))&&[".theme-dark","[data-app-theme=dark]"].forEach(function(t){e+=r.map(function(e){return t+" "+e}).join(", ")+"{"+a[n].replace(i,function(e,t,n,r,a){return"hsla("+t+","+o(100,1.5*+n)+"%,"+(100-r)+"%,"+a+")"})+"}"}),e},"")})+"");"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports={Colours:t,CSS:a,versionClass:s}:"function"==typeof define&&define.amd&&define("utils/typecolours",[],function(){return{Colours:t,CSS:a,versionClass:s}})}.call(void 0);
;require("harlowe")}());
Published by
«),x.create(«propagated»,»».concat(r.length,» error»).concat(1<r.length?"s":""," occurred when running ").concat(v.TwineScript_ObjectName,"."),void 0,g)):void 0===y?x.create("custommacro","".concat(v.TwineScript_ObjectName," didn't output any data or hooks using (output:) or (output-data:).")):"object"===_typeof(y)&&"changer"in y?S.create(E(y,{toSource:"(".concat(v.TwineScript_KnownName||"unnamed",":").concat(l.map(C),")")})):y}}var r=e.andList,A=t.objectName,a=t.typeName,o=t.matches,C=t.toSource,E=Object.assign,N=Object.create,i=Object.seal({TwineScript_TypeID:"macro",TwineScript_TypeName:"a custom macro",TwineScript_GetProperty:function(e){if("params"===e)return _toConsumableArray(this.params)},TwineScript_Properties:["params"],TwineScript_Print:function(){return"`["+this.TwineScript_ObjectName+"]`"},TwineScript_Clone:function(){var e=E(N(i),this);return e.fn=n(e),e},TwineScript_ToSource:function(){return"(macro:"+this.params.map(function(e){return e.TwineScript_ToSource()}).concat("")+this.body.TwineScript_ToSource()+")"},createFromFn:function(e,t,n,r){return E(N(i),{params:[],fn:e,typeSignature:r,TwineScript_ObjectName:t,TwineScript_ToSource:n,TwineScript_KnownName:""})},create:function(e,t){t=E(N(i),{params:e,called:0,varNames:e.map(function(e){return e.varRef.propertyChain[0]}),typeSignature:e.map(function(t){var e=t.datatype.toTypeSignatureObject?t.datatype.toTypeSignatureObject({rest:t.rest}):{pattern:"range",range:function(e){return o(t.datatype,e)},name:a(t.datatype)};return t.rest?{pattern:"zero or more",innerType:e}:e}),body:t,TwineScript_KnownName:"",TwineScript_ObjectName:"a custom macro (with ".concat(e.length?r(e.map(C)):"no params",")")});return t.fn=n(t),t}});return i}),define("datatypes/datatype",["utils","utils/operationutils","datatypes/changercommand","datatypes/colour","datatypes/gradient","datatypes/lambda","datatypes/custommacro","datatypes/codehook","internaltypes/twineerror"],function(e,t,n,r,a,o,i,s,c){var l=e.realWhitespace,u=e.anyRealLetter,p=e.anyCasedLetter,d=e.anyNewline,f=t.objectName,e=Object.seal,h=Object.keys,m=Math.floor,g=Math.abs,y={TwineScript_TypeID:"datatype",TwineScript_TypeName:"a datatype",TwineScript_Print:function(){return"`["+this.TwineScript_ObjectName+"]`"},get TwineScript_ObjectName(){return"the "+(this.rest?"…":"")+this.name+" datatype"},TwineScript_is:function(e){return y.isPrototypeOf(e)&&e.name===this.name},TwineScript_Clone:function(){return this.rest?this:Object.create(this)},TwineScript_ToSource:function(){return(this.rest?"…":"")+this.name},TwineScript_IsTypeOf:function(e){var t=this.name,n=this.rest;return!!v[t]&&v[t](e,n)},toTypeSignatureObject:function(){var e=this.name,e={pattern:"range",range:v[e],name:"a "+("dm"===e?"datamap":"ds"===e?"dataset":"num"===e?e+"ber":"str"===e?e+"ing":"color"===e?"colour":"bool"===e?e+"ean":"alnum"===e?"alphanumeric character":"int"===e?e+"eger":"even"===e||"odd"===e?e+" number":e.endsWith("case")||"whitespace"===e?e+" character":"empty"===e?e+" value":e)};return this.rest?{pattern:"zero or more",innerType:e}:e},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=(e="datamap"===e?"dm":"dataset"===e?"ds":"number"===e?"num":"string"===e?"str":"color"===e?"colour":"boolean"===e?"bool":"alphanumeric"===e?"alnum":"integer"===e?"int":"newline"===e?"linebreak":e,Object.create(this));return n.name=e,n.rest=t,n},from:function(t){var e=h(b).find(function(e){return b[e](t)});return e?y.create(e):c.create("datatype",f(t)+" doesn't correspond to a datatype value.")}},b={array:Array.isArray,dm:function(e){return e instanceof Map},ds:function(e){return e instanceof Set},datatype:function(e){return y.isPrototypeOf(e)},changer:function(e){return n.isPrototypeOf(e)},colour:function(e){return r.isPrototypeOf(e)},gradient:function(e){return a.isPrototypeOf(e)},lambda:function(e){return o.isPrototypeOf(e)},macro:function(e){return i.isPrototypeOf(e)},codehook:function(e){return s.isPrototypeOf(e)},command:function(e){return e&&"command"===e.TwineScript_TypeID},str:function(e){return"string"==typeof e},num:function(e){return"number"==typeof e},bool:function(e){return"boolean"==typeof e}},v=_objectSpread(_objectSpread({},b),{},{even:function(e){return!isNaN(e)&&m(g(e))%2==0},odd:function(e){return!isNaN(e)&&m(g(e))%2==1},empty:function(e){return e instanceof Map||e instanceof Set?!e.size:!(!Array.isArray(e)&&"string"!=typeof e||e.length)},int:function(e){return"number"==typeof e&&e===(0|e)},uppercase:function(e){return"string"==typeof e&&1===_toConsumableArray(e).length&&_toConsumableArray(e).every(function(e){return e!==e.toLowerCase()})},lowercase:function(e){return"string"==typeof e&&1===_toConsumableArray(e).length&&_toConsumableArray(e).every(function(e){return e!==e.toUpperCase()})},whitespace:function(e){return"string"==typeof e&&!!e.match("^"+l+"$")},digit:function(e){return"string"==typeof e&&!!e.match("^\\d$")},alnum:function(e){return"string"==typeof e&&!!e.match("^"+u+"$")},anycase:function(e){return"string"==typeof e&&!!e.match("^"+p+"$")},linebreak:function(e){return"string"==typeof e&&!!e.match("^"+d+"$")},any:function(){return!0},const:function(){return!0}});return e(y)}),define("datatypes/gradient",["utils/operationutils"],function(e){var t=e.toSource,n=Object.freeze({TwineScript_TypeID:"gradient",TwineScript_TypeName:"a gradient",TwineScript_ObjectName:"a gradient",TwineScript_DebugName:function(){return"a gradient "+this.TwineScript_Print()},TwineScript_GetProperty:function(e){var t=this;return"angle"===e?this.angle:"stops"===e?this.stops.map(function(e){return new Map([[t.repeating?"pixels":"percent",e.stop],["colour",e.colour.TwineScript_Clone()]])}):void 0},TwineScript_Properties:["angle","stops"],TwineScript_ToSource:function(){return"(gradient:"+this.angle+","+this.stops.map(function(e){return t(e.stop)+","+t(e.colour)})+")"},TwineScript_is:function(e){var r=this;return e.angle===this.angle&&e.stops.length===this.stops.length&&e.stops.every(function(e,t){var n=e.colour,e=e.stop;return r.stops[t].stop===e&&r.stops[t].colour.TwineScript_is(n)})},TwineScript_Clone:function(){return n.create(this.angle,_toConsumableArray(this.stops))},TwineScript_Print:function(){return"»},create:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return Object.assign(Object.create(this),{angle:e,stops:t.sort(function(e,t){return e.stop-t.stop}),repeating:n})},multiply:function(t){return n.create(this.angle,this.stops.map(function(e){return{colour:e.colour,stop:e.stop*t}}))},toLinearGradientString:function(){var r=this;return(this.repeating?"repeating-":"")+"linear-gradient(".concat(this.angle,"deg, ").concat(this.stops.reduce(function(e,t){var n=t.colour,t=t.stop;return e+n.toRGBAString()+" "+t*(r.repeating?1:100)+(r.repeating?"px,":"%,")},"").slice(0,-1),")")}});return n}),define("datatypes/hookset",["jquery","utils","utils/renderutils","utils/operationutils"],function(g,s,e,t){var y=e.textNodeToChars,b=e.realWhitespace,c=e.findTextInNodes,r=t.toSource;function l(e){function t(n,e){if(Array.isArray(e))return e.reduce(function(e,t){return e.add(n.get(t))},g());if(e&&"object"===_typeof(e)&&"first"in e&&"last"in e){for(var t=e.first,r=e.last,a=n.length,o=(t<0&&(t+=a),r<0&&(r+=a),[n.get(t)]);t!==r;)t+=Math.sign(r-t),o.push(n.get(t));return g(o)}if("string"==typeof e){if("chars"===e){var i,s=[],c=_createForOfIteratorHelper(n.textNodes(m));try{for(c.s();!(i=c.n()).done;){var l,u=i.value,p=_createForOfIteratorHelper(y(u));try{for(p.s();!(l=p.n()).done;){var d=l.value;d.textContent.match(b)||s.push(d)}}catch(e){p.e(e)}finally{p.f()}}}catch(e){c.e(e)}finally{c.f()}return g(s)}if("links"===e)return n.findAndFilter("tw-link, .enchantment-link");if("visited"===e)return n.findAndFilter("tw-link.visited");var f,h;if("lines"===e)return f=n.findAndFilter("br:not(tw-sidebar *),tw-consecutive-br:not(tw-sidebar *)").get(),h=[[]],n.contents().each(function e(t,n){var r=(n.tagName||"").toLowerCase();if("tw-sidebar"!==r)if("tw-passage"===r||"tw-transition-container"===r)g(n).contents().each(e);else{if(f.length){if(n===f[0])return f.shift(),void h.push([]);if(16&n.compareDocumentPosition(f[0]))return h.push([]),g(n).contents().each(e),void h.push([])}h[h.length-1].push(n)}}),g(h.map(function(e){return!!e.length&&g(e).wrapAll("»).parent()[0]}).filter(Boolean))}return g(n.get(e))}var n,r,a=e.dom,m=»:not(tw-error, tw-error *)»,o=g();this.next&&(o=o.add(l.call(this.next,e)));if(this.selector){if(«string»===this.selector.type)i=this.selector.data,n=c((n=a).textNodes(),i),r=g(),n.forEach(function(e){r=r.add(g(e).wrapAll(«»).parent())}),i=r;else{if(«base»===this.selector.type)return o.add(t(l.call(this.selector.data,e),this.property));n=this.selector.data,e=’tw-hook[name=»‘+(n=s.insensitiveName(n).replace(/»/g,»"»))+'»],tw-enchantment[name=»‘+n+'»]’;var e=e+={page:», tw-story»,passage:», tw-passage»,sidebar:», tw-sidebar»,link:», tw-link, .enchantment-link»}[n]||»»,i=a.findAndFilter(e).add(a.parentsUntil(s.storyElement.parent())).filter(e)}o=this.property?o.add(t(i,this.property)):o.add(i)}return o=o.get().reduce(function(e,t){return t=g(t),e.add(t.is(«tw-enchantment»)&&t.contents().length<=1?t.contents():t)},g())}function a(e){var t,n;return e?(t=e.selector,n=e.property,e=e.next,[JSON.stringify(["base"===t.type?a(t.data):s.insensitiveName(t.data),n])].concat(_toConsumableArray(a(e))).sort()):[]}var o=Object.freeze({forEach:function(e,n){var t=l.call(this,e).each(function(e,t){return n(g(t),e)});return e.dom.findAndFilter("tw-pseudo-hook").contents().unwrap(),t},hooks:function(e){return l.call(this,e)},get TwineScript_ObjectName(){return"the hook name ".concat(this.TwineScript_ToSource())},TwineScript_TypeID:"hookName",TwineScript_TypeName:"a hook name (like ?this)",TwineScript_Unstorable:!0,TwineScript_ToSource:function(){var e="",t=this.selector,n=t.type,t=t.data;return"name"===n?t.match(RegExp("^"+s.anyRealLetter+"+$"))?e+="?"+t:e+="(hooks-named:"+JSON.stringify(t)+")":"string"===n?e+=JSON.stringify(t):"base"===n&&(e+=t.TwineScript_ToSource()+"'s "+r(this.property,"property")),this.next&&(e+=" + "+this.next.TwineScript_ToSource()),e},"TwineScript_+":function(e){for(var t=this.TwineScript_Clone(),n=t;n.next;)n=n.next;return n.next=e,t},TwineScript_is:function(e){return a(this)+""==a(e)+""},TwineScript_GetProperty:function(e){return o.create({type:"base",data:this},e,void 0)},TwineScript_Properties:["chars","links","lines","visited"],TwineScript_Clone:function(){return o.create(this.selector,this.property,this.next)},create:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;return Object.assign(Object.create(this||o),{selector:Object.freeze(e),property:t,next:n})},from:function(e){return o.isPrototypeOf(e)||"string"==typeof e||s.impossible("HookSet.from() was given a non-HookSet non-string."),o.isPrototypeOf(e)?e:o.create({type:"string",data:e})}});return o}),define("datatypes/lambda",["utils/operationutils","internaltypes/varscope","internaltypes/varref","internaltypes/twineerror"],function(e,h,s,m){var g=e.objectName;var c=Object.freeze({TwineScript_TypeID:"lambda",TwineScript_TypeName:"a lambda",get TwineScript_ObjectName(){return'a "'+("making"in this?"making … ":"")+("each"in this?"each … ":"")+("where"in this?"where … ":"")+("when"in this?"when … ":"")+("via"in this?"via … ":"")+'" lambda'},TwineScript_Print:function(){return"`[A lambda]`"},TwineScript_is:function(e){return e===this},TwineScript_ToSource:function(){return this.source},TypeSignature:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return{pattern:"lambda",innerType:c,clauses:t,typeName:'a "'+t.concat("").join(" …")+'" lambda'}},TwineScript_Clone:function(){return Object.assign(Object.create(c),this)},create:function(e,t,n,r){var a,o="temp variable, or typed temp variable";function i(e){e=e&&e.varRef?e.varRef:e;return void 0===e||e&&s.isPrototypeOf(e)&&h.isPrototypeOf(e.object)&&1===e.propertyChain.length}if(m.containsError(n))return n;if("making"===t&&!i(n))return m.create("syntax","I need a "+o+", to the right of '"+t+"', not "+g(n)+".");if(m.containsError(e))return e;if(c.isPrototypeOf(e)){if("when"===t||"when"in e)return m.create("syntax","A 'when' lambda cannot have any other clauses, such as '"+t+"'.");if(t in e)return m.create("syntax","This lambda has two '"+t+"' clauses.");a=e}else{if("when"===t&&void 0!==e)return m.create("syntax","A 'when' lambda shouldn't begin with a temp variable (just use 'when' followed by the condition).");if(!i(e))return m.create("syntax","This lambda needs to start with a single "+o+", not "+g(e)+".");(a=Object.create(this)).loop=e||""}return a.source=r.trim(),a[t]=n,a.making&&a.making.getName()===(a.loop&&a.loop.getName())?m.create("syntax","This lambda has two variables named '"+a.loop.getName()+"'.","Lambdas should have all-unique parameter names."):a},apply:function(e,t){var n=t.loop,r=t.pos,a=t.making,o=t.ignoreVia;function i(e,t){if(e){var n,r;if("datatype"in e&&"varRef"in e)return n=e.varRef.create(s,e.varRef.propertyChain),m.containsError(n)?n:(r=n.defineType(e.datatype),m.containsError(r)||(r=n.set(t),m.containsError(r))?r:void 0);s[e.getName()]=t}}var s=(s=t.tempVariables)||Object.create(e.stack.length?e.stackTop.tempVariables:h),t=i(this.loop,n)||i(this.making,a);if(m.containsError(t))return t;e.stack.unshift(Object.assign(Object.create(e.stackTop||null),{tempVariables:s,lambdaPos:this.when?void 0:r})),!n||this.making||this.when?e.Identifiers.it=m.create("operation","I can't use 'it', or an implied 'it', in "+this.TwineScript_ObjectName):e.Identifiers.it=n;var c,l,u,p,d,t=!o&&this.via,o="where"in this||"when"in this,f=e.evalReplay;return e.evalReplay=f?[]:null,o?(c=e.eval(this.where||this.when),l=e.evalReplay,e.evalReplay=l&&t?[]:null,!n||this.making||this.when||(e.Identifiers.it=n),u=c,p=!t||e.eval(t),d=null,u=m.containsError(u)||("boolean"!=typeof u?m.create("operation","This lambda's 'where' clause must evaluate to true or false, not "+g(u)+"."):u?p:d)):c=u=!t||e.eval(t),p=t?e.evalReplay:null,e.stack.shift(),(e.evalReplay=f)&&(o||t)&&(((d=f[f.length-1])||{}).lambda&&d.lambda.obj===this||((d={lambda:{obj:this,loops:[]},code:(f[f.length-1]||{}).code||""}).fromCode=d.code,f.push(d)),d.lambda.loops.push(_objectSpread(_objectSpread(_objectSpread({it:n,pos:r},void 0!==a&&{making:a}),t&&{viaReplay:p,viaResult:u}),o&&{whereReplay:l,whereResult:null!==c&&c}))),u},filter:function(r,e){var a,o=this,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return e.reduce(function(e,t,n){return a||(n=o.apply(r,{loop:t,pos:n+1,ignoreVia:!0,tempVariables:i}),a=m.containsError(n))||e.concat(n?[t]:[])},[])}});return c}),define("datatypes/typedvar",["utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(e,a,o){var i=e.typeName,t=e.matches,n=e.toSource,s=e.unstorableValue,e=Object.freeze,c=Object.assign,l=Object.create,u=e({TwineScript_TypeName:"a TypedVar (typed variable name)",get TwineScript_ObjectName(){var e=n(this.datatype);return"the ".concat(e.length<24?e+"-":"","typed variable name, ").concat(this.varRef.TwineScript_ToSource())},TwineScript_Print:function(){return"`[A typed variable name]`"},TwineScript_Unstorable:!0,TwineScript_Clone:function(){return c(l(u),{datatype:this.datatype.TwineScript_Clone(),varRef:this.varRef})},TwineScript_ToSource:function(){return n(this.datatype)+"-type "+this.varRef.TwineScript_ToSource()},TwineScript_GetProperty:function(e){return"name"===e?this.getName():this[e]},TwineScript_Properties:["datatype","name"],TwineScript_IsTypeOf:function(e){return t(this.datatype,e)},get:function(){var e;return(e=this.varRef).get.apply(e,arguments)},getName:function(){return this.varRef.getName()},defineType:function(){if("any"!==this.datatype.name)return this.varRef.defineType(this.datatype)},create:function(e,t){var n,r;return(n=o.containsError(t)||o.containsError(e)||t.error)||(a.isPrototypeOf(t)?(n=t.object,r=t.compiledPropertyChain,n&&n.TwineScript_VariableStore&&1===r.length&&n.TwineScript_TypeDefs?(r=s(e))&&!u.isPrototypeOf(r)?o.create("syntax","The -type syntax can't have "+i(r)+" to its left."):c(l(this),{datatype:e,varRef:t}):o.create("unimplemented","I can only restrict the datatypes of variables, not data names or anything else.")):o.create("syntax","The -type syntax must have a variable to its right."))}});return u}),define("datatypes/varbind",["jquery","utils","utils/operationutils","internaltypes/varref","internaltypes/twineerror"],function(o,e,t,n,r){var a=t.objectName;return n.on("set",function(r,a){r.TwineScript_VariableStore&&e.storyElement.find("[data-2bind]").each(function(e,t){var n=(t=o(t)).data("twoWayBindEvent");"function"==typeof n&&n(t,r,a)})}),Object.freeze({TwineScript_TypeName:"a VarBind (bound variable name)",get TwineScript_ObjectName(){return"a ".concat(this.bind," bind to ").concat(this.varRef.TwineScript_ToSource())},TwineScript_Print:function(){return"`[A bound variable name]`"},TwineScript_Unstorable:!0,TwineScript_ToSource:function(){return("two way"===this.bind?"2":"")+"bind "+this.varRef.TwineScript_ToSource()},set:function(e){var e=this.varRef.set(e);if(e=r.containsError(e))return e},create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"one way";return r.containsError(e)?e:n.isPrototypeOf(e)?e.error||Object.assign(Object.create(this),{varRef:e,bind:t}):r.create("operation","I can only 'bind' a variable, not "+a(e)+".")}})}),define("debugmode/highlight",["jquery","utils","utils/typecolours","macros","lexer"],function(u,e,t,p,n){var d=e.insensitiveName,f=t.versionClass,h=n.lex;return function(e,t,n,r){if(9999<e.length)return[u("«).text(e)];for(var a=h(e,»»,t||»macro»),o=[],i=»»,s=a,c=a.start;c<a.end;c+=1){var l=a.pathAt(c);l[0]!==s[0]&&(o.length&&(o[o.length-1].textContent=i),i="",s=l,o.push(u("<".concat(r&&n<=c&&c<r?"mark":"span",' class="').concat(function(e){for(var t={},n="",r=0;r<e.length;r+=1){var a=e[r],o=a.type,i=a.text,s=("verbatim"!==o&&"comment"!==o||(n=""),f+o);switch(t[s]=(t[s]||0)+1,1′))[0])),i+=a.text[c-a.start]}return o.length&&(o[o.length-1].textContent=i),o}}),define(«debugmode/mode»,[«jquery»,»utils»,»utils/naturalsort»,»state»,»engine»,»internaltypes/varref»,»internaltypes/twineerror»,»utils/operationutils»,»utils/renderutils»,»passages»,»section»,»debugmode/panel»,»debugmode/highlight»,»utils/typecolours»],function(I,V,M,D,F,L,H,e,t,z,q,W,B,n){var U=e.objectName,$=e.isObject,G=e.toSource,Y=e.typeID,J=t.dialog,X=n.CSS,K=function(e,t){var f=V.escape,i=V.nth,n=V.debounce,r=I(document.documentElement),a=M(),o={darkMode:!0,fadePanel:!0,evalReplay:!0,width:null,maxHeight:400};if(D.hasStorage)try{var s=localStorage.getItem(«(Debug Options «+V.options.ifid+»)»);s&&(o=JSON.parse(s))}catch(e){}function c(){if(D.hasStorage)try{localStorage.setItem(«(Debug Options «+V.options.ifid+»)»,JSON.stringify(o))}catch(e){}}W.defaultMaxHeight=o.maxHeight;function l(e){return n(function(){if(V.options.debug)return e.apply(this,arguments)},{maxWait:2e3})}var h=I(‘\n was run, producing these results.«:» became».concat(c.ToDesc?»\u2026″:»»,» «).concat(c.toDesc?»«.concat(f(c.toDesc),».«):»«)),c.error?t.append(c.error):c.lambda?(s=function(e,t){return I(«")).find("code").append(B(t,"macro")).end()},t.find(".to-lambda").append(B(c.lambda.obj.source,"macro")).end().append((e=I("")).append.apply(e,[I("
").append(s("th","pos"),c.lambda.obj.loop?s("th","_"+c.lambda.obj.loop.getName()).append(" / ",I(" ").append(B("it","macro"))):s("th","it"),c.lambda.obj.making&&s("th","_"+c.lambda.obj.making.getName()),c.lambda.obj.where&&s("th","where").append(" result"),c.lambda.obj.via&&s("th","via").append(" result"))].concat(_toConsumableArray(c.lambda.loops.map(function(e){var t=e.it,n=e.pos,r=e.making,a=e.whereResult,o=e.whereReplay,i=e.viaResult,e=e.viaReplay;return I("").append(s("td",G(n)),s("td",G(t)),void 0!==r&&s("td",G(r)),null!=a&&(H.containsError(a)?I(" ").append(a.render(c.lambda.obj.source,!0)):s("td",G(a))).append(o&&I("").data("evalReplay",o)),null!=i&&(H.containsError(i)?I(" ").append(i.render(c.lambda.obj.source,!0)):s("td",G(i))).append(e&&I("").data("evalReplay",e)))})))))):c.toDesc||t.find(".to-code").append(B(c.toCode,"macro")),t.next().html(c.itIdentifier?'(The it identifier now refers to '.concat(f(c.itIdentifier),".)"):"").next().text(c.reason||"")):(n.html(B(c.code,"macro")),t.html("First, there was .").next().empty().next().empty()),c.lambda||t.find("code").first().append(B(c.fromCode,"macro")),o.find("mark").each(function(e,t){t.scrollIntoView()}),i.css("visibility",a<=9?"hidden":"visible"),l.css("visibility",a=r.length-1?"hidden":"visible"),d.css("visibility",a>=r.length-10?"hidden":"visible"),u.html("( ".concat(a+1,"/").concat(r.length," )"))}t&&(r=t,t=J({buttons:[{name:"Understood",confirm:!(a=0),callback:function(){return!h.find("tw-backdrop").length&&h.removeClass("show-dialog")}}]}).addClass("eval-replay"),o=I("".concat(1===r.length?"":"","").concat(1===r.length?"":"\u2190 10\u2190 \u2190\u2192 \u219210 \u2192","")),t.find("tw-dialog").css({width:"75vw","max-width":"75vw"}).prepend(o),i=o.find("tw-link:first-of-type"),l=i.next(),u=l.next(),p=u.next(),d=p.next(),n(),i.on("click",function(){a=Math.max(0,a-10),n()}),l.on("click",function(){a=Math.max(0,a-1),n()}),p.on("click",function(){a=Math.min(r.length-1,a+1),n()}),d.on("click",function(){a=Math.min(r.length-1,a+10),n()}),h.find("tw-backdrop").length?h.find("tw-backdrop").before(t):h.addClass("show-dialog").append(t));var s,t=I(e.target).data("goto");t&&(s=V.options.ignoreGotos,V.options.ignoreGotos=!1,t.command.TwineScript_Run(t.section),V.options.ignoreGotos=s),e.stopPropagation()})),h.find(".resizer-h").mousedown(function(e){if(1!==e.which)return!0;e.stopPropagation();var t=e.pageX,n=h.width();r.on("mousemove.debugger-resizer-h",function(e){e=e.pageX;h.width("".concat(n+t-e|0,"px"))}).on("mouseup.debugger-resizer-h",function(){r.off(".debugger-resizer-h"),o.width=h.width(),c()})}),h.on("mousedown",".resizer-v",function(e){if(1!==e.which)return!0;e.stopPropagation();var t=e.pageY,n=I(e.target.parentNode).height();r.on("mousemove.debugger-resizer-v",function(e){e=e.pageY;h.find(".panel").css("maxHeight","".concat(n+t-(0|e),"px"))}).on("mouseup.debugger-resizer-v",function(){r.off(".debugger-resizer-v"),o.maxHeight=h.find(".panel").css("maxHeight"),c()})}),p.click(function(){r.toggleClass("debug-mode").removeClass("dom-debug-mode"),p.toggleClass("enabled"),u.removeClass("enabled")}),u.click(function(){r.toggleClass("dom-debug-mode").removeClass("debug-mode"),u.toggleClass("enabled"),p.removeClass("enabled")}),d.click(function(){r.removeClass("debug-mode dom-debug-mode"),h.detach(),Object.assign(V.options,{debug:!1,speedMultiplier:1,ignoreClickEvents:!1,ignoreGotos:!1})});function g(e){(e=e.parents(".variable-row, .enchantment-row, .source-row")).next(".panel-row-source").find("td").empty().append(B(e.data("value")||G(e.data("enchantment").changer),e.is("source-row")?"markup":"macro"))}function y(){return k=new Set}function b(){I(document.body).append(h),V.options.debug=!0,V.options.evalReplay=o.evalReplay,V.options.speedMultiplier=1,V.options.ignoreClickEvents=!1,V.options.ignoreGotos=!1,R()}var v,w=l(function(){var r=m.children().get(),e=D.timeline,a=0;e.forEach(function(e,t){var n=e.turns,e=e.passage,n=(a+=1+(void 0===n?0:n))+": "+e;r[t]?r[t].textContent=n:m.append("").concat(n,""))}),e.length<r.length&&I(r.slice(e.length)).remove(),m[1<=e.length?"removeAttr":"attr"]("disabled"),m.val(D.pastLength)}),k=(m.change(function(e){e=e.target.value-D.pastLength;0!=e&&(D[e<0?"rewind":"fastForward"](Math.abs(e)),F.showPassage(D.passage))}),w(),D.on("forward",w).on("load",w).on("forgetUndos",function(){return w}).on("back",function(){D.pastLength<=1&&m.attr("disabled"),m.find("[selected]").removeAttr("selected"),m.val(D.pastLength)}),new Set),S=W.create({className:"variables",tabName:"Variable",rowWrite:function(e,t){var n,r=e.name,a=e.dataset,o=e.path,i=e.value,s=e.tempScope,e=e.type,c=i&&48<i.length&&!i.TwineScript_DebugName,l=$(i)&&i.TwineScript_DebugName?i.TwineScript_DebugName():f(U(i)),u="",a=(o.length&&(u=o.reduce(function(e,t){return e+t+"'s "},"")),a&&(r="???"),e?G(e):""),e="object"===_typeof(i)||c;return t?(t[0].firstChild.innerHTML=a||"",u&&I(t[0].firstChild).children(".variable-path").html((s?"_":"$")+f(u)),t[0].childNodes[1].lastChild.textContent=(u?"":s?"_":"$")+f(r+""),t[0].childNodes[2].textContent=s||"",t[0].childNodes[3].innerHTML=l,n=(c=I(t[0].lastChild.firstChild)).is(".open"),c[e?"show":"hide"](),c=t.next(".panel-row-source"),n&&c.find("td").empty().append(B(G(i))),t.data("value",G(i)),t.add(c)):I('".concat(a||""," "),""+(u?(s?"_":"$")+f(u):"")+" "+(u?"":s?"_":"$")+f(r+"")+" ","".concat(s||""," "),""+l+" (source:) ").data("value",G(i)).find("tw-folddown").data("folddown",g).end().add("")},rowCheck:function(e,t){var n=e.name,r=e.path,e=e.tempScope;return t[0]&&t[0].getAttribute("data-name")===n&&t[0].getAttribute("data-path")===r+""&&t[0].getAttribute("data-scope")===e},columnHead:function(){return' '},rowSort:function(e,t,n){if("variable-value"===e)return a(t.attr("class"),n.attr("class"))||a(t.parent().data("value"),n.parent().data("value"))}}),T=l(function(){var e,t,o=[],n=D.variables,r=o.length;for(e in n)e.startsWith("TwineScript")||(r+=1,function n(e){var r,t,a;500<o.length||(o.push(e),r=e.path.concat(e.name),t=e.value,a=e.tempScope,r.length<=4&&(Array.isArray(t)?t.forEach(function(e,t){return n({name:i(t+1),path:r,value:e,tempScope:a})}):t instanceof Map?_toConsumableArray(t).forEach(function(e){var t=(e=_slicedToArray(e,2))[0],e=e[1];return n({name:t,path:r,value:e,tempScope:a})}):t instanceof Set&&_toConsumableArray(t).forEach(function(e,t){return n({name:t,dataset:!0,path:r,value:e,tempScope:a})})))}({name:e,path:[],value:n[e],tempScope:"",type:null==(t=n.TwineScript_TypeDefs)?void 0:t[e]}));o.push.apply(o,_toConsumableArray(k)),r+=k.size,S.update(o,r),0===r!==S.panel[0].classList.contains("panel-variables-empty")&&S.panel.toggleClass("panel-variables-empty")}),_=(L.on("set",function(e,t,n){var r,a;e===D.variables||"temp"!==(null==(a=e.TwineScript_VariableStore)?void 0:a.type)||null!=(a=e.TwineScript_VariableStore)&&a.name.match(/#\d+$/)||(r=null==(a=e.TwineScript_VariableStore)?void 0:a.name,e=null==(a=e.TwineScript_TypeDefs)?void 0:a[t],(a=_toConsumableArray(k).find(function(e){return e.name===t&&e.tempScope===r}))?a.value=n:k.add({name:t,path:[],value:n,tempScope:r,type:e})),T(),v()}).on("delete",function(){T(),v()}),S.panel.append("Type Name Scope Value "+G(n)+(i?""+("function"==typeof i.TwineScript_ToSource?i.TwineScript_ToSource():i.attr("name")?"?"+i.attr("name"):"an unnamed hook"):"")+" "+a+" "+(r?"(source:) ":"")).find("tw-folddown").data("folddown",g).end().add(r?I(""):"")},rowCheck:function(e,t){return t.data("enchantment")===e},columnHead:function(){return'Scope Value '}})),d=l(function(e){x.update(e.enchantments,e.enchantments.length)}),O=(q.on("add",d).on("remove",d),q.create()),A=W.create({className:"storylets",tabName:"Storylet",rowWrite:function(e,t){var n=e.name,r=e.active,a=e.storyletSource,o=e.exclusive,e=e.urgent;return t?(t.toggleClass("storylet-closed",!r),t[0].firstChild.textContent=r?"\u2713":""):(t=I('')).attr("data-name",n).append(" "+(r?"\u2713":"")+" "+n+" "+o+" "+e+" ")).find(".storylet-lambda").append(B(a.replace(/^when\s+/i,""))),t},rowCheck:function(e,t){e=e.name;return t[0].getAttribute("data-name")===f(e+"")},columnHead:function(){return' '}}),C=(A.tab.hide(),v=l(function(){var r,a,o=z.getStorylets(O),i=H.containsError(o),e=z.allStorylets();A.update(e.map(function(t){var e="number"==typeof t.get("exclusivity")?t.get("exclusivity"):0,n="number"==typeof t.get("urgency")?t.get("urgency"):0;return r=r||e,a=a||e,{name:t.get("name"),storyletSource:t.get("storylet").TwineScript_ToSource(),active:!i&&o.some(function(e){return e.get("name")===t.get("name")}),exclusive:e,urgent:n}}),i?0:o.length),A.panel.toggleClass("storylet-error",i),A.panel.toggleClass("panel-exclusive",r),A.panel.toggleClass("panel-urgent",a),e.length&&A.tab.show()}),W.create({className:"source",tabName:"Source",tabNameCounter:!1,rowWrite:function(e,t){var n=e.name,e=e.tag;return t?t.add(t.next(".panel-row-source")):(t=z.get(n).get("source"),I('Open Name Condition Exclusivity Urgency '.concat(n,' ').concat(e," ")).find("tw-folddown").data("folddown",g).end().add(I(" ")).find("td").append(!e&&B(t,"markup")).end()))},rowCheck:function(e,t){e=e.name;return t[0].firstChild.textContent===f(e+"")},tabUpdate:I.noop,columnHead:I.noop})),E=["debug-startup","startup","header","debug-header","footer","debug-footer"].reduce(function(e,t){return e.concat(z.getTagged(t).map(function(e){return{name:e.get("name"),tag:t}}))},[]),N=W.create({className:"errors",tabName:"Error",rowWrite:I.noop,rowCheck:I.noop,columnHead:I.noop,tabUpdate:function(e){return N.tab.css({background:e?"rgba(230,101,204,0.3)":""}).text("".concat(e," Error").concat(1!==e?"s":""))}}),d=n(function(e){var t;V.options.debug&&(N.panelRows.append(e.reduce(function(e,t){var t=_slicedToArray(t,2),n=t[0],t=t[1];return"propagated"===n.type?e:e+' "},"")),500<(t=(e=N.panelRows.children()).length)&&I(Array.prototype.slice.call(N.panelRows[0].childNodes,0,t-500)).remove(),N.tabUpdate(Math.min(500,e.length)))},{batch:!0}),j=(H.on(d),N.panel.append("'+D.passage+' (dialog:) boxes"},{id:"ignoreClickEvents",type:"checkbox",label:"Stop links, (click:) and (hover-style:) from activating"},{id:"ignoreGotos",type:"checkbox",label:"Stop (go-to:), (undo:), (redirect:) and (restart:) from activating
(Click 'GO' buttons in Debug View to activate later)"},{id:"speedMultiplier",label:"Speed of timed events (time, (live:), (after:)): ",type:"dropdown",dropdownValue:1,dropdownItems:[.25,.5,.75,1,1.25,1.5,1.75,2,3,5,10]}]),W.create({className:"options",tabName:"\u2699\ufe0f",tabNameCounter:!1,rowWrite:function(e,t){var n=e.name,e=e.label,r={darkMode:o.darkMode,fadePanel:o.fadePanel,evalReplay:o.evalReplay}[n];return t?t.find("input").prop("checked",r):I('').concat(e,""))},rowCheck:I.noop,tabUpdate:I.noop,columnHead:I.noop})),R=(r.on("click",'.panel-options [type="checkbox"]',function(e){var e=e.target,t=(e=I(e)).attr("id"),e=e.is(":checked");"debug-darkMode"===t&&(o.darkMode=e,h.toggleClass("theme-dark",e)),"debug-fadePanel"===t&&(o.fadePanel=e,h.toggleClass("fade-panel",e)),"debug-evalReplay"===t&&(V.options.evalReplay=o.evalReplay=e),c()}),P.update([{name:"darkMode",label:"Debug panel is dark"},{name:"fadePanel",label:"Debug panel is transparent unless the cursor is over it"},{name:"evalReplay",label:"Record expression replays (viewable via \ud83d\udd0d buttons in Debug View; slower)"}]),h.prepend(S.panel,x.panel,N.panel,A.panel,C.panel,j.panel,P.panel),s.prepend(S.tab,x.tab,N.tab,A.tab,C.tab,j.tab,P.tab),D.on("beforeForward",y).on("beforeBack",y).on("beforeLoad",y),l(function(){T(),v(),x.panelRows.empty(),x.tabUpdate(0),D.passage&&z.get(D.passage)&&(C.update(E.concat({name:D.passage,tag:""})),C.panel.find('[data-tag=""], [data-tag=""] + .panel-row-source').insertBefore(C.panel.find('[data-tag="footer"]').first()))}));D.on("forward",R).on("back",R).on("load",R);K=b,I(document.head).append(I("").html(X)),b(),e&&d(e,t)};return F.registerDebugMode(function(e,t){return!V.options.debug&&K(e,t)}),K}),define("debugmode/panel",["jquery","utils/naturalsort"],function(d,e){var i=e();return Object.seal({create:function(e){var n,t=e.className,r=e.rowWrite,a=e.rowCheck,o=e.rowSort,i=e.columnHead,s=e.tabName,c=e.tabNameCounter,l=void 0===c||c,c=e.tabUpdate,u=d("a+r+s+("string"==typeof o)?y.create("datatype","An incorrect combination of values was given to this (".concat(g,":) macro.")):void 0},function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var o=g.startsWith("force"),i=g.endsWith("box"),s=v.isPrototypeOf(r[0]),c="string"==typeof r[+s],l=i&&"number"==typeof r[c+s],u=s&&r[0],p=l?r[1+s]:3,d=c?S(r[+s]):{},f=d.marginLeft,d=d.size,h=(d?r[s+l+c]:c&&r[+s])||"",l=o?"":h,c=!1;if("two way"===u.bind){e.attr.push({"data-2bind":!0});s=u.varRef.get();if("string"==typeof s){l=o?h.slice(0,s.length):s,s=u.set(l),c=!0;if(y.containsError(s))return s}e.data.twoWayBindEvent=function(e,t,n){u.varRef.matches(t,n)&&"string"==typeof(t=u.varRef.get())&&e.find(i?"textarea":"input").val(o?h.slice(0,t.length):t)}}if(u&&!c){s=u.set(o?"":h);if(y.containsError(s))return s}!o&&u&&(e.data.inputBoxEvent=function(e){var t=e.val(),t=u.set(t);y.containsError(t)&&e.replaceWith(t.render(""))});var m,c=""):'value="').concat(b.escape(l)).concat(i?"":'">');return o&&(m=Array.from(h),e.data.inputBoxEvent=function(e){var t=e.val().length,t=m.slice(0,t).join("");return e.val(t),u&&(t=u.set(t),y.containsError(t))&&e.replaceWith(t.render("")),!0}),e.styles.push({display:"block","margin-left":d?f+"%":void 0,width:d?d+"%":"100%","border-style":function(){return this.style.borderStyle||"solid"}}),C(e,{source:c,append:"replace"})},g.endsWith("box")?[_(v,String),x(_(A,String)),x(_(A,String)),x(String)]:[x(_(v,String)),x(String),x(String)])}),["show","rerun"].forEach(function(s){return n.addCommand(s,function(){for(var r,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function e(t){var n=t.selector,t=t.next;return"name"===n.type&&"page"===n.data?(r=y.create("macrocall","You can't (hide:) the ?page. Sorry."),!0):!!("base"===n.type&&e(n.data)||t&&e(t))||void 0}),r},function(o,i){for(var e=arguments.length,t=new Array(2<e?e-2:0),n=2;n<e;n++)t[n-2]=arguments[n];return t.forEach(function(e){return e.forEach(i,function(e){var t,n,r,a=e.data("hidden");void 0!==a!=("rerun"===s)&&(e.removeData("hidden"),a instanceof u?e.empty().append(a):(a=e.data("tempVariables"),n=(t="tw-passage"===e.tag())?l.getTree(c.passage):e.data("originalSource")||"",t&&(r=e.find("tw-sidebar").detach()),i.renderInto("",null,_objectSpread(_objectSpread({},o),{},{append:"replace",source:n,target:e}),a&&Object.create(a)),r&&e.prepend(r)))})}),o},[T(o)])});n.addCommand("hide",function(){for(var r,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some(function e(t){var n=t.selector,t=t.next;return"name"===n.type&&"page"===n.data?(r=y.create("macrocall","You can't (hide:) the ?page. Sorry."),!0):!!("base"===n.type&&e(n.data)||t&&e(t))||void 0}),r},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,o=n;a<o.length;a++)o[a].forEach(e,function(e){e.data("hidden")||e.data("hidden",e.contents().detach())})},[T(o)],!1)("scroll",P,function(m,e,g){var y="number"==typeof g&&g;requestAnimationFrame(function(){e.forEach(m,function(e){if(!1!==y){var t,n,r=e[0];null!=(t=(n=r=r===b.storyElement[0]&&r.scrollHeight===r.clientHeight?getComputedStyle(document.body).overflow.includes(" scroll")?document.body:document.documentElement:r).scrollTo)&&t.call(n,0,(r.scrollHeight-r.clientHeight)*y)}else{var a,o=_createForOfIteratorHelper(g.hooks(m).get());try{for(o.s();!(a=o.n()).done;){var i=a.value;if(e.find(i)){for(var s=[],c=e[0];(c=c.parentNode)&&c!==document.body;)s.push([c,c.scrollLeft,c.scrollTop]);i.scrollIntoView();for(var l=0,u=s;l<u.length;l++){var p=_slicedToArray(u[l],3),d=p[0],f=p[1],h=p[2];d.scrollLeft=f,d.scrollTop=h}break}}}catch(e){o.e(e)}finally{o.f()}}})})},[o,_(L,o)],!1)("stop",P,P,[],!1)("load-game",P,function(e,t){var n,r;return e.loadedGame?y.create("infinite","I can't use (load-game:) immediately after loading a game."):(n=localStorage.getItem(R("Saved Game")+t))?(n=c.deserialise(e,n))instanceof Error?{blocked:r=k({message:"Sorry to interrupt... The story tried to load saved data, but there was a problem.\n"+n.message+"\n\nThat data might have been saved from a different version of this story. Should I delete it?\n(Type 'delete' and choose Yes to delete it.)\n\nEither way, the story will now continue without loading the data.",defaultValue:"",buttons:[{name:"Yes",confirm:!0,callback:function(){"delete"===r.find("input").last().val()&&localStorage.removeItem(R("Saved Game")+t),e.unblock("")}},{name:"No",cancel:!0,callback:function(){return e.unblock()}}]})}:void requestAnimationFrame(a.showPassage.bind(a,c.passage,{loadedGame:!0})):y.create("saving","I can't find a save slot named '"+t+"'!")},[String],!1)("forget-undos",P,function(e,t){c.futureLength||c.forgetUndos(t)},[parseInt],!1)("forget-visits",P,function(e,t){c.forgetVisits(t)},[parseInt],!1)("mock-visits",function(){if(!b.options.debug)return y.create("debugonly","(mock-visits:) cannot be used outside of debug mode.");for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.find(function(e){return!l.hasValid(e)});return r?y.create("datatype","I can't mock-visit '"+r+"' because no passage with that name exists."):void 0},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];c.mockVisits=g(n)},[T(String)],!1)("mock-turns",function(){if(!b.options.debug)return y.create("debugonly","(mock-turns:) cannot be used outside of debug mode.")},function(e,t){c.mockTurns=t},[H],!1)("seed",P,function(e,t){c.setSeed(t)},[String],!1)(["dialog","alert"],function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];if(v.isPrototypeOf(e)){if("two way"===e.bind)return y.create("datatype","(dialog:) shouldn't be given two-way bound variables.",'Change the "2bind" keyword to just "bind".');if(void 0===t)return y.create("datatype","(dialog:) needs a message string or codehook to display.")}else void 0!==t&&r.unshift(t);e=r.findIndex(function(e){return""===e});if(-1<e)return y.create("datatype","(dialog:)'s ".concat(b.nth(e+1)," link text shouldn't be an empty string."))},function(e,n,r,t){for(var a=arguments.length,o=new Array(4<a?a-4:0),i=4;i<a;i++)o[i-4]=arguments[i];return v.isPrototypeOf(r)||(void 0!==t&&o.unshift(t),t=r,r=void 0),o.length||(o=["OK"]),{blocked:k({section:n,message:t,cd:e,buttons:o.map(function(t){return{name:t,callback:function(){var e;n.unblock((null==(e=r)?void 0:e.set(t))||"")}}})})}},[_(v,String,t),x(_(t,String)),O(String)])("open-url",P,function(e,t){window.open(t,"")},[String],!1)(["restart","reload"],P,function(){if(!b.options.ignoreGotos){if(c.turns<=1)return y.create("infinite","I mustn't (restart:) the story in the starting passage.");c.hasSessionStorage&&sessionStorage.removeItem("Saved Session"),window.location.reload()}},[],!1)("goto-url",P,function(e,t){window.location.assign(t)},[String],!1)("ignore",P,P,[O(F)])("assert-exists",function(e){if(""===e)return y.create("datatype","(assert-exists:) mustn't be given an empty string.")},function(e,t,n){var r=0;return("string"==typeof n?o.create({type:"string",data:n}):n).forEach(t,function(){++r}),r?e:y.create("assertion","I didn't see any ".concat("string"==typeof n?"text occurrences of":"hooks matching"," ").concat(w(n)," in this passage."))},[_(o,String)]),n.add("assert","Instant",function(e,t){return t?{TwineScript_TypeID:"instant",TwineScript_TypeName:"an (assert:) operation",TwineScript_ObjectName:"an (assert:) operation",TwineScript_Unstorable:!0,TwineScript_Print:function(){return""}}:C(y.create("assertion","An assertion failed: "),{appendTitleText:!0})},[Boolean])("save-game","Boolean",function(e,t,n){if(n=n||"",!c.hasStorage)return!1;var r=c.serialise(!1).pastAndPresent;if(y.containsError(r))return r;if(!1===r)return!1;try{return localStorage.setItem(R("Saved Game")+t,r),localStorage.setItem(R("Saved Game Filename")+t,n),!0}catch(e){return!1}},[String,x(String)])("prompt","String",function(e,t,n,r,a){var o,i;return null!=(o=e.stackTop)&&o.evaluateOnly?y.create.apply(y,["macrocall"].concat(_toConsumableArray(I(e.stackTop.evaluateOnly)))):""===a?y.create("datatype","The text for (prompt:)'s confirm link can't be blank."):(i=k({section:e,message:t,defaultValue:n,buttons:[{name:a||"OK",confirm:!0,callback:function(){return e.unblock(i.find("input").last().val())}}].concat(""===r?[]:{name:r||"Cancel",cancel:!0,callback:function(){return e.unblock(n)}})}),e.stackTop.blocked=i,0)},[_(String,t),String,x(String),x(String)])("confirm","Boolean",function(e,t,n,r){var a;return null!=(a=e.stackTop)&&a.evaluateOnly?y.create.apply(y,["macrocall"].concat(_toConsumableArray(I(e.stackTop.evaluateOnly)))):""===r?y.create("datatype","The text for (confirm:)'s confirm link can't be blank."):(a=k({section:e,message:t,defaultValue:!1,buttons:[{name:r||"OK",confirm:!0,callback:function(){return e.unblock(!0)}}].concat(""===n?[]:{name:n||"Cancel",cancel:!0,callback:function(){return e.unblock(!1)}})}),e.stackTop.blocked=a,0)},[_(String,t),x(String),x(String)])("page-url","String",function(){return window.location.href},[])}),define("macrolib/custommacros",["utils","macros","state","utils/operationutils","datatypes/changercommand","datatypes/custommacro","datatypes/codehook","datatypes/typedvar","internaltypes/twineerror"],function(c,l,u,e,t,p,n,d,f){function s(e,t,n){if(!t.some(function(e){if("function"==typeof e.output)return e.output(n),!0}))return f.create("macrocall","("+e+":) should only be used inside a code hook passed to (macro:).")}var h=e.objectName,m=e.toSource,e=l.add,r=l.addChanger,a=l.addCommand,o=l.TypeSignature,i=o.rest,g=o.either,y=o.Any,b=o.Everything,o=o.zeroOrMore;e("macro","CustomMacro",function(e){for(var t,n=[],r=arguments.length,a=new Array(1<r?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];for(t=0;t<a.length;t+=1){var i=t===a.length-1;if(d.isPrototypeOf(a[t])===i)return f.create("datatype","The "+(i?"":c.nth(a.length-t+1)+"-")+"last value given to (macro:) should be a "+(i?"code hook":"datatyped variable")+", not "+h(a[t]));if(!i){i="A custom macro";if(a[t].varRef.object===u.variables)return f.create("datatype",i+"'s typed variables must be temp variables (with a '_'), not global variables (with a '$').","Write them with a _ symbol at the start instead of a $ symbol.");if(1<a[t].varRef.propertyChain.length)return f.create("datatype",i+"'s typed variables can't be properties inside a data structure.");if(a[t].datatype.rest&&t!==a.length-2)return f.create("datatype",i+" can only have one spread variable, and it must be its last variable.");var s=a[t].varRef.propertyChain[0];if(n.includes(s))return f.create("datatype",i+"'s typed variables can't both be named '"+s+"'.");n.push(s)}}return p.create(a.slice(0,-1),a[a.length-1])},[i(g(d,n))]);a(["output-data","out-data"],function(){},function(e,t){e=e.stack;return s("output-data",e,t)||{blocked:!0}},[y],!1),r(["output","out"],function(){return Object.assign(t.create("output",[]))},function(e,t){if(e.section){var n,r=e.section,a=r.stack,o=r.stackTop,i={};for(n in o.tempVariables)n.startsWith("TwineScript_")||(i[n]=o.tempVariables[n]);s("output",a,{changer:t,variables:i,hook:Array.isArray(e.source)?"["+e.source.map(function(e){return e.text}).join("")+"]":e.source}),e.output=!0,o.blocked=!0}},[]),a("error",function(e){if(!e)return f.create("datatype","This (error:) macro was given an empty string.")},function(e,t){e=e.stack;return s("error",e,f.create("user",t))||{blocked:!0}},[String],!1),e("partial","CustomMacro",function(e,a){for(var t=arguments.length,o=new Array(2<t?t-2:0),n=2;n<t;n++)o[n-2]=arguments[n];var r="string"!=typeof a&&a,i=!r&&a;if(!r){if(!l.has(i))return f.create("macrocall",'The macro name given to (partial:), "'.concat(a,"\", isn't the name of a built-in macro."));if("Metadata"===l.get(i).returnType)return f.create("macrocall","(partial:) can't be used with metadata macros such as (".concat(a,":)"))}var s="(partial:".concat(m(a),",").concat(o.map(function(e){return m(e)}),")"),c=p.createFromFn(function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r=o.length||"rest"===e.pattern||"zero or more"===e.pattern}));return c},[g(String,p),o(b)])}),define("macrolib/datastructures",["utils","utils/naturalsort","macros","utils/operationutils","state","engine","passages","datatypes/lambda","datatypes/typedvar","internaltypes/twineerror"],function(e,i,t,n,s,r,a,c,o,l){var u=e.permutations,p=e.options,d=n.objectName,f=n.subset,h=n.collectionType,m=n.isValidDatamapName,g=n.is,y=n.unique,b=n.clone,v=n.range,e=t.TypeSignature,n=e.optional,w=e.rest,k=e.either,S=e.zeroOrMore,T=e.Any,e=e.nonNegativeInteger,_=i("en");t.add(["a","array"],"Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n},S(k(o,T)))("range","Array",function(e,t,n){return v(t,n)},[parseInt,parseInt])("subarray","Array",function(e,t,n,r){return f(t,n,r)},[Array,parseInt,parseInt])("reversed","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reverse().map(b)},S(T))("shuffled","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return s.shuffled.apply(s,n).map(b)},[S(T)])("sorted","Array",function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];if(!c.isPrototypeOf(r[0]))return(t=r.filter(function(e){return"string"!=typeof e&&"number"!=typeof e}))&&t.length?1===t.length&&Array.isArray(t[0])?l.create("macrocall","Please give multiple numbers or strings to (sorted:), not a single array.","You can use the spread ... syntax to spread out the array's values into (sorted:)."):l.create("datatype","If (sorted:) isn't given a 'via' lambda, it must be given only numbers and strings, not ".concat(d(t[0]),".")):r.sort(_);var o=r.shift();if("making"in o||"where"in o||"when"in o||!("via"in o))return l.create("datatype","The optional lambda given to (sorted:) must be a 'via' lambda, not ".concat(d(o),"."));for(var i=0;i<r.length;i+=1){var s=o.apply(e,{loop:r[i],pos:i+1});if(l.containsError(s))return s;if("string"!=typeof s&&"number"!=typeof s)return l.create("datatype",'The "via" lambda given to (sorted:) couldn\'t convert '.concat(d(r[i])," into a string or number."));r[i]=[r[i],s]}return r.sort(function(e,t){return _(e[1],t[1])}).map(function(e){return e[0]})},[S(T)])("rotated","Array",function(e,t){if(0===t)return l.create("macrocall","I can't rotate these values by 0 positions.");for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=-1*(t=Math.abs(t)%r.length*Math.sign(t));return r.slice(t).concat(r.slice(0,t)).map(b)},[parseInt,S(T)])("rotated-to","Array",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return l.containsError(t)?t:t.length?(e=r.indexOf(t[0]),r.slice(e).concat(r.slice(0,e)).map(b)):l.create("macrocall","None of these "+r.length+" values matched the lambda, so I can't rotate them.")},[c.TypeSignature("where"),w(T)])("repeated","Array",function(e,t){for(var n=[],r=arguments.length,a=new Array(2<r?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];if(!a.length)return n;for(;0<t--;)n.push.apply(n,a);return n.map(b)},[e,w(T)])("interlaced","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=Math.min.apply(Math,_toConsumableArray(n.map(function(e){return e.length}))),o=[],i=0;i<a;i+=1)for(var s=0;s<n.length;s+=1)o.push(b(n[s][i]));return o},[Array,w(Array)])("permutations","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.length?u.apply(void 0,n):[]},[S(T)])("unique","Array",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter(y)},[S(T)])("altered","Array",function(n,r){for(var e=arguments.length,t=new Array(2<e?e-2:0),a=2;a<e;a++)t[a-2]=arguments[a];return t.map(function(e,t){t=r.apply(n,{loop:e,pos:t+1});return null===t?e:t})},[k(c.TypeSignature("via"),c.TypeSignature("where","via")),S(T)])("find","Array",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return t.filter(e,r)},[c.TypeSignature("where"),S(T)])(["all-pass","pass"],"Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return l.containsError(t)||t.length===r.length},[c.TypeSignature("where"),S(T)])("some-pass","Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return l.containsError(t)||0<t.length},[c.TypeSignature("where"),S(T)])("none-pass","Boolean",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];t=t.filter(e,r);return l.containsError(t)||0===t.length},[c.TypeSignature("where"),S(T)])("folded","Any",function(r,a){for(var e=arguments.length,t=new Array(2<e?e-2:0),n=2;n<e;n++)t[n-2]=arguments[n];return"where"in a&&(t=[t[0]].concat(_toConsumableArray(a.filter(r,t.slice(1))))),l.containsError(t)||t.reduce(function(e,t,n){return a.apply(r,{making:e,loop:t,pos:n+1})})},[k(c.TypeSignature("where","via","making"),c.TypeSignature("via","making")),w(T)])(["dm-names","datamap-names","datanames"],"Array",function(e,t){return Array.from(t.keys()).sort(i("en"))},[Map])(["dm-values","datamap-values","datavalues"],"Array",function(e,t){return Array.from(t.entries()).sort(i("en",function(e){return String(e[0])})).map(function(e){return b(e[1])})},[Map])(["dm-entries","datamap-entries","dataentries"],"Array",function(e,t){return Array.from(t.entries()).sort(function(e,t){return[e[0],t[0]].sort(i("en"))[0]===e[0]?-1:1}).map(function(e){return new Map([["name",e[0]],["value",b(e[1])]])})},[Map])(["dm-altered","datamap-altered"],"Datamap",function(a,o,e){return Array.from(e.entries()).sort(function(e,t){return[e[0],t[0]].sort(i("en"))[0]===e[0]?-1:1}).reduce(function(e,t,n){if(!l.containsError(e)){var r=new Map([["name",t[0]],["value",b(t[1])]]),r=o.apply(a,{loop:r,pos:n+1});if(l.containsError(r))return r;e.set(t[0],null===r?t[1]:r)}return e},new Map)},[k(c.TypeSignature("via"),c.TypeSignature("where","via")),Map])("history","Array",function(e,t){var n=s.history();return t?(t=t.filter(e,n.map(function(e){return a.get(e)})),l.containsError(t)?t:t.map(function(e){return e.get("name")})):n},[n(c.TypeSignature("where"))])("visited","Boolean",function(e,t){var n;return"string"==typeof t?a.has(t)?0<s.passageNameVisited(t)||s.passage===t:l.create("macrocall","There's no passage named '"+t+"' in this story."):(n=s.history(),n=t.filter(e,n.concat(s.passage).map(function(e){return a.get(e)})),l.containsError(n)?n:0<n.length)},[k(String,c.TypeSignature("where"))])("passage","Datamap",function(e,t){return b(a.get(t||s.passage))||l.create("macrocall","There's no passage named '"+t+"' in this story.")},[n(String)])("passages","Array",function(e,t){var n=i("en"),r=_toConsumableArray(a.values()).map(function(e){return b(e)}),t=t?t.filter(e,r):r,e=l.containsError(t);return e||t.sort(function(e,t){return n(e.get("name"),t.get("name"))})},[n(c.TypeSignature("where"))])("open-storylets","Array",function(e,t){return e.stackTop.evaluateOnly?l.create("macrocall","(open-storylets:) can't be used in "+e.stackTop.evaluateOnly+"."):(e=a.getStorylets(e,t),l.containsError(e)||e.map(b))},[n(c.TypeSignature("where"))])("savedgames","Datamap",function(){function e(e){return"("+e+" "+p.ifid+") "}var t,n,r=0,a=new Map;do{if(!s.hasStorage)break;t=localStorage.key(r),r+=1;var o=e("Saved Game")}while(null!=(n=t)&&n.startsWith(o)&&(t=t.slice(o.length),a.set(t,localStorage.getItem(e("Saved Game Filename")+t))),t);return a},[])(["datamap","dm"],"Datamap",function(e){for(var r,a=new Map,t=arguments.length,n=new Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n.reduce(function(e,t){var n;if(!l.containsError(e))if(void 0===r)r=t;else{if(n=l.containsError(m(a,r)))return n;if(a.has(r))return l.create("macrocall","You used the same data name ("+d(r)+") twice in the same (datamap:) call.");a.set(r,b(t)),r=void 0}return e},!0);return l.containsError(i)?i:void 0!==r?l.create("macrocall","This datamap has a data name without a value."):a},S(k(o,T)))(["dataset","ds"],"Dataset",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Set(n.filter(y).map(b))},S(T))("count","Number",function t(n,r){for(var e,a=arguments.length,o=new Array(2<a?a-2:0),i=2;i<a;i++)o[i-2]=arguments[i];if(1<o.length)return e=o.map(function(e){return t(n,r,e)}),l.containsError(e)||e.reduce(function(e,t){return e+t},0);var s=o[0];switch(h(r)){case"dataset":case"datamap":return l.create("macrocall","(count:) shouldn't be given a datamap or dataset.","You should use the 'contains' operator instead. For instance, write: $variable contains 'value'.");case"string":return"string"!=typeof s?l.create("macrocall",d(r)+" can't contain "+d(s)+" because it isn't also a string."):s?r.split(s).length-1:0;case"array":return r.reduce(function(e,t){return e+g(t,s)},0);default:return l.create("macrocall",d(r)+" can't contain values, let alone "+d(s)+".")}},[T,w(T)])}),define("macrolib/enchantments",["jquery","utils","utils/operationutils","engine","state","passages","macros","datatypes/hookset","datatypes/codehook","datatypes/changercommand","datatypes/lambda","internaltypes/changedescriptor","internaltypes/enchantment","internaltypes/twineerror"],function(c,r,e,l,s,n,u,p,a,d,t,i,f,h){var m=e.is,e=u.TypeSignature,g=e.either,y=e.rest,o=e.optional,b=Object.assign;function v(e,t){if(d.isPrototypeOf(t)&&!t.canEnchant)return h.create("datatype","The changer given to (".concat(e,":) can't include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:)."))}["enchant","change"].forEach(function(o){u.addCommand(o,function(e,t){t=v(o,t);if(t)return t},function(t,n,e){n=p.from(n);var r,a=[];return d.isPrototypeOf(e)&&(r=i.create({section:t}),e.run(r),0<(r.innerEnchantments||[]).length)&&(r=r.innerEnchantments.map(function(e){return e(n)}),a.push.apply(a,_toConsumableArray(r))),a.push(f.create(_defineProperty(_defineProperty({scope:n},d.isPrototypeOf(e)?"changer":"lambda",e),"section",t))),a.forEach(function(e){"enchant"===o?(t.addEnchantment(e),t.updateEnchantments()):e.enchantScope()}),""},[g(p,String),g(d,t.TypeSignature("via"))],!1)}),u.addChanger("enchant-in",function(e,t,n){var r=v("enchant-in",n);return r||d.create("enchant-in",[t,n])},function(t,n,r){return t.innerEnchantments=(t.innerEnchantments||[]).concat(function(e){return f.create(_defineProperty(_defineProperty({scope:p.from(n),localHook:e},d.isPrototypeOf(r)?"changer":"lambda",r),"section",t.section))}),t},[g(p,String),g(d,t.TypeSignature("via"))]),[["link-style",p.create({type:"name",data:"link"})],["line-style",p.create({type:"base",data:p.create({type:"name",data:"page"})},"lines",void 0)],["char-style",p.create({type:"base",data:p.create({type:"name",data:"page"})},"chars",void 0)]].forEach(function(e){var e=_slicedToArray(e,2),r=e[0],a=e[1];u.addChanger(r,function(e,t){var n=v(r,t);return n||d.create(r,[t])},function(t,n){return t.innerEnchantments=(t.innerEnchantments||[]).concat(function(e){return f.create(_defineProperty(_defineProperty({scope:a,localHook:e},d.isPrototypeOf(n)?"changer":"lambda",n),"section",t.section))}),t},[g(d,t.TypeSignature("via"))])});e=["replace","append","prepend"];function w(i,s){return r.onStartup(function(){var e=i.classList.replace(/ /g,"."),t=i.blockClassList?i.blockClassList.replace(/ /g,"."):"",n="."+e+(t?",."+t:"");r.storyElement.on(i.event.map(function(e){return e+".enchantment"}).join(" "),n,function(){var e,t=c(this);r.options.debug&&r.options.ignoreClickEvents&&!t.is("tw-backdrop.eval-replay *, tw-backdrop.harlowe-crash *")||t.is("tw-open-button")||(e=(t=c(Array.from(t.parents(n).add(this)).sort(function(e,t){return 8&e.compareDocumentPosition(t)?1:-1})[0])).data("enchantmentEvent"))&&e(t)})}),[function(e,t,n){if(!t)return h.create("datatype","A string given to this ("+s+":) macro was empty.");if(n){var r=v(s,n);if(r)return r}return d.create(s,[p.from(t)].concat(n?[n]:[]))},function(t,e,n){t.enabled=!1,t.transitionDeferred=!0,i.rerender&&(t.newTargets=(t.newTargets||[]).concat({target:e,append:i.rerender}));var r,a=null!=(r=t.section)&&r.stackTop?t.section.stackTop.tempVariables:Object.create(null),o=f.create(_defineProperty({functions:[function(e){e.attr("class",e.children().is("tw-story, tw-sidebar, tw-passage")||["block","flex"].includes(e.children().css("display"))?i.blockClassList:i.classList),e.attr({tabIndex:"0"})}],data:{enchantmentEvent:function(){var e;null!=(e=t.section.stackTop)&&e.blocked||(i.once&&t.section.removeEnchantment(o),i.goto?l.goToPassage(i.goto,{transition:i.transition}):i.undo?l.goBack({transition:i.transition}):t.section.renderInto(t.source,null,_objectSpread(_objectSpread({},t),{},{append:i.once?"append":"replace",enabled:!0,transitionDeferred:!1}),a))}},scope:e,section:t.section,name:s},d.isPrototypeOf(n)?"changer":"lambda",n));return t.section&&(t.section.addEnchantment(o),o.enchantScope()),t},[g(p,String),o(g(d,t.TypeSignature("via")))]]}e.forEach(function(o){u.addChanger(o,function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.every(Boolean)?d.create(o,n.map(p.from),null,!1):h.create("datatype","A string given to this (".concat(o,":) macro was empty."))},function(e){var t;0<c(e.target).parents().filter("tw-collapsed,[collapsing=true]").length||e.attr.some(function(e){return e.collapsing})||(e.attr=[].concat(_toConsumableArray(e.attr),[{collapsing:!1}])),e.newTargets=e.newTargets||[];for(var n=arguments.length,r=new Array(1<n?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return(t=e.newTargets).push.apply(t,_toConsumableArray(r.filter(function(n){return!e.newTargets.some(function(e){var t=e.target,e=e.append;return m(n,t)&&o===e})}).map(function(e){return{target:e,append:o,before:!0}}))),e},y(g(p,String)))(o+"-with",function(e,t){return d.create(o+"-with",[t],null,!1)},function(e,t){return a.isPrototypeOf(t)&&(t=t.code),e.appendSource=(e.appendSource||[]).concat({source:t,append:o}),e},g(a,String))});var k="ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints,S=[{name:"click",enchantDesc:{event:["click"],once:!0,rerender:"",classList:"link enchantment-link",blockClassList:"enchantment-clickblock"}},{name:"mouseover",enchantDesc:{event:["mouseenter",k?"click":""].filter(Boolean),once:!0,rerender:"",classList:"link enchantment-mouseover",blockClassList:"enchantment-mouseoverblock"}},{name:"mouseout",enchantDesc:{event:["mouseleave",k?"click":""].filter(Boolean),once:!0,rerender:"",classList:"link enchantment-mouseout",blockClassList:"enchantment-mouseoutblock"}},{name:"doubleclick",enchantDesc:{event:["dblclick"],once:!0,rerender:"",classList:"link enchantment-dblclick",blockClassList:"enchantment-dblclickblock"}}];S.forEach(function(e){"doubleclick"!==e.name&&(u.addChanger.apply(u,[e.name].concat(_toConsumableArray(w(e.enchantDesc,e.name)))),"click"===e.name)&&u.addChanger.apply(u,[e.name+"-rerun"].concat(_toConsumableArray(w(_objectSpread(_objectSpread({},e.enchantDesc),{},{once:!1}),e.name+"-rerun"))))}),r.onStartup(function(){S.forEach(function(e){var n=e.enchantDesc;n.blockClassList&&r.storyElement.on(n.event.map(function(e){return e+".enchantment"}).join(" "),function(){var e,t=c(this);r.options.debug&&r.options.ignoreClickEvents&&!t.is("tw-backdrop.eval-replay *, tw-backdrop.harlowe-crash *")||t.is("tw-open-button")||(e=(t=c(Array.from(t.parents("."+n.blockClassList.replace(/ /g,"."))).sort(function(e,t){return 8&e.compareDocumentPosition(t)?1:-1})[0])).data("enchantmentEvent"))&&e(t)})})}),e.forEach(function(n){S.forEach(function(e){var t;"doubleclick"!==e&&(t=_objectSpread(_objectSpread({},e.enchantDesc),{},{rerender:n}),e=e.name+"-"+n,u.addChanger.apply(u,[e].concat(_toConsumableArray(w(t,e)))))})}),S.forEach(function(i){"doubleclick"!==i&&["goto","undo"].forEach(function(a){var o=i.name+"-"+a;u.addCommand(o,function(e,t){return!e||!t&&"goto"===a?h.create("datatype","A string given to this ("+o+":) macro was empty."):"goto"!==a||n.hasValid(t)?void 0:h.create("macrocall","I can't ("+o+":) the passage '"+t+"' because it doesn't exist.")},function(e,t,n,r){return"undo"===a&&s.pastLength or <- arrow if it's there."],g=Object.assign;function s(e,t,n){n=n||t;var r,a=u.hasValid(t)&&t===n,e=e.evaluateTwineMarkup(c.unescape(n),"a link's passage name");return a?t=(a=0<e.children().length?"`".repeat((n.match(/`+/)||[]).reduce(function(e,t){return Math.max(e,t.length+1)},1)):"")+"\0".repeat(!!a)+t+"\0".repeat(!!a)+a:(e.findAndFilter("tw-error").length&&(r=e.findAndFilter("tw-error").data("TwineError")),n=e.text()),{text:t,passage:n,error:r}}c.onStartup(function(){var e="ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints;function t(e){var t=i(this),n=t.closest("tw-expression"),r=t.closest("tw-expression, tw-hook"),a=r.data("clickEvent"),r=r.data("section");if((!c.options.debug||!c.options.ignoreClickEvents||t.is("tw-backdrop.eval-replay *, tw-backdrop.harlowe-crash *"))&&!t.is("tw-open-button")&&(null==r||!r.stackTop||!r.stackTop.blocked||r.stackTop.blocked instanceof i&&r.stackTop.blocked.find(t).length)){if(a)return 0 tw-link",t).on("mouseout.passage-link","tw-link.enchantment-mouseout, tw-expression.enchantment-mouseout > tw-link",t).on("dblclick.passage-link","tw-link.enchantment-dblclick, tw-expression.enchantment-dblclick > tw-link",t),i(document).on("fullscreenchange",function(){i("tw-link[fullscreen]",c.storyElement).each(function(e,t){(i(t).closest("tw-expression, tw-hook").data("fullscreenEvent")||Object)(t)})})}),[["link","link-replace"],["link-reveal","link-append"],["link-repeat"],["link-rerun"]].forEach(function(s){return e.addChanger(s,function(e,t,n){return t?n&&!n.canEnchant?h.create("datatype","The changer given to (".concat(s[0],":) can't be (or include) a revision, enchantment, or interaction changer like (replace:), (click:), or (link:).")):a.create(s[0],[t].concat(n||[]),null,!0):h.create("datatype",m[0])},function(r,e,t){var n,a=s[0],o=null!=(n=r.section)&&n.stackTop?r.section.stackTop.tempVariables:Object.create(null),i=d.create({source:""+e+"",target:function(){return r.target},append:"replace",data:{section:r.section,clickEvent:function(e){r.enablers=r.enablers.filter(function(e){return e.descriptor!==i}),"link-reveal"===a&&e.contents().unwrap();var t,n=e.parentsUntil(":not(tw-enchantment)").parent();n.length||(n=e.parent()),"link-rerun"===a&&(t=e.parentsUntil(":not(tw-enchantment)"),e.detach(),t.remove()),"link"!==a&&"link-rerun"!==a||n.empty(),r.section.renderInto("",null,r,o),"link-rerun"===a&&n.prepend(e)}}});return r.enablers=(r.enablers||[]).concat({descriptor:i,changer:t}),r},[String,r(a)])}),e.addCommand("link-goto",function(e){if(!e)return h.create.apply(h,["datatype"].concat(m))},function(e,t,n,r){var a,o=s(t,n,r);return n=o.text,r=o.passage,(o=o.error)||(e.transition?h.create("datatype","Please attach ("+(o="transition")+"-depart:) or ("+o+"-arrive:) to a passage link, not ("+o+":)."):(a=(a=u.hasValid(r)?a:''+n+"")||"<tw-link tabindex=0 "+(0"+n+"",e.data.linkPassageName=r,e.data.section=t,g(e,{source:a,transitionDeferred:!0})))},[String,r(String)])("link-storylet",function(){var e=(e=1===arguments.length||"string"!=typeof(arguments.length<=0?void 0:arguments[0])?0:1)<0||arguments.length<=e?void 0:arguments[e];if(!e||"string"==typeof e)return h.create("datatype","(link-storylet:) should be given one index number or one 'where' lambda, after the optional link text string.")},function(e,t){var n=(n=2+("string"==typeof(arguments.length<=2?void 0:arguments[2])?1:0))<2||arguments.length<=n?void 0:arguments[n],r="string"==typeof(arguments.length<=2?void 0:arguments[2])&&(arguments.length<=2?void 0:arguments[2]),a=((a=(arguments.length<=2?0:arguments.length-2)-1+2)<2||arguments.length<=a?void 0:arguments[a])!==n&&((a=(arguments.length<=2?0:arguments.length-2)-1+2)<2||arguments.length<=a?void 0:arguments[a]);if(e.transition)return h.create("datatype","Please attach (".concat(o="transition","-depart:) or (").concat(o,"-arrive:) to (link-storylet:), not (").concat(o,":)."));var o=f.isPrototypeOf(n),i=u.getStorylets(t,o&&n),s=h.containsError(i);if(s)return s;var c,s=i[o?0:n<0?i.length+n:n-1];if(s)s=s.get("name"),r=r||s,c=c||"<tw-link tabindex=0 "+(0"+r+"",e.data.linkPassageName=s,e.data.section=t;else{if(!a)return e;c=a}return g(e,{source:c,transitionDeferred:!0})},[n(parseInt,String,f.TypeSignature("where")),r(n(parseInt,String,f.TypeSignature("where"))),r(String)])("link-undo",function(e){if(!e)return h.create("datatype",m[0])},function(t,e,n){var r,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"";return l.pastLength<1?g(t,{source:a}):(r=(t.data.section=e).stackTop.tempVariables,t.data.forgetUndosEvent=function(){return t.data.section.whenUnblocked(function(){var e=_objectSpread(_objectSpread({},t),{},{append:"replace",source:a,transitionDeferred:!1});t.section.renderInto("",null,e,r)})},g(t,{source:""+n+"",transitionDeferred:!0}))},[String,r(String)])("link-show",function(e){if(!e)return h.create("datatype",m[0])},function(r,a,e){for(var t=arguments.length,n=new Array(3<t?t-3:0),o=3;o<t;o++)n[o-3]=arguments[o];return r.data.section=a,r.data.clickEvent=function(e){e.contents().unwrap(),n.forEach(function(e){return e.forEach(a,function(e){var t=e.data("originalSource")||"",n=e.data("hidden");n&&(e.removeData("hidden"),n instanceof i?e.empty().append(n):(n=e.data("tempVariables"),a.renderInto("",null,_objectSpread(_objectSpread({},r),{},{source:t,target:e,transitionDeferred:!1}),n&&Object.create(n))))})})},g(r,{source:""+e+"",transitionDeferred:!0})},[String,o(t)])("link-fullscreen",function(e,t){if(!e||!t)return h.create("datatype",m[0])},function(t,e,n,r){function a(){return document.fullscreenEnabled||document.msFullscreenEnabled?""+(document.fullscreenElement||document.msFullscreenElement?r:n)+"":r?""+r+"":""}var o=e.stackTop.tempVariables;return t.data.section=e,t.data.fullscreenEvent=function(){(document.fullscreenEnabled||document.msFullscreenEnabled)&&t.data.section.whenUnblocked(function(){var e=_objectSpread(_objectSpread({},t),{},{append:"replace",source:a(),transitionDeferred:!1});t.section.renderInto("",null,e,o)})},g(t,{source:a(),transitionDeferred:!0})},[String,String,r(String)]),e.addChanger(["link-reveal-goto"],function(e,t,n,r){if(!t)return h.create.apply(h,["datatype"].concat(m));if(a.isPrototypeOf(n)){if(a.isPrototypeOf(r))return h.create("datatype","You mustn't give two changers to (link-reveal-goto:)");r=n,n=void 0}return r&&!r.canEnchant?h.create("datatype","The changer given to (link-reveal-goto:) can't include a revision, enchantment, or interaction changer like (replace:), (click:), or (link:)."):(t=(e=s(e,t,n)).text,n=e.passage,e.error||a.create("link-reveal-goto",[t,n,r].filter(function(e){return void 0!==e}),null,!1))},function(t,e,n,r){var a,o,i,s;if(u.hasValid(n))return o=l.passageNameVisited(n),i=null!=(a=t.section)&&a.stackTop?t.section.stackTop.tempVariables:Object.create(null),s=d.create({source:"<tw-link tabindex=0 "+(0"+e+"",target:t.target,append:"replace",data:{section:t.section,append:"replace",clickEvent:function(e){t.enablers=t.enablers.filter(function(e){return e.descriptor!==s}),e.contents().unwrap(),t.section.renderInto("",null,t,i),t.section.whenUnblocked(function(){return p.goToPassage(n,{transition:t.data.passageT8n})})}}}),t.enablers=(t.enablers||[]).concat({descriptor:s,changer:r}),t;t.source=''+e+""},[String,r(n(a,String)),r(a)])}),define("macrolib/metadata",["macros","utils/operationutils","datatypes/lambda","internaltypes/twineerror"],function(t,e,n,s){function c(e){return{TwineScript_TypeName:"a ("+e+":) macro",TwineScript_ObjectName:"a ("+e+":) macro",TwineScript_Unstorable:!0,TwineScript_Print:function(){return""}}}var l=e.clone,u=e.objectName,p=e.isValidDatamapName,e=t.TypeSignature,r=e.zeroOrMore,e=e.Any;[["storylet",n.TypeSignature("when")],["urgency",Number],["exclusivity",Number]].forEach(function(e){var e=_slicedToArray(e,2),n=e[0],e=e[1];t.add(n,"Metadata",function(e,t){return e.stackTop.speculativePassage?t:c(n)},e)}),t.add("metadata","Metadata",function(e){for(var r,a=new Map,t=arguments.length,n=new Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=n.reduce(function(e,t){var n;if(!s.containsError(e))if(void 0===r)r=t;else{if(n=s.containsError(p(a,r)))return n;if(a.has(r))return s.create("macrocall","You used the same data name ("+u(r)+") twice in the same (metadata:) call.");a.set(r,l(t)),r=void 0}return e},!0);return s.containsError(i)?i:void 0!==r?s.create("macrocall","This (metadata:) macro has a data name without a value."):e.stackTop.speculativePassage?a:c("metadata")},r(e))}),define("macrolib/patterns",["macros","utils","utils/operationutils","datatypes/lambda","datatypes/datatype","datatypes/typedvar","internaltypes/twineerror","internaltypes/varscope"],function(e,t,n,y,b,h,v,w){function k(e){var r,t,a=e.name,n=e.fullArgs,o=e.args,i=e.makeRegExpString,s=void 0===i?function(e){return e.join("")}:i,c=void 0!==(i=e.insensitive)&&i,l=void 0===(i=e.canContainTypedVars)||i,u=void 0===(i=e.canBeUsedAlone)||i,p=void 0===(i=e.canContainTypedGlobals)||i,d=o||n,f=E(null),e=d.map(function e(t){if(h.isPrototypeOf(t)){var n=t.varRef;if(!l)return v.create("operation","Optional string patterns, like (".concat(a,":)").concat("p-many"===a?" with a minimum of 0 matches":"",", can't have typed variables inside them."));if(!p&&!w.isPrototypeOf(n.object))return v.create("operation","Only typed temp variables can be used in patterns given to (".concat(a,":)"));n=n.getName();if(n in f)return v.create("operation","There's already a typed temp variable named _".concat(n," inside this (").concat(a,":) call."));f[n]=!0;n=e(t.datatype);return v.containsError(n)?n:"("+n+")"}if(b.isPrototypeOf(t)){if(!(l&&p||"function"!=typeof t.typedVars)){n=t.typedVars();if(!l&&n.length)return v.create("operation","(".concat(a,":) can't have typed variables inside its pattern."));if(!p&&n.some(function(e){return!w.isPrototypeOf(e.varRef.object)}))return v.create("operation","Only typed temp variables can be used in patterns given to (".concat(a,":)"))}var r;return t.regExp?(t.rest?"(?:":"")+(c?t.insensitive():t).regExp+(t.rest?")*":""):(n=t.name,r=t.rest?"*":"","alnum"===n?m+r:"whitespace"===n?_+r:"uppercase"===n?(c?T:g)+r:"lowercase"===n?(c?T:S)+r:"anycase"===n?T+r:"digit"===n?"\\d"+r:"linebreak"===n?"(?:\\r|\\n|\\r\\n)"+r:"str"===n?".*?":["even","odd","int","num"].includes(n)?v.create("datatype","Please use string datatypes like 'digit' in (".concat(a,":) instead of number datatypes.")):v.create("datatype","The (".concat(a,":) macro must only be given string-related datatypes, not ").concat(O(t),".")))}return"string"==typeof t?(t=t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),c?t.replace(RegExp("(".concat(g,"|").concat(S,")"),"g"),function(e){return"["+e.toUpperCase()+e.toLowerCase()+"]"}):t):(x("createPattern","mapper() was given a non-string non-datatype "+t),"")});return(i=v.containsError(e))||(r=s(e),t=C(E(b),{name:a,regExp:r,insensitive:function(){return c?t:k({name:a,fullArgs:n,args:d.map(function(e){return b.isPrototypeOf(e)&&"function"==typeof e.insensitive?e.insensitive():e}),makeRegExpString:s,insensitive:!0,canContainTypedVars:l,canBeUsedAlone:u})},typedVars:function(){return d.reduce(function(e,t){return h.isPrototypeOf(t)&&(e=e.concat(c?h.create(k({name:"p-ins",fullArgs:[t.datatype],insensitive:!0}),t.varRef):t),t=t.datatype),e=b.isPrototypeOf(t)&&"function"==typeof t.typedVars?e.concat(t.typedVars()):e},[])},destructure:function(e){var n,t;return"string"!=typeof e?[v.create("operation","I can't put ".concat(O(e)," into ").concat(this.TwineScript_ToSource()," because it isn't a string."))]:(n=this.typedVars()).length?(t=(RegExp("^"+(this.rest?"(?:":"")+r+(this.rest?")*":"")+"$").exec(e)||[]).slice(1)).length?t.map(function(e,t){t=n[t];if(t)return t.datatype.rest&&!t.datatype.regExp&&((t=t.TwineScript_Clone()).datatype=k({name:"p",fullArgs:[t.datatype]})),{dest:t,value:e||"",src:void 0}}).filter(Boolean):[v.create("operation","I can't put ".concat(O(e)," because it doesn't match the pattern ").concat(this.TwineScript_ToSource(),"."))]:[]},TwineScript_IsTypeOf:function(e){return u?"string"==typeof e&&!!e.match("^"+(this.rest?"(?:":"")+r+(this.rest?")*":"")+"$"):v.create("operation","A (".concat(a,":) datatype must only be used with a (p:) macro."))},TwineScript_toTypeSignatureObject:function(){var t=this;return{pattern:"range",name:a,range:function(e){return t.TwineScript_IsTypeOf(e)}}},TwineScript_ToSource:function(){return(this.rest?"...":"")+"("+a+":"+n.map(A)+")"}}),Object.defineProperty(t,"TwineScript_ObjectName",{get:function(){return"a (".concat(a,":) datatype")}}),t)}var m=t.anyRealLetter,g=t.anyUppercase,S=t.anyLowercase,T=t.anyCasedLetter,_=t.realWhitespace,x=t.impossible,O=n.objectName,A=n.toSource,t=e.TypeSignature,n=t.rest,r=t.either,a=t.optional,t=t.nonNegativeInteger,C=Object.assign,E=Object.create,o=n(r(String,b,h));e.add(["p","pattern"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p",fullArgs:n})},o)(["p-either","pattern-either"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-either",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?:"+e.join("|")+")"}})},o)(["p-opt","pattern-opt","p-optional","pattern-optional"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-opt",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?:"+e.join("")+")?"}})},o)(["p-not","pattern-not"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.find(function(e){return"string"==typeof e?1!==_toConsumableArray(e).length:e.rest||e.regExp||["str","empty"].includes(e.name)})?v.create("datatype","(p-not:) should only be given single characters, or datatypes that match single characters"):k({name:"p-not",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"[^"+e.map(function(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}).join("")+"]"}})},o)(["p-not-before","pattern-not-before"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-not-before",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?!"+e.join("")+")"}})},o)(["p-before","pattern-before"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-before",fullArgs:n,canContainTypedVars:!1,makeRegExpString:function(e){return"(?="+e.join("")+")"}})},o)(["p-start","pattern-start"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-start",fullArgs:n,makeRegExpString:function(e){return"^(?:"+e.join("")+")"}})},o)(["p-end","pattern-end"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-end",fullArgs:n,makeRegExpString:function(e){return"(?:"+e.join("")+")$"}})},o)(["p-many","pattern-many"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a,o,i,s=n.slice();return"number"==typeof n[0]&&(a=n.shift(),o="number"==typeof n[0]?n.shift():1/0),!(void 0!==o&&o<a)&&n.length?(i=n.find(function(e){return"string"!=typeof e&&!b.isPrototypeOf(e)&&!h.isPrototypeOf(e)}))?v.create("datatype","This (p-many:) macro can only be given a min and max number followed by datatypes or strings, but was also given "+O(i)+"."):k({name:"p-many",args:n,fullArgs:s,canContainTypedVars:0<a,makeRegExpString:function(e){return"(?:"+e.join("")+")"+(void 0!==a?"{"+a+(o===1/0?",":o!==a?","+o:"")+"}":"+")}}):v.create("datatype","The (p-many:) macro needs to be given string patterns, not just min and max numbers.")},[n(r(t,String,b,h))])(["p-ins","pattern-ins","p-insensitive","pattern-insensitive"],"Datatype",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return k({name:"p-ins",fullArgs:n,insensitive:!0})},o)(["split","splitted"],"Array",function(e,t,n){if(t=k({name:"split",fullArgs:[t],canContainTypedVars:!1}),v.containsError(t))return t;if(!n)return[""];if(!t.regExp)return _toConsumableArray(n);for(var r,a=RegExp(t.regExp),o=[];n&&(r=a.exec(n));){if(r.index+r[0].length===0)return o;o.push(n.slice(0,r.index)),n=n.slice(r.index+r[0].length)}return o.concat(n||[])},[r(String,b),String])("trimmed","String",function(e,t,n){return void 0===n||b.isPrototypeOf(t)&&"whitespace"===t.name?t.trim():(t=k({name:"trimmed",fullArgs:[t],canContainTypedVars:!1}),v.containsError(t)?t:t.regExp?n.replace(RegExp("^("+t.regExp+")*|("+t.regExp+")*$","g"),""):n)},[r(String,b),a(String)])(["str-find","string-find"],"String",function(e,t,n){if(t=k({name:"str-find",fullArgs:[t],canContainTypedGlobals:!1}),v.containsError(t))return t;for(var r,a=t.typedVars(),o=RegExp(t.regExp,"g"),i=[],s=o.lastIndex;(r=o.exec(n))&&s!==o.lastIndex;)if(s=o.lastIndex,a.length){for(var c=new Map,l=0;l<a.length;l+=1){if("match"===a[l].varRef.getName())return v.create("macrocall","There was a typed temp variable named _match in the pattern given to (str-find:)","The variable _match is reserved, and can't be used inside (str-find:)'s pattern.");c.set(a[l].varRef.getName(),r[l+1]),c.set("match",r[0])}i.push(c)}else i.push(r[0]);return i},[b,String])(["str-replaced","string-replaced","replaced"],"String",function(e,t,n,r,a){if("number"!=typeof t){if(void 0!==a)return v.create("macrocall","1 too many values were given to (str-replaced:).","If this is given 5 values, the first value must be a number of replacements.");a=r,r=n,n=t,t=1/0}else if(void 0===a)return v.create("macrocall","The (str-replaced:) macro needs 1 more value.","The final string seems to be missing.");if(b.isPrototypeOf(r))return v.create("datatype","The replacement value for (str-replaced:) must be a string or lambda, not ".concat(O(r)));if(y.isPrototypeOf(a)||y.isPrototypeOf(n))return v.create("datatype","The ".concat(y.isPrototypeOf(a)?"final string":"search pattern"," given to (str-replaced:) can't be a lambda."),"Only the replacement value (after the search pattern) can be a 'via' lambda.");if(n=k({name:"str-replaced",fullArgs:[n],canContainTypedGlobals:!1}),v.containsError(n))return n;if(!n.regExp)return a;for(var o,i=RegExp(n.regExp,"g"),s=y.isPrototypeOf(r)?n.typedVars():[],c=1,l=0,u="",p=i.lastIndex;a&&(o=i.exec(a))&&0<t&&p!==i.lastIndex;){for(var p=i.lastIndex,d=Object.create(e.stack.length?e.stackTop.tempVariables:w),f=0;ft?[!0]:[]}}}},[_,b(O)])("after-error",function(){return o.create("after-error",[])},function(n){n.enabled=!1,n.transitionDeferred=!0;var r=n.section.stackTop.tempVariables;n.data.errorEvent=function(e){e.removeData("errorEvent");var t=_objectSpread(_objectSpread({},n),{},{enabled:!0,transitionDeferred:!1});t.data&&(t.data.errorEvent=void 0),n.section.whenUnblocked(function(){return n.section.renderInto("",null,t,r)})}},[])("hook",function(e,t){var n;return t?(n=c.insensitiveName(t))?o.create("hook",[n]):u.create("datatype",'The string given to (hook:), "'.concat(t,'", contained only dashes and underscores.')):u.create("datatype","The string given to (hook:) was empty.")},function(e,t){return e.attr.push({name:t})},[String])(["for","loop"],function(e,t){if(!t.loop)return u.create("datatype","The lambda provided to (for:) must refer to a temp variable, not just 'it'.");for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return o.create("for",[t].concat(r))},function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var o,i=t.filter(e.section,r);if(o=u.containsError(i))return o;e.loopVars[t.loop.getName()]=i||[]},[i.TypeSignature("where"),k(v)])(["transition","t8n"],function(e,t){return o.create("transition",[c.insensitiveName(t)])},function(e,t){return"zoom"===(e.transition=t)&&(e.transitionOrigin=function(){var e=s(this).offset(),t=e.left,e=e.top;return c.mouseCoords.x-t+"px "+(c.mouseCoords.y-e)+"px"}),e},[A])(["transition-time","t8n-time"],function(e,t){return o.create("transition-time",[t])},function(e,t){return e.transitionTime=t,e.data.passageT8n=m(e.data.passageT8n||{},{time:t}),e},[_])(["transition-delay","t8n-delay"],function(e,t){return o.create("transition-delay",[t])},function(e,t){return e.transitionDelay=t,e},[O])(["transition-skip","t8n-skip"],function(e,t){return o.create("transition-skip",[t])},function(e,t){return e.transitionSkip=t,e},[_])(["transition-depart","t8n-depart"],function(e,t){return o.create("transition-depart",[c.insensitiveName(t)])},function(e,t){return e.data.passageT8n=m(e.data.passageT8n||{},{depart:t}),"zoom"===t&&(e.data.passageT8n.departOrigin=function(){var e=s(this).offset(),t=e.left,e=e.top;return c.mouseCoords.x-t+"px "+(c.mouseCoords.y-e)+"px"}),e},[A])(["transition-arrive","t8n-arrive"],function(e,t){return o.create("transition-arrive",[c.insensitiveName(t)])},function(e,t){return e.data.passageT8n=m(e.data.passageT8n||{},{arrive:t}),"zoom"===t&&(e.data.passageT8n.arriveOrigin=function(){var e=s(this),t=e.offset(),n=t.left,t=t.top,r=e.height();return{"transform-origin":100*(c.mouseCoords.x-n)/e.width()+"% "+100*(c.mouseCoords.y-t)/r+"%",height:r+"px"}}),e},[A])("button",function(e,t){return void 0===t||f(t).size?o.create("button",t?[t]:[]):u.create("datatype",'The string given to (button:) should be a sizing line ("==X==", "==X", "=XXXX=" etc.), not '.concat(JSON.stringify(t),"."))},function(e,t){var t=f(t),n=t.marginLeft,t=t.size;return e.attr.push({class:function(){return this.className+(this.classList.contains("enchantment-button")?"":" ".repeat(0<this.className.length)+"enchantment-button")}}),e.styles.push({"margin-left":t?n+"%":void 0,width:t?t+"%":"100%"}),e},[b(String)]).apply(void 0,_toConsumableArray((d={click:{className:"enchantment-link",blockClassName:"enchantment-clickblock"},doubleclick:{className:"enchantment-dblclick",blockClassName:"enchantment-dblclickblock"},mouseover:{className:"enchantment-mouseover",blockClassName:"enchantment-mouseoverblock"},mouseout:{className:"enchantment-mouseout",blockClassName:"enchantment-mouseoutblock"}},["action",function(e,t){return o.create("action",[c.insensitiveName(t)])},function(e,t){return e.attr.push({class:function(){var e=function e(t){return(t=s(t)).is("tw-story, tw-sidebar, tw-passage")||["block","flex"].includes(t.css("display"))||t.children().get().some(e)}(this);return Array.from(this.classList).filter(function(t){return!Object.keys(d).some(function(e){return d[e].className===t||d[e].blockClassName===t})}).concat(d[t][e?"blockClassName":"className"]).join(" ")}}),e},[T.apply(void 0,_toConsumableArray(Object.keys(d)))]])))(["border","b4r"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border",n.map(c.insensitiveName))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({display:function(){var e=s(this).css("display");return n.every(function(e){return"none"===e})||!e.includes("inline")?e:"inline-block"},"border-style":n.join(" "),"border-width":function(){return this.style.borderWidth||"2px"}}),e},[C].concat(_toConsumableArray(Array(3).fill(b(C)))))(["border-size","b4r-size"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border-size",n)},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({"border-width":n.map(function(e){return e+"px"}).join(" ")}),e},[O].concat(_toConsumableArray(Array(3).fill(b(O)))))("corner-radius",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("corner-radius",n)},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.styles.push({"border-radius":n.map(function(e){return e+"px"}).join(" "),padding:function(){return this.style.padding||n.map(function(e){return e+"px"}).join(" ")}}),e},[O].concat(_toConsumableArray(Array(3).fill(b(O)))))(["border-colour","b4r-colour","border-color","b4r-color"],function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("border-colour",n.map(function(e){return a.isPrototypeOf(e)?e.toRGBAString(e):e}))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r|<=+|)$/.test(t)?((n=~n?_objectSpread({"text-align":"center","max-width":"50%"},25===(n=Math.round(n/(t.length-2)*50))?{"margin-left":"auto","margin-right":"auto"}:{"margin-left":n+"%"}):""===t.slice(-1)?{"text-align":"justify","max-width":"50%"}:t.includes(">")?{"text-align":"right"}:{"text-align":"left"}).display="block",o.create("align",[n])):u.create("datatype",'The (align:) macro requires an alignment arrow ("==>", "<=" etc.) be provided, not "'+t+'"')},function(e,t){e.styles.push(t)},[String])(["text-colour","text-color","color","colour"],function(e,t){return o.create("text-colour",[t])},function(e,t){return a.isPrototypeOf(t)&&(t=t.toRGBAString(t)),e.styles.push({color:t}),e},[g(String,a)])(["text-size","size"],function(e,t){return o.create("text-size",[t])},function(e,t){return e.styles.push({"font-size":24*t+"px","line-height":36*t+"px"}),e},[O])("text-indent",function(e,t){return o.create("text-indent",[t])},function(e,t){return e.styles.push({"text-indent":t+"px",display:"inline-block"}),e},[O])(["text-rotate-z","text-rotate"],function(e,t){return o.create("text-rotate-z",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" rotate("+t+"deg)"}}),e},[Number])("text-rotate-y",function(e,t){return o.create("text-rotate-y",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" perspective(50vw) rotateY("+t+"deg)"}}),e},[Number])("text-rotate-x",function(e,t){return o.create("text-rotate-x",[t])},function(e,t){return e.styles.push({display:"inline-block",transform:function(){var e=s(this).css("transform")||"";return(e="none"===e?"":e)+" perspective(50vw) rotateX("+t+"deg)"}}),e},[Number])(["background","bg"],function(e,t){return o.create("background",[t])},function(e,t){return a.isPrototypeOf(t)?t=t.toRGBAString():r.isPrototypeOf(t)&&(t=t.toLinearGradientString()),t=a.isHexString(t)||a.isCSS3Function(t)?{"background-color":t}:t.startsWith("linear-gradient(")||t.startsWith("repeating-linear-gradient(")?{"background-image":t}:{"background-size":"cover","background-image":"url(".concat(t,")"),"background-attachment":"fixed"},e.styles.push(t,{display:function(){var e=s(this);return!e.children().length||c.childrenProbablyInline(e)?s(this).css("display"):"block"}}),e},[g(String,a,r)]).apply(void 0,_toConsumableArray((y={color:function(){return"transparent"}},p=m(Object.create(null),{none:{},bold:{"font-weight":"bold"},italic:{"font-style":"italic"},underline:{"text-decoration":"underline"},doubleunderline:{"text-decoration":"underline","text-decoration-style":"double"},wavyunderline:{"text-decoration":"underline","text-decoration-style":"wavy"},strike:{"text-decoration":"line-through"},doublestrike:{"text-decoration":"line-through","text-decoration-style":"double"},wavystrike:{"text-decoration":"line-through","text-decoration-style":"wavy"},superscript:{"vertical-align":"super","font-size":".83em"},subscript:{"vertical-align":"sub","font-size":".83em"},blink:{animation:"fade-in-out 1s steps(1,end) infinite alternate"},shudder:{animation:"shudder linear 0.1s 0s infinite"},mark:{"background-color":"hsla(60, 100%, 50%, 0.6)"},condense:{"letter-spacing":"-0.08em"},expand:{"letter-spacing":"0.1em"},outline:[{"text-shadow":function(){var e=s(this).css("color");return"-1px -1px 0 "+e+", 1px -1px 0 "+e+",-1px 1px 0 "+e+", 1px 1px 0 "+e}},{color:function(){return c.parentColours(s(this)).backgroundColour}}],shadow:{"text-shadow":function(){return"0.08em 0.08em 0.08em "+s(this).css("color")}},emboss:{"text-shadow":function(){return"0.04em 0.04em 0em "+s(this).css("color")}},smear:[{"text-shadow":function(){var e=s(this).css("color");return"0em 0em 0.02em "+e+",-0.2em 0em 0.5em "+e+", 0.2em 0em 0.5em "+e}},y],blur:[{"text-shadow":function(){return"0em 0em 0.08em "+s(this).css("color")}},y],blurrier:[{"text-shadow":function(){return"0em 0em 0.2em "+s(this).css("color")},"user-select":"none"},y],mirror:{display:"inline-block",transform:"scaleX(-1)"},upsidedown:{display:"inline-block",transform:"scaleY(-1)"},tall:{display:"inline-block",transform:"scaleY(1.5) translateY(-0.25ex)"},flat:{display:"inline-block",transform:"scaleY(0.5) translateY(0.25ex)"},fadeinout:{animation:"fade-in-out 2s ease-in-out infinite alternate"},rumble:{animation:"rumble linear 0.1s 0s infinite"},sway:{animation:"sway linear 2.5s 0s infinite"},buoy:{animation:"buoy linear 2.5s 0s infinite"},fidget:{animation:function(){return"fidget step-end 60s "+60*-Math.random()+"s infinite"+(Math.random()<.5?" reverse":"")}}}),["text-style",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return o.create("text-style",n.map(c.insensitiveName))},function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0;a<n.length;a+=1)"none"===n[a]?e.styles=[]:e.styles=e.styles.concat(p[n[a]]);return e},[S(T.apply(void 0,_toConsumableArray(Object.keys(p))))]])))("collapse",function(){return o.create("collapse")},function(e){return e.attr.push({collapsing:!0}),e},[])("hover-style",function(e,t){var n=l.create(),r=(t.run(n),n.summary());return r+""=="styles"||r.every(function(e){return"styles"===e||"attr"===e})&&n.attr.every(function(e){return Object.keys(e)+""=="style"})?o.create("hover-style",[t]):u.create("datatype","The changer given to (hover-style:) must only change the hook's style.")},function(e,t){return e.data.hoverChanger=t,e.attr.push({hover:function(e,t){return void 0!==t&&t}}),e},[o])("css",function(e,t){return t.trim().endsWith(";")||(t+=";"),o.create("css",[t])},function(e,t){return e.attr.push({style:function(){return(s(this).attr("style")||"")+t}}),e},[String])("test-true",function(){return o.create("test-true",[])},function(e){return e.enabled=!0},k(w))("test-false",function(){return o.create("test-false",[])},function(e){return e.enabled=!1},k(w)),e.addCommand("animate",s.noop,function(r,e,t,a,o){t.forEach(e,function(e){var t,n;"zoom"===name&&(n=(t=e.offset()).left,t=t.top,n=c.mouseCoords.x-n+"px "+(c.mouseCoords.y-t)+"px"),c.transitionIn(e,a,r.transitionTime||o,r.transitionDelay,r.transitionSkip,0,n)})},[S(n),T.apply(void 0,_toConsumableArray(A.innerType.filter(function(e){return"instant"!==e}))),b(_)]),["box","float-box"].forEach(function(i){return e.addChanger(i,function(e,t,n){var r=-1===t.search(h)||1<t.length&&!t.includes("="),a="float-box"===i&&(-1===n.search(h)||1<n.length&&!n.includes("="));return r||a?u.create("datatype","The ("+i+':) macro requires a sizing line("==X==", "==X", "=XXXX=" etc.) be provided, not "'+(r?t:n)+'".'):o.create(i,[t,n].filter(function(e){return void 0!==e}))},function(e,t,n){var r,t=f(t),a=t.marginLeft,t=t.size,o=("float-box"===i&&(r=(o=f(n)).marginLeft,n=o.size),"box"===i?"%":"vw"),t=_defineProperty(_defineProperty(_defineProperty({display:"block",width:t+o,"max-width":t+o},"box"===i?"margin-left":"left",a+o),"overflow-y","auto"),"padding",function(){var e=s(this).css("padding");return e&&"0px"!==e?e:"1em"});return void 0!==n&&(t.height="box"===i?1.5*n+2+"em":n+"vh"),"float-box"===i&&m(t,{position:"fixed",top:r+"vh","background-color":function(){return c.parentColours(s(this)).backgroundColour}}),e.styles.push(t),e},[String,"box"===i?b(x):String])})}),define("macrolib/values",["macros","state","utils","utils/operationutils","datatypes/colour","datatypes/gradient","datatypes/datatype","datatypes/hookset","datatypes/codehook","internaltypes/twineerror"],function(t,r,e,n,l,c,a,o,i,f){var s=e.realWhitespace,u=e.nth,p=e.anyRealLetter,d=e.plural,h=n.subset,m=n.objectName,g=n.clone,y=n.toSource,e=t.TypeSignature,n=e.rest,b=e.zeroOrMore,v=e.either,w=e.optional,k=e.insensitiveSet,S=e.numberRange,T=e.percent,_=e.nonNegativeInteger,x=e.positiveInteger,e=e.Any,O=Math.max,A=Math.min,C=Math.round,E=Math.floor,N=Math.ceil;function j(t){return function(){var e=t.apply(void 0,arguments);return"number"!=typeof e||isNaN(e)?f.create("macrocall","This mathematical expression doesn't compute!"):e}}t.add(["str","string","text"],"String",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.map(function(e){return i.isPrototypeOf(e)?e.source:e}).join("")},[b(t.TypeSignature.either(String,Number,Boolean,Array,i))])("source","String",function(e,t){return"command"!==(null==t?void 0:t.TwineScript_TypeID)||t.TwineScript_ToSource?y(t):f.create("datatype","I can't construct the source code of a command created by a custom macro.")},[e])("substring","String",function(e,t,n,r){return h(t,n,r)},[String,parseInt,parseInt])("lowercase","String",function(e,t){return t.toLowerCase()},[String])("uppercase","String",function(e,t){return t.toUpperCase()},[String])("lowerfirst","String",function(e,t){return t.replace(RegExp(p+"+"),function(e){return(e=Array.from(e))[0].toLowerCase()+e.slice(1).join("").toLowerCase()})},[String])("upperfirst","String",function(e,t){return t.replace(RegExp(p+"+"),function(e){return(e=Array.from(e))[0].toUpperCase()+e.slice(1).join("").toLowerCase()})},[String])("words","Array",function(e,t){return t.split(RegExp(s+"+")).filter(Boolean)},[String])(["str-repeated","string-repeated"],"String",function(e,t,n){return 0===n.length?f.create("macrocall","I can't repeat an empty string."):n.repeat(t)},[_,String])(["str-reversed","string-reversed"],"String",function(e,t){return _toConsumableArray(t).reverse().join("")},[String])("joined","String",function(e,t){for(var n=arguments.length,r=new Array(2<n?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];return r.join(t)},[n(String)])("plural","String",function(e,t,n,r){return n&&""!==r?d(t,n,r):f.create("macrocall","The (plural:) macro can't be given empty strings.")},[parseInt,String,w(String)])(["str-nth","string-nth"],"String",function(e,t){return u(t)},[parseInt])("digit-format","String",function(e,t,n){if(1e21<=Math.abs(n))return f.create("macrocall","The number given to (digit-format:) is too big.");for(var r=/([^#0])(?=[#0]*$)/g,a=(r.exec(t)||[])[1],o=(/^[#0]*([^#0])/g.exec(t)||[])[1],i=(t=_toConsumableArray(t)).length,s=(a&&(","!==a||o&&","!==o)&&(i=r.lastIndex-1),Math.abs(n).toFixed(16).replace(/(\.\d*?)0+$/,function(e,t){return t}).replace(/^0+/,"")),c=s.includes(".")?s.indexOf("."):s.length,l=0,u="",p=t.length-1;0<=p;--p){var d=t[p];"0"===d||"#"===d?u=(s[c-i+p+l]||("0"===d?"0":""))+u:p<t.length-1&&0<p&&(u=d+u,l+=p===i?0:1)}return(n<0?"-":"")+u},[String,Number])(["num","number"],"Number",function(e,t){return Number.isNaN(+t)?f.create("macrocall","I couldn't convert "+m(t)+" to a number."):+t},[String])("datatype","Datatype",function(e,t){return a.from(t)},[e])("datapattern","Any",function(e,t){return function n(e){var r;return Array.isArray(e)?r=e.map(n):e instanceof Map?(r=new Map,_toConsumableArray(e).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];return r.set(t,n(e))})):r=a.from(e),(e=f.containsError(r))||r}(t)},[e])(["rgb","rgba"],"Colour",function(e){return l.create({r:arguments.length<=1?void 0:arguments[1],g:arguments.length<=2?void 0:arguments[2],b:arguments.length<=3?void 0:arguments[3],a:arguments.length<=4?void 0:arguments[4]})},[S(0,255),S(0,255),S(0,255),w(T)])(["hsl","hsla"],"Colour",function(e,t,n,r,a){return(t=C(t)%360)<0&&(t+=360),l.create({h:t,s:n,l:r,a:a})},[Number,T,T,w(T)])(["lch","lcha"],"Colour",function(e,t,n,r,a){return(r=C(r)%360)<0&&(r+=360),l.create({l:t,c:n,h:r,a:a})},[T,S(0,132),Number,w(T)])("complement","Colour",function(e,t){return t.LCHRotate(180)},[l])("mix","Colour",function(e,t,n,r,a){n=n.toLCHA(),a=a.toLCHA();var o=1,i=(t+r!==1&&(t+r<1&&(o=t+r),t=(i=[t/(t+r),r/(t+r)])[0],r=i[1]),n.c<2||n.l<.01||.99<n.l?n.h=a.h:(a.c<2||a.l<.01||.99<a.l)&&(a.h=n.h),n.l*=n.a,n.c*=n.a,a.l*=a.a,a.c*=a.a,180<a.h-n.h?n.h+=360:a.h-n.h<-180&&(a.h+=360),n.a*t+a.a*r),s=(n.l*t+a.l*r)/i,c=(n.c*t+a.c*r)/i,n=(n.h*t+a.h*r)/i;return l.create({l:s,c:c,h:n,a:i*o})},[T,l,T,l])("palette","Array",function(e,t,n){var r,a=n.toLCHA(),o=a.l,a={l:o<=.75?.75+o/3:.75-3*(1-o),c:80,h:a.h,a:1},i=l.create(a);return a.l+=o<=.75?-.1:.1,a.l<.5&&(a.l*=.5/a.l),r=l.create(a),a.l+=o<=.85?.15:-.15,o=l.create(a),"adjacent"===t?(r=(i=i.LCHRotate(-30)).LCHRotate(30),o=i.LCHRotate(60)):"triad"===t&&(o=i.LCHRotate(180),r=i.LCHRotate(140),i=i.LCHRotate(-140)),[n,i,r,o]},[k("mono","adjacent","triad"),l])("gradient","Gradient",function(e,t){(t=C(t)%360)<0&&(t+=360);for(var n,r,a,o=arguments.length,i=new Array(2<o?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];return i.length<4?f.create("datatype","(gradient:) must be given at least 2 colour-stop pairs of numbers and colours."):(r=[],a=i.reduce(function(e,t){if(!f.containsError(e))if(void 0===n)n=t;else{if("number"!=typeof n||!l.isPrototypeOf(t))return f.create("datatype","(gradient:) colour-stops should be pairs of numbers and colours, not colours and numbers.");r.push({stop:n,colour:g(t)}),n=void 0}return e},!0),f.containsError(a)?a:void 0!==n?f.create("macrocall","This gradient has a colour-stop percent without a colour."):c.create(t,r))},[Number,n(v(T,l))])("stripes","Gradient",function(e,t,n){(t=C(t)%360)<0&&(t+=360);for(var r=0,a=[],o=arguments.length,i=new Array(3<o?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return i.forEach(function(e){a.push({stop:r,colour:g(e)}),r+=n,a.push({stop:r,colour:g(e)})}),c.create(t,a,!0)},[Number,x,l,n(l)])("hooks-named","HookName",function(e,t){return t?o.create({type:"name",data:t}):f.create("datatype","(hooks-named:) can't be given an empty string.")},[String])("cond","Any",function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0;a<n.length;a+=2){var o=n[a];if(a===n.length-1||f.containsError(o))return o;if("boolean"!=typeof o)return f.create("datatype","(cond:)'s "+u(a+1)+" value is "+m(o)+", but should be a boolean.");if(o)return n[a+1]}return f.create("macrocall","An odd number of values must be given to (cond:), not "+n.length,"(cond:) must be given one or more pairs of booleans and values, as well as one final value.")},[Boolean,e,n(e)]);({weekday:[function(){return["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][(new Date).getDay()]+"day"},null],monthday:[function(){return(new Date).getDate()},null],currenttime:[function(){var e=new Date,t=e.getHours()<12;return(e.getHours()%12||12)+":"+((e.getMinutes()<10?"0":"")+e.getMinutes())+" "+(t?"A":"P")+"M"},null],currentdate:[function(){return(new Date).toDateString()},null],min:[A,n(Number)],max:[O,n(Number)],abs:[Math.abs,Number],sign:[Math.sign,Number],sin:[Math.sin,Number],cos:[Math.cos,Number],tan:[Math.tan,Number],floor:[E,Number],round:[C,Number],trunc:[function(e){return(0<e?E:N)(e)},Number],ceil:[N,Number],pow:[j(Math.pow),[Number,Number]],exp:[Math.exp,Number],sqrt:[j(Math.sqrt),Number],log:[j(Math.log),Number],log10:[j(Math.log10),Number],log2:[j(Math.log2),Number],random:[function(e,t){var n,t=t?(n=A(e,t),O(e,t)):(n=0,e);return t+=1,~~(r.random()*(t-n))+n},[parseInt,t.TypeSignature.optional(parseInt)]],"":function(){for(var e in this)e&&hasOwnProperty.call(this,e)&&t.add(e,"Number",function(a){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a.apply(void 0,n)}}(this[e][0]),this[e][1])}})[""](),t.add("either","Any",function(e){var t=1+~~(r.random()*(arguments.length<=1?0:arguments.length-1));return t<1||arguments.length<=t?void 0:arguments[t]},n(e))("nth","Any",function(e,t){return t<=0?f.create("datatype","(nth:)'s first value should be a positive whole number, not "+t):(t=(t-1)%(arguments.length<=2?0:arguments.length-2)+2)<2||arguments.length<=t?void 0:arguments[t]},[parseInt,n(e)])}),!function(){var a,k={};function o(e){for(var t in e)this[t]=e[t]}function i(e,t){for(var n,r,a=e.innerText,o=null,i=0,s=i,c=a.length,l=null;i<c;){for(var u=a.slice(i),p=(o&&o.length?o[0]:e).innerMode,d=0,f=p.length;d<f;d+=1){var h=k[p[d]];if(!(h.constraint&&!h.constraint(l)||h.cannotFollowText&&("text"===(null==(w=l)?void 0:w.type)||s<i))&&(h.plainCompare?u.startsWith(h.pattern):h.pattern.test(u))){var m=h.fn(h.plainCompare?h.pattern:h.pattern.exec(u)),g=!1,y=0;if(m.matches){for(;o&&y<o.length;y+=1){var b=o[y],v=b.type,b=b.aka;if(v in m.matches){g=!0;break}b&&(v=b),-1=o.length)&&!m.isFront)continue}s<i&&e.addChild({type:"text",text:a.slice(s,i),innerMode:p});var s=i+=(l=e.addChild(m)).text.length,w=!1;g&&(t&&S(e,l,o[y]),o=o.slice(y+1),w=!0),!w&&l.isFront&&(o?o.unshift(l):o=[l]);break}}d===f&&(i+=1,null===l)&&(l={type:"text"})}for(s<i&&e.addChild({type:"text",text:a.slice(s,i),innerMode:(null!=(n=o)&&n.length?o[0]:e).innerMode});0<(null==(r=o)?void 0:r.length);)o.shift().demote();return e}function S(e,t,n){var r=e.children.indexOf(t),a=e.children.indexOf(n);t.children=e.children.splice(a+1,r-(a+1)),t.type=t.matches[n.type],t.innerText="";for(var o,i=0,s=t.children.length;i<s;i++)t.innerText+=t.children[i].text;for(o in t.start=n.start,t.text=n.text+t.innerText+t.text,n)hasOwnProperty.call(n,o)&&!hasOwnProperty.call(t,o)&&(t[o]=n[o]);t.isFront&&(t.isFront=!1),e.children.splice(a,1)}o.prototype={constructor:o,addChild:function(e){var t=this.lastChildEnd(),n=new o(e);return n.start=t,n.end=e.text&&t+e.text.length,n.place=this.place,n.children=[],n.innerText&&i(n),this.children.push(n),n},lastChildEnd:function(){var e=this.children&&this.children[this.children.length-1]||null;return e?e.end:this.start+Math.max(0,this.text.indexOf(this.innerText))},tokenAt:function(e){if(e=this.end)return null;if(this.children.length)for(var t=0;t=this.children[t].start&&e<this.children[t].end){var n=this.children[t].tokenAt(e);if(n)return n}return this},pathAt:function(e){if(e=this.end)return[];var t=[];if(this.children.length)for(var n=0;n=this.children[n].start&&e<this.children[n].end){var r=this.children[n].pathAt(e);if(r.length){t=t.concat(r);break}}return t.concat(this)},nearestTokenAt:function(n){return n=this.end?null:this.children?this.children.reduce(function(e,t){return e||(n>=t.start&&n<t.end?t:null)},null):this},everyLeaf:function(n){return this.children&&0!==this.children.length?this.children.reduce(function(e,t){return e&&t.everyLeaf(n)},!0):!!n(this)},demote:function(){this.type="text"},error:function(e){this.type="error",this.message=e},toString:function(){var e=this.type+"("+this.start+"\u2192"+this.end+")";return this.children&&0<this.children.length&&(e+="["+this.children+"]"),e},copy:function(){var e=new o(this);return e.children=e.children.slice(),e},foldChildren:function(){for(var e=[],t=this.children.slice(),n=0;n<t.length;n+=1){var r=t[n],a=!1;if(r.matches)for(var o=0;o<e.length;o+=1)e[o].type in r.matches&&(S(this,r,e[o]),e=e.slice(o+1),a=!0);!a&&r.isFront&&e.unshift(r)}}},a={lex:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"start",r=3<arguments.length&&void 0!==arguments[3]&&arguments[3];return i(new o({type:"root",place:t,start:0,end:e.length,text:e,innerText:e,children:[],innerMode:a.modes[n]}),!r)},rules:k,modes:{}},"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=a:"function"==typeof define&&define.amd?define("lexer",[],function(){return a}):this&&null!=this&&this.loaded?(this.modules||(this.modules={}),this.modules.Lexer=a):this.Lexer=a}.call(eval("this")||("undefined"!=typeof global?global:window)),!function(){Object.assign=Object.assign||function(e){for(var t=1;t<");return~n?25===(t=Math.round(n/(e.length-2)*50))&&(t="center"):""===e.slice(-1)?t="justify":-1")?t="right":-1<e.indexOf("<")&&(t="left"),{align:t}}},column:{fn:function(e){var t,e=e[1],n=e.indexOf("|");return n&&n<e.length-1?t="center":"|"===e[0]&&"|"===e.slice(-1)?t="none":n===e.length-1?t="right":n||(t="left"),{column:t,width:/\|+/.exec(e)[0].length,marginLeft:/^=*/.exec(e)[0].length,marginRight:/=*$/.exec(e)[0].length}}}}),u=(g(l).forEach(function(e){l[e].constraint=o,l[e].cannotFollowText=!0}),a(i,{twine1Macro:{fn:function(){return{type:"error",message:"Harlowe macros use a different syntax to Twine 1, SugarCube, and Yarn macros."}}},emBack:{fn:function(){return{matches:{emFront:"em"},cannotCross:["verbatimOpener"]}}},strongBack:{fn:function(){return{matches:{strongFront:"strong"},cannotCross:["verbatimOpener"]}}},strongFront:{fn:function(){return{isFront:!0}}},emFront:{fn:function(){return{isFront:!0}}},boldOpener:{fn:n("boldOpener","bold")},italicOpener:{fn:n("italicOpener","italic")},strikeOpener:{fn:n("strikeOpener","strike")},supOpener:{fn:n("supOpener","sup")},commentFront:{fn:function(){return{isFront:!0}}},commentBack:{fn:function(){return{matches:{commentFront:"comment"}}}},scriptStyleTag:{fn:r},tag:{fn:r},url:{fn:r},hookPrependedFront:{fn:function(e){return{name:e[1],hidden:")"===e[2],isFront:!0,tagPosition:"prepended"}}},hookFront:{fn:function(){return{isFront:!0}}},hookBack:{fn:function(){return{matches:{hookPrependedFront:"hook",hookFront:"hook"},cannotCross:["verbatimOpener"]}}},hookAppendedBack:{fn:function(e){return{name:e[2],hidden:"("===e[1],tagPosition:"appended",matches:{hookFront:"hook"},cannotCross:["verbatimOpener"]}}},unclosedHook:{fn:r},unclosedHookPrepended:{fn:function(e){return{type:"unclosedHook",name:e[1],hidden:")"===e[2]}}},verbatimOpener:{fn:function(e){var e=e[0].length,t={};return{type:(t["verbatim"+e]="verbatim")+e,isFront:!0,matches:t,aka:"verbatimOpener"}}},unclosedCollapsed:{fn:r},collapsedFront:{fn:function(){return{isFront:!0}}},collapsedBack:{fn:function(){return{matches:{collapsedFront:"collapsed"},cannotCross:["verbatimOpener"]}}},escapedLine:{fn:r},legacyLink:{fn:function(e){return{type:"twineLink",innerText:e[1],passage:e[2],innerMode:i}}},br:{fn:r}})),p=y(a(s,{macroFront:{fn:function(e){return{isFront:!0,name:e[1]}}},groupingBack:{fn:function(){return{matches:{groupingFront:"grouping",macroFront:"macro"},cannotCross:["singleStringOpener","doubleStringOpener","hookFront"]}}},passageLink:{fn:function(e){var t=e[1]||"",n=e[2]||"",e=e[3]||"";return{type:"twineLink",innerText:n?e:t,passage:t?e:n,innerMode:i}}},simpleLink:{fn:function(e){return{type:"twineLink",innerText:e[1]||"",passage:e[1]||"",innerMode:i}}},variable:{constraint:function(e){return!e||"macroFront"!==e.type},fn:t("name")},tempVariable:{constraint:function(e){return!e||"macroFront"!==e.type},fn:t("name")}}),{hookFront:u.hookFront,hookBack:u.hookBack}),d=a(s,_objectSpread(_objectSpread({commentBack:{fn:function(){return{matches:{commentFront:"comment"}}}},macroName:{constraint:function(e){return e&&"macroFront"===e.type},fn:t("name")},groupingFront:{fn:function(){return{isFront:!0}}},property:{fn:t("name"),constraint:function(e){if(e)switch(e.type){case"variable":case"hookName":case"property":case"tempVariable":case"colour":case"itsProperty":case"belongingItProperty":case"macro":case"grouping":case"string":case"datatype":case"hook":case"boolean":case"number":return!0}}},possessiveOperator:{fn:r},itsProperty:{cannotFollowText:!0,fn:t("name")},itsOperator:{cannotFollowText:!0,fn:r},belongingItProperty:{cannotFollowText:!0,fn:t("name")},belongingItOperator:{cannotFollowText:!0,fn:r},belongingProperty:{cannotFollowText:!0,fn:t("name")},belongingOperator:{cannotFollowText:!0,fn:r},escapedStringChar:{fn:function(){return{type:"text"}}},singleStringOpener:{fn:function(){return{isFront:!0,matches:{singleStringOpener:"string"},innerMode:c}}},doubleStringOpener:{fn:function(){return{isFront:!0,matches:{doubleStringOpener:"string"},innerMode:c}}},hookName:{fn:t("name")},cssTime:{fn:function(e){return{value:+e[1]*("s"===e[2].toLowerCase()?1e3:1)}}},datatype:{cannotFollowText:!0,fn:function(e){return{name:e[0].toLowerCase()}}},colour:{cannotFollowText:!0,fn:function(e){var e=e[0].toLowerCase(),t={red:"e61919",orange:"e68019",yellow:"e5e619",lime:"80e619",green:"19e619",cyan:"19e5e6",aqua:"19e5e6",blue:"197fe6",navy:"1919e6",purple:"7f19e6",fuchsia:"e619e5",magenta:"e619e5",white:"fff",black:"000",gray:"888",grey:"888"},t=hasOwnProperty.call(t,e)?"#"+t[e]:e;return{colour:t}}},number:{fn:function(e){return{value:parseFloat(e[0])}}},inequality:{fn:function(e){return{operator:e[2],negate:-1":">=","=<":"=",lte:"",lt:"|<=+|)"+i+p,p=i+"(=+\\|+|\\|+=+|=+\\|+=+|\\|=+\\|)"+i+p,g={opener:"\\[\\[(?!\\[)",text:"("+function(){return"[^"+Array.apply(0,arguments).map(n).join("")+"]*"}("]")+")",rightSeparator:r("\\->","\\|"),leftSeparator:"<\\-",closer:"\\]\\]",legacySeparator:"\\|",legacyText:"("+r("[^\\|\\]]","\\]"+a("\\]"))+"+)"},y=u+"*"+u.replace("\\w","a-zA-Z")+u+"*",b="\\$("+y+")",v="_("+y+")",w="'s"+s+a("_")+"("+y+")",k="("+y+")"+s+"of"+c+a("it\\b"),S="'s"+s,T=r("it","time","turns?","visits?","exits?","pos")+c,_="its"+s+"("+y+")",x="("+y+")"+s+"of"+s+"it"+c,O="of"+s+"it"+c,A={opener:"\\(",name:"("+r("\\$","_")+"?"+l+"+):"+a("\\/"),closer:"\\)"},C=r("=","[gl]te?\\b","n?eq\\b","isnot\\b","are\\b","x\\b","isa\\b","or"+s+"a"+c),E="[a-zA-Z][\\w\\-]*",N="(?:\"[^\"]*\"|'[^']*'|[^'\">])*?",j="\\|("+l+"+)(>|\\))",P="(<|\\()("+l+"+)\\|",R="((?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?)"+a("m?s")+c;g.main=g.opener+r(g.text+g.rightSeparator,g.text.replace("*","*?")+g.leftSeparator)+g.text,e={upperLetter:"[A-Z\\u00c0-\\u00de\\u0150\\u0170]",lowerLetter:"[a-z0-9_\\-\\u00df-\\u00ff\\u0151\\u0171]",anyLetter:l,anyLetterStrict:u,whitespace:s.replace("[","[\\n\\r"),escapedLine:"\\\\\\n\\\\?|\\n\\\\",br:"\\n(?!\\\\)",tag:"",scriptStyleTag:"[^]*?",scriptStyleTagOpener:"<",url:"("+r("https?","mailto","javascript","ftp","data")+":\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])",bullet:"\\*",hr:h,heading:"[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*(#{1,6})[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*",align:m,column:p,bulleted:d,numbered:f,verbatimOpener:"`+",hookAppendedFront:"\\["+a("=+"),hookPrependedFront:j+"\\["+a("=+"),hookFront:"\\["+a("=+"),hookBack:"\\]"+a(P),hookAppendedBack:"\\]"+P,unclosedHook:"\\[=+",unclosedHookPrepended:j+"\\[=+",unclosedCollapsed:"\\{=+",passageLink:g.main+g.closer,legacyLink:g.opener+g.legacyText+g.legacySeparator+g.legacyText+g.closer,simpleLink:g.opener+g.legacyText+g.closer,macroFront:A.opener+o(A.name),macroName:A.name,groupingFront:"\\("+a(A.name),twine1Macro:"<\\s]+\\s*(?:\\\\.|'(?:[^'\\\\]*\\\\.)*[^'\\\\]*'|\"(?:[^\"\\\\]*\\\\.)*[^\"\\\\]*\"|[^'\"\\\\>]|>(?!>))*>>",validPropertyName:y,property:w,belongingProperty:k,possessiveOperator:S,belongingOperator:"of\\b",itsOperator:"its\\b",belongingItOperator:O,variable:b,tempVariable:v,hookName:"\\?("+l+"+)\\b",cssTime:"(\\d+\\.?\\d*|\\d*\\.?\\d+)(m?s)\\b",colour:r(r("Red","Orange","Yellow","Lime","Green","Cyan","Aqua","Blue","Navy","Purple","Fuchsia","Magenta","White","Gray","Grey","Black","Transparent"),"#[\\dA-Fa-f]{3}(?:[\\dA-Fa-f]{3})?"),datatype:r("alnum","alphanumeric","any(?:case)?","array","bool(?:ean)?","changer","codehook","colou?r","const","command","dm","data"+r("map","type","set"),"ds","digit","gradient","empty","even","int"+a("o")+"(?:eger)?","lambda","lowercase","macro","linebreak","newline","num(?:ber)?","odd","str(?:ing)?","uppercase","whitespace")+c,number:R,boolean:r("true","false")+c,identifier:T,itsProperty:_,belongingItProperty:x,escapedStringChar:"\\\\[^\\n]",singleStringOpener:"'",doubleStringOpener:'"',singleStringCloser:"'",doubleStringCloser:'"',is:"is"+a(s+"not"+c,s+"an?"+c,s+"in"+c,s+"")+c,isNot:"is"+s+"not"+a(s+r("an?","in")+c)+c,isA:"is"+s+"an?"+c,isNotA:"is"+s+"not"+s+"an?"+c,matches:"matches\\b",doesNotMatch:"does"+s+"not"+s+"match"+c,and:"and\\b",or:"or\\b",not:"not\\b",inequality:"((?:is(?:"+s+"not)?"+i+")*)("+r("<(?!=)","(?!=)",">=")+")",isIn:"is"+s+"in"+c,contains:"contains\\b",doesNotContain:"does"+s+"not"+s+"contain"+c,isNotIn:"is"+s+"not"+s+"in"+c,addition:n("+")+a("="),subtraction:n("-")+a("=","type"),multiplication:n("*")+a("="),division:r("/","%")+a("="),spread:"\\.\\.\\."+a("\\."),to:r("to\\b","="),into:"into\\b",making:"making\\b",where:"where\\b",when:"when\\b",via:"via\\b",each:"each\\b",augmentedAssign:r("\\+","\\-","\\*","\\/","%")+"=",bind:"2?bind\\b",typeSignature:n("-type")+c,incorrectOperator:C,PlainCompare:{comma:",",commentFront:"\x3c!--",commentBack:"--\x3e",strikeOpener:"~~",italicOpener:"//",boldOpener:"''",supOpener:"^^",strongFront:"**",strongBack:"**",emFront:"*",emBack:"*",collapsedFront:"{",collapsedBack:"}",groupingBack:")"}},"object"===("undefined"==typeof module?"undefined":_typeof(module))?module.exports=e:"function"==typeof define&&define.amd?define("patterns",[],function(){return e}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Patterns=e):this.Patterns=e}.call(eval("this")||("undefined"!=typeof global?global:window)),define("twinescript/operations",["utils","utils/operationutils","datatypes/typedvar","datatypes/datatype","internaltypes/twineerror"],function(e,t,n,r,m){var a=e.plural,o=t.isObject,i=t.collectionType,s=t.is,c=t.isA,l=t.clone,u=t.unique,p=t.contains,e=t.matches,g=t.objectName,d=t.toSource;function f(r,a,o,i){return o=o||"do this to",function(e,t){var n;return 1===a.length&&(t=e),(n=m.containsError(e,t))||(_typeof(e)!==r||_typeof(t)!==r?m.create("operation","I can only ".concat(o," ").concat(r,"s, not ").concat(g(_typeof(e)!==r?e:t),"."),i):a(e,t))}}function h(a){return function(e,t){var n,r;return(n=m.containsError(e,t))||(_typeof(e)!==_typeof(t)||o(e)&&"TwineScript_TypeName"in e&&o(t)&&"TwineScript_TypeName"in t&&e.TwineScript_TypeName!==t.TwineScript_TypeName||i(e)!==i(t)?(n="".concat(g(e)," isn't the same type of data as ").concat(g(t)),_typeof(e)+_typeof(t)!=="stringnumber"&&_typeof(e)+_typeof(t)!=="numberstring"||(r="You might want to convert one side to a number using (num:), or to a string using (str:)."),m.create("operation",n[0].toUpperCase()+n.slice(1),r)):a(e,t))}}function y(d,f,e){var h=2<arguments.length&&void 0!==e&&e;return function r(a,o){var e;if(e=m.containsError(a,o))return e;var t=_slicedToArray(a.determiner?[a,o]:o.determiner?[o,a]:[],2),i=t[0],t=t[1];if(i){var n=i,s=n.determiner,n=n.determined;if("start"===s||"end"===s){if(f)return m.create("operation","I can't use '".concat(f,"' with the 'start' or 'end' of ").concat(g(n),"."));if(t.determiner){if("start"===t.determiner||"end"===t.determiner)return m.create("operation","I can't compare one value's 'start' or 'end' with another value's 'start' or 'end'.","Please change one of them to use an exact range, such as '1stto4th' or '2ndlasttolast'.");n=[t,i],i=n[0]}for(var c=i.string||i.array,l=0;l<c.length+1;l+=1){var u=l?"end"===s?c.slice(-l):c.slice(0,l):c.constructor(),u=i===a?r(u,o):r(a,u);if(e=m.containsError(u))return e;if(u!==h)return u}return h}var p="all"===s;return i.array.reduce(function(e,t){var n,t=i===a?r(t,o):r(a,t);return(n=m.containsError(e,t))||(p?e&&t:e||t)},p)}return d(a,o)}}function b(n,e){return y(function(e,t){e=n(e,t);return m.containsError(e)?e:!e},e,!0)}t="If one of these values is a number, you may want to write a check that it 'is not 0'. Also, if one is a string, you may want to write a check that it 'is not \"\" '.",t={and:f("boolean",h(function(e,t){return e&&t}),"use 'and' to join",t),or:f("boolean",h(function(e,t){return e||t}),"use 'or' to join",t),not:f("boolean",function(e){return!e},"use 'not' to invert",t),"+":h(function(e,t){var n;return Array.isArray(e)?[].concat(_toConsumableArray(e),_toConsumableArray(t)):e instanceof Map?(n=new Map(e),t.forEach(function(e,t){return n.set(t,e)}),n):e instanceof Set?new Set([].concat(_toConsumableArray(e),_toConsumableArray(t)).filter(u).map(l)):"function"==typeof e["TwineScript_+"]?e["TwineScript_+"](t):"string|number|boolean".includes(_typeof(e))?e+t:m.create("operation","I can't use + on ".concat(g(e),"."))}),"-":h(function(e,n){var r;return Array.isArray(e)?e.filter(function(t){return!n.some(function(e){return s(t,e)})}):e instanceof Set?(r=_toConsumableArray(n),new Set(_toConsumableArray(e).filter(function(t){return!r.some(function(e){return s(t,e)})}))):"string"==typeof e?e.split(n).join(""):"number"==typeof e?e-n:m.create("operation","I can't use - on ".concat(g(e),"."))}),"*":f("number",h(function(e,t){return e*t}),"multiply"),"/":f("number",h(function(e,t){return 0===t?m.create("operation","I can't divide ".concat(g(e)," by zero.")):e/t}),"divide"),"%":f("number",h(function(e,t){return 0===t?m.create("operation","I can't modulo ".concat(g(e)," by zero.")):e%t}),"modulus"),"<":y(f("number",h(function(e,t){return e<t}),"do < to"),"":y(f("number",h(function(e,t){return t to"),">"),"<=":y(f("number",h(function(e,t){return e<=t}),"do <= to"),"=":y(f("number",h(function(e,t){return t= to"),">="),is:y(s),isNot:b(s),contains:y(p,"contains"),doesNotContain:b(p,"does not contain"),isIn:y(function(e,t){return p(t,e)},"is in"),isNotIn:b(function(e,t){return p(t,e)},"is not in"),isA:y(c,"is a"),isNotA:b(c,"is not a"),typifies:y(function(e,t){return c(t,e)}),untypifies:b(function(e,t){return c(t,e)}),matches:y(e),doesNotMatch:b(e),makeSpreader:function(e){var t;return m.containsError(e)?e:n.isPrototypeOf(e)||r.isPrototypeOf(e)?(t=l(e),(n.isPrototypeOf(e)?t.datatype:t).rest=!0,t):{value:e,spreader:!0,TwineScript_TypeName:"a spreaded '...' value",TwineScript_ObjectName:a("string"==typeof e||Array.isArray(e)?_toConsumableArray(e).length:1,"spreaded '...' value"),TwineScript_Unstorable:!0,TwineScript_ToSource:function(){return""+_toConsumableArray(e).map(d)}}}};return Object.freeze(t)}),define("twinescript/runner",["macros","state","utils","utils/operationutils","twinescript/operations","datatypes/colour","datatypes/hookset","datatypes/lambda","datatypes/datatype","datatypes/varbind","datatypes/codehook","datatypes/typedvar","datatypes/assignmentrequest","internaltypes/varref","internaltypes/twineerror"],function(Macros,State,Utils,_ref127,Operations,Colour,HookSet,Lambda,Datatype,VarBind,CodeHook,TypedVar,AssignmentRequest,VarRef,TwineError){var toSource=_ref127.toSource,typeName=_ref127.typeName,objectName=_ref127.objectName,insensitiveName=Utils.insensitiveName,impossible=Utils.impossible,hash=Utils.hash;function addFreeVariable(e,t){var n,r=e.freeVariables;"macro"===t.type?"current-time"===(n=insensitiveName(t.name))||"current-date"===n||"monthday"===n||"weekday"===n||"history"===n||"visited"===n||"passage"===n?e.freeVariables=!0:t.blockedValue&&!r.blockedValues?r.blockedValues=e.stackTop.blockedValues.concat():"random"!==n&&"either"!==n&&"shuffled"!==n||r.seed||(r.seed=State.seed,r.seedIter=State.seedIter):"identifier"===t.type?"time"!==(n=insensitiveName(t.text))&&"exits"!==n&&"it"!==n&&"visits"!==n&&"turns"!==n||(e.freeVariables=!0):"property"===t.type||"belongingProperty"===t.type?"random"!==insensitiveName(t.name)||r.seed||(r.seed=State.seed,r.seedIter=State.seedIter):"variable"!==t.type&&"tempVariable"!==t.type||(e.freeVariables=!0)}var precedenceTable=[["error","text"],["comma"],["to","into"],["where","when","via","making","each"],["typeSignature"],["augmentedAssign"],["and","or"],["is","isNot"],["contains","doesNotContain","isIn","isNotIn"],["isA","isNotA","matches","doesNotMatch"],["inequality"],["addition","subtraction"],["multiplication","division"],{rightAssociative:["spread","bind"]},{rightAssociative:["not","positive","negative"]},{rightAssociative:["belongingProperty","belongingItProperty","belongingOperator","belongingItOperator"]},["property","itsProperty","possessiveOperator","itsOperator"],["twineLink","macro","identifier","variable","tempVariable","hookName","number","cssTime","boolean","string","hook","colour","datatype","root"],["grouping"]];function precedentToken(e,t){var n,r,a,o=[];if(e.length)for("most"===t?(n=precedenceTable.length-1,r=a=-1):(n=0,r=precedenceTable.length,a=1);n!==r;n+=a){var i=precedenceTable[n],s=NaN;if(i.rightAssociative){for(var c=0;c<e.length;c+=1)if(i.rightAssociative.includes(e[c].type)){s=c;break}}else for(var l=e.length-1;0<=l;--l)if(i.includes(e[l].type)){s=l;break}if(!Number.isNaN(s)&&-1":"<=","=",">=":"<",""};function compileComparisonOperator(e){return"inequality"===e.type?e.negate?inequalityNegator[e.operator]:e.operator:e.type}var comparisonReverser={">":"<","",">=":"<=","=",contains:"isIn",doesNotContain:"isNotIn",isIn:"contains",isA:"typifies",typifies:"isA",isNotA:"untypifies",untypifies:"isNotA"};function reverseComparisonOperator(e){e=compileComparisonOperator(e);return comparisonReverser[e]||e}var tokenSides={error:"neither",identifier:"neither",variable:"neither",tempVariable:"neither",hookName:"neither",number:"neither",boolean:"neither",string:"neither",hook:"neither",colour:"neither",datatype:"neither",root:"neither",twineLink:"neither",macro:"neither",grouping:"neither",itsProperty:"neither",belongingItProperty:"neither",to:"both",into:"both",typeSignature:"both",augmentedAssign:"both",and:"both",or:"both",belongingOperator:"both",possessiveOperator:"both",multiplication:"both",division:"both",spread:"after",bind:"after",not:"after",belongingProperty:"after",each:"after",itsOperator:"after",positive:"after",negative:"after",belongingItOperator:"before",property:"before"};function missingSideError(e,t,n){return TwineError.create("syntax","I need usable code to be ".concat(e?"left ":"").concat(e&&t?"and ":"").concat(t?"right ":"","of ").concat(n.text,"."))}function wrongSideError(e,t,n){return TwineError.create("syntax","There can't be a ".concat(e&&t?e.map(function(e){return e.text}).join("")+" or "+t.map(function(e){return e.text}).join(""):(e||t).map(function(e){return e.text}).join("")," to the ").concat(e?"left ":"").concat(e&&t?"or ":"").concat(t?"right ":"","of ").concat(n.text,"."),"There could be a comma missing between them.")}function makeEvalReplayFrame(e,t){var n=t.val,r=t.fromCode,a=t.toCode,o=t.toDesc,i=t.reason,s=t.it,c=t.tokens,t=t.i;if(!(200t[0].start&&(u=(p=[t,u])[0],t=p[1]),p=a||"".concat(null!=(p=u)&&p.length&&"whitespace"===u[u.length-1].type?" ":"").concat(c?" \ud83d\udc1e ":(n&&!n.TwineScript_ToSource&&n.TwineScript_Unstorable?objectName:toSource)(n)).concat(null==(p=t)||!p.length||"whitespace"!==t[0].type&&"addition"!==l.type&&"subtraction"!==l.type?"":" "),(u.length?u[0]:l).start-h),g=(t.length?t[t.length-1]:l).end-h,y=_createForOfIteratorHelper(e);try{for(y.s();!(d=y.n()).done;){var b=d.value;b.start<m?(m+=b.diff,g+=b.diff):b.start<g&&(g+=b.diff)}}catch(e){y.e(e)}finally{y.f()}!r&&(r=f.slice(m,g),a)&&a.trim()===r.trim()||(u=p.length-(g-m),e.push({code:f.slice(0,m)+p+f.slice(g),fromCode:r,toCode:!c&&a,toDesc:!c&&!a&&(o||objectName(n)),start:m,end:g,diff:u,reason:i,itIdentifier:void 0!==s&&objectName(s),error:c&&c.render(f.slice(m,g),!0)}))}}}function setIt(e,t){return(VarRef.isPrototypeOf(t)||TypedVar.isPrototypeOf(t))&&(e.Identifiers.it=t.get()),t}return function run(section,tokens){var isVarRef=2<arguments.length&&void 0!==arguments[2]&&arguments[2],isTypedVar=3<arguments.length&&void 0!==arguments[3]&&arguments[3],evalReplay=section.evalReplay,hasEvalReplay=null==evalReplay?void 0:evalReplay.length,evalReplayReason,evalReplaySkip=!1,evalReplayIt,ops=Operations,token,ret,i,before,after,_precedentToken,_precedentToken2,token,i,before,after;if(Array.isArray(tokens)||(tokens=[tokens]),!tokens.length||!tokens[0])return impossible("Runner.run","No tokens to run!"),0;1===tokens.length?token=tokens[0]:(_precedentToken=precedentToken(tokens,"least"),_precedentToken2=_slicedToArray(_precedentToken,2),token=_precedentToken2[0],i=_precedentToken2[1],before=tokens.slice(0,i),after=tokens.slice(i+1),before.length&&(1!==before.length||"whitespace"!==before[0].type)||(before=!1),after.length&&(1!==after.length||"whitespace"!==after[0].type)||(after=!1));var type=token.type;if(!type)return impossible("Runner.run","Token has no type!"),0;var sides=tokenSides[type]||"",VARREF=("both"!==sides||before&&after?"neither"===sides&&(before||after)?ret=wrongSideError(before,after,token):"before"===sides?before?after&&(ret=wrongSideError(null,after,token)):ret=missingSideError(!0,!1,token):"after"===sides&&(after?before&&(ret=wrongSideError(before,null,token)):ret=missingSideError(!1,!0,token)):ret=missingSideError(!before,!after,token),section.freeVariables&&"object"===_typeof(section.freeVariables)&&addFreeVariable(section,token),!0),TYPEDVAR=!0,_ret4,val,evalReplayReason,ret,source,_source4,_value4,msg;if(!ret){if("comma"===type)return impossible("Section.run","a comma token was run() somehow."),0;if("root"===type)ret=run(section,token.children);else if("identifier"===type)ret=isVarRef?VarRef.create(section.Identifiers,token.text.toLowerCase()):section.Identifiers[token.text.toLowerCase()];else if("variable"===type||"tempVariable"===type){ret=VarRef.create("tempVariable"===type?section.stackTop.tempVariables:State.variables,token.name),isTypedVar?(ret=TypedVar.create(Datatype.create("any"),ret),evalReplayReason=hasEvalReplay&&"Variables in 'to' or 'into' expressions with no -type to their left are considered to be 'any-type' variables that can store any storable value."):isVarRef||TwineError.containsError(ret)?evalReplaySkip=!0:(val=ret.get(),evalReplayReason=hasEvalReplay&&((null==(_ret4=ret)?void 0:_ret4.object)!==State.variables||hasOwnProperty.call(ret.object,ret.compiledPropertyChain[0])?"":"This variable didn't exist; for story-wide $ variables, a default value of 0 is used if they don't exist."),ret=val)}else if("hookName"===type)ret=HookSet.create({type:"name",data:token.name}),evalReplaySkip=!0;else if("number"===type||"cssTime"===type)ret=token.value,evalReplayReason=hasEvalReplay&&"cssTime"===type&&(token.text.endsWith("ms")?"The letters 'ms' at the end of numbers are ignored, so you can use them to indicate that a number represents milliseconds.":"The letter 's' at the end of numbers represents 'seconds'. Harlowe converts them to milliseconds (multiplies them by 1000)."),evalReplaySkip=!evalReplayReason;else if("boolean"===type)ret="true"===token.text.toLowerCase(),evalReplaySkip=!0;else if("string"===type){var t=token.text.replace(/(.?)\n/g,function(e,t){return("\\"===t?"\\\\":"\n"===t?"\\n":t)+"\\n"}).replace(/(\\*)\\0/g,function(e,t){return(t?"\\".repeat(2*t.length):"")+"0"});ret=eval(t),evalReplaySkip=!0}else if("hook"===type)ret=CodeHook.create(token.children,token.text),evalReplaySkip=!0;else if("colour"===type)ret=Colour.create(token.colour),evalReplaySkip=!0;else if("datatype"===type)ret=Datatype.create(token.name),evalReplaySkip=!0;else if("spread"===type)ret=ops.makeSpreader(run(section,after,!1,isTypedVar));else if("bind"===type)ret=VarBind.create(run(section,after,VARREF),token.text.startsWith("2")?"two way":""),evalReplaySkip=!0;else if("to"===type||"into"===type){var dest="to"===type?setIt(section,run(section,before,VARREF,TYPEDVAR)):run(section,after,VARREF,TYPEDVAR);if(TwineError.containsError(dest))ret=dest;else{(VarRef.isPrototypeOf(dest)&&dest.propertyChain.length<=1||TypedVar.isPrototypeOf(dest)&&dest.varRef.propertyChain.length=toSource(src).length)&&(srcRef=void 0),ret=AssignmentRequest.create(dest,src,type,srcRef),evalReplaySkip=!0,evalReplayIt=section.Identifiers.it}}else if("typeSignature"===type){var datatype=run(section,before),free=section.freeVariables,variable=(section.freeVariables=null,run(section,after,VARREF));section.freeVariables=free,ret=TypedVar.create(datatype,variable),evalReplaySkip=!0}else if("where"===type||"when"===type||"via"===type){after?(source=tokens.map(function(e){return e.text}).join(""),ret=Lambda.create(before?run(section,before,VARREF):void 0,token.type,after,source),evalReplaySkip=!0):ret=missingSideError(!1,!0,token)}else if("making"===type||"each"===type){after?(_source4=[].concat(tokens).map(function(e){return e.text}).join(""),ret="each"===type?Lambda.create(run(section,after,VARREF),"each",null,_source4):Lambda.create(before?run(section,before,VARREF):void 0,token.type,run(section,after,VARREF),_source4),evalReplaySkip=!0):ret=missingSideError(!1,!0,token)}else if("augmentedAssign"===type)ret=ops.makeAssignmentRequest(run(section,before,VARREF),ops[token.operator](run(section,before),run(section,after)),token.operator),evalReplaySkip=!0;else if("and"===type||"or"===type){var isComparisonOp=function e(t){var n=_slicedToArray(precedentToken(t,"least"),2),r=n[0],n=n[1];if(r&&"whitespace"!==r.type)return comparisonOpTypes.includes(r.type)?r:r.type===type?e(t.slice(0,n))||e(t.slice(n+1)):void 0},leftIsComparison=isComparisonOp(before),rightIsComparison=isComparisonOp(after),ambiguityError=TwineError.create("operation",'This use of "is not" and "'.concat(type,'" is grammatically ambiguous.'),'Maybe try rewriting this as "__ is not __ '.concat(type,' __ is not __"')),operator,getElisionOperands=function e(t){var n,r=_slicedToArray(precedentToken(t,"least"),2),a=r[0],r=r[1];return a&&"whitespace"!==a.type?a.type===type?[].concat(_toConsumableArray(e(t.slice(0,r))),_toConsumableArray(e(t.slice(r+1)))):(a=run(section,t),hasEvalReplay&&"boolean"!=typeof a&&(n=operator.replace(/[A-Z]/g,function(e){return" "+e.toLowerCase()}),makeEvalReplayFrame(evalReplay,{toCode:" it ".concat(n," ").concat(toSource(a)," "),reason:"A missing 'it ".concat(n,"' was inferred to correct the '").concat(type,"' operation."),tokens:t,i:r}),makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(section.Identifiers.it)," ").concat(n," ").concat(toSource(a)," "),tokens:t,i:r})),[{val:a,tokens:t,i:r}]):[]},elidedComparisonOperator=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(e,t){var n=t.val,r=t.tokens,t=t.i;return"boolean"==typeof n?n:(e=Operations[token.type](e,Operations[operator](section.Identifiers.it,n)),hasEvalReplay&&makeEvalReplayFrame(evalReplay,{val:e,tokens:r,i:t}),e)},"and"===token.type)},leftSide,evalBefore,operator,rightSide,rightIndex,swappedSides,evalAfter;ret=leftIsComparison&&!rightIsComparison?(leftSide=leftIsComparison,operator=compileComparisonOperator(leftSide),"isNot"===leftSide.type||"isNotA"===leftSide.type||"untypifies"===leftSide.type?ambiguityError:(evalBefore=run(section,before),ops[type](evalBefore,elidedComparisonOperator.apply(void 0,_toConsumableArray(getElisionOperands(after)))))):!leftIsComparison&&rightIsComparison?(rightSide=rightIsComparison,rightIndex=tokens.indexOf(rightSide),operator=reverseComparisonOperator(rightSide),"isNot"===rightSide.type||"isNotA"===rightSide.type||"untypifies"===rightSide.type?ambiguityError:(swappedSides=[].concat(_toConsumableArray(tokens.slice(rightIndex+1)),[Object.assign(Object.create(rightSide),_defineProperty({},"inequality"===rightSide.type?"operator":"type",reverseComparisonOperator(rightSide)))],_toConsumableArray(tokens.slice(i+1,rightIndex))),evalAfter=run(section,swappedSides),ops[type](evalAfter,elidedComparisonOperator.apply(void 0,_toConsumableArray(getElisionOperands(before)))))):ops[type](run(section,before),run(section,after))}else if(comparisonOpTypes.includes(type)){after||missingSideError(!1,!0,token);var leftOp=before?run(section,before):section.Identifiers.it;ret=ops[compileComparisonOperator(token)](leftOp,run(section,after)),section.Identifiers.it=leftOp,evalReplayIt=leftOp,evalReplayReason=hasEvalReplay&&!before&&"A missing 'it' was inferred to complete the operation."}else if("addition"===type||"subtraction"===type){after||missingSideError(!1,!0,token);var convert=!before,_precedentToken7,_precedentToken8,previousPrecedentToken,_i10,_sides,pType,convert;before&&(_precedentToken7=precedentToken(before,"least"),_precedentToken8=_slicedToArray(_precedentToken7,2),previousPrecedentToken=_precedentToken8[0],_i10=_precedentToken8[1],_sides=tokenSides[previousPrecedentToken.type],pType=previousPrecedentToken.type,convert=("both"===_sides||"after"===_sides||"addition"===pType||"subtraction"===pType)&&(_i10===before.length-1||_i10===before.length-2&&"whitespace"===before[before.length-1].type)),convert?(token.type="addition"===type?"positive":"negative",ret=run(section,tokens),token.type=type,evalReplaySkip=!0):ret=ops[token.text](run(section,before),run(section,after))}else if("multiplication"===type||"division"===type)ret=ops[token.text](run(section,before),run(section,after));else if("positive"===type||"negative"===type)ret=ops["*"]("negative"===type?-1:1,run(section,after)),evalReplaySkip=!0;else if("not"===type)ret=ops.not(run(section,after));else if("belongingProperty"===type){var container=run(section,after,isVarRef),isRef=(ret=VarRef.create(container,token.name),isVarRef||TwineError.containsError(ret));ret=isRef?ret:ret.get(),isRef=isVarRef||TwineError.containsError(ret),hasEvalReplay&&!isRef?makeEvalReplayFrame(evalReplay,{toCode:" ".concat(token.name," of ").concat(toSource(VarRef.isPrototypeOf(container)?container.get():container)," "),tokens:tokens,i:i}):isRef||(evalReplayReason="The value to the right of 'of', ".concat(typeName(container),', had a "').concat(token.name,'" data name corresponding to that data value.'))}else if("belongingOperator"===type||"belongingItOperator"===type){var value=run(section,before);"random"===value&§ion.freeVariables&&"object"===_typeof(section.freeVariables)&&!section.freeVariables.seed&&(section.freeVariables.seed=State.seed,section.freeVariables.seedIter=State.seedIter),ret=VarRef.create("belongingItOperator"===type?section.Identifiers.it:run(section,after,isVarRef),{computed:!0,value:value}),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),"belongingItOperator"===type&&hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(value)," of ").concat(toSource(section.Identifiers.it)," "),tokens:tokens,i:i})}else if("property"===type){var _container=run(section,before,VARREF),_isRef=(ret=VarRef.create(_container,token.name),isVarRef||TwineError.containsError(ret));ret=_isRef?ret:ret.get(),_isRef=isVarRef||TwineError.containsError(ret),hasEvalReplay&&VarRef.isPrototypeOf(_container)&&!_isRef?makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(_container.get()),"'s ").concat(token.name," "),tokens:tokens,i:i}):_isRef||(evalReplayReason="The value to the left of 's, ".concat(typeName(_container),', had a "').concat(token.name,'" data name corresponding to that data value.'))}else if("itsProperty"===type||"belongingItProperty"===type)ret=VarRef.create(section.Identifiers.it,token.name),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:"itsProperty"===type?" ".concat(toSource(section.Identifiers.it),"'s ").concat(token.name," "):" ".concat(token.name," of ").concat(toSource(section.Identifiers.it)," "),tokens:tokens,i:i});else if("possessiveOperator"===type||"itsOperator"===type){!after||!before&&"itsOperator"!==token.type?ret=missingSideError(!before,!after,token):(_value4=run(section,after),"random"===_value4&§ion.freeVariables&&"object"===_typeof(section.freeVariables)&&!section.freeVariables.seed&&(section.freeVariables.seed=State.seed,section.freeVariables.seedIter=State.seedIter),ret=VarRef.create("itsOperator"===token.type?section.Identifiers.it:run(section,before,isVarRef),{computed:!0,value:_value4}),ret=isVarRef||TwineError.containsError(ret)?ret:ret.get(),"itsOperator"===type&&hasEvalReplay&&makeEvalReplayFrame(evalReplay,{toCode:" ".concat(toSource(section.Identifiers.it),"'s ").concat(toSource(_value4)," "),tokens:tokens,i:i}))}else if("twineLink"===type)ret=Macros.run("link-goto",section,[token.innerText,token.passage]),evalReplayReason=hasEvalReplay&&"Passage links are the same as (link-goto:) macro calls.";else if("macro"===type)if(token.blockedValue&&!section.blocked){if(ret=section.blockedValue(),void 0===ret)return impossible("Runner.run","section.blockedValue() returned undefined"),0}else{var macroNameToken=token.children[0],variableCall="$"===macroNameToken.text[0]||"_"===macroNameToken.text[0],macroRef;if("macroName"!==macroNameToken.type&&!variableCall)return impossible("Runner.run","macro token had no macroName child token"),0;variableCall?(macroRef=VarRef.create("_"===macroNameToken.text[0]?section.stackTop.tempVariables:State.variables,macroNameToken.text.trim().slice(1,-1)),TwineError.containsError(macroRef)||(macroRef=macroRef.get())):macroRef=token.name,ret=Macros[variableCall?"runCustom":"run"](macroRef,section,token.children.slice(1).reduce(function(e,t){return"comma"===t.type?e.push([]):e[e.length-1].push(t),e},[[]]).filter(function(e){return e.length&&(1<e.length||"whitespace"!==e[0].type)}).map(function(e){return run(section,e,!1,isTypedVar)})),evalReplayReason=hasEvalReplay&&variableCall&&"I called ".concat(objectName(macroRef),".")}else if("grouping"===type)ret=run(section,token.children,isVarRef),evalReplaySkip=!0;else if("error"===type)ret=TwineError.create("syntax",token.message,token.explanation||"");else{if("text"!==type)return impossible("Section.run","unknown syntax token type: ".concat(type,"!!")),0;token.text.trim().match(/^\d+(?:th|nd|st|rd)(?:last)?(?:to\d+(?:nth|nd|st|rd)(?:last)?)?$/g)&&(msg='Position data names like "'.concat(token.text,'" need to be either left of "of" or right of "\'s".')),ret=TwineError.create("syntax",msg||'"'.concat(token.text,"\" isn't valid Harlowe syntax for the inside of a macro call."),"Maybe you misspelled something? Also, as of 3.3.0, Javascript syntax is not allowed inside macro calls.")}}return void 0===ret?(impossible("Section.run","token ".concat(type).concat(token.name?" (".concat(token.name,":)"):""," produced undefined")),0):ret===section?(impossible("Section.run","token ".concat(type).concat(token.name?" (".concat(token.name,":)"):""," produced the section")),0):(hasEvalReplay&&!evalReplaySkip&&makeEvalReplayFrame(evalReplay,{val:ret,reason:evalReplayReason,it:evalReplayIt,tokens:tokens,i:i}),ret)}}),define("utils/jqueryplugins",["jquery"],function(e){e.prototype.extend({popAttr:function(e){var t=this.attr(e);return this.removeAttr(e),t},popData:function(e){var t=this.data(e);return this.removeData(e),t},tag:function(){return this[0]&&this[0].tagName&&this[0].tagName.toLowerCase()},textNodes:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"*";return 1===this.length&&this[0]&&this[0].nodeType===Node.TEXT_NODE?[this[0]]:this.get().concat(this.contents().get(),this.find(e).contents().get()).filter(function(e,t,n){return(null==e?void 0:e.nodeType)===Node.TEXT_NODE&&n.indexOf(e)===t}).sort(function(e,t){return 2&e.compareDocumentPosition(t)?1:-1})},findAndFilter:function(e){var t=this.find(e),e=this.filter(e);return e.length?t.add(e):t}})}),define("utils/naturalsort",[],function(){return function(h){var m=1<arguments.length&&void 0!==arguments[1]?arguments[1]:String;return function(e,t){var n,r,a,o,i=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[/-]\d{1,4}[/-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,l=/^0/,e=m(e).trim(),t=m(t).trim(),u=e.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=t.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),i=parseInt(e.match(c))||1!==u.length&&e.match(s)&&Date.parse(e),e=parseInt(t.match(c))||i&&t.match(s)&&Date.parse(t)||null;if(h&&window.Intl&&window.Intl.Collator&&(a=window.Intl.Collator(h)),e){if(i<e)return-1;if(e<i)return 1}for(var d=0,f=Math.max(u.length,p.length);d<f;d++){if(n=!(u[d]||"").match(l)&&parseFloat(u[d])||u[d]||0,r=!(p[d]||"").match(l)&&parseFloat(p[d])||p[d]||0,isNaN(n)!==isNaN(r))return isNaN(n)?1:-1;if(_typeof(n)!==_typeof(r))n+="",r+="";else if("string"==typeof n&&a&&0!==(o=a.compare(n,r)))return o;if(n<r)return-1;if(r<n)return 1}return 0}}}),define("utils/operationutils",["utils/naturalsort","utils","internaltypes/twineerror","patterns"],function(f,e,h,t){var m=e.impossible,g=e.nth,u=e.permutations,s=e.plural,y=t.validPropertyName,r="object",n="boolean",b="string",v="number",w="function";function a(e){return!!e&&(_typeof(e)===r||_typeof(e)===w)}var k=Array.isArray;function S(e){return e&&Object.getPrototypeOf(e)===Object.prototype}function i(e){return k(e)?"array":e instanceof Map?"datamap":e instanceof Set?"dataset":_typeof(e)===b?b:e&&_typeof(e)===r?r:""}function c(e){if(a(e)){if(_typeof(e.TwineScript_Clone)===w)return e.TwineScript_Clone();if(k(e))return _toConsumableArray(e);if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(_typeof(e)===w)return Object.assign(e.bind(),e);switch(Object.getPrototypeOf(e)){case Object.prototype:return _objectSpread({},e);case null:return Object.assign(Object.create(null),e)}m("OperationUtils.clone","The value "+e+" cannot be cloned!")}return e}function o(e,t,n,r){for(var a="",o=0;a.length<=t&&o<e.length;){var i=r(e[o]);if(!(i.length+a.length<=t)){a+=(0<o?" and ":"")+s(e.length-o,(0<o?"other ":"")+n);break}a+=(0<o&&o===e.length-1?" and ":"")+i+(o<e.length-1?", ":""),o+=1}return a}function l(e){var t;return a(e)&&"TwineScript_ObjectName"in e?e.TwineScript_ObjectName:k(e)?0===e.length?"an empty array":"an array (with "+o(e,48,"item",l)+")":e instanceof Map?0===e.size?"an empty datamap":"a datamap (with "+o(_toConsumableArray(e.keys()),48,"dataname",_)+")":e instanceof Set?0===e.size?"an empty dataset":"a dataset (with "+o(_toConsumableArray(e.values()),48,"item",l)+")":_typeof(e)===b?0===e.length?"an empty string":48<(t=_toConsumableArray(e)).length?"a ".concat(t.length,"-character string starting with ").concat(JSON.stringify(t.slice(0,48).join(""))):"the string ".concat(JSON.stringify(e)):_typeof(e)===n?"the boolean value '"+e+"'":_typeof(e)===v?"the number "+JSON.stringify(e):void 0===e?"an empty variable":"...whatever this is"}function T(e,t){return[e[0],t[0]].sort(f("en"))[0]===e[0]?-1:1}function _(e,t){var n=h.containsError(e);if(n&&m("toSource","received a TwineError: "+n.message),_typeof(e.TwineScript_ToSource)===w)return e.TwineScript_ToSource();if(S(e)&&"first"in e&&"last"in e)return(e.first<0?(-1!==e.first?g(-e.first):"")+"last":g(e.first+1))+"to"+(e.last<0?(-1!==e.last?g(-e.last):"")+"last":g(e.last+1));if(k(e)){var r,a="",o=_createForOfIteratorHelper(e);try{for(o.s();!(r=o.n()).done;)var i=r.value,a=(a+=a?",":"(a:")+("property"===t?i+(0<i):_(i))}catch(e){o.e(e)}finally{o.f()}return a+(a?")":"(a:)")}if(e instanceof Map){var s,c="",l=_createForOfIteratorHelper(Array.from(e.entries()).sort(T));try{for(l.s();!(s=l.n()).done;){var u=_slicedToArray(s.value,2),p=u[0],d=u[1];c+=(c?",":"(dm:")+_(p)+","+_(d)}}catch(e){l.e(e)}finally{l.f()}return c+(c?")":"(dm:)")}return e instanceof Set?"(ds:"+Array.from(e).sort(f("en")).map(_)+")":_typeof(e)===v&&"property"===t?e<0?-1===e?"last":g(-e)+"last":g(e+1):_typeof(e)===b&&"property"===t?RegExp(y).test(e)?e:"("+JSON.stringify(e)+")":JSON.stringify(e)}function p(t,n){return _typeof(t)!==r&&_typeof(n)!==r?t===n:k(t)&&k(n)?t.length===n.length&&t.every(function(e,t){return p(n[t],e)}):t instanceof Map&&n instanceof Map?p(Array.from(t.entries()).sort(),Array.from(n.entries()).sort()):t instanceof Set&&n instanceof Set?p(_toConsumableArray(t),_toConsumableArray(n)):t&&_typeof(t.TwineScript_is)===w?t.TwineScript_is(n):t&&_typeof(t)===r&&n&&_typeof(n)===r&&S(t)&&S(n)?p(Object.getOwnPropertyNames(t).map(function(e){return[e,t[e]]}),Object.getOwnPropertyNames(n).map(function(e){return[e,n[e]]})):Object.is(t,n)}return Object.freeze({isObject:a,isValidDatamapName:function(e,t){var n;return e instanceof Map||m("isValidDatamapName","called with non-Map"),h.containsError(t)?t:_typeof(t)!==b&&_typeof(t)!==v?h.create("property","Only strings and numbers can be used as data names for "+l(e)+", not "+l(t)+"."):(n=_typeof(t)===b?+t:""+t,!(!Number.isNaN(n)&&e.has(n))||h.create("property","You mustn't use both "+l(t)+" and "+l(n)+" as data names in the same datamap."))},collectionType:i,isSequential:function(e){return _typeof(e)===b||k(e)||_typeof(e.hooks)===w},unstorableValue:function e(t){return(null==t?void 0:t.TwineScript_Unstorable)&&t||k(t)&&t.find(e)||t instanceof Map&&_toConsumableArray(t.values()).find(e)||t instanceof Set&&_toConsumableArray(t).find(e)},isHarloweJSValue:function e(t){return _typeof(t)===b||_typeof(t)===n||_typeof(t)===v&&!Number.isNaN(t)&&Math.abs(t)!==1/0||Array.isArray(t)&&t.every(e)||t instanceof Set&&_toConsumableArray(t).every(e)||t instanceof Map&&_toConsumableArray(t.values()).every(e)&&_toConsumableArray(t.keys()).every(function(e){return _typeof(e)===b})},clone:c,objectName:l,typeName:function e(t){var n,r=S(t);return r&&t.innerType?t.typeName||("insensitive set"===t.pattern?"a case-insensitive string name":"either"===t.pattern?(k(t.innerType)||m("typeName",'"either" pattern had non-array inner type'),t.innerType.map(e).join(" or ")):"optional"===t.pattern?"(optional) "+e(t.innerType):e(t.innerType)):r&&"range"===t.pattern?t.name||(r=t.min,n=t.max,"a"+(0<r?" positive":"")+(t.integer?" whole":"")+" number"+(0===r?" between 0 and "+n:n<1/0?" up to "+n:"")):t===String||t===Number||t===Boolean?"a "+_typeof(t()):t===parseInt?"a whole number":t===Map?"a datamap":t===Set?"a dataset":t===Array?"an array":a(t)&&"TwineScript_TypeName"in t?t.TwineScript_TypeName:l(t)},typeID:function(e){var t=_typeof(e);return[n,b,v].includes(t)?t:k(e)?"array":e instanceof Map?"datamap":e instanceof Set?"dataset":e.TwineScript_TypeID||""},toSource:_,is:p,contains:function(e,t){if(e||""===e){if(_typeof(e)===b)return _typeof(t)!==b?h.create("operation",l(e)+" can only contain strings, not "+l(t)+"."):e.includes(t);if(k(e))return e.some(function(e){return p(e,t)});if(e instanceof Set||e instanceof Map)return Array.from(e.keys()).some(function(e){return p(e,t)})}return h.create("operation",l(e)+" cannot contain any values, let alone "+l(t))},isA:function(e,t){return _typeof(t.TwineScript_IsTypeOf)===w?t.TwineScript_IsTypeOf(e):h.create("operation",'"is a" should only be used to compare type names, not '+l(t)+".")},matches:function t(n,e){var r=!1;if(n&&_typeof(n.TwineScript_IsTypeOf)===w){var a=n.TwineScript_IsTypeOf(e);if(h.containsError(a))return a;r|=a}if(e&&_typeof(e.TwineScript_IsTypeOf)===w){if(a=e.TwineScript_IsTypeOf(n),h.containsError(a))return a;r|=a}if(r)return!0;if(k(n)&&k(e)){for(var o=0,i=0,s=!0;s&&o<n.length&&i<e.length;){var c=n[o],l=e[i];if(c.rest){for(;i<e.length&&t(c,l);)l=e[i+=1];o+=1}else if(l.rest){for(;o=n.length&&i>=e.length}return n instanceof Map&&e instanceof Map?t(Array.from(n.entries()).sort(),Array.from(e.entries()).sort()):n instanceof Set&&e instanceof Set?(n=_toConsumableArray(n),u.apply(void 0,_toConsumableArray(e)).some(function(e){return t(n,e)})):p(n,e)},subset:function e(t,n,r){var a,o;return n&&r?((a=_typeof(t)===b)&&(t=Array.from(t)),n<0&&(n=Math.max(0,t.length+n+1)),(r=r<0?Math.max(0,t.length+r+1):r)<n?e(arguments[0],r,n):(o=t.slice(0<n?n-1:n,r).map(c),a?o.join(""):o)):h.create("macrocall","The sub"+i(t)+" index value must not be "+(n&&r)+".")},range:function e(t,n){if(n<t)return e(n,t);var r=[t];for(n-=t;0<n--;)r.push(++t);return r},printBuiltinValue:function r(e){return h.containsError(e)?e:e&&_typeof(e.TwineScript_Print)===w?e.TwineScript_Print():e instanceof Map?(e=Array.from(e.entries()),h.containsError(e)?e:e.reduce(function(e,t){var n=(t=_slicedToArray(t,2))[0],t=t[1];return e+" "},"`"+r(n)+"` `"+r(t)+"` ")+"
"):e instanceof Set?Array.from(e.values()).map(r)+"":k(e)?e.map(r)+"":e&&_typeof(e.jquery)===b?e:a(e)?h.create("unimplemented","I don't know how to print this value yet."):e+""},unique:function(t,e,n){return n.findIndex(function(e){return p(t,e)})===e}})}),define("utils/polyfills",[],function(){var o=Array.prototype;"function"!=typeof o.includes&&(o.includes=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;if(!Number.isNaN(e)&&Number.isFinite(t)&&void 0!==e)return-1<o.indexOf.call(this,e,t);var n=Object(this),r=parseInt(n.length);if(!(r<=0))for(var a=0<=t?t:Math.max(0,r+t);a<r;){if(Object.is(e,n[a]))return!0;a+=1}return!1}),window.Symbol||(window.Symbol={iterator:"_es6-shim iterator_"})}),define("utils/renderutils",["jquery","utils","renderer"],function(l,u,p){var n=RegExp(u.realWhitespace+"+"),s=RegExp(u.realWhitespace+"+","g");function d(e,t,n){var r,a=e.textContent.length;if(!(a<=t))return r=[e=0===t?e:e.splitText(t)],n&&(n=n<=0?a-n:n)<a&&r.push(e.splitText(n-t)),r}var t,c=function(){var e;return void 0!==t?t:(e=l("
Deja un comentario