-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgotoB.min.js
1 lines (1 loc) · 43.9 KB
/
gotoB.min.js
1
!function(){var l,e="object"==typeof exports,f=(l=e?exports:window.dale={},function(){return Object.prototype.toString.call(arguments).match("arguments")}()),p=function(e,t){var n=typeof e;return"function"===n?Object.prototype.toString.call(e).match(/regexp/i)?"regex":"function":"object"!==n&&"number"!==n?n:e instanceof Array?"array":"number"===n?isNaN(e)?"nan":isFinite(e)?e%1==0?"integer":"float":"infinity":null===e?"null":"array"===(n=Object.prototype.toString.call(e).replace("[object ","").replace("]","").toLowerCase())||"date"===n?n:"regexp"===n?"regex":t?!f&&"function"===n(e.callee)?"arguments":n:"object"};try{l.clog=console.log.bind(console)}catch(t){l.clog=function(){var e=l.go(arguments,function(e){return e===undefined?"undefined":e}).join(" ");window.console?window.console.log(e):alert(e)}}e=function(d){return function(e,t,n,r){var o,i,a,u;if("go"===d?(i=t,a=!0===n,u=[],o=0):"fil"===d?(i=n,a=!0===r,u=[],o=0):"obj"!==d?(i=n,a=!0===r):u="object"===p(t)?(i=n,a=!0===r,t):(i=t,a=!0===n,{}),"function"!==p(i))return l.clog(("go"===d||"obj"===d&&"object"!==p(t)?"Second":"Third")+" argument passed to dale."+d+" must be a function but instead is",i,"with type",p(i)),!1;if(e!==undefined){s="go"===d?function(e){u[o++]=e}:"fil"===d?function(e){e!==t&&(u[o++]=e)}:"obj"===d?function(e){if(e!==undefined)return"array"!==p(e)||2!==e.length?(l.clog("array"===p(e)?"fun passed to dale.obj must return undefined or an array of length 2 but instead returned an array of length "+e.length:"fun passed to dale.obj must return undefined or an array of length 2 but instead returned a value of type "+p(e)),!(u=!1)):void(u[e[0]]=e[1])}:function(e){return u=e,"stop"===d?e===t:e!==t};var s,r=p(e);if("object"!==r||"[object Arguments]"!==Object.prototype.toString.call(e)&&(f||"function"!==p(e.callee))||(r="array",e=[].slice.call(e)),"array"===r)for(var c=0;c<e.length&&!s(i(e[c],parseInt(c)));c++);else if("object"===r){for(var c in e)if((a||!e.hasOwnProperty||e.hasOwnProperty(c))&&s(i(e[c],c)))break}else s(i(e,0))}return u}};l.go=e("go"),l.fil=e("fil"),l.obj=e("obj"),l.stop=e("stop"),l.stopNot=e("stopNot"),l.keys=function(e,t){return l.go(e,function(e,t){return t},t)},l.times=function(e,t,n){if(0===e)return[];if("integer"!==p(e)||e<0)return l.clog("steps must be a positive integer or zero."),!1;if(t===undefined)t=1;else if("integer"!==p(t)&&"float"!==p(t))return l.clog("start must be an integer or float."),!1;if(n===undefined)n=1;else if("integer"!==p(n)&&"float"!==p(n))return l.clog("step must be an integer or float."),!1;for(var r=[t];r.length<e;)r.push(t+=n);return r},l.acc=function(e,t,n,r){var o,i=arguments.length===("boolean"===p(arguments[arguments.length-1])?4:3),a=i?t:undefined,u=i?n:t,s=i?r:n;return"function"!==p(u)?(l.clog("fun must be a function but instead is of type",p(u)),!1):(o=!0,l.go(e,function(e,t){if(!i&&o)return o=!1,a=e;a=u(a,e)},s),a)}}(),function(){var l,n="object"==typeof exports,f=n?require("dale"):window.dale,r=(l=n?exports:window.teishi={},Array.prototype.indexOf||(Array.prototype.indexOf=function(n,r){var e=f.stopNot(this,undefined,function(e,t){return!(r&&t<r)&&n===e?t:void 0});return e===undefined?-1:e}),function(){return Object.prototype.toString.call(arguments).match("arguments")}());l.type=function(e,t){var n=typeof e;return"function"==n?Object.prototype.toString.call(e).match(/regexp/i)?"regex":"function":"object"!=n&&"number"!=n?n:e instanceof Array?"array":"number"==n?isNaN(e)?"nan":isFinite(e)?e%1==0?"integer":"float":"infinity":null===e?"null":"array"===(n=Object.prototype.toString.call(e).replace("[object ","").replace("]","").toLowerCase())||"date"===n?n:"regexp"===n?"regex":t?!r&&"function"===l.type(e.callee)?"arguments":n:"object"},l.str=function(){try{return JSON.stringify.apply(JSON.stringify,arguments)}catch(e){return!1}},l.parse=function(){try{return JSON.parse.apply(JSON.parse,arguments)}catch(e){return!1}},l.simple=function(e){e=l.type(e);return"array"!==e&&"object"!==e},l.complex=function(e){return!l.simple(e)},l.inc=function(e,t){return-1<e.indexOf(t)},l.copy=function(r,o){var e,i;return l.simple(r)?r:(e=l.type(r,!0),i="array"===e||"arguments"===e?[]:{},f.go(r,function(e,t){var n;return l.simple(e)?i[t]=e:(n=o?o.concat():[r],l.inc(n,e)?i[t]="[Circular]":(n.push(e),i[t]=l.copy(e,n)))}),i)},l.eq=function(e,n){return l.simple(e)&&l.simple(n)?e===n:l.type(e,!0)===l.type(n,!0)&&l.str(f.keys(e).sort())===l.str(f.keys(n).sort())&&!1!==f.stop(e,!1,function(e,t){return l.eq(e,n[t])})},l.last=function(e,t){return l.inc(["array","arguments"],l.type(e,!0))?t!==undefined&&("integer"!==l.type(t)||t<1)?l.clog("Second argument passed to teishi.last must be either undefined or an integer larger than 0."):e[e.length-(t||1)]:l.clog("First argument passed to teishi.last must be array or arguments but instead has type "+l.type(e,!0))},l.time=function(e){return(arguments.length?new Date(e):new Date).getTime()};var o,p=function(){return n?"[0m":""},g=function(){return n?"[1m":""},h=function(){return n?"[37m":""},m=function(e){if(!n)return"";for(var t=o;o===t;)t=Math.round(5*Math.random()+1);return"["+(e?"4":"3")+(o=t)+"m"},d=(l.clog=function(){var c=g(),e=(!function d(o,i){var a=l.type(o),i=i||0,u=!0,s=("object"===a&&"[object Arguments]"===Object.prototype.toString.call(o)&&(a="array"),i<2?"":"\n"+f.go(f.times(i-1),function(e){return" "}).join(""));0<i&&(c+="array"===a?h()+"[":h()+"{"),f.go(o,function(e,t){var n,r=l.type(e);if(0===i&&0===t&&("string"===r||"integer"===r))return c+=m(!(u=!1))+e+(1<o.length?":":"")+p()+g();u||(c+=h()+(0===i?" ":", ")),u=!1,"string"===r&&0<i&&(e="'"+e+"'"),"function"===r&&(150<(e=null!==(n=(e+="").match(/\s+(?=}$)/))?e.replace(new RegExp(n[0],"g"),"\n"):e).length&&(e=e.slice(0,150)+"...\n"),1<i)&&(e=e.replace(/\n/g,"array"===a?s:"\n"+(t+": ").replace(/./g," ")+s.slice(1))),c+=m(),"object"===a&&(c+=s+(t.match(/^[0-9a-zA-Z_]+$/)?t:"'"+t+"'")+": "),"array"===r||"object"===r?d(e,i+1):c+="object"===a?e:s+e}),0<i&&("array"===a&&(c+=(1<i?"\n":"")+s.slice(4)+h()+"]"),"object"===a)&&(c+=(1<i?"\n":"")+s.slice(4)+h()+"}")}(l.copy(arguments)),new Date);return f.clog("("+e[e.toISOString?"toISOString":"toString"]()+")",c+p()),!1},l.lno=function(){n=!1},l.makeTest=function(c,d){if("function"!==l.type(c))return l.clog("teishi.makeTest","fun passed to teishi.makeTest should be a function but instead is",c,"with type",l.type(c));if("string"===l.type(d)&&(d=[d]),"array"!==l.type(d))return l.clog("teishi.makeTest","clauses argument passed to teishi.makeTest should be an array but instead is",d,"with type",l.type(d));if("string"!==l.type(d[0]))return l.clog("teishi.makeTest","shouldClause passed to teishi.makeTest should be a string but instead is",d[0],"with type",l.type(d[0]));if(d[1]!==undefined&&("array"!==l.type(d[1])&&(d[1]=[d[1]]),!0!==f.stopNot(d[1],!0,function(e){var t=l.type(e);return"string"===t||"function"===t||l.clog("teishi.makeTest","Each finalClause passed to teishi.makeTest should be a string or a function but instead is",e,"with type",t)})))return;return function(e,t,n,r,o,i){var a,u,s=c(n,r);return!0===s||("array"===l.type(s)?s:(a=[],u=0,o!==undefined&&(a[u++]="each of the"),t[0]&&(a[u++]=t[0]),e&&(a[u++]="passed to",a[u++]=e),a[u++]=d[0],i!==undefined&&(a[u++]="one of"),a[u++]=i!==undefined?i:r,t[1]&&(a[u++]="("+t[1]+")"),a[u++]=o!==undefined?"but one of":"but instead",o!==undefined&&(a[u++]=o),a[u++]="is",a[u++]=n,f.go(d[1],function(e){a[u++]="function"!=typeof e?e:e(n,r)}),a))}},l.test={type:l.makeTest(function(e,t){return l.type(e)===t},["should have as type",["with type",l.type]]),equal:l.makeTest(l.eq,"should be equal to"),notEqual:l.makeTest(function(e,t){return!l.eq(e,t)},"should not be equal to"),range:l.makeTest(function(n,e){return"object"!==l.type(e,!0)?["Range options object must be an object but instead is",e,"with type",l.type(e,!0)]:"{}"===l.str(e)||f.stopNot(e,!0,function(e,t){return"min"!==t&&"max"!==t&&"less"!==t&&"more"!==t?['Range options must be one of "min", "max", "less" and "more", but instead is',t]:"min"===t?e<=n:"max"===t?n<=e:"less"===t?n<e:e<n})},"should be in range"),match:l.makeTest(function(e,t){return"string"!==l.type(e)?["Invalid comparison string passed to teishi.test.match. Comparison string must be of type string but instead is",e,"with type",l.type(e)]:"regex"!==l.type(t)?["Invalid regex passed to teishi.test.match. Regex must be of type regex but instead is",t,"with type",l.type(t)]:null!==e.match(t)},"should match")},l.validateRule=function(r){var o,i,e=l.type(r);return"function"===e||"boolean"===e||("array"!==e?["each teishi rule must be an array or boolean or function but instead is",r,"with type",e]:"string"!==(e=l.type(r[0]))&&("array"!==e||2!==r[0].length||"string"!==l.type(r[0][0])||"string"!==l.type(r[0][1]))||3===r.length||(r.length<3||5<r.length?["Each teishi simple rule must be an array of length between 3 and 5, but instead is",r,"and has length",r.length]:f.stopNot(r,!0,function(e,t){if(!(t<3)){var n=l.type(e);if("string"===n){if("oneOf"!==e&&"each"!==e&&"eachOf"!==e)return["Invalid multi parameter",e,". Valid multi parameters are",["oneOf","each","eachOf"]];if(i)return["You can pass only one multi parameter to a teishi simple rule but instead you passed two:",r[3],"and",r[4]];i=e}else{if("function"!==n)return["Elements #4 and #5 of a teishi simple rule must be either a string or a function, but element","#"+(t+1),"is",e,"and has type",n];if(o)return["You can pass only one test function to a teishi simple rule but instead you passed two:",r[3],"and",r[4]];o=e}}return!0})))},function(e,t){return t===undefined?l.clog.apply(l.clog,["teishi.v"].concat(e)):(e=f.go(e,function(e){return l.complex(e)?l.str(e):e+""}).join(" "),!0===t?e:(t(e),!1))});l.v=function(e,t,n,r){var o,i,a,u;if(!(u="string"===l.type(e)?(o=e,i=t,a=n,r):(o="",i=e,a=t,n))&&!l.prod){if(a!==undefined&&!0!==a&&"function"!==l.type(a))return l.clog("teishi.v","Invalid apres argument. Must be either undefined, true, or a function.");r=l.validateRule(i);if(!0!==r)return d(r,a)}var s,c,e=l.type(i);return"boolean"===e?i:"function"===e?l.v(o,i(),a,u):0===i.length||("boolean"===(t=l.type(i[0]))&&2===i.length&&"array"===l.type(i[1])?!1===i[0]||l.v(o,i[1],a,u):"string"===t||"array"===t&&2===i[0].length&&"string"===l.type(i[0][0])&&"string"===l.type(i[0][1])?(n=l.type(i[3]),r=l.type(i[4]),s="function"===n?i[3]:"function"===r?i[4]:l.test.type,e="string"===n?i[3]:"string"===r?i[4]:undefined,c="array"===t?i[0]:[i[0]],n=l.type(i[1],!0),r=l.type(i[2],!0),("each"===e||"eachOf"===e)&&("array"===n&&0===i[1].length||"object"===n&&0===f.keys(i[1]).length||i[1]===undefined)||!0===(t="oneOf"!==e&&"eachOf"!==e||!("array"===r&&0===i[2].length||"object"===r&&0===f.keys(i[2]).length||i[2]===undefined)?e===undefined?s(o,c,i[1],i[2]):"each"===e?f.stopNot(i[1],!0,function(e){return s(o,c,e,i[2],i[1])}):"oneOf"===e?f.stop(i[2],!0,function(e){return s(o,c,i[1],e,undefined,i[2])}):f.stopNot(i[1],!0,function(t){return f.stop(i[2],!0,function(e){return s(o,c,t,e,i[1],i[2])})}):["To field of teishi rule is",i.to,"but multi attribute",e,"requires it to be non-empty, at teishi step",i])||d(t,a)):f.stopNot(i,!0,function(e){return l.v(o,e,a,u)}))},l.stop=function(){return!0!==l.v.apply(l.v,arguments)}}(),function(){var u,e="object"==typeof exports,s=e?require("dale"):window.dale,i=e?require("teishi"):window.teishi,c=(u=e?exports:window.lith={},i.type),d=i.clog,a=i.inc;u.k={lithbagElements:["string","integer","float","array","undefined"],tags:["!DOCTYPE HTML","LITERAL","a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],voidTags:["!DOCTYPE HTML","area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]},u.entityify=function(e,t){return!(!t&&i.stop("lith.entityify",["Entityified string",e,"string"],undefined,!0))&&e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")},u.v=function(t,e){var n,r,o=c(t);return"array"===o&&a(u.k.tags,t[0])?(r="object"===c(t[1])?t[1]:undefined,n=t[r?2:1],!0===(r=i.v([["lith length",t.length,{min:1,max:3},i.test.range],[r===undefined,["length of lith without attributes",t.length,{max:2},i.test.range]],[["lith attribute keys","start with an ASCII letter, underscore or colon, and be followed by letters, digits, underscores, colons, periods, dashes, extended ASCII characters, or any non-ASCII characters."],s.keys(r),/^[a-zA-Z_:][a-zA-Z_:0-9.\-\u0080-\uffff]*$/,"each",i.test.match],["lith attribute values",r,["string","integer","float","undefined","null","boolean"],"eachOf"],"LITERAL"===t[0]?["lith LITERAL contents",n,"string"]:["lith contents",n,u.k.lithbagElements,"oneOf"]],!!e||function(e){d("lith.v - Invalid lith",{error:e,"original input":t})},!0))?"Lith":!!e&&{error:r,"original input":t}):!0===(r=i.v([["lithbag",o,u.k.lithbagElements,"oneOf",i.test.equal],["array"===o,["lithbag elements",t,u.k.lithbagElements,"eachOf"]]],!!e||function(e){d("lith.v - Invalid lithbag",{error:e,"original input":t})},!0))?"Lithbag":!!e&&{error:r,"original input":t}},u.g=function(e,t){return t||u.prod?!0!==(t||u.prod)?d("lith.g","prod or lith.prod must be true or undefined."):"array"===c(e)&&a(u.k.tags,e[0])?u.generateLith(e,!0):u.generateLithbag(e,!1,!0):!!(t=u.v(e))&&u["generate"+t](e)},u.generateLithbag=function(e,t,n){var r="";return!1!==s.stop(e,!1,function(e){if(e!==undefined)return c(e),"array"!==c(e)?r+=t?e:u.entityify(e+"",n):!1!==(e=u.g(e,n))&&void(r+=e)})&&r},u.generateLith=function(e,n){var t="object"===c(e[1])?e[1]:undefined,r=e[t?2:1];if("LITERAL"===e[0])return r;var o="<"+e[0];if(s.go(t,function(e,t){!e&&0!==e||(o+=" "+u.entityify(t+"",n)+'="'+u.entityify(e+"",n)+'"')}),o+=">","array"===c(r)){t=("style"===e[0]?u.css:u).g(r,n);if(!1===t)return!1;o+=t}else o+=u.generateLithbag(r,"style"===e[0]||"script"===e[0],n);return a(u.k.voidTags,e[0])||(o+="</"+e[0]+">"),o},u.css={},u.css.v=function(t,e){var n,r,o=i.v(["litc or litcbag",t,"array"],!!e||function(e){d("lith.css.v - Invalid litc or litcbag",{error:e,"original input":t})},!0);return!0!==o?!!e&&{error:o,"original input":t}:0===t.length||"array"===c(t[0])||(n="object"===c(t[1])?t[1]:undefined,r=t[n?2:1],!0===(o=i.v([["litc length",t.length,{min:1,max:3},i.test.range],[n===undefined,["length of litc without attributes",t.length,{max:2},i.test.range]],["litc selector",t[0],"string"],u.css.vAttributes(n),"LITERAL"===t[0]?["litc LITERAL contents",r,"string"]:["litc contents",r,["undefined","array"],"oneOf"]],!!e||function(e){d("lith.css.v - Invalid litc",{error:e,"original input":t})},!0))?o:!!e&&{error:o,"original input":t})},u.css.vAttributes=function(e){return i.v([["litc attribute values",e,["string","integer","float","object","undefined","null","boolean"],"eachOf"]],undefined,!0)},u.css.g=function(e,n,r){if(n||u.prod){if(!0!==(n||u.prod))return d("lith.css.g","prod or lith.prod must be true or undefined.");n=!0}if(!n&&!1===u.css.v(e))return!1;if(0===e.length)return"";if("LITERAL"===e[0])return e[1];var o="";if("array"===c(e[0]))return!1!==s.stop(e,!1,function(e,t){e=u.css.g(e,n,r);if(!1===e)return!1;o+=e})&&o;r===undefined&&(r="");var t="object"===c(e[1])?e[1]:undefined,i=e[t?2:1],a=(r=s.go(r.split(/,\s*/),function(t){return s.go(e[0].split(/,\s*/),function(e){return e.match(/&/)?e.replace("&",t):t+(0===t.length?"":" ")+e}).join(", ")}).join(", "),o+=r+"{",function(e){return!1!==u.css.vAttributes(e)&&s.stop(e,!1,function(t,e){if(t||0===t){var n=c(t);if("object"===n)return a(t);"integer"===n&&(t<0||1<t)&&(t+="px"),"float"!==n&&1!==t||(t=100*t+"%"),s.go(e.split(/,\s*/),function(e){o+=e+":"+t+";"})}})});if(!1===a(t))return!1;if(o===r+"{"?o="":o+="}",i){t=u.css.g(i,n,r);if(!1===t)return!1;o+=t}return o},u.css.media=function(e,t){return!i.stop(["selector",e,"string"],undefined,!0)&&[["LITERAL","@media "+e+" {"],t,["LITERAL","}"]]},u.css.style=function(e,t){e=u.css.g(["",e],t);return!1===e?e:e.slice(1,-1)}}(),function(){var e="object"==typeof exports,u=e?require("dale"):window.dale,s=e?require("teishi"):window.teishi,c=s.type,t=s.clog,n=function(e){var a;if(!s.stop([["store",e,["array","object","undefined"],"oneOf"]],undefined,!0))return a={responders:{},store:e||{},log:[],error:t,count:{e:1,r:1},call:function(){var t,e,n,r,o=arguments[(r="object"===c(arguments[0])?arguments[0]:undefined)?1:0],i=arguments[r?2:1];return s.simple(i)&&(i=[i]),!(!a.prod&&s.stop("r.call",[["context",r,["object","undefined"],"oneOf"],[r!==undefined,[function(){return["x.from",r.from,["string","undefined"],"oneOf"]}]],["verb",o,"string"]],function(e){r?a.error(r,"r.call",e):a.error("r.call",e)},!0))&&(a.prod||a.isPath(i)?(e=(t=arguments).length===(r?3:2)?undefined:u.go(u.times(arguments.length-(r?3:2),r?3:2),function(e){return t[e]}),n=r?r.responder?r.responder.id+"/"+r.from:r.from:undefined,r={from:"E"+a.count.e++,verb:o,path:i,args:e},a.addLog({t:s.time(),from:n,id:r.from,verb:o,path:i,args:s.copy(e)}),a.mill(e===undefined?[r]:[r].concat(e)),r.from):r?a.error(r,"r.call","Invalid path. Arguments:",{verb:o,path:i}):a.error("r.call","Invalid path. Arguments:",{verb:o,path:i}))},respond:function(){var e,t=arguments[arguments.length-1];if(arguments.length<2)return a.error("r.respond","Too few arguments passed to r.respond");if(2===arguments.length?e=arguments[0]:((e=3===arguments.length?{}:arguments[2]).verb=arguments[0],e.path=arguments[1]),s.simple(e.path)&&(e.path=[e.path]),!a.prod&&s.stop("r.respond",[["options",e,"object"],["keys of options",u.keys(e),["verb","path","id","parent","priority","burn","match"],"eachOf",s.test.equal],function(){return[["options.verb",e.verb,["string","regex"],"oneOf"],["options.id",e.id,["string","integer","undefined"],"oneOf"],["options.parent",e.parent,["string","integer","undefined"],"oneOf"],["options.priority",e.priority,["undefined","integer"],"oneOf"],["options.burn",e.burn,["undefined","boolean"],"oneOf"],["options.match",e.match,["undefined","function"],"oneOf"]]},["responder function",t,"function"]],function(e){a.error("r.respond",e)},!0))return!1;if(!a.prod&&!a.isPath(e.path,!0))return a.error("r.respond","Invalid path. Options:",e);if(e.id!==undefined){if(e.id+="",!a.prod&&e.id.match(/^[R|E]\d+$/))return a.error("r.respond","If you pass an id for a responder, it cannot be an `R` or an `E` followed by digits, since that is the form that recalc gives to auto-generated ids.");if(!a.prod&&a.responders[e.id])return a.error("r.respond","A responder with id",e.id,"already exists.")}else e.id="R"+a.count.r;return e.rfun=t,e.index=a.count.r++,(a.responders[e.id]=e).id},forget:function(n,r){var e;return a.prod||r===undefined||"function"===c(r)?a.prod||a.responders[n]?(e=a.responders[n],delete a.responders[n],r&&r(e),void u.go(a.responders,function(e,t){e.parent===n&&a.forget(t,r)})):a.error("r.forget","responder",n,"does not exist."):a.error("r.forget","Second argument to r.forget must be a function or undefined. Id is:",n)},isPath:function(e,t){return s.v([["path",e,["array","integer","string"].concat(t?"regex":[]),"oneOf"],["path",e,["integer","string"].concat(t?"regex":[]),"eachOf"]],function(){},!0)},compare:function(e,t){return"*"===e||"*"===t||("regex"===c(t)?null!==(e+"").match(t):e===t)},addLog:function(e){a.log.push(e)},mill:function(n){var r=function(e){if(0!==e.length){n[0].cb=function(){r(e)};var t=e.shift();if(n[0].responder=t,!a.responders[t.id])return r(e);a.addLog({t:s.time(),from:n[0].from,id:t.id,verb:t.verb,path:t.path,args:n.slice(1).length?s.copy(n.slice(1)):undefined}),t.burn&&a.forget(t.id),"function"!==c(t.rfun.apply(null,n))&&r(e)}};r(a.sort(a.match(n[0].verb,n[0].path,n.slice(1),a.responders)))},match:function(e,r,t,n){var o=[];return u.go(n,function(n){if(!n.disabled)return n.match?!0===n.match({verb:e,path:r,args:t},n)?o.push(n):undefined:a.compare(e,n.verb)&&r.length===n.path.length?0===r.length&&0===n.path.length?o.push(n):void(u.stop(r,!1,function(e,t){return a.compare(r[t],n.path[t])})&&o.push(n)):void 0}),o},sort:function(e){return e.sort(function(e,t){var n=(t.priority||0)-(e.priority||0);return 0!=n?n:e.index-t.index})}}};e?module.exports=n:window.R=n}(),function(){var s,c,d,l,u,f;"object"==typeof exports?console.log("cocholate only works in a browser!"):(s=window.dale,d=(c=window.teishi).type,l=c.clog,u=c.inc,document.createElement("_").insertAdjacentHTML||(HTMLElement.prototype.insertAdjacentHTML=function(e,t){var n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)"beforeBegin"===e?this.parentNode.insertBefore(n.firstChild,this):"afterBegin"===e?this.insertBefore(n.firstChild,this.firstChild):"beforeEnd"===e?this.appendChild(n.firstChild):this.parentNode.insertBefore(n.firstChild,this.nextElementSibling)}),(f=window.c=function(e,t){var n,r,o;return!(!f.prod&&c.stop("c",["fun",t,["function","undefined"],"oneOf"],undefined,!0))&&!1!==(o=(n=e&&e.nodeName)?[e]:f.find(e))&&(t&&(r=s.go(arguments,function(e){return e}).slice(2),o=s.go(o,function(e){return t.apply(undefined,[e].concat(r))})),n||"body"===e||"string"===d(e)&&e.match(/^[a-z0-9]*#[^\s\[>,:]+$/)?o[0]:o)}).nodeListToArray=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},f.setop=function(e,t,n){var r;return"and"===e?s.fil(t,undefined,function(e){if(u(n,e))return e}):(r=t.slice(),"or"===e?s.go(n,function(e){u(r,e)||r.push(e)}):(0===r.length&&(r=f.nodeListToArray(document.getElementsByTagName("*"))),s.go(n,function(e){e=r.indexOf(e);-1<e&&r.splice(e,1)})),r)},f.find=function(t){var e,n,r,o,i,a=d(t);return!(!f.prod&&c.stop("cocholate",[["selector",t,["array","string","object"],"oneOf"],function(){return[["array"===a,["first element of array selector",t[0],[":and",":or",":not"],"oneOf",c.test.equal]],["object"===a,[["selector keys",s.keys(t),["selector","from"],"eachOf",c.test.equal],["selector.selector",t.selector,["array","string"],"oneOf"],function(){return!("object"!==d(t.from)||document.querySelectorAll&&!t.from.querySelectorAll)||l("c.find","selector.from passed to cocholate must be a DOM element.")}]]]}],undefined,!0))&&("array"!==a?document.querySelectorAll&&"string"===a?f.nodeListToArray(document.querySelectorAll(t)):document.querySelectorAll&&"object"===a?f.nodeListToArray(t.from.querySelectorAll(t.selector)):(e=t.from||document,"*"===(t="string"===a?t:t.selector)||t.match(/^[a-z0-9]*(#|\.)?[^,>\[\]]+$/i)?(n=t.match("#")?"id":t.match(/\./)?"class":undefined,r=2!==(t=t.split(/#|\./)).length&&n?undefined:t[0].toUpperCase(),s.fil(f.nodeListToArray(e.getElementsByTagName(r||"*")),undefined,function(e){if(("class"!==n||u((e.className||"").split(/\s/),c.last(t)))&&("id"!==n||e.id===c.last(t)))return e})):l("The selector "+t+" is not supported in IE <= 7 or Firefox <= 3.")):(o=t.shift(),i=[],s.stop(t,!1,function(e,t){e=f.find(e);if(!1===e)return i=!1;i=0===t&&":not"!==o?e:f.setop(o.replace(":",""),i,e)}),i))},f.empty=function(e){f(e,function(e){e.innerHTML=""})},f.fill=function(e,t){if(!f.prod&&c.stop("c.fill",["html",t,"string"],undefined,!0))return!1;f(e,function(e){e.innerHTML=t})},f.place=function(e,t,n){if(!f.prod&&c.stop("c.place",[["where",t,["beforeBegin","afterBegin","beforeEnd","afterEnd"],"oneOf",c.test.equal],["html",n,"string"]],undefined,!0))return!1;f(e,function(e){e.insertAdjacentHTML(t,n)})},f.get=function(e,n,r){var o;return!(!f.prod&&c.stop("c.get",["attributes",n,["string","array","undefined"],"oneOf"],undefined,!0))&&(o=[null,"",!1,0,"false"],f(e,function(t){return n!==undefined?s.obj(n,function(e){return r?[e,t.style[e]||null]:[e,t.getAttribute(e)]}):r?s.obj(t.style.length?s.times(t.style.length,0):s.keys(t.style),function(e){return t.style.length?[t.style[e],t.style[t.style[e]]]:u(o,t.style[e])?void 0:[e,t.style[e]]}):s.obj(t.attributes,t["class"]||t.className?{"class":t["class"]||t.className}:{},function(e,t){if(e&&e.nodeName&&!u(o,e.nodeValue))return[e.nodeName,e.nodeValue]})}))},f.set=function(e,t,r,o){if(!f.prod&&c.stop("c.set",[["attributes",t,"object"],[["attribute keys","start with an ASCII letter, underscore or colon, and be followed by letters, digits, underscores, colons, periods, dashes, extended ASCII characters, or any non-ASCII characters."],s.keys(t),/^[a-zA-Z_:][a-zA-Z_:0-9.\-\u0080-\uffff]*$/,"each",c.test.match],["attribute values",t,["integer","float","string","null"],"eachOf"]],undefined,!0))return!1;f(e,function(n){s.go(t,function(e,t){r?n.style[t]=null===e?"":e:null===e?n.removeAttribute(t):n.setAttribute(t,e)}),o||f.fire(n,"change")})},f.fire=function(e,r){if(!f.prod&&c.stop("c.fire",["event type",r,"string"],undefined,!0))return!1;f(e,function(e){var t;try{t=new Event(r)}catch(n){t=document.createEvent?document.createEvent("Event"):document.createEventObject(),document.createEvent&&t.initEvent(r,!1,!1)}if(e.dispatchEvent)return e.dispatchEvent(t);if(!e.fireEvent)return l("c.fire error","Unfortunately, this browser supports neither EventTarget.dispatchEvent nor element.fireEvent.");try{e.fireEvent("on"+r,t)}catch(n){e["on"+r]&&e["on"+r]()}})},f.ready=function(e){var t;return window.addEventListener?window.addEventListener("load",e,!1):window.attachEvent?window.attachEvent("onload",e):void setInterval(function(){"complete"!==document.readyState||e()||clearInterval(t)},10)},f.cookie=function(e){return!1===e?s.go(document.cookie.split(/;\s*/),function(e){return document.cookie=e.replace(/^ +/,"").replace(/=.*/,"=;expires="+(new Date).toUTCString()),e}):s.obj((e||document.cookie).split(/;\s*/),function(e){if(""!==e)return[(e=e.split("="))[0],e.slice(1).join("=")]})},f.ajax=function(e,t,n,r,o){var i;return e=e||"GET",n=n||{},r=r||"",o=o||function(){},!(!f.prod&&c.stop("c.ajax",[["method",e,"string"],["path",t,"string"],["headers",n,"object"],["callback",o,"function"]],undefined,!0))&&((i=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")).open(e.toUpperCase(),t,!0),c.complex(r)&&"formdata"!==d(r,!0)&&(n["content-type"]=n["content-type"]||"application/json",r=c.str(r)),s.go(n,function(e,t){i.setRequestHeader(t,e)}),i.onreadystatechange=function(){if(4===i.readyState){if(200!==i.status&&304!==i.status)return o(i);var n,e={xhr:i,headers:s.obj(i.getAllResponseHeaders().split(/\r?\n/),function(e){var t;if(""!==e)return t=e.match(/^[^:]+/)[0],e=e.replace(t,"").replace(/:\s+/,""),t.match(/^content-type/i)&&e.match(/application\/json/i)&&(n=!0),[t,e]})};e.body=n?c.parse(i.responseText):i.responseText,o(null,e)}},i.send(r),{headers:n,body:r,xhr:i})},f.loadScript=function(e,r){return r=r||function(){},f.ajax("get",e,{},"",function(e,t){if(e)return r(e);var n=document.createElement("script");try{n.appendChild(document.createTextNode(t.body))}catch(e){n.text=t.body}document.body.appendChild(n),r(null,t)})},f.test=function(e,a){if(!f.prod&&c.stop("c.test",[["tests",e,"array"],["tests",e,"array","each"],s.go(e,function(e,t){return 0===e.length?[]:[["test length",e.length,{min:2,max:3},c.test.range],["test #"+(t+1)+" tag",e[0],"string"],2===e.length?["test #"+(t+1)+" check",e[1],"function"]:[["test #"+(t+1)+" action",e[1],"function"],["test #"+(t+1)+" check",e[2],"function"]]]}),["callback",a,["function","undefined"],"oneOf"]],undefined,!0))return!1;a=a||function(e,t){if(e)throw new Error("c.test: Test failed: "+e.test+"; result: "+e.result);l("c.test","All tests finished successfully ("+(c.time()-n)+" ms)")};var n=c.time(),u=function(r){var o,i=e[r];return i?0===i.length?u(r+1):(o=function(e,t){var n=i[i.length-1]();if(!t||!0!==n&&e||clearInterval(t),!0===n)return u(r+1);e||a({test:i[0],result:n})},l("c.test","Running test:",i[0]),2===i.length?o():void(i[1](function(e,t){if(e===undefined)return o();if("integer"!==d(e)||e<0)throw new Error("c.test: `wait` parameter must be undefined, zero or a positive integer but instead is "+e);if(t===undefined)return setTimeout(o,e);if("integer"!==d(t)||t<1)throw new Error("c.test: `ms` parameter must be undefined or a positive integer but instead is "+t);var n=c.time()+e,r=setInterval(function(){o(c.time()<=n,r)},t)})!==undefined&&o())):a(null,c.time()-n)};u(0)})}(),function(){var v,c,l,d,a,f,w,p,j;"object"==typeof exports?console.log("gotoв only works in a browser!"):(v=window.dale,c=window.teishi,l=window.lith,d=window.R(),a=window.c,f=c.type,w=c.inc,p=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},j=window.B={v:"2.3.1",B:"в",t:p(),r:d,responders:d.responders,store:d.store,log:d.log,call:d.call,respond:d.respond,forget:d.forget},d.error=j.error=function(){var e="object"===f(arguments[0])?arguments[0]:undefined,t=v.go(arguments,function(e){return e}).slice(e?1:0);return j.call.apply(null,[e||{},"error"].concat(t)),!1},j.respond({id:"error",verb:"error",path:[],match:function(e){return"error"===e.verb}},function(){document.body.innerHTML+=l.g(["div",{id:"eventlog-snackbar",style:l.css.style({position:"fixed","font-weight":"bold",opacity:"0.8",top:0,left:.1,width:.8,padding:10,color:"white","background-color":"black","z-index":"10001","text-align":"center"})},"There was an error."],!0),setTimeout(function(){a("#eventlog-snackbar")&&document.body.removeChild(a("#eventlog-snackbar"))},3e3),j.eventlog()}),j.eventlog=function(t){a("#eventlog")&&document.body.removeChild(a("#eventlog"));var r={},o=["#fe6f6c","#465775","#e086c3","#8332ac","#462749","#044389","#59c9a6","#ffad05","#7cafc4","#5b6c5d"],i=0;document.body.innerHTML+=l.g(["table",{id:"eventlog"},[["style",["#eventlog",{display:"block","table-layout":"fixed","border-collapse":"collapse","font-family":"monospace","font-size":18,position:"absolute","top, left":4,width:(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-22,"z-index":"10000",border:"solid 4px #4488DD"},["th, td",{"padding-left, padding-right":10,"border-bottom, border-right":"solid 1px black","word-wrap":"break-word","max-width":(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)/4}]]],["tr",v.go(["#","ms","type","id","from","verb","path","args"],function(e){return["th",{style:l.css.style({"background-color":"#efefef"})},e]})],v.go(j.log,function(e){var n;if(t===undefined||JSON.stringify(e).match(new RegExp(t,"i")))return n="E"!==e.id[0]&&e.from&&e.from.match(/^E\d+$/)?e.id+"/"+e.from:undefined,r[n||e.id]=i++,["tr",{style:l.css.style({"background-color":{0:"#fcfcfc",1:"#efefef"}[(i-1)%2]}),"class":"E"===e.id[0]?"evlog-ev":"evlog-resp"},v.go(["#"+i,e.t-j.t,e.id.match(/^E\d+$/)?"event":"responder",e.id,e.from,e.verb,e.path.join(":"),v.go(e.args,function(e){return e=j.str(e,!0),t=300,e.length<t+10?e:e.slice(0,Math.ceil(2*t/3))+" [[["+(e.length-t)+" CHARACTERS OMITTED]]] "+e.slice(-Math.floor(t/3));var t}).join(" ")],function(e,t){return 1===t?["td",e/1e3+(e%1e3?"":".0")+(e%100?"":"0")+(e%10?"":"0")+"s"]:3!==t&&4!==t?["td",e]:["td",{onclick:e===undefined?"":'var row = c ({from: c ("#eventlog"), selector: "tr"}) ['+((r[e]===undefined?r[n]:r[e])+1)+']; if (row) row.scrollIntoView (); if (row) row.style.background = "#8e8e8e"; if (row) setTimeout (function () {row.style.background = "#bebebe"}, 500); if (row) setTimeout (function () {row.style.background = "white"}, 1000);',style:l.css.style({cursor:"pointer","font-weight":"bold",color:o[parseInt(r[e])%o.length]})},e===undefined?"":e]})]})]],!0)},j.get=function(){var n,r="array"===f(arguments[0])?arguments[0]:v.go(arguments,function(e){return e});return j.prod||d.isPath(r)?(n=j.store,!1===v.stop(r,!1,function(e,t){if(t<r.length-1&&c.simple(n[e]))return!1;n=n[e]})?undefined:n):j.error("B.get","Invalid path:",r)||undefined},j.set=function(){var e,n,t="object"===f(arguments[0])?arguments[0]:undefined,r=arguments[t?1:0],o=arguments[t?2:1];return j.prod||d.isPath(r)?0===(r="array"!==f(r)?[r]:r).length?!j.prod&&c.simple(o)?j.error(t||{},"B.set","Cannot set B.store to something that is not an array or object:",o):(j.store=o,!0):(e="string"===f(r[0])?"object":"array",f(j.store)!==e&&(j.store="object"==e?{}:[]),n=j.store,v.go(r,function(e,t){if(t===r.length-1)return n[e]=o;t="string"===f(r[t+1])?"object":"array";f(n[e])!==t&&(n[e]="object"==t?{}:[]),n=n[e]}),!0):j.error(t||{},"B.set","Invalid path:",r)},j.add=function(){var n="object"===f(arguments[0])?arguments[0]:undefined,e=arguments[n?1:0];if(!j.prod&&!d.isPath(e))return j.error(n||{},"B.add","Invalid path:",e);j.get(e)===undefined&&j.set(e,[]);var r=j.get(e);return j.prod||"array"===f(r)?(v.go(arguments,function(e,t){(n?1:0)<t&&r.push(e)}),!0):j.error(n||{},"B.add","Cannot add to something that is not an array. Path:",e)},j.rem=function(){var t,e,n,r="object"===f(arguments[0])?arguments[0]:undefined,o=arguments[r?1:0];return j.prod||d.isPath(o)?(t=j.get(o),e=f(t),n="array"===f(arguments[r?2:1])?arguments[r?2:1]:v.go(arguments,function(e){return e}).slice(r?2:1),!(!j.prod&&c.stop("B.rem",[["type of target",e,["array","object","undefined"],"oneOf",c.test.equal],"array"===e?["keys of array target",n,"integer","each"]:[],"object"===e?["keys of object target",n,"string","each"]:[]],function(e){j.error(r||{},"B.rem",e,"Path:",o)},!1)||("object"===e&&v.go(n,function(e){delete t[e]}),"array"===e&&(n=n.slice().sort(function(e,t){return t-e}),v.go(n,function(e){t.splice(e,1)})),0))):j.error(r||{},"B.rem","Invalid path:",o)},j.mrespond=function(e){v.go(e,function(e){j.respond.apply(null,e)})},v.go(["add","rem","set","madd","mrem","mset"],function(e,r){j.respond({id:e,verb:e,path:[],match:function(e,t){return d.compare(e.verb,t.verb)}},function(t){var n;return 2<r?j[e.replace(/^m/,"")].apply(null,[t,t.path].concat(t.args||[])):(n="set"===e?j.get(t.path):c.copy(j.get(t.path)),!1===j[e].apply(null,[t,t.path].concat(t.args||[]))||c.eq(n,j.get(t.path))?void 0:"rem"!==e?j.call(t,"change",t.path,j.get(t.path),n):void v.go(t.args,function(e){v.go(e,function(e){j.call(t,"change",t.path.concat(e),undefined,n[e])})}))})}),j.changeResponder=function(t,n){return!!d.compare(t.verb,n.verb)&&(0===t.path.length||0===n.path.length||v.stop(v.times(Math.min(t.path.length,n.path.length),0),!1,function(e){return d.compare(t.path[e],n.path[e])}))},j.str=function(e,t){var n=f(e);return"array"!==n&&"object"!==n?"string"===n?t?e:c.str(e):e+"":"array"===n?"["+v.go(e,function(e){return j.str(e)}).join(", ")+"]":"{"+v.go(e,function(e,t){return c.str(t)+": "+j.str(e)}).join(", ")+"}"},j.evh=function(e){return v.obj(a.get(e),function(e,t){if(!t.match(/^on/))return[t,e]})},j.ev=function(){var t,n;return t="array"===f(arguments[0])?arguments:0===arguments.length?[]:[v.go(arguments,function(e){return e})],!(!j.prod&&c.stop("B.ev",v.go(t,function(e){return[["ev",e,"array"],e.length?function(){return[["ev.verb",e[0],"string"],function(){return!!d.isPath(e[1])||j.error("B.ev","Invalid path:",e[1],"Events:",t)}]}:[]]}),function(e){j.error("B.ev",e,"Events:",t)},!1))&&(n='var id = B.call ("ev", event ? event.type : "undefined event", B.evh (this));',v.go(t,function(e){var t=j.internal.oldFF?'this.value || (this.attributes.value ? this.attributes.value.nodeValue : "")':"this.value";e.length&&(n+=' B.call ({"from": id}, '+v.go(2===e.length?e.concat({raw:t}):e,function(e,t){return 1<t&&"object"===f(e)&&"string"===f(e.raw)?e.raw:j.str(e)}).join(", ")+");")}),n)},j.mount=function(e,t){if(!j.prod&&"string"!==f(e)||!e.match(/^(body|[a-z0-9]*#[^\s\[>,:]+)$/))return j.error("B.mount","Target must be either 'body' or an id selector, but instead is:",e);var n="body"===e?document.body:document.getElementById(e.replace(/.*#/g,""));if(!j.prod){if(!n)return j.error("B.mount","Target not found:",e);if("function"!==f(t))return j.error("B.mount","fun must be a function but instead is",t,"with type",f(t))}n=t();if(!j.prod){t=j.validateLith(n);if("Lith"!==t&&"Lithbag"!==t)return j.error("B.mount","fun returned invalid lith or lithbag",t.error)}a.place(e,"beforeEnd",l.g(n,!0))},j.unmount=function(e){var t;return!j.prod&&"string"!==f(e)||!e.match(/^(body|[a-z0-9]*#[^\s\[>,:]+)$/)?j.error("B.unmount","Target must be either 'body' or an id selector, but instead is "+e):(t="body"===e?document.body:document.getElementById(e.replace(/.*#/g,"")),j.prod||t?(a({selector:"*",from:t},function(e){e.id&&e.id.match(/^в[0-9a-f]+$/g)&&j.responders[e.id]&&j.forget(e.id)}),void(t.innerHTML="")):j.error("B.unmount","Target not found:",e))},j.view=function(o,i){var a,u,s="array"!==f(o)?[[o]]:"array"!==f(o[0])?[o]:o;return!(!j.prod&&c.stop("B.view",[v.stopNot(s,!1,function(e){return!!d.isPath(e)||j.error("B.view","Invalid path:",e)}),function(){return["fun",i,"function"]}],function(e){j.error("B.view","Validation error:",e,"Path:",o)},!1))&&(a=j.B+j.internal.count++,u=function(){var e=j.internal.count,t=[],n=i.apply(null,v.go(s,j.get)),r=j.prod?"Lith":j.validateLith(n);if("Lith"!==r)return j.error("B.view","View function at path",o,"must return a lith element but instead returned"+(r.error?" an invalid lith: ":" a lithbag")+(r.error||""));if(!j.prod&&"object"===f(n[1])&&n[1].id!==undefined)return j.error("B.view","View function at path",o,"must return a lith element without an id attribute but instead returned an element with id "+n[1].id);v.go(v.times(j.internal.count-e,e),function(e){e=j.responders[j.B+e];e.parent||(t.push(e.id),e.parent=a),e.priority=e.priority+j.responders[a].priority});r=v.obj("object"===f(n[1])?n[1]:{},{id:a,path:v.go(s,function(e){return e.join(":")||":"}).join(", ")},function(e,t){if(!w(["id","path"],t.toLowerCase()))return[t,e]}),n=n.slice();return"object"!==f(n[1])?n.splice(1,0,r):n[1]=r,j.responders[a].elem=n,j.responders[a].children=t,n},j.respond("change",[],{id:a,priority:-1,match:function(t){return v.stop(s,!0,function(e){return j.changeResponder(t,{verb:"change",path:e})})}},function(e){var t=j.responders[a].elem,n=j.responders[a].children,r=p();u()&&j.redraw(e,a,t,n,p()-r)}),u())},j.internal={count:1,timeout:200,queue:[],redrawing:!1},document.body.fireEvent&&!document.body.dispatchEvent&&(j.internal.oldIE=!0),!document.querySelectorAll&&j.internal.oldIE&&(j.internal.olderIE=!0),document.querySelectorAll||j.internal.oldIE||(j.internal.oldFF=!0),navigator.userAgent.match("Opera")&&(j.internal.oldOpera=!0),j.validateLith=function(e){var t=l.v(e,!0);return"Lith"!==t&&"Lithbag"!==t?t:"Lith"===t?"array"!==f(c.last(e))||"Lith"===(t="style"===e[0]?j.validateLitc(c.last(e)):j.validateLith(c.last(e)))||"Lithbag"===t||!0===t?"Lith":t:v.stopNot(e,undefined,function(e){return"array"===f(e)&&"Lith"!==(e=j.validateLith(e))&&"Lithbag"!==e?e:void 0})||"Lithbag"},j.validateLitc=function(e){var t=l.css.v(e,!0);return!0!==t?t:"array"===f(e[0])?v.stopNot(e,!0,j.validateLitc):"array"!==f(c.last(e))||j.validateLitc(c.last(e))},document.body.contains||(document.body.contains=function(e){for(;e=e.parentNode;)if(e===document.body)return!0;return!1}),j.redraw=function(e,t,n,r,o,i){if(j.internal.redrawing&&!i)return j.internal.queue.push([e,t,n,r,o]);j.internal.redrawing=!0;var i=j.responders[t],a=document.getElementById(t),u=p();if(!(j.prod||a&&document.body.contains(a)))return j.error(e,"B.redraw","Attempt to redraw dangling element.","Responder:",i);var n=[j.prediff(n),j.prediff(i.elem)],s=p(),n=j.diff(n[0],n[1]),c=p();if(v.go(r,function(e){j.forget(e)}),!1===n){var r=(a=document.getElementById(t)).parentNode,t=a.nextSibling,d=l.g(i.elem,!0);r.removeChild(a),t?t.insertAdjacentHTML("beforeBegin",d):r.insertAdjacentHTML("beforeEnd",d)}else{t=j.applyDiff(a,n);if(!j.prod&&t!==undefined)return j.error(e,"B.redraw","Redraw error: DOM element missing.",{diffIndex:t,diffElement:n[t],diff:n,responder:i.id})}j.call(e,"redraw",e.path,{responder:i.id,ms:{create:o,prediff:s-u,diff:c-s,DOM:p()-c,total:p()-u+o},diff:!1!==n&&{length:n.length,edits:n.edits}});d=v.stopNot(j.internal.queue,undefined,function(){var e=j.internal.queue.shift();if(j.responders[e[1]])return e});d?j.redraw.apply(null,d.concat(!0)):j.internal.redrawing=!1},j.prediff=function(e,t){if("array"!==f(e)||"LITERAL"===e[0])return e===undefined||""===e?void 0:"L"!==t[t.length-1].substr(0,1)?t.push("L "+l.g(e,!0)):t[t.length-1]+=l.g(e,!0);if(t=t||[],!w(l.k.tags,e[0]))return v.go(e,function(e){j.prediff(e,t)});e[1]&&e[1].id&&(e[1].id+"").match(/^в[0-9a-f]+$/g)&&t.length&&(e=j.responders[e[1].id].elem);var n,r,o="object"!==f(e[1])?undefined:v.obj(e[1],function(e,t){if(!w(["",null,!1,undefined],e))return[t,e]}),i=e[o?2:1];return t.push("O "+e[0]),o&&(t[t.length-1]+=" "+JSON.stringify(o)),o&&o.opaque?(o=t[t.length-1].length,t[t.length-1]="P "+o+t[t.length-1].slice(1)+" "+l.g(i,!0)):("style"===e[0]&&"array"===f(i)&&(i=l.css.g(i,!0)),"table"===e[0]&&(n=t.length),j.prediff(i,t),"table"===e[0]&&t[n]&&(t[n].match(/^O thead/)&&(r=0,v.stopNot(v.times(t.length-n,n),undefined,function(e){if("O"===t[e].substr(0,1)&&r++,"C"===t[e].substr(0,1)&&r--,0===r)return n=e+1})),t[n]&&!t[n].match(/^O tbody/)&&(t.splice(n,0,"O tbody"),t.push("C tbody")),j.internal.olderIE)&&!t[n]&&t.splice(n,0,"O tbody","C tbody"),j.internal.olderIE&&"table"===e[0]&&!t[n]&&t.splice(n,0,"O tbody","C tbody"),t.push("C "+e[0])),t},j.applyDiff=function(r,a){var o,u=[],s=[],i={},c=r.parentNode,d=r.nextSibling,l=[r,null],f=[],e=v.stopNot(a,undefined,function(e,t){if("C"===e[1].substr(0,1))"rem"!==e[0]&&(f.pop(),f[f.length-1]++),"add"!==e[0]&&l.pop();else if("rem"!==e[0]&&(s[t]=f.slice(),"O"===e[1].substr(0,1)?(i[s[t].join(",")]=t,f.push(0)):f[f.length-1]++),"add"!==e[0]){var n=0===t?r:l[l.length-1]?l[l.length-1].nextSibling:l[l.length-2].firstChild;if(!j.prod&&!n)return t;(u[t]=n)===document.activeElement&&(o=n),l[l.length-1]=n,"O"===e[1].substr(0,1)&&l.push(null)}});if(e!==undefined)return e;var p=function(e,t){return"tag"===t?e.match(/(O|P) [^\s]+/)[0].replace(/(O|P) /,""):e.match("{")?JSON.parse(e.replace(/[^{]+/,"")):{}},g=function(e,t){var n=0===e.length?c:u[i[e.slice(0,-1).join(",")]],r=n.children||n.childNodes;if(0===e.length){if(d&&d.previousSibling===t)return;if(!d&&r[r.length-1]===t)return}0<e.length&&r[e[e.length-1]]===t||(e=0===e.length?d:r[e[e.length-1]]||null,n.insertBefore(t,e))},h=function(e){var t=parseInt(e.match(/ \d+ /)[0].replace(/\s/g,""));return{element:(e=e.replace(t+" ","")).slice(0,t),contents:e.slice(t+1)}},m=function(e){var t,n;if("L"===e.substr(0,1))return(t=document.createElement("div")).innerHTML=e.slice(2),t.firstChild;"P"===e.substr(0,1)&&(e=(n=h(e)).element);var r=document.createElement(p(e,"tag"));return v.go(p(e,"attributes"),function(e,t){w(["",null,!1],e)||r.setAttribute(j.internal.olderIE&&"class"===t?"className":t,e)}),"P"===e.substr(0,1)&&(r.innerHTML=n.contents),r},b={},y={};v.go(a,function(e,t){var n,r,o,i=e[1].substr(0,1);if("C"!==i){if("keep"===e[0]){if(j.internal.olderIE&&"O"===i&&p(e[1],"attributes").checked&&u[t].setAttribute("checked",!0),"P"!==i)return g(s[t],u[t]);u[t].parentNode.removeChild(u[t])}return"rem"===e[0]?"O"===i?(b[p(e[1],"tag")]=t,y[t]=!0):u[t].parentNode.removeChild(u[t]):"L"===i?g(s[t],m(e[1])):(o=p(e[1],"tag"),n=b[o],"P"!==i&&n!==undefined&&(r=function(n,e,t){var r=p(e,"attributes"),o=p(t,"attributes");if(!(j.internal.oldIE&&r.type!==o.type||r.onclick!==undefined&&o.href!==undefined))return v.go(o,function(e,t){e===r[t]||w(["",null,!1],e)||(n.setAttribute(j.internal.olderIE&&"class"===t?"className":t,e),"value"===t&&(n.value=e),"checked"===t&&(n.checked=!0),j.internal.oldOpera&&"selected"===t&&(n.selected=e))}),v.go(r,function(e,t){e===o[t]||w(["",null,!1],e)||w(["",null,!1,undefined],o[t])&&(n.removeAttribute(j.internal.olderIE&&"class"===t?"className":t,e),"value"===t&&(n.value=""),"checked"===t)&&(n.checked=!1)}),n}(u[n],a[n][1],e[1]))?b[o]=y[n]=undefined:r=m(e[1]),u[t]=r,g(s[t],r),(o=j.internal.olderIE?p("O"===i?e[1]:h(e[1]).element,"attributes"):{}).checked&&r.setAttribute("checked",!0),void(o["class"]&&(r.className=o["class"])))}}),v.go(y,function(e,t){!0===e&&u[t].parentNode.removeChild(u[t])}),o&&document.body.contains(o)&&o!==document.activeElement&&(o.focus(),j.internal.oldIE)&&o.focus()},j.diff=function(e,t){for(var n,r,o,i,a=[],u=[],s=0,c=p();s<=e.length+t.length;){if(j.internal.timeout&&p()-c>j.internal.timeout)return!1;for(o=-s,n=u[u.length-1]||{1:0},u.push(r={});o<=s;){for(i=o===-s||o!==s&&n[o+1]>n[o-1]?n[o+1]:n[o-1]+1;i<e.length&&i-o<t.length&&e[i]===t[i-o];)i++;if(!((r[o]=i)<e.length||i-o<t.length)){for(a.edits=s;0<i;){if(o===-s||o!==s&&u[s-1][o+1]>u[s-1][o-1]){for(o++;i>(0===s?0:u[s-1][o]);)a.unshift(["keep",e[i-1]]),i--;0<s&&a.unshift(["add",t[i-o]])}else{for(o--,i--;i>u[s-1][o];)a.unshift(["keep",e[i]]),i--;a.unshift(["rem",e[i]])}s--}return a}o+=2}s++}})}();