“).append(Se.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},Se.each([“ajaxStart”,”ajaxStop”,”ajaxComplete”,”ajaxError”,”ajaxSuccess”,”ajaxSend”],function(e,t){Se.fn[t]=function(e){return this.on(t,e)}}),Se.expr.pseudos.animated=function(e){return Se.grep(Se.timers,function(t){return e===t.elem}).length},Se.offset={setOffset:function(e,t,n){var r,i,o,a,s,c,u,l=Se.css(e,”position”),f=Se(e),p={};”static”===l&&(e.style.position=”relative”),s=f.offset(),o=Se.css(e,”top”),c=Se.css(e,”left”),u=(“absolute”===l||”fixed”===l)&&(o+c).indexOf(“auto”)>-1,u?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(c)||0),we(t)&&(t=t.call(e,n,Se.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),”using”in t?t.using.call(e,p):f.css(p)}},Se.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){Se.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(“fixed”===Se.css(r,”position”))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&”static”===Se.css(e,”position”);)e=e.parentNode;e&&e!==r&&1===e.nodeType&&(i=Se(e).offset(),i.top+=Se.css(e,”borderTopWidth”,!0),i.left+=Se.css(e,”borderLeftWidth”,!0))}return{top:t.top-i.top-Se.css(r,”marginTop”,!0),left:t.left-i.left-Se.css(r,”marginLeft”,!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&”static”===Se.css(e,”position”);)e=e.offsetParent;return e||Je})}}),Se.each({scrollLeft:”pageXOffset”,scrollTop:”pageYOffset”},function(e,t){var n=”pageYOffset”===t;Se.fn[e]=function(r){return Re(this,function(e,r,i){var o;if(xe(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),Se.each([“top”,”left”],function(e,t){Se.cssHooks[t]=q(be.pixelPosition,function(e,n){if(n)return n=R(e,t),pt.test(n)?Se(e).position()[t]+”px”:n})}),Se.each({Height:”height”,Width:”width”},function(e,t){Se.each({padding:”inner”+e,content:t,””:”outer”+e},function(n,r){Se.fn[r]=function(i,o){var a=arguments.length&&(n||”boolean”!=typeof i),s=n||(!0===i||!0===o?”margin”:”border”);return Re(this,function(t,n,i){var o;return xe(t)?0===r.indexOf(“outer”)?t[“inner”+e]:t.document.documentElement[“client”+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body[“scroll”+e],o[“scroll”+e],t.body[“offset”+e],o[“offset”+e],o[“client”+e])):void 0===i?Se.css(t,n,s):Se.style(t,n,i,s)},t,a?i:void 0,a)}})}),Se.each(“blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu”.split(” “),function(e,t){Se.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),Se.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Se.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,”**”):this.off(t,e||”**”,n)}}),Se.proxy=function(e,t){var n,r,i;if(“string”==typeof t&&(n=e[t],t=e,e=n),we(e))return r=le.call(arguments,2),i=function(){return e.apply(t||this,r.concat(le.call(arguments)))},i.guid=e.guid=e.guid||Se.guid++,i},Se.holdReady=function(e){e?Se.readyWait++:Se.ready(!0)},Se.isArray=Array.isArray,Se.parseJSON=JSON.parse,Se.nodeName=o,Se.isFunction=we,Se.isWindow=xe,Se.camelCase=h,Se.type=r,Se.now=Date.now,Se.isNumeric=function(e){var t=Se.type(e);return(“number”===t||”string”===t)&&!isNaN(e-parseFloat(e))},”function”==typeof define&&define.amd&&define(“jquery”,[],function(){return Se});var tn=e.jQuery,nn=e.$;return Se.noConflict=function(t){return e.$===Se&&(e.$=nn),t&&e.jQuery===Se&&(e.jQuery=tn),Se},t||(e.jQuery=e.$=Se),Se}),/*!
*
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){“function”==typeof define&&define.amd?define(“es6-shim”,t):”object”===(“undefined”==typeof exports?”undefined”:_typeof(exports))?module.exports=t():e.returnExports=t()}(this,function(){var e,t=Function.call.bind(Function.apply),n=Function.call.bind(Function.call),r=Array.isArray,i=Object.keys,o=function(e){try{return e(),!1}catch(e){return!0}},a=function(e){try{return e()}catch(e){return!1}},s=function(e){return function(){return!t(e,this,arguments)}}(o),c=!!Object.defineProperty&&function(){return!o(function(){return Object.defineProperty({},”x”,{get:function(){}})})}(),u=”foo”===function(){}.name,l=Function.call.bind(Array.prototype.forEach),f=Function.call.bind(Array.prototype.reduce),p=Function.call.bind(Array.prototype.filter),d=Function.call.bind(Array.prototype.some),h=function(e,t,n,r){!r&&t in e||(c?Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n}):e[t]=n)},g=function(e,t,n){l(i(t),function(r){var i=t[r];h(e,r,i,!!n)})},y=Function.call.bind(Object.prototype.toString),m=”function”==typeof/abc/?function(e){return”function”==typeof e&&”[object Function]”===y(e)}:function(e){return”function”==typeof e},v={getter:function(e,t,n){if(!c)throw new TypeError(“getters require true ES5 support”);Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:n})},proxy:function(e,t,n){if(!c)throw new TypeError(“getters require true ES5 support”);var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,{configurable:r.configurable,enumerable:r.enumerable,get:function(){return e[t]},set:function(n){e[t]=n}})},redefine:function(e,t,n){if(c){var r=Object.getOwnPropertyDescriptor(e,t);r.value=n,Object.defineProperty(e,t,r)}else e[t]=n},defineByDescriptor:function(e,t,n){c?Object.defineProperty(e,t,n):”value”in n&&(e[t]=n.value)},preserveToString:function(e,t){t&&m(t.toString)&&h(e,”toString”,t.toString.bind(t),!0)}},b=Object.create||function(e,t){var n=function(){};n.prototype=e;var r=new n;return void 0!==t&&i(t).forEach(function(e){v.defineByDescriptor(r,e,t[e])}),r},w=function(e,t){return!!Object.setPrototypeOf&&a(function(){var n=function t(n){var r=new e(n);return Object.setPrototypeOf(r,t.prototype),r};return Object.setPrototypeOf(n,e),n.prototype=b(e.prototype,{constructor:{value:n}}),t(n)})},x=function(){if(“undefined”!=typeof self)return self;if(“undefined”!=typeof window)return window;if(“undefined”!=typeof global)return global;throw new Error(“unable to locate global object”)}(),T=x.isFinite,S=Function.call.bind(String.prototype.indexOf),k=Function.apply.bind(Array.prototype.indexOf),O=Function.call.bind(Array.prototype.concat),j=Function.call.bind(String.prototype.slice),A=Function.call.bind(Array.prototype.push),C=Function.apply.bind(Array.prototype.push),E=Function.call.bind(Array.prototype.shift),N=Math.max,_=Math.min,P=Math.floor,I=Math.abs,M=Math.exp,D=Math.log,L=Math.sqrt,R=Function.call.bind(Object.prototype.hasOwnProperty),q=function(){},F=x.Map,H=F&&F.prototype.delete,V=F&&F.prototype.get,$=F&&F.prototype.has,B=F&&F.prototype.set,W=x.Symbol||{},z=W.species||”@@species”,U=Number.isNaN||function(e){return e!==e},G=Number.isFinite||function(e){return”number”==typeof e&&T(e)},J=m(Math.sign)?Math.sign:function(e){var t=Number(e);return 0===t?t:U(t)?t:t<0?-1:1},X=function(e){var t=Number(e);return t=0&&”[object Array]”!==y(e)&&”[object Function]”===y(e.callee)},Q=Y(arguments)?Y:Z,K={primitive:function(e){return null===e||”function”!=typeof e&&”object”!==(void 0===e?”undefined”:_typeof(e))},string:function(e){return”[object String]”===y(e)},regex:function(e){return”[object RegExp]”===y(e)},symbol:function(e){return”function”==typeof x.Symbol&&”symbol”===(void 0===e?”undefined”:_typeof(e))}},ee=function(e,t,n){var r=e[t];h(e,t,n,!0),v.preserveToString(e[t],r)},te=”function”==typeof W&&”function”==typeof W.for&&K.symbol(W()),ne=K.symbol(W.iterator)?W.iterator:”_es6-shim iterator_”;x.Set&&”function”==typeof(new x.Set)[“@@iterator”]&&(ne=”@@iterator”),x.Reflect||h(x,”Reflect”,{},!0);var re=x.Reflect,ie=String,oe=”undefined”!=typeof document&&document?document.all:null,ae=null==oe?function(e){return null==e}:function(e){return null==e&&e!==oe},se={Call:function(e,n){var r=arguments.length>2?arguments[2]:[];if(!se.IsCallable(e))throw new TypeError(e+” is not a function”);return t(e,n,r)},RequireObjectCoercible:function(e,t){if(ae(e))throw new TypeError(t||”Cannot call method on “+e);return e},TypeIsObject:function(e){return void 0!==e&&null!==e&&!0!==e&&!1!==e&&(“function”==typeof e||”object”===(void 0===e?”undefined”:_typeof(e))||e===oe)},ToObject:function(e,t){return Object(se.RequireObjectCoercible(e,t))},IsCallable:m,IsConstructor:function(e){return se.IsCallable(e)},ToInt32:function(e){return se.ToNumber(e)>>0},ToUint32:function(e){return se.ToNumber(e)>>>0},ToNumber:function(e){if(“[object Symbol]”===y(e))throw new TypeError(“Cannot convert a Symbol value to a number”);return+e},ToInteger:function(e){var t=se.ToNumber(e);return U(t)?0:0!==t&&G(t)?(t>0?1:-1)*P(I(t)):t},ToLength:function(e){var t=se.ToInteger(e);return tNumber.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t},SameValue:function(e,t){return e===t?0!==e||1/e==1/t:U(e)&&U(t)},SameValueZero:function(e,t){return e===t||U(e)&&U(t)},IsIterable:function(e){return se.TypeIsObject(e)&&(void 0!==e[ne]||Q(e))},GetIterator:function(t){if(Q(t))return new e(t,”value”);var n=se.GetMethod(t,ne);if(!se.IsCallable(n))throw new TypeError(“value is not an iterable”);var r=se.Call(n,t);if(!se.TypeIsObject(r))throw new TypeError(“bad iterator”);return r},GetMethod:function(e,t){var n=se.ToObject(e)[t];if(!ae(n)){if(!se.IsCallable(n))throw new TypeError(“Method not callable: “+t);return n}},IteratorComplete:function(e){return!!e.done},IteratorClose:function(e,t){var n=se.GetMethod(e,”return”);if(void 0!==n){var r,i;try{r=se.Call(n,e)}catch(e){i=e}if(!t){if(i)throw i;if(!se.TypeIsObject(r))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(!se.TypeIsObject(t))throw new TypeError(“bad iterator”);return t},IteratorStep:function(e){var t=se.IteratorNext(e);return!se.IteratorComplete(t)&&t},Construct:function(e,t,n,r){var i=void 0===n?e:n;if(!r&&re.construct)return re.construct(e,t,i);var o=i.prototype;se.TypeIsObject(o)||(o=Object.prototype);var a=b(o),s=se.Call(e,a,t);return se.TypeIsObject(s)?s:a},SpeciesConstructor:function(e,t){var n=e.constructor;if(void 0===n)return t;if(!se.TypeIsObject(n))throw new TypeError(“Bad constructor”);var r=n[z];if(ae(r))return t;if(!se.IsConstructor(r))throw new TypeError(“Bad @@species”);return r},CreateHTML:function(e,t,n,r){var i=se.ToString(e),o=””+i+””},IsRegExp:function(e){if(!se.TypeIsObject(e))return!1;var t=e[W.match];return void 0!==t?!!t:K.regex(e)},ToString:function(e){return ie(e)}};if(c&&te){var ce=function(e){if(K.symbol(W[e]))return W[e];var t=W.for(“Symbol.”+e);return Object.defineProperty(W,e,{configurable:!1,enumerable:!1,writable:!1,value:t}),t};if(!K.symbol(W.search)){var ue=ce(“search”),le=String.prototype.search;h(RegExp.prototype,ue,function(e){return se.Call(le,e,[this])});var fe=function(e){var t=se.RequireObjectCoercible(this);if(!ae(e)){var n=se.GetMethod(e,ue);if(void 0!==n)return se.Call(n,e,[t])}return se.Call(le,t,[se.ToString(e)])};ee(String.prototype,”search”,fe)}if(!K.symbol(W.replace)){var pe=ce(“replace”),de=String.prototype.replace;h(RegExp.prototype,pe,function(e,t){return se.Call(de,e,[this,t])});var he=function(e,t){var n=se.RequireObjectCoercible(this);if(!ae(e)){var r=se.GetMethod(e,pe);if(void 0!==r)return se.Call(r,e,[n,t])}return se.Call(de,n,[se.ToString(e),t])};ee(String.prototype,”replace”,he)}if(!K.symbol(W.split)){var ge=ce(“split”),ye=String.prototype.split;h(RegExp.prototype,ge,function(e,t){return se.Call(ye,e,[this,t])});var me=function(e,t){var n=se.RequireObjectCoercible(this);if(!ae(e)){var r=se.GetMethod(e,ge);if(void 0!==r)return se.Call(r,e,[n,t])}return se.Call(ye,n,[se.ToString(e),t])};ee(String.prototype,”split”,me)}var ve=K.symbol(W.match),be=ve&&function(){var e={};return e[W.match]=function(){return 42},42!==”a”.match(e)}();if(!ve||be){var we=ce(“match”),xe=String.prototype.match;h(RegExp.prototype,we,function(e){return se.Call(xe,e,[this])});var Te=function(e){var t=se.RequireObjectCoercible(this);if(!ae(e)){var n=se.GetMethod(e,we);if(void 0!==n)return se.Call(n,e,[t])}return se.Call(xe,t,[se.ToString(e)])};ee(String.prototype,”match”,Te)}}var Se=function(e,t,n){v.preserveToString(t,e),Object.setPrototypeOf&&Object.setPrototypeOf(e,t),c?l(Object.getOwnPropertyNames(e),function(r){r in q||n[r]||v.proxy(e,r,t)}):l(Object.keys(e),function(r){r in q||n[r]||(t[r]=e[r])}),t.prototype=e.prototype,v.redefine(e.prototype,”constructor”,t)},ke=function(){return this},Oe=function(e){c&&!R(e,z)&&v.getter(e,z,ke)},je=function(e,t){var n=t||function(){return this};h(e,ne,n),!e[ne]&&K.symbol(ne)&&(e[ne]=n)},Ae=function(e,t,n){c?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n},Ce=function(e,t,n){if(Ae(e,t,n),!se.SameValue(e[t],n))throw new TypeError(“property is nonconfigurable”)},Ee=function(e,t,n,r){if(!se.TypeIsObject(e))throw new TypeError(“Constructor requires `new`: “+t.name);var i=t.prototype;se.TypeIsObject(i)||(i=n);var o=b(i);for(var a in r)if(R(r,a)){var s=r[a];h(o,a,s,!0)}return o};if(String.fromCodePoint&&1!==String.fromCodePoint.length){var Ne=String.fromCodePoint;ee(String,”fromCodePoint”,function(e){return se.Call(Ne,this,arguments)})}var _e={fromCodePoint:function(e){for(var t,n=[],r=0,i=arguments.length;r<i;r++){if(t=Number(arguments[r]),!se.SameValue(t,se.ToInteger(t))||t1114111)throw new RangeError(“Invalid code point “+t);t>10))),A(n,String.fromCharCode(t%1024+56320)))}return n.join(“”)},raw:function(e){var t=se.ToObject(e,”bad callSite”),n=se.ToObject(t.raw,”bad raw value”),r=n.length,i=se.ToLength(r);if(i<=0)return"";for(var o,a,s,c,u=[],l=0;l
=i));)a=l+1<arguments.length?arguments[l+1]:"",c=se.ToString(a),A(u,c),l+=1;return u.join("")}};String.raw&&"xy"!==String.raw({raw:{0:"x",1:"y",length:2}})&&ee(String,"raw",_e.raw),g(String,_e);var Pe=function e(t,n){if(n<1)return"";if(n%2)return e(t,n-1)+t;var r=e(t,n/2);return r+r},Ie={repeat:function(e){var t=se.ToString(se.RequireObjectCoercible(this)),n=se.ToInteger(e);if(n=1/0)throw new RangeError(“repeat count must be less than infinity and not overflow maximum string size”);return Pe(t,n)},startsWith:function(e){var t=se.ToString(se.RequireObjectCoercible(this));if(se.IsRegExp(e))throw new TypeError(‘Cannot call method “startsWith” with a regex’);var n,r=se.ToString(e);arguments.length>1&&(n=arguments[1]);var i=N(se.ToInteger(n),0);return j(t,i,i+r.length)===r},endsWith:function(e){var t=se.ToString(se.RequireObjectCoercible(this));if(se.IsRegExp(e))throw new TypeError(‘Cannot call method “endsWith” with a regex’);var n,r=se.ToString(e),i=t.length;arguments.length>1&&(n=arguments[1]);var o=void 0===n?i:se.ToInteger(n),a=_(N(o,0),i);return j(t,a-r.length,a)===r},includes:function(e){if(se.IsRegExp(e))throw new TypeError(‘”includes” does not accept a RegExp’);var t,n=se.ToString(e);return arguments.length>1&&(t=arguments[1]),-1!==S(this,n,t)},codePointAt:function(e){var t=se.ToString(se.RequireObjectCoercible(this)),n=se.ToInteger(e),r=t.length;if(n>=0&&n<r){var i=t.charCodeAt(n),o=n+1===r;if(i56319||o)return i;var a=t.charCodeAt(n+1);return a57343?i:1024*(i-55296)+(a-56320)+65536}}};if(String.prototype.includes&&!1!==”a”.includes(“a”,1/0)&&ee(String.prototype,”includes”,Ie.includes),String.prototype.startsWith&&String.prototype.endsWith){var Me=o(function(){return”/a/”.startsWith(/a/)}),De=a(function(){return!1===”abc”.startsWith(“a”,1/0)});Me&&De||(ee(String.prototype,”startsWith”,Ie.startsWith),ee(String.prototype,”endsWith”,Ie.endsWith))}if(te){a(function(){var e=/a/;return e[W.match]=!1,”/a/”.startsWith(e)})||ee(String.prototype,”startsWith”,Ie.startsWith);a(function(){var e=/a/;return e[W.match]=!1,”/a/”.endsWith(e)})||ee(String.prototype,”endsWith”,Ie.endsWith);a(function(){var e=/a/;return e[W.match]=!1,”/a/”.includes(e)})||ee(String.prototype,”includes”,Ie.includes)}g(String.prototype,Ie);var Le=[“\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003″,”\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028″,”\u2029\ufeff”].join(“”),Re=new RegExp(“(^[“+Le+”]+)|([“+Le+”]+$)”,”g”),qe=function(){return se.ToString(se.RequireObjectCoercible(this)).replace(Re,””)},Fe=[“\x85″,”\u200b”,”\ufffe”].join(“”),He=new RegExp(“[“+Fe+”]”,”g”),Ve=/^[-+]0x[0-9a-f]+$/i,$e=Fe.trim().length!==Fe.length;h(String.prototype,”trim”,qe,$e);var Be=function(e){return{value:e,done:0===arguments.length}},We=function(e){se.RequireObjectCoercible(e),this._s=se.ToString(e),this._i=0};We.prototype.next=function(){var e=this._s,t=this._i;if(void 0===e||t>=e.length)return this._s=void 0,Be();var n,r,i=e.charCodeAt(t);return i56319||t+1===e.length?r=1:(n=e.charCodeAt(t+1),r=n57343?1:2),this._i=t+r,Be(e.substr(t,r))},je(We.prototype),je(String.prototype,function(){return new We(this)});var ze={from:function(e){var t,r=this;arguments.length>1&&(t=arguments[1]);var i,o;if(void 0===t)i=!1;else{if(!se.IsCallable(t))throw new TypeError(“Array.from: when provided, the second argument must be a function”);arguments.length>2&&(o=arguments[2]),i=!0}var a,s,c,u=void 0!==(Q(e)||se.GetMethod(e,ne));if(u){s=se.IsConstructor(r)?Object(new r):[];var l,f,p=se.GetIterator(e);for(c=0;;){if(!1===(l=se.IteratorStep(p)))break;f=l.value;try{i&&(f=void 0===o?t(f,c):n(t,o,f,c)),s[c]=f}catch(e){throw se.IteratorClose(p,!0),e}c+=1}a=c}else{var d=se.ToObject(e);a=se.ToLength(d.length),s=se.IsConstructor(r)?Object(new r(a)):new Array(a);var h;for(c=0;c<a;++c)h=d[c],i&&(h=void 0===o?t(h,c):n(t,o,h,c)),Ce(s,c,h)}return s.length=a,s},of:function(){for(var e=arguments.length,t=this,n=r(t)||!se.IsCallable(t)?new Array(e):se.Construct(t,[e]),i=0;i<e;++i)Ce(n,i,arguments[i]);return n.length=e,n}};g(Array,ze),Oe(Array),e=function(e,t){this.i=0,this.array=e,this.kind=t},g(e.prototype,{next:function(){var t=this.i,n=this.array;if(!(this instanceof e))throw new TypeError("Not an ArrayIterator");if(void 0!==n)for(var r=se.ToLength(n.length);t<r;t++){var i,o=this.kind;return"key"===o?i=t:"value"===o?i=n[t]:"entry"===o&&(i=[t,n[t]]),this.i=t+1,Be(i)}return this.array=void 0,Be()}}),je(e.prototype),Array.of===ze.of||function(){var e=function(e){this.length=e};e.prototype=[];var t=Array.of.apply(e,[1,2]);return t instanceof e&&2===t.length}()||ee(Array,"of",ze.of);var Ue={copyWithin:function(e,t){var n,r=se.ToObject(this),i=se.ToLength(r.length),o=se.ToInteger(e),a=se.ToInteger(t),s=o<0?N(i+o,0):_(o,i),c=a2&&(n=arguments[2]);var u=void 0===n?i:se.ToInteger(n),l=u<0?N(i+u,0):_(u,i),f=_(l-c,i-s),p=1;for(c<s&&s0;)c in r?r[s]=r[c]:delete r[s],c+=p,s+=p,f-=1;return r},fill:function(e){var t;arguments.length>1&&(t=arguments[1]);var n;arguments.length>2&&(n=arguments[2]);var r=se.ToObject(this),i=se.ToLength(r.length);t=se.ToInteger(void 0===t?0:t),n=se.ToInteger(void 0===n?i:n);for(var o=t<0?N(i+t,0):_(t,i),a=n<0?i+n:n,s=o;s<i&&s1?arguments[1]:null,a=0;a1?arguments[1]:null,o=0;o<r;o++)if(i){if(n(e,i,t[o],o,t))return o}else if(e(t[o],o,t))return o;return-1},keys:function(){return new e(this,"key")},values:function(){return new e(this,"value")},entries:function(){return new e(this,"entry")}};if(Array.prototype.keys&&!se.IsCallable([1].keys().next)&&delete Array.prototype.keys,Array.prototype.entries&&!se.IsCallable([1].entries().next)&&delete Array.prototype.entries,Array.prototype.keys&&Array.prototype.entries&&!Array.prototype.values&&Array.prototype[ne]&&(g(Array.prototype,{values:Array.prototype[ne]}),K.symbol(W.unscopables)&&(Array.prototype[W.unscopables].values=!0)),u&&Array.prototype.values&&"values"!==Array.prototype.values.name){var Ge=Array.prototype.values;ee(Array.prototype,"values",function(){return se.Call(Ge,this,arguments)}),h(Array.prototype,ne,Array.prototype.values,!0)}g(Array.prototype,Ue),1/[!0].indexOf(!0,-0)<0&&h(Array.prototype,"indexOf",function(e){var t=k(this,arguments);return 0===t&&1/t1&&void 0!==arguments[1]?se.Call(Ye,this,arguments):n(Ye,this,e)})}var Ze=-(Math.pow(2,32)-1),Qe=function(e,t){var r={length:Ze};return r[t?(r.length>>>0)-1:0]=!0,a(function(){return n(e,r,function(){throw new RangeError(“should not reach here”)},[]),!0})};if(!Qe(Array.prototype.forEach)){var Ke=Array.prototype.forEach;ee(Array.prototype,”forEach”,function(e){return se.Call(Ke,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.map)){var et=Array.prototype.map;ee(Array.prototype,”map”,function(e){return se.Call(et,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.filter)){var tt=Array.prototype.filter;ee(Array.prototype,”filter”,function(e){return se.Call(tt,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.some)){var nt=Array.prototype.some;ee(Array.prototype,”some”,function(e){return se.Call(nt,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.every)){var rt=Array.prototype.every;ee(Array.prototype,”every”,function(e){return se.Call(rt,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.reduce)){var it=Array.prototype.reduce;ee(Array.prototype,”reduce”,function(e){return se.Call(it,this.length>=0?this:[],arguments)})}if(!Qe(Array.prototype.reduceRight,!0)){var ot=Array.prototype.reduceRight;ee(Array.prototype,”reduceRight”,function(e){return se.Call(ot,this.length>=0?this:[],arguments)})}var at=8!==Number(“0o10”),st=2!==Number(“0b10”),ct=d(Fe,function(e){return 0===Number(e+0+e)});if(at||st||ct){var ut=Number,lt=/^0b[01]+$/i,ft=/^0o[0-7]+$/i,pt=lt.test.bind(lt),dt=ft.test.bind(ft),ht=function(e){var t;if(“function”==typeof e.valueOf&&(t=e.valueOf(),K.primitive(t)))return t;if(“function”==typeof e.toString&&(t=e.toString(),K.primitive(t)))return t;throw new TypeError(“No default value”)},gt=He.test.bind(He),yt=Ve.test.bind(Ve),mt=function(){var e=function(t){var n;”string”==typeof(n=arguments.length>0?K.primitive(t)?t:ht(t):0)&&(n=se.Call(qe,n),pt(n)?n=parseInt(j(n,2),2):dt(n)?n=parseInt(j(n,2),8):(gt(n)||yt(n))&&(n=NaN));var r=this,i=a(function(){return ut.prototype.valueOf.call(r),!0});return r instanceof e&&!i?new ut(n):ut(n)};return e}();Se(ut,mt,{}),g(mt,{NaN:ut.NaN,MAX_VALUE:ut.MAX_VALUE,MIN_VALUE:ut.MIN_VALUE,NEGATIVE_INFINITY:ut.NEGATIVE_INFINITY,POSITIVE_INFINITY:ut.POSITIVE_INFINITY}),Number=mt,v.redefine(x,”Number”,mt)}var vt=Math.pow(2,53)-1;g(Number,{MAX_SAFE_INTEGER:vt,MIN_SAFE_INTEGER:-vt,EPSILON:2.220446049250313e-16,parseInt:x.parseInt,parseFloat:x.parseFloat,isFinite:G,isInteger:function(e){return G(e)&&se.ToInteger(e)===e},isSafeInteger:function(e){return Number.isInteger(e)&&I(e)<=Number.MAX_SAFE_INTEGER},isNaN:U}),h(Number,"parseInt",x.parseInt,Number.parseInt!==x.parseInt),1===[,1].find(function(){return!0})&&ee(Array.prototype,"find",Ue.find),0!==[,1].findIndex(function(){return!0})&&ee(Array.prototype,"findIndex",Ue.findIndex);var bt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable),wt=function(e,t){c&&bt(e,t)&&Object.defineProperty(e,t,{enumerable:!1})},xt=function(){for(var e=Number(this),t=arguments.length,n=t-e,r=new Array(n<0?0:n),i=e;i<t;++i)r[i-e]=arguments[i];return r},Tt=function(e){return function(t,n){return t[n]=e[n],t}},St=function(e,t){var n,r=i(Object(t));return se.IsCallable(Object.getOwnPropertySymbols)&&(n=p(Object.getOwnPropertySymbols(Object(t)),bt(t))),f(O(r,n||[]),Tt(t),e)},kt={assign:function(e,t){var n=se.ToObject(e,"Cannot convert undefined or null to object");return f(se.Call(xt,1,arguments),St,n)},is:function(e,t){return se.SameValue(e,t)}};if(Object.assign&&Object.preventExtensions&&function(){var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}}()&&ee(Object,"assign",kt.assign),g(Object,kt),c){var Ot={setPrototypeOf:function(e,t){var r,i=function(e,t){if(!se.TypeIsObject(e))throw new TypeError("cannot set prototype on a non-object");if(null!==t&&!se.TypeIsObject(t))throw new TypeError("can only set prototype to an object or null"+t)},o=function(e,t){return i(e,t),n(r,e,t),e};try{r=e.getOwnPropertyDescriptor(e.prototype,"__proto__").set,n(r,{},null)}catch(t){if(e.prototype!=={}.__proto__)return;r=function(e){this.__proto__=e},o.polyfill=o(o({},null),e.prototype)instanceof e}return o}(Object)};g(Object,Ot)}if(Object.setPrototypeOf&&Object.getPrototypeOf&&null!==Object.getPrototypeOf(Object.setPrototypeOf({},null))&&null===Object.getPrototypeOf(Object.create(null))&&function(){var e=Object.create(null),t=Object.getPrototypeOf,n=Object.setPrototypeOf;Object.getPrototypeOf=function(n){var r=t(n);return r===e?null:r},Object.setPrototypeOf=function(t,r){return n(t,null===r?e:r)},Object.setPrototypeOf.polyfill=!1}(),!!o(function(){return Object.keys("foo")})){var jt=Object.keys;ee(Object,"keys",function(e){return jt(se.ToObject(e))}),i=Object.keys}if(o(function(){return Object.keys(/a/g)})){var At=Object.keys;ee(Object,"keys",function(e){if(K.regex(e)){var t=[];for(var n in e)R(e,n)&&A(t,n);return t}return At(e)}),i=Object.keys}if(Object.getOwnPropertyNames){if(!!o(function(){return Object.getOwnPropertyNames("foo")})){var Ct="object"===("undefined"==typeof window?"undefined":_typeof(window))?Object.getOwnPropertyNames(window):[],Et=Object.getOwnPropertyNames;ee(Object,"getOwnPropertyNames",function(e){var t=se.ToObject(e);if("[object Window]"===y(t))try{return Et(t)}catch(e){return O([],Ct)}return Et(t)})}}if(Object.getOwnPropertyDescriptor){if(!!o(function(){return Object.getOwnPropertyDescriptor("foo","bar")})){var Nt=Object.getOwnPropertyDescriptor;ee(Object,"getOwnPropertyDescriptor",function(e,t){return Nt(se.ToObject(e),t)})}}if(Object.seal){if(!!o(function(){return Object.seal("foo")})){var _t=Object.seal;ee(Object,"seal",function(e){return se.TypeIsObject(e)?_t(e):e})}}if(Object.isSealed){if(!!o(function(){return Object.isSealed("foo")})){var Pt=Object.isSealed;ee(Object,"isSealed",function(e){return!se.TypeIsObject(e)||Pt(e)})}}if(Object.freeze){if(!!o(function(){return Object.freeze("foo")})){var It=Object.freeze;ee(Object,"freeze",function(e){return se.TypeIsObject(e)?It(e):e})}}if(Object.isFrozen){if(!!o(function(){return Object.isFrozen("foo")})){var Mt=Object.isFrozen;ee(Object,"isFrozen",function(e){return!se.TypeIsObject(e)||Mt(e)})}}if(Object.preventExtensions){if(!!o(function(){return Object.preventExtensions("foo")})){var Dt=Object.preventExtensions;ee(Object,"preventExtensions",function(e){return se.TypeIsObject(e)?Dt(e):e})}}if(Object.isExtensible){if(!!o(function(){return Object.isExtensible("foo")})){var Lt=Object.isExtensible;ee(Object,"isExtensible",function(e){return!!se.TypeIsObject(e)&&Lt(e)})}}if(Object.getPrototypeOf){if(!!o(function(){return Object.getPrototypeOf("foo")})){var Rt=Object.getPrototypeOf;ee(Object,"getPrototypeOf",function(e){return Rt(se.ToObject(e))})}}var qt=c&&function(){var e=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags");return e&&se.IsCallable(e.get)}();if(c&&!qt){var Ft=function(){if(!se.TypeIsObject(this))throw new TypeError("Method called on incompatible type: must be an object.");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e};v.getter(RegExp.prototype,"flags",Ft)}var Ht=c&&a(function(){return"/a/i"===String(new RegExp(/a/g,"i"))}),Vt=te&&c&&function(){var e=/./;return e[W.match]=!1,RegExp(e)===e}(),$t=a(function(){return"/abc/"===RegExp.prototype.toString.call({source:"abc"})}),Bt=$t&&a(function(){return"/a/b"===RegExp.prototype.toString.call({source:"a",flags:"b"})});if(!$t||!Bt){var Wt=RegExp.prototype.toString;h(RegExp.prototype,"toString",function(){var e=se.RequireObjectCoercible(this);return K.regex(e)?n(Wt,e):"/"+ie(e.source)+"/"+ie(e.flags)},!0),v.preserveToString(RegExp.prototype.toString,Wt)}if(c&&(!Ht||Vt)){var zt=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags").get,Ut=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")||{},Gt=function(){return this.source},Jt=se.IsCallable(Ut.get)?Ut.get:Gt,Xt=RegExp,Yt=function(){return function e(t,n){var r=se.IsRegExp(t);if(!(this instanceof e)&&r&&void 0===n&&t.constructor===e)return t;var i=t,o=n;return K.regex(t)?(i=se.Call(Jt,t),o=void 0===n?se.Call(zt,t):n,new e(i,o)):(r&&(i=t.source,o=void 0===n?t.flags:n),new Xt(t,n))}}();Se(Xt,Yt,{$input:!0}),RegExp=Yt,v.redefine(x,"RegExp",Yt)}if(c){var Zt={input:"$_",lastMatch:"$&",lastParen:"$+",leftContext:"$`",rightContext:"$'"};l(i(Zt),function(e){e in RegExp&&!(Zt[e]in RegExp)&&v.getter(RegExp,Zt[e],function(){return RegExp[e]})})}Oe(RegExp);var Qt=1/Number.EPSILON,Kt=function(e){return e+Qt-Qt},en=Math.pow(2,-23),tn=Math.pow(2,127)*(2-en),nn=Math.pow(2,-126),rn=Math.E,on=Math.LOG2E,an=Math.LOG10E,sn=Number.prototype.clz;delete Number.prototype.clz;var cn={acosh:function(e){var t=Number(e);if(U(t)||e<1)return NaN;if(1===t)return 0;if(t===1/0)return t;var n=1/(t*t);if(t<2)return X(t-1+L(1-n)*t);var r=t/2;return X(r+L(1-n)*r-1)+1/on},asinh:function(e){var t=Number(e);if(0===t||!T(t))return t;var n=I(t),r=n*n,i=J(t);return n<1?i*X(n+r/(L(r+1)+1)):i*(X(n/2+L(1+1/r)*n/2-1)+1/on)},atanh:function(e){var t=Number(e);if(0===t)return t;if(-1===t)return-1/0;if(1===t)return 1/0;if(U(t)||t1)return NaN;var n=I(t);return J(t)*X(2*n/(1-n))/2},cbrt:function(e){var t=Number(e);if(0===t)return t;var n,r=t.5)return M(t)-1;for(var n=t,r=0,i=1;r+n!==r;)r+=n,i+=1,n*=t/i;return r},hypot:function(e,t){for(var n=0,r=0,i=0;i<arguments.length;++i){var o=I(Number(arguments[i]));r0?o/r*(o/r):o}return r===1/0?1/0:r*L(n)},log2:function(e){return D(e)*on},log10:function(e){return D(e)*an},log1p:X,sign:J,sinh:function(e){var t=Number(e);if(!T(t)||0===t)return t;var n=I(t);if(n=20?1:t<=-20?-1:(Math.expm1(t)-Math.expm1(-t))/(M(t)+M(-t))},trunc:function(e){var t=Number(e);return t>>16&65535,o=65535&n,a=r>>>16&65535,s=65535&r;return o*s+(i*s+o*a<>>0)|0},fround:function(e){var t=Number(e);if(0===t||t===1/0||t===-1/0||U(t))return t;var n=J(t),r=I(t);if(rtn||U(o)?n*(1/0):n*o}},un=function(e,t,n){return I(1-e/t)/Number.EPSILON22025.465794806718||ln<22025.465794806718);var fn=Math.round,pn=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(Number.EPSILON/3.99-.5),dn=Qt+1,hn=2*Qt-1,gn=[dn,hn].every(function(e){return Math.round(e)===e});h(Math,"round",function(e){var t=P(e),n=-1===t?-0:t+1;return e-t0&&(l(n.fulfillReactionHandler0,n.reactionCapability0,t),n.fulfillReactionHandler0=void 0,n.rejectReactions0=void 0,n.reactionCapability0=void 0,r>1))for(var i=1,o=0;i0&&(l(n.rejectReactionHandler0,n.reactionCapability0,t),n.fulfillReactionHandler0=void 0,n.rejectReactions0=void 0,n.reactionCapability0=void 0,r>1))for(var i=1,o=0;i2&&arguments[2]===u&&o===v?u:new r(o);var a,f=se.IsCallable(e)?e:s,p=se.IsCallable(t)?t:c,d=n._promise;if(0===d.state){if(0===d.reactionLength)d.fulfillReactionHandler0=f,d.rejectReactionHandler0=p,d.reactionCapability0=i;else{var h=3*(d.reactionLength-1);d[h+0]=f,d[h+1]=p,d[h+2]=i}d.reactionLength+=1}else if(1===d.state)a=d.result,l(f,i,a);else{if(2!==d.state)throw new TypeError(“unexpected Promise state”);a=d.result,l(p,i,a)}return i.promise}}),u=new r(v),o=i.then,v}}();if(x.Promise&&(delete x.Promise.accept,delete x.Promise.defer,delete x.Promise.prototype.chain),”function”==typeof mn){g(x,{Promise:mn});var vn=w(x.Promise,function(e){return e.resolve(42).then(function(){})instanceof e}),bn=!o(function(){return x.Promise.reject(42).then(null,5).then(null,q)}),wn=o(function(){return x.Promise.call(3,q)}),xn=function(e){var t=e.resolve(5);t.constructor={};var n=e.resolve(t);try{n.then(null,q).then(null,q)}catch(e){return!0}return t===n}(x.Promise),Tn=c&&function(){var e=0,t=Object.defineProperty({},”then”,{get:function(){e+=1}});return Promise.resolve(t),1===e}(),Sn=function e(t){var n=new Promise(t);t(3,function(){}),this.then=n.then,this.constructor=e};Sn.prototype=Promise.prototype,Sn.all=Promise.all;var kn=a(function(){return!!Sn.all([1,2])});if(vn&&bn&&wn&&!xn&&Tn&&!kn||(Promise=mn,ee(x,”Promise”,mn)),1!==Promise.all.length){var On=Promise.all;ee(Promise,”all”,function(e){return se.Call(On,this,arguments)})}if(1!==Promise.race.length){var jn=Promise.race;ee(Promise,”race”,function(e){return se.Call(jn,this,arguments)})}if(1!==Promise.resolve.length){var An=Promise.resolve;ee(Promise,”resolve”,function(e){return se.Call(An,this,arguments)})}if(1!==Promise.reject.length){var Cn=Promise.reject;ee(Promise,”reject”,function(e){return se.Call(Cn,this,arguments)})}wt(Promise,”all”),wt(Promise,”race”),wt(Promise,”resolve”),wt(Promise,”reject”),Oe(Promise)}var En=function(e){var t=i(f(e,function(e,t){return e[t]=!0,e},{}));return e.join(“:”)===t.join(“:”)},Nn=En([“z”,”a”,”bb”]),_n=En([“z”,1,”a”,”3″,2]);if(c){var Pn=function(e,t){return t||Nn?ae(e)?”^”+se.ToString(e):”string”==typeof e?”$”+e:”number”==typeof e?_n?e:”n”+e:”boolean”==typeof e?”b”+e:null:null},In=function(){return Object.create?Object.create(null):{}},Mn=function(e,t,i){if(r(i)||K.string(i))l(i,function(e){if(!se.TypeIsObject(e))throw new TypeError(“Iterator value “+e+” is not an entry object”);t.set(e[0],e[1])});else if(i instanceof e)n(e.prototype.forEach,i,function(e,n){t.set(n,e)});else{var o,a;if(!ae(i)){if(a=t.set,!se.IsCallable(a))throw new TypeError(“bad map”);o=se.GetIterator(i)}if(void 0!==o)for(;;){var s=se.IteratorStep(o);if(!1===s)break;var c=s.value;try{if(!se.TypeIsObject(c))throw new TypeError(“Iterator value “+c+” is not an entry object”);n(a,t,c[0],c[1])}catch(e){throw se.IteratorClose(o,!0),e}}}},Dn=function(e,t,i){if(r(i)||K.string(i))l(i,function(e){t.add(e)});else if(i instanceof e)n(e.prototype.forEach,i,function(e){t.add(e)});else{var o,a;if(!ae(i)){if(a=t.add,!se.IsCallable(a))throw new TypeError(“bad set”);o=se.GetIterator(i)}if(void 0!==o)for(;;){var s=se.IteratorStep(o);if(!1===s)break;var c=s.value;try{n(a,t,c)}catch(e){throw se.IteratorClose(o,!0),e}}}},Ln={Map:function(){var e={},t=function(e,t){this.key=e,this.value=t,this.next=null,this.prev=null};t.prototype.isRemoved=function(){return this.key===e};var r=function(e){return!!e._es6map},i=function(e,t){if(!se.TypeIsObject(e)||!r(e))throw new TypeError(“Method Map.prototype.”+t+” called on incompatible receiver “+se.ToString(e))},o=function(e,t){i(e,”[[MapIterator]]”),this.head=e._head,this.i=this.head,this.kind=t};o.prototype={isMapIterator:!0,next:function(){if(!this.isMapIterator)throw new TypeError(“Not a MapIterator”);var e=this.i,t=this.kind,n=this.head;if(void 0===this.i)return Be();for(;e.isRemoved()&&e!==n;)e=e.prev;for(var r;e.next!==n;)if(e=e.next,!e.isRemoved())return r=”key”===t?e.key:”value”===t?e.value:[e.key,e.value],this.i=e,Be(r);return this.i=void 0,Be()}},je(o.prototype);var a,s=function e(){if(!(this instanceof e))throw new TypeError(‘Constructor Map requires “new”‘);if(this&&this._es6map)throw new TypeError(“Bad construction”);var n=Ee(this,e,a,{_es6map:!0,_head:null,_map:F?new F:null,_size:0,_storage:In()}),r=new t(null,null);return r.next=r.prev=r,n._head=r,arguments.length>0&&Mn(e,n,arguments[0]),n};return a=s.prototype,v.getter(a,”size”,function(){if(void 0===this._size)throw new TypeError(“size method called on incompatible Map”);return this._size}),g(a,{get:function(e){i(this,”get”);var t,n=Pn(e,!0);if(null!==n)return t=this._storage[n],t?t.value:void 0;if(this._map)return t=V.call(this._map,e),t?t.value:void 0;for(var r=this._head,o=r;(o=o.next)!==r;)if(se.SameValueZero(o.key,e))return o.value},has:function(e){i(this,”has”);var t=Pn(e,!0);if(null!==t)return void 0!==this._storage[t];if(this._map)return $.call(this._map,e);for(var n=this._head,r=n;(r=r.next)!==n;)if(se.SameValueZero(r.key,e))return!0;return!1},set:function(e,n){i(this,”set”);var r,o=this._head,a=o,s=Pn(e,!0);if(null!==s){if(void 0!==this._storage[s])return this._storage[s].value=n,this;r=this._storage[s]=new t(e,n),a=o.prev}else this._map&&($.call(this._map,e)?V.call(this._map,e).value=n:(r=new t(e,n),B.call(this._map,e,r),a=o.prev));for(;(a=a.next)!==o;)if(se.SameValueZero(a.key,e))return a.value=n,this;return r=r||new t(e,n),se.SameValue(-0,e)&&(r.key=0),r.next=this._head,r.prev=this._head.prev,r.prev.next=r,r.next.prev=r,this._size+=1,this},delete:function(t){i(this,”delete”);var n=this._head,r=n,o=Pn(t,!0);if(null!==o){if(void 0===this._storage[o])return!1;r=this._storage[o].prev,delete this._storage[o]}else if(this._map){if(!$.call(this._map,t))return!1;r=V.call(this._map,t).prev,H.call(this._map,t)}for(;(r=r.next)!==n;)if(se.SameValueZero(r.key,t))return r.key=e,r.value=e,r.prev.next=r.next,r.next.prev=r.prev,this._size-=1,!0;return!1},clear:function(){i(this,”clear”),this._map=F?new F:null,this._size=0,this._storage=In();for(var t=this._head,n=t,r=n.next;(n=r)!==t;)n.key=e,n.value=e,r=n.next,n.next=n.prev=t;t.next=t.prev=t},keys:function(){return i(this,”keys”),new o(this,”key”)},values:function(){return i(this,”values”),new o(this,”value”)},entries:function(){return i(this,”entries”),new o(this,”key+value”)},forEach:function(e){i(this,”forEach”);for(var t=arguments.length>1?arguments[1]:null,r=this.entries(),o=r.next();!o.done;o=r.next())t?n(e,t,o.value[1],o.value[0],this):e(o.value[1],o.value[0],this)}}),je(a,a.entries),s}(),Set:function(){var e,t=function(e){return e._es6set&&void 0!==e._storage},r=function(e,n){if(!se.TypeIsObject(e)||!t(e))throw new TypeError(“Set.prototype.”+n+” called on incompatible receiver “+se.ToString(e))},o=function t(){if(!(this instanceof t))throw new TypeError(‘Constructor Set requires “new”‘);if(this&&this._es6set)throw new TypeError(“Bad construction”);var n=Ee(this,t,e,{_es6set:!0,”[[SetData]]”:null,_storage:In()});if(!n._es6set)throw new TypeError(“bad set”);return arguments.length>0&&Dn(t,n,arguments[0]),n};e=o.prototype;var a=function(e){var t=e;if(“^null”===t)return null;if(“^undefined”!==t){var n=t.charAt(0);return”$”===n?j(t,1):”n”===n?+j(t,1):”b”===n?”btrue”===t:+t}},s=function(e){if(!e[“[[SetData]]”]){var t=new Ln.Map;e[“[[SetData]]”]=t,l(i(e._storage),function(e){var n=a(e);t.set(n,n)}),e[“[[SetData]]”]=t}e._storage=null};v.getter(o.prototype,”size”,function(){return r(this,”size”),this._storage?i(this._storage).length:(s(this),this[“[[SetData]]”].size)}),g(o.prototype,{has:function(e){r(this,”has”);var t;return this._storage&&null!==(t=Pn(e))?!!this._storage[t]:(s(this),this[“[[SetData]]”].has(e))},add:function(e){r(this,”add”);var t;return this._storage&&null!==(t=Pn(e))?(this._storage[t]=!0,this):(s(this),this[“[[SetData]]”].set(e,e),this)},delete:function(e){r(this,”delete”);var t;if(this._storage&&null!==(t=Pn(e))){var n=R(this._storage,t);return delete this._storage[t]&&n}return s(this),this[“[[SetData]]”].delete(e)},clear:function(){r(this,”clear”),this._storage&&(this._storage=In()),this[“[[SetData]]”]&&this[“[[SetData]]”].clear()},values:function(){return r(this,”values”),s(this),new c(this[“[[SetData]]”].values())},entries:function(){return r(this,”entries”),s(this),new c(this[“[[SetData]]”].entries())},forEach:function(e){r(this,”forEach”);var t=arguments.length>1?arguments[1]:null,i=this;s(i),this[“[[SetData]]”].forEach(function(r,o){t?n(e,t,o,o,i):e(o,o,i)})}}),h(o.prototype,”keys”,o.prototype.values,!0),je(o.prototype,o.prototype.values);var c=function(e){this.it=e};return c.prototype={isSetIterator:!0,next:function(){if(!this.isSetIterator)throw new TypeError(“Not a SetIterator”);return this.it.next()}},je(c.prototype),o}()};if(x.Set&&!Set.prototype.delete&&Set.prototype.remove&&Set.prototype.items&&Set.prototype.map&&Array.isArray((new Set).keys)&&(x.Set=Ln.Set),x.Map||x.Set){a(function(){return 2===new Map([[1,2]]).get(1)})||(x.Map=function e(){if(!(this instanceof e))throw new TypeError(‘Constructor Map requires “new”‘);var t=new F;return arguments.length>0&&Mn(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,x.Map.prototype),t},x.Map.prototype=b(F.prototype),h(x.Map.prototype,”constructor”,x.Map,!0),v.preserveToString(x.Map,F));var Rn=new Map,qn=function(){var e=new Map([[1,0],[2,0],[3,0],[4,0]]);return e.set(-0,e),e.get(0)===e&&e.get(-0)===e&&e.has(0)&&e.has(-0)}(),Fn=Rn.set(1,2)===Rn;qn&&Fn||ee(Map.prototype,”set”,function(e,t){return n(B,this,0===e?0:e,t),this}),qn||(g(Map.prototype,{get:function(e){return n(V,this,0===e?0:e)},has:function(e){return n($,this,0===e?0:e)}},!0),v.preserveToString(Map.prototype.get,V),v.preserveToString(Map.prototype.has,$));var Hn=new Set,Vn=Set.prototype.delete&&Set.prototype.add&&Set.prototype.has&&function(e){return e.delete(0),e.add(-0),!e.has(0)}(Hn),$n=Hn.add(1)===Hn;if(!Vn||!$n){var Bn=Set.prototype.add;Set.prototype.add=function(e){return n(Bn,this,0===e?0:e),this},v.preserveToString(Set.prototype.add,Bn)}if(!Vn){var Wn=Set.prototype.has;Set.prototype.has=function(e){return n(Wn,this,0===e?0:e)},v.preserveToString(Set.prototype.has,Wn);var zn=Set.prototype.delete;Set.prototype.delete=function(e){return n(zn,this,0===e?0:e)},v.preserveToString(Set.prototype.delete,zn)}var Un=w(x.Map,function(e){var t=new e([]);return t.set(42,42),t instanceof e}),Gn=Object.setPrototypeOf&&!Un,Jn=function(){try{return!(x.Map()instanceof x.Map)}catch(e){return e instanceof TypeError}}();0===x.Map.length&&!Gn&&Jn||(x.Map=function e(){if(!(this instanceof e))throw new TypeError(‘Constructor Map requires “new”‘);var t=new F;return arguments.length>0&&Mn(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,e.prototype),t},x.Map.prototype=F.prototype,h(x.Map.prototype,”constructor”,x.Map,!0),v.preserveToString(x.Map,F));var Xn=w(x.Set,function(e){var t=new e([]);return t.add(42,42),t instanceof e}),Yn=Object.setPrototypeOf&&!Xn,Zn=function(){try{return!(x.Set()instanceof x.Set)}catch(e){return e instanceof TypeError}}();if(0!==x.Set.length||Yn||!Zn){var Qn=x.Set;x.Set=function e(){if(!(this instanceof e))throw new TypeError(‘Constructor Set requires “new”‘);var t=new Qn;return arguments.length>0&&Dn(e,t,arguments[0]),delete t.constructor,Object.setPrototypeOf(t,e.prototype),t},x.Set.prototype=Qn.prototype,h(x.Set.prototype,”constructor”,x.Set,!0),v.preserveToString(x.Set,Qn)}var Kn=new x.Map,er=!a(function(){return Kn.keys().next().done});if((“function”!=typeof x.Map.prototype.clear||0!==(new x.Set).size||0!==Kn.size||”function”!=typeof x.Map.prototype.keys||”function”!=typeof x.Set.prototype.keys||”function”!=typeof x.Map.prototype.forEach||”function”!=typeof x.Set.prototype.forEach||s(x.Map)||s(x.Set)||”function”!=typeof Kn.keys().next||er||!Un)&&g(x,{Map:Ln.Map,Set:Ln.Set},!0),x.Set.prototype.keys!==x.Set.prototype.values&&h(x.Set.prototype,”keys”,x.Set.prototype.values,!0),je(Object.getPrototypeOf((new x.Map).keys())),je(Object.getPrototypeOf((new x.Set).keys())),u&&”has”!==x.Set.prototype.has.name){var tr=x.Set.prototype.has;ee(x.Set.prototype,”has”,function(e){return n(tr,this,e)})}}g(x,Ln),Oe(x.Map),Oe(x.Set)}var nr=function(e){if(!se.TypeIsObject(e))throw new TypeError(“target must be an object”)},rr={apply:function(){return se.Call(se.Call,null,arguments)},construct:function(e,t){if(!se.IsConstructor(e))throw new TypeError(“First argument must be a constructor.”);var n=arguments.length>2?arguments[2]:e;if(!se.IsConstructor(n))throw new TypeError(“new.target must be a constructor.”);return se.Construct(e,t,n,”internal”)},deleteProperty:function(e,t){if(nr(e),c){var n=Object.getOwnPropertyDescriptor(e,t);if(n&&!n.configurable)return!1}return delete e[t]},has:function(e,t){return nr(e),t in e}};Object.getOwnPropertyNames&&Object.assign(rr,{ownKeys:function(e){nr(e);var t=Object.getOwnPropertyNames(e);return se.IsCallable(Object.getOwnPropertySymbols)&&C(t,Object.getOwnPropertySymbols(e)),t}});var ir=function(e){return!o(e)};if(Object.preventExtensions&&Object.assign(rr,{isExtensible:function(e){return nr(e),Object.isExtensible(e)},preventExtensions:function(e){return nr(e),ir(function(){return Object.preventExtensions(e)})}}),c){var or=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r){var i=Object.getPrototypeOf(e);if(null===i)return;return or(i,t,n)}return”value”in r?r.value:r.get?se.Call(r.get,n):void 0},ar=function(e,t,r,i){var o=Object.getOwnPropertyDescriptor(e,t);if(!o){var a=Object.getPrototypeOf(e);if(null!==a)return ar(a,t,r,i);o={value:void 0,writable:!0,enumerable:!0,configurable:!0}}if(“value”in o){if(!o.writable)return!1;if(!se.TypeIsObject(i))return!1;return Object.getOwnPropertyDescriptor(i,t)?re.defineProperty(i,t,{value:r}):re.defineProperty(i,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}return!!o.set&&(n(o.set,i,r),!0)};Object.assign(rr,{defineProperty:function(e,t,n){return nr(e),ir(function(){return Object.defineProperty(e,t,n)})},getOwnPropertyDescriptor:function(e,t){return nr(e),Object.getOwnPropertyDescriptor(e,t)},get:function(e,t){nr(e);var n=arguments.length>2?arguments[2]:e;return or(e,t,n)},set:function(e,t,n){nr(e);var r=arguments.length>3?arguments[3]:e;return ar(e,t,n,r)}})}if(Object.getPrototypeOf){var sr=Object.getPrototypeOf;rr.getPrototypeOf=function(e){return nr(e),sr(e)}}if(Object.setPrototypeOf&&rr.getPrototypeOf){var cr=function(e,t){for(var n=t;n;){if(e===n)return!0;n=rr.getPrototypeOf(n)}return!1};Object.assign(rr,{setPrototypeOf:function(e,t){if(nr(e),null!==t&&!se.TypeIsObject(t))throw new TypeError(“proto must be an object or null”);return t===re.getPrototypeOf(e)||!(re.isExtensible&&!re.isExtensible(e))&&(!cr(e,t)&&(Object.setPrototypeOf(e,t),!0))}})}var ur=function(e,t){if(se.IsCallable(x.Reflect[e])){a(function(){return x.Reflect[e](1),x.Reflect[e](NaN),x.Reflect[e](!0),!0})&&ee(x.Reflect,e,t)}else h(x.Reflect,e,t)};Object.keys(rr).forEach(function(e){ur(e,rr[e])});var lr=x.Reflect.getPrototypeOf;if(u&&lr&&”getPrototypeOf”!==lr.name&&ee(x.Reflect,”getPrototypeOf”,function(e){return n(lr,x.Reflect,e)}),x.Reflect.setPrototypeOf&&a(function(){return x.Reflect.setPrototypeOf(1,{}),!0})&&ee(x.Reflect,”setPrototypeOf”,rr.setPrototypeOf),x.Reflect.defineProperty&&(a(function(){var e=!x.Reflect.defineProperty(1,”test”,{value:1}),t=”function”!=typeof Object.preventExtensions||!x.Reflect.defineProperty(Object.preventExtensions({}),”test”,{});return e&&t})||ee(x.Reflect,”defineProperty”,rr.defineProperty)),x.Reflect.construct&&(a(function(){var e=function(){};return x.Reflect.construct(function(){},[],e)instanceof e})||ee(x.Reflect,”construct”,rr.construct)),”Invalid Date”!==String(new Date(NaN))){var fr=Date.prototype.toString,pr=function(){var e=+this;return e!==e?”Invalid Date”:se.Call(fr,this)};ee(Date.prototype,”toString”,pr)}var dr={anchor:function(e){return se.CreateHTML(this,”a”,”name”,e)},big:function(){return se.CreateHTML(this,”big”,””,””)},blink:function(){return se.CreateHTML(this,”blink”,””,””)},bold:function(){return se.CreateHTML(this,”b”,””,””)},fixed:function(){return se.CreateHTML(this,”tt”,””,””)},fontcolor:function(e){return se.CreateHTML(this,”font”,”color”,e)},fontsize:function(e){return se.CreateHTML(this,”font”,”size”,e)},italics:function(){return se.CreateHTML(this,”i”,””,””)},link:function(e){return se.CreateHTML(this,”a”,”href”,e)},small:function(){return se.CreateHTML(this,”small”,””,””)},strike:function(){return se.CreateHTML(this,”strike”,””,””)},sub:function(){return se.CreateHTML(this,”sub”,””,””)},sup:function(){return se.CreateHTML(this,”sup”,””,””)}};l(Object.keys(dr),function(e){var t=String.prototype[e],r=!1;if(se.IsCallable(t)){var i=n(t,””,’ ” ‘),o=O([],i.match(/”/g)).length;r=i!==i.toLowerCase()||o>2}else r=!0;r&&ee(String.prototype,e,dr[e])});var hr=function(){if(!te)return!1;var e=”object”===(“undefined”==typeof JSON?”undefined”:_typeof(JSON))&&”function”==typeof JSON.stringify?JSON.stringify:null;if(!e)return!1;if(void 0!==e(W()))return!0;if(“[null]”!==e([W()]))return!0;var t={a:W()};return t[W()]=!0,”{}”!==e(t)}(),gr=a(function(){return!te||”{}”===JSON.stringify(Object(W()))&&”[{}]”===JSON.stringify([Object(W())])});if(hr||!gr){var yr=JSON.stringify;ee(JSON,”stringify”,function(e){if(“symbol”!==(void 0===e?”undefined”:_typeof(e))){var t;arguments.length>1&&(t=arguments[1]);var i=[e];if(r(t))i.push(t);else{var o=se.IsCallable(t)?t:null,a=function(e,t){var r=o?n(o,this,e,t):t;if(“symbol”!==(void 0===r?”undefined”:_typeof(r)))return K.symbol(r)?Tt({})(r):r};i.push(a)}return arguments.length>2&&i.push(arguments[2]),yr.apply(this,i)}})}return x}),define(“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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:”*”;return 1===this.length&&this[0]instanceof Text?[this[0]]:Array.from(this.add(this.contents().add(this.find(e).contents())).filter(function(){return this instanceof Text})).sort(function(e,t){return 2&e.compareDocumentPosition(t)?1:-1})},findAndFilter:function(e){return this.filter(e).add(this.find(e))}})}),function(){function e(){for(var e=0;e<arguments.length;e++)for(var t in arguments[e])this[t]=arguments[e][t]}function t(e,t){e.childAt=e.childAt||{};for(var n=t.start;n-1)||e.cannotFollow&&(-1!==e.cannotFollow.indexOf(n&&n.type)||e.cannotFollow.indexOf(“text”)>-1&&r)||e.peek&&e.peek.toLowerCase()!==t.slice(0,e.peek.length).toLowerCase())}function r(e){for(var t=e.innerText,r=[],o=0,s=o,c=t.length,u=null;o<c;){for(var l=t.slice(o),f=(r.length?r[0]:e).innerMode,p=0,d=f.length;p<d;p+=1){var h=a[f[p]];if(n(h,l,u,s<o)&&h.pattern.test(l)){var g=h.pattern.exec(l),y=h.fn(g),m=!1,v=0;if(y.matches){for(;v-1&&(v=r.length-1)}if(v>=r.length&&!y.isFront)continue}s<o&&e.addChild({type:"text",text:t.slice(s,o),innerMode:f}),u=e.addChild(y),o+=u.text.length,s=o,m&&(i(e,u,r[v]),r=r.slice(v+1)),u.isFrontToken()&&r.unshift(u);break}}p===d&&(o+=1,null===u&&(u={type:"text"}))}for(s0;)r.shift().demote();return e}function i(e,n,r){var i=e.children.indexOf(n),o=e.children.indexOf(r);n.children=e.children.splice(o+1,i-(o+1)),n.children.forEach(function(e){t(n,e)}),n.type=n.matches[r.type],n.innerText=””;for(var a=0,s=n.children.length;a<s;a++)n.innerText+=n.children[a].text;n.start=r.start,n.text=r.text+n.innerText+n.text,Object.keys(r).forEach(function(e){Object.hasOwnProperty.call(n,e)||(n[e]=r[e])}),n.isFront&&(n.isFront=!1),e.children.splice(o,1),t(e,n)}var o=void 0,a={};e.prototype={constructor:e,addChild:function(n){var i=this.lastChildEnd(),o=new e({start:i,end:n.text&&i+n.text.length,children:[]},n);return o.innerText&&r(o),this.children.push(o),t(this,o),o},firstChild:function(){return this.children?this.children[0]||null:null},lastChild:function(){return this.children?this.children[this.children.length-1]||null:null},lastChildEnd:function(){var e=this.lastChild();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.childAt)return this.childAt[e]&&this.childAt[e].tokenAt(e)||this;if(this.children.length)for(var t=0;t<this.children.length;t+=1){var n=this.children[t].tokenAt(e);if(n)return n}return this},pathAt:function(e){if(e=this.end)return[];if(this.childAt)return(this.childAt[e]&&this.childAt[e].pathAt(e)||[]).concat(this);var t=[];if(this.children.length)for(var n=0;n<this.children.length;n+=1){var r=this.children[n].pathAt(e);if(r.length){t.concat(r);break}}return t.concat(this)},nearestTokenAt:function(e){return e=this.end?null:this.children?this.children.reduce(function(t,n){return t||(e>=n.start&&e0&&(e+=”[“+this.children+”]”),e}},o={lex:function(t,n){return r(new e({type:”root”,start:n||0,end:t.length,text:t,innerText:t,children:[],childAt:{},innerMode:o.modes.start}))},rules:a,modes:{}},”object”===(“undefined”==typeof module?”undefined”:_typeof(module))?module.exports=o:”function”==typeof define&&define.amd?define(“lexer”,[],function(){return o}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Lexer=o):this.TwineLexer=o}.call(eval(“this”)||(“undefined”!=typeof global?global:window)),function(){function e(t){return t&&”object”===(void 0===t?”undefined”:_typeof(t))?(Object.keys(t).forEach(function(n){t[n]=e(t[n])}),t):(t+””).replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,”\\$&”)}function t(e){return function(){return”(“+e+Array.apply(0,arguments).join(“|”)+”)”}}var n=void 0,r=t(“?:”),i=t(“?!”),o=t(“?=”),a=”[ \\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]*”,s=a.replace(“*”,”+”),c=”\\b”,u=”[\\w\\-\\u00c0-\\u00de\\u00df-\\u00ff\\u0150\\u0170\\u0151\\u0171\\uD800-\\uDFFF]”,l=u.replace(“\\-“,””),f=r(“\\n”,”$”),p=”(“+r(“\\\\\\n\\\\?|\\n\\\\”,”[^\\n]”)+”+)”,d=a+”(\\*+)”+s+p+f,h=a+”((?:0\\.)+)”+s+p+f,g=a+”-{3,}”+a+f,y=a+”(#{1,6})”+a+p+f,m=a+”(==+>|<=+|)”+a+f,v=a+”(=+\\|+|\\|+=+|=+\\|+=+|\\|=+\\|)”+a+f,b={opener:”\\[\\[(?!\\[)”,text:”(“+function(){return”[^”+Array.apply(0,arguments).map(e).join(“”)+”]*”}(“]”)+”)”,rightSeparator:r(“\\->”,”\\|”),leftSeparator:”<\\-",closer:"\\]\\]",legacySeparator:"\\|",legacyText:"("+r("[^\\|\\]]","\\]"+i("\\]"))+"+)"},w=l+"*"+l.replace("\\w","a-zA-Z")+l+"*",x="\\$("+w+")",T="'s"+s+"("+w+")",S="("+w+")"+s+"of"+c+i("it\\b"),k="'s"+s,O=r("it","time","visits?","exits?")+c,j="its"+s+"("+w+")",A="its"+s,C="("+w+")"+s+"of"+s+"it"+c,E="of\\b"+s+"it"+c,N={opener:"\\(",name:"("+r(u+"+",x)+"):"+i("\\/"),closer:"\\)"},_=r("=”,”[gl]te?\\b”,”n?eq\\b”,”isnot\\b”,”are\\b”,”x\\b”,”isa\\b”,”or”+s+”a”+c),P={name:”[a-zA-Z][\\w\\-]*”,attrs:”(?:\”[^\”]*\”|'[^’]*’|[^’\”>])*?”},I=”\\|(“+u+”+)(>|\\))”,M=”(<|\\()("+u+"+)\\|",D="_("+w+")"+c,L="\\b(\\d+(?:\\.\\d+)?(?:[eE][+\\-]?\\d+)?)"+i("m?s")+c;b.main=b.opener+r(b.text+b.rightSeparator,b.text.replace("*","*?")+b.leftSeparator)+b.text,n={upperLetter:"[A-Z\\u00c0-\\u00de\\u0150\\u0170]",lowerLetter:"[a-z0-9_\\-\\u00df-\\u00ff\\u0151\\u0171]",anyLetter:u,anyLetterStrict:l,whitespace:s,escapedLine:"\\\\\\n\\\\?|\\n\\\\",br:"\\n(?!\\\\)",commentFront:"\x3c!–",commentBack:"–\x3e",tag:"”,tagPeek:”<",scriptStyleTag:"[^]*?”,scriptStyleTagOpener:”<",url:"("+r("https?","mailto","javascript","ftp","data")+":\\/\\/[^\\s<]+[^<.,:;\"')\\]\\s])",bullet:"\\*",hr:g,heading:y,align:m,column:v,bulleted:d,numbered:h,strikeOpener:e("~~"),italicOpener:e("//"),boldOpener:e("''"),supOpener:e("^^"),strongFront:e("**"),strongBack:e("**"),emFront:e("*"),emBack:e("*"),verbatimOpener:"`+",collapsedFront:"{",collapsedBack:"}",hookAppendedFront:"\\["+i("=+"),hookPrependedFront:I+"\\["+i("=+"),hookFront:"\\["+i("=+"),hookBack:"\\]"+i(M),hookAppendedBack:"\\]"+M,unclosedHook:"\\[=+",unclosedHookPrepended:I+"\\[=+",passageLink:b.main+b.closer,passageLinkPeek:"[[",legacyLink:b.opener+b.legacyText+b.legacySeparator+b.legacyText+b.closer,legacyLinkPeek:"[[",simpleLink:b.opener+b.legacyText+b.closer,simpleLinkPeek:"[[",macroFront:N.opener+o(N.name),macroFrontPeek:"(",macroName:N.name,groupingFront:"\\("+i(N.name),groupingFrontPeek:"(",groupingBack:"\\)",twine1Macro:"<\\s]+\\s*(?:\\\\.|'(?:[^’\\\\]*\\\\.)*[^’\\\\]*’|\”(?:[^\”\\\\]*\\\\.)*[^\”\\\\]*\”|[^’\”\\\\>]|>(?!>))*>>”,twine1MacroPeek:”<<",property:T,propertyPeek:"'s",belongingProperty:S,possessiveOperator:k,belongingOperator:"of\\b",belongingOperatorPeek:"of",itsOperator:A,itsOperatorPeek:"its",belongingItOperator:E,belongingItOperatorPeek:"of",variable:x,variablePeek:"$",tempVariable:D,tempVariablePeek:"_",hookRef:"\\?("+u+"+)\\b",hookRefPeek:"?",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"),"#[\\dA-Fa-f]{3}(?:[\\dA-Fa-f]{3})?"),datatype:r("array","boolean","changer","colour","gradient","color","command","dm","datamap","ds","dataset","number","num","string","str"),number:L,boolean:r("true","false")+c,identifier:O,itsProperty:j,itsPropertyPeek:"its",belongingItProperty:C,escapedStringChar:"\\\\[^\\n]",singleStringOpener:"'",doubleStringOpener:'"',is:"is"+i(s+"not"+c,s+"an?"+c,s+"in"+c,s+"”)+c,isNot:”is”+s+”not”+i(s+”a”+c)+c,isA:”is”+s+”an?”+c,isNotA:”is”+s+”not”+s+”an?”+c,matches:”matches”+s,and:”and\\b”,or:”or\\b”,not:”not\\b”,inequality:”((?:is(?:”+s+”not)?”+a+”)*)(“+r(“<(?!=)","(?!=)”,”>=”)+”)”,isIn:”is”+s+”in”+c,contains:”contains\\b”,addition:e(“+”)+i(“=”),subtraction:e(“-“)+i(“=”),multiplication:e(“*”)+i(“=”),division:r(“/”,”%”)+i(“=”),comma:”,”,spread:”\\.\\.\\.”+i(“\\.”),to:r(“to\\b”,”=”),into:”into\\b”,making:”making\\b”,where:”where\\b”,when:”when\\b”,via:”via\\b”,with:”with\\b”,each:”each\\b”,augmentedAssign:r(“\\+”,”\\-“,”\\*”,”\\/”,”%”)+”=”,bind:”bind\\b”,incorrectOperator:_},”object”===(“undefined”==typeof module?”undefined”:_typeof(module))?module.exports=n:”function”==typeof define&&define.amd?define(“patterns”,[],function(){return n}):this&&this.loaded?(this.modules||(this.modules={}),this.modules.Patterns=n):this.Patterns=n}.call(eval(“this”)||(“undefined”!=typeof global?global:window)),function(){function e(e){function t(e){return e=e||”innerText”,function(t){var n=t.reduceRight(function(e,t,n){return e||(n?t:””)},””),r={};return r[e]=n,r}}function r(e,t){var n={};return n[e]=t,function(){return{isFront:!0,matches:n,cannotCross:[“verbatimOpener”]}}}function i(e,t){return Object.keys(t).forEach(function(n){var r=t[n].fn;t[n].fn=function(t){var i=r(t);return i.text||(i.text=t[0]),i.type||(i.type=n),i.innerMode||(i.innerMode=e),i}}),t}var o=Object.bind(0,null),a=[],s=[],c=i(a,{hr:{fn:o},bulleted:{fn:function(e){return{depth:e[1].length,innerText:e[2]}}},numbered:{fn:function(e){return{depth:e[1].length/2,innerText:e[2]}}},heading:{fn:function(e){return{depth:e[1].length,innerText:e[2]}}},align:{fn:function(e){var t=void 0,n=e[1],r=n.indexOf(“><");return~r?25===(t=Math.round(r/(n.length-2)*50))&&(t="center"):"”===n.slice(-1)?t=”justify”:n.indexOf(“>”)>-1?t=”right”:n.indexOf(“-1&&(t=”left”),{align:t}}},column:{fn:function(e){var t=void 0,n=e[1],r=n.indexOf(“|”);return r&&r-1}}},augmentedAssign:{fn:function(e){return{operator:e[0][0]}}},identifier:{fn:t(“name”),cannotFollow:[“text”]},whitespace:{fn:o,cannotFollow:”text”},incorrectOperator:{fn:function(e){var t={“=>”:”>=”,”=<":"=”,lte:””,lt:”<",eq:"is",isnot:"is not",neq:"is not",isa:"is a",are:"is",x:"*","or a":"or"}[e[0].toLowerCase().replace(/\s+/g," ")];return{type:"error",message:"Please say "+(t?"'"+t+"'":"something else")+" instead of '"+e[0]+"'.",explanation:"In the interests of readability, I want certain operators to be in a specific form."}},cannotFollow:"text"}},["boolean","is","to","into","where","when","via","with","making","each","and","or","not","isNot","contains","isIn","isA","isNotA","matches","bind"].reduce(function(e,t){return e[t]={fn:o,cannotFollow:["text"]},e},{}),["comma","spread","addition","subtraction","multiplication","division"].reduce(function(e,t){return e[t]={fn:o},e},{})));a.push.apply(a,_toConsumableArray(Object.keys(c)).concat(_toConsumableArray(Object.keys(l)),_toConsumableArray(Object.keys(u)))),s.push.apply(s,_toConsumableArray(Object.keys(l)).concat(_toConsumableArray(Object.keys(f))));var p=Object.assign({},c,u,l,f);return Object.keys(p).forEach(function(e){var t=n[e];p[e].pattern="string"!=typeof t?t:new RegExp("^(?:"+t+")","i"),n[e+"Peek"]&&(p[e].peek=n[e+"Peek"])}),Object.assign(e.rules,p),e.modes.start=e.modes.markup=a,e.modes.macro=s,e}function t(t){return Object.freeze({lex:e(t).lex,Patterns:n})}var n=void 0;Object.assign=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:0;if(!Number.isNaN(t)&&Number.isFinite(n)&&void 0!==t)return e.indexOf.call(this,t,n)>-1;var r=Object(this),i=parseInt(r.length);if(i=0?n:Math.max(0,i+n);o<i;){if(Object.is(t,r[o]))return!0;o+=1}return!1})}),define("utils",["jquery","markup","utils/selectors","utils/polyfills"],function(e,t,n){function r(t,n){var r=o[n];if(!r[t]){var i=e("“).appendTo(document.body).attr(“data-t8n”,t).addClass(n);r[t]=u.cssTimeUnit(i.css(“animation-duration”))+u.cssTimeUnit(i.css(“animation-delay”)),i.remove()}return r[t]}var i={configurable:0,writable:0},o={“transition-in”:Object.create(null),”transition-out”:Object.create(null)},a=”audio,blockquote,canvas,div,h1,h2,h3,h4,h5,hr,ol,p,pre,table,ul,video,tw-align,tw-story,tw-passage”.split(“,”),s=”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”.split(“,”),c=[“audio”],u=void 0,l=void 0,f=[];return u={lockProperty:function(e,t,n){var r=Object.create(i);return n&&(r.value=n),Object.defineProperty(e,t,r),e},permutations:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.length,i=[[].concat(t)],o=Array(r).fill(0),a=1,s=void 0,c=void 0;a<r;)o[a]1?”s”:””)},andList:function(e){return 1===e.length?e[0]:e.slice(0,-1).join(“, “)+” and “+e[e.length-1]},realWhitespace:”[ \\n\\r\\f\\t\\v\\u00a0\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]”,anyRealLetter:”[\\dA-Za-z\\u00c0-\\u00de\\u00df-\\u00ff\\u0150\\u0170\\u0151\\u0171\\uD800-\\uDFFF]”,unescape:function(e){return e.replace(/&(?:amp|lt|gt|quot|nbsp|zwnj|#39|#96);/g,function(e){return{“&”:”&”,”>”:”>”,”<“:””:”>”,”0&&(t=o);var a=e(“”).css(“position”,”relative”);a.insertBefore(t.first());var s=void 0;r&&(s=e(“”).appendTo(a),r.appendTo(s));var c=e(“”).css(“position”,”absolute”).prependTo(a);t.detach().appendTo(c),u.transitionOut(c,i),r&&u.transitionIn(s,i,function(){s.unwrap().children().first().unwrap()})},transitionOut:function(e,t,n){function i(){e.remove()}if(0!==e.length){var o=u.childrenProbablyInline(e);(e.length>1||!o||![“tw-hook”,”tw-passage”].includes(e.tag()))&&(e=e.wrapAll(“”).parent()),e.attr(“data-t8n”,t).addClass(“transition-out”),u.childrenProbablyInline(e)&&e.css(“display”,”inline-block”),”number”==typeof n&&e.css(“animation-duration”,n+”ms”);var a=n||r(t,”transition-out”);a?window.setTimeout(i,a):i()}},transitionIn:function(e,t,n){function i(){var t=0===e.findAndFilter(c.join(“,”)).length;a&&t?e.contents().unwrap():e.removeClass(“transition-in”).removeAttr(“data-t8n”)}if(0!==e.length){var o=u.childrenProbablyInline(e),a=e.length>1||!o||![“tw-hook”,”tw-passage”].includes(e.tag());a&&(e=e.wrapAll(“”).parent()),e.attr(“data-t8n”,t).addClass(“transition-in”),”number”==typeof n&&e.css(“animation-duration”,n+”ms”),u.childrenProbablyInline(e)&&e.css(“display”,”inline-block”);var s=n||r(t,”transition-in”);s?window.setTimeout(i,s):i()}},$:function(t,n){return e(t,n||u.storyElement).not(“.transition-out, .transition-out *”)},impossible:function(e,t){window.console&&console.error(e+”(): “+t)},assertMustHave:function(e,t){if(window.console)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:String;return function(n,r){var i,o,a,s,c=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,f=/^0/,p=t(n).trim(),d=t(r).trim(),h=p.replace(c,”\0$1\0″).replace(/\0$/,””).replace(/^\0/,””).split(“\0″),g=d.replace(c,”\0$1\0″).replace(/\0$/,””).replace(/^\0/,””).split(“\0”),y=parseInt(p.match(l))||1!==h.length&&p.match(u)&&Date.parse(p),m=parseInt(d.match(l))||y&&d.match(u)&&Date.parse(d)||null;if(e&&window.Intl&&window.Intl.Collator&&(a=window.Intl.Collator(e)),m){if(ym)return 1}for(var v=0,b=Math.max(h.length,g.length);v<b;v++){if(i=!(h[v]||"").match(f)&&parseFloat(h[v])||h[v]||0,o=!(g[v]||"").match(f)&&parseFloat(g[v])||g[v]||0,isNaN(i)!==isNaN(o))return isNaN(i)?1:-1;if((void 0===i?"undefined":_typeof(i))!==(void 0===o?"undefined":_typeof(o)))i+="",o+="";else if("string"==typeof i&&a&&0!==(s=a.compare(i,o)))return s;if(io)return 1}return 0}}}),define(“passages”,[“jquery”,”utils/naturalsort”,”utils”,”utils/selectors”],function(e,t,n,r){function i(e){return Object.assign(new Map([[“source”,o(e.html())],[“tags”,(e.attr(“tags”)||””).split(/\s/)||[]],[“name”,e.attr(“name”)]]),{TwineScript_TypeName:”a passage datamap”,TwineScript_ObjectName:”a passage datamap”})}var o=n.unescape,a=n.onStartup,s=Object.assign(new Map,{TwineScript_ObjectName:”the Passages datamap”,getTagged:function(e){var n=t(“en”,function(e){return e.get(“name”)}),r=[];return this.forEach(function(t){var n=t instanceof Map&&t.get(“tags”);Array.isArray(n)&&n.includes(e)&&r.push(t)}),r.sort(n)},hasValid:function(e){var t=this.get(e);return t&&t instanceof Map&&t.has(“source”)},create:i});return a(function(){Array.from(e(r.storyData+” > “+r.passageData)).forEach(function(t){t=e(t),s.set(t.attr(“name”),new i(t))})}),s}),define(“datatypes/hookset”,[“jquery”,”utils”,”utils/selectors”,”markup”],function(e,t,n,r){function i(e){var t=[].concat(_toConsumableArray(e.textContent));return 1===t.length?[e]:t.reduce(function(e,t){return t.match(p)&&e[e.length-1].match(p)?e[e.length-1]+=t:e.push(t),e},[]).reduce(function(t,n){var r=e;return n.length=r)){var i=void 0,o=[i=0===t?e:e.splitText(t)];return n&&(n<=0&&(n=r-n),n0;){n.push(e[0]),r+=e[0].textContent,e.shift();var s=r.indexOf(t);if(s>-1){for(var c,u=r.length-(s+t.length);s>=n[0].textContent.length;)s-=n[0].textContent.length,n.shift();if(1===n.length){var l=o(n[0],s,s+t.length);i.push(l[0]),l[1]&&e.unshift(l[1]);break}i.push(o(n[0],s,n[0].length)[0]),(c=i).push.apply(c,_toConsumableArray(n.slice(1,-1)));var f=o(n[n.length-1],0,n[n.length-1].textContent.length-u);i.push(f[0]),f[1]&&e.unshift(f[1]),i=i.filter(Boolean);break}}return[i].concat(_toConsumableArray(a(e,t)))}function s(t,n){var r=a(n.textNodes(),t),i=e();return r.forEach(function(t){i=i.add(e(t).wrapAll(“”).parent())}),i}function c(e){e=t.insensitiveName(e).replace(/\?/g,””).replace(/”/g,”"”);var r=n.hook+'[name=”‘+e+'”]’;return r+={page:”, tw-story”,passage:”, tw-passage”,sidebar:”, tw-sidebar”,link:”, tw-link, .enchantment-link”}[e]||””}function u(n){var r=n.dom,o=e();this.prev&&(o=o.add(u.call(this.prev,{dom:r})));var a=function(t,n){if(Array.isArray(n))return n.reduce(function(e,n){return e.add(t.get(n))},e());if(n&&”object”===(void 0===n?”undefined”:_typeof(n))&&”first”in n&&”last”in n){var r=n.first,o=n.last,a=t.length;r<0&&(r+=a),o<0&&(o+=a);for(var s=e(t.get(r));r!==o;)r+=Math.sign(o-r),s=s.add(t.get(r));return s}if("string"==typeof n){if("chars"===n){var c=e();return t.textNodes().forEach(function(e){return i(e).forEach(function(e){return c=c.add(e)})}),c}if("links"===n)return t.find("tw-link, .enchantment-link");if("lines"===n){var u=t.findAndFilter("br:not(tw-sidebar *)").get(),l=[e()],f=e();return t.textNodes(":not(tw-sidebar):not(tw-sidebar *)").forEach(function(t){2&t.compareDocumentPosition(u[0])&&(u.shift(),l.push(e())),l[l.length-1]=l[l.length-1].add(t)}),l.forEach(function(e){return f=f.add(e.wrapAll("”).parent())}),f}}return e(t.get(n))};if(this.selector){var l=void 0;l=this.selector.match(“^”+f.hookRef+”$”)?r.add(r.parentsUntil(t.storyElement.parent())).findAndFilter(c(this.selector)):s(this.selector,r),o=this.properties.length?o.add(this.properties.reduce(a,l)):o.add(l)}return this.base&&(o=o.add(this.properties.reduce(a,u.call(this.base,{dom:r})))),o}function l(e){if(!e)return[];var n=e.selector,r=e.base,i=e.properties,o=e.prev;return[JSON.stringify([t.insensitiveName(n)||””,l(r),[].concat(_toConsumableArray(i)).sort()])].concat(_toConsumableArray(l(o))).sort()}var f=r.Patterns,p=new RegExp(t.realWhitespace+”+”),d=Object.freeze({forEach:function(t,n){var r=u.call(this,t).each(function(t){n(e(this),t)});return t.dom.findAndFilter(“tw-pseudo-hook”).contents().unwrap(),r},hooks:function(e){return u.call(this,e)},get TwineScript_ObjectName(){return this.properties.length>0||this.prev?”a complex hook name”:this.selector+” (a hook name)”},TwineScript_TypeName:”a hook name (like ?this)”,TwineScript_Unstorable:!0,”TwineScript_+”:function(e){var t=e.TwineScript_Clone();return t.prev=this,t},TwineScript_is:function(e){return l(this)+””==l(e)+””},TwineScript_GetProperty:function(e){return d.create(void 0,this,[e],void 0)},TwineScript_Properties:[“chars”,”links”,”lines”],TwineScript_Clone:function(){return d.create(this.selector,this.base,this.properties,this.prev)},create:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return Object.assign(Object.create(this||d),{selector:e,base:t,properties:n,prev:r})},from:function(e){return d.isPrototypeOf(e)?e:d.create(e)}});return d}),define(“internaltypes/twineerror”,[“jquery”,”utils”],function(e,t){var n=t.impossible,r=t.escape,i={syntax:”The markup seems to contain a mistake.”,saving:”I tried to save or load the game, but I couldn’t do it.”,operation:”I tried to perform an operation on some data, but the data’s type was incorrect.”,macrocall:”I tried to use a macro, but its call wasn’t written correctly.”,datatype:”I tried to use a macro, but was given the wrong type of data to it.”,infinite:”I almost ended up doing the same thing over and over, forever.”,property:”I tried to access a value in a string/array/datamap, but I couldn’t find it.”,unimplemented:”I currently don’t have this particular feature. I’m sorry.”,javascript:”This error message was reported by your browser’s Javascript engine. I don’t understand it either, but it usually means that an expression was badly written.”},o={error:[],warning:[]},a={create:function(e,t,r){return t||n(“TwineError.create”,”called with only 1 string.”),r||e in i||n(“TwineError.create”,”no error explanation given”),Object.assign(Object.create(this),{type:e,message:t,explanation:r})},fromError:function(e){return a.create(“javascript”,”\u2615 “+e.message)},containsError:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(e,t){return e||(t instanceof Error?t:a.isPrototypeOf(t)?t:!!Array.isArray(t)&&a.containsError.apply(a,_toConsumableArray(t)))},!1)},createWarning:function(e,t){return Object.assign(this.create(e,t),{warning:!0})},render:function(t){var n=this;t=t||"";var a=e("”+r(this.message)+””),s=e(“”).text(this.explanation||i[this.type]).hide(),c=e(“”).html(“►“);return c.on(“click”,function(){s.toggle(),c.children(“.folddown-arrowhead”).css(“transform”,”rotate(“+(s.is(“:visible”)?”90deg”:”0deg”)+”)”)}),a.append(c).append(s),a.data(“TwineError”,this),o.error.forEach(function(e){return e(n,t)}),a},on:function(e,t){return e in o?(“function”!=typeof t||o[e].includes(t)||o[e].push(t),a):void n(“TwineError.on”,”invalid event name”)}};return a}),define(“utils/operationutils”,[“jquery”,”utils”,”datatypes/hookset”,”internaltypes/twineerror”],function(e,t,n,r){function i(e){return!!e&&(“object”===(void 0===e?”undefined”:_typeof(e))||”function”==typeof e)}function o(e){return Array.isArray(e)?”array”:e instanceof Map?”datamap”:e instanceof Set?”dataset”:”string”==typeof e?”string”:e&&”object”===(void 0===e?”undefined”:_typeof(e))?”object”:””}function a(e,t){if(e instanceof Map||b(“isValidDatamapName”,”called with non-Map”),r.containsError(t))return t;if(“string”!=typeof t&&”number”!=typeof t)return r.create(“property”,”Only strings and numbers can be used as data names for “+l(e)+”, not “+l(t)+”.”);var n=”string”==typeof t?+t:””+t;return!(!Number.isNaN(n)&&e.has(n))||r.create(“property”,”You mustn’t use both “+l(t)+” and “+l(n)+” as data names in the same datamap.”)}function s(e,t){if(null===t)return void 0===e;if(t.innerType){if(“optional”===t.pattern||”zero or more”===t.pattern)return void 0===e||s(e,t.innerType);if(“either”===t.pattern)return t.innerType.some(function(t){return s(e,t)});if(“lambda”===t.pattern&&s(e,t.innerType))return”string”!=typeof t.clauses&&b(“singleTypeCheck”,”lambda signature had non-string clauses”),t.clauses.includes(“where”)===”where”in e&&t.clauses.includes(“making”)===”making”in e&&t.clauses.includes(“via”)===”via”in e&&t.clauses.includes(“with”)===”with”in e;if(“wrapped”===t.pattern)return s(e,t.innerType)}return(void 0===t||void 0!==e)&&(“anything”===t.TwineScript_TypeName&&void 0!==e&&!e.TwineScript_Unstorable||(t===String?”string”==typeof e:t===Boolean?”boolean”==typeof e:t===parseInt?”number”==typeof e&&!Number.isNaN(e)&&!(e+””).includes(“.”):t===Number?”number”==typeof e&&!Number.isNaN(e):t===Array?Array.isArray(e):t===Map||t===Set?e instanceof t:Object.isPrototypeOf.call(t,e)))}function c(e){return”string”==typeof e||Array.isArray(e)||n.isPrototypeOf(e)}function u(e){if(!i(e))return e;if(“function”==typeof e.TwineScript_Clone)return e.TwineScript_Clone();if(Array.isArray(e))return[].concat(_toConsumableArray(e));if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(“function”==typeof e)return Object.assign(e.bind(),e);switch(Object.getPrototypeOf(e)){case Object.prototype:return Object.assign({},e);case null:return Object.assign(Object.create(null),e)}return b(“OperationUtils.clone”,”The value “+(e.toSource?e.toSource():e)+” cannot be cloned!”),e}function l(e){return i(e)&&”TwineScript_ObjectName”in e?e.TwineScript_ObjectName:Array.isArray(e)?”an array”:e instanceof Map?”a datamap”:e instanceof Set?”a dataset”:”boolean”==typeof e?”the boolean value ‘”+e+”‘”:”string”==typeof e||”number”==typeof e?”the “+(void 0===e?”undefined”:_typeof(e))+” “+x(e):void 0===e?”an empty variable”:”…whatever this is”}function f(e){return Object.getPrototypeOf(e)===Object.prototype&&e.innerType?e.typeName?e.typeName:”either”===e.pattern?(Array.isArray(e.innerType)||b(“typeName”,'”either” pattern had non-array inner type’),e.innerType.map(f).join(” or “)):”optional”===e.pattern?”(optional) “+f(e.innerType):f(e.innerType):e===String||e===Number||e===Boolean?”a “+_typeof(e()):e===parseInt?”a whole number”:e===Map?”a datamap”:e===Set?”a dataset”:e===Array?”an array”:i(e)&&”TwineScript_TypeName”in e?e.TwineScript_TypeName:l(e)}function p(e,t){return”object”!==(void 0===e?”undefined”:_typeof(e))&&”object”!==(void 0===t?”undefined”:_typeof(t))?e===t:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(e,n){return p(t[n],e)}):e instanceof Map&&t instanceof Map?p(Array.from(e.entries()).sort(),Array.from(t.entries()).sort()):e instanceof Set&&t instanceof Set?p([].concat(_toConsumableArray(e)),[].concat(_toConsumableArray(t))):e&&”function”==typeof e.TwineScript_is?e.TwineScript_is(t):e&&”object”===(void 0===e?”undefined”:_typeof(e))&&t&&”object”===(void 0===t?”undefined”:_typeof(t))&&Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype?p(Object.getOwnPropertyNames(e).map(function(t){return[t,e[t]]}),Object.getOwnPropertyNames(t).map(function(e){return[e,t[e]]})):Object.is(e,t)}function d(e,t){if(e||””===e){if(“string”==typeof e)return e.includes(t);if(Array.isArray(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 r.create(“operation”,l(e)+” cannot contain any values, let alone “+l(t))}function h(e,t){return”function”==typeof t.TwineScript_IsTypeOf?t.TwineScript_IsTypeOf(e):r.create(“operation”,'”is a” should only be used to compare type names, not ‘+l(t)+”.”)}function g(e,t){return e&&”function”==typeof e.TwineScript_IsTypeOf?e.TwineScript_IsTypeOf(t):t&&”function”==typeof t.TwineScript_IsTypeOf?t.TwineScript_IsTypeOf(e):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(e,n){return g(e,t[n])}):e instanceof Map&&t instanceof Map?g(Array.from(e.entries()).sort(),Array.from(t.entries()).sort()):e instanceof Set&&t instanceof Set?(e=[].concat(_toConsumableArray(e)),w.apply(void 0,_toConsumableArray(t)).some(function(t){return g(e,t)})):p(e,t)}function y(e,t,n){if(!t||!n)return r.create(“macrocall”,”The sub”+o(e)+” index values must not be 0 or NaN.”);var i=”string”==typeof e;if(i&&(e=Array.from(e)),t<0&&(t=e.length+t+1),nn)return y(arguments[0],n,t);var a=e.slice(t>0?t-1:t,n).map(u);return i?a.join(“”):a}function m(t){return r.containsError(t)?t:t&&”function”==typeof t.TwineScript_Print?t.TwineScript_Print():t instanceof Map?(t=Array.from(t.entries()),r.containsError(t)?t:t.reduce(function(e,t){var n=_slicedToArray(t,2),r=n[0],i=n[1];return e+”`”+m(r)+”` | `”+m(i)+”` |
“},”
“):t instanceof Set?Array.from(t.values()).map(m)+””:Array.isArray(t)?t.map(m)+””:t instanceof e?t:i(t)?r.create(“unimplemented”,”I don’t know how to print this value yet.”):t+””}function v(e,t){if(e>t)return v(t,e);var n=[e];for(t-=e;t– >0;)n.push(++e);return n}var b=t.impossible,w=t.permutations,x=t.toJSLiteral;return Object.freeze({isObject:i,singleTypeCheck:s,isValidDatamapName:a,collectionType:o,isSequential:c,clone:u,objectName:l,typeName:f,is:p,contains:d,isA:h,matches:g,subset:y,range:v,printBuiltinValue:m,numericIndex:/^(?:[1-9]\d*|0)$/,unique:function(e,t,n){return!n.slice(t+1).some(function(t){return p(e,t)})}})}),define(“twinescript/compiler”,[“utils”],function(e){function t(e,t){for(var n=0;n-1)return i=[e[o],o],!0}),i):i}function i(e){if(“inequality”===e.type){var t=e.operator;return e.negate?{“>”:”<=","=”,”>=”:”<","”}[t]:t}return e.type}function o(e){var t=i(e);return{“>”:”<","”,”>=”:”<=","=”,contains:”isIn”,isIn:”contains”,isA:”typifies”,typifies:”isA”,isNotA:”untypifies”,untypifies:”isNotA”}[t]||t}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isVarRef,u=t.whitespaceError,l=t.elidedComparison,f=t.testNeedsRight;if(e=[].concat(e),!e.length)return n&&u?”TwineError.create(‘operation’,”+s(u)+”)”:””;var p=e[0];if(1===e.length){if(“identifier”===p.type)return n?”VarRef.create(Operations.Identifiers,”+s(p.text)+”)”:” Operations.Identifiers.”+p.text.toLowerCase()+” “;if(“variable”===p.type)return”VarRef.create(State.variables,”+s(p.name)+”)”+(n?””:”.get()”);if(“tempVariable”===p.type)return”VarRef.create(section.stack[0].tempVariables,”+s(p.name)+”)”+(n?””:”.get()”);if(“hookRef”===p.type)return” HookSet.create(‘?”+p.name+”‘) “;if(“string”===p.type)return p.text.replace(/\n/g,”\\n”);if(“colour”===p.type)return”Colour.create(“+s(p.colour)+”)”;if(“datatype”===p.type)return”Datatype.create(“+s(p.name)+”)”;if(“blockedValue”===p.type)return”section.blockedValue()”;if(“root”===p.type)return a(p.children);if(“whitespace”===p.type&&n&&u)return”TwineError.create(‘operation’,”+s(u)+”)”}var d=void 0,h=r(e,”least”),g=_slicedToArray(h,2);p=g[0],d=g[1];var y=(p||{}).type,m=function(e){return{isVarRef:!0,whitespaceError:”I need usable data to be on the “+e+’ of “‘+p.text+'”.’}},v=void 0,b=void 0,w=void 0,x=void 0,T=void 0,S=void 0,k=!0,O=!0,j=!1;if(y){if(“error”===y)return”TwineError.create(‘syntax’,”+s(p.message)+”)”;if(“comma”===y)w=”,”,O=!1;else if(“spread”===y)w=”Operations.makeSpreader(“,b=a(e.slice(d+1))+”)”,k=!1;else if(“bind”===y)w=”VarBind.create(“,b=a(e.slice(d+1),m(“right”))+”)”,k=!1;else if(“to”===y)T=”to”,b=a(e.slice(d+1),m(“right”)),v=”Operations.setIt(“+a(e.slice(0,d),m(“left”))+”)”;else if(“into”===y)T=”into”,b=a(e.slice(0,d),m(“left”)),v=”Operations.setIt(“+a(e.slice(d+1),m(“right”))+”)”;else if(“where”===y||”when”===y||”via”===y)v=”Lambda.create(“+(a(e.slice(0,d),{isVarRef:!0,whitespaceError:null}).trim()||”undefined”)+”,”,w=s(p.type)+”,”,b=s(a(e.slice(d+1)))+”)”;else if(“with”===y||”making”===y||”each”===y){var A=e.slice(d+1);![2,3].includes(A.length)||”whitespace”!==A[0].type||”tempVariable”!==A[1].type||A[2]&&”whitespace”!==A[2].type?(v=”TwineError.create(‘operation’,’I need a temporary variable to the right of \\'”,w=p.type,b=”\\’.’)”):”each”===y?(v=”Lambda.create(“,w=a(A,m(“right”)).trim(),b=”,’where’,’true’)”):(v=”Lambda.create(“+(a(e.slice(0,d),{isVarRef:!0,whitespaceError:null}).trim()||”undefined”)+”,”,w=s(p.type)+”,”,b=s(A[1].name)+”)”)}else if(“augmentedAssign”===y)T=p.operator,v=a(e.slice(0,d),m(“left”)),b=”Operations[‘”+T+”‘](“+a(e.slice(0,d))+”,”+a(e.slice(d+1))+”)”;else if(“and”===y||”or”===y){var C=function e(t){var n=r(t,”least”),i=_slicedToArray(n,2),o=i[0],a=i[1];if(o)return[“inequality”,”is”,”isNot”,”isIn”,”contains”,”isA”,”typifies”,”isNotA”,”untypifies”,”matches”].includes(o.type)?o:[“and”,”or”].includes(o.type)?e(t.slice(0,a))||e(t.slice(a+1)):void 0},E=C(e.slice(0,d)),N=C(e.slice(d+1)),_=”TwineError.create(‘operation’, ‘This use of \”is not\” and \””+y+”\” is grammatically ambiguous’,’Maybe try rewriting this as \”__ is not __ “+y+” __ is not __\”‘) “;if(x=p.type,l===p.type)x=””,v=a(e.slice(0,d),{isVarRef:n,elidedComparison:l}).trim(),w=”,”,b=a(e.slice(d+1),{elidedComparison:l}).trim();else if(E&&!N){var P=E,I=s(i(P));if(“isNot”===P.type||”isNotA”===P.type||”untypifies”===P.type)return _;b=”Operations.elidedComparisonOperator(“+s(p.type)+”,”+I+”,”+a(e.slice(d+1),{elidedComparison:y})+”)”}else if(!E&&N){var M=N,D=e.indexOf(M),L=s(o(M));if(“isNot”===M.type||”isNotA”===M.type||”untypifies”===M.type)return _;b=”Operations.elidedComparisonOperator(“+s(p.type)+”,”+L+”,”+a(e.slice(0,d),{elidedComparison:y})+”)”,v=a([].concat(_toConsumableArray(e.slice(D+1)),[Object.assign(Object.create(M),_defineProperty({},”inequality”===M.type?”operator”:”type”,o(M)))],_toConsumableArray(e.slice(d+1,D))))}}else if(“is”===y||”isNot”===y||”contains”===y||”isIn”===y||”inequality”===y||”isA”===y||”typifies”===y||”isNotA”===y||”untypifies”===y||”matches”===y)j=!0,x=i(p);else if(“addition”===y||”subtraction”===y){var R=a(e.slice(0,d),{testNeedsRight:!0}).trim();if(!R)return p.type={addition:”positive”,subtraction:”negative”}[y],a(e,{isVarRef:n,whitespaceError:u,elidedComparison:l,testNeedsRight:f});x=p.text}else if(“multiplication”===y||”division”===y)x=p.text;else if(“positive”===y||”negative”===y)x=”*”,v=”negative”===y?”-1″:”1″;else if(“not”===y)w=” “,b=”Operations.not(“+a(e.slice(d+1))+”)”,k=!1;else if(“belongingProperty”===y)b=”VarRef.create(“+a(e.slice(d+1),m(“right”))+”,”+s(p.name)+”)”+(n?””:”.get()”),w=” “,k=O=!1;else if(“belongingOperator”===y||”belongingItOperator”===y)p.type.includes(“It”)?(b=”Operations.Identifiers.it”,O=!1):b=a(e.slice(d+1),m(“right”)),S=”belonging”;else if(“property”===y)v=”VarRef.create(“+a(e.slice(0,d),m(“left”))+”,”+s(p.name)+”)”+(n?””:”.get()”),w=” “,k=O=!1;else if(“itsProperty”===y||”belongingItProperty”===y)v=”VarRef.create(Operations.Identifiers.it,”+s(p.name)+”).get()”,w=” “,k=O=!1;else if(“possessiveOperator”===y||”itsOperator”===y)p.type.includes(“it”)&&(v=”Operations.Identifiers.it”,k=!1),S=”possessive”;else if(“twineLink”===y)w=’Macros.run(“link-goto”, [section,’+s(p.innerText)+”,”+s(p.passage)+”])”,k=O=!1;else if(“macro”===y){var q=p.children[0];”macroName”!==q.type&&c(“Compiler.compile”,”macro token had no macroName child token”),w=”Macros.run(“+(q.isMethodCall?a(q.children):'”‘+p.name+'”‘)+”, [section,”+a(p.children.slice(1))+”])”,k=O=!1}else”grouping”===y&&(w=”(“+a(p.children,{isVarRef:n})+”)”,k=O=!1)}else;return d>-1?(x&&(n=!1),v=v||a(e.slice(0,d),{isVarRef:n
}).trim(),b=b||a(e.slice(d+1)).trim(),j&&!v&&(v=” Operations.Identifiers.it “),k&&!v||O&&!b?f&&O&&!b?””:”TwineError.create(‘operation’,’I need some code to be “+(k?”left “:””)+(k&&O?”and “:””)+(O?”right “:””)+’of “‘+p.text+”\”‘)”:w?v+w+b:T?”Operations.makeAssignmentRequest(“+[v,b,s(T)]+”)”:S?”VarRef.create(“+(“belonging”===S?b:v)+”,{computed:true,value:”+(“belonging”===S?v:b)+”})”+(n?””:”.get()”):x?” Operations[“+s(x)+”](“+v+”,”+b+”) “:””):1===e.length?((“value”in e[0]?e[0].value:e[0].text)+””).trim()||” “:e.reduce(function(e,t){return e+a(t,{isVarRef:n})},””)}var s=e.toJSLiteral,c=e.impossible;return a}),define(“renderer”,[“utils”,”markup”,”twinescript/compiler”,”internaltypes/twineerror”],function(e,t,n,r){function i(e,t){return””+e+””}function o(e,t){var n=f.render(e.children);return n&&i(n,t)}function a(e){var t=[];if(“string”!==e.type)for(var n=0;n<e.children.length;n+=1)t.push.apply(t,_toConsumableArray(a(e.children[n])));var r=e.firstChild();return"macro"===e.type&&r&&"macroName"===r.type&&f.options.blockerMacros.includes(l(r.text.slice(0,-1)))&&t.push(e),t}var s=e.escape,c=e.impossible,u=e.toJSLiteral,l=e.insensitiveName,f=void 0,p="text-align: center; max-width:50%; ";return f={options:{blockerMacros:[]},exec:function(){var e=void 0,n=void 0;return function(r){return"string"!=typeof r?(c("Renderer.exec","source was not a string, but "+(void 0===r?"undefined":_typeof(r))),""):r===e?n:(e=r,n=f.render(t.lex(r).children))}}(),render:function e(c){var d="",h=[];if(!c)return d;for(var g=c.length,y=0;y<g;y+=1){var m=c[y];switch(m.type){case"error":d+=r.create("syntax",m.message).render(s(m.text))[0].outerHTML;break;case"numbered":case"bulleted":var v="numbered"===m.type?"ol":"ul";d+="”;for(var b=1;y<g&&c[y]&&c[y].type===m.type;)d+=("”).repeat(Math.max(0,c[y].depth-b)),d+=(“”).repeat(Math.max(0,b-c[y].depth)),b=c[y].depth,d+=o(c[y],”li”),y+=1;y-=1,d+=(“”).repeat(b+1);break;case”align”:for(;m&&”align”===m.type;){var w=m,x=w.align,T=y+=1;if(“left”===x){y-=1;break}for(;y<g&&c[y]&&"align"!==c[y].type;)y+=1;var S=e(c.slice(T,y)),k="";switch(x){case"center":k+=p+"margin-left: auto; margin-right: auto;";break;case"justify":case"right":k+="text-align: "+x+";";break;default:+x&&(k+=p+"margin-left: "+x+"%;")}d+="”+S+”\n”,m=c[y]}break;case”column”:for(var O=[];m&&”column”===m.type;){var j=m,A=j.column,C=y+=1;if(“none”===A){y-=1;break}for(;y<g&&c[y]&&"column"!==c[y].type;)y+=1;O.push({text:m.text,type:A,body:e(c.slice(C,y)),width:m.width,marginLeft:m.marginLeft,marginRight:m.marginRight}),m=c[y]}O.length&&function(){var e=O.reduce(function(e,t){return e+t.width},0);d+="”+O.map(function(t){return””+t.body+”\n”}).join(“”)+””}();break;case”heading”:d+=o(m,”h”+m.depth);break;case”br”:if(!h.length||/td|th/.test(h[0])){d+=”
“;for(var E=c[y+1];E&&(“br”===E.type||”tag”===E.type&&/^<br\b/i.test(E.text));)d+="
“,y+=1,E=c[y+1]}break;case”hr”:d+=”
“;break;case”escapedLine”:case”comment”:break;case”inlineUrl”:d+=’‘+m.text+”“;break;case”scriptStyleTag”:case”tag”:var N=m.text.toLowerCase();/^<\/?(?:table|thead|tbody|tr|tfoot|td|th)\b/.test(N)&&h[m.text.startsWith("</")?"shift":"unshift"](N),d+=m.text.startsWith("$/,” data-raw>”);break;case”sub”:case”sup”:case”strong”:case”em”:d+=o(m,m.type);break;case”strike”:d+=o(m,”s”);break;case”bold”:d+=o(m,”b”);break;case”italic”:d+=o(m,”i”);break;case”twineLink”:var _=_slicedToArray(t.lex(“(link-goto:”+u(m.innerText)+”,”+u(m.passage)+”)”).children,1),P=_[0];d+=”;break;case”hook”:d+=”‘;break;case”unclosedHook”:return d+=”‘;case”verbatim”:d+=i(s(m.innerText).replace(/\n/g,”
“),”tw-verbatim”);break;case”collapsed”:d+=o(m,”tw-collapsed”);break;case”variable”:case”tempVariable”:case”macro”:var I=”macro”===m.type?a(m):[],M=I.map(function(e){var t=n(e);return e.type=”blockedValue”,t});d+=”,I.forEach(function(e){return e.type=”macro”});break;default:d+=m.children&&m.children.length?e(m.children):m.text}}return d}},Object.freeze(f)}),define(“internaltypes/changedescriptor”,[“jquery”,”utils”,”renderer”,”datatypes/hookset”],function(e,t,n,r){var i=t.assertOnlyHas,o=t.impossible,a=t.transitionIn,s=n.exec,c=void 0,u={source:””,innerSource:””,enabled:!0,target:null,append:”append”,newTargets:null,transition:”instant”,transitionTime:null,transitionDeferred:!1,loopVars:null,styles:null,attr:null,data:null,section:null,summary:function(){var e=this;return[“source”,”innerSource”,”enabled”,”target”,”append”,”newTargets”,”transition”,”transitionTime”].filter(function(t){return e.hasOwnProperty(t)}).concat([this.attr.length&&”attr”,this.styles.length&&”styles”,Object.keys(this.loopVars).length&&”loopVars”,Object.keys(this.data).length&&”data”].filter(Boolean))},create:function(e,t){var n=Object.assign(Object.create(this),{attr:[].concat(this.attr||[]),styles:[].concat(this.styles||[]),loopVars:this.loopVars||{},data:this.data||{}},e);return t&&t.run(n),n},update:function(){var e=this,t=this.section,n=this.newTargets,i=this.target,o=function(t){if(Array.isArray(e.styles)&&e.styles.length>0){var n=e.styles.reduce(function(e,t){return Object.keys(t).forEach(function(n){var r=t[n];e[+(“function”==typeof r)][n]=r}),e},[{},{}]),r=_slicedToArray(n,2),i=r[0],o=r[1];t.css(i),setTimeout(function(){return t.css(o)})}e.attr&&e.attr.forEach(function(e){return t.attr(e)}),e.data&&t.data(e.data)};Array.isArray(n)&&n.length&&(i=n.map(function(e){return e.target})),[].concat(i).forEach(function(e){r.isPrototypeOf(e)?e.forEach(t,o):o(e)})},render:function(){var t=this,n=this.source,l=this.transition,f=this.transitionTime,p=this.transitionDeferred,d=this.enabled,h=this.data,g=this.section,y=this.newTargets,m=this.target,v=this.target,b=this.append;if(i(this,c),!d||void 0!==m.popAttr(“hidden”))return u.create({target:m,data:Object.assign({},h,{hiddenSource:n})}).update(),e();if(Array.isArray(y)&&y.length&&(m=y),!m)return o(“ChangeDescriptor.render”,”ChangeDescriptor has source but not a target!”),e();var w=e();if([].concat(m).filter(function(e){return!e.jquery}).map(function(e){var t=b,n=void 0;if(e.target&&e.append){var r=e;t=r.append,n=r.before,e=e.target}return{elements:e.hooks(g,v).filter(function(){return!(n&&1&this.compareDocumentPosition(document)&&2&this.compareDocumentPosition(v[0]))}),append:t}},[]).forEach(function(n){var r=n.elements,i=n.append;r.each(function(n,r){r=e(r),w=w.add(t.create({target:r,append:i,newTargets:null}).render()),r.filter(“tw-pseudo-hook”).contents().unwrap()})}),w.length||Array.isArray(m)||r.isPrototypeOf(m))return w;if(!(b in m)){if(“replace”!==b)return o(“Section.render”,”The target doesn’t have a ‘”+b+”‘ method.”),e();m[0]instanceof Text?b=”replaceWith”:(m.empty(),b=”append”)}return m[0]instanceof Text&&(“append”===b&&(b=”after”),”prepend”===b&&(b=”before”)),w=e(n&&e.parseHTML(s(n),document,!0)),m[b](w.length?w:void 0),this.update(),l&&!p&&a(“replace”===b?m:w,l,f),w}};return c=Object.keys(u),Object.seal(u)}),define(“datatypes/changercommand”,[“utils”,”utils/operationutils”,”internaltypes/changedescriptor”,”internaltypes/twineerror”],function(e,t,n,r){var i=e.impossible,o=t.is,a={},s={changer:!0,TwineScript_TypeName:”a changer command”,TwineScript_Print:function(){return”`[A (‘”+this.macroName+”‘:) command]`”},summary:function(){var e=n.create();return this.run(e),e.summary()},create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Array.isArray(t)||i(“ChangerCommand.create”,”params was not an array”),Object.assign(Object.create(this),{macroName:e,params:t,next:n,TwineScript_ObjectName:”a (“+e+”:) command”})},”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){if(s.isPrototypeOf(e))return this.macroName===e.macroName&&o(this.params,e.params)&&o(this.next,e.next)},TwineScript_Clone:function(){return this.create(this.macroName,this.params,this.next)},run:function(e){var t=a[this.macroName].apply(a,[e].concat(_toConsumableArray(this.params)));if(r.containsError(t))return t;this.next&&this.next.run(e)},register:function(e,t){a[e]=t}};return Object.freeze(s)}),define(“state”,[“utils”,”passages”,”datatypes/changercommand”,”internaltypes/twineerror”,”utils/operationutils”],function(e,t,n,r,i){function o(){if(m.hasSessionStorage){var e=m.serialise();if(“string”==typeof e)try{sessionStorage.setItem(“Saved Session”,e)}catch(e){return}}}function a(e){h=(p[d]||f).create(e),o()}var s=e.impossible,c=i.objectName,u=[“localStorage”,”sessionStorage”].map(function(e){try{return!!window[e]&&function(){return window[e].setItem(“test”,”1″),window[e].removeItem(“test”),!0}()}catch(e){return!1}}),l={TwineScript_ObjectName:”this story’s variables”,TwineScript_VariableStore:!0},f={passage:””,variables:l,create:function(e,t){var n=Object.create(f);return n.passage=e||””,n.variables=Object.assign(Object.create(this.variables),t),n}},p=[],d=-1,h=f.create(),g=void 0,y={forward:[],back:[],load:[]},m=void 0;return m=Object.assign({get passage(){return h.passage},get variables(){return h.variables},get pastLength(){return d},get futureLength(){return p.length-1-d},passageNameVisited:function(e){var n=0;if(!t.get(e))return 0;for(var r=0;r0;n–)if(p[n].passage===e)return d-n+1;return 1/0},pastPassageNames:function(){for(var e=[],t=d-1;t>=0;t–)e.unshift(p[t].passage);return e},play:function(e){h||s(“State.play”,”present is undefined!”),h.passage=e,p=p.slice(0,d+1).concat(h),d+=1,a(e),y.forward.forEach(function(t){return t(e)})},rewind:function(e){var t=1,n=!1;if(e)if(“string”==typeof e){if((t=this.passageNameLastVisited(e))===1/0)return}else”number”==typeof e&&(t=e);for(;t>0&&d>0;t–)n=!0,d-=1;return n&&(a(p[d].passage),y.back.forEach(function(e){return e()})),n},fastForward:function(e){var t=1,n=!1;for(“number”==typeof e&&(t=e);t>0&&p.length>0;t–)n=!0,d+=1;return n&&(a(p[d].passage),y.forward.forEach(function(e){return e(p[d].passage,”fastForward”)})),n},on:function(e,t){return e in y?(“function”!=typeof t||y[e].includes(t)||y[e].push(t),m):void s(“State.on”,”invalid event name”)},reset:function(){window.jasmine&&(p=[],d=-1,h=f.create(),g=void 0,y.load.forEach(function(e){return e(p)}))},hasStorage:u[0],hasSessionStorage:u[1]},function(){function e(t){return”number”==typeof t||”boolean”==typeof t||”string”==typeof t||null===t||Array.isArray(t)&&t.every(e)||t instanceof Set&&Array.from(t).every(e)||t instanceof Map&&Array.from(t.values()).every(e)||n.isPrototypeOf(t)}function i(e,t){return t instanceof Set?{“(dataset:)”:Array.from(t)}:t instanceof Map?{“(datamap:)”:Array.from(t)}:n.isPrototypeOf(t)?{changer:{name:t.macroName,params:t.params,next:t.next}}:t}function o(e,t){if(t&&”object”===(void 0===t?”undefined”:_typeof(t))){if(Array.isArray(t[“(dataset:)”]))return new Set(t[“(dataset:)”]);if(Array.isArray(t[“(datamap:)”]))return new Map(t[“(datamap:)”]);if(t.changer&&”object”===_typeof(t.changer)){var r=t.changer,i=r.name,o=r.params,a=r.next;return n.create(i,o,a)}}return t}function s(){var t=p.slice(0,d+1),n=t.map(function(t){return Object.keys(t.variables).filter(function(n){return t.variables[n]&&!e(t.variables[n])}).map(function(e){return[e,t.variables[e]]})});if(g||(g=n.reduce(function(e,t,n){var r=_slicedToArray(t,2),i=r[0],o=r[1];return e||i&&[i,o,n+1]},void 0)),g){var o=g,a=_slicedToArray(o,3),s=a[0],u=a[1],l=a[2];return r.create(“saving”,”The variable $”+s+” holds “+c(u)+” (which is, or contains, a complex data value) on turn “+l+”; the game can no longer be saved.”)}try{return JSON.stringify(t,i)}catch(e){return!1}}function u(e){var n=void 0,r=l,i=”The save data is unintelligible.”;try{n=JSON.parse(e,o)}catch(e){return Error(i)}if(!Array.isArray(n))return Error(i);var s=void 0;return(s=(n=n.map(function(e){return”object”===(void 0===e?”undefined”:_typeof(e))&&e.hasOwnProperty(“passage”)&&e.hasOwnProperty(“variables”)?t.hasValid(e.passage)?(e.variables=Object.assign(Object.create(r),e.variables),r=e.variables,Object.assign(Object.create(f),e)):Error(“The data refers to a passage named ‘”+e.passage+”‘, but it isn’t in this story.”):Error(i)})).find(function(e){return e instanceof Error}))?s:(p=n,y.load.forEach(function(e){return e(p)}),d=p.length-1,a(p[d].passage),!0)}return{serialise:s,deserialise:u}}()),Object.seal(f),Object.freeze(m)}),define(“datatypes/colour”,[“jquery”],function(e){function t(t){if(t in s)return s[t];var n=e(““).css(“background-color”,t).css(“background-color”);return n=n.startsWith(“rgb”)?n.match(/\d+/g).reduce(function(e,t,n){return e[“rgb”[n]]=+t,e},{}):{r:192,g:192,b:192},s[t]=n,n}function n(e){return”string”!=typeof e?e:(e=e.replace(“#”,””),e=e.replace(o,”$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 r(e){var t=e.r,n=e.g,r=e.b,i=e.a;t/=255,n/=255,r/=255;var o=Math.max(t,n,r),a=Math.min(t,n,r),s=(o+a)/2,c=o-a;if(o===a)return{h:0,s:0,l:s};var u=void 0;switch(o){case t:u=(n-r)/c+(n.5?c/(2-o-a):c/(o+a),l:s,a:i}}function i(e){function t(e){return e1&&(e-=1),e<1/6?c+6*(s-c)*e:e<.5?s:e<2/3?c+(s-c)*(2/3-e)*6:c}var n=e.h,r=e.s,i=e.l,o=e.a;if(0===r){var a=Math.floor(255*i);return{r:a,g:a,b:a}}n/=360;var s=i<.5?i*(1+r):i+r-i*r,c=2*i-s;return{r:Math.floor(255*t(n+1/3)),g:Math.floor(255*t(n)),b:Math.floor(255*t(n-1/3)),a:o}}var o=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,a=/^([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])([\da-fA-F])$/,s=Object.create(null),c=Object.freeze({TwineScript_TypeName:"a colour",TwineScript_ObjectName:"a colour",TwineScript_DebugName:function(){return"a colour "+this.TwineScript_Print()},"TwineScript_+":function(e){var t=this,n=e;return c.create({r:Math.min(Math.round(.6*(t.r+n.r)),255),g:Math.min(Math.round(.6*(t.g+n.g)),255),b:Math.min(Math.round(.6*(t.b+n.b)),255),a:(t.a+n.a)/2})},TwineScript_Print:function(){return"“},TwineScript_is:function(e){return c.isPrototypeOf(e)&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a},TwineScript_Clone:function(){return c.create(this)},toRGBAString:function(){return”rgba(“+this.r+”, “+this.g+”, “+this.b+”, “+this.a+”)”},TwineScript_GetProperty:function(e){return”h”===e||”s”===e||”l”===e?r(this)[e]:”r”===e||”g”===e||”b”===e?this[e]:void 0},TwineScript_Properties:[“h”,”s”,”l”,”r”,”g”,”b”],create:function(e){return”string”==typeof e?c.isHexString(e)?this.create(n(e)):this.create(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),Object.assign(Object.create(this),e)):this.create(i(e))},isHexString:function(e){return”string”==typeof e&&”#”===e[0]&&(e.slice(1).match(o)||e.slice(1).match(a))},isCSS3Function:function(e){return”string”==typeof e&&/^(?:rgb|hsl)a?\(\s*\d+\s*,\s*\d+%?\s*,\s*\d+%?(?:,\s*\d+(?:\.\d+)?\s*)?\)$/.test(e)}});return c}),define(“datatypes/gradient”,[],function(){var e=Object.freeze({TwineScript_TypeName:”a gradient”,TwineScript_ObjectName:”a gradient”,TwineScript_DebugName:function(){return”a gradient “+this.TwineScript_Print()},TwineScript_GetProperty:function(e){return”angle”===e?this.angle:”stops”===e?this.stops.map(function(e){return new Map([[“percent”,e.stop],[“colour”,e.colour.TwineScript_Clone()]])}):void 0},TwineScript_Properties:[“angle”,”stops”],TwineScript_is:function(e){var t=this;return e.angle===this.angle&&e.stops.length===this.stops.length&&e.stops.every(function(e,n){var r=e.colour,i=e.stop;return t.stops[n].stop===i&&t.stops[n].colour.TwineScript_is(r)})},TwineScript_Clone:function(){return e.create(this.angle,[].concat(_toConsumableArray(this.stops)))},TwineScript_Print:function(){return””},create:function(e,t){return Object.assign(Object.create(this),{angle:e,stops:t.sort(function(e,t){return e.stop-t.stop})})},toLinearGradientString:function(){return”linear-gradient(“+this.angle+”deg, “+this.stops.reduce(function(e,t){var n=t.colour,r=t.stop;return e+n.toRGBAString()+” “+100*r+”%,”},””).slice(0,-1)+”)”}});return e}),define(“internaltypes/varref”,[“state”,”internaltypes/twineerror”,”utils”,”utils/operationutils”,”datatypes/hookset”,”datatypes/colour”,”datatypes/gradient”],function(e,t,n,r,i,o,a){function s(e,n){var r=void 0;if(e instanceof Map&&(r=t.containsError(A(e,n))))return r;if(T(e)){var o=void 0,a=”You can only access position strings/numbers (‘4th’, ‘last’, ‘2ndlast’, (2), etc.) or slices (‘1stTo2ndlast’, ‘3rdTo5th’), “;if(“number”==typeof n){if(0===n)return t.create(“property”,”You can’t access elements at position 0 of “+S(e)+”.”,”Only positive and negative position values exist.”);n>0&&(n-=1)}else if(“string”==typeof n&&(o=/^(\d+)(?:st|[nr]d|th)last$/i.exec(n)))n=-o[1];else if(“string”==typeof n&&(o=/^(\d+)(?:st|[nr]d|th)$/i.exec(n)))n=o[1]-1;else if(“string”==typeof n&&(o=/^(?:(\d+)(?:st|[nr]d|th)(last)?|last)to(?:(\d+)(?:st|[nr]d|th)(last)?|last)$/i.exec(n))){var s=o,c=_slicedToArray(s,5),u=c[1],l=void 0===u?0:u,f=c[2],p=c[3],d=void 0===p?0:p,h=c[4];l=f?-l:l-1,d=h?-d:d-1,n={last:d,first:l}}else if(“last”===n)n=-1;else{if(i.isPrototypeOf(e)&&!i.TwineScript_Properties.includes(n))return t.create(“property”,a+w(i.TwineScript_Properties.map(function(e){return”‘”+e+”‘”}))+” of “+S(e)+”, not “+S(n)+”.”);if(![“length”,”any”,”all”].includes(n)&&!i.isPrototypeOf(e))return t.create(“property”,a+”‘length’, ‘any’ and ‘all’ of “+S(e)+”, not “+S(n)+”.”)}}else if(e instanceof Set){if(![“length”,”any”,”all”].includes(n))return t.create(“property”,”You can only get the ‘length’, ‘any’ and ‘all’ of “+S(e)+”.”,”To check contained values, use the ‘contains’ operator.”);”length”===n&&(n=”size”)}else{if(Array.isArray(e.TwineScript_Properties)&&!e.TwineScript_Properties.includes(n))return t.create(“property”,”You can only get the “+w(e.TwineScript_Properties.map(function(e){return”‘”+e+”‘”}))+” of “+S(e)+”, not “+S(n)+”.”);if(“number”==typeof e||”boolean”==typeof e)return t.create(“property”,”You can’t get data values from “+S(e)+”.”)}return n}function c(e,n){return{compiledPropertyChain:n.reduce(function(r,i,o){i.computed&&(i=i.value),E.isPrototypeOf(i)&&(i=i.get()),i=Array.isArray(i)?i.map(function(t){return s(e,t)}):s(e,i);var a=void 0;return(a=t.containsError(r,i))?a:(o<n.length-1&&(e=m(e,i)),r.push(i),r)},[]),deepestObject:e}}function u(e,t){return t-0<0&&Math.abs(t)=0),s+(s>=0))}if(Array.isArray(r))return i.isPrototypeOf(n)?n.TwineScript_GetProperty(r):r.map(function(e){return m(n,e,e)})[“string”==typeof n?”join”:”valueOf”](“”);”string”==typeof n&&(n=[].concat(_toConsumableArray(n)));var c=f(n,r);return void 0===c?n===e.variables?N:n.TwineScript_VariableStore?t.create(“property”,”There isn’t a temp variable named _”+o+” in this place.”,”Temp variables only exist inside the same passage and hook in which they’re (set:).”):t.create(“property”,”I can’t find a “+p(o)+” data name in “+S(n)):c}function v(e,n){var r=this,i=this.compiledPropertyChain.reduce(function(e,t){var n=void 0;return n=0===e.length?r.object:m.apply(void 0,_toConsumableArray(e[e.length-1])),e.push([n,t])&&e},[]).reduceRight(e,n);return t.containsError(i)?i:void 0}var b=n.impossible,w=n.andList,x=r.isObject,T=r.isSequential,S=r.objectName,k=r.typeName,O=r.clone,j=r.numericIndex,A=r.isValidDatamapName,C=r.subset,E=void 0,N=0,_={set:[],delete:[]};return E=Object.freeze({varref:!0,get:function(){return m(this.deepestObject,this.compiledPropertyChain.slice(-1)[0],this.propertyChain.slice(-1)[0])},set:function(e){return!this.object||this.object.TwineScript_VariableStore||this.object.TwineScript_Identifiers?v.call(this,function(e,n,r){var i=_slicedToArray(n,2),o=i[0],a=i[1],s=void 0;if(s=t.containsError(e,o,a)||t.containsError(d(o,a)))return s;if(e&&e.TwineScript_Unstorable)return t.create(“operation”,k(e)+” can’t be stored.”);if(r>0&&(o=O(o)),”string”==typeof o){if(“string”!=typeof e||e.length!==(Array.isArray(a)?a.length:1))return t.create(“datatype”,”I can’t put this non-string value, “+S(e)+”, in a string.”);o=[].concat(_toConsumableArray(o));var c=[].concat(_toConsumableArray(e));[].concat(a).forEach(function(e){0+e0&&(o=O(o)),null===e){var c=”string”==typeof o;c&&(o=[].concat(_toConsumableArray(o))),Array.isArray(a)?(T(o)&&(a=[].concat(_toConsumableArray(new Set(a))),a.sort(function(e,t){return u(o,t)-u(o,e)})),a.forEach(function(e){return g(o,e)})):g(o,a),c&&(o=o.join(“”))}else h(o,a,e);return o},null)},create:function(e,n){var r=void 0;if(r=t.containsError(e))return y(r);n=[].concat(n),E.isPrototypeOf(e)&&(n=e.propertyChain.concat(n),e=e.object);var i=c(e,n),o=i.compiledPropertyChain,a=i.deepestObject;return(r=t.containsError(o,a))?y(r):Object.assign(Object.create(E),{object:e,propertyChain:n,compiledPropertyChain:o,deepestObject:a})},get TwineScript_ObjectName(){var t=this,n=function(n,r){return r||t.object!==e.variables&&!t.object.TwineScript_VariableStore?p(n):n};return(this.object===e.variables?”$”:this.object.TwineScript_VariableStore?”_”:S(this.object)+”‘s “)+(1===this.propertyChain.length?n(this.propertyChain[0]):this.propertyChain.reduce(function(e,t,r){return e+”‘s “+n(t,r)}))+(this.object.TwineScript_VariableStoreName?” in “+this.object.TwineScript_VariableStoreName:””)},on:function(e,t){return e in _?(“function”!=typeof t||_[e].includes(t)||_[e].push(t),E):void b(“VarRef.on”,”invalid event name”)}})}),define(“internaltypes/varscope”,[],function(){return{TwineScript_ObjectName:”the temporary variables”,TwineScript_VariableStore:!0}}),define(“datatypes/lambda”,[“utils”,”utils/operationutils”,”internaltypes/varscope”,”internaltypes/twineerror”],function(e,t,n,r){var i=e.toJSLiteral,o=e.insensitiveName,a=(e.plural,t.typeName,t.objectName,t.singleTypeCheck,Object.freeze({lambda:!0,TwineScript_TypeName:”a lambda”,get TwineScript_ObjectName(){return’a “‘+(“making”in this?”making … “:””)+(“with”in this?”with … “:””)+(“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},TypeSignature:function(e){return{pattern:”lambda”,innerType:a,clauses:e,typeName:’a “‘+e.split().concat(“”).join(” …”)+'” lambda’}},create:function(e,t,i){var s=void 0;if(r.containsError(e))return e;if(a.isPrototypeOf(e)){if(“when”===t||”when”in e)return r.create(“syntax”,”A ‘when’ lambda cannot have any other clauses, such as ‘”+t+”‘.”);if(t in e&&(“where”!==t||”true”!==e[t]))return r.create(“syntax”,”This lambda has two ‘”+t+”‘ clauses.”);s=e}else{if(“when”===t&&void 0!==e)return r.create(“syntax”,”A ‘when’ lambda shouldn’t begin with a temporary variable (just use ‘when’ followed by the condition).”);if(void 0!==e&&(!e||!e.varref||!n.isPrototypeOf(e.object)||e.propertyChain.length>1))return r.create(“syntax”,”This lambda needs to start with a single temporary variable.”);s=Object.create(this),s.loop=e?e.propertyChain[0]:””}s[t]=i;var c=[s.making,s.with,s.loop].filter(function(e,t,n){return e&&n.indexOf(o(e))!==t});return c.length?r.create(“syntax”,”This lambda has two variables named ‘”+c[0]+”‘.”,”Lambdas should have all-unique parameter names.”):s},apply:function(e,t){var o=t.loop,a=t.with,s=t.making,c=t.fail,u=t.pass,l=t.ignoreVia,f=t.tempVariables;f=f||Object.create(e.stack.length?e.stack[0].tempVariables:n),[[this.loop,o],[this.with,a],[this.making,s]].forEach(function(e){var t=_slicedToArray(e,2),n=t[0],r=t[1];return n&&(f[n]=r)}),e.stack.unshift(Object.assign(Object.create(null),{tempVariables:f})),!o||this.with||this.making||this.when?e.eval(“Operations”).initialiseIt(r.create(“operation”,”I can’t use ‘it’, or an implied ‘it’, in “+this.TwineScript_ObjectName)):e.eval(“Operations”).initialiseIt(o);var p=!l&&this.via,d=e.eval(“where”in this||”when”in this?”Operations.where(“+(this.where||this.when)+”,”+(p||i(u))+”,”+i(c)+”)”:p||i(u));return e.stack.shift(),d},filter:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=void 0,a=t.reduce(function(t,a){if(o=r.containsError(t))return o;var s=n.apply(e,{loop:a,pass:!0,fail:!1,ignoreVia:!0,tempVariables:i});return(o=r.containsError(s))?o:t.concat(s?[a]:[])},[]);return(o=r.containsError(a))?o:a}}));return a}),define(“macros”,[“jquery”,”utils/naturalsort”,”utils”,”utils/operationutils”,”datatypes/changercommand”,”datatypes/lambda”,”datatypes/hookset”,”internaltypes/changedescriptor”,”internaltypes/twineerror”],function(e,t,n,r,i,o,a,s,c){function u(e){return function(n){n=n.reduce(function(e,n){if(n&&!0===n.spreader){var r=n.value,i=c.containsError(r);if(i)return i;if(Array.isArray(r)||”string”==typeof r)for(var o=0;o1?e[0]:e)+”:)”;var r=void 0;return r=n.length>0?”The “+e+” macro must only be given “+g(n.map(v))+(n.length>1?”, in that order”:”.”):”The macro must not be given any data – just write “+e+”.”,function(i){for(var a=arguments.length,s=Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];for(var l=void 0,f=0,p=Math.max(s.length,n.length);f
=n.length&&!l?{v:c.create(“datatype”,s.length-n.length+” too many values were given to this “+e+” macro.”,r)}:(a||(a=l),!a.innerType||”rest”!==a.pattern&&”zero or more”!==a.pattern||(l=a.innerType,”rest”===a.pattern&&(a=a.innerType)),b(u,a)?void 0:void 0===u?{v:c.create(“datatype”,”The “+e+” macro needs “+h(n.length-t,”more value”)+”.”,r)}:u&&u.TwineScript_Unstorable&&(a===w.TypeSignature.Any||a.innerType&&a.innerType===w.TypeSignature.Any)?{v:c.create(“datatype”,e+”‘s “+d(t+1)+” value, “+m(u)+”, is not valid data for this macro.”,r)}:u&&o.isPrototypeOf(u)&&”lambda”===a.pattern?{v:c.create(“datatype”,e+”‘s “+d(t+1)+” value (a lambda) should have “+g([“where”,”when”,”making”,”via”,”with”].filter(function(e){return a.clauses.includes(e)}).map(function(e){return”a ‘”+e+”‘ clause”}))+”, not “+g([“where”,”when”,”making”,”via”,”with”].filter(function(e){return e in u}).map(function(e){return”a ‘”+e+”‘ clause”}))+”.”)}:{v:c.create(“datatype”,e+”‘s “+d(t+1)+” value is “+m(u)+”, but should be “+v(a)+”.”,a.message||r)})}(f);if(“object”===(void 0===y?”undefined”:_typeof(y)))return y.v}return t.apply(void 0,[i].concat(s))}}function f(e,t){Array.isArray(e)?e.forEach(function(e){return y(x,p(e),t)}):y(x,p(e),t)}var p=n.insensitiveName,d=n.nth,h=n.plural,g=n.andList,y=n.lockProperty,m=r.objectName,v=r.typeName,b=r.singleTypeCheck,w=void 0,x={},T=function(e,t,n,r){return function(){for(var i=arguments.length,o=Array(i),a=0;a4&&void 0!==arguments[4])||arguments[4],a=[].concat(t)[0];return f(t,u(l(t,T(a,n,r,o),i))),e},TypeSignature:{optional:function(e){return{pattern:”optional”,innerType:e}},zeroOrMore:function(e){return{pattern:”zero or more”,innerType:e}},either:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:”one way”;return n.isPrototypeOf(e)||e.varref?Object.assign(Object.create(this),{varRef:e,bind:t}):r.create(“operation”,”I can only ‘bind’ a variable, not “+i(e)+”.”)}})}),define(“datatypes/assignmentrequest”,[“utils”],function(e){var t=e.assertMustHave;return Object.freeze({assignmentRequest:!0,TwineScript_TypeName:”a ‘to’ or ‘into’ expression”,TwineScript_ObjectName:”a ‘to’ or ‘into’ expression”,TwineScript_Unstorable:!0,create:function(e,n,r){return t(e,[“varref”]),Object.assign(Object.create(this),{dest:e,src:n,operator:r})}})}),define(“twinescript/operations”,[“jquery”,”state”,”datatypes/assignmentrequest”,”utils/operationutils”,”internaltypes/twineerror”],function(e,t,n,r,i){function o(e,t,n,r){return n=n||”do this to”,function(o,a){1===t.length&&(a=o);var s=void 0;return(s=i.containsError(o,a))?s:(void 0===o?”undefined”:_typeof(o))!==e||(void 0===a?”undefined”:_typeof(a))!==e?i.create(“operation”,”I can only “+n+” “+e+”s, not “+y((void 0===o?”undefined”:_typeof(o))!==e?o:a)+”.”,r):t(o,a)}}function a(e){return function(t,n){var r=void 0;return(r=i.containsError(t,n))?r:t&&t.varref?i.create(“operation”,”I can’t give an expression a new value.”):(void 0===t?”undefined”:_typeof(t))!==(void 0===n?”undefined”:_typeof(n))||c(t)&&”TwineScript_TypeName”in t&&c(n)&&”TwineScript_TypeName”in n&&t.TwineScript_TypeName!==n.TwineScript_TypeName||u(t)!==u(n)?i.create(“operation”,y(t)+” isn’t the same type of data as “+y(n)):e(t,n)}}function s(e){return function t(n,r){var o=void 0;if(o=i.containsError(n,r))return o;if(v=n,n.determiner){var a=”all”===n.determiner;return n.array.reduce(function(e,n){var o=void 0,s=t(n,r);return(o=i.containsError(e,s))?o:a?e&&s:e||s},a)}if(r.determiner){var s=”all”===r.determiner;return r.array.reduce(function(e,r){var o=void 0,a=t(n,r);return(o=i.containsError(e,a))?o:s?e&&a:e||a},s)}return e(n,r)}}var c=r.isObject,u=r.collectionType,l=r.is,f=r.isA,p=r.clone,d=r.unique,h=r.contains,g=r.matches,y=(r.typeName,r.objectName),m=void 0,v=0,b=”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 \”\” ‘.”;return m={create:function(n){var r=Object.create(this);return r.Identifiers={TwineScript_Identifiers:!0,get it(){return v},get time(){return Date.now()-n.timestamp},get visits(){return t.pastPassageNames().filter(function(e){return e===t.passage}).length+1},get visit(){return r.Identifiers.visits},get exits(){return n.dom.find(“tw-enchantment, tw-link”).filter(function(t,n){return e(n).data(“enchantmentEvent”)||e(n).parent().data(“linkPassageName”)||e(n).parent().data(“clickEvent”)}).length},get exit(){return r.Identifiers.exits}},r},elidedComparisonOperator:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return r.reduce(function(n,r){return"boolean"==typeof r?r:m[e](n,m[t](v,r))},"and"===e)},and:o("boolean",a(function(e,t){return e&&t}),"use 'and' to join",b),or:o("boolean",a(function(e,t){return e||t}),"use 'or' to join",b),not:o("boolean",function(e){return!e},"use 'not' to invert",b),"+":a(function(e,t){if(Array.isArray(e))return[].concat(_toConsumableArray(e),_toConsumableArray(t));var n=void 0;return 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(d).map(p)):"function"==typeof e["TwineScript_+"]?e["TwineScript_+"](t):"string|number|boolean".includes(void 0===e?"undefined":_typeof(e))?e+t:i.create("operation","I can't use + on "+y(e)+".")}),"-":a(function(e,t){if(Array.isArray(e))return e.filter(function(e){return!t.some(function(t){return l(e,t)})});if(e instanceof Set){var n=[].concat(_toConsumableArray(t));return new Set([].concat(_toConsumableArray(e)).filter(function(e){return!n.some(function(t){return l(e,t)})}))}return"string"==typeof e?e.split(t).join(""):"number"==typeof e?e-t:i.create("operation","I can't use – on "+y(e)+".")}),"*":o("number",a(function(e,t){return e*t}),"multiply"),"/":o("number",a(function(e,t){return 0===t?i.create("operation","I can't divide "+y(e)+" by zero."):e/t}),"divide"),"%":o("number",a(function(e,t){return 0===t?i.create("operation","I can't modulo "+y(e)+" by zero."):e%t}),"modulus"),"<":s(o("number",a(function(e,t){return e<t}),"do “:s(o(“number”,a(function(e,t){return e>t}),”do > to”)),”<=":s(o("number",a(function(e,t){return e<=t}),"do =”:s(o(“number”,a(function(e,t){return e>=t}),”do >= to”)),is:s(l),isNot:s(function(e,t){return!m.is(e,t)}),contains:s(h),isIn:s(function(e,t){return h(t,e)}),isA:s(f),isNotA:s(function(e,t){return!f(e,t)}),typifies:s(function(e,t){return f(t,e)}),untypifies:s(function(e,t){return!f(t,e)}),matches:s(g),where:function(e,t,n){var r=void 0;return(r=i.containsError(e))?r:”boolean”!=typeof e?i.create(“operation”,”This lambda’s ‘where’ clause must evaluate to true or false, not “+y(e)+”.”):e?t:n},makeSpreader:function(e){return{value:e,spreader:!0}},makeAssignmentRequest:function(e,t,r){var o=i.containsError(e,t);return o||(c(e)&&”varref”in e?n.create(e,t,r):i.create(“operation”,”I can’t store a new value inside “+y(e)+”.”))},setIt:function(e){return i.containsError(e)?e:e.varref?(v=e.get(),e):i.create(“operation”,”I can’t put a new value into “+y(e)+”.”)},initialiseIt:function(e){v=e}},Object.freeze(m)}),define(“twinescript/environ”,[“macros”,”state”,”utils”,”datatypes/colour”,”datatypes/hookset”,”datatypes/lambda”,”datatypes/datatype”,”datatypes/varbind”,”internaltypes/varref”,”internaltypes/twineerror”,”twinescript/operations”],function(Macros,State,Utils,Colour,HookSet,Lambda,Datatype,VarBind,VarRef,TwineError,OperationsProto){return function(section){“object”===(void 0===section?”undefined”:_typeof(section))&§ion||Utils.impossible(“TwineScript.environ”,”no Section argument was given!”);var Operations=OperationsProto.create(section);return section.eval=function(){try{for(var _len7=arguments.length,args=Array(_len7),_key7=0;_key7<_len7;_key7++)args[_key7]=arguments[_key7];return eval(args.join(""))}catch(e){return e}},section}}),define("internaltypes/twinenotifier",["jquery","utils"],function(e,t){var n=t.impossible,r={create:function(e){return e||n("TwineNotifier.create","called with only 1 string."),Object.assign(Object.create(r),{message:e})},render:function(){return e("”).attr(“message”,this.message)}};return r}),define(“section”,[“jquery”,”utils”,”utils/selectors”,”renderer”,”twinescript/environ”,”twinescript/operations”,”state”,”utils/operationutils”,”datatypes/changercommand”,”datatypes/hookset”,”datatypes/colour”,”internaltypes/changedescriptor”,”internaltypes/varscope”,”internaltypes/twineerror”,”internaltypes/twinenotifier”],function(e,t,n,r,i,o,a,s,c,u,l,f,p,d,h){function g(e,n,r){if(n&&”object”===(void 0===n?”undefined”:_typeof(n))&&c.isPrototypeOf(n)){if(!this.renderInto(r.popAttr(“source”),r,n)){var i=t.insensitiveName(e.attr(“name”));if([“if”,”elseif”,”unless”,”else”].includes(i)&&(e.addClass(“false”),”elseif”!==i&&(this.stack[0].lastHookShown=!1)),r.data(“live”)){var o=r.data(“live”),a=o.delay,s=o.event;x.call(this,e,r,a,s)}return}}else{if(!1===n)return r.attr(“source”)&&r.data(“hiddenSource”,r.popAttr(“source”)),e.addClass(“false”),void(this.stack[0].lastHookShown=!1);!0!==n&&e.replaceWith(d.create(“datatype”,S(n)+” cannot be attached to this hook.”,”Only Booleans, changer commands, and the (live:) macro can be attached to hooks.”).render(e.attr(“title”)))}this.stack[0].lastHookShown=!0}function y(t){var n=t instanceof e?t[0]:t,r=n.nextSibling;if(r&&(r instanceof Text&&!r.textContent.trim()||”br”===(r.tagName||””).toLowerCase())){var i=y(r),o=i.whitespace,a=i.nextElem;return{whitespace:e(r).add(o),nextElem:a}}return{whitespace:e(),nextElem:e(r)}}function m(r){var i=this.eval(r.popAttr(“js”)||””);this.stackTop.evaluateOnly&&i&&(c.isPrototypeOf(i)||”function”==typeof i.TwineScript_Run)&&(i=d.create(“syntax”,”I can’t work out what this “+this.stackTop.evaluateOnly+” should evaluate to, because it contains a “+c.isPrototypeOf(i)?”changer”:”command.”,”Please rewrite this without putting changers or commands here.”));var a=void 0,s=void 0,u=e();for(s=r;c.isPrototypeOf(i);){var p=y(s);if(a=p.whitespace,s=p.nextElem,s[0]instanceof Text&&”+”===s[0].textContent.trim()){var m=void 0,v=s,b=y(v);if(m=b.whitespace,s=b.nextElem,s.is(n.expression)){var w=this.eval(s.popAttr(“js”));if(d.containsError(w)){i=w;break}var x=o[“+”](i,w);e(a).add(v).add(m).remove(),i=d.containsError(x)?d.create(“operation”,”I can’t combine “+S(i)+” with “+S(w)+”.”,”function”==typeof w.TwineScript_Run?”If you want to attach this changer to “+S(w)+”, remove the + between them.”:”Changers can only be added to other changers.”):x;continue}}if(s.is(n.expression)){var k=this.eval(s.popAttr(“js”));if(d.containsError(k)){i=k;break}if(k&&”object”===(void 0===k?”undefined”:_typeof(k))&&”function”==typeof k.TwineScript_Attach){i=k.TwineScript_Attach(i);break}return c.isPrototypeOf(k)?void r.replaceWith(d.create(“operation”,”Changers like (“+i.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(r.attr(“title”))):void r.replaceWith(d.create(“operation”,S(k)+” can’t have changers like (“+i.macroName+”:) attached.”,”Changers placed just before hooks, links and commands will attempt to attach, but in this case it didn’t work.”).render(r.attr(“title”)))}if(s.is(n.hook)){a.remove(),u=s;break}i.macroName||t.impossible(“Section.runExpression”,”changer has no macroName”);var O=r.attr(“title”)||”(“+i.macroName+”: …)”;return void r.replaceWith(d.create(“syntax”,”The (“+i.macroName+”:) changer should be stored in a variable or attached to a hook.”,”Macros like this should appear to the left of a hook: “+O+”[Some text]”).render(r.attr(“title”)))}u=u.length?u:y(r).nextElem.filter(n.hook);var j=void 0;if(j=d.containsError(i))j instanceof Error&&(j=d.fromError(j)),r.replaceWith(j.render(r.attr(“title”),r));else if(h.isPrototypeOf(i))r.append(i.render());else if(i&&”function”==typeof i.TwineScript_Run)if(i=i.TwineScript_Run(this),d.containsError(i))r.replaceWith(i.render(r.attr(“title”)));else if(f.isPrototypeOf(i)){if(i.data&&i.data.live)return void r.replaceWith(d.create(“unimplemented”,”I currently can’t attach (live:) or (event:) macros to commands – only hooks.”).render(r.attr(“title”)));i.section=this,i.target=s,this.renderInto(“”,s,i)}else{if(“blocked”===i)return void(this.stackTop.blocked=!0);i&&t.impossible(“Section.runExpression”,”TwineScript_Run() returned a non-ChangeDescriptor “+(void 0===i?”undefined”:_typeof(i))+’: “‘+i+'”‘)}else!u.length&&(“string”==typeof i||”number”==typeof i||i instanceof Map||i instanceof Set||Array.isArray(i)||l.isPrototypeOf(i))||i&&”function”==typeof i.TwineScript_Print&&!c.isPrototypeOf(i)?(i=T(i),d.containsError(i)?(i instanceof Error&&(i=d.fromError(i)),r.replaceWith(i.render(r.attr(“title”)))):”string”!=typeof i?t.impossible(“printBuiltinValue() produced a non-string “+(void 0===i?”undefined”:_typeof(i))):this.renderInto(i,r)):u.length?g.call(this,r,i,u):c.isPrototypeOf(i)||”boolean”==typeof i||t.impossible(“Section.runExpression”,”The expression evaluated to an unknown value: “+i.toSource())}function v(e){var t=e.first()[0],n=e.parent();if(!n.length)return null;var r=n.textNodes().filter(function(e){var n=e.compareDocumentPosition(t);return 4&n&&!(8&n)});return(r=r[r.length-1])||v(n)}function b(e){var t=e.last()[0],n=e.parent();if(!n.length)return null;var r=n.textNodes().filter(function(e){var n=e.compareDocumentPosition(t);return 2&n&&!(8&n)})[0];return r||b(n)}function w(t){function n(t){return 0===e(this||t).parentsUntil(“tw-collapsed”).filter(“tw-verbatim, tw-expression, [collapsing=false]”).length}var r=v(t);e(r).parents(“tw-collapsed”).length||(r=null);var i=b(t);e(i).parents(“tw-collapsed”).length||(i=null),t.findAndFilter(“br:not([data-raw])”).filter(n).replaceWith(document.createTextNode(” “));var o=t.textNodes(),a=0;o.reduce(function(e,t){return n(t)?(t.textContent=t.textContent.replace(/\s+/g,” “),” “!==t.textContent[0]||e&&e.textContent&&!(e.textContent.search(/\s$/)>-1)||(t.textContent=t.textContent.slice(1)),t):document.createTextNode(“A”)},r),[].concat(_toConsumableArray(o)).reverse().every(function(e){return!!n(e)&&(e.textContent.match(/^\s*$/)?(a+=e.textContent.length,e.textContent=””,!0):(e.textContent=e.textContent.replace(/\s+$/,function(e){return a+=e.length,””}),!1))}),a>0&&i&&(o[o.length-1].textContent+=” “),t[0]&&O()&&t[0].normalize()}function x(e,r){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;a&&t.assertMustHave(a,[“when”]);var s=r.data(“hiddenSource”)||””,c=_slicedToArray(this.stack,1),u=c[0].tempVariables,l=this.whenUnblocked.bind(this,function(){if(i.inDOM()){var t=a&&a.filter(i,[!0],u);if(d.containsError(t))return void t.render(e.attr(“title”)).replaceAll(e);if(a&&!t[0])return void setTimeout(l,o);i.renderInto(s,r,{append:”replace”}),t||r.find(n.expression+”[name=’stop’]”).length||i.inDOM()&&setTimeout(l,o)}});setTimeout(l,o)}var T=s.printBuiltinValue,S=s.objectName,k=void 0,O=function(){var t=void 0;return function(){if(void 0!==t)return t;var n=e(“
“);return n[0].normalize?(n.append(document.createTextNode(“0-“),document.createTextNode(“2”),document.createTextNode(“”))[0].normalize(),t=1===n.contents().length):t=!1}}();return k={create:function(n){n instanceof e&&1===n.length||t.impossible(“Section.create”,”called with no DOM element”);var r=Object.assign(Object.create(this),{timestamp:Date.now(),dom:n||t.storyElement,stack:[],enchantments:[],unblockCallbacks:[]});return r=i(r)},get stackTop(){return this.stack[0]},inDOM:function(){return e(t.storyElement).find(this.dom).length>0},evaluateTwineMarkup:function(t,n){var r=e(“
“);this.stack.unshift({desc:f.create({target:r,source:t,section:this}),tempVariables:this.stackTop.tempVariables,evaluateOnly:n}),this.execute();var i=void 0;return(i=r.find(“tw-error”)).length>0?i:r},renderInto:function(t,r,i){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=f.create({target:r,source:t,section:this});if(i)if(c.isPrototypeOf(i)){var u=i.run(s);if(d.containsError(u))return u.render(r.attr(“title”)).replaceAll(r),!1}else Object.assign(s,i);if(r=s.target,this.stack.length>=50)return d.create(“infinite”,”Printing this expression may have trapped me in an infinite loop.”).render(r.attr(“title”)).replaceAll(r),!1;var l=function(t,i){var a=r instanceof e&&r.is(n.hook)&&r.parents(“tw-collapsed”).length>0;o.stack.unshift({desc:t,tempVariables:i,collapses:a,evaluateOnly:o.stackTop&&o.stackTop.evaluateOnly})};if(!a){a=Object.create(this.stack.length?this.stackTop.tempVariables:p);var h=r&&r.tag();a.TwineScript_VariableStoreName=h===n.hook?r.attr(“name”)?”?”+r.attr(“name”):”an unnamed hook”:h===n.expression?”a “+r.attr(“type”)+” expression”:h===n.passage?”this passage”:”an unknown scope”}return Object.keys(s.loopVars).length?function(){var e=Object.assign({},s.loopVars),t=Math.min.apply(Math,_toConsumableArray(Object.keys(e).map(function(t){return e[t].length})));if(t){for(var n=t-1;n>=0;n-=1)!function(t){l(s,Object.keys(e).reduce(function(n,r){return n[r]=e[r][t],n},Object.create(a)))}(n);for(var n=t-1;n>=0&&!o.stackTop.blocked;n-=1)o.execute()}}():(l(s,a),this.execute()),0===this.stack.length&&this.updateEnchantments(),s.enabled},execute:function(){var r=_slicedToArray(this.stack,1),i=r[0],o=i.desc,a=i.dom,s=i.collapses,c=i.evaluateOnly;o&&!a&&(a=o.render(),this.stackTop.dom=a,this.stackTop.desc=void 0);var u=this;a.findAndFilter(n.hook+”,”+n.expression).each(function(){var r=e(this);switch(r.tag()){case n.hook:r.attr(“hidden”)&&(r.removeAttr(“hidden”),r.data(“hiddenSource”,r.popAttr(“source”))),r.attr(“source”)&&u.renderInto(r.popAttr(“source”),r);break;case n.expression:if(r.attr(“blockers”)){if(c)return void r.removeAttr(“blockers”).removeAttr(“js”).replaceWith(d.create(“syntax”,”I can’t use a macro like (prompt:) or (confirm:) in “+c+”.”,”Please rewrite this without putting such macros here.”).render(r.attr(“title”),r));var i=[];try{i=JSON.parse(r.popAttr(“blockers”)),r.data(“blockers”,i)}catch(e){t.impossible(“Section.execute”,”JSON.parse blockers failed.”)}}if(r.data(“blockers”)){var o=r.data(“blockers”);if(o.length){u.stackTop.blocked=!0;var a=u.eval(o.shift());return d.containsError(a)&&(u.stackTop.blocked=!1,r.removeData(“blockers”).replaceWith(a.render(r.attr(“title”),r))),!1}r.removeData(“blockers”)}if(r.attr(“js”)&&m.call(u,r),u.stackTop.blocked)return!1}}),u.stackTop.blocked||(a.length&&s&&w(a),a.findAndFilter(n.collapsed).each(function(){w(e(this))}),this.stack.shift())},updateEnchantments:function(){this.enchantments.forEach(function(e){e.disenchant(),e.enchantScope()})},unblock:function(e){for(this.stack.length||t.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(;this.unblockCallbacks.length>0;){var n=this.unblockCallbacks.shift();if(n(),this.stackTop.blocked)return}},whenUnblocked:function(e){if(!this.stack.length||!this.stackTop.blocked)return void e();this.unblockCallbacks=this.unblockCallbacks.concat(e)},blockedValue:function(){var e=this.stackTop;return e||t.impossible(“Section.blockedValue”,”stack is empty”),e.blockedValues&&e.blockedValues.length||t.impossible(“Section.blockedValue”,”blockedValues is missing or empty”),e.blockedValues.shift()}},Object.preventExtensions(k)}),define(“engine”,[“jquery”,”utils”,”utils/selectors”,”state”,”section”,”passages”],function(e,t,n,r,i,o){function a(){var t=e(“”),i=t.children(n.sidebar);h.permalink&&r.save&&i.append(‘
Like this:
Like Loading...