├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── .settings └── ccw.repl.cmdhistory.prefs ├── README.md ├── project.clj ├── resources ├── pirates │ ├── fedora.png │ ├── halloween16.png │ ├── hands6.png │ ├── old3.png │ ├── old45.png │ ├── sail1.png │ ├── sword1.png │ └── wine47.png └── public │ └── js │ └── pirates.js └── src ├── clj └── pirates │ ├── pirates3d.clj │ └── swingui.clj └── cljc └── pirates └── rules.cljc /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | resources/* linguist-vendored 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /lib 3 | /classes 4 | /checkouts 5 | pom.xml 6 | pom.xml.asc 7 | *.jar 8 | *.class 9 | .lein-deps-sum 10 | .lein-failures 11 | .lein-plugins 12 | .lein-repl-history 13 | /.idea 14 | /doc 15 | /docs 16 | *.iml 17 | *.dylib 18 | *.log 19 | .nrepl-port 20 | /bin/ 21 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | pirates 4 | 5 | 6 | 7 | 8 | 9 | ccw.builder 10 | 11 | 12 | 13 | 14 | ccw.leiningen.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | ccw.leiningen.nature 27 | ccw.nature 28 | 29 | 30 | -------------------------------------------------------------------------------- /.settings/ccw.repl.cmdhistory.prefs: -------------------------------------------------------------------------------- 1 | cmdhistory=["(- 2 3)" "(require '[clojure.string \:as s])" "(s/reverse \\"This is a test.\\")" "exit" "(- 45 5)"] 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pirates: A Clojure implementation of the Cartagena board game. 2 | 3 | This was my first non-trivial Clojure project. It's an implementation of the [Cartagena board 4 | game](http://boardgamegeek.com/boardgame/826/cartagena) in Clojure. The rules are all found in rules.cljx. Cljx was used 5 | since at some point I'd like to make a web gui as well. The program can be launched from swingui.clj. I apologize up 6 | front for the programmer art. The main goal was to explore how a desktop app could be written in Clojure. Coming from 7 | the Java and Scala worlds, I was quite impressed by how concise the application is. The majority of the code is Swing, 8 | and that could probably be reduced a lot using seesaw or similar. 9 | 10 | ## Installation 11 | 12 | From a repl, uncomment and run the frame method. Alternatively, lein run does the trick. You can also bundle the app 13 | with lein compile, lein uberjar. 14 | 15 | ## Usage 16 | 17 | Double-click the executable jar. To take a turn, right click on the square with your colored dot (pirate) and select an 18 | action. Once you have all of your pirates in the boat, you win. You are assigned a color (pick the one you want that 19 | pops up) and when your cards (icons on the right) are your color, it is your turn. It's a pretty minimal UI :( 20 | 21 | One thing I've noticed is that the initial UI may not display correctly on Windows. If you resize the frame it will render correctly. I've only got a Mac, so can't easily debug. 22 | 23 | ## Design 24 | 25 | This app was written as more of an exercise in learning Clojure than in writing a fun game (that takes a lot of work), 26 | but the cool pattern I've used since is 1) creating business logic in pure functional form, 2) creating a stateful UI in 27 | whatever framework you want, and 3) using an atom, agent, or ref to manage a state instance that bridges the UI and the 28 | logic. Pretty cool! 29 | 30 | ## Contributors 31 | 32 | If anyone out there wants to add AI, better art, online multiplayer, etc. I'd be more than happy to accept input or collaborate. 33 | 34 | ## License 35 | 36 | Copyright © 2015 Mark Bastian 37 | 38 | Distributed under the Eclipse Public License, the same as Clojure. 39 | 40 | ## Licenses for Art 41 | 42 | Designed by Freepik 43 |
Icons made by Freepik from www.flaticon.com is licensed under CC BY 3.0
44 | -------------------------------------------------------------------------------- /project.clj: -------------------------------------------------------------------------------- 1 | (defproject pirates "0.1.0-SNAPSHOT" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "Eclipse Public License" 5 | :url "http://www.eclipse.org/legal/epl-v10.html"} 6 | :dependencies [[org.clojure/clojure "1.9.0-alpha7"] 7 | [org.clojure/clojurescript "1.9.93"] 8 | ;[org.jmonkeyengine/jme3-core "3.1.0-beta1"] 9 | ;[org.jmonkeyengine/jme3-desktop "3.1.0-beta1"] 10 | ;[org.jmonkeyengine/jme3-lwjgl "3.1.0-beta1"] 11 | ] 12 | 13 | :main pirates.swingui 14 | 15 | :jar-exclusions [#"\.swp|\.swo|\.DS_Store"] 16 | :profiles {:uberjar {:aot :all} 17 | :dev {:plugins [[lein-cljsbuild "1.1.3"] 18 | [org.clojure/clojurescript "1.9.93"]]} 19 | :cljs {:plugins [[lein-cljsbuild "1.1.3"]] }} 20 | 21 | :source-paths ["src/clj" "src/cljc"] 22 | 23 | :clj {:builds [{ :source-paths ["src/clj" "src/cljc" "test"] }]} 24 | 25 | :cljsbuild {:builds [{ :source-paths ["src/cljs" "src/cljc"] 26 | :compiler { :output-to "resources/public/js/pirates.js" 27 | :optimizations :advanced 28 | :pretty-print true}}]} 29 | 30 | :codox {:sources ["src/clj" "target/classes"]} 31 | 32 | :aot :all 33 | 34 | ;:repositories [["jme" "https://bintray.com/"]] 35 | ) 36 | -------------------------------------------------------------------------------- /resources/pirates/fedora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/fedora.png -------------------------------------------------------------------------------- /resources/pirates/halloween16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/halloween16.png -------------------------------------------------------------------------------- /resources/pirates/hands6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/hands6.png -------------------------------------------------------------------------------- /resources/pirates/old3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/old3.png -------------------------------------------------------------------------------- /resources/pirates/old45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/old45.png -------------------------------------------------------------------------------- /resources/pirates/sail1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/sail1.png -------------------------------------------------------------------------------- /resources/pirates/sword1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/sword1.png -------------------------------------------------------------------------------- /resources/pirates/wine47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/markbastian/pirates/6e1bcd3d6c68229f70f0616177cabbf96faf8dca/resources/pirates/wine47.png -------------------------------------------------------------------------------- /resources/public/js/pirates.js: -------------------------------------------------------------------------------- 1 | if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) { 2 | Math.imul = function (a, b) { 3 | var ah = (a >>> 16) & 0xffff; 4 | var al = a & 0xffff; 5 | var bh = (b >>> 16) & 0xffff; 6 | var bl = b & 0xffff; 7 | // the shift by 0 fixes the sign on the high part 8 | // the final |0 converts the unsigned value into a signed value 9 | return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); 10 | } 11 | } 12 | 13 | ;(function(){ 14 | var g; 15 | function t(a) { 16 | var b = typeof a; 17 | if ("object" == b) { 18 | if (a) { 19 | if (a instanceof Array) { 20 | return "array"; 21 | } 22 | if (a instanceof Object) { 23 | return b; 24 | } 25 | var c = Object.prototype.toString.call(a); 26 | if ("[object Window]" == c) { 27 | return "object"; 28 | } 29 | if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { 30 | return "array"; 31 | } 32 | if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { 33 | return "function"; 34 | } 35 | } else { 36 | return "null"; 37 | } 38 | } else { 39 | if ("function" == b && "undefined" == typeof a.call) { 40 | return "object"; 41 | } 42 | } 43 | return b; 44 | } 45 | var aa = "closure_uid_" + (1E9 * Math.random() >>> 0), ba = 0; 46 | function ca(a) { 47 | return Array.prototype.join.call(arguments, ""); 48 | } 49 | ;function ea(a, b) { 50 | for (var c in a) { 51 | b.call(void 0, a[c], c, a); 52 | } 53 | } 54 | ;function fa(a, b) { 55 | null != a && this.append.apply(this, arguments); 56 | } 57 | fa.prototype.Ea = ""; 58 | fa.prototype.append = function(a, b, c) { 59 | this.Ea += a; 60 | if (null != b) { 61 | for (var d = 1;d < arguments.length;d++) { 62 | this.Ea += arguments[d]; 63 | } 64 | } 65 | return this; 66 | }; 67 | fa.prototype.toString = function() { 68 | return this.Ea; 69 | }; 70 | function ga(a, b) { 71 | return a > b ? 1 : a < b ? -1 : 0; 72 | } 73 | ;if ("undefined" === typeof ha) { 74 | var ha = function() { 75 | throw Error("No *print-fn* fn set for evaluation environment"); 76 | } 77 | } 78 | var ja = null; 79 | if ("undefined" === typeof ka) { 80 | var ka = null 81 | } 82 | function x(a) { 83 | return null != a && !1 !== a; 84 | } 85 | function z(a, b) { 86 | return a[t(null == b ? null : b)] ? !0 : a._ ? !0 : !1; 87 | } 88 | function na(a) { 89 | return null == a ? null : a.constructor; 90 | } 91 | function A(a, b) { 92 | var c = na(b), c = x(x(c) ? c.vb : c) ? c.ub : t(b); 93 | return Error(["No protocol method ", a, " defined for type ", c, ": ", b].join("")); 94 | } 95 | function oa(a) { 96 | var b = a.ub; 97 | return x(b) ? b : "" + B(a); 98 | } 99 | var pa = "undefined" !== typeof Symbol && "function" === t(Symbol) ? Symbol.Fb : "@@iterator"; 100 | function D(a) { 101 | for (var b = a.length, c = Array(b), d = 0;;) { 102 | if (d < b) { 103 | c[d] = a[d], d += 1; 104 | } else { 105 | break; 106 | } 107 | } 108 | return c; 109 | } 110 | var ra = {}, sa = {}; 111 | function ta(a) { 112 | if (a ? a.D : a) { 113 | return a.D(a); 114 | } 115 | var b; 116 | b = ta[t(null == a ? null : a)]; 117 | if (!b && (b = ta._, !b)) { 118 | throw A("ICounted.-count", a); 119 | } 120 | return b.call(null, a); 121 | } 122 | function ua(a, b) { 123 | if (a ? a.H : a) { 124 | return a.H(a, b); 125 | } 126 | var c; 127 | c = ua[t(null == a ? null : a)]; 128 | if (!c && (c = ua._, !c)) { 129 | throw A("ICollection.-conj", a); 130 | } 131 | return c.call(null, a, b); 132 | } 133 | var va = {}, E = function() { 134 | function a(a, b, c) { 135 | if (a ? a.R : a) { 136 | return a.R(a, b, c); 137 | } 138 | var h; 139 | h = E[t(null == a ? null : a)]; 140 | if (!h && (h = E._, !h)) { 141 | throw A("IIndexed.-nth", a); 142 | } 143 | return h.call(null, a, b, c); 144 | } 145 | function b(a, b) { 146 | if (a ? a.O : a) { 147 | return a.O(a, b); 148 | } 149 | var c; 150 | c = E[t(null == a ? null : a)]; 151 | if (!c && (c = E._, !c)) { 152 | throw A("IIndexed.-nth", a); 153 | } 154 | return c.call(null, a, b); 155 | } 156 | var c = null, c = function(d, c, f) { 157 | switch(arguments.length) { 158 | case 2: 159 | return b.call(this, d, c); 160 | case 3: 161 | return a.call(this, d, c, f); 162 | } 163 | throw Error("Invalid arity: " + arguments.length); 164 | }; 165 | c.a = b; 166 | c.d = a; 167 | return c; 168 | }(), ya = {}; 169 | function F(a) { 170 | if (a ? a.P : a) { 171 | return a.P(a); 172 | } 173 | var b; 174 | b = F[t(null == a ? null : a)]; 175 | if (!b && (b = F._, !b)) { 176 | throw A("ISeq.-first", a); 177 | } 178 | return b.call(null, a); 179 | } 180 | function G(a) { 181 | if (a ? a.S : a) { 182 | return a.S(a); 183 | } 184 | var b; 185 | b = G[t(null == a ? null : a)]; 186 | if (!b && (b = G._, !b)) { 187 | throw A("ISeq.-rest", a); 188 | } 189 | return b.call(null, a); 190 | } 191 | var Aa = {}, Ba = {}, H = function() { 192 | function a(a, b, c) { 193 | if (a ? a.s : a) { 194 | return a.s(a, b, c); 195 | } 196 | var h; 197 | h = H[t(null == a ? null : a)]; 198 | if (!h && (h = H._, !h)) { 199 | throw A("ILookup.-lookup", a); 200 | } 201 | return h.call(null, a, b, c); 202 | } 203 | function b(a, b) { 204 | if (a ? a.t : a) { 205 | return a.t(a, b); 206 | } 207 | var c; 208 | c = H[t(null == a ? null : a)]; 209 | if (!c && (c = H._, !c)) { 210 | throw A("ILookup.-lookup", a); 211 | } 212 | return c.call(null, a, b); 213 | } 214 | var c = null, c = function(c, e, f) { 215 | switch(arguments.length) { 216 | case 2: 217 | return b.call(this, c, e); 218 | case 3: 219 | return a.call(this, c, e, f); 220 | } 221 | throw Error("Invalid arity: " + arguments.length); 222 | }; 223 | c.a = b; 224 | c.d = a; 225 | return c; 226 | }(); 227 | function Ca(a, b) { 228 | if (a ? a.Ra : a) { 229 | return a.Ra(a, b); 230 | } 231 | var c; 232 | c = Ca[t(null == a ? null : a)]; 233 | if (!c && (c = Ca._, !c)) { 234 | throw A("IAssociative.-contains-key?", a); 235 | } 236 | return c.call(null, a, b); 237 | } 238 | function Da(a, b, c) { 239 | if (a ? a.Fa : a) { 240 | return a.Fa(a, b, c); 241 | } 242 | var d; 243 | d = Da[t(null == a ? null : a)]; 244 | if (!d && (d = Da._, !d)) { 245 | throw A("IAssociative.-assoc", a); 246 | } 247 | return d.call(null, a, b, c); 248 | } 249 | var Ea = {}, Fa = {}; 250 | function Ga(a) { 251 | if (a ? a.Xa : a) { 252 | return a.Xa(); 253 | } 254 | var b; 255 | b = Ga[t(null == a ? null : a)]; 256 | if (!b && (b = Ga._, !b)) { 257 | throw A("IMapEntry.-key", a); 258 | } 259 | return b.call(null, a); 260 | } 261 | function Ia(a) { 262 | if (a ? a.cb : a) { 263 | return a.cb(); 264 | } 265 | var b; 266 | b = Ia[t(null == a ? null : a)]; 267 | if (!b && (b = Ia._, !b)) { 268 | throw A("IMapEntry.-val", a); 269 | } 270 | return b.call(null, a); 271 | } 272 | var Ja = {}, Ka = {}; 273 | function La(a, b, c) { 274 | if (a ? a.Ya : a) { 275 | return a.Ya(a, b, c); 276 | } 277 | var d; 278 | d = La[t(null == a ? null : a)]; 279 | if (!d && (d = La._, !d)) { 280 | throw A("IVector.-assoc-n", a); 281 | } 282 | return d.call(null, a, b, c); 283 | } 284 | function Ma(a) { 285 | if (a ? a.La : a) { 286 | return a.La(a); 287 | } 288 | var b; 289 | b = Ma[t(null == a ? null : a)]; 290 | if (!b && (b = Ma._, !b)) { 291 | throw A("IDeref.-deref", a); 292 | } 293 | return b.call(null, a); 294 | } 295 | var Oa = {}; 296 | function Pa(a) { 297 | if (a ? a.I : a) { 298 | return a.I(a); 299 | } 300 | var b; 301 | b = Pa[t(null == a ? null : a)]; 302 | if (!b && (b = Pa._, !b)) { 303 | throw A("IMeta.-meta", a); 304 | } 305 | return b.call(null, a); 306 | } 307 | var Qa = {}; 308 | function Ra(a, b) { 309 | if (a ? a.J : a) { 310 | return a.J(a, b); 311 | } 312 | var c; 313 | c = Ra[t(null == a ? null : a)]; 314 | if (!c && (c = Ra._, !c)) { 315 | throw A("IWithMeta.-with-meta", a); 316 | } 317 | return c.call(null, a, b); 318 | } 319 | var Sa = {}, Ta = function() { 320 | function a(a, b, c) { 321 | if (a ? a.L : a) { 322 | return a.L(a, b, c); 323 | } 324 | var h; 325 | h = Ta[t(null == a ? null : a)]; 326 | if (!h && (h = Ta._, !h)) { 327 | throw A("IReduce.-reduce", a); 328 | } 329 | return h.call(null, a, b, c); 330 | } 331 | function b(a, b) { 332 | if (a ? a.K : a) { 333 | return a.K(a, b); 334 | } 335 | var c; 336 | c = Ta[t(null == a ? null : a)]; 337 | if (!c && (c = Ta._, !c)) { 338 | throw A("IReduce.-reduce", a); 339 | } 340 | return c.call(null, a, b); 341 | } 342 | var c = null, c = function(c, e, f) { 343 | switch(arguments.length) { 344 | case 2: 345 | return b.call(this, c, e); 346 | case 3: 347 | return a.call(this, c, e, f); 348 | } 349 | throw Error("Invalid arity: " + arguments.length); 350 | }; 351 | c.a = b; 352 | c.d = a; 353 | return c; 354 | }(); 355 | function Ua(a, b) { 356 | if (a ? a.A : a) { 357 | return a.A(a, b); 358 | } 359 | var c; 360 | c = Ua[t(null == a ? null : a)]; 361 | if (!c && (c = Ua._, !c)) { 362 | throw A("IEquiv.-equiv", a); 363 | } 364 | return c.call(null, a, b); 365 | } 366 | function Va(a) { 367 | if (a ? a.B : a) { 368 | return a.B(a); 369 | } 370 | var b; 371 | b = Va[t(null == a ? null : a)]; 372 | if (!b && (b = Va._, !b)) { 373 | throw A("IHash.-hash", a); 374 | } 375 | return b.call(null, a); 376 | } 377 | var Wa = {}; 378 | function Xa(a) { 379 | if (a ? a.G : a) { 380 | return a.G(a); 381 | } 382 | var b; 383 | b = Xa[t(null == a ? null : a)]; 384 | if (!b && (b = Xa._, !b)) { 385 | throw A("ISeqable.-seq", a); 386 | } 387 | return b.call(null, a); 388 | } 389 | var Ya = {}; 390 | function J(a, b) { 391 | if (a ? a.gb : a) { 392 | return a.gb(0, b); 393 | } 394 | var c; 395 | c = J[t(null == a ? null : a)]; 396 | if (!c && (c = J._, !c)) { 397 | throw A("IWriter.-write", a); 398 | } 399 | return c.call(null, a, b); 400 | } 401 | var Za = {}; 402 | function $a(a, b, c) { 403 | if (a ? a.v : a) { 404 | return a.v(a, b, c); 405 | } 406 | var d; 407 | d = $a[t(null == a ? null : a)]; 408 | if (!d && (d = $a._, !d)) { 409 | throw A("IPrintWithWriter.-pr-writer", a); 410 | } 411 | return d.call(null, a, b, c); 412 | } 413 | function ab(a) { 414 | if (a ? a.Ga : a) { 415 | return a.Ga(a); 416 | } 417 | var b; 418 | b = ab[t(null == a ? null : a)]; 419 | if (!b && (b = ab._, !b)) { 420 | throw A("IEditableCollection.-as-transient", a); 421 | } 422 | return b.call(null, a); 423 | } 424 | function cb(a, b) { 425 | if (a ? a.Ia : a) { 426 | return a.Ia(a, b); 427 | } 428 | var c; 429 | c = cb[t(null == a ? null : a)]; 430 | if (!c && (c = cb._, !c)) { 431 | throw A("ITransientCollection.-conj!", a); 432 | } 433 | return c.call(null, a, b); 434 | } 435 | function db(a) { 436 | if (a ? a.Ja : a) { 437 | return a.Ja(a); 438 | } 439 | var b; 440 | b = db[t(null == a ? null : a)]; 441 | if (!b && (b = db._, !b)) { 442 | throw A("ITransientCollection.-persistent!", a); 443 | } 444 | return b.call(null, a); 445 | } 446 | function eb(a, b, c) { 447 | if (a ? a.Ha : a) { 448 | return a.Ha(a, b, c); 449 | } 450 | var d; 451 | d = eb[t(null == a ? null : a)]; 452 | if (!d && (d = eb._, !d)) { 453 | throw A("ITransientAssociative.-assoc!", a); 454 | } 455 | return d.call(null, a, b, c); 456 | } 457 | function fb(a, b, c) { 458 | if (a ? a.fb : a) { 459 | return a.fb(0, b, c); 460 | } 461 | var d; 462 | d = fb[t(null == a ? null : a)]; 463 | if (!d && (d = fb._, !d)) { 464 | throw A("ITransientVector.-assoc-n!", a); 465 | } 466 | return d.call(null, a, b, c); 467 | } 468 | function gb(a) { 469 | if (a ? a.ab : a) { 470 | return a.ab(); 471 | } 472 | var b; 473 | b = gb[t(null == a ? null : a)]; 474 | if (!b && (b = gb._, !b)) { 475 | throw A("IChunk.-drop-first", a); 476 | } 477 | return b.call(null, a); 478 | } 479 | function hb(a) { 480 | if (a ? a.Ta : a) { 481 | return a.Ta(a); 482 | } 483 | var b; 484 | b = hb[t(null == a ? null : a)]; 485 | if (!b && (b = hb._, !b)) { 486 | throw A("IChunkedSeq.-chunked-first", a); 487 | } 488 | return b.call(null, a); 489 | } 490 | function ib(a) { 491 | if (a ? a.Ua : a) { 492 | return a.Ua(a); 493 | } 494 | var b; 495 | b = ib[t(null == a ? null : a)]; 496 | if (!b && (b = ib._, !b)) { 497 | throw A("IChunkedSeq.-chunked-rest", a); 498 | } 499 | return b.call(null, a); 500 | } 501 | function jb(a) { 502 | if (a ? a.Sa : a) { 503 | return a.Sa(a); 504 | } 505 | var b; 506 | b = jb[t(null == a ? null : a)]; 507 | if (!b && (b = jb._, !b)) { 508 | throw A("IChunkedNext.-chunked-next", a); 509 | } 510 | return b.call(null, a); 511 | } 512 | function kb(a) { 513 | if (a ? a.Na : a) { 514 | return a.Na(a); 515 | } 516 | var b; 517 | b = kb[t(null == a ? null : a)]; 518 | if (!b && (b = kb._, !b)) { 519 | throw A("IIterable.-iterator", a); 520 | } 521 | return b.call(null, a); 522 | } 523 | function lb(a) { 524 | this.wb = a; 525 | this.n = 0; 526 | this.g = 1073741824; 527 | } 528 | lb.prototype.gb = function(a, b) { 529 | return this.wb.append(b); 530 | }; 531 | function nb(a) { 532 | var b = new fa; 533 | a.v(null, new lb(b), new ob(null, 5, [pb, !0, qb, !0, rb, !1, sb, !1, tb, null], null)); 534 | return "" + B(b); 535 | } 536 | var ub = "undefined" !== typeof Math.imul && 0 !== (Math.imul.a ? Math.imul.a(4294967295, 5) : Math.imul.call(null, 4294967295, 5)) ? function(a, b) { 537 | return Math.imul.a ? Math.imul.a(a, b) : Math.imul.call(null, a, b); 538 | } : function(a, b) { 539 | var c = a & 65535, d = b & 65535; 540 | return c * d + ((a >>> 16 & 65535) * d + c * (b >>> 16 & 65535) << 16 >>> 0) | 0; 541 | }; 542 | function vb(a) { 543 | a = ub(a, 3432918353); 544 | return ub(a << 15 | a >>> -15, 461845907); 545 | } 546 | function wb(a, b) { 547 | var c = a ^ b; 548 | return ub(c << 13 | c >>> -13, 5) + 3864292196; 549 | } 550 | function xb(a, b) { 551 | var c = a ^ b, c = ub(c ^ c >>> 16, 2246822507), c = ub(c ^ c >>> 13, 3266489909); 552 | return c ^ c >>> 16; 553 | } 554 | var yb = {}, zb = 0; 555 | function Ab(a) { 556 | 255 < zb && (yb = {}, zb = 0); 557 | var b = yb[a]; 558 | if ("number" !== typeof b) { 559 | a: { 560 | if (null != a) { 561 | if (b = a.length, 0 < b) { 562 | for (var c = 0, d = 0;;) { 563 | if (c < b) { 564 | var e = c + 1, d = ub(31, d) + a.charCodeAt(c), c = e 565 | } else { 566 | b = d; 567 | break a; 568 | } 569 | } 570 | b = void 0; 571 | } else { 572 | b = 0; 573 | } 574 | } else { 575 | b = 0; 576 | } 577 | } 578 | yb[a] = b; 579 | zb += 1; 580 | } 581 | return a = b; 582 | } 583 | function Bb(a) { 584 | a && (a.g & 4194304 || a.xb) ? a = a.B(null) : "number" === typeof a ? a = (Math.floor.e ? Math.floor.e(a) : Math.floor.call(null, a)) % 2147483647 : !0 === a ? a = 1 : !1 === a ? a = 0 : "string" === typeof a ? (a = Ab(a), 0 !== a && (a = vb(a), a = wb(0, a), a = xb(a, 4))) : a = a instanceof Date ? a.valueOf() : null == a ? 0 : Va(a); 585 | return a; 586 | } 587 | function Cb(a) { 588 | var b; 589 | b = a.name; 590 | var c; 591 | a: { 592 | c = 1; 593 | for (var d = 0;;) { 594 | if (c < b.length) { 595 | var e = c + 2, d = wb(d, vb(b.charCodeAt(c - 1) | b.charCodeAt(c) << 16)); 596 | c = e; 597 | } else { 598 | c = d; 599 | break a; 600 | } 601 | } 602 | c = void 0; 603 | } 604 | c = 1 === (b.length & 1) ? c ^ vb(b.charCodeAt(b.length - 1)) : c; 605 | b = xb(c, ub(2, b.length)); 606 | a = Ab(a.xa); 607 | return b ^ a + 2654435769 + (b << 6) + (b >> 2); 608 | } 609 | function K(a) { 610 | if (null == a) { 611 | return null; 612 | } 613 | if (a && (a.g & 8388608 || a.yb)) { 614 | return a.G(null); 615 | } 616 | if (a instanceof Array || "string" === typeof a) { 617 | return 0 === a.length ? null : new Eb(a, 0); 618 | } 619 | if (z(Wa, a)) { 620 | return Xa(a); 621 | } 622 | throw Error([B(a), B(" is not ISeqable")].join("")); 623 | } 624 | function L(a) { 625 | if (null == a) { 626 | return null; 627 | } 628 | if (a && (a.g & 64 || a.Oa)) { 629 | return a.P(null); 630 | } 631 | a = K(a); 632 | return null == a ? null : F(a); 633 | } 634 | function M(a) { 635 | return null != a ? a && (a.g & 64 || a.Oa) ? a.S(null) : (a = K(a)) ? G(a) : Fb : Fb; 636 | } 637 | function N(a) { 638 | return null == a ? null : a && (a.g & 128 || a.eb) ? a.X(null) : K(M(a)); 639 | } 640 | var Gb = function() { 641 | function a(a, b) { 642 | return null == a ? null == b : a === b || Ua(a, b); 643 | } 644 | var b = null, c = function() { 645 | function a(b, d, k) { 646 | var l = null; 647 | 2 < arguments.length && (l = O(Array.prototype.slice.call(arguments, 2), 0)); 648 | return c.call(this, b, d, l); 649 | } 650 | function c(a, d, e) { 651 | for (;;) { 652 | if (b.a(a, d)) { 653 | if (N(e)) { 654 | a = d, d = L(e), e = N(e); 655 | } else { 656 | return b.a(d, L(e)); 657 | } 658 | } else { 659 | return!1; 660 | } 661 | } 662 | } 663 | a.r = 2; 664 | a.m = function(a) { 665 | var b = L(a); 666 | a = N(a); 667 | var d = L(a); 668 | a = M(a); 669 | return c(b, d, a); 670 | }; 671 | a.k = c; 672 | return a; 673 | }(), b = function(b, e, f) { 674 | switch(arguments.length) { 675 | case 1: 676 | return!0; 677 | case 2: 678 | return a.call(this, b, e); 679 | default: 680 | return c.k(b, e, O(arguments, 2)); 681 | } 682 | throw Error("Invalid arity: " + arguments.length); 683 | }; 684 | b.r = 2; 685 | b.m = c.m; 686 | b.e = function() { 687 | return!0; 688 | }; 689 | b.a = a; 690 | b.k = c.k; 691 | return b; 692 | }(); 693 | function Hb(a) { 694 | this.p = a; 695 | } 696 | Hb.prototype.next = function() { 697 | if (null != this.p) { 698 | var a = L(this.p); 699 | this.p = N(this.p); 700 | return{done:!1, value:a}; 701 | } 702 | return{done:!0, value:null}; 703 | }; 704 | function Ib(a) { 705 | return new Hb(K(a)); 706 | } 707 | function Jb(a, b) { 708 | var c = vb(a), c = wb(0, c); 709 | return xb(c, b); 710 | } 711 | function Kb(a) { 712 | var b = 0, c = 1; 713 | for (a = K(a);;) { 714 | if (null != a) { 715 | b += 1, c = ub(31, c) + Bb(L(a)) | 0, a = N(a); 716 | } else { 717 | return Jb(c, b); 718 | } 719 | } 720 | } 721 | function Lb(a) { 722 | var b = 0, c = 0; 723 | for (a = K(a);;) { 724 | if (null != a) { 725 | b += 1, c = c + Bb(L(a)) | 0, a = N(a); 726 | } else { 727 | return Jb(c, b); 728 | } 729 | } 730 | } 731 | sa["null"] = !0; 732 | ta["null"] = function() { 733 | return 0; 734 | }; 735 | Date.prototype.A = function(a, b) { 736 | return b instanceof Date && this.toString() === b.toString(); 737 | }; 738 | Ua.number = function(a, b) { 739 | return a === b; 740 | }; 741 | Oa["function"] = !0; 742 | Pa["function"] = function() { 743 | return null; 744 | }; 745 | ra["function"] = !0; 746 | Va._ = function(a) { 747 | return a[aa] || (a[aa] = ++ba); 748 | }; 749 | function Mb(a) { 750 | this.W = a; 751 | this.n = 0; 752 | this.g = 32768; 753 | } 754 | Mb.prototype.La = function() { 755 | return this.W; 756 | }; 757 | function Nb(a) { 758 | return a instanceof Mb; 759 | } 760 | function Ob(a) { 761 | return Ma(a); 762 | } 763 | var Pb = function() { 764 | function a(a, b, c, d) { 765 | for (var l = ta(a);;) { 766 | if (d < l) { 767 | var m = E.a(a, d); 768 | c = b.a ? b.a(c, m) : b.call(null, c, m); 769 | if (Nb(c)) { 770 | return Ma(c); 771 | } 772 | d += 1; 773 | } else { 774 | return c; 775 | } 776 | } 777 | } 778 | function b(a, b, c) { 779 | var d = ta(a), l = c; 780 | for (c = 0;;) { 781 | if (c < d) { 782 | var m = E.a(a, c), l = b.a ? b.a(l, m) : b.call(null, l, m); 783 | if (Nb(l)) { 784 | return Ma(l); 785 | } 786 | c += 1; 787 | } else { 788 | return l; 789 | } 790 | } 791 | } 792 | function c(a, b) { 793 | var c = ta(a); 794 | if (0 === c) { 795 | return b.q ? b.q() : b.call(null); 796 | } 797 | for (var d = E.a(a, 0), l = 1;;) { 798 | if (l < c) { 799 | var m = E.a(a, l), d = b.a ? b.a(d, m) : b.call(null, d, m); 800 | if (Nb(d)) { 801 | return Ma(d); 802 | } 803 | l += 1; 804 | } else { 805 | return d; 806 | } 807 | } 808 | } 809 | var d = null, d = function(d, f, h, k) { 810 | switch(arguments.length) { 811 | case 2: 812 | return c.call(this, d, f); 813 | case 3: 814 | return b.call(this, d, f, h); 815 | case 4: 816 | return a.call(this, d, f, h, k); 817 | } 818 | throw Error("Invalid arity: " + arguments.length); 819 | }; 820 | d.a = c; 821 | d.d = b; 822 | d.i = a; 823 | return d; 824 | }(), Qb = function() { 825 | function a(a, b, c, d) { 826 | for (var l = a.length;;) { 827 | if (d < l) { 828 | var m = a[d]; 829 | c = b.a ? b.a(c, m) : b.call(null, c, m); 830 | if (Nb(c)) { 831 | return Ma(c); 832 | } 833 | d += 1; 834 | } else { 835 | return c; 836 | } 837 | } 838 | } 839 | function b(a, b, c) { 840 | var d = a.length, l = c; 841 | for (c = 0;;) { 842 | if (c < d) { 843 | var m = a[c], l = b.a ? b.a(l, m) : b.call(null, l, m); 844 | if (Nb(l)) { 845 | return Ma(l); 846 | } 847 | c += 1; 848 | } else { 849 | return l; 850 | } 851 | } 852 | } 853 | function c(a, b) { 854 | var c = a.length; 855 | if (0 === a.length) { 856 | return b.q ? b.q() : b.call(null); 857 | } 858 | for (var d = a[0], l = 1;;) { 859 | if (l < c) { 860 | var m = a[l], d = b.a ? b.a(d, m) : b.call(null, d, m); 861 | if (Nb(d)) { 862 | return Ma(d); 863 | } 864 | l += 1; 865 | } else { 866 | return d; 867 | } 868 | } 869 | } 870 | var d = null, d = function(d, f, h, k) { 871 | switch(arguments.length) { 872 | case 2: 873 | return c.call(this, d, f); 874 | case 3: 875 | return b.call(this, d, f, h); 876 | case 4: 877 | return a.call(this, d, f, h, k); 878 | } 879 | throw Error("Invalid arity: " + arguments.length); 880 | }; 881 | d.a = c; 882 | d.d = b; 883 | d.i = a; 884 | return d; 885 | }(); 886 | function Rb(a) { 887 | return a ? a.g & 2 || a.kb ? !0 : a.g ? !1 : z(sa, a) : z(sa, a); 888 | } 889 | function Sb(a) { 890 | return a ? a.g & 16 || a.bb ? !0 : a.g ? !1 : z(va, a) : z(va, a); 891 | } 892 | function Tb(a, b) { 893 | this.b = a; 894 | this.h = b; 895 | } 896 | Tb.prototype.Za = function() { 897 | return this.h < this.b.length; 898 | }; 899 | Tb.prototype.next = function() { 900 | var a = this.b[this.h]; 901 | this.h += 1; 902 | return a; 903 | }; 904 | function Eb(a, b) { 905 | this.b = a; 906 | this.h = b; 907 | this.g = 166199550; 908 | this.n = 8192; 909 | } 910 | g = Eb.prototype; 911 | g.toString = function() { 912 | return nb(this); 913 | }; 914 | g.O = function(a, b) { 915 | var c = b + this.h; 916 | return c < this.b.length ? this.b[c] : null; 917 | }; 918 | g.R = function(a, b, c) { 919 | a = b + this.h; 920 | return a < this.b.length ? this.b[a] : c; 921 | }; 922 | g.Na = function() { 923 | return new Tb(this.b, this.h); 924 | }; 925 | g.X = function() { 926 | return this.h + 1 < this.b.length ? new Eb(this.b, this.h + 1) : null; 927 | }; 928 | g.D = function() { 929 | return this.b.length - this.h; 930 | }; 931 | g.B = function() { 932 | return Kb(this); 933 | }; 934 | g.A = function(a, b) { 935 | return Ub.a ? Ub.a(this, b) : Ub.call(null, this, b); 936 | }; 937 | g.K = function(a, b) { 938 | return Qb.i(this.b, b, this.b[this.h], this.h + 1); 939 | }; 940 | g.L = function(a, b, c) { 941 | return Qb.i(this.b, b, c, this.h); 942 | }; 943 | g.P = function() { 944 | return this.b[this.h]; 945 | }; 946 | g.S = function() { 947 | return this.h + 1 < this.b.length ? new Eb(this.b, this.h + 1) : Fb; 948 | }; 949 | g.G = function() { 950 | return this; 951 | }; 952 | g.H = function(a, b) { 953 | return R.a ? R.a(b, this) : R.call(null, b, this); 954 | }; 955 | Eb.prototype[pa] = function() { 956 | return Ib(this); 957 | }; 958 | var Vb = function() { 959 | function a(a, b) { 960 | return b < a.length ? new Eb(a, b) : null; 961 | } 962 | function b(a) { 963 | return c.a(a, 0); 964 | } 965 | var c = null, c = function(c, e) { 966 | switch(arguments.length) { 967 | case 1: 968 | return b.call(this, c); 969 | case 2: 970 | return a.call(this, c, e); 971 | } 972 | throw Error("Invalid arity: " + arguments.length); 973 | }; 974 | c.e = b; 975 | c.a = a; 976 | return c; 977 | }(), O = function() { 978 | function a(a, b) { 979 | return Vb.a(a, b); 980 | } 981 | function b(a) { 982 | return Vb.a(a, 0); 983 | } 984 | var c = null, c = function(c, e) { 985 | switch(arguments.length) { 986 | case 1: 987 | return b.call(this, c); 988 | case 2: 989 | return a.call(this, c, e); 990 | } 991 | throw Error("Invalid arity: " + arguments.length); 992 | }; 993 | c.e = b; 994 | c.a = a; 995 | return c; 996 | }(); 997 | Ua._ = function(a, b) { 998 | return a === b; 999 | }; 1000 | var Xb = function() { 1001 | function a(a, b) { 1002 | return null != a ? ua(a, b) : ua(Fb, b); 1003 | } 1004 | var b = null, c = function() { 1005 | function a(b, d, k) { 1006 | var l = null; 1007 | 2 < arguments.length && (l = O(Array.prototype.slice.call(arguments, 2), 0)); 1008 | return c.call(this, b, d, l); 1009 | } 1010 | function c(a, d, e) { 1011 | for (;;) { 1012 | if (x(e)) { 1013 | a = b.a(a, d), d = L(e), e = N(e); 1014 | } else { 1015 | return b.a(a, d); 1016 | } 1017 | } 1018 | } 1019 | a.r = 2; 1020 | a.m = function(a) { 1021 | var b = L(a); 1022 | a = N(a); 1023 | var d = L(a); 1024 | a = M(a); 1025 | return c(b, d, a); 1026 | }; 1027 | a.k = c; 1028 | return a; 1029 | }(), b = function(b, e, f) { 1030 | switch(arguments.length) { 1031 | case 0: 1032 | return Wb; 1033 | case 1: 1034 | return b; 1035 | case 2: 1036 | return a.call(this, b, e); 1037 | default: 1038 | return c.k(b, e, O(arguments, 2)); 1039 | } 1040 | throw Error("Invalid arity: " + arguments.length); 1041 | }; 1042 | b.r = 2; 1043 | b.m = c.m; 1044 | b.q = function() { 1045 | return Wb; 1046 | }; 1047 | b.e = function(a) { 1048 | return a; 1049 | }; 1050 | b.a = a; 1051 | b.k = c.k; 1052 | return b; 1053 | }(); 1054 | function S(a) { 1055 | if (null != a) { 1056 | if (a && (a.g & 2 || a.kb)) { 1057 | a = a.D(null); 1058 | } else { 1059 | if (a instanceof Array) { 1060 | a = a.length; 1061 | } else { 1062 | if ("string" === typeof a) { 1063 | a = a.length; 1064 | } else { 1065 | if (z(sa, a)) { 1066 | a = ta(a); 1067 | } else { 1068 | a: { 1069 | a = K(a); 1070 | for (var b = 0;;) { 1071 | if (Rb(a)) { 1072 | a = b + ta(a); 1073 | break a; 1074 | } 1075 | a = N(a); 1076 | b += 1; 1077 | } 1078 | a = void 0; 1079 | } 1080 | } 1081 | } 1082 | } 1083 | } 1084 | } else { 1085 | a = 0; 1086 | } 1087 | return a; 1088 | } 1089 | var Yb = function() { 1090 | function a(a, b, c) { 1091 | for (;;) { 1092 | if (null == a) { 1093 | return c; 1094 | } 1095 | if (0 === b) { 1096 | return K(a) ? L(a) : c; 1097 | } 1098 | if (Sb(a)) { 1099 | return E.d(a, b, c); 1100 | } 1101 | if (K(a)) { 1102 | a = N(a), b -= 1; 1103 | } else { 1104 | return c; 1105 | } 1106 | } 1107 | } 1108 | function b(a, b) { 1109 | for (;;) { 1110 | if (null == a) { 1111 | throw Error("Index out of bounds"); 1112 | } 1113 | if (0 === b) { 1114 | if (K(a)) { 1115 | return L(a); 1116 | } 1117 | throw Error("Index out of bounds"); 1118 | } 1119 | if (Sb(a)) { 1120 | return E.a(a, b); 1121 | } 1122 | if (K(a)) { 1123 | var c = N(a), h = b - 1; 1124 | a = c; 1125 | b = h; 1126 | } else { 1127 | throw Error("Index out of bounds"); 1128 | } 1129 | } 1130 | } 1131 | var c = null, c = function(c, e, f) { 1132 | switch(arguments.length) { 1133 | case 2: 1134 | return b.call(this, c, e); 1135 | case 3: 1136 | return a.call(this, c, e, f); 1137 | } 1138 | throw Error("Invalid arity: " + arguments.length); 1139 | }; 1140 | c.a = b; 1141 | c.d = a; 1142 | return c; 1143 | }(), Zb = function() { 1144 | function a(a, b, c) { 1145 | if ("number" !== typeof b) { 1146 | throw Error("index argument to nth must be a number."); 1147 | } 1148 | if (null == a) { 1149 | return c; 1150 | } 1151 | if (a && (a.g & 16 || a.bb)) { 1152 | return a.R(null, b, c); 1153 | } 1154 | if (a instanceof Array || "string" === typeof a) { 1155 | return b < a.length ? a[b] : c; 1156 | } 1157 | if (z(va, a)) { 1158 | return E.a(a, b); 1159 | } 1160 | if (a ? a.g & 64 || a.Oa || (a.g ? 0 : z(ya, a)) : z(ya, a)) { 1161 | return Yb.d(a, b, c); 1162 | } 1163 | throw Error([B("nth not supported on this type "), B(oa(na(a)))].join("")); 1164 | } 1165 | function b(a, b) { 1166 | if ("number" !== typeof b) { 1167 | throw Error("index argument to nth must be a number"); 1168 | } 1169 | if (null == a) { 1170 | return a; 1171 | } 1172 | if (a && (a.g & 16 || a.bb)) { 1173 | return a.O(null, b); 1174 | } 1175 | if (a instanceof Array || "string" === typeof a) { 1176 | return b < a.length ? a[b] : null; 1177 | } 1178 | if (z(va, a)) { 1179 | return E.a(a, b); 1180 | } 1181 | if (a ? a.g & 64 || a.Oa || (a.g ? 0 : z(ya, a)) : z(ya, a)) { 1182 | return Yb.a(a, b); 1183 | } 1184 | throw Error([B("nth not supported on this type "), B(oa(na(a)))].join("")); 1185 | } 1186 | var c = null, c = function(c, e, f) { 1187 | switch(arguments.length) { 1188 | case 2: 1189 | return b.call(this, c, e); 1190 | case 3: 1191 | return a.call(this, c, e, f); 1192 | } 1193 | throw Error("Invalid arity: " + arguments.length); 1194 | }; 1195 | c.a = b; 1196 | c.d = a; 1197 | return c; 1198 | }(), $b = function() { 1199 | function a(a, b, c) { 1200 | return null != a ? a && (a.g & 256 || a.nb) ? a.s(null, b, c) : a instanceof Array ? b < a.length ? a[b] : c : "string" === typeof a ? b < a.length ? a[b] : c : z(Ba, a) ? H.d(a, b, c) : c : c; 1201 | } 1202 | function b(a, b) { 1203 | return null == a ? null : a && (a.g & 256 || a.nb) ? a.t(null, b) : a instanceof Array ? b < a.length ? a[b] : null : "string" === typeof a ? b < a.length ? a[b] : null : z(Ba, a) ? H.a(a, b) : null; 1204 | } 1205 | var c = null, c = function(c, e, f) { 1206 | switch(arguments.length) { 1207 | case 2: 1208 | return b.call(this, c, e); 1209 | case 3: 1210 | return a.call(this, c, e, f); 1211 | } 1212 | throw Error("Invalid arity: " + arguments.length); 1213 | }; 1214 | c.a = b; 1215 | c.d = a; 1216 | return c; 1217 | }(), cc = function() { 1218 | function a(a, b, c) { 1219 | if (null != a) { 1220 | a = Da(a, b, c); 1221 | } else { 1222 | a: { 1223 | a = [b]; 1224 | c = [c]; 1225 | b = a.length; 1226 | for (var h = 0, k = ab(ac);;) { 1227 | if (h < b) { 1228 | var l = h + 1, k = k.Ha(null, a[h], c[h]), h = l 1229 | } else { 1230 | a = db(k); 1231 | break a; 1232 | } 1233 | } 1234 | a = void 0; 1235 | } 1236 | } 1237 | return a; 1238 | } 1239 | var b = null, c = function() { 1240 | function a(b, d, k, l) { 1241 | var m = null; 1242 | 3 < arguments.length && (m = O(Array.prototype.slice.call(arguments, 3), 0)); 1243 | return c.call(this, b, d, k, m); 1244 | } 1245 | function c(a, d, e, l) { 1246 | for (;;) { 1247 | if (a = b.d(a, d, e), x(l)) { 1248 | d = L(l), e = L(N(l)), l = N(N(l)); 1249 | } else { 1250 | return a; 1251 | } 1252 | } 1253 | } 1254 | a.r = 3; 1255 | a.m = function(a) { 1256 | var b = L(a); 1257 | a = N(a); 1258 | var d = L(a); 1259 | a = N(a); 1260 | var l = L(a); 1261 | a = M(a); 1262 | return c(b, d, l, a); 1263 | }; 1264 | a.k = c; 1265 | return a; 1266 | }(), b = function(b, e, f, h) { 1267 | switch(arguments.length) { 1268 | case 3: 1269 | return a.call(this, b, e, f); 1270 | default: 1271 | return c.k(b, e, f, O(arguments, 3)); 1272 | } 1273 | throw Error("Invalid arity: " + arguments.length); 1274 | }; 1275 | b.r = 3; 1276 | b.m = c.m; 1277 | b.d = a; 1278 | b.k = c.k; 1279 | return b; 1280 | }(); 1281 | function dc(a) { 1282 | var b = "function" == t(a); 1283 | return x(b) ? b : a ? x(x(null) ? null : a.ib) ? !0 : a.Eb ? !1 : z(ra, a) : z(ra, a); 1284 | } 1285 | function ec(a, b) { 1286 | this.c = a; 1287 | this.l = b; 1288 | this.n = 0; 1289 | this.g = 393217; 1290 | } 1291 | g = ec.prototype; 1292 | g.call = function() { 1293 | function a(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I, Y) { 1294 | a = this.c; 1295 | return fc.Ma ? fc.Ma(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I, Y) : fc.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I, Y); 1296 | } 1297 | function b(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I) { 1298 | a = this; 1299 | return a.c.ma ? a.c.ma(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w, I); 1300 | } 1301 | function c(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w) { 1302 | a = this; 1303 | return a.c.la ? a.c.la(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, w); 1304 | } 1305 | function d(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) { 1306 | a = this; 1307 | return a.c.ka ? a.c.ka(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C); 1308 | } 1309 | function e(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) { 1310 | a = this; 1311 | return a.c.ja ? a.c.ja(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y); 1312 | } 1313 | function f(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) { 1314 | a = this; 1315 | return a.c.ia ? a.c.ia(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v); 1316 | } 1317 | function h(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u) { 1318 | a = this; 1319 | return a.c.ha ? a.c.ha(b, c, d, e, f, h, k, l, m, n, p, q, r, s, u) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u); 1320 | } 1321 | function k(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s) { 1322 | a = this; 1323 | return a.c.ga ? a.c.ga(b, c, d, e, f, h, k, l, m, n, p, q, r, s) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r, s); 1324 | } 1325 | function l(a, b, c, d, e, f, h, k, l, m, n, p, q, r) { 1326 | a = this; 1327 | return a.c.fa ? a.c.fa(b, c, d, e, f, h, k, l, m, n, p, q, r) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q, r); 1328 | } 1329 | function m(a, b, c, d, e, f, h, k, l, m, n, p, q) { 1330 | a = this; 1331 | return a.c.ea ? a.c.ea(b, c, d, e, f, h, k, l, m, n, p, q) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p, q); 1332 | } 1333 | function n(a, b, c, d, e, f, h, k, l, m, n, p) { 1334 | a = this; 1335 | return a.c.da ? a.c.da(b, c, d, e, f, h, k, l, m, n, p) : a.c.call(null, b, c, d, e, f, h, k, l, m, n, p); 1336 | } 1337 | function p(a, b, c, d, e, f, h, k, l, m, n) { 1338 | a = this; 1339 | return a.c.ca ? a.c.ca(b, c, d, e, f, h, k, l, m, n) : a.c.call(null, b, c, d, e, f, h, k, l, m, n); 1340 | } 1341 | function q(a, b, c, d, e, f, h, k, l, m) { 1342 | a = this; 1343 | return a.c.oa ? a.c.oa(b, c, d, e, f, h, k, l, m) : a.c.call(null, b, c, d, e, f, h, k, l, m); 1344 | } 1345 | function r(a, b, c, d, e, f, h, k, l) { 1346 | a = this; 1347 | return a.c.na ? a.c.na(b, c, d, e, f, h, k, l) : a.c.call(null, b, c, d, e, f, h, k, l); 1348 | } 1349 | function s(a, b, c, d, e, f, h, k) { 1350 | a = this; 1351 | return a.c.U ? a.c.U(b, c, d, e, f, h, k) : a.c.call(null, b, c, d, e, f, h, k); 1352 | } 1353 | function u(a, b, c, d, e, f, h) { 1354 | a = this; 1355 | return a.c.N ? a.c.N(b, c, d, e, f, h) : a.c.call(null, b, c, d, e, f, h); 1356 | } 1357 | function v(a, b, c, d, e, f) { 1358 | a = this; 1359 | return a.c.u ? a.c.u(b, c, d, e, f) : a.c.call(null, b, c, d, e, f); 1360 | } 1361 | function y(a, b, c, d, e) { 1362 | a = this; 1363 | return a.c.i ? a.c.i(b, c, d, e) : a.c.call(null, b, c, d, e); 1364 | } 1365 | function C(a, b, c, d) { 1366 | a = this; 1367 | return a.c.d ? a.c.d(b, c, d) : a.c.call(null, b, c, d); 1368 | } 1369 | function I(a, b, c) { 1370 | a = this; 1371 | return a.c.a ? a.c.a(b, c) : a.c.call(null, b, c); 1372 | } 1373 | function Y(a, b) { 1374 | a = this; 1375 | return a.c.e ? a.c.e(b) : a.c.call(null, b); 1376 | } 1377 | function xa(a) { 1378 | a = this; 1379 | return a.c.q ? a.c.q() : a.c.call(null); 1380 | } 1381 | var w = null, w = function(w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db, bc, Cc, kd, Nd) { 1382 | switch(arguments.length) { 1383 | case 1: 1384 | return xa.call(this, w); 1385 | case 2: 1386 | return Y.call(this, w, P); 1387 | case 3: 1388 | return I.call(this, w, P, Q); 1389 | case 4: 1390 | return C.call(this, w, P, Q, V); 1391 | case 5: 1392 | return y.call(this, w, P, Q, V, X); 1393 | case 6: 1394 | return v.call(this, w, P, Q, V, X, $); 1395 | case 7: 1396 | return u.call(this, w, P, Q, V, X, $, da); 1397 | case 8: 1398 | return s.call(this, w, P, Q, V, X, $, da, ia); 1399 | case 9: 1400 | return r.call(this, w, P, Q, V, X, $, da, ia, la); 1401 | case 10: 1402 | return q.call(this, w, P, Q, V, X, $, da, ia, la, ma); 1403 | case 11: 1404 | return p.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa); 1405 | case 12: 1406 | return n.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa); 1407 | case 13: 1408 | return m.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za); 1409 | case 14: 1410 | return l.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha); 1411 | case 15: 1412 | return k.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na); 1413 | case 16: 1414 | return h.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb); 1415 | case 17: 1416 | return f.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb); 1417 | case 18: 1418 | return e.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db); 1419 | case 19: 1420 | return d.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db, bc); 1421 | case 20: 1422 | return c.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db, bc, Cc); 1423 | case 21: 1424 | return b.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db, bc, Cc, kd); 1425 | case 22: 1426 | return a.call(this, w, P, Q, V, X, $, da, ia, la, ma, qa, wa, za, Ha, Na, bb, mb, Db, bc, Cc, kd, Nd); 1427 | } 1428 | throw Error("Invalid arity: " + arguments.length); 1429 | }; 1430 | w.e = xa; 1431 | w.a = Y; 1432 | w.d = I; 1433 | w.i = C; 1434 | w.u = y; 1435 | w.N = v; 1436 | w.U = u; 1437 | w.na = s; 1438 | w.oa = r; 1439 | w.ca = q; 1440 | w.da = p; 1441 | w.ea = n; 1442 | w.fa = m; 1443 | w.ga = l; 1444 | w.ha = k; 1445 | w.ia = h; 1446 | w.ja = f; 1447 | w.ka = e; 1448 | w.la = d; 1449 | w.ma = c; 1450 | w.mb = b; 1451 | w.Ma = a; 1452 | return w; 1453 | }(); 1454 | g.apply = function(a, b) { 1455 | return this.call.apply(this, [this].concat(D(b))); 1456 | }; 1457 | g.q = function() { 1458 | return this.c.q ? this.c.q() : this.c.call(null); 1459 | }; 1460 | g.e = function(a) { 1461 | return this.c.e ? this.c.e(a) : this.c.call(null, a); 1462 | }; 1463 | g.a = function(a, b) { 1464 | return this.c.a ? this.c.a(a, b) : this.c.call(null, a, b); 1465 | }; 1466 | g.d = function(a, b, c) { 1467 | return this.c.d ? this.c.d(a, b, c) : this.c.call(null, a, b, c); 1468 | }; 1469 | g.i = function(a, b, c, d) { 1470 | return this.c.i ? this.c.i(a, b, c, d) : this.c.call(null, a, b, c, d); 1471 | }; 1472 | g.u = function(a, b, c, d, e) { 1473 | return this.c.u ? this.c.u(a, b, c, d, e) : this.c.call(null, a, b, c, d, e); 1474 | }; 1475 | g.N = function(a, b, c, d, e, f) { 1476 | return this.c.N ? this.c.N(a, b, c, d, e, f) : this.c.call(null, a, b, c, d, e, f); 1477 | }; 1478 | g.U = function(a, b, c, d, e, f, h) { 1479 | return this.c.U ? this.c.U(a, b, c, d, e, f, h) : this.c.call(null, a, b, c, d, e, f, h); 1480 | }; 1481 | g.na = function(a, b, c, d, e, f, h, k) { 1482 | return this.c.na ? this.c.na(a, b, c, d, e, f, h, k) : this.c.call(null, a, b, c, d, e, f, h, k); 1483 | }; 1484 | g.oa = function(a, b, c, d, e, f, h, k, l) { 1485 | return this.c.oa ? this.c.oa(a, b, c, d, e, f, h, k, l) : this.c.call(null, a, b, c, d, e, f, h, k, l); 1486 | }; 1487 | g.ca = function(a, b, c, d, e, f, h, k, l, m) { 1488 | return this.c.ca ? this.c.ca(a, b, c, d, e, f, h, k, l, m) : this.c.call(null, a, b, c, d, e, f, h, k, l, m); 1489 | }; 1490 | g.da = function(a, b, c, d, e, f, h, k, l, m, n) { 1491 | return this.c.da ? this.c.da(a, b, c, d, e, f, h, k, l, m, n) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n); 1492 | }; 1493 | g.ea = function(a, b, c, d, e, f, h, k, l, m, n, p) { 1494 | return this.c.ea ? this.c.ea(a, b, c, d, e, f, h, k, l, m, n, p) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p); 1495 | }; 1496 | g.fa = function(a, b, c, d, e, f, h, k, l, m, n, p, q) { 1497 | return this.c.fa ? this.c.fa(a, b, c, d, e, f, h, k, l, m, n, p, q) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q); 1498 | }; 1499 | g.ga = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r) { 1500 | return this.c.ga ? this.c.ga(a, b, c, d, e, f, h, k, l, m, n, p, q, r) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r); 1501 | }; 1502 | g.ha = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s) { 1503 | return this.c.ha ? this.c.ha(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s); 1504 | }; 1505 | g.ia = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u) { 1506 | return this.c.ia ? this.c.ia(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u); 1507 | }; 1508 | g.ja = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) { 1509 | return this.c.ja ? this.c.ja(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v); 1510 | }; 1511 | g.ka = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) { 1512 | return this.c.ka ? this.c.ka(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y); 1513 | }; 1514 | g.la = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) { 1515 | return this.c.la ? this.c.la(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C); 1516 | }; 1517 | g.ma = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I) { 1518 | return this.c.ma ? this.c.ma(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I) : this.c.call(null, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I); 1519 | }; 1520 | g.mb = function(a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y) { 1521 | var xa = this.c; 1522 | return fc.Ma ? fc.Ma(xa, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y) : fc.call(null, xa, a, b, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y); 1523 | }; 1524 | g.ib = !0; 1525 | g.J = function(a, b) { 1526 | return new ec(this.c, b); 1527 | }; 1528 | g.I = function() { 1529 | return this.l; 1530 | }; 1531 | function gc(a, b) { 1532 | return dc(a) && !(a ? a.g & 262144 || a.Cb || (a.g ? 0 : z(Qa, a)) : z(Qa, a)) ? new ec(a, b) : null == a ? null : Ra(a, b); 1533 | } 1534 | function hc(a) { 1535 | var b = null != a; 1536 | return(b ? a ? a.g & 131072 || a.qb || (a.g ? 0 : z(Oa, a)) : z(Oa, a) : b) ? Pa(a) : null; 1537 | } 1538 | function ic(a) { 1539 | return null == a ? !1 : a ? a.g & 4096 || a.Ab ? !0 : a.g ? !1 : z(Ja, a) : z(Ja, a); 1540 | } 1541 | function jc(a) { 1542 | return null == a ? !1 : a ? a.g & 1024 || a.ob ? !0 : a.g ? !1 : z(Ea, a) : z(Ea, a); 1543 | } 1544 | function kc(a) { 1545 | return a ? a.g & 16384 || a.Bb ? !0 : a.g ? !1 : z(Ka, a) : z(Ka, a); 1546 | } 1547 | function lc(a) { 1548 | var b = []; 1549 | ea(a, function(a, b) { 1550 | return function(a, c) { 1551 | return b.push(c); 1552 | }; 1553 | }(a, b)); 1554 | return b; 1555 | } 1556 | function mc(a, b, c, d, e) { 1557 | for (;0 !== e;) { 1558 | c[d] = a[b], d += 1, e -= 1, b += 1; 1559 | } 1560 | } 1561 | function nc(a, b, c, d, e) { 1562 | b += e - 1; 1563 | for (d += e - 1;0 !== e;) { 1564 | c[d] = a[b], d -= 1, e -= 1, b -= 1; 1565 | } 1566 | } 1567 | var oc = {}; 1568 | function pc(a) { 1569 | return x(a) ? !0 : !1; 1570 | } 1571 | function qc(a, b) { 1572 | if (a === b) { 1573 | return 0; 1574 | } 1575 | if (null == a) { 1576 | return-1; 1577 | } 1578 | if (null == b) { 1579 | return 1; 1580 | } 1581 | if (na(a) === na(b)) { 1582 | return a && (a.n & 2048 || a.Va) ? a.Wa(null, b) : ga(a, b); 1583 | } 1584 | throw Error("compare on non-nil objects of different types"); 1585 | } 1586 | var rc = function() { 1587 | function a(a, b, c, h) { 1588 | for (;;) { 1589 | var k = qc(Zb.a(a, h), Zb.a(b, h)); 1590 | if (0 === k && h + 1 < c) { 1591 | h += 1; 1592 | } else { 1593 | return k; 1594 | } 1595 | } 1596 | } 1597 | function b(a, b) { 1598 | var f = S(a), h = S(b); 1599 | return f < h ? -1 : f > h ? 1 : c.i(a, b, f, 0); 1600 | } 1601 | var c = null, c = function(c, e, f, h) { 1602 | switch(arguments.length) { 1603 | case 2: 1604 | return b.call(this, c, e); 1605 | case 4: 1606 | return a.call(this, c, e, f, h); 1607 | } 1608 | throw Error("Invalid arity: " + arguments.length); 1609 | }; 1610 | c.a = b; 1611 | c.i = a; 1612 | return c; 1613 | }(), T = function() { 1614 | function a(a, b, c) { 1615 | for (c = K(c);;) { 1616 | if (c) { 1617 | var h = L(c); 1618 | b = a.a ? a.a(b, h) : a.call(null, b, h); 1619 | if (Nb(b)) { 1620 | return Ma(b); 1621 | } 1622 | c = N(c); 1623 | } else { 1624 | return b; 1625 | } 1626 | } 1627 | } 1628 | function b(a, b) { 1629 | var c = K(b); 1630 | if (c) { 1631 | var h = L(c), c = N(c); 1632 | return sc.d ? sc.d(a, h, c) : sc.call(null, a, h, c); 1633 | } 1634 | return a.q ? a.q() : a.call(null); 1635 | } 1636 | var c = null, c = function(c, e, f) { 1637 | switch(arguments.length) { 1638 | case 2: 1639 | return b.call(this, c, e); 1640 | case 3: 1641 | return a.call(this, c, e, f); 1642 | } 1643 | throw Error("Invalid arity: " + arguments.length); 1644 | }; 1645 | c.a = b; 1646 | c.d = a; 1647 | return c; 1648 | }(), sc = function() { 1649 | function a(a, b, c) { 1650 | return c && (c.g & 524288 || c.sb) ? c.L(null, a, b) : c instanceof Array ? Qb.d(c, a, b) : "string" === typeof c ? Qb.d(c, a, b) : z(Sa, c) ? Ta.d(c, a, b) : T.d(a, b, c); 1651 | } 1652 | function b(a, b) { 1653 | return b && (b.g & 524288 || b.sb) ? b.K(null, a) : b instanceof Array ? Qb.a(b, a) : "string" === typeof b ? Qb.a(b, a) : z(Sa, b) ? Ta.a(b, a) : T.a(a, b); 1654 | } 1655 | var c = null, c = function(c, e, f) { 1656 | switch(arguments.length) { 1657 | case 2: 1658 | return b.call(this, c, e); 1659 | case 3: 1660 | return a.call(this, c, e, f); 1661 | } 1662 | throw Error("Invalid arity: " + arguments.length); 1663 | }; 1664 | c.a = b; 1665 | c.d = a; 1666 | return c; 1667 | }(); 1668 | function tc(a) { 1669 | return a; 1670 | } 1671 | var uc = function() { 1672 | function a(a, b, c, h) { 1673 | a = a.e ? a.e(b) : a.call(null, b); 1674 | c = sc.d(a, c, h); 1675 | return a.e ? a.e(c) : a.call(null, c); 1676 | } 1677 | function b(a, b, f) { 1678 | return c.i(a, b, b.q ? b.q() : b.call(null), f); 1679 | } 1680 | var c = null, c = function(c, e, f, h) { 1681 | switch(arguments.length) { 1682 | case 3: 1683 | return b.call(this, c, e, f); 1684 | case 4: 1685 | return a.call(this, c, e, f, h); 1686 | } 1687 | throw Error("Invalid arity: " + arguments.length); 1688 | }; 1689 | c.d = b; 1690 | c.i = a; 1691 | return c; 1692 | }(); 1693 | function vc(a) { 1694 | a = (a - a % 2) / 2; 1695 | return 0 <= a ? Math.floor.e ? Math.floor.e(a) : Math.floor.call(null, a) : Math.ceil.e ? Math.ceil.e(a) : Math.ceil.call(null, a); 1696 | } 1697 | function wc(a) { 1698 | a -= a >> 1 & 1431655765; 1699 | a = (a & 858993459) + (a >> 2 & 858993459); 1700 | return 16843009 * (a + (a >> 4) & 252645135) >> 24; 1701 | } 1702 | var B = function() { 1703 | function a(a) { 1704 | return null == a ? "" : ca(a); 1705 | } 1706 | var b = null, c = function() { 1707 | function a(b, d) { 1708 | var k = null; 1709 | 1 < arguments.length && (k = O(Array.prototype.slice.call(arguments, 1), 0)); 1710 | return c.call(this, b, k); 1711 | } 1712 | function c(a, d) { 1713 | for (var e = new fa(b.e(a)), l = d;;) { 1714 | if (x(l)) { 1715 | e = e.append(b.e(L(l))), l = N(l); 1716 | } else { 1717 | return e.toString(); 1718 | } 1719 | } 1720 | } 1721 | a.r = 1; 1722 | a.m = function(a) { 1723 | var b = L(a); 1724 | a = M(a); 1725 | return c(b, a); 1726 | }; 1727 | a.k = c; 1728 | return a; 1729 | }(), b = function(b, e) { 1730 | switch(arguments.length) { 1731 | case 0: 1732 | return ""; 1733 | case 1: 1734 | return a.call(this, b); 1735 | default: 1736 | return c.k(b, O(arguments, 1)); 1737 | } 1738 | throw Error("Invalid arity: " + arguments.length); 1739 | }; 1740 | b.r = 1; 1741 | b.m = c.m; 1742 | b.q = function() { 1743 | return ""; 1744 | }; 1745 | b.e = a; 1746 | b.k = c.k; 1747 | return b; 1748 | }(); 1749 | function Ub(a, b) { 1750 | var c; 1751 | if (b ? b.g & 16777216 || b.zb || (b.g ? 0 : z(Ya, b)) : z(Ya, b)) { 1752 | if (Rb(a) && Rb(b) && S(a) !== S(b)) { 1753 | c = !1; 1754 | } else { 1755 | a: { 1756 | c = K(a); 1757 | for (var d = K(b);;) { 1758 | if (null == c) { 1759 | c = null == d; 1760 | break a; 1761 | } 1762 | if (null != d && Gb.a(L(c), L(d))) { 1763 | c = N(c), d = N(d); 1764 | } else { 1765 | c = !1; 1766 | break a; 1767 | } 1768 | } 1769 | c = void 0; 1770 | } 1771 | } 1772 | } else { 1773 | c = null; 1774 | } 1775 | return pc(c); 1776 | } 1777 | function xc(a, b, c, d, e) { 1778 | this.l = a; 1779 | this.first = b; 1780 | this.qa = c; 1781 | this.count = d; 1782 | this.j = e; 1783 | this.g = 65937646; 1784 | this.n = 8192; 1785 | } 1786 | g = xc.prototype; 1787 | g.toString = function() { 1788 | return nb(this); 1789 | }; 1790 | g.I = function() { 1791 | return this.l; 1792 | }; 1793 | g.X = function() { 1794 | return 1 === this.count ? null : this.qa; 1795 | }; 1796 | g.D = function() { 1797 | return this.count; 1798 | }; 1799 | g.B = function() { 1800 | var a = this.j; 1801 | return null != a ? a : this.j = a = Kb(this); 1802 | }; 1803 | g.A = function(a, b) { 1804 | return Ub(this, b); 1805 | }; 1806 | g.K = function(a, b) { 1807 | return T.a(b, this); 1808 | }; 1809 | g.L = function(a, b, c) { 1810 | return T.d(b, c, this); 1811 | }; 1812 | g.P = function() { 1813 | return this.first; 1814 | }; 1815 | g.S = function() { 1816 | return 1 === this.count ? Fb : this.qa; 1817 | }; 1818 | g.G = function() { 1819 | return this; 1820 | }; 1821 | g.J = function(a, b) { 1822 | return new xc(b, this.first, this.qa, this.count, this.j); 1823 | }; 1824 | g.H = function(a, b) { 1825 | return new xc(this.l, b, this, this.count + 1, null); 1826 | }; 1827 | xc.prototype[pa] = function() { 1828 | return Ib(this); 1829 | }; 1830 | function yc(a) { 1831 | this.l = a; 1832 | this.g = 65937614; 1833 | this.n = 8192; 1834 | } 1835 | g = yc.prototype; 1836 | g.toString = function() { 1837 | return nb(this); 1838 | }; 1839 | g.I = function() { 1840 | return this.l; 1841 | }; 1842 | g.X = function() { 1843 | return null; 1844 | }; 1845 | g.D = function() { 1846 | return 0; 1847 | }; 1848 | g.B = function() { 1849 | return 0; 1850 | }; 1851 | g.A = function(a, b) { 1852 | return Ub(this, b); 1853 | }; 1854 | g.K = function(a, b) { 1855 | return T.a(b, this); 1856 | }; 1857 | g.L = function(a, b, c) { 1858 | return T.d(b, c, this); 1859 | }; 1860 | g.P = function() { 1861 | return null; 1862 | }; 1863 | g.S = function() { 1864 | return Fb; 1865 | }; 1866 | g.G = function() { 1867 | return null; 1868 | }; 1869 | g.J = function(a, b) { 1870 | return new yc(b); 1871 | }; 1872 | g.H = function(a, b) { 1873 | return new xc(this.l, b, null, 1, null); 1874 | }; 1875 | var Fb = new yc(null); 1876 | yc.prototype[pa] = function() { 1877 | return Ib(this); 1878 | }; 1879 | function zc(a, b, c, d) { 1880 | this.l = a; 1881 | this.first = b; 1882 | this.qa = c; 1883 | this.j = d; 1884 | this.g = 65929452; 1885 | this.n = 8192; 1886 | } 1887 | g = zc.prototype; 1888 | g.toString = function() { 1889 | return nb(this); 1890 | }; 1891 | g.I = function() { 1892 | return this.l; 1893 | }; 1894 | g.X = function() { 1895 | return null == this.qa ? null : K(this.qa); 1896 | }; 1897 | g.B = function() { 1898 | var a = this.j; 1899 | return null != a ? a : this.j = a = Kb(this); 1900 | }; 1901 | g.A = function(a, b) { 1902 | return Ub(this, b); 1903 | }; 1904 | g.K = function(a, b) { 1905 | return T.a(b, this); 1906 | }; 1907 | g.L = function(a, b, c) { 1908 | return T.d(b, c, this); 1909 | }; 1910 | g.P = function() { 1911 | return this.first; 1912 | }; 1913 | g.S = function() { 1914 | return null == this.qa ? Fb : this.qa; 1915 | }; 1916 | g.G = function() { 1917 | return this; 1918 | }; 1919 | g.J = function(a, b) { 1920 | return new zc(b, this.first, this.qa, this.j); 1921 | }; 1922 | g.H = function(a, b) { 1923 | return new zc(null, b, this, this.j); 1924 | }; 1925 | zc.prototype[pa] = function() { 1926 | return Ib(this); 1927 | }; 1928 | function R(a, b) { 1929 | var c = null == b; 1930 | return(c ? c : b && (b.g & 64 || b.Oa)) ? new zc(null, a, b, null) : new zc(null, a, K(b), null); 1931 | } 1932 | function Ac(a, b) { 1933 | if (a.$ === b.$) { 1934 | return 0; 1935 | } 1936 | var c = x(a.xa) ? !1 : !0; 1937 | if (x(c ? b.xa : c)) { 1938 | return-1; 1939 | } 1940 | if (x(a.xa)) { 1941 | if (!x(b.xa)) { 1942 | return 1; 1943 | } 1944 | c = ga(a.xa, b.xa); 1945 | return 0 === c ? ga(a.name, b.name) : c; 1946 | } 1947 | return ga(a.name, b.name); 1948 | } 1949 | function U(a, b, c, d) { 1950 | this.xa = a; 1951 | this.name = b; 1952 | this.$ = c; 1953 | this.$a = d; 1954 | this.g = 2153775105; 1955 | this.n = 4096; 1956 | } 1957 | g = U.prototype; 1958 | g.v = function(a, b) { 1959 | return J(b, [B(":"), B(this.$)].join("")); 1960 | }; 1961 | g.B = function() { 1962 | var a = this.$a; 1963 | return null != a ? a : this.$a = a = Cb(this) + 2654435769 | 0; 1964 | }; 1965 | g.call = function() { 1966 | var a = null, a = function(a, c, d) { 1967 | switch(arguments.length) { 1968 | case 2: 1969 | return $b.a(c, this); 1970 | case 3: 1971 | return $b.d(c, this, d); 1972 | } 1973 | throw Error("Invalid arity: " + arguments.length); 1974 | }; 1975 | a.a = function(a, c) { 1976 | return $b.a(c, this); 1977 | }; 1978 | a.d = function(a, c, d) { 1979 | return $b.d(c, this, d); 1980 | }; 1981 | return a; 1982 | }(); 1983 | g.apply = function(a, b) { 1984 | return this.call.apply(this, [this].concat(D(b))); 1985 | }; 1986 | g.e = function(a) { 1987 | return $b.a(a, this); 1988 | }; 1989 | g.a = function(a, b) { 1990 | return $b.d(a, this, b); 1991 | }; 1992 | g.A = function(a, b) { 1993 | return b instanceof U ? this.$ === b.$ : !1; 1994 | }; 1995 | g.toString = function() { 1996 | return[B(":"), B(this.$)].join(""); 1997 | }; 1998 | var Bc = function() { 1999 | function a(a, b) { 2000 | return new U(a, b, [B(x(a) ? [B(a), B("/")].join("") : null), B(b)].join(""), null); 2001 | } 2002 | function b(a) { 2003 | var b; 2004 | return a instanceof U ? a : "string" === typeof a ? (b = a.split("/"), 2 === b.length ? new U(b[0], b[1], a, null) : new U(null, b[0], a, null)) : null; 2005 | } 2006 | var c = null, c = function(c, e) { 2007 | switch(arguments.length) { 2008 | case 1: 2009 | return b.call(this, c); 2010 | case 2: 2011 | return a.call(this, c, e); 2012 | } 2013 | throw Error("Invalid arity: " + arguments.length); 2014 | }; 2015 | c.e = b; 2016 | c.a = a; 2017 | return c; 2018 | }(); 2019 | function Dc(a, b, c, d) { 2020 | this.l = a; 2021 | this.Ba = b; 2022 | this.p = c; 2023 | this.j = d; 2024 | this.n = 0; 2025 | this.g = 32374988; 2026 | } 2027 | g = Dc.prototype; 2028 | g.toString = function() { 2029 | return nb(this); 2030 | }; 2031 | function Ec(a) { 2032 | null != a.Ba && (a.p = a.Ba.q ? a.Ba.q() : a.Ba.call(null), a.Ba = null); 2033 | return a.p; 2034 | } 2035 | g.I = function() { 2036 | return this.l; 2037 | }; 2038 | g.X = function() { 2039 | Xa(this); 2040 | return null == this.p ? null : N(this.p); 2041 | }; 2042 | g.B = function() { 2043 | var a = this.j; 2044 | return null != a ? a : this.j = a = Kb(this); 2045 | }; 2046 | g.A = function(a, b) { 2047 | return Ub(this, b); 2048 | }; 2049 | g.K = function(a, b) { 2050 | return T.a(b, this); 2051 | }; 2052 | g.L = function(a, b, c) { 2053 | return T.d(b, c, this); 2054 | }; 2055 | g.P = function() { 2056 | Xa(this); 2057 | return null == this.p ? null : L(this.p); 2058 | }; 2059 | g.S = function() { 2060 | Xa(this); 2061 | return null != this.p ? M(this.p) : Fb; 2062 | }; 2063 | g.G = function() { 2064 | Ec(this); 2065 | if (null == this.p) { 2066 | return null; 2067 | } 2068 | for (var a = this.p;;) { 2069 | if (a instanceof Dc) { 2070 | a = Ec(a); 2071 | } else { 2072 | return this.p = a, K(this.p); 2073 | } 2074 | } 2075 | }; 2076 | g.J = function(a, b) { 2077 | return new Dc(b, this.Ba, this.p, this.j); 2078 | }; 2079 | g.H = function(a, b) { 2080 | return R(b, this); 2081 | }; 2082 | Dc.prototype[pa] = function() { 2083 | return Ib(this); 2084 | }; 2085 | function Fc(a, b) { 2086 | this.Qa = a; 2087 | this.end = b; 2088 | this.n = 0; 2089 | this.g = 2; 2090 | } 2091 | Fc.prototype.D = function() { 2092 | return this.end; 2093 | }; 2094 | Fc.prototype.add = function(a) { 2095 | this.Qa[this.end] = a; 2096 | return this.end += 1; 2097 | }; 2098 | Fc.prototype.ba = function() { 2099 | var a = new Gc(this.Qa, 0, this.end); 2100 | this.Qa = null; 2101 | return a; 2102 | }; 2103 | function Gc(a, b, c) { 2104 | this.b = a; 2105 | this.C = b; 2106 | this.end = c; 2107 | this.n = 0; 2108 | this.g = 524306; 2109 | } 2110 | g = Gc.prototype; 2111 | g.K = function(a, b) { 2112 | return Qb.i(this.b, b, this.b[this.C], this.C + 1); 2113 | }; 2114 | g.L = function(a, b, c) { 2115 | return Qb.i(this.b, b, c, this.C); 2116 | }; 2117 | g.ab = function() { 2118 | if (this.C === this.end) { 2119 | throw Error("-drop-first of empty chunk"); 2120 | } 2121 | return new Gc(this.b, this.C + 1, this.end); 2122 | }; 2123 | g.O = function(a, b) { 2124 | return this.b[this.C + b]; 2125 | }; 2126 | g.R = function(a, b, c) { 2127 | return 0 <= b && b < this.end - this.C ? this.b[this.C + b] : c; 2128 | }; 2129 | g.D = function() { 2130 | return this.end - this.C; 2131 | }; 2132 | var Hc = function() { 2133 | function a(a, b, c) { 2134 | return new Gc(a, b, c); 2135 | } 2136 | function b(a, b) { 2137 | return new Gc(a, b, a.length); 2138 | } 2139 | function c(a) { 2140 | return new Gc(a, 0, a.length); 2141 | } 2142 | var d = null, d = function(d, f, h) { 2143 | switch(arguments.length) { 2144 | case 1: 2145 | return c.call(this, d); 2146 | case 2: 2147 | return b.call(this, d, f); 2148 | case 3: 2149 | return a.call(this, d, f, h); 2150 | } 2151 | throw Error("Invalid arity: " + arguments.length); 2152 | }; 2153 | d.e = c; 2154 | d.a = b; 2155 | d.d = a; 2156 | return d; 2157 | }(); 2158 | function Ic(a, b, c, d) { 2159 | this.ba = a; 2160 | this.aa = b; 2161 | this.l = c; 2162 | this.j = d; 2163 | this.g = 31850732; 2164 | this.n = 1536; 2165 | } 2166 | g = Ic.prototype; 2167 | g.toString = function() { 2168 | return nb(this); 2169 | }; 2170 | g.I = function() { 2171 | return this.l; 2172 | }; 2173 | g.X = function() { 2174 | if (1 < ta(this.ba)) { 2175 | return new Ic(gb(this.ba), this.aa, this.l, null); 2176 | } 2177 | var a = Xa(this.aa); 2178 | return null == a ? null : a; 2179 | }; 2180 | g.B = function() { 2181 | var a = this.j; 2182 | return null != a ? a : this.j = a = Kb(this); 2183 | }; 2184 | g.A = function(a, b) { 2185 | return Ub(this, b); 2186 | }; 2187 | g.P = function() { 2188 | return E.a(this.ba, 0); 2189 | }; 2190 | g.S = function() { 2191 | return 1 < ta(this.ba) ? new Ic(gb(this.ba), this.aa, this.l, null) : null == this.aa ? Fb : this.aa; 2192 | }; 2193 | g.G = function() { 2194 | return this; 2195 | }; 2196 | g.Ta = function() { 2197 | return this.ba; 2198 | }; 2199 | g.Ua = function() { 2200 | return null == this.aa ? Fb : this.aa; 2201 | }; 2202 | g.J = function(a, b) { 2203 | return new Ic(this.ba, this.aa, b, this.j); 2204 | }; 2205 | g.H = function(a, b) { 2206 | return R(b, this); 2207 | }; 2208 | g.Sa = function() { 2209 | return null == this.aa ? null : this.aa; 2210 | }; 2211 | Ic.prototype[pa] = function() { 2212 | return Ib(this); 2213 | }; 2214 | function Jc(a, b) { 2215 | return 0 === ta(a) ? b : new Ic(a, b, null, null); 2216 | } 2217 | function Kc(a, b) { 2218 | a.add(b); 2219 | } 2220 | function Lc(a) { 2221 | for (var b = [];;) { 2222 | if (K(a)) { 2223 | b.push(L(a)), a = N(a); 2224 | } else { 2225 | return b; 2226 | } 2227 | } 2228 | } 2229 | function Mc(a, b) { 2230 | if (Rb(a)) { 2231 | return S(a); 2232 | } 2233 | for (var c = a, d = b, e = 0;;) { 2234 | if (0 < d && K(c)) { 2235 | c = N(c), d -= 1, e += 1; 2236 | } else { 2237 | return e; 2238 | } 2239 | } 2240 | } 2241 | var Oc = function Nc(b) { 2242 | return null == b ? null : null == N(b) ? K(L(b)) : R(L(b), Nc(N(b))); 2243 | }, Pc = function() { 2244 | function a(a, b, c, d) { 2245 | return R(a, R(b, R(c, d))); 2246 | } 2247 | function b(a, b, c) { 2248 | return R(a, R(b, c)); 2249 | } 2250 | var c = null, d = function() { 2251 | function a(c, d, e, m, n) { 2252 | var p = null; 2253 | 4 < arguments.length && (p = O(Array.prototype.slice.call(arguments, 4), 0)); 2254 | return b.call(this, c, d, e, m, p); 2255 | } 2256 | function b(a, c, d, e, f) { 2257 | return R(a, R(c, R(d, R(e, Oc(f))))); 2258 | } 2259 | a.r = 4; 2260 | a.m = function(a) { 2261 | var c = L(a); 2262 | a = N(a); 2263 | var d = L(a); 2264 | a = N(a); 2265 | var e = L(a); 2266 | a = N(a); 2267 | var n = L(a); 2268 | a = M(a); 2269 | return b(c, d, e, n, a); 2270 | }; 2271 | a.k = b; 2272 | return a; 2273 | }(), c = function(c, f, h, k, l) { 2274 | switch(arguments.length) { 2275 | case 1: 2276 | return K(c); 2277 | case 2: 2278 | return R(c, f); 2279 | case 3: 2280 | return b.call(this, c, f, h); 2281 | case 4: 2282 | return a.call(this, c, f, h, k); 2283 | default: 2284 | return d.k(c, f, h, k, O(arguments, 4)); 2285 | } 2286 | throw Error("Invalid arity: " + arguments.length); 2287 | }; 2288 | c.r = 4; 2289 | c.m = d.m; 2290 | c.e = function(a) { 2291 | return K(a); 2292 | }; 2293 | c.a = function(a, b) { 2294 | return R(a, b); 2295 | }; 2296 | c.d = b; 2297 | c.i = a; 2298 | c.k = d.k; 2299 | return c; 2300 | }(), Qc = function() { 2301 | function a() { 2302 | return ab(Wb); 2303 | } 2304 | var b = null, c = function() { 2305 | function a(c, d, k) { 2306 | var l = null; 2307 | 2 < arguments.length && (l = O(Array.prototype.slice.call(arguments, 2), 0)); 2308 | return b.call(this, c, d, l); 2309 | } 2310 | function b(a, c, d) { 2311 | for (;;) { 2312 | if (a = cb(a, c), x(d)) { 2313 | c = L(d), d = N(d); 2314 | } else { 2315 | return a; 2316 | } 2317 | } 2318 | } 2319 | a.r = 2; 2320 | a.m = function(a) { 2321 | var c = L(a); 2322 | a = N(a); 2323 | var d = L(a); 2324 | a = M(a); 2325 | return b(c, d, a); 2326 | }; 2327 | a.k = b; 2328 | return a; 2329 | }(), b = function(b, e, f) { 2330 | switch(arguments.length) { 2331 | case 0: 2332 | return a.call(this); 2333 | case 1: 2334 | return b; 2335 | case 2: 2336 | return cb(b, e); 2337 | default: 2338 | return c.k(b, e, O(arguments, 2)); 2339 | } 2340 | throw Error("Invalid arity: " + arguments.length); 2341 | }; 2342 | b.r = 2; 2343 | b.m = c.m; 2344 | b.q = a; 2345 | b.e = function(a) { 2346 | return a; 2347 | }; 2348 | b.a = function(a, b) { 2349 | return cb(a, b); 2350 | }; 2351 | b.k = c.k; 2352 | return b; 2353 | }(), Rc = function() { 2354 | var a = null, b = function() { 2355 | function a(c, f, h, k) { 2356 | var l = null; 2357 | 3 < arguments.length && (l = O(Array.prototype.slice.call(arguments, 3), 0)); 2358 | return b.call(this, c, f, h, l); 2359 | } 2360 | function b(a, c, d, k) { 2361 | for (;;) { 2362 | if (a = eb(a, c, d), x(k)) { 2363 | c = L(k), d = L(N(k)), k = N(N(k)); 2364 | } else { 2365 | return a; 2366 | } 2367 | } 2368 | } 2369 | a.r = 3; 2370 | a.m = function(a) { 2371 | var c = L(a); 2372 | a = N(a); 2373 | var h = L(a); 2374 | a = N(a); 2375 | var k = L(a); 2376 | a = M(a); 2377 | return b(c, h, k, a); 2378 | }; 2379 | a.k = b; 2380 | return a; 2381 | }(), a = function(a, d, e, f) { 2382 | switch(arguments.length) { 2383 | case 3: 2384 | return eb(a, d, e); 2385 | default: 2386 | return b.k(a, d, e, O(arguments, 3)); 2387 | } 2388 | throw Error("Invalid arity: " + arguments.length); 2389 | }; 2390 | a.r = 3; 2391 | a.m = b.m; 2392 | a.d = function(a, b, e) { 2393 | return eb(a, b, e); 2394 | }; 2395 | a.k = b.k; 2396 | return a; 2397 | }(); 2398 | function Sc(a, b, c) { 2399 | var d = K(c); 2400 | if (0 === b) { 2401 | return a.q ? a.q() : a.call(null); 2402 | } 2403 | c = F(d); 2404 | var e = G(d); 2405 | if (1 === b) { 2406 | return a.e ? a.e(c) : a.e ? a.e(c) : a.call(null, c); 2407 | } 2408 | var d = F(e), f = G(e); 2409 | if (2 === b) { 2410 | return a.a ? a.a(c, d) : a.a ? a.a(c, d) : a.call(null, c, d); 2411 | } 2412 | var e = F(f), h = G(f); 2413 | if (3 === b) { 2414 | return a.d ? a.d(c, d, e) : a.d ? a.d(c, d, e) : a.call(null, c, d, e); 2415 | } 2416 | var f = F(h), k = G(h); 2417 | if (4 === b) { 2418 | return a.i ? a.i(c, d, e, f) : a.i ? a.i(c, d, e, f) : a.call(null, c, d, e, f); 2419 | } 2420 | var h = F(k), l = G(k); 2421 | if (5 === b) { 2422 | return a.u ? a.u(c, d, e, f, h) : a.u ? a.u(c, d, e, f, h) : a.call(null, c, d, e, f, h); 2423 | } 2424 | var k = F(l), m = G(l); 2425 | if (6 === b) { 2426 | return a.N ? a.N(c, d, e, f, h, k) : a.N ? a.N(c, d, e, f, h, k) : a.call(null, c, d, e, f, h, k); 2427 | } 2428 | var l = F(m), n = G(m); 2429 | if (7 === b) { 2430 | return a.U ? a.U(c, d, e, f, h, k, l) : a.U ? a.U(c, d, e, f, h, k, l) : a.call(null, c, d, e, f, h, k, l); 2431 | } 2432 | var m = F(n), p = G(n); 2433 | if (8 === b) { 2434 | return a.na ? a.na(c, d, e, f, h, k, l, m) : a.na ? a.na(c, d, e, f, h, k, l, m) : a.call(null, c, d, e, f, h, k, l, m); 2435 | } 2436 | var n = F(p), q = G(p); 2437 | if (9 === b) { 2438 | return a.oa ? a.oa(c, d, e, f, h, k, l, m, n) : a.oa ? a.oa(c, d, e, f, h, k, l, m, n) : a.call(null, c, d, e, f, h, k, l, m, n); 2439 | } 2440 | var p = F(q), r = G(q); 2441 | if (10 === b) { 2442 | return a.ca ? a.ca(c, d, e, f, h, k, l, m, n, p) : a.ca ? a.ca(c, d, e, f, h, k, l, m, n, p) : a.call(null, c, d, e, f, h, k, l, m, n, p); 2443 | } 2444 | var q = F(r), s = G(r); 2445 | if (11 === b) { 2446 | return a.da ? a.da(c, d, e, f, h, k, l, m, n, p, q) : a.da ? a.da(c, d, e, f, h, k, l, m, n, p, q) : a.call(null, c, d, e, f, h, k, l, m, n, p, q); 2447 | } 2448 | var r = F(s), u = G(s); 2449 | if (12 === b) { 2450 | return a.ea ? a.ea(c, d, e, f, h, k, l, m, n, p, q, r) : a.ea ? a.ea(c, d, e, f, h, k, l, m, n, p, q, r) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r); 2451 | } 2452 | var s = F(u), v = G(u); 2453 | if (13 === b) { 2454 | return a.fa ? a.fa(c, d, e, f, h, k, l, m, n, p, q, r, s) : a.fa ? a.fa(c, d, e, f, h, k, l, m, n, p, q, r, s) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s); 2455 | } 2456 | var u = F(v), y = G(v); 2457 | if (14 === b) { 2458 | return a.ga ? a.ga(c, d, e, f, h, k, l, m, n, p, q, r, s, u) : a.ga ? a.ga(c, d, e, f, h, k, l, m, n, p, q, r, s, u) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u); 2459 | } 2460 | var v = F(y), C = G(y); 2461 | if (15 === b) { 2462 | return a.ha ? a.ha(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) : a.ha ? a.ha(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v); 2463 | } 2464 | var y = F(C), I = G(C); 2465 | if (16 === b) { 2466 | return a.ia ? a.ia(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) : a.ia ? a.ia(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y); 2467 | } 2468 | var C = F(I), Y = G(I); 2469 | if (17 === b) { 2470 | return a.ja ? a.ja(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) : a.ja ? a.ja(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C); 2471 | } 2472 | var I = F(Y), xa = G(Y); 2473 | if (18 === b) { 2474 | return a.ka ? a.ka(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I) : a.ka ? a.ka(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I); 2475 | } 2476 | Y = F(xa); 2477 | xa = G(xa); 2478 | if (19 === b) { 2479 | return a.la ? a.la(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y) : a.la ? a.la(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y); 2480 | } 2481 | var w = F(xa); 2482 | G(xa); 2483 | if (20 === b) { 2484 | return a.ma ? a.ma(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y, w) : a.ma ? a.ma(c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y, w) : a.call(null, c, d, e, f, h, k, l, m, n, p, q, r, s, u, v, y, C, I, Y, w); 2485 | } 2486 | throw Error("Only up to 20 arguments supported on functions"); 2487 | } 2488 | var fc = function() { 2489 | function a(a, b, c, d, e) { 2490 | b = Pc.i(b, c, d, e); 2491 | c = a.r; 2492 | return a.m ? (d = Mc(b, c + 1), d <= c ? Sc(a, d, b) : a.m(b)) : a.apply(a, Lc(b)); 2493 | } 2494 | function b(a, b, c, d) { 2495 | b = Pc.d(b, c, d); 2496 | c = a.r; 2497 | return a.m ? (d = Mc(b, c + 1), d <= c ? Sc(a, d, b) : a.m(b)) : a.apply(a, Lc(b)); 2498 | } 2499 | function c(a, b, c) { 2500 | b = Pc.a(b, c); 2501 | c = a.r; 2502 | if (a.m) { 2503 | var d = Mc(b, c + 1); 2504 | return d <= c ? Sc(a, d, b) : a.m(b); 2505 | } 2506 | return a.apply(a, Lc(b)); 2507 | } 2508 | function d(a, b) { 2509 | var c = a.r; 2510 | if (a.m) { 2511 | var d = Mc(b, c + 1); 2512 | return d <= c ? Sc(a, d, b) : a.m(b); 2513 | } 2514 | return a.apply(a, Lc(b)); 2515 | } 2516 | var e = null, f = function() { 2517 | function a(c, d, e, f, h, r) { 2518 | var s = null; 2519 | 5 < arguments.length && (s = O(Array.prototype.slice.call(arguments, 5), 0)); 2520 | return b.call(this, c, d, e, f, h, s); 2521 | } 2522 | function b(a, c, d, e, f, h) { 2523 | c = R(c, R(d, R(e, R(f, Oc(h))))); 2524 | d = a.r; 2525 | return a.m ? (e = Mc(c, d + 1), e <= d ? Sc(a, e, c) : a.m(c)) : a.apply(a, Lc(c)); 2526 | } 2527 | a.r = 5; 2528 | a.m = function(a) { 2529 | var c = L(a); 2530 | a = N(a); 2531 | var d = L(a); 2532 | a = N(a); 2533 | var e = L(a); 2534 | a = N(a); 2535 | var f = L(a); 2536 | a = N(a); 2537 | var h = L(a); 2538 | a = M(a); 2539 | return b(c, d, e, f, h, a); 2540 | }; 2541 | a.k = b; 2542 | return a; 2543 | }(), e = function(e, k, l, m, n, p) { 2544 | switch(arguments.length) { 2545 | case 2: 2546 | return d.call(this, e, k); 2547 | case 3: 2548 | return c.call(this, e, k, l); 2549 | case 4: 2550 | return b.call(this, e, k, l, m); 2551 | case 5: 2552 | return a.call(this, e, k, l, m, n); 2553 | default: 2554 | return f.k(e, k, l, m, n, O(arguments, 5)); 2555 | } 2556 | throw Error("Invalid arity: " + arguments.length); 2557 | }; 2558 | e.r = 5; 2559 | e.m = f.m; 2560 | e.a = d; 2561 | e.d = c; 2562 | e.i = b; 2563 | e.u = a; 2564 | e.k = f.k; 2565 | return e; 2566 | }(); 2567 | function Tc(a, b) { 2568 | for (;;) { 2569 | if (null == K(b)) { 2570 | return!0; 2571 | } 2572 | var c; 2573 | c = L(b); 2574 | c = a.e ? a.e(c) : a.call(null, c); 2575 | if (x(c)) { 2576 | c = a; 2577 | var d = N(b); 2578 | a = c; 2579 | b = d; 2580 | } else { 2581 | return!1; 2582 | } 2583 | } 2584 | } 2585 | function Uc(a) { 2586 | this.state = a; 2587 | this.n = 0; 2588 | this.g = 32768; 2589 | } 2590 | Uc.prototype.La = function() { 2591 | return this.state; 2592 | }; 2593 | Uc.prototype.tb = function(a) { 2594 | return this.state = a; 2595 | }; 2596 | var Vc = function() { 2597 | function a(a, b, c, d) { 2598 | return new Dc(null, function() { 2599 | var f = K(b), p = K(c), q = K(d); 2600 | if (f && p && q) { 2601 | var r = R, s; 2602 | s = L(f); 2603 | var u = L(p), v = L(q); 2604 | s = a.d ? a.d(s, u, v) : a.call(null, s, u, v); 2605 | f = r(s, e.i(a, M(f), M(p), M(q))); 2606 | } else { 2607 | f = null; 2608 | } 2609 | return f; 2610 | }, null, null); 2611 | } 2612 | function b(a, b, c) { 2613 | return new Dc(null, function() { 2614 | var d = K(b), f = K(c); 2615 | if (d && f) { 2616 | var p = R, q; 2617 | q = L(d); 2618 | var r = L(f); 2619 | q = a.a ? a.a(q, r) : a.call(null, q, r); 2620 | d = p(q, e.d(a, M(d), M(f))); 2621 | } else { 2622 | d = null; 2623 | } 2624 | return d; 2625 | }, null, null); 2626 | } 2627 | function c(a, b) { 2628 | return new Dc(null, function() { 2629 | var c = K(b); 2630 | if (c) { 2631 | if (c && (c.n & 512 || c.jb)) { 2632 | for (var d = hb(c), f = S(d), p = new Fc(Array(f), 0), q = 0;;) { 2633 | if (q < f) { 2634 | Kc(p, function() { 2635 | var b = E.a(d, q); 2636 | return a.e ? a.e(b) : a.call(null, b); 2637 | }()), q += 1; 2638 | } else { 2639 | break; 2640 | } 2641 | } 2642 | return Jc(p.ba(), e.a(a, ib(c))); 2643 | } 2644 | return R(function() { 2645 | var b = L(c); 2646 | return a.e ? a.e(b) : a.call(null, b); 2647 | }(), e.a(a, M(c))); 2648 | } 2649 | return null; 2650 | }, null, null); 2651 | } 2652 | function d(a) { 2653 | return function(b) { 2654 | return function() { 2655 | function c(d, e) { 2656 | var f = a.e ? a.e(e) : a.call(null, e); 2657 | return b.a ? b.a(d, f) : b.call(null, d, f); 2658 | } 2659 | function d(a) { 2660 | return b.e ? b.e(a) : b.call(null, a); 2661 | } 2662 | function e() { 2663 | return b.q ? b.q() : b.call(null); 2664 | } 2665 | var f = null, q = function() { 2666 | function c(a, b, e) { 2667 | var f = null; 2668 | 2 < arguments.length && (f = O(Array.prototype.slice.call(arguments, 2), 0)); 2669 | return d.call(this, a, b, f); 2670 | } 2671 | function d(c, e, f) { 2672 | e = fc.d(a, e, f); 2673 | return b.a ? b.a(c, e) : b.call(null, c, e); 2674 | } 2675 | c.r = 2; 2676 | c.m = function(a) { 2677 | var b = L(a); 2678 | a = N(a); 2679 | var c = L(a); 2680 | a = M(a); 2681 | return d(b, c, a); 2682 | }; 2683 | c.k = d; 2684 | return c; 2685 | }(), f = function(a, b, f) { 2686 | switch(arguments.length) { 2687 | case 0: 2688 | return e.call(this); 2689 | case 1: 2690 | return d.call(this, a); 2691 | case 2: 2692 | return c.call(this, a, b); 2693 | default: 2694 | return q.k(a, b, O(arguments, 2)); 2695 | } 2696 | throw Error("Invalid arity: " + arguments.length); 2697 | }; 2698 | f.r = 2; 2699 | f.m = q.m; 2700 | f.q = e; 2701 | f.e = d; 2702 | f.a = c; 2703 | f.k = q.k; 2704 | return f; 2705 | }(); 2706 | }; 2707 | } 2708 | var e = null, f = function() { 2709 | function a(c, d, e, f, h) { 2710 | var r = null; 2711 | 4 < arguments.length && (r = O(Array.prototype.slice.call(arguments, 4), 0)); 2712 | return b.call(this, c, d, e, f, r); 2713 | } 2714 | function b(a, c, d, f, h) { 2715 | var k = function u(a) { 2716 | return new Dc(null, function() { 2717 | var b = e.a(K, a); 2718 | return Tc(tc, b) ? R(e.a(L, b), u(e.a(M, b))) : null; 2719 | }, null, null); 2720 | }; 2721 | return e.a(function() { 2722 | return function(b) { 2723 | return fc.a(a, b); 2724 | }; 2725 | }(k), k(Xb.k(h, f, O([d, c], 0)))); 2726 | } 2727 | a.r = 4; 2728 | a.m = function(a) { 2729 | var c = L(a); 2730 | a = N(a); 2731 | var d = L(a); 2732 | a = N(a); 2733 | var e = L(a); 2734 | a = N(a); 2735 | var f = L(a); 2736 | a = M(a); 2737 | return b(c, d, e, f, a); 2738 | }; 2739 | a.k = b; 2740 | return a; 2741 | }(), e = function(e, k, l, m, n) { 2742 | switch(arguments.length) { 2743 | case 1: 2744 | return d.call(this, e); 2745 | case 2: 2746 | return c.call(this, e, k); 2747 | case 3: 2748 | return b.call(this, e, k, l); 2749 | case 4: 2750 | return a.call(this, e, k, l, m); 2751 | default: 2752 | return f.k(e, k, l, m, O(arguments, 4)); 2753 | } 2754 | throw Error("Invalid arity: " + arguments.length); 2755 | }; 2756 | e.r = 4; 2757 | e.m = f.m; 2758 | e.e = d; 2759 | e.a = c; 2760 | e.d = b; 2761 | e.i = a; 2762 | e.k = f.k; 2763 | return e; 2764 | }(), Wc = function() { 2765 | function a(a, b) { 2766 | return new Dc(null, function() { 2767 | if (0 < a) { 2768 | var f = K(b); 2769 | return f ? R(L(f), c.a(a - 1, M(f))) : null; 2770 | } 2771 | return null; 2772 | }, null, null); 2773 | } 2774 | function b(a) { 2775 | return function(b) { 2776 | return function(a) { 2777 | return function() { 2778 | function c(d, h) { 2779 | var k = Ma(a), l = a.tb(a.La(null) - 1), k = 0 < k ? b.a ? b.a(d, h) : b.call(null, d, h) : d; 2780 | return 0 < l ? k : Nb(k) ? k : new Mb(k); 2781 | } 2782 | function d(a) { 2783 | return b.e ? b.e(a) : b.call(null, a); 2784 | } 2785 | function l() { 2786 | return b.q ? b.q() : b.call(null); 2787 | } 2788 | var m = null, m = function(a, b) { 2789 | switch(arguments.length) { 2790 | case 0: 2791 | return l.call(this); 2792 | case 1: 2793 | return d.call(this, a); 2794 | case 2: 2795 | return c.call(this, a, b); 2796 | } 2797 | throw Error("Invalid arity: " + arguments.length); 2798 | }; 2799 | m.q = l; 2800 | m.e = d; 2801 | m.a = c; 2802 | return m; 2803 | }(); 2804 | }(new Uc(a)); 2805 | }; 2806 | } 2807 | var c = null, c = function(c, e) { 2808 | switch(arguments.length) { 2809 | case 1: 2810 | return b.call(this, c); 2811 | case 2: 2812 | return a.call(this, c, e); 2813 | } 2814 | throw Error("Invalid arity: " + arguments.length); 2815 | }; 2816 | c.e = b; 2817 | c.a = a; 2818 | return c; 2819 | }(), Xc = function() { 2820 | function a(a, b) { 2821 | return Wc.a(a, c.e(b)); 2822 | } 2823 | function b(a) { 2824 | return new Dc(null, function() { 2825 | return R(a, c.e(a)); 2826 | }, null, null); 2827 | } 2828 | var c = null, c = function(c, e) { 2829 | switch(arguments.length) { 2830 | case 1: 2831 | return b.call(this, c); 2832 | case 2: 2833 | return a.call(this, c, e); 2834 | } 2835 | throw Error("Invalid arity: " + arguments.length); 2836 | }; 2837 | c.e = b; 2838 | c.a = a; 2839 | return c; 2840 | }(), Yc = function() { 2841 | function a(a, b, c) { 2842 | a && (a.n & 4 || a.lb) ? (b = uc.i(b, Qc, ab(a), c), b = db(b), a = gc(b, hc(a))) : a = uc.i(b, Xb, a, c); 2843 | return a; 2844 | } 2845 | function b(a, b) { 2846 | var c; 2847 | null != a ? a && (a.n & 4 || a.lb) ? (c = sc.d(cb, ab(a), b), c = db(c), c = gc(c, hc(a))) : c = sc.d(ua, a, b) : c = sc.d(Xb, Fb, b); 2848 | return c; 2849 | } 2850 | var c = null, c = function(c, e, f) { 2851 | switch(arguments.length) { 2852 | case 2: 2853 | return b.call(this, c, e); 2854 | case 3: 2855 | return a.call(this, c, e, f); 2856 | } 2857 | throw Error("Invalid arity: " + arguments.length); 2858 | }; 2859 | c.a = b; 2860 | c.d = a; 2861 | return c; 2862 | }(); 2863 | function Zc(a, b) { 2864 | this.o = a; 2865 | this.b = b; 2866 | } 2867 | function $c(a) { 2868 | return new Zc(a, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]); 2869 | } 2870 | function ad(a) { 2871 | a = a.f; 2872 | return 32 > a ? 0 : a - 1 >>> 5 << 5; 2873 | } 2874 | function bd(a, b, c) { 2875 | for (;;) { 2876 | if (0 === b) { 2877 | return c; 2878 | } 2879 | var d = $c(a); 2880 | d.b[0] = c; 2881 | c = d; 2882 | b -= 5; 2883 | } 2884 | } 2885 | var dd = function cd(b, c, d, e) { 2886 | var f = new Zc(d.o, D(d.b)), h = b.f - 1 >>> c & 31; 2887 | 5 === c ? f.b[h] = e : (d = d.b[h], b = null != d ? cd(b, c - 5, d, e) : bd(null, c - 5, e), f.b[h] = b); 2888 | return f; 2889 | }; 2890 | function ed(a, b) { 2891 | throw Error([B("No item "), B(a), B(" in vector of length "), B(b)].join("")); 2892 | } 2893 | function fd(a, b) { 2894 | if (b >= ad(a)) { 2895 | return a.M; 2896 | } 2897 | for (var c = a.root, d = a.shift;;) { 2898 | if (0 < d) { 2899 | var e = d - 5, c = c.b[b >>> d & 31], d = e 2900 | } else { 2901 | return c.b; 2902 | } 2903 | } 2904 | } 2905 | function gd(a, b) { 2906 | return 0 <= b && b < a.f ? fd(a, b) : ed(b, a.f); 2907 | } 2908 | var id = function hd(b, c, d, e, f) { 2909 | var h = new Zc(d.o, D(d.b)); 2910 | if (0 === c) { 2911 | h.b[e & 31] = f; 2912 | } else { 2913 | var k = e >>> c & 31; 2914 | b = hd(b, c - 5, d.b[k], e, f); 2915 | h.b[k] = b; 2916 | } 2917 | return h; 2918 | }; 2919 | function jd(a, b, c, d, e, f) { 2920 | this.h = a; 2921 | this.Pa = b; 2922 | this.b = c; 2923 | this.sa = d; 2924 | this.start = e; 2925 | this.end = f; 2926 | } 2927 | jd.prototype.Za = function() { 2928 | return this.h < this.end; 2929 | }; 2930 | jd.prototype.next = function() { 2931 | 32 === this.h - this.Pa && (this.b = fd(this.sa, this.h), this.Pa += 32); 2932 | var a = this.b[this.h & 31]; 2933 | this.h += 1; 2934 | return a; 2935 | }; 2936 | function W(a, b, c, d, e, f) { 2937 | this.l = a; 2938 | this.f = b; 2939 | this.shift = c; 2940 | this.root = d; 2941 | this.M = e; 2942 | this.j = f; 2943 | this.g = 167668511; 2944 | this.n = 8196; 2945 | } 2946 | g = W.prototype; 2947 | g.toString = function() { 2948 | return nb(this); 2949 | }; 2950 | g.t = function(a, b) { 2951 | return H.d(this, b, null); 2952 | }; 2953 | g.s = function(a, b, c) { 2954 | return "number" === typeof b ? E.d(this, b, c) : c; 2955 | }; 2956 | g.O = function(a, b) { 2957 | return gd(this, b)[b & 31]; 2958 | }; 2959 | g.R = function(a, b, c) { 2960 | return 0 <= b && b < this.f ? fd(this, b)[b & 31] : c; 2961 | }; 2962 | g.Ya = function(a, b, c) { 2963 | if (0 <= b && b < this.f) { 2964 | return ad(this) <= b ? (a = D(this.M), a[b & 31] = c, new W(this.l, this.f, this.shift, this.root, a, null)) : new W(this.l, this.f, this.shift, id(this, this.shift, this.root, b, c), this.M, null); 2965 | } 2966 | if (b === this.f) { 2967 | return ua(this, c); 2968 | } 2969 | throw Error([B("Index "), B(b), B(" out of bounds [0,"), B(this.f), B("]")].join("")); 2970 | }; 2971 | g.Na = function() { 2972 | var a = this.f; 2973 | return new jd(0, 0, 0 < S(this) ? fd(this, 0) : null, this, 0, a); 2974 | }; 2975 | g.I = function() { 2976 | return this.l; 2977 | }; 2978 | g.D = function() { 2979 | return this.f; 2980 | }; 2981 | g.Xa = function() { 2982 | return E.a(this, 0); 2983 | }; 2984 | g.cb = function() { 2985 | return E.a(this, 1); 2986 | }; 2987 | g.B = function() { 2988 | var a = this.j; 2989 | return null != a ? a : this.j = a = Kb(this); 2990 | }; 2991 | g.A = function(a, b) { 2992 | if (b instanceof W) { 2993 | if (this.f === S(b)) { 2994 | for (var c = kb(this), d = kb(b);;) { 2995 | if (x(c.Za())) { 2996 | var e = c.next(), f = d.next(); 2997 | if (!Gb.a(e, f)) { 2998 | return!1; 2999 | } 3000 | } else { 3001 | return!0; 3002 | } 3003 | } 3004 | } else { 3005 | return!1; 3006 | } 3007 | } else { 3008 | return Ub(this, b); 3009 | } 3010 | }; 3011 | g.Ga = function() { 3012 | var a = this; 3013 | return new ld(a.f, a.shift, function() { 3014 | var b = a.root; 3015 | return md.e ? md.e(b) : md.call(null, b); 3016 | }(), function() { 3017 | var b = a.M; 3018 | return nd.e ? nd.e(b) : nd.call(null, b); 3019 | }()); 3020 | }; 3021 | g.K = function(a, b) { 3022 | return Pb.a(this, b); 3023 | }; 3024 | g.L = function(a, b, c) { 3025 | a = 0; 3026 | for (var d = c;;) { 3027 | if (a < this.f) { 3028 | var e = fd(this, a); 3029 | c = e.length; 3030 | a: { 3031 | for (var f = 0;;) { 3032 | if (f < c) { 3033 | var h = e[f], d = b.a ? b.a(d, h) : b.call(null, d, h); 3034 | if (Nb(d)) { 3035 | e = d; 3036 | break a; 3037 | } 3038 | f += 1; 3039 | } else { 3040 | e = d; 3041 | break a; 3042 | } 3043 | } 3044 | e = void 0; 3045 | } 3046 | if (Nb(e)) { 3047 | return b = e, Ob.e ? Ob.e(b) : Ob.call(null, b); 3048 | } 3049 | a += c; 3050 | d = e; 3051 | } else { 3052 | return d; 3053 | } 3054 | } 3055 | }; 3056 | g.Fa = function(a, b, c) { 3057 | if ("number" === typeof b) { 3058 | return La(this, b, c); 3059 | } 3060 | throw Error("Vector's key for assoc must be a number."); 3061 | }; 3062 | g.G = function() { 3063 | if (0 === this.f) { 3064 | return null; 3065 | } 3066 | if (32 >= this.f) { 3067 | return new Eb(this.M, 0); 3068 | } 3069 | var a; 3070 | a: { 3071 | a = this.root; 3072 | for (var b = this.shift;;) { 3073 | if (0 < b) { 3074 | b -= 5, a = a.b[0]; 3075 | } else { 3076 | a = a.b; 3077 | break a; 3078 | } 3079 | } 3080 | a = void 0; 3081 | } 3082 | return Z.i ? Z.i(this, a, 0, 0) : Z.call(null, this, a, 0, 0); 3083 | }; 3084 | g.J = function(a, b) { 3085 | return new W(b, this.f, this.shift, this.root, this.M, this.j); 3086 | }; 3087 | g.H = function(a, b) { 3088 | if (32 > this.f - ad(this)) { 3089 | for (var c = this.M.length, d = Array(c + 1), e = 0;;) { 3090 | if (e < c) { 3091 | d[e] = this.M[e], e += 1; 3092 | } else { 3093 | break; 3094 | } 3095 | } 3096 | d[c] = b; 3097 | return new W(this.l, this.f + 1, this.shift, this.root, d, null); 3098 | } 3099 | c = (d = this.f >>> 5 > 1 << this.shift) ? this.shift + 5 : this.shift; 3100 | d ? (d = $c(null), d.b[0] = this.root, e = bd(null, this.shift, new Zc(null, this.M)), d.b[1] = e) : d = dd(this, this.shift, this.root, new Zc(null, this.M)); 3101 | return new W(this.l, this.f + 1, c, d, [b], null); 3102 | }; 3103 | g.call = function() { 3104 | var a = null, a = function(a, c, d) { 3105 | switch(arguments.length) { 3106 | case 2: 3107 | return this.O(null, c); 3108 | case 3: 3109 | return this.R(null, c, d); 3110 | } 3111 | throw Error("Invalid arity: " + arguments.length); 3112 | }; 3113 | a.a = function(a, c) { 3114 | return this.O(null, c); 3115 | }; 3116 | a.d = function(a, c, d) { 3117 | return this.R(null, c, d); 3118 | }; 3119 | return a; 3120 | }(); 3121 | g.apply = function(a, b) { 3122 | return this.call.apply(this, [this].concat(D(b))); 3123 | }; 3124 | g.e = function(a) { 3125 | return this.O(null, a); 3126 | }; 3127 | g.a = function(a, b) { 3128 | return this.R(null, a, b); 3129 | }; 3130 | var od = new Zc(null, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]), Wb = new W(null, 0, 5, od, [], 0); 3131 | W.prototype[pa] = function() { 3132 | return Ib(this); 3133 | }; 3134 | function pd(a, b, c, d, e, f) { 3135 | this.T = a; 3136 | this.pa = b; 3137 | this.h = c; 3138 | this.C = d; 3139 | this.l = e; 3140 | this.j = f; 3141 | this.g = 32375020; 3142 | this.n = 1536; 3143 | } 3144 | g = pd.prototype; 3145 | g.toString = function() { 3146 | return nb(this); 3147 | }; 3148 | g.I = function() { 3149 | return this.l; 3150 | }; 3151 | g.X = function() { 3152 | if (this.C + 1 < this.pa.length) { 3153 | var a; 3154 | a = this.T; 3155 | var b = this.pa, c = this.h, d = this.C + 1; 3156 | a = Z.i ? Z.i(a, b, c, d) : Z.call(null, a, b, c, d); 3157 | return null == a ? null : a; 3158 | } 3159 | return jb(this); 3160 | }; 3161 | g.B = function() { 3162 | var a = this.j; 3163 | return null != a ? a : this.j = a = Kb(this); 3164 | }; 3165 | g.A = function(a, b) { 3166 | return Ub(this, b); 3167 | }; 3168 | g.K = function(a, b) { 3169 | var c = this; 3170 | return Pb.a(function() { 3171 | var a = c.T, b = c.h + c.C, f = S(c.T); 3172 | return qd.d ? qd.d(a, b, f) : qd.call(null, a, b, f); 3173 | }(), b); 3174 | }; 3175 | g.L = function(a, b, c) { 3176 | var d = this; 3177 | return Pb.d(function() { 3178 | var a = d.T, b = d.h + d.C, c = S(d.T); 3179 | return qd.d ? qd.d(a, b, c) : qd.call(null, a, b, c); 3180 | }(), b, c); 3181 | }; 3182 | g.P = function() { 3183 | return this.pa[this.C]; 3184 | }; 3185 | g.S = function() { 3186 | if (this.C + 1 < this.pa.length) { 3187 | var a; 3188 | a = this.T; 3189 | var b = this.pa, c = this.h, d = this.C + 1; 3190 | a = Z.i ? Z.i(a, b, c, d) : Z.call(null, a, b, c, d); 3191 | return null == a ? Fb : a; 3192 | } 3193 | return ib(this); 3194 | }; 3195 | g.G = function() { 3196 | return this; 3197 | }; 3198 | g.Ta = function() { 3199 | return Hc.a(this.pa, this.C); 3200 | }; 3201 | g.Ua = function() { 3202 | var a = this.h + this.pa.length; 3203 | if (a < ta(this.T)) { 3204 | var b = this.T, c = fd(this.T, a); 3205 | return Z.i ? Z.i(b, c, a, 0) : Z.call(null, b, c, a, 0); 3206 | } 3207 | return Fb; 3208 | }; 3209 | g.J = function(a, b) { 3210 | var c = this.T, d = this.pa, e = this.h, f = this.C; 3211 | return Z.u ? Z.u(c, d, e, f, b) : Z.call(null, c, d, e, f, b); 3212 | }; 3213 | g.H = function(a, b) { 3214 | return R(b, this); 3215 | }; 3216 | g.Sa = function() { 3217 | var a = this.h + this.pa.length; 3218 | if (a < ta(this.T)) { 3219 | var b = this.T, c = fd(this.T, a); 3220 | return Z.i ? Z.i(b, c, a, 0) : Z.call(null, b, c, a, 0); 3221 | } 3222 | return null; 3223 | }; 3224 | pd.prototype[pa] = function() { 3225 | return Ib(this); 3226 | }; 3227 | var Z = function() { 3228 | function a(a, b, c, d, l) { 3229 | return new pd(a, b, c, d, l, null); 3230 | } 3231 | function b(a, b, c, d) { 3232 | return new pd(a, b, c, d, null, null); 3233 | } 3234 | function c(a, b, c) { 3235 | return new pd(a, gd(a, b), b, c, null, null); 3236 | } 3237 | var d = null, d = function(d, f, h, k, l) { 3238 | switch(arguments.length) { 3239 | case 3: 3240 | return c.call(this, d, f, h); 3241 | case 4: 3242 | return b.call(this, d, f, h, k); 3243 | case 5: 3244 | return a.call(this, d, f, h, k, l); 3245 | } 3246 | throw Error("Invalid arity: " + arguments.length); 3247 | }; 3248 | d.d = c; 3249 | d.i = b; 3250 | d.u = a; 3251 | return d; 3252 | }(); 3253 | function rd(a, b, c, d, e) { 3254 | this.l = a; 3255 | this.sa = b; 3256 | this.start = c; 3257 | this.end = d; 3258 | this.j = e; 3259 | this.g = 166617887; 3260 | this.n = 8192; 3261 | } 3262 | g = rd.prototype; 3263 | g.toString = function() { 3264 | return nb(this); 3265 | }; 3266 | g.t = function(a, b) { 3267 | return H.d(this, b, null); 3268 | }; 3269 | g.s = function(a, b, c) { 3270 | return "number" === typeof b ? E.d(this, b, c) : c; 3271 | }; 3272 | g.O = function(a, b) { 3273 | return 0 > b || this.end <= this.start + b ? ed(b, this.end - this.start) : E.a(this.sa, this.start + b); 3274 | }; 3275 | g.R = function(a, b, c) { 3276 | return 0 > b || this.end <= this.start + b ? c : E.d(this.sa, this.start + b, c); 3277 | }; 3278 | g.Ya = function(a, b, c) { 3279 | var d = this.start + b; 3280 | a = this.l; 3281 | c = cc.d(this.sa, d, c); 3282 | b = this.start; 3283 | var e = this.end, d = d + 1, d = e > d ? e : d; 3284 | return sd.u ? sd.u(a, c, b, d, null) : sd.call(null, a, c, b, d, null); 3285 | }; 3286 | g.I = function() { 3287 | return this.l; 3288 | }; 3289 | g.D = function() { 3290 | return this.end - this.start; 3291 | }; 3292 | g.B = function() { 3293 | var a = this.j; 3294 | return null != a ? a : this.j = a = Kb(this); 3295 | }; 3296 | g.A = function(a, b) { 3297 | return Ub(this, b); 3298 | }; 3299 | g.K = function(a, b) { 3300 | return Pb.a(this, b); 3301 | }; 3302 | g.L = function(a, b, c) { 3303 | return Pb.d(this, b, c); 3304 | }; 3305 | g.Fa = function(a, b, c) { 3306 | if ("number" === typeof b) { 3307 | return La(this, b, c); 3308 | } 3309 | throw Error("Subvec's key for assoc must be a number."); 3310 | }; 3311 | g.G = function() { 3312 | var a = this; 3313 | return function(b) { 3314 | return function d(e) { 3315 | return e === a.end ? null : R(E.a(a.sa, e), new Dc(null, function() { 3316 | return function() { 3317 | return d(e + 1); 3318 | }; 3319 | }(b), null, null)); 3320 | }; 3321 | }(this)(a.start); 3322 | }; 3323 | g.J = function(a, b) { 3324 | var c = this.sa, d = this.start, e = this.end, f = this.j; 3325 | return sd.u ? sd.u(b, c, d, e, f) : sd.call(null, b, c, d, e, f); 3326 | }; 3327 | g.H = function(a, b) { 3328 | var c = this.l, d = La(this.sa, this.end, b), e = this.start, f = this.end + 1; 3329 | return sd.u ? sd.u(c, d, e, f, null) : sd.call(null, c, d, e, f, null); 3330 | }; 3331 | g.call = function() { 3332 | var a = null, a = function(a, c, d) { 3333 | switch(arguments.length) { 3334 | case 2: 3335 | return this.O(null, c); 3336 | case 3: 3337 | return this.R(null, c, d); 3338 | } 3339 | throw Error("Invalid arity: " + arguments.length); 3340 | }; 3341 | a.a = function(a, c) { 3342 | return this.O(null, c); 3343 | }; 3344 | a.d = function(a, c, d) { 3345 | return this.R(null, c, d); 3346 | }; 3347 | return a; 3348 | }(); 3349 | g.apply = function(a, b) { 3350 | return this.call.apply(this, [this].concat(D(b))); 3351 | }; 3352 | g.e = function(a) { 3353 | return this.O(null, a); 3354 | }; 3355 | g.a = function(a, b) { 3356 | return this.R(null, a, b); 3357 | }; 3358 | rd.prototype[pa] = function() { 3359 | return Ib(this); 3360 | }; 3361 | function sd(a, b, c, d, e) { 3362 | for (;;) { 3363 | if (b instanceof rd) { 3364 | c = b.start + c, d = b.start + d, b = b.sa; 3365 | } else { 3366 | var f = S(b); 3367 | if (0 > c || 0 > d || c > f || d > f) { 3368 | throw Error("Index out of bounds"); 3369 | } 3370 | return new rd(a, b, c, d, e); 3371 | } 3372 | } 3373 | } 3374 | var qd = function() { 3375 | function a(a, b, c) { 3376 | return sd(null, a, b, c, null); 3377 | } 3378 | function b(a, b) { 3379 | return c.d(a, b, S(a)); 3380 | } 3381 | var c = null, c = function(c, e, f) { 3382 | switch(arguments.length) { 3383 | case 2: 3384 | return b.call(this, c, e); 3385 | case 3: 3386 | return a.call(this, c, e, f); 3387 | } 3388 | throw Error("Invalid arity: " + arguments.length); 3389 | }; 3390 | c.a = b; 3391 | c.d = a; 3392 | return c; 3393 | }(); 3394 | function td(a, b) { 3395 | return a === b.o ? b : new Zc(a, D(b.b)); 3396 | } 3397 | function md(a) { 3398 | return new Zc({}, D(a.b)); 3399 | } 3400 | function nd(a) { 3401 | var b = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; 3402 | mc(a, 0, b, 0, a.length); 3403 | return b; 3404 | } 3405 | var vd = function ud(b, c, d, e) { 3406 | d = td(b.root.o, d); 3407 | var f = b.f - 1 >>> c & 31; 3408 | if (5 === c) { 3409 | b = e; 3410 | } else { 3411 | var h = d.b[f]; 3412 | b = null != h ? ud(b, c - 5, h, e) : bd(b.root.o, c - 5, e); 3413 | } 3414 | d.b[f] = b; 3415 | return d; 3416 | }; 3417 | function ld(a, b, c, d) { 3418 | this.f = a; 3419 | this.shift = b; 3420 | this.root = c; 3421 | this.M = d; 3422 | this.g = 275; 3423 | this.n = 88; 3424 | } 3425 | g = ld.prototype; 3426 | g.call = function() { 3427 | var a = null, a = function(a, c, d) { 3428 | switch(arguments.length) { 3429 | case 2: 3430 | return this.t(null, c); 3431 | case 3: 3432 | return this.s(null, c, d); 3433 | } 3434 | throw Error("Invalid arity: " + arguments.length); 3435 | }; 3436 | a.a = function(a, c) { 3437 | return this.t(null, c); 3438 | }; 3439 | a.d = function(a, c, d) { 3440 | return this.s(null, c, d); 3441 | }; 3442 | return a; 3443 | }(); 3444 | g.apply = function(a, b) { 3445 | return this.call.apply(this, [this].concat(D(b))); 3446 | }; 3447 | g.e = function(a) { 3448 | return this.t(null, a); 3449 | }; 3450 | g.a = function(a, b) { 3451 | return this.s(null, a, b); 3452 | }; 3453 | g.t = function(a, b) { 3454 | return H.d(this, b, null); 3455 | }; 3456 | g.s = function(a, b, c) { 3457 | return "number" === typeof b ? E.d(this, b, c) : c; 3458 | }; 3459 | g.O = function(a, b) { 3460 | if (this.root.o) { 3461 | return gd(this, b)[b & 31]; 3462 | } 3463 | throw Error("nth after persistent!"); 3464 | }; 3465 | g.R = function(a, b, c) { 3466 | return 0 <= b && b < this.f ? E.a(this, b) : c; 3467 | }; 3468 | g.D = function() { 3469 | if (this.root.o) { 3470 | return this.f; 3471 | } 3472 | throw Error("count after persistent!"); 3473 | }; 3474 | g.fb = function(a, b, c) { 3475 | var d = this; 3476 | if (d.root.o) { 3477 | if (0 <= b && b < d.f) { 3478 | return ad(this) <= b ? d.M[b & 31] = c : (a = function() { 3479 | return function f(a, k) { 3480 | var l = td(d.root.o, k); 3481 | if (0 === a) { 3482 | l.b[b & 31] = c; 3483 | } else { 3484 | var m = b >>> a & 31, n = f(a - 5, l.b[m]); 3485 | l.b[m] = n; 3486 | } 3487 | return l; 3488 | }; 3489 | }(this).call(null, d.shift, d.root), d.root = a), this; 3490 | } 3491 | if (b === d.f) { 3492 | return cb(this, c); 3493 | } 3494 | throw Error([B("Index "), B(b), B(" out of bounds for TransientVector of length"), B(d.f)].join("")); 3495 | } 3496 | throw Error("assoc! after persistent!"); 3497 | }; 3498 | g.Ha = function(a, b, c) { 3499 | if ("number" === typeof b) { 3500 | return fb(this, b, c); 3501 | } 3502 | throw Error("TransientVector's key for assoc! must be a number."); 3503 | }; 3504 | g.Ia = function(a, b) { 3505 | if (this.root.o) { 3506 | if (32 > this.f - ad(this)) { 3507 | this.M[this.f & 31] = b; 3508 | } else { 3509 | var c = new Zc(this.root.o, this.M), d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; 3510 | d[0] = b; 3511 | this.M = d; 3512 | if (this.f >>> 5 > 1 << this.shift) { 3513 | var d = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], e = this.shift + 5; 3514 | d[0] = this.root; 3515 | d[1] = bd(this.root.o, this.shift, c); 3516 | this.root = new Zc(this.root.o, d); 3517 | this.shift = e; 3518 | } else { 3519 | this.root = vd(this, this.shift, this.root, c); 3520 | } 3521 | } 3522 | this.f += 1; 3523 | return this; 3524 | } 3525 | throw Error("conj! after persistent!"); 3526 | }; 3527 | g.Ja = function() { 3528 | if (this.root.o) { 3529 | this.root.o = null; 3530 | var a = this.f - ad(this), b = Array(a); 3531 | mc(this.M, 0, b, 0, a); 3532 | return new W(null, this.f, this.shift, this.root, b, null); 3533 | } 3534 | throw Error("persistent! called twice"); 3535 | }; 3536 | function wd() { 3537 | this.n = 0; 3538 | this.g = 2097152; 3539 | } 3540 | wd.prototype.A = function() { 3541 | return!1; 3542 | }; 3543 | var xd = new wd; 3544 | function yd(a, b) { 3545 | return pc(jc(b) ? S(a) === S(b) ? Tc(tc, Vc.a(function(a) { 3546 | return Gb.a($b.d(b, L(a), xd), L(N(a))); 3547 | }, a)) : null : null); 3548 | } 3549 | function zd(a, b) { 3550 | var c = a.b; 3551 | if (b instanceof U) { 3552 | a: { 3553 | for (var d = c.length, e = b.$, f = 0;;) { 3554 | if (d <= f) { 3555 | c = -1; 3556 | break a; 3557 | } 3558 | var h = c[f]; 3559 | if (h instanceof U && e === h.$) { 3560 | c = f; 3561 | break a; 3562 | } 3563 | f += 2; 3564 | } 3565 | c = void 0; 3566 | } 3567 | } else { 3568 | if (d = "string" == typeof b, x(x(d) ? d : "number" === typeof b)) { 3569 | a: { 3570 | d = c.length; 3571 | for (e = 0;;) { 3572 | if (d <= e) { 3573 | c = -1; 3574 | break a; 3575 | } 3576 | if (b === c[e]) { 3577 | c = e; 3578 | break a; 3579 | } 3580 | e += 2; 3581 | } 3582 | c = void 0; 3583 | } 3584 | } else { 3585 | if (null == b) { 3586 | a: { 3587 | d = c.length; 3588 | for (e = 0;;) { 3589 | if (d <= e) { 3590 | c = -1; 3591 | break a; 3592 | } 3593 | if (null == c[e]) { 3594 | c = e; 3595 | break a; 3596 | } 3597 | e += 2; 3598 | } 3599 | c = void 0; 3600 | } 3601 | } else { 3602 | a: { 3603 | d = c.length; 3604 | for (e = 0;;) { 3605 | if (d <= e) { 3606 | c = -1; 3607 | break a; 3608 | } 3609 | if (Gb.a(b, c[e])) { 3610 | c = e; 3611 | break a; 3612 | } 3613 | e += 2; 3614 | } 3615 | c = void 0; 3616 | } 3617 | } 3618 | } 3619 | } 3620 | return c; 3621 | } 3622 | function Ad(a, b, c) { 3623 | this.b = a; 3624 | this.h = b; 3625 | this.ya = c; 3626 | this.n = 0; 3627 | this.g = 32374990; 3628 | } 3629 | g = Ad.prototype; 3630 | g.toString = function() { 3631 | return nb(this); 3632 | }; 3633 | g.I = function() { 3634 | return this.ya; 3635 | }; 3636 | g.X = function() { 3637 | return this.h < this.b.length - 2 ? new Ad(this.b, this.h + 2, this.ya) : null; 3638 | }; 3639 | g.D = function() { 3640 | return(this.b.length - this.h) / 2; 3641 | }; 3642 | g.B = function() { 3643 | return Kb(this); 3644 | }; 3645 | g.A = function(a, b) { 3646 | return Ub(this, b); 3647 | }; 3648 | g.K = function(a, b) { 3649 | return T.a(b, this); 3650 | }; 3651 | g.L = function(a, b, c) { 3652 | return T.d(b, c, this); 3653 | }; 3654 | g.P = function() { 3655 | return new W(null, 2, 5, od, [this.b[this.h], this.b[this.h + 1]], null); 3656 | }; 3657 | g.S = function() { 3658 | return this.h < this.b.length - 2 ? new Ad(this.b, this.h + 2, this.ya) : Fb; 3659 | }; 3660 | g.G = function() { 3661 | return this; 3662 | }; 3663 | g.J = function(a, b) { 3664 | return new Ad(this.b, this.h, b); 3665 | }; 3666 | g.H = function(a, b) { 3667 | return R(b, this); 3668 | }; 3669 | Ad.prototype[pa] = function() { 3670 | return Ib(this); 3671 | }; 3672 | function Bd(a, b, c) { 3673 | this.b = a; 3674 | this.h = b; 3675 | this.f = c; 3676 | } 3677 | Bd.prototype.Za = function() { 3678 | return this.h < this.f; 3679 | }; 3680 | Bd.prototype.next = function() { 3681 | var a = new W(null, 2, 5, od, [this.b[this.h], this.b[this.h + 1]], null); 3682 | this.h += 2; 3683 | return a; 3684 | }; 3685 | function ob(a, b, c, d) { 3686 | this.l = a; 3687 | this.f = b; 3688 | this.b = c; 3689 | this.j = d; 3690 | this.g = 16647951; 3691 | this.n = 8196; 3692 | } 3693 | g = ob.prototype; 3694 | g.toString = function() { 3695 | return nb(this); 3696 | }; 3697 | g.t = function(a, b) { 3698 | return H.d(this, b, null); 3699 | }; 3700 | g.s = function(a, b, c) { 3701 | a = zd(this, b); 3702 | return-1 === a ? c : this.b[a + 1]; 3703 | }; 3704 | g.Na = function() { 3705 | return new Bd(this.b, 0, 2 * this.f); 3706 | }; 3707 | g.I = function() { 3708 | return this.l; 3709 | }; 3710 | g.D = function() { 3711 | return this.f; 3712 | }; 3713 | g.B = function() { 3714 | var a = this.j; 3715 | return null != a ? a : this.j = a = Lb(this); 3716 | }; 3717 | g.A = function(a, b) { 3718 | if (b && (b.g & 1024 || b.ob)) { 3719 | var c = this.b.length; 3720 | if (this.f === b.D(null)) { 3721 | for (var d = 0;;) { 3722 | if (d < c) { 3723 | var e = b.s(null, this.b[d], oc); 3724 | if (e !== oc) { 3725 | if (Gb.a(this.b[d + 1], e)) { 3726 | d += 2; 3727 | } else { 3728 | return!1; 3729 | } 3730 | } else { 3731 | return!1; 3732 | } 3733 | } else { 3734 | return!0; 3735 | } 3736 | } 3737 | } else { 3738 | return!1; 3739 | } 3740 | } else { 3741 | return yd(this, b); 3742 | } 3743 | }; 3744 | g.Ga = function() { 3745 | return new Cd({}, this.b.length, D(this.b)); 3746 | }; 3747 | g.K = function(a, b) { 3748 | return T.a(b, this); 3749 | }; 3750 | g.L = function(a, b, c) { 3751 | return T.d(b, c, this); 3752 | }; 3753 | g.Fa = function(a, b, c) { 3754 | a = zd(this, b); 3755 | if (-1 === a) { 3756 | if (this.f < Dd) { 3757 | a = this.b; 3758 | for (var d = a.length, e = Array(d + 2), f = 0;;) { 3759 | if (f < d) { 3760 | e[f] = a[f], f += 1; 3761 | } else { 3762 | break; 3763 | } 3764 | } 3765 | e[d] = b; 3766 | e[d + 1] = c; 3767 | return new ob(this.l, this.f + 1, e, null); 3768 | } 3769 | return Ra(Da(Yc.a(ac, this), b, c), this.l); 3770 | } 3771 | if (c === this.b[a + 1]) { 3772 | return this; 3773 | } 3774 | b = D(this.b); 3775 | b[a + 1] = c; 3776 | return new ob(this.l, this.f, b, null); 3777 | }; 3778 | g.Ra = function(a, b) { 3779 | return-1 !== zd(this, b); 3780 | }; 3781 | g.G = function() { 3782 | var a = this.b; 3783 | return 0 <= a.length - 2 ? new Ad(a, 0, null) : null; 3784 | }; 3785 | g.J = function(a, b) { 3786 | return new ob(b, this.f, this.b, this.j); 3787 | }; 3788 | g.H = function(a, b) { 3789 | if (kc(b)) { 3790 | return Da(this, E.a(b, 0), E.a(b, 1)); 3791 | } 3792 | for (var c = this, d = K(b);;) { 3793 | if (null == d) { 3794 | return c; 3795 | } 3796 | var e = L(d); 3797 | if (kc(e)) { 3798 | c = Da(c, E.a(e, 0), E.a(e, 1)), d = N(d); 3799 | } else { 3800 | throw Error("conj on a map takes map entries or seqables of map entries"); 3801 | } 3802 | } 3803 | }; 3804 | g.call = function() { 3805 | var a = null, a = function(a, c, d) { 3806 | switch(arguments.length) { 3807 | case 2: 3808 | return this.t(null, c); 3809 | case 3: 3810 | return this.s(null, c, d); 3811 | } 3812 | throw Error("Invalid arity: " + arguments.length); 3813 | }; 3814 | a.a = function(a, c) { 3815 | return this.t(null, c); 3816 | }; 3817 | a.d = function(a, c, d) { 3818 | return this.s(null, c, d); 3819 | }; 3820 | return a; 3821 | }(); 3822 | g.apply = function(a, b) { 3823 | return this.call.apply(this, [this].concat(D(b))); 3824 | }; 3825 | g.e = function(a) { 3826 | return this.t(null, a); 3827 | }; 3828 | g.a = function(a, b) { 3829 | return this.s(null, a, b); 3830 | }; 3831 | var Ed = new ob(null, 0, [], null), Dd = 8; 3832 | ob.prototype[pa] = function() { 3833 | return Ib(this); 3834 | }; 3835 | function Cd(a, b, c) { 3836 | this.za = a; 3837 | this.Da = b; 3838 | this.b = c; 3839 | this.n = 56; 3840 | this.g = 258; 3841 | } 3842 | g = Cd.prototype; 3843 | g.Ha = function(a, b, c) { 3844 | var d = this; 3845 | if (x(d.za)) { 3846 | a = zd(this, b); 3847 | if (-1 === a) { 3848 | return d.Da + 2 <= 2 * Dd ? (d.Da += 2, d.b.push(b), d.b.push(c), this) : Rc.d(function() { 3849 | var a = d.Da, b = d.b; 3850 | return Fd.a ? Fd.a(a, b) : Fd.call(null, a, b); 3851 | }(), b, c); 3852 | } 3853 | c !== d.b[a + 1] && (d.b[a + 1] = c); 3854 | return this; 3855 | } 3856 | throw Error("assoc! after persistent!"); 3857 | }; 3858 | g.Ia = function(a, b) { 3859 | if (x(this.za)) { 3860 | if (b ? b.g & 2048 || b.pb || (b.g ? 0 : z(Fa, b)) : z(Fa, b)) { 3861 | return eb(this, Gd.e ? Gd.e(b) : Gd.call(null, b), Hd.e ? Hd.e(b) : Hd.call(null, b)); 3862 | } 3863 | for (var c = K(b), d = this;;) { 3864 | var e = L(c); 3865 | if (x(e)) { 3866 | var f = e, c = N(c), d = eb(d, function() { 3867 | var a = f; 3868 | return Gd.e ? Gd.e(a) : Gd.call(null, a); 3869 | }(), function() { 3870 | var a = f; 3871 | return Hd.e ? Hd.e(a) : Hd.call(null, a); 3872 | }()) 3873 | } else { 3874 | return d; 3875 | } 3876 | } 3877 | } else { 3878 | throw Error("conj! after persistent!"); 3879 | } 3880 | }; 3881 | g.Ja = function() { 3882 | if (x(this.za)) { 3883 | return this.za = !1, new ob(null, vc(this.Da), this.b, null); 3884 | } 3885 | throw Error("persistent! called twice"); 3886 | }; 3887 | g.t = function(a, b) { 3888 | return H.d(this, b, null); 3889 | }; 3890 | g.s = function(a, b, c) { 3891 | if (x(this.za)) { 3892 | return a = zd(this, b), -1 === a ? c : this.b[a + 1]; 3893 | } 3894 | throw Error("lookup after persistent!"); 3895 | }; 3896 | g.D = function() { 3897 | if (x(this.za)) { 3898 | return vc(this.Da); 3899 | } 3900 | throw Error("count after persistent!"); 3901 | }; 3902 | function Fd(a, b) { 3903 | for (var c = ab(ac), d = 0;;) { 3904 | if (d < a) { 3905 | c = Rc.d(c, b[d], b[d + 1]), d += 2; 3906 | } else { 3907 | return c; 3908 | } 3909 | } 3910 | } 3911 | function Id() { 3912 | this.W = !1; 3913 | } 3914 | function Jd(a, b) { 3915 | return a === b ? !0 : a === b || a instanceof U && b instanceof U && a.$ === b.$ ? !0 : Gb.a(a, b); 3916 | } 3917 | var Kd = function() { 3918 | function a(a, b, c, h, k) { 3919 | a = D(a); 3920 | a[b] = c; 3921 | a[h] = k; 3922 | return a; 3923 | } 3924 | function b(a, b, c) { 3925 | a = D(a); 3926 | a[b] = c; 3927 | return a; 3928 | } 3929 | var c = null, c = function(c, e, f, h, k) { 3930 | switch(arguments.length) { 3931 | case 3: 3932 | return b.call(this, c, e, f); 3933 | case 5: 3934 | return a.call(this, c, e, f, h, k); 3935 | } 3936 | throw Error("Invalid arity: " + arguments.length); 3937 | }; 3938 | c.d = b; 3939 | c.u = a; 3940 | return c; 3941 | }(), Ld = function() { 3942 | function a(a, b, c, h, k, l) { 3943 | a = a.Aa(b); 3944 | a.b[c] = h; 3945 | a.b[k] = l; 3946 | return a; 3947 | } 3948 | function b(a, b, c, h) { 3949 | a = a.Aa(b); 3950 | a.b[c] = h; 3951 | return a; 3952 | } 3953 | var c = null, c = function(c, e, f, h, k, l) { 3954 | switch(arguments.length) { 3955 | case 4: 3956 | return b.call(this, c, e, f, h); 3957 | case 6: 3958 | return a.call(this, c, e, f, h, k, l); 3959 | } 3960 | throw Error("Invalid arity: " + arguments.length); 3961 | }; 3962 | c.i = b; 3963 | c.N = a; 3964 | return c; 3965 | }(); 3966 | function Md(a, b, c) { 3967 | this.o = a; 3968 | this.w = b; 3969 | this.b = c; 3970 | } 3971 | g = Md.prototype; 3972 | g.Aa = function(a) { 3973 | if (a === this.o) { 3974 | return this; 3975 | } 3976 | var b = wc(this.w), c = Array(0 > b ? 4 : 2 * (b + 1)); 3977 | mc(this.b, 0, c, 0, 2 * b); 3978 | return new Md(a, this.w, c); 3979 | }; 3980 | g.Ka = function() { 3981 | var a = this.b; 3982 | return Od.e ? Od.e(a) : Od.call(null, a); 3983 | }; 3984 | g.ua = function(a, b, c, d) { 3985 | var e = 1 << (b >>> a & 31); 3986 | if (0 === (this.w & e)) { 3987 | return d; 3988 | } 3989 | var f = wc(this.w & e - 1), e = this.b[2 * f], f = this.b[2 * f + 1]; 3990 | return null == e ? f.ua(a + 5, b, c, d) : Jd(c, e) ? f : d; 3991 | }; 3992 | g.Z = function(a, b, c, d, e, f) { 3993 | var h = 1 << (c >>> b & 31), k = wc(this.w & h - 1); 3994 | if (0 === (this.w & h)) { 3995 | var l = wc(this.w); 3996 | if (2 * l < this.b.length) { 3997 | var m = this.Aa(a), n = m.b; 3998 | f.W = !0; 3999 | nc(n, 2 * k, n, 2 * (k + 1), 2 * (l - k)); 4000 | n[2 * k] = d; 4001 | n[2 * k + 1] = e; 4002 | m.w |= h; 4003 | return m; 4004 | } 4005 | if (16 <= l) { 4006 | h = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; 4007 | h[c >>> b & 31] = Pd.Z(a, b + 5, c, d, e, f); 4008 | for (m = k = 0;;) { 4009 | if (32 > k) { 4010 | 0 !== (this.w >>> k & 1) && (h[k] = null != this.b[m] ? Pd.Z(a, b + 5, Bb(this.b[m]), this.b[m], this.b[m + 1], f) : this.b[m + 1], m += 2), k += 1; 4011 | } else { 4012 | break; 4013 | } 4014 | } 4015 | return new Qd(a, l + 1, h); 4016 | } 4017 | n = Array(2 * (l + 4)); 4018 | mc(this.b, 0, n, 0, 2 * k); 4019 | n[2 * k] = d; 4020 | n[2 * k + 1] = e; 4021 | mc(this.b, 2 * k, n, 2 * (k + 1), 2 * (l - k)); 4022 | f.W = !0; 4023 | m = this.Aa(a); 4024 | m.b = n; 4025 | m.w |= h; 4026 | return m; 4027 | } 4028 | var p = this.b[2 * k], q = this.b[2 * k + 1]; 4029 | if (null == p) { 4030 | return l = q.Z(a, b + 5, c, d, e, f), l === q ? this : Ld.i(this, a, 2 * k + 1, l); 4031 | } 4032 | if (Jd(d, p)) { 4033 | return e === q ? this : Ld.i(this, a, 2 * k + 1, e); 4034 | } 4035 | f.W = !0; 4036 | return Ld.N(this, a, 2 * k, null, 2 * k + 1, function() { 4037 | var f = b + 5; 4038 | return Rd.U ? Rd.U(a, f, p, q, c, d, e) : Rd.call(null, a, f, p, q, c, d, e); 4039 | }()); 4040 | }; 4041 | g.Y = function(a, b, c, d, e) { 4042 | var f = 1 << (b >>> a & 31), h = wc(this.w & f - 1); 4043 | if (0 === (this.w & f)) { 4044 | var k = wc(this.w); 4045 | if (16 <= k) { 4046 | f = [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; 4047 | f[b >>> a & 31] = Pd.Y(a + 5, b, c, d, e); 4048 | for (var l = h = 0;;) { 4049 | if (32 > h) { 4050 | 0 !== (this.w >>> h & 1) && (f[h] = null != this.b[l] ? Pd.Y(a + 5, Bb(this.b[l]), this.b[l], this.b[l + 1], e) : this.b[l + 1], l += 2), h += 1; 4051 | } else { 4052 | break; 4053 | } 4054 | } 4055 | return new Qd(null, k + 1, f); 4056 | } 4057 | l = Array(2 * (k + 1)); 4058 | mc(this.b, 0, l, 0, 2 * h); 4059 | l[2 * h] = c; 4060 | l[2 * h + 1] = d; 4061 | mc(this.b, 2 * h, l, 2 * (h + 1), 2 * (k - h)); 4062 | e.W = !0; 4063 | return new Md(null, this.w | f, l); 4064 | } 4065 | var m = this.b[2 * h], n = this.b[2 * h + 1]; 4066 | if (null == m) { 4067 | return k = n.Y(a + 5, b, c, d, e), k === n ? this : new Md(null, this.w, Kd.d(this.b, 2 * h + 1, k)); 4068 | } 4069 | if (Jd(c, m)) { 4070 | return d === n ? this : new Md(null, this.w, Kd.d(this.b, 2 * h + 1, d)); 4071 | } 4072 | e.W = !0; 4073 | return new Md(null, this.w, Kd.u(this.b, 2 * h, null, 2 * h + 1, function() { 4074 | var e = a + 5; 4075 | return Rd.N ? Rd.N(e, m, n, b, c, d) : Rd.call(null, e, m, n, b, c, d); 4076 | }())); 4077 | }; 4078 | var Pd = new Md(null, 0, []); 4079 | function Qd(a, b, c) { 4080 | this.o = a; 4081 | this.f = b; 4082 | this.b = c; 4083 | } 4084 | g = Qd.prototype; 4085 | g.Aa = function(a) { 4086 | return a === this.o ? this : new Qd(a, this.f, D(this.b)); 4087 | }; 4088 | g.Ka = function() { 4089 | var a = this.b; 4090 | return Sd.e ? Sd.e(a) : Sd.call(null, a); 4091 | }; 4092 | g.ua = function(a, b, c, d) { 4093 | var e = this.b[b >>> a & 31]; 4094 | return null != e ? e.ua(a + 5, b, c, d) : d; 4095 | }; 4096 | g.Z = function(a, b, c, d, e, f) { 4097 | var h = c >>> b & 31, k = this.b[h]; 4098 | if (null == k) { 4099 | return a = Ld.i(this, a, h, Pd.Z(a, b + 5, c, d, e, f)), a.f += 1, a; 4100 | } 4101 | b = k.Z(a, b + 5, c, d, e, f); 4102 | return b === k ? this : Ld.i(this, a, h, b); 4103 | }; 4104 | g.Y = function(a, b, c, d, e) { 4105 | var f = b >>> a & 31, h = this.b[f]; 4106 | if (null == h) { 4107 | return new Qd(null, this.f + 1, Kd.d(this.b, f, Pd.Y(a + 5, b, c, d, e))); 4108 | } 4109 | a = h.Y(a + 5, b, c, d, e); 4110 | return a === h ? this : new Qd(null, this.f, Kd.d(this.b, f, a)); 4111 | }; 4112 | function Td(a, b, c) { 4113 | b *= 2; 4114 | for (var d = 0;;) { 4115 | if (d < b) { 4116 | if (Jd(c, a[d])) { 4117 | return d; 4118 | } 4119 | d += 2; 4120 | } else { 4121 | return-1; 4122 | } 4123 | } 4124 | } 4125 | function Ud(a, b, c, d) { 4126 | this.o = a; 4127 | this.ta = b; 4128 | this.f = c; 4129 | this.b = d; 4130 | } 4131 | g = Ud.prototype; 4132 | g.Aa = function(a) { 4133 | if (a === this.o) { 4134 | return this; 4135 | } 4136 | var b = Array(2 * (this.f + 1)); 4137 | mc(this.b, 0, b, 0, 2 * this.f); 4138 | return new Ud(a, this.ta, this.f, b); 4139 | }; 4140 | g.Ka = function() { 4141 | var a = this.b; 4142 | return Od.e ? Od.e(a) : Od.call(null, a); 4143 | }; 4144 | g.ua = function(a, b, c, d) { 4145 | a = Td(this.b, this.f, c); 4146 | return 0 > a ? d : Jd(c, this.b[a]) ? this.b[a + 1] : d; 4147 | }; 4148 | g.Z = function(a, b, c, d, e, f) { 4149 | if (c === this.ta) { 4150 | b = Td(this.b, this.f, d); 4151 | if (-1 === b) { 4152 | if (this.b.length > 2 * this.f) { 4153 | return a = Ld.N(this, a, 2 * this.f, d, 2 * this.f + 1, e), f.W = !0, a.f += 1, a; 4154 | } 4155 | c = this.b.length; 4156 | b = Array(c + 2); 4157 | mc(this.b, 0, b, 0, c); 4158 | b[c] = d; 4159 | b[c + 1] = e; 4160 | f.W = !0; 4161 | f = this.f + 1; 4162 | a === this.o ? (this.b = b, this.f = f, a = this) : a = new Ud(this.o, this.ta, f, b); 4163 | return a; 4164 | } 4165 | return this.b[b + 1] === e ? this : Ld.i(this, a, b + 1, e); 4166 | } 4167 | return(new Md(a, 1 << (this.ta >>> b & 31), [null, this, null, null])).Z(a, b, c, d, e, f); 4168 | }; 4169 | g.Y = function(a, b, c, d, e) { 4170 | return b === this.ta ? (a = Td(this.b, this.f, c), -1 === a ? (a = 2 * this.f, b = Array(a + 2), mc(this.b, 0, b, 0, a), b[a] = c, b[a + 1] = d, e.W = !0, new Ud(null, this.ta, this.f + 1, b)) : Gb.a(this.b[a], d) ? this : new Ud(null, this.ta, this.f, Kd.d(this.b, a + 1, d))) : (new Md(null, 1 << (this.ta >>> a & 31), [null, this])).Y(a, b, c, d, e); 4171 | }; 4172 | var Rd = function() { 4173 | function a(a, b, c, h, k, l, m) { 4174 | var n = Bb(c); 4175 | if (n === k) { 4176 | return new Ud(null, n, 2, [c, h, l, m]); 4177 | } 4178 | var p = new Id; 4179 | return Pd.Z(a, b, n, c, h, p).Z(a, b, k, l, m, p); 4180 | } 4181 | function b(a, b, c, h, k, l) { 4182 | var m = Bb(b); 4183 | if (m === h) { 4184 | return new Ud(null, m, 2, [b, c, k, l]); 4185 | } 4186 | var n = new Id; 4187 | return Pd.Y(a, m, b, c, n).Y(a, h, k, l, n); 4188 | } 4189 | var c = null, c = function(c, e, f, h, k, l, m) { 4190 | switch(arguments.length) { 4191 | case 6: 4192 | return b.call(this, c, e, f, h, k, l); 4193 | case 7: 4194 | return a.call(this, c, e, f, h, k, l, m); 4195 | } 4196 | throw Error("Invalid arity: " + arguments.length); 4197 | }; 4198 | c.N = b; 4199 | c.U = a; 4200 | return c; 4201 | }(); 4202 | function Vd(a, b, c, d, e) { 4203 | this.l = a; 4204 | this.wa = b; 4205 | this.h = c; 4206 | this.p = d; 4207 | this.j = e; 4208 | this.n = 0; 4209 | this.g = 32374860; 4210 | } 4211 | g = Vd.prototype; 4212 | g.toString = function() { 4213 | return nb(this); 4214 | }; 4215 | g.I = function() { 4216 | return this.l; 4217 | }; 4218 | g.B = function() { 4219 | var a = this.j; 4220 | return null != a ? a : this.j = a = Kb(this); 4221 | }; 4222 | g.A = function(a, b) { 4223 | return Ub(this, b); 4224 | }; 4225 | g.K = function(a, b) { 4226 | return T.a(b, this); 4227 | }; 4228 | g.L = function(a, b, c) { 4229 | return T.d(b, c, this); 4230 | }; 4231 | g.P = function() { 4232 | return null == this.p ? new W(null, 2, 5, od, [this.wa[this.h], this.wa[this.h + 1]], null) : L(this.p); 4233 | }; 4234 | g.S = function() { 4235 | if (null == this.p) { 4236 | var a = this.wa, b = this.h + 2; 4237 | return Od.d ? Od.d(a, b, null) : Od.call(null, a, b, null); 4238 | } 4239 | var a = this.wa, b = this.h, c = N(this.p); 4240 | return Od.d ? Od.d(a, b, c) : Od.call(null, a, b, c); 4241 | }; 4242 | g.G = function() { 4243 | return this; 4244 | }; 4245 | g.J = function(a, b) { 4246 | return new Vd(b, this.wa, this.h, this.p, this.j); 4247 | }; 4248 | g.H = function(a, b) { 4249 | return R(b, this); 4250 | }; 4251 | Vd.prototype[pa] = function() { 4252 | return Ib(this); 4253 | }; 4254 | var Od = function() { 4255 | function a(a, b, c) { 4256 | if (null == c) { 4257 | for (c = a.length;;) { 4258 | if (b < c) { 4259 | if (null != a[b]) { 4260 | return new Vd(null, a, b, null, null); 4261 | } 4262 | var h = a[b + 1]; 4263 | if (x(h) && (h = h.Ka(), x(h))) { 4264 | return new Vd(null, a, b + 2, h, null); 4265 | } 4266 | b += 2; 4267 | } else { 4268 | return null; 4269 | } 4270 | } 4271 | } else { 4272 | return new Vd(null, a, b, c, null); 4273 | } 4274 | } 4275 | function b(a) { 4276 | return c.d(a, 0, null); 4277 | } 4278 | var c = null, c = function(c, e, f) { 4279 | switch(arguments.length) { 4280 | case 1: 4281 | return b.call(this, c); 4282 | case 3: 4283 | return a.call(this, c, e, f); 4284 | } 4285 | throw Error("Invalid arity: " + arguments.length); 4286 | }; 4287 | c.e = b; 4288 | c.d = a; 4289 | return c; 4290 | }(); 4291 | function Wd(a, b, c, d, e) { 4292 | this.l = a; 4293 | this.wa = b; 4294 | this.h = c; 4295 | this.p = d; 4296 | this.j = e; 4297 | this.n = 0; 4298 | this.g = 32374860; 4299 | } 4300 | g = Wd.prototype; 4301 | g.toString = function() { 4302 | return nb(this); 4303 | }; 4304 | g.I = function() { 4305 | return this.l; 4306 | }; 4307 | g.B = function() { 4308 | var a = this.j; 4309 | return null != a ? a : this.j = a = Kb(this); 4310 | }; 4311 | g.A = function(a, b) { 4312 | return Ub(this, b); 4313 | }; 4314 | g.K = function(a, b) { 4315 | return T.a(b, this); 4316 | }; 4317 | g.L = function(a, b, c) { 4318 | return T.d(b, c, this); 4319 | }; 4320 | g.P = function() { 4321 | return L(this.p); 4322 | }; 4323 | g.S = function() { 4324 | var a = this.wa, b = this.h, c = N(this.p); 4325 | return Sd.i ? Sd.i(null, a, b, c) : Sd.call(null, null, a, b, c); 4326 | }; 4327 | g.G = function() { 4328 | return this; 4329 | }; 4330 | g.J = function(a, b) { 4331 | return new Wd(b, this.wa, this.h, this.p, this.j); 4332 | }; 4333 | g.H = function(a, b) { 4334 | return R(b, this); 4335 | }; 4336 | Wd.prototype[pa] = function() { 4337 | return Ib(this); 4338 | }; 4339 | var Sd = function() { 4340 | function a(a, b, c, h) { 4341 | if (null == h) { 4342 | for (h = b.length;;) { 4343 | if (c < h) { 4344 | var k = b[c]; 4345 | if (x(k) && (k = k.Ka(), x(k))) { 4346 | return new Wd(a, b, c + 1, k, null); 4347 | } 4348 | c += 1; 4349 | } else { 4350 | return null; 4351 | } 4352 | } 4353 | } else { 4354 | return new Wd(a, b, c, h, null); 4355 | } 4356 | } 4357 | function b(a) { 4358 | return c.i(null, a, 0, null); 4359 | } 4360 | var c = null, c = function(c, e, f, h) { 4361 | switch(arguments.length) { 4362 | case 1: 4363 | return b.call(this, c); 4364 | case 4: 4365 | return a.call(this, c, e, f, h); 4366 | } 4367 | throw Error("Invalid arity: " + arguments.length); 4368 | }; 4369 | c.e = b; 4370 | c.i = a; 4371 | return c; 4372 | }(); 4373 | function Xd(a, b, c, d, e, f) { 4374 | this.l = a; 4375 | this.f = b; 4376 | this.root = c; 4377 | this.Q = d; 4378 | this.V = e; 4379 | this.j = f; 4380 | this.g = 16123663; 4381 | this.n = 8196; 4382 | } 4383 | g = Xd.prototype; 4384 | g.toString = function() { 4385 | return nb(this); 4386 | }; 4387 | g.t = function(a, b) { 4388 | return H.d(this, b, null); 4389 | }; 4390 | g.s = function(a, b, c) { 4391 | return null == b ? this.Q ? this.V : c : null == this.root ? c : this.root.ua(0, Bb(b), b, c); 4392 | }; 4393 | g.I = function() { 4394 | return this.l; 4395 | }; 4396 | g.D = function() { 4397 | return this.f; 4398 | }; 4399 | g.B = function() { 4400 | var a = this.j; 4401 | return null != a ? a : this.j = a = Lb(this); 4402 | }; 4403 | g.A = function(a, b) { 4404 | return yd(this, b); 4405 | }; 4406 | g.Ga = function() { 4407 | return new Yd({}, this.root, this.f, this.Q, this.V); 4408 | }; 4409 | g.Fa = function(a, b, c) { 4410 | if (null == b) { 4411 | return this.Q && c === this.V ? this : new Xd(this.l, this.Q ? this.f : this.f + 1, this.root, !0, c, null); 4412 | } 4413 | a = new Id; 4414 | b = (null == this.root ? Pd : this.root).Y(0, Bb(b), b, c, a); 4415 | return b === this.root ? this : new Xd(this.l, a.W ? this.f + 1 : this.f, b, this.Q, this.V, null); 4416 | }; 4417 | g.Ra = function(a, b) { 4418 | return null == b ? this.Q : null == this.root ? !1 : this.root.ua(0, Bb(b), b, oc) !== oc; 4419 | }; 4420 | g.G = function() { 4421 | if (0 < this.f) { 4422 | var a = null != this.root ? this.root.Ka() : null; 4423 | return this.Q ? R(new W(null, 2, 5, od, [null, this.V], null), a) : a; 4424 | } 4425 | return null; 4426 | }; 4427 | g.J = function(a, b) { 4428 | return new Xd(b, this.f, this.root, this.Q, this.V, this.j); 4429 | }; 4430 | g.H = function(a, b) { 4431 | if (kc(b)) { 4432 | return Da(this, E.a(b, 0), E.a(b, 1)); 4433 | } 4434 | for (var c = this, d = K(b);;) { 4435 | if (null == d) { 4436 | return c; 4437 | } 4438 | var e = L(d); 4439 | if (kc(e)) { 4440 | c = Da(c, E.a(e, 0), E.a(e, 1)), d = N(d); 4441 | } else { 4442 | throw Error("conj on a map takes map entries or seqables of map entries"); 4443 | } 4444 | } 4445 | }; 4446 | g.call = function() { 4447 | var a = null, a = function(a, c, d) { 4448 | switch(arguments.length) { 4449 | case 2: 4450 | return this.t(null, c); 4451 | case 3: 4452 | return this.s(null, c, d); 4453 | } 4454 | throw Error("Invalid arity: " + arguments.length); 4455 | }; 4456 | a.a = function(a, c) { 4457 | return this.t(null, c); 4458 | }; 4459 | a.d = function(a, c, d) { 4460 | return this.s(null, c, d); 4461 | }; 4462 | return a; 4463 | }(); 4464 | g.apply = function(a, b) { 4465 | return this.call.apply(this, [this].concat(D(b))); 4466 | }; 4467 | g.e = function(a) { 4468 | return this.t(null, a); 4469 | }; 4470 | g.a = function(a, b) { 4471 | return this.s(null, a, b); 4472 | }; 4473 | var ac = new Xd(null, 0, null, !1, null, 0); 4474 | Xd.prototype[pa] = function() { 4475 | return Ib(this); 4476 | }; 4477 | function Yd(a, b, c, d, e) { 4478 | this.o = a; 4479 | this.root = b; 4480 | this.count = c; 4481 | this.Q = d; 4482 | this.V = e; 4483 | this.n = 56; 4484 | this.g = 258; 4485 | } 4486 | g = Yd.prototype; 4487 | g.Ha = function(a, b, c) { 4488 | return Zd(this, b, c); 4489 | }; 4490 | g.Ia = function(a, b) { 4491 | return $d(this, b); 4492 | }; 4493 | g.Ja = function() { 4494 | var a; 4495 | if (this.o) { 4496 | this.o = null, a = new Xd(null, this.count, this.root, this.Q, this.V, null); 4497 | } else { 4498 | throw Error("persistent! called twice"); 4499 | } 4500 | return a; 4501 | }; 4502 | g.t = function(a, b) { 4503 | return null == b ? this.Q ? this.V : null : null == this.root ? null : this.root.ua(0, Bb(b), b); 4504 | }; 4505 | g.s = function(a, b, c) { 4506 | return null == b ? this.Q ? this.V : c : null == this.root ? c : this.root.ua(0, Bb(b), b, c); 4507 | }; 4508 | g.D = function() { 4509 | if (this.o) { 4510 | return this.count; 4511 | } 4512 | throw Error("count after persistent!"); 4513 | }; 4514 | function $d(a, b) { 4515 | if (a.o) { 4516 | if (b ? b.g & 2048 || b.pb || (b.g ? 0 : z(Fa, b)) : z(Fa, b)) { 4517 | return Zd(a, Gd.e ? Gd.e(b) : Gd.call(null, b), Hd.e ? Hd.e(b) : Hd.call(null, b)); 4518 | } 4519 | for (var c = K(b), d = a;;) { 4520 | var e = L(c); 4521 | if (x(e)) { 4522 | var f = e, c = N(c), d = Zd(d, function() { 4523 | var a = f; 4524 | return Gd.e ? Gd.e(a) : Gd.call(null, a); 4525 | }(), function() { 4526 | var a = f; 4527 | return Hd.e ? Hd.e(a) : Hd.call(null, a); 4528 | }()) 4529 | } else { 4530 | return d; 4531 | } 4532 | } 4533 | } else { 4534 | throw Error("conj! after persistent"); 4535 | } 4536 | } 4537 | function Zd(a, b, c) { 4538 | if (a.o) { 4539 | if (null == b) { 4540 | a.V !== c && (a.V = c), a.Q || (a.count += 1, a.Q = !0); 4541 | } else { 4542 | var d = new Id; 4543 | b = (null == a.root ? Pd : a.root).Z(a.o, 0, Bb(b), b, c, d); 4544 | b !== a.root && (a.root = b); 4545 | d.W && (a.count += 1); 4546 | } 4547 | return a; 4548 | } 4549 | throw Error("assoc! after persistent!"); 4550 | } 4551 | function ae(a, b) { 4552 | this.va = a; 4553 | this.ya = b; 4554 | this.n = 0; 4555 | this.g = 32374988; 4556 | } 4557 | g = ae.prototype; 4558 | g.toString = function() { 4559 | return nb(this); 4560 | }; 4561 | g.I = function() { 4562 | return this.ya; 4563 | }; 4564 | g.X = function() { 4565 | var a = this.va, a = (a ? a.g & 128 || a.eb || (a.g ? 0 : z(Aa, a)) : z(Aa, a)) ? this.va.X(null) : N(this.va); 4566 | return null == a ? null : new ae(a, this.ya); 4567 | }; 4568 | g.B = function() { 4569 | return Kb(this); 4570 | }; 4571 | g.A = function(a, b) { 4572 | return Ub(this, b); 4573 | }; 4574 | g.K = function(a, b) { 4575 | return T.a(b, this); 4576 | }; 4577 | g.L = function(a, b, c) { 4578 | return T.d(b, c, this); 4579 | }; 4580 | g.P = function() { 4581 | return this.va.P(null).Xa(); 4582 | }; 4583 | g.S = function() { 4584 | var a = this.va, a = (a ? a.g & 128 || a.eb || (a.g ? 0 : z(Aa, a)) : z(Aa, a)) ? this.va.X(null) : N(this.va); 4585 | return null != a ? new ae(a, this.ya) : Fb; 4586 | }; 4587 | g.G = function() { 4588 | return this; 4589 | }; 4590 | g.J = function(a, b) { 4591 | return new ae(this.va, b); 4592 | }; 4593 | g.H = function(a, b) { 4594 | return R(b, this); 4595 | }; 4596 | ae.prototype[pa] = function() { 4597 | return Ib(this); 4598 | }; 4599 | function Gd(a) { 4600 | return Ga(a); 4601 | } 4602 | function Hd(a) { 4603 | return Ia(a); 4604 | } 4605 | function be(a, b, c) { 4606 | this.l = a; 4607 | this.Ca = b; 4608 | this.j = c; 4609 | this.g = 15077647; 4610 | this.n = 8196; 4611 | } 4612 | g = be.prototype; 4613 | g.toString = function() { 4614 | return nb(this); 4615 | }; 4616 | g.t = function(a, b) { 4617 | return H.d(this, b, null); 4618 | }; 4619 | g.s = function(a, b, c) { 4620 | return Ca(this.Ca, b) ? b : c; 4621 | }; 4622 | g.I = function() { 4623 | return this.l; 4624 | }; 4625 | g.D = function() { 4626 | return ta(this.Ca); 4627 | }; 4628 | g.B = function() { 4629 | var a = this.j; 4630 | return null != a ? a : this.j = a = Lb(this); 4631 | }; 4632 | g.A = function(a, b) { 4633 | return ic(b) && S(this) === S(b) && Tc(function(a) { 4634 | return function(b) { 4635 | return $b.d(a, b, oc) === oc ? !1 : !0; 4636 | }; 4637 | }(this), b); 4638 | }; 4639 | g.Ga = function() { 4640 | return new ce(ab(this.Ca)); 4641 | }; 4642 | g.G = function() { 4643 | var a = K(this.Ca); 4644 | return a ? new ae(a, null) : null; 4645 | }; 4646 | g.J = function(a, b) { 4647 | return new be(b, this.Ca, this.j); 4648 | }; 4649 | g.H = function(a, b) { 4650 | return new be(this.l, cc.d(this.Ca, b, null), null); 4651 | }; 4652 | g.call = function() { 4653 | var a = null, a = function(a, c, d) { 4654 | switch(arguments.length) { 4655 | case 2: 4656 | return this.t(null, c); 4657 | case 3: 4658 | return this.s(null, c, d); 4659 | } 4660 | throw Error("Invalid arity: " + arguments.length); 4661 | }; 4662 | a.a = function(a, c) { 4663 | return this.t(null, c); 4664 | }; 4665 | a.d = function(a, c, d) { 4666 | return this.s(null, c, d); 4667 | }; 4668 | return a; 4669 | }(); 4670 | g.apply = function(a, b) { 4671 | return this.call.apply(this, [this].concat(D(b))); 4672 | }; 4673 | g.e = function(a) { 4674 | return this.t(null, a); 4675 | }; 4676 | g.a = function(a, b) { 4677 | return this.s(null, a, b); 4678 | }; 4679 | be.prototype[pa] = function() { 4680 | return Ib(this); 4681 | }; 4682 | function ce(a) { 4683 | this.ra = a; 4684 | this.g = 259; 4685 | this.n = 136; 4686 | } 4687 | g = ce.prototype; 4688 | g.call = function() { 4689 | function a(a, b, c) { 4690 | return H.d(this.ra, b, oc) === oc ? c : b; 4691 | } 4692 | function b(a, b) { 4693 | return H.d(this.ra, b, oc) === oc ? null : b; 4694 | } 4695 | var c = null, c = function(c, e, f) { 4696 | switch(arguments.length) { 4697 | case 2: 4698 | return b.call(this, c, e); 4699 | case 3: 4700 | return a.call(this, c, e, f); 4701 | } 4702 | throw Error("Invalid arity: " + arguments.length); 4703 | }; 4704 | c.a = b; 4705 | c.d = a; 4706 | return c; 4707 | }(); 4708 | g.apply = function(a, b) { 4709 | return this.call.apply(this, [this].concat(D(b))); 4710 | }; 4711 | g.e = function(a) { 4712 | return H.d(this.ra, a, oc) === oc ? null : a; 4713 | }; 4714 | g.a = function(a, b) { 4715 | return H.d(this.ra, a, oc) === oc ? b : a; 4716 | }; 4717 | g.t = function(a, b) { 4718 | return H.d(this, b, null); 4719 | }; 4720 | g.s = function(a, b, c) { 4721 | return H.d(this.ra, b, oc) === oc ? c : b; 4722 | }; 4723 | g.D = function() { 4724 | return S(this.ra); 4725 | }; 4726 | g.Ia = function(a, b) { 4727 | this.ra = Rc.d(this.ra, b, null); 4728 | return this; 4729 | }; 4730 | g.Ja = function() { 4731 | return new be(null, db(this.ra), null); 4732 | }; 4733 | function de(a) { 4734 | if (a && (a.n & 4096 || a.rb)) { 4735 | return a.name; 4736 | } 4737 | if ("string" === typeof a) { 4738 | return a; 4739 | } 4740 | throw Error([B("Doesn't support name: "), B(a)].join("")); 4741 | } 4742 | function ee(a, b, c, d, e, f, h) { 4743 | var k = ja; 4744 | try { 4745 | ja = null == ja ? null : ja - 1; 4746 | if (null != ja && 0 > ja) { 4747 | return J(a, "#"); 4748 | } 4749 | J(a, c); 4750 | if (K(h)) { 4751 | var l = L(h); 4752 | b.d ? b.d(l, a, f) : b.call(null, l, a, f); 4753 | } 4754 | for (var m = N(h), n = tb.e(f) - 1;;) { 4755 | if (!m || null != n && 0 === n) { 4756 | K(m) && 0 === n && (J(a, d), J(a, "...")); 4757 | break; 4758 | } else { 4759 | J(a, d); 4760 | var p = L(m); 4761 | c = a; 4762 | h = f; 4763 | b.d ? b.d(p, c, h) : b.call(null, p, c, h); 4764 | var q = N(m); 4765 | c = n - 1; 4766 | m = q; 4767 | n = c; 4768 | } 4769 | } 4770 | return J(a, e); 4771 | } finally { 4772 | ja = k; 4773 | } 4774 | } 4775 | var fe = function() { 4776 | function a(a, d) { 4777 | var e = null; 4778 | 1 < arguments.length && (e = O(Array.prototype.slice.call(arguments, 1), 0)); 4779 | return b.call(this, a, e); 4780 | } 4781 | function b(a, b) { 4782 | for (var e = K(b), f = null, h = 0, k = 0;;) { 4783 | if (k < h) { 4784 | var l = f.O(null, k); 4785 | J(a, l); 4786 | k += 1; 4787 | } else { 4788 | if (e = K(e)) { 4789 | (f = e) && (f.n & 512 || f.jb) ? (e = hb(f), h = ib(f), f = e, l = S(e), e = h, h = l) : (l = L(f), J(a, l), e = N(f), f = null, h = 0), k = 0; 4790 | } else { 4791 | return null; 4792 | } 4793 | } 4794 | } 4795 | } 4796 | a.r = 1; 4797 | a.m = function(a) { 4798 | var d = L(a); 4799 | a = M(a); 4800 | return b(d, a); 4801 | }; 4802 | a.k = b; 4803 | return a; 4804 | }(), ge = {'"':'\\"', "\\":"\\\\", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t"}; 4805 | function he(a) { 4806 | return[B('"'), B(a.replace(RegExp('[\\\\"\b\f\n\r\t]', "g"), function(a) { 4807 | return ge[a]; 4808 | })), B('"')].join(""); 4809 | } 4810 | var ke = function ie(b, c, d) { 4811 | if (null == b) { 4812 | return J(c, "nil"); 4813 | } 4814 | if (void 0 === b) { 4815 | return J(c, "#\x3cundefined\x3e"); 4816 | } 4817 | x(function() { 4818 | var c = $b.a(d, rb); 4819 | return x(c) ? (c = b ? b.g & 131072 || b.qb ? !0 : b.g ? !1 : z(Oa, b) : z(Oa, b)) ? hc(b) : c : c; 4820 | }()) && (J(c, "^"), ie(hc(b), c, d), J(c, " ")); 4821 | if (null == b) { 4822 | return J(c, "nil"); 4823 | } 4824 | if (b.vb) { 4825 | return b.Db(b, c, d); 4826 | } 4827 | if (b && (b.g & 2147483648 || b.F)) { 4828 | return b.v(null, c, d); 4829 | } 4830 | if (na(b) === Boolean || "number" === typeof b) { 4831 | return J(c, "" + B(b)); 4832 | } 4833 | if (null != b && b.constructor === Object) { 4834 | J(c, "#js "); 4835 | var e = Vc.a(function(c) { 4836 | return new W(null, 2, 5, od, [Bc.e(c), b[c]], null); 4837 | }, lc(b)); 4838 | return je.i ? je.i(e, ie, c, d) : je.call(null, e, ie, c, d); 4839 | } 4840 | return b instanceof Array ? ee(c, ie, "#js [", " ", "]", d, b) : x("string" == typeof b) ? x(qb.e(d)) ? J(c, he(b)) : J(c, b) : dc(b) ? fe.k(c, O(["#\x3c", "" + B(b), "\x3e"], 0)) : b instanceof Date ? (e = function(b, c) { 4841 | for (var d = "" + B(b);;) { 4842 | if (S(d) < c) { 4843 | d = [B("0"), B(d)].join(""); 4844 | } else { 4845 | return d; 4846 | } 4847 | } 4848 | }, fe.k(c, O(['#inst "', "" + B(b.getUTCFullYear()), "-", e(b.getUTCMonth() + 1, 2), "-", e(b.getUTCDate(), 2), "T", e(b.getUTCHours(), 2), ":", e(b.getUTCMinutes(), 2), ":", e(b.getUTCSeconds(), 2), ".", e(b.getUTCMilliseconds(), 3), "-", '00:00"'], 0))) : b instanceof RegExp ? fe.k(c, O(['#"', b.source, '"'], 0)) : (b ? b.g & 2147483648 || b.F || (b.g ? 0 : z(Za, b)) : z(Za, b)) ? $a(b, c, d) : fe.k(c, O(["#\x3c", "" + B(b), "\x3e"], 0)); 4849 | }; 4850 | function je(a, b, c, d) { 4851 | return ee(c, function(a, c, d) { 4852 | var k = Ga(a); 4853 | b.d ? b.d(k, c, d) : b.call(null, k, c, d); 4854 | J(c, " "); 4855 | a = Ia(a); 4856 | return b.d ? b.d(a, c, d) : b.call(null, a, c, d); 4857 | }, "{", ", ", "}", d, K(a)); 4858 | } 4859 | Uc.prototype.F = !0; 4860 | Uc.prototype.v = function(a, b, c) { 4861 | J(b, "#\x3cVolatile: "); 4862 | ke(this.state, b, c); 4863 | return J(b, "\x3e"); 4864 | }; 4865 | Eb.prototype.F = !0; 4866 | Eb.prototype.v = function(a, b, c) { 4867 | return ee(b, ke, "(", " ", ")", c, this); 4868 | }; 4869 | Dc.prototype.F = !0; 4870 | Dc.prototype.v = function(a, b, c) { 4871 | return ee(b, ke, "(", " ", ")", c, this); 4872 | }; 4873 | Vd.prototype.F = !0; 4874 | Vd.prototype.v = function(a, b, c) { 4875 | return ee(b, ke, "(", " ", ")", c, this); 4876 | }; 4877 | Ad.prototype.F = !0; 4878 | Ad.prototype.v = function(a, b, c) { 4879 | return ee(b, ke, "(", " ", ")", c, this); 4880 | }; 4881 | pd.prototype.F = !0; 4882 | pd.prototype.v = function(a, b, c) { 4883 | return ee(b, ke, "(", " ", ")", c, this); 4884 | }; 4885 | zc.prototype.F = !0; 4886 | zc.prototype.v = function(a, b, c) { 4887 | return ee(b, ke, "(", " ", ")", c, this); 4888 | }; 4889 | Xd.prototype.F = !0; 4890 | Xd.prototype.v = function(a, b, c) { 4891 | return je(this, ke, b, c); 4892 | }; 4893 | Wd.prototype.F = !0; 4894 | Wd.prototype.v = function(a, b, c) { 4895 | return ee(b, ke, "(", " ", ")", c, this); 4896 | }; 4897 | rd.prototype.F = !0; 4898 | rd.prototype.v = function(a, b, c) { 4899 | return ee(b, ke, "[", " ", "]", c, this); 4900 | }; 4901 | be.prototype.F = !0; 4902 | be.prototype.v = function(a, b, c) { 4903 | return ee(b, ke, "#{", " ", "}", c, this); 4904 | }; 4905 | Ic.prototype.F = !0; 4906 | Ic.prototype.v = function(a, b, c) { 4907 | return ee(b, ke, "(", " ", ")", c, this); 4908 | }; 4909 | W.prototype.F = !0; 4910 | W.prototype.v = function(a, b, c) { 4911 | return ee(b, ke, "[", " ", "]", c, this); 4912 | }; 4913 | yc.prototype.F = !0; 4914 | yc.prototype.v = function(a, b) { 4915 | return J(b, "()"); 4916 | }; 4917 | ob.prototype.F = !0; 4918 | ob.prototype.v = function(a, b, c) { 4919 | return je(this, ke, b, c); 4920 | }; 4921 | ae.prototype.F = !0; 4922 | ae.prototype.v = function(a, b, c) { 4923 | return ee(b, ke, "(", " ", ")", c, this); 4924 | }; 4925 | xc.prototype.F = !0; 4926 | xc.prototype.v = function(a, b, c) { 4927 | return ee(b, ke, "(", " ", ")", c, this); 4928 | }; 4929 | W.prototype.Va = !0; 4930 | W.prototype.Wa = function(a, b) { 4931 | return rc.a(this, b); 4932 | }; 4933 | rd.prototype.Va = !0; 4934 | rd.prototype.Wa = function(a, b) { 4935 | return rc.a(this, b); 4936 | }; 4937 | U.prototype.Va = !0; 4938 | U.prototype.Wa = function(a, b) { 4939 | return Ac(this, b); 4940 | }; 4941 | var rb = new U(null, "meta", "meta", 1499536964), sb = new U(null, "dup", "dup", 556298533), pb = new U(null, "flush-on-newline", "flush-on-newline", -151457939), qb = new U(null, "readably", "readably", 1129599760), tb = new U(null, "print-length", "print-length", 1931866356); 4942 | a: { 4943 | for (var le = new be(null, new ob(null, 6, [new U(null, "bottle", "bottle", 296817956), null, new U(null, "flag", "flag", 1088647881), null, new U(null, "sword", "sword", -1447473555), null, new U(null, "hat", "hat", 41545646), null, new U(null, "keys", "keys", 1068423698), null, new U(null, "pistol", "pistol", 600340060), null], null), null), me = Xc.e(0), ne = ab(Ed), oe = K(le), pe = K(me);;) { 4944 | if (oe && pe) { 4945 | var qe = Rc.d(ne, L(oe), L(pe)), re = N(oe), se = N(pe), ne = qe, oe = re, pe = se 4946 | } else { 4947 | db(ne); 4948 | break a; 4949 | } 4950 | } 4951 | } 4952 | ; 4953 | })(); 4954 | -------------------------------------------------------------------------------- /src/clj/pirates/pirates3d.clj: -------------------------------------------------------------------------------- 1 | (ns pirates.pirates3d "A 3D version of Cartagena. Note that I just started this and nothing works yet. For now, look at 2 | the swingui version." 3 | (:require [pirates.swingui :as ps]) 4 | #_(:import (com.jme3.app SimpleApplication) 5 | (com.jme3.scene Geometry Node) 6 | (com.jme3.scene.shape Box) 7 | (com.jme3.material Material) 8 | (com.jme3.math ColorRGBA Vector3f) 9 | (com.jme3.asset AssetManager) 10 | (com.jme3.light DirectionalLight))) 11 | 12 | #_(defn create-grid [^AssetManager am] 13 | (let [mat (doto (Material. am "Common/MatDefs/Light/Lighting.j3md") 14 | (.setBoolean "UseMaterialColors" true) 15 | (.setColor "Diffuse" ColorRGBA/Red) 16 | (.setColor "Specular" ColorRGBA/Red) 17 | (.setFloat "Shininess" (float 64.0))) 18 | box (Box. 0.5 0.5 0.1)] 19 | (for [[x y] ps/grid] 20 | (doto (Geometry. (str x "-" y) (.clone box)) 21 | (doto (.setMaterial mat)) 22 | (.setLocalTranslation x y 0))))) 23 | 24 | ;(.start 25 | ; (let [state (atom {})] 26 | ; (proxy [SimpleApplication] [] 27 | ; (simpleInitApp [] 28 | ; (let [am (.getAssetManager this) 29 | ; path (create-grid am)] 30 | ; (doto (.getRootNode this) 31 | ; ((fn [root] (doseq [p path] (.attachChild ^Node root p)))) 32 | ; (.addLight (doto (DirectionalLight.) 33 | ; (.setDirection (.normalizeLocal (Vector3f. 1 0 -2))) 34 | ; (.setColor ColorRGBA/White)))))) 35 | ; (simpleUpdate [^double tpf] 36 | ; (let [{:keys [geometry]} @state]))))) 37 | -------------------------------------------------------------------------------- /src/clj/pirates/swingui.clj: -------------------------------------------------------------------------------- 1 | (ns pirates.swingui 2 | (:gen-class) 3 | (:require [pirates.rules :as rules] 4 | [clojure.java.io :as io] 5 | [clojure.pprint :as pp]) 6 | (:import (java.awt Color BorderLayout Component Graphics2D Shape) 7 | (javax.imageio ImageIO) 8 | (javax.swing JFrame JPopupMenu JMenuItem JOptionPane JLabel SwingUtilities) 9 | (java.awt.geom Rectangle2D$Double Ellipse2D$Double RectangularShape) 10 | (java.awt.event MouseAdapter ActionListener MouseEvent))) 11 | 12 | (defn load-image [s] (-> s io/resource io/input-stream ImageIO/read)) 13 | 14 | (def images 15 | { :start (load-image "pirates/hands6.png") 16 | :boat (load-image "pirates/sail1.png") 17 | :keys (load-image "pirates/old45.png") 18 | :bottle (load-image "pirates/wine47.png") 19 | :flag (load-image "pirates/halloween16.png") 20 | :hat (load-image "pirates/fedora.png") 21 | :pistol (load-image "pirates/old3.png") 22 | :sword (load-image "pirates/sword1.png")}) 23 | 24 | (def color-map 25 | { :red Color/RED :green Color/GREEN :blue Color/BLUE :yellow Color/YELLOW :brown (Color. 139 69 19) }) 26 | 27 | (def grid [[0 0] [1 0] [2 0] [3 0] [4 0] [5 0] [6 0] [7 0] 28 | [7 1] 29 | [7 2] 30 | [7 3] [6 3] [5 3] [4 3] [3 3] [2 3] [1 3] [0 3] 31 | [0 4] 32 | [0 5] 33 | [0 6] [1 6] [2 6] [3 6] [4 6] [5 6] [6 6] [7 6] 34 | [7 7] 35 | [7 8] 36 | [7 9] [6 9] [5 9] [4 9] [3 9] [2 9] [1 9] [0 9]]) 37 | 38 | (defn create-square [coord dim] 39 | (Rectangle2D$Double. (* dim (first coord)) (* dim (second coord)) dim dim)) 40 | 41 | (def track-shapes (mapv #(create-square % 50) grid)) 42 | 43 | (def hand-shapes 44 | (zipmap 45 | (map #(create-square [9 %] 50) (range (count rules/card-types))) 46 | rules/card-types)) 47 | 48 | (defn draw-image [g image shape] 49 | (.drawImage g image (.getMinX shape) (.getMinY shape) (.getMaxX shape) (.getMaxY shape) 50 | 0 0 (.getWidth image) (.getHeight image) nil)) 51 | 52 | (defn draw-squares [^Graphics2D g board] 53 | (doseq [i (range (count board))] 54 | (let [image ((get-in board [i :symbol]) images) 55 | ^RectangularShape shape (get track-shapes i)] 56 | (doto g 57 | (.draw shape) 58 | (draw-image image shape))))) 59 | 60 | (defn centered-circle [cx cy r](Ellipse2D$Double. (- cx r) (- cy r) (* r 2) (* r 2))) 61 | 62 | (defn draw-cards [^Graphics2D g player] 63 | (let [color (color-map (key player)) 64 | hand (:cards (val player))] 65 | (doseq [hand-shape hand-shapes] 66 | (let [shape (key hand-shape) 67 | card-type (val hand-shape) 68 | image (card-type images) 69 | dx1 (.getMinX shape) 70 | dy1 (.getMinY shape)] 71 | (doto g 72 | (.setPaint color) 73 | (.draw shape) 74 | (draw-image image shape) 75 | (.setPaint Color/BLACK) 76 | (.drawString (str (card-type hand)) (float (+ dx1 (.getWidth shape))) (float (+ dy1 (.getHeight shape))))))))) 77 | 78 | (defmulti draw-piece (fn [_ pieces _] (count (rules/space-contents pieces)))) 79 | 80 | (defmethod draw-piece 0 [_ _ _]) 81 | 82 | (defmethod draw-piece 1 [^Graphics2D g pieces boundary] 83 | (let [piece (first (rules/space-contents pieces)) 84 | color (piece color-map) 85 | cx (.getCenterX boundary) 86 | cy (.getCenterY boundary) 87 | r (* (.getWidth boundary) 0.25) 88 | shape (centered-circle cx cy r)] 89 | (.setColor g color) 90 | (.fill g shape))) 91 | 92 | (defmethod draw-piece 2 [^Graphics2D g pieces boundary] 93 | (let [piece1 (first (rules/space-contents pieces)) 94 | color1 (piece1 color-map) 95 | piece2 (second (rules/space-contents pieces)) 96 | color2 (piece2 color-map) 97 | cx (.getCenterX boundary) 98 | cy (.getCenterY boundary) 99 | r (/ (.getWidth boundary) 3.0)] 100 | (.setColor g color1) 101 | (.fill g (Ellipse2D$Double. (- cx (* r 0.5)) (+ (- cy (* r 0.5)) (/ r 2.0)) r r)) 102 | (.setColor g color2) 103 | (.fill g (Ellipse2D$Double. (- cx (* r 0.5)) (- (- cy (* r 0.5)) (/ r 2.0)) r r)))) 104 | 105 | (defmethod draw-piece :default [^Graphics2D g pieces boundary] 106 | (let [p (rules/space-contents pieces) 107 | n (count p) 108 | cx (.getCenterX boundary) 109 | cy (.getCenterY boundary) 110 | r (* 3.0 (Math/sqrt (.getWidth boundary))) 111 | theta (/ Math/PI (inc n) 0.5) 112 | cl (* 2.0 r (Math/sin (* theta 0.5)))] 113 | (doseq [i (range n)] 114 | (let [piece (p i) 115 | color (piece color-map) 116 | y (* r (Math/sin (* i theta))) 117 | x (* r (Math/cos (* i theta))) 118 | shape (Ellipse2D$Double. (- cx x (* cl 0.5)) (- cy y (* cl 0.5)) cl cl)] 119 | (.setColor g color) 120 | (.fill g shape))))) 121 | 122 | (defn draw-pieces 123 | ([^Graphics2D g pieces boundary] (draw-piece g pieces boundary)) 124 | ([^Graphics2D g pieces] 125 | (doseq [i (range (count pieces))] 126 | (let [local-pieces (get-in pieces [i :pieces]) 127 | shape (get track-shapes i)] 128 | (draw-pieces g local-pieces shape))))) 129 | 130 | (defn get-click-index [x y] 131 | (first (filter #(.contains ^Shape (get track-shapes %) x y) (range (count track-shapes))))) 132 | 133 | (defn create-action [parent action] 134 | (proxy [ActionListener] [] 135 | (actionPerformed [_] 136 | (action) 137 | (.repaint parent)))) 138 | 139 | (defn popup [parent ^MouseEvent event cards game-state square-index] 140 | (let [playable-cards (filter #(> (val %) 0) cards) 141 | f (fn [menu] 142 | (doseq [c (zipmap playable-cards (map #(JMenuItem. (str "Play " %)) playable-cards))] 143 | (.addActionListener (val c) (create-action parent #(swap! game-state rules/play-card (first (key c)) square-index))) 144 | (.add menu (val c))))] 145 | (if (.isPopupTrigger event) 146 | (.show (doto (JPopupMenu.) 147 | f 148 | (.add (doto (JMenuItem. "Fall Back") (.addActionListener (create-action parent #(swap! game-state rules/fall-back square-index))))) 149 | (.add (doto (JMenuItem. "Pass") (.addActionListener (create-action parent #(swap! game-state rules/pass)))))) 150 | (.getComponent event) (.x (.getPoint event)) (.y (.getPoint event)))))) 151 | 152 | (defn clicker [parent game-state] 153 | (let [click-handler #(when-let [clicked (get-click-index (-> % .getPoint .x) (-> % .getPoint .y))] 154 | (let [color (key (rules/active-player @game-state))] 155 | (popup parent % (get-in @game-state [:players color :cards]) game-state clicked)))] 156 | (proxy [MouseAdapter] [] 157 | (mousePressed [event] (click-handler event)) 158 | (mouseReleased [event] (click-handler event))))) 159 | 160 | (defn c [game-state] 161 | (let [component (proxy [Component] [] 162 | (paint [g] 163 | (doto g 164 | (draw-squares (:board @game-state)) 165 | (draw-pieces (:board @game-state)) 166 | (draw-cards (rules/active-player @game-state)))))] 167 | (.addMouseListener component (clicker component game-state)) 168 | component)) 169 | 170 | (defn setup-winner-watch [state] 171 | (add-watch 172 | state :watch-for-winner 173 | (fn [_ _ _ n] 174 | (if (rules/winner? n) 175 | (SwingUtilities/invokeLater 176 | (JOptionPane/showMessageDialog 177 | nil (str (key (rules/active-player n)) " is the winner!"))))))) 178 | 179 | ;(defn almost-win [state] 180 | ; (-> state 181 | ; (assoc-in [:board 0 :pieces :yellow] 0) 182 | ; (assoc-in [:board 36 :pieces :yellow] 1) 183 | ; (assoc-in [:board 37 :pieces :yellow] 5) 184 | ; (doto pp/pprint))) 185 | 186 | (defn frame [initial-game-state exit-condition] 187 | (let [frame (JFrame. "Pirates!") 188 | first-player (first (keys (:turn-order initial-game-state))) 189 | started (rules/start-turn initial-game-state first-player) 190 | ;game-state (atom (almost-win started)) 191 | game-state (atom started) 192 | ] 193 | (setup-winner-watch game-state) 194 | (doto frame 195 | (.setSize 600 600) 196 | (.add ^Component (c game-state) BorderLayout/CENTER) 197 | (.add (JLabel. "Right-click on square with piece to make a move.") BorderLayout/SOUTH) 198 | (.setDefaultCloseOperation exit-condition) 199 | (.setVisible true) 200 | (.repaint)) 201 | frame)) 202 | 203 | ;Uncomment and load this in the REPL if you don't want to run via lein run. 204 | (frame 205 | (rules/init-game-state 206 | #{{ :name "Mark" :color :green } 207 | { :name "Bob" :color :yellow } 208 | { :name "Gene" :color :blue }}) 209 | JFrame/DISPOSE_ON_CLOSE) 210 | 211 | (defn -main [] 212 | (let [n (JOptionPane/showInputDialog nil "Enter players (2-5):") 213 | colors (take (read-string n) rules/pirate-colors) 214 | players (map #(partial {:color % :name (str % )}) colors)] 215 | (frame 216 | (rules/init-game-state players) 217 | JFrame/EXIT_ON_CLOSE))) 218 | -------------------------------------------------------------------------------- /src/cljc/pirates/rules.cljc: -------------------------------------------------------------------------------- 1 | (ns pirates.rules) 2 | 3 | ;The potential cards you can get. 4 | (def card-types #{:hat :flag :pistol :sword :bottle :keys}) 5 | 6 | ;Pawn types - id'd by color. 7 | (def pirate-colors #{:red :green :blue :yellow :brown}) 8 | 9 | (defn draw 10 | "Draw n cards. Note that rather than having a deck we assume an 11 | infinite number of uniformly distributed cards." 12 | [n] (repeatedly n #(rand-nth (vec card-types)))) 13 | 14 | (defn gen-board-sequence [] 15 | (flatten [:start (repeatedly 6 #(shuffle card-types)) :boat])) 16 | 17 | (defn add-initial-pieces [board colors] 18 | (assoc-in board [0 :pieces] (zipmap colors (repeat 6)))) 19 | 20 | (defn make-board [used-colors] 21 | (let [empty-color-map { :pieces (zipmap used-colors (repeat 0)) }] 22 | (mapv #(assoc empty-color-map :symbol %) (gen-board-sequence)))) 23 | 24 | (defn setup-board [colors] 25 | (add-initial-pieces (make-board colors) colors)) 26 | 27 | (defn cards->hand 28 | ([hand card](update-in hand [card] inc)) 29 | ([hand card & more](reduce #(cards->hand %1 %2) 30 | (cards->hand hand card) more))) 31 | 32 | (def empty-hand (zipmap card-types (repeat 0))) 33 | 34 | (defn initial-hand [] (apply cards->hand empty-hand (draw 6))) 35 | 36 | (defn init-players [players] 37 | (zipmap 38 | (map :color players) 39 | (map (fn [p]{ :name (:name p) :cards (initial-hand) :actions 0 }) 40 | players))) 41 | 42 | (defn active-player [{p :players}] 43 | (first (filter #(pos? (:actions (val %))) p))) 44 | 45 | (defn active-player-color [game-state](key (active-player game-state))) 46 | 47 | (defn create-turn-sequence [player-colors] (zipmap player-colors (rest (cycle player-colors)))) 48 | 49 | (defn init-game-state [player-prefs] 50 | { :turn-order (create-turn-sequence (map :color player-prefs)) 51 | :players (init-players player-prefs) 52 | :board (setup-board (map :color player-prefs)) }) 53 | 54 | (defn winner? [{ :keys [board] :as game-state }] 55 | (let [color (active-player-color game-state)] 56 | (-> board last :pieces color (= 6)))) 57 | 58 | (defn piece-count[piece-slot] 59 | (reduce + (vals piece-slot))) 60 | 61 | (defn fallback-space-available? [board index] 62 | (and (< index (count board)) 63 | (< 0 (or (piece-count (:pieces (board index))) 0) 3))) 64 | 65 | (defn space-occupied? [game-state index] 66 | (-> game-state (get-in [:board index :pieces]) piece-count pos?)) 67 | 68 | (defn symbol-indices 69 | ([symbol board start] (filter #(= symbol (get board %)) (range start (count board)))) 70 | ([symbol board] (symbol-indices symbol board 0))) 71 | 72 | (defn next-open [{ :keys [board] :as game-state } start-index symbol] 73 | (let [r (range start-index (count board))] 74 | (or 75 | (first (filter #(and (not (space-occupied? game-state %)) 76 | (= symbol (get-in board [% :symbol]))) r)) 77 | (dec (count board))))) 78 | 79 | (defn next-fallback [start-index {:keys [board]}] 80 | (first (filter #(fallback-space-available? board %) 81 | (range (dec start-index) 0 -1)))) 82 | 83 | (defn player-has-card? [game-state card color] 84 | (pos? (get-in game-state [:players color :cards card]))) 85 | 86 | (defn square-has-color? [game-state color index] 87 | (pos? (get-in game-state [:board index :pieces color]))) 88 | 89 | (defn start-turn [game-state color] 90 | (assoc-in game-state [:players color :actions] 3)) 91 | 92 | (defn pass [game-state] 93 | (let [color (active-player-color game-state)] 94 | (start-turn 95 | (assoc-in game-state [:players color :actions] 0) 96 | (get-in game-state [:turn-order color])))) 97 | 98 | (defn space-contents 99 | "Convert the pieces on the given space to a vector of pieces" 100 | ([space] (vec (reduce concat (map #(repeat (val %) (key %)) space)))) 101 | ([game-state index] 102 | (space-contents (get-in game-state [:board index :pieces])))) 103 | 104 | (defn hand-contents 105 | "Convert the player's cards (map of cards to count) to a vector of cards." 106 | ([hand] (vec (reduce concat (map #(repeat (val %) (key %)) hand)))) 107 | ([game-state color] 108 | (hand-contents (get-in game-state [:players color :cards])))) 109 | 110 | (defn move [game-state color from-index to-index] 111 | (-> game-state 112 | (update-in [:board from-index :pieces color] dec) 113 | (update-in [:board to-index :pieces color] inc))) 114 | 115 | (defn use-action [game-state color] 116 | (-> game-state 117 | (update-in [:players color :actions] dec) 118 | (#(if (zero? (get-in % [:players color :actions])) 119 | (start-turn % (get-in % [:turn-order color])) %)))) 120 | 121 | (defn execute-play-card [game-state card-symbol pirate-color from-index] 122 | (let [to-index (next-open game-state (inc from-index) card-symbol)] 123 | (-> game-state 124 | (move pirate-color from-index to-index) 125 | (update-in [:players pirate-color :cards card-symbol] dec)))) 126 | 127 | #_(defn play-card [game-state card from-index] 128 | (let [color (active-player-color game-state)] 129 | (if (and (player-has-card? game-state card color) 130 | (square-has-color? game-state color from-index)) 131 | (use-action (execute-play-card game-state card color from-index) color) 132 | game-state))) 133 | 134 | (defn execute-fall-back [game-state from-index to-index pirate] 135 | (let [num-cards (piece-count (get-in game-state [:board to-index :pieces]))] 136 | (-> game-state 137 | (move pirate from-index to-index) 138 | (update-in [:players pirate :cards] #(apply cards->hand % (draw num-cards)))))) 139 | 140 | (defn fall-back [game-state start-index] 141 | (let [color (active-player-color game-state) 142 | to-index (next-fallback start-index game-state)] 143 | (if (and to-index (square-has-color? game-state color start-index)) 144 | (use-action (execute-fall-back game-state start-index to-index color) color) 145 | game-state))) 146 | 147 | (defmacro defaction [action-sym args w pred d action] 148 | `(defn ~action-sym ~args 149 | (let [game-state# ~(first args) 150 | color# (active-player-color game-state#)] 151 | (if (~pred color#) 152 | (use-action (~action color#) color#) 153 | game-state#)))) 154 | 155 | (macroexpand '(defaction play-card-action [game-state card from-index] 156 | :when #(and (player-has-card? game-state card %) 157 | (square-has-color? game-state % from-index)) 158 | :do #(execute-play-card game-state card % from-index))) 159 | 160 | (defaction play-card [game-state card from-index] 161 | :when #(and (player-has-card? game-state card %) 162 | (square-has-color? game-state % from-index)) 163 | :do #(execute-play-card game-state card % from-index)) 164 | 165 | #_(defaction fall-back [game-state start-index] 166 | :when #(and to-index (square-has-color? game-state % start-index)) 167 | :do #(execute-fall-back game-state start-index to-index %)) 168 | --------------------------------------------------------------------------------