godash-diagrams 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Godash Diagrams
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/godash-diagrams)](https://www.npmjs.com/package/godash-diagrams)
4
+
3
5
  A diagramming library for [Go](https://en.wikipedia.org/wiki/Go_(game)), inspired by [Mermaid](https://mermaid.js.org/), and built on [Godash](https://duckpunch.github.io/godash/).
4
6
 
5
7
  [**Try it live →**](https://duckpunch.github.io/godash-diagrams/)
@@ -47,6 +49,18 @@ O .
47
49
  </script>
48
50
  ```
49
51
 
52
+ ### Auto-init (no JavaScript required)
53
+
54
+ ```html
55
+ <script src="https://unpkg.com/godash-diagrams/dist/godash-diagrams.auto.iife.js"></script>
56
+ <div class="godash-diagram">
57
+ static
58
+
59
+ O .
60
+ . X
61
+ </div>
62
+ ```
63
+
50
64
  ## License
51
65
 
52
66
  ISC
@@ -0,0 +1,4 @@
1
+ (function(){"use strict";var vr="@@__IMMUTABLE_INDEXED__@@";function X(r){return!!(r&&r[vr])}var yr="@@__IMMUTABLE_KEYED__@@";function R(r){return!!(r&&r[yr])}function Fr(r){return R(r)||X(r)}var mi="@@__IMMUTABLE_ITERABLE__@@";function F(r){return!!(r&&r[mi])}var j=function(t){return F(t)?t:D(t)},V=(function(r){function t(e){return R(e)?e:yt(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(j),It=(function(r){function t(e){return X(e)?e:tt(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(j),zt=(function(r){function t(e){return F(e)&&!Fr(e)?e:kt(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t})(j);j.Keyed=V,j.Indexed=It,j.Set=zt;var At=0,U=1,H=2,Ur=typeof Symbol=="function"&&Symbol.iterator,Si="@@iterator",gr=Ur||Si,w=function(t){this.next=t};w.prototype.toString=function(){return"[Iterator]"},w.KEYS=At,w.VALUES=U,w.ENTRIES=H,w.prototype.inspect=w.prototype.toSource=function(){return this.toString()},w.prototype[gr]=function(){return this};function z(r,t,e,n){var i=r===At?t:r===U?e:[t,e];return n?n.value=i:n={value:i,done:!1},n}function L(){return{value:void 0,done:!0}}function wi(r){return Array.isArray(r)?!0:!!mr(r)}function bi(r){return!!(r&&typeof r.next=="function")}function Hr(r){var t=mr(r);return t&&t.call(r)}function mr(r){var t=r&&(Ur&&r[Ur]||r[Si]);if(typeof t=="function")return t}function ks(r){var t=mr(r);return t&&t===r.entries}function Bs(r){var t=mr(r);return t&&t===r.keys}var Yt="delete",q=5,K=1<<q,P=K-1,S={};function Kr(){return{value:!1}}function Z(r){r&&(r.value=!0)}function Wr(){}function Ct(r){return r.size===void 0&&(r.size=r.__iterate(Ii)),r.size}function lt(r,t){if(typeof t!="number"){var e=t>>>0;if(""+e!==t||e===4294967295)return NaN;t=e}return t<0?Ct(r)+t:t}function Ii(){return!0}function Sr(r,t,e){return(r===0&&!Mi(r)||e!==void 0&&r<=-e)&&(t===void 0||e!==void 0&&t>=e)}function Jt(r,t){return qi(r,t,0)}function wr(r,t){return qi(r,t,t)}function qi(r,t,e){return r===void 0?e:Mi(r)?t===1/0?t:Math.max(0,t+r)|0:t===void 0||t===r?r:Math.min(t,r)|0}function Mi(r){return r<0||r===0&&1/r===-1/0}var Oi="@@__IMMUTABLE_RECORD__@@";function qt(r){return!!(r&&r[Oi])}function nt(r){return F(r)||qt(r)}var vt="@@__IMMUTABLE_ORDERED__@@";function it(r){return!!(r&&r[vt])}var Ei="@@__IMMUTABLE_SEQ__@@";function Gr(r){return!!(r&&r[Ei])}var $t=Object.prototype.hasOwnProperty;function Ti(r){return Array.isArray(r)||typeof r=="string"?!0:r&&typeof r=="object"&&Number.isInteger(r.length)&&r.length>=0&&(r.length===0?Object.keys(r).length===1:r.hasOwnProperty(r.length-1))}var D=(function(r){function t(e){return e==null?Jr():nt(e)?e.toSeq():xs(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var a=this._cache;if(a){for(var o=a.length,s=0;s!==o;){var u=a[i?o-++s:s++];if(n(u[1],u[0],this)===!1)break}return s}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var a=this._cache;if(a){var o=a.length,s=0;return new w(function(){if(s===o)return L();var u=a[i?o-++s:s++];return z(n,u[0],u[1])})}return this.__iteratorUncached(n,i)},t})(j),yt=(function(r){function t(e){return e==null?Jr().toKeyedSeq():F(e)?R(e)?e.toSeq():e.fromEntrySeq():qt(e)?e.toSeq():Xr(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(D),tt=(function(r){function t(e){return e==null?Jr():F(e)?R(e)?e.entrySeq():e.toIndexedSeq():qt(e)?e.toSeq().entrySeq():zi(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(D),kt=(function(r){function t(e){return(F(e)&&!Fr(e)?e:tt(e)).toSetSeq()}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(D);D.isSeq=Gr,D.Keyed=yt,D.Set=kt,D.Indexed=tt,D.prototype[Ei]=!0;var Bt=(function(r){function t(e){this._array=e,this.size=e.length}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[lt(this,n)]:i},t.prototype.__iterate=function(n,i){for(var a=this._array,o=a.length,s=0;s!==o;){var u=i?o-++s:s++;if(n(a[u],u,this)===!1)break}return s},t.prototype.__iterator=function(n,i){var a=this._array,o=a.length,s=0;return new w(function(){if(s===o)return L();var u=i?o-++s:s++;return z(n,u,a[u])})},t})(tt),Yr=(function(r){function t(e){var n=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=n,this.size=n.length}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return $t.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var a=this._object,o=this._keys,s=o.length,u=0;u!==s;){var f=o[i?s-++u:u++];if(n(a[f],f,this)===!1)break}return u},t.prototype.__iterator=function(n,i){var a=this._object,o=this._keys,s=o.length,u=0;return new w(function(){if(u===s)return L();var f=o[i?s-++u:u++];return z(n,f,a[f])})},t})(yt);Yr.prototype[vt]=!0;var js=(function(r){function t(e){this._collection=e,this.size=e.length||e.size}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var a=this._collection,o=Hr(a),s=0;if(bi(o))for(var u;!(u=o.next()).done&&n(u.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var a=this._collection,o=Hr(a);if(!bi(o))return new w(L);var s=0;return new w(function(){var u=o.next();return u.done?u:z(n,s++,u.value)})},t})(tt),Ri;function Jr(){return Ri||(Ri=new Bt([]))}function Xr(r){var t=Vr(r);if(t)return t.fromEntrySeq();if(typeof r=="object")return new Yr(r);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+r)}function zi(r){var t=Vr(r);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+r)}function xs(r){var t=Vr(r);if(t)return ks(r)?t.fromEntrySeq():Bs(r)?t.toSetSeq():t;if(typeof r=="object")return new Yr(r);throw new TypeError("Expected Array or collection object of values, or keyed object: "+r)}function Vr(r){return Ti(r)?new Bt(r):wi(r)?new js(r):void 0}function Xt(){return this.__ensureOwner()}function Vt(){return this.__ownerID?this:this.__ensureOwner(new Wr)}var Zt=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t|=0,e|=0;var n=t&65535,i=e&65535;return n*i+((t>>>16)*i+n*(e>>>16)<<16>>>0)|0};function br(r){return r>>>1&1073741824|r&3221225471}var Ls=Object.prototype.valueOf;function W(r){if(r==null)return Ai(r);if(typeof r.hashCode=="function")return br(r.hashCode(r));var t=Hs(r);if(t==null)return Ai(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return Ps(t);case"string":return t.length>Ks?Ns(t):Zr(t);case"object":case"function":return Fs(t);case"symbol":return Ds(t);default:if(typeof t.toString=="function")return Zr(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function Ai(r){return r===null?1108378658:1108378659}function Ps(r){if(r!==r||r===1/0)return 0;var t=r|0;for(t!==r&&(t^=r*4294967295);r>4294967295;)r/=4294967295,t^=r;return br(t)}function Ns(r){var t=ne[r];return t===void 0&&(t=Zr(r),ee===Ws&&(ee=0,ne={}),ee++,ne[r]=t),t}function Zr(r){for(var t=0,e=0;e<r.length;e++)t=31*t+r.charCodeAt(e)|0;return br(t)}function Ds(r){var t=Bi[r];return t!==void 0||(t=ki(),Bi[r]=t),t}function Fs(r){var t;if(Qr&&(t=te.get(r),t!==void 0)||(t=r[Mt],t!==void 0)||!$i&&(t=r.propertyIsEnumerable&&r.propertyIsEnumerable[Mt],t!==void 0||(t=Us(r),t!==void 0)))return t;if(t=ki(),Qr)te.set(r,t);else{if(Ci!==void 0&&Ci(r)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if($i)Object.defineProperty(r,Mt,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(r.propertyIsEnumerable!==void 0&&r.propertyIsEnumerable===r.constructor.prototype.propertyIsEnumerable)r.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},r.propertyIsEnumerable[Mt]=t;else if(r.nodeType!==void 0)r[Mt]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var Ci=Object.isExtensible,$i=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();function Us(r){if(r&&r.nodeType>0)switch(r.nodeType){case 1:return r.uniqueID;case 9:return r.documentElement&&r.documentElement.uniqueID}}function Hs(r){return r.valueOf!==Ls&&typeof r.valueOf=="function"?r.valueOf(r):r}function ki(){var r=++re;return re&1073741824&&(re=0),r}var Qr=typeof WeakMap=="function",te;Qr&&(te=new WeakMap);var Bi=Object.create(null),re=0,Mt="__immutablehash__";typeof Symbol=="function"&&(Mt=Symbol(Mt));var Ks=16,Ws=255,ee=0,ne={},Ir=(function(r){function t(e,n){this._iter=e,this._useKeys=n,this.size=e.size}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=ie(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var a=this,o=Ni(this,n,i);return this._useKeys||(o.valueSeq=function(){return a._iter.toSeq().map(n,i)}),o},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(o,s){return n(o,s,a)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t})(yt);Ir.prototype[vt]=!0;var ji=(function(r){function t(e){this._iter=e,this.size=e.size}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this,o=0;return i&&Ct(this),this._iter.__iterate(function(s){return n(s,i?a.size-++o:o++,a)},i)},t.prototype.__iterator=function(n,i){var a=this,o=this._iter.__iterator(U,i),s=0;return i&&Ct(this),new w(function(){var u=o.next();return u.done?u:z(n,i?a.size-++s:s++,u.value,u)})},t})(tt),xi=(function(r){function t(e){this._iter=e,this.size=e.size}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(o){return n(o,o,a)},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(U,i);return new w(function(){var o=a.next();return o.done?o:z(n,o.value,o.value,o)})},t})(kt),Li=(function(r){function t(e){this._iter=e,this.size=e.size}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var a=this;return this._iter.__iterate(function(o){if(o){Ki(o);var s=F(o);return n(s?o.get(1):o[1],s?o.get(0):o[0],a)}},i)},t.prototype.__iterator=function(n,i){var a=this._iter.__iterator(U,i);return new w(function(){for(;;){var o=a.next();if(o.done)return o;var s=o.value;if(s){Ki(s);var u=F(s);return z(n,u?s.get(0):s[0],u?s.get(1):s[1],o)}}})},t})(yt);ji.prototype.cacheResult=Ir.prototype.cacheResult=xi.prototype.cacheResult=Li.prototype.cacheResult=se;function Pi(r){var t=at(r);return t._iter=r,t.size=r.size,t.flip=function(){return r},t.reverse=function(){var e=r.reverse.apply(this);return e.flip=function(){return r.reverse()},e},t.has=function(e){return r.includes(e)},t.includes=function(e){return r.has(e)},t.cacheResult=se,t.__iterateUncached=function(e,n){var i=this;return r.__iterate(function(a,o){return e(o,a,i)!==!1},n)},t.__iteratorUncached=function(e,n){if(e===H){var i=r.__iterator(e,n);return new w(function(){var a=i.next();if(!a.done){var o=a.value[0];a.value[0]=a.value[1],a.value[1]=o}return a})}return r.__iterator(e===U?At:U,n)},t}function Ni(r,t,e){var n=at(r);return n.size=r.size,n.has=function(i){return r.has(i)},n.get=function(i,a){var o=r.get(i,S);return o===S?a:t.call(e,o,i,r)},n.__iterateUncached=function(i,a){var o=this;return r.__iterate(function(s,u,f){return i(t.call(e,s,u,f),u,o)!==!1},a)},n.__iteratorUncached=function(i,a){var o=r.__iterator(H,a);return new w(function(){var s=o.next();if(s.done)return s;var u=s.value,f=u[0];return z(i,f,t.call(e,u[1],f,r),s)})},n}function ie(r,t){var e=this,n=at(r);return n._iter=r,n.size=r.size,n.reverse=function(){return r},r.flip&&(n.flip=function(){var i=Pi(r);return i.reverse=function(){return r.flip()},i}),n.get=function(i,a){return r.get(t?i:-1-i,a)},n.has=function(i){return r.has(t?i:-1-i)},n.includes=function(i){return r.includes(i)},n.cacheResult=se,n.__iterate=function(i,a){var o=this,s=0;return a&&Ct(r),r.__iterate(function(u,f){return i(u,t?f:a?o.size-++s:s++,o)},!a)},n.__iterator=function(i,a){var o=0;a&&Ct(r);var s=r.__iterator(H,!a);return new w(function(){var u=s.next();if(u.done)return u;var f=u.value;return z(i,t?f[0]:a?e.size-++o:o++,f[1],u)})},n}function Di(r,t,e,n){var i=at(r);return n&&(i.has=function(a){var o=r.get(a,S);return o!==S&&!!t.call(e,o,a,r)},i.get=function(a,o){var s=r.get(a,S);return s!==S&&t.call(e,s,a,r)?s:o}),i.__iterateUncached=function(a,o){var s=this,u=0;return r.__iterate(function(f,c,h){if(t.call(e,f,c,h))return u++,a(f,n?c:u-1,s)},o),u},i.__iteratorUncached=function(a,o){var s=r.__iterator(H,o),u=0;return new w(function(){for(;;){var f=s.next();if(f.done)return f;var c=f.value,h=c[0],p=c[1];if(t.call(e,p,h,r))return z(a,n?h:u++,p,f)}})},i}function Gs(r,t,e){var n=J().asMutable();return r.__iterate(function(i,a){n.update(t.call(e,i,a,r),0,function(o){return o+1})}),n.asImmutable()}function Ys(r,t,e){var n=R(r),i=(it(r)?_t():J()).asMutable();r.__iterate(function(o,s){i.update(t.call(e,o,s,r),function(u){return u=u||[],u.push(n?[s,o]:o),u})});var a=oe(r);return i.map(function(o){return M(r,a(o))}).asImmutable()}function Js(r,t,e){var n=R(r),i=[[],[]];r.__iterate(function(o,s){i[t.call(e,o,s,r)?1:0].push(n?[s,o]:o)});var a=oe(r);return i.map(function(o){return M(r,a(o))})}function ae(r,t,e,n){var i=r.size;if(Sr(t,e,i))return r;if(typeof i>"u"&&(t<0||e<0))return ae(r.toSeq().cacheResult(),t,e,n);var a=Jt(t,i),o=wr(e,i),s=o-a,u;s===s&&(u=s<0?0:s);var f=at(r);return f.size=u===0?u:r.size&&u||void 0,!n&&Gr(r)&&u>=0&&(f.get=function(c,h){return c=lt(this,c),c>=0&&c<u?r.get(c+a,h):h}),f.__iterateUncached=function(c,h){var p=this;if(u===0)return 0;if(h)return this.cacheResult().__iterate(c,h);var _=0,d=!0,v=0;return r.__iterate(function(I,y){if(!(d&&(d=_++<a)))return v++,c(I,n?y:v-1,p)!==!1&&v!==u}),v},f.__iteratorUncached=function(c,h){if(u!==0&&h)return this.cacheResult().__iterator(c,h);if(u===0)return new w(L);var p=r.__iterator(c,h),_=0,d=0;return new w(function(){for(;_++<a;)p.next();if(++d>u)return L();var v=p.next();return n||c===U||v.done?v:c===At?z(c,d-1,void 0,v):z(c,d-1,v.value[1],v)})},f}function Xs(r,t,e){var n=at(r);return n.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=0;return r.__iterate(function(u,f,c){return t.call(e,u,f,c)&&++s&&i(u,f,o)}),s},n.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=r.__iterator(H,a),u=!0;return new w(function(){if(!u)return L();var f=s.next();if(f.done)return f;var c=f.value,h=c[0],p=c[1];return t.call(e,p,h,o)?i===H?f:z(i,h,p,f):(u=!1,L())})},n}function Fi(r,t,e,n){var i=at(r);return i.__iterateUncached=function(a,o){var s=this;if(o)return this.cacheResult().__iterate(a,o);var u=!0,f=0;return r.__iterate(function(c,h,p){if(!(u&&(u=t.call(e,c,h,p))))return f++,a(c,n?h:f-1,s)}),f},i.__iteratorUncached=function(a,o){var s=this;if(o)return this.cacheResult().__iterator(a,o);var u=r.__iterator(H,o),f=!0,c=0;return new w(function(){var h,p,_;do{if(h=u.next(),h.done)return n||a===U?h:a===At?z(a,c++,void 0,h):z(a,c++,h.value[1],h);var d=h.value;p=d[0],_=d[1],f&&(f=t.call(e,_,p,s))}while(f);return a===H?h:z(a,p,_,h)})},i}var Vs=(function(r){function t(e){this._wrappedIterables=e.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,i){if(n!==void 0){var a=i.size;if(a!==void 0)return n+a}},0),this[yr]=this._wrappedIterables[0][yr],this[vr]=this._wrappedIterables[0][vr],this[vt]=this._wrappedIterables[0][vt]}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(this._wrappedIterables.length!==0){if(i)return this.cacheResult().__iterate(n,i);for(var a=0,o=R(this),s=o?H:U,u=this._wrappedIterables[a].__iterator(s,i),f=!0,c=0;f;){for(var h=u.next();h.done;){if(a++,a===this._wrappedIterables.length)return c;u=this._wrappedIterables[a].__iterator(s,i),h=u.next()}var p=o?n(h.value[1],h.value[0],this):n(h.value,c,this);f=p!==!1,c++}return c}},t.prototype.__iteratorUncached=function(n,i){var a=this;if(this._wrappedIterables.length===0)return new w(L);if(i)return this.cacheResult().__iterator(n,i);var o=0,s=this._wrappedIterables[o].__iterator(n,i);return new w(function(){for(var u=s.next();u.done;){if(o++,o===a._wrappedIterables.length)return u;s=a._wrappedIterables[o].__iterator(n,i),u=s.next()}return u})},t})(D);function Zs(r,t){var e=R(r),n=[r].concat(t).map(function(a){return F(a)?e&&(a=V(a)):a=e?Xr(a):zi(Array.isArray(a)?a:[a]),a}).filter(function(a){return a.size!==0});if(n.length===0)return r;if(n.length===1){var i=n[0];if(i===r||e&&R(i)||X(r)&&X(i))return i}return new Vs(n)}function Ui(r,t,e){var n=at(r);return n.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var o=0,s=!1;function u(f,c){f.__iterate(function(h,p){return(!t||c<t)&&F(h)?u(h,c+1):(o++,i(h,e?p:o-1,n)===!1&&(s=!0)),!s},a)}return u(r,0),o},n.__iteratorUncached=function(i,a){if(a)return this.cacheResult().__iterator(i,a);var o=r.__iterator(i,a),s=[],u=0;return new w(function(){for(;o;){var f=o.next();if(f.done!==!1){o=s.pop();continue}var c=f.value;if(i===H&&(c=c[1]),(!t||s.length<t)&&F(c))s.push(o),o=c.__iterator(i,a);else return e?f:z(i,u++,c,f)}return L()})},n}function Qs(r,t,e){var n=oe(r);return r.toSeq().map(function(i,a){return n(t.call(e,i,a,r))}).flatten(!0)}function tu(r,t){var e=at(r);return e.size=r.size&&r.size*2-1,e.__iterateUncached=function(n,i){var a=this,o=0;return r.__iterate(function(s){return(!o||n(t,o++,a)!==!1)&&n(s,o++,a)!==!1},i),o},e.__iteratorUncached=function(n,i){var a=r.__iterator(U,i),o=0,s;return new w(function(){return(!s||o%2)&&(s=a.next(),s.done)?s:o%2?z(n,o++,t):z(n,o++,s.value,s)})},e}function jt(r,t,e){t||(t=Wi);var n=R(r),i=0,a=r.toSeq().map(function(o,s){return[s,o,i++,e?e(o,s,r):o]}).valueSeq().toArray();return a.sort(function(o,s){return t(o[3],s[3])||o[2]-s[2]}).forEach(n?function(o,s){a[s].length=2}:function(o,s){a[s]=o[1]}),n?yt(a):X(r)?tt(a):kt(a)}function qr(r,t,e){if(t||(t=Wi),e){var n=r.toSeq().map(function(i,a){return[i,e(i,a,r)]}).reduce(function(i,a){return Hi(t,i[1],a[1])?a:i});return n&&n[0]}return r.reduce(function(i,a){return Hi(t,i,a)?a:i})}function Hi(r,t,e){var n=r(e,t);return n===0&&e!==t&&(e==null||e!==e)||n>0}function Mr(r,t,e,n){var i=at(r),a=new Bt(e).map(function(o){return o.size});return i.size=n?a.max():a.min(),i.__iterate=function(o,s){for(var u=this.__iterator(U,s),f,c=0;!(f=u.next()).done&&o(f.value,c++,this)!==!1;);return c},i.__iteratorUncached=function(o,s){var u=e.map(function(h){return h=j(h),Hr(s?h.reverse():h)}),f=0,c=!1;return new w(function(){var h;return c||(h=u.map(function(p){return p.next()}),c=n?h.every(function(p){return p.done}):h.some(function(p){return p.done})),c?L():z(o,f++,t.apply(null,h.map(function(p){return p.value})))})},i}function M(r,t){return r===t?r:Gr(r)?t:r.constructor(t)}function Ki(r){if(r!==Object(r))throw new TypeError("Expected [K, V] tuple: "+r)}function oe(r){return R(r)?V:X(r)?It:zt}function at(r){return Object.create((R(r)?yt:X(r)?tt:kt).prototype)}function se(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):D.prototype.cacheResult.call(this)}function Wi(r,t){return r===void 0&&t===void 0?0:r===void 0?1:t===void 0?-1:r>t?1:r<t?-1:0}function Gi(r){return!!(r&&typeof r.equals=="function"&&typeof r.hashCode=="function")}function G(r,t){if(r===t||r!==r&&t!==t)return!0;if(!r||!t)return!1;if(typeof r.valueOf=="function"&&typeof t.valueOf=="function"){if(r=r.valueOf(),t=t.valueOf(),r===t||r!==r&&t!==t)return!0;if(!r||!t)return!1}return!!(Gi(r)&&Gi(t)&&r.equals(t))}function Yi(r,t,e,n){return Pt(r,[t],e,n)}function Ji(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return Vi(this,r)}function Xi(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];if(typeof r!="function")throw new TypeError("Invalid merger function: "+r);return Vi(this,t,r)}function Vi(r,t,e){for(var n=[],i=0;i<t.length;i++){var a=V(t[i]);a.size!==0&&n.push(a)}return n.length===0?r:r.toSeq().size===0&&!r.__ownerID&&n.length===1?qt(r)?r:r.constructor(n[0]):r.withMutations(function(o){for(var s=e?function(f,c){Yi(o,c,S,function(h){return h===S?f:e(h,f,c)})}:function(f,c){o.set(c,f)},u=0;u<n.length;u++)n[u].forEach(s)})}var ru=Object.prototype.toString;function eu(r){if(!r||typeof r!="object"||ru.call(r)!=="[object Object]")return!1;var t=Object.getPrototypeOf(r);if(t===null)return!0;for(var e=t,n=Object.getPrototypeOf(t);n!==null;)e=n,n=Object.getPrototypeOf(e);return e===t}function gt(r){return typeof r=="object"&&(nt(r)||Array.isArray(r)||eu(r))}function ot(r,t){t=t||0;for(var e=Math.max(0,r.length-t),n=new Array(e),i=0;i<e;i++)n[i]=r[i+t];return n}function Or(r){if(Array.isArray(r))return ot(r);var t={};for(var e in r)$t.call(r,e)&&(t[e]=r[e]);return t}function ue(r,t,e){return fe(r,t,nu(e))}function fe(r,t,e){if(!gt(r))throw new TypeError("Cannot merge into non-data-structure value: "+r);if(nt(r))return typeof e=="function"&&r.mergeWith?r.mergeWith.apply(r,[e].concat(t)):r.merge?r.merge.apply(r,t):r.concat.apply(r,t);for(var n=Array.isArray(r),i=r,a=n?It:V,o=n?function(u){i===r&&(i=Or(i)),i.push(u)}:function(u,f){var c=$t.call(i,f),h=c&&e?e(i[f],u,f):u;(!c||h!==i[f])&&(i===r&&(i=Or(i)),i[f]=h)},s=0;s<t.length;s++)a(t[s]).forEach(o);return i}function nu(r){function t(e,n,i){return gt(e)&&gt(n)&&iu(e,n)?fe(e,[n],t):r?r(e,n,i):n}return t}function iu(r,t){var e=D(r),n=D(t);return X(e)===X(n)&&R(e)===R(n)}function Zi(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];return ue(this,r)}function Qi(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];return ue(this,t,r)}function ce(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];return Pt(this,r,st(),function(n){return ue(n,t)})}function he(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];return Pt(this,r,st(),function(n){return fe(n,t)})}function au(r,t,e){return Pt(r,t,S,function(){return e})}function pe(r,t){return au(this,r,t)}function _e(r,t,e){return arguments.length===1?r(this):Yi(this,r,t,e)}function de(r,t,e){return Pt(this,r,t,e)}function le(){return this.__altered}function Qt(r){var t=this.asMutable();return r(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}var ta="@@__IMMUTABLE_MAP__@@";function ve(r){return!!(r&&r[ta])}function tr(r,t){if(!r)throw new Error(t)}function Y(r){tr(r!==1/0,"Cannot perform this action with an infinite size.")}var J=(function(r){function t(e){return e==null?st():ve(e)&&!it(e)?e:st().withMutations(function(n){var i=r(e);Y(i.size),i.forEach(function(a,o){return n.set(o,a)})})}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return na(this,n,i)},t.prototype.remove=function(n){return na(this,n,S)},t.prototype.deleteAll=function(n){var i=j(n);return i.size===0?this:this.withMutations(function(a){i.forEach(function(o){return a.remove(o)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):st()},t.prototype.sort=function(n){return _t(jt(this,n))},t.prototype.sortBy=function(n,i){return _t(jt(this,i,n))},t.prototype.map=function(n,i){var a=this;return this.withMutations(function(o){o.forEach(function(s,u){o.set(u,n.call(i,s,u,a))})})},t.prototype.__iterator=function(n,i){return new ou(this,n,i)},t.prototype.__iterate=function(n,i){var a=this,o=0;return this._root&&this._root.iterate(function(s){return o++,n(s[1],s[0],a)},i),o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?ge(this.size,this._root,n,this.__hash):this.size===0?st():(this.__ownerID=n,this.__altered=!1,this)},t})(V);J.isMap=ve;var T=J.prototype;T[ta]=!0,T[Yt]=T.remove,T.removeAll=T.deleteAll,T.setIn=pe,T.removeIn=T.deleteIn=we,T.update=_e,T.updateIn=de,T.merge=T.concat=Ji,T.mergeWith=Xi,T.mergeDeep=Zi,T.mergeDeepWith=Qi,T.mergeIn=he,T.mergeDeepIn=ce,T.withMutations=Qt,T.wasAltered=le,T.asImmutable=Xt,T["@@transducer/init"]=T.asMutable=Vt,T["@@transducer/step"]=function(r,t){return r.set(t[0],t[1])},T["@@transducer/result"]=function(r){return r.asImmutable()};var rr=function(t,e){this.ownerID=t,this.entries=e};rr.prototype.get=function(t,e,n,i){for(var a=this.entries,o=0,s=a.length;o<s;o++)if(G(n,a[o][0]))return a[o][1];return i},rr.prototype.update=function(t,e,n,i,a,o,s){for(var u=a===S,f=this.entries,c=0,h=f.length;c<h&&!G(i,f[c][0]);c++);var p=c<h;if(p?f[c][1]===a:u)return this;if(Z(s),(u||!p)&&Z(o),!(u&&f.length===1)){if(!p&&!u&&f.length>=pu)return su(t,f,i,a);var _=t&&t===this.ownerID,d=_?f:ot(f);return p?u?c===h-1?d.pop():d[c]=d.pop():d[c]=[i,a]:d.push([i,a]),_?(this.entries=d,this):new rr(t,d)}};var xt=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n};xt.prototype.get=function(t,e,n,i){e===void 0&&(e=W(n));var a=1<<((t===0?e:e>>>t)&P),o=this.bitmap;return(o&a)===0?i:this.nodes[aa(o&a-1)].get(t+q,e,n,i)},xt.prototype.update=function(t,e,n,i,a,o,s){n===void 0&&(n=W(i));var u=(e===0?n:n>>>e)&P,f=1<<u,c=this.bitmap,h=(c&f)!==0;if(!h&&a===S)return this;var p=aa(c&f-1),_=this.nodes,d=h?_[p]:void 0,v=me(d,t,e+q,n,i,a,o,s);if(v===d)return this;if(!h&&v&&_.length>=_u)return fu(t,_,c,u,v);if(h&&!v&&_.length===2&&ia(_[p^1]))return _[p^1];if(h&&v&&_.length===1&&ia(v))return v;var I=t&&t===this.ownerID,y=h?v?c:c^f:c|f,m=h?v?oa(_,p,v,I):hu(_,p,I):cu(_,p,v,I);return I?(this.bitmap=y,this.nodes=m,this):new xt(t,y,m)};var er=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n};er.prototype.get=function(t,e,n,i){e===void 0&&(e=W(n));var a=(t===0?e:e>>>t)&P,o=this.nodes[a];return o?o.get(t+q,e,n,i):i},er.prototype.update=function(t,e,n,i,a,o,s){n===void 0&&(n=W(i));var u=(e===0?n:n>>>e)&P,f=a===S,c=this.nodes,h=c[u];if(f&&!h)return this;var p=me(h,t,e+q,n,i,a,o,s);if(p===h)return this;var _=this.count;if(!h)_++;else if(!p&&(_--,_<du))return uu(t,c,_,u);var d=t&&t===this.ownerID,v=oa(c,u,p,d);return d?(this.count=_,this.nodes=v,this):new er(t,_,v)};var Lt=function(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n};Lt.prototype.get=function(t,e,n,i){for(var a=this.entries,o=0,s=a.length;o<s;o++)if(G(n,a[o][0]))return a[o][1];return i},Lt.prototype.update=function(t,e,n,i,a,o,s){n===void 0&&(n=W(i));var u=a===S;if(n!==this.keyHash)return u?this:(Z(s),Z(o),Se(this,t,e,n,[i,a]));for(var f=this.entries,c=0,h=f.length;c<h&&!G(i,f[c][0]);c++);var p=c<h;if(p?f[c][1]===a:u)return this;if(Z(s),(u||!p)&&Z(o),u&&h===2)return new pt(t,this.keyHash,f[c^1]);var _=t&&t===this.ownerID,d=_?f:ot(f);return p?u?c===h-1?d.pop():d[c]=d.pop():d[c]=[i,a]:d.push([i,a]),_?(this.entries=d,this):new Lt(t,this.keyHash,d)};var pt=function(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n};pt.prototype.get=function(t,e,n,i){return G(n,this.entry[0])?this.entry[1]:i},pt.prototype.update=function(t,e,n,i,a,o,s){var u=a===S,f=G(i,this.entry[0]);if(f?a===this.entry[1]:u)return this;if(Z(s),u){Z(o);return}return f?t&&t===this.ownerID?(this.entry[1]=a,this):new pt(t,this.keyHash,[i,a]):(Z(o),Se(this,t,e,W(i),[i,a]))},rr.prototype.iterate=Lt.prototype.iterate=function(r,t){for(var e=this.entries,n=0,i=e.length-1;n<=i;n++)if(r(e[t?i-n:n])===!1)return!1},xt.prototype.iterate=er.prototype.iterate=function(r,t){for(var e=this.nodes,n=0,i=e.length-1;n<=i;n++){var a=e[t?i-n:n];if(a&&a.iterate(r,t)===!1)return!1}},pt.prototype.iterate=function(r,t){return r(this.entry)};var ou=(function(r){function t(e,n,i){this._type=n,this._reverse=i,this._stack=e._root&&ra(e._root)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,i=this._stack;i;){var a=i.node,o=i.index++,s=void 0;if(a.entry){if(o===0)return ye(n,a.entry)}else if(a.entries){if(s=a.entries.length-1,o<=s)return ye(n,a.entries[this._reverse?s-o:o])}else if(s=a.nodes.length-1,o<=s){var u=a.nodes[this._reverse?s-o:o];if(u){if(u.entry)return ye(n,u.entry);i=this._stack=ra(u,i)}continue}i=this._stack=this._stack.__prev}return L()},t})(w);function ye(r,t){return z(r,t[0],t[1])}function ra(r,t){return{node:r,index:0,__prev:t}}function ge(r,t,e,n){var i=Object.create(T);return i.size=r,i._root=t,i.__ownerID=e,i.__hash=n,i.__altered=!1,i}var ea;function st(){return ea||(ea=ge(0))}function na(r,t,e){var n,i;if(r._root){var a=Kr(),o=Kr();if(n=me(r._root,r.__ownerID,0,void 0,t,e,a,o),!o.value)return r;i=r.size+(a.value?e===S?-1:1:0)}else{if(e===S)return r;i=1,n=new rr(r.__ownerID,[[t,e]])}return r.__ownerID?(r.size=i,r._root=n,r.__hash=void 0,r.__altered=!0,r):n?ge(i,n):st()}function me(r,t,e,n,i,a,o,s){return r?r.update(t,e,n,i,a,o,s):a===S?r:(Z(s),Z(o),new pt(t,n,[i,a]))}function ia(r){return r.constructor===pt||r.constructor===Lt}function Se(r,t,e,n,i){if(r.keyHash===n)return new Lt(t,n,[r.entry,i]);var a=(e===0?r.keyHash:r.keyHash>>>e)&P,o=(e===0?n:n>>>e)&P,s,u=a===o?[Se(r,t,e+q,n,i)]:(s=new pt(t,n,i),a<o?[r,s]:[s,r]);return new xt(t,1<<a|1<<o,u)}function su(r,t,e,n){r||(r=new Wr);for(var i=new pt(r,W(e),[e,n]),a=0;a<t.length;a++){var o=t[a];i=i.update(r,0,void 0,o[0],o[1])}return i}function uu(r,t,e,n){for(var i=0,a=0,o=new Array(e),s=0,u=1,f=t.length;s<f;s++,u<<=1){var c=t[s];c!==void 0&&s!==n&&(i|=u,o[a++]=c)}return new xt(r,i,o)}function fu(r,t,e,n,i){for(var a=0,o=new Array(K),s=0;e!==0;s++,e>>>=1)o[s]=e&1?t[a++]:void 0;return o[n]=i,new er(r,a+1,o)}function aa(r){return r-=r>>1&1431655765,r=(r&858993459)+(r>>2&858993459),r=r+(r>>4)&252645135,r+=r>>8,r+=r>>16,r&127}function oa(r,t,e,n){var i=n?r:ot(r);return i[t]=e,i}function cu(r,t,e,n){var i=r.length+1;if(n&&t+1===i)return r[t]=e,r;for(var a=new Array(i),o=0,s=0;s<i;s++)s===t?(a[s]=e,o=-1):a[s]=r[s+o];return a}function hu(r,t,e){var n=r.length-1;if(e&&t===n)return r.pop(),r;for(var i=new Array(n),a=0,o=0;o<n;o++)o===t&&(a=1),i[o]=r[o+a];return i}var pu=K/4,_u=K/2,du=K/4;function sa(r){if(Ti(r)&&typeof r!="string")return r;if(it(r))return r.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+r)}function nr(r){try{return typeof r=="string"?JSON.stringify(r):String(r)}catch{return JSON.stringify(r)}}function lu(r,t){return nt(r)?r.has(t):gt(r)&&$t.call(r,t)}function ua(r,t,e){return nt(r)?r.get(t,e):lu(r,t)?typeof r.get=="function"?r.get(t):r[t]:e}function vu(r,t){if(!gt(r))throw new TypeError("Cannot update non-data-structure value: "+r);if(nt(r)){if(!r.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+r);return r.remove(t)}if(!$t.call(r,t))return r;var e=Or(r);return Array.isArray(e)?e.splice(t,1):delete e[t],e}function yu(r,t,e){if(!gt(r))throw new TypeError("Cannot update non-data-structure value: "+r);if(nt(r)){if(!r.set)throw new TypeError("Cannot update immutable value without .set() method: "+r);return r.set(t,e)}if($t.call(r,t)&&e===r[t])return r;var n=Or(r);return n[t]=e,n}function Pt(r,t,e,n){n||(n=e,e=void 0);var i=fa(nt(r),r,sa(t),0,e,n);return i===S?e:i}function fa(r,t,e,n,i,a){var o=t===S;if(n===e.length){var s=o?i:t,u=a(s);return u===s?t:u}if(!o&&!gt(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(e).slice(0,n).map(nr)+"]: "+t);var f=e[n],c=o?S:ua(t,f,S),h=fa(c===S?r:nt(c),c,e,n+1,i,a);return h===c?t:h===S?vu(t,f):yu(o?r?st():{}:t,f,h)}function gu(r,t){return Pt(r,t,function(){return S})}function we(r){return gu(this,r)}var ca="@@__IMMUTABLE_LIST__@@";function ha(r){return!!(r&&r[ca])}var Er=(function(r){function t(e){var n=Tr();if(e==null)return n;if(ha(e))return e;var i=r(e),a=i.size;return a===0?n:(Y(a),a>0&&a<K?ar(0,a,q,null,new mt(i.toArray())):n.withMutations(function(o){o.setSize(a),i.forEach(function(s,u){return o.set(u,s)})}))}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,i){if(n=lt(this,n),n>=0&&n<this.size){n+=this._origin;var a=_a(this,n);return a&&a.array[n&P]}return i},t.prototype.set=function(n,i){return mu(this,n,i)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,i){return this.splice(n,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=q,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Tr()},t.prototype.push=function(){var n=arguments,i=this.size;return this.withMutations(function(a){St(a,0,i+n.length);for(var o=0;o<n.length;o++)a.set(i+o,n[o])})},t.prototype.pop=function(){return St(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(i){St(i,-n.length);for(var a=0;a<n.length;a++)i.set(a,n[a])})},t.prototype.shift=function(){return St(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(i){for(var a=i.size,o,s;a;)o=Math.floor(n()*a--),s=i.get(o),i.set(o,i.get(a)),i.set(a,s)})},t.prototype.concat=function(){for(var n=arguments,i=[],a=0;a<arguments.length;a++){var o=n[a],s=r(typeof o!="string"&&wi(o)?o:[o]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(u){i.forEach(function(f){return f.forEach(function(c){return u.push(c)})})})},t.prototype.setSize=function(n){return St(this,0,n)},t.prototype.map=function(n,i){var a=this;return this.withMutations(function(o){for(var s=0;s<a.size;s++)o.set(s,n.call(i,o.get(s),s,a))})},t.prototype.slice=function(n,i){var a=this.size;return Sr(n,i,a)?this:St(this,Jt(n,a),wr(i,a))},t.prototype.__iterator=function(n,i){var a=i?this.size:0,o=pa(this,i);return new w(function(){var s=o();return s===ir?L():z(n,i?--a:a++,s)})},t.prototype.__iterate=function(n,i){for(var a=i?this.size:0,o=pa(this,i),s;(s=o())!==ir&&n(s,i?--a:a++,this)!==!1;);return a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?ar(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?Tr():(this.__ownerID=n,this.__altered=!1,this)},t})(It);Er.isList=ha;var C=Er.prototype;C[ca]=!0,C[Yt]=C.remove,C.merge=C.concat,C.setIn=pe,C.deleteIn=C.removeIn=we,C.update=_e,C.updateIn=de,C.mergeIn=he,C.mergeDeepIn=ce,C.withMutations=Qt,C.wasAltered=le,C.asImmutable=Xt,C["@@transducer/init"]=C.asMutable=Vt,C["@@transducer/step"]=function(r,t){return r.push(t)},C["@@transducer/result"]=function(r){return r.asImmutable()};var mt=function(t,e){this.array=t,this.ownerID=e};mt.prototype.removeBefore=function(t,e,n){if((n&(1<<e+q)-1)===0||this.array.length===0)return this;var i=n>>>e&P;if(i>=this.array.length)return new mt([],t);var a=i===0,o;if(e>0){var s=this.array[i];if(o=s&&s.removeBefore(t,e-q,n),o===s&&a)return this}if(a&&!o)return this;var u=Nt(this,t);if(!a)for(var f=0;f<i;f++)u.array[f]=void 0;return o&&(u.array[i]=o),u},mt.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e+q:K)||this.array.length===0)return this;var i=n-1>>>e&P;if(i>=this.array.length)return this;var a;if(e>0){var o=this.array[i];if(a=o&&o.removeAfter(t,e-q,n),a===o&&i===this.array.length-1)return this}var s=Nt(this,t);return s.array.splice(i+1),a&&(s.array[i]=a),s};var ir={};function pa(r,t){var e=r._origin,n=r._capacity,i=or(n),a=r._tail;return o(r._root,r._level,0);function o(f,c,h){return c===0?s(f,h):u(f,c,h)}function s(f,c){var h=c===i?a&&a.array:f&&f.array,p=c>e?0:e-c,_=n-c;return _>K&&(_=K),function(){if(p===_)return ir;var d=t?--_:p++;return h&&h[d]}}function u(f,c,h){var p,_=f&&f.array,d=h>e?0:e-h>>c,v=(n-h>>c)+1;return v>K&&(v=K),function(){for(;;){if(p){var I=p();if(I!==ir)return I;p=null}if(d===v)return ir;var y=t?--v:d++;p=o(_&&_[y],c-q,h+(y<<c))}}}}function ar(r,t,e,n,i,a,o){var s=Object.create(C);return s.size=t-r,s._origin=r,s._capacity=t,s._level=e,s._root=n,s._tail=i,s.__ownerID=a,s.__hash=o,s.__altered=!1,s}function Tr(){return ar(0,0,q)}function mu(r,t,e){if(t=lt(r,t),t!==t)return r;if(t>=r.size||t<0)return r.withMutations(function(o){t<0?St(o,t).set(0,e):St(o,0,t+1).set(t,e)});t+=r._origin;var n=r._tail,i=r._root,a=Kr();return t>=or(r._capacity)?n=be(n,r.__ownerID,0,t,e,a):i=be(i,r.__ownerID,r._level,t,e,a),a.value?r.__ownerID?(r._root=i,r._tail=n,r.__hash=void 0,r.__altered=!0,r):ar(r._origin,r._capacity,r._level,i,n):r}function be(r,t,e,n,i,a){var o=n>>>e&P,s=r&&o<r.array.length;if(!s&&i===void 0)return r;var u;if(e>0){var f=r&&r.array[o],c=be(f,t,e-q,n,i,a);return c===f?r:(u=Nt(r,t),u.array[o]=c,u)}return s&&r.array[o]===i?r:(a&&Z(a),u=Nt(r,t),i===void 0&&o===u.array.length-1?u.array.pop():u.array[o]=i,u)}function Nt(r,t){return t&&r&&t===r.ownerID?r:new mt(r?r.array.slice():[],t)}function _a(r,t){if(t>=or(r._capacity))return r._tail;if(t<1<<r._level+q){for(var e=r._root,n=r._level;e&&n>0;)e=e.array[t>>>n&P],n-=q;return e}}function St(r,t,e){t!==void 0&&(t|=0),e!==void 0&&(e|=0);var n=r.__ownerID||new Wr,i=r._origin,a=r._capacity,o=i+t,s=e===void 0?a:e<0?a+e:i+e;if(o===i&&s===a)return r;if(o>=s)return r.clear();for(var u=r._level,f=r._root,c=0;o+c<0;)f=new mt(f&&f.array.length?[void 0,f]:[],n),u+=q,c+=1<<u;c&&(o+=c,i+=c,s+=c,a+=c);for(var h=or(a),p=or(s);p>=1<<u+q;)f=new mt(f&&f.array.length?[f]:[],n),u+=q;var _=r._tail,d=p<h?_a(r,s-1):p>h?new mt([],n):_;if(_&&p>h&&o<a&&_.array.length){f=Nt(f,n);for(var v=f,I=u;I>q;I-=q){var y=h>>>I&P;v=v.array[y]=Nt(v.array[y],n)}v.array[h>>>q&P]=_}if(s<a&&(d=d&&d.removeAfter(n,0,s)),o>=p)o-=p,s-=p,u=q,f=null,d=d&&d.removeBefore(n,0,o);else if(o>i||p<h){for(c=0;f;){var m=o>>>u&P;if(m!==p>>>u&P)break;m&&(c+=(1<<u)*m),u-=q,f=f.array[m]}f&&o>i&&(f=f.removeBefore(n,u,o-c)),f&&p<h&&(f=f.removeAfter(n,u,p-c)),c&&(o-=c,s-=c)}return r.__ownerID?(r.size=s-o,r._origin=o,r._capacity=s,r._level=u,r._root=f,r._tail=d,r.__hash=void 0,r.__altered=!0,r):ar(o,s,u,f,d)}function or(r){return r<K?0:r-1>>>q<<q}function da(r){return ve(r)&&it(r)}var _t=(function(r){function t(e){return e==null?sr():da(e)?e:sr().withMutations(function(n){var i=V(e);Y(i.size),i.forEach(function(a,o){return n.set(o,a)})})}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,i){var a=this._map.get(n);return a!==void 0?this._list.get(a)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):sr()},t.prototype.set=function(n,i){return va(this,n,i)},t.prototype.remove=function(n){return va(this,n,S)},t.prototype.__iterate=function(n,i){var a=this;return this._list.__iterate(function(o){return o&&n(o[1],o[0],a)},i)},t.prototype.__iterator=function(n,i){return this._list.fromEntrySeq().__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n),a=this._list.__ensureOwner(n);return n?Ie(i,a,n,this.__hash):this.size===0?sr():(this.__ownerID=n,this.__altered=!1,this._map=i,this._list=a,this)},t})(J);_t.isOrderedMap=da,_t.prototype[vt]=!0,_t.prototype[Yt]=_t.prototype.remove;function Ie(r,t,e,n){var i=Object.create(_t.prototype);return i.size=r?r.size:0,i._map=r,i._list=t,i.__ownerID=e,i.__hash=n,i.__altered=!1,i}var la;function sr(){return la||(la=Ie(st(),Tr()))}function va(r,t,e){var n=r._map,i=r._list,a=n.get(t),o=a!==void 0,s,u;if(e===S){if(!o)return r;i.size>=K&&i.size>=n.size*2?(u=i.filter(function(f,c){return f!==void 0&&a!==c}),s=u.toKeyedSeq().map(function(f){return f[0]}).flip().toMap(),r.__ownerID&&(s.__ownerID=u.__ownerID=r.__ownerID)):(s=n.remove(t),u=a===i.size-1?i.pop():i.set(a,void 0))}else if(o){if(e===i.get(a)[1])return r;s=n,u=i.set(a,[t,e])}else s=n.set(t,i.size),u=i.set(i.size,[t,e]);return r.__ownerID?(r.size=s.size,r._map=s,r._list=u,r.__hash=void 0,r.__altered=!0,r):Ie(s,u)}var ya="@@__IMMUTABLE_STACK__@@";function qe(r){return!!(r&&r[ya])}var Me=(function(r){function t(e){return e==null?Rr():qe(e)?e:Rr().pushAll(e)}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var a=this._head;for(n=lt(this,n);a&&n--;)a=a.next;return a?a.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,a=this._head,o=arguments.length-1;o>=0;o--)a={value:n[o],next:a};return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):ur(i,a)},t.prototype.pushAll=function(n){if(n=r(n),n.size===0)return this;if(this.size===0&&qe(n))return n;Y(n.size);var i=this.size,a=this._head;return n.__iterate(function(o){i++,a={value:o,next:a}},!0),this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):ur(i,a)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Rr()},t.prototype.slice=function(n,i){if(Sr(n,i,this.size))return this;var a=Jt(n,this.size),o=wr(i,this.size);if(o!==this.size)return r.prototype.slice.call(this,n,i);for(var s=this.size-a,u=this._head;a--;)u=u.next;return this.__ownerID?(this.size=s,this._head=u,this.__hash=void 0,this.__altered=!0,this):ur(s,u)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?ur(this.size,this._head,n,this.__hash):this.size===0?Rr():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var a=this;if(i)return new Bt(this.toArray()).__iterate(function(u,f){return n(u,f,a)},i);for(var o=0,s=this._head;s&&n(s.value,o++,this)!==!1;)s=s.next;return o},t.prototype.__iterator=function(n,i){if(i)return new Bt(this.toArray()).__iterator(n,i);var a=0,o=this._head;return new w(function(){if(o){var s=o.value;return o=o.next,z(n,a++,s)}return L()})},t})(It);Me.isStack=qe;var N=Me.prototype;N[ya]=!0,N.shift=N.pop,N.unshift=N.push,N.unshiftAll=N.pushAll,N.withMutations=Qt,N.wasAltered=le,N.asImmutable=Xt,N["@@transducer/init"]=N.asMutable=Vt,N["@@transducer/step"]=function(r,t){return r.unshift(t)},N["@@transducer/result"]=function(r){return r.asImmutable()};function ur(r,t,e,n){var i=Object.create(N);return i.size=r,i._head=t,i.__ownerID=e,i.__hash=n,i.__altered=!1,i}var ga;function Rr(){return ga||(ga=ur(0))}function ma(r,t,e,n,i,a){return Y(r.size),r.__iterate(function(o,s,u){i?(i=!1,e=o):e=t.call(n,e,o,s,u)},a),e}function Su(r,t){return t}function wu(r,t){return[t,r]}function Oe(r){return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return!r.apply(this,t)}}function Sa(r){return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return-r.apply(this,t)}}function wa(r,t){return r<t?1:r>t?-1:0}function ba(r,t){if(r===t)return!0;if(!F(t)||r.size!==void 0&&t.size!==void 0&&r.size!==t.size||r.__hash!==void 0&&t.__hash!==void 0&&r.__hash!==t.__hash||R(r)!==R(t)||X(r)!==X(t)||it(r)!==it(t))return!1;if(r.size===0&&t.size===0)return!0;var e=!Fr(r);if(it(r)){var n=r.entries();return t.every(function(u,f){var c=n.next().value;return c&&G(c[1],u)&&(e||G(c[0],f))})&&n.next().done}var i=!1;if(r.size===void 0)if(t.size===void 0)typeof r.cacheResult=="function"&&r.cacheResult();else{i=!0;var a=r;r=t,t=a}var o=!0,s=t.__iterate(function(u,f){if(e?!r.has(u):i?!G(u,r.get(f,S)):!G(r.get(f,S),u))return o=!1,!1});return o&&r.size===s}var bu=(function(r){function t(e,n,i){if(i===void 0&&(i=1),!(this instanceof t))return new t(e,n,i);if(tr(i!==0,"Cannot step a Range by 0"),tr(e!==void 0,"You must define a start value when using Range"),tr(n!==void 0,"You must define an end value when using Range"),i=Math.abs(i),n<e&&(i=-i),this._start=e,this._end=n,this._step=i,this.size=Math.max(0,Math.ceil((n-e)/i-1)+1),this.size===0){if(Ee)return Ee;Ee=this}}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,i){return this.has(n)?this._start+lt(this,n)*this._step:i},t.prototype.includes=function(n){var i=(n-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(n,i){return Sr(n,i,this.size)?this:(n=Jt(n,this.size),i=wr(i,this.size),i<=n?new t(0,0):new t(this.get(n,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(n){var i=n-this._start;if(i%this._step===0){var a=i/this._step;if(a>=0&&a<this.size)return a}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,i){for(var a=this.size,o=this._step,s=i?this._start+(a-1)*o:this._start,u=0;u!==a&&n(s,i?a-++u:u++,this)!==!1;)s+=i?-o:o;return u},t.prototype.__iterator=function(n,i){var a=this.size,o=this._step,s=i?this._start+(a-1)*o:this._start,u=0;return new w(function(){if(u===a)return L();var f=s;return s+=i?-o:o,z(n,i?a-++u:u++,f)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:ba(this,n)},t})(tt),Ee,Ia="@@__IMMUTABLE_SET__@@";function Te(r){return!!(r&&r[Ia])}var ut=(function(r){function t(e){return e==null?fr():Te(e)&&!it(e)?e:fr().withMutations(function(n){var i=r(e);Y(i.size),i.forEach(function(a){return n.add(a)})})}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(V(n).keySeq())},t.intersect=function(n){return n=j(n).toArray(),n.length?k.intersect.apply(t(n.pop()),n):fr()},t.union=function(n){return n=j(n).toArray(),n.length?k.union.apply(t(n.pop()),n):fr()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return zr(this,this._map.set(n,n))},t.prototype.remove=function(n){return zr(this,this._map.remove(n))},t.prototype.clear=function(){return zr(this,this._map.clear())},t.prototype.map=function(n,i){var a=this,o=!1,s=zr(this,this._map.mapEntries(function(u){var f=u[1],c=n.call(i,f,f,a);return c!==f&&(o=!0),[c,c]},i));return o?s:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(a){return a.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(a){for(var o=0;o<n.length;o++)typeof n[o]=="string"?a.add(n[o]):r(n[o]).forEach(function(s){return a.add(s)})})},t.prototype.intersect=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(o){return r(o)});var a=[];return this.forEach(function(o){n.every(function(s){return s.includes(o)})||a.push(o)}),this.withMutations(function(o){a.forEach(function(s){o.remove(s)})})},t.prototype.subtract=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(o){return r(o)});var a=[];return this.forEach(function(o){n.some(function(s){return s.includes(o)})&&a.push(o)}),this.withMutations(function(o){a.forEach(function(s){o.remove(s)})})},t.prototype.sort=function(n){return hr(jt(this,n))},t.prototype.sortBy=function(n,i){return hr(jt(this,i,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,i){var a=this;return this._map.__iterate(function(o){return n(o,o,a)},i)},t.prototype.__iterator=function(n,i){return this._map.__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n);return n?this.__make(i,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=i,this)},t})(zt);ut.isSet=Te;var k=ut.prototype;k[Ia]=!0,k[Yt]=k.remove,k.merge=k.concat=k.union,k.withMutations=Qt,k.asImmutable=Xt,k["@@transducer/init"]=k.asMutable=Vt,k["@@transducer/step"]=function(r,t){return r.add(t)},k["@@transducer/result"]=function(r){return r.asImmutable()},k.__empty=fr,k.__make=qa;function zr(r,t){return r.__ownerID?(r.size=t.size,r._map=t,r):t===r._map?r:t.size===0?r.__empty():r.__make(t)}function qa(r,t){var e=Object.create(k);return e.size=r?r.size:0,e._map=r,e.__ownerID=t,e}var Ma;function fr(){return Ma||(Ma=qa(st()))}function Oa(r,t,e){for(var n=sa(t),i=0;i!==n.length;)if(r=ua(r,n[i++],S),r===S)return e;return r}function Ea(r,t){return Oa(this,r,t)}function Iu(r,t){return Oa(r,t,S)!==S}function qu(r){return Iu(this,r)}function Ta(){Y(this.size);var r={};return this.__iterate(function(t,e){r[e]=t}),r}function Ar(r){if(!r||typeof r!="object")return r;if(!F(r)){if(!gt(r))return r;r=D(r)}if(R(r)){var t={};return r.__iterate(function(n,i){t[i]=Ar(n)}),t}var e=[];return r.__iterate(function(n){e.push(Ar(n))}),e}function Mu(r){if(r.size===1/0)return 0;var t=it(r),e=R(r),n=t?1:0;return r.__iterate(e?t?function(i,a){n=31*n+Ra(W(i),W(a))|0}:function(i,a){n=n+Ra(W(i),W(a))|0}:t?function(i){n=31*n+W(i)|0}:function(i){n=n+W(i)|0}),Ou(r.size,n)}function Ou(r,t){return t=Zt(t,3432918353),t=Zt(t<<15|t>>>-15,461845907),t=Zt(t<<13|t>>>-13,5),t=(t+3864292196|0)^r,t=Zt(t^t>>>16,2246822507),t=Zt(t^t>>>13,3266489909),t=br(t^t>>>16),t}function Ra(r,t){return r^t+2654435769+(r<<6)+(r>>2)|0}function Ot(r,t){var e=function(n){r.prototype[n]=t[n]};return Object.keys(t).forEach(e),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(e),r}j.Iterator=w,Ot(j,{toArray:function(){Y(this.size);var t=new Array(this.size||0),e=R(this),n=0;return this.__iterate(function(i,a){t[n++]=e?[a,i]:i}),t},toIndexedSeq:function(){return new ji(this)},toJS:function(){return Ar(this)},toKeyedSeq:function(){return new Ir(this,!0)},toMap:function(){return J(this.toKeyedSeq())},toObject:Ta,toOrderedMap:function(){return _t(this.toKeyedSeq())},toOrderedSet:function(){return hr(R(this)?this.valueSeq():this)},toSet:function(){return ut(R(this)?this.valueSeq():this)},toSetSeq:function(){return new xi(this)},toSeq:function(){return X(this)?this.toIndexedSeq():R(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Me(R(this)?this.valueSeq():this)},toList:function(){return Er(R(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return this.size===0?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return M(this,Zs(this,t))},includes:function(t){return this.some(function(e){return G(e,t)})},entries:function(){return this.__iterator(H)},every:function(t,e){Y(this.size);var n=!0;return this.__iterate(function(i,a,o){if(!t.call(e,i,a,o))return n=!1,!1}),n},filter:function(t,e){return M(this,Di(this,t,e,!0))},partition:function(t,e){return Js(this,t,e)},find:function(t,e,n){var i=this.findEntry(t,e);return i?i[1]:n},forEach:function(t,e){return Y(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Y(this.size),t=t!==void 0?""+t:",";var e="",n=!0;return this.__iterate(function(i){n?n=!1:e+=t,e+=i!=null?i.toString():""}),e},keys:function(){return this.__iterator(At)},map:function(t,e){return M(this,Ni(this,t,e))},reduce:function(t,e,n){return ma(this,t,e,n,arguments.length<2,!1)},reduceRight:function(t,e,n){return ma(this,t,e,n,arguments.length<2,!0)},reverse:function(){return M(this,ie(this,!0))},slice:function(t,e){return M(this,ae(this,t,e,!0))},some:function(t,e){Y(this.size);var n=!1;return this.__iterate(function(i,a,o){if(t.call(e,i,a,o))return n=!0,!1}),n},sort:function(t){return M(this,jt(this,t))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,e){return Ct(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return Gs(this,t,e)},equals:function(t){return ba(this,t)},entrySeq:function(){var t=this;if(t._cache)return new Bt(t._cache);var e=t.toSeq().map(wu).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Oe(t),e)},findEntry:function(t,e,n){var i=n;return this.__iterate(function(a,o,s){if(t.call(e,a,o,s))return i=[o,a],!1}),i},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(Ii,null,t)},flatMap:function(t,e){return M(this,Qs(this,t,e))},flatten:function(t){return M(this,Ui(this,t,!0))},fromEntrySeq:function(){return new Li(this)},get:function(t,e){return this.find(function(n,i){return G(i,t)},void 0,e)},getIn:Ea,groupBy:function(t,e){return Ys(this,t,e)},has:function(t){return this.get(t,S)!==S},hasIn:qu,isSubset:function(t){return t=typeof t.includes=="function"?t:j(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:j(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(e){return G(e,t)})},keySeq:function(){return this.toSeq().map(Su).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return qr(this,t)},maxBy:function(t,e){return qr(this,e,t)},min:function(t){return qr(this,t?Sa(t):wa)},minBy:function(t,e){return qr(this,e?Sa(e):wa,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return M(this,Fi(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Oe(t),e)},sortBy:function(t,e){return M(this,jt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return M(this,Xs(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Oe(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=Mu(this))}});var x=j.prototype;x[mi]=!0,x[gr]=x.values,x.toJSON=x.toArray,x.__toStringMapper=nr,x.inspect=x.toSource=function(){return this.toString()},x.chain=x.flatMap,x.contains=x.includes,Ot(V,{flip:function(){return M(this,Pi(this))},mapEntries:function(t,e){var n=this,i=0;return M(this,this.toSeq().map(function(a,o){return t.call(e,[o,a],i++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return M(this,this.toSeq().flip().map(function(i,a){return t.call(e,i,a,n)}).flip())}});var cr=V.prototype;cr[yr]=!0,cr[gr]=x.entries,cr.toJSON=Ta,cr.__toStringMapper=function(r,t){return nr(t)+": "+nr(r)},Ot(It,{toKeyedSeq:function(){return new Ir(this,!1)},filter:function(t,e){return M(this,Di(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return e===void 0?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return e===void 0?-1:e},reverse:function(){return M(this,ie(this,!1))},slice:function(t,e){return M(this,ae(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(e||0,0),n===0||n===2&&!e)return this;t=Jt(t,t<0?this.count():this.size);var i=this.slice(0,t);return M(this,n===1?i:i.concat(ot(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return M(this,Ui(this,t,!1))},get:function(t,e){return t=lt(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?e:this.find(function(n,i){return i===t},void 0,e)},has:function(t){return t=lt(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.indexOf(t)!==-1)},interpose:function(t){return M(this,tu(this,t))},interleave:function(){var t=[this].concat(ot(arguments)),e=Mr(this.toSeq(),tt.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),M(this,n)},keySeq:function(){return bu(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return M(this,Fi(this,t,e,!1))},zip:function(){var t=[this].concat(ot(arguments));return M(this,Mr(this,za,t))},zipAll:function(){var t=[this].concat(ot(arguments));return M(this,Mr(this,za,t,!0))},zipWith:function(t){var e=ot(arguments);return e[0]=this,M(this,Mr(this,t,e))}});var Dt=It.prototype;Dt[vr]=!0,Dt[vt]=!0,Ot(zt,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Ft=zt.prototype;Ft.has=x.includes,Ft.contains=Ft.includes,Ft.keys=Ft.values,Ot(yt,cr),Ot(tt,Dt),Ot(kt,Ft);function za(){return ot(arguments)}function Aa(r){return Te(r)&&it(r)}var hr=(function(r){function t(e){return e==null?Re():Aa(e)?e:Re().withMutations(function(n){var i=zt(e);Y(i.size),i.forEach(function(a){return n.add(a)})})}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(V(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(ut);hr.isOrderedSet=Aa;var Et=hr.prototype;Et[vt]=!0,Et.zip=Dt.zip,Et.zipWith=Dt.zipWith,Et.zipAll=Dt.zipAll,Et.__empty=Re,Et.__make=Ca;function Ca(r,t){var e=Object.create(Et);return e.size=r?r.size:0,e._map=r,e.__ownerID=t,e}var $a;function Re(){return $a||($a=Ca(sr()))}function Eu(r){if(qt(r))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(nt(r))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(r===null||typeof r!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var A=function(t,e){var n;Eu(t);var i=function(s){var u=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!n){n=!0;var f=Object.keys(t),c=a._indices={};a._name=e,a._keys=f,a._defaultValues=t;for(var h=0;h<f.length;h++){var p=f[h];c[p]=h,a[p]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+Ae(this)+' with property "'+p+'" since that property name is part of the Record API.'):Tu(a,p)}}return this.__ownerID=void 0,this._values=Er().withMutations(function(_){_.setSize(u._keys.length),V(s).forEach(function(d,v){_.set(u._indices[v],d===u._defaultValues[v]?void 0:d)})}),this},a=i.prototype=Object.create(O);return a.constructor=i,e&&(i.displayName=e),i};A.prototype.toString=function(){for(var t=Ae(this)+" { ",e=this._keys,n,i=0,a=e.length;i!==a;i++)n=e[i],t+=(i?", ":"")+n+": "+nr(this.get(n));return t+" }"},A.prototype.equals=function(t){return this===t||qt(t)&&Ut(this).equals(Ut(t))},A.prototype.hashCode=function(){return Ut(this).hashCode()},A.prototype.has=function(t){return this._indices.hasOwnProperty(t)},A.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._indices[t],i=this._values.get(n);return i===void 0?this._defaultValues[t]:i},A.prototype.set=function(t,e){if(this.has(t)){var n=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(n!==this._values&&!this.__ownerID)return ze(this,n)}return this},A.prototype.remove=function(t){return this.set(t)},A.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ze(this,t)},A.prototype.wasAltered=function(){return this._values.wasAltered()},A.prototype.toSeq=function(){return Ut(this)},A.prototype.toJS=function(){return Ar(this)},A.prototype.entries=function(){return this.__iterator(H)},A.prototype.__iterator=function(t,e){return Ut(this).__iterator(t,e)},A.prototype.__iterate=function(t,e){return Ut(this).__iterate(t,e)},A.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?ze(this,e,t):(this.__ownerID=t,this._values=e,this)},A.isRecord=qt,A.getDescriptiveName=Ae;var O=A.prototype;O[Oi]=!0,O[Yt]=O.remove,O.deleteIn=O.removeIn=we,O.getIn=Ea,O.hasIn=x.hasIn,O.merge=Ji,O.mergeWith=Xi,O.mergeIn=he,O.mergeDeep=Zi,O.mergeDeepWith=Qi,O.mergeDeepIn=ce,O.setIn=pe,O.update=_e,O.updateIn=de,O.withMutations=Qt,O.asMutable=Vt,O.asImmutable=Xt,O[gr]=O.entries,O.toJSON=O.toObject=x.toObject,O.inspect=O.toSource=function(){return this.toString()};function ze(r,t,e){var n=Object.create(Object.getPrototypeOf(r));return n._values=t,n.__ownerID=e,n}function Ae(r){return r.constructor.displayName||r.constructor.name||"Record"}function Ut(r){return Xr(r._keys.map(function(t){return[t,r.get(t)]}))}function Tu(r,t){try{Object.defineProperty(r,t,{get:function(){return this.get(t)},set:function(e){tr(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch{}}var Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ru(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ce,ka;function Ba(){if(ka)return Ce;ka=1;function r(t,e){for(var n=-1,i=e.length,a=t.length;++n<i;)t[a+n]=e[n];return t}return Ce=r,Ce}var $e,ja;function zu(){if(ja)return $e;ja=1;var r=typeof Cr=="object"&&Cr&&Cr.Object===Object&&Cr;return $e=r,$e}var ke,xa;function Be(){if(xa)return ke;xa=1;var r=zu(),t=typeof self=="object"&&self&&self.Object===Object&&self,e=r||t||Function("return this")();return ke=e,ke}var je,La;function $r(){if(La)return je;La=1;var r=Be(),t=r.Symbol;return je=t,je}var xe,Pa;function Au(){if(Pa)return xe;Pa=1;var r=$r(),t=Object.prototype,e=t.hasOwnProperty,n=t.toString,i=r?r.toStringTag:void 0;function a(o){var s=e.call(o,i),u=o[i];try{o[i]=void 0;var f=!0}catch{}var c=n.call(o);return f&&(s?o[i]=u:delete o[i]),c}return xe=a,xe}var Le,Na;function Cu(){if(Na)return Le;Na=1;var r=Object.prototype,t=r.toString;function e(n){return t.call(n)}return Le=e,Le}var Pe,Da;function kr(){if(Da)return Pe;Da=1;var r=$r(),t=Au(),e=Cu(),n="[object Null]",i="[object Undefined]",a=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?i:n:a&&a in Object(s)?t(s):e(s)}return Pe=o,Pe}var Ne,Fa;function Br(){if(Fa)return Ne;Fa=1;function r(t){return t!=null&&typeof t=="object"}return Ne=r,Ne}var De,Ua;function $u(){if(Ua)return De;Ua=1;var r=kr(),t=Br(),e="[object Arguments]";function n(i){return t(i)&&r(i)==e}return De=n,De}var Fe,Ha;function Ka(){if(Ha)return Fe;Ha=1;var r=$u(),t=Br(),e=Object.prototype,n=e.hasOwnProperty,i=e.propertyIsEnumerable,a=r((function(){return arguments})())?r:function(o){return t(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return Fe=a,Fe}var Ue,Wa;function wt(){if(Wa)return Ue;Wa=1;var r=Array.isArray;return Ue=r,Ue}var He,Ga;function ku(){if(Ga)return He;Ga=1;var r=$r(),t=Ka(),e=wt(),n=r?r.isConcatSpreadable:void 0;function i(a){return e(a)||t(a)||!!(n&&a&&a[n])}return He=i,He}var Ke,Ya;function Bu(){if(Ya)return Ke;Ya=1;var r=Ba(),t=ku();function e(n,i,a,o,s){var u=-1,f=n.length;for(a||(a=t),s||(s=[]);++u<f;){var c=n[u];i>0&&a(c)?i>1?e(c,i-1,a,o,s):r(s,c):o||(s[s.length]=c)}return s}return Ke=e,Ke}var We,Ja;function ju(){if(Ja)return We;Ja=1;function r(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}return We=r,We}var Ge,Xa;function xu(){if(Xa)return Ge;Xa=1;var r=Ba(),t=Bu(),e=ju(),n=wt();function i(){var a=arguments.length;if(!a)return[];for(var o=Array(a-1),s=arguments[0],u=a;u--;)o[u-1]=arguments[u];return r(n(s)?e(s):[s],t(o,1))}return Ge=i,Ge}xu();var Ye,Va;function Lu(){if(Va)return Ye;Va=1;function r(t,e){return t!=null&&e in Object(t)}return Ye=r,Ye}var Je,Za;function jr(){if(Za)return Je;Za=1;var r=kr(),t=Br(),e="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&r(i)==e}return Je=n,Je}var Xe,Qa;function Pu(){if(Qa)return Xe;Qa=1;var r=wt(),t=jr(),e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(r(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:n.test(a)||!e.test(a)||o!=null&&a in Object(o)}return Xe=i,Xe}var Ve,to;function Ze(){if(to)return Ve;to=1;function r(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}return Ve=r,Ve}var Qe,ro;function Nu(){if(ro)return Qe;ro=1;var r=kr(),t=Ze(),e="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var u=r(s);return u==n||u==i||u==e||u==a}return Qe=o,Qe}var tn,eo;function Du(){if(eo)return tn;eo=1;var r=Be(),t=r["__core-js_shared__"];return tn=t,tn}var rn,no;function Fu(){if(no)return rn;no=1;var r=Du(),t=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function e(n){return!!t&&t in n}return rn=e,rn}var en,io;function Uu(){if(io)return en;io=1;var r=Function.prototype,t=r.toString;function e(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return en=e,en}var nn,ao;function Hu(){if(ao)return nn;ao=1;var r=Nu(),t=Fu(),e=Ze(),n=Uu(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,f=s.hasOwnProperty,c=RegExp("^"+u.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(p){if(!e(p)||t(p))return!1;var _=r(p)?c:a;return _.test(n(p))}return nn=h,nn}var an,oo;function Ku(){if(oo)return an;oo=1;function r(t,e){return t?.[e]}return an=r,an}var on,so;function uo(){if(so)return on;so=1;var r=Hu(),t=Ku();function e(n,i){var a=t(n,i);return r(a)?a:void 0}return on=e,on}var sn,fo;function xr(){if(fo)return sn;fo=1;var r=uo(),t=r(Object,"create");return sn=t,sn}var un,co;function Wu(){if(co)return un;co=1;var r=xr();function t(){this.__data__=r?r(null):{},this.size=0}return un=t,un}var fn,ho;function Gu(){if(ho)return fn;ho=1;function r(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}return fn=r,fn}var cn,po;function Yu(){if(po)return cn;po=1;var r=xr(),t="__lodash_hash_undefined__",e=Object.prototype,n=e.hasOwnProperty;function i(a){var o=this.__data__;if(r){var s=o[a];return s===t?void 0:s}return n.call(o,a)?o[a]:void 0}return cn=i,cn}var hn,_o;function Ju(){if(_o)return hn;_o=1;var r=xr(),t=Object.prototype,e=t.hasOwnProperty;function n(i){var a=this.__data__;return r?a[i]!==void 0:e.call(a,i)}return hn=n,hn}var pn,lo;function Xu(){if(lo)return pn;lo=1;var r=xr(),t="__lodash_hash_undefined__";function e(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=r&&i===void 0?t:i,this}return pn=e,pn}var _n,vo;function Vu(){if(vo)return _n;vo=1;var r=Wu(),t=Gu(),e=Yu(),n=Ju(),i=Xu();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var f=o[s];this.set(f[0],f[1])}}return a.prototype.clear=r,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=n,a.prototype.set=i,_n=a,_n}var dn,yo;function Zu(){if(yo)return dn;yo=1;function r(){this.__data__=[],this.size=0}return dn=r,dn}var ln,go;function Qu(){if(go)return ln;go=1;function r(t,e){return t===e||t!==t&&e!==e}return ln=r,ln}var vn,mo;function Lr(){if(mo)return vn;mo=1;var r=Qu();function t(e,n){for(var i=e.length;i--;)if(r(e[i][0],n))return i;return-1}return vn=t,vn}var yn,So;function tf(){if(So)return yn;So=1;var r=Lr(),t=Array.prototype,e=t.splice;function n(i){var a=this.__data__,o=r(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():e.call(a,o,1),--this.size,!0}return yn=n,yn}var gn,wo;function rf(){if(wo)return gn;wo=1;var r=Lr();function t(e){var n=this.__data__,i=r(n,e);return i<0?void 0:n[i][1]}return gn=t,gn}var mn,bo;function ef(){if(bo)return mn;bo=1;var r=Lr();function t(e){return r(this.__data__,e)>-1}return mn=t,mn}var Sn,Io;function nf(){if(Io)return Sn;Io=1;var r=Lr();function t(e,n){var i=this.__data__,a=r(i,e);return a<0?(++this.size,i.push([e,n])):i[a][1]=n,this}return Sn=t,Sn}var wn,qo;function af(){if(qo)return wn;qo=1;var r=Zu(),t=tf(),e=rf(),n=ef(),i=nf();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var f=o[s];this.set(f[0],f[1])}}return a.prototype.clear=r,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=n,a.prototype.set=i,wn=a,wn}var bn,Mo;function of(){if(Mo)return bn;Mo=1;var r=uo(),t=Be(),e=r(t,"Map");return bn=e,bn}var In,Oo;function sf(){if(Oo)return In;Oo=1;var r=Vu(),t=af(),e=of();function n(){this.size=0,this.__data__={hash:new r,map:new(e||t),string:new r}}return In=n,In}var qn,Eo;function uf(){if(Eo)return qn;Eo=1;function r(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}return qn=r,qn}var Mn,To;function Pr(){if(To)return Mn;To=1;var r=uf();function t(e,n){var i=e.__data__;return r(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Mn=t,Mn}var On,Ro;function ff(){if(Ro)return On;Ro=1;var r=Pr();function t(e){var n=r(this,e).delete(e);return this.size-=n?1:0,n}return On=t,On}var En,zo;function cf(){if(zo)return En;zo=1;var r=Pr();function t(e){return r(this,e).get(e)}return En=t,En}var Tn,Ao;function hf(){if(Ao)return Tn;Ao=1;var r=Pr();function t(e){return r(this,e).has(e)}return Tn=t,Tn}var Rn,Co;function pf(){if(Co)return Rn;Co=1;var r=Pr();function t(e,n){var i=r(this,e),a=i.size;return i.set(e,n),this.size+=i.size==a?0:1,this}return Rn=t,Rn}var zn,$o;function _f(){if($o)return zn;$o=1;var r=sf(),t=ff(),e=cf(),n=hf(),i=pf();function a(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var f=o[s];this.set(f[0],f[1])}}return a.prototype.clear=r,a.prototype.delete=t,a.prototype.get=e,a.prototype.has=n,a.prototype.set=i,zn=a,zn}var An,ko;function df(){if(ko)return An;ko=1;var r=_f(),t="Expected a function";function e(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],u=a.cache;if(u.has(s))return u.get(s);var f=n.apply(this,o);return a.cache=u.set(s,f)||u,f};return a.cache=new(e.Cache||r),a}return e.Cache=r,An=e,An}var Cn,Bo;function lf(){if(Bo)return Cn;Bo=1;var r=df(),t=500;function e(n){var i=r(n,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return Cn=e,Cn}var $n,jo;function vf(){if(jo)return $n;jo=1;var r=lf(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e=/\\(\\)?/g,n=r(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,u,f){a.push(u?f.replace(e,"$1"):s||o)}),a});return $n=n,$n}var kn,xo;function yf(){if(xo)return kn;xo=1;function r(t,e){for(var n=-1,i=t==null?0:t.length,a=Array(i);++n<i;)a[n]=e(t[n],n,t);return a}return kn=r,kn}var Bn,Lo;function jn(){if(Lo)return Bn;Lo=1;var r=$r(),t=yf(),e=wt(),n=jr(),i=r?r.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(e(s))return t(s,o)+"";if(n(s))return a?a.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Bn=o,Bn}var xn,Po;function Ln(){if(Po)return xn;Po=1;var r=jn();function t(e){return e==null?"":r(e)}return xn=t,xn}var Pn,No;function gf(){if(No)return Pn;No=1;var r=wt(),t=Pu(),e=vf(),n=Ln();function i(a,o){return r(a)?a:t(a,o)?[a]:e(n(a))}return Pn=i,Pn}var Nn,Do;function mf(){if(Do)return Nn;Do=1;var r=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function e(n,i){var a=typeof n;return i=i??r,!!i&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return Nn=e,Nn}var Dn,Fo;function Sf(){if(Fo)return Dn;Fo=1;var r=9007199254740991;function t(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=r}return Dn=t,Dn}var Fn,Uo;function wf(){if(Uo)return Fn;Uo=1;var r=jr();function t(e){if(typeof e=="string"||r(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}return Fn=t,Fn}var Un,Ho;function bf(){if(Ho)return Un;Ho=1;var r=gf(),t=Ka(),e=wt(),n=mf(),i=Sf(),a=wf();function o(s,u,f){u=r(u,s);for(var c=-1,h=u.length,p=!1;++c<h;){var _=a(u[c]);if(!(p=s!=null&&f(s,_)))break;s=s[_]}return p||++c!=h?p:(h=s==null?0:s.length,!!h&&i(h)&&n(_,h)&&(e(s)||t(s)))}return Un=o,Un}var Hn,Ko;function If(){if(Ko)return Hn;Ko=1;var r=Lu(),t=bf();function e(n,i){return n!=null&&t(n,i,r)}return Hn=e,Hn}If();var Kn,Wo;function qf(){if(Wo)return Kn;Wo=1;var r=Math.max,t=Math.min;function e(n,i,a){return n>=t(i,a)&&n<r(i,a)}return Kn=e,Kn}var Wn,Go;function Mf(){if(Go)return Wn;Go=1;var r=/\s/;function t(e){for(var n=e.length;n--&&r.test(e.charAt(n)););return n}return Wn=t,Wn}var Gn,Yo;function Of(){if(Yo)return Gn;Yo=1;var r=Mf(),t=/^\s+/;function e(n){return n&&n.slice(0,r(n)+1).replace(t,"")}return Gn=e,Gn}var Yn,Jo;function Xo(){if(Jo)return Yn;Jo=1;var r=Of(),t=Ze(),e=jr(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(f){if(typeof f=="number")return f;if(e(f))return n;if(t(f)){var c=typeof f.valueOf=="function"?f.valueOf():f;f=t(c)?c+"":c}if(typeof f!="string")return f===0?f:+f;f=r(f);var h=a.test(f);return h||o.test(f)?s(f.slice(2),h?2:8):i.test(f)?n:+f}return Yn=u,Yn}var Jn,Vo;function Zo(){if(Vo)return Jn;Vo=1;var r=Xo(),t=1/0,e=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=r(i),i===t||i===-t){var a=i<0?-1:1;return a*e}return i===i?i:0}return Jn=n,Jn}var Xn,Qo;function Ef(){if(Qo)return Xn;Qo=1;var r=qf(),t=Zo(),e=Xo();function n(i,a,o){return a=t(a),o===void 0?(o=a,a=0):o=t(o),i=e(i),r(i,a,o)}return Xn=n,Xn}var Tf=Ef();const Rf=Ru(Tf);var Vn,ts;function Zn(){if(ts)return Vn;ts=1;var r=Zo();function t(e){var n=r(e),i=n%1;return n===n?i?n-i:n:0}return Vn=t,Vn}var Qn,rs;function zf(){if(rs)return Qn;rs=1;var r=Zn();function t(e){return typeof e=="number"&&e==r(e)}return Qn=t,Qn}zf();var ti,es;function ns(){if(es)return ti;es=1;function r(t,e,n){var i=-1,a=t.length;e<0&&(e=-e>a?0:a+e),n=n>a?a:n,n<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(a);++i<a;)o[i]=t[i+e];return o}return ti=r,ti}var ri,is;function Af(){if(is)return ri;is=1;var r=ns(),t=Zn();function e(n,i,a){return n&&n.length?(i=a||i===void 0?1:t(i),r(n,0,i<0?0:i)):[]}return ri=e,ri}Af();const pr="black",_r="white",rt=null;class as extends A({dimensions:19,moves:J()},"Board"){constructor(t=19,...e){super({dimensions:t,moves:J(e.map(n=>[n.coordinate,n.color]))})}toMap(t=null){const e={[pr]:pr,[_r]:_r,[rt]:rt},n=t||e;return Array(this.dimensions).fill(rt).map((i,a)=>Array(this.dimensions).fill(rt).map((o,s)=>{const u=this.moves.get(et(s,a),rt);return n[u]||e[u]}))}}function os(...r){return Reflect.construct(as,r)}os.prototype=as.prototype;class ss extends A({x:0,y:0},"Coordinate"){constructor(t,e){super({x:t,y:e})}}function et(...r){return Reflect.construct(ss,r)}et.prototype=ss.prototype;class us extends A({coordinate:et(),color:rt},"Move"){constructor(t,e){super({coordinate:t,color:e})}}function fs(...r){return Reflect.construct(us,r)}fs.prototype=us.prototype,et(4,4),et(6,6),et(9,9);function Cf(r,t){const{x:e,y:n}=t,i=a=>Rf(a,r.dimensions);return ut.of(et(e,n+1),et(e,n-1),et(e+1,n),et(e-1,n)).filter(a=>i(a.x)&&i(a.y))}function Nr(r,t,e){const n=e===void 0?r.moves.get(t,rt):e;return Cf(r,t).filter(i=>r.moves.get(i,rt)===n)}function cs(r,t){let e=ut(),n=ut.of(t);for(;!n.isEmpty();){const i=n.first(),a=Nr(r,i);e=e.add(i),n=n.rest().union(a.subtract(e))}return e}function hs(r){return r===pr?_r:r===_r?pr:rt}function $f(r,t){return cs(r,t).reduce((e,n)=>e.union(Nr(r,n,rt)),ut())}function ei(r,t){return $f(r,t).size}function ps(r,t){const e=ei(r.setIn(["moves",t.coordinate],t.color),t.coordinate)>0,n=Nr(r,t.coordinate,hs(t.color)).some(i=>ei(r,i)===1);return e||n}function kf(r,t){return r.setIn(["moves"],t.reduce((e,n)=>e.delete(n),r.moves))}function Bf(r,t){if(!ps(r,t))throw new Error("Not a valid position");if(r.moves.has(t.coordinate))throw new Error("There is already a stone there");const e=Nr(r,t.coordinate,hs(t.color)).reduce((n,i)=>n.union(ei(r,i)===1?cs(r,i):ut()),ut());return kf(r,e).setIn(["moves",t.coordinate],t.color)}const bt={BLACK:pr,Board:os,Coordinate:et,EMPTY:rt,Move:fs,WHITE:_r,addMove:Bf,isLegalMove:ps};wt();var ni,_s;function jf(){if(_s)return ni;_s=1;var r=kr(),t=wt(),e=Br(),n="[object String]";function i(a){return typeof a=="string"||!t(a)&&e(a)&&r(a)==n}return ni=i,ni}jf();var ii,ds;function xf(){if(ds)return ii;ds=1;function r(t,e,n){return t===t&&(n!==void 0&&(t=t<=n?t:n),e!==void 0&&(t=t>=e?t:e)),t}return ii=r,ii}var ai,ls;function Lf(){if(ls)return ai;ls=1;var r=xf(),t=jn(),e=Zn(),n=Ln();function i(a,o,s){return a=n(a),s=s==null?0:r(e(s),0,a.length),o=t(o),a.slice(s,s+o.length)==o}return ai=i,ai}Lf();var oi,vs;function Pf(){if(vs)return oi;vs=1;var r=ns();function t(e,n,i){var a=e.length;return i=i===void 0?a:i,!n&&i>=a?e:r(e,n,i)}return oi=t,oi}var si,ys;function Nf(){if(ys)return si;ys=1;function r(t,e,n,i){for(var a=t.length,o=n+(i?1:-1);i?o--:++o<a;)if(e(t[o],o,t))return o;return-1}return si=r,si}var ui,gs;function Df(){if(gs)return ui;gs=1;function r(t){return t!==t}return ui=r,ui}var fi,ms;function Ff(){if(ms)return fi;ms=1;function r(t,e,n){for(var i=n-1,a=t.length;++i<a;)if(t[i]===e)return i;return-1}return fi=r,fi}var ci,Ss;function Uf(){if(Ss)return ci;Ss=1;var r=Nf(),t=Df(),e=Ff();function n(i,a,o){return a===a?e(i,a,o):r(i,t,o)}return ci=n,ci}var hi,ws;function Hf(){if(ws)return hi;ws=1;var r=Uf();function t(e,n){for(var i=-1,a=e.length;++i<a&&r(n,e[i],0)>-1;);return i}return hi=t,hi}var pi,bs;function Kf(){if(bs)return pi;bs=1;function r(t){return t.split("")}return pi=r,pi}var _i,Is;function Wf(){if(Is)return _i;Is=1;var r="\\ud800-\\udfff",t="\\u0300-\\u036f",e="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+e+n,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+i+a+"]");function u(f){return s.test(f)}return _i=u,_i}var di,qs;function Gf(){if(qs)return di;qs=1;var r="\\ud800-\\udfff",t="\\u0300-\\u036f",e="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+e+n,a="\\ufe0e\\ufe0f",o="["+r+"]",s="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",f="(?:"+s+"|"+u+")",c="[^"+r+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",_="\\u200d",d=f+"?",v="["+a+"]?",I="(?:"+_+"(?:"+[c,h,p].join("|")+")"+v+d+")*",y=v+d+I,m="(?:"+[c+s+"?",s,h,p,o].join("|")+")",l=RegExp(u+"(?="+u+")|"+m+y,"g");function g(b){return b.match(l)||[]}return di=g,di}var li,Ms;function Yf(){if(Ms)return li;Ms=1;var r=Kf(),t=Wf(),e=Gf();function n(i){return t(i)?e(i):r(i)}return li=n,li}var vi,Os;function Jf(){if(Os)return vi;Os=1;var r=jn(),t=Pf(),e=Hf(),n=Yf(),i=Ln(),a=/^\s+/;function o(s,u,f){if(s=i(s),s&&(f||u===void 0))return s.replace(a,"");if(!s||!(u=r(u)))return s;var c=n(s),h=e(c,n(u));return t(c,h).join("")}return vi=o,vi}Jf();const Q=bt.BLACK,Es=bt.Board,dr=bt.Coordinate,lr=bt.EMPTY,Tt=bt.Move,ft=bt.WHITE,Ht=bt.addMove,Ts=bt.isLegalMove;function Dr(r){return`
2
+ <div style="background: #fee2e2; color: #991b1b; padding: 1rem; border-radius: 4px;">${r}</div>
3
+ `}function yi(r,t,e){const n=r.dimensions,i=t??n,a=e??n,o=30,s=o,u=o*.4,f=n===a,c=n===i,h=(f?a-1:a)*o+s*2,p=(c?i-1:i)*o+s*2;let _=`<svg width="${h}" height="${p}" xmlns="http://www.w3.org/2000/svg">`;_+=`<rect width="${h}" height="${p}" fill="#dcb35c"/>`;const d=a<n,v=i<n,I=s+(d?a:a-1)*o,y=s+(v?i:i-1)*o;for(let l=0;l<a;l++){const g=s+l*o;_+=`<line x1="${g}" y1="${s}" x2="${g}" y2="${y}" stroke="#000" stroke-width="1"/>`}for(let l=0;l<i;l++){const g=s+l*o;_+=`<line x1="${s}" y1="${g}" x2="${I}" y2="${g}" stroke="#000" stroke-width="1"/>`}const m=[];n===9?m.push([2,2],[2,6],[4,4],[6,2],[6,6]):n===13?m.push([3,3],[3,9],[6,6],[9,3],[9,9]):n===19&&m.push([3,3],[3,9],[3,15],[9,3],[9,9],[9,15],[15,3],[15,9],[15,15]);for(const[l,g]of m)if(l<i&&g<a){const b=s+g*o,B=s+l*o;_+=`<circle cx="${b}" cy="${B}" r="3" fill="#000"/>`}for(let l=0;l<i;l++)for(let g=0;g<a;g++){const b=r.moves.get(dr(l,g),lr);if(b!==lr){const B=s+g*o,$=s+l*o;b===Q?_+=`<circle cx="${B}" cy="${$}" r="${u}" fill="#000" stroke="#000" stroke-width="1"/>`:b===ft&&(_+=`<circle cx="${B}" cy="${$}" r="${u}" fill="#fff" stroke="#000" stroke-width="1"/>`)}}return _+="</svg>",_}class ct extends Error{constructor(t){super(t),this.name="ValidationError"}}function Rs(r,t){const e={};let n=null,i=!1;for(let a=t;a<r.length;a++){const o=r[a].trim();if(o==="")continue;const s=o.indexOf(":");if(s>0){const u=o.substring(0,s).trim(),f=o.substring(s+1).trim();e[u]=f,n=u,i=f===""}else n&&i&&(Array.isArray(e[n])?e[n].push(o):e[n]=[o])}return e}function gi(r,t={}){const{allowEmpty:e=!1,validateCharacters:n=!0}=t;let i=1;for(;i<r.length&&r[i].trim()==="";)i++;if(i>=r.length)throw new ct("No board definition or options found");const a=[];let o=i;for(let y=i;y<r.length;y++){const m=r[y];if(m.trim()===""){o=y;break}if(m.indexOf(":")>0){o=y;break}a.push(m),o=y+1}const s=Rs(r,o);let u;if(s.size){const y=s.size;if(Array.isArray(y))throw new ct("Size option cannot have multiple values");const m=parseInt(y,10);if(isNaN(m)||m<=1||m>19)throw new ct("Size must be a positive integer greater than 1 and less than or equal to 19");u=m}if(a.length===0){if(!e)throw new ct("Board definition is required");if(!u)throw new ct('Empty board requires a "size" option');return{board:Es(u),rowCount:u,columnCount:u,configStartIndex:o,otherMarks:{}}}const f=a.map(y=>y.replace(/\s/g,"").length),c=f[0];if(!f.every(y=>y===c))throw new ct("All board rows must have the same number of non-space characters");const h=a.length,p=a[0].replace(/\s/g,"").length,_=h===p;if(u&&(h>u||p>u))throw new ct(`Board dimensions (${h}x${p}) exceed specified size (${u})`);if(!_&&!u)throw new ct(`Rectangle boards require a "size" option (found ${h}x${p} board)`);u||(u=h);const d=[],v={};for(let y=0;y<a.length;y++){const m=a[y];let l=0;for(let g=0;g<m.length;g++){const b=m[g];if(b===" ")continue;const B=/^[.+XOxo]$/.test(b);if(n&&!B)throw new ct(`Invalid board character '${b}' at row ${y+1}, col ${l+1}. Valid characters: . or + (empty), X or x (black stone), O or o (white stone)`);let $=lr;b==="X"||b==="x"?$=Q:b==="O"||b==="o"?$=ft:b==="."||b==="+"?$=lr:n||(v[b]||(v[b]=[]),v[b].push(dr(y,l))),$!==lr&&d.push(Tt(dr(y,l),$)),l++}}return{board:Es(u,...d),rowCount:h,columnCount:p,configStartIndex:o,otherMarks:v}}const ht={Success:"success",Failure:"failure",Incomplete:"incomplete"};class zs{parsedBoard;element;constructor(t,e){this.element=t,this.parsedBoard=gi(e,{})}render(){const t=this.element,{board:e,rowCount:n,columnCount:i}=this.parsedBoard,a=yi(e,n,i);t.innerHTML=a}}class As{parsedBoard;element;toPlay;sequenceTree;result;currentTree;playedMoves;currentBoard;isBlackTurn;constructor(t,e){this.element=t;const n=gi(e,{allowEmpty:!1,validateCharacters:!1});for(const[l,g]of Object.entries(n.otherMarks))if(g.length>1)throw new Error(`Mark '${l}' appears at multiple coordinates. Each mark must be unique.`);const i=Rs(e,n.configStartIndex),a=i.black,o=i.white,s=a?Array.isArray(a)?a:a.split(",").map(l=>l.trim()).filter(l=>l.length>0):[],u=o?Array.isArray(o)?o:o.split(",").map(l=>l.trim()).filter(l=>l.length>0):[],f=new Set(u),c=s.filter(l=>f.has(l));if(c.length>0)throw new Error(`Marks cannot appear in both black and white: ${c.join(", ")}`);const h=new Set(Object.keys(n.otherMarks));for(const l of s)if(!h.has(l))throw new Error(`Black mark '${l}' does not appear in the board`);for(const l of u)if(!h.has(l))throw new Error(`White mark '${l}' does not appear in the board`);const p=i["to-play"],_=p?(Array.isArray(p)?p[0]:p).toLowerCase():"";if(_&&_!=="black"&&_!=="white")throw new Error(`Invalid to-play value '${_}'. Must be 'black' or 'white'`);this.toPlay=_==="white"?ft:Q;let d=n.board;for(const l of s){const g=n.otherMarks[l];for(const b of g)d=Ht(d,Tt(b,Q))}for(const l of u){const g=n.otherMarks[l];for(const b of g)d=Ht(d,Tt(b,ft))}this.parsedBoard={...n,board:d},this.result=ht.Incomplete,this.currentTree=J(),this.playedMoves=[],this.currentBoard=d,this.isBlackTurn=this.toPlay===Q;const v=(l,g)=>{const b=l.split(">").map(E=>E.trim()).filter(E=>E.length>0);for(const E of b)if(!n.otherMarks[E])throw new Error(`${g} '${l}': mark '${E}' does not appear in the board`);let B=d,$=this.toPlay;for(let E=0;E<b.length;E++){const dt=b[E],Rt=n.otherMarks[dt][0],Wt=Tt(Rt,$);if(!Ts(B,Wt))throw new Error(`${g} '${l}': move ${E+1} (${dt}) is illegal`);try{B=Ht(B,Wt)}catch(Gt){const Qf=Gt instanceof Error?Gt.message:String(Gt);throw new Error(`${g} '${l}': move ${E+1} (${dt}) failed - ${Qf}`)}$=$===Q?ft:Q}},I=i.solutions,y=[];if(I){const l=Array.isArray(I)?I:[I];for(const g of l)v(g,"Solution"),y.push({sequence:g,isSolution:!0})}const m=i.sequences;if(m){const l=Array.isArray(m)?m:[m];for(const g of l)v(g,"Sequence"),y.push({sequence:g,isSolution:!1})}this.sequenceTree=J();for(const{sequence:l,isSolution:g}of y){const b=l.split(">").map(E=>E.trim()).filter(E=>E.length>0),B=[];for(const E of b)B.push(n.otherMarks[E][0]);let $=J();for(let E=B.length-1;E>=0;E--){const dt=B[E],Kt=E===B.length-1;let Rt;Kt?Rt=g?ht.Success:ht.Failure:Rt=ht.Incomplete;const Wt={result:Rt,children:$};$=J().set(dt,Wt)}this.sequenceTree=this.mergeSequenceTrees(this.sequenceTree,$)}this.currentTree=this.sequenceTree}mergeSequenceTrees(t,e){return e.reduce((n,i,a)=>{const o=n.get(a);if(o){const s=this.mergeSequenceTrees(o.children,i.children),c={result:s.size>0?ht.Incomplete:o.result,children:s};return n.set(a,c)}else return n.set(a,i)},t)}handleUserMove(t){const e=this.currentTree.get(t),n=this.isBlackTurn?Q:ft,i=Tt(t,n);if(this.playedMoves.push(i),this.currentBoard=Ht(this.currentBoard,i),this.isBlackTurn=!this.isBlackTurn,!e){this.result!==ht.Success&&(this.result=ht.Failure),this.currentTree=J(),this.render();return}this.currentTree=e.children,this.result=e.result,this.render(),e.children.size>0&&setTimeout(()=>this.playComputerResponse(),500)}playComputerResponse(){const t=Array.from(this.currentTree.entries());if(t.length===0)return;const e=Math.floor(Math.random()*t.length),[n,i]=t[e],a=this.isBlackTurn?Q:ft,o=Tt(n,a);this.playedMoves.push(o),this.currentBoard=Ht(this.currentBoard,o),this.isBlackTurn=!this.isBlackTurn,this.currentTree=i.children,this.result=i.result,this.render()}reset(){this.currentTree=this.sequenceTree,this.playedMoves=[],this.currentBoard=this.parsedBoard.board,this.isBlackTurn=this.toPlay===Q,this.result=ht.Incomplete,this.render()}render(){const t=this.element,{rowCount:e,columnCount:n}=this.parsedBoard;let a=yi(this.currentBoard,e,n);const o=`reset-${Math.random().toString(36).substr(2,9)}`,s="padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 0.9rem;";a+='<div style="margin-top: 1rem; display: flex; align-items: center;">',a+=`<button id="${o}" style="${s}">Reset</button>`,this.result===ht.Success?a+='<span style="margin-left: 1rem; font-weight: 600; font-size: 1.1rem; color: #155724;">Success!</span>':this.result===ht.Failure&&(a+='<span style="margin-left: 1rem; font-weight: 600; font-size: 1.1rem; color: #721c24;">Incorrect</span>'),a+="</div>",t.innerHTML=a;const u=t.querySelector("svg");u&&(u.style.cursor="pointer",u.addEventListener("click",c=>{const h=c,p=u.getBoundingClientRect(),_=h.clientX-p.left,d=h.clientY-p.top,v=30,I=v,y=Math.round((_-I)/v),m=Math.round((d-I)/v);if(m>=0&&m<e&&y>=0&&y<n){const l=dr(m,y);this.handleUserMove(l)}}));const f=document.getElementById(o);f&&f.addEventListener("click",()=>this.reset())}}class Cs{parsedBoard;element;currentBoard;initialBoard;history;currentMoveIndex;isBlackTurn;constructor(t,e){this.element=t,this.parsedBoard=gi(e,{allowEmpty:!0}),this.initialBoard=this.parsedBoard.board,this.currentBoard=this.parsedBoard.board,this.history=[],this.currentMoveIndex=-1,this.isBlackTurn=!0}rebuildBoard(){let t=this.initialBoard;for(let e=0;e<=this.currentMoveIndex;e++){const n=this.history[e];n.type==="move"&&(t=Ht(t,n.move))}if(this.currentBoard=t,this.currentMoveIndex===-1)this.isBlackTurn=!0;else{const e=this.history[this.currentMoveIndex],n=e.type==="move"?e.move.color:e.color;this.isBlackTurn=n===ft}}undo(){this.currentMoveIndex>=0&&(this.currentMoveIndex--,this.rebuildBoard(),this.render())}redo(){this.currentMoveIndex<this.history.length-1&&(this.currentMoveIndex++,this.rebuildBoard(),this.render())}pass(){this.history=this.history.slice(0,this.currentMoveIndex+1);const t=this.isBlackTurn?Q:ft;this.history.push({type:"pass",color:t}),this.currentMoveIndex++,this.isBlackTurn=!this.isBlackTurn,this.render()}reset(){this.history=[],this.currentMoveIndex=-1,this.currentBoard=this.initialBoard,this.isBlackTurn=!0,this.render()}render(){const t=this.element,{rowCount:e,columnCount:n}=this.parsedBoard,i=yi(this.currentBoard,e,n),a=`turn-info-${Math.random().toString(36).substr(2,9)}`,o=`undo-${Math.random().toString(36).substr(2,9)}`,s=`redo-${Math.random().toString(36).substr(2,9)}`,u=`pass-${Math.random().toString(36).substr(2,9)}`,f=`reset-${Math.random().toString(36).substr(2,9)}`;let c='<div class="freeplay-container">';c+=`<div id="${a}" style="margin-bottom: 1rem; padding: 0.5rem; font-weight: 600; font-size: 1.1rem;">${this.isBlackTurn?"Black":"White"} to play</div>`,c+=i;const h="padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 0.9rem;",p="padding: 0.5rem 1rem; margin: 0.5rem 0.25rem; border: 1px solid #ccc; border-radius: 4px; background: #f0f0f0; cursor: not-allowed; font-size: 0.9rem; color: #999;";c+='<div style="margin-top: 1rem;">',c+=`<button id="${o}" style="${this.currentMoveIndex>=0?h:p}" ${this.currentMoveIndex<0?"disabled":""}>← Undo</button>`,c+=`<button id="${s}" style="${this.currentMoveIndex<this.history.length-1?h:p}" ${this.currentMoveIndex>=this.history.length-1?"disabled":""}>Redo →</button>`,c+=`<button id="${u}" style="${h}">Pass</button>`,c+=`<button id="${f}" style="${h}">Reset</button>`,c+="</div>",c+="</div>",t.innerHTML=c;const _=t.querySelector("svg"),d=document.getElementById(o),v=document.getElementById(s),I=document.getElementById(u),y=document.getElementById(f);_&&(_.style.cursor="pointer",_.addEventListener("click",m=>{const l=m,g=_.getBoundingClientRect(),b=l.clientX-g.left,B=l.clientY-g.top,$=30,E=$,dt=Math.round((b-E)/$),Kt=Math.round((B-E)/$);if(Kt>=0&&Kt<e&&dt>=0&&dt<n){const Rt=dr(Kt,dt),Wt=this.isBlackTurn?Q:ft,Gt=Tt(Rt,Wt);Ts(this.currentBoard,Gt)&&(this.history=this.history.slice(0,this.currentMoveIndex+1),this.history.push({type:"move",move:Gt}),this.currentMoveIndex++,this.rebuildBoard(),this.render())}})),d&&d.addEventListener("click",()=>this.undo()),v&&v.addEventListener("click",()=>this.redo()),I&&I.addEventListener("click",()=>this.pass()),y&&y.addEventListener("click",()=>this.reset())}}const Xf={static:zs,freeplay:Cs,problem:As},Vf=".godash-diagram";function Zf(r,t){const e=t.split(`
4
+ `);if(e.length===0){r.innerHTML=Dr("Empty diagram source");return}const n=e[0].trim();try{let i;switch(n){case"static":i=new zs(r,e);break;case"freeplay":i=new Cs(r,e);break;case"problem":i=new As(r,e);break;default:r.innerHTML=Dr(`Unsupported diagram type "${n}". Supported types: ${Object.keys(Xf).join(", ")}`);return}i.render()}catch(i){i instanceof ct?r.innerHTML=Dr(i.message):r.innerHTML=Dr(i instanceof Error?i.message:String(i))}}function $s(r,t){const e=Vf,n=document.querySelectorAll(e);if(n.length===0)throw new Error(`No elements found for selector: ${e}`);n.forEach(i=>{const a=i.textContent??"";Zf(i,a)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{$s()}):$s()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godash-diagrams",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "A diagramming library for Go, inspired by Mermaid, and built on Godash",
5
5
  "author": {
6
6
  "name": "duckpunch",
@@ -12,7 +12,14 @@
12
12
  "url": "git+https://github.com/duckpunch/godash-diagrams.git"
13
13
  },
14
14
  "homepage": "https://duckpunch.github.io/godash-diagrams/",
15
- "keywords": ["go", "baduk", "weiqi", "diagram", "mermaid", "godash"],
15
+ "keywords": [
16
+ "go",
17
+ "baduk",
18
+ "weiqi",
19
+ "diagram",
20
+ "mermaid",
21
+ "godash"
22
+ ],
16
23
  "type": "module",
17
24
  "main": "./dist/godash-diagrams.umd.cjs",
18
25
  "module": "./dist/godash-diagrams.js",
@@ -29,7 +36,7 @@
29
36
  ],
30
37
  "scripts": {
31
38
  "dev": "vite",
32
- "build": "tsc -p tsconfig.build.json && vite build",
39
+ "build": "tsc -p tsconfig.build.json && vite build && vite build --config vite.config.auto.ts",
33
40
  "build:demo": "vite build --config vite.config.demo.ts",
34
41
  "preview": "vite preview"
35
42
  },