A full featured blog in RiotJS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
269 KiB

(function(){"use strict";var __TAGS_CACHE=[];var __TAG_IMPL={};var GLOBAL_MIXIN="__global_mixin";var ATTRS_PREFIX="riot-";var REF_DIRECTIVES=["ref","data-ref"];var IS_DIRECTIVE="data-is";var CONDITIONAL_DIRECTIVE="if";var LOOP_DIRECTIVE="each";var LOOP_NO_REORDER_DIRECTIVE="no-reorder";var SHOW_DIRECTIVE="show";var HIDE_DIRECTIVE="hide";var RIOT_EVENTS_KEY="__riot-events__";var T_STRING="string";var T_OBJECT="object";var T_UNDEF="undefined";var T_FUNCTION="function";var XLINK_NS="http://www.w3.org/1999/xlink";var SVG_NS="http://www.w3.org/2000/svg";var XLINK_REGEX=/^xlink:(\w+)/;var WIN=typeof window===T_UNDEF?undefined:window;var RE_SPECIAL_TAGS=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/;var RE_SPECIAL_TAGS_NO_OPTION=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/;var RE_EVENTS_PREFIX=/^on/;var RE_RESERVED_NAMES=/^(?:_(?:item|id|parent)|update|root|(?:un)?mount|mixin|is(?:Mounted|Loop)|tags|refs|parent|opts|trigger|o(?:n|ff|ne))$/;var RE_HTML_ATTRS=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g;var CASE_SENSITIVE_ATTRIBUTES={viewbox:"viewBox"};var RE_BOOL_ATTRS=/^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$/;var IE_VERSION=(WIN&&WIN.document||{}).documentMode|0;function isBoolAttr(value){return RE_BOOL_ATTRS.test(value)}function isFunction(value){return typeof value===T_FUNCTION}function isObject(value){return value&&typeof value===T_OBJECT}function isUndefined(value){return typeof value===T_UNDEF}function isString(value){return typeof value===T_STRING}function isBlank(value){return isUndefined(value)||value===null||value===""}function isArray(value){return Array.isArray(value)||value instanceof Array}function isWritable(obj,key){var descriptor=Object.getOwnPropertyDescriptor(obj,key);return isUndefined(obj[key])||descriptor&&descriptor.writable}function isReservedName(value){return RE_RESERVED_NAMES.test(value)}var check=Object.freeze({isBoolAttr:isBoolAttr,isFunction:isFunction,isObject:isObject,isUndefined:isUndefined,isString:isString,isBlank:isBlank,isArray:isArray,isWritable:isWritable,isReservedName:isReservedName});function $$(selector,ctx){return Array.prototype.slice.call((ctx||document).querySelectorAll(selector))}function $(selector,ctx){return(ctx||document).querySelector(selector)}function createFrag(){return document.createDocumentFragment()}function createDOMPlaceholder(){return document.createTextNode("")}function isSvg(el){return!!el.ownerSVGElement}function mkEl(name){return name==="svg"?document.createElementNS(SVG_NS,name):document.createElement(name)}function setInnerHTML(container,html){if(!isUndefined(container.innerHTML)){container.innerHTML=html}else{var doc=(new DOMParser).parseFromString(html,"application/xml");var node=container.ownerDocument.importNode(doc.documentElement,true);container.appendChild(node)}}function toggleVisibility(dom,show){dom.style.display=show?"":"none";dom["hidden"]=show?false:true}function remAttr(dom,name){dom.removeAttribute(name)}function styleObjectToString(style){return Object.keys(style).reduce(function(acc,prop){return acc+" "+prop+": "+style[prop]+";"},"")}function getAttr(dom,name){return dom.getAttribute(name)}function setAttr(dom,name,val){var xlink=XLINK_REGEX.exec(name);if(xlink&&xlink[1]){dom.setAttributeNS(XLINK_NS,xlink[1],val)}else{dom.setAttribute(name,val)}}function safeInsert(root,curr,next){root.insertBefore(curr,next.parentNode&&next)}function walkAttrs(html,fn){if(!html){return}var m;while(m=RE_HTML_ATTRS.exec(html)){fn(m[1].toLowerCase(),m[2]||m[3]||m[4])}}function walkNodes(dom,fn,context){if(dom){var res=fn(dom,context);var next;if(res===false){return}dom=dom.firstChild;while(dom){next=dom.nextSibling;walkNodes(dom,fn,res);dom=next}}}var dom=Object.freeze({$$:$$,$:$,createFrag:createFrag,createDOMPlaceholder:createDOMPlaceholder,isSvg:isSvg,mkEl:mkEl,setInnerHTML:setInnerHTML,toggleVisibility:toggleVisibility,remAttr:remAttr,styleObjectToString:styleObjectToString,getAttr:getAttr,setAttr:setAttr,safeInsert:safeInsert,walkAttrs:walkAttrs,walkNodes:walkNodes});var styleNode;var cssTextProp;var byName={};var remainder=[];var needsInject=false;if(WIN){styleNode=function(){var newNode=mkEl("style");setAttr(newNode,"type","text/css");var userNode=$("style[type=riot]");if(userNode){if(userNode.id){newNode.id=userNode.id}userNode.parentNode.replaceChild(newNode,userNode)}else{document.getElementsByTagName("head")[0].appendChild(newNode)}return newNode}();cssTextProp=styleNode.styleSheet}var styleManager={styleNode:styleNode,add:function add(css,name){if(name){byName[name]=css}else{remainder.push(css)}needsInject=true},inject:function inject(){if(!WIN||!needsInject){return}needsInject=false;var style=Object.keys(byName).map(function(k){return byName[k]}).concat(remainder).join("\n");if(cssTextProp){cssTextProp.cssText=style}else{styleNode.innerHTML=style}}};var skipRegex=function(){var beforeReChars="[{(,;:?=|&!^~>%*/";var beforeReWords=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"];var beforeWordChars=beforeReWords.reduce(function(s,w){return s+w.slice(-1)},"");var RE_REGEX=/^\/(?=[^*>\/])[^[\/\\]*(?:\\.|(?:\[(?:\\.|[^\]\\]*)*\])[^[\\\/]*)*?\/[gimuy]*/;var RE_VARCHAR=/[$\w]/;function prev(code,pos){while(--pos>=0&&/\s/.test(code[pos])){}return pos}function _skipRegex(code,start){var re=/.*/g;var pos=re.lastIndex=start++;var match=re.exec(code)[0].match(RE_REGEX);if(match){var next=pos+match[0].length;pos=prev(code,pos);var c=code[pos];if(pos<0||~beforeReChars.indexOf(c)){return next}if(c==="."){if(code[pos-1]==="."){start=next}}else if(c==="+"||c==="-"){if(code[--pos]!==c||(pos=prev(code,pos))<0||!RE_VARCHAR.test(code[pos])){start=next}}else if(~beforeWordChars.indexOf(c)){++pos;for(var i=0;i<beforeReWords.length;i++){var kw=beforeReWords[i];var nn=pos-kw.length;if(nn>=0&&code.slice(nn,pos)===kw&&!RE_VARCHAR.test(code[nn-1])){start=next;break}}}}return start}return _skipRegex}();var brackets=function(UNDEF){var REGLOB="g",R_MLCOMMS=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,R_STRINGS=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'|`[^`\\]*(?:\\[\S\s][^`\\]*)*`/g,S_QBLOCKS=R_STRINGS.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?([^<]\/)[gim]*/.source,S_QBLOCK2=R_STRINGS.source+"|"+/(\/)(?![*\/])/.source,UNSUPPORTED=RegExp("[\\"+"x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),NEED_ESCAPE=/(?=[[\]()*+?.^$|])/g,FINDBRACES={"(":RegExp("([()])|"+S_QBLOCK2,REGLOB),"[":RegExp("([[\\]])|"+S_QBLOCK2,REGLOB),"{":RegExp("([{}])|"+S_QBLOCK2,REGLOB)},DEFAULT="{ }";var _pairs=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+S_QBLOCK2,REGLOB),DEFAULT,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/];var cachedBrackets=UNDEF,_regex,_cache=[],_settings;function _loopback(re){return re}function _rewrite(re,bp){if(!bp){bp=_cache}return new RegExp(re.source.replace(/{/g,bp[2]).replace(/}/g,bp[3]),re.global?REGLOB:"")}function _create(pair){if(pair===DEFAULT){return _pairs}var arr=pair.split(" ");if(arr.length!==2||UNSUPPORTED.test(pair)){throw new Error('Unsupported brackets "'+pair+'"')}arr=arr.concat(pair.replace(NEED_ESCAPE,"\\").split(" "));arr[4]=_rewrite(arr[1].length>1?/{[\S\s]*?}/:_pairs[4],arr);arr[5]=_rewrite(pair.length>3?/\\({|})/g:_pairs[5],arr);arr[6]=_rewrite(_pairs[6],arr);arr[7]=RegExp("\\\\("+arr[3]+")|([[({])|("+arr[3]+")|"+S_QBLOCK2,REGLOB);arr[8]=pair;return arr}function _brackets(reOrIdx){return reOrIdx instanceof RegExp?_regex(reOrIdx):_cache[reOrIdx]}_brackets.split=function split(str,tmpl,_bp){if(!_bp){_bp=_cache}var parts=[],match,isexpr,start,pos,re=_bp[6];var qblocks=[];var prevStr="";var mark,lastIndex;isexpr=start=re.lastIndex=0;while(match=re.exec(str)){lastIndex=re.lastIndex;pos=match.index;if(isexpr){if(match[2]){var ch=match[2];var rech=FINDBRACES[ch];var ix=1;rech.lastIndex=lastIndex;while(match=rech.exec(str)){if(match[1]){if(match[1]===ch){++ix}else if(!--ix){break}}else{rech.lastIndex=pushQBlock(match.index,rech.lastIndex,match[2])}}re.lastIndex=ix?str.length:rech.lastIndex;continue}if(!match[3]){re.lastIndex=pushQBlock(pos,lastIndex,match[4]);continue}}if(!match[1]){unescapeStr(str.slice(start,pos));start=re.lastIndex;re=_bp[6+(isexpr^=1)];re.lastIndex=start}}if(str&&start<str.length){unescapeStr(str.slice(start))}parts.qblocks=qblocks;return parts;function unescapeStr(s){if(prevStr){s=prevStr+s;prevStr=""}if(tmpl||isexpr){parts.push(s&&s.replace(_bp[5],"$1"))}else{parts.push(s)}}function pushQBlock(_pos,_lastIndex,slash){if(slash){_lastIndex=skipRegex(str,_pos)}if(tmpl&&_lastIndex>_pos+2){mark="⁗"+qblocks.length+"~";qblocks.push(str.slice(_pos,_lastIndex));prevStr+=str.slice(start,_pos)+mark;start=_lastIndex}return _lastIndex}};_brackets.hasExpr=function hasExpr(str){return _cache[4].test(str)};_brackets.loopKeys=function loopKeys(expr){var m=expr.match(_cache[9]);return m?{key:m[1],pos:m[2],val:_cache[0]+m[3].trim()+_cache[1]}:{val:expr.trim()}};_brackets.array=function array(pair){return pair?_create(pair):_cache};function _reset(pair){if((pair||(pair=DEFAULT))!==_cache[8]){_cache=_create(pair);_regex=pair===DEFAULT?_loopback:_rewrite;_cache[9]=_regex(_pairs[9])}cachedBrackets=pair}function _setSettings(o){var b;o=o||{};b=o.brackets;Object.defineProperty(o,"brackets",{set:_reset,get:function(){return cachedBrackets},enumerable:true});_settings=o;_reset(b)}Object.defineProperty(_brackets,"settings",{set:_setSettings,get:function(){return _settings}});_brackets.settings=typeof riot!=="undefined"&&riot.settings||{};_brackets.set=_reset;_brackets.R_STRINGS=R_STRINGS;_brackets.R_MLCOMMS=R_MLCOMMS;_brackets.S_QBLOCKS=S_QBLOCKS;_brackets.S_QBLOCK2=S_QBLOCK2;return _brackets}();var tmpl=function(){var _cache={};function _tmpl(str,data){if(!str){return str}return(_cache[str]||(_cache[str]=_create(str))).call(data,_logErr.bind({data:data,tmpl:str}))}_tmpl.hasExpr=brackets.hasExpr;_tmpl.loopKeys=brackets.loopKeys;_tmpl.clearCache=function(){_cache={}};_tmpl.errorHandler=null;function _logErr(err,ctx){err.riotData={tagName:ctx&&ctx.__&&ctx.__.tagName,_riot_id:ctx&&ctx._riot_id};if(_tmpl.errorHandler){_tmpl.errorHandler(err)}else if(typeof console!=="undefined"&&typeof console.error==="function"){console.error(err.message);console.log("<%s> %s",err.riotData.tagName||"Unknown tag",this.tmpl);console.log(this.data)}}function _create(str){var expr=_getTmpl(str);if(expr.slice(0,11)!=="try{return "){expr="return "+expr}return new Function("E",expr+";")}var RE_DQUOTE=/\u2057/g;var RE_QBMARK=/\u2057(\d+)~/g;function _getTmpl(str){var parts=brackets.split(str.replace(RE_DQUOTE,'"'),1);var qstr=parts.qblocks;var expr;if(parts.length>2||parts[0]){var i,j,list=[];for(i=j=0;i<parts.length;++i){expr=parts[i];if(expr&&(expr=i&1?_parseExpr(expr,1,qstr):'"'+expr.replace(/\\/g,"\\\\").replace(/\r\n?|\n/g,"\\n").replace(/"/g,'\\"')+'"')){list[j++]=expr}}expr=j<2?list[0]:"["+list.join(",")+'].join("")'}else{expr=_parseExpr(parts[1],0,qstr)}if(qstr.length){expr=expr.replace(RE_QBMARK,function(_,pos){return qstr[pos].replace(/\r/g,"\\r").replace(/\n/g,"\\n")})}return expr}var RE_CSNAME=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/;var RE_BREND={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g};function _parseExpr(expr,asText,qstr){expr=expr.replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1");if(expr){var list=[],cnt=0,match;while(expr&&(match=expr.match(RE_CSNAME))&&!match.index){var key,jsb,re=/,|([[{(])|$/g;expr=RegExp.rightContext;key=match[2]?qstr[match[2]].slice(1,-1).trim().replace(/\s+/g," "):match[1];while(jsb=(match=re.exec(expr))[1]){skipBraces(jsb,re)}jsb=expr.slice(0,match.index);expr=RegExp.rightContext;list[cnt++]=_wrapExpr(jsb,1,key)}expr=!cnt?_wrapExpr(expr,asText):cnt>1?"["+list.join(",")+'].join(" ").trim()':list[0]}return expr;function skipBraces(ch,re){var mm,lv=1,ir=RE_BREND[ch];ir.lastIndex=re.lastIndex;while(mm=ir.exec(expr)){if(mm[0]===ch){++lv}else if(!--lv){break}}re.lastIndex=lv?expr.length:ir.lastIndex}}var JS_CONTEXT='"in this?this:'+(typeof window!=="object"?"global":"window")+").",JS_VARNAME=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,JS_NOPROPS=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;function _wrapExpr(expr,asText,key){var tb;expr=expr.replace(JS_VARNAME,function(match,p,mvar,pos,s){if(mvar){pos=tb?0:pos+match.length;if(mvar!=="this"&&mvar!=="global"&&mvar!=="window"){match=p+'("'+mvar+JS_CONTEXT+mvar;if(pos){tb=(s=s[pos])==="."||s==="("||s==="["}}else if(pos){tb=!JS_NOPROPS.test(s.slice(pos))}}return match});if(tb){expr="try{return "+expr+"}catch(e){E(e,this)}"}if(key){expr=(tb?"function(){"+expr+"}.call(this)":"("+expr+")")+'?"'+key+'":""'}else if(asText){expr="function(v){"+(tb?expr.replace("return ","v="):"v=("+expr+")")+';return v||v===0?v:""}.call(this)'}return expr}_tmpl.version=brackets.version="v3.0.7";return _tmpl}();var observable$1=function(el){el=el||{};var callbacks={},slice=Array.prototype.slice;Object.defineProperties(el,{on:{value:function(event,fn){if(typeof fn=="function"){(callbacks[event]=callbacks[event]||[]).push(fn)}return el},enumerable:false,writable:false,configurable:false},off:{value:function(event,fn){if(event=="*"&&!fn){callbacks={}}else{if(fn){var arr=callbacks[event];for(var i=0,cb;cb=arr&&arr[i];++i){if(cb==fn){arr.splice(i--,1)}}}else{delete callbacks[event]}}return el},enumerable:false,writable:false,configurable:false},one:{value:function(event,fn){function on(){el.off(event,on);fn.apply(el,arguments)}return el.on(event,on)},enumerable:false,writable:false,configurable:false},trigger:{value:function(event){var arguments$1=arguments;var arglen=arguments.length-1,args=new Array(arglen),fns,fn,i;for(i=0;i<arglen;i++){args[i]=arguments$1[i+1]}fns=slice.call(callbacks[event]||[],0);for(i=0;fn=fns[i];++i){fn.apply(el,args)}if(callbacks["*"]&&event!="*"){el.trigger.apply(el,["*",event].concat(args))}return el},enumerable:false,writable:false,configurable:false}});return el};function each(list,fn){var len=list?list.length:0;var i=0;for(;i<len;++i){fn(list[i],i)}return list}function contains(array,item){return array.indexOf(item)!==-1}function toCamel(str){return str.replace(/-(\w)/g,function(_,c){return c.toUpperCase()})}function startsWith(str,value){return str.slice(0,value.length)===value}function defineProperty(el,key,value,options){Object.defineProperty(el,key,extend({value:value,enumerable:false,writable:false,configurable:true},options));return el}function extend(src){var obj,args=arguments;for(var i=1;i<args.length;++i){if(obj=args[i]){for(var key in obj){if(isWritable(src,key)){src[key]=obj[key]}}}}return src}var misc=Object.freeze({each:each,contains:contains,toCamel:toCamel,startsWith:startsWith,defineProperty:defineProperty,extend:extend});var settings$1=extend(Object.create(brackets.settings),{skipAnonymousTags:true});function handleEvent(dom,handler,e){var ptag=this.__.parent,item=this.__.item;if(!item){while(ptag&&!item){item=ptag.__.item;ptag=ptag.__.parent}}if(isWritable(e,"currentTarget")){e.currentTarget=dom}if(isWritable(e,"target")){e.target=e.srcElement}if(isWritable(e,"which")){e.which=e.charCode||e.keyCode}e.item=item;handler.call(this,e);if(!e.preventUpdate){var p=getImmediateCustomParentTag(this);if(p.isMounted){p.update()}}}function setEventHandler(name,handler,dom,tag){var eventName,cb=handleEvent.bind(tag,dom,handler);dom[name]=null;eventName=name.replace(RE_EVENTS_PREFIX,"");if(!contains(tag.__.listeners,dom)){tag.__.listeners.push(dom)}if(!dom[RIOT_EVENTS_KEY]){dom[RIOT_EVENTS_KEY]={}}if(dom[RIOT_EVENTS_KEY][name]){dom.removeEventListener(eventName,dom[RIOT_EVENTS_KEY][name])}dom[RIOT_EVENTS_KEY][name]=cb;dom.addEventListener(eventName,cb,false)}function updateDataIs(expr,parent,tagName){var conf,isVirtual,head,ref;if(expr.tag&&expr.tagName===tagName){expr.tag.update();return}isVirtual=expr.dom.tagName==="VIRTUAL";if(expr.tag){if(isVirtual){head=expr.tag.__.head;ref=createDOMPlaceholder();head.parentNode.insertBefore(ref,head)}expr.tag.unmount(true)}if(!isString(tagName)){return}expr.impl=__TAG_IMPL[tagName];conf={root:expr.dom,parent:parent,hasImpl:true,tagName:tagName};expr.tag=initChildTag(expr.impl,conf,expr.dom.innerHTML,parent);each(expr.attrs,function(a){return setAttr(expr.tag.root,a.name,a.value)});expr.tagName=tagName;expr.tag.mount();if(isVirtual){makeReplaceVirtual(expr.tag,ref||expr.tag.root)}parent.__.onUnmount=function(){var delName=expr.tag.opts.dataIs,tags=expr.tag.parent.tags,_tags=expr.tag.__.parent.tags;arrayishRemove(tags,delName,expr.tag);arrayishRemove(_tags,delName,expr.tag);expr.tag.unmount()}}function normalizeAttrName(attrName){if(!attrName){return null}attrName=attrName.replace(ATTRS_PREFIX,"");if(CASE_SENSITIVE_ATTRIBUTES[attrName]){attrName=CASE_SENSITIVE_ATTRIBUTES[attrName]}return attrName}function updateExpression(expr){if(this.root&&getAttr(this.root,"virtualized")){return}var dom=expr.dom,attrName=normalizeAttrName(expr.attr),isToggle=contains([SHOW_DIRECTIVE,HIDE_DIRECTIVE],attrName),isVirtual=expr.root&&expr.root.tagName==="VIRTUAL",parent=dom&&(expr.parent||dom.parentNode),isStyleAttr=attrName==="style",isClassAttr=attrName==="class",hasValue,isObj,value;if(expr._riot_id){if(expr.isMounted){expr.update()}else{expr.mount();if(isVirtual){makeReplaceVirtual(expr,expr.root)}}return}if(expr.update){return expr.update()}value=tmpl(expr.expr,isToggle?extend({},Object.create(this.parent),this):this);hasValue=!isBlank(value);isObj=isObject(value);if(isObj){isObj=!isClassAttr&&!isStyleAttr;if(isClassAttr){value=tmpl(JSON.stringify(value),this)}else if(isStyleAttr){value=styleObjectToString(value)}}if(expr.attr&&(!expr.isAttrRemoved||!hasValue||value===false)){remAttr(dom,expr.attr);expr.isAttrRemoved=true}if(expr.bool){value=value?attrName:false}if(expr.isRtag){return updateDataIs(expr,this,value)}if(expr.wasParsedOnce&&expr.value===value){return}expr.value=value;expr.wasParsedOnce=true;if(isObj&&!isToggle){return}if(isBlank(value)){value=""}if(!attrName){value+="";if(parent){expr.parent=parent;if(parent.tagName==="TEXTAREA"){parent.value=value;if(!IE_VERSION){dom.nodeValue=value}}else{dom.nodeValue=value}}return}if(isFunction(value)){setEventHandler(attrName,value,dom,this)}else if(isToggle){toggleVisibility(dom,attrName===HIDE_DIRECTIVE?!value:value)}else{if(expr.bool){dom[attrName]=value}if(attrName==="value"&&dom.value!==value){dom.value=value}if(hasValue&&value!==false){setAttr(dom,attrName,value)}if(isStyleAttr&&dom.hidden){toggleVisibility(dom,false)}}}function updateAllExpressions(expressions){each(expressions,updateExpression.bind(this))}var IfExpr={init:function init(dom,tag,expr){remAttr(dom,CONDITIONAL_DIRECTIVE);this.tag=tag;this.expr=expr;this.stub=document.createTextNode("");this.pristine=dom;var p=dom.parentNode;p.insertBefore(this.stub,dom);p.removeChild(dom);return this},update:function update(){this.value=tmpl(this.expr,this.tag);if(this.value&&!this.current){this.current=this.pristine.cloneNode(true);this.stub.parentNode.insertBefore(this.current,this.stub);this.expressions=[];parseExpressions.apply(this.tag,[this.current,this.expressions,true])}else if(!this.value&&this.current){unmountAll(this.expressions);if(this.current._tag){this.current._tag.unmount()}else if(this.current.parentNode){this.current.parentNode.removeChild(this.current)}this.current=null;this.expressions=[]}if(this.value){updateAllExpressions.call(this.tag,this.expressions)}},unmount:function unmount(){unmountAll(this.expressions||[])}};var RefExpr={init:function init(dom,parent,attrName,attrValue){this.dom=dom;this.attr=attrName;this.rawValue=attrValue;this.parent=parent;this.hasExp=tmpl.hasExpr(attrValue);return this},update:function update(){var old=this.value;var customParent=this.parent&&getImmediateCustomParentTag(this.parent);var tagOrDom=this.dom.__ref||this.tag||this.dom;this.value=this.hasExp?tmpl(this.rawValue,this.parent):this.rawValue;if(!isBlank(old)&&customParent){arrayishRemove(customParent.refs,old,tagOrDom)}if(!isBlank(this.value)&&isString(this.value)){if(customParent){arrayishAdd(customParent.refs,this.value,tagOrDom,null,this.parent.__.index)}if(this.value!==old){setAttr(this.dom,this.attr,this.value)}}else{remAttr(this.dom,this.attr)}if(!this.dom.__ref){this.dom.__ref=tagOrDom}},unmount:function unmount(){var tagOrDom=this.tag||this.dom;var customParent=this.parent&&getImmediateCustomParentTag(this.parent);if(!isBlank(this.value)&&customParent){arrayishRemove(customParent.refs,this.value,tagOrDom)}}};function mkitem(expr,key,val,base){var item=base?Object.create(base):{};item[expr.key]=key;if(expr.pos){item[expr.pos]=val}return item}function unmountRedundant(items,tags){var i=tags.length,j=items.length;while(i>j){i--;remove.apply(tags[i],[tags,i])}}function remove(tags,i){tags.splice(i,1);this.unmount();arrayishRemove(this.parent,this,this.__.tagName,true)}function moveNestedTags(i){var this$1=this;each(Object.keys(this.tags),function(tagName){moveChildTag.apply(this$1.tags[tagName],[tagName,i])})}function move(root,nextTag,isVirtual){if(isVirtual){moveVirtual.apply(this,[root,nextTag])}else{safeInsert(root,this.root,nextTag.root)}}function insert(root,nextTag,isVirtual){if(isVirtual){makeVirtual.apply(this,[root,nextTag])}else{safeInsert(root,this.root,nextTag.root)}}function append(root,isVirtual){if(isVirtual){makeVirtual.call(this,root)}else{root.appendChild(this.root)}}function _each(dom,parent,expr){remAttr(dom,LOOP_DIRECTIVE);var mustReorder=typeof getAttr(dom,LOOP_NO_REORDER_DIRECTIVE)!==T_STRING||remAttr(dom,LOOP_NO_REORDER_DIRECTIVE),tagName=getTagName(dom),impl=__TAG_IMPL[tagName],parentNode=dom.parentNode,placeholder=createDOMPlaceholder(),child=getTag(dom),ifExpr=getAttr(dom,CONDITIONAL_DIRECTIVE),tags=[],oldItems=[],hasKeys,isLoop=true,isAnonymous=!__TAG_IMPL[tagName],isVirtual=dom.tagName==="VIRTUAL";expr=tmpl.loopKeys(expr);expr.isLoop=true;if(ifExpr){remAttr(dom,CONDITIONAL_DIRECTIVE)}parentNode.insertBefore(placeholder,dom);parentNode.removeChild(dom);expr.update=function updateEach(){expr.value=tmpl(expr.val,parent);var frag=createFrag(),items=expr.value,isObject$$1=!isArray(items)&&!isString(items),root=placeholder.parentNode;if(!root){return}if(isObject$$1){hasKeys=items||false;items=hasKeys?Object.keys(items).map(function(key){return mkitem(expr,items[key],key)}):[]}else{hasKeys=false}if(ifExpr){items=items.filter(function(item,i){if(expr.key&&!isObject$$1){return!!tmpl(ifExpr,mkitem(expr,item,i,parent))}return!!tmpl(ifExpr,extend(Object.create(parent),item))})}each(items,function(item,i){var doReorder=mustReorder&&typeof item===T_OBJECT&&!hasKeys,oldPos=oldItems.indexOf(item),isNew=oldPos===-1,pos=!isNew&&doReorder?oldPos:i,tag=tags[pos],mustAppend=i>=oldItems.length,mustCreate=doReorder&&isNew||!doReorder&&!tag;item=!hasKeys&&expr.key?mkitem(expr,item,i):item;if(mustCreate){tag=new Tag$1(impl,{parent:parent,isLoop:isLoop,isAnonymous:isAnonymous,tagName:tagName,root:dom.cloneNode(isAnonymous),item:item,index:i},dom.innerHTML);tag.mount();if(mustAppend){append.apply(tag,[frag||root,isVirtual])}else{insert.apply(tag,[root,tags[i],isVirtual])}if(!mustAppend){oldItems.splice(i,0,item)}tags.splice(i,0,tag);if(child){arrayishAdd(parent.tags,tagName,tag,true)}}else if(pos!==i&&doReorder){if(contains(items,oldItems[pos])){move.apply(tag,[root,tags[i],isVirtual]);tags.splice(i,0,tags.splice(pos,1)[0]);oldItems.splice(i,0,oldItems.splice(pos,1)[0])}if(expr.pos){tag[expr.pos]=i}if(!child&&tag.tags){moveNestedTags.call(tag,i)}}tag.__.item=item;tag.__.index=i;tag.__.parent=parent;if(!mustCreate){tag.update(item)}});unmountRedundant(items,tags);oldItems=items.slice();root.insertBefore(frag,placeholder)};expr.unmount=function(){each(tags,function(t){t.unmount()})};return expr}function parseExpressions(root,expressions,mustIncludeRoot){var this$1=this;var tree={parent:{children:expressions}};walkNodes(root,function(dom,ctx){var type=dom.nodeType,parent=ctx.parent,attr,expr,tagImpl;if(!mustIncludeRoot&&dom===root){return{parent:parent}}if(type===3&&dom.parentNode.tagName!=="STYLE"&&tmpl.hasExpr(dom.nodeValue)){parent.children.push({dom:dom,expr:dom.nodeValue})}if(type!==1){return ctx}var isVirtual=dom.tagName==="VIRTUAL";if(attr=getAttr(dom,LOOP_DIRECTIVE)){if(isVirtual){setAttr(dom,"loopVirtual",true)}parent.children.push(_each(dom,this$1,attr));return false}if(attr=getAttr(dom,CONDITIONAL_DIRECTIVE)){parent.children.push(Object.create(IfExpr).init(dom,this$1,attr));return false}if(expr=getAttr(dom,IS_DIRECTIVE)){if(tmpl.hasExpr(expr)){parent.children.push({isRtag:true,expr:expr,dom:dom,attrs:[].slice.call(dom.attributes)});return false}}tagImpl=getTag(dom);if(isVirtual){if(getAttr(dom,"virtualized")){dom.parentElement.removeChild(dom)}if(!tagImpl&&!getAttr(dom,"virtualized")&&!getAttr(dom,"loopVirtual")){tagImpl={tmpl:dom.outerHTML}}}if(tagImpl&&(dom!==root||mustIncludeRoot)){if(isVirtual&&!getAttr(dom,IS_DIRECTIVE)){setAttr(dom,"virtualized",true);var tag=new Tag$1({tmpl:dom.outerHTML},{root:dom,parent:this$1},dom.innerHTML);parent.children.push(tag)}else{var conf={root:dom,parent:this$1,hasImpl:true};parent.children.push(initChildTag(tagImpl,conf,dom.innerHTML,this$1));return false}}parseAttributes.apply(this$1,[dom,dom.attributes,function(attr,expr){if(!expr){return}parent.children.push(expr)}]);return{parent:parent}},tree)}function parseAttributes(dom,attrs,fn){var this$1=this;each(attrs,function(attr){if(!attr){return false}var name=attr.name,bool=isBoolAttr(name),expr;if(contains(REF_DIRECTIVES,name)){expr=Object.create(RefExpr).init(dom,this$1,name,attr.value)}else if(tmpl.hasExpr(attr.value)){expr={dom:dom,expr:attr.value,attr:name,bool:bool}}fn(attr,expr)})}var reHasYield=/<yield\b/i;var reYieldAll=/<yield\s*(?:\/>|>([\S\s]*?)<\/yield\s*>|>)/gi;var reYieldSrc=/<yield\s+to=['"]([^'">]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi;var reYieldDest=/<yield\s+from=['"]?([-\w]+)['"]?\s*(?:\/>|>([\S\s]*?)<\/yield\s*>)/gi;var rootEls={tr:"tbody",th:"tr",td:"tr",col:"colgroup"};var tblTags=IE_VERSION&&IE_VERSION<10?RE_SPECIAL_TAGS:RE_SPECIAL_TAGS_NO_OPTION;var GENERIC="div";var SVG="svg";function specialTags(el,tmpl,tagName){var select=tagName[0]==="o",parent=select?"select>":"table>";el.innerHTML="<"+parent+tmpl.trim()+"</"+parent;parent=el.firstChild;if(select){parent.selectedIndex=-1}else{var tname=rootEls[tagName];if(tname&&parent.childElementCount===1){parent=$(tname,parent)}}return parent}function replaceYield(tmpl,html){if(!reHasYield.test(tmpl)){return tmpl}var src={};html=html&&html.replace(reYieldSrc,function(_,ref,text){src[ref]=src[ref]||text;return""}).trim();return tmpl.replace(reYieldDest,function(_,ref,def){return src[ref]||def||""}).replace(reYieldAll,function(_,def){return html||def||""})}function mkdom(tmpl,html,isSvg$$1){var match=tmpl&&tmpl.match(/^\s*<([-\w]+)/),tagName=match&&match[1].toLowerCase(),el=mkEl(isSvg$$1?SVG:GENERIC);tmpl=replaceYield(tmpl,html);if(tblTags.test(tagName)){el=specialTags(el,tmpl,tagName)}else{setInnerHTML(el,tmpl)}return el}function Tag$2(el,opts){var ref=this;var name=ref.name;var tmpl=ref.tmpl;var css=ref.css;var attrs=ref.attrs;var onCreate=ref.onCreate;if(!__TAG_IMPL[name]){tag$1(name,tmpl,css,attrs,onCreate);__TAG_IMPL[name].class=this.constructor}mountTo(el,name,opts,this);if(css){styleManager.inject()}return this}function tag$1(name,tmpl,css,attrs,fn){if(isFunction(attrs)){fn=attrs;if(/^[\w\-]+\s?=/.test(css)){attrs=css;css=""}else{attrs=""}}if(css){if(isFunction(css)){fn=css}else{styleManager.add(css)}}name=name.toLowerCase();__TAG_IMPL[name]={name:name,tmpl:tmpl,attrs:attrs,fn:fn};return name}function tag2$1(name,tmpl,css,attrs,fn){if(css){styleManager.add(css,name)}__TAG_IMPL[name]={name:name,tmpl:tmpl,attrs:attrs,fn:fn};return name}function mount$1(selector,tagName,opts){var tags=[];var elem,allTags;function pushTagsTo(root){if(root.tagName){var riotTag=getAttr(root,IS_DIRECTIVE),tag;if(tagName&&riotTag!==tagName){riotTag=tagName;setAttr(root,IS_DIRECTIVE,tagName)}tag=mountTo(root,riotTag||root.tagName.toLowerCase(),opts);if(tag){tags.push(tag)}}else if(root.length){each(root,pushTagsTo)}}styleManager.inject();if(isObject(tagName)){opts=tagName;tagName=0}if(isString(selector)){selector=selector==="*"?allTags=selectTags():selector+selectTags(selector.split(/, */));elem=selector?$$(selector):[]}else{elem=selector}if(tagName==="*"){tagName=allTags||selectTags();if(elem.tagName){elem=$$(tagName,elem)}else{var nodeList=[];each(elem,function(_el){return nodeList.push($$(tagName,_el))});elem=nodeList}tagName=0}pushTagsTo(elem);return tags}var mixins={};var globals=mixins[GLOBAL_MIXIN]={};var mixins_id=0;function mixin$1(name,mix,g){if(isObject(name)){mixin$1("__"+mixins_id++ +"__",name,true);return}var store=g?globals:mixins;if(!mix){if(isUndefined(store[name])){throw new Error("Unregistered mixin: "+name)}return store[name]}store[name]=isFunction(mix)?extend(mix.prototype,store[name]||{})&&mix:extend(store[name]||{},mix)}function update$1(){return each(__TAGS_CACHE,function(tag){return tag.update()})}function unregister$1(name){__TAG_IMPL[name]=null}var version$1="WIP";var core=Object.freeze({Tag:Tag$2,tag:tag$1,tag2:tag2$1,mount:mount$1,mixin:mixin$1,update:update$1,unregister:unregister$1,version:version$1});var __uid=0;function updateOpts(isLoop,parent,isAnonymous,opts,instAttrs){if(isLoop&&isAnonymous){return}var ctx=!isAnonymous&&isLoop?this:parent||this;each(instAttrs,function(attr){if(attr.expr){updateAllExpressions.call(ctx,[attr.expr])}opts[toCamel(attr.name).replace(ATTRS_PREFIX,"")]=attr.expr?attr.expr.value:attr.value})}function Tag$1(impl,conf,innerHTML){if(impl===void 0)impl={};if(conf===void 0)conf={};var opts=extend({},conf.opts),parent=conf.parent,isLoop=conf.isLoop,isAnonymous=!!conf.isAnonymous,skipAnonymous=settings$1.skipAnonymousTags&&isAnonymous,item=cleanUpData(conf.item),index=conf.index,instAttrs=[],implAttrs=[],expressions=[],root=conf.root,tagName=conf.tagName||getTagName(root),isVirtual=tagName==="virtual",isInline=!isVirtual&&!impl.tmpl,propsInSyncWithParent=[],dom;if(!skipAnonymous){observable$1(this)}if(impl.name&&root._tag){root._tag.unmount(true)}this.isMounted=false;defineProperty(this,"__",{isAnonymous:isAnonymous,instAttrs:instAttrs,innerHTML:innerHTML,tagName:tagName,index:index,isLoop:isLoop,isInline:isInline,listeners:[],virts:[],tail:null,head:null,parent:null,item:null});defineProperty(this,"_riot_id",++__uid);defineProperty(this,"root",root);extend(this,{opts:opts},item);defineProperty(this,"parent",parent||null);defineProperty(this,"tags",{});defineProperty(this,"refs",{});if(isInline||isLoop&&isAnonymous){dom=root}else{if(!isVirtual){root.innerHTML=""}dom=mkdom(impl.tmpl,innerHTML,isSvg(root))}defineProperty(this,"update",function tagUpdate(data){var nextOpts={},canTrigger=this.isMounted&&!skipAnonymous;data=cleanUpData(data);extend(this,data);updateOpts.apply(this,[isLoop,parent,isAnonymous,nextOpts,instAttrs]);if(canTrigger&&this.isMounted&&isFunction(this.shouldUpdate)&&!this.shouldUpdate(data,nextOpts)){return this}if(isLoop&&isAnonymous){inheritFrom.apply(this,[this.parent,propsInSyncWithParent])}extend(opts,nextOpts);if(canTrigger){this.trigger("update",data)}updateAllExpressions.call(this,expressions);if(canTrigger){this.trigger("updated")}return this}.bind(this));defineProperty(this,"mixin",function tagMixin(){var this$1=this;each(arguments,function(mix){var instance,obj;var props=[];var propsBlacklist=["init","__proto__"];mix=isString(mix)?mixin$1(mix):mix;if(isFunction(mix)){instance=new mix}else{instance=mix}var proto=Object.getPrototypeOf(instance);do{props=props.concat(Object.getOwnPropertyNames(obj||instance))}while(obj=Object.getPrototypeOf(obj||instance));
each(props,function(key){if(!contains(propsBlacklist,key)){var descriptor=Object.getOwnPropertyDescriptor(instance,key)||Object.getOwnPropertyDescriptor(proto,key);var hasGetterSetter=descriptor&&(descriptor.get||descriptor.set);if(!this$1.hasOwnProperty(key)&&hasGetterSetter){Object.defineProperty(this$1,key,descriptor)}else{this$1[key]=isFunction(instance[key])?instance[key].bind(this$1):instance[key]}}});if(instance.init){instance.init.bind(this$1)()}});return this}.bind(this));defineProperty(this,"mount",function tagMount(){var this$1=this;root._tag=this;parseAttributes.apply(parent,[root,root.attributes,function(attr,expr){if(!isAnonymous&&RefExpr.isPrototypeOf(expr)){expr.tag=this$1}attr.expr=expr;instAttrs.push(attr)}]);implAttrs=[];walkAttrs(impl.attrs,function(k,v){implAttrs.push({name:k,value:v})});parseAttributes.apply(this,[root,implAttrs,function(attr,expr){if(expr){expressions.push(expr)}else{setAttr(root,attr.name,attr.value)}}]);updateOpts.apply(this,[isLoop,parent,isAnonymous,opts,instAttrs]);var globalMixin=mixin$1(GLOBAL_MIXIN);if(globalMixin&&!skipAnonymous){for(var i in globalMixin){if(globalMixin.hasOwnProperty(i)){this$1.mixin(globalMixin[i])}}}if(impl.fn){impl.fn.call(this,opts)}if(!skipAnonymous){this.trigger("before-mount")}parseExpressions.apply(this,[dom,expressions,isAnonymous]);this.update(item);if(!isAnonymous&&!isInline){while(dom.firstChild){root.appendChild(dom.firstChild)}}defineProperty(this,"root",root);defineProperty(this,"isMounted",true);if(skipAnonymous){return}if(!this.parent){this.trigger("mount")}else{var p=getImmediateCustomParentTag(this.parent);p.one(!p.isMounted?"mount":"updated",function(){this$1.trigger("mount")})}return this}.bind(this));defineProperty(this,"unmount",function tagUnmount(mustKeepRoot){var this$1=this;var el=this.root,p=el.parentNode,ptag,tagIndex=__TAGS_CACHE.indexOf(this);if(!skipAnonymous){this.trigger("before-unmount")}walkAttrs(impl.attrs,function(name){if(startsWith(name,ATTRS_PREFIX)){name=name.slice(ATTRS_PREFIX.length)}remAttr(root,name)});this.__.listeners.forEach(function(dom){Object.keys(dom[RIOT_EVENTS_KEY]).forEach(function(eventName){dom.removeEventListener(eventName,dom[RIOT_EVENTS_KEY][eventName])})});if(tagIndex!==-1){__TAGS_CACHE.splice(tagIndex,1)}if(p||isVirtual){if(parent){ptag=getImmediateCustomParentTag(parent);if(isVirtual){Object.keys(this.tags).forEach(function(tagName){arrayishRemove(ptag.tags,tagName,this$1.tags[tagName])})}else{arrayishRemove(ptag.tags,tagName,this);if(parent!==ptag){arrayishRemove(parent.tags,tagName,this)}}}else{setInnerHTML(el,"")}if(p&&!mustKeepRoot){p.removeChild(el)}}if(this.__.virts){each(this.__.virts,function(v){if(v.parentNode){v.parentNode.removeChild(v)}})}unmountAll(expressions);each(instAttrs,function(a){return a.expr&&a.expr.unmount&&a.expr.unmount()});if(this.__.onUnmount){this.__.onUnmount()}if(!skipAnonymous){this.trigger("unmount");this.off("*")}defineProperty(this,"isMounted",false);delete this.root._tag;return this}.bind(this))}function getTag(dom){return dom.tagName&&__TAG_IMPL[getAttr(dom,IS_DIRECTIVE)||getAttr(dom,IS_DIRECTIVE)||dom.tagName.toLowerCase()]}function inheritFrom(target,propsInSyncWithParent){var this$1=this;each(Object.keys(target),function(k){var mustSync=!isReservedName(k)&&contains(propsInSyncWithParent,k);if(isUndefined(this$1[k])||mustSync){if(!mustSync){propsInSyncWithParent.push(k)}this$1[k]=target[k]}})}function moveChildTag(tagName,newPos){var parent=this.parent,tags;if(!parent){return}tags=parent.tags[tagName];if(isArray(tags)){tags.splice(newPos,0,tags.splice(tags.indexOf(this),1)[0])}else{arrayishAdd(parent.tags,tagName,this)}}function initChildTag(child,opts,innerHTML,parent){var tag=new Tag$1(child,opts,innerHTML),tagName=opts.tagName||getTagName(opts.root,true),ptag=getImmediateCustomParentTag(parent);defineProperty(tag,"parent",ptag);tag.__.parent=parent;arrayishAdd(ptag.tags,tagName,tag);if(ptag!==parent){arrayishAdd(parent.tags,tagName,tag)}opts.root.innerHTML="";return tag}function getImmediateCustomParentTag(tag){var ptag=tag;while(ptag.__.isAnonymous){if(!ptag.parent){break}ptag=ptag.parent}return ptag}function unmountAll(expressions){each(expressions,function(expr){if(expr instanceof Tag$1){expr.unmount(true)}else if(expr.tagName){expr.tag.unmount(true)}else if(expr.unmount){expr.unmount()}})}function getTagName(dom,skipDataIs){var child=getTag(dom),namedTag=!skipDataIs&&getAttr(dom,IS_DIRECTIVE);return namedTag&&!tmpl.hasExpr(namedTag)?namedTag:child?child.name:dom.tagName.toLowerCase()}function cleanUpData(data){if(!(data instanceof Tag$1)&&!(data&&isFunction(data.trigger))){return data}var o={};for(var key in data){if(!RE_RESERVED_NAMES.test(key)){o[key]=data[key]}}return o}function arrayishAdd(obj,key,value,ensureArray,index){var dest=obj[key];var isArr=isArray(dest);var hasIndex=!isUndefined(index);if(dest&&dest===value){return}if(!dest&&ensureArray){obj[key]=[value]}else if(!dest){obj[key]=value}else{if(isArr){var oldIndex=dest.indexOf(value);if(oldIndex===index){return}if(oldIndex!==-1){dest.splice(oldIndex,1)}if(hasIndex){dest.splice(index,0,value)}else{dest.push(value)}}else{obj[key]=[dest,value]}}}function arrayishRemove(obj,key,value,ensureArray){if(isArray(obj[key])){var index=obj[key].indexOf(value);if(index!==-1){obj[key].splice(index,1)}if(!obj[key].length){delete obj[key]}else if(obj[key].length===1&&!ensureArray){obj[key]=obj[key][0]}}else{delete obj[key]}}function mountTo(root,tagName,opts,ctx){var impl=__TAG_IMPL[tagName],implClass=__TAG_IMPL[tagName].class,tag=ctx||(implClass?Object.create(implClass.prototype):{}),innerHTML=root._innerHTML=root._innerHTML||root.innerHTML;var conf=extend({root:root,opts:opts},{parent:opts?opts.parent:null});if(impl&&root){Tag$1.apply(tag,[impl,conf,innerHTML])}if(tag&&tag.mount){tag.mount(true);if(!contains(__TAGS_CACHE,tag)){__TAGS_CACHE.push(tag)}}return tag}function makeReplaceVirtual(tag,ref){var frag=createFrag();makeVirtual.call(tag,frag);ref.parentNode.replaceChild(frag,ref)}function makeVirtual(src,target){var this$1=this;var head=createDOMPlaceholder(),tail=createDOMPlaceholder(),frag=createFrag(),sib,el;this.root.insertBefore(head,this.root.firstChild);this.root.appendChild(tail);this.__.head=el=head;this.__.tail=tail;while(el){sib=el.nextSibling;frag.appendChild(el);this$1.__.virts.push(el);el=sib}if(target){src.insertBefore(frag,target.__.head)}else{src.appendChild(frag)}}function moveVirtual(src,target){var this$1=this;var el=this.__.head,frag=createFrag(),sib;while(el){sib=el.nextSibling;frag.appendChild(el);el=sib;if(el===this$1.__.tail){frag.appendChild(el);src.insertBefore(frag,target.__.head);break}}}function selectTags(tags){if(!tags){var keys=Object.keys(__TAG_IMPL);return keys+selectTags(keys)}return tags.filter(function(t){return!/[^-\w]/.test(t)}).reduce(function(list,t){var name=t.trim().toLowerCase();return list+",["+IS_DIRECTIVE+'="'+name+'"]'},"")}var tags=Object.freeze({getTag:getTag,inheritFrom:inheritFrom,moveChildTag:moveChildTag,initChildTag:initChildTag,getImmediateCustomParentTag:getImmediateCustomParentTag,unmountAll:unmountAll,getTagName:getTagName,cleanUpData:cleanUpData,arrayishAdd:arrayishAdd,arrayishRemove:arrayishRemove,mountTo:mountTo,makeReplaceVirtual:makeReplaceVirtual,makeVirtual:makeVirtual,moveVirtual:moveVirtual,selectTags:selectTags});var settings=settings$1;var util={tmpl:tmpl,brackets:brackets,styleManager:styleManager,vdom:__TAGS_CACHE,styleNode:styleManager.styleNode,dom:dom,check:check,misc:misc,tags:tags};var riot$1=extend({},core,{observable:observable$1,settings:settings,util:util});riot$1.tag2("bbutton",'<button class="btn rounded-button"> </button>',"","",function(opts){});(function(self){"use strict";if(self.fetch){return}var support={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{new Blob;return true}catch(e){return false}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(support.arrayBuffer){var viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"];var isDataView=function(obj){return obj&&DataView.prototype.isPrototypeOf(obj)};var isArrayBufferView=ArrayBuffer.isView||function(obj){return obj&&viewClasses.indexOf(Object.prototype.toString.call(obj))>-1}}function normalizeName(name){if(typeof name!=="string"){name=String(name)}if(/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)){throw new TypeError("Invalid character in header field name")}return name.toLowerCase()}function normalizeValue(value){if(typeof value!=="string"){value=String(value)}return value}function iteratorFor(items){var iterator={next:function(){var value=items.shift();return{done:value===undefined,value:value}}};if(support.iterable){iterator[Symbol.iterator]=function(){return iterator}}return iterator}function Headers(headers){this.map={};if(headers instanceof Headers){headers.forEach(function(value,name){this.append(name,value)},this)}else if(Array.isArray(headers)){headers.forEach(function(header){this.append(header[0],header[1])},this)}else if(headers){Object.getOwnPropertyNames(headers).forEach(function(name){this.append(name,headers[name])},this)}}Headers.prototype.append=function(name,value){name=normalizeName(name);value=normalizeValue(value);var oldValue=this.map[name];this.map[name]=oldValue?oldValue+","+value:value};Headers.prototype["delete"]=function(name){delete this.map[normalizeName(name)]};Headers.prototype.get=function(name){name=normalizeName(name);return this.has(name)?this.map[name]:null};Headers.prototype.has=function(name){return this.map.hasOwnProperty(normalizeName(name))};Headers.prototype.set=function(name,value){this.map[normalizeName(name)]=normalizeValue(value)};Headers.prototype.forEach=function(callback,thisArg){var this$1=this;for(var name in this$1.map){if(this$1.map.hasOwnProperty(name)){callback.call(thisArg,this$1.map[name],name,this$1)}}};Headers.prototype.keys=function(){var items=[];this.forEach(function(value,name){items.push(name)});return iteratorFor(items)};Headers.prototype.values=function(){var items=[];this.forEach(function(value){items.push(value)});return iteratorFor(items)};Headers.prototype.entries=function(){var items=[];this.forEach(function(value,name){items.push([name,value])});return iteratorFor(items)};if(support.iterable){Headers.prototype[Symbol.iterator]=Headers.prototype.entries}function consumed(body){if(body.bodyUsed){return Promise.reject(new TypeError("Already read"))}body.bodyUsed=true}function fileReaderReady(reader){return new Promise(function(resolve,reject){reader.onload=function(){resolve(reader.result)};reader.onerror=function(){reject(reader.error)}})}function readBlobAsArrayBuffer(blob){var reader=new FileReader;var promise=fileReaderReady(reader);reader.readAsArrayBuffer(blob);return promise}function readBlobAsText(blob){var reader=new FileReader;var promise=fileReaderReady(reader);reader.readAsText(blob);return promise}function readArrayBufferAsText(buf){var view=new Uint8Array(buf);var chars=new Array(view.length);for(var i=0;i<view.length;i++){chars[i]=String.fromCharCode(view[i])}return chars.join("")}function bufferClone(buf){if(buf.slice){return buf.slice(0)}else{var view=new Uint8Array(buf.byteLength);view.set(new Uint8Array(buf));return view.buffer}}function Body(){this.bodyUsed=false;this._initBody=function(body){this._bodyInit=body;if(!body){this._bodyText=""}else if(typeof body==="string"){this._bodyText=body}else if(support.blob&&Blob.prototype.isPrototypeOf(body)){this._bodyBlob=body}else if(support.formData&&FormData.prototype.isPrototypeOf(body)){this._bodyFormData=body}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body)){this._bodyText=body.toString()}else if(support.arrayBuffer&&support.blob&&isDataView(body)){this._bodyArrayBuffer=bufferClone(body.buffer);this._bodyInit=new Blob([this._bodyArrayBuffer])}else if(support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(body)||isArrayBufferView(body))){this._bodyArrayBuffer=bufferClone(body)}else{throw new Error("unsupported BodyInit type")}if(!this.headers.get("content-type")){if(typeof body==="string"){this.headers.set("content-type","text/plain;charset=UTF-8")}else if(this._bodyBlob&&this._bodyBlob.type){this.headers.set("content-type",this._bodyBlob.type)}else if(support.searchParams&&URLSearchParams.prototype.isPrototypeOf(body)){this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")}}};if(support.blob){this.blob=function(){var rejected=consumed(this);if(rejected){return rejected}if(this._bodyBlob){return Promise.resolve(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(new Blob([this._bodyArrayBuffer]))}else if(this._bodyFormData){throw new Error("could not read FormData body as blob")}else{return Promise.resolve(new Blob([this._bodyText]))}};this.arrayBuffer=function(){if(this._bodyArrayBuffer){return consumed(this)||Promise.resolve(this._bodyArrayBuffer)}else{return this.blob().then(readBlobAsArrayBuffer)}}}this.text=function(){var rejected=consumed(this);if(rejected){return rejected}if(this._bodyBlob){return readBlobAsText(this._bodyBlob)}else if(this._bodyArrayBuffer){return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))}else if(this._bodyFormData){throw new Error("could not read FormData body as text")}else{return Promise.resolve(this._bodyText)}};if(support.formData){this.formData=function(){return this.text().then(decode)}}this.json=function(){return this.text().then(JSON.parse)};return this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(method){var upcased=method.toUpperCase();return methods.indexOf(upcased)>-1?upcased:method}function Request(input,options){options=options||{};var body=options.body;if(input instanceof Request){if(input.bodyUsed){throw new TypeError("Already read")}this.url=input.url;this.credentials=input.credentials;if(!options.headers){this.headers=new Headers(input.headers)}this.method=input.method;this.mode=input.mode;if(!body&&input._bodyInit!=null){body=input._bodyInit;input.bodyUsed=true}}else{this.url=String(input)}this.credentials=options.credentials||this.credentials||"omit";if(options.headers||!this.headers){this.headers=new Headers(options.headers)}this.method=normalizeMethod(options.method||this.method||"GET");this.mode=options.mode||this.mode||null;this.referrer=null;if((this.method==="GET"||this.method==="HEAD")&&body){throw new TypeError("Body not allowed for GET or HEAD requests")}this._initBody(body)}Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})};function decode(body){var form=new FormData;body.trim().split("&").forEach(function(bytes){if(bytes){var split=bytes.split("=");var name=split.shift().replace(/\+/g," ");var value=split.join("=").replace(/\+/g," ");form.append(decodeURIComponent(name),decodeURIComponent(value))}});return form}function parseHeaders(rawHeaders){var headers=new Headers;rawHeaders.split(/\r?\n/).forEach(function(line){var parts=line.split(":");var key=parts.shift().trim();if(key){var value=parts.join(":").trim();headers.append(key,value)}});return headers}Body.call(Request.prototype);function Response(bodyInit,options){if(!options){options={}}this.type="default";this.status="status"in options?options.status:200;this.ok=this.status>=200&&this.status<300;this.statusText="statusText"in options?options.statusText:"OK";this.headers=new Headers(options.headers);this.url=options.url||"";this._initBody(bodyInit)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var response=new Response(null,{status:0,statusText:""});response.type="error";return response};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(url,status){if(redirectStatuses.indexOf(status)===-1){throw new RangeError("Invalid status code")}return new Response(null,{status:status,headers:{location:url}})};self.Headers=Headers;self.Request=Request;self.Response=Response;self.fetch=function(input,init){return new Promise(function(resolve,reject){var request=new Request(input,init);var xhr=new XMLHttpRequest;xhr.onload=function(){var options={status:xhr.status,statusText:xhr.statusText,headers:parseHeaders(xhr.getAllResponseHeaders()||"")};options.url="responseURL"in xhr?xhr.responseURL:options.headers.get("X-Request-URL");var body="response"in xhr?xhr.response:xhr.responseText;resolve(new Response(body,options))};xhr.onerror=function(){reject(new TypeError("Network request failed"))};xhr.ontimeout=function(){reject(new TypeError("Network request failed"))};xhr.open(request.method,request.url,true);if(request.credentials==="include"){xhr.withCredentials=true}if("responseType"in xhr&&support.blob){xhr.responseType="blob"}request.headers.forEach(function(value,name){xhr.setRequestHeader(name,value)});xhr.send(typeof request._bodyInit==="undefined"?null:request._bodyInit)})};self.fetch.polyfill=true})(typeof self!=="undefined"?self:undefined);var _isPlaceholder=function _isPlaceholder(a){return a!=null&&typeof a==="object"&&a["@@functional/placeholder"]===true};var _curry1=function _curry1(fn){return function f1(a){if(arguments.length===0||_isPlaceholder(a)){return f1}else{return fn.apply(this,arguments)}}};var always=_curry1(function always(val){return function(){return val}});var F=always(false);var T=always(true);var __={"@@functional/placeholder":true};var _curry2=function _curry2(fn){return function f2(a,b){switch(arguments.length){case 0:return f2;case 1:return _isPlaceholder(a)?f2:_curry1(function(_b){return fn(a,_b)});default:return _isPlaceholder(a)&&_isPlaceholder(b)?f2:_isPlaceholder(a)?_curry1(function(_a){return fn(_a,b)}):_isPlaceholder(b)?_curry1(function(_b){return fn(a,_b)}):fn(a,b)}}};var add=_curry2(function add(a,b){return Number(a)+Number(b)});var _concat=function _concat(set1,set2){set1=set1||[];set2=set2||[];var idx;var len1=set1.length;var len2=set2.length;var result=[];idx=0;while(idx<len1){result[result.length]=set1[idx];idx+=1}idx=0;while(idx<len2){result[result.length]=set2[idx];idx+=1}return result};var _arity=function _arity(n,fn){switch(n){case 0:return function(){return fn.apply(this,arguments)};case 1:return function(a0){return fn.apply(this,arguments)};case 2:return function(a0,a1){return fn.apply(this,arguments)};case 3:return function(a0,a1,a2){return fn.apply(this,arguments)};case 4:return function(a0,a1,a2,a3){return fn.apply(this,arguments)};case 5:return function(a0,a1,a2,a3,a4){return fn.apply(this,arguments)};case 6:return function(a0,a1,a2,a3,a4,a5){return fn.apply(this,arguments)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){return fn.apply(this,arguments)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){return fn.apply(this,arguments)};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){return fn.apply(this,arguments)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){return fn.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}};var _curryN=function _curryN(length,received,fn){return function(){var arguments$1=arguments;var combined=[];var argsIdx=0;var left=length;var combinedIdx=0;while(combinedIdx<received.length||argsIdx<arguments.length){var result;if(combinedIdx<received.length&&(!_isPlaceholder(received[combinedIdx])||argsIdx>=arguments$1.length)){result=received[combinedIdx]}else{result=arguments$1[argsIdx];argsIdx+=1}combined[combinedIdx]=result;if(!_isPlaceholder(result)){left-=1}combinedIdx+=1}return left<=0?fn.apply(this,combined):_arity(left,_curryN(length,combined,fn))}};var curryN=_curry2(function curryN(length,fn){if(length===1){return _curry1(fn)}return _arity(length,_curryN(length,[],fn))});var addIndex=_curry1(function addIndex(fn){return curryN(fn.length,function(){var idx=0;var origFn=arguments[0];var list=arguments[arguments.length-1];var args=Array.prototype.slice.call(arguments,0);args[0]=function(){var result=origFn.apply(this,_concat(arguments,[idx,list]));idx+=1;return result};return fn.apply(this,args)})});var _curry3=function _curry3(fn){return function f3(a,b,c){switch(arguments.length){case 0:return f3;case 1:return _isPlaceholder(a)?f3:_curry2(function(_b,_c){return fn(a,_b,_c)});case 2:return _isPlaceholder(a)&&_isPlaceholder(b)?f3:_isPlaceholder(a)?_curry2(function(_a,_c){return fn(_a,b,_c)}):_isPlaceholder(b)?_curry2(function(_b,_c){return fn(a,_b,_c)}):_curry1(function(_c){return fn(a,b,_c)});default:return _isPlaceholder(a)&&_isPlaceholder(b)&&_isPlaceholder(c)?f3:_isPlaceholder(a)&&_isPlaceholder(b)?_curry2(function(_a,_b){return fn(_a,_b,c)}):_isPlaceholder(a)&&_isPlaceholder(c)?_curry2(function(_a,_c){return fn(_a,b,_c)}):_isPlaceholder(b)&&_isPlaceholder(c)?_curry2(function(_b,_c){return fn(a,_b,_c)}):_isPlaceholder(a)?_curry1(function(_a){return fn(_a,b,c)}):_isPlaceholder(b)?_curry1(function(_b){return fn(a,_b,c)}):_isPlaceholder(c)?_curry1(function(_c){return fn(a,b,_c)}):fn(a,b,c)}}};var adjust=_curry3(function adjust(fn,idx,list){if(idx>=list.length||idx<-list.length){return list}var start=idx<0?list.length:0;var _idx=start+idx;var _list=_concat(list);_list[_idx]=fn(list[_idx]);return _list});var _isArray=Array.isArray||function _isArray(val){return val!=null&&val.length>=0&&Object.prototype.toString.call(val)==="[object Array]"};var _isTransformer=function _isTransformer(obj){return typeof obj["@@transducer/step"]==="function"};var _dispatchable=function _dispatchable(methodNames,xf,fn){return function(){if(arguments.length===0){return fn()}var args=Array.prototype.slice.call(arguments,0);var obj=args.pop();if(!_isArray(obj)){var idx=0;while(idx<methodNames.length){if(typeof obj[methodNames[idx]]==="function"){return obj[methodNames[idx]].apply(obj,args)}idx+=1}if(_isTransformer(obj)){var transducer=xf.apply(null,args);return transducer(obj)}}return fn.apply(this,arguments)}};var _reduced=function _reduced(x){return x&&x["@@transducer/reduced"]?x:{"@@transducer/value":x,"@@transducer/reduced":true}};var _xfBase={init:function(){return this.xf["@@transducer/init"]()},result:function(result){return this.xf["@@transducer/result"](result)}};var _xall=function(){function XAll(f,xf){this.xf=xf;this.f=f;this.all=true}XAll.prototype["@@transducer/init"]=_xfBase.init;XAll.prototype["@@transducer/result"]=function(result){if(this.all){result=this.xf["@@transducer/step"](result,true)}return this.xf["@@transducer/result"](result)};XAll.prototype["@@transducer/step"]=function(result,input){if(!this.f(input)){this.all=false;result=_reduced(this.xf["@@transducer/step"](result,false))}return result};return _curry2(function _xall(f,xf){return new XAll(f,xf)})}();var all=_curry2(_dispatchable(["all"],_xall,function all(fn,list){var idx=0;while(idx<list.length){if(!fn(list[idx])){return false}idx+=1}return true}));var max=_curry2(function max(a,b){return b>a?b:a});var _map=function _map(fn,functor){var idx=0;var len=functor.length;var result=Array(len);while(idx<len){result[idx]=fn(functor[idx]);idx+=1}return result};var _xwrap=function(){function XWrap(fn){this.f=fn}XWrap.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")};XWrap.prototype["@@transducer/result"]=function(acc){return acc};XWrap.prototype["@@transducer/step"]=function(acc,x){return this.f(acc,x)};return function _xwrap(fn){return new XWrap(fn)}}();var bind=_curry2(function bind(fn,thisObj){return _arity(fn.length,function(){return fn.apply(thisObj,arguments)})});var _isString=function _isString(x){return Object.prototype.toString.call(x)==="[object String]"};var isArrayLike=_curry1(function isArrayLike(x){if(_isArray(x)){return true}if(!x){return false}if(typeof x!=="object"){return false}if(_isString(x)){return false}if(x.nodeType===1){return!!x.length}if(x.length===0){return true}if(x.length>0){return x.hasOwnProperty(0)&&x.hasOwnProperty(x.length-1)}return false});var _reduce=function(){function _arrayReduce(xf,acc,list){var idx=0;var len=list.length;while(idx<len){acc=xf["@@transducer/step"](acc,list[idx]);if(acc&&acc["@@transducer/reduced"]){acc=acc["@@transducer/value"];break}idx+=1}return xf["@@transducer/result"](acc)}function _iterableReduce(xf,acc,iter){var step=iter.next();while(!step.done){acc=xf["@@transducer/step"](acc,step.value);if(acc&&acc["@@transducer/reduced"]){acc=acc["@@transducer/value"];break}step=iter.next()}return xf["@@transducer/result"](acc)}function _methodReduce(xf,acc,obj){return xf["@@transducer/result"](obj.reduce(bind(xf["@@transducer/step"],xf),acc))}var symIterator=typeof Symbol!=="undefined"?Symbol.iterator:"@@iterator";return function _reduce(fn,acc,list){if(typeof fn==="function"){fn=_xwrap(fn)}if(isArrayLike(list)){return _arrayReduce(fn,acc,list)}if(typeof list.reduce==="function"){return _methodReduce(fn,acc,list)}if(list[symIterator]!=null){return _iterableReduce(fn,acc,list[symIterator]())}if(typeof list.next==="function"){return _iterableReduce(fn,acc,list)}throw new TypeError("reduce: list must be array or iterable")}}();var _xmap=function(){function XMap(f,xf){this.xf=xf;this.f=f}XMap.prototype["@@transducer/init"]=_xfBase.init;XMap.prototype["@@transducer/result"]=_xfBase.result;XMap.prototype["@@transducer/step"]=function(result,input){return this.xf["@@transducer/step"](result,this.f(input))};return _curry2(function _xmap(f,xf){return new XMap(f,xf)})}();var _has=function _has(prop,obj){return Object.prototype.hasOwnProperty.call(obj,prop)};var _isArguments=function(){var toString=Object.prototype.toString;return toString.call(arguments)==="[object Arguments]"?function _isArguments(x){return toString.call(x)==="[object Arguments]"}:function _isArguments(x){return _has("callee",x)}}();var keys=function(){var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];var hasArgsEnumBug=function(){"use strict";return arguments.propertyIsEnumerable("length")}();var contains=function contains(list,item){var idx=0;while(idx<list.length){if(list[idx]===item){return true}idx+=1}return false};return typeof Object.keys==="function"&&!hasArgsEnumBug?_curry1(function keys(obj){return Object(obj)!==obj?[]:Object.keys(obj)}):_curry1(function keys(obj){if(Object(obj)!==obj){return[]}var prop,nIdx;var ks=[];var checkArgsLength=hasArgsEnumBug&&_isArguments(obj);for(prop in obj){if(_has(prop,obj)&&(!checkArgsLength||prop!=="length")){ks[ks.length]=prop}}if(hasEnumBug){nIdx=nonEnumerableProps.length-1;while(nIdx>=0){prop=nonEnumerableProps[nIdx];if(_has(prop,obj)&&!contains(ks,prop)){ks[ks.length]=prop}nIdx-=1}}return ks})}();var map=_curry2(_dispatchable(["map"],_xmap,function map(fn,functor){switch(Object.prototype.toString.call(functor)){case"[object Function]":return curryN(functor.length,function(){return fn.call(this,functor.apply(this,arguments))});case"[object Object]":return _reduce(function(acc,key){acc[key]=fn(functor[key]);return acc},{},keys(functor));default:return _map(fn,functor)}}));var prop=_curry2(function prop(p,obj){return obj[p]});var pluck=_curry2(function pluck(p,list){return map(prop(p),list)});var reduce=_curry3(_reduce);var allPass=_curry1(function allPass(preds){return curryN(reduce(max,0,pluck("length",preds)),function(){var arguments$1=arguments;var this$1=this;var idx=0;var len=preds.length;while(idx<len){if(!preds[idx].apply(this$1,arguments$1)){return false}idx+=1}return true})});var and=_curry2(function and(a,b){return a&&b});var _xany=function(){function XAny(f,xf){this.xf=xf;this.f=f;this.any=false}XAny.prototype["@@transducer/init"]=_xfBase.init;XAny.prototype["@@transducer/result"]=function(result){if(!this.any){result=this.xf["@@transducer/step"](result,false)}return this.xf["@@transducer/result"](result)};XAny.prototype["@@transducer/step"]=function(result,input){if(this.f(input)){this.any=true;result=_reduced(this.xf["@@transducer/step"](result,true))}return result};return _curry2(function _xany(f,xf){return new XAny(f,xf)})}();var any=_curry2(_dispatchable(["any"],_xany,function any(fn,list){var idx=0;while(idx<list.length){if(fn(list[idx])){return true}idx+=1}return false}));var anyPass=_curry1(function anyPass(preds){return curryN(reduce(max,0,pluck("length",preds)),function(){var arguments$1=arguments;var this$1=this;var idx=0;var len=preds.length;while(idx<len){if(preds[idx].apply(this$1,arguments$1)){return true}idx+=1}return false})});var ap=_curry2(function ap(applicative,fn){return typeof applicative.ap==="function"?applicative.ap(fn):typeof applicative==="function"?function(x){return applicative(x)(fn(x))}:_reduce(function(acc,f){return _concat(acc,map(f,fn))},[],applicative)});var _aperture=function _aperture(n,list){var idx=0;var limit=list.length-(n-1);var acc=new Array(limit>=0?limit:0);while(idx<limit){acc[idx]=Array.prototype.slice.call(list,idx,idx+n);idx+=1}return acc};var _xaperture=function(){function XAperture(n,xf){this.xf=xf;this.pos=0;this.full=false;this.acc=new Array(n)}XAperture.prototype["@@transducer/init"]=_xfBase.init;XAperture.prototype["@@transducer/result"]=function(result){this.acc=null;return this.xf["@@transducer/result"](result)};XAperture.prototype["@@transducer/step"]=function(result,input){this.store(input);return this.full?this.xf["@@transducer/step"](result,this.getCopy()):result};XAperture.prototype.store=function(input){this.acc[this.pos]=input;this.pos+=1;if(this.pos===this.acc.length){this.pos=0;this.full=true}};XAperture.prototype.getCopy=function(){return _concat(Array.prototype.slice.call(this.acc,this.pos),Array.prototype.slice.call(this.acc,0,this.pos))};return _curry2(function _xaperture(n,xf){return new XAperture(n,xf)})}();var aperture=_curry2(_dispatchable([],_xaperture,_aperture));var append$1=_curry2(function append(el,list){return _concat(list,[el])});var apply=_curry2(function apply(fn,args){return fn.apply(this,args)});var values=_curry1(function values(obj){var props=keys(obj);var len=props.length;var vals=[];var idx=0;while(idx<len){vals[idx]=obj[props[idx]];idx+=1}return vals});var applySpec=_curry1(function applySpec(spec){spec=map(function(v){return typeof v=="function"?v:applySpec(v)},spec);return curryN(reduce(max,0,pluck("length",values(spec))),function(){var args=arguments;return map(function(f){return apply(f,args)},spec)})});var ascend=_curry3(function ascend(fn,a,b){var aa=fn(a);var bb=fn(b);return aa<bb?-1:aa>bb?1:0});var assoc=_curry3(function assoc(prop,val,obj){var result={};for(var p in obj){result[p]=obj[p]}result[prop]=val;return result});var _isInteger=Number.isInteger||function _isInteger(n){return n<<0===n};var assocPath=_curry3(function assocPath(path,val,obj){if(path.length===0){return val}var idx=path[0];if(path.length>1){var nextObj=_has(idx,obj)?obj[idx]:_isInteger(path[1])?[]:{};val=assocPath(Array.prototype.slice.call(path,1),val,nextObj)}if(_isInteger(idx)&&_isArray(obj)){var arr=[].concat(obj);arr[idx]=val;return arr}else{return assoc(idx,val,obj)}});var nAry=_curry2(function nAry(n,fn){switch(n){case 0:return function(){return fn.call(this)};case 1:return function(a0){return fn.call(this,a0)};case 2:return function(a0,a1){return fn.call(this,a0,a1)};case 3:return function(a0,a1,a2){return fn.call(this,a0,a1,a2)};case 4:return function(a0,a1,a2,a3){return fn.call(this,a0,a1,a2,a3)};case 5:return function(a0,a1,a2,a3,a4){return fn.call(this,a0,a1,a2,a3,a4)};case 6:return function(a0,a1,a2,a3,a4,a5){return fn.call(this,a0,a1,a2,a3,a4,a5)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){return fn.call(this,a0,a1,a2,a3,a4,a5,a6)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7);
};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}});var binary=_curry1(function binary(fn){return nAry(2,fn)});var _isFunction=function _isFunction(x){return Object.prototype.toString.call(x)==="[object Function]"};var liftN=_curry2(function liftN(arity,fn){var lifted=curryN(arity,fn);return curryN(arity,function(){return _reduce(ap,map(lifted,arguments[0]),Array.prototype.slice.call(arguments,1))})});var lift=_curry1(function lift(fn){return liftN(fn.length,fn)});var both=_curry2(function both(f,g){return _isFunction(f)?function _both(){return f.apply(this,arguments)&&g.apply(this,arguments)}:lift(and)(f,g)});var curry=_curry1(function curry(fn){return curryN(fn.length,fn)});var call=curry(function call(fn){return fn.apply(this,Array.prototype.slice.call(arguments,1))});var _makeFlat=function _makeFlat(recursive){return function flatt(list){var value,jlen,j;var result=[];var idx=0;var ilen=list.length;while(idx<ilen){if(isArrayLike(list[idx])){value=recursive?flatt(list[idx]):list[idx];j=0;jlen=value.length;while(j<jlen){result[result.length]=value[j];j+=1}}else{result[result.length]=list[idx]}idx+=1}return result}};var _forceReduced=function _forceReduced(x){return{"@@transducer/value":x,"@@transducer/reduced":true}};var _flatCat=function(){var preservingReduced=function(xf){return{"@@transducer/init":_xfBase.init,"@@transducer/result":function(result){return xf["@@transducer/result"](result)},"@@transducer/step":function(result,input){var ret=xf["@@transducer/step"](result,input);return ret["@@transducer/reduced"]?_forceReduced(ret):ret}}};return function _xcat(xf){var rxf=preservingReduced(xf);return{"@@transducer/init":_xfBase.init,"@@transducer/result":function(result){return rxf["@@transducer/result"](result)},"@@transducer/step":function(result,input){return!isArrayLike(input)?_reduce(rxf,result,[input]):_reduce(rxf,result,input)}}}}();var _xchain=_curry2(function _xchain(f,xf){return map(f,_flatCat(xf))});var chain=_curry2(_dispatchable(["chain"],_xchain,function chain(fn,monad){if(typeof monad==="function"){return function(x){return fn(monad(x))(x)}}return _makeFlat(false)(map(fn,monad))}));var clamp=_curry3(function clamp(min,max,value){if(min>max){throw new Error("min must not be greater than max in clamp(min, max, value)")}return value<min?min:value>max?max:value});var _cloneRegExp=function _cloneRegExp(pattern){return new RegExp(pattern.source,(pattern.global?"g":"")+(pattern.ignoreCase?"i":"")+(pattern.multiline?"m":"")+(pattern.sticky?"y":"")+(pattern.unicode?"u":""))};var type=_curry1(function type(val){return val===null?"Null":val===undefined?"Undefined":Object.prototype.toString.call(val).slice(8,-1)});var _clone=function _clone(value,refFrom,refTo,deep){var copy=function copy(copiedValue){var len=refFrom.length;var idx=0;while(idx<len){if(value===refFrom[idx]){return refTo[idx]}idx+=1}refFrom[idx+1]=value;refTo[idx+1]=copiedValue;for(var key in value){copiedValue[key]=deep?_clone(value[key],refFrom,refTo,true):value[key]}return copiedValue};switch(type(value)){case"Object":return copy({});case"Array":return copy([]);case"Date":return new Date(value.valueOf());case"RegExp":return _cloneRegExp(value);default:return value}};var clone=_curry1(function clone(value){return value!=null&&typeof value.clone==="function"?value.clone():_clone(value,[],[],true)});var comparator=_curry1(function comparator(pred){return function(a,b){return pred(a,b)?-1:pred(b,a)?1:0}});var not=_curry1(function not(a){return!a});var complement=lift(not);var _pipe=function _pipe(f,g){return function(){return g.call(this,f.apply(this,arguments))}};var _checkForMethod=function _checkForMethod(methodname,fn){return function(){var length=arguments.length;if(length===0){return fn()}var obj=arguments[length-1];return _isArray(obj)||typeof obj[methodname]!=="function"?fn.apply(this,arguments):obj[methodname].apply(obj,Array.prototype.slice.call(arguments,0,length-1))}};var slice=_curry3(_checkForMethod("slice",function slice(fromIndex,toIndex,list){return Array.prototype.slice.call(list,fromIndex,toIndex)}));var tail=_curry1(_checkForMethod("tail",slice(1,Infinity)));var pipe=function pipe(){if(arguments.length===0){throw new Error("pipe requires at least one argument")}return _arity(arguments[0].length,reduce(_pipe,arguments[0],tail(arguments)))};var reverse=_curry1(function reverse(list){return _isString(list)?list.split("").reverse().join(""):Array.prototype.slice.call(list,0).reverse()});var compose=function compose(){if(arguments.length===0){throw new Error("compose requires at least one argument")}return pipe.apply(this,reverse(arguments))};var composeK=function composeK(){if(arguments.length===0){throw new Error("composeK requires at least one argument")}var init=Array.prototype.slice.call(arguments);var last=init.pop();return compose(compose.apply(this,map(chain,init)),last)};var _pipeP=function _pipeP(f,g){return function(){var ctx=this;return f.apply(ctx,arguments).then(function(x){return g.call(ctx,x)})}};var pipeP=function pipeP(){if(arguments.length===0){throw new Error("pipeP requires at least one argument")}return _arity(arguments[0].length,reduce(_pipeP,arguments[0],tail(arguments)))};var composeP=function composeP(){if(arguments.length===0){throw new Error("composeP requires at least one argument")}return pipeP.apply(this,reverse(arguments))};var _arrayFromIterator=function _arrayFromIterator(iter){var list=[];var next;while(!(next=iter.next()).done){list.push(next.value)}return list};var _functionName=function _functionName(f){var match=String(f).match(/^function (\w*)/);return match==null?"":match[1]};var identical=_curry2(function identical(a,b){if(a===b){return a!==0||1/a===1/b}else{return a!==a&&b!==b}});var _equals=function _equals(a,b,stackA,stackB){if(identical(a,b)){return true}if(type(a)!==type(b)){return false}if(a==null||b==null){return false}if(typeof a.equals==="function"||typeof b.equals==="function"){return typeof a.equals==="function"&&a.equals(b)&&typeof b.equals==="function"&&b.equals(a)}switch(type(a)){case"Arguments":case"Array":case"Object":if(typeof a.constructor==="function"&&_functionName(a.constructor)==="Promise"){return a===b}break;case"Boolean":case"Number":case"String":if(!(typeof a===typeof b&&identical(a.valueOf(),b.valueOf()))){return false}break;case"Date":if(!identical(a.valueOf(),b.valueOf())){return false}break;case"Error":return a.name===b.name&&a.message===b.message;case"RegExp":if(!(a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline&&a.sticky===b.sticky&&a.unicode===b.unicode)){return false}break;case"Map":case"Set":if(!_equals(_arrayFromIterator(a.entries()),_arrayFromIterator(b.entries()),stackA,stackB)){return false}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":break;case"ArrayBuffer":break;default:return false}var keysA=keys(a);if(keysA.length!==keys(b).length){return false}var idx=stackA.length-1;while(idx>=0){if(stackA[idx]===a){return stackB[idx]===b}idx-=1}stackA.push(a);stackB.push(b);idx=keysA.length-1;while(idx>=0){var key=keysA[idx];if(!(_has(key,b)&&_equals(b[key],a[key],stackA,stackB))){return false}idx-=1}stackA.pop();stackB.pop();return true};var equals=_curry2(function equals(a,b){return _equals(a,b,[],[])});var _indexOf=function _indexOf(list,a,idx){var inf,item;if(typeof list.indexOf==="function"){switch(typeof a){case"number":if(a===0){inf=1/a;while(idx<list.length){item=list[idx];if(item===0&&1/item===inf){return idx}idx+=1}return-1}else if(a!==a){while(idx<list.length){item=list[idx];if(typeof item==="number"&&item!==item){return idx}idx+=1}return-1}return list.indexOf(a,idx);case"string":case"boolean":case"function":case"undefined":return list.indexOf(a,idx);case"object":if(a===null){return list.indexOf(a,idx)}}}while(idx<list.length){if(equals(list[idx],a)){return idx}idx+=1}return-1};var _contains=function _contains(a,list){return _indexOf(list,a,0)>=0};var _quote=function _quote(s){var escaped=s.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+escaped.replace(/"/g,'\\"')+'"'};var _toISOString=function(){var pad=function pad(n){return(n<10?"0":"")+n};return typeof Date.prototype.toISOString==="function"?function _toISOString(d){return d.toISOString()}:function _toISOString(d){return d.getUTCFullYear()+"-"+pad(d.getUTCMonth()+1)+"-"+pad(d.getUTCDate())+"T"+pad(d.getUTCHours())+":"+pad(d.getUTCMinutes())+":"+pad(d.getUTCSeconds())+"."+(d.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}();var _complement=function _complement(f){return function(){return!f.apply(this,arguments)}};var _filter=function _filter(fn,list){var idx=0;var len=list.length;var result=[];while(idx<len){if(fn(list[idx])){result[result.length]=list[idx]}idx+=1}return result};var _isObject=function _isObject(x){return Object.prototype.toString.call(x)==="[object Object]"};var _xfilter=function(){function XFilter(f,xf){this.xf=xf;this.f=f}XFilter.prototype["@@transducer/init"]=_xfBase.init;XFilter.prototype["@@transducer/result"]=_xfBase.result;XFilter.prototype["@@transducer/step"]=function(result,input){return this.f(input)?this.xf["@@transducer/step"](result,input):result};return _curry2(function _xfilter(f,xf){return new XFilter(f,xf)})}();var filter=_curry2(_dispatchable(["filter"],_xfilter,function(pred,filterable){return _isObject(filterable)?_reduce(function(acc,key){if(pred(filterable[key])){acc[key]=filterable[key]}return acc},{},keys(filterable)):_filter(pred,filterable)}));var reject=_curry2(function reject(pred,filterable){return filter(_complement(pred),filterable)});var _toString=function _toString(x,seen){var recur=function recur(y){var xs=seen.concat([x]);return _contains(y,xs)?"<Circular>":_toString(y,xs)};var mapPairs=function(obj,keys$$1){return _map(function(k){return _quote(k)+": "+recur(obj[k])},keys$$1.slice().sort())};switch(Object.prototype.toString.call(x)){case"[object Arguments]":return"(function() { return arguments; }("+_map(recur,x).join(", ")+"))";case"[object Array]":return"["+_map(recur,x).concat(mapPairs(x,reject(function(k){return/^\d+$/.test(k)},keys(x)))).join(", ")+"]";case"[object Boolean]":return typeof x==="object"?"new Boolean("+recur(x.valueOf())+")":x.toString();case"[object Date]":return"new Date("+(isNaN(x.valueOf())?recur(NaN):_quote(_toISOString(x)))+")";case"[object Null]":return"null";case"[object Number]":return typeof x==="object"?"new Number("+recur(x.valueOf())+")":1/x===-Infinity?"-0":x.toString(10);case"[object String]":return typeof x==="object"?"new String("+recur(x.valueOf())+")":_quote(x);case"[object Undefined]":return"undefined";default:if(typeof x.toString==="function"){var repr=x.toString();if(repr!=="[object Object]"){return repr}}return"{"+mapPairs(x,keys(x)).join(", ")+"}"}};var toString_1=_curry1(function toString(val){return _toString(val,[])});var concat=_curry2(function concat(a,b){if(a==null||!_isFunction(a.concat)){throw new TypeError(toString_1(a)+' does not have a method named "concat"')}if(_isArray(a)&&!_isArray(b)){throw new TypeError(toString_1(b)+" is not an array")}return a.concat(b)});var cond=_curry1(function cond(pairs){var arity=reduce(max,0,map(function(pair){return pair[0].length},pairs));return _arity(arity,function(){var arguments$1=arguments;var this$1=this;var idx=0;while(idx<pairs.length){if(pairs[idx][0].apply(this$1,arguments$1)){return pairs[idx][1].apply(this$1,arguments$1)}idx+=1}})});var constructN=_curry2(function constructN(n,Fn){if(n>10){throw new Error("Constructor with greater than ten arguments")}if(n===0){return function(){return new Fn}}return curry(nAry(n,function($0,$1,$2,$3,$4,$5,$6,$7,$8,$9){switch(arguments.length){case 1:return new Fn($0);case 2:return new Fn($0,$1);case 3:return new Fn($0,$1,$2);case 4:return new Fn($0,$1,$2,$3);case 5:return new Fn($0,$1,$2,$3,$4);case 6:return new Fn($0,$1,$2,$3,$4,$5);case 7:return new Fn($0,$1,$2,$3,$4,$5,$6);case 8:return new Fn($0,$1,$2,$3,$4,$5,$6,$7);case 9:return new Fn($0,$1,$2,$3,$4,$5,$6,$7,$8);case 10:return new Fn($0,$1,$2,$3,$4,$5,$6,$7,$8,$9)}}))});var construct=_curry1(function construct(Fn){return constructN(Fn.length,Fn)});var contains$1=_curry2(_contains);var converge=_curry2(function converge(after,fns){return curryN(reduce(max,0,pluck("length",fns)),function(){var args=arguments;var context=this;return after.apply(context,_map(function(fn){return fn.apply(context,args)},fns))})});var _xreduceBy=function(){function XReduceBy(valueFn,valueAcc,keyFn,xf){this.valueFn=valueFn;this.valueAcc=valueAcc;this.keyFn=keyFn;this.xf=xf;this.inputs={}}XReduceBy.prototype["@@transducer/init"]=_xfBase.init;XReduceBy.prototype["@@transducer/result"]=function(result){var this$1=this;var key;for(key in this$1.inputs){if(_has(key,this$1.inputs)){result=this$1.xf["@@transducer/step"](result,this$1.inputs[key]);if(result["@@transducer/reduced"]){result=result["@@transducer/value"];break}}}this.inputs=null;return this.xf["@@transducer/result"](result)};XReduceBy.prototype["@@transducer/step"]=function(result,input){var key=this.keyFn(input);this.inputs[key]=this.inputs[key]||[key,this.valueAcc];this.inputs[key][1]=this.valueFn(this.inputs[key][1],input);return result};return _curryN(4,[],function _xreduceBy(valueFn,valueAcc,keyFn,xf){return new XReduceBy(valueFn,valueAcc,keyFn,xf)})}();var reduceBy=_curryN(4,[],_dispatchable([],_xreduceBy,function reduceBy(valueFn,valueAcc,keyFn,list){return _reduce(function(acc,elt){var key=keyFn(elt);acc[key]=valueFn(_has(key,acc)?acc[key]:valueAcc,elt);return acc},{},list)}));var countBy=reduceBy(function(acc,elem){return acc+1},0);var dec=add(-1);var descend=_curry3(function descend(fn,a,b){var aa=fn(a);var bb=fn(b);return aa>bb?-1:aa<bb?1:0});var defaultTo=_curry2(function defaultTo(d,v){return v==null||v!==v?d:v});var difference=_curry2(function difference(first,second){var out=[];var idx=0;var firstLen=first.length;while(idx<firstLen){if(!_contains(first[idx],second)&&!_contains(first[idx],out)){out[out.length]=first[idx]}idx+=1}return out});var _containsWith=function _containsWith(pred,x,list){var idx=0;var len=list.length;while(idx<len){if(pred(x,list[idx])){return true}idx+=1}return false};var differenceWith=_curry3(function differenceWith(pred,first,second){var out=[];var idx=0;var firstLen=first.length;while(idx<firstLen){if(!_containsWith(pred,first[idx],second)&&!_containsWith(pred,first[idx],out)){out.push(first[idx])}idx+=1}return out});var dissoc=_curry2(function dissoc(prop,obj){var result={};for(var p in obj){result[p]=obj[p]}delete result[prop];return result});var dissocPath=_curry2(function dissocPath(path,obj){switch(path.length){case 0:return obj;case 1:return dissoc(path[0],obj);default:var head=path[0];var tail=Array.prototype.slice.call(path,1);return obj[head]==null?obj:assoc(head,dissocPath(tail,obj[head]),obj)}});var divide=_curry2(function divide(a,b){return a/b});var _xdrop=function(){function XDrop(n,xf){this.xf=xf;this.n=n}XDrop.prototype["@@transducer/init"]=_xfBase.init;XDrop.prototype["@@transducer/result"]=_xfBase.result;XDrop.prototype["@@transducer/step"]=function(result,input){if(this.n>0){this.n-=1;return result}return this.xf["@@transducer/step"](result,input)};return _curry2(function _xdrop(n,xf){return new XDrop(n,xf)})}();var drop=_curry2(_dispatchable(["drop"],_xdrop,function drop(n,xs){return slice(Math.max(0,n),Infinity,xs)}));var _xtake=function(){function XTake(n,xf){this.xf=xf;this.n=n;this.i=0}XTake.prototype["@@transducer/init"]=_xfBase.init;XTake.prototype["@@transducer/result"]=_xfBase.result;XTake.prototype["@@transducer/step"]=function(result,input){this.i+=1;var ret=this.n===0?result:this.xf["@@transducer/step"](result,input);return this.i>=this.n?_reduced(ret):ret};return _curry2(function _xtake(n,xf){return new XTake(n,xf)})}();var take=_curry2(_dispatchable(["take"],_xtake,function take(n,xs){return slice(0,n<0?Infinity:n,xs)}));var _dropLast=function dropLast(n,xs){return take(n<xs.length?xs.length-n:0,xs)};var _xdropLast=function(){function XDropLast(n,xf){this.xf=xf;this.pos=0;this.full=false;this.acc=new Array(n)}XDropLast.prototype["@@transducer/init"]=_xfBase.init;XDropLast.prototype["@@transducer/result"]=function(result){this.acc=null;return this.xf["@@transducer/result"](result)};XDropLast.prototype["@@transducer/step"]=function(result,input){if(this.full){result=this.xf["@@transducer/step"](result,this.acc[this.pos])}this.store(input);return result};XDropLast.prototype.store=function(input){this.acc[this.pos]=input;this.pos+=1;if(this.pos===this.acc.length){this.pos=0;this.full=true}};return _curry2(function _xdropLast(n,xf){return new XDropLast(n,xf)})}();var dropLast=_curry2(_dispatchable([],_xdropLast,_dropLast));var _dropLastWhile=function dropLastWhile(pred,list){var idx=list.length-1;while(idx>=0&&pred(list[idx])){idx-=1}return Array.prototype.slice.call(list,0,idx+1)};var _xdropLastWhile=function(){function XDropLastWhile(fn,xf){this.f=fn;this.retained=[];this.xf=xf}XDropLastWhile.prototype["@@transducer/init"]=_xfBase.init;XDropLastWhile.prototype["@@transducer/result"]=function(result){this.retained=null;return this.xf["@@transducer/result"](result)};XDropLastWhile.prototype["@@transducer/step"]=function(result,input){return this.f(input)?this.retain(result,input):this.flush(result,input)};XDropLastWhile.prototype.flush=function(result,input){result=_reduce(this.xf["@@transducer/step"],result,this.retained);this.retained=[];return this.xf["@@transducer/step"](result,input)};XDropLastWhile.prototype.retain=function(result,input){this.retained.push(input);return result};return _curry2(function _xdropLastWhile(fn,xf){return new XDropLastWhile(fn,xf)})}();var dropLastWhile=_curry2(_dispatchable([],_xdropLastWhile,_dropLastWhile));var _xdropRepeatsWith=function(){function XDropRepeatsWith(pred,xf){this.xf=xf;this.pred=pred;this.lastValue=undefined;this.seenFirstValue=false}XDropRepeatsWith.prototype["@@transducer/init"]=_xfBase.init;XDropRepeatsWith.prototype["@@transducer/result"]=_xfBase.result;XDropRepeatsWith.prototype["@@transducer/step"]=function(result,input){var sameAsLast=false;if(!this.seenFirstValue){this.seenFirstValue=true}else if(this.pred(this.lastValue,input)){sameAsLast=true}this.lastValue=input;return sameAsLast?result:this.xf["@@transducer/step"](result,input)};return _curry2(function _xdropRepeatsWith(pred,xf){return new XDropRepeatsWith(pred,xf)})}();var nth=_curry2(function nth(offset,list){var idx=offset<0?list.length+offset:offset;return _isString(list)?list.charAt(idx):list[idx]});var last=nth(-1);var dropRepeatsWith=_curry2(_dispatchable([],_xdropRepeatsWith,function dropRepeatsWith(pred,list){var result=[];var idx=1;var len=list.length;if(len!==0){result[0]=list[0];while(idx<len){if(!pred(last(result),list[idx])){result[result.length]=list[idx]}idx+=1}}return result}));var dropRepeats=_curry1(_dispatchable([],_xdropRepeatsWith(equals),dropRepeatsWith(equals)));var _xdropWhile=function(){function XDropWhile(f,xf){this.xf=xf;this.f=f}XDropWhile.prototype["@@transducer/init"]=_xfBase.init;XDropWhile.prototype["@@transducer/result"]=_xfBase.result;XDropWhile.prototype["@@transducer/step"]=function(result,input){if(this.f){if(this.f(input)){return result}this.f=null}return this.xf["@@transducer/step"](result,input)};return _curry2(function _xdropWhile(f,xf){return new XDropWhile(f,xf)})}();var dropWhile=_curry2(_dispatchable(["dropWhile"],_xdropWhile,function dropWhile(pred,list){var idx=0;var len=list.length;while(idx<len&&pred(list[idx])){idx+=1}return Array.prototype.slice.call(list,idx)}));var or=_curry2(function or(a,b){return a||b});var either=_curry2(function either(f,g){return _isFunction(f)?function _either(){return f.apply(this,arguments)||g.apply(this,arguments)}:lift(or)(f,g)});var empty=_curry1(function empty(x){return x!=null&&typeof x.empty==="function"?x.empty():x!=null&&x.constructor!=null&&typeof x.constructor.empty==="function"?x.constructor.empty():_isArray(x)?[]:_isString(x)?"":_isObject(x)?{}:_isArguments(x)?function(){return arguments}():void 0});var eqBy=_curry3(function eqBy(f,x,y){return equals(f(x),f(y))});var eqProps=_curry3(function eqProps(prop,obj1,obj2){return equals(obj1[prop],obj2[prop])});var evolve=_curry2(function evolve(transformations,object){var result={};var transformation,key,type;for(key in object){transformation=transformations[key];type=typeof transformation;result[key]=type==="function"?transformation(object[key]):transformation&&type==="object"?evolve(transformation,object[key]):object[key]}return result});var _xfind=function(){function XFind(f,xf){this.xf=xf;this.f=f;this.found=false}XFind.prototype["@@transducer/init"]=_xfBase.init;XFind.prototype["@@transducer/result"]=function(result){if(!this.found){result=this.xf["@@transducer/step"](result,void 0)}return this.xf["@@transducer/result"](result)};XFind.prototype["@@transducer/step"]=function(result,input){if(this.f(input)){this.found=true;result=_reduced(this.xf["@@transducer/step"](result,input))}return result};return _curry2(function _xfind(f,xf){return new XFind(f,xf)})}();var find=_curry2(_dispatchable(["find"],_xfind,function find(fn,list){var idx=0;var len=list.length;while(idx<len){if(fn(list[idx])){return list[idx]}idx+=1}}));var _xfindIndex=function(){function XFindIndex(f,xf){this.xf=xf;this.f=f;this.idx=-1;this.found=false}XFindIndex.prototype["@@transducer/init"]=_xfBase.init;XFindIndex.prototype["@@transducer/result"]=function(result){if(!this.found){result=this.xf["@@transducer/step"](result,-1)}return this.xf["@@transducer/result"](result)};XFindIndex.prototype["@@transducer/step"]=function(result,input){this.idx+=1;if(this.f(input)){this.found=true;result=_reduced(this.xf["@@transducer/step"](result,this.idx))}return result};return _curry2(function _xfindIndex(f,xf){return new XFindIndex(f,xf)})}();var findIndex=_curry2(_dispatchable([],_xfindIndex,function findIndex(fn,list){var idx=0;var len=list.length;while(idx<len){if(fn(list[idx])){return idx}idx+=1}return-1}));var _xfindLast=function(){function XFindLast(f,xf){this.xf=xf;this.f=f}XFindLast.prototype["@@transducer/init"]=_xfBase.init;XFindLast.prototype["@@transducer/result"]=function(result){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](result,this.last))};XFindLast.prototype["@@transducer/step"]=function(result,input){if(this.f(input)){this.last=input}return result};return _curry2(function _xfindLast(f,xf){return new XFindLast(f,xf)})}();var findLast=_curry2(_dispatchable([],_xfindLast,function findLast(fn,list){var idx=list.length-1;while(idx>=0){if(fn(list[idx])){return list[idx]}idx-=1}}));var _xfindLastIndex=function(){function XFindLastIndex(f,xf){this.xf=xf;this.f=f;this.idx=-1;this.lastIdx=-1}XFindLastIndex.prototype["@@transducer/init"]=_xfBase.init;XFindLastIndex.prototype["@@transducer/result"]=function(result){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](result,this.lastIdx))};XFindLastIndex.prototype["@@transducer/step"]=function(result,input){this.idx+=1;if(this.f(input)){this.lastIdx=this.idx}return result};return _curry2(function _xfindLastIndex(f,xf){return new XFindLastIndex(f,xf)})}();var findLastIndex=_curry2(_dispatchable([],_xfindLastIndex,function findLastIndex(fn,list){var idx=list.length-1;while(idx>=0){if(fn(list[idx])){return idx}idx-=1}return-1}));var flatten=_curry1(_makeFlat(true));var flip=_curry1(function flip(fn){return curry(function(a,b){var args=Array.prototype.slice.call(arguments,0);args[0]=b;args[1]=a;return fn.apply(this,args)})});var forEach=_curry2(_checkForMethod("forEach",function forEach(fn,list){var len=list.length;var idx=0;while(idx<len){fn(list[idx]);idx+=1}return list}));var forEachObjIndexed=_curry2(function forEachObjIndexed(fn,obj){var keyList=keys(obj);var idx=0;while(idx<keyList.length){var key=keyList[idx];fn(obj[key],key,obj);idx+=1}return obj});var fromPairs=_curry1(function fromPairs(pairs){var result={};var idx=0;while(idx<pairs.length){result[pairs[idx][0]]=pairs[idx][1];idx+=1}return result});var groupBy=_curry2(_checkForMethod("groupBy",reduceBy(function(acc,item){if(acc==null){acc=[]}acc.push(item);return acc},null)));var groupWith=_curry2(function(fn,list){var res=[];var idx=0;var len=list.length;while(idx<len){var nextidx=idx+1;while(nextidx<len&&fn(list[idx],list[nextidx])){nextidx+=1}res.push(list.slice(idx,nextidx));idx=nextidx}return res});var gt=_curry2(function gt(a,b){return a>b});var gte=_curry2(function gte(a,b){return a>=b});var has=_curry2(_has);var hasIn=_curry2(function hasIn(prop,obj){return prop in obj});var head=nth(0);var _identity=function _identity(x){return x};var identity=_curry1(_identity);var ifElse=_curry3(function ifElse(condition,onTrue,onFalse){return curryN(Math.max(condition.length,onTrue.length,onFalse.length),function _ifElse(){return condition.apply(this,arguments)?onTrue.apply(this,arguments):onFalse.apply(this,arguments)})});var inc=add(1);var indexBy=reduceBy(function(acc,elem){return elem},null);var indexOf=_curry2(function indexOf(target,xs){return typeof xs.indexOf==="function"&&!_isArray(xs)?xs.indexOf(target):_indexOf(xs,target,0)});var init=slice(0,-1);var insert$1=_curry3(function insert(idx,elt,list){idx=idx<list.length&&idx>=0?idx:list.length;var result=Array.prototype.slice.call(list,0);result.splice(idx,0,elt);return result});var insertAll=_curry3(function insertAll(idx,elts,list){idx=idx<list.length&&idx>=0?idx:list.length;return[].concat(Array.prototype.slice.call(list,0,idx),elts,Array.prototype.slice.call(list,idx))});var _Set=function(){function _Set(){this._nativeSet=typeof Set==="function"?new Set:null;this._items={}}_Set.prototype.add=function(item){return!hasOrAdd(item,true,this)};_Set.prototype.has=function(item){return hasOrAdd(item,false,this)};function hasOrAdd(item,shouldAdd,set){var type=typeof item;var prevSize,newSize;switch(type){case"string":case"number":if(item===0&&1/item===-Infinity){if(set._items["-0"]){return true}else{if(shouldAdd){set._items["-0"]=true}return false}}if(set._nativeSet!==null){if(shouldAdd){prevSize=set._nativeSet.size;set._nativeSet.add(item);newSize=set._nativeSet.size;return newSize===prevSize}else{return set._nativeSet.has(item)}}else{if(!(type in set._items)){if(shouldAdd){set._items[type]={};set._items[type][item]=true}return false}else if(item in set._items[type]){return true}else{if(shouldAdd){set._items[type][item]=true}return false}}case"boolean":if(type in set._items){var bIdx=item?1:0;if(set._items[type][bIdx]){return true}else{if(shouldAdd){set._items[type][bIdx]=true}return false}}else{if(shouldAdd){set._items[type]=item?[false,true]:[true,false]}return false}case"function":if(set._nativeSet!==null){if(shouldAdd){prevSize=set._nativeSet.size;set._nativeSet.add(item);newSize=set._nativeSet.size;return newSize===prevSize}else{return set._nativeSet.has(item)}}else{if(!(type in set._items)){if(shouldAdd){set._items[type]=[item]}return false}if(!_contains(item,set._items[type])){if(shouldAdd){set._items[type].push(item)}return false}return true}case"undefined":if(set._items[type]){return true}else{if(shouldAdd){set._items[type]=true}return false}case"object":if(item===null){if(!set._items["null"]){if(shouldAdd){set._items["null"]=true}return false}return true}default:type=Object.prototype.toString.call(item);if(!(type in set._items)){if(shouldAdd){set._items[type]=[item]}return false}if(!_contains(item,set._items[type])){if(shouldAdd){set._items[type].push(item)}return false}return true}}return _Set}();var uniqBy=_curry2(function uniqBy(fn,list){var set=new _Set;var result=[];var idx=0;var appliedItem,item;while(idx<list.length){item=list[idx];appliedItem=fn(item);if(set.add(appliedItem)){result.push(item)}idx+=1}return result});var uniq=uniqBy(identity);var intersection=_curry2(function intersection(list1,list2){var lookupList,filteredList;if(list1.length>list2.length){lookupList=list1;filteredList=list2}else{lookupList=list2;filteredList=list1}return uniq(_filter(flip(_contains)(lookupList),filteredList))});var uniqWith=_curry2(function uniqWith(pred,list){var idx=0;var len=list.length;var result=[];var item;while(idx<len){item=list[idx];if(!_containsWith(pred,item,result)){result[result.length]=item}idx+=1}return result});var intersectionWith=_curry3(function intersectionWith(pred,list1,list2){var lookupList,filteredList;if(list1.length>list2.length){lookupList=list1;filteredList=list2}else{lookupList=list2;filteredList=list1}var results=[];var idx=0;while(idx<filteredList.length){if(_containsWith(pred,filteredList[idx],lookupList)){results[results.length]=filteredList[idx]}idx+=1}return uniqWith(pred,results)});var intersperse=_curry2(_checkForMethod("intersperse",function intersperse(separator,list){var out=[];var idx=0;var length=list.length;while(idx<length){if(idx===length-1){out.push(list[idx])}else{out.push(list[idx],separator)}idx+=1}return out}));var _objectAssign=function _objectAssign(target){var arguments$1=arguments;if(target==null){throw new TypeError("Cannot convert undefined or null to object")}var output=Object(target);var idx=1;var length=arguments.length;while(idx<length){var source=arguments$1[idx];if(source!=null){for(var nextKey in source){if(_has(nextKey,source)){output[nextKey]=source[nextKey]}}}idx+=1}return output};var _assign=typeof Object.assign==="function"?Object.assign:_objectAssign;var objOf=_curry2(function objOf(key,val){var obj={};obj[key]=val;return obj});var _stepCat=function(){var _stepCatArray={"@@transducer/init":Array,"@@transducer/step":function(xs,x){xs.push(x);return xs},"@@transducer/result":_identity};var _stepCatString={"@@transducer/init":String,"@@transducer/step":function(a,b){return a+b},"@@transducer/result":_identity};var _stepCatObject={"@@transducer/init":Object,"@@transducer/step":function(result,input){return _assign(result,isArrayLike(input)?objOf(input[0],input[1]):input)},"@@transducer/result":_identity};return function _stepCat(obj){if(_isTransformer(obj)){return obj}if(isArrayLike(obj)){return _stepCatArray}if(typeof obj==="string"){return _stepCatString}if(typeof obj==="object"){return _stepCatObject}throw new Error("Cannot create transformer for "+obj)}}();var into=_curry3(function into(acc,xf,list){return _isTransformer(acc)?_reduce(xf(acc),acc["@@transducer/init"](),list):_reduce(xf(_stepCat(acc)),_clone(acc,[],[],false),list)});var invert=_curry1(function invert(obj){var props=keys(obj);var len=props.length;var idx=0;var out={};while(idx<len){var key=props[idx];var val=obj[key];var list=_has(val,out)?out[val]:out[val]=[];list[list.length]=key;idx+=1}return out});var invertObj=_curry1(function invertObj(obj){var props=keys(obj);var len=props.length;var idx=0;var out={};while(idx<len){var key=props[idx];out[obj[key]]=key;idx+=1}return out});var invoker=_curry2(function invoker(arity,method){return curryN(arity+1,function(){var target=arguments[arity];if(target!=null&&_isFunction(target[method])){return target[method].apply(target,Array.prototype.slice.call(arguments,0,arity))}throw new TypeError(toString_1(target)+' does not have a method named "'+method+'"')})});var is=_curry2(function is(Ctor,val){return val!=null&&val.constructor===Ctor||val instanceof Ctor});var isEmpty=_curry1(function isEmpty(x){return x!=null&&equals(x,empty(x))});var isNil=_curry1(function isNil(x){return x==null});var join=invoker(1,"join");var juxt=_curry1(function juxt(fns){return converge(function(){return Array.prototype.slice.call(arguments,0)},fns)});var keysIn=_curry1(function keysIn(obj){var prop;var ks=[];
for(prop in obj){ks[ks.length]=prop}return ks});var lastIndexOf=_curry2(function lastIndexOf(target,xs){if(typeof xs.lastIndexOf==="function"&&!_isArray(xs)){return xs.lastIndexOf(target)}else{var idx=xs.length-1;while(idx>=0){if(equals(xs[idx],target)){return idx}idx-=1}return-1}});var _isNumber=function _isNumber(x){return Object.prototype.toString.call(x)==="[object Number]"};var length=_curry1(function length(list){return list!=null&&_isNumber(list.length)?list.length:NaN});var lens=_curry2(function lens(getter,setter){return function(toFunctorFn){return function(target){return map(function(focus){return setter(focus,target)},toFunctorFn(getter(target)))}}});var update$2=_curry3(function update(idx,x,list){return adjust(always(x),idx,list)});var lensIndex=_curry1(function lensIndex(n){return lens(nth(n),update$2(n))});var path=_curry2(function path(paths,obj){var val=obj;var idx=0;while(idx<paths.length){if(val==null){return}val=val[paths[idx]];idx+=1}return val});var lensPath=_curry1(function lensPath(p){return lens(path(p),assocPath(p))});var lensProp=_curry1(function lensProp(k){return lens(prop(k),assoc(k))});var lt=_curry2(function lt(a,b){return a<b});var lte=_curry2(function lte(a,b){return a<=b});var mapAccum=_curry3(function mapAccum(fn,acc,list){var idx=0;var len=list.length;var result=[];var tuple=[acc];while(idx<len){tuple=fn(tuple[0],list[idx]);result[idx]=tuple[1];idx+=1}return[tuple[0],result]});var mapAccumRight=_curry3(function mapAccumRight(fn,acc,list){var idx=list.length-1;var result=[];var tuple=[acc];while(idx>=0){tuple=fn(list[idx],tuple[0]);result[idx]=tuple[1];idx-=1}return[result,tuple[0]]});var mapObjIndexed=_curry2(function mapObjIndexed(fn,obj){return _reduce(function(acc,key){acc[key]=fn(obj[key],key,obj);return acc},{},keys(obj))});var match=_curry2(function match(rx,str){return str.match(rx)||[]});var mathMod=_curry2(function mathMod(m,p){if(!_isInteger(m)){return NaN}if(!_isInteger(p)||p<1){return NaN}return(m%p+p)%p});var maxBy=_curry3(function maxBy(f,a,b){return f(b)>f(a)?b:a});var sum=reduce(add,0);var mean=_curry1(function mean(list){return sum(list)/list.length});var median=_curry1(function median(list){var len=list.length;if(len===0){return NaN}var width=2-len%2;var idx=(len-width)/2;return mean(Array.prototype.slice.call(list,0).sort(function(a,b){return a<b?-1:a>b?1:0}).slice(idx,idx+width))});var memoize=_curry1(function memoize(fn){var cache={};return _arity(fn.length,function(){var key=toString_1(arguments);if(!_has(key,cache)){cache[key]=fn.apply(this,arguments)}return cache[key]})});var merge=_curry2(function merge(l,r){return _assign({},l,r)});var mergeAll=_curry1(function mergeAll(list){return _assign.apply(null,[{}].concat(list))});var mergeWithKey=_curry3(function mergeWithKey(fn,l,r){var result={};var k;for(k in l){if(_has(k,l)){result[k]=_has(k,r)?fn(k,l[k],r[k]):l[k]}}for(k in r){if(_has(k,r)&&!_has(k,result)){result[k]=r[k]}}return result});var mergeWith=_curry3(function mergeWith(fn,l,r){return mergeWithKey(function(_,_l,_r){return fn(_l,_r)},l,r)});var min=_curry2(function min(a,b){return b<a?b:a});var minBy=_curry3(function minBy(f,a,b){return f(b)<f(a)?b:a});var modulo=_curry2(function modulo(a,b){return a%b});var multiply=_curry2(function multiply(a,b){return a*b});var negate=_curry1(function negate(n){return-n});var none=_curry2(_complement(_dispatchable(["any"],_xany,any)));var nthArg=_curry1(function nthArg(n){var arity=n<0?1:n+1;return curryN(arity,function(){return nth(n,arguments)})});var _of=function _of(x){return[x]};var of=_curry1(_of);var omit=_curry2(function omit(names,obj){var result={};for(var prop in obj){if(!_contains(prop,names)){result[prop]=obj[prop]}}return result});var once=_curry1(function once(fn){var called=false;var result;return _arity(fn.length,function(){if(called){return result}called=true;result=fn.apply(this,arguments);return result})});var over=function(){var Identity=function(x){return{value:x,map:function(f){return Identity(f(x))}}};return _curry3(function over(lens,f,x){return lens(function(y){return Identity(f(y))})(x).value})}();var pair=_curry2(function pair(fst,snd){return[fst,snd]});var _createPartialApplicator=function _createPartialApplicator(concat){return _curry2(function(fn,args){return _arity(Math.max(0,fn.length-args.length),function(){return fn.apply(this,concat(args,arguments))})})};var partial=_createPartialApplicator(_concat);var partialRight=_createPartialApplicator(flip(_concat));var partition=juxt([filter,reject]);var pathEq=_curry3(function pathEq(_path,val,obj){return equals(path(_path,obj),val)});var pathOr=_curry3(function pathOr(d,p,obj){return defaultTo(d,path(p,obj))});var pathSatisfies=_curry3(function pathSatisfies(pred,propPath,obj){return propPath.length>0&&pred(path(propPath,obj))});var pick=_curry2(function pick(names,obj){var result={};var idx=0;while(idx<names.length){if(names[idx]in obj){result[names[idx]]=obj[names[idx]]}idx+=1}return result});var pickAll=_curry2(function pickAll(names,obj){var result={};var idx=0;var len=names.length;while(idx<len){var name=names[idx];result[name]=obj[name];idx+=1}return result});var pickBy=_curry2(function pickBy(test,obj){var result={};for(var prop in obj){if(test(obj[prop],prop,obj)){result[prop]=obj[prop]}}return result});var pipeK=function pipeK(){if(arguments.length===0){throw new Error("pipeK requires at least one argument")}return composeK.apply(this,reverse(arguments))};var prepend=_curry2(function prepend(el,list){return _concat([el],list)});var product=reduce(multiply,1);var useWith=_curry2(function useWith(fn,transformers){return curryN(transformers.length,function(){var arguments$1=arguments;var this$1=this;var args=[];var idx=0;while(idx<transformers.length){args.push(transformers[idx].call(this$1,arguments$1[idx]));idx+=1}return fn.apply(this,args.concat(Array.prototype.slice.call(arguments,transformers.length)))})});var project=useWith(_map,[pickAll,identity]);var propEq=_curry3(function propEq(name,val,obj){return equals(val,obj[name])});var propIs=_curry3(function propIs(type,name,obj){return is(type,obj[name])});var propOr=_curry3(function propOr(val,p,obj){return obj!=null&&_has(p,obj)?obj[p]:val});var propSatisfies=_curry3(function propSatisfies(pred,name,obj){return pred(obj[name])});var props=_curry2(function props(ps,obj){var len=ps.length;var out=[];var idx=0;while(idx<len){out[idx]=obj[ps[idx]];idx+=1}return out});var range=_curry2(function range(from,to){if(!(_isNumber(from)&&_isNumber(to))){throw new TypeError("Both arguments to range must be numbers")}var result=[];var n=from;while(n<to){result.push(n);n+=1}return result});var reduceRight=_curry3(function reduceRight(fn,acc,list){var idx=list.length-1;while(idx>=0){acc=fn(list[idx],acc);idx-=1}return acc});var reduceWhile=_curryN(4,[],function _reduceWhile(pred,fn,a,list){return _reduce(function(acc,x){return pred(acc,x)?fn(acc,x):_reduced(acc)},a,list)});var reduced=_curry1(_reduced);var remove$1=_curry3(function remove(start,count,list){var result=Array.prototype.slice.call(list,0);result.splice(start,count);return result});var times=_curry2(function times(fn,n){var len=Number(n);var idx=0;var list;if(len<0||isNaN(len)){throw new RangeError("n must be a non-negative number")}list=new Array(len);while(idx<len){list[idx]=fn(idx);idx+=1}return list});var repeat=_curry2(function repeat(value,n){return times(always(value),n)});var replace=_curry3(function replace(regex,replacement,str){return str.replace(regex,replacement)});var scan=_curry3(function scan(fn,acc,list){var idx=0;var len=list.length;var result=[acc];while(idx<len){acc=fn(acc,list[idx]);result[idx+1]=acc;idx+=1}return result});var sequence=_curry2(function sequence(of,traversable){return typeof traversable.sequence==="function"?traversable.sequence(of):reduceRight(function(x,acc){return ap(map(prepend,x),acc)},of([]),traversable)});var set=_curry3(function set(lens,v,x){return over(lens,always(v),x)});var sort=_curry2(function sort(comparator,list){return Array.prototype.slice.call(list,0).sort(comparator)});var sortBy=_curry2(function sortBy(fn,list){return Array.prototype.slice.call(list,0).sort(function(a,b){var aa=fn(a);var bb=fn(b);return aa<bb?-1:aa>bb?1:0})});var sortWith=_curry2(function sortWith(fns,list){return Array.prototype.slice.call(list,0).sort(function(a,b){var result=0;var i=0;while(result===0&&i<fns.length){result=fns[i](a,b);i+=1}return result})});var split=invoker(1,"split");var splitAt=_curry2(function splitAt(index,array){return[slice(0,index,array),slice(index,length(array),array)]});var splitEvery=_curry2(function splitEvery(n,list){if(n<=0){throw new Error("First argument to splitEvery must be a positive integer")}var result=[];var idx=0;while(idx<list.length){result.push(slice(idx,idx+=n,list))}return result});var splitWhen=_curry2(function splitWhen(pred,list){var idx=0;var len=list.length;var prefix=[];while(idx<len&&!pred(list[idx])){prefix.push(list[idx]);idx+=1}return[prefix,Array.prototype.slice.call(list,idx)]});var subtract=_curry2(function subtract(a,b){return Number(a)-Number(b)});var symmetricDifference=_curry2(function symmetricDifference(list1,list2){return concat(difference(list1,list2),difference(list2,list1))});var symmetricDifferenceWith=_curry3(function symmetricDifferenceWith(pred,list1,list2){return concat(differenceWith(pred,list1,list2),differenceWith(pred,list2,list1))});var takeLast=_curry2(function takeLast(n,xs){return drop(n>=0?xs.length-n:0,xs)});var takeLastWhile=_curry2(function takeLastWhile(fn,list){var idx=list.length-1;while(idx>=0&&fn(list[idx])){idx-=1}return Array.prototype.slice.call(list,idx+1)});var _xtakeWhile=function(){function XTakeWhile(f,xf){this.xf=xf;this.f=f}XTakeWhile.prototype["@@transducer/init"]=_xfBase.init;XTakeWhile.prototype["@@transducer/result"]=_xfBase.result;XTakeWhile.prototype["@@transducer/step"]=function(result,input){return this.f(input)?this.xf["@@transducer/step"](result,input):_reduced(result)};return _curry2(function _xtakeWhile(f,xf){return new XTakeWhile(f,xf)})}();var takeWhile=_curry2(_dispatchable(["takeWhile"],_xtakeWhile,function takeWhile(fn,list){var idx=0;var len=list.length;while(idx<len&&fn(list[idx])){idx+=1}return Array.prototype.slice.call(list,0,idx)}));var tap=_curry2(function tap(fn,x){fn(x);return x});var _isRegExp=function _isRegExp(x){return Object.prototype.toString.call(x)==="[object RegExp]"};var test=_curry2(function test(pattern,str){if(!_isRegExp(pattern)){throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+toString_1(pattern))}return _cloneRegExp(pattern).test(str)});var toLower=invoker(0,"toLowerCase");var toPairs=_curry1(function toPairs(obj){var pairs=[];for(var prop in obj){if(_has(prop,obj)){pairs[pairs.length]=[prop,obj[prop]]}}return pairs});var toPairsIn=_curry1(function toPairsIn(obj){var pairs=[];for(var prop in obj){pairs[pairs.length]=[prop,obj[prop]]}return pairs});var toUpper=invoker(0,"toUpperCase");var transduce=curryN(4,function transduce(xf,fn,acc,list){return _reduce(xf(typeof fn==="function"?_xwrap(fn):fn),acc,list)});var transpose=_curry1(function transpose(outerlist){var i=0;var result=[];while(i<outerlist.length){var innerlist=outerlist[i];var j=0;while(j<innerlist.length){if(typeof result[j]==="undefined"){result[j]=[]}result[j].push(innerlist[j]);j+=1}i+=1}return result});var traverse=_curry3(function traverse(of,f,traversable){return sequence(of,map(f,traversable))});var trim=function(){var ws=" \n \f\r   ᠎    "+"          \u2028"+"\u2029\ufeff";var zeroWidth="​";var hasProtoTrim=typeof String.prototype.trim==="function";if(!hasProtoTrim||(ws.trim()||!zeroWidth.trim())){return _curry1(function trim(str){var beginRx=new RegExp("^["+ws+"]["+ws+"]*");var endRx=new RegExp("["+ws+"]["+ws+"]*$");return str.replace(beginRx,"").replace(endRx,"")})}else{return _curry1(function trim(str){return str.trim()})}}();var tryCatch=_curry2(function _tryCatch(tryer,catcher){return _arity(tryer.length,function(){try{return tryer.apply(this,arguments)}catch(e){return catcher.apply(this,_concat([e],arguments))}})});var unapply=_curry1(function unapply(fn){return function(){return fn(Array.prototype.slice.call(arguments,0))}});var unary=_curry1(function unary(fn){return nAry(1,fn)});var uncurryN=_curry2(function uncurryN(depth,fn){return curryN(depth,function(){var arguments$1=arguments;var this$1=this;var currentDepth=1;var value=fn;var idx=0;var endIdx;while(currentDepth<=depth&&typeof value==="function"){endIdx=currentDepth===depth?arguments$1.length:idx+value.length;value=value.apply(this$1,Array.prototype.slice.call(arguments$1,idx,endIdx));currentDepth+=1;idx=endIdx}return value})});var unfold=_curry2(function unfold(fn,seed){var pair=fn(seed);var result=[];while(pair&&pair.length){result[result.length]=pair[0];pair=fn(pair[1])}return result});var union=_curry2(compose(uniq,_concat));var unionWith=_curry3(function unionWith(pred,list1,list2){return uniqWith(pred,_concat(list1,list2))});var unless=_curry3(function unless(pred,whenFalseFn,x){return pred(x)?x:whenFalseFn(x)});var unnest=chain(_identity);var until=_curry3(function until(pred,fn,init){var val=init;while(!pred(val)){val=fn(val)}return val});var valuesIn=_curry1(function valuesIn(obj){var prop;var vs=[];for(prop in obj){vs[vs.length]=obj[prop]}return vs});var view=function(){var Const=function(x){return{value:x,map:function(){return this}}};return _curry2(function view(lens,x){return lens(Const)(x).value})}();var when=_curry3(function when(pred,whenTrueFn,x){return pred(x)?whenTrueFn(x):x});var where=_curry2(function where(spec,testObj){for(var prop in spec){if(_has(prop,spec)&&!spec[prop](testObj[prop])){return false}}return true});var whereEq=_curry2(function whereEq(spec,testObj){return where(map(equals,spec),testObj)});var without=_curry2(function(xs,list){return reject(flip(_contains)(xs),list)});var xprod=_curry2(function xprod(a,b){var idx=0;var ilen=a.length;var j;var jlen=b.length;var result=[];while(idx<ilen){j=0;while(j<jlen){result[result.length]=[a[idx],b[j]];j+=1}idx+=1}return result});var zip=_curry2(function zip(a,b){var rv=[];var idx=0;var len=Math.min(a.length,b.length);while(idx<len){rv[idx]=[a[idx],b[idx]];idx+=1}return rv});var zipObj=_curry2(function zipObj(keys,values){var idx=0;var len=Math.min(keys.length,values.length);var out={};while(idx<len){out[keys[idx]]=values[idx];idx+=1}return out});var zipWith=_curry3(function zipWith(fn,a,b){var rv=[];var idx=0;var len=Math.min(a.length,b.length);while(idx<len){rv[idx]=fn(a[idx],b[idx]);idx+=1}return rv});var index={F:F,T:T,__:__,add:add,addIndex:addIndex,adjust:adjust,all:all,allPass:allPass,always:always,and:and,any:any,anyPass:anyPass,ap:ap,aperture:aperture,append:append$1,apply:apply,applySpec:applySpec,ascend:ascend,assoc:assoc,assocPath:assocPath,binary:binary,bind:bind,both:both,call:call,chain:chain,clamp:clamp,clone:clone,comparator:comparator,complement:complement,compose:compose,composeK:composeK,composeP:composeP,concat:concat,cond:cond,construct:construct,constructN:constructN,contains:contains$1,converge:converge,countBy:countBy,curry:curry,curryN:curryN,dec:dec,descend:descend,defaultTo:defaultTo,difference:difference,differenceWith:differenceWith,dissoc:dissoc,dissocPath:dissocPath,divide:divide,drop:drop,dropLast:dropLast,dropLastWhile:dropLastWhile,dropRepeats:dropRepeats,dropRepeatsWith:dropRepeatsWith,dropWhile:dropWhile,either:either,empty:empty,eqBy:eqBy,eqProps:eqProps,equals:equals,evolve:evolve,filter:filter,find:find,findIndex:findIndex,findLast:findLast,findLastIndex:findLastIndex,flatten:flatten,flip:flip,forEach:forEach,forEachObjIndexed:forEachObjIndexed,fromPairs:fromPairs,groupBy:groupBy,groupWith:groupWith,gt:gt,gte:gte,has:has,hasIn:hasIn,head:head,identical:identical,identity:identity,ifElse:ifElse,inc:inc,indexBy:indexBy,indexOf:indexOf,init:init,insert:insert$1,insertAll:insertAll,intersection:intersection,intersectionWith:intersectionWith,intersperse:intersperse,into:into,invert:invert,invertObj:invertObj,invoker:invoker,is:is,isArrayLike:isArrayLike,isEmpty:isEmpty,isNil:isNil,join:join,juxt:juxt,keys:keys,keysIn:keysIn,last:last,lastIndexOf:lastIndexOf,length:length,lens:lens,lensIndex:lensIndex,lensPath:lensPath,lensProp:lensProp,lift:lift,liftN:liftN,lt:lt,lte:lte,map:map,mapAccum:mapAccum,mapAccumRight:mapAccumRight,mapObjIndexed:mapObjIndexed,match:match,mathMod:mathMod,max:max,maxBy:maxBy,mean:mean,median:median,memoize:memoize,merge:merge,mergeAll:mergeAll,mergeWith:mergeWith,mergeWithKey:mergeWithKey,min:min,minBy:minBy,modulo:modulo,multiply:multiply,nAry:nAry,negate:negate,none:none,not:not,nth:nth,nthArg:nthArg,objOf:objOf,of:of,omit:omit,once:once,or:or,over:over,pair:pair,partial:partial,partialRight:partialRight,partition:partition,path:path,pathEq:pathEq,pathOr:pathOr,pathSatisfies:pathSatisfies,pick:pick,pickAll:pickAll,pickBy:pickBy,pipe:pipe,pipeK:pipeK,pipeP:pipeP,pluck:pluck,prepend:prepend,product:product,project:project,prop:prop,propEq:propEq,propIs:propIs,propOr:propOr,propSatisfies:propSatisfies,props:props,range:range,reduce:reduce,reduceBy:reduceBy,reduceRight:reduceRight,reduceWhile:reduceWhile,reduced:reduced,reject:reject,remove:remove$1,repeat:repeat,replace:replace,reverse:reverse,scan:scan,sequence:sequence,set:set,slice:slice,sort:sort,sortBy:sortBy,sortWith:sortWith,split:split,splitAt:splitAt,splitEvery:splitEvery,splitWhen:splitWhen,subtract:subtract,sum:sum,symmetricDifference:symmetricDifference,symmetricDifferenceWith:symmetricDifferenceWith,tail:tail,take:take,takeLast:takeLast,takeLastWhile:takeLastWhile,takeWhile:takeWhile,tap:tap,test:test,times:times,toLower:toLower,toPairs:toPairs,toPairsIn:toPairsIn,toString:toString_1,toUpper:toUpper,transduce:transduce,transpose:transpose,traverse:traverse,trim:trim,tryCatch:tryCatch,type:type,unapply:unapply,unary:unary,uncurryN:uncurryN,unfold:unfold,union:union,unionWith:unionWith,uniq:uniq,uniqBy:uniqBy,uniqWith:uniqWith,unless:unless,unnest:unnest,until:until,update:update$2,useWith:useWith,values:values,valuesIn:valuesIn,view:view,when:when,where:where,whereEq:whereEq,without:without,xprod:xprod,zip:zip,zipObj:zipObj,zipWith:zipWith};riot$1.tag2("postcontrols",'<div class="container"> <div class="columns"> <div class="column col-6"> <button class="{⁗btn btn-lg nav-button float-right ⁗ + (this.opts.state.pid <= 1 ? ⁗disabled⁗ : ⁗ ⁗) + this.opts.prevloading}" onclick="{this.opts.prev}"> <i class="fa fa-arrow-left" aria-hidden="true"></i> </button> </div> <div class="column col-6"> <button class="{⁗btn btn-lg nav-button float-left ⁗ + (this.opts.nomore ? ⁗disabled⁗ : ⁗ ⁗) + this.opts.nextloading}" onclick="{this.opts.next}"> <i class="fa fa-arrow-right" aria-hidden="true"></i> </button> </div> </div> </div>',"","",function(opts){});riot$1.tag2("post",'<div class="posts-box post centered"> <div class="text-break animated fadeIn"> <loading if="{this.loading}"></loading> <div if="{this.swipe && !this.loading}" class="{`animated ${this.transition}`}"> <h4>{this.title}</h4> <h5>Posted by {this.author}</h5> <p class="post-content centered text-break"> {this.content} </p> <div class="divider"></div> </div> </div> <div data-is="postcontrols" state="{this.opts.state}" prevloading="{this.prevloading}" prev="{this.prev}" nomore="{this.nomore}" nextloading="{this.nextloading}" next="{this.next}"> </div> </div>',"","",function(opts){var self=this;self.author="";self.title="";self.content="";self.prevloading="";self.nextloading="";self.transition="";self.nomore=false;self.content="";self.swipe=false;self.loading=!self.opts.state.loaded;this.prev=function(ev){ev.preventDefault();if(self.prevloading||self.nextloading){return}self.prevloading=" loading";if(self.opts.state.pid>1){self.opts.state.pid--;self.update()}self.update({swipe:!self.swipe});self.setPost(self.opts.state.pid,"fadeInLeft")}.bind(this);this.next=function(ev){ev.preventDefault();if(self.nextloading||self.prevloading){return}self.nextloading=" loading";if(!self.nomore){self.opts.state.pid++;self.update()}self.update({swipe:!self.swipe});self.setPost(self.opts.state.pid,"fadeInRight")}.bind(this);this.setPost=function(pid,transition){self.update({loading:self.opts.state.loaded});fetch("/blog/switchpost/"+(pid-1)).then(function(resp){return resp.text()}).then(function(body){if(body==="false"){self.nomore=true;self.prevloading="";self.nextloading="";self.loading=false;self.update();return}else{var postcontent=JSON.parse(body);if(postcontent.length==0){self.prevloading="";self.nextloading="";self.nomore=true;self.swipe=!self.swipe;self.transition="";self.opts.state.pid--;self.loading=false;self.update();return}self.opts.state.pid=pid;self.author=postcontent[0].doc.author[0];self.content=postcontent[0].doc.content[0];self.title=postcontent[0].doc.title[0];self.transition=transition;self.swipe=!self.swipe;self.nomore=false;self.loading=false;self.update()}self.prevloading="";self.nextloading="";self.update()})}.bind(this);this.setPost(this.opts.state.pid)});riot$1.tag2("posts","<yield></yield>","","",function(opts){});riot$1.tag2("raw","<span></span>","","",function(opts){this.updateContent=function(){this.root.innerHTML=opts.content}.bind(this);this.on("update",function(){this.updateContent()});this.updateContent()});var commonjsGlobal=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}var showdown=createCommonjsModule(function(module){(function(){function getDefaultOpts(simple){"use strict";var defaultOptions={omitExtraWLInCodeBlocks:{defaultValue:false,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:false,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:false,describe:"Specify a prefix to generated header ids",type:"string"},ghCompatibleHeaderId:{defaultValue:false,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},headerLevelStart:{defaultValue:false,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:false,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:false,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:false,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:false,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:false,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:false,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:false,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:false,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:true,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:false,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:false,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:false,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:false,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:false,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:false,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:false,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:true,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:false,description:"Open all links in new windows",type:"boolean"}};if(simple===false){return JSON.parse(JSON.stringify(defaultOptions))}var ret={};for(var opt in defaultOptions){if(defaultOptions.hasOwnProperty(opt)){ret[opt]=defaultOptions[opt].defaultValue}}return ret}function allOptionsOn(){"use strict";var options=getDefaultOpts(true),ret={};for(var opt in options){if(options.hasOwnProperty(opt)){ret[opt]=true}}return ret}var showdown={},parsers={},extensions={},globalOptions=getDefaultOpts(true),setFlavor="vanilla",flavor={github:{omitExtraWLInCodeBlocks:true,simplifiedAutoLink:true,excludeTrailingPunctuationFromURLs:true,literalMidWordUnderscores:true,strikethrough:true,tables:true,tablesHeaderId:true,ghCodeBlocks:true,tasklists:true,disableForced4SpacesIndentedSublists:true,simpleLineBreaks:true,requireSpaceBeforeHeadingText:true,ghCompatibleHeaderId:true,ghMentions:true},original:{noHeaderId:true,ghCodeBlocks:false},ghost:{omitExtraWLInCodeBlocks:true,parseImgDimensions:true,simplifiedAutoLink:true,excludeTrailingPunctuationFromURLs:true,literalMidWordUnderscores:true,strikethrough:true,tables:true,tablesHeaderId:true,ghCodeBlocks:true,tasklists:true,smoothLivePreview:true,simpleLineBreaks:true,requireSpaceBeforeHeadingText:true,ghMentions:false,encodeEmails:true},vanilla:getDefaultOpts(true),allOn:allOptionsOn()};showdown.helper={};showdown.extensions={};showdown.setOption=function(key,value){"use strict";globalOptions[key]=value;return this};showdown.getOption=function(key){"use strict";return globalOptions[key]};showdown.getOptions=function(){"use strict";return globalOptions};showdown.resetOptions=function(){"use strict";globalOptions=getDefaultOpts(true)};showdown.setFlavor=function(name){"use strict";if(!flavor.hasOwnProperty(name)){throw Error(name+" flavor was not found")}showdown.resetOptions();var preset=flavor[name];setFlavor=name;for(var option in preset){if(preset.hasOwnProperty(option)){globalOptions[option]=preset[option]}}};showdown.getFlavor=function(){"use strict";return setFlavor};showdown.getFlavorOptions=function(name){"use strict";if(flavor.hasOwnProperty(name)){return flavor[name]}};showdown.getDefaultOptions=function(simple){"use strict";return getDefaultOpts(simple)};showdown.subParser=function(name,func){"use strict";if(showdown.helper.isString(name)){if(typeof func!=="undefined"){parsers[name]=func}else{if(parsers.hasOwnProperty(name)){return parsers[name]}else{throw Error("SubParser named "+name+" not registered!")}}}};showdown.extension=function(name,ext){"use strict";if(!showdown.helper.isString(name)){throw Error("Extension 'name' must be a string")}name=showdown.helper.stdExtName(name);if(showdown.helper.isUndefined(ext)){if(!extensions.hasOwnProperty(name)){throw Error("Extension named "+name+" is not registered!")}return extensions[name]}else{if(typeof ext==="function"){ext=ext()}if(!showdown.helper.isArray(ext)){ext=[ext]}var validExtension=validate(ext,name);if(validExtension.valid){extensions[name]=ext}else{throw Error(validExtension.error)}}};showdown.getAllExtensions=function(){"use strict";return extensions};showdown.removeExtension=function(name){"use strict";delete extensions[name]};showdown.resetExtensions=function(){"use strict";extensions={}};function validate(extension,name){"use strict";var errMsg=name?"Error in "+name+" extension->":"Error in unnamed extension",ret={valid:true,error:""};if(!showdown.helper.isArray(extension)){extension=[extension]}for(var i=0;i<extension.length;++i){var baseMsg=errMsg+" sub-extension "+i+": ",ext=extension[i];if(typeof ext!=="object"){ret.valid=false;ret.error=baseMsg+"must be an object, but "+typeof ext+" given";return ret}if(!showdown.helper.isString(ext.type)){ret.valid=false;ret.error=baseMsg+'property "type" must be a string, but '+typeof ext.type+" given";return ret}var type=ext.type=ext.type.toLowerCase();if(type==="language"){type=ext.type="lang"}if(type==="html"){type=ext.type="output"}if(type!=="lang"&&type!=="output"&&type!=="listener"){ret.valid=false;ret.error=baseMsg+"type "+type+' is not recognized. Valid values: "lang/language", "output/html" or "listener"';return ret}if(type==="listener"){if(showdown.helper.isUndefined(ext.listeners)){ret.valid=false;ret.error=baseMsg+'. Extensions of type "listener" must have a property called "listeners"';return ret}}else{if(showdown.helper.isUndefined(ext.filter)&&showdown.helper.isUndefined(ext.regex)){ret.valid=false;ret.error=baseMsg+type+' extensions must define either a "regex" property or a "filter" method';return ret}}if(ext.listeners){if(typeof ext.listeners!=="object"){ret.valid=false;ret.error=baseMsg+'"listeners" property must be an object but '+typeof ext.listeners+" given";return ret}for(var ln in ext.listeners){if(ext.listeners.hasOwnProperty(ln)){if(typeof ext.listeners[ln]!=="function"){ret.valid=false;ret.error=baseMsg+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+ln+" must be a function but "+typeof ext.listeners[ln]+" given";return ret}}}}if(ext.filter){if(typeof ext.filter!=="function"){ret.valid=false;ret.error=baseMsg+'"filter" must be a function, but '+typeof ext.filter+" given";return ret}}else if(ext.regex){if(showdown.helper.isString(ext.regex)){ext.regex=new RegExp(ext.regex,"g")}if(!(ext.regex instanceof RegExp)){ret.valid=false;ret.error=baseMsg+'"regex" property must either be a string or a RegExp object, but '+typeof ext.regex+" given";return ret}if(showdown.helper.isUndefined(ext.replace)){ret.valid=false;ret.error=baseMsg+'"regex" extensions must implement a replace string or function';return ret}}}return ret}showdown.validateExtension=function(ext){"use strict";var validateExtension=validate(ext,null);if(!validateExtension.valid){console.warn(validateExtension.error);return false}return true};if(!showdown.hasOwnProperty("helper")){showdown.helper={}}showdown.helper.isString=function(a){"use strict";return typeof a==="string"||a instanceof String};showdown.helper.isFunction=function(a){"use strict";var getType={};return a&&getType.toString.call(a)==="[object Function]"};showdown.helper.isArray=function(a){"use strict";return a.constructor===Array};showdown.helper.isUndefined=function(value){"use strict";return typeof value==="undefined"};showdown.helper.forEach=function(obj,callback){"use strict";if(showdown.helper.isUndefined(obj)){throw new Error("obj param is required")}if(showdown.helper.isUndefined(callback)){throw new Error("callback param is required")}if(!showdown.helper.isFunction(callback)){throw new Error("callback param must be a function/closure")}if(typeof obj.forEach==="function"){obj.forEach(callback)}else if(showdown.helper.isArray(obj)){for(var i=0;i<obj.length;i++){callback(obj[i],i,obj)}}else if(typeof obj==="object"){for(var prop in obj){if(obj.hasOwnProperty(prop)){callback(obj[prop],prop,obj)}}}else{throw new Error("obj does not seem to be an array or an iterable object")}};showdown.helper.stdExtName=function(s){"use strict";return s.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function escapeCharactersCallback(wholeMatch,m1){"use strict";var charCodeToEscape=m1.charCodeAt(0);return"¨E"+charCodeToEscape+"E"}showdown.helper.escapeCharactersCallback=escapeCharactersCallback;showdown.helper.escapeCharacters=function(text,charsToEscape,afterBackslash){"use strict";var regexString="(["+charsToEscape.replace(/([\[\]\\])/g,"\\$1")+"])";if(afterBackslash){regexString="\\\\"+regexString}var regex=new RegExp(regexString,"g");text=text.replace(regex,escapeCharactersCallback);
return text};var rgxFindMatchPos=function(str,left,right,flags){"use strict";var f=flags||"",g=f.indexOf("g")>-1,x=new RegExp(left+"|"+right,"g"+f.replace(/g/g,"")),l=new RegExp(left,f.replace(/g/g,"")),pos=[],t,s,m,start,end;do{t=0;while(m=x.exec(str)){if(l.test(m[0])){if(!t++){s=x.lastIndex;start=s-m[0].length}}else if(t){if(!--t){end=m.index+m[0].length;var obj={left:{start:start,end:s},match:{start:s,end:m.index},right:{start:m.index,end:end},wholeMatch:{start:start,end:end}};pos.push(obj);if(!g){return pos}}}}}while(t&&(x.lastIndex=s));return pos};showdown.helper.matchRecursiveRegExp=function(str,left,right,flags){"use strict";var matchPos=rgxFindMatchPos(str,left,right,flags),results=[];for(var i=0;i<matchPos.length;++i){results.push([str.slice(matchPos[i].wholeMatch.start,matchPos[i].wholeMatch.end),str.slice(matchPos[i].match.start,matchPos[i].match.end),str.slice(matchPos[i].left.start,matchPos[i].left.end),str.slice(matchPos[i].right.start,matchPos[i].right.end)])}return results};showdown.helper.replaceRecursiveRegExp=function(str,replacement,left,right,flags){"use strict";if(!showdown.helper.isFunction(replacement)){var repStr=replacement;replacement=function(){return repStr}}var matchPos=rgxFindMatchPos(str,left,right,flags),finalStr=str,lng=matchPos.length;if(lng>0){var bits=[];if(matchPos[0].wholeMatch.start!==0){bits.push(str.slice(0,matchPos[0].wholeMatch.start))}for(var i=0;i<lng;++i){bits.push(replacement(str.slice(matchPos[i].wholeMatch.start,matchPos[i].wholeMatch.end),str.slice(matchPos[i].match.start,matchPos[i].match.end),str.slice(matchPos[i].left.start,matchPos[i].left.end),str.slice(matchPos[i].right.start,matchPos[i].right.end)));if(i<lng-1){bits.push(str.slice(matchPos[i].wholeMatch.end,matchPos[i+1].wholeMatch.start))}}if(matchPos[lng-1].wholeMatch.end<str.length){bits.push(str.slice(matchPos[lng-1].wholeMatch.end))}finalStr=bits.join("")}return finalStr};showdown.helper.regexIndexOf=function(str,regex,fromIndex){"use strict";if(!showdown.helper.isString(str)){throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"}if(regex instanceof RegExp===false){throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp"}var indexOf=str.substring(fromIndex||0).search(regex);return indexOf>=0?indexOf+(fromIndex||0):indexOf};showdown.helper.splitAtIndex=function(str,index){"use strict";if(!showdown.helper.isString(str)){throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string"}return[str.substring(0,index),str.substring(index)]};showdown.helper.encodeEmailAddress=function(mail){"use strict";var encode=[function(ch){return"&#"+ch.charCodeAt(0)+";"},function(ch){return"&#x"+ch.charCodeAt(0).toString(16)+";"},function(ch){return ch}];mail=mail.replace(/./g,function(ch){if(ch==="@"){ch=encode[Math.floor(Math.random()*2)](ch)}else{var r=Math.random();ch=r>.9?encode[2](ch):r>.45?encode[1](ch):encode[0](ch)}return ch});return mail};if(typeof console==="undefined"){console={warn:function(msg){"use strict";alert(msg)},log:function(msg){"use strict";alert(msg)},error:function(msg){"use strict";throw msg}}}showdown.helper.regexes={asteriskAndDash:/([*_])/g};showdown.Converter=function(converterOptions){"use strict";var options={},langExtensions=[],outputModifiers=[],listeners={},setConvFlavor=setFlavor;_constructor();function _constructor(){converterOptions=converterOptions||{};for(var gOpt in globalOptions){if(globalOptions.hasOwnProperty(gOpt)){options[gOpt]=globalOptions[gOpt]}}if(typeof converterOptions==="object"){for(var opt in converterOptions){if(converterOptions.hasOwnProperty(opt)){options[opt]=converterOptions[opt]}}}else{throw Error("Converter expects the passed parameter to be an object, but "+typeof converterOptions+" was passed instead.")}if(options.extensions){showdown.helper.forEach(options.extensions,_parseExtension)}}function _parseExtension(ext,name){name=name||null;if(showdown.helper.isString(ext)){ext=showdown.helper.stdExtName(ext);name=ext;if(showdown.extensions[ext]){console.warn("DEPRECATION WARNING: "+ext+" is an old extension that uses a deprecated loading method."+"Please inform the developer that the extension should be updated!");legacyExtensionLoading(showdown.extensions[ext],ext);return}else if(!showdown.helper.isUndefined(extensions[ext])){ext=extensions[ext]}else{throw Error('Extension "'+ext+'" could not be loaded. It was either not found or is not a valid extension.')}}if(typeof ext==="function"){ext=ext()}if(!showdown.helper.isArray(ext)){ext=[ext]}var validExt=validate(ext,name);if(!validExt.valid){throw Error(validExt.error)}for(var i=0;i<ext.length;++i){switch(ext[i].type){case"lang":langExtensions.push(ext[i]);break;case"output":outputModifiers.push(ext[i]);break}if(ext[i].hasOwnProperty("listeners")){for(var ln in ext[i].listeners){if(ext[i].listeners.hasOwnProperty(ln)){listen(ln,ext[i].listeners[ln])}}}}}function legacyExtensionLoading(ext,name){if(typeof ext==="function"){ext=ext(new showdown.Converter)}if(!showdown.helper.isArray(ext)){ext=[ext]}var valid=validate(ext,name);if(!valid.valid){throw Error(valid.error)}for(var i=0;i<ext.length;++i){switch(ext[i].type){case"lang":langExtensions.push(ext[i]);break;case"output":outputModifiers.push(ext[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}}function listen(name,callback){if(!showdown.helper.isString(name)){throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof name+" given")}if(typeof callback!=="function"){throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof callback+" given")}if(!listeners.hasOwnProperty(name)){listeners[name]=[]}listeners[name].push(callback)}function rTrimInputText(text){var rsp=text.match(/^\s*/)[0].length,rgx=new RegExp("^\\s{0,"+rsp+"}","gm");return text.replace(rgx,"")}this._dispatch=function dispatch(evtName,text,options,globals){var this$1=this;if(listeners.hasOwnProperty(evtName)){for(var ei=0;ei<listeners[evtName].length;++ei){var nText=listeners[evtName][ei](evtName,text,this$1,options,globals);if(nText&&typeof nText!=="undefined"){text=nText}}}return text};this.listen=function(name,callback){listen(name,callback);return this};this.makeHtml=function(text){if(!text){return text}var globals={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:langExtensions,outputModifiers:outputModifiers,converter:this,ghCodeBlocks:[]};text=text.replace(/¨/g,"¨T");text=text.replace(/\$/g,"¨D");text=text.replace(/\r\n/g,"\n");text=text.replace(/\r/g,"\n");text=text.replace(/\u00A0/g," ");if(options.smartIndentationFix){text=rTrimInputText(text)}text="\n\n"+text+"\n\n";text=showdown.subParser("detab")(text,options,globals);text=text.replace(/^[ \t]+$/gm,"");showdown.helper.forEach(langExtensions,function(ext){text=showdown.subParser("runExtension")(ext,text,options,globals)});text=showdown.subParser("hashPreCodeTags")(text,options,globals);text=showdown.subParser("githubCodeBlocks")(text,options,globals);text=showdown.subParser("hashHTMLBlocks")(text,options,globals);text=showdown.subParser("hashCodeTags")(text,options,globals);text=showdown.subParser("stripLinkDefinitions")(text,options,globals);text=showdown.subParser("blockGamut")(text,options,globals);text=showdown.subParser("unhashHTMLSpans")(text,options,globals);text=showdown.subParser("unescapeSpecialChars")(text,options,globals);text=text.replace(/¨D/g,"$$");text=text.replace(/¨T/g,"¨");showdown.helper.forEach(outputModifiers,function(ext){text=showdown.subParser("runExtension")(ext,text,options,globals)});return text};this.setOption=function(key,value){options[key]=value};this.getOption=function(key){return options[key]};this.getOptions=function(){return options};this.addExtension=function(extension,name){name=name||null;_parseExtension(extension,name)};this.useExtension=function(extensionName){_parseExtension(extensionName)};this.setFlavor=function(name){if(!flavor.hasOwnProperty(name)){throw Error(name+" flavor was not found")}var preset=flavor[name];setConvFlavor=name;for(var option in preset){if(preset.hasOwnProperty(option)){options[option]=preset[option]}}};this.getFlavor=function(){return setConvFlavor};this.removeExtension=function(extension){if(!showdown.helper.isArray(extension)){extension=[extension]}for(var a=0;a<extension.length;++a){var ext=extension[a];for(var i=0;i<langExtensions.length;++i){if(langExtensions[i]===ext){langExtensions[i].splice(i,1)}}for(var ii=0;ii<outputModifiers.length;++i){if(outputModifiers[ii]===ext){outputModifiers[ii].splice(i,1)}}}};this.getAllExtensions=function(){return{language:langExtensions,output:outputModifiers}}};showdown.subParser("anchors",function(text,options,globals){"use strict";text=globals.converter._dispatch("anchors.before",text,options,globals);var writeAnchorTag=function(wholeMatch,linkText,linkId,url,m5,m6,title){if(showdown.helper.isUndefined(title)){title=""}linkId=linkId.toLowerCase();if(wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1){url=""}else if(!url){if(!linkId){linkId=linkText.toLowerCase().replace(/ ?\n/g," ")}url="#"+linkId;if(!showdown.helper.isUndefined(globals.gUrls[linkId])){url=globals.gUrls[linkId];if(!showdown.helper.isUndefined(globals.gTitles[linkId])){title=globals.gTitles[linkId]}}else{return wholeMatch}}url=url.replace(showdown.helper.regexes.asteriskAndDash,showdown.helper.escapeCharactersCallback);var result='<a href="'+url+'"';if(title!==""&&title!==null){title=title.replace(/"/g,"&quot;");title=title.replace(showdown.helper.regexes.asteriskAndDash,showdown.helper.escapeCharactersCallback);result+=' title="'+title+'"'}if(options.openLinksInNewWindow){result+=' target="¨E95Eblank"'}result+=">"+linkText+"</a>";return result};text=text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,writeAnchorTag);text=text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,writeAnchorTag);text=text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,writeAnchorTag);text=text.replace(/\[([^\[\]]+)]()()()()()/g,writeAnchorTag);if(options.ghMentions){text=text.replace(/(^|\s)(\\)?(@([a-z\d\-]+))(?=[.!?;,[\]()]|\s|$)/gim,function(wm,st,escape,mentions,username){if(escape==="\\"){return st+mentions}if(!showdown.helper.isString(options.ghMentionsLink)){throw new Error("ghMentionsLink option must be a string")}var lnk=options.ghMentionsLink.replace(/\{u}/g,username);return st+'<a href="'+lnk+'">'+mentions+"</a>"})}text=globals.converter._dispatch("anchors.after",text,options,globals);return text});var simpleURLRegex=/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)()(?=\s|$)(?!["<>])/gi,simpleURLRegex2=/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]]?)(?=\s|$)(?!["<>])/gi,delimUrlRegex=/<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>/gi,simpleMailRegex=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-\/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,delimMailRegex=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,replaceLink=function(options){"use strict";return function(wm,link,m2,m3,trailingPunctuation){var lnkTxt=link,append="",target="";if(/^www\./i.test(link)){link=link.replace(/^www\./i,"http://www.")}if(options.excludeTrailingPunctuationFromURLs&&trailingPunctuation){append=trailingPunctuation}if(options.openLinksInNewWindow){target=' target="¨E95Eblank"'}return'<a href="'+link+'"'+target+">"+lnkTxt+"</a>"+append}},replaceMail=function(options,globals){"use strict";return function(wholeMatch,b,mail){var href="mailto:";b=b||"";mail=showdown.subParser("unescapeSpecialChars")(mail,options,globals);if(options.encodeEmails){href=showdown.helper.encodeEmailAddress(href+mail);mail=showdown.helper.encodeEmailAddress(mail)}else{href=href+mail}return b+'<a href="'+href+'">'+mail+"</a>"}};showdown.subParser("autoLinks",function(text,options,globals){"use strict";text=globals.converter._dispatch("autoLinks.before",text,options,globals);text=text.replace(delimUrlRegex,replaceLink(options));text=text.replace(delimMailRegex,replaceMail(options,globals));text=globals.converter._dispatch("autoLinks.after",text,options,globals);return text});showdown.subParser("simplifiedAutoLinks",function(text,options,globals){"use strict";if(!options.simplifiedAutoLink){return text}text=globals.converter._dispatch("simplifiedAutoLinks.before",text,options,globals);if(options.excludeTrailingPunctuationFromURLs){text=text.replace(simpleURLRegex2,replaceLink(options))}else{text=text.replace(simpleURLRegex,replaceLink(options))}text=text.replace(simpleMailRegex,replaceMail(options,globals));text=globals.converter._dispatch("simplifiedAutoLinks.after",text,options,globals);return text});showdown.subParser("blockGamut",function(text,options,globals){"use strict";text=globals.converter._dispatch("blockGamut.before",text,options,globals);text=showdown.subParser("blockQuotes")(text,options,globals);text=showdown.subParser("headers")(text,options,globals);text=showdown.subParser("horizontalRule")(text,options,globals);text=showdown.subParser("lists")(text,options,globals);text=showdown.subParser("codeBlocks")(text,options,globals);text=showdown.subParser("tables")(text,options,globals);text=showdown.subParser("hashHTMLBlocks")(text,options,globals);text=showdown.subParser("paragraphs")(text,options,globals);text=globals.converter._dispatch("blockGamut.after",text,options,globals);return text});showdown.subParser("blockQuotes",function(text,options,globals){"use strict";text=globals.converter._dispatch("blockQuotes.before",text,options,globals);text=text.replace(/((^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(wholeMatch,m1){var bq=m1;bq=bq.replace(/^[ \t]*>[ \t]?/gm,"¨0");bq=bq.replace(/¨0/g,"");bq=bq.replace(/^[ \t]+$/gm,"");bq=showdown.subParser("githubCodeBlocks")(bq,options,globals);bq=showdown.subParser("blockGamut")(bq,options,globals);bq=bq.replace(/(^|\n)/g,"$1 ");bq=bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(wholeMatch,m1){var pre=m1;pre=pre.replace(/^ /gm,"¨0");pre=pre.replace(/¨0/g,"");return pre});return showdown.subParser("hashBlock")("<blockquote>\n"+bq+"\n</blockquote>",options,globals)});text=globals.converter._dispatch("blockQuotes.after",text,options,globals);return text});showdown.subParser("codeBlocks",function(text,options,globals){"use strict";text=globals.converter._dispatch("codeBlocks.before",text,options,globals);text+="¨0";var pattern=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;text=text.replace(pattern,function(wholeMatch,m1,m2){var codeblock=m1,nextChar=m2,end="\n";codeblock=showdown.subParser("outdent")(codeblock,options,globals);codeblock=showdown.subParser("encodeCode")(codeblock,options,globals);codeblock=showdown.subParser("detab")(codeblock,options,globals);codeblock=codeblock.replace(/^\n+/g,"");codeblock=codeblock.replace(/\n+$/g,"");if(options.omitExtraWLInCodeBlocks){end=""}codeblock="<pre><code>"+codeblock+end+"</code></pre>";return showdown.subParser("hashBlock")(codeblock,options,globals)+nextChar});text=text.replace(/¨0/,"");text=globals.converter._dispatch("codeBlocks.after",text,options,globals);return text});showdown.subParser("codeSpans",function(text,options,globals){"use strict";text=globals.converter._dispatch("codeSpans.before",text,options,globals);if(typeof text==="undefined"){text=""}text=text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(wholeMatch,m1,m2,m3){var c=m3;c=c.replace(/^([ \t]*)/g,"");c=c.replace(/[ \t]*$/g,"");c=showdown.subParser("encodeCode")(c,options,globals);return m1+"<code>"+c+"</code>"});text=globals.converter._dispatch("codeSpans.after",text,options,globals);return text});showdown.subParser("detab",function(text,options,globals){"use strict";text=globals.converter._dispatch("detab.before",text,options,globals);text=text.replace(/\t(?=\t)/g," ");text=text.replace(/\t/g,"¨A¨B");text=text.replace(/¨B(.+?)¨A/g,function(wholeMatch,m1){var leadingText=m1,numSpaces=4-leadingText.length%4;for(var i=0;i<numSpaces;i++){leadingText+=" "}return leadingText});text=text.replace(/¨A/g," ");text=text.replace(/¨B/g,"");text=globals.converter._dispatch("detab.after",text,options,globals);return text});showdown.subParser("encodeAmpsAndAngles",function(text,options,globals){"use strict";text=globals.converter._dispatch("encodeAmpsAndAngles.before",text,options,globals);text=text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");text=text.replace(/<(?![a-z\/?$!])/gi,"&lt;");text=text.replace(/</g,"&lt;");text=text.replace(/>/g,"&gt;");text=globals.converter._dispatch("encodeAmpsAndAngles.after",text,options,globals);return text});showdown.subParser("encodeBackslashEscapes",function(text,options,globals){"use strict";text=globals.converter._dispatch("encodeBackslashEscapes.before",text,options,globals);text=text.replace(/\\(\\)/g,showdown.helper.escapeCharactersCallback);text=text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,showdown.helper.escapeCharactersCallback);text=globals.converter._dispatch("encodeBackslashEscapes.after",text,options,globals);return text});showdown.subParser("encodeCode",function(text,options,globals){"use strict";text=globals.converter._dispatch("encodeCode.before",text,options,globals);text=text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,showdown.helper.escapeCharactersCallback);text=globals.converter._dispatch("encodeCode.after",text,options,globals);return text});showdown.subParser("escapeSpecialCharsWithinTagAttributes",function(text,options,globals){"use strict";text=globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",text,options,globals);var regex=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;text=text.replace(regex,function(wholeMatch){return wholeMatch.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,showdown.helper.escapeCharactersCallback)});text=globals.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",text,options,globals);return text});showdown.subParser("githubCodeBlocks",function(text,options,globals){"use strict";if(!options.ghCodeBlocks){return text}text=globals.converter._dispatch("githubCodeBlocks.before",text,options,globals);text+="¨0";text=text.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(wholeMatch,language,codeblock){var end=options.omitExtraWLInCodeBlocks?"":"\n";codeblock=showdown.subParser("encodeCode")(codeblock,options,globals);codeblock=showdown.subParser("detab")(codeblock,options,globals);codeblock=codeblock.replace(/^\n+/g,"");codeblock=codeblock.replace(/\n+$/g,"");codeblock="<pre><code"+(language?' class="'+language+" language-"+language+'"':"")+">"+codeblock+end+"</code></pre>";codeblock=showdown.subParser("hashBlock")(codeblock,options,globals);return"\n\n¨G"+(globals.ghCodeBlocks.push({text:wholeMatch,codeblock:codeblock})-1)+"G\n\n"});text=text.replace(/¨0/,"");return globals.converter._dispatch("githubCodeBlocks.after",text,options,globals)});showdown.subParser("hashBlock",function(text,options,globals){"use strict";text=globals.converter._dispatch("hashBlock.before",text,options,globals);text=text.replace(/(^\n+|\n+$)/g,"");text="\n\n¨K"+(globals.gHtmlBlocks.push(text)-1)+"K\n\n";text=globals.converter._dispatch("hashBlock.after",text,options,globals);return text});showdown.subParser("hashCodeTags",function(text,options,globals){"use strict";text=globals.converter._dispatch("hashCodeTags.before",text,options,globals);var repFunc=function(wholeMatch,match,left,right){var codeblock=left+showdown.subParser("encodeCode")(match,options,globals)+right;return"¨C"+(globals.gHtmlSpans.push(codeblock)-1)+"C"};text=showdown.helper.replaceRecursiveRegExp(text,repFunc,"<code\\b[^>]*>","</code>","gim");text=globals.converter._dispatch("hashCodeTags.after",text,options,globals);return text});showdown.subParser("hashElement",function(text,options,globals){"use strict";return function(wholeMatch,m1){var blockText=m1;blockText=blockText.replace(/\n\n/g,"\n");blockText=blockText.replace(/^\n/,"");blockText=blockText.replace(/\n+$/g,"");blockText="\n\n¨K"+(globals.gHtmlBlocks.push(blockText)-1)+"K\n\n";return blockText}});showdown.subParser("hashHTMLBlocks",function(text,options,globals){"use strict";text=globals.converter._dispatch("hashHTMLBlocks.before",text,options,globals);var blockTags=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],repFunc=function(wholeMatch,match,left,right){var txt=wholeMatch;if(left.search(/\bmarkdown\b/)!==-1){txt=left+globals.converter.makeHtml(match)+right}return"\n\n¨K"+(globals.gHtmlBlocks.push(txt)-1)+"K\n\n"};for(var i=0;i<blockTags.length;++i){var opTagPos,rgx1=new RegExp("^ {0,3}<"+blockTags[i]+"\\b[^>]*>","im"),patLeft="<"+blockTags[i]+"\\b[^>]*>",patRight="</"+blockTags[i]+">";while((opTagPos=showdown.helper.regexIndexOf(text,rgx1))!==-1){var subTexts=showdown.helper.splitAtIndex(text,opTagPos),newSubText1=showdown.helper.replaceRecursiveRegExp(subTexts[1],repFunc,patLeft,patRight,"im");if(newSubText1===subTexts[1]){break}text=subTexts[0].concat(newSubText1)}}text=text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,showdown.subParser("hashElement")(text,options,globals));text=showdown.helper.replaceRecursiveRegExp(text,function(txt){return"\n\n¨K"+(globals.gHtmlBlocks.push(txt)-1)+"K\n\n"},"^ {0,3}<!--","-->","gm");text=text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,showdown.subParser("hashElement")(text,options,globals));text=globals.converter._dispatch("hashHTMLBlocks.after",text,options,globals);return text});showdown.subParser("hashHTMLSpans",function(text,options,globals){"use strict";text=globals.converter._dispatch("hashHTMLSpans.before",text,options,globals);function hashHTMLSpan(html){return"¨C"+(globals.gHtmlSpans.push(html)-1)+"C"}text=text.replace(/<[^>]+?\/>/gi,function(wm){return hashHTMLSpan(wm)});text=text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(wm){return hashHTMLSpan(wm)});text=text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(wm){return hashHTMLSpan(wm)});text=text.replace(/<[^>]+?>/gi,function(wm){return hashHTMLSpan(wm)});text=globals.converter._dispatch("hashHTMLSpans.after",text,options,globals);return text});showdown.subParser("unhashHTMLSpans",function(text,options,globals){"use strict";text=globals.converter._dispatch("unhashHTMLSpans.before",text,options,globals);for(var i=0;i<globals.gHtmlSpans.length;++i){var repText=globals.gHtmlSpans[i],limit=0;while(/¨C(\d+)C/.test(repText)){var num=RegExp.$1;repText=repText.replace("¨C"+num+"C",globals.gHtmlSpans[num]);if(limit===10){break}++limit}text=text.replace("¨C"+i+"C",repText)}text=globals.converter._dispatch("unhashHTMLSpans.after",text,options,globals);return text});showdown.subParser("hashPreCodeTags",function(text,options,globals){"use strict";text=globals.converter._dispatch("hashPreCodeTags.before",text,options,globals);var repFunc=function(wholeMatch,match,left,right){var codeblock=left+showdown.subParser("encodeCode")(match,options,globals)+right;return"\n\n¨G"+(globals.ghCodeBlocks.push({text:wholeMatch,codeblock:codeblock})-1)+"G\n\n"};text=showdown.helper.replaceRecursiveRegExp(text,repFunc,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim");text=globals.converter._dispatch("hashPreCodeTags.after",text,options,globals);return text});showdown.subParser("headers",function(text,options,globals){"use strict";text=globals.converter._dispatch("headers.before",text,options,globals);var headerLevelStart=isNaN(parseInt(options.headerLevelStart))?1:parseInt(options.headerLevelStart),ghHeaderId=options.ghCompatibleHeaderId,setextRegexH1=options.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,setextRegexH2=options.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;text=text.replace(setextRegexH1,function(wholeMatch,m1){var spanGamut=showdown.subParser("spanGamut")(m1,options,globals),hID=options.noHeaderId?"":' id="'+headerId(m1)+'"',hLevel=headerLevelStart,hashBlock="<h"+hLevel+hID+">"+spanGamut+"</h"+hLevel+">";return showdown.subParser("hashBlock")(hashBlock,options,globals)});text=text.replace(setextRegexH2,function(matchFound,m1){var spanGamut=showdown.subParser("spanGamut")(m1,options,globals),hID=options.noHeaderId?"":' id="'+headerId(m1)+'"',hLevel=headerLevelStart+1,hashBlock="<h"+hLevel+hID+">"+spanGamut+"</h"+hLevel+">";return showdown.subParser("hashBlock")(hashBlock,options,globals)});var atxStyle=options.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;text=text.replace(atxStyle,function(wholeMatch,m1,m2){var hText=m2;if(options.customizedHeaderId){hText=m2.replace(/\s?\{([^{]+?)}\s*$/,"")}var span=showdown.subParser("spanGamut")(hText,options,globals),hID=options.noHeaderId?"":' id="'+headerId(m2)+'"',hLevel=headerLevelStart-1+m1.length,header="<h"+hLevel+hID+">"+span+"</h"+hLevel+">";return showdown.subParser("hashBlock")(header,options,globals)});function headerId(m){var title;if(options.customizedHeaderId){var match=m.match(/\{([^{]+?)}\s*$/);if(match&&match[1]){m=match[1]}}if(showdown.helper.isString(options.prefixHeaderId)){title=options.prefixHeaderId+m}else if(options.prefixHeaderId===true){title="section "+m}else{title=m}if(ghHeaderId){title=title.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase()}else{title=title.replace(/[^\w]/g,"").toLowerCase()}if(globals.hashLinkCounts[title]){title=title+"-"+globals.hashLinkCounts[title]++}else{globals.hashLinkCounts[title]=1}return title}text=globals.converter._dispatch("headers.after",text,options,globals);return text});showdown.subParser("horizontalRule",function(text,options,globals){"use strict";text=globals.converter._dispatch("horizontalRule.before",text,options,globals);var key=showdown.subParser("hashBlock")("<hr />",options,globals);text=text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,key);text=text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,key);text=text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,key);text=globals.converter._dispatch("horizontalRule.after",text,options,globals);return text});showdown.subParser("images",function(text,options,globals){"use strict";text=globals.converter._dispatch("images.before",text,options,globals);var inlineRegExp=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,crazyRegExp=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,referenceRegExp=/!\[([^\]]*?)] ?(?:\n *)?\[(.*?)]()()()()()/g,refShortcutRegExp=/!\[([^\[\]]+)]()()()()()/g;function writeImageTag(wholeMatch,altText,linkId,url,width,height,m5,title){var gUrls=globals.gUrls,gTitles=globals.gTitles,gDims=globals.gDimensions;linkId=linkId.toLowerCase();if(!title){title=""}if(wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1){url=""}else if(url===""||url===null){if(linkId===""||linkId===null){linkId=altText.toLowerCase().replace(/ ?\n/g," ")}url="#"+linkId;if(!showdown.helper.isUndefined(gUrls[linkId])){url=gUrls[linkId];if(!showdown.helper.isUndefined(gTitles[linkId])){title=gTitles[linkId]}if(!showdown.helper.isUndefined(gDims[linkId])){width=gDims[linkId].width;height=gDims[linkId].height}}else{return wholeMatch}}altText=altText.replace(/"/g,"&quot;").replace(showdown.helper.regexes.asteriskAndDash,showdown.helper.escapeCharactersCallback);url=url.replace(showdown.helper.regexes.asteriskAndDash,showdown.helper.escapeCharactersCallback);var result='<img src="'+url+'" alt="'+altText+'"';if(title){title=title.replace(/"/g,"&quot;").replace(showdown.helper.regexes.asteriskAndDash,showdown.helper.escapeCharactersCallback);result+=' title="'+title+'"'}if(width&&height){width=width==="*"?"auto":width;height=height==="*"?"auto":height;result+=' width="'+width+'"';result+=' height="'+height+'"'}result+=" />";return result}text=text.replace(referenceRegExp,writeImageTag);text=text.replace(crazyRegExp,writeImageTag);text=text.replace(inlineRegExp,writeImageTag);text=text.replace(refShortcutRegExp,writeImageTag);text=globals.converter._dispatch("images.after",text,options,globals);return text});showdown.subParser("italicsAndBold",function(text,options,globals){"use strict";text=globals.converter._dispatch("italicsAndBold.before",text,options,globals);function parseInside(txt,left,right){if(options.simplifiedAutoLink){txt=showdown.subParser("simplifiedAutoLinks")(txt,options,globals)}return left+txt+right}if(options.literalMidWordUnderscores){text=text.replace(/\b___(\S[\s\S]*)___\b/g,function(wm,txt){return parseInside(txt,"<strong><em>","</em></strong>")});text=text.replace(/\b__(\S[\s\S]*)__\b/g,function(wm,txt){return parseInside(txt,"<strong>","</strong>")});text=text.replace(/\b_(\S[\s\S]*?)_\b/g,function(wm,txt){return parseInside(txt,"<em>","</em>")})}else{text=text.replace(/___(\S[\s\S]*?)___/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<strong><em>","</em></strong>"):wm});text=text.replace(/__(\S[\s\S]*?)__/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<strong>","</strong>"):wm});text=text.replace(/_([^\s_][\s\S]*?)_/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<em>","</em>"):wm})}if(options.literalMidWordAsterisks){text=text.trim().replace(/(?:^| +)\*{3}(\S[\s\S]*?)\*{3}(?: +|$)/g,function(wm,txt){return parseInside(txt," <strong><em>","</em></strong> ")});text=text.trim().replace(/(?:^| +)\*{2}(\S[\s\S]*?)\*{2}(?: +|$)/g,function(wm,txt){return parseInside(txt," <strong>","</strong> ")});text=text.trim().replace(/(?:^| +)\*{1}(\S[\s\S]*?)\*{1}(?: +|$)/g,function(wm,txt){return parseInside(txt," <em>","</em>"+(wm.slice(-1)===" "?" ":""))})}else{text=text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<strong><em>","</em></strong>"):wm});text=text.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<strong>","</strong>"):wm});text=text.replace(/\*([^\s*][\s\S]*?)\*/g,function(wm,m){return/\S$/.test(m)?parseInside(m,"<em>","</em>"):wm})}text=globals.converter._dispatch("italicsAndBold.after",text,options,globals);return text});showdown.subParser("lists",function(text,options,globals){"use strict";text=globals.converter._dispatch("lists.before",text,options,globals);function processListItems(listStr,trimTrailing){globals.gListLevel++;listStr=listStr.replace(/\n{2,}$/,"\n");listStr+="¨0";var rgx=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,isParagraphed=/\n[ \t]*\n(?!¨0)/.test(listStr);if(options.disableForced4SpacesIndentedSublists){rgx=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm}listStr=listStr.replace(rgx,function(wholeMatch,m1,m2,m3,m4,taskbtn,checked){checked=checked&&checked.trim()!=="";var item=showdown.subParser("outdent")(m4,options,globals),bulletStyle="";if(taskbtn&&options.tasklists){bulletStyle=' class="task-list-item" style="list-style-type: none;"';item=item.replace(/^[ \t]*\[(x|X| )?]/m,function(){var otp='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';if(checked){otp+=" checked"}otp+=">";return otp})}item=item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(wm2){return"¨A"+wm2});if(m1||item.search(/\n{2,}/)>-1){item=showdown.subParser("githubCodeBlocks")(item,options,globals);item=showdown.subParser("blockGamut")(item,options,globals);
}else{item=showdown.subParser("lists")(item,options,globals);item=item.replace(/\n$/,"");item=showdown.subParser("hashHTMLBlocks")(item,options,globals);item=item.replace(/\n\n+/g,"\n\n");item=item.replace(/\n\n/g,"¨B");if(isParagraphed){item=showdown.subParser("paragraphs")(item,options,globals)}else{item=showdown.subParser("spanGamut")(item,options,globals)}item=item.replace(/¨B/g,"\n\n")}item=item.replace("¨A","");item="<li"+bulletStyle+">"+item+"</li>\n";return item});listStr=listStr.replace(/¨0/g,"");globals.gListLevel--;if(trimTrailing){listStr=listStr.replace(/\s+$/,"")}return listStr}function parseConsecutiveLists(list,listType,trimTrailing){var olRgx=options.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,ulRgx=options.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,counterRxg=listType==="ul"?olRgx:ulRgx,result="";if(list.search(counterRxg)!==-1){(function parseCL(txt){var pos=txt.search(counterRxg);if(pos!==-1){result+="\n<"+listType+">\n"+processListItems(txt.slice(0,pos),!!trimTrailing)+"</"+listType+">\n";listType=listType==="ul"?"ol":"ul";counterRxg=listType==="ul"?olRgx:ulRgx;parseCL(txt.slice(pos))}else{result+="\n<"+listType+">\n"+processListItems(txt,!!trimTrailing)+"</"+listType+">\n"}})(list)}else{result="\n<"+listType+">\n"+processListItems(list,!!trimTrailing)+"</"+listType+">\n"}return result}text+="¨0";if(globals.gListLevel){text=text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(wholeMatch,list,m2){var listType=m2.search(/[*+-]/g)>-1?"ul":"ol";return parseConsecutiveLists(list,listType,true)})}else{text=text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(wholeMatch,m1,list,m3){var listType=m3.search(/[*+-]/g)>-1?"ul":"ol";return parseConsecutiveLists(list,listType,false)})}text=text.replace(/¨0/,"");text=globals.converter._dispatch("lists.after",text,options,globals);return text});showdown.subParser("outdent",function(text,options,globals){"use strict";text=globals.converter._dispatch("outdent.before",text,options,globals);text=text.replace(/^(\t|[ ]{1,4})/gm,"¨0");text=text.replace(/¨0/g,"");text=globals.converter._dispatch("outdent.after",text,options,globals);return text});showdown.subParser("paragraphs",function(text,options,globals){"use strict";text=globals.converter._dispatch("paragraphs.before",text,options,globals);text=text.replace(/^\n+/g,"");text=text.replace(/\n+$/g,"");var grafs=text.split(/\n{2,}/g),grafsOut=[],end=grafs.length;for(var i=0;i<end;i++){var str=grafs[i];if(str.search(/¨(K|G)(\d+)\1/g)>=0){grafsOut.push(str)}else if(str.search(/\S/)>=0){str=showdown.subParser("spanGamut")(str,options,globals);str=str.replace(/^([ \t]*)/g,"<p>");str+="</p>";grafsOut.push(str)}}end=grafsOut.length;for(i=0;i<end;i++){var blockText="",grafsOutIt=grafsOut[i],codeFlag=false;while(/¨(K|G)(\d+)\1/.test(grafsOutIt)){var delim=RegExp.$1,num=RegExp.$2;if(delim==="K"){blockText=globals.gHtmlBlocks[num]}else{if(codeFlag){blockText=showdown.subParser("encodeCode")(globals.ghCodeBlocks[num].text,options,globals)}else{blockText=globals.ghCodeBlocks[num].codeblock}}blockText=blockText.replace(/\$/g,"$$$$");grafsOutIt=grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,blockText);if(/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)){codeFlag=true}}grafsOut[i]=grafsOutIt}text=grafsOut.join("\n");text=text.replace(/^\n+/g,"");text=text.replace(/\n+$/g,"");return globals.converter._dispatch("paragraphs.after",text,options,globals)});showdown.subParser("runExtension",function(ext,text,options,globals){"use strict";if(ext.filter){text=ext.filter(text,globals.converter,options)}else if(ext.regex){var re=ext.regex;if(!(re instanceof RegExp)){re=new RegExp(re,"g")}text=text.replace(re,ext.replace)}return text});showdown.subParser("spanGamut",function(text,options,globals){"use strict";text=globals.converter._dispatch("spanGamut.before",text,options,globals);text=showdown.subParser("codeSpans")(text,options,globals);text=showdown.subParser("escapeSpecialCharsWithinTagAttributes")(text,options,globals);text=showdown.subParser("encodeBackslashEscapes")(text,options,globals);text=showdown.subParser("images")(text,options,globals);text=showdown.subParser("anchors")(text,options,globals);text=showdown.subParser("autoLinks")(text,options,globals);text=showdown.subParser("italicsAndBold")(text,options,globals);text=showdown.subParser("strikethrough")(text,options,globals);text=showdown.subParser("simplifiedAutoLinks")(text,options,globals);text=showdown.subParser("hashHTMLSpans")(text,options,globals);text=showdown.subParser("encodeAmpsAndAngles")(text,options,globals);if(options.simpleLineBreaks){text=text.replace(/\n/g,"<br />\n")}else{text=text.replace(/ +\n/g,"<br />\n")}text=globals.converter._dispatch("spanGamut.after",text,options,globals);return text});showdown.subParser("strikethrough",function(text,options,globals){"use strict";function parseInside(txt){if(options.simplifiedAutoLink){txt=showdown.subParser("simplifiedAutoLinks")(txt,options,globals)}return"<del>"+txt+"</del>"}if(options.strikethrough){text=globals.converter._dispatch("strikethrough.before",text,options,globals);text=text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(wm,txt){return parseInside(txt)});text=globals.converter._dispatch("strikethrough.after",text,options,globals)}return text});showdown.subParser("stripLinkDefinitions",function(text,options,globals){"use strict";var regex=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm;text+="¨0";text=text.replace(regex,function(wholeMatch,linkId,url,width,height,blankLines,title){linkId=linkId.toLowerCase();globals.gUrls[linkId]=showdown.subParser("encodeAmpsAndAngles")(url,options,globals);if(blankLines){return blankLines+title}else{if(title){globals.gTitles[linkId]=title.replace(/"|'/g,"&quot;")}if(options.parseImgDimensions&&width&&height){globals.gDimensions[linkId]={width:width,height:height}}}return""});text=text.replace(/¨0/,"");return text});showdown.subParser("tables",function(text,options,globals){"use strict";if(!options.tables){return text}var tableRgx=/^ {0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|¨0)/gm;function parseStyles(sLine){if(/^:[ \t]*--*$/.test(sLine)){return' style="text-align:left;"'}else if(/^--*[ \t]*:[ \t]*$/.test(sLine)){return' style="text-align:right;"'}else if(/^:[ \t]*--*[ \t]*:$/.test(sLine)){return' style="text-align:center;"'}else{return""}}function parseHeaders(header,style){var id="";header=header.trim();if(options.tableHeaderId){id=' id="'+header.replace(/ /g,"_").toLowerCase()+'"'}header=showdown.subParser("spanGamut")(header,options,globals);return"<th"+id+style+">"+header+"</th>\n"}function parseCells(cell,style){var subText=showdown.subParser("spanGamut")(cell,options,globals);return"<td"+style+">"+subText+"</td>\n"}function buildTable(headers,cells){var tb="<table>\n<thead>\n<tr>\n",tblLgn=headers.length;for(var i=0;i<tblLgn;++i){tb+=headers[i]}tb+="</tr>\n</thead>\n<tbody>\n";for(i=0;i<cells.length;++i){tb+="<tr>\n";for(var ii=0;ii<tblLgn;++ii){tb+=cells[i][ii]}tb+="</tr>\n"}tb+="</tbody>\n</table>\n";return tb}text=globals.converter._dispatch("tables.before",text,options,globals);text=text.replace(/\\(\|)/g,showdown.helper.escapeCharactersCallback);text=text.replace(tableRgx,function(rawTable){var i,tableLines=rawTable.split("\n");for(i=0;i<tableLines.length;++i){if(/^ {0,3}\|/.test(tableLines[i])){tableLines[i]=tableLines[i].replace(/^ {0,3}\|/,"")}if(/\|[ \t]*$/.test(tableLines[i])){tableLines[i]=tableLines[i].replace(/\|[ \t]*$/,"")}}var rawHeaders=tableLines[0].split("|").map(function(s){return s.trim()}),rawStyles=tableLines[1].split("|").map(function(s){return s.trim()}),rawCells=[],headers=[],styles=[],cells=[];tableLines.shift();tableLines.shift();for(i=0;i<tableLines.length;++i){if(tableLines[i].trim()===""){continue}rawCells.push(tableLines[i].split("|").map(function(s){return s.trim()}))}if(rawHeaders.length<rawStyles.length){return rawTable}for(i=0;i<rawStyles.length;++i){styles.push(parseStyles(rawStyles[i]))}for(i=0;i<rawHeaders.length;++i){if(showdown.helper.isUndefined(styles[i])){styles[i]=""}headers.push(parseHeaders(rawHeaders[i],styles[i]))}for(i=0;i<rawCells.length;++i){var row=[];for(var ii=0;ii<headers.length;++ii){if(showdown.helper.isUndefined(rawCells[i][ii])){}row.push(parseCells(rawCells[i][ii],styles[ii]))}cells.push(row)}return buildTable(headers,cells)});text=globals.converter._dispatch("tables.after",text,options,globals);return text});showdown.subParser("unescapeSpecialChars",function(text,options,globals){"use strict";text=globals.converter._dispatch("unescapeSpecialChars.before",text,options,globals);text=text.replace(/¨E(\d+)E/g,function(wholeMatch,m1){var charCodeToReplace=parseInt(m1);return String.fromCharCode(charCodeToReplace)});text=globals.converter._dispatch("unescapeSpecialChars.after",text,options,globals);return text});var root=this;if("object"!=="undefined"&&module.exports){module.exports=showdown}else if(typeof undefined==="function"&&undefined.amd){undefined(function(){"use strict";return showdown})}else{root.showdown=showdown}}).call(commonjsGlobal)});riot$1.tag2("editor",'<div class="centered container"> <div class="columns"> <div class="column col-6"> <textarea onfocus="{clearplaceholder}" onblur="{checkplaceholder}" oninput="{echo}" rows="30" cols="10" __disabled="{⁗⁗}" class="editor form-input centered" ref="textarea" maxlength="{this.maxlength}"> {placeholder} </textarea> <button onclick="{submit}" class="btn post-submit centered"> Submit Post </button> </div> <div class="column col-6"> <raw content="{this.converted}"></raw> </div> </div> </div>',"","",function(opts){this.R=index;this.converter=new showdown.Converter;this.converted="<h3>Nothing here yet</h3>";this.placeholderText="Write a post!";this.placeholder=this.placeholderText;this.focused=false;this.clearplaceholder=function(){if(!this.focused){this.update({placeholder:"",focused:true})}}.bind(this);this.checkplaceholder=function(){if(this.refs.textarea.value.trim().length==0){this.update({placeholder:this.placeholderText,focused:false})}}.bind(this);this.echo=function(ev){this.update({converted:this.converter.makeHtml(this.refs.textarea.value.trim())})}.bind(this);var self=this;this.submit=function(){var post={author:"name",text:this.refs.textarea.value};console.log("Submitting the post");console.log(post)}.bind(this)});var immutable=createCommonjsModule(function(module,exports){(function(global,factory){module.exports=factory()})(commonjsGlobal,function(){"use strict";var SLICE$0=Array.prototype.slice;function createClass(ctor,superClass){if(superClass){ctor.prototype=Object.create(superClass.prototype)}ctor.prototype.constructor=ctor}function Iterable(value){return isIterable(value)?value:Seq(value)}createClass(KeyedIterable,Iterable);function KeyedIterable(value){return isKeyed(value)?value:KeyedSeq(value)}createClass(IndexedIterable,Iterable);function IndexedIterable(value){return isIndexed(value)?value:IndexedSeq(value)}createClass(SetIterable,Iterable);function SetIterable(value){return isIterable(value)&&!isAssociative(value)?value:SetSeq(value)}function isIterable(maybeIterable){return!!(maybeIterable&&maybeIterable[IS_ITERABLE_SENTINEL])}function isKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL])}function isIndexed(maybeIndexed){return!!(maybeIndexed&&maybeIndexed[IS_INDEXED_SENTINEL])}function isAssociative(maybeAssociative){return isKeyed(maybeAssociative)||isIndexed(maybeAssociative)}function isOrdered(maybeOrdered){return!!(maybeOrdered&&maybeOrdered[IS_ORDERED_SENTINEL])}Iterable.isIterable=isIterable;Iterable.isKeyed=isKeyed;Iterable.isIndexed=isIndexed;Iterable.isAssociative=isAssociative;Iterable.isOrdered=isOrdered;Iterable.Keyed=KeyedIterable;Iterable.Indexed=IndexedIterable;Iterable.Set=SetIterable;var IS_ITERABLE_SENTINEL="@@__IMMUTABLE_ITERABLE__@@";var IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";var IS_INDEXED_SENTINEL="@@__IMMUTABLE_INDEXED__@@";var IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";var DELETE="delete";var SHIFT=5;var SIZE=1<<SHIFT;var MASK=SIZE-1;var NOT_SET={};var CHANGE_LENGTH={value:false};var DID_ALTER={value:false};function MakeRef(ref){ref.value=false;return ref}function SetRef(ref){ref&&(ref.value=true)}function OwnerID(){}function arrCopy(arr,offset){offset=offset||0;var len=Math.max(0,arr.length-offset);var newArr=new Array(len);for(var ii=0;ii<len;ii++){newArr[ii]=arr[ii+offset]}return newArr}function ensureSize(iter){if(iter.size===undefined){iter.size=iter.__iterate(returnTrue)}return iter.size}function wrapIndex(iter,index){if(typeof index!=="number"){var uint32Index=index>>>0;if(""+uint32Index!==index||uint32Index===4294967295){return NaN}index=uint32Index}return index<0?ensureSize(iter)+index:index}function returnTrue(){return true}function wholeSlice(begin,end,size){return(begin===0||size!==undefined&&begin<=-size)&&(end===undefined||size!==undefined&&end>=size)}function resolveBegin(begin,size){return resolveIndex(begin,size,0)}function resolveEnd(end,size){return resolveIndex(end,size,size)}function resolveIndex(index,size,defaultIndex){return index===undefined?defaultIndex:index<0?Math.max(0,size+index):size===undefined?index:Math.min(size,index)}var ITERATE_KEYS=0;var ITERATE_VALUES=1;var ITERATE_ENTRIES=2;var REAL_ITERATOR_SYMBOL=typeof Symbol==="function"&&Symbol.iterator;var FAUX_ITERATOR_SYMBOL="@@iterator";var ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL;function Iterator(next){this.next=next}Iterator.prototype.toString=function(){return"[Iterator]"};Iterator.KEYS=ITERATE_KEYS;Iterator.VALUES=ITERATE_VALUES;Iterator.ENTRIES=ITERATE_ENTRIES;Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()};Iterator.prototype[ITERATOR_SYMBOL]=function(){return this};function iteratorValue(type,k,v,iteratorResult){var value=type===0?k:type===1?v:[k,v];iteratorResult?iteratorResult.value=value:iteratorResult={value:value,done:false};return iteratorResult}function iteratorDone(){return{value:undefined,done:true}}function hasIterator(maybeIterable){return!!getIteratorFn(maybeIterable)}function isIterator(maybeIterator){return maybeIterator&&typeof maybeIterator.next==="function"}function getIterator(iterable){var iteratorFn=getIteratorFn(iterable);return iteratorFn&&iteratorFn.call(iterable)}function getIteratorFn(iterable){var iteratorFn=iterable&&(REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]||iterable[FAUX_ITERATOR_SYMBOL]);if(typeof iteratorFn==="function"){return iteratorFn}}function isArrayLike(value){return value&&typeof value.length==="number"}createClass(Seq,Iterable);function Seq(value){return value===null||value===undefined?emptySequence():isIterable(value)?value.toSeq():seqFromValue(value)}Seq.of=function(){return Seq(arguments)};Seq.prototype.toSeq=function(){return this};Seq.prototype.toString=function(){return this.__toString("Seq {","}")};Seq.prototype.cacheResult=function(){if(!this._cache&&this.__iterateUncached){this._cache=this.entrySeq().toArray();this.size=this._cache.length}return this};Seq.prototype.__iterate=function(fn,reverse){return seqIterate(this,fn,reverse,true)};Seq.prototype.__iterator=function(type,reverse){return seqIterator(this,type,reverse,true)};createClass(KeyedSeq,Seq);function KeyedSeq(value){return value===null||value===undefined?emptySequence().toKeyedSeq():isIterable(value)?isKeyed(value)?value.toSeq():value.fromEntrySeq():keyedSeqFromValue(value)}KeyedSeq.prototype.toKeyedSeq=function(){return this};createClass(IndexedSeq,Seq);function IndexedSeq(value){return value===null||value===undefined?emptySequence():!isIterable(value)?indexedSeqFromValue(value):isKeyed(value)?value.entrySeq():value.toIndexedSeq()}IndexedSeq.of=function(){return IndexedSeq(arguments)};IndexedSeq.prototype.toIndexedSeq=function(){return this};IndexedSeq.prototype.toString=function(){return this.__toString("Seq [","]")};IndexedSeq.prototype.__iterate=function(fn,reverse){return seqIterate(this,fn,reverse,false)};IndexedSeq.prototype.__iterator=function(type,reverse){return seqIterator(this,type,reverse,false)};createClass(SetSeq,Seq);function SetSeq(value){return(value===null||value===undefined?emptySequence():!isIterable(value)?indexedSeqFromValue(value):isKeyed(value)?value.entrySeq():value).toSetSeq()}SetSeq.of=function(){return SetSeq(arguments)};SetSeq.prototype.toSetSeq=function(){return this};Seq.isSeq=isSeq;Seq.Keyed=KeyedSeq;Seq.Set=SetSeq;Seq.Indexed=IndexedSeq;var IS_SEQ_SENTINEL="@@__IMMUTABLE_SEQ__@@";Seq.prototype[IS_SEQ_SENTINEL]=true;createClass(ArraySeq,IndexedSeq);function ArraySeq(array){this._array=array;this.size=array.length}ArraySeq.prototype.get=function(index,notSetValue){return this.has(index)?this._array[wrapIndex(this,index)]:notSetValue};ArraySeq.prototype.__iterate=function(fn,reverse){var this$1=this;var array=this._array;var maxIndex=array.length-1;for(var ii=0;ii<=maxIndex;ii++){if(fn(array[reverse?maxIndex-ii:ii],ii,this$1)===false){return ii+1}}return ii};ArraySeq.prototype.__iterator=function(type,reverse){var array=this._array;var maxIndex=array.length-1;var ii=0;return new Iterator(function(){return ii>maxIndex?iteratorDone():iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++])})};createClass(ObjectSeq,KeyedSeq);function ObjectSeq(object){var keys=Object.keys(object);this._object=object;this._keys=keys;this.size=keys.length}ObjectSeq.prototype.get=function(key,notSetValue){if(notSetValue!==undefined&&!this.has(key)){return notSetValue}return this._object[key]};ObjectSeq.prototype.has=function(key){return this._object.hasOwnProperty(key)};ObjectSeq.prototype.__iterate=function(fn,reverse){var this$1=this;var object=this._object;var keys=this._keys;var maxIndex=keys.length-1;for(var ii=0;ii<=maxIndex;ii++){var key=keys[reverse?maxIndex-ii:ii];if(fn(object[key],key,this$1)===false){return ii+1}}return ii};ObjectSeq.prototype.__iterator=function(type,reverse){var object=this._object;var keys=this._keys;var maxIndex=keys.length-1;var ii=0;return new Iterator(function(){var key=keys[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,key,object[key])})};ObjectSeq.prototype[IS_ORDERED_SENTINEL]=true;createClass(IterableSeq,IndexedSeq);function IterableSeq(iterable){this._iterable=iterable;this.size=iterable.length||iterable.size}IterableSeq.prototype.__iterateUncached=function(fn,reverse){var this$1=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterable=this._iterable;var iterator=getIterator(iterable);var iterations=0;if(isIterator(iterator)){var step;while(!(step=iterator.next()).done){if(fn(step.value,iterations++,this$1)===false){break}}}return iterations};IterableSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterable=this._iterable;var iterator=getIterator(iterable);if(!isIterator(iterator)){return new Iterator(iteratorDone)}var iterations=0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value)})};createClass(IteratorSeq,IndexedSeq);function IteratorSeq(iterator){this._iterator=iterator;this._iteratorCache=[]}IteratorSeq.prototype.__iterateUncached=function(fn,reverse){var this$1=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterator=this._iterator;var cache=this._iteratorCache;var iterations=0;while(iterations<cache.length){if(fn(cache[iterations],iterations++,this$1)===false){return iterations}}var step;while(!(step=iterator.next()).done){var val=step.value;cache[iterations]=val;if(fn(val,iterations++,this$1)===false){break}}return iterations};IteratorSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=this._iterator;var cache=this._iteratorCache;var iterations=0;return new Iterator(function(){if(iterations>=cache.length){var step=iterator.next();if(step.done){return step}cache[iterations]=step.value}return iteratorValue(type,iterations,cache[iterations++])})};function isSeq(maybeSeq){return!!(maybeSeq&&maybeSeq[IS_SEQ_SENTINEL])}var EMPTY_SEQ;function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(value){var seq=Array.isArray(value)?new ArraySeq(value).fromEntrySeq():isIterator(value)?new IteratorSeq(value).fromEntrySeq():hasIterator(value)?new IterableSeq(value).fromEntrySeq():typeof value==="object"?new ObjectSeq(value):undefined;if(!seq){throw new TypeError("Expected Array or iterable object of [k, v] entries, "+"or keyed object: "+value)}return seq}function indexedSeqFromValue(value){var seq=maybeIndexedSeqFromValue(value);if(!seq){throw new TypeError("Expected Array or iterable object of values: "+value)}return seq}function seqFromValue(value){var seq=maybeIndexedSeqFromValue(value)||typeof value==="object"&&new ObjectSeq(value);if(!seq){throw new TypeError("Expected Array or iterable object of values, or keyed object: "+value)}return seq}function maybeIndexedSeqFromValue(value){return isArrayLike(value)?new ArraySeq(value):isIterator(value)?new IteratorSeq(value):hasIterator(value)?new IterableSeq(value):undefined}function seqIterate(seq,fn,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1;for(var ii=0;ii<=maxIndex;ii++){var entry=cache[reverse?maxIndex-ii:ii];if(fn(entry[1],useKeys?entry[0]:ii,seq)===false){return ii+1}}return ii}return seq.__iterateUncached(fn,reverse)}function seqIterator(seq,type,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1;var ii=0;return new Iterator(function(){var entry=cache[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,useKeys?entry[0]:ii-1,entry[1])})}return seq.__iteratorUncached(type,reverse)}function fromJS(json,converter){return converter?fromJSWith(converter,json,"",{"":json}):fromJSDefault(json)}function fromJSWith(converter,json,key,parentJSON){if(Array.isArray(json)){return converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)}))}if(isPlainObj(json)){return converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)}))}return json}function fromJSDefault(json){if(Array.isArray(json)){return IndexedSeq(json).map(fromJSDefault).toList()}if(isPlainObj(json)){return KeyedSeq(json).map(fromJSDefault).toMap()}return json}function isPlainObj(value){return value&&(value.constructor===Object||value.constructor===undefined)}function is(valueA,valueB){if(valueA===valueB||valueA!==valueA&&valueB!==valueB){return true}if(!valueA||!valueB){return false}if(typeof valueA.valueOf==="function"&&typeof valueB.valueOf==="function"){valueA=valueA.valueOf();valueB=valueB.valueOf();if(valueA===valueB||valueA!==valueA&&valueB!==valueB){return true}if(!valueA||!valueB){return false}}if(typeof valueA.equals==="function"&&typeof valueB.equals==="function"&&valueA.equals(valueB)){return true}return false}function deepEqual(a,b){if(a===b){return true}if(!isIterable(b)||a.size!==undefined&&b.size!==undefined&&a.size!==b.size||a.__hash!==undefined&&b.__hash!==undefined&&a.__hash!==b.__hash||isKeyed(a)!==isKeyed(b)||isIndexed(a)!==isIndexed(b)||isOrdered(a)!==isOrdered(b)){return false}if(a.size===0&&b.size===0){return true}var notAssociative=!isAssociative(a);if(isOrdered(a)){var entries=a.entries();return b.every(function(v,k){var entry=entries.next().value;return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k))})&&entries.next().done}var flipped=false;if(a.size===undefined){if(b.size===undefined){if(typeof a.cacheResult==="function"){a.cacheResult()}}else{flipped=true;var _=a;a=b;b=_}}var allEqual=true;var bSize=b.__iterate(function(v,k){if(notAssociative?!a.has(v):flipped?!is(v,a.get(k,NOT_SET)):!is(a.get(k,NOT_SET),v)){allEqual=false;return false}});return allEqual&&a.size===bSize}createClass(Repeat,IndexedSeq);function Repeat(value,times){if(!(this instanceof Repeat)){return new Repeat(value,times)}this._value=value;this.size=times===undefined?Infinity:Math.max(0,times);if(this.size===0){if(EMPTY_REPEAT){return EMPTY_REPEAT}EMPTY_REPEAT=this}}Repeat.prototype.toString=function(){if(this.size===0){return"Repeat []"}return"Repeat [ "+this._value+" "+this.size+" times ]"};Repeat.prototype.get=function(index,notSetValue){return this.has(index)?this._value:notSetValue};Repeat.prototype.includes=function(searchValue){return is(this._value,searchValue)};Repeat.prototype.slice=function(begin,end){var size=this.size;return wholeSlice(begin,end,size)?this:new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size))};Repeat.prototype.reverse=function(){return this};Repeat.prototype.indexOf=function(searchValue){if(is(this._value,searchValue)){return 0}return-1};Repeat.prototype.lastIndexOf=function(searchValue){if(is(this._value,searchValue)){return this.size}return-1};Repeat.prototype.__iterate=function(fn,reverse){var this$1=this;for(var ii=0;ii<this.size;ii++){if(fn(this$1._value,ii,this$1)===false){return ii+1}}return ii};Repeat.prototype.__iterator=function(type,reverse){var this$0=this;var ii=0;return new Iterator(function(){return ii<this$0.size?iteratorValue(type,ii++,this$0._value):iteratorDone()})};Repeat.prototype.equals=function(other){return other instanceof Repeat?is(this._value,other._value):deepEqual(other)};var EMPTY_REPEAT;function invariant(condition,error){if(!condition){throw new Error(error)}}createClass(Range,IndexedSeq);function Range(start,end,step){if(!(this instanceof Range)){return new Range(start,end,step)}invariant(step!==0,"Cannot step a Range by 0");start=start||0;if(end===undefined){end=Infinity}step=step===undefined?1:Math.abs(step);if(end<start){step=-step}this._start=start;this._end=end;this._step=step;this.size=Math.max(0,Math.ceil((end-start)/step-1)+1);if(this.size===0){if(EMPTY_RANGE){return EMPTY_RANGE}EMPTY_RANGE=this}}Range.prototype.toString=function(){if(this.size===0){return"Range []"}return"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"};Range.prototype.get=function(index,notSetValue){return this.has(index)?this._start+wrapIndex(this,index)*this._step:notSetValue};Range.prototype.includes=function(searchValue){var possibleIndex=(searchValue-this._start)/this._step;return possibleIndex>=0&&possibleIndex<this.size&&possibleIndex===Math.floor(possibleIndex)};Range.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size)){return this}begin=resolveBegin(begin,this.size);end=resolveEnd(end,this.size);if(end<=begin){return new Range(0,0)}return new Range(this.get(begin,this._end),this.get(end,this._end),this._step)};Range.prototype.indexOf=function(searchValue){var offsetValue=searchValue-this._start;if(offsetValue%this._step===0){var index=offsetValue/this._step;if(index>=0&&index<this.size){return index}}return-1};Range.prototype.lastIndexOf=function(searchValue){return this.indexOf(searchValue)};Range.prototype.__iterate=function(fn,reverse){var this$1=this;var maxIndex=this.size-1;var step=this._step;var value=reverse?this._start+maxIndex*step:this._start;for(var ii=0;ii<=maxIndex;ii++){if(fn(value,ii,this$1)===false){return ii+1}value+=reverse?-step:step}return ii};Range.prototype.__iterator=function(type,reverse){var maxIndex=this.size-1;var step=this._step;var value=reverse?this._start+maxIndex*step:this._start;var ii=0;return new Iterator(function(){var v=value;value+=reverse?-step:step;return ii>maxIndex?iteratorDone():iteratorValue(type,ii++,v)})};Range.prototype.equals=function(other){return other instanceof Range?this._start===other._start&&this._end===other._end&&this._step===other._step:deepEqual(this,other)};var EMPTY_RANGE;createClass(Collection,Iterable);function Collection(){throw TypeError("Abstract")}createClass(KeyedCollection,Collection);function KeyedCollection(){}createClass(IndexedCollection,Collection);function IndexedCollection(){}createClass(SetCollection,Collection);function SetCollection(){}Collection.Keyed=KeyedCollection;Collection.Indexed=IndexedCollection;Collection.Set=SetCollection;var imul=typeof Math.imul==="function"&&Math.imul(4294967295,2)===-2?Math.imul:function imul(a,b){a=a|0;b=b|0;var c=a&65535;var d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0};function smi(i32){return i32>>>1&1073741824|i32&3221225471}function hash(o){if(o===false||o===null||o===undefined){return 0}if(typeof o.valueOf==="function"){o=o.valueOf();if(o===false||o===null||o===undefined){return 0}}if(o===true){return 1}var type=typeof o;if(type==="number"){if(o!==o||o===Infinity){return 0}var h=o|0;if(h!==o){h^=o*4294967295}while(o>4294967295){o/=4294967295;h^=o}return smi(h)}if(type==="string"){return o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o)}if(typeof o.hashCode==="function"){return o.hashCode()}if(type==="object"){return hashJSObj(o)}if(typeof o.toString==="function"){return hashString(o.toString())}throw new Error("Value type "+type+" cannot be hashed.")}function cachedHashString(string){var hash=stringHashCache[string];if(hash===undefined){hash=hashString(string);if(STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE){STRING_HASH_CACHE_SIZE=0;stringHashCache={}}STRING_HASH_CACHE_SIZE++;stringHashCache[string]=hash}return hash}function hashString(string){var hash=0;for(var ii=0;ii<string.length;ii++){hash=31*hash+string.charCodeAt(ii)|0}return smi(hash)}function hashJSObj(obj){var hash;if(usingWeakMap){hash=weakMap.get(obj);if(hash!==undefined){return hash}}hash=obj[UID_HASH_KEY];if(hash!==undefined){return hash}if(!canDefineProperty){hash=obj.propertyIsEnumerable&&obj.propertyIsEnumerable[UID_HASH_KEY];if(hash!==undefined){return hash}hash=getIENodeHash(obj);if(hash!==undefined){return hash}}hash=++objHashUID;if(objHashUID&1073741824){objHashUID=0}if(usingWeakMap){weakMap.set(obj,hash)}else if(isExtensible!==undefined&&isExtensible(obj)===false){throw new Error("Non-extensible objects are not allowed as keys.")}else if(canDefineProperty){Object.defineProperty(obj,UID_HASH_KEY,{enumerable:false,configurable:false,writable:false,value:hash})}else if(obj.propertyIsEnumerable!==undefined&&obj.propertyIsEnumerable===obj.constructor.prototype.propertyIsEnumerable){obj.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)};obj.propertyIsEnumerable[UID_HASH_KEY]=hash}else if(obj.nodeType!==undefined){obj[UID_HASH_KEY]=hash}else{throw new Error("Unable to set a non-enumerable property on object.")}return hash}var isExtensible=Object.isExtensible;var canDefineProperty=function(){try{Object.defineProperty({},"@",{});return true}catch(e){return false}}();function getIENodeHash(node){if(node&&node.nodeType>0){switch(node.nodeType){case 1:return node.uniqueID;case 9:return node.documentElement&&node.documentElement.uniqueID}}}var usingWeakMap=typeof WeakMap==="function";var weakMap;if(usingWeakMap){weakMap=new WeakMap}var objHashUID=0;var UID_HASH_KEY="__immutablehash__";if(typeof Symbol==="function"){UID_HASH_KEY=Symbol(UID_HASH_KEY)}var STRING_HASH_CACHE_MIN_STRLEN=16;var STRING_HASH_CACHE_MAX_SIZE=255;var STRING_HASH_CACHE_SIZE=0;var stringHashCache={};function assertNotInfinite(size){invariant(size!==Infinity,"Cannot perform this action with an infinite size.")}createClass(Map,KeyedCollection);function Map(value){return value===null||value===undefined?emptyMap():isMap(value)&&!isOrdered(value)?value:emptyMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v,k){return map.set(k,v)})})}Map.of=function(){var keyValues=SLICE$0.call(arguments,0);return emptyMap().withMutations(function(map){
for(var i=0;i<keyValues.length;i+=2){if(i+1>=keyValues.length){throw new Error("Missing value for key: "+keyValues[i])}map.set(keyValues[i],keyValues[i+1])}})};Map.prototype.toString=function(){return this.__toString("Map {","}")};Map.prototype.get=function(k,notSetValue){return this._root?this._root.get(0,undefined,k,notSetValue):notSetValue};Map.prototype.set=function(k,v){return updateMap(this,k,v)};Map.prototype.setIn=function(keyPath,v){return this.updateIn(keyPath,NOT_SET,function(){return v})};Map.prototype.remove=function(k){return updateMap(this,k,NOT_SET)};Map.prototype.deleteIn=function(keyPath){return this.updateIn(keyPath,function(){return NOT_SET})};Map.prototype.update=function(k,notSetValue,updater){return arguments.length===1?k(this):this.updateIn([k],notSetValue,updater)};Map.prototype.updateIn=function(keyPath,notSetValue,updater){if(!updater){updater=notSetValue;notSetValue=undefined}var updatedValue=updateInDeepMap(this,forceIterator(keyPath),notSetValue,updater);return updatedValue===NOT_SET?undefined:updatedValue};Map.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._root=null;this.__hash=undefined;this.__altered=true;return this}return emptyMap()};Map.prototype.merge=function(){return mergeIntoMapWith(this,undefined,arguments)};Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,merger,iters)};Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return typeof m.merge==="function"?m.merge.apply(m,iters):iters[iters.length-1]})};Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)};Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(merger),iters)};Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return typeof m.mergeDeep==="function"?m.mergeDeep.apply(m,iters):iters[iters.length-1]})};Map.prototype.sort=function(comparator){return OrderedMap(sortFactory(this,comparator))};Map.prototype.sortBy=function(mapper,comparator){return OrderedMap(sortFactory(this,comparator,mapper))};Map.prototype.withMutations=function(fn){var mutable=this.asMutable();fn(mutable);return mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this};Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)};Map.prototype.asImmutable=function(){return this.__ensureOwner()};Map.prototype.wasAltered=function(){return this.__altered};Map.prototype.__iterator=function(type,reverse){return new MapIterator(this,type,reverse)};Map.prototype.__iterate=function(fn,reverse){var this$0=this;var iterations=0;this._root&&this._root.iterate(function(entry){iterations++;return fn(entry[1],entry[0],this$0)},reverse);return iterations};Map.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;this.__altered=false;return this}return makeMap(this.size,this._root,ownerID,this.__hash)};function isMap(maybeMap){return!!(maybeMap&&maybeMap[IS_MAP_SENTINEL])}Map.isMap=isMap;var IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@";var MapPrototype=Map.prototype;MapPrototype[IS_MAP_SENTINEL]=true;MapPrototype[DELETE]=MapPrototype.remove;MapPrototype.removeIn=MapPrototype.deleteIn;function ArrayMapNode(ownerID,entries){this.ownerID=ownerID;this.entries=entries}ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){var entries=this.entries;for(var ii=0,len=entries.length;ii<len;ii++){if(is(key,entries[ii][0])){return entries[ii][1]}}return notSetValue};ArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET;var entries=this.entries;var idx=0;for(var len=entries.length;idx<len;idx++){if(is(key,entries[idx][0])){break}}var exists=idx<len;if(exists?entries[idx][1]===value:removed){return this}SetRef(didAlter);(removed||!exists)&&SetRef(didChangeSize);if(removed&&entries.length===1){return}if(!exists&&!removed&&entries.length>=MAX_ARRAY_MAP_SIZE){return createNodes(ownerID,entries,key,value)}var isEditable=ownerID&&ownerID===this.ownerID;var newEntries=isEditable?entries:arrCopy(entries);if(exists){if(removed){idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop()}else{newEntries[idx]=[key,value]}}else{newEntries.push([key,value])}if(isEditable){this.entries=newEntries;return this}return new ArrayMapNode(ownerID,newEntries)};function BitmapIndexedNode(ownerID,bitmap,nodes){this.ownerID=ownerID;this.bitmap=bitmap;this.nodes=nodes}BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){if(keyHash===undefined){keyHash=hash(key)}var bit=1<<((shift===0?keyHash:keyHash>>>shift)&MASK);var bitmap=this.bitmap;return(bitmap&bit)===0?notSetValue:this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue)};BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var keyHashFrag=(shift===0?keyHash:keyHash>>>shift)&MASK;var bit=1<<keyHashFrag;var bitmap=this.bitmap;var exists=(bitmap&bit)!==0;if(!exists&&value===NOT_SET){return this}var idx=popCount(bitmap&bit-1);var nodes=this.nodes;var node=exists?nodes[idx]:undefined;var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node){return this}if(!exists&&newNode&&nodes.length>=MAX_BITMAP_INDEXED_SIZE){return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode)}if(exists&&!newNode&&nodes.length===2&&isLeafNode(nodes[idx^1])){return nodes[idx^1]}if(exists&&newNode&&nodes.length===1&&isLeafNode(newNode)){return newNode}var isEditable=ownerID&&ownerID===this.ownerID;var newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit;var newNodes=exists?newNode?setIn(nodes,idx,newNode,isEditable):spliceOut(nodes,idx,isEditable):spliceIn(nodes,idx,newNode,isEditable);if(isEditable){this.bitmap=newBitmap;this.nodes=newNodes;return this}return new BitmapIndexedNode(ownerID,newBitmap,newNodes)};function HashArrayMapNode(ownerID,count,nodes){this.ownerID=ownerID;this.count=count;this.nodes=nodes}HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){if(keyHash===undefined){keyHash=hash(key)}var idx=(shift===0?keyHash:keyHash>>>shift)&MASK;var node=this.nodes[idx];return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue};HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var idx=(shift===0?keyHash:keyHash>>>shift)&MASK;var removed=value===NOT_SET;var nodes=this.nodes;var node=nodes[idx];if(removed&&!node){return this}var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node){return this}var newCount=this.count;if(!node){newCount++}else if(!newNode){newCount--;if(newCount<MIN_HASH_ARRAY_MAP_SIZE){return packNodes(ownerID,nodes,newCount,idx)}}var isEditable=ownerID&&ownerID===this.ownerID;var newNodes=setIn(nodes,idx,newNode,isEditable);if(isEditable){this.count=newCount;this.nodes=newNodes;return this}return new HashArrayMapNode(ownerID,newCount,newNodes)};function HashCollisionNode(ownerID,keyHash,entries){this.ownerID=ownerID;this.keyHash=keyHash;this.entries=entries}HashCollisionNode.prototype.get=function(shift,keyHash,key,notSetValue){var entries=this.entries;for(var ii=0,len=entries.length;ii<len;ii++){if(is(key,entries[ii][0])){return entries[ii][1]}}return notSetValue};HashCollisionNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var removed=value===NOT_SET;if(keyHash!==this.keyHash){if(removed){return this}SetRef(didAlter);SetRef(didChangeSize);return mergeIntoNode(this,ownerID,shift,keyHash,[key,value])}var entries=this.entries;var idx=0;for(var len=entries.length;idx<len;idx++){if(is(key,entries[idx][0])){break}}var exists=idx<len;if(exists?entries[idx][1]===value:removed){return this}SetRef(didAlter);(removed||!exists)&&SetRef(didChangeSize);if(removed&&len===2){return new ValueNode(ownerID,this.keyHash,entries[idx^1])}var isEditable=ownerID&&ownerID===this.ownerID;var newEntries=isEditable?entries:arrCopy(entries);if(exists){if(removed){idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop()}else{newEntries[idx]=[key,value]}}else{newEntries.push([key,value])}if(isEditable){this.entries=newEntries;return this}return new HashCollisionNode(ownerID,this.keyHash,newEntries)};function ValueNode(ownerID,keyHash,entry){this.ownerID=ownerID;this.keyHash=keyHash;this.entry=entry}ValueNode.prototype.get=function(shift,keyHash,key,notSetValue){return is(key,this.entry[0])?this.entry[1]:notSetValue};ValueNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET;var keyMatch=is(key,this.entry[0]);if(keyMatch?value===this.entry[1]:removed){return this}SetRef(didAlter);if(removed){SetRef(didChangeSize);return}if(keyMatch){if(ownerID&&ownerID===this.ownerID){this.entry[1]=value;return this}return new ValueNode(ownerID,this.keyHash,[key,value])}SetRef(didChangeSize);return mergeIntoNode(this,ownerID,shift,hash(key),[key,value])};ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(fn,reverse){var entries=this.entries;for(var ii=0,maxIndex=entries.length-1;ii<=maxIndex;ii++){if(fn(entries[reverse?maxIndex-ii:ii])===false){return false}}};BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(fn,reverse){var nodes=this.nodes;for(var ii=0,maxIndex=nodes.length-1;ii<=maxIndex;ii++){var node=nodes[reverse?maxIndex-ii:ii];if(node&&node.iterate(fn,reverse)===false){return false}}};ValueNode.prototype.iterate=function(fn,reverse){return fn(this.entry)};createClass(MapIterator,Iterator);function MapIterator(map,type,reverse){this._type=type;this._reverse=reverse;this._stack=map._root&&mapIteratorFrame(map._root)}MapIterator.prototype.next=function(){var this$1=this;var type=this._type;var stack=this._stack;while(stack){var node=stack.node;var index=stack.index++;var maxIndex;if(node.entry){if(index===0){return mapIteratorValue(type,node.entry)}}else if(node.entries){maxIndex=node.entries.length-1;if(index<=maxIndex){return mapIteratorValue(type,node.entries[this$1._reverse?maxIndex-index:index])}}else{maxIndex=node.nodes.length-1;if(index<=maxIndex){var subNode=node.nodes[this$1._reverse?maxIndex-index:index];if(subNode){if(subNode.entry){return mapIteratorValue(type,subNode.entry)}stack=this$1._stack=mapIteratorFrame(subNode,stack)}continue}}stack=this$1._stack=this$1._stack.__prev}return iteratorDone()};function mapIteratorValue(type,entry){return iteratorValue(type,entry[0],entry[1])}function mapIteratorFrame(node,prev){return{node:node,index:0,__prev:prev}}function makeMap(size,root,ownerID,hash){var map=Object.create(MapPrototype);map.size=size;map._root=root;map.__ownerID=ownerID;map.__hash=hash;map.__altered=false;return map}var EMPTY_MAP;function emptyMap(){return EMPTY_MAP||(EMPTY_MAP=makeMap(0))}function updateMap(map,k,v){var newRoot;var newSize;if(!map._root){if(v===NOT_SET){return map}newSize=1;newRoot=new ArrayMapNode(map.__ownerID,[[k,v]])}else{var didChangeSize=MakeRef(CHANGE_LENGTH);var didAlter=MakeRef(DID_ALTER);newRoot=updateNode(map._root,map.__ownerID,0,undefined,k,v,didChangeSize,didAlter);if(!didAlter.value){return map}newSize=map.size+(didChangeSize.value?v===NOT_SET?-1:1:0)}if(map.__ownerID){map.size=newSize;map._root=newRoot;map.__hash=undefined;map.__altered=true;return map}return newRoot?makeMap(newSize,newRoot):emptyMap()}function updateNode(node,ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(!node){if(value===NOT_SET){return node}SetRef(didAlter);SetRef(didChangeSize);return new ValueNode(ownerID,keyHash,[key,value])}return node.update(ownerID,shift,keyHash,key,value,didChangeSize,didAlter)}function isLeafNode(node){return node.constructor===ValueNode||node.constructor===HashCollisionNode}function mergeIntoNode(node,ownerID,shift,keyHash,entry){if(node.keyHash===keyHash){return new HashCollisionNode(ownerID,keyHash,[node.entry,entry])}var idx1=(shift===0?node.keyHash:node.keyHash>>>shift)&MASK;var idx2=(shift===0?keyHash:keyHash>>>shift)&MASK;var newNode;var nodes=idx1===idx2?[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:(newNode=new ValueNode(ownerID,keyHash,entry),idx1<idx2?[node,newNode]:[newNode,node]);return new BitmapIndexedNode(ownerID,1<<idx1|1<<idx2,nodes)}function createNodes(ownerID,entries,key,value){if(!ownerID){ownerID=new OwnerID}var node=new ValueNode(ownerID,hash(key),[key,value]);for(var ii=0;ii<entries.length;ii++){var entry=entries[ii];node=node.update(ownerID,0,undefined,entry[0],entry[1])}return node}function packNodes(ownerID,nodes,count,excluding){var bitmap=0;var packedII=0;var packedNodes=new Array(count);for(var ii=0,bit=1,len=nodes.length;ii<len;ii++,bit<<=1){var node=nodes[ii];if(node!==undefined&&ii!==excluding){bitmap|=bit;packedNodes[packedII++]=node}}return new BitmapIndexedNode(ownerID,bitmap,packedNodes)}function expandNodes(ownerID,nodes,bitmap,including,node){var count=0;var expandedNodes=new Array(SIZE);for(var ii=0;bitmap!==0;ii++,bitmap>>>=1){expandedNodes[ii]=bitmap&1?nodes[count++]:undefined}expandedNodes[including]=node;return new HashArrayMapNode(ownerID,count+1,expandedNodes)}function mergeIntoMapWith(map,merger,iterables){var iters=[];for(var ii=0;ii<iterables.length;ii++){var value=iterables[ii];var iter=KeyedIterable(value);if(!isIterable(value)){iter=iter.map(function(v){return fromJS(v)})}iters.push(iter)}return mergeIntoCollectionWith(map,merger,iters)}function deepMerger(existing,value,key){return existing&&existing.mergeDeep&&isIterable(value)?existing.mergeDeep(value):is(existing,value)?existing:value}function deepMergerWith(merger){return function(existing,value,key){if(existing&&existing.mergeDeepWith&&isIterable(value)){return existing.mergeDeepWith(merger,value)}var nextValue=merger(existing,value,key);return is(existing,nextValue)?existing:nextValue}}function mergeIntoCollectionWith(collection,merger,iters){iters=iters.filter(function(x){return x.size!==0});if(iters.length===0){return collection}if(collection.size===0&&!collection.__ownerID&&iters.length===1){return collection.constructor(iters[0])}return collection.withMutations(function(collection){var mergeIntoMap=merger?function(value,key){collection.update(key,NOT_SET,function(existing){return existing===NOT_SET?value:merger(existing,value,key)})}:function(value,key){collection.set(key,value)};for(var ii=0;ii<iters.length;ii++){iters[ii].forEach(mergeIntoMap)}})}function updateInDeepMap(existing,keyPathIter,notSetValue,updater){var isNotSet=existing===NOT_SET;var step=keyPathIter.next();if(step.done){var existingValue=isNotSet?notSetValue:existing;var newValue=updater(existingValue);return newValue===existingValue?existing:newValue}invariant(isNotSet||existing&&existing.set,"invalid keyPath");var key=step.value;var nextExisting=isNotSet?NOT_SET:existing.get(key,NOT_SET);var nextUpdated=updateInDeepMap(nextExisting,keyPathIter,notSetValue,updater);return nextUpdated===nextExisting?existing:nextUpdated===NOT_SET?existing.remove(key):(isNotSet?emptyMap():existing).set(key,nextUpdated)}function popCount(x){x=x-(x>>1&1431655765);x=(x&858993459)+(x>>2&858993459);x=x+(x>>4)&252645135;x=x+(x>>8);x=x+(x>>16);return x&127}function setIn(array,idx,val,canEdit){var newArray=canEdit?array:arrCopy(array);newArray[idx]=val;return newArray}function spliceIn(array,idx,val,canEdit){var newLen=array.length+1;if(canEdit&&idx+1===newLen){array[idx]=val;return array}var newArray=new Array(newLen);var after=0;for(var ii=0;ii<newLen;ii++){if(ii===idx){newArray[ii]=val;after=-1}else{newArray[ii]=array[ii+after]}}return newArray}function spliceOut(array,idx,canEdit){var newLen=array.length-1;if(canEdit&&idx===newLen){array.pop();return array}var newArray=new Array(newLen);var after=0;for(var ii=0;ii<newLen;ii++){if(ii===idx){after=1}newArray[ii]=array[ii+after]}return newArray}var MAX_ARRAY_MAP_SIZE=SIZE/4;var MAX_BITMAP_INDEXED_SIZE=SIZE/2;var MIN_HASH_ARRAY_MAP_SIZE=SIZE/4;createClass(List,IndexedCollection);function List(value){var empty=emptyList();if(value===null||value===undefined){return empty}if(isList(value)){return value}var iter=IndexedIterable(value);var size=iter.size;if(size===0){return empty}assertNotInfinite(size);if(size>0&&size<SIZE){return makeList(0,size,SHIFT,null,new VNode(iter.toArray()))}return empty.withMutations(function(list){list.setSize(size);iter.forEach(function(v,i){return list.set(i,v)})})}List.of=function(){return this(arguments)};List.prototype.toString=function(){return this.__toString("List [","]")};List.prototype.get=function(index,notSetValue){index=wrapIndex(this,index);if(index>=0&&index<this.size){index+=this._origin;var node=listNodeFor(this,index);return node&&node.array[index&MASK]}return notSetValue};List.prototype.set=function(index,value){return updateList(this,index,value)};List.prototype.remove=function(index){return!this.has(index)?this:index===0?this.shift():index===this.size-1?this.pop():this.splice(index,1)};List.prototype.insert=function(index,value){return this.splice(index,0,value)};List.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=this._origin=this._capacity=0;this._level=SHIFT;this._root=this._tail=null;this.__hash=undefined;this.__altered=true;return this}return emptyList()};List.prototype.push=function(){var values=arguments;var oldSize=this.size;return this.withMutations(function(list){setListBounds(list,0,oldSize+values.length);for(var ii=0;ii<values.length;ii++){list.set(oldSize+ii,values[ii])}})};List.prototype.pop=function(){return setListBounds(this,0,-1)};List.prototype.unshift=function(){var values=arguments;return this.withMutations(function(list){setListBounds(list,-values.length);for(var ii=0;ii<values.length;ii++){list.set(ii,values[ii])}})};List.prototype.shift=function(){return setListBounds(this,1)};List.prototype.merge=function(){return mergeIntoListWith(this,undefined,arguments)};List.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoListWith(this,merger,iters)};List.prototype.mergeDeep=function(){return mergeIntoListWith(this,deepMerger,arguments)};List.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoListWith(this,deepMergerWith(merger),iters)};List.prototype.setSize=function(size){return setListBounds(this,0,size)};List.prototype.slice=function(begin,end){var size=this.size;if(wholeSlice(begin,end,size)){return this}return setListBounds(this,resolveBegin(begin,size),resolveEnd(end,size))};List.prototype.__iterator=function(type,reverse){var index=0;var values=iterateList(this,reverse);return new Iterator(function(){var value=values();return value===DONE?iteratorDone():iteratorValue(type,index++,value)})};List.prototype.__iterate=function(fn,reverse){var this$1=this;var index=0;var values=iterateList(this,reverse);var value;while((value=values())!==DONE){if(fn(value,index++,this$1)===false){break}}return index};List.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;return this}return makeList(this._origin,this._capacity,this._level,this._root,this._tail,ownerID,this.__hash)};function isList(maybeList){return!!(maybeList&&maybeList[IS_LIST_SENTINEL])}List.isList=isList;var IS_LIST_SENTINEL="@@__IMMUTABLE_LIST__@@";var ListPrototype=List.prototype;ListPrototype[IS_LIST_SENTINEL]=true;ListPrototype[DELETE]=ListPrototype.remove;ListPrototype.setIn=MapPrototype.setIn;ListPrototype.deleteIn=ListPrototype.removeIn=MapPrototype.removeIn;ListPrototype.update=MapPrototype.update;ListPrototype.updateIn=MapPrototype.updateIn;ListPrototype.mergeIn=MapPrototype.mergeIn;ListPrototype.mergeDeepIn=MapPrototype.mergeDeepIn;ListPrototype.withMutations=MapPrototype.withMutations;ListPrototype.asMutable=MapPrototype.asMutable;ListPrototype.asImmutable=MapPrototype.asImmutable;ListPrototype.wasAltered=MapPrototype.wasAltered;function VNode(array,ownerID){this.array=array;this.ownerID=ownerID}VNode.prototype.removeBefore=function(ownerID,level,index){if(index===level?1<<level:0||this.array.length===0){return this}var originIndex=index>>>level&MASK;if(originIndex>=this.array.length){return new VNode([],ownerID)}var removingFirst=originIndex===0;var newChild;if(level>0){var oldChild=this.array[originIndex];newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index);if(newChild===oldChild&&removingFirst){return this}}if(removingFirst&&!newChild){return this}var editable=editableVNode(this,ownerID);if(!removingFirst){for(var ii=0;ii<originIndex;ii++){editable.array[ii]=undefined}}if(newChild){editable.array[originIndex]=newChild}return editable};VNode.prototype.removeAfter=function(ownerID,level,index){if(index===(level?1<<level:0)||this.array.length===0){return this}var sizeIndex=index-1>>>level&MASK;if(sizeIndex>=this.array.length){return this}var newChild;if(level>0){var oldChild=this.array[sizeIndex];newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index);if(newChild===oldChild&&sizeIndex===this.array.length-1){return this}}var editable=editableVNode(this,ownerID);editable.array.splice(sizeIndex+1);if(newChild){editable.array[sizeIndex]=newChild}return editable};var DONE={};function iterateList(list,reverse){var left=list._origin;var right=list._capacity;var tailPos=getTailOffset(right);var tail=list._tail;return iterateNodeOrLeaf(list._root,list._level,0);function iterateNodeOrLeaf(node,level,offset){return level===0?iterateLeaf(node,offset):iterateNode(node,level,offset)}function iterateLeaf(node,offset){var array=offset===tailPos?tail&&tail.array:node&&node.array;var from=offset>left?0:left-offset;var to=right-offset;if(to>SIZE){to=SIZE}return function(){if(from===to){return DONE}var idx=reverse?--to:from++;return array&&array[idx]}}function iterateNode(node,level,offset){var values;var array=node&&node.array;var from=offset>left?0:left-offset>>level;var to=(right-offset>>level)+1;if(to>SIZE){to=SIZE}return function(){do{if(values){var value=values();if(value!==DONE){return value}values=null}if(from===to){return DONE}var idx=reverse?--to:from++;values=iterateNodeOrLeaf(array&&array[idx],level-SHIFT,offset+(idx<<level))}while(true)}}}function makeList(origin,capacity,level,root,tail,ownerID,hash){var list=Object.create(ListPrototype);list.size=capacity-origin;list._origin=origin;list._capacity=capacity;list._level=level;list._root=root;list._tail=tail;list.__ownerID=ownerID;list.__hash=hash;list.__altered=false;return list}var EMPTY_LIST;function emptyList(){return EMPTY_LIST||(EMPTY_LIST=makeList(0,0,SHIFT))}function updateList(list,index,value){index=wrapIndex(list,index);if(index!==index){return list}if(index>=list.size||index<0){return list.withMutations(function(list){index<0?setListBounds(list,index).set(0,value):setListBounds(list,0,index+1).set(index,value)})}index+=list._origin;var newTail=list._tail;var newRoot=list._root;var didAlter=MakeRef(DID_ALTER);if(index>=getTailOffset(list._capacity)){newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter)}else{newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter)}if(!didAlter.value){return list}if(list.__ownerID){list._root=newRoot;list._tail=newTail;list.__hash=undefined;list.__altered=true;return list}return makeList(list._origin,list._capacity,list._level,newRoot,newTail)}function updateVNode(node,ownerID,level,index,value,didAlter){var idx=index>>>level&MASK;var nodeHas=node&&idx<node.array.length;if(!nodeHas&&value===undefined){return node}var newNode;if(level>0){var lowerNode=node&&node.array[idx];var newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter);if(newLowerNode===lowerNode){return node}newNode=editableVNode(node,ownerID);newNode.array[idx]=newLowerNode;return newNode}if(nodeHas&&node.array[idx]===value){return node}SetRef(didAlter);newNode=editableVNode(node,ownerID);if(value===undefined&&idx===newNode.array.length-1){newNode.array.pop()}else{newNode.array[idx]=value}return newNode}function editableVNode(node,ownerID){if(ownerID&&node&&ownerID===node.ownerID){return node}return new VNode(node?node.array.slice():[],ownerID)}function listNodeFor(list,rawIndex){if(rawIndex>=getTailOffset(list._capacity)){return list._tail}if(rawIndex<1<<list._level+SHIFT){var node=list._root;var level=list._level;while(node&&level>0){node=node.array[rawIndex>>>level&MASK];level-=SHIFT}return node}}function setListBounds(list,begin,end){if(begin!==undefined){begin=begin|0}if(end!==undefined){end=end|0}var owner=list.__ownerID||new OwnerID;var oldOrigin=list._origin;var oldCapacity=list._capacity;var newOrigin=oldOrigin+begin;var newCapacity=end===undefined?oldCapacity:end<0?oldCapacity+end:oldOrigin+end;if(newOrigin===oldOrigin&&newCapacity===oldCapacity){return list}if(newOrigin>=newCapacity){return list.clear()}var newLevel=list._level;var newRoot=list._root;var offsetShift=0;while(newOrigin+offsetShift<0){newRoot=new VNode(newRoot&&newRoot.array.length?[undefined,newRoot]:[],owner);newLevel+=SHIFT;offsetShift+=1<<newLevel}if(offsetShift){newOrigin+=offsetShift;oldOrigin+=offsetShift;newCapacity+=offsetShift;oldCapacity+=offsetShift}var oldTailOffset=getTailOffset(oldCapacity);var newTailOffset=getTailOffset(newCapacity);while(newTailOffset>=1<<newLevel+SHIFT){newRoot=new VNode(newRoot&&newRoot.array.length?[newRoot]:[],owner);newLevel+=SHIFT}var oldTail=list._tail;var newTail=newTailOffset<oldTailOffset?listNodeFor(list,newCapacity-1):newTailOffset>oldTailOffset?new VNode([],owner):oldTail;if(oldTail&&newTailOffset>oldTailOffset&&newOrigin<oldCapacity&&oldTail.array.length){newRoot=editableVNode(newRoot,owner);var node=newRoot;for(var level=newLevel;level>SHIFT;level-=SHIFT){var idx=oldTailOffset>>>level&MASK;node=node.array[idx]=editableVNode(node.array[idx],owner)}node.array[oldTailOffset>>>SHIFT&MASK]=oldTail}if(newCapacity<oldCapacity){newTail=newTail&&newTail.removeAfter(owner,0,newCapacity)}if(newOrigin>=newTailOffset){newOrigin-=newTailOffset;newCapacity-=newTailOffset;newLevel=SHIFT;newRoot=null;newTail=newTail&&newTail.removeBefore(owner,0,newOrigin)}else if(newOrigin>oldOrigin||newTailOffset<oldTailOffset){offsetShift=0;while(newRoot){var beginIndex=newOrigin>>>newLevel&MASK;if(beginIndex!==newTailOffset>>>newLevel&MASK){break}if(beginIndex){offsetShift+=(1<<newLevel)*beginIndex}newLevel-=SHIFT;newRoot=newRoot.array[beginIndex]}if(newRoot&&newOrigin>oldOrigin){newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift)}if(newRoot&&newTailOffset<oldTailOffset){newRoot=newRoot.removeAfter(owner,newLevel,newTailOffset-offsetShift)}if(offsetShift){newOrigin-=offsetShift;newCapacity-=offsetShift}}if(list.__ownerID){list.size=newCapacity-newOrigin;list._origin=newOrigin;list._capacity=newCapacity;list._level=newLevel;list._root=newRoot;list._tail=newTail;list.__hash=undefined;list.__altered=true;return list}return makeList(newOrigin,newCapacity,newLevel,newRoot,newTail)}function mergeIntoListWith(list,merger,iterables){var iters=[];var maxSize=0;for(var ii=0;ii<iterables.length;ii++){var value=iterables[ii];var iter=IndexedIterable(value);if(iter.size>maxSize){maxSize=iter.size}if(!isIterable(value)){iter=iter.map(function(v){return fromJS(v)})}iters.push(iter)}if(maxSize>list.size){list=list.setSize(maxSize)}return mergeIntoCollectionWith(list,merger,iters)}function getTailOffset(size){return size<SIZE?0:size-1>>>SHIFT<<SHIFT}createClass(OrderedMap,Map);function OrderedMap(value){return value===null||value===undefined?emptyOrderedMap():isOrderedMap(value)?value:emptyOrderedMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v,k){return map.set(k,v)})})}OrderedMap.of=function(){return this(arguments)};OrderedMap.prototype.toString=function(){return this.__toString("OrderedMap {","}")};OrderedMap.prototype.get=function(k,notSetValue){var index=this._map.get(k);return index!==undefined?this._list.get(index)[1]:notSetValue};OrderedMap.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._map.clear();this._list.clear();return this}return emptyOrderedMap()};OrderedMap.prototype.set=function(k,v){return updateOrderedMap(this,k,v)};OrderedMap.prototype.remove=function(k){return updateOrderedMap(this,k,NOT_SET)};OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()};OrderedMap.prototype.__iterate=function(fn,reverse){var this$0=this;return this._list.__iterate(function(entry){return entry&&fn(entry[1],entry[0],this$0)},reverse)};OrderedMap.prototype.__iterator=function(type,reverse){return this._list.fromEntrySeq().__iterator(type,reverse)};OrderedMap.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map.__ensureOwner(ownerID);var newList=this._list.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;this._list=newList;return this}return makeOrderedMap(newMap,newList,ownerID,this.__hash)};function isOrderedMap(maybeOrderedMap){return isMap(maybeOrderedMap)&&isOrdered(maybeOrderedMap)}OrderedMap.isOrderedMap=isOrderedMap;OrderedMap.prototype[IS_ORDERED_SENTINEL]=true;OrderedMap.prototype[DELETE]=OrderedMap.prototype.remove;function makeOrderedMap(map,list,ownerID,hash){var omap=Object.create(OrderedMap.prototype);omap.size=map?map.size:0;omap._map=map;omap._list=list;omap.__ownerID=ownerID;omap.__hash=hash;return omap}var EMPTY_ORDERED_MAP;function emptyOrderedMap(){return EMPTY_ORDERED_MAP||(EMPTY_ORDERED_MAP=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(omap,k,v){var map=omap._map;var list=omap._list;var i=map.get(k);var has=i!==undefined;var newMap;var newList;if(v===NOT_SET){if(!has){return omap}if(list.size>=SIZE&&list.size>=map.size*2){newList=list.filter(function(entry,idx){return entry!==undefined&&i!==idx});newMap=newList.toKeyedSeq().map(function(entry){return entry[0]}).flip().toMap();if(omap.__ownerID){newMap.__ownerID=newList.__ownerID=omap.__ownerID}}else{newMap=map.remove(k);newList=i===list.size-1?list.pop():list.set(i,undefined)}}else{if(has){if(v===list.get(i)[1]){return omap}newMap=map;newList=list.set(i,[k,v])}else{newMap=map.set(k,list.size);newList=list.set(list.size,[k,v])}}if(omap.__ownerID){omap.size=newMap.size;omap._map=newMap;omap._list=newList;omap.__hash=undefined;return omap}return makeOrderedMap(newMap,newList)}createClass(ToKeyedSequence,KeyedSeq);function ToKeyedSequence(indexed,useKeys){this._iter=indexed;this._useKeys=useKeys;this.size=indexed.size}ToKeyedSequence.prototype.get=function(key,notSetValue){return this._iter.get(key,notSetValue)};ToKeyedSequence.prototype.has=function(key){return this._iter.has(key)};ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()};ToKeyedSequence.prototype.reverse=function(){var this$0=this;var reversedSequence=reverseFactory(this,true);if(!this._useKeys){reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse()}}return reversedSequence};ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this;var mappedSequence=mapFactory(this,mapper,context);if(!this._useKeys){mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context)}}return mappedSequence};ToKeyedSequence.prototype.__iterate=function(fn,reverse){var this$0=this;var ii;return this._iter.__iterate(this._useKeys?function(v,k){return fn(v,k,this$0)}:(ii=reverse?resolveSize(this):0,function(v){return fn(v,reverse?--ii:ii++,this$0)}),reverse)};ToKeyedSequence.prototype.__iterator=function(type,reverse){if(this._useKeys){return this._iter.__iterator(type,reverse);
}var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);var ii=reverse?resolveSize(this):0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,reverse?--ii:ii++,step.value,step)})};ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=true;createClass(ToIndexedSequence,IndexedSeq);function ToIndexedSequence(iter){this._iter=iter;this.size=iter.size}ToIndexedSequence.prototype.includes=function(value){return this._iter.includes(value)};ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this;var iterations=0;return this._iter.__iterate(function(v){return fn(v,iterations++,this$0)},reverse)};ToIndexedSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);var iterations=0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value,step)})};createClass(ToSetSequence,SetSeq);function ToSetSequence(iter){this._iter=iter;this.size=iter.size}ToSetSequence.prototype.has=function(key){return this._iter.includes(key)};ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(v){return fn(v,v,this$0)},reverse)};ToSetSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,step.value,step.value,step)})};createClass(FromEntriesSequence,KeyedSeq);function FromEntriesSequence(entries){this._iter=entries;this.size=entries.size}FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()};FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(entry){if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return fn(indexedIterable?entry.get(1):entry[1],indexedIterable?entry.get(0):entry[0],this$0)}},reverse)};FromEntriesSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new Iterator(function(){while(true){var step=iterator.next();if(step.done){return step}var entry=step.value;if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return iteratorValue(type,indexedIterable?entry.get(0):entry[0],indexedIterable?entry.get(1):entry[1],step)}}})};ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough;function flipFactory(iterable){var flipSequence=makeSequence(iterable);flipSequence._iter=iterable;flipSequence.size=iterable.size;flipSequence.flip=function(){return iterable};flipSequence.reverse=function(){var reversedSequence=iterable.reverse.apply(this);reversedSequence.flip=function(){return iterable.reverse()};return reversedSequence};flipSequence.has=function(key){return iterable.includes(key)};flipSequence.includes=function(key){return iterable.has(key)};flipSequence.cacheResult=cacheResultThrough;flipSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==false},reverse)};flipSequence.__iteratorUncached=function(type,reverse){if(type===ITERATE_ENTRIES){var iterator=iterable.__iterator(type,reverse);return new Iterator(function(){var step=iterator.next();if(!step.done){var k=step.value[0];step.value[0]=step.value[1];step.value[1]=k}return step})}return iterable.__iterator(type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,reverse)};return flipSequence}function mapFactory(iterable,mapper,context){var mappedSequence=makeSequence(iterable);mappedSequence.size=iterable.size;mappedSequence.has=function(key){return iterable.has(key)};mappedSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v===NOT_SET?notSetValue:mapper.call(context,v,key,iterable)};mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==false},reverse)};mappedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);return new Iterator(function(){var step=iterator.next();if(step.done){return step}var entry=step.value;var key=entry[0];return iteratorValue(type,key,mapper.call(context,entry[1],key,iterable),step)})};return mappedSequence}function reverseFactory(iterable,useKeys){var reversedSequence=makeSequence(iterable);reversedSequence._iter=iterable;reversedSequence.size=iterable.size;reversedSequence.reverse=function(){return iterable};if(iterable.flip){reversedSequence.flip=function(){var flipSequence=flipFactory(iterable);flipSequence.reverse=function(){return iterable.flip()};return flipSequence}}reversedSequence.get=function(key,notSetValue){return iterable.get(useKeys?key:-1-key,notSetValue)};reversedSequence.has=function(key){return iterable.has(useKeys?key:-1-key)};reversedSequence.includes=function(value){return iterable.includes(value)};reversedSequence.cacheResult=cacheResultThrough;reversedSequence.__iterate=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(v,k,this$0)},!reverse)};reversedSequence.__iterator=function(type,reverse){return iterable.__iterator(type,!reverse)};return reversedSequence}function filterFactory(iterable,predicate,context,useKeys){var filterSequence=makeSequence(iterable);if(useKeys){filterSequence.has=function(key){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&!!predicate.call(context,v,key,iterable)};filterSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&predicate.call(context,v,key,iterable)?v:notSetValue}}filterSequence.__iterateUncached=function(fn,reverse){var this$0=this;var iterations=0;iterable.__iterate(function(v,k,c){if(predicate.call(context,v,k,c)){iterations++;return fn(v,useKeys?k:iterations-1,this$0)}},reverse);return iterations};filterSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var iterations=0;return new Iterator(function(){while(true){var step=iterator.next();if(step.done){return step}var entry=step.value;var key=entry[0];var value=entry[1];if(predicate.call(context,value,key,iterable)){return iteratorValue(type,useKeys?key:iterations++,value,step)}}})};return filterSequence}function countByFactory(iterable,grouper,context){var groups=Map().asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),0,function(a){return a+1})});return groups.asImmutable()}function groupByFactory(iterable,grouper,context){var isKeyedIter=isKeyed(iterable);var groups=(isOrdered(iterable)?OrderedMap():Map()).asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a})});var coerce=iterableClass(iterable);return groups.map(function(arr){return reify(iterable,coerce(arr))})}function sliceFactory(iterable,begin,end,useKeys){var originalSize=iterable.size;if(begin!==undefined){begin=begin|0}if(end!==undefined){if(end===Infinity){end=originalSize}else{end=end|0}}if(wholeSlice(begin,end,originalSize)){return iterable}var resolvedBegin=resolveBegin(begin,originalSize);var resolvedEnd=resolveEnd(end,originalSize);if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd){return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys)}var resolvedSize=resolvedEnd-resolvedBegin;var sliceSize;if(resolvedSize===resolvedSize){sliceSize=resolvedSize<0?0:resolvedSize}var sliceSeq=makeSequence(iterable);sliceSeq.size=sliceSize===0?sliceSize:iterable.size&&sliceSize||undefined;if(!useKeys&&isSeq(iterable)&&sliceSize>=0){sliceSeq.get=function(index,notSetValue){index=wrapIndex(this,index);return index>=0&&index<sliceSize?iterable.get(index+resolvedBegin,notSetValue):notSetValue}}sliceSeq.__iterateUncached=function(fn,reverse){var this$0=this;if(sliceSize===0){return 0}if(reverse){return this.cacheResult().__iterate(fn,reverse)}var skipped=0;var isSkipping=true;var iterations=0;iterable.__iterate(function(v,k){if(!(isSkipping&&(isSkipping=skipped++<resolvedBegin))){iterations++;return fn(v,useKeys?k:iterations-1,this$0)!==false&&iterations!==sliceSize}});return iterations};sliceSeq.__iteratorUncached=function(type,reverse){if(sliceSize!==0&&reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=sliceSize!==0&&iterable.__iterator(type,reverse);var skipped=0;var iterations=0;return new Iterator(function(){while(skipped++<resolvedBegin){iterator.next()}if(++iterations>sliceSize){return iteratorDone()}var step=iterator.next();if(useKeys||type===ITERATE_VALUES){return step}else if(type===ITERATE_KEYS){return iteratorValue(type,iterations-1,undefined,step)}else{return iteratorValue(type,iterations-1,step.value[1],step)}})};return sliceSeq}function takeWhileFactory(iterable,predicate,context){var takeSequence=makeSequence(iterable);takeSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterations=0;iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0)});return iterations};takeSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var iterating=true;return new Iterator(function(){if(!iterating){return iteratorDone()}var step=iterator.next();if(step.done){return step}var entry=step.value;var k=entry[0];var v=entry[1];if(!predicate.call(context,v,k,this$0)){iterating=false;return iteratorDone()}return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})};return takeSequence}function skipWhileFactory(iterable,predicate,context,useKeys){var skipSequence=makeSequence(iterable);skipSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var isSkipping=true;var iterations=0;iterable.__iterate(function(v,k,c){if(!(isSkipping&&(isSkipping=predicate.call(context,v,k,c)))){iterations++;return fn(v,useKeys?k:iterations-1,this$0)}});return iterations};skipSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var skipping=true;var iterations=0;return new Iterator(function(){var step,k,v;do{step=iterator.next();if(step.done){if(useKeys||type===ITERATE_VALUES){return step}else if(type===ITERATE_KEYS){return iteratorValue(type,iterations++,undefined,step)}else{return iteratorValue(type,iterations++,step.value[1],step)}}var entry=step.value;k=entry[0];v=entry[1];skipping&&(skipping=predicate.call(context,v,k,this$0))}while(skipping);return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})};return skipSequence}function concatFactory(iterable,values){var isKeyedIterable=isKeyed(iterable);var iters=[iterable].concat(values).map(function(v){if(!isIterable(v)){v=isKeyedIterable?keyedSeqFromValue(v):indexedSeqFromValue(Array.isArray(v)?v:[v])}else if(isKeyedIterable){v=KeyedIterable(v)}return v}).filter(function(v){return v.size!==0});if(iters.length===0){return iterable}if(iters.length===1){var singleton=iters[0];if(singleton===iterable||isKeyedIterable&&isKeyed(singleton)||isIndexed(iterable)&&isIndexed(singleton)){return singleton}}var concatSeq=new ArraySeq(iters);if(isKeyedIterable){concatSeq=concatSeq.toKeyedSeq()}else if(!isIndexed(iterable)){concatSeq=concatSeq.toSetSeq()}concatSeq=concatSeq.flatten(true);concatSeq.size=iters.reduce(function(sum,seq){if(sum!==undefined){var size=seq.size;if(size!==undefined){return sum+size}}},0);return concatSeq}function flattenFactory(iterable,depth,useKeys){var flatSequence=makeSequence(iterable);flatSequence.__iterateUncached=function(fn,reverse){var iterations=0;var stopped=false;function flatDeep(iter,currentDepth){var this$0=this;iter.__iterate(function(v,k){if((!depth||currentDepth<depth)&&isIterable(v)){flatDeep(v,currentDepth+1)}else if(fn(v,useKeys?k:iterations++,this$0)===false){stopped=true}return!stopped},reverse)}flatDeep(iterable,0);return iterations};flatSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(type,reverse);var stack=[];var iterations=0;return new Iterator(function(){while(iterator){var step=iterator.next();if(step.done!==false){iterator=stack.pop();continue}var v=step.value;if(type===ITERATE_ENTRIES){v=v[1]}if((!depth||stack.length<depth)&&isIterable(v)){stack.push(iterator);iterator=v.__iterator(type,reverse)}else{return useKeys?step:iteratorValue(type,iterations++,v,step)}}return iteratorDone()})};return flatSequence}function flatMapFactory(iterable,mapper,context){var coerce=iterableClass(iterable);return iterable.toSeq().map(function(v,k){return coerce(mapper.call(context,v,k,iterable))}).flatten(true)}function interposeFactory(iterable,separator){var interposedSequence=makeSequence(iterable);interposedSequence.size=iterable.size&&iterable.size*2-1;interposedSequence.__iterateUncached=function(fn,reverse){var this$0=this;var iterations=0;iterable.__iterate(function(v,k){return(!iterations||fn(separator,iterations++,this$0)!==false)&&fn(v,iterations++,this$0)!==false},reverse);return iterations};interposedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_VALUES,reverse);var iterations=0;var step;return new Iterator(function(){if(!step||iterations%2){step=iterator.next();if(step.done){return step}}return iterations%2?iteratorValue(type,iterations++,separator):iteratorValue(type,iterations++,step.value,step)})};return interposedSequence}function sortFactory(iterable,comparator,mapper){if(!comparator){comparator=defaultComparator}var isKeyedIterable=isKeyed(iterable);var index=0;var entries=iterable.toSeq().map(function(v,k){return[k,v,index++,mapper?mapper(v,k,iterable):v]}).toArray();entries.sort(function(a,b){return comparator(a[3],b[3])||a[2]-b[2]}).forEach(isKeyedIterable?function(v,i){entries[i].length=2}:function(v,i){entries[i]=v[1]});return isKeyedIterable?KeyedSeq(entries):isIndexed(iterable)?IndexedSeq(entries):SetSeq(entries)}function maxFactory(iterable,comparator,mapper){if(!comparator){comparator=defaultComparator}if(mapper){var entry=iterable.toSeq().map(function(v,k){return[v,mapper(v,k,iterable)]}).reduce(function(a,b){return maxCompare(comparator,a[1],b[1])?b:a});return entry&&entry[0]}else{return iterable.reduce(function(a,b){return maxCompare(comparator,a,b)?b:a})}}function maxCompare(comparator,a,b){var comp=comparator(b,a);return comp===0&&b!==a&&(b===undefined||b===null||b!==b)||comp>0}function zipWithFactory(keyIter,zipper,iters){var zipSequence=makeSequence(keyIter);zipSequence.size=new ArraySeq(iters).map(function(i){return i.size}).min();zipSequence.__iterate=function(fn,reverse){var this$1=this;var iterator=this.__iterator(ITERATE_VALUES,reverse);var step;var iterations=0;while(!(step=iterator.next()).done){if(fn(step.value,iterations++,this$1)===false){break}}return iterations};zipSequence.__iteratorUncached=function(type,reverse){var iterators=iters.map(function(i){return i=Iterable(i),getIterator(reverse?i.reverse():i)});var iterations=0;var isDone=false;return new Iterator(function(){var steps;if(!isDone){steps=iterators.map(function(i){return i.next()});isDone=steps.some(function(s){return s.done})}if(isDone){return iteratorDone()}return iteratorValue(type,iterations++,zipper.apply(null,steps.map(function(s){return s.value})))})};return zipSequence}function reify(iter,seq){return isSeq(iter)?seq:iter.constructor(seq)}function validateEntry(entry){if(entry!==Object(entry)){throw new TypeError("Expected [K, V] tuple: "+entry)}}function resolveSize(iter){assertNotInfinite(iter.size);return ensureSize(iter)}function iterableClass(iterable){return isKeyed(iterable)?KeyedIterable:isIndexed(iterable)?IndexedIterable:SetIterable}function makeSequence(iterable){return Object.create((isKeyed(iterable)?KeyedSeq:isIndexed(iterable)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){if(this._iter.cacheResult){this._iter.cacheResult();this.size=this._iter.size;return this}else{return Seq.prototype.cacheResult.call(this)}}function defaultComparator(a,b){return a>b?1:a<b?-1:0}function forceIterator(keyPath){var iter=getIterator(keyPath);if(!iter){if(!isArrayLike(keyPath)){throw new TypeError("Expected iterable or array-like: "+keyPath)}iter=getIterator(Iterable(keyPath))}return iter}createClass(Record,KeyedCollection);function Record(defaultValues,name){var hasInitialized;var RecordType=function Record(values){if(values instanceof RecordType){return values}if(!(this instanceof RecordType)){return new RecordType(values)}if(!hasInitialized){hasInitialized=true;var keys=Object.keys(defaultValues);setProps(RecordTypePrototype,keys);RecordTypePrototype.size=keys.length;RecordTypePrototype._name=name;RecordTypePrototype._keys=keys;RecordTypePrototype._defaultValues=defaultValues}this._map=Map(values)};var RecordTypePrototype=RecordType.prototype=Object.create(RecordPrototype);RecordTypePrototype.constructor=RecordType;return RecordType}Record.prototype.toString=function(){return this.__toString(recordName(this)+" {","}")};Record.prototype.has=function(k){return this._defaultValues.hasOwnProperty(k)};Record.prototype.get=function(k,notSetValue){if(!this.has(k)){return notSetValue}var defaultVal=this._defaultValues[k];return this._map?this._map.get(k,defaultVal):defaultVal};Record.prototype.clear=function(){if(this.__ownerID){this._map&&this._map.clear();return this}var RecordType=this.constructor;return RecordType._empty||(RecordType._empty=makeRecord(this,emptyMap()))};Record.prototype.set=function(k,v){if(!this.has(k)){throw new Error('Cannot set unknown key "'+k+'" on '+recordName(this))}if(this._map&&!this._map.has(k)){var defaultVal=this._defaultValues[k];if(v===defaultVal){return this}}var newMap=this._map&&this._map.set(k,v);if(this.__ownerID||newMap===this._map){return this}return makeRecord(this,newMap)};Record.prototype.remove=function(k){if(!this.has(k)){return this}var newMap=this._map&&this._map.remove(k);if(this.__ownerID||newMap===this._map){return this}return makeRecord(this,newMap)};Record.prototype.wasAltered=function(){return this._map.wasAltered()};Record.prototype.__iterator=function(type,reverse){var this$0=this;return KeyedIterable(this._defaultValues).map(function(_,k){return this$0.get(k)}).__iterator(type,reverse)};Record.prototype.__iterate=function(fn,reverse){var this$0=this;return KeyedIterable(this._defaultValues).map(function(_,k){return this$0.get(k)}).__iterate(fn,reverse)};Record.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map&&this._map.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;return this}return makeRecord(this,newMap,ownerID)};var RecordPrototype=Record.prototype;RecordPrototype[DELETE]=RecordPrototype.remove;RecordPrototype.deleteIn=RecordPrototype.removeIn=MapPrototype.removeIn;RecordPrototype.merge=MapPrototype.merge;RecordPrototype.mergeWith=MapPrototype.mergeWith;RecordPrototype.mergeIn=MapPrototype.mergeIn;RecordPrototype.mergeDeep=MapPrototype.mergeDeep;RecordPrototype.mergeDeepWith=MapPrototype.mergeDeepWith;RecordPrototype.mergeDeepIn=MapPrototype.mergeDeepIn;RecordPrototype.setIn=MapPrototype.setIn;RecordPrototype.update=MapPrototype.update;RecordPrototype.updateIn=MapPrototype.updateIn;RecordPrototype.withMutations=MapPrototype.withMutations;RecordPrototype.asMutable=MapPrototype.asMutable;RecordPrototype.asImmutable=MapPrototype.asImmutable;function makeRecord(likeRecord,map,ownerID){var record=Object.create(Object.getPrototypeOf(likeRecord));record._map=map;record.__ownerID=ownerID;return record}function recordName(record){return record._name||record.constructor.name||"Record"}function setProps(prototype,names){try{names.forEach(setProp.bind(undefined,prototype))}catch(error){}}function setProp(prototype,name){Object.defineProperty(prototype,name,{get:function(){return this.get(name)},set:function(value){invariant(this.__ownerID,"Cannot set on an immutable record.");this.set(name,value)}})}createClass(Set,SetCollection);function Set(value){return value===null||value===undefined?emptySet():isSet(value)&&!isOrdered(value)?value:emptySet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v){return set.add(v)})})}Set.of=function(){return this(arguments)};Set.fromKeys=function(value){return this(KeyedIterable(value).keySeq())};Set.prototype.toString=function(){return this.__toString("Set {","}")};Set.prototype.has=function(value){return this._map.has(value)};Set.prototype.add=function(value){return updateSet(this,this._map.set(value,true))};Set.prototype.remove=function(value){return updateSet(this,this._map.remove(value))};Set.prototype.clear=function(){return updateSet(this,this._map.clear())};Set.prototype.union=function(){var iters=SLICE$0.call(arguments,0);iters=iters.filter(function(x){return x.size!==0});if(iters.length===0){return this}if(this.size===0&&!this.__ownerID&&iters.length===1){return this.constructor(iters[0])}return this.withMutations(function(set){for(var ii=0;ii<iters.length;ii++){SetIterable(iters[ii]).forEach(function(value){return set.add(value)})}})};Set.prototype.intersect=function(){var iters=SLICE$0.call(arguments,0);if(iters.length===0){return this}iters=iters.map(function(iter){return SetIterable(iter)});var originalSet=this;return this.withMutations(function(set){originalSet.forEach(function(value){if(!iters.every(function(iter){return iter.includes(value)})){set.remove(value)}})})};Set.prototype.subtract=function(){var iters=SLICE$0.call(arguments,0);if(iters.length===0){return this}iters=iters.map(function(iter){return SetIterable(iter)});var originalSet=this;return this.withMutations(function(set){originalSet.forEach(function(value){if(iters.some(function(iter){return iter.includes(value)})){set.remove(value)}})})};Set.prototype.merge=function(){return this.union.apply(this,arguments)};Set.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return this.union.apply(this,iters)};Set.prototype.sort=function(comparator){return OrderedSet(sortFactory(this,comparator))};Set.prototype.sortBy=function(mapper,comparator){return OrderedSet(sortFactory(this,comparator,mapper))};Set.prototype.wasAltered=function(){return this._map.wasAltered()};Set.prototype.__iterate=function(fn,reverse){var this$0=this;return this._map.__iterate(function(_,k){return fn(k,k,this$0)},reverse)};Set.prototype.__iterator=function(type,reverse){return this._map.map(function(_,k){return k}).__iterator(type,reverse)};Set.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;return this}return this.__make(newMap,ownerID)};function isSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL])}Set.isSet=isSet;var IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";var SetPrototype=Set.prototype;SetPrototype[IS_SET_SENTINEL]=true;SetPrototype[DELETE]=SetPrototype.remove;SetPrototype.mergeDeep=SetPrototype.merge;SetPrototype.mergeDeepWith=SetPrototype.mergeWith;SetPrototype.withMutations=MapPrototype.withMutations;SetPrototype.asMutable=MapPrototype.asMutable;SetPrototype.asImmutable=MapPrototype.asImmutable;SetPrototype.__empty=emptySet;SetPrototype.__make=makeSet;function updateSet(set,newMap){if(set.__ownerID){set.size=newMap.size;set._map=newMap;return set}return newMap===set._map?set:newMap.size===0?set.__empty():set.__make(newMap)}function makeSet(map,ownerID){var set=Object.create(SetPrototype);set.size=map?map.size:0;set._map=map;set.__ownerID=ownerID;return set}var EMPTY_SET;function emptySet(){return EMPTY_SET||(EMPTY_SET=makeSet(emptyMap()))}createClass(OrderedSet,Set);function OrderedSet(value){return value===null||value===undefined?emptyOrderedSet():isOrderedSet(value)?value:emptyOrderedSet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v){return set.add(v)})})}OrderedSet.of=function(){return this(arguments)};OrderedSet.fromKeys=function(value){return this(KeyedIterable(value).keySeq())};OrderedSet.prototype.toString=function(){return this.__toString("OrderedSet {","}")};function isOrderedSet(maybeOrderedSet){return isSet(maybeOrderedSet)&&isOrdered(maybeOrderedSet)}OrderedSet.isOrderedSet=isOrderedSet;var OrderedSetPrototype=OrderedSet.prototype;OrderedSetPrototype[IS_ORDERED_SENTINEL]=true;OrderedSetPrototype.__empty=emptyOrderedSet;OrderedSetPrototype.__make=makeOrderedSet;function makeOrderedSet(map,ownerID){var set=Object.create(OrderedSetPrototype);set.size=map?map.size:0;set._map=map;set.__ownerID=ownerID;return set}var EMPTY_ORDERED_SET;function emptyOrderedSet(){return EMPTY_ORDERED_SET||(EMPTY_ORDERED_SET=makeOrderedSet(emptyOrderedMap()))}createClass(Stack,IndexedCollection);function Stack(value){return value===null||value===undefined?emptyStack():isStack(value)?value:emptyStack().unshiftAll(value)}Stack.of=function(){return this(arguments)};Stack.prototype.toString=function(){return this.__toString("Stack [","]")};Stack.prototype.get=function(index,notSetValue){var head=this._head;index=wrapIndex(this,index);while(head&&index--){head=head.next}return head?head.value:notSetValue};Stack.prototype.peek=function(){return this._head&&this._head.value};Stack.prototype.push=function(){var arguments$1=arguments;if(arguments.length===0){return this}var newSize=this.size+arguments.length;var head=this._head;for(var ii=arguments.length-1;ii>=0;ii--){head={value:arguments$1[ii],next:head}}if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.pushAll=function(iter){iter=IndexedIterable(iter);if(iter.size===0){return this}assertNotInfinite(iter.size);var newSize=this.size;var head=this._head;iter.reverse().forEach(function(value){newSize++;head={value:value,next:head}});if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.pop=function(){return this.slice(1)};Stack.prototype.unshift=function(){return this.push.apply(this,arguments)};Stack.prototype.unshiftAll=function(iter){return this.pushAll(iter)};Stack.prototype.shift=function(){return this.pop.apply(this,arguments)};Stack.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._head=undefined;this.__hash=undefined;this.__altered=true;return this}return emptyStack()};Stack.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size)){return this}var resolvedBegin=resolveBegin(begin,this.size);var resolvedEnd=resolveEnd(end,this.size);if(resolvedEnd!==this.size){return IndexedCollection.prototype.slice.call(this,begin,end)}var newSize=this.size-resolvedBegin;var head=this._head;while(resolvedBegin--){head=head.next}if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;this.__altered=false;return this}return makeStack(this.size,this._head,ownerID,this.__hash)};Stack.prototype.__iterate=function(fn,reverse){var this$1=this;if(reverse){return this.reverse().__iterate(fn)}var iterations=0;var node=this._head;while(node){if(fn(node.value,iterations++,this$1)===false){break}node=node.next}return iterations};Stack.prototype.__iterator=function(type,reverse){if(reverse){return this.reverse().__iterator(type)}var iterations=0;var node=this._head;return new Iterator(function(){if(node){var value=node.value;node=node.next;return iteratorValue(type,iterations++,value)}return iteratorDone()})};function isStack(maybeStack){return!!(maybeStack&&maybeStack[IS_STACK_SENTINEL])}Stack.isStack=isStack;var IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@";var StackPrototype=Stack.prototype;StackPrototype[IS_STACK_SENTINEL]=true;StackPrototype.withMutations=MapPrototype.withMutations;StackPrototype.asMutable=MapPrototype.asMutable;StackPrototype.asImmutable=MapPrototype.asImmutable;StackPrototype.wasAltered=MapPrototype.wasAltered;function makeStack(size,head,ownerID,hash){var map=Object.create(StackPrototype);map.size=size;map._head=head;map.__ownerID=ownerID;map.__hash=hash;map.__altered=false;return map}var EMPTY_STACK;function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}function mixin(ctor,methods){var keyCopier=function(key){ctor.prototype[key]=methods[key]};Object.keys(methods).forEach(keyCopier);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier);return ctor}Iterable.Iterator=Iterator;mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var array=new Array(this.size||0);this.valueSeq().__iterate(function(v,i){array[i]=v});return array},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map(function(value){return value&&typeof value.toJS==="function"?value.toJS():value}).__toJS()},toJSON:function(){return this.toSeq().map(function(value){return value&&typeof value.toJSON==="function"?value.toJSON():value}).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,true)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var object={};this.__iterate(function(v,k){object[k]=v});return object},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(head,tail){if(this.size===0){return head+tail}return head+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+tail},concat:function(){var values=SLICE$0.call(arguments,0);return reify(this,concatFactory(this,values))},includes:function(searchValue){return this.some(function(value){return is(value,searchValue)})},entries:function(){return this.__iterator(ITERATE_ENTRIES)},every:function(predicate,context){assertNotInfinite(this.size);var returnValue=true;this.__iterate(function(v,k,c){if(!predicate.call(context,v,k,c)){returnValue=false;return false}});return returnValue},filter:function(predicate,context){return reify(this,filterFactory(this,predicate,context,true))},find:function(predicate,context,notSetValue){var entry=this.findEntry(predicate,context);return entry?entry[1]:notSetValue},forEach:function(sideEffect,context){assertNotInfinite(this.size);return this.__iterate(context?sideEffect.bind(context):sideEffect)},join:function(separator){assertNotInfinite(this.size);separator=separator!==undefined?""+separator:",";var joined="";var isFirst=true;this.__iterate(function(v){isFirst?isFirst=false:joined+=separator;joined+=v!==null&&v!==undefined?v.toString():""});return joined},keys:function(){return this.__iterator(ITERATE_KEYS)},map:function(mapper,context){return reify(this,mapFactory(this,mapper,context))},reduce:function(reducer,initialReduction,context){assertNotInfinite(this.size);var reduction;var useFirst;if(arguments.length<2){useFirst=true}else{reduction=initialReduction}this.__iterate(function(v,k,c){if(useFirst){useFirst=false;reduction=v;
}else{reduction=reducer.call(context,reduction,v,k,c)}});return reduction},reduceRight:function(reducer,initialReduction,context){var reversed=this.toKeyedSeq().reverse();return reversed.reduce.apply(reversed,arguments)},reverse:function(){return reify(this,reverseFactory(this,true))},slice:function(begin,end){return reify(this,sliceFactory(this,begin,end,true))},some:function(predicate,context){return!this.every(not(predicate),context)},sort:function(comparator){return reify(this,sortFactory(this,comparator))},values:function(){return this.__iterator(ITERATE_VALUES)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==undefined?this.size===0:!this.some(function(){return true})},count:function(predicate,context){return ensureSize(predicate?this.toSeq().filter(predicate,context):this)},countBy:function(grouper,context){return countByFactory(this,grouper,context)},equals:function(other){return deepEqual(this,other)},entrySeq:function(){var iterable=this;if(iterable._cache){return new ArraySeq(iterable._cache)}var entriesSequence=iterable.toSeq().map(entryMapper).toIndexedSeq();entriesSequence.fromEntrySeq=function(){return iterable.toSeq()};return entriesSequence},filterNot:function(predicate,context){return this.filter(not(predicate),context)},findEntry:function(predicate,context,notSetValue){var found=notSetValue;this.__iterate(function(v,k,c){if(predicate.call(context,v,k,c)){found=[k,v];return false}});return found},findKey:function(predicate,context){var entry=this.findEntry(predicate,context);return entry&&entry[0]},findLast:function(predicate,context,notSetValue){return this.toKeyedSeq().reverse().find(predicate,context,notSetValue)},findLastEntry:function(predicate,context,notSetValue){return this.toKeyedSeq().reverse().findEntry(predicate,context,notSetValue)},findLastKey:function(predicate,context){return this.toKeyedSeq().reverse().findKey(predicate,context)},first:function(){return this.find(returnTrue)},flatMap:function(mapper,context){return reify(this,flatMapFactory(this,mapper,context))},flatten:function(depth){return reify(this,flattenFactory(this,depth,true))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(searchKey,notSetValue){return this.find(function(_,key){return is(key,searchKey)},undefined,notSetValue)},getIn:function(searchKeyPath,notSetValue){var nested=this;var iter=forceIterator(searchKeyPath);var step;while(!(step=iter.next()).done){var key=step.value;nested=nested&&nested.get?nested.get(key,NOT_SET):NOT_SET;if(nested===NOT_SET){return notSetValue}}return nested},groupBy:function(grouper,context){return groupByFactory(this,grouper,context)},has:function(searchKey){return this.get(searchKey,NOT_SET)!==NOT_SET},hasIn:function(searchKeyPath){return this.getIn(searchKeyPath,NOT_SET)!==NOT_SET},isSubset:function(iter){iter=typeof iter.includes==="function"?iter:Iterable(iter);return this.every(function(value){return iter.includes(value)})},isSuperset:function(iter){iter=typeof iter.isSubset==="function"?iter:Iterable(iter);return iter.isSubset(this)},keyOf:function(searchValue){return this.findKey(function(value){return is(value,searchValue)})},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(searchValue){return this.toKeyedSeq().reverse().keyOf(searchValue)},max:function(comparator){return maxFactory(this,comparator)},maxBy:function(mapper,comparator){return maxFactory(this,comparator,mapper)},min:function(comparator){return maxFactory(this,comparator?neg(comparator):defaultNegComparator)},minBy:function(mapper,comparator){return maxFactory(this,comparator?neg(comparator):defaultNegComparator,mapper)},rest:function(){return this.slice(1)},skip:function(amount){return this.slice(Math.max(0,amount))},skipLast:function(amount){return reify(this,this.toSeq().reverse().skip(amount).reverse())},skipWhile:function(predicate,context){return reify(this,skipWhileFactory(this,predicate,context,true))},skipUntil:function(predicate,context){return this.skipWhile(not(predicate),context)},sortBy:function(mapper,comparator){return reify(this,sortFactory(this,comparator,mapper))},take:function(amount){return this.slice(0,Math.max(0,amount))},takeLast:function(amount){return reify(this,this.toSeq().reverse().take(amount).reverse())},takeWhile:function(predicate,context){return reify(this,takeWhileFactory(this,predicate,context))},takeUntil:function(predicate,context){return this.takeWhile(not(predicate),context)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var IterablePrototype=Iterable.prototype;IterablePrototype[IS_ITERABLE_SENTINEL]=true;IterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.values;IterablePrototype.__toJS=IterablePrototype.toArray;IterablePrototype.__toStringMapper=quoteString;IterablePrototype.inspect=IterablePrototype.toSource=function(){return this.toString()};IterablePrototype.chain=IterablePrototype.flatMap;IterablePrototype.contains=IterablePrototype.includes;mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(mapper,context){var this$0=this;var iterations=0;return reify(this,this.toSeq().map(function(v,k){return mapper.call(context,[k,v],iterations++,this$0)}).fromEntrySeq())},mapKeys:function(mapper,context){var this$0=this;return reify(this,this.toSeq().flip().map(function(k,v){return mapper.call(context,k,v,this$0)}).flip())}});var KeyedIterablePrototype=KeyedIterable.prototype;KeyedIterablePrototype[IS_KEYED_SENTINEL]=true;KeyedIterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.entries;KeyedIterablePrototype.__toJS=IterablePrototype.toObject;KeyedIterablePrototype.__toStringMapper=function(v,k){return JSON.stringify(k)+": "+quoteString(v)};mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,false)},filter:function(predicate,context){return reify(this,filterFactory(this,predicate,context,false))},findIndex:function(predicate,context){var entry=this.findEntry(predicate,context);return entry?entry[0]:-1},indexOf:function(searchValue){var key=this.keyOf(searchValue);return key===undefined?-1:key},lastIndexOf:function(searchValue){var key=this.lastKeyOf(searchValue);return key===undefined?-1:key},reverse:function(){return reify(this,reverseFactory(this,false))},slice:function(begin,end){return reify(this,sliceFactory(this,begin,end,false))},splice:function(index,removeNum){var numArgs=arguments.length;removeNum=Math.max(removeNum|0,0);if(numArgs===0||numArgs===2&&!removeNum){return this}index=resolveBegin(index,index<0?this.count():this.size);var spliced=this.slice(0,index);return reify(this,numArgs===1?spliced:spliced.concat(arrCopy(arguments,2),this.slice(index+removeNum)))},findLastIndex:function(predicate,context){var entry=this.findLastEntry(predicate,context);return entry?entry[0]:-1},first:function(){return this.get(0)},flatten:function(depth){return reify(this,flattenFactory(this,depth,false))},get:function(index,notSetValue){index=wrapIndex(this,index);return index<0||(this.size===Infinity||this.size!==undefined&&index>this.size)?notSetValue:this.find(function(_,key){return key===index},undefined,notSetValue)},has:function(index){index=wrapIndex(this,index);return index>=0&&(this.size!==undefined?this.size===Infinity||index<this.size:this.indexOf(index)!==-1)},interpose:function(separator){return reify(this,interposeFactory(this,separator))},interleave:function(){var iterables=[this].concat(arrCopy(arguments));var zipped=zipWithFactory(this.toSeq(),IndexedSeq.of,iterables);var interleaved=zipped.flatten(true);if(zipped.size){interleaved.size=zipped.size*iterables.length}return reify(this,interleaved)},keySeq:function(){return Range(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(predicate,context){return reify(this,skipWhileFactory(this,predicate,context,false))},zip:function(){var iterables=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,iterables))},zipWith:function(zipper){var iterables=arrCopy(arguments);iterables[0]=this;return reify(this,zipWithFactory(this,zipper,iterables))}});IndexedIterable.prototype[IS_INDEXED_SENTINEL]=true;IndexedIterable.prototype[IS_ORDERED_SENTINEL]=true;mixin(SetIterable,{get:function(value,notSetValue){return this.has(value)?value:notSetValue},includes:function(value){return this.has(value)},keySeq:function(){return this.valueSeq()}});SetIterable.prototype.has=IterablePrototype.includes;SetIterable.prototype.contains=SetIterable.prototype.includes;mixin(KeyedSeq,KeyedIterable.prototype);mixin(IndexedSeq,IndexedIterable.prototype);mixin(SetSeq,SetIterable.prototype);mixin(KeyedCollection,KeyedIterable.prototype);mixin(IndexedCollection,IndexedIterable.prototype);mixin(SetCollection,SetIterable.prototype);function keyMapper(v,k){return k}function entryMapper(v,k){return[k,v]}function not(predicate){return function(){return!predicate.apply(this,arguments)}}function neg(predicate){return function(){return-predicate.apply(this,arguments)}}function quoteString(value){return typeof value==="string"?JSON.stringify(value):String(value)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(a,b){return a<b?1:a>b?-1:0}function hashIterable(iterable){if(iterable.size===Infinity){return 0}var ordered=isOrdered(iterable);var keyed=isKeyed(iterable);var h=ordered?1:0;var size=iterable.__iterate(keyed?ordered?function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0}:function(v,k){h=h+hashMerge(hash(v),hash(k))|0}:ordered?function(v){h=31*h+hash(v)|0}:function(v){h=h+hash(v)|0});return murmurHashOfSize(size,h)}function murmurHashOfSize(size,h){h=imul(h,3432918353);h=imul(h<<15|h>>>-15,461845907);h=imul(h<<13|h>>>-13,5);h=(h+3864292196|0)^size;h=imul(h^h>>>16,2246822507);h=imul(h^h>>>13,3266489909);h=smi(h^h>>>16);return h}function hashMerge(a,b){return a^b+2654435769+(a<<6)+(a>>2)|0}var Immutable={Iterable:Iterable,Seq:Seq,Collection:Collection,Map:Map,OrderedMap:OrderedMap,List:List,Stack:Stack,Set:Set,OrderedSet:OrderedSet,Record:Record,Range:Range,Repeat:Repeat,is:is,fromJS:fromJS};return Immutable})});function Zipper(left,right){return{left:left,right:right}}function fromList(xs){return Zipper(immutable.Stack(),immutable.Stack(xs))}function focus(z,def_val){var head=z.right.first();if(head){return head}return def_val}function reset(z){return Zipper(immutable.Stack(),z.left.reverse().concat(z.right))}function swap(z){return Zipper(immutable.Stack(z.right.reverse().shift()),immutable.Stack([z.right.last()]))}function goRight(z){if(z.right.size==1){return reset(z)}return Zipper(z.left.unshift(z.right.first()),z.right.shift())}function goLeft(z){if(z.left.size==0){return swap(z)}return Zipper(z.left.shift(),z.right.unshift(z.left.first()))}var empty$3=fromList([]);var Z={Zipper:fromList,focus:focus,goRight:goRight,goLeft:goLeft,empty:empty$3,fromList:fromList};riot$1.tag2("projects",'<div class="projects-box"> <h3>Projects for {this.username}</h3> <div class="text-break"> <div if="{this.swipe}" class="{`card animated ${this.transition}`}"> <div class="card-header"> <h4 class="card-title">{this.project().name}</h4> </div> <div class="card-body"> <a target="_blank" href="{this.project().html_url}"> See on github </a> <p>{this.project().description}</p> <p>{this.project().language}</p> </div> </div> </div> <div class="controls container"> <div class="columns"> <div class="column col-6"> <button onclick="{this.prev}" class="btn btn-lg nav-button float-right"> <i class="fa fa-arrow-left" aria-hidden="true"></i> </button> </div> <div class="column col-6"> <button onclick="{this.next}" class="btn btn-lg nav-button float-left"> <i class="fa fa-arrow-right" aria-hidden="true"></i> </button> </div> </div> </div> </div> </div>',"","",function(opts){var cycle_timeout=12;this.username="Wes";var self=this;self.transition="";self.swipe=true;var empty_project={name:"",html_url:"",description:"",language:""};this.project=function(){return Z.focus(self.opts.state.projects,empty_project)}.bind(this);this.next=function(){self.update({swipe:false});self.opts.state.projects=Z.goRight(self.opts.state.projects);self.update({transition:"fadeInRight",swipe:true})}.bind(this);this.prev=function(){self.update({swipe:false});self.opts.state.projects=Z.goLeft(self.opts.state.projects);self.update({transition:"fadeInLeft",swipe:true})}.bind(this)});riot$1.tag2("projectsview",'<projects state="{this.opts.state}"></projects>',"","",function(opts){});riot$1.tag2("postsview",'<posts> <post state="{this.parent.opts.state}"></post> </posts>',"","",function(opts){});riot$1.tag2("loading",'<div class="loading"></div>',"","",function(opts){});var RE_ORIGIN=/^.+?\/\/+[^\/]+/;var EVENT_LISTENER="EventListener";var REMOVE_EVENT_LISTENER="remove"+EVENT_LISTENER;var ADD_EVENT_LISTENER="add"+EVENT_LISTENER;var HAS_ATTRIBUTE="hasAttribute";var POPSTATE="popstate";var HASHCHANGE="hashchange";var TRIGGER="trigger";var MAX_EMIT_STACK_LEVEL=3;var win=typeof window!="undefined"&&window;var doc=typeof document!="undefined"&&document;var hist=win&&history;var loc=win&&(hist.location||win.location);var prot=Router.prototype;var clickEvent=doc&&doc.ontouchstart?"touchstart":"click";var central=observable$1();var started=false;var routeFound=false;var debouncedEmit;var base;var current;var parser;var secondParser;var emitStack=[];var emitStackLevel=0;function DEFAULT_PARSER(path){return path.split(/[\/?#]/)}function DEFAULT_SECOND_PARSER(path,filter){var f=filter.replace(/\?/g,"\\?").replace(/\*/g,"([^/?#]+?)").replace(/\.\./,".*");var re=new RegExp("^"+f+"$");var args=path.match(re);if(args){return args.slice(1)}}function debounce(fn,delay){var t;return function(){clearTimeout(t);t=setTimeout(fn,delay)}}function start(autoExec){debouncedEmit=debounce(emit,1);win[ADD_EVENT_LISTENER](POPSTATE,debouncedEmit);win[ADD_EVENT_LISTENER](HASHCHANGE,debouncedEmit);doc[ADD_EVENT_LISTENER](clickEvent,click);if(autoExec){emit(true)}}function Router(){this.$=[];observable$1(this);central.on("stop",this.s.bind(this));central.on("emit",this.e.bind(this))}function normalize(path){return path.replace(/^\/|\/$/,"")}function isString$1(str){return typeof str=="string"}function getPathFromRoot(href){return(href||loc.href).replace(RE_ORIGIN,"")}function getPathFromBase(href){return base[0]==="#"?(href||loc.href||"").split(base)[1]||"":(loc?getPathFromRoot(href):href||"").replace(base,"")}function emit(force){var isRoot=emitStackLevel===0;if(MAX_EMIT_STACK_LEVEL<=emitStackLevel){return}emitStackLevel++;emitStack.push(function(){var path=getPathFromBase();if(force||path!==current){central[TRIGGER]("emit",path);current=path}});if(isRoot){var first;while(first=emitStack.shift()){first()}emitStackLevel=0}}function click(e){if(e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.defaultPrevented){return}var el=e.target;while(el&&el.nodeName!=="A"){el=el.parentNode}if(!el||el.nodeName!=="A"||el[HAS_ATTRIBUTE]("download")||!el[HAS_ATTRIBUTE]("href")||el.target&&el.target!=="_self"||el.href.indexOf(loc.href.match(RE_ORIGIN)[0])===-1){return}if(el.href!==loc.href&&(el.href.split("#")[0]===loc.href.split("#")[0]||base[0]!=="#"&&getPathFromRoot(el.href).indexOf(base)!==0||base[0]==="#"&&el.href.split(base)[0]!==loc.href.split(base)[0]||!go(getPathFromBase(el.href),el.title||doc.title))){return}e.preventDefault()}function go(path,title,shouldReplace){if(!hist){return central[TRIGGER]("emit",getPathFromBase(path))}path=base+normalize(path);title=title||doc.title;shouldReplace?hist.replaceState(null,title,path):hist.pushState(null,title,path);doc.title=title;routeFound=false;emit();return routeFound}prot.m=function(first,second,third){if(isString$1(first)&&(!second||isString$1(second))){go(first,second,third||false)}else if(second){this.r(first,second)}else{this.r("@",first)}};prot.s=function(){this.off("*");this.$=[]};prot.e=function(path){this.$.concat("@").some(function(filter){var args=(filter==="@"?parser:secondParser)(normalize(path),normalize(filter));if(typeof args!="undefined"){this[TRIGGER].apply(null,[filter].concat(args));return routeFound=true}},this)};prot.r=function(filter,action){if(filter!=="@"){filter="/"+normalize(filter);this.$.push(filter)}this.on(filter,action)};var mainRouter=new Router;var route=mainRouter.m.bind(mainRouter);route.create=function(){var newSubRouter=new Router;var router=newSubRouter.m.bind(newSubRouter);router.stop=newSubRouter.s.bind(newSubRouter);return router};route.base=function(arg){base=arg||"#";current=getPathFromBase()};route.exec=function(){emit(true)};route.parser=function(fn,fn2){if(!fn&&!fn2){parser=DEFAULT_PARSER;secondParser=DEFAULT_SECOND_PARSER}if(fn){parser=fn}if(fn2){secondParser=fn2}};route.query=function(){var q={};var href=loc.href||current;href.replace(/[?&](.+?)=([^&]*)/g,function(_,k,v){q[k]=v});return q};route.stop=function(){if(started){if(win){win[REMOVE_EVENT_LISTENER](POPSTATE,debouncedEmit);win[REMOVE_EVENT_LISTENER](HASHCHANGE,debouncedEmit);doc[REMOVE_EVENT_LISTENER](clickEvent,click)}central[TRIGGER]("stop");started=false}};route.start=function(autoExec){if(!started){if(win){if(document.readyState==="interactive"||document.readyState==="complete"){start(autoExec)}else{document.onreadystatechange=function(){if(document.readyState==="interactive"){setTimeout(function(){start(autoExec)},1)}}}}started=true}};route.base();route.parser();riot$1.tag2("app",'<ul class="navigate tab tab-block"> <li class="{⁗tab-item animated fadeIn ⁗ + (this.active.projects ? ⁗active⁗ : ⁗⁗)}"> <a onclick="{to(⁗projects⁗)}" href="#">Projects</a> </li> <li class="{⁗tab-item ⁗ + (this.active.posts ? ⁗active⁗ : ⁗⁗)}"> <a onclick="{to(⁗posts⁗)}" href="#">Posts</a> </li> </ul> <div class="content"> <loading if="{!this.state.loaded}"></loading> <projectsview class="animated fadeInDown" if="{this.active.projects && this.state.loaded}" state="{this.state}" ref="projectsview"> </projectsview> <postsview state="{this.state}" if="{this.active.posts}" ref="postsview"> </postsview> </div>',"","",function(opts){this.route=route;this.riot=riot$1;this.state={pid:1,projects:Z.empty,loaded:false};this.active={projects:false,posts:false};var self=this;this.route("posts",function(){self.active.posts=true;self.active.projects=false;self.update()});this.route("projects",function(){self.active.projects=true;self.active.posts=false;self.update()});this.to=function(name){return function(e){e.preventDefault();this.route(name);return}.bind(this)}.bind(this);this.on("mount",function(){route.start(true)});function loaduser(){axios.get("/blog/projects").then(function(resp){self.state.projects=Z.fromList(resp.data);self.state.loaded=true;if(!self.active.posts){self.active.projects=true}self.update()})}this.on("mount",loaduser)});riot$1.tag2("grid",'<div class="container"> <yield></yield> </div>',"","",function(opts){});riot$1.tag2("row",'<div class="columns"> <yield></yield> </div>',"","",function(opts){});riot$1.tag2("column",'<div class="{⁗column ⁗ + this.opts.width}"> <yield></yield> </div>',"","",function(opts){});riot$1.mount("app");riot$1.mount("editor");riot$1.mount("post",{creator:"author"});riot$1.mount("decision");riot$1.mount("bbutton");riot$1.mount("projects")})();