diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 178a7227..560f1e79 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -133,7 +133,7 @@ module.exports = -> mocha_phantomjs: all: options: - reporter: 'node_modules/mocha/lib/reporters/spec.js' + reporter: 'spec' urls: ['http://127.0.0.1:9999/spec/runner.html'] 'saucelabs-mocha': diff --git a/dist/gss.js b/dist/gss.js index 7b238466..0e25ae4d 100644 --- a/dist/gss.js +++ b/dist/gss.js @@ -1,3 +1,4 @@ +/* gss-engine - version 1.0.4-beta (2014-06-11) - http://gridstylesheets.org */ ;(function(){ /** @@ -20048,7 +20049,7 @@ GSS.Getter.prototype['readAST:text/gss'] = function(node) { }); require.register("gss/lib/GSS.js", function(exports, require, module){ -var GSS, LOG_PASS, TIME, TIME_END, key, val, _ref; +var GSS, LOG_PASS, TIME, TIME_END, key, val, _ref, _ref1; require("customevent-polyfill"); @@ -20117,6 +20118,10 @@ if (typeof GSS_CONFIG !== "undefined" && GSS_CONFIG !== null) { } } +if (((_ref = location.search) != null ? _ref.substring(1) : void 0) === 'noworker') { + GSS.config.useWorker = false; +} + GSS.deblog = function() { if (GSS.config.debug) { return console.log.apply(console, arguments); @@ -20178,9 +20183,9 @@ GSS.Rule = require("./gssom/Rule.js"); require("./gssom/StyleSheet.js"); -_ref = require("./dom/IdMixin.js"); -for (key in _ref) { - val = _ref[key]; +_ref1 = require("./dom/IdMixin.js"); +for (key in _ref1) { + val = _ref1[key]; if (GSS[key]) { throw new Error("IdMixin key clash: " + key); } diff --git a/dist/gss.min.js b/dist/gss.min.js index 11cd2aca..33770d9f 100644 --- a/dist/gss.min.js +++ b/dist/gss.min.js @@ -1,10 +1,10 @@ -/* gss-engine - version 1.0.4-beta (2014-06-02) - http://gridstylesheets.org */ +/* gss-engine - version 1.0.4-beta (2014-06-11) - http://gridstylesheets.org */ !function(){function require(a,b,c){var d=require.resolve(a);if(null==d){c=c||a,b=b||"root";var e=new Error('Failed to require "'+c+'" from "'+b+'"');throw e.path=c,e.parent=b,e.require=!0,e}var f=require.modules[d];if(!f._resolving&&!f.exports){var g={};g.exports={},g.client=g.component=!0,f._resolving=!0,f.call(this,g.exports,require.relative(d),g),delete f._resolving,f.exports=g.exports}return f.exports}require.modules={},require.aliases={},require.resolve=function(a){"/"===a.charAt(0)&&(a=a.slice(1));for(var b=[a,a+".js",a+".json",a+"/index.js",a+"/index.json"],c=0;ce;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Oc!==b&&(Oc>b&&(Oc=0,Pc={line:1,column:1,seenCR:!1}),c(Pc,Oc,b),Oc=b),Pc}function d(a){Qc>Mc||(Mc>Qc&&(Qc=Mc,Rc=[]),Rc.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=f1?arguments[1]:{},F={},G={start:f},H=f,I=F,J=function(a){return a},K={type:"other",description:"Statement"},L={type:"other",description:"Nested Statement"},M={type:"other",description:"CCSS"},N=function(a){return{type:"constraint",cssText:Tc.stringify(a)}},O="@",P={type:"literal",value:"@",description:'"@"'},Q=null,R="-gss-",S={type:"literal",value:"-gss-",description:'"-gss-"'},T="stay",U={type:"literal",value:"stay",description:'"stay"'},V=function(a){return{type:"constraint",cssText:Tc.stringify(a)}},W="chain",X={type:"literal",value:"chain",description:'"chain"'},Y=function(a){return{type:"constraint",cssText:Tc.stringify(a)}},Z="for-each",$={type:"literal",value:"for-each",description:'"for-each"'},_="for-all",ab={type:"literal",value:"for-all",description:'"for-all"'},bb=/^[^`]/,cb={type:"class",value:"[^`]",description:"[^`]"},db="```",eb={type:"literal",value:"```",description:'"```"'},fb=function(a){return{type:"constraint",cssText:Tc.stringify(a)}},gb=/^[a-zA-Z0-9_#.[\]\-""' *+\/$\^~%\\()~]/,hb={type:"class",value:'[a-zA-Z0-9_#.[\\]\\-""\' *+\\/$\\^~%\\\\()~]',description:'[a-zA-Z0-9_#.[\\]\\-""\' *+\\/$\\^~%\\\\()~]'},ib="::",jb={type:"literal",value:"::",description:'"::"'},kb=":",lb={type:"literal",value:":",description:'":"'},mb=/^[a-zA-Z0-9_\-]/,nb={type:"class",value:"[a-zA-Z0-9_\\-]",description:"[a-zA-Z0-9_\\-]"},ob="(",pb={type:"literal",value:"(",description:'"("'},qb=">=",rb={type:"literal",value:">=",description:'">="'},sb="==",tb={type:"literal",value:"==",description:'"=="'},ub="<=",vb={type:"literal",value:"<=",description:'"<="'},wb="=>",xb={type:"literal",value:"=>",description:'"=>"'},yb="=<",zb={type:"literal",value:"=<",description:'"=<"'},Ab={type:"other",description:"Contextual CCSS Statement"},Bb=/^[a-zA-Z0-9\-_$]/,Cb={type:"class",value:"[a-zA-Z0-9\\-_$]",description:"[a-zA-Z0-9\\-_$]"},Db=function(a,b,c){return{type:"constraint",cssText:"::["+Tc.trim(a)+"] "+b+" "+Tc.stringify(c)}},Eb={type:"other",description:"CSS Line"},Fb=function(a,b){return{type:"style",key:a,val:b}},Gb={type:"other",description:"Ruleset"},Hb=function(a,b){return{type:"ruleset",selectors:a,rules:b}},Ib={type:"other",description:"Directive"},Jb=/^[^@{};]/,Kb={type:"class",value:"[^@{};]",description:"[^@{};]"},Lb=function(a,b,c){var d;return d={type:"directive",name:Tc.trim(a),terms:Tc.trim(b)},c&&(d.rules=c),d},Mb=function(a,b){var c;return c={type:"directive",name:Tc.trim(a),terms:Tc.trim(b)}},Nb={type:"other",description:"Directive Name"},Ob=function(a){return Tc.trim(a)},Pb={type:"other",description:"Statement Blocks"},Qb="{",Rb={type:"literal",value:"{",description:'"{"'},Sb="}",Tb={type:"literal",value:"}",description:'"}"'},Ub=function(a){return a},Vb={type:"other",description:"SelectorList"},Wb=function(a,b){return[a].concat(b)},Xb=",",Yb={type:"literal",value:",",description:'","'},Zb=function(a){return a},$b={type:"other",description:"Selector"},_b=/^[^@{},;]/,ac={type:"class",value:"[^@{},;]",description:"[^@{},;]"},bc=function(a){return a.join("").trim()},cc={type:"other",description:"Comment"},dc="/*",ec={type:"literal",value:"/*",description:'"/*"'},fc=/^[^*]/,gc={type:"class",value:"[^*]",description:"[^*]"},hc="*",ic={type:"literal",value:"*",description:'"*"'},jc=/^[^\/*]/,kc={type:"class",value:"[^\\/*]",description:"[^\\/*]"},lc="/",mc={type:"literal",value:"/",description:'"/"'},nc=function(){return""},oc={type:"other",description:"Space"},pc=" ",qc={type:"literal",value:" ",description:'" "'},rc=/^[\t]/,sc={type:"class",value:"[\\t]",description:"[\\t]"},tc=/^[\xA0]/,uc={type:"class",value:"[\\xA0]",description:"[\\xA0]"},vc={type:"other",description:"anytoend"},wc=/^[^;]/,xc={type:"class",value:"[^;]",description:"[^;]"},yc=";",zc={type:"literal",value:";",description:'";"'},Ac={type:"other",description:"TextToColon"},Bc=/^[^:{}]/,Cc={type:"class",value:"[^:{}]",description:"[^:{}]"},Dc=function(a){return Tc.stringify(a)},Ec={type:"other",description:"TextToSemicolon"},Fc=/^[^;{}]/,Gc={type:"class",value:"[^;{}]",description:"[^;{}]"},Hc={type:"other",description:"LineTerminator"},Ic=/^[\n\r\u2028\u2029]/,Jc={type:"class",value:"[\\n\\r\\u2028\\u2029]",description:"[\\n\\r\\u2028\\u2029]"},Kc="\r\n",Lc={type:"literal",value:"\r\n",description:'"\\r\\n"'},Mc=0,Nc=0,Oc=0,Pc={line:1,column:1,seenCR:!1},Qc=0,Rc=[],Sc=0;if("startRule"in E){if(!(E.startRule in G))throw new Error("Can't start parsing from rule \""+E.startRule+'".');H=G[E.startRule]}var Tc,Uc,Vc;if(Tc=Uc=this,String.prototype.trim=String.prototype.trim||function(){return this.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},Vc=Uc.flatten=function(a,b){for(var c=-1,d=a?a.length:0,e=[];++ce;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Yf!==b&&(Yf>b&&(Yf=0,Zf={line:1,column:1,seenCR:!1}),c(Zf,Yf,b),Yf=b),Zf}function g(a){$f>Wf||(Wf>$f&&($f=Wf,_f=[]),_f.push(a))}function h(b,d,e){function g(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=f(e),j=eWf?(b=a.charAt(Wf),Wf++):(b=kb,0===ag&&g(_c)),b}function E(){var b,c;return ag++,bd.test(a.charAt(Wf))?(b=a.charAt(Wf),Wf++):(b=kb,0===ag&&g(cd)),ag--,b===kb&&(c=kb,0===ag&&g(ad)),b}function F(){var b;return dd.test(a.charAt(Wf))?(b=a.charAt(Wf),Wf++):(b=kb,0===ag&&g(ed)),b}function G(){var b,c;return ag++,10===a.charCodeAt(Wf)?(b=gd,Wf++):(b=kb,0===ag&&g(hd)),b===kb&&(a.substr(Wf,2)===id?(b=id,Wf+=2):(b=kb,0===ag&&g(jd)),b===kb&&(13===a.charCodeAt(Wf)?(b=kd,Wf++):(b=kb,0===ag&&g(ld)),b===kb&&(8232===a.charCodeAt(Wf)?(b=md,Wf++):(b=kb,0===ag&&g(nd)),b===kb&&(8233===a.charCodeAt(Wf)?(b=od,Wf++):(b=kb,0===ag&&g(pd)))))),ag--,b===kb&&(c=kb,0===ag&&g(fd)),b}function H(){var b,c,d;return b=Wf,c=O(),c!==kb?(59===a.charCodeAt(Wf)?(d=qd,Wf++):(d=kb,0===ag&&g(rd)),d!==kb?(c=[c,d],b=c):(Wf=b,b=nb)):(Wf=b,b=nb),b===kb&&(b=Wf,c=N(),c!==kb?(d=G(),d!==kb?(c=[c,d],b=c):(Wf=b,b=nb)):(Wf=b,b=nb),b===kb&&(b=Wf,c=O(),c!==kb?(d=I(),d!==kb?(c=[c,d],b=c):(Wf=b,b=nb)):(Wf=b,b=nb))),b}function I(){var b,c;return b=Wf,ag++,a.length>Wf?(c=a.charAt(Wf),Wf++):(c=kb,0===ag&&g(_c)),ag--,c===kb?b=sd:(Wf=b,b=nb),b}function J(){var a,b;return ag++,a=K(),a===kb&&(a=M()),ag--,a===kb&&(b=kb,0===ag&&g(td)),a}function K(){var b,c,d,e,f,h;if(b=Wf,a.substr(Wf,2)===ud?(c=ud,Wf+=2):(c=kb,0===ag&&g(vd)),c!==kb){for(d=[],e=Wf,f=Wf,ag++,a.substr(Wf,2)===wd?(h=wd,Wf+=2):(h=kb,0===ag&&g(xd)),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);e!==kb;)d.push(e),e=Wf,f=Wf,ag++,a.substr(Wf,2)===wd?(h=wd,Wf+=2):(h=kb,0===ag&&g(xd)),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);d!==kb?(a.substr(Wf,2)===wd?(e=wd,Wf+=2):(e=kb,0===ag&&g(xd)),e!==kb?(c=[c,d,e],b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function L(){var b,c,d,e,f,h;if(b=Wf,a.substr(Wf,2)===ud?(c=ud,Wf+=2):(c=kb,0===ag&&g(vd)),c!==kb){for(d=[],e=Wf,f=Wf,ag++,a.substr(Wf,2)===wd?(h=wd,Wf+=2):(h=kb,0===ag&&g(xd)),h===kb&&(h=F()),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);e!==kb;)d.push(e),e=Wf,f=Wf,ag++,a.substr(Wf,2)===wd?(h=wd,Wf+=2):(h=kb,0===ag&&g(xd)),h===kb&&(h=F()),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);d!==kb?(a.substr(Wf,2)===wd?(e=wd,Wf+=2):(e=kb,0===ag&&g(xd)),e!==kb?(c=[c,d,e],b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function M(){var b,c,d,e,f,h;if(b=Wf,a.substr(Wf,2)===yd?(c=yd,Wf+=2):(c=kb,0===ag&&g(zd)),c!==kb){for(d=[],e=Wf,f=Wf,ag++,h=F(),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);e!==kb;)d.push(e),e=Wf,f=Wf,ag++,h=F(),ag--,h===kb?f=sd:(Wf=f,f=nb),f!==kb?(h=D(),h!==kb?(f=[f,h],e=f):(Wf=e,e=nb)):(Wf=e,e=nb);d!==kb?(e=F(),e===kb&&(e=I()),e!==kb?(c=[c,d,e],b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function N(){var a,b;for(a=[],b=E(),b===kb&&(b=L(),b===kb&&(b=M()));b!==kb;)a.push(b),b=E(),b===kb&&(b=L(),b===kb&&(b=M()));return a}function O(){var a,b;for(a=[],b=E(),b===kb&&(b=G(),b===kb&&(b=J()));b!==kb;)a.push(b),b=E(),b===kb&&(b=G(),b===kb&&(b=J()));return a}function P(){var b,c,d,e;if(ag++,b=Wf,35===a.charCodeAt(Wf)?(c=Bd,Wf++):(c=kb,0===ag&&g(Cd)),c!==kb){if(d=[],e=z(),e!==kb)for(;e!==kb;)d.push(e),e=z();else d=nb;d!==kb?(Xf=b,c=Dd(d),b=c):(Wf=b,b=nb)}else Wf=b,b=nb;if(b===kb&&(b=Wf,a.substr(Wf,2)===Ed?(c=Ed,Wf+=2):(c=kb,0===ag&&g(Fd)),c!==kb?(d=S(),d!==kb?(Xf=b,c=Gd(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb),b===kb)){if(b=Wf,34===a.charCodeAt(Wf)?(c=Hd,Wf++):(c=kb,0===ag&&g(Id)),c!==kb){if(d=[],Jd.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(Kd)),e!==kb)for(;e!==kb;)d.push(e),Jd.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(Kd));else d=nb;d!==kb?(34===a.charCodeAt(Wf)?(e=Hd,Wf++):(e=kb,0===ag&&g(Id)),e!==kb?(Xf=b,c=Ld(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;if(b===kb){if(b=Wf,46===a.charCodeAt(Wf)?(c=Yc,Wf++):(c=kb,0===ag&&g(Zc)),c!==kb){if(d=[],e=z(),e!==kb)for(;e!==kb;)d.push(e),e=z(); else d=nb;d!==kb?(Xf=b,c=Md(d),b=c):(Wf=b,b=nb)}else Wf=b,b=nb;if(b===kb){if(b=Wf,c=[],d=z(),d!==kb)for(;d!==kb;)c.push(d),d=z();else c=nb;if(c!==kb&&(Xf=b,c=Nd(c)),b=c,b===kb)if(b=Wf,40===a.charCodeAt(Wf)?(c=Gc,Wf++):(c=kb,0===ag&&g(Hc)),c!==kb){if(d=[],e=Q(),e!==kb)for(;e!==kb;)d.push(e),e=Q();else d=nb;d!==kb?(41===a.charCodeAt(Wf)?(e=Ic,Wf++):(e=kb,0===ag&&g(Jc)),e!==kb?(Xf=b,c=Od(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb}}}return ag--,b===kb&&(c=kb,0===ag&&g(Ad)),b}function Q(){var b,c,d,e;if(b=Wf,c=[],d=R(),d!==kb)for(;d!==kb;)c.push(d),d=R();else c=nb;if(c!==kb&&(Xf=b,c=Pd(c)),b=c,b===kb)if(b=Wf,40===a.charCodeAt(Wf)?(c=Gc,Wf++):(c=kb,0===ag&&g(Hc)),c!==kb){for(d=[],Qd.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(Rd));e!==kb;)d.push(e),Qd.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(Rd));d!==kb?(41===a.charCodeAt(Wf)?(e=Ic,Wf++):(e=kb,0===ag&&g(Jc)),e!==kb?(Xf=b,c=Sd(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function R(){var b;return Td.test(a.charAt(Wf))?(b=a.charAt(Wf),Wf++):(b=kb,0===ag&&g(Ud)),b}function S(){var b,c;return a.substr(Wf,8)===Vd?(b=Vd,Wf+=8):(b=kb,0===ag&&g(Wd)),b===kb&&(a.substr(Wf,4)===Xd?(b=Xd,Wf+=4):(b=kb,0===ag&&g(Yd)),b===kb&&(a.substr(Wf,5)===Zd?(b=Zd,Wf+=5):(b=kb,0===ag&&g($d)),b===kb&&(a.substr(Wf,6)===_d?(b=_d,Wf+=6):(b=kb,0===ag&&g(ae))))),b===kb&&(b=Wf,a.substr(Wf,6)===be?(c=be,Wf+=6):(c=kb,0===ag&&g(ce)),c===kb&&(a.substr(Wf,8)===de?(c=de,Wf+=8):(c=kb,0===ag&&g(ee))),c!==kb&&(Xf=b,c=fe()),b=c,b===kb&&(b=Wf,a.substr(Wf,4)===ge?(c=ge,Wf+=4):(c=kb,0===ag&&g(he)),c===kb&&(c=ie),c!==kb&&(Xf=b,c=je()),b=c)),b}function T(){var b,c,d,e;return b=Wf,33===a.charCodeAt(Wf)?(c=ke,Wf++):(c=kb,0===ag&&g(le)),c!==kb?(d=V(),d!==kb?(e=U(),e===kb&&(e=jc),e!==kb?(Xf=b,c=me(d,e),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb),b===kb&&(b=Wf,33===a.charCodeAt(Wf)?(c=ke,Wf++):(c=kb,0===ag&&g(le)),c!==kb?(a.length>Wf?(d=a.charAt(Wf),Wf++):(d=kb,0===ag&&g(_c)),d===kb&&(d=jc),d!==kb?(Xf=b,c=ne(),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)),b}function U(){var b,c,d;if(b=Wf,c=[],Vc.test(a.charAt(Wf))?(d=a.charAt(Wf),Wf++):(d=kb,0===ag&&g(Wc)),d!==kb)for(;d!==kb;)c.push(d),Vc.test(a.charAt(Wf))?(d=a.charAt(Wf),Wf++):(d=kb,0===ag&&g(Wc));else c=nb;return c!==kb&&(Xf=b,c=oe(c)),b=c}function V(){var b,c;return b=Wf,a.substr(Wf,7)===pe?(c=pe,Wf+=7):(c=kb,0===ag&&g(qe)),c===kb&&(a.substr(Wf,7)===re?(c=re,Wf+=7):(c=kb,0===ag&&g(se)),c===kb&&(a.substr(Wf,7)===te?(c=te,Wf+=7):(c=kb,0===ag&&g(ue)))),c!==kb&&(Xf=b,c=ve()),b=c,b===kb&&(b=Wf,a.substr(Wf,6)===we?(c=we,Wf+=6):(c=kb,0===ag&&g(xe)),c===kb&&(a.substr(Wf,6)===ye?(c=ye,Wf+=6):(c=kb,0===ag&&g(ze)),c===kb&&(a.substr(Wf,6)===Ae?(c=Ae,Wf+=6):(c=kb,0===ag&&g(Be)))),c!==kb&&(Xf=b,c=Ce()),b=c,b===kb&&(b=Wf,a.substr(Wf,6)===De?(c=De,Wf+=6):(c=kb,0===ag&&g(Ee)),c===kb&&(a.substr(Wf,6)===Fe?(c=Fe,Wf+=6):(c=kb,0===ag&&g(Ge)),c===kb&&(a.substr(Wf,6)===He?(c=He,Wf+=6):(c=kb,0===ag&&g(Ie)))),c!==kb&&(Xf=b,c=Je()),b=c,b===kb&&(b=Wf,a.substr(Wf,4)===Ke?(c=Ke,Wf+=4):(c=kb,0===ag&&g(Le)),c===kb&&(a.substr(Wf,4)===Me?(c=Me,Wf+=4):(c=kb,0===ag&&g(Ne)),c===kb&&(a.substr(Wf,4)===Oe?(c=Oe,Wf+=4):(c=kb,0===ag&&g(Pe)))),c!==kb&&(Xf=b,c=Qe()),b=c,b===kb&&(b=Wf,a.substr(Wf,8)===Re?(c=Re,Wf+=8):(c=kb,0===ag&&g(Se)),c===kb&&(a.substr(Wf,8)===Te?(c=Te,Wf+=8):(c=kb,0===ag&&g(Ue)),c===kb&&(a.substr(Wf,8)===Ve?(c=Ve,Wf+=8):(c=kb,0===ag&&g(We)))),c!==kb&&(Xf=b,c=Xe()),b=c)))),b}function W(){var b,c,d,e,f,h;if(b=Wf,64===a.charCodeAt(Wf)?(c=Ye,Wf++):(c=kb,0===ag&&g(Ze)),c!==kb)if(a.substr(Wf,12)===$e?(d=$e,Wf+=12):(d=kb,0===ag&&g(_e)),d===kb&&(a.substr(Wf,7)===af?(d=af,Wf+=7):(d=kb,0===ag&&g(bf))),d!==kb)if(e=O(),e!==kb){if(f=[],h=X(),h!==kb)for(;h!==kb;)f.push(h),h=X();else f=nb;f!==kb?(Xf=b,c=cf(f),b=c):(Wf=b,b=nb)}else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;return b}function X(){var b,c,d,e,f;if(b=Wf,34===a.charCodeAt(Wf)?(c=Hd,Wf++):(c=kb,0===ag&&g(Id)),c!==kb){if(d=[],df.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(ef)),e!==kb)for(;e!==kb;)d.push(e),df.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(ef));else d=nb;d!==kb?(34===a.charCodeAt(Wf)?(e=Hd,Wf++):(e=kb,0===ag&&g(Id)),e!==kb?(f=O(),f!==kb?(Xf=b,c=ff(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function Y(){var a,b,c,d;if(a=Wf,b=$(),b!==kb){if(c=[],d=Z(),d!==kb)for(;d!==kb;)c.push(d),d=Z();else c=nb;c!==kb?(Xf=a,b=gf(c),a=b):(Wf=a,a=nb)}else Wf=a,a=nb;return a}function Z(){var b,c,d,e,f;return b=Wf,c=O(),c!==kb?(d=y(),d!==kb?(e=O(),e!==kb?(44===a.charCodeAt(Wf)?(f=hf,Wf++):(f=kb,0===ag&&g(jf)),f===kb&&(f=jc),f!==kb?(Xf=b,c=kf(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb),b}function $(){var b;return a.substr(Wf,10)===lf?(b=lf,Wf+=10):(b=kb,0===ag&&g(mf)),b===kb&&(a.substr(Wf,5)===nf?(b=nf,Wf+=5):(b=kb,0===ag&&g(of))),b}function _(){var b,c,d,e,f;return b=Wf,a.substr(Wf,5)===pf?(c=pf,Wf+=5):(c=kb,0===ag&&g(qf)),c!==kb?(d=O(),d!==kb?(e=k(),e!==kb?(f=O(),f!==kb?(Xf=b,c=rf(e),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb)):(Wf=b,b=nb),b}function ab(){var a,b,c,d,e,f;return a=Wf,b=cb(),b!==kb?(c=O(),c!==kb?(d=P(),d!==kb?(e=O(),e!==kb?(f=bb(),f!==kb?(Xf=a,b=sf(b,d,f),a=b):(Wf=a,a=nb)):(Wf=a,a=nb)):(Wf=a,a=nb)):(Wf=a,a=nb)):(Wf=a,a=nb),a}function bb(){var b,c,d,e;if(b=Wf,a.substr(Wf,3)===tf?(c=tf,Wf+=3):(c=kb,0===ag&&g(uf)),c!==kb){for(d=[],vf.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(wf));e!==kb;)d.push(e),vf.test(a.charAt(Wf))?(e=a.charAt(Wf),Wf++):(e=kb,0===ag&&g(wf));d!==kb?(a.substr(Wf,3)===tf?(e=tf,Wf+=3):(e=kb,0===ag&&g(uf)),e!==kb?(Xf=b,c=xf(d),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;return b}function cb(){var b,c;return b=Wf,a.substr(Wf,14)===yf?(c=yf,Wf+=14):(c=kb,0===ag&&g(zf)),c===kb&&(a.substr(Wf,9)===Af?(c=Af,Wf+=9):(c=kb,0===ag&&g(Bf))),c!==kb&&(Xf=b,c=Cf()),b=c,b===kb&&(b=Wf,a.substr(Wf,13)===Df?(c=Df,Wf+=13):(c=kb,0===ag&&g(Ef)),c===kb&&(a.substr(Wf,8)===Ff?(c=Ff,Wf+=8):(c=kb,0===ag&&g(Gf))),c!==kb&&(Xf=b,c=Hf()),b=c),b}function db(){var b,c,d,e,f,h,i,j,k;if(b=Wf,64===a.charCodeAt(Wf)?(c=Ye,Wf++):(c=kb,0===ag&&g(Ze)),c!==kb)if(a.substr(Wf,5)===If?(d=If,Wf+=5):(d=kb,0===ag&&g(Jf)),d===kb&&(d=jc),d!==kb)if(a.substr(Wf,5)===Kf?(e=Kf,Wf+=5):(e=kb,0===ag&&g(Lf)),e!==kb)if(f=O(),f!==kb)if(h=P(),h!==kb)if(i=O(),i!==kb){if(j=[],k=eb(),k!==kb)for(;k!==kb;)j.push(k),k=eb();else j=nb;j!==kb?(k=O(),k!==kb?(Xf=b,c=Mf(h,j),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;return b}function eb(){var b,c,d,e,f,h,i,j,k,l,m,n,o,p,q,s,t;if(b=Wf,c=[],Nf.test(a.charAt(Wf))?(d=a.charAt(Wf),Wf++):(d=kb,0===ag&&g(Of)),d!==kb)for(;d!==kb;)c.push(d),Nf.test(a.charAt(Wf))?(d=a.charAt(Wf),Wf++):(d=kb,0===ag&&g(Of));else c=nb;if(c!==kb)if(40===a.charCodeAt(Wf)?(d=Gc,Wf++):(d=kb,0===ag&&g(Hc)),d!==kb)if(e=N(),e!==kb)if(f=fb(),f===kb&&(f=jc),f!==kb)if(h=N(),h!==kb)if(i=hb(),i!==kb)if(j=N(),j!==kb)if(k=r(),k===kb&&(k=jc),k!==kb)if(l=N(),l!==kb)if(m=hb(),m===kb&&(m=jc),m!==kb)if(n=N(),n!==kb)if(o=T(),o===kb&&(o=jc),o!==kb)if(p=N(),p!==kb)if(41===a.charCodeAt(Wf)?(q=Ic,Wf++):(q=kb,0===ag&&g(Jc)),q!==kb){for(s=[],Nf.test(a.charAt(Wf))?(t=a.charAt(Wf),Wf++):(t=kb,0===ag&&g(Of));t!==kb;)s.push(t),Nf.test(a.charAt(Wf))?(t=a.charAt(Wf),Wf++):(t=kb,0===ag&&g(Of));s!==kb?(t=O(),t!==kb?(Xf=b,c=Pf(c,f,i,k,m,o,s),b=c):(Wf=b,b=nb)):(Wf=b,b=nb)}else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;else Wf=b,b=nb;return b}function fb(){var a,b,c;return a=Wf,b=gb(),b!==kb?(c=r(),c!==kb?(Xf=a,b=Qf(b,c),a=b):(Wf=a,a=nb)):(Wf=a,a=nb),a}function gb(){var b,c;return b=Wf,43===a.charCodeAt(Wf)?(c=sc,Wf++):(c=kb,0===ag&&g(tc)),c!==kb&&(Xf=b,c=Rf()),b=c,b===kb&&(b=Wf,45===a.charCodeAt(Wf)?(c=vc,Wf++):(c=kb,0===ag&&g(wc)),c!==kb&&(Xf=b,c=Sf()),b=c,b===kb&&(b=Wf,42===a.charCodeAt(Wf)?(c=Ac,Wf++):(c=kb,0===ag&&g(Bc)),c!==kb&&(Xf=b,c=Tf()),b=c,b===kb&&(b=Wf,47===a.charCodeAt(Wf)?(c=Dc,Wf++):(c=kb,0===ag&&g(Ec)),c!==kb&&(Xf=b,c=Uf()),b=c))),b}function hb(){var a,b;return a=Wf,b=p(),b===kb&&(b=jc),b!==kb&&(Xf=a,b=Vf(b)),a=b}var ib,jb=arguments.length>1?arguments[1]:{},kb={},lb={start:i},mb=i,nb=kb,ob=function(){return bg.start()},pb=function(a){return bg.statement().linearConstraint(a)},qb=function(a){return bg.statement().virtual(a)},rb=function(a){return bg.statement().conditional(a)},sb=function(a){return bg.statement().stay(a)},tb=function(a){return bg.statement().chain(a)},ub=function(a){return bg.statement().forEach(a)},vb=function(a,b){return bg.andOrExpression(a,b)},wb="AND",xb={type:"literal",value:"AND",description:'"AND"'},yb="and",zb={type:"literal",value:"and",description:'"and"'},Ab="And",Bb={type:"literal",value:"And",description:'"And"'},Cb="&&",Db={type:"literal",value:"&&",description:'"&&"'},Eb=function(){return bg.andOrOperator().and()},Fb="OR",Gb={type:"literal",value:"OR",description:'"OR"'},Hb="or",Ib={type:"literal",value:"or",description:'"or"'},Jb="Or",Kb={type:"literal",value:"Or",description:'"Or"'},Lb="||",Mb={type:"literal",value:"||",description:'"||"'},Nb=function(){return bg.andOrOperator().or()},Ob=function(a,b){return bg.conditionalExpression(a,b)},Pb="==",Qb={type:"literal",value:"==",description:'"=="'},Rb=function(){return bg.conditionalOperator().equal()},Sb="<=",Tb={type:"literal",value:"<=",description:'"<="'},Ub="=<",Vb={type:"literal",value:"=<",description:'"=<"'},Wb=function(){return bg.conditionalOperator().lte()},Xb=">=",Yb={type:"literal",value:">=",description:'">="'},Zb="=>",$b={type:"literal",value:"=>",description:'"=>"'},_b=function(){return bg.conditionalOperator().gte()},ac="<",bc={type:"literal",value:"<",description:'"<"'},cc=function(){return bg.conditionalOperator().lt()},dc=">",ec={type:"literal",value:">",description:'">"'},fc=function(){return bg.conditionalOperator().gt()},gc="!=",hc={type:"literal",value:"!=",description:'"!="'},ic=function(){return bg.conditionalOperator().notEqual()},jc=null,kc=function(a,b,c){return bg.linearConstraint(a,b,c)},lc=function(){return bg.linearConstraintOperator().equal()},mc=function(){return bg.linearConstraintOperator().lte()},nc=function(){return bg.linearConstraintOperator().gte()},oc=function(){return bg.linearConstraintOperator().lt()},pc=function(){return bg.linearConstraintOperator().gt()},qc=function(a,b){return bg.constraintAdditiveExpression(a,b)},rc=function(a,b){return bg.additiveExpression(a,b)},sc="+",tc={type:"literal",value:"+",description:'"+"'},uc=function(){return bg.additiveOperator().plus()},vc="-",wc={type:"literal",value:"-",description:'"-"'},xc=function(){return bg.additiveOperator().minus()},yc=function(a,b){return bg.constraintMultiplicativeExpression(a,b)},zc=function(a,b){return bg.multiplicativeExpression(a,b)},Ac="*",Bc={type:"literal",value:"*",description:'"*"'},Cc=function(){return bg.multiplicativeOperator().multiply()},Dc="/",Ec={type:"literal",value:"/",description:'"/"'},Fc=function(){return bg.multiplicativeOperator().divide()},Gc="(",Hc={type:"literal",value:"(",description:'"("'},Ic=")",Jc={type:"literal",value:")",description:'")"'},Kc=function(a){return bg.constraintPrimaryExpression().constraintAdditiveExpression(a)},Lc=function(a){return bg.primaryExpression().andOrExpression(a)},Mc={type:"other",description:"variable"},Nc="[",Oc={type:"literal",value:"[",description:'"["'},Pc="]",Qc={type:"literal",value:"]",description:'"]"'},Rc=function(a,b){return bg.variable(a,b)},Sc=/^[a-zA-Z0-9#.\-_$]/,Tc={type:"class",value:"[a-zA-Z0-9#.\\-_$]",description:"[a-zA-Z0-9#.\\-_$]"},Uc=function(a){return bg.literal(a)},Vc=/^[0-9]/,Wc={type:"class",value:"[0-9]",description:"[0-9]"},Xc=function(a){return bg.integer(a)},Yc=".",Zc={type:"literal",value:".",description:'"."'},$c=function(a){return bg.real(a)},_c={type:"any",description:"any character"},ad={type:"other",description:"whitespace"},bd=/^[\t\x0B\f \xA0\uFEFF]/,cd={type:"class",value:"[\\t\\x0B\\f \\xA0\\uFEFF]",description:"[\\t\\x0B\\f \\xA0\\uFEFF]"},dd=/^[\n\r\u2028\u2029]/,ed={type:"class",value:"[\\n\\r\\u2028\\u2029]",description:"[\\n\\r\\u2028\\u2029]"},fd={type:"other",description:"end of line"},gd="\n",hd={type:"literal",value:"\n",description:'"\\n"'},id="\r\n",jd={type:"literal",value:"\r\n",description:'"\\r\\n"'},kd="\r",ld={type:"literal",value:"\r",description:'"\\r"'},md="\u2028",nd={type:"literal",value:"\u2028",description:'"\\u2028"'},od="\u2029",pd={type:"literal",value:"\u2029",description:'"\\u2029"'},qd=";",rd={type:"literal",value:";",description:'";"'},sd=void 0,td={type:"other",description:"comment"},ud="/*",vd={type:"literal",value:"/*",description:'"/*"'},wd="*/",xd={type:"literal",value:"*/",description:'"*/"'},yd="//",zd={type:"literal",value:"//",description:'"//"'},Ad={type:"other",description:"selector"},Bd="#",Cd={type:"literal",value:"#",description:'"#"'},Dd=function(a){return bg.selector().id(a)},Ed="::",Fd={type:"literal",value:"::",description:'"::"'},Gd=function(a){return bg.selector().reservedPseudoSelector(a)},Hd='"',Id={type:"literal",value:'"',description:'"\\""'},Jd=/^[a-zA-Z0-9.\-_$=:+><~ ]/,Kd={type:"class",value:"[a-zA-Z0-9.\\-_$=:+><~ ]",description:"[a-zA-Z0-9.\\-_$=:+><~ ]"},Ld=function(a){return bg.selector().virtual(a)},Md=function(a){return bg.selector().class(a)},Nd=function(a){return bg.selector().tag(a)},Od=function(a){return bg.selector().all(a)},Pd=function(a){return bg.querySelectorAllParts().withoutParens(a)},Qd=/^[^)]/,Rd={type:"class",value:"[^)]",description:"[^)]"},Sd=function(a){return bg.querySelectorAllParts().withParens(a)},Td=/^[a-zA-Z0-9#.\-_$=:+>'" \][]/,Ud={type:"class",value:"[a-zA-Z0-9#.\\-_$=:+>'\" \\][]",description:"[a-zA-Z0-9#.\\-_$=:+>'\" \\][]"},Vd="document",Wd={type:"literal",value:"document",description:'"document"'},Xd="host",Yd={type:"literal",value:"host",description:'"host"'},Zd="scope",$d={type:"literal",value:"scope",description:'"scope"'},_d="parent",ae={type:"literal",value:"parent",description:'"parent"'},be="window",ce={type:"literal",value:"window",description:'"window"'},de="viewport",ee={type:"literal",value:"viewport",description:'"viewport"'},fe=function(){return bg.reservedPseudoSelector().window()},ge="this",he={type:"literal",value:"this",description:'"this"'},ie="",je=function(){return bg.reservedPseudoSelector().this()},ke="!",le={type:"literal",value:"!",description:'"!"'},me=function(a,b){return bg.strengthAndWeight().valid(a,b)},ne=function(){return bg.strengthAndWeight().invalid()},oe=function(a){return bg.weight(a)},pe="require",qe={type:"literal",value:"require",description:'"require"'},re="REQUIRE",se={type:"literal",value:"REQUIRE",description:'"REQUIRE"'},te="Require",ue={type:"literal",value:"Require",description:'"Require"'},ve=function(){return bg.strength().require()},we="strong",xe={type:"literal",value:"strong",description:'"strong"'},ye="STRONG",ze={type:"literal",value:"STRONG",description:'"STRONG"'},Ae="Strong",Be={type:"literal",value:"Strong",description:'"Strong"'},Ce=function(){return bg.strength().strong()},De="medium",Ee={type:"literal",value:"medium",description:'"medium"'},Fe="MEDIUM",Ge={type:"literal",value:"MEDIUM",description:'"MEDIUM"'},He="Medium",Ie={type:"literal",value:"Medium",description:'"Medium"'},Je=function(){return bg.strength().medium()},Ke="weak",Le={type:"literal",value:"weak",description:'"weak"'},Me="WEAK",Ne={type:"literal",value:"WEAK",description:'"WEAK"'},Oe="Weak",Pe={type:"literal",value:"Weak",description:'"Weak"'},Qe=function(){return bg.strength().weak()},Re="required",Se={type:"literal",value:"required",description:'"required"'},Te="REQUIRED",Ue={type:"literal",value:"REQUIRED",description:'"REQUIRED"'},Ve="Required",We={type:"literal",value:"Required",description:'"Required"'},Xe=function(){return bg.strength().required()},Ye="@",Ze={type:"literal",value:"@",description:'"@"'},$e="-gss-virtual",_e={type:"literal",value:"-gss-virtual",description:'"-gss-virtual"'},af="virtual",bf={type:"literal",value:"virtual",description:'"virtual"'},cf=function(a){return bg.virtualElement(a)},df=/^[^"]/,ef={type:"class",value:'[^"]',description:'[^"]'},ff=function(a){return bg.virtualElementName(a)},gf=function(a){return bg.stay(a)},hf=",",jf={type:"literal",value:",",description:'","'},kf=function(a){return bg.stayVariable(a)},lf="@-gss-stay",mf={type:"literal",value:"@-gss-stay",description:'"@-gss-stay"'},nf="@stay",of={type:"literal",value:"@stay",description:'"@stay"'},pf="@cond",qf={type:"literal",value:"@cond",description:'"@cond"'},rf=function(a){return bg.conditional(a)},sf=function(a,b,c){return bg.forEach(a,b,c)},tf="```",uf={type:"literal",value:"```",description:'"```"'},vf=/^[^`]/,wf={type:"class",value:"[^`]",description:"[^`]"},xf=function(a){return bg.javaScript(a)},yf="@-gss-for-each",zf={type:"literal",value:"@-gss-for-each",description:'"@-gss-for-each"'},Af="@for-each",Bf={type:"literal",value:"@for-each",description:'"@for-each"'},Cf=function(){return bg.forLoopType().forEach()},Df="@-gss-for-all",Ef={type:"literal",value:"@-gss-for-all",description:'"@-gss-for-all"'},Ff="@for-all",Gf={type:"literal",value:"@for-all",description:'"@for-all"'},Hf=function(){return bg.forLoopType().forAll()},If="-gss-",Jf={type:"literal",value:"-gss-",description:'"-gss-"'},Kf="chain",Lf={type:"literal",value:"chain",description:'"chain"'},Mf=function(a,b){bg.chain(a,b)},Nf=/^[a-zA-Z\-_0-9]/,Of={type:"class",value:"[a-zA-Z\\-_0-9]",description:"[a-zA-Z\\-_0-9]"},Pf=function(a,b,c,d,e,f,g){return bg.chainer({headCharacters:a,headExpression:b,headOperator:c,bridgeValue:d,tailOperator:e,strengthAndWeight:f,tailCharacters:g})},Qf=function(a,b){return bg.headExpression(a,b)},Rf=function(){return bg.chainMathOperator().plus()},Sf=function(){return bg.chainMathOperator().minus()},Tf=function(){return bg.chainMathOperator().multiply()},Uf=function(){return bg.chainMathOperator().divide()},Vf=function(a){return bg.chainLinearConstraintOperator(a)},Wf=0,Xf=0,Yf=0,Zf={line:1,column:1,seenCR:!1},$f=0,_f=[],ag=0;if("startRule"in jb){if(!(jb.startRule in lb))throw new Error("Can't start parsing from rule \""+jb.startRule+'".');mb=lb[jb.startRule]}var bg=function(){var c=function(){return a},f=function(){return d()},g=function(){return e()},h=b("./grammar");return new h(c,f,g)}();if(ib=mb(),ib!==kb&&Wf===a.length)return ib;throw ib!==kb&&Wfb;b++)if(b in this&&this[b]===a)return b;return-1};d=function(){function a(a,b,c){this.chainer=e(this.chainer,this),this._commands=[],this._selectors=[],this._input=a,this._line=b,this._column=c}return a._createExpressionAST=function(a,b){var c,d,e,f,g;for(e=a,c=f=0,g=b.length;g>f;c=++f)d=b[c],e=[b[c][1],e,b[c][3]];return e},a._reportError=function(a,b,c){return null!=b&&null!=c&&(a=""+a+" {line:"+b+", col:"+c+"}"),console.error(a),a},a._toString=function(a){return"[object String]"===toString.call(a)?a:"[object Array]"===toString.call(a)?a.join(""):""},a._unpack2DExpression=function(a){var b,c,d,e,f,g,h;if(d={"bottom-left":["left","bottom"],"bottom-right":["right","bottom"],center:["center-x","center-y"],"intrinsic-size":["intrinsic-width","intrinsic-height"],position:["x","y"],size:["width","height"],"top-left":["left","top"],"top-right":["right","top"]},b=[a],f=a[1],e=d[f],null!=e)for(b=[],g=0,h=e.length;h>g;g++)c=e[g],a=a.slice(),a[1]=c,b.push(a);return b},a.prototype._commands=null,a.prototype._selectors=null,a.prototype._addCommand=function(a){return this._commands.push(a)},a.prototype._addSelector=function(a){return null!=a?(f.call(this._selectors,a)<0&&this._selectors.push(a),a):void 0},a.prototype._column=function(){},a.prototype._input=function(){},a.prototype._line=function(){},a.prototype.start=function(){return{commands:JSON.parse(JSON.stringify(this._commands)),selectors:this._selectors}},a.prototype.statement=function(){return{linearConstraint:function(a){return a},virtual:function(a){return a},conditional:function(a){return a},stay:function(a){return a},chain:function(a){return a},forEach:function(a){return a}}},a.prototype.andOrExpression=function(b,c){return a._createExpressionAST(b,c)},a.prototype.andOrOperator=function(){return{and:function(){return"&&"},or:function(){return"||"}}},a.prototype.conditionalExpression=function(b,c){return a._createExpressionAST(b,c)},a.prototype.conditionalOperator=function(){return{equal:function(){return"?=="},gt:function(){return"?>"},gte:function(){return"?>="},lt:function(){return"?<"},lte:function(){return"?<="},notEqual:function(){return"?!="}}},a.prototype.linearConstraint=function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(f=b,(null==d||0===d.length)&&(d=[]),i=o=0,q=c.length;q>o;i=++o){for(j=c[i],k=c[i][1],l=c[i][3],h=a._unpack2DExpression(f),n=a._unpack2DExpression(l),i=p=0,r=n.length;r>p;i=++p)m=n[i],g=h[i],null!=g&&null!=m&&(h.length>n.length?g[1]=m[1]:h.lengthh;f=++h)d=e[f],c=g.slice(),c[1]=e[f],this._addCommand(c);return g},a.prototype.stayVariable=function(a){return a},a.prototype.conditional=function(a){return this._addCommand(a),a},a.prototype.forEach=function(a,b,c){var d;return d=b.selector,this._addSelector(d),this._addCommand([a,b.ast,c])},a.prototype.javaScript=function(a){return["js",a.join("").trim()]},a.prototype.forLoopType=function(){return{forEach:function(){return"for-each"},forAll:function(){return"for-all"}}},a.prototype.chain=function(a,b){var c,d,e,f,g;for(e=a.selector,this._addSelector(e),c=["chain",a.ast],f=0,g=b.length;g>f;f++)d=b[f],c=c.concat(d);return this._addCommand(c)},a.prototype.chainer=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o;return h=b.headCharacters,i=b.headExpression,j=b.headOperator,d=b.bridgeValue,o=b.tailOperator,k=b.strengthAndWeight,n=b.tailCharacters,c=[],f=a._toString(h),l=a._toString(n),e=function(a,b,c){var d;return d=[a,b,c],null!=k&&(d=d.concat(k)),d},0===l.length&&(l=f),null!=i&&(i.splice(1,1,f),f=i),g=e(j,f,l),null!=d&&(g=e(j,f,d)),c.push(g),null!=d&&null!=o?(m=e(o,d,l),c.push(m)):a._reportError("Invalid Chain Statement",this._line(),this._column()),c},a.prototype.headExpression=function(a,b){return[a,"_REPLACE_ME_",b]},a.prototype.tailExpression=function(a,b){return[b,a,"_REPLACE_ME_"]},a.prototype.chainMathOperator=function(){return{plus:function(){return"plus-chain"},minus:function(){return"minus-chain"},multiply:function(){return"multiply-chain"},divide:function(){return"divide-chain"}}},a.prototype.chainLinearConstraintOperator=function(a){return null==a&&(a="eq"),a=""+a+"-chain"},a}(),c.exports=d}),require.register("the-gss-vfl-compiler/lib/vfl-compiler.js",function(a,b,c){c.exports=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(){return e(Td).line}function d(){return e(Td).column}function e(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Ud!==b&&(Ud>b&&(Ud=0,Vd={line:1,column:1,seenCR:!1}),c(Vd,Ud,b),Ud=b),Vd}function f(a){Wd>Sd||(Sd>Wd&&(Wd=Sd,Xd=[]),Xd.push(a))}function g(c,d,f){function g(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=e(f),j=fSd?(d=a.charAt(Sd),Sd++):(d=$,0===Yd&&f(kd)),d===$&&(d=eb),d!==$?(Td=b,c=ld(),b=c):(Sd=b,b=bb)):(Sd=b,b=bb)),Yd--,b===$&&(c=$,0===Yd&&f(cd)),b}function I(){var b;return md.test(a.charAt(Sd))?(b=a.charAt(Sd),Sd++):(b=$,0===Yd&&f(nd)),b}function J(){var a;return a=L(),a===$&&(a=K()),a}function K(){var b,c,d;if(b=Sd,c=[],hd.test(a.charAt(Sd))?(d=a.charAt(Sd),Sd++):(d=$,0===Yd&&f(id)),d!==$)for(;d!==$;)c.push(d),hd.test(a.charAt(Sd))?(d=a.charAt(Sd),Sd++):(d=$,0===Yd&&f(id));else c=bb;return c!==$&&(Td=b,c=od(c)),b=c}function L(){var b,c,d,e,g;return b=Sd,c=Sd,d=K(),d!==$?(46===a.charCodeAt(Sd)?(e=pd,Sd++):(e=$,0===Yd&&f(qd)),e!==$?(g=K(),g!==$?(d=[d,e,g],c=d):(Sd=c,c=bb)):(Sd=c,c=bb)):(Sd=c,c=bb),c!==$&&(Td=b,c=rd(c)),b=c}function M(){var b;return a.length>Sd?(b=a.charAt(Sd),Sd++):(b=$,0===Yd&&f(kd)),b}function N(){var b,c;return Yd++,td.test(a.charAt(Sd))?(b=a.charAt(Sd),Sd++):(b=$,0===Yd&&f(ud)),Yd--,b===$&&(c=$,0===Yd&&f(sd)),b}function O(){var b;return vd.test(a.charAt(Sd))?(b=a.charAt(Sd),Sd++):(b=$,0===Yd&&f(wd)),b}function P(){var b,c;return Yd++,10===a.charCodeAt(Sd)?(b=yd,Sd++):(b=$,0===Yd&&f(zd)),b===$&&(a.substr(Sd,2)===Ad?(b=Ad,Sd+=2):(b=$,0===Yd&&f(Bd)),b===$&&(13===a.charCodeAt(Sd)?(b=Cd,Sd++):(b=$,0===Yd&&f(Dd)),b===$&&(8232===a.charCodeAt(Sd)?(b=Ed,Sd++):(b=$,0===Yd&&f(Fd)),b===$&&(8233===a.charCodeAt(Sd)?(b=Gd,Sd++):(b=$,0===Yd&&f(Hd)))))),Yd--,b===$&&(c=$,0===Yd&&f(xd)),b}function Q(){var b,c,d;return b=Sd,c=X(),c!==$?(59===a.charCodeAt(Sd)?(d=Id,Sd++):(d=$,0===Yd&&f(Jd)),d!==$?(c=[c,d],b=c):(Sd=b,b=bb)):(Sd=b,b=bb),b===$&&(b=Sd,c=W(),c!==$?(d=P(),d!==$?(c=[c,d],b=c):(Sd=b,b=bb)):(Sd=b,b=bb),b===$&&(b=Sd,c=X(),c!==$?(d=R(),d!==$?(c=[c,d],b=c):(Sd=b,b=bb)):(Sd=b,b=bb))),b}function R(){var b,c;return b=Sd,Yd++,a.length>Sd?(c=a.charAt(Sd),Sd++):(c=$,0===Yd&&f(kd)),Yd--,c===$?b=Kd:(Sd=b,b=bb),b}function S(){var a,b;return Yd++,a=T(),a===$&&(a=V()),Yd--,a===$&&(b=$,0===Yd&&f(Ld)),a}function T(){var b,c,d,e,g,h;if(b=Sd,a.substr(Sd,2)===Md?(c=Md,Sd+=2):(c=$,0===Yd&&f(Nd)),c!==$){for(d=[],e=Sd,g=Sd,Yd++,a.substr(Sd,2)===Od?(h=Od,Sd+=2):(h=$,0===Yd&&f(Pd)),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);e!==$;)d.push(e),e=Sd,g=Sd,Yd++,a.substr(Sd,2)===Od?(h=Od,Sd+=2):(h=$,0===Yd&&f(Pd)),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);d!==$?(a.substr(Sd,2)===Od?(e=Od,Sd+=2):(e=$,0===Yd&&f(Pd)),e!==$?(c=[c,d,e],b=c):(Sd=b,b=bb)):(Sd=b,b=bb)}else Sd=b,b=bb;return b}function U(){var b,c,d,e,g,h;if(b=Sd,a.substr(Sd,2)===Md?(c=Md,Sd+=2):(c=$,0===Yd&&f(Nd)),c!==$){for(d=[],e=Sd,g=Sd,Yd++,a.substr(Sd,2)===Od?(h=Od,Sd+=2):(h=$,0===Yd&&f(Pd)),h===$&&(h=O()),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);e!==$;)d.push(e),e=Sd,g=Sd,Yd++,a.substr(Sd,2)===Od?(h=Od,Sd+=2):(h=$,0===Yd&&f(Pd)),h===$&&(h=O()),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);d!==$?(a.substr(Sd,2)===Od?(e=Od,Sd+=2):(e=$,0===Yd&&f(Pd)),e!==$?(c=[c,d,e],b=c):(Sd=b,b=bb)):(Sd=b,b=bb)}else Sd=b,b=bb;return b}function V(){var b,c,d,e,g,h;if(b=Sd,a.substr(Sd,2)===Qd?(c=Qd,Sd+=2):(c=$,0===Yd&&f(Rd)),c!==$){for(d=[],e=Sd,g=Sd,Yd++,h=O(),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);e!==$;)d.push(e),e=Sd,g=Sd,Yd++,h=O(),Yd--,h===$?g=Kd:(Sd=g,g=bb),g!==$?(h=M(),h!==$?(g=[g,h],e=g):(Sd=e,e=bb)):(Sd=e,e=bb);d!==$?(e=O(),e===$&&(e=R()),e!==$?(c=[c,d,e],b=c):(Sd=b,b=bb)):(Sd=b,b=bb)}else Sd=b,b=bb;return b}function W(){var a,b;for(a=[],b=N(),b===$&&(b=U(),b===$&&(b=V()));b!==$;)a.push(b),b=N(),b===$&&(b=U(),b===$&&(b=V()));return a}function X(){var a,b;for(a=[],b=N(),b===$&&(b=P(),b===$&&(b=S()));b!==$;)a.push(b),b=N(),b===$&&(b=P(),b===$&&(b=S()));return a}var Y,Z=arguments.length>1?arguments[1]:{},$={},_={start:h},ab=h,bb=$,cb=function(){return $d.getResults()},db=function(a){return a},eb=null,fb=function(a,b,c,d){var e,f,g,h,i,j,k,l,m;f=b,m=b,l=m.view,h=[],"|"!==l&&h.push(l),$d.addPreds(l,b.preds,a);for(var n=0;n======]/,nc={type:"class",value:"[^>]",description:"[^>]"},oc=">",pc={type:"literal",value:">",description:'">"'},qc=function(a){return Zd.stringify(a)},rc={type:"other",description:"Predicate"},sc=function(a){return a},tc={type:"other",description:"Predicate Expression"},uc="==",vc={type:"literal",value:"==",description:'"=="'},wc="<=",xc={type:"literal",value:"<=",description:'"<="'},yc=">=",zc={type:"literal",value:">=",description:'">="'},Ac="=<",Bc={type:"literal",value:"=<",description:'"=<"'},Cc=function(){return"<="},Dc="=>",Ec={type:"literal",value:"=>",description:'"=>"'},Fc=function(){return">="},Gc=function(a){return a},Hc=/^[+\-\/*]/,Ic={type:"class",value:"[+\\-\\/*]",description:"[+\\-\\/*]"},Jc=function(a){return a},Kc=function(a){return["view",a.join("")]},Lc=function(a){return a.join("")},Mc=function(a){return"["+a.join("")+"]"},Nc=function(a,b){return a.join("")+"["+b.join("")+"]"},Oc=function(){return""},Pc={type:"other",description:"VFL Connection"},Qc="-",Rc={type:"literal",value:"-",description:'"-"'},Sc=function(a){return{op:"==",gap:a.join("")}},Tc=function(){return{op:"==",gap:"__STANDARD__"}},Uc="~",Vc={type:"literal",value:"~",description:'"~"'},Wc=function(a){return{op:"<=",gap:a.join("")}},Xc=function(){return{op:"<=",gap:"__STANDARD__"}},Yc=function(){return{op:"<="}},Zc="",$c=function(){return{op:"=="}},_c={type:"other",description:"VFL Connection Gap"},ad=/^[a-zA-Z0-9#._$]/,bd={type:"class",value:"[a-zA-Z0-9#._$]",description:"[a-zA-Z0-9#._$]"},cd={type:"other",description:"Strength / Weight"},dd="!",ed={type:"literal",value:"!",description:'"!"'},fd=/^[a-zA-Z]/,gd={type:"class",value:"[a-zA-Z]",description:"[a-zA-Z]"},hd=/^[0-9]/,id={type:"class",value:"[0-9]",description:"[0-9]"},jd=function(a,b){var c;return c="!"+Zd.join(a)+Zd.join(b),c.trim()},kd={type:"any",description:"any character"},ld=function(){return $d.error("Invalid Strength or Weight",c,d)},md=/^[a-zA-Z0-9#.\-_$:""]/,nd={type:"class",value:'[a-zA-Z0-9#.\\-_$:""]',description:'[a-zA-Z0-9#.\\-_$:""]'},od=function(a){return parseInt(a.join(""),10)},pd=".",qd={type:"literal",value:".",description:'"."'},rd=function(a){return parseFloat(a.join(""))},sd={type:"other",description:"whitespace"},td=/^[\t\x0B\f \xA0\uFEFF]/,ud={type:"class",value:"[\\t\\x0B\\f \\xA0\\uFEFF]",description:"[\\t\\x0B\\f \\xA0\\uFEFF]"},vd=/^[\n\r\u2028\u2029]/,wd={type:"class",value:"[\\n\\r\\u2028\\u2029]",description:"[\\n\\r\\u2028\\u2029]"},xd={type:"other",description:"end of line"},yd="\n",zd={type:"literal",value:"\n",description:'"\\n"'},Ad="\r\n",Bd={type:"literal",value:"\r\n",description:'"\\r\\n"'},Cd="\r",Dd={type:"literal",value:"\r",description:'"\\r"'},Ed="\u2028",Fd={type:"literal",value:"\u2028",description:'"\\u2028"'},Gd="\u2029",Hd={type:"literal",value:"\u2029",description:'"\\u2029"'},Id=";",Jd={type:"literal",value:";",description:'";"'},Kd=void 0,Ld={type:"other",description:"comment"},Md="/*",Nd={type:"literal",value:"/*",description:'"/*"'},Od="*/",Pd={type:"literal",value:"*/",description:'"*/"'},Qd="//",Rd={type:"literal",value:"//",description:'"//"'},Sd=0,Td=0,Ud=0,Vd={line:1,column:1,seenCR:!1},Wd=0,Xd=[],Yd=0;if("startRule"in Z){if(!(Z.startRule in _))throw new Error("Can't start parsing from rule \""+Z.startRule+'".');ab=_[Z.startRule]}var Zd,$d,_d,ae,be,ce,de,ee,fe,ge,he;if(Zd=$d=this,Zd.trickleDownOptions=["name"],he=Zd.sizeVarNames=["width","height"],ae=Zd.leftVarNames=["right","bottom"],be=Zd.superLeftVarNames=["left","top"],ce=Zd.rightVarNames=["left","top"],de=Zd.superRightVarNames=["right","bottom"],_d=$d.cs=[],$d.addC=function(a){_d.push(a)},$d.addPreds=function(a,b,c){var d,e,f,g,h;if(b)for(var i=0;i=",">=":"<=","==":"==","<":">",">":"<"},$d.addChains=function(a,b){var c,d,e,f,g,h,i;if(c=b.chains)for(var j=0;j1?(""===i.tailEq&&(i.tailEq=$d.chainTailEqMap[i.headEq]),g+=" "+i.tailEq):(g+=" "+i.s,_d.push(g.trim())));a.length>1&&(g+=" "+a[a.length-1]+"["+e+"]",g+=Zd.getTrailingOptions(b),g+=" "+i.s,_d.push(g.trim()))}}},fe=function(a){return void 0===a.in?"::this":a.in},$d.getLeftVar=function(a,b,c,d){var e,f;return d.isPoint?d.pos:("|"===a?(f=fe(c),e=be[b]):(f=a,e=ae[b]),f+"["+e+"]")},$d.getRightVar=function(a,b,c,d){var e;return d.isPoint?d.pos:("|"===a?(a=fe(c),e=de[b]):e=ce[b],a+"["+e+"]")},ee=["[hgap]","[vgap]"],ge=function(a,b,c,d){return void 0===a?"":("__STANDARD__"===a&&(a=d&&c["outer-gap"]?c["outer-gap"]:c.gap?c.gap:ee[b]),"+ "+a)},$d.getConnectionString=function(a,b,c,d){return(ge(a.gap,b,c,d)+" "+a.op).trim()},Zd.getTrailingOptions=function(a){var b="";return a&&Zd.trickleDownOptions.forEach(function(c){null!=a[c]&&(b=b+" "+c+"("+a[c]+")")}),b},Zd.getSW=function(a){return a.sw?" "+a.sw.trim():""},$d.getResults=function(){return this.cs},$d.error=function(a,b,c){return b&&c&&(a=a+" {line:"+b+", col:"+c+"}"),console.error(a),a},Zd.flatten=function(a,b){if("string"==typeof a)return a;for(var c=-1,d=a?a.length:0,e=[];++ce;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Se!==b&&(Se>b&&(Se=0,Te={line:1,column:1,seenCR:!1}),c(Te,Se,b),Se=b),Te}function d(a){Ue>Qe||(Qe>Ue&&(Ue=Qe,Ve=[]),Ve.push(a))}function e(d,e,f){function g(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=c(f),j=fQe?(b=a.charAt(Qe),Qe++):(b=K,0===We&&d(he)),b}function w(){var b,c;return We++,je.test(a.charAt(Qe))?(b=a.charAt(Qe),Qe++):(b=K,0===We&&d(ke)),We--,b===K&&(c=K,0===We&&d(ie)),b}function x(){var b;return le.test(a.charAt(Qe))?(b=a.charAt(Qe),Qe++):(b=K,0===We&&d(me)),b}function y(){var b,c;return We++,10===a.charCodeAt(Qe)?(b=oe,Qe++):(b=K,0===We&&d(pe)),b===K&&(a.substr(Qe,2)===qe?(b=qe,Qe+=2):(b=K,0===We&&d(re)),b===K&&(13===a.charCodeAt(Qe)?(b=se,Qe++):(b=K,0===We&&d(te)),b===K&&(8232===a.charCodeAt(Qe)?(b=ue,Qe++):(b=K,0===We&&d(ve)),b===K&&(8233===a.charCodeAt(Qe)?(b=we,Qe++):(b=K,0===We&&d(xe)))))),We--,b===K&&(c=K,0===We&&d(ne)),b}function z(){var b;return ye.test(a.charAt(Qe))?(b=a.charAt(Qe),Qe++):(b=K,0===We&&d(ze)),b}function A(){var b,c,e;return We++,b=Qe,c=H(),c!==K?(59===a.charCodeAt(Qe)?(e=Be,Qe++):(e=K,0===We&&d(Ce)),e!==K?(c=[c,e],b=c):(Qe=b,b=N)):(Qe=b,b=N),b===K&&(b=Qe,c=G(),c!==K?(e=y(),e!==K?(c=[c,e],b=c):(Qe=b,b=N)):(Qe=b,b=N),b===K&&(b=Qe,c=H(),c!==K?(e=B(),e!==K?(c=[c,e],b=c):(Qe=b,b=N)):(Qe=b,b=N))),We--,b===K&&(c=K,0===We&&d(Ae)),b}function B(){var b,c;return b=Qe,We++,a.length>Qe?(c=a.charAt(Qe),Qe++):(c=K,0===We&&d(he)),We--,c===K?b=De:(Qe=b,b=N),b}function C(){var a,b;return We++,a=D(),a===K&&(a=F()),We--,a===K&&(b=K,0===We&&d(Ee)),a}function D(){var b,c,e,f,g,h;if(We++,b=Qe,a.substr(Qe,2)===Ge?(c=Ge,Qe+=2):(c=K,0===We&&d(He)),c!==K){for(e=[],f=Qe,g=Qe,We++,a.substr(Qe,2)===Ie?(h=Ie,Qe+=2):(h=K,0===We&&d(Je)),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);f!==K;)e.push(f),f=Qe,g=Qe,We++,a.substr(Qe,2)===Ie?(h=Ie,Qe+=2):(h=K,0===We&&d(Je)),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);e!==K?(a.substr(Qe,2)===Ie?(f=Ie,Qe+=2):(f=K,0===We&&d(Je)),f!==K?(c=[c,e,f],b=c):(Qe=b,b=N)):(Qe=b,b=N)}else Qe=b,b=N;return We--,b===K&&(c=K,0===We&&d(Fe)),b}function E(){var b,c,e,f,g,h;if(We++,b=Qe,a.substr(Qe,2)===Ge?(c=Ge,Qe+=2):(c=K,0===We&&d(He)),c!==K){for(e=[],f=Qe,g=Qe,We++,a.substr(Qe,2)===Ie?(h=Ie,Qe+=2):(h=K,0===We&&d(Je)),h===K&&(h=x()),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);f!==K;)e.push(f),f=Qe,g=Qe,We++,a.substr(Qe,2)===Ie?(h=Ie,Qe+=2):(h=K,0===We&&d(Je)),h===K&&(h=x()),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);e!==K?(a.substr(Qe,2)===Ie?(f=Ie,Qe+=2):(f=K,0===We&&d(Je)),f!==K?(c=[c,e,f],b=c):(Qe=b,b=N)):(Qe=b,b=N)}else Qe=b,b=N;return We--,b===K&&(c=K,0===We&&d(Ke)),b}function F(){var b,c,e,f,g,h;if(We++,b=Qe,a.substr(Qe,2)===Me?(c=Me,Qe+=2):(c=K,0===We&&d(Ne)),c!==K){for(e=[],f=Qe,g=Qe,We++,h=x(),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);f!==K;)e.push(f),f=Qe,g=Qe,We++,h=x(),We--,h===K?g=De:(Qe=g,g=N),g!==K?(h=v(),h!==K?(g=[g,h],f=g):(Qe=f,f=N)):(Qe=f,f=N);e!==K?(f=x(),f===K&&(f=B()),f!==K?(c=[c,e,f],b=c):(Qe=b,b=N)):(Qe=b,b=N)}else Qe=b,b=N;return We--,b===K&&(c=K,0===We&&d(Le)),b}function G(){var a,b;for(We++,a=[],b=w(),b===K&&(b=E(),b===K&&(b=F()));b!==K;)a.push(b),b=w(),b===K&&(b=E(),b===K&&(b=F()));return We--,a===K&&(b=K,0===We&&d(Oe)),a}function H(){var a,b;for(We++,a=[],b=w(),b===K&&(b=y(),b===K&&(b=C()));b!==K;)a.push(b),b=w(),b===K&&(b=y(),b===K&&(b=C()));return We--,a===K&&(b=K,0===We&&d(Pe)),a}var I,J=arguments.length>1?arguments[1]:{},K={},L={start:f},M=f,N=K,O=function(){return Xe.getResults()},P="@",Q={type:"literal",value:"@",description:'"@"'},R=function(a){return a},S={type:"other",description:"grid-rows / grid-cols"},T="grid-",U={type:"literal",value:"grid-",description:'"grid-"'},V="-gss-grid-",W={type:"literal",value:"-gss-grid-",description:'"-gss-grid-"'},X='"',Y={type:"literal",value:'"',description:'"\\""'},Z=function(a,b,c){var d;d="@"+["v","h"][a]+" "+b+" in(::) chain-"+Xe.size[a]+"(::["+Xe.size[a]+"]) chain-"+Xe.size[1-a]+" chain-"+Xe.pos[a]+"(::["+Xe.pos[a]+"]) "+Xe.trim(c),Xe.addVFL(d.trim())},$={type:"other",description:"grid-template"},_="template",ab={type:"literal",value:"template",description:'"template"'},bb=/^[0-9a-zA-Z\-_]/,cb={type:"class",value:"[0-9a-zA-Z\\-_]",description:"[0-9a-zA-Z\\-_]"},db=function(a,b,c){Xe.addTemplate(b,Xe.stringify(a),c)},eb={type:"other",description:"template line"},fb=function(a){return Xe.processHZones(a)},gb={type:"other",description:"Template Options"},hb=function(a){var b={};return a&&(b={},a.forEach(function(a){b[a.key]=a.value})),b},ib={type:"other",description:"TemplateOption"},jb="(",kb={type:"literal",value:"(",description:'"("'},lb=")",mb={type:"literal",value:")",description:'")"'},nb=function(a,b){return{key:a.join(""),value:b.join("")}},ob=/^[^>===1&&(g+=" - "+i.h,d.yspan>2&&(g+=" * "+(d.yspan-1))),g+=")"):g+=f+"[width]",d.yspan>1&&(g+=" / "+d.yspan),g+=" !require",Xe.addCCSS(g),g="::["+b+"-md-height] "+h+" ",i.top||i.bottom||i.v?(g+="("+f+"[height]",i.top&&(g+=" - "+i.top),i.bottom&&(g+=" - "+i.bottom),i.v&&d.xspan>1&&(g+=" - "+i.v,d.xspan>2&&(g+=" * "+(d.xspan-1))),g+=")"):g+=f+"[height]",d.xspan>1&&(g+=" / "+d.xspan),g+=" !require",Xe.addCCSS(g);var l,m;for(var n in d.widths)Xe.addVirtual(e+n),l=d.widths[n],m='"'+e+n+'"[width] == ',m+="::["+d.name+"-md-width]",l>1&&(m+=" * "+l,i.h&&(m+=" + "+i.h,l>2&&(m+=" * "+(l-1)))),Xe.addCCSS(m);var o,p;for(var n in d.heights)o=d.heights[n],p='"'+e+n+'"[height] == ',p+="::["+d.name+"-md-height]",o>1&&(p+=" * "+o,i.v&&(p+=" + "+i.v,o>2&&(p+=" * "+(o-1)))),Xe.addCCSS(p);var q;d.v.forEach(function(a){a=a.split("%-v-%"),q='@v ["'+e+a[0]+'"]',i.v&&(q+="-"),q+='["'+e+a[1]+'"]',i.v&&(q+=" gap("+i.v+")"),Xe.addVFL(q)}),d.h.forEach(function(a){a=a.split("%-h-%"),q='@h ["'+e+a[0]+'"]',i.h&&(q+="-"),q+='["'+e+a[1]+'"]',i.h&&(q+=" gap("+i.h+")"),Xe.addVFL(q)});var r;return r=[],d.cols[0].y.forEach(function(a){return r.indexOf(a)>-1?null:(r.push(a),q="@h |",i.left&&(q+="-"),q+='["'+e+a+'"] in('+f+")",i.left&&(q+=" gap("+i.left+")"),void Xe.addVFL(q))}),r=[],d.rows[0].x.forEach(function(a){return r.indexOf(a)>-1?null:(r.push(a),q="@v |",i.top&&(q+="-"),q+='["'+e+a+'"] in('+f+")",i.top&&(q+=" gap("+i.top+")"),void Xe.addVFL(q))}),r=[],d.cols[d.cols.length-1].y.forEach(function(a){return r.indexOf(a)>-1?null:(r.push(a),q='@h ["'+e+a+'"]',i.right&&(q+="-"),q+="| in("+f+")",i.right&&(q+=" gap("+i.right+")"),void Xe.addVFL(q))}),r=[],d.rows[d.rows.length-1].x.forEach(function(a){return r.indexOf(a)>-1?null:(r.push(a),q='@v ["'+e+a+'"]',i.bottom&&(q+="-"),q+="| in("+f+")",i.bottom&&(q+=" gap("+i.bottom+")"),void Xe.addVFL(q))}),Xe.addAST(d),d},Xe.processHZones=function(a){var b,c,d,e,f,g,h,i;return b=0,e=[],g={},f=[],h=0,a.forEach(function(a){i=!1,c=a.name,"-DOT-"===c&&(i=!1,h++,c+=h),f=f.concat(a.x),delete a.x,d&&d!==c&&e.push([d,c].join("%-h-%")),g[a.name]=a.xspan,b+=a.xspan,d=c}),{xspan:b,x:f,h:e,widths:g}},Xe.processHLines=function(a){var b,c,d,e;return e={heights:{},widths:{},v:[],h:[]},b=[],c=0,a.forEach(function(a){d=0;for(var f in a.widths)e.widths[f]=a.widths[f];a.h.forEach(function(a){-1===e.h.indexOf(a)&&e.h.push(a)}),a.x.forEach(function(a){var c;b[d]||(b[d]={y:[]}),c=b[d],c.y.push(a),d++}),c++}),b.forEach(function(a){var b,c,d,f,g,h;h=[],c=0,d=null,g=0,a.y.forEach(function(h){b=h,c++,a.y[g+1]!==b&&(e.heights[h]=c,c=0),d&&d!==b&&(f=[d,b].join("%-v-%"),-1===e.v.indexOf(f)&&e.v.push(f)),d=b,g++})}),e.yspan=b.length,e.xspan=a.length,e.cols=b,e.rows=a,e},Xe.error=function(a,b,c){return b&&c&&(a=a+" {line:"+b+", col:"+c+"}"),console.error(a),a},Xe.trim=function(a){return"string"==typeof a?a.trim():a instanceof Array?a.join("").trim():""},Xe.flatten=function(a,b){for(var c=-1,d=a?a.length:0,e=[];++cq;q++){switch(e=a[q],l={},e.type){case"directive":switch(e.name){case"grid-template":case"-gss-grid-template":case"grid-rows":case"-gss-rows":case"grid-cols":case"-gss-grid-cols":try{n=j.parse("@"+e.name+" "+e.terms)}catch(A){h=A,console.log("VGL Parse Error: @"+e.name+" "+e.terms,h)}for(l={selectors:[],commands:[]},y=n.ccss,r=0,v=y.length;v>r;r++){b=y[r];try{m=c.parse(b)}catch(A){h=A,console.log("VGL generated CCSS parse Error",h)}l.selectors=l.selectors.concat(m.selectors),l.commands=l.commands.concat(m.commands)}for(z=n.vfl,s=0,w=z.length;w>s;s++){p=z[s];try{m=c.parse(i.parse(p).join("; "))}catch(A){h=A,console.log("VGL generated VFL parse Error",h)}l.selectors=l.selectors.concat(m.selectors),l.commands=l.commands.concat(m.commands)}break;case"horizontal":case"vertical":case"-gss-horizontal":case"-gss-vertical":case"h":case"v":case"-gss-h":case"-gss-v":try{d=i.parse("@"+e.name+" "+e.terms)}catch(A){h=A,console.log("VFL Parse Error: @"+e.name+" "+e.terms,h)}for(l={selectors:[],commands:[]},t=0,x=d.length;x>t;t++){b=d[t];try{m=c.parse(b)}catch(A){h=A,console.log("VFL generated CCSS parse Error",h)}l.selectors=l.selectors.concat(m.selectors),l.commands=l.commands.concat(m.commands)}break;case"if":case"elseif":case"else":if(e.terms.length>0){try{l=c.parse("@cond"+e.terms+";")}catch(A){h=A,console.log("CCSS conditional parse Error",h)}l.clause=l.commands[0],delete l.commands}else l.clause=null}break;case"constraint":try{l=c.parse(e.cssText)}catch(A){h=A,console.log("Constraint Parse Error",h)}}for(k in l)o=l[k],e[k]=o;e.rules&&f(e.rules)}return a},e=function(a){var b;return b=function(a,c){var d,e,f,g,i;for(i=[],e=0,f=a.length;f>e;e++)d=a[e],d._uuid=h(),c&&(d._parent_uuid=c._uuid),i.push((null!=(g=d.rules)?g.length:void 0)>0?b(d.rules,d):void 0);return i},b(a),a},a.compile=d}),require.register("d4tocchini-customevent-polyfill/CustomEvent.js",function(){var a;a=function(a,b){var c;return b=b||{bubbles:!1,cancelable:!1,detail:void 0},c=document.createEvent("CustomEvent"),c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c},a.prototype=window.Event.prototype,window.CustomEvent=a}),require.register("slightlyoff-cassowary.js/index.js",function(a,b,c){c.exports=b("./src/c.js"),b("./src/HashTable.js"),b("./src/HashSet.js"),b("./src/Error.js"),b("./src/SymbolicWeight.js"),b("./src/Strength.js"),b("./src/Variable.js"),b("./src/Point.js"),b("./src/Expression.js"),b("./src/Constraint.js"),b("./src/Constraint.js"),b("./src/EditInfo.js"),b("./src/Tableau.js"),b("./src/SimplexSolver.js"),b("./src/Timer.js"),b("./src/parser/parser.js"),b("./src/parser/api.js")}),require.register("slightlyoff-cassowary.js/src/c.js",function(a,b,c){!function(a){"use strict";try{(function(){}).bind(a)}catch(b){Object.defineProperty(Function.prototype,"bind",{value:function(a){var b=this;return function(){return b.apply(a,arguments)}},enumerable:!1,configurable:!0,writable:!0})}var d="undefined"!=typeof a.HTMLElement,e=function(a){for(var b=null;a&&a!=Object.prototype;){if(a.tagName){b=a.tagName;break}a=a.prototype}return b||"div"},f=1e-8,g={},h=function(a,b){if(a&&b){if("function"==typeof a[b])return a[b];var c=a.prototype;if(c&&"function"==typeof c[b])return c[b];if(c!==Object.prototype&&c!==Function.prototype)return"function"==typeof a.__super__?h(a.__super__,b):void 0}},i=a.c=function(){return i._api?i._api.apply(this,arguments):void 0};i.debug=!1,i.trace=!1,i.verbose=!1,i.traceAdded=!1,i.GC=!1,i.GEQ=1,i.LEQ=2,i.inherit=function(b){var c=null,f=null;b["extends"]&&(f=b["extends"],delete b["extends"]),b.initialize&&(c=b.initialize,delete b.initialize);var h=c||function(){};Object.defineProperty(h,"__super__",{value:f?f:Object,enumerable:!1,configurable:!0,writable:!1}),b._t&&(g[b._t]=h);var j=h.prototype=Object.create(f?f.prototype:Object.prototype);if(i.extend(j,b),d&&f&&f.prototype instanceof a.HTMLElement){var k=h,l=e(j),m=function(a){return a.__proto__=j,k.apply(a,arguments),j.created&&a.created(),j.decorate&&a.decorate(),a};this.extend(j,{upgrade:m}),h=function(){return m(a.document.createElement(l))},h.prototype=j,this.extend(h,{ctor:k})}return h},i.own=function(b,c,d){return Object.getOwnPropertyNames(b).forEach(c,d||a),b},i.extend=function(a,b){return i.own(b,function(c){var d=Object.getOwnPropertyDescriptor(b,c);try{"function"==typeof d.get||"function"==typeof d.set?Object.defineProperty(a,c,d):"function"==typeof d.value||"_"===c.charAt(0)?(d.writable=!0,d.configurable=!0,d.enumerable=!1,Object.defineProperty(a,c,d)):a[c]=b[c]}catch(e){}}),a},i.traceprint=function(a){i.verbose&&console.log(a)},i.fnenterprint=function(a){console.log("* "+a)},i.fnexitprint=function(a){console.log("- "+a)},i.assert=function(a,b){if(!a)throw new i.InternalError("Assertion failed: "+b)};var j=function(a){return"number"==typeof a?i.Expression.fromConstant(a):a instanceof i.Variable?i.Expression.fromVariable(a):a};i.plus=function(a,b){return a=j(a),b=j(b),a.plus(b)},i.minus=function(a,b){return a=j(a),b=j(b),a.minus(b)},i.times=function(a,b){return a=j(a),b=j(b),a.times(b)},i.divide=function(a,b){return a=j(a),b=j(b),a.divide(b)},i.approx=function(a,b){return a===b?!0:(a=+a,b=+b,0==a?Math.abs(b)30||this._deleted>this._compactThreshold&&(this._compact(),this._deleted=0)},"delete":function(a){a=a.hashCode,this._store.hasOwnProperty(a)&&(this._deleted++,delete this._store[a],this.size>0&&this.size--)},each:function(a,b){if(this.size){this._perhapsCompact();var c=this._store,d=this._keyStrMap;for(var e in this._store)this._store.hasOwnProperty(e)&&a.call(b||null,d[e],c[e])}},escapingEach:function(a,b){if(this.size){this._perhapsCompact();for(var d=this,e=this._store,f=this._keyStrMap,g=c,h=Object.keys(e),i=0;i "+c+"\n"}),a}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/HashSet.js",function(a,b,c){!function(a){"use strict";a.HashSet=a.inherit({_t:"c.HashSet",initialize:function(){this.storage=[],this.size=0,this.hashCode=a._inc()},add:function(a){{var b=this.storage;b.indexOf(a)}-1==b.indexOf(a)&&(b[b.length]=a),this.size=this.storage.length},values:function(){return this.storage},has:function(a){var b=this.storage;return-1!=b.indexOf(a)},"delete":function(a){var b=this.storage.indexOf(a);return-1==b?null:(this.storage.splice(b,1)[0],void(this.size=this.storage.length))},clear:function(){this.storage.length=0},each:function(a,b){this.size&&this.storage.forEach(a,b)},escapingEach:function(a,b){this.size&&this.storage.forEach(a,b)},toString:function(){var a=this.size+" {",b=!0;return this.each(function(c){b?b=!1:a+=", ",a+=c}),a+="}\n"},toJSON:function(){var a=[];return this.each(function(b){a[a.length]=b.toJSON()}),{_t:"c.HashSet",data:a}},fromJSON:function(b){var c=new a.HashSet;return b.data&&(c.size=b.data.length,c.storage=b.data),c}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Error.js",function(a,b,c){!function(a){"use strict";a.Error=a.inherit({initialize:function(a){a&&(this._description=a)},_name:"c.Error",_description:"An error has occured in Cassowary",set description(a){this._description=a},get description(){return"("+this._name+") "+this._description},get message(){return this.description},toString:function(){return this.description}});var b=function(b,c){return a.inherit({"extends":a.Error,initialize:function(){a.Error.apply(this,arguments)},_name:b||"",_description:c||""})};a.ConstraintNotFound=b("c.ConstraintNotFound","Tried to remove a constraint never added to the tableu"),a.InternalError=b("c.InternalError"),a.NonExpression=b("c.NonExpression","The resulting expression would be non"),a.NotEnoughStays=b("c.NotEnoughStays","There are not enough stays to give specific values to every variable"),a.RequiredFailure=b("c.RequiredFailure","A required constraint cannot be satisfied"),a.TooDifficult=b("c.TooDifficult","The constraints are too difficult to solve")}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/SymbolicWeight.js",function(a,b,c){!function(a){"use strict";var b=1e3;a.SymbolicWeight=a.inherit({_t:"c.SymbolicWeight",initialize:function(){this.value=0;for(var a=1,c=arguments.length-1;c>=0;--c)this.value+=arguments[c]*a,a*=b},toJSON:function(){return{_t:this._t,value:this.value}}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Strength.js",function(a,b,c){!function(a){a.Strength=a.inherit({initialize:function(b,c,d,e){this.name=b,this.symbolicWeight=c instanceof a.SymbolicWeight?c:new a.SymbolicWeight(c,d,e)},get required(){return this===a.Strength.required},toString:function(){return this.name+(this.isRequired?"":":"+this.symbolicWeight)}}),a.Strength.required=new a.Strength("",1e3,1e3,1e3),a.Strength.strong=new a.Strength("strong",1,0,0),a.Strength.medium=new a.Strength("medium",0,1,0),a.Strength.weak=new a.Strength("weak",0,0,1)}(this.c||("undefined"!=typeof c?c.parent.exports.c:{}))}),require.register("slightlyoff-cassowary.js/src/Variable.js",function(a,b,c){!function(a){"use strict";a.AbstractVariable=a.inherit({isDummy:!1,isExternal:!1,isPivotable:!1,isRestricted:!1,_init:function(b,c){this.hashCode=a._inc(),this.name=(c||"")+this.hashCode,b&&("undefined"!=typeof b.name&&(this.name=b.name),"undefined"!=typeof b.value&&(this.value=b.value),"undefined"!=typeof b.prefix&&(this._prefix=b.prefix))},_prefix:"",name:"",value:0,valueOf:function(){return this.value},toJSON:function(){var a={};return this._t&&(a._t=this._t),this.name&&(a.name=this.name),"undefined"!=typeof this.value&&(a.value=this.value),this._prefix&&(a._prefix=this._prefix),this._t&&(a._t=this._t),a},fromJSON:function(b,c){var d=new c;return a.extend(d,b),d},toString:function(){return this._prefix+"["+this.name+":"+this.value+"]"}}),a.Variable=a.inherit({_t:"c.Variable","extends":a.AbstractVariable,initialize:function(b){this._init(b,"v");var c=a.Variable._map;c&&(c[this.name]=this)},isExternal:!0}),a.DummyVariable=a.inherit({_t:"c.DummyVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"d")},isDummy:!0,isRestricted:!0,value:"dummy"}),a.ObjectiveVariable=a.inherit({_t:"c.ObjectiveVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"o")},value:"obj"}),a.SlackVariable=a.inherit({_t:"c.SlackVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"s")},isPivotable:!0,isRestricted:!0,value:"slack"}) }(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Point.js",function(a,b,c){!function(a){"use strict";a.Point=a.inherit({initialize:function(b,c,d){if(b instanceof a.Variable)this._x=b;else{var e={value:b};d&&(e.name="x"+d),this._x=new a.Variable(e)}if(c instanceof a.Variable)this._y=c;else{var f={value:c};d&&(f.name="y"+d),this._y=new a.Variable(f)}},get x(){return this._x},set x(b){b instanceof a.Variable?this._x=b:this._x.value=b},get y(){return this._y},set y(b){b instanceof a.Variable?this._y=b:this._y.value=b},toString:function(){return"("+this.x+", "+this.y+")"}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Expression.js",function(a,b,c){!function(a){"use strict";var b=function(a,b){return"number"==typeof a?a:b};a.Expression=a.inherit({initialize:function(c,d,e){this.constant=b(e,0),this.terms=new a.HashTable,c instanceof a.AbstractVariable?(d=b(d,1),this.setVariable(c,d)):"number"==typeof c&&(isNaN(c)?console.trace():this.constant=c)},initializeFromHash:function(b,c){return a.verbose&&(console.log("*******************************"),console.log("clone c.initializeFromHash"),console.log("*******************************")),a.GC&&console.log("clone c.Expression"),this.constant=b,this.terms=c.clone(),this},multiplyMe:function(a){this.constant*=a;var b=this.terms;return b.each(function(c,d){b.set(c,d*a)}),this},clone:function(){a.verbose&&(console.log("*******************************"),console.log("clone c.Expression"),console.log("*******************************"));var b=a.Expression.empty();return b.initializeFromHash(this.constant,this.terms),b},times:function(b){if("number"==typeof b)return this.clone().multiplyMe(b);if(this.isConstant)return b.times(this.constant);if(b.isConstant)return this.times(b.constant);throw new a.NonExpression},plus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,1):b instanceof a.Variable?this.clone().addVariable(b,1):void 0},minus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,-1):b instanceof a.Variable?this.clone().addVariable(b,-1):void 0},divide:function(b){if("number"==typeof b){if(a.approx(b,0))throw new a.NonExpression;return this.times(1/b)}if(b instanceof a.Expression){if(!b.isConstant)throw new a.NonExpression;return this.times(1/b.constant)}},addExpression:function(c,d,e,f){return c instanceof a.AbstractVariable&&(c=a.Expression.fromVariable(c)),d=b(d,1),this.constant+=d*c.constant,c.terms.each(function(a,b){this.addVariable(a,b*d,e,f)},this),this},addVariable:function(b,c,d,e){null==c&&(c=1);var f=this.terms.get(b);if(f){var g=f+c;0==g||a.approx(g,0)?(e&&e.noteRemovedVariable(b,d),this.terms.delete(b)):this.setVariable(b,g)}else a.approx(c,0)||(this.setVariable(b,c),e&&e.noteAddedVariable(b,d));return this},setVariable:function(a,b){return this.terms.set(a,b),this},anyPivotableVariable:function(){if(this.isConstant)throw new a.InternalError("anyPivotableVariable called on a constant");var b=this.terms.escapingEach(function(a){return a.isPivotable?{retval:a}:void 0});return b&&void 0!==b.retval?b.retval:null},substituteOut:function(b,c,d,e){var f=(this.setVariable.bind(this),this.terms),g=f.get(b);f.delete(b),this.constant+=g*c.constant,c.terms.each(function(b,c){var h=f.get(b);if(h){var i=h+g*c;a.approx(i,0)?(e.noteRemovedVariable(b,d),f.delete(b)):f.set(b,i)}else f.set(b,g*c),e&&e.noteAddedVariable(b,d)})},changeSubject:function(a,b){this.setVariable(a,this.newSubject(b))},newSubject:function(a){var b=1/this.terms.get(a);return this.terms.delete(a),this.multiplyMe(-b),b},coefficientFor:function(a){return this.terms.get(a)||0},get isConstant(){return 0==this.terms.size},toString:function(){var b="",c=!1;if(!a.approx(this.constant,0)||this.isConstant){if(b+=this.constant,this.isConstant)return b;c=!0}return this.terms.each(function(a,d){c&&(b+=" + "),b+=d+"*"+a,c=!0}),b},equals:function(b){return b===this?!0:b instanceof a.Expression&&b.constant===this.constant&&b.terms.equals(this.terms)},Plus:function(a,b){return a.plus(b)},Minus:function(a,b){return a.minus(b)},Times:function(a,b){return a.times(b)},Divide:function(a,b){return a.divide(b)}}),a.Expression.empty=function(){return new a.Expression(void 0,1,0)},a.Expression.fromConstant=function(b){return new a.Expression(b)},a.Expression.fromValue=function(b){return b=+b,new a.Expression(void 0,b,0)},a.Expression.fromVariable=function(b){return new a.Expression(b,1,0)}}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Constraint.js",function(a,b,c){!function(a){"use strict";a.AbstractConstraint=a.inherit({initialize:function(b,c){this.hashCode=a._inc(),this.strength=b||a.Strength.required,this.weight=c||1},isEditConstraint:!1,isInequality:!1,isStayConstraint:!1,get required(){return this.strength===a.Strength.required},toString:function(){return this.strength+" {"+this.weight+"} ("+this.expression+")"}});var b=a.AbstractConstraint.prototype.toString,c=function(b,c,d){a.AbstractConstraint.call(this,c||a.Strength.strong,d),this.variable=b,this.expression=new a.Expression(b,-1,b.value)};a.EditConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isEditConstraint:!0,toString:function(){return"edit:"+b.call(this)}}),a.StayConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isStayConstraint:!0,toString:function(){return"stay:"+b.call(this)}});var d=a.Constraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(b,c,d){a.AbstractConstraint.call(this,c,d),this.expression=b}});a.Inequality=a.inherit({"extends":a.Constraint,_cloneOrNewCle:function(b){return b.clone?b.clone():new a.Expression(b)},initialize:function(b,c,e,f,g){var h=b instanceof a.Expression,i=e instanceof a.Expression,j=b instanceof a.AbstractVariable,k=e instanceof a.AbstractVariable,l="number"==typeof b,m="number"==typeof e;if((h||l)&&k){var n=b,o=c,p=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else if(j&&(i||m)){var n=e,o=c,p=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else{if(h&&m){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(l&&i){var s=e,o=c,t=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(h&&i){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(t),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(s));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(s),-1)}}else{if(h)return d.call(this,b,c,e);if(c==a.GEQ)d.call(this,new a.Expression(e),f,g),this.expression.multiplyMe(-1),this.expression.addVariable(b);else{if(c!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");d.call(this,new a.Expression(e),f,g),this.expression.addVariable(b,-1)}}}},isInequality:!0,toString:function(){return d.prototype.toString.call(this)+" >= 0) id: "+this.hashCode}}),a.Equation=a.inherit({"extends":a.Constraint,initialize:function(b,c,e,f){if(b instanceof a.Expression&&!c||c instanceof a.Strength)d.call(this,b,c,e);else if(b instanceof a.AbstractVariable&&c instanceof a.Expression){var g=b,h=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.AbstractVariable&&"number"==typeof c){var g=b,k=c,i=e,j=f;d.call(this,new a.Expression(k),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.Expression&&c instanceof a.AbstractVariable){var h=b,g=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else{if(!(b instanceof a.Expression||b instanceof a.AbstractVariable||"number"==typeof b)||!(c instanceof a.Expression||c instanceof a.AbstractVariable||"number"==typeof c))throw"Bad initializer to c.Equation";b=b instanceof a.Expression?b.clone():new a.Expression(b),c=c instanceof a.Expression?c.clone():new a.Expression(c),d.call(this,b,e,f),this.expression.addExpression(c,-1)}a.assert(this.strength instanceof a.Strength,"_strength not set")},toString:function(){return d.prototype.toString.call(this)+" = 0)"}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/EditInfo.js",function(a,b,c){!function(a){"use strict";a.EditInfo=a.inherit({initialize:function(a,b,c,d,e){this.constraint=a,this.editPlus=b,this.editMinus=c,this.prevEditConstant=d,this.index=e},toString:function(){return""}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Tableau.js",function(a,b,c){!function(a){"use strict";a.Tableau=a.inherit({initialize:function(){this.columns=new a.HashTable,this.rows=new a.HashTable,this._infeasibleRows=new a.HashSet,this._externalRows=new a.HashSet,this._externalParametricVars=new a.HashSet},noteRemovedVariable:function(b,c){a.trace&&console.log("c.Tableau::noteRemovedVariable: ",b,c);var d=this.columns.get(b);c&&d&&d.delete(c)},noteAddedVariable:function(a,b){b&&this.insertColVar(a,b)},getInternalInfo:function(){var a="Tableau Information:\n";return a+="Rows: "+this.rows.size,a+=" (= "+(this.rows.size-1)+" constraints)",a+="\nColumns: "+this.columns.size,a+="\nInfeasible Rows: "+this._infeasibleRows.size,a+="\nExternal basic variables: "+this._externalRows.size,a+="\nExternal parametric variables: ",a+=this._externalParametricVars.size,a+="\n"},toString:function(){var a="Tableau:\n";return this.rows.each(function(b,c){a+=b,a+=" <==> ",a+=c,a+="\n"}),a+="\nColumns:\n",a+=this.columns,a+="\nInfeasible rows: ",a+=this._infeasibleRows,a+="External basic variables: ",a+=this._externalRows,a+="External parametric variables: ",a+=this._externalParametricVars},insertColVar:function(b,c){var d=this.columns.get(b);d||(d=new a.HashSet,this.columns.set(b,d)),d.add(c)},addRow:function(b,c){a.trace&&a.fnenterprint("addRow: "+b+", "+c),this.rows.set(b,c),c.terms.each(function(a){this.insertColVar(a,b),a.isExternal&&this._externalParametricVars.add(a)},this),b.isExternal&&this._externalRows.add(b),a.trace&&a.traceprint(this.toString())},removeColumn:function(b){a.trace&&a.fnenterprint("removeColumn:"+b);var c=this.columns.get(b);c?(this.columns.delete(b),c.each(function(a){var c=this.rows.get(a);c.terms.delete(b)},this)):a.trace&&console.log("Could not find var",b,"in columns"),b.isExternal&&(this._externalRows.delete(b),this._externalParametricVars.delete(b))},removeRow:function(b){a.trace&&a.fnenterprint("removeRow:"+b);var c=this.rows.get(b);return a.assert(null!=c),c.terms.each(function(c){var d=this.columns.get(c);null!=d&&(a.trace&&console.log("removing from varset:",b),d.delete(b))},this),this._infeasibleRows.delete(b),b.isExternal&&this._externalRows.delete(b),this.rows.delete(b),a.trace&&a.fnexitprint("returning "+c),c},substituteOut:function(b,c){a.trace&&a.fnenterprint("substituteOut:"+b+", "+c),a.trace&&a.traceprint(this.toString());var d=this.columns.get(b);d.each(function(a){var d=this.rows.get(a);d.substituteOut(b,c,a,this),a.isRestricted&&d.constant<0&&this._infeasibleRows.add(a)},this),b.isExternal&&(this._externalRows.add(b),this._externalParametricVars.delete(b)),this.columns.delete(b)},columnsHasKey:function(a){return!!this.columns.get(a)}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/SimplexSolver.js",function(a,b,c){!function(a){var b=a.Tableau,c=b.prototype,d=1e-8,e=a.Strength.weak;a.SimplexSolver=a.inherit({"extends":a.Tableau,initialize:function(){a.Tableau.call(this),this._stayMinusErrorVars=[],this._stayPlusErrorVars=[],this._errorVars=new a.HashTable,this._markerVars=new a.HashTable,this._objective=new a.ObjectiveVariable({name:"Z"}),this._editVarMap=new a.HashTable,this._editVarList=[],this._slackCounter=0,this._artificialCounter=0,this._dummyCounter=0,this.autoSolve=!0,this._needsSolving=!1,this._optimizeCount=0,this.rows.set(this._objective,a.Expression.empty()),this._editVariableStack=[0],a.trace&&a.traceprint("objective expr == "+this.rows.get(this._objective))},add:function(){for(var a=0;a0,"_editVarMap.size > 0"),this._infeasibleRows.clear(),this._resetStayConstants(),this._editVariableStack[this._editVariableStack.length]=this._editVarMap.size,this},endEdit:function(){return a.assert(this._editVarMap.size>0,"_editVarMap.size > 0"),this.resolve(),this._editVariableStack.pop(),this.removeEditVarsTo(this._editVariableStack[this._editVariableStack.length-1]),this},removeAllEditVars:function(){return this.removeEditVarsTo(0)},removeEditVarsTo:function(b){try{for(var c=this._editVarList.length,d=b;c>d;d++)this._editVarList[d]&&this.removeConstraint(this._editVarMap.get(this._editVarList[d].v).constraint);return this._editVarList.length=b,a.assert(this._editVarMap.size==b,"_editVarMap.size == n"),this}catch(e){throw new a.InternalError("Constraint not found in removeEditVarsTo")}},addPointStays:function(b){return a.trace&&console.log("addPointStays",b),b.forEach(function(a,b){this.addStay(a.x,e,Math.pow(2,b)),this.addStay(a.y,e,Math.pow(2,b))},this),this},addStay:function(b,c,d){var f=new a.StayConstraint(b,c||e,d||1);return this.addConstraint(f)},removeConstraint:function(b){a.trace&&a.fnenterprint("removeConstraintInternal: "+b),a.trace&&a.traceprint(this.toString()),this._needsSolving=!0,this._resetStayConstants();var c=this.rows.get(this._objective),d=this._errorVars.get(b);a.trace&&a.traceprint("eVars == "+d),null!=d&&d.each(function(e){var f=this.rows.get(e);null==f?c.addVariable(e,-b.weight*b.strength.symbolicWeight.value,this._objective,this):c.addExpression(f,-b.weight*b.strength.symbolicWeight.value,this._objective,this),a.trace&&a.traceprint("now eVars == "+d)},this);var e=this._markerVars.get(b);if(this._markerVars.delete(b),null==e)throw new a.InternalError("Constraint not found in removeConstraintInternal");if(a.trace&&a.traceprint("Looking to remove var "+e),null==this.rows.get(e)){var f=this.columns.get(e);a.trace&&a.traceprint("Must pivot -- columns are "+f);var g=null,h=0;f.each(function(b){if(b.isRestricted){var c=this.rows.get(b),d=c.coefficientFor(e);if(a.trace&&a.traceprint("Marker "+e+"'s coefficient in "+c+" is "+d),0>d){var f=-c.constant/d;(null==g||h>f||a.approx(f,h)&&b.hashCoded)&&(h=d,g=a)}},this)),null==g&&(0==f.size?this.removeColumn(e):f.escapingEach(function(a){return a!=this._objective?(g=a,{brk:!0}):void 0},this)),null!=g&&this.pivot(e,g)}if(null!=this.rows.get(e)){this.removeRow(e)}if(null!=d&&d.each(function(a){a!=e&&this.removeColumn(a)},this),b.isStayConstraint){if(null!=d)for(var i=0;ie&&this.suggestValue(a,b[e])},this),this.resolve()},resolvePair:function(a,b){this.suggestValue(this._editVarList[0].v,a),this.suggestValue(this._editVarList[1].v,b),this.resolve()},resolve:function(){a.trace&&a.fnenterprint("resolve()"),this.dualOptimize(),this._setExternalVariables(),this._infeasibleRows.clear(),this._resetStayConstants()},suggestValue:function(b,c){a.trace&&console.log("suggestValue("+b+", "+c+")");var d=this._editVarMap.get(b);if(!d)throw new a.Error("suggestValue for variable "+b+", but var is not an edit variable");var e=c-d.prevEditConstant;return d.prevEditConstant=c,this.deltaEditConstant(e,d.editPlus,d.editMinus),this},solve:function(){return this._needsSolving&&(this.optimize(this._objective),this._setExternalVariables()),this},setEditedValue:function(b,c){if(!this.columnsHasKey(b)&&null==this.rows.get(b))return b.value=c,this;if(!a.approx(c,b.value)){this.addEditVar(b),this.beginEdit();try{this.suggestValue(b,c)}catch(d){throw new a.InternalError("Error in setEditedValue")}this.endEdit()}return this},addVar:function(b){if(!this.columnsHasKey(b)&&null==this.rows.get(b)){try{this.addStay(b)}catch(c){throw new a.InternalError("Error in addVar -- required failure is impossible")}a.trace&&a.traceprint("added initial stay on "+b)}return this},getInternalInfo:function(){var a=c.getInternalInfo.call(this);return a+="\nSolver info:\n",a+="Stay Error Variables: ",a+=this._stayPlusErrorVars.length+this._stayMinusErrorVars.length,a+=" ("+this._stayPlusErrorVars.length+" +, ",a+=this._stayMinusErrorVars.length+" -)\n",a+="Edit Variables: "+this._editVarMap.size,a+="\n"},getDebugInfo:function(){return this.toString()+this.getInternalInfo()+"\n"},toString:function(){var a=c.getInternalInfo.call(this);return a+="\n_stayPlusErrorVars: ",a+="["+this._stayPlusErrorVars+"]",a+="\n_stayMinusErrorVars: ",a+="["+this._stayMinusErrorVars+"]",a+="\n",a+="_editVarMap:\n"+this._editVarMap,a+="\n"},addWithArtificialVariable:function(b){a.trace&&a.fnenterprint("addWithArtificialVariable: "+b);var c=new a.SlackVariable({value:++this._artificialCounter,prefix:"a"}),d=new a.ObjectiveVariable({name:"az"}),e=b.clone();a.trace&&a.traceprint("before addRows:\n"+this),this.addRow(d,e),this.addRow(c,b),a.trace&&a.traceprint("after addRows:\n"+this),this.optimize(d);var f=this.rows.get(d);if(a.trace&&a.traceprint("azTableauRow.constant == "+f.constant),!a.approx(f.constant,0))throw this.removeRow(d),this.removeColumn(c),new a.RequiredFailure;var g=this.rows.get(c);if(null!=g){if(g.isConstant)return this.removeRow(c),void this.removeRow(d);var h=g.anyPivotableVariable();this.pivot(h,c)}a.assert(null==this.rows.get(c),"rowExpression(av) == null"),this.removeColumn(c),this.removeRow(d)},tryAddingDirectly:function(b){a.trace&&a.fnenterprint("tryAddingDirectly: "+b);var c=this.chooseSubject(b);return null==c?(a.trace&&a.fnexitprint("returning false"),!1):(b.newSubject(c),this.columnsHasKey(c)&&this.substituteOut(c,b),this.addRow(c,b),a.trace&&a.fnexitprint("returning true"),!0)},chooseSubject:function(b){a.trace&&a.fnenterprint("chooseSubject: "+b);var c=null,d=!1,e=!1,f=b.terms,g=f.escapingEach(function(a,b){if(d){if(!a.isRestricted&&!this.columnsHasKey(a))return{retval:a}}else if(a.isRestricted){if(!e&&!a.isDummy&&0>b){var f=this.columns.get(a);(null==f||1==f.size&&this.columnsHasKey(this._objective))&&(c=a,e=!0)}}else c=a,d=!0},this);if(g&&void 0!==g.retval)return g.retval;if(null!=c)return c;var h=0,g=f.escapingEach(function(a,b){return a.isDummy?void(this.columnsHasKey(a)||(c=a,h=b)):{retval:null}},this);if(g&&void 0!==g.retval)return g.retval;if(!a.approx(b.constant,0))throw new a.RequiredFailure;return h>0&&b.multiplyMe(-1),c},deltaEditConstant:function(b,c,d){a.trace&&a.fnenterprint("deltaEditConstant :"+b+", "+c+", "+d);var e=this.rows.get(c);if(null!=e)return e.constant+=b,void(e.constant<0&&this._infeasibleRows.add(c));var f=this.rows.get(d);if(null!=f)return f.constant+=-b,void(f.constant<0&&this._infeasibleRows.add(d));var g=this.columns.get(d);g||console.log("columnVars is null -- tableau is:\n"+this),g.each(function(a){var c=this.rows.get(a),e=c.coefficientFor(d);c.constant+=e*b,a.isRestricted&&c.constant<0&&this._infeasibleRows.add(a)},this)},dualOptimize:function(){a.trace&&a.fnenterprint("dualOptimize:");for(var b=this.rows.get(this._objective);this._infeasibleRows.size;){var c=this._infeasibleRows.values()[0];this._infeasibleRows.delete(c);var d=null,e=this.rows.get(c);if(e&&e.constant<0){var f,g=Number.MAX_VALUE,h=e.terms;if(h.each(function(c,e){if(e>0&&c.isPivotable){var h=b.coefficientFor(c);f=h/e,(g>f||a.approx(f,g)&&c.hashCodeb?(e=b,g=a,{brk:1}):void 0},this),e>=-d)return;a.trace&&console.log("entryVar:",g,"objectiveCoeff:",e);var i=Number.MAX_VALUE,j=this.columns.get(g),k=0;if(j.each(function(b){if(a.trace&&a.traceprint("Checking "+b),b.isPivotable){var c=this.rows.get(b),d=c.coefficientFor(g);a.trace&&a.traceprint("pivotable, coeff = "+d),0>d&&(k=-c.constant/d,(i>k||a.approx(k,i)&&b.hashCoded;d++){var e=this.rows.get(b[d]);null===e&&(e=this.rows.get(this._stayMinusErrorVars[d])),null!=e&&(e.constant=0)}},_setExternalVariables:function(){a.trace&&a.fnenterprint("_setExternalVariables:"),a.trace&&a.traceprint(this.toString());var b={};this._externalParametricVars.each(function(c){null!=this.rows.get(c)?a.trace&&console.log("Error: variable"+c+" in _externalParametricVars is basic"):(c.value=0,b[c.name]=0)},this),this._externalRows.each(function(a){var c=this.rows.get(a);a.value!=c.constant&&(a.value=c.constant,b[a.name]=c.constant)},this),this._changed=b,this._needsSolving=!1,this._informCallbacks(),this.onsolved()},onsolved:function(){},_informCallbacks:function(){if(this._callbacks){var a=this._changed;this._callbacks.forEach(function(b){b(a)})}},_addCallback:function(a){var b=this._callbacks||(this._callbacks=[]);b[b.length]=a},insertErrorVar:function(b,c){a.trace&&a.fnenterprint("insertErrorVar:"+b+", "+c);var d=this._errorVars.get(c);d||(d=new a.HashSet,this._errorVars.set(b,d)),d.add(c)}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/Timer.js",function(a,b,c){!function(a){"use strict";a.Timer=a.inherit({initialize:function(){this.isRunning=!1,this._elapsedMs=0},start:function(){return this.isRunning=!0,this._startReading=new Date,this},stop:function(){return this.isRunning=!1,this._elapsedMs+=new Date-this._startReading,this},reset:function(){return this.isRunning=!1,this._elapsedMs=0,this},elapsedTime:function(){return this.isRunning?(this._elapsedMs+(new Date-this._startReading))/1e3:this._elapsedMs/1e3}})}(this.c||c.parent.exports||{})}),require.register("slightlyoff-cassowary.js/src/parser/parser.js",function(){this.c.parser=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function d(a){O>M||(M>O&&(O=M,P=[]),P.push(a))}function e(){var a,b,c,d,e;if(d=M,e=M,a=s(),null!==a){for(b=[],c=f();null!==c;)b.push(c),c=f();null!==b?(c=s(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)}else a=null,M=e;return null!==a&&(a=function(a,b){return b}(d,a[1])),null===a&&(M=d),a}function f(){var a,b,c,d;return c=M,d=M,a=I(),null!==a?(b=l(),null!==b?a=[a,b]:(a=null,M=d)):(a=null,M=d),null!==a&&(a=function(a,b){return b}(c,a[0])),null===a&&(M=c),a}function g(){var a;return b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),a}function h(){var a;return/^[a-zA-Z]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[a-zA-Z]")),null===a&&(36===b.charCodeAt(M)?(a="$",M++):(a=null,0===N&&d('"$"')),null===a&&(95===b.charCodeAt(M)?(a="_",M++):(a=null,0===N&&d('"_"')))),a}function i(){var a;return N++,/^[\t\x0B\f \xA0\uFEFF]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\t\\x0B\\f \\xA0\\uFEFF]")),N--,0===N&&null===a&&d("whitespace"),a}function j(){var a;return/^[\n\r\u2028\u2029]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\n\\r\\u2028\\u2029]")),a}function k(){var a;return N++,10===b.charCodeAt(M)?(a="\n",M++):(a=null,0===N&&d('"\\n"')),null===a&&("\r\n"===b.substr(M,2)?(a="\r\n",M+=2):(a=null,0===N&&d('"\\r\\n"')),null===a&&(13===b.charCodeAt(M)?(a="\r",M++):(a=null,0===N&&d('"\\r"')),null===a&&(8232===b.charCodeAt(M)?(a="\u2028",M++):(a=null,0===N&&d('"\\u2028"')),null===a&&(8233===b.charCodeAt(M)?(a="\u2029",M++):(a=null,0===N&&d('"\\u2029"')))))),N--,0===N&&null===a&&d("end of line"),a}function l(){var a,c,e;return e=M,a=s(),null!==a?(59===b.charCodeAt(M)?(c=";",M++):(c=null,0===N&&d('";"')),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=r(),null!==a?(c=k(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=s(),null!==a?(c=m(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e))),a}function m(){var a,c;return c=M,N++,b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),N--,null===a?a="":(a=null,M=c),a}function n(){var a;return N++,a=o(),null===a&&(a=q()),N--,0===N&&null===a&&d("comment"),a}function o(){var a,c,e,f,h,i,j;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function p(){var a,c,e,f,h,i,k;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function q(){var a,c,e,f,h,i,k;if(h=M,"//"===b.substr(M,2)?(a="//",M+=2):(a=null,0===N&&d('"//"')),null!==a){for(c=[],i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?(e=j(),null===e&&(e=m()),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function r(){var a,b;for(a=[],b=i(),null===b&&(b=p(),null===b&&(b=q()));null!==b;)a.push(b),b=i(),null===b&&(b=p(),null===b&&(b=q()));return a}function s(){var a,b;for(a=[],b=i(),null===b&&(b=k(),null===b&&(b=n()));null!==b;)a.push(b),b=i(),null===b&&(b=k(),null===b&&(b=n()));return a}function t(){var a,b;return b=M,a=v(),null===a&&(a=u()),null!==a&&(a=function(a,b){return{type:"NumericLiteral",value:b}}(b,a)),null===a&&(M=b),a}function u(){var a,c,e; -if(e=M,/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]")),null!==c)for(a=[];null!==c;)a.push(c),/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]"));else a=null;return null!==a&&(a=function(a,b){return parseInt(b.join(""))}(e,a)),null===a&&(M=e),a}function v(){var a,c,e,f,g;return f=M,g=M,a=u(),null!==a?(46===b.charCodeAt(M)?(c=".",M++):(c=null,0===N&&d('"."')),null!==c?(e=u(),null!==e?a=[a,c,e]:(a=null,M=g)):(a=null,M=g)):(a=null,M=g),null!==a&&(a=function(a,b){return parseFloat(b.join(""))}(f,a)),null===a&&(M=f),a}function w(){var a,c,e,f;if(f=M,/^[\-+]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\-+]")),a=null!==a?a:"",null!==a){if(/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]")),null!==e)for(c=[];null!==e;)c.push(e),/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]"));else c=null;null!==c?a=[a,c]:(a=null,M=f)}else a=null,M=f;return a}function x(){var a,b;return N++,b=M,a=y(),null!==a&&(a=function(a,b){return b}(b,a)),null===a&&(M=b),N--,0===N&&null===a&&d("identifier"),a}function y(){var a,b,c,e,f;if(N++,e=M,f=M,a=h(),null!==a){for(b=[],c=h();null!==c;)b.push(c),c=h();null!==b?a=[a,b]:(a=null,M=f)}else a=null,M=f;return null!==a&&(a=function(a,b,c){return b+c.join("")}(e,a[0],a[1])),null===a&&(M=e),N--,0===N&&null===a&&d("identifier"),a}function z(){var a,c,e,f,g,h,i;return h=M,a=x(),null!==a&&(a=function(a,b){return{type:"Variable",name:b}}(h,a)),null===a&&(M=h),null===a&&(a=t(),null===a&&(h=M,i=M,40===b.charCodeAt(M)?(a="(",M++):(a=null,0===N&&d('"("')),null!==a?(c=s(),null!==c?(e=I(),null!==e?(f=s(),null!==f?(41===b.charCodeAt(M)?(g=")",M++):(g=null,0===N&&d('")"')),null!==g?a=[a,c,e,f,g]:(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i),null!==a&&(a=function(a,b){return b}(h,a[2])),null===a&&(M=h))),a}function A(){var a,b,c,d,e;return a=z(),null===a&&(d=M,e=M,a=B(),null!==a?(b=s(),null!==b?(c=A(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)):(a=null,M=e),null!==a&&(a=function(a,b,c){return{type:"UnaryExpression",operator:b,expression:c}}(d,a[0],a[2])),null===a&&(M=d)),a}function B(){var a;return 43===b.charCodeAt(M)?(a="+",M++):(a=null,0===N&&d('"+"')),null===a&&(45===b.charCodeAt(M)?(a="-",M++):(a=null,0===N&&d('"-"')),null===a&&(33===b.charCodeAt(M)?(a="!",M++):(a=null,0===N&&d('"!"')))),a}function C(){var a,b,c,d,e,f,g,h,i;if(g=M,h=M,a=A(),null!==a){for(b=[],i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==c;)b.push(c),i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==b?a=[a,b]:(a=null,M=h)}else a=null,M=h;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;e="===b.substr(M,2)?(a=">=",M+=2):(a=null,0===N&&d('">="')),null===a&&(60===b.charCodeAt(M)?(a="<",M++):(a=null,0===N&&d('"<"')),null===a&&(62===b.charCodeAt(M)?(a=">",M++):(a=null,0===N&&d('">"'))))),a}function I(){var a,c,e,f,g,h,i,j,k;if(i=M,j=M,a=G(),null!==a){for(c=[],k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==e;)c.push(e),k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==c?a=[a,c]:(a=null,M=j)}else a=null,M=j;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;ec;c++)if(b=a[c],"undefined"!=typeof i.style[b])return b;return null},f=String.prototype.trim,h=String.prototype.trimRight,g=String.prototype.trimLeft,j={transformPrefix:d(["transform","WebkitTransform","MozTransform","OTransform","msTransform"]),boxSizingPrefix:d(["boxSizing","WebkitBoxSizing","MozBoxSizing","OBoxSizing","msBoxSizing"]),defer:function(a){return setTimeout(a,1)},debounce:function(a,b,c){var d,f,g,h,i;return h=void 0,d=void 0,f=void 0,i=void 0,g=void 0,function(){var j,l;return f=this,d=k.call(arguments),i=e(),l=function(){var j;return j=e()-i,b>j?h=setTimeout(l,b-j):(h=null,c?void 0:g=a.apply(f,d))},j=c&&!h,h||(h=setTimeout(l,b)),j&&(g=a.apply(f,d)),g}},cloneDeep:function(a){return JSON.parse(JSON.stringify(a))},cloneObject:function(a){var b,c;c={};for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},filterVarsForDisplay:function(a){var b,c,d,e,f,g,h,i;f={},e=[];for(d in a)g=a[d],b=d.indexOf("intrinsic-"),-1!==b?e.push(d.replace("intrinsic-","")):f[d]=g;for(h=0,i=e.length;i>h;h++)c=e[h],delete f[c];return f},varsByViewId:function(a){var b,c,d,e,f;f={};for(c in a)e=a[c],"$"===c[0]&&(b=c.substring(1,c.indexOf("[")),f[b]||(f[b]={}),d=c.substring(c.indexOf("[")+1,c.indexOf("]")),f[b][d]=e);return f},mat4ToCSS:function(a){return"matrix3d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"},mat2dToCSS:function(a){return"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"},camelize:function(a){var b;return b=a.replace(/[-_\s]+(.)?/g,function(a,b){return b?b.toUpperCase():""})},dasherize:function(a){return this.trim(a).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},trim:function(a,b){return null==a?"":!b&&f?f.call(a):(b=defaultToWhiteSpace(b),String(a).replace(new RegExp("^"+b+"+|"+b+"+$","g"),""))}},c.exports=j}),require.register("gss/lib/EventTrigger.js",function(a,b,c){var d;d=function(){function a(){this._listenersByType={}}return a.prototype._getListeners=function(a){var b;return this._listenersByType[a]?b=this._listenersByType[a]:(b=[],this._listenersByType[a]=b),b},a.prototype.on=function(a,b){var c;return c=this._getListeners(a),-1===c.indexOf(b)&&c.push(b),this},a.prototype.once=function(a,b){var c,d;return d=null,c=this,d=function(e){return c.off(a,d),b.call(c,e)},this.on(a,d),this},a.prototype.off=function(a,b){var c,d;return d=this._getListeners(a),c=d.indexOf(b),-1!==c&&d.splice(c,1),this},a.prototype.offAll=function(a){var b,c,d,e;if("string"==typeof a)a&&(this._listenersByType[a]=[]);else if("function"==typeof a){e=this._listenersByType;for(d in e)c=e[d],b=c.indexOf(a),-1!==b&&c.splice(b,1)}else this._listenersByType={};return this},a.prototype.trigger=function(a,b){var c,d,e,f;for(f=this._getListeners(a),d=0,e=f.length;e>d;d++)c=f[d],null!=c&&c.call(this,b);return this},a}(),d.make=function(a){var b,c,e;null==a&&(a={}),d.prototype.constructor.call(a),e=d.prototype;for(b in e)c=e[b],"constructor"===b?c.call(a):a[b]=c;return a},c.exports=d}),require.register("gss/lib/dom/Query.js",function(a,b,c){var d,e,f,g=[].slice,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};f=function(a,b){var c,d,e,f,g,h,i,j;for(c=[],f=[],g=0,i=b.length;i>g;g++)d=b[g],-1===a.indexOf(d)&&c.push(d);for(h=0,j=a.length;j>h;h++)e=a[h],-1===b.indexOf(e)&&f.push(e);return{adds:c,removes:f}},d=function(){return GSS.deblog.apply(GSS,["Query"].concat(g.call(arguments)))},e=function(a){function b(a){null==a&&(a={}),b.__super__.constructor.apply(this,arguments),this.selector=a.selector||function(){throw new Error("GssQuery must have a selector")}(),this.createNodeList=a.createNodeList||function(){throw new Error("GssQuery must implement createNodeList()")}(),this.isMulti=a.isMulti||!1,this.isLive=a.isLive||!1,this.ids=a.ids||[],this.lastAddedIds=[],this.lastRemovedIds=[],d("constructor() @",this)}return i(b,a),b.prototype.isQuery=!0,b.prototype._updated_once=!1,b.prototype.changedLastUpdate=!1,b.prototype.update=function(){var a,b,c,e,g,h,i,j,k,l;if(d("update() @",this),this.is_destroyed)throw new Error("Can't update destroyed query: "+this.selector);for(this.changedLastUpdate=!1,this.isLive&&this._updated_once||(this.nodeList=this.createNodeList(),this._updated_once=!0),g=this.ids,e=[],k=this.nodeList,i=0,j=k.length;j>i;i++)b=k[i],c=GSS.setupId(b),c&&e.push(c);return l=f(g,e),a=l.adds,h=l.removes,a.length>0&&(this.changedLastUpdate=!0),this.lastAddedIds=a,h.length>0&&(this.changedLastUpdate=!0),this.lastRemovedIds=h,this.ids=e,this.changedLastUpdate&&this.trigger("afterChange"),this},b.prototype.forEach=function(a){var b,c,d,e,f;for(e=this.nodeList,f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(a.call(this,b));return f},b.prototype.first=function(){return this.nodeList[0]},b.prototype.last=function(){return this.nodeList[this.nodeList.length-1]},b.prototype.next=function(a){return this.nodeList[this.indexOf(a)+1]},b.prototype.prev=function(a){return this.nodeList[this.indexOf(a)-1]},b.prototype.indexOf=function(a){return Array.prototype.indexOf.call(this.nodeList,a)},b.prototype.is_destroyed=!1,b.prototype.destroy=function(){return this.offAll(),this.is_destroyed=!0,this.ids=null,this.lastAddedIds=null,this.lastRemovedIds=null,this.createNodeList=null,this.nodeList=null,this.changedLastUpdate=null},b}(GSS.EventTrigger),e.Set=function(a){function b(){return b.__super__.constructor.apply(this,arguments),this.bySelector={},this}return i(b,a),b.prototype.clean=function(){var a,b,c;c=this.bySelector;for(b in c)a=c[b],a.destroy(),delete this.bySelector[b];return this.bySelector={}},b.prototype.destroy=function(){var a,b,c;c=this.bySelector;for(b in c)a=c[b],a.destroy(),this.bySelector[b]=null;return this.offAll(),this.bySelector=null},b.prototype.add=function(a){var b,c;return c=a.selector,b=this.bySelector[c],b||(b=new GSS.Query(a),b.update(),this.bySelector[c]=b),b},b.prototype.remove=function(a){var b,c;return c=a.selector,b=this.bySelector[c],b&&(b.destroy(),delete this.bySelector[c]),b},b.prototype.update=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;i=[],f=[],b=[],j=!1,m=this.bySelector;for(h in m)if(d=m[h],d.update(),d.changedLastUpdate&&(d.lastAddedIds.length>0&&(j=!0,i.push(h)),d.lastRemovedIds.length>0))for(j=!0,e=d.lastRemovedIds,k=0,l=e.length;l>k;k++)g=e[k],-1===b.indexOf(g)&&(a=GSS.getById(g),document.documentElement.contains(a)?(b.push(g),f.push(h+"$"+g)):f.push("$"+g));return GSS._ids_killed(b),j?j?(c={removes:f,selectorsWithAdds:i},this.trigger("update",c),c):void 0:j},b}(GSS.EventTrigger),c.exports=e}),require.register("gss/lib/dom/View.js",function(a,b,c){var d,e,f=function(a,b){return function(){return a.apply(b,arguments)}};e=GSS._.transformPrefix,d=function(){function a(){this.printCssTree=f(this.printCssTree,this),this.recycle=f(this.recycle,this),this.attach=f(this.attach,this),this.values={},this.is_positioned=!1,this.el=null,this.id=null,this.parentOffsets=null,this.style=null,this.Matrix=null,this.matrixType=null,this.virtuals=null}return a.prototype.attach=function(b,c){if(this.el=b,this.id=c,!this.el)throw new Error("View needs el");if(!this.id)throw new Error("View needs id");return a.byId[this.id]=this,this.is_positioned=!1,this.el.gssView=this,GSS.trigger("view:attach",this),this.matrixType||(this.matrixType=GSS.config.defaultMatrixType),this.Matrix=GSS.glMatrix[this.matrixType]||function(){throw new Error("View matrixType not found: "+this.matrixType)}.call(this),this.matrix||(this.matrix=this.Matrix.create()),this},a.prototype.recycle=function(){return GSS.trigger("view:detach",this),this.is_positioned=!1,this.el=null,delete a.byId[this.id],this.id=null,this.parentOffsets=null,this.style=null,this.Matrix.identity(this.matrix),this.matrixType=null,this.virtuals=null,this.values={},a.recycled.push(this)},a.prototype.positionIfNeeded=function(){return this.is_positioned||(this.style.position="absolute",this.style.margin="0px",this.style.top="0px",this.style.left="0px"),this.is_positioned=!0},a.prototype.updateParentOffsets=function(){return this.parentOffsets=this.getParentOffsets()},a.prototype.getParentOffsets=function(){var a;return a=this.el.getBoundingClientRect(),{y:a.top+(window.pageYOffset||document.documentElement.scrollTop)-(document.documentElement.clientTop||0),x:a.left+(window.pageXOffset||document.documentElement.scrollLeft)-(document.documentElement.clientLeft||0)}},a.prototype.getParentOffsets__=function(){var a,b;if(a=this.el,b={x:0,y:0},!a.offsetParent)return b;for(a=a.offsetParent;;){if(b.x+=a.offsetLeft,b.y+=a.offsetTop,!a.offsetParent)break;a=a.offsetParent}return b},a.prototype.needsDisplay=!1,a.prototype.display=function(a){var b,c,d,e,f,g,h;if(this.values){c={},g=this.values;for(b in g)d=g[b],c[b]=d;(null!=c.x||null!=c.y)&&(this.parentOffsets&&(a.x+=this.parentOffsets.x,a.y+=this.parentOffsets.y),null!=c.x?(e=c.x-a.x,delete c.x):e=0,null!=c.y?(f=c.y-a.y,delete c.y):f=0,GSS.config.fractionalPixels||(e=Math.round(e),f=Math.round(f)),this.values.xLocal=e,this.values.yLocal=f,this._positionMatrix(e,f)),null!=c["z-index"]&&(this.style.zIndex=c["z-index"],delete c["z-index"]),null!=c.opacity&&(this.style.opacity=c.opacity,delete c.opacity),GSS.config.fractionalPixels||(null!=c.width&&(c.width=Math.round(c.width)),null!=c.height&&(c.height=Math.round(c.height)));for(b in c)d=c[b],b=GSS._.camelize(b),this.style[b]=d+"px";h=this.style;for(b in h)d=h[b],this.el.style[b]=d;return this}},a.prototype.printCss=function(){var a,b,c,d,e;a="",b=!1,e=this.style;for(c in e)d=e[c],b=!0,a+=""+GSS._.dasherize(c)+":"+d+";";return b&&(a="#"+this.id+"{"+a+"}"),a},a.prototype.printCssTree=function(a,b){var c,d,e,f,g,h;if(null==b&&(b=0),a?e="":(a=this.el,e=this.printCss()),b>GSS.config.maxDisplayRecursionDepth)return"";if(d=a.children,!d)return"";for(g=0,h=d.length;h>g;g++)c=d[g],f=GSS.get.view(c),e+=f?f.printCssTree():this.printCssTree(c,b+1);return e},a.prototype._positionMatrix=function(a,b){return this.Matrix.translate(this.matrix,this.matrix,[a,b,0]),this.style[e]=GSS._[this.matrixType+"ToCSS"](this.matrix)},a.prototype.displayIfNeeded=function(a,b){return null==a&&(a={x:0,y:0}),null==b&&(b=!0),this.needsDisplay&&(this.display(a),this.setNeedsDisplay(!1)),a={x:0,y:0},this.values.x&&(a.x+=this.values.x),this.values.y&&(a.y+=this.values.y),b?this.displayChildrenIfNeeded(a):void 0},a.prototype.setNeedsDisplay=function(a){return this.needsDisplay=a?!0:!1},a.prototype.displayChildrenIfNeeded=function(a){return this._displayChildrenIfNeeded(this.el,a,0)},a.prototype._displayChildrenIfNeeded=function(a,b,c){var d,e,f,g,h,i;if(c<=GSS.config.maxDisplayRecursionDepth){if(e=a.children,!e)return null;for(i=[],g=0,h=e.length;h>g;g++)d=e[g],f=GSS.get.view(d),i.push(f?f.displayIfNeeded(b):this._displayChildrenIfNeeded(d,b,c+1));return i}},a.prototype.updateValues=function(a){return this.values=a,this.style={},this.Matrix.identity(this.matrix),null!=this.el.getAttribute("gss-parent-offsets")&&this.updateParentOffsets(),(null!=a.x||null!=a.y)&&this.positionIfNeeded(),this.setNeedsDisplay(!0),this},a.prototype.getParentView=function(){var b,c;for(b=this.el.parentElement;;){if(c=b._gss_id)return a.byId[c];if(!b.parentElement)break;b=b.parentElement}},a.prototype.addVirtuals=function(a){var b,c,d;if(!this.virtuals)return this.virtuals=[].concat(a);for(c=0,d=a.length;d>c;c++)b=a[c],this.addVirtual(b);return null},a.prototype.addVirtual=function(a){return this.virtuals?(-1===this.virtuals.indexOf(a)&&this.virtuals.push(a),null):this.virtuals=[a]},a.prototype.hasVirtual=function(a){return this.virtuals?-1===this.virtuals.indexOf(a)?!1:!0:!1},a.prototype.nearestViewWithVirtual=function(a){var b;for(b=this;b;){if(b.hasVirtual(a))return b;b=b.parentElement}return null},a}(),d.byId={},d.recycled=[],d.count=0,d["new"]=function(a){var b,c,e;return b=a.el,c=a.id,d.count++,e=d.recycled.length>0?d.recycled.pop():new d,e.attach(b,c)},c.exports=d}),require.register("gss/lib/dom/Observer.js",function(a,b,c){var d,e,f,g=[].slice;d=function(){return GSS.deblog.apply(GSS,["Observer"].concat(g.call(arguments)))},e=null,GSS.is_observing=!1,GSS.observe=function(){return e&&!GSS.is_observing&&GSS.config.observe?(e.observe(document.body,GSS.config.observerOptions),GSS.is_observing=!0):void 0},GSS.unobserve=function(){return e?(e.disconnect(),GSS.is_observing=!1):void 0},GSS._unobservedElements=f=[],GSS.observeElement=function(a){return-1===f.indexOf(a)?f.push(a):void 0},GSS.unobserveElement=function(a){var b;return b=f.indexOf(a),b>-1?f.splice(b,1):void 0},GSS.setupObserver=function(){return window.MutationObserver||(window.MutationObserver=window.WebKitMutationObserver?window.WebKitMutationObserver:window.JsMutationObserver),window.MutationObserver?e=new MutationObserver(function(a){var b,c,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;for(d("MutationObserver",a),e=[],l=[],k=[],i=[],m=!1,r=0,v=a.length;v>r;r++)if(j=a[r],-1===f.indexOf(j.target)){if(m=!0,"characterData"===j.type){if(!j.target.parentElement)continue;p=j.target.parentElement.gssStyleSheet,p&&(p.reload(),b=p.engine,-1===e.indexOf(b)&&e.push(b))}("attributes"===j.type||"childList"===j.type)&&("attributes"===j.type&&"data-gss-id"===j.attributename?l.push(j.target):-1===l.indexOf(j.target)&&(o=GSS.get.nearestScope(j.target),o&&-1===k.indexOf(o)&&k.push(o))),g=null,("characterData"===j.type||"attributes"===j.type||"childList"===j.type)&&("characterData"===j.type?(q=j.target.parentElement,g=GSS.getId(j.target.parentElement)):-1===l.indexOf(j.target)&&(g=GSS.getId(j.target)),null!=g&&(g="$"+g,-1===i.indexOf(g)&&i.push(g)))}if(!m)return null;for(n=GSS.styleSheets.findAllRemoved(),s=0,w=n.length;w>s;s++)p=n[s],p.destroy(),b=p.engine,-1===e.indexOf(b)&&e.push(b);for(h=0,c=GSS.engines[h];c;)h>0&&c.scope&&(document.documentElement.contains(c.scope)||(c.destroyChildren(),c.destroy())),h++,c=GSS.engines[h];for(t=0,x=e.length;x>t;t++)b=e[t],b.is_destroyed||b.reset();for(u=0,y=k.length;y>u;u++)o=k[u],b=GSS.get.engine(o),b&&(b.is_destroyed||-1===e.indexOf(b)&&b.updateQueries());if(i.length>0)for(B=GSS.engines,A=0,z=B.length;z>A;A++)b=B[A],b.is_destroyed||b.commander.handleInvalidMeasures(i);return e=null,l=null,k=null,i=null,GSS.update()}):void 0},GSS.isDisplayed=!1,GSS.onDisplay=function(){return GSS.trigger("display"),GSS.isDisplayed?void 0:(GSS.isDisplayed=!0,GSS.config.readyClass?GSS._.defer(function(){return GSS.html.classList.add("gss-ready"),GSS.html.classList.remove("gss-not-ready")}):void 0)},document.addEventListener("DOMContentLoaded",function(){return GSS.boot()}),c.exports=e}),require.register("gss/lib/gssom/Node.js",function(){}),require.register("gss/lib/gssom/StyleSheet.js",function(a,b,c){var d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=GSS.Rule,e=function(a){function b(a){var c,d,e;null==a&&(a={}),b.__super__.constructor.apply(this,arguments);for(c in a)e=a[c],this[c]=e;if(!this.engine)throw new Error("StyleSheet needs engine");return this.engine.addStyleSheet(this),GSS.styleSheets.push(this),this.isRemote=!1,this.remoteSourceText=null,this.el&&(d=this.el.tagName,"LINK"===d&&(this.isRemote=!0)),this.rules=[],a.rules&&this.addRules(a.rules),this.loadIfNeeded(),this}return g(b,a),b.prototype.isScoped=!1,b.prototype.addRules=function(a){var b,c,d,e,f;for(this.setNeedsInstall(!0),f=[],d=0,e=a.length;e>d;d++)b=a[d],b.parent=this,b.styleSheet=this,b.engine=this.engine,c=new GSS.Rule(b),f.push(this.rules.push(c));return f},b.prototype.isLoading=!1,b.prototype.needsLoad=!0,b.prototype.reload=function(){return this.destroyRules(),this._load()},b.prototype.loadIfNeeded=function(){return this.needsLoad&&(this.needsLoad=!1,this._load()),this},b.prototype._load=function(){return this.isRemote?this._loadRemote():this.el?this._loadInline():void 0},b.prototype._loadInline=function(){return this.addRules(GSS.get.readAST(this.el))},b.prototype._loadRemote=function(){var a,b,c=this;return this.remoteSourceText?this.addRules(GSS.compile(this.remoteSourceText)):(b=this.el.getAttribute("href"))?(a=new XMLHttpRequest,a.onreadystatechange=function(){return 4===a.readyState&&200===a.status?(c.remoteSourceText=a.responseText.trim(),c.addRules(GSS.compile(c.remoteSourceText)),c.isLoading=!1,c.trigger("loaded")):void 0},this.isLoading=!0,a.open("GET",b,!0),a.send(null)):null},b.prototype.needsInstall=!1,b.prototype.setNeedsInstall=function(a){return a?(this.engine.setNeedsUpdate(!0),this.needsInstall=!0):this.needsInstall=!1},b.prototype.install=function(){return this.needsInstall?(this.setNeedsInstall(!1),this._install()):void 0},b.prototype.reinstall=function(){return this._install()},b.prototype._install=function(){var a,b,c,d,e;for(d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.install());return e},b.prototype.reset=function(){var a,b,c,d,e;for(this.setNeedsInstall(!0),d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.reset());return e},b.prototype.destroyRules=function(){var a,b,c,d;for(d=this.rules,b=0,c=d.length;c>b;b++)a=d[b],a.destroy();return this.rules=[]},b.prototype.destroy=function(){var a;return a=this.engine.styleSheets.indexOf(this),this.engine.styleSheets.splice(a,1),a=GSS.styleSheets.indexOf(this),GSS.styleSheets.splice(a,1)},b.prototype.isRemoved=function(){return!this.el||document.body.contains(this.el)||document.head.contains(this.el)?!1:!0},b.prototype.needsDumpCSS=!1,b.prototype.setNeedsDumpCSS=function(a){return a?(this.engine.setNeedsDumpCSS(!0),this.needsDumpCSS=!0):this.needsDumpCSS=!1},b.prototype.dumpCSSIfNeeded=function(){return this.needsDumpCSS?this.dumpCSS():void 0},b.prototype.dumpCSS=function(){var a,b,c,d,e,f;for(a="",f=this.rules,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSS(),c&&(a+=c);return a},b}(GSS.EventTrigger),e.fromNode=function(a){var b,c;return a.gssStyleSheet?a.gssStyleSheet:(b=GSS({scope:GSS.get.scopeForStyleNode(a)}),c=new GSS.StyleSheet({el:a,engine:b,engineId:b.id}),a.gssStyleSheet=c,c)},e.Collection=function(){function a(){var a,b,c;a=[];for(b in this)c=this[b],a[b]=c;return a}return a.prototype.install=function(){var a,b,c;for(b=0,c=this.length;c>b;b++)a=this[b],a.install();return this},a.prototype.find=function(){var a,b,c,d,e;for(b=document.querySelectorAll('[type="text/gss"], [type="text/gss-ast"]'),d=0,e=b.length;e>d;d++)a=b[d],c=GSS.StyleSheet.fromNode(a);return this},a.prototype.findAllRemoved=function(){var a,b,c,d;for(a=[],c=0,d=this.length;d>c;c++)b=this[c],b.isRemoved()&&a.push(b);return a},a}(),GSS.StyleSheet=e,GSS.styleSheets=new GSS.StyleSheet.Collection,c.exports=e}),require.register("gss/lib/gssom/Rule.js",function(a,b,c){var d,e;e=0,d=function(){function a(b){var c,d;e++,this.cid=e;for(c in b)d=b[c],this[c]=d;this.boundConditionals=[],("else"===this.name||"elseif"===this.name||"if"===this.name)&&(this.isConditional=!0),this.rules=[],b.rules&&this.addRules(b.rules),this.Type=a.types[this.type]||function(){throw new Error("Rule type, "+type+", not found")}()}return a.prototype.isRule=!0,a.prototype.addRules=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)b=a[d],b.parent=this,b.styleSheet=this.styleSheet,b.engine=this.engine,c=new GSS.Rule(b),f.push(this.rules.push(c));return f},a.prototype._selectorContext=null,a.prototype.needsInstall=!0,a.prototype.install=function(){var a,b,c,d;for(this.needsInstall&&(this.needsInstall=!1,this.Type.install.call(this)),d=this.rules,b=0,c=d.length;c>b;b++)a=d[b],a.install();return this},a.prototype.uninstall=function(){},a.prototype.reset=function(){var a,b,c,d,e;for(this.needsInstall=!0,this.boundConditionals=[],d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.reset());return e},a.prototype.destroy=function(){return this.rules=null,this.commands=null,this.engine=null,this.parent=null,this.styleSheet=null,this.boundConditionals=null},a.prototype.executeCommands=function(){return this.commands?this.engine.run(this):void 0 -},a.prototype.nextSibling=function(){var a;return a=this.parent.rules.indexOf(this),this.parent.rules[a+1]},a.prototype.prevSibling=function(){var a;return a=this.parent.rules.indexOf(this),this.parent.rules[a-1]},a.prototype.getSelectorContext=function(){return this._selectorContext||(this._selectorContext=this._computeSelectorContext()),this._selectorContext},a.prototype._computeSelectorContext=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;for(e=[],d=this;d.parent;){if(c=d.parent,!c.isConditional&&(null!=c&&null!=(m=c.selectors)?m.length:void 0)>0)if(0===e.length)for(n=c.selectors,g=0,j=n.length;j>g;g++)a=n[g],e.push(a);else{for(f=[],o=c.selectors,h=0,k=o.length;k>h;h++)for(a=o[h],i=0,l=e.length;l>i;i++)b=e[i],f.push(a+" "+b);e=f}d=c}return this.selectorContext=e,e},a.prototype.getContextQuery=function(){return this.query?this.query:this.setupContextQuery()},a.prototype.setupContextQuery=function(){var a,b;return a=this.getSelectorContext().join(", "),b=this.engine,this.query=b.registerDomQuery({selector:a,isMulti:!0,isLive:!1,createNodeList:function(){return b.queryScope.querySelectorAll(a)}})},a.prototype.gatherCondCommand=function(){var a,b,c;for(a=["cond"],b=this,c=!0;c;)a.push(b.getClauseCommand()),b=b.nextSibling(),c=null!=b?b.isConditional:void 0;return a},a.prototype.getClauseCommand=function(){return["clause",this.clause,this.getClauseTracker()]},a.prototype.getClauseTracker=function(){return"gss-cond-"+this.cid},a.prototype.injectChildrenCondtionals=function(a){var b,c,d,e,f,g,h,i,j;for(h=this.rules,j=[],d=0,f=h.length;f>d;d++){if(c=h[d],c.boundConditionals.push(a),c.commands)for(i=c.commands,e=0,g=i.length;g>e;e++)b=i[e],b.push(["where",a.getClauseTracker()]);c.isCondtionalBound=!0,j.push(c.injectChildrenCondtionals(a))}return j},a.prototype.setNeedsDumpCSS=function(a){return a?this.styleSheet.setNeedsDumpCSS(!0):void 0},a.prototype.dumpCSS=function(){var a;return a=this.Type.dumpCSS,a||(a=this.dumpChildrenCSS),a.call(this)},a.prototype.dumpChildrenCSS=function(){var a,b,c,d,e,f;for(a="",f=this.rules,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSS(),c&&(a+=c);return a},a}(),d.types={directive:{install:function(){return"else"===this.name||"elseif"===this.name?(this.injectChildrenCondtionals(this),this):"if"===this.name?(this.commands=[this.gatherCondCommand()],this.injectChildrenCondtionals(this),this.executeCommands()):this.executeCommands()},dumpCSS:function(){return""}},constraint:{install:function(){return this.executeCommands()},dumpCSS:function(){return""}},style:{install:function(){return this.setNeedsDumpCSS(!0)},dumpCSS:function(){return this.key+":"+this.val+";"}},ruleset:{install:function(){},dumpCSS:function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(c=!1,d=!1,a="",e="",g="",b=null,l=this.rules,j=0,k=l.length;k>j;j++)h=l[j],i=h.dumpCSS(),f=i[i.length-1],";"===f?(e+=i,d||(b=h.getSelectorContext().join(", "),d=!0)):"}"===f&&(g+=i,c=!0);return d&&(a=b+"{"+e+"}"),c&&(a+=g),a}}},c.exports=d}),require.register("gss/lib/Engine.js",function(a,b,c){var d,e,f,g,h,i,j=[].slice,k=function(a,b){return function(){return a.apply(b,arguments)}},l={}.hasOwnProperty,m=function(a,b){function c(){this.constructor=a}for(var d in b)l.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};if("undefined"==typeof GSS||null===GSS)throw new Error("GSS object needed for Engine");i=GSS._,f=function(){return GSS.config.perf?console.time.apply(console,arguments):void 0},g=function(){return GSS.config.perf?console.timeEnd.apply(console,arguments):void 0},e=function(){return GSS.deblog.apply(GSS,["Engine"].concat(j.call(arguments)))},GSS.engines=h=[],h.byId={},h.root=null,d=function(a){function b(a){null==a&&(a={}),this.dispatch=k(this.dispatch,this),this.updateQueries=k(this.updateQueries,this),this.handleWorkerMessage=k(this.handleWorkerMessage,this),this.reset=k(this.reset,this),b.__super__.constructor.apply(this,arguments),this.scope=a.scope,this.workerURL=a.workerURL,this.vars=a.vars,this.getter=a.getter,this.is_root=a.is_root,this.useWorker=a.useWorker,this.vars||(this.vars={}),this.clauses=null,GSS.config.useWorker?null==this.useWorker&&(this.useWorker=!0):this.useWorker=!1,this.worker=null,this.workerCommands=[],this.workerMessageHistory=[],this.workerURL||(this.workerURL=GSS.config.worker),this.scope?("HEAD"===this.scope.tagName&&(this.scope=document),this.id=GSS.setupScopeId(this.scope),this.queryScope=this.scope===GSS.Getter.getRootScope()?document:this.scope):(this.id=GSS.uid(),this.queryScope=document),this.getter||(this.getter=new GSS.Getter(this.scope)),this.commander=new GSS.Commander(this),this.lastWorkerCommands=null,this.cssDump=null,GSS.engines.push(this),h.byId[this.id]=this,this._Hierarchy_setup(),this._Queries_setup(),this._StyleSheets_setup(),e("constructor() @",this)}return m(b,a),b.prototype.getVarsById=function(a){var b;return GSS.config.processBeforeSet&&(a=GSS.config.processBeforeSet(a)),b=i.varsByViewId(i.filterVarsForDisplay(a))},b.prototype.getQueryScopeById=function(a){return a?GSS.getById(a):this.queryScope},b.prototype.isDescendantOf=function(a){var b;for(b=this.parentEngine;b;){if(b===a)return!0;b=b.parentEngine}return!1},b.prototype._Hierarchy_setup=function(){var a;if(this.childEngines=[],this.parentEngine=null,this.is_root?h.root=this:this.parentEngine=this.scope?GSS.get.nearestEngine(this.scope,!0):h.root,!this.parentEngine&&!this.is_root)throw new Error("ParentEngine missing, WTF");return null!=(a=this.parentEngine)?a.childEngines.push(this):void 0},b.prototype._Hierarchy_destroy=function(){return this.parentEngine.childEngines.splice(this.parentEngine.childEngines.indexOf(this),1),this.parentEngine=null},b.prototype.is_running=!1,b.prototype.run=function(a){var b,c,d,f;if(e(this.id,".run(asts)",a),a instanceof Array){for(f=[],c=0,d=a.length;d>c;c++)b=a[c],f.push(this._run(b));return f}return this._run(a)},b.prototype._run=function(a){return this.commander.execute(a)},b.prototype.load=function(){var a,b,c,d,e;if(!this.scope)throw new Error("can't load scopeless engine");for(this.is_running&&this.clean(),d=this.styleSheets,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.execute());return e},b.prototype.reset=function(){var a,b,c,d;if(e(this.id,".reset()"),!this.scope)throw new Error("can't reset scopeless engine");for(b=this.styleSheets,this.is_running&&this.clean(),this.styleSheets=b,c=0,d=b.length;d>c;c++)a=b[c],a.reset();return this.setNeedsUpdate(!0),this},b.prototype.registerCommands=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.registerCommand(b));return e},b.prototype.registerCommand=function(a){return this.workerCommands.push(a),this.setNeedsLayout(!0),this},b.prototype._StyleSheets_setup=function(){return this.styleSheets=[]},b.prototype.addStyleSheet=function(a){return this.setNeedsUpdate(!0),this.styleSheets.push(a)},b.prototype.needsUpdate=!1,b.prototype.setNeedsUpdate=function(a){return a?(GSS.setNeedsUpdate(!0),this.needsUpdate=!0):this.needsUpdate=!1},b.prototype.updateIfNeeded=function(){var a=this;return this.needsUpdate?(this._whenReadyForUpdate(function(){var b,c,d,e;for(e=a.styleSheets,c=0,d=e.length;d>c;c++)b=e[c],b.install();return a.updateChildrenIfNeeded()}),this.setNeedsUpdate(!1)):this.updateChildrenIfNeeded()},b.prototype._whenReadyForUpdate=function(a){var b,c,d,e,f,g=this;for(b=0,f=this.styleSheets,d=0,e=f.length;e>d;d++)c=f[d],c.isLoading&&(b++,c.once("loaded",function(){return b--,0===b?a.call(g):void 0}));return 0===b&&a.call(this),this},b.prototype.updateChildrenIfNeeded=function(){var a,b,c,d,e;for(d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.updateIfNeeded());return e},b.prototype.needsLayout=!1,b.prototype.setNeedsLayout=function(a){return a?this.needsLayout?void 0:(GSS.setNeedsLayout(!0),this.needsLayout=!0):this.needsLayout=!1},b.prototype._beforeLayoutCalls=null,b.prototype.layout=function(){return this.hoistedTrigger("beforeLayout",this),this.is_running=!0,f(""+this.id+" LAYOUT & DISPLAY"),this.dumpCSSIfNeeded(),this.solve(),this.setNeedsLayout(!1)},b.prototype.layoutIfNeeded=function(){return this.needsLayout&&this.layout(),this.layoutSubTreeIfNeeded()},b.prototype.waitingToLayoutSubtree=!1,b.prototype.layoutSubTreeIfNeeded=function(){var a,b,c,d,e;for(this.waitingToLayoutSubtree=!1,d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.layoutIfNeeded());return e},b.prototype.needsDisplay=!1,b.prototype.setNeedsDisplay=function(a){return a?(GSS.setNeedsDisplay(!0),this.needsDisplay=!0):this.needsDisplay=!1},b.prototype.display=function(a,b){var c,d,f,h,i,j,k;null==b&&(b=!1),i=a.values,e(this.id,".display()"),this.hoistedTrigger("beforeDisplay",this),GSS.unobserve(),j=this.getVarsById(i),f=!1;for(d in j)h=j[d],f=!0,b&&(c=document.getElementById(d),c&&GSS.setupId(c)),null!=(k=GSS.View.byId[d])&&"function"==typeof k.updateValues&&k.updateValues(h);return a.clauses&&this.updateClauses(a.clauses),f&&this.scope&&GSS.get.view(this.scope).displayIfNeeded(),!this.isMeasuring&&this.needsMeasure?(this.measureIfNeeded(),this.needsLayout||this._didDisplay()):this._didDisplay(),GSS.observe(),this.dispatchedTrigger("solved",{values:i}),g(""+this.id+" LAYOUT & DISPLAY"),this},b.prototype._didDisplay=function(){return this.trigger("display"),GSS.onDisplay(),this.isMeasuring=!1},b.prototype.forceDisplay=function(){},b.prototype.updateClauses=function(a){var b,c,d,e,f,g,h,i,j,k;if(c=GSS.html,e=this.clauses,d=a,e){for(f=0,i=e.length;i>f;f++)b=e[f],-1===d.indexOf(b)&&c.classList.remove(b);for(g=0,j=d.length;j>g;g++)b=d[g],-1===e.indexOf(b)&&c.classList.add(b)}else for(h=0,k=d.length;k>h;h++)b=d[h],c.classList.add(b);return this.clauses=d},b.prototype.isMeasuring=!1,b.prototype.needsMeasure=!1,b.prototype.setNeedsMeasure=function(a){return this.needsMeasure=a?!0:!1},b.prototype.measureIfNeeded=function(){return this.needsMeasure?(this.isMeasuring=!0,this.needsMeasure=!1,this.measure()):void 0},b.prototype.measure=function(){return this.commander.validateMeasures()},b.prototype.measureByGssId=function(a,b){var c,d;return c=GSS.getById(a),d=this.getter.measure(c,b),e(this.id,".measureByGssId()",a,b,d),d},b.prototype.solve=function(){return this.useWorker?this.solveWithWorker():this.solveWithoutWorker()},b.prototype.solveWithWorker=function(){var a;return e(this.id,".solveWithWorker()",this.workerCommands),a={commands:this.workerCommands},this.workerMessageHistory.push(a),this.worker||(this.worker=new Worker(this.workerURL),this.worker.addEventListener("message",this.handleWorkerMessage,!1),this.worker.addEventListener("error",this.handleError,!1),a.config={defaultStrength:GSS.config.defaultStrength,defaultWeight:GSS.config.defaultWeight}),this.worker.postMessage(a),this.lastWorkerCommands=this.workerCommands,this.workerCommands=[]},b.prototype.solveWithoutWorker=function(){var a,b=this;return e(this.id,".solveWithoutWorker()",this.workerCommands),a={commands:this.workerCommands},this.workerMessageHistory.push(a),this.worker||(this.worker=new GSS.Thread({defaultStrength:GSS.config.defaultStrength,defaultWeight:GSS.config.defaultWeight})),this.worker.postMessage(i.cloneDeep(a)),i.defer(function(){return b.worker?b.handleWorkerMessage({data:b.worker.output()}):void 0}),this.lastWorkerCommands=this.workerCommands,this.workerCommands=[]},b.prototype.handleWorkerMessage=function(a){return e(this.id,".handleWorkerMessage()",this.workerCommands),this.vars=a.data.values,this.display(a.data)},b.prototype.handleError=function(a){if(this.onError)return this.onError(a);throw new Error(""+a.message+" ("+a.filename+":"+a.lineno+")")},b.prototype._Worker_destroy=function(){return this.worker&&(this.worker.terminate(),this.worker=null),this.workerCommands=null,this.workerMessageHistory=null,this.lastWorkerCommands=null},b.prototype._Worker_clean=function(){return this.workerCommands=[],this.lastWorkerCommands=null,this.worker?(this.worker.terminate(),this.worker=null):void 0},b.prototype._Queries_setup=function(){var a=this;return this.querySet=new GSS.Query.Set,this.querySet.on("update",function(b){return a.commander.handleRemoves(b.removes),a.commander.handleSelectorsWithAdds(b.selectorsWithAdds)})},b.prototype.getDomQuery=function(a){return this.querySet.bySelector[a]},b.prototype.registerDomQuery=function(a){return this.querySet.add(a)},b.prototype.unregisterDomQuery=function(a){return this.querySet.remove(a)},b.prototype.updateQueries=function(){return this.querySet.update()},b.prototype._Queries_destroy=function(){return this.querySet.destroy()},b.prototype._Queries_clean=function(){return this.querySet.clean()},b.prototype.hoistedTrigger=function(a,b){return this.trigger(a,b),GSS.trigger("engine:"+a,b)},b.prototype.dispatchedTrigger=function(a,b,c,d){return this.trigger(a,b),this.dispatch(a,b,c,d)},b.prototype.dispatch=function(a,b,c,d){var e,f;return null==b&&(b={}),null==c&&(c=!0),null==d&&(d=!0),this.scope?(b.engine=this,f={detail:b,bubbles:c,cancelable:d},e=new CustomEvent(a,f),this.scope.dispatchEvent(e)):void 0},b.prototype.cssToDump=null,b.prototype.cssDump=null,b.prototype.setupCSSDumpIfNeeded=function(){var a;return a=this.scope||document.body,this.cssDump?void 0:(this.cssDump=document.createElement("style"),this.cssDump.id="gss-css-dump-"+this.id,a.appendChild(this.cssDump))},b.prototype.needsDumpCSS=!1,b.prototype.setNeedsDumpCSS=function(a){return a?(this.setNeedsLayout(!0),this.needsDumpCSS=!0):this.needsDumpCSS=!1},b.prototype.dumpCSSIfNeeded=function(){var a,b,c,d,e,f;if(this.needsDumpCSS){for(this.needsDumpCSS=!1,this.setupCSSDumpIfNeeded(),a="",f=this.styleSheets,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSSIfNeeded(),c&&(a+=c);if(a.length>0)return this.cssDump.innerHTML=a}},b.prototype._CSSDumper_clean=function(){var a;return null!=(a=this.cssDump)?a.innerHTML="":void 0},b.prototype._CSSDumper_destroy=function(){return this.needsDumpCSS=!1,this.cssDump=null},b.prototype.clean=function(){var a,b,c,d;e(this.id,".clean()"),d=this.vars;for(a in d)b=d[a],delete this.vars[a];return this.setNeedsLayout(!1),this.setNeedsDisplay(!1),this.setNeedsLayout(!1),this.setNeedsMeasure(!1),this.isMeasuring=!1,this.waitingToLayoutSubtree=!1,this.commander.clean(),"function"==typeof(c=this.getter).clean&&c.clean(),this._CSSDumper_clean(),this._Worker_clean(),this._Queries_clean(),this},b.prototype.is_destroyed=!1,b.prototype.destroyChildren=function(){var a,b,c,d,e;for(d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.is_destroyed?void 0:a.destroy());return e},b.prototype.destroy=function(){var a,b,c,d,f,g,i;if(e(this.id,".destroy()"),this.hoistedTrigger("beforeDestroy",this),GSS._ids_killed([this.id]),this.scope)for(b=GSS.get.descdendantNodes(this.scope),g=0,i=b.length;i>g;g++)a=b[g],d=a._gss_id,d&&GSS._id_killed(d);return c=h.indexOf(this),c>-1&&h.splice(c,1),delete h.byId[this.id],this.offAll(),this.setNeedsLayout(!1),this.setNeedsDisplay(!1),this.setNeedsLayout(!1),this.waitingToLayoutSubtree=!1,this.commander.destroy(),"function"==typeof(f=this.getter).destroy&&f.destroy(),this.vars=null,this.clauses=null,this.ast=null,this.getter=null,this.scope=null,this.commander=null,this._Hierarchy_destroy(),this._CSSDumper_destroy(),this._Worker_destroy(),this._Queries_destroy(),this.is_running=null,this.is_destroyed=!0,this},b.prototype.elVar=function(a,b,c,d){var e,f,g;return f="$"+GSS.getId(a),"left"===b?b="x":"top"===b&&(b="y"),g=f+("["+b+"]"),e=["get$",b,f,c],d&&e.push(d),e},b.prototype["var"]=function(a){return["get",a]},b.prototype.varexp=function(a){return["get",a]},b.prototype.__e=function(a){return a instanceof Array?a:Number(a)||0===Number(a)?["number",a]:this["var"](a)},b.prototype._addconstraint=function(a,b,c,d,e,f){var g,h,i,j;if(b=this.__e(b),c=this.__e(c),g=["eq",b,c],d&&g.push(d),e&&g.push(e),f)for(i=0,j=f.length;j>i;i++)h=f[i],g.push(h);return this.registerCommand(g)},b.prototype.eq=function(a,b,c,d,e){return this._addconstraint("eq",a,b,c,d,e)},b.prototype.lte=function(a,b,c,d,e){return this._addconstraint("lte",a,b,c,d,e)},b.prototype.gte=function(a,b,c,d,e){return this._addconstraint("gte",a,b,c,d,e)},b.prototype.suggest=function(a,b,c){return null==c&&(c="required"),a=this.__e(a),this.registerCommand(["suggest",a,["number",b],c])},b.prototype.stay=function(a){return a=this.__e(a),this.registerCommand(["stay",a])},b.prototype.remove=function(a){return this.registerCommand(["remove",a])},b.prototype.number=function(a){return["number",a]},b.prototype.plus=function(a,b){return a=this.__e(a),b=this.__e(b),["plus",a,b]},b.prototype.minus=function(a,b){return a=this.__e(a),b=this.__e(b),["minus",a,b]},b.prototype.multiply=function(a,b){return a=this.__e(a),b=this.__e(b),["multiply",a,b]},b.prototype.divide=function(a,b){return a=this.__e(a),b=this.__e(b),["divide",a,b]},b}(GSS.EventTrigger),c.exports=d}),require.register("gss/lib/Commander.js",function(exports,require,module){var Commander,bindRoot,bindRootAsContext,bindRootAsMulti,unbindRoot,__bind=function(a,b){return function(){return a.apply(b,arguments)}},__slice=[].slice;bindRoot=function(a,b){return a.isQueryBound=!0,a.queries?-1===a.queries.indexOf(b)&&a.queries.push(b):a.queries=[b],a},unbindRoot=function(a,b){var c;if(a.queries)return c=a.queries.indexOf(b),-1!==c&&a.queries.splice(c,1),a.queries.length||(a.isQueryBound=null),a},bindRootAsMulti=function(a,b){return bindRoot(a,b),a},bindRootAsContext=function(a,b){return bindRoot(a,b),a.isContextBound=!0},Commander=function(){function Commander(a){this.engine=a,this.js=__bind(this.js,this),this["for-all"]=__bind(this["for-all"],this),this["for-each"]=__bind(this["for-each"],this),this._e_for_chain=__bind(this._e_for_chain,this),this._chainer_math=__bind(this._chainer_math,this),this["divide-chain"]=__bind(this["divide-chain"],this),this["multiply-chain"]=__bind(this["multiply-chain"],this),this["minus-chain"]=__bind(this["minus-chain"],this),this["plus-chain"]=__bind(this["plus-chain"],this),this._chainer=__bind(this._chainer,this),this["gt-chain"]=__bind(this["gt-chain"],this),this["lt-chain"]=__bind(this["lt-chain"],this),this["gte-chain"]=__bind(this["gte-chain"],this),this["lte-chain"]=__bind(this["lte-chain"],this),this["eq-chain"]=__bind(this["eq-chain"],this),this.chain=__bind(this.chain,this),this.$reserved=__bind(this.$reserved,this),this.$id=__bind(this.$id,this),this.$all=__bind(this.$all,this),this.$tag=__bind(this.$tag,this),this.$class=__bind(this.$class,this),this.$virtual=__bind(this.$virtual,this),this.virtual=__bind(this.virtual,this),this.stay=__bind(this.stay,this),this.gt=__bind(this.gt,this),this.lt=__bind(this.lt,this),this.gte=__bind(this.gte,this),this.lte=__bind(this.lte,this),this.eq=__bind(this.eq,this),this.suggest=__bind(this.suggest,this),this.strength=__bind(this.strength,this),this["||"]=__bind(this["||"],this),this["&&"]=__bind(this["&&"],this),this["?<"]=__bind(this["?<"],this),this["?>"]=__bind(this["?>"],this),this["?!="]=__bind(this["?!="],this),this["?=="]=__bind(this["?=="],this),this["?<="]=__bind(this["?<="],this),this["?>="]=__bind(this["?>="],this),this.clause=__bind(this.clause,this),this.where=__bind(this.where,this),this.cond=__bind(this.cond,this),this.divide=__bind(this.divide,this),this.multiply=__bind(this.multiply,this),this.minus=__bind(this.minus,this),this.plus=__bind(this.plus,this),this._get$=__bind(this._get$,this),this.get$=__bind(this.get$,this),this.get=__bind(this.get,this),this.makeCommandScopedToParentRule=__bind(this.makeCommandScopedToParentRule,this),this.spawnForWindowSize=__bind(this.spawnForWindowSize,this),this._execute=__bind(this._execute,this),this.lazySpawnForWindowSize=GSS._.debounce(this.spawnForWindowSize,GSS.config.resizeDebounce,!1),this.cleanVars()}return Commander.prototype.clean=function(){return this.cleanVars(),this.unlisten()},Commander.prototype.cleanVars=function(){return this.spawnableRoots=[],this.intrinsicRegistersById={},this.boundWindowProps=[],this.get$cache={},this.queryCommandCache={}},Commander.prototype.destroy=function(){return this.spawnableRoots=null,this.intrinsicRegistersById=null,this.boundWindowProps=null,this.get$cache=null,this.queryCommandCache=null,this.unlisten()},Commander.prototype.execute=function(a){var b,c,d,e,f;if(null!=a.commands){for(e=a.commands,f=[],c=0,d=e.length;d>c;c++)b=e[c],a.isRule&&(b.parentRule=a),f.push(this._execute(b,b));return f}},Commander.prototype._execute=function(a,b){var c,d,e,f,g,h,i;if(e=a,c=this[e[0]],null==c)throw new Error("Engine Commands broke, couldn't find method: "+e[0]);for(i=e.slice(1,+e.length+1||9e9),d=g=0,h=i.length;h>g;d=++g)f=i[d],f instanceof Array&&e.splice(d+1,1,this._execute(f,b));return c.call.apply(c,[this.engine,b].concat(__slice.call(e.slice(1,e.length))))},Commander.prototype.unlisten=function(){return this._bound_to_window_resize||window.removeEventListener("resize",this.lazySpawnForWindowSize,!1),this._bound_to_window_resize=!1},Commander.prototype._bound_to_window_resize=!1,Commander.prototype.spawnForWindowWidth=function(){var a;return a=window.innerWidth,GSS.config.verticalScroll&&(a-=GSS.get.scrollbarWidth()),this.engine.vars["::window[width]"]!==a?this.engine.registerCommand(["suggest",["get","::window[width]"],["number",a],"required"]):void 0},Commander.prototype.spawnForWindowHeight=function(){var a;return a=window.innerHeight,GSS.config.horizontalScroll&&(a-=GSS.get.scrollbarWidth()),this.engine.vars["::window[height]"]!==a?this.engine.registerCommand(["suggest",["get","::window[height]"],["number",a],"required"]):void 0},Commander.prototype.spawnForWindowSize=function(){return this._bound_to_window_resize?(-1!==this.boundWindowProps.indexOf("width")&&this.spawnForWindowWidth(),-1!==this.boundWindowProps.indexOf("height")&&this.spawnForWindowHeight(),this.engine.solve()):void 0},Commander.prototype.bindToWindow=function(a){if("center-x"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[center-x]"],["divide",["get","::window[width]"],2],"required"]),null;if("right"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[right]"],["get","::window[width]"],"required"]),null;if("center-y"===a)return this.bindToWindow("height"),this.engine.registerCommand(["eq",["get","::window[center-y]"],["divide",["get","::window[height]"],2],"required"]),null;if("bottom"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[bottom]"],["get","::window[height]"],"required"]),null;if(-1===this.boundWindowProps.indexOf(a)&&this.boundWindowProps.push(a),"width"===a||"height"===a){if("width"===a?this.spawnForWindowWidth():this.spawnForWindowHeight(),!this._bound_to_window_resize)return window.addEventListener("resize",this.lazySpawnForWindowSize,!1),this._bound_to_window_resize=!0}else{if("x"===a)return this.engine.registerCommand(["eq",["get","::window[x]"],["number",0],"required"]);if("y"===a)return this.engine.registerCommand(["eq",["get","::window[y]"],["number",0],"required"])}},Commander.prototype.spawnForScope=function(a){var b,c;return b="$"+this.engine.id+("["+a+"]"),c=this.engine,GSS.on("engine:beforeDisplay",function(a){var d;return d=a.vars[b],null!=d&&c.isDescendantOf(a)?c.registerCommand(["suggest",["get",b],["number",d],"required"]):void 0})},Commander.prototype.bindToScope=function(a){return this.spawnForScope(a)},Commander.prototype.handleRemoves=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;if(a.length<1)return this;if(q=this.trackersById)for(h=0,l=a.length;l>h;h++)if(g=a[h],f=q[g]){for(i=0,m=f.length;m>i;i++)e=f[i],-1===a.indexOf(e)&&a.push(e);delete q[g]}for(p=this.subqueriesByTracker,j=0,n=a.length;n>j;j++)if(g=a[j],delete this.intrinsicRegistersById[g],p&&(c=p[g])){for(k=0,o=c.length;o>k;k++)d=c[k],b=d.query,-1===a.indexOf(b.selector)&&a.push(b.selector),delete this.queryCommandCache[b.selector],this.engine.unregisterDomQuery(b),unbindRoot(d.root,b);delete p[g]}return this.engine.registerCommand(["remove"].concat(__slice.call(a))),this},Commander.prototype.handleSelectorsWithAdds=function(a){var b,c,d,e,f,g,h,i;if(a.length<1)return this;for(h=this.spawnableRoots,d=0,f=h.length;f>d;d++)for(c=h[d],i=c.queries,e=0,g=i.length;g>e;e++)b=i[e],-1!==a.indexOf(b.selector)&&this.spawn(c,b);return this},Commander.prototype.validateMeasures=function(){var a,b;b=[];for(a in this.intrinsicRegistersById)b.push(a);return this.handleInvalidMeasures(b)},Commander.prototype.handleInvalidMeasures=function(a){var b,c,d,e,f,g;if(a.length<1)return this;for(f=0,g=a.length;g>f;f++)if(b=a[f],e=this.intrinsicRegistersById[b])for(c in e)d=e[c],d.call(this);return this},Commander.prototype.bindRootSubselector=function(a,b,c){var d=this;return a.subselector=c,a.spawn=function(e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u;for(i="$"+(g||e),p=b.query.selector+i,o=b.selector+" "+c+i,j=d.$all(a,c,e,o),j.root=a,n=(r=d.trackersById||(d.trackersById={}))[i]||(r[i]=[]),-1===n.indexOf(p)&&n.push(p),q=(s=d.subqueriesByTracker||(d.subqueriesByTracker={}))[p]||(s[p]=[]),-1===q.indexOf(j)&&q.push(j),m=[],l=h===j.query?j.query.lastAddedIds:j.query.ids,t=0,u=l.length;u>t;t++)k=l[t],m.push.apply(m,d.expandSpawnable([f],!1,k,o,"do_not_recurse"));return m.length?(m.isPlural=!0,m):void 0}},Commander.prototype.registerSpawn=function(a){var b,c,d,e;if(a.isQueryBound)return this.spawnableRoots.push(a),this.spawn(a);for(b=[],d=0,e=a.length;e>d;d++)c=a[d],b.push(c);return this.engine.registerCommand(b)},Commander.prototype.spawn=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;for(f=a.queries,g=!0,i=0,k=f.length;k>i;i++)if(e=f[i],(!b||b===e)&&e.lastAddedIds.length<=0){g=!1;break}if(g){if(h=a.parentRule,a.isContextBound){for(d=b||h.getContextQuery(),m=d.lastAddedIds,n=[],j=0,l=m.length;l>j;j++)c=m[j],n.push(this.engine.registerCommands(this.expandSpawnable(a,!0,c,null,b)));return n}return this.engine.registerCommands(this.expandSpawnable(a,!0,null,null,b))}},Commander.prototype.expandSpawnable=function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;for(j=[],f=[],g=!1,p={},m=null,o=0,q=null,h=r=0,u=a.length;u>r;h=++r)l=a[h],l&&(null!=l.spawn?(k=l.spawn(c,d,e))&&(j.push(k),(l.isPlural||k.isPlural)&&(g?k.length!==o&&(GSS.warn("GSS: trying to constrain 2 plural selectors ('"+q+"' & '"+l.query.selector+"') with different number of matching elements"),k.length=0?o>s:s>o;i=o>=0?++s:--s){for(n=[],h=t=0,v=j.length;v>t;h=++t)l=j[h],n.push(p[h]?p[h][i]:l);f.push(n)}return f}return b?[j]:j},Commander.prototype.makeNonRootSpawnableIfNeeded=function(a){var b,c,d,e,f,g=this;for(b=!1,e=0,f=a.length;f>e;e++)d=a[e],d&&null!=d.spawn&&(c=!0,d.isPlural&&(b=!0));return c?{isPlural:b,spawn:function(b){return g.expandSpawnable(a,!1,b)}}:a},Commander.prototype.makeCommandScopedToParentRule=function(){},Commander.prototype.get=function(a,b,c){var d;return d=["get",b],c&&d.push(c),d},Commander.prototype.get$=function(a,b,c){var d,e;return d=c.selectorKey,d||(d=c.selector),d+=b,e=this.get$cache[d],e||(e=this._get$(a,b,c),this.get$cache[d]=e),e},Commander.prototype._get$=function(a,b,c){var d,e,f,g,h,i,j=this;return h=c.query,i=c.selector,"window"===i?(this.bindToWindow(b),["get","::window["+b+"]"]):(f=h.isMulti,e=c.isContextBound,g=c.isScopeBound,g&&this.bindToScope(b),0===b.indexOf("intrinsic-")&&(h.on("afterChange",function(){return j._processIntrinsics(h,i,b)}),this._processIntrinsics(h,i,b)),e?(d=c.idProcessor,{isQueryBound:!0,isPlural:a.isPlural||!1,query:h,spawn:function(c,e,f){var g;if(f&&f!==h)e||(e=(f||h).selector);else if(d&&(g=c,c=d(c)),a.spawn)return a.spawn(c,this,g,f);return["get$",b,"$"+c,e||i]}}):{isQueryBound:!0,isPlural:f,query:h,spawn:function(){var a,c,d,e,g;if(!f)return a=h.lastAddedIds[h.lastAddedIds.length-1],["get$",b,"$"+a,i];for(c=[],g=h.lastAddedIds,d=0,e=g.length;e>d;d++)a=g[d],c.push(["get$",b,"$"+a,i]);return c}})},Commander.prototype._processIntrinsics=function(a,b,c){var d=this;return a.lastAddedIds.forEach(function(a){var e,f,g,h,i;return g="$"+a,d.intrinsicRegistersById[g]||(d.intrinsicRegistersById[g]={}),d.intrinsicRegistersById[g][c]?void 0:(e=c.split("intrinsic-")[1],h=""+g+"["+c+"]",f=d.engine,i=function(){var d;return d=f.measureByGssId(a,e),f.vars[h]!==d&&f.registerCommand(["suggest",["get$",c,g,b],["number",d],"required"]),f.setNeedsMeasure(!0)},d.intrinsicRegistersById[g][c]=i,i.call(d))})},Commander.prototype.number=function(a,b){return["number",b]},Commander.prototype.plus=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["plus",b,c])},Commander.prototype.minus=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["minus",b,c])},Commander.prototype.multiply=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["multiply",b,c])},Commander.prototype.divide=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["divide",b,c])},Commander.prototype.cond=function(a){return this.registerSpawn(a)},Commander.prototype.where=function(a,b){var c;return c=a.isContextBound?["where",b,{spawn:function(a){return"-context-"+a}}]:["where",b],this.makeNonRootSpawnableIfNeeded(c)},Commander.prototype.clause=function(a,b,c){var d;return d=a.isContextBound?["clause",b,{spawn:function(a){return a?c+"-context-"+a:c}}]:["clause",b,c],this.makeNonRootSpawnableIfNeeded(d)},Commander.prototype["?>="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?>=",b,c])},Commander.prototype["?<="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?<=",b,c])},Commander.prototype["?=="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?==",b,c])},Commander.prototype["?!="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?!=",b,c])},Commander.prototype["?>"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?>",b,c])},Commander.prototype["?<"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?<",b,c])},Commander.prototype["&&"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["&&",b,c])},Commander.prototype["||"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["||",b,c])},Commander.prototype.strength=function(a,b){return["strength",b]},Commander.prototype.suggest=function(){var a;return a=__slice.call(arguments),this.engine.registerCommand(["suggest"].concat(__slice.call(a.slice(1,a.length))))},Commander.prototype.eq=function(a){return this.registerSpawn(a)},Commander.prototype.lte=function(a){return this.registerSpawn(a)},Commander.prototype.gte=function(a){return this.registerSpawn(a)},Commander.prototype.lt=function(a){return this.registerSpawn(a)},Commander.prototype.gt=function(a){return this.registerSpawn(a)},Commander.prototype.stay=function(a){return this.registerSpawn(a)},Commander.prototype.virtual=function(){},Commander.prototype.$virtual=function(a,b){var c,d,e,f,g;if(d=a.parentRule,!d)throw new'Error virtual element "#{name}" requires parent rule for context';return e=d.getContextQuery(),f=e.selector,g=e.selector+(" ::virtual("+b+")"),c=this.queryCommandCache[g],c||(c={query:e,selector:f,selectorKey:g,isContextBound:!0,idProcessor:function(a){return a+'"'+b+'"'}},this.queryCommandCache[g]=c),bindRootAsContext(a,e),c},Commander.prototype.$class=function(a,b,c){var d,e,f,g=this;return f="."+b,d=this.queryCommandCache[f],d||(e=this.engine.registerDomQuery({selector:f,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).getElementsByClassName(b)}}),d={query:e,selector:f},this.queryCommandCache[f]=d),bindRootAsMulti(a,d.query),d},Commander.prototype.$tag=function(a,b,c){var d,e,f,g=this;return f=b,d=this.queryCommandCache[f],d||(e=this.engine.registerDomQuery({selector:f,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).getElementsByTagName(b)}}),d={query:e,selector:f},this.queryCommandCache[f]=d),bindRootAsMulti(a,d.query),d},Commander.prototype.$all=function(a,b,c,d){var e,f,g=this;return d||(d=b),e=this.queryCommandCache[d],e||(f=this.engine.registerDomQuery({selector:d,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).querySelectorAll(b) +if(e=M,/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]")),null!==c)for(a=[];null!==c;)a.push(c),/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]"));else a=null;return null!==a&&(a=function(a,b){return parseInt(b.join(""))}(e,a)),null===a&&(M=e),a}function v(){var a,c,e,f,g;return f=M,g=M,a=u(),null!==a?(46===b.charCodeAt(M)?(c=".",M++):(c=null,0===N&&d('"."')),null!==c?(e=u(),null!==e?a=[a,c,e]:(a=null,M=g)):(a=null,M=g)):(a=null,M=g),null!==a&&(a=function(a,b){return parseFloat(b.join(""))}(f,a)),null===a&&(M=f),a}function w(){var a,c,e,f;if(f=M,/^[\-+]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\-+]")),a=null!==a?a:"",null!==a){if(/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]")),null!==e)for(c=[];null!==e;)c.push(e),/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]"));else c=null;null!==c?a=[a,c]:(a=null,M=f)}else a=null,M=f;return a}function x(){var a,b;return N++,b=M,a=y(),null!==a&&(a=function(a,b){return b}(b,a)),null===a&&(M=b),N--,0===N&&null===a&&d("identifier"),a}function y(){var a,b,c,e,f;if(N++,e=M,f=M,a=h(),null!==a){for(b=[],c=h();null!==c;)b.push(c),c=h();null!==b?a=[a,b]:(a=null,M=f)}else a=null,M=f;return null!==a&&(a=function(a,b,c){return b+c.join("")}(e,a[0],a[1])),null===a&&(M=e),N--,0===N&&null===a&&d("identifier"),a}function z(){var a,c,e,f,g,h,i;return h=M,a=x(),null!==a&&(a=function(a,b){return{type:"Variable",name:b}}(h,a)),null===a&&(M=h),null===a&&(a=t(),null===a&&(h=M,i=M,40===b.charCodeAt(M)?(a="(",M++):(a=null,0===N&&d('"("')),null!==a?(c=s(),null!==c?(e=I(),null!==e?(f=s(),null!==f?(41===b.charCodeAt(M)?(g=")",M++):(g=null,0===N&&d('")"')),null!==g?a=[a,c,e,f,g]:(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i),null!==a&&(a=function(a,b){return b}(h,a[2])),null===a&&(M=h))),a}function A(){var a,b,c,d,e;return a=z(),null===a&&(d=M,e=M,a=B(),null!==a?(b=s(),null!==b?(c=A(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)):(a=null,M=e),null!==a&&(a=function(a,b,c){return{type:"UnaryExpression",operator:b,expression:c}}(d,a[0],a[2])),null===a&&(M=d)),a}function B(){var a;return 43===b.charCodeAt(M)?(a="+",M++):(a=null,0===N&&d('"+"')),null===a&&(45===b.charCodeAt(M)?(a="-",M++):(a=null,0===N&&d('"-"')),null===a&&(33===b.charCodeAt(M)?(a="!",M++):(a=null,0===N&&d('"!"')))),a}function C(){var a,b,c,d,e,f,g,h,i;if(g=M,h=M,a=A(),null!==a){for(b=[],i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==c;)b.push(c),i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==b?a=[a,b]:(a=null,M=h)}else a=null,M=h;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;e="===b.substr(M,2)?(a=">=",M+=2):(a=null,0===N&&d('">="')),null===a&&(60===b.charCodeAt(M)?(a="<",M++):(a=null,0===N&&d('"<"')),null===a&&(62===b.charCodeAt(M)?(a=">",M++):(a=null,0===N&&d('">"'))))),a}function I(){var a,c,e,f,g,h,i,j,k;if(i=M,j=M,a=G(),null!==a){for(c=[],k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==e;)c.push(e),k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==c?a=[a,c]:(a=null,M=j)}else a=null,M=j;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;ec;c++)if(b=a[c],"undefined"!=typeof i.style[b])return b;return null},f=String.prototype.trim,h=String.prototype.trimRight,g=String.prototype.trimLeft,j={transformPrefix:d(["transform","WebkitTransform","MozTransform","OTransform","msTransform"]),boxSizingPrefix:d(["boxSizing","WebkitBoxSizing","MozBoxSizing","OBoxSizing","msBoxSizing"]),defer:function(a){return setTimeout(a,1)},debounce:function(a,b,c){var d,f,g,h,i;return h=void 0,d=void 0,f=void 0,i=void 0,g=void 0,function(){var j,l;return f=this,d=k.call(arguments),i=e(),l=function(){var j;return j=e()-i,b>j?h=setTimeout(l,b-j):(h=null,c?void 0:g=a.apply(f,d))},j=c&&!h,h||(h=setTimeout(l,b)),j&&(g=a.apply(f,d)),g}},cloneDeep:function(a){return JSON.parse(JSON.stringify(a))},cloneObject:function(a){var b,c;c={};for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c},filterVarsForDisplay:function(a){var b,c,d,e,f,g,h,i;f={},e=[];for(d in a)g=a[d],b=d.indexOf("intrinsic-"),-1!==b?e.push(d.replace("intrinsic-","")):f[d]=g;for(h=0,i=e.length;i>h;h++)c=e[h],delete f[c];return f},varsByViewId:function(a){var b,c,d,e,f;f={};for(c in a)e=a[c],"$"===c[0]&&(b=c.substring(1,c.indexOf("[")),f[b]||(f[b]={}),d=c.substring(c.indexOf("[")+1,c.indexOf("]")),f[b][d]=e);return f},mat4ToCSS:function(a){return"matrix3d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"},mat2dToCSS:function(a){return"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"},camelize:function(a){var b;return b=a.replace(/[-_\s]+(.)?/g,function(a,b){return b?b.toUpperCase():""})},dasherize:function(a){return this.trim(a).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},trim:function(a,b){return null==a?"":!b&&f?f.call(a):(b=defaultToWhiteSpace(b),String(a).replace(new RegExp("^"+b+"+|"+b+"+$","g"),""))}},c.exports=j}),require.register("gss/lib/EventTrigger.js",function(a,b,c){var d;d=function(){function a(){this._listenersByType={}}return a.prototype._getListeners=function(a){var b;return this._listenersByType[a]?b=this._listenersByType[a]:(b=[],this._listenersByType[a]=b),b},a.prototype.on=function(a,b){var c;return c=this._getListeners(a),-1===c.indexOf(b)&&c.push(b),this},a.prototype.once=function(a,b){var c,d;return d=null,c=this,d=function(e){return c.off(a,d),b.call(c,e)},this.on(a,d),this},a.prototype.off=function(a,b){var c,d;return d=this._getListeners(a),c=d.indexOf(b),-1!==c&&d.splice(c,1),this},a.prototype.offAll=function(a){var b,c,d,e;if("string"==typeof a)a&&(this._listenersByType[a]=[]);else if("function"==typeof a){e=this._listenersByType;for(d in e)c=e[d],b=c.indexOf(a),-1!==b&&c.splice(b,1)}else this._listenersByType={};return this},a.prototype.trigger=function(a,b){var c,d,e,f;for(f=this._getListeners(a),d=0,e=f.length;e>d;d++)c=f[d],null!=c&&c.call(this,b);return this},a}(),d.make=function(a){var b,c,e;null==a&&(a={}),d.prototype.constructor.call(a),e=d.prototype;for(b in e)c=e[b],"constructor"===b?c.call(a):a[b]=c;return a},c.exports=d}),require.register("gss/lib/dom/Query.js",function(a,b,c){var d,e,f,g=[].slice,h={}.hasOwnProperty,i=function(a,b){function c(){this.constructor=a}for(var d in b)h.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};f=function(a,b){var c,d,e,f,g,h,i,j;for(c=[],f=[],g=0,i=b.length;i>g;g++)d=b[g],-1===a.indexOf(d)&&c.push(d);for(h=0,j=a.length;j>h;h++)e=a[h],-1===b.indexOf(e)&&f.push(e);return{adds:c,removes:f}},d=function(){return GSS.deblog.apply(GSS,["Query"].concat(g.call(arguments)))},e=function(a){function b(a){null==a&&(a={}),b.__super__.constructor.apply(this,arguments),this.selector=a.selector||function(){throw new Error("GssQuery must have a selector")}(),this.createNodeList=a.createNodeList||function(){throw new Error("GssQuery must implement createNodeList()")}(),this.isMulti=a.isMulti||!1,this.isLive=a.isLive||!1,this.ids=a.ids||[],this.lastAddedIds=[],this.lastRemovedIds=[],d("constructor() @",this)}return i(b,a),b.prototype.isQuery=!0,b.prototype._updated_once=!1,b.prototype.changedLastUpdate=!1,b.prototype.update=function(){var a,b,c,e,g,h,i,j,k,l;if(d("update() @",this),this.is_destroyed)throw new Error("Can't update destroyed query: "+this.selector);for(this.changedLastUpdate=!1,this.isLive&&this._updated_once||(this.nodeList=this.createNodeList(),this._updated_once=!0),g=this.ids,e=[],k=this.nodeList,i=0,j=k.length;j>i;i++)b=k[i],c=GSS.setupId(b),c&&e.push(c);return l=f(g,e),a=l.adds,h=l.removes,a.length>0&&(this.changedLastUpdate=!0),this.lastAddedIds=a,h.length>0&&(this.changedLastUpdate=!0),this.lastRemovedIds=h,this.ids=e,this.changedLastUpdate&&this.trigger("afterChange"),this},b.prototype.forEach=function(a){var b,c,d,e,f;for(e=this.nodeList,f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(a.call(this,b));return f},b.prototype.first=function(){return this.nodeList[0]},b.prototype.last=function(){return this.nodeList[this.nodeList.length-1]},b.prototype.next=function(a){return this.nodeList[this.indexOf(a)+1]},b.prototype.prev=function(a){return this.nodeList[this.indexOf(a)-1]},b.prototype.indexOf=function(a){return Array.prototype.indexOf.call(this.nodeList,a)},b.prototype.is_destroyed=!1,b.prototype.destroy=function(){return this.offAll(),this.is_destroyed=!0,this.ids=null,this.lastAddedIds=null,this.lastRemovedIds=null,this.createNodeList=null,this.nodeList=null,this.changedLastUpdate=null},b}(GSS.EventTrigger),e.Set=function(a){function b(){return b.__super__.constructor.apply(this,arguments),this.bySelector={},this}return i(b,a),b.prototype.clean=function(){var a,b,c;c=this.bySelector;for(b in c)a=c[b],a.destroy(),delete this.bySelector[b];return this.bySelector={}},b.prototype.destroy=function(){var a,b,c;c=this.bySelector;for(b in c)a=c[b],a.destroy(),this.bySelector[b]=null;return this.offAll(),this.bySelector=null},b.prototype.add=function(a){var b,c;return c=a.selector,b=this.bySelector[c],b||(b=new GSS.Query(a),b.update(),this.bySelector[c]=b),b},b.prototype.remove=function(a){var b,c;return c=a.selector,b=this.bySelector[c],b&&(b.destroy(),delete this.bySelector[c]),b},b.prototype.update=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;i=[],f=[],b=[],j=!1,m=this.bySelector;for(h in m)if(d=m[h],d.update(),d.changedLastUpdate&&(d.lastAddedIds.length>0&&(j=!0,i.push(h)),d.lastRemovedIds.length>0))for(j=!0,e=d.lastRemovedIds,k=0,l=e.length;l>k;k++)g=e[k],-1===b.indexOf(g)&&(a=GSS.getById(g),document.documentElement.contains(a)?(b.push(g),f.push(h+"$"+g)):f.push("$"+g));return GSS._ids_killed(b),j?j?(c={removes:f,selectorsWithAdds:i},this.trigger("update",c),c):void 0:j},b}(GSS.EventTrigger),c.exports=e}),require.register("gss/lib/dom/View.js",function(a,b,c){var d,e,f=function(a,b){return function(){return a.apply(b,arguments)}};e=GSS._.transformPrefix,d=function(){function a(){this.printCssTree=f(this.printCssTree,this),this.recycle=f(this.recycle,this),this.attach=f(this.attach,this),this.values={},this.is_positioned=!1,this.el=null,this.id=null,this.parentOffsets=null,this.style=null,this.Matrix=null,this.matrixType=null,this.virtuals=null}return a.prototype.attach=function(b,c){if(this.el=b,this.id=c,!this.el)throw new Error("View needs el");if(!this.id)throw new Error("View needs id");return a.byId[this.id]=this,this.is_positioned=!1,this.el.gssView=this,GSS.trigger("view:attach",this),this.matrixType||(this.matrixType=GSS.config.defaultMatrixType),this.Matrix=GSS.glMatrix[this.matrixType]||function(){throw new Error("View matrixType not found: "+this.matrixType)}.call(this),this.matrix||(this.matrix=this.Matrix.create()),this},a.prototype.recycle=function(){return GSS.trigger("view:detach",this),this.is_positioned=!1,this.el=null,delete a.byId[this.id],this.id=null,this.parentOffsets=null,this.style=null,this.Matrix.identity(this.matrix),this.matrixType=null,this.virtuals=null,this.values={},a.recycled.push(this)},a.prototype.updateParentOffsets=function(){return this.parentOffsets=this.getParentOffsets()},a.prototype.getParentOffsets=function(){var a;return a=this.el.getBoundingClientRect(),{y:a.top+(window.pageYOffset||document.documentElement.scrollTop)-(document.documentElement.clientTop||0),x:a.left+(window.pageXOffset||document.documentElement.scrollLeft)-(document.documentElement.clientLeft||0)}},a.prototype.getParentOffsets__=function(){var a,b;if(a=this.el,b={x:0,y:0},!a.offsetParent)return b;for(a=a.offsetParent;;){if(b.x+=a.offsetLeft,b.y+=a.offsetTop,!a.offsetParent)break;a=a.offsetParent}return b},a.prototype.needsDisplay=!1,a.prototype.display=function(a){var b,c,d,e,f,g,h;if(this.values){c={},g=this.values;for(b in g)d=g[b],c[b]=d;(null!=c.x||null!=c.y)&&(this.parentOffsets&&(a.x+=this.parentOffsets.x,a.y+=this.parentOffsets.y),null!=c.x?(e=c.x-a.x,delete c.x):e=0,null!=c.y?(f=c.y-a.y,delete c.y):f=0,GSS.config.fractionalPixels||(e=Math.round(e),f=Math.round(f)),this.values.xLocal=e,this.values.yLocal=f,this._positionMatrix(e,f)),null!=c["z-index"]&&(this.style.zIndex=c["z-index"],delete c["z-index"]),null!=c.opacity&&(this.style.opacity=c.opacity,delete c.opacity),GSS.config.fractionalPixels||(null!=c.width&&(c.width=Math.round(c.width)),null!=c.height&&(c.height=Math.round(c.height)));for(b in c)d=c[b],b=GSS._.camelize(b),this.style[b]=d+"px";h=this.style;for(b in h)d=h[b],this.el.style[b]=d;return this}},a.prototype.positionIfNeeded=function(){return this.is_positioned||(this.style.position="absolute",this.style.margin="0px",this.style.top="0px",this.style.left="0px"),this.is_positioned=!0},a.prototype._positionMatrix=function(a,b){return this.Matrix.translate(this.matrix,this.matrix,[a,b,0]),this.style[e]=GSS._[this.matrixType+"ToCSS"](this.matrix)},a.prototype.printCss=function(){var a,b,c,d,e;a="",this.is_positioned&&(a+="position:absolute;",a+="margin:0px;",a+="top:0px;",a+="left:0px;"),b=!1,e=this.style;for(c in e)d=e[c],b=!0,a+=""+GSS._.dasherize(c)+":"+d+";";return b?"#"+this.id+"{"+a+"}":""},a.prototype.printCssTree=function(a,b){var c,d,e,f,g,h;if(null==b&&(b=0),a?e="":(a=this.el,e=this.printCss()),b>GSS.config.maxDisplayRecursionDepth)return"";if(d=a.children,!d)return"";for(g=0,h=d.length;h>g;g++)c=d[g],f=GSS.get.view(c),e+=f?f.printCssTree():this.printCssTree(c,b+1);return e},a.prototype.displayIfNeeded=function(a,b){return null==a&&(a={x:0,y:0}),null==b&&(b=!0),this.needsDisplay&&(this.display(a),this.setNeedsDisplay(!1)),a={x:0,y:0},this.values.x&&(a.x+=this.values.x),this.values.y&&(a.y+=this.values.y),b?this.displayChildrenIfNeeded(a):void 0},a.prototype.setNeedsDisplay=function(a){return this.needsDisplay=a?!0:!1},a.prototype.displayChildrenIfNeeded=function(a){return this._displayChildrenIfNeeded(this.el,a,0)},a.prototype._displayChildrenIfNeeded=function(a,b,c){var d,e,f,g,h,i;if(c<=GSS.config.maxDisplayRecursionDepth){if(e=a.children,!e)return null;for(i=[],g=0,h=e.length;h>g;g++)d=e[g],f=GSS.get.view(d),i.push(f?f.displayIfNeeded(b):this._displayChildrenIfNeeded(d,b,c+1));return i}},a.prototype.updateValues=function(a){return this.values=a,this.style={},this.Matrix.identity(this.matrix),null!=this.el.getAttribute("gss-parent-offsets")&&this.updateParentOffsets(),(null!=a.x||null!=a.y)&&this.positionIfNeeded(),this.setNeedsDisplay(!0),this},a.prototype.getParentView=function(){var b,c;for(b=this.el.parentElement;;){if(c=b._gss_id)return a.byId[c];if(!b.parentElement)break;b=b.parentElement}},a.prototype.addVirtuals=function(a){var b,c,d;if(!this.virtuals)return this.virtuals=[].concat(a);for(c=0,d=a.length;d>c;c++)b=a[c],this.addVirtual(b);return null},a.prototype.addVirtual=function(a){return this.virtuals?(-1===this.virtuals.indexOf(a)&&this.virtuals.push(a),null):this.virtuals=[a]},a.prototype.hasVirtual=function(a){return this.virtuals?-1===this.virtuals.indexOf(a)?!1:!0:!1},a.prototype.nearestViewWithVirtual=function(a){var b;for(b=this;b;){if(b.hasVirtual(a))return b;b=b.parentElement}return null},a}(),d.byId={},d.recycled=[],d.count=0,d["new"]=function(a){var b,c,e;return b=a.el,c=a.id,d.count++,e=d.recycled.length>0?d.recycled.pop():new d,e.attach(b,c)},c.exports=d}),require.register("gss/lib/dom/Observer.js",function(a,b,c){var d,e,f,g=[].slice;d=function(){return GSS.deblog.apply(GSS,["Observer"].concat(g.call(arguments)))},e=null,GSS.is_observing=!1,GSS.observe=function(){return e&&!GSS.is_observing&&GSS.config.observe?(e.observe(document.body,GSS.config.observerOptions),GSS.is_observing=!0):void 0},GSS.unobserve=function(){return e?(e.disconnect(),GSS.is_observing=!1):void 0},GSS._unobservedElements=f=[],GSS.observeElement=function(a){return-1===f.indexOf(a)?f.push(a):void 0},GSS.unobserveElement=function(a){var b;return b=f.indexOf(a),b>-1?f.splice(b,1):void 0},GSS.setupObserver=function(){return window.MutationObserver||(window.MutationObserver=window.WebKitMutationObserver?window.WebKitMutationObserver:window.JsMutationObserver),window.MutationObserver?e=new MutationObserver(function(a){var b,c,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;for(d("MutationObserver",a),e=[],l=[],k=[],i=[],m=!1,r=0,v=a.length;v>r;r++)if(j=a[r],-1===f.indexOf(j.target)){if(m=!0,"characterData"===j.type){if(!j.target.parentElement)continue;p=j.target.parentElement.gssStyleSheet,p&&(p.reload(),b=p.engine,-1===e.indexOf(b)&&e.push(b))}("attributes"===j.type||"childList"===j.type)&&("attributes"===j.type&&"data-gss-id"===j.attributename?l.push(j.target):-1===l.indexOf(j.target)&&(o=GSS.get.nearestScope(j.target),o&&-1===k.indexOf(o)&&k.push(o))),g=null,("characterData"===j.type||"attributes"===j.type||"childList"===j.type)&&("characterData"===j.type?(q=j.target.parentElement,g=GSS.getId(j.target.parentElement)):-1===l.indexOf(j.target)&&(g=GSS.getId(j.target)),null!=g&&(g="$"+g,-1===i.indexOf(g)&&i.push(g)))}if(!m)return null;for(n=GSS.styleSheets.findAllRemoved(),s=0,w=n.length;w>s;s++)p=n[s],p.destroy(),b=p.engine,-1===e.indexOf(b)&&e.push(b);for(h=0,c=GSS.engines[h];c;)h>0&&c.scope&&(document.documentElement.contains(c.scope)||(c.destroyChildren(),c.destroy())),h++,c=GSS.engines[h];for(t=0,x=e.length;x>t;t++)b=e[t],b.is_destroyed||b.reset();for(u=0,y=k.length;y>u;u++)o=k[u],b=GSS.get.engine(o),b&&(b.is_destroyed||-1===e.indexOf(b)&&b.updateQueries());if(i.length>0)for(B=GSS.engines,A=0,z=B.length;z>A;A++)b=B[A],b.is_destroyed||b.commander.handleInvalidMeasures(i);return e=null,l=null,k=null,i=null,GSS.update()}):void 0},GSS.isDisplayed=!1,GSS.onDisplay=function(){return GSS.trigger("display"),GSS.isDisplayed?void 0:(GSS.isDisplayed=!0,GSS.config.readyClass?GSS._.defer(function(){return GSS.html.classList.add("gss-ready"),GSS.html.classList.remove("gss-not-ready")}):void 0)},document.addEventListener("DOMContentLoaded",function(){return GSS.boot()}),c.exports=e}),require.register("gss/lib/gssom/Node.js",function(){}),require.register("gss/lib/gssom/StyleSheet.js",function(a,b,c){var d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=GSS.Rule,e=function(a){function b(a){var c,d,e;null==a&&(a={}),b.__super__.constructor.apply(this,arguments);for(c in a)e=a[c],this[c]=e;if(!this.engine)throw new Error("StyleSheet needs engine");return this.engine.addStyleSheet(this),GSS.styleSheets.push(this),this.isRemote=!1,this.remoteSourceText=null,this.el&&(d=this.el.tagName,"LINK"===d&&(this.isRemote=!0)),this.rules=[],a.rules&&this.addRules(a.rules),this.loadIfNeeded(),this}return g(b,a),b.prototype.isScoped=!1,b.prototype.addRules=function(a){var b,c,d,e,f;for(this.setNeedsInstall(!0),f=[],d=0,e=a.length;e>d;d++)b=a[d],b.parent=this,b.styleSheet=this,b.engine=this.engine,c=new GSS.Rule(b),f.push(this.rules.push(c));return f},b.prototype.isLoading=!1,b.prototype.needsLoad=!0,b.prototype.reload=function(){return this.destroyRules(),this._load()},b.prototype.loadIfNeeded=function(){return this.needsLoad&&(this.needsLoad=!1,this._load()),this},b.prototype._load=function(){return this.isRemote?this._loadRemote():this.el?this._loadInline():void 0},b.prototype._loadInline=function(){return this.addRules(GSS.get.readAST(this.el))},b.prototype._loadRemote=function(){var a,b,c=this;return this.remoteSourceText?this.addRules(GSS.compile(this.remoteSourceText)):(b=this.el.getAttribute("href"))?(a=new XMLHttpRequest,a.onreadystatechange=function(){return 4===a.readyState&&200===a.status?(c.remoteSourceText=a.responseText.trim(),c.addRules(GSS.compile(c.remoteSourceText)),c.isLoading=!1,c.trigger("loaded")):void 0},this.isLoading=!0,a.open("GET",b,!0),a.send(null)):null},b.prototype.needsInstall=!1,b.prototype.setNeedsInstall=function(a){return a?(this.engine.setNeedsUpdate(!0),this.needsInstall=!0):this.needsInstall=!1},b.prototype.install=function(){return this.needsInstall?(this.setNeedsInstall(!1),this._install()):void 0},b.prototype.reinstall=function(){return this._install()},b.prototype._install=function(){var a,b,c,d,e;for(d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.install());return e},b.prototype.reset=function(){var a,b,c,d,e;for(this.setNeedsInstall(!0),d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.reset());return e},b.prototype.destroyRules=function(){var a,b,c,d;for(d=this.rules,b=0,c=d.length;c>b;b++)a=d[b],a.destroy();return this.rules=[]},b.prototype.destroy=function(){var a;return a=this.engine.styleSheets.indexOf(this),this.engine.styleSheets.splice(a,1),a=GSS.styleSheets.indexOf(this),GSS.styleSheets.splice(a,1)},b.prototype.isRemoved=function(){return!this.el||document.body.contains(this.el)||document.head.contains(this.el)?!1:!0},b.prototype.needsDumpCSS=!1,b.prototype.setNeedsDumpCSS=function(a){return a?(this.engine.setNeedsDumpCSS(!0),this.needsDumpCSS=!0):this.needsDumpCSS=!1},b.prototype.dumpCSSIfNeeded=function(){return this.needsDumpCSS?this.dumpCSS():void 0},b.prototype.dumpCSS=function(){var a,b,c,d,e,f;for(a="",f=this.rules,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSS(),c&&(a+=c);return a},b}(GSS.EventTrigger),e.fromNode=function(a){var b,c;return a.gssStyleSheet?a.gssStyleSheet:(b=GSS({scope:GSS.get.scopeForStyleNode(a)}),c=new GSS.StyleSheet({el:a,engine:b,engineId:b.id}),a.gssStyleSheet=c,c)},e.Collection=function(){function a(){var a,b,c;a=[];for(b in this)c=this[b],a[b]=c;return a}return a.prototype.install=function(){var a,b,c;for(b=0,c=this.length;c>b;b++)a=this[b],a.install();return this},a.prototype.find=function(){var a,b,c,d,e;for(b=document.querySelectorAll('[type="text/gss"], [type="text/gss-ast"]'),d=0,e=b.length;e>d;d++)a=b[d],c=GSS.StyleSheet.fromNode(a);return this},a.prototype.findAllRemoved=function(){var a,b,c,d;for(a=[],c=0,d=this.length;d>c;c++)b=this[c],b.isRemoved()&&a.push(b);return a},a}(),GSS.StyleSheet=e,GSS.styleSheets=new GSS.StyleSheet.Collection,c.exports=e}),require.register("gss/lib/gssom/Rule.js",function(a,b,c){var d,e;e=0,d=function(){function a(b){var c,d;e++,this.cid=e;for(c in b)d=b[c],this[c]=d;this.boundConditionals=[],("else"===this.name||"elseif"===this.name||"if"===this.name)&&(this.isConditional=!0),this.rules=[],b.rules&&this.addRules(b.rules),this.Type=a.types[this.type]||function(){throw new Error("Rule type, "+type+", not found")}()}return a.prototype.isRule=!0,a.prototype.addRules=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)b=a[d],b.parent=this,b.styleSheet=this.styleSheet,b.engine=this.engine,c=new GSS.Rule(b),f.push(this.rules.push(c));return f},a.prototype._selectorContext=null,a.prototype.needsInstall=!0,a.prototype.install=function(){var a,b,c,d;for(this.needsInstall&&(this.needsInstall=!1,this.Type.install.call(this)),d=this.rules,b=0,c=d.length;c>b;b++)a=d[b],a.install();return this},a.prototype.uninstall=function(){},a.prototype.reset=function(){var a,b,c,d,e;for(this.needsInstall=!0,this.boundConditionals=[],d=this.rules,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.reset());return e},a.prototype.destroy=function(){return this.rules=null,this.commands=null,this.engine=null,this.parent=null,this.styleSheet=null,this.boundConditionals=null +},a.prototype.executeCommands=function(){return this.commands?this.engine.run(this):void 0},a.prototype.nextSibling=function(){var a;return a=this.parent.rules.indexOf(this),this.parent.rules[a+1]},a.prototype.prevSibling=function(){var a;return a=this.parent.rules.indexOf(this),this.parent.rules[a-1]},a.prototype.getSelectorContext=function(){return this._selectorContext||(this._selectorContext=this._computeSelectorContext()),this._selectorContext},a.prototype._computeSelectorContext=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;for(e=[],d=this;d.parent;){if(c=d.parent,!c.isConditional&&(null!=c&&null!=(m=c.selectors)?m.length:void 0)>0)if(0===e.length)for(n=c.selectors,g=0,j=n.length;j>g;g++)a=n[g],e.push(a);else{for(f=[],o=c.selectors,h=0,k=o.length;k>h;h++)for(a=o[h],i=0,l=e.length;l>i;i++)b=e[i],f.push(a+" "+b);e=f}d=c}return this.selectorContext=e,e},a.prototype.getContextQuery=function(){return this.query?this.query:this.setupContextQuery()},a.prototype.setupContextQuery=function(){var a,b;return a=this.getSelectorContext().join(", "),b=this.engine,this.query=b.registerDomQuery({selector:a,isMulti:!0,isLive:!1,createNodeList:function(){return b.queryScope.querySelectorAll(a)}})},a.prototype.gatherCondCommand=function(){var a,b,c;for(a=["cond"],b=this,c=!0;c;)a.push(b.getClauseCommand()),b=b.nextSibling(),c=null!=b?b.isConditional:void 0;return a},a.prototype.getClauseCommand=function(){return["clause",this.clause,this.getClauseTracker()]},a.prototype.getClauseTracker=function(){return"gss-cond-"+this.cid},a.prototype.injectChildrenCondtionals=function(a){var b,c,d,e,f,g,h,i,j;for(h=this.rules,j=[],d=0,f=h.length;f>d;d++){if(c=h[d],c.boundConditionals.push(a),c.commands)for(i=c.commands,e=0,g=i.length;g>e;e++)b=i[e],b.push(["where",a.getClauseTracker()]);c.isCondtionalBound=!0,j.push(c.injectChildrenCondtionals(a))}return j},a.prototype.setNeedsDumpCSS=function(a){return a?this.styleSheet.setNeedsDumpCSS(!0):void 0},a.prototype.dumpCSS=function(){var a;return a=this.Type.dumpCSS,a||(a=this.dumpChildrenCSS),a.call(this)},a.prototype.dumpChildrenCSS=function(){var a,b,c,d,e,f;for(a="",f=this.rules,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSS(),c&&(a+=c);return a},a}(),d.types={directive:{install:function(){return"else"===this.name||"elseif"===this.name?(this.injectChildrenCondtionals(this),this):"if"===this.name?(this.commands=[this.gatherCondCommand()],this.injectChildrenCondtionals(this),this.executeCommands()):this.executeCommands()},dumpCSS:function(){return""}},constraint:{install:function(){return this.executeCommands()},dumpCSS:function(){return""}},style:{install:function(){return this.setNeedsDumpCSS(!0)},dumpCSS:function(){return this.key+":"+this.val+";"}},ruleset:{install:function(){},dumpCSS:function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(c=!1,d=!1,a="",e="",g="",b=null,l=this.rules,j=0,k=l.length;k>j;j++)h=l[j],i=h.dumpCSS(),f=i[i.length-1],";"===f?(e+=i,d||(b=h.getSelectorContext().join(", "),d=!0)):"}"===f&&(g+=i,c=!0);return d&&(a=b+"{"+e+"}"),c&&(a+=g),a}}},c.exports=d}),require.register("gss/lib/Engine.js",function(a,b,c){var d,e,f,g,h,i,j=[].slice,k=function(a,b){return function(){return a.apply(b,arguments)}},l={}.hasOwnProperty,m=function(a,b){function c(){this.constructor=a}for(var d in b)l.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};if("undefined"==typeof GSS||null===GSS)throw new Error("GSS object needed for Engine");i=GSS._,f=function(){return GSS.config.perf?console.time.apply(console,arguments):void 0},g=function(){return GSS.config.perf?console.timeEnd.apply(console,arguments):void 0},e=function(){return GSS.deblog.apply(GSS,["Engine"].concat(j.call(arguments)))},GSS.engines=h=[],h.byId={},h.root=null,d=function(a){function b(a){null==a&&(a={}),this.dispatch=k(this.dispatch,this),this.updateQueries=k(this.updateQueries,this),this.handleWorkerMessage=k(this.handleWorkerMessage,this),this.reset=k(this.reset,this),b.__super__.constructor.apply(this,arguments),this.scope=a.scope,this.workerURL=a.workerURL,this.vars=a.vars,this.getter=a.getter,this.is_root=a.is_root,this.useWorker=a.useWorker,this.vars||(this.vars={}),this.clauses=null,GSS.config.useWorker?null==this.useWorker&&(this.useWorker=!0):this.useWorker=!1,this.worker=null,this.workerCommands=[],this.workerMessageHistory=[],this.workerURL||(this.workerURL=GSS.config.worker),this.scope?("HEAD"===this.scope.tagName&&(this.scope=document),this.id=GSS.setupScopeId(this.scope),this.queryScope=this.scope===GSS.Getter.getRootScope()?document:this.scope):(this.id=GSS.uid(),this.queryScope=document),this.getter||(this.getter=new GSS.Getter(this.scope)),this.commander=new GSS.Commander(this),this.lastWorkerCommands=null,this.cssDump=null,GSS.engines.push(this),h.byId[this.id]=this,this._Hierarchy_setup(),this._Queries_setup(),this._StyleSheets_setup(),e("constructor() @",this)}return m(b,a),b.prototype.getVarsById=function(a){var b;return GSS.config.processBeforeSet&&(a=GSS.config.processBeforeSet(a)),b=i.varsByViewId(i.filterVarsForDisplay(a))},b.prototype.getQueryScopeById=function(a){return a?GSS.getById(a):this.queryScope},b.prototype.isDescendantOf=function(a){var b;for(b=this.parentEngine;b;){if(b===a)return!0;b=b.parentEngine}return!1},b.prototype._Hierarchy_setup=function(){var a;if(this.childEngines=[],this.parentEngine=null,this.is_root?h.root=this:this.parentEngine=this.scope?GSS.get.nearestEngine(this.scope,!0):h.root,!this.parentEngine&&!this.is_root)throw new Error("ParentEngine missing, WTF");return null!=(a=this.parentEngine)?a.childEngines.push(this):void 0},b.prototype._Hierarchy_destroy=function(){return this.parentEngine.childEngines.splice(this.parentEngine.childEngines.indexOf(this),1),this.parentEngine=null},b.prototype.is_running=!1,b.prototype.run=function(a){var b,c,d,f;if(e(this.id,".run(asts)",a),a instanceof Array){for(f=[],c=0,d=a.length;d>c;c++)b=a[c],f.push(this._run(b));return f}return this._run(a)},b.prototype._run=function(a){return this.commander.execute(a)},b.prototype.load=function(){var a,b,c,d,e;if(!this.scope)throw new Error("can't load scopeless engine");for(this.is_running&&this.clean(),d=this.styleSheets,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.execute());return e},b.prototype.reset=function(){var a,b,c,d;if(e(this.id,".reset()"),!this.scope)throw new Error("can't reset scopeless engine");for(b=this.styleSheets,this.is_running&&this.clean(),this.styleSheets=b,c=0,d=b.length;d>c;c++)a=b[c],a.reset();return this.setNeedsUpdate(!0),this},b.prototype.registerCommands=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.registerCommand(b));return e},b.prototype.registerCommand=function(a){return this.workerCommands.push(a),this.setNeedsLayout(!0),this},b.prototype._StyleSheets_setup=function(){return this.styleSheets=[]},b.prototype.addStyleSheet=function(a){return this.setNeedsUpdate(!0),this.styleSheets.push(a)},b.prototype.needsUpdate=!1,b.prototype.setNeedsUpdate=function(a){return a?(GSS.setNeedsUpdate(!0),this.needsUpdate=!0):this.needsUpdate=!1},b.prototype.updateIfNeeded=function(){var a=this;return this.needsUpdate?(this._whenReadyForUpdate(function(){var b,c,d,e;for(e=a.styleSheets,c=0,d=e.length;d>c;c++)b=e[c],b.install();return a.updateChildrenIfNeeded()}),this.setNeedsUpdate(!1)):this.updateChildrenIfNeeded()},b.prototype._whenReadyForUpdate=function(a){var b,c,d,e,f,g=this;for(b=0,f=this.styleSheets,d=0,e=f.length;e>d;d++)c=f[d],c.isLoading&&(b++,c.once("loaded",function(){return b--,0===b?a.call(g):void 0}));return 0===b&&a.call(this),this},b.prototype.updateChildrenIfNeeded=function(){var a,b,c,d,e;for(d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.updateIfNeeded());return e},b.prototype.needsLayout=!1,b.prototype.setNeedsLayout=function(a){return a?this.needsLayout?void 0:(GSS.setNeedsLayout(!0),this.needsLayout=!0):this.needsLayout=!1},b.prototype._beforeLayoutCalls=null,b.prototype.layout=function(){return this.hoistedTrigger("beforeLayout",this),this.is_running=!0,f(""+this.id+" LAYOUT & DISPLAY"),this.dumpCSSIfNeeded(),this.solve(),this.setNeedsLayout(!1)},b.prototype.layoutIfNeeded=function(){return this.needsLayout&&this.layout(),this.layoutSubTreeIfNeeded()},b.prototype.waitingToLayoutSubtree=!1,b.prototype.layoutSubTreeIfNeeded=function(){var a,b,c,d,e;for(this.waitingToLayoutSubtree=!1,d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.layoutIfNeeded());return e},b.prototype.needsDisplay=!1,b.prototype.setNeedsDisplay=function(a){return a?(GSS.setNeedsDisplay(!0),this.needsDisplay=!0):this.needsDisplay=!1},b.prototype.display=function(a,b){var c,d,f,h,i,j,k;null==b&&(b=!1),i=a.values,e(this.id,".display()"),this.hoistedTrigger("beforeDisplay",this),GSS.unobserve(),j=this.getVarsById(i),f=!1;for(d in j)h=j[d],f=!0,b&&(c=document.getElementById(d),c&&GSS.setupId(c)),null!=(k=GSS.View.byId[d])&&"function"==typeof k.updateValues&&k.updateValues(h);return a.clauses&&this.updateClauses(a.clauses),f&&this.scope&&GSS.get.view(this.scope).displayIfNeeded(),!this.isMeasuring&&this.needsMeasure?(this.measureIfNeeded(),this.needsLayout||this._didDisplay()):this._didDisplay(),GSS.observe(),this.dispatchedTrigger("solved",{values:i}),g(""+this.id+" LAYOUT & DISPLAY"),this},b.prototype._didDisplay=function(){return this.trigger("display"),GSS.onDisplay(),this.isMeasuring=!1},b.prototype.forceDisplay=function(){},b.prototype.updateClauses=function(a){var b,c,d,e,f,g,h,i,j,k;if(c=GSS.html,e=this.clauses,d=a,e){for(f=0,i=e.length;i>f;f++)b=e[f],-1===d.indexOf(b)&&c.classList.remove(b);for(g=0,j=d.length;j>g;g++)b=d[g],-1===e.indexOf(b)&&c.classList.add(b)}else for(h=0,k=d.length;k>h;h++)b=d[h],c.classList.add(b);return this.clauses=d},b.prototype.isMeasuring=!1,b.prototype.needsMeasure=!1,b.prototype.setNeedsMeasure=function(a){return this.needsMeasure=a?!0:!1},b.prototype.measureIfNeeded=function(){return this.needsMeasure?(this.isMeasuring=!0,this.needsMeasure=!1,this.measure()):void 0},b.prototype.measure=function(){return this.commander.validateMeasures()},b.prototype.measureByGssId=function(a,b){var c,d;return c=GSS.getById(a),d=this.getter.measure(c,b),e(this.id,".measureByGssId()",a,b,d),d},b.prototype.solve=function(){return this.useWorker?this.solveWithWorker():this.solveWithoutWorker()},b.prototype.solveWithWorker=function(){var a;return e(this.id,".solveWithWorker()",this.workerCommands),a={commands:this.workerCommands},this.workerMessageHistory.push(a),this.worker||(this.worker=new Worker(this.workerURL),this.worker.addEventListener("message",this.handleWorkerMessage,!1),this.worker.addEventListener("error",this.handleError,!1),a.config={defaultStrength:GSS.config.defaultStrength,defaultWeight:GSS.config.defaultWeight}),this.worker.postMessage(a),this.lastWorkerCommands=this.workerCommands,this.workerCommands=[]},b.prototype.solveWithoutWorker=function(){var a,b=this;return e(this.id,".solveWithoutWorker()",this.workerCommands),a={commands:this.workerCommands},this.workerMessageHistory.push(a),this.worker||(this.worker=new GSS.Thread({defaultStrength:GSS.config.defaultStrength,defaultWeight:GSS.config.defaultWeight})),this.worker.postMessage(i.cloneDeep(a)),i.defer(function(){return b.worker?b.handleWorkerMessage({data:b.worker.output()}):void 0}),this.lastWorkerCommands=this.workerCommands,this.workerCommands=[]},b.prototype.handleWorkerMessage=function(a){return e(this.id,".handleWorkerMessage()",this.workerCommands),this.vars=a.data.values,this.display(a.data)},b.prototype.handleError=function(a){if(this.onError)return this.onError(a);throw new Error(""+a.message+" ("+a.filename+":"+a.lineno+")")},b.prototype._Worker_destroy=function(){return this.worker&&(this.worker.terminate(),this.worker=null),this.workerCommands=null,this.workerMessageHistory=null,this.lastWorkerCommands=null},b.prototype._Worker_clean=function(){return this.workerCommands=[],this.lastWorkerCommands=null,this.worker?(this.worker.terminate(),this.worker=null):void 0},b.prototype._Queries_setup=function(){var a=this;return this.querySet=new GSS.Query.Set,this.querySet.on("update",function(b){return a.commander.handleRemoves(b.removes),a.commander.handleSelectorsWithAdds(b.selectorsWithAdds)})},b.prototype.getDomQuery=function(a){return this.querySet.bySelector[a]},b.prototype.registerDomQuery=function(a){return this.querySet.add(a)},b.prototype.unregisterDomQuery=function(a){return this.querySet.remove(a)},b.prototype.updateQueries=function(){return this.querySet.update()},b.prototype._Queries_destroy=function(){return this.querySet.destroy()},b.prototype._Queries_clean=function(){return this.querySet.clean()},b.prototype.hoistedTrigger=function(a,b){return this.trigger(a,b),GSS.trigger("engine:"+a,b)},b.prototype.dispatchedTrigger=function(a,b,c,d){return this.trigger(a,b),this.dispatch(a,b,c,d)},b.prototype.dispatch=function(a,b,c,d){var e,f;return null==b&&(b={}),null==c&&(c=!0),null==d&&(d=!0),this.scope?(b.engine=this,f={detail:b,bubbles:c,cancelable:d},e=new CustomEvent(a,f),this.scope.dispatchEvent(e)):void 0},b.prototype.cssToDump=null,b.prototype.cssDump=null,b.prototype.setupCSSDumpIfNeeded=function(){var a;return a=this.scope||document.body,this.cssDump?void 0:(this.cssDump=document.createElement("style"),this.cssDump.id="gss-css-dump-"+this.id,a.appendChild(this.cssDump))},b.prototype.needsDumpCSS=!1,b.prototype.setNeedsDumpCSS=function(a){return a?(this.setNeedsLayout(!0),this.needsDumpCSS=!0):this.needsDumpCSS=!1},b.prototype.dumpCSSIfNeeded=function(){var a,b,c,d,e,f;if(this.needsDumpCSS){for(this.needsDumpCSS=!1,this.setupCSSDumpIfNeeded(),a="",f=this.styleSheets,d=0,e=f.length;e>d;d++)b=f[d],c=b.dumpCSSIfNeeded(),c&&(a+=c);if(a.length>0)return this.cssDump.innerHTML=a}},b.prototype._CSSDumper_clean=function(){var a;return null!=(a=this.cssDump)?a.innerHTML="":void 0},b.prototype._CSSDumper_destroy=function(){return this.needsDumpCSS=!1,this.cssDump=null},b.prototype.clean=function(){var a,b,c,d;e(this.id,".clean()"),d=this.vars;for(a in d)b=d[a],delete this.vars[a];return this.setNeedsLayout(!1),this.setNeedsDisplay(!1),this.setNeedsLayout(!1),this.setNeedsMeasure(!1),this.isMeasuring=!1,this.waitingToLayoutSubtree=!1,this.commander.clean(),"function"==typeof(c=this.getter).clean&&c.clean(),this._CSSDumper_clean(),this._Worker_clean(),this._Queries_clean(),this},b.prototype.is_destroyed=!1,b.prototype.destroyChildren=function(){var a,b,c,d,e;for(d=this.childEngines,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.is_destroyed?void 0:a.destroy());return e},b.prototype.destroy=function(){var a,b,c,d,f,g,i;if(e(this.id,".destroy()"),this.hoistedTrigger("beforeDestroy",this),GSS._ids_killed([this.id]),this.scope)for(b=GSS.get.descdendantNodes(this.scope),g=0,i=b.length;i>g;g++)a=b[g],d=a._gss_id,d&&GSS._id_killed(d);return c=h.indexOf(this),c>-1&&h.splice(c,1),delete h.byId[this.id],this.offAll(),this.setNeedsLayout(!1),this.setNeedsDisplay(!1),this.setNeedsLayout(!1),this.waitingToLayoutSubtree=!1,this.commander.destroy(),"function"==typeof(f=this.getter).destroy&&f.destroy(),this.vars=null,this.clauses=null,this.ast=null,this.getter=null,this.scope=null,this.commander=null,this._Hierarchy_destroy(),this._CSSDumper_destroy(),this._Worker_destroy(),this._Queries_destroy(),this.is_running=null,this.is_destroyed=!0,this},b.prototype.elVar=function(a,b,c,d){var e,f,g;return f="$"+GSS.getId(a),"left"===b?b="x":"top"===b&&(b="y"),g=f+("["+b+"]"),e=["get$",b,f,c],d&&e.push(d),e},b.prototype["var"]=function(a){return["get",a]},b.prototype.varexp=function(a){return["get",a]},b.prototype.__e=function(a){return a instanceof Array?a:Number(a)||0===Number(a)?["number",a]:this["var"](a)},b.prototype._addconstraint=function(a,b,c,d,e,f){var g,h,i,j;if(b=this.__e(b),c=this.__e(c),g=["eq",b,c],d&&g.push(d),e&&g.push(e),f)for(i=0,j=f.length;j>i;i++)h=f[i],g.push(h);return this.registerCommand(g)},b.prototype.eq=function(a,b,c,d,e){return this._addconstraint("eq",a,b,c,d,e)},b.prototype.lte=function(a,b,c,d,e){return this._addconstraint("lte",a,b,c,d,e)},b.prototype.gte=function(a,b,c,d,e){return this._addconstraint("gte",a,b,c,d,e)},b.prototype.suggest=function(a,b,c){return null==c&&(c="required"),a=this.__e(a),this.registerCommand(["suggest",a,["number",b],c])},b.prototype.stay=function(a){return a=this.__e(a),this.registerCommand(["stay",a])},b.prototype.remove=function(a){return this.registerCommand(["remove",a])},b.prototype.number=function(a){return["number",a]},b.prototype.plus=function(a,b){return a=this.__e(a),b=this.__e(b),["plus",a,b]},b.prototype.minus=function(a,b){return a=this.__e(a),b=this.__e(b),["minus",a,b]},b.prototype.multiply=function(a,b){return a=this.__e(a),b=this.__e(b),["multiply",a,b]},b.prototype.divide=function(a,b){return a=this.__e(a),b=this.__e(b),["divide",a,b]},b}(GSS.EventTrigger),c.exports=d}),require.register("gss/lib/Commander.js",function(exports,require,module){var Commander,bindRoot,bindRootAsContext,bindRootAsMulti,unbindRoot,__bind=function(a,b){return function(){return a.apply(b,arguments)}},__slice=[].slice;bindRoot=function(a,b){return a.isQueryBound=!0,a.queries?-1===a.queries.indexOf(b)&&a.queries.push(b):a.queries=[b],a},unbindRoot=function(a,b){var c;if(a.queries)return c=a.queries.indexOf(b),-1!==c&&a.queries.splice(c,1),a.queries.length||(a.isQueryBound=null),a},bindRootAsMulti=function(a,b){return bindRoot(a,b),a},bindRootAsContext=function(a,b){return bindRoot(a,b),a.isContextBound=!0},Commander=function(){function Commander(a){this.engine=a,this.js=__bind(this.js,this),this["for-all"]=__bind(this["for-all"],this),this["for-each"]=__bind(this["for-each"],this),this._e_for_chain=__bind(this._e_for_chain,this),this._chainer_math=__bind(this._chainer_math,this),this["divide-chain"]=__bind(this["divide-chain"],this),this["multiply-chain"]=__bind(this["multiply-chain"],this),this["minus-chain"]=__bind(this["minus-chain"],this),this["plus-chain"]=__bind(this["plus-chain"],this),this._chainer=__bind(this._chainer,this),this["gt-chain"]=__bind(this["gt-chain"],this),this["lt-chain"]=__bind(this["lt-chain"],this),this["gte-chain"]=__bind(this["gte-chain"],this),this["lte-chain"]=__bind(this["lte-chain"],this),this["eq-chain"]=__bind(this["eq-chain"],this),this.chain=__bind(this.chain,this),this.$reserved=__bind(this.$reserved,this),this.$id=__bind(this.$id,this),this.$all=__bind(this.$all,this),this.$tag=__bind(this.$tag,this),this.$class=__bind(this.$class,this),this.$virtual=__bind(this.$virtual,this),this.virtual=__bind(this.virtual,this),this.stay=__bind(this.stay,this),this.gt=__bind(this.gt,this),this.lt=__bind(this.lt,this),this.gte=__bind(this.gte,this),this.lte=__bind(this.lte,this),this.eq=__bind(this.eq,this),this.suggest=__bind(this.suggest,this),this.strength=__bind(this.strength,this),this["||"]=__bind(this["||"],this),this["&&"]=__bind(this["&&"],this),this["?<"]=__bind(this["?<"],this),this["?>"]=__bind(this["?>"],this),this["?!="]=__bind(this["?!="],this),this["?=="]=__bind(this["?=="],this),this["?<="]=__bind(this["?<="],this),this["?>="]=__bind(this["?>="],this),this.clause=__bind(this.clause,this),this.where=__bind(this.where,this),this.cond=__bind(this.cond,this),this.divide=__bind(this.divide,this),this.multiply=__bind(this.multiply,this),this.minus=__bind(this.minus,this),this.plus=__bind(this.plus,this),this._get$=__bind(this._get$,this),this.get$=__bind(this.get$,this),this.get=__bind(this.get,this),this.makeCommandScopedToParentRule=__bind(this.makeCommandScopedToParentRule,this),this.spawnForWindowSize=__bind(this.spawnForWindowSize,this),this._execute=__bind(this._execute,this),this.lazySpawnForWindowSize=GSS._.debounce(this.spawnForWindowSize,GSS.config.resizeDebounce,!1),this.cleanVars()}return Commander.prototype.clean=function(){return this.cleanVars(),this.unlisten()},Commander.prototype.cleanVars=function(){return this.spawnableRoots=[],this.intrinsicRegistersById={},this.boundWindowProps=[],this.get$cache={},this.queryCommandCache={}},Commander.prototype.destroy=function(){return this.spawnableRoots=null,this.intrinsicRegistersById=null,this.boundWindowProps=null,this.get$cache=null,this.queryCommandCache=null,this.unlisten()},Commander.prototype.execute=function(a){var b,c,d,e,f;if(null!=a.commands){for(e=a.commands,f=[],c=0,d=e.length;d>c;c++)b=e[c],a.isRule&&(b.parentRule=a),f.push(this._execute(b,b));return f}},Commander.prototype._execute=function(a,b){var c,d,e,f,g,h,i;if(e=a,c=this[e[0]],null==c)throw new Error("Engine Commands broke, couldn't find method: "+e[0]);for(i=e.slice(1,+e.length+1||9e9),d=g=0,h=i.length;h>g;d=++g)f=i[d],f instanceof Array&&e.splice(d+1,1,this._execute(f,b));return c.call.apply(c,[this.engine,b].concat(__slice.call(e.slice(1,e.length))))},Commander.prototype.unlisten=function(){return this._bound_to_window_resize||window.removeEventListener("resize",this.lazySpawnForWindowSize,!1),this._bound_to_window_resize=!1},Commander.prototype._bound_to_window_resize=!1,Commander.prototype.spawnForWindowWidth=function(){var a;return a=window.innerWidth,GSS.config.verticalScroll&&(a-=GSS.get.scrollbarWidth()),this.engine.vars["::window[width]"]!==a?this.engine.registerCommand(["suggest",["get","::window[width]"],["number",a],"required"]):void 0},Commander.prototype.spawnForWindowHeight=function(){var a;return a=window.innerHeight,GSS.config.horizontalScroll&&(a-=GSS.get.scrollbarWidth()),this.engine.vars["::window[height]"]!==a?this.engine.registerCommand(["suggest",["get","::window[height]"],["number",a],"required"]):void 0},Commander.prototype.spawnForWindowSize=function(){return this._bound_to_window_resize?(-1!==this.boundWindowProps.indexOf("width")&&this.spawnForWindowWidth(),-1!==this.boundWindowProps.indexOf("height")&&this.spawnForWindowHeight(),this.engine.solve()):void 0},Commander.prototype.bindToWindow=function(a){if("center-x"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[center-x]"],["divide",["get","::window[width]"],2],"required"]),null;if("right"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[right]"],["get","::window[width]"],"required"]),null;if("center-y"===a)return this.bindToWindow("height"),this.engine.registerCommand(["eq",["get","::window[center-y]"],["divide",["get","::window[height]"],2],"required"]),null;if("bottom"===a)return this.bindToWindow("width"),this.engine.registerCommand(["eq",["get","::window[bottom]"],["get","::window[height]"],"required"]),null;if(-1===this.boundWindowProps.indexOf(a)&&this.boundWindowProps.push(a),"width"===a||"height"===a){if("width"===a?this.spawnForWindowWidth():this.spawnForWindowHeight(),!this._bound_to_window_resize)return window.addEventListener("resize",this.lazySpawnForWindowSize,!1),this._bound_to_window_resize=!0}else{if("x"===a)return this.engine.registerCommand(["eq",["get","::window[x]"],["number",0],"required"]);if("y"===a)return this.engine.registerCommand(["eq",["get","::window[y]"],["number",0],"required"])}},Commander.prototype.spawnForScope=function(a){var b,c;return b="$"+this.engine.id+("["+a+"]"),c=this.engine,GSS.on("engine:beforeDisplay",function(a){var d;return d=a.vars[b],null!=d&&c.isDescendantOf(a)?c.registerCommand(["suggest",["get",b],["number",d],"required"]):void 0})},Commander.prototype.bindToScope=function(a){return this.spawnForScope(a)},Commander.prototype.handleRemoves=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;if(a.length<1)return this;if(q=this.trackersById)for(h=0,l=a.length;l>h;h++)if(g=a[h],f=q[g]){for(i=0,m=f.length;m>i;i++)e=f[i],-1===a.indexOf(e)&&a.push(e);delete q[g]}for(p=this.subqueriesByTracker,j=0,n=a.length;n>j;j++)if(g=a[j],delete this.intrinsicRegistersById[g],p&&(c=p[g])){for(k=0,o=c.length;o>k;k++)d=c[k],b=d.query,-1===a.indexOf(b.selector)&&a.push(b.selector),delete this.queryCommandCache[b.selector],this.engine.unregisterDomQuery(b),unbindRoot(d.root,b);delete p[g]}return this.engine.registerCommand(["remove"].concat(__slice.call(a))),this},Commander.prototype.handleSelectorsWithAdds=function(a){var b,c,d,e,f,g,h,i;if(a.length<1)return this;for(h=this.spawnableRoots,d=0,f=h.length;f>d;d++)for(c=h[d],i=c.queries,e=0,g=i.length;g>e;e++)b=i[e],-1!==a.indexOf(b.selector)&&this.spawn(c,b);return this},Commander.prototype.validateMeasures=function(){var a,b;b=[];for(a in this.intrinsicRegistersById)b.push(a);return this.handleInvalidMeasures(b)},Commander.prototype.handleInvalidMeasures=function(a){var b,c,d,e,f,g;if(a.length<1)return this;for(f=0,g=a.length;g>f;f++)if(b=a[f],e=this.intrinsicRegistersById[b])for(c in e)d=e[c],d.call(this);return this},Commander.prototype.bindRootSubselector=function(a,b,c){var d=this;return a.subselector=c,a.spawn=function(e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u;for(i="$"+(g||e),p=b.query.selector+i,o=b.selector+" "+c+i,j=d.$all(a,c,e,o),j.root=a,n=(r=d.trackersById||(d.trackersById={}))[i]||(r[i]=[]),-1===n.indexOf(p)&&n.push(p),q=(s=d.subqueriesByTracker||(d.subqueriesByTracker={}))[p]||(s[p]=[]),-1===q.indexOf(j)&&q.push(j),m=[],l=h===j.query?j.query.lastAddedIds:j.query.ids,t=0,u=l.length;u>t;t++)k=l[t],m.push.apply(m,d.expandSpawnable([f],!1,k,o,"do_not_recurse"));return m.length?(m.isPlural=!0,m):void 0}},Commander.prototype.registerSpawn=function(a){var b,c,d,e;if(a.isQueryBound)return this.spawnableRoots.push(a),this.spawn(a);for(b=[],d=0,e=a.length;e>d;d++)c=a[d],b.push(c);return this.engine.registerCommand(b)},Commander.prototype.spawn=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;for(f=a.queries,g=!0,i=0,k=f.length;k>i;i++)if(e=f[i],(!b||b===e)&&e.lastAddedIds.length<=0){g=!1;break}if(g){if(h=a.parentRule,a.isContextBound){for(d=b||h.getContextQuery(),m=d.lastAddedIds,n=[],j=0,l=m.length;l>j;j++)c=m[j],n.push(this.engine.registerCommands(this.expandSpawnable(a,!0,c,null,b)));return n}return this.engine.registerCommands(this.expandSpawnable(a,!0,null,null,b))}},Commander.prototype.expandSpawnable=function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;for(j=[],f=[],g=!1,p={},m=null,o=0,q=null,h=r=0,u=a.length;u>r;h=++r)l=a[h],l&&(null!=l.spawn?(k=l.spawn(c,d,e))&&(j.push(k),(l.isPlural||k.isPlural)&&(g?k.length!==o&&(GSS.warn("GSS: trying to constrain 2 plural selectors ('"+q+"' & '"+l.query.selector+"') with different number of matching elements"),k.length=0?o>s:s>o;i=o>=0?++s:--s){for(n=[],h=t=0,v=j.length;v>t;h=++t)l=j[h],n.push(p[h]?p[h][i]:l);f.push(n)}return f}return b?[j]:j},Commander.prototype.makeNonRootSpawnableIfNeeded=function(a){var b,c,d,e,f,g=this;for(b=!1,e=0,f=a.length;f>e;e++)d=a[e],d&&null!=d.spawn&&(c=!0,d.isPlural&&(b=!0));return c?{isPlural:b,spawn:function(b){return g.expandSpawnable(a,!1,b)}}:a},Commander.prototype.makeCommandScopedToParentRule=function(){},Commander.prototype.get=function(a,b,c){var d;return d=["get",b],c&&d.push(c),d},Commander.prototype.get$=function(a,b,c){var d,e;return d=c.selectorKey,d||(d=c.selector),d+=b,e=this.get$cache[d],e||(e=this._get$(a,b,c),this.get$cache[d]=e),e},Commander.prototype._get$=function(a,b,c){var d,e,f,g,h,i,j=this;return h=c.query,i=c.selector,"window"===i?(this.bindToWindow(b),["get","::window["+b+"]"]):(f=h.isMulti,e=c.isContextBound,g=c.isScopeBound,g&&this.bindToScope(b),0===b.indexOf("intrinsic-")&&(h.on("afterChange",function(){return j._processIntrinsics(h,i,b)}),this._processIntrinsics(h,i,b)),e?(d=c.idProcessor,{isQueryBound:!0,isPlural:a.isPlural||!1,query:h,spawn:function(c,e,f){var g;if(f&&f!==h)e||(e=(f||h).selector);else if(d&&(g=c,c=d(c)),a.spawn)return a.spawn(c,this,g,f);return["get$",b,"$"+c,e||i]}}):{isQueryBound:!0,isPlural:f,query:h,spawn:function(){var a,c,d,e,g;if(!f)return a=h.lastAddedIds[h.lastAddedIds.length-1],["get$",b,"$"+a,i];for(c=[],g=h.lastAddedIds,d=0,e=g.length;e>d;d++)a=g[d],c.push(["get$",b,"$"+a,i]);return c}})},Commander.prototype._processIntrinsics=function(a,b,c){var d=this;return a.lastAddedIds.forEach(function(a){var e,f,g,h,i;return g="$"+a,d.intrinsicRegistersById[g]||(d.intrinsicRegistersById[g]={}),d.intrinsicRegistersById[g][c]?void 0:(e=c.split("intrinsic-")[1],h=""+g+"["+c+"]",f=d.engine,i=function(){var d;return d=f.measureByGssId(a,e),f.vars[h]!==d&&f.registerCommand(["suggest",["get$",c,g,b],["number",d],"required"]),f.setNeedsMeasure(!0)},d.intrinsicRegistersById[g][c]=i,i.call(d))})},Commander.prototype.number=function(a,b){return["number",b]},Commander.prototype.plus=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["plus",b,c])},Commander.prototype.minus=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["minus",b,c])},Commander.prototype.multiply=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["multiply",b,c])},Commander.prototype.divide=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["divide",b,c])},Commander.prototype.cond=function(a){return this.registerSpawn(a)},Commander.prototype.where=function(a,b){var c;return c=a.isContextBound?["where",b,{spawn:function(a){return"-context-"+a}}]:["where",b],this.makeNonRootSpawnableIfNeeded(c)},Commander.prototype.clause=function(a,b,c){var d;return d=a.isContextBound?["clause",b,{spawn:function(a){return a?c+"-context-"+a:c}}]:["clause",b,c],this.makeNonRootSpawnableIfNeeded(d)},Commander.prototype["?>="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?>=",b,c])},Commander.prototype["?<="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?<=",b,c])},Commander.prototype["?=="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?==",b,c])},Commander.prototype["?!="]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?!=",b,c])},Commander.prototype["?>"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?>",b,c])},Commander.prototype["?<"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["?<",b,c])},Commander.prototype["&&"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["&&",b,c])},Commander.prototype["||"]=function(a,b,c){return this.makeNonRootSpawnableIfNeeded(["||",b,c])},Commander.prototype.strength=function(a,b){return["strength",b]},Commander.prototype.suggest=function(){var a;return a=__slice.call(arguments),this.engine.registerCommand(["suggest"].concat(__slice.call(a.slice(1,a.length))))},Commander.prototype.eq=function(a){return this.registerSpawn(a)},Commander.prototype.lte=function(a){return this.registerSpawn(a)},Commander.prototype.gte=function(a){return this.registerSpawn(a)},Commander.prototype.lt=function(a){return this.registerSpawn(a)},Commander.prototype.gt=function(a){return this.registerSpawn(a)},Commander.prototype.stay=function(a){return this.registerSpawn(a)},Commander.prototype.virtual=function(){},Commander.prototype.$virtual=function(a,b){var c,d,e,f,g;if(d=a.parentRule,!d)throw new'Error virtual element "#{name}" requires parent rule for context';return e=d.getContextQuery(),f=e.selector,g=e.selector+(" ::virtual("+b+")"),c=this.queryCommandCache[g],c||(c={query:e,selector:f,selectorKey:g,isContextBound:!0,idProcessor:function(a){return a+'"'+b+'"'}},this.queryCommandCache[g]=c),bindRootAsContext(a,e),c},Commander.prototype.$class=function(a,b,c){var d,e,f,g=this;return f="."+b,d=this.queryCommandCache[f],d||(e=this.engine.registerDomQuery({selector:f,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).getElementsByClassName(b)}}),d={query:e,selector:f},this.queryCommandCache[f]=d),bindRootAsMulti(a,d.query),d},Commander.prototype.$tag=function(a,b,c){var d,e,f,g=this;return f=b,d=this.queryCommandCache[f],d||(e=this.engine.registerDomQuery({selector:f,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).getElementsByTagName(b)}}),d={query:e,selector:f},this.queryCommandCache[f]=d),bindRootAsMulti(a,d.query),d},Commander.prototype.$all=function(a,b,c,d){var e,f,g=this;return d||(d=b),e=this.queryCommandCache[d],e||(f=this.engine.registerDomQuery({selector:d,isMulti:!0,isLive:!1,createNodeList:function(){return g.engine.getQueryScopeById(c).querySelectorAll(b) }}),e={query:f,selector:d},this.queryCommandCache[d]=e),bindRootAsMulti(a,e.query),e},Commander.prototype.$id=function(a,b){var c,d,e;return e="#"+b,c=this.queryCommandCache[e],c||(d=this.engine.registerDomQuery({selector:e,isMulti:!1,isLive:!1,createNodeList:function(){var a;return a=document.getElementById(b),a?[a]:[]}}),c={query:d,selector:e},this.queryCommandCache[e]=c),bindRoot(a,c.query),c},Commander.prototype["::this"]=function(a,b,c,d,e){return{isContextBound:!0,selectorKey:e,selector:d}},Commander.prototype["::parent"]=function(a,b,c,d,e){return{isContextBound:!0,selector:e,idProcessor:function(a){return GSS.setupId(GSS.getById(a).parentElement)}}},Commander.prototype["::window"]=function(){return{selector:"window",query:null}},Commander.prototype["::scope"]=function(a,b,c,d,e){return{idProcessor:function(){return GSS.getId(c.scope)},isContextBound:!!b,isScopeBound:!b,selector:e,query:!b&&c.registerDomQuery({selector:"::scope",isMulti:!1,isLive:!0,createNodeList:function(){return[c.scope]}})}},Commander.prototype.$reserved=function(a,b,c){var d,e,f,g,h,i;if(":"===b.charAt(0)?(h=b,b=b.substring(2)):h="::"+b,"window"===b)f=g=b;else if("scope"!==b||c){if(e=a.parentRule,!e)throw new Error(h+" query requires parent rule for context");i=e.getContextQuery(),f=i.selector,g=f+h}else f=g=h;return d=this.queryCommandCache[g],d||(d=this[h](a,c,this.engine,f,g),d.isContextBound&&(d.query=i),this.queryCommandCache[g]=d),d.isContextBound?bindRootAsContext(a,d.query):d.query&&bindRoot(a,d.query),c&&this.bindRootSubselector(a,d,c),d},Commander.prototype.chain=function(a,b){var c,d,e,f,g,h,i,j,k,l;for(h=b.query,c=__slice.call(arguments),e=__slice.call(c.slice(2,c.length)),f=this.engine,g=null,i=0,k=e.length;k>i;i++)d=e[i],"function"!=typeof d&&(g||(g=[]),g.push(d),e.splice(e.indexOf(d),1));for(j=0,l=e.length;l>j;j++)d=e[j],d.call(f,h,f,g);return h.on("afterChange",function(){var a,b,c;for(c=[],a=0,b=e.length;b>a;a++)d=e[a],c.push(d.call(f,h,f,g));return c})},Commander.prototype["eq-chain"]=function(a,b,c,d,e){return this._chainer("eq",b,c,d,e)},Commander.prototype["lte-chain"]=function(a,b,c,d,e){return this._chainer("lte",b,c,d,e)},Commander.prototype["gte-chain"]=function(a,b,c,d,e){return this._chainer("gte",b,c,d,e)},Commander.prototype["lt-chain"]=function(a,b,c,d,e){return this._chainer("lt",b,c,d,e)},Commander.prototype["gt-chain"]=function(a,b,c,d,e){return this._chainer("gt",b,c,d,e)},Commander.prototype._chainer=function(a,b,c,d,e){var f,g,h;return g="eq-chain-"+GSS.uid(),f=this.engine,h=this._e_for_chain,function(f,i,j){return i.remove(g),f.forEach(function(k){var l,m,n;return(n=f.next(k))?(l=h(k,b,f,g,k,n),m=h(n,c,f,g,k,n),i[a](l,m,d,e,j)):void 0})}},Commander.prototype["plus-chain"]=function(a,b,c){return this._chainer_math(b,c,"plus")},Commander.prototype["minus-chain"]=function(a,b,c){return this._chainer_math(b,c,"minus")},Commander.prototype["multiply-chain"]=function(a,b,c){return this._chainer_math(b,c,"multiply")},Commander.prototype["divide-chain"]=function(a,b,c){return this._chainer_math(b,c,"divide")},Commander.prototype._chainer_math=function(a,b,c){var d,e;return d=this.engine,e=this._e_for_chain,function(f,g,h,i){var j,k;return j=e(f,a,h,i),k=e(g,b,h,i),d[c](j,k)}},Commander.prototype._e_for_chain=function(a,b,c,d,e,f){var g;return g="string"==typeof b?this.engine.elVar(a,b,c.selector):"function"==typeof b?b.call(this,e,f,c,d):b},Commander.prototype["for-each"]=function(a,b,c){var d,e,f,g,h;for(e=b.query,h=e.nodeList,f=0,g=h.length;g>f;f++)d=h[f],c.call(this.engine,d,e,this.engine);return e.on("afterChange",function(){var a,b,f,g;for(f=e.nodeList,g=[],a=0,b=f.length;b>a;a++)d=f[a],g.push(c.call(this.engine,d,e));return g})},Commander.prototype["for-all"]=function(a,b,c){var d,e=this;return d=b.query,c.call(this.engine,d,this.engine),d.on("afterChange",function(){return c.call(e.engine,d,e.engine)})},Commander.prototype.js=function(root,js){return eval("var callback ="+js),callback},Commander}(),module.exports=Commander}),require.register("gss/lib/Thread.js",function(a,b,d){var e,f,g,h=[].slice;g=function(a){var b;if(b=a.value,null!=b)return b;if(b=Number(a),null!=b)return b;throw new Error("Thread.valueOf couldn't find value of: "+a)},f=function(a){return"cond"===a[0]?!1:!0},e=function(){function a(a){var b;null==a&&(a={}),b=a.defaultStrength||"required",this.defaultStrength=c.Strength[b],this.defaultStrength||(this.defaultStrength=c.Strength.required),this.defaultWeight=a.defaultWeight||0,this.setupIfNeeded()}return a.prototype.needsSetup=!0,a.prototype.setupIfNeeded=function(){return this.needsSetup?(this.needsSetup=!1,this.solver=new c.SimplexSolver,this.solver.autoSolve=!1,this.cachedVars={},this.elements={},this.constraintsByTracker={},this.varIdsByTracker={},this.conditionals=[],this.activeClauses=[],this.__editVarNames=[],this):this},a.prototype.postMessage=function(a){return this.execute(a),this},a.prototype.terminate=function(){return this.needsSetup=!0,this.solver=null,this.cachedVars=null,this.constraintsByTracker=null,this.varIdsByTracker=null,this.conditionals=null,this.activeClauses=null,this.__editVarNames=null,this},a.prototype.output=function(){return{values:this.getValues(),clauses:this.activeClauses}},a.prototype.execute=function(a){var b,c,d,e,f;for(this.setupIfNeeded(),c=null,a.uuid&&(c=a.uuid),f=a.commands,d=0,e=f.length;e>d;d++)b=f[d],this._trackRootIfNeeded(b,c),this._execute(b,b);return this},a.prototype._execute=function(a,b){var c,d,e,f,g;if(e=a,c=this[e[0]],null==c)throw new Error("Thread.execute broke - couldn't find method: "+e[0]);for(d=e.length-1;d>0;)f=e[d],f instanceof Array&&(g=this._execute(f,b),"IGNORE"===g?e.splice(d,1):e.splice(d,1,g)),d--;return c.call.apply(c,[this,b].concat(h.call(e.slice(1,e.length))))},a.prototype.getValues=function(){var a,b;this._solve(),b={};for(a in this.cachedVars)b[a]=this.cachedVars[a].value;return b},a.prototype._solve=function(a){var b,c,d,e;if(null==a&&(a=0),this.solver.solve(),this.conditionals.length>0&&0===a){for(e=this.conditionals,c=0,d=e.length;d>c;c++)b=e[c],b.update();return a++,this._solve(a)}},a.prototype.virtual=function(a){return a},a.prototype.track=function(a,b){return this._trackRootIfNeeded(a,b),"IGNORE"},a.prototype._trackRootIfNeeded=function(a,b){return b&&(a._is_tracked=!0,a._trackers||(a._trackers=[]),-1===a._trackers.indexOf(b))?a._trackers.push(b):void 0},a.prototype.remove=function(){var a,b,c,d,e,f;for(a=h.call(arguments),c=h.call(a.slice(1,a.length)),f=[],d=0,e=c.length;e>d;d++)b=c[d],f.push(this._remove(b));return f},a.prototype._remove=function(a){return this._removeConstraintByTracker(a),this._removeVarByTracker(a)},a.prototype._removeVarByTracker=function(a){var b,c,d,e,f;if(this.varIdsByTracker[a]){for(f=this.varIdsByTracker[a],d=0,e=f.length;e>d;d++)b=f[d],delete this.cachedVars[b],c=this.__editVarNames.indexOf(b),c>=0&&this.__editVarNames.splice(c,1);return delete this.varIdsByTracker[a]}},a.prototype._removeConstraintByTracker=function(a,b){var c,d,e,f;if(null==b&&(b=!0),this.constraintsByTracker[a]){for(f=this.constraintsByTracker[a],d=0,e=f.length;e>d;d++)c=f[d],c._gss_removed||(this.solver.removeConstraint(c),c._gss_removed=!0);if(b)return this.constraintsByTracker[a]=null}},a.prototype._addConstraintByTracker=function(a){var b,c,d,e,f;if(this.constraintsByTracker[a]){for(e=this.constraintsByTracker[a],f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(this.solver.addConstraint(b));return f}},a.prototype.where=function(a,b,c){return a._condition_bound=!0,this._trackRootIfNeeded(a,b),this._trackRootIfNeeded(a,b+c),"IGNORE"},a.prototype.cond=function(){var a,b,c,d,e,f,g;for(a=h.call(arguments),c=[],g=a.slice(1,a.length),e=0,f=g.length;f>e;e++)b=g[e],c.push(b);return d=this,this.conditionals.push({clauses:c,activeLabel:null,update:function(){var a,e,f,g,h;for(a=!1,f=this.activeLabel,g=0,h=c.length;h>g;g++)if(b=c[g],e=b.test()){a=!0;break}if(a){if(f!==e)return null!=f&&(d.activeClauses.splice(d.activeClauses.indexOf(f),1),d._removeConstraintByTracker(f,!1)),d._addConstraintByTracker(e),d.activeClauses.push(e),this.activeLabel=e}else if(null!=f)return d.activeClauses.splice(d.activeClauses.indexOf(f),1),d._removeConstraintByTracker(f,!1)}})},a.prototype.clause=function(a,b,c){return{label:c,test:function(){return c?b?b.call(this)?c:null:c:b}}},a.prototype["?>="]=function(a,b,c){return function(){return g(b)>=g(c)}},a.prototype["?<="]=function(a,b,c){return function(){return g(b)<=g(c)}},a.prototype["?=="]=function(a,b,c){return function(){return g(b)===g(c)}},a.prototype["?>"]=function(a,b,c){return function(){return g(b)>g(c)}},a.prototype["?<"]=function(a,b,c){return function(){return g(b)d;d++)c=f[d],this.constraintsByTracker[c]||(this.constraintsByTracker[c]=[]),this.constraintsByTracker[c].push(b);return b},a.prototype.eq=function(a,b,d,e,f){return this._addConstraint(a,new c.Equation(b,d,this._strength(e),this._weight(f)))},a.prototype.lte=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.LEQ,d,this._strength(e),this._weight(f)))},a.prototype.gte=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.GEQ,d,this._strength(e),this._weight(f)))},a.prototype.lt=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.LEQ,d,this._strength(e),this._weight(f)))},a.prototype.gt=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.GEQ,d,this._strength(e),this._weight(f)))},a.prototype._editvar=function(a,b,c){return-1===this.__editVarNames.indexOf(a.name)&&(this.__editVarNames.push(a.name),this.solver.addEditVar(a,this._strength(b),this._weight(c))),this},a.prototype.suggest=function(a,b,c,d,e){return null==d&&(d="strong"),"string"==typeof b&&(b=this.get(a,b)),this.solver.solve(),this._editvar(b,d,e),this.solver.suggestValue(b,c),this.solver.resolve()},a.prototype.stay=function(){var a,b,c,d,e;for(a=h.call(arguments),e=a.slice(1,a.length),c=0,d=e.length;d>c;c++)b=e[c],this.solver.addStay(b);return this.solver},a}(),("undefined"!=typeof d&&null!==d?d.exports:void 0)&&(d.exports=e)}),require.register("gss/lib/dom/Getter.js",function(a,b,c){var d,e,f;e=function(){var a,b,c,d;return a=document.createElement("p"),a.style.width="100%",a.style.height="200px",b=document.createElement("div"),b.style.position="absolute",b.style.top="0px",b.style.left="0px",b.style.visibility="hidden",b.style.width="200px",b.style.height="150px",b.style.overflow="hidden",b.style.zoom="document",b.appendChild(a),document.body.appendChild(b),c=a.offsetWidth,b.style.overflow="scroll",d=a.offsetWidth,c===d&&(d=b.clientWidth),document.body.removeChild(b),c-d},f=null,d=function(){function a(a){this.scope=a,this.styleNodes=null,this.scope||(this.scope=document)}return a.prototype.clean=function(){},a.prototype.destroy=function(){return this.scope=null,this.styleNodes=null},a.prototype.scrollbarWidth=function(){return f||(f=e()),f},a.prototype.get=function(a){var b,c;switch(c=a[0],b=a[1],c){case"$reserved":if("this"===b)return this.scope;break;case"$id":return"#"===b[0]&&(b=b.substr(1)),document.getElementById(b);case"$class":return"."===b[0]&&(b=b.substr(1)),this.scope.getElementsByClassName(b);case"$tag":return this.scope.getElementsByTagName(b)}return this.scope.querySelectorAll(b)},a.prototype.measure=function(a,b){var c;switch(b){case"width":case"w":return a.getBoundingClientRect().width;case"height":case"h":return a.getBoundingClientRect().height;case"left":case"x":return c=window.scrollX||window.scrollLeft||0,a.getBoundingClientRect().left+c;case"top":case"y":return c=window.scrollY||window.scrollTop||0,a.getBoundingClientRect().top+c;case"bottom":return this.measure(a,"top")+this.measure(a,"height");case"right":return this.measure(a,"left")+this.measure(a,"width");case"centerX":return this.measure(a,"left")+this.measure(a,"width")/2;case"centerY":return this.measure(a,"top")+this.measure(a,"height")/2}},a.prototype.offsets=function(a){var b;if(b={x:0,y:0},!a.offsetParent)return b;for(a=a.offsetParent;;){if(b.x+=a.offsetLeft,b.y+=a.offsetTop,!a.offsetParent)break;a=a.offsetParent}return b},a.prototype.view=function(a){return"string"==typeof a?GSS.View.byId[a]:GSS.View.byId[GSS.getId(a)]},a.prototype.getAllStyleNodes=function(){return this.scope.getElementsByTagName("style")},a.prototype.readAllASTs=function(){var a,b,c,d,e,f;for(b=[],f=this.getAllStyleNodes(),d=0,e=f.length;e>d;d++)c=f[d],a=this.readAST(c),a&&b.push(a);return b},a.prototype.scopeFor=function(a){return this.isStyleNode(a)?this.scopeForStyleNode(a):this.nearestScope(a)},a.prototype.isStyleNode=function(a){var b,c;return c=null!=a?a.tagName:void 0,"STYLE"!==c&&"LINK"!==c||!(b="function"==typeof a.getAttribute?a.getAttribute("type"):void 0)?!1:0===b.indexOf("text/gss")},a.prototype.scopeForStyleNode=function(b){var c;return c=b.getAttribute("scoped"),null!=c&&"false"!==c?b.parentElement:a.getRootScope()},a.prototype.isScope=function(a){return!!(null!=a?a._gss_is_scope:void 0)},a.prototype.nearestScope=function(a,b){for(null==b&&(b=!1),b&&(a=a.parentElement);a.parentElement;){if(this.isScope(a))return a;a=a.parentElement}return null},a.prototype.nearestEngine=function(a,b){var c;return null==b&&(b=!1),c=this.nearestScope(a,b),c?this.engine(c):null},a.prototype.descdendantNodes=function(a){return a.getElementsByTagName("*")},a.prototype.engine=function(a){return GSS.engines.byId[GSS.getId(a)]},a.prototype.readAST=function(a){var b,c;return b=a.getAttribute("type"),c=this["readAST:"+b],c?c.call(this,a):null},a.prototype["readAST:text/gss-ast"]=function(a){var b,c,d;if(d=a.textContent.trim(),0===d.length)return{};try{b=JSON.parse(d)}catch(e){c=e,console.error("Parsing compiled gss error",console.dir(c))}return b},a.prototype["readAST:text/gss"]=function(){throw new Error("did not include GSS's compilers")},a}(),d.getRootScope=function(){return"undefined"==typeof ShadowDOMPolyfill||null===ShadowDOMPolyfill?document.body:ShadowDOMPolyfill.wrap(document.body)},c.exports=d}),require.register("gss/lib/dom/IdMixin.js",function(a,b,c){var d,e;e=GSS._.boxSizingPrefix,d={uid:function(){return this._id_counter++},_id_counter:1,_byIdCache:{},_ids_killed:function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this._id_killed(b));return e},_id_killed:function(a){var b;return this._byIdCache[a]=null,delete this._byIdCache[a],null!=(b=GSS.View.byId[a])&&"function"==typeof b.recycle?b.recycle():void 0},getById:function(a){var b;return this._byIdCache[a]?this._byIdCache[a]:(b=document.querySelector('[data-gss-id="'+a+'"]'),b&&(this._byIdCache[a]=b),b)},setupScopeId:function(a){return a._gss_is_scope=!0,this.setupId(a)},setupId:function(a){var b,c;return a?(b=this.getId(a),null==b&&(c=this.uid(),b=String(a.id||c),a.setAttribute("data-gss-id",b),a.style[e]="border-box",a._gss_id=b,GSS.View["new"]({el:a,id:b})),this._byIdCache[b]=a,b):null},getId:function(a){return(null!=a?a._gss_id:void 0)?null!=a?a._gss_id:void 0:null}},c.exports=d}),require.register("gss/vendor/gl-matrix.js",function(a){!function(b){"use strict";var c={};"undefined"==typeof a?"function"==typeof define&&"object"==typeof define.amd&&define.amd?(c.exports={},define(function(){return c.exports})):c.exports="undefined"!=typeof window?window:b:c.exports=a,function(a){if(!b)var b=1e-6;if(!c)var c="undefined"!=typeof Float32Array?Float32Array:Array;if(!d)var d=Math.random;var e={};e.setMatrixArrayType=function(a){c=a},"undefined"!=typeof a&&(a.glMatrix=e);var f=Math.PI/180;e.toRadian=function(a){return a*f};var g={};g.create=function(){var a=new c(2);return a[0]=0,a[1]=0,a},g.clone=function(a){var b=new c(2);return b[0]=a[0],b[1]=a[1],b},g.fromValues=function(a,b){var d=new c(2);return d[0]=a,d[1]=b,d},g.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a},g.set=function(a,b,c){return a[0]=b,a[1]=c,a},g.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a},g.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a},g.sub=g.subtract,g.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a},g.mul=g.multiply,g.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a},g.div=g.divide,g.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a},g.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a},g.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a},g.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a},g.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},g.dist=g.distance,g.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d},g.sqrDist=g.squaredDistance,g.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},g.len=g.length,g.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},g.sqrLen=g.squaredLength,g.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a},g.normalize=function(a,b){var c=b[0],d=b[1],e=c*c+d*d;return e>0&&(e=1/Math.sqrt(e),a[0]=b[0]*e,a[1]=b[1]*e),a},g.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},g.cross=function(a,b,c){var d=b[0]*c[1]-b[1]*c[0];return a[0]=a[1]=0,a[2]=d,a},g.lerp=function(a,b,c,d){var e=b[0],f=b[1];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a},g.random=function(a,b){b=b||1;var c=2*d()*Math.PI;return a[0]=Math.cos(c)*b,a[1]=Math.sin(c)*b,a},g.transformMat2=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e,a[1]=c[1]*d+c[3]*e,a},g.transformMat2d=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e+c[4],a[1]=c[1]*d+c[3]*e+c[5],a},g.transformMat3=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[3]*e+c[6],a[1]=c[1]*d+c[4]*e+c[7],a},g.transformMat4=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[4]*e+c[12],a[1]=c[1]*d+c[5]*e+c[13],a},g.forEach=function(){var a=g.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=2),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],f(a,a,g),b[h]=a[0],b[h+1]=a[1];return b}}(),g.str=function(a){return"vec2("+a[0]+", "+a[1]+")"},"undefined"!=typeof a&&(a.vec2=g);var h={};h.create=function(){var a=new c(3);return a[0]=0,a[1]=0,a[2]=0,a},h.clone=function(a){var b=new c(3);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b},h.fromValues=function(a,b,d){var e=new c(3);return e[0]=a,e[1]=b,e[2]=d,e},h.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a},h.set=function(a,b,c,d){return a[0]=b,a[1]=c,a[2]=d,a},h.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a},h.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a},h.sub=h.subtract,h.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a},h.mul=h.multiply,h.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a},h.div=h.divide,h.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a},h.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a},h.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a},h.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a},h.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)},h.dist=h.distance,h.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return c*c+d*d+e*e},h.sqrDist=h.squaredDistance,h.length=function(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)},h.len=h.length,h.squaredLength=function(a){var b=a[0],c=a[1],d=a[2];return b*b+c*c+d*d},h.sqrLen=h.squaredLength,h.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a},h.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a},h.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},h.cross=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a},h.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a},h.random=function(a,b){b=b||1;var c=2*d()*Math.PI,e=2*d()-1,f=Math.sqrt(1-e*e)*b;return a[0]=Math.cos(c)*f,a[1]=Math.sin(c)*f,a[2]=e*b,a},h.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12],a[1]=c[1]*d+c[5]*e+c[9]*f+c[13],a[2]=c[2]*d+c[6]*e+c[10]*f+c[14],a},h.transformMat3=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=d*c[0]+e*c[3]+f*c[6],a[1]=d*c[1]+e*c[4]+f*c[7],a[2]=d*c[2]+e*c[5]+f*c[8],a},h.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},h.forEach=function(){var a=h.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=3),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2];return b}}(),h.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"},"undefined"!=typeof a&&(a.vec3=h);var i={};i.create=function(){var a=new c(4);return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a},i.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},i.fromValues=function(a,b,d,e){var f=new c(4);return f[0]=a,f[1]=b,f[2]=d,f[3]=e,f},i.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},i.set=function(a,b,c,d,e){return a[0]=b,a[1]=c,a[2]=d,a[3]=e,a},i.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a[3]=b[3]+c[3],a},i.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a[3]=b[3]-c[3],a},i.sub=i.subtract,i.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a[3]=b[3]*c[3],a},i.mul=i.multiply,i.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a[3]=b[3]/c[3],a},i.div=i.divide,i.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a[3]=Math.min(b[3],c[3]),a},i.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a[3]=Math.max(b[3],c[3]),a},i.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a[3]=b[3]*c,a},i.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a[3]=b[3]+c[3]*d,a},i.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return Math.sqrt(c*c+d*d+e*e+f*f)},i.dist=i.distance,i.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return c*c+d*d+e*e+f*f},i.sqrDist=i.squaredDistance,i.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},i.len=i.length,i.squaredLength=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return b*b+c*c+d*d+e*e},i.sqrLen=i.squaredLength,i.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=-b[3],a},i.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f;return g>0&&(g=1/Math.sqrt(g),a[0]=b[0]*g,a[1]=b[1]*g,a[2]=b[2]*g,a[3]=b[3]*g),a},i.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},i.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[3];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a[3]=h+d*(c[3]-h),a},i.random=function(a,b){return b=b||1,a[0]=d(),a[1]=d(),a[2]=d(),a[3]=d(),i.normalize(a,a),i.scale(a,a,b),a},i.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a},i.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},i.forEach=function(){var a=i.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=4),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],a[3]=b[h+3],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2],b[h+3]=a[3];return b}}(),i.str=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.vec4=i);var j={};j.create=function(){var a=new c(4);return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},j.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},j.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},j.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},j.transpose=function(a,b){if(a===b){var c=b[1];a[1]=b[2],a[2]=c}else a[0]=b[0],a[1]=b[2],a[2]=b[1],a[3]=b[3];return a},j.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;return g?(g=1/g,a[0]=f*g,a[1]=-d*g,a[2]=-e*g,a[3]=c*g,a):null},j.adjoint=function(a,b){var c=b[0];return a[0]=b[3],a[1]=-b[1],a[2]=-b[2],a[3]=c,a},j.determinant=function(a){return a[0]*a[3]-a[2]*a[1]},j.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*h+e*j,a[1]=d*i+e*k,a[2]=f*h+g*j,a[3]=f*i+g*k,a},j.mul=j.multiply,j.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=d*-h+e*i,a[2]=f*i+g*h,a[3]=f*-h+g*i,a},j.scale=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1];return a[0]=d*h,a[1]=e*i,a[2]=f*h,a[3]=g*i,a},j.str=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.mat2=j);var k={};k.create=function(){var a=new c(6);return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a},k.clone=function(a){var b=new c(6);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b},k.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a},k.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a},k.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=c*f-d*e;return i?(i=1/i,a[0]=f*i,a[1]=-d*i,a[2]=-e*i,a[3]=c*i,a[4]=(e*h-f*g)*i,a[5]=(d*g-c*h)*i,a):null},k.determinant=function(a){return a[0]*a[3]-a[1]*a[2]},k.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=c[0],k=c[1],l=c[2],m=c[3],n=c[4],o=c[5];return a[0]=d*j+e*l,a[1]=d*k+e*m,a[2]=f*j+g*l,a[3]=f*k+g*m,a[4]=j*h+l*i+n,a[5]=k*h+m*i+o,a},k.mul=k.multiply,k.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=Math.sin(c),k=Math.cos(c);return a[0]=d*k+e*j,a[1]=-d*j+e*k,a[2]=f*k+g*j,a[3]=-f*j+k*g,a[4]=k*h+j*i,a[5]=k*i-j*h,a},k.scale=function(a,b,c){var d=c[0],e=c[1];return a[0]=b[0]*d,a[1]=b[1]*e,a[2]=b[2]*d,a[3]=b[3]*e,a[4]=b[4]*d,a[5]=b[5]*e,a},k.translate=function(a,b,c){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4]+c[0],a[5]=b[5]+c[1],a},k.str=function(a){return"mat2d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"},"undefined"!=typeof a&&(a.mat2d=k);var l={};l.create=function(){var a=new c(9);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},l.fromMat4=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[4],a[4]=b[5],a[5]=b[6],a[6]=b[8],a[7]=b[9],a[8]=b[10],a},l.clone=function(a){var b=new c(9);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b},l.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a},l.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},l.transpose=function(a,b){if(a===b){var c=b[1],d=b[2],e=b[5];a[1]=b[3],a[2]=b[6],a[3]=c,a[5]=b[7],a[6]=d,a[7]=e}else a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8];return a},l.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=k*g-h*j,m=-k*f+h*i,n=j*f-g*i,o=c*l+d*m+e*n;return o?(o=1/o,a[0]=l*o,a[1]=(-k*d+e*j)*o,a[2]=(h*d-e*g)*o,a[3]=m*o,a[4]=(k*c-e*i)*o,a[5]=(-h*c+e*f)*o,a[6]=n*o,a[7]=(-j*c+d*i)*o,a[8]=(g*c-d*f)*o,a):null},l.adjoint=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8];return a[0]=g*k-h*j,a[1]=e*j-d*k,a[2]=d*h-e*g,a[3]=h*i-f*k,a[4]=c*k-e*i,a[5]=e*f-c*h,a[6]=f*j-g*i,a[7]=d*i-c*j,a[8]=c*g-d*f,a},l.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8];return b*(j*f-g*i)+c*(-j*e+g*h)+d*(i*e-f*h)},l.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=c[0],n=c[1],o=c[2],p=c[3],q=c[4],r=c[5],s=c[6],t=c[7],u=c[8];return a[0]=m*d+n*g+o*j,a[1]=m*e+n*h+o*k,a[2]=m*f+n*i+o*l,a[3]=p*d+q*g+r*j,a[4]=p*e+q*h+r*k,a[5]=p*f+q*i+r*l,a[6]=s*d+t*g+u*j,a[7]=s*e+t*h+u*k,a[8]=s*f+t*i+u*l,a},l.mul=l.multiply,l.translate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=c[0],n=c[1];return a[0]=d,a[1]=e,a[2]=f,a[3]=g,a[4]=h,a[5]=i,a[6]=m*d+n*g+j,a[7]=m*e+n*h+k,a[8]=m*f+n*i+l,a},l.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=Math.sin(c),n=Math.cos(c);return a[0]=n*d+m*g,a[1]=n*e+m*h,a[2]=n*f+m*i,a[3]=n*g-m*d,a[4]=n*h-m*e,a[5]=n*i-m*f,a[6]=j,a[7]=k,a[8]=l,a},l.scale=function(a,b,c){var d=c[0],e=c[1];return a[0]=d*b[0],a[1]=d*b[1],a[2]=d*b[2],a[3]=e*b[3],a[4]=e*b[4],a[5]=e*b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a},l.fromMat2d=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=0,a[3]=b[2],a[4]=b[3],a[5]=0,a[6]=b[4],a[7]=b[5],a[8]=1,a },l.fromQuat=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,h=d+d,i=e+e,j=c*g,k=d*g,l=d*h,m=e*g,n=e*h,o=e*i,p=f*g,q=f*h,r=f*i;return a[0]=1-l-o,a[3]=k-r,a[6]=m+q,a[1]=k+r,a[4]=1-j-o,a[7]=n-p,a[2]=m-q,a[5]=n+p,a[8]=1-j-l,a},l.normalFromMat4=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(i*A-g*D-j*z)*E,a[2]=(g*C-h*A+j*y)*E,a[3]=(e*C-d*D-f*B)*E,a[4]=(c*D-e*A+f*z)*E,a[5]=(d*A-c*C-f*y)*E,a[6]=(p*x-q*w+r*v)*E,a[7]=(q*u-o*x-r*t)*E,a[8]=(o*w-p*u+r*s)*E,a):null},l.str=function(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"},"undefined"!=typeof a&&(a.mat3=l);var m={};m.create=function(){var a=new c(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},m.clone=function(a){var b=new c(16);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15],b},m.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a},m.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},m.transpose=function(a,b){if(a===b){var c=b[1],d=b[2],e=b[3],f=b[6],g=b[7],h=b[11];a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=c,a[6]=b[9],a[7]=b[13],a[8]=d,a[9]=f,a[11]=b[14],a[12]=e,a[13]=g,a[14]=h}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a},m.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(e*C-d*D-f*B)*E,a[2]=(p*x-q*w+r*v)*E,a[3]=(m*w-l*x-n*v)*E,a[4]=(i*A-g*D-j*z)*E,a[5]=(c*D-e*A+f*z)*E,a[6]=(q*u-o*x-r*t)*E,a[7]=(k*x-m*u+n*t)*E,a[8]=(g*C-h*A+j*y)*E,a[9]=(d*A-c*C-f*y)*E,a[10]=(o*w-p*u+r*s)*E,a[11]=(l*u-k*w-n*s)*E,a[12]=(h*z-g*B-i*y)*E,a[13]=(c*B-d*z+e*y)*E,a[14]=(p*t-o*v-q*s)*E,a[15]=(k*v-l*t+m*s)*E,a):null},m.adjoint=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15];return a[0]=h*(m*r-n*q)-l*(i*r-j*q)+p*(i*n-j*m),a[1]=-(d*(m*r-n*q)-l*(e*r-f*q)+p*(e*n-f*m)),a[2]=d*(i*r-j*q)-h*(e*r-f*q)+p*(e*j-f*i),a[3]=-(d*(i*n-j*m)-h*(e*n-f*m)+l*(e*j-f*i)),a[4]=-(g*(m*r-n*q)-k*(i*r-j*q)+o*(i*n-j*m)),a[5]=c*(m*r-n*q)-k*(e*r-f*q)+o*(e*n-f*m),a[6]=-(c*(i*r-j*q)-g*(e*r-f*q)+o*(e*j-f*i)),a[7]=c*(i*n-j*m)-g*(e*n-f*m)+k*(e*j-f*i),a[8]=g*(l*r-n*p)-k*(h*r-j*p)+o*(h*n-j*l),a[9]=-(c*(l*r-n*p)-k*(d*r-f*p)+o*(d*n-f*l)),a[10]=c*(h*r-j*p)-g*(d*r-f*p)+o*(d*j-f*h),a[11]=-(c*(h*n-j*l)-g*(d*n-f*l)+k*(d*j-f*h)),a[12]=-(g*(l*q-m*p)-k*(h*q-i*p)+o*(h*m-i*l)),a[13]=c*(l*q-m*p)-k*(d*q-e*p)+o*(d*m-e*l),a[14]=-(c*(h*q-i*p)-g*(d*q-e*p)+o*(d*i-e*h)),a[15]=c*(h*m-i*l)-g*(d*m-e*l)+k*(d*i-e*h),a},m.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=b*g-c*f,s=b*h-d*f,t=b*i-e*f,u=c*h-d*g,v=c*i-e*g,w=d*i-e*h,x=j*o-k*n,y=j*p-l*n,z=j*q-m*n,A=k*p-l*o,B=k*q-m*o,C=l*q-m*p;return r*C-s*B+t*A+u*z-v*y+w*x},m.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],p=b[12],q=b[13],r=b[14],s=b[15],t=c[0],u=c[1],v=c[2],w=c[3];return a[0]=t*d+u*h+v*l+w*p,a[1]=t*e+u*i+v*m+w*q,a[2]=t*f+u*j+v*n+w*r,a[3]=t*g+u*k+v*o+w*s,t=c[4],u=c[5],v=c[6],w=c[7],a[4]=t*d+u*h+v*l+w*p,a[5]=t*e+u*i+v*m+w*q,a[6]=t*f+u*j+v*n+w*r,a[7]=t*g+u*k+v*o+w*s,t=c[8],u=c[9],v=c[10],w=c[11],a[8]=t*d+u*h+v*l+w*p,a[9]=t*e+u*i+v*m+w*q,a[10]=t*f+u*j+v*n+w*r,a[11]=t*g+u*k+v*o+w*s,t=c[12],u=c[13],v=c[14],w=c[15],a[12]=t*d+u*h+v*l+w*p,a[13]=t*e+u*i+v*m+w*q,a[14]=t*f+u*j+v*n+w*r,a[15]=t*g+u*k+v*o+w*s,a},m.mul=m.multiply,m.translate=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t=c[0],u=c[1],v=c[2];return d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],p=b[12],q=b[13],r=b[14],s=b[15],a[0]=d+g*t,a[1]=e+g*u,a[2]=f+g*v,a[3]=g,a[4]=h+k*t,a[5]=i+k*u,a[6]=j+k*v,a[7]=k,a[8]=l+o*t,a[9]=m+o*u,a[10]=n+o*v,a[11]=o,a[12]=p+s*t,a[13]=q+s*u,a[14]=r+s*v,a[15]=s,a},m.scale=function(a,b,c){var d=c[0],e=c[1],f=c[2];return a[0]=b[0]*d,a[1]=b[1]*d,a[2]=b[2]*d,a[3]=b[3]*d,a[4]=b[4]*e,a[5]=b[5]*e,a[6]=b[6]*e,a[7]=b[7]*e,a[8]=b[8]*f,a[9]=b[9]*f,a[10]=b[10]*f,a[11]=b[11]*f,a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a},m.rotate=function(a,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=e[0],E=e[1],F=e[2],G=Math.sqrt(D*D+E*E+F*F);return Math.abs(G)g?(h.cross(a,b,e),h.length(a)<1e-6&&h.cross(a,c,e),h.normalize(a,a),n.setAxisAngle(d,a,Math.PI),d):g>.999999?(d[0]=0,d[1]=0,d[2]=0,d[3]=1,d):(h.cross(a,e,f),d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=1+g,n.normalize(d,d))}}(),n.setAxes=function(){var a=l.create();return function(b,c,d,e){return a[0]=d[0],a[3]=d[1],a[6]=d[2],a[1]=e[0],a[4]=e[1],a[7]=e[2],a[2]=-c[0],a[5]=-c[1],a[8]=-c[2],n.normalize(b,n.fromMat3(b,a))}}(),n.clone=i.clone,n.fromValues=i.fromValues,n.copy=i.copy,n.set=i.set,n.identity=function(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a},n.setAxisAngle=function(a,b,c){c=.5*c;var d=Math.sin(c);return a[0]=d*b[0],a[1]=d*b[1],a[2]=d*b[2],a[3]=Math.cos(c),a},n.add=i.add,n.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*k+g*h+e*j-f*i,a[1]=e*k+g*i+f*h-d*j,a[2]=f*k+g*j+d*i-e*h,a[3]=g*k-d*h-e*i-f*j,a},n.mul=n.multiply,n.scale=i.scale,n.rotateX=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+g*h,a[1]=e*i+f*h,a[2]=f*i-e*h,a[3]=g*i-d*h,a},n.rotateY=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i-f*h,a[1]=e*i+g*h,a[2]=f*i+d*h,a[3]=g*i-e*h,a},n.rotateZ=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=e*i-d*h,a[2]=f*i+g*h,a[3]=g*i-f*h,a},n.calculateW=function(a,b){var c=b[0],d=b[1],e=b[2];return a[0]=c,a[1]=d,a[2]=e,a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a},n.dot=i.dot,n.lerp=i.lerp,n.slerp=function(a,b,c,d){var e,f,g,h,i,j=b[0],k=b[1],l=b[2],m=b[3],n=c[0],o=c[1],p=c[2],q=c[3];return f=j*n+k*o+l*p+m*q,0>f&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-d)*e)/g,i=Math.sin(d*e)/g):(h=1-d,i=d),a[0]=h*j+i*n,a[1]=h*k+i*o,a[2]=h*l+i*p,a[3]=h*m+i*q,a},n.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f,h=g?1/g:0;return a[0]=-c*h,a[1]=-d*h,a[2]=-e*h,a[3]=f*h,a},n.conjugate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=b[3],a},n.length=i.length,n.len=n.length,n.squaredLength=i.squaredLength,n.sqrLen=n.squaredLength,n.normalize=i.normalize,n.fromMat3=function(a,b){var c,d=b[0]+b[4]+b[8];if(d>0)c=Math.sqrt(d+1),a[3]=.5*c,c=.5/c,a[0]=(b[7]-b[5])*c,a[1]=(b[2]-b[6])*c,a[2]=(b[3]-b[1])*c;else{var e=0;b[4]>b[0]&&(e=1),b[8]>b[3*e+e]&&(e=2);var f=(e+1)%3,g=(e+2)%3;c=Math.sqrt(b[3*e+e]-b[3*f+f]-b[3*g+g]+1),a[e]=.5*c,c=.5/c,a[3]=(b[3*g+f]-b[3*f+g])*c,a[f]=(b[3*f+e]+b[3*e+f])*c,a[g]=(b[3*g+e]+b[3*e+g])*c}return a},n.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.quat=n)}(c.exports)}(this)}),require.register("the-gss-preparser/component.json",function(a,b,c){c.exports={name:"gss-preparser",description:"GSS preparser",author:"Dan Tocchini ",repo:"the-gss/preparser",version:"1.0.5-beta",json:["component.json"],remotes:["https://raw.githubusercontent.com"],scripts:["lib/gss-preparser.js"],main:"lib/gss-preparser.js"}}),require.register("the-gss-ccss-compiler/component.json",function(a,b,c){c.exports={name:"ccss-compiler",description:"Constraint Cascading Style Sheets compiler",author:"Dan Tocchini ",repo:"the-gss/ccss-compiler",version:"1.0.10-beta",json:["component.json"],remotes:["https://raw.githubusercontent.com"],scripts:["lib/ccss-compiler.js","lib/grammar.js"],main:"lib/ccss-compiler.js"}}),require.register("the-gss-compiler/component.json",function(a,b,c){c.exports={name:"gss-compiler",description:"GSS rule compiler",version:"0.8.2",author:"Dan Tocchini ",repo:"the-gss/compiler",scripts:["lib/gss-compiler.js"],remotes:["https://raw.githubusercontent.com"],json:["component.json"],dependencies:{"the-gss/preparser":"*","the-gss/ccss-compiler":"*","the-gss/vfl-compiler":"*","the-gss/vgl-compiler":"*"},main:"lib/gss-compiler.js"}}),require.register("gss/component.json",function(a,b,c){c.exports={name:"gss",repo:"the-gss/engine",description:"GSS runtime",version:"1.0.4-beta",author:"Dan Tocchini ",repo:"the-gss/engine",json:["component.json"],remotes:["https://raw.githubusercontent.com"],scripts:["lib/GSS-with-compiler.js","lib/GSS.js","lib/_.js","lib/EventTrigger.js","lib/dom/Query.js","lib/dom/View.js","lib/dom/Observer.js","lib/gssom/Node.js","lib/gssom/StyleSheet.js","lib/gssom/Rule.js","lib/Engine.js","lib/Commander.js","lib/Thread.js","lib/dom/Getter.js","lib/dom/IdMixin.js","vendor/gl-matrix.js"],dependencies:{"the-gss/compiler":"*","d4tocchini/customevent-polyfill":"*","slightlyoff/cassowary.js":"*"},files:["vendor/observe.js","vendor/sidetable.js","vendor/MutationObserver.js"],main:"lib/GSS-with-compiler.js"}}),require.alias("the-gss-compiler/lib/gss-compiler.js","gss/deps/gss-compiler/lib/gss-compiler.js"),require.alias("the-gss-compiler/lib/gss-compiler.js","gss/deps/gss-compiler/index.js"),require.alias("the-gss-compiler/lib/gss-compiler.js","gss-compiler/index.js"),require.alias("the-gss-preparser/lib/gss-preparser.js","the-gss-compiler/deps/gss-preparser/lib/gss-preparser.js"),require.alias("the-gss-preparser/lib/gss-preparser.js","the-gss-compiler/deps/gss-preparser/index.js"),require.alias("the-gss-preparser/lib/gss-preparser.js","the-gss-preparser/index.js"),require.alias("the-gss-ccss-compiler/lib/ccss-compiler.js","the-gss-compiler/deps/ccss-compiler/lib/ccss-compiler.js"),require.alias("the-gss-ccss-compiler/lib/grammar.js","the-gss-compiler/deps/ccss-compiler/lib/grammar.js"),require.alias("the-gss-ccss-compiler/lib/ccss-compiler.js","the-gss-compiler/deps/ccss-compiler/index.js"),require.alias("the-gss-ccss-compiler/lib/ccss-compiler.js","the-gss-ccss-compiler/index.js"),require.alias("the-gss-vfl-compiler/lib/vfl-compiler.js","the-gss-compiler/deps/vfl-compiler/lib/vfl-compiler.js"),require.alias("the-gss-vfl-compiler/lib/compiler.js","the-gss-compiler/deps/vfl-compiler/lib/compiler.js"),require.alias("the-gss-vfl-compiler/lib/compiler.js","the-gss-compiler/deps/vfl-compiler/index.js"),require.alias("the-gss-vfl-compiler/lib/compiler.js","the-gss-vfl-compiler/index.js"),require.alias("the-gss-vgl-compiler/lib/vgl-compiler.js","the-gss-compiler/deps/vgl-compiler/lib/vgl-compiler.js"),require.alias("the-gss-vgl-compiler/lib/compiler.js","the-gss-compiler/deps/vgl-compiler/lib/compiler.js"),require.alias("the-gss-vgl-compiler/lib/compiler.js","the-gss-compiler/deps/vgl-compiler/index.js"),require.alias("the-gss-vgl-compiler/lib/compiler.js","the-gss-vgl-compiler/index.js"),require.alias("the-gss-compiler/lib/gss-compiler.js","the-gss-compiler/index.js"),require.alias("d4tocchini-customevent-polyfill/CustomEvent.js","gss/deps/customevent-polyfill/CustomEvent.js"),require.alias("d4tocchini-customevent-polyfill/CustomEvent.js","gss/deps/customevent-polyfill/index.js"),require.alias("d4tocchini-customevent-polyfill/CustomEvent.js","customevent-polyfill/index.js"),require.alias("d4tocchini-customevent-polyfill/CustomEvent.js","d4tocchini-customevent-polyfill/index.js"),require.alias("slightlyoff-cassowary.js/index.js","gss/deps/cassowary/index.js"),require.alias("slightlyoff-cassowary.js/src/c.js","gss/deps/cassowary/src/c.js"),require.alias("slightlyoff-cassowary.js/src/HashTable.js","gss/deps/cassowary/src/HashTable.js"),require.alias("slightlyoff-cassowary.js/src/HashSet.js","gss/deps/cassowary/src/HashSet.js"),require.alias("slightlyoff-cassowary.js/src/Error.js","gss/deps/cassowary/src/Error.js"),require.alias("slightlyoff-cassowary.js/src/SymbolicWeight.js","gss/deps/cassowary/src/SymbolicWeight.js"),require.alias("slightlyoff-cassowary.js/src/Strength.js","gss/deps/cassowary/src/Strength.js"),require.alias("slightlyoff-cassowary.js/src/Variable.js","gss/deps/cassowary/src/Variable.js"),require.alias("slightlyoff-cassowary.js/src/Point.js","gss/deps/cassowary/src/Point.js"),require.alias("slightlyoff-cassowary.js/src/Expression.js","gss/deps/cassowary/src/Expression.js"),require.alias("slightlyoff-cassowary.js/src/Constraint.js","gss/deps/cassowary/src/Constraint.js"),require.alias("slightlyoff-cassowary.js/src/EditInfo.js","gss/deps/cassowary/src/EditInfo.js"),require.alias("slightlyoff-cassowary.js/src/Tableau.js","gss/deps/cassowary/src/Tableau.js"),require.alias("slightlyoff-cassowary.js/src/SimplexSolver.js","gss/deps/cassowary/src/SimplexSolver.js"),require.alias("slightlyoff-cassowary.js/src/Timer.js","gss/deps/cassowary/src/Timer.js"),require.alias("slightlyoff-cassowary.js/src/parser/parser.js","gss/deps/cassowary/src/parser/parser.js"),require.alias("slightlyoff-cassowary.js/src/parser/api.js","gss/deps/cassowary/src/parser/api.js"),require.alias("slightlyoff-cassowary.js/index.js","cassowary/index.js"),require.alias("gss/lib/GSS-with-compiler.js","gss/index.js"),"object"==typeof exports?module.exports=require("gss"):"function"==typeof define&&define.amd?define([],function(){return require("gss")}):this.gss=require("gss")}(); \ No newline at end of file diff --git a/dist/worker.js b/dist/worker.js index f70d5a5a..70097d8c 100644 --- a/dist/worker.js +++ b/dist/worker.js @@ -1,3 +1,4 @@ +/* gss-engine - version 1.0.4-beta (2014-06-11) - http://gridstylesheets.org */ /** * Parts Copyright (C) 2011-2012, Alex Russell (slightlyoff@chromium.org) * Parts Copyright (C) Copyright (C) 1998-2000 Greg J. Badros diff --git a/dist/worker.min.js b/dist/worker.min.js index 025a85e9..8902d91a 100644 --- a/dist/worker.min.js +++ b/dist/worker.min.js @@ -1,3 +1,3 @@ -/* gss-engine - version 1.0.4-beta (2014-06-02) - http://gridstylesheets.org */ +/* gss-engine - version 1.0.4-beta (2014-06-11) - http://gridstylesheets.org */ (function(){!function(a){"use strict";try{!function(){}.bind(a)}catch(b){Object.defineProperty(Function.prototype,"bind",{value:function(a){var b=this;return function(){return b.apply(a,arguments)}},enumerable:!1,configurable:!0,writable:!0})}var c="undefined"!=typeof a.HTMLElement,d=function(a){for(var b=null;a&&a!=Object.prototype;){if(a.tagName){b=a.tagName;break}a=a.prototype}return b||"div"},e=1e-8,f={},g=function(a,b){if(a&&b){if("function"==typeof a[b])return a[b];var c=a.prototype;if(c&&"function"==typeof c[b])return c[b];if(c!==Object.prototype&&c!==Function.prototype)return"function"==typeof a.__super__?g(a.__super__,b):void 0}},h=a.c=function(){return h._api?h._api.apply(this,arguments):void 0};h.debug=!1,h.trace=!1,h.verbose=!1,h.traceAdded=!1,h.GC=!1,h.GEQ=1,h.LEQ=2,h.inherit=function(b){var e=null,g=null;b["extends"]&&(g=b["extends"],delete b["extends"]),b.initialize&&(e=b.initialize,delete b.initialize);var i=e||function(){};Object.defineProperty(i,"__super__",{value:g?g:Object,enumerable:!1,configurable:!0,writable:!1}),b._t&&(f[b._t]=i);var j=i.prototype=Object.create(g?g.prototype:Object.prototype);if(h.extend(j,b),c&&g&&g.prototype instanceof a.HTMLElement){var k=i,l=d(j),m=function(a){return a.__proto__=j,k.apply(a,arguments),j.created&&a.created(),j.decorate&&a.decorate(),a};this.extend(j,{upgrade:m}),i=function(){return m(a.document.createElement(l))},i.prototype=j,this.extend(i,{ctor:k})}return i},h.own=function(b,c,d){return Object.getOwnPropertyNames(b).forEach(c,d||a),b},h.extend=function(a,b){return h.own(b,function(c){var d=Object.getOwnPropertyDescriptor(b,c);try{"function"==typeof d.get||"function"==typeof d.set?Object.defineProperty(a,c,d):"function"==typeof d.value||"_"===c.charAt(0)?(d.writable=!0,d.configurable=!0,d.enumerable=!1,Object.defineProperty(a,c,d)):a[c]=b[c]}catch(e){}}),a},h.traceprint=function(a){h.verbose&&console.log(a)},h.fnenterprint=function(a){console.log("* "+a)},h.fnexitprint=function(a){console.log("- "+a)},h.assert=function(a,b){if(!a)throw new h.InternalError("Assertion failed: "+b)};var i=function(a){return"number"==typeof a?h.Expression.fromConstant(a):a instanceof h.Variable?h.Expression.fromVariable(a):a};h.plus=function(a,b){return a=i(a),b=i(b),a.plus(b)},h.minus=function(a,b){return a=i(a),b=i(b),a.minus(b)},h.times=function(a,b){return a=i(a),b=i(b),a.times(b)},h.divide=function(a,b){return a=i(a),b=i(b),a.divide(b)},h.approx=function(a,b){return a===b?!0:(a=+a,b=+b,0==a?Math.abs(b)30||this._deleted>this._compactThreshold&&(this._compact(),this._deleted=0)},"delete":function(a){a=a.hashCode,this._store.hasOwnProperty(a)&&(this._deleted++,delete this._store[a],this.size>0&&this.size--)},each:function(a,b){if(this.size){this._perhapsCompact();var c=this._store,d=this._keyStrMap;for(var e in this._store)this._store.hasOwnProperty(e)&&a.call(b||null,d[e],c[e])}},escapingEach:function(a,b){if(this.size){this._perhapsCompact();for(var d=this,e=this._store,f=this._keyStrMap,g=c,h=Object.keys(e),i=0;i "+c+"\n"}),a}})}(this.c||module.parent.exports||{}),function(a){"use strict";a.HashSet=a.inherit({_t:"c.HashSet",initialize:function(){this.storage=[],this.size=0,this.hashCode=a._inc()},add:function(a){var b=this.storage;b.indexOf(a),-1==b.indexOf(a)&&(b[b.length]=a),this.size=this.storage.length},values:function(){return this.storage},has:function(a){var b=this.storage;return-1!=b.indexOf(a)},"delete":function(a){var b=this.storage.indexOf(a);return-1==b?null:(this.storage.splice(b,1)[0],void(this.size=this.storage.length))},clear:function(){this.storage.length=0},each:function(a,b){this.size&&this.storage.forEach(a,b)},escapingEach:function(a,b){this.size&&this.storage.forEach(a,b)},toString:function(){var a=this.size+" {",b=!0;return this.each(function(c){b?b=!1:a+=", ",a+=c}),a+="}\n"},toJSON:function(){var a=[];return this.each(function(b){a[a.length]=b.toJSON()}),{_t:"c.HashSet",data:a}},fromJSON:function(b){var c=new a.HashSet;return b.data&&(c.size=b.data.length,c.storage=b.data),c}})}(this.c||module.parent.exports||{}),function(a){"use strict";a.Error=a.inherit({initialize:function(a){a&&(this._description=a)},_name:"c.Error",_description:"An error has occured in Cassowary",set description(a){this._description=a},get description(){return"("+this._name+") "+this._description},get message(){return this.description},toString:function(){return this.description}});var b=function(b,c){return a.inherit({"extends":a.Error,initialize:function(){a.Error.apply(this,arguments)},_name:b||"",_description:c||""})};a.ConstraintNotFound=b("c.ConstraintNotFound","Tried to remove a constraint never added to the tableu"),a.InternalError=b("c.InternalError"),a.NonExpression=b("c.NonExpression","The resulting expression would be non"),a.NotEnoughStays=b("c.NotEnoughStays","There are not enough stays to give specific values to every variable"),a.RequiredFailure=b("c.RequiredFailure","A required constraint cannot be satisfied"),a.TooDifficult=b("c.TooDifficult","The constraints are too difficult to solve")}(this.c||module.parent.exports||{}),function(a){"use strict";var b=1e3;a.SymbolicWeight=a.inherit({_t:"c.SymbolicWeight",initialize:function(){this.value=0;for(var a=1,c=arguments.length-1;c>=0;--c)this.value+=arguments[c]*a,a*=b},toJSON:function(){return{_t:this._t,value:this.value}}})}(this.c||module.parent.exports||{}),function(a){a.Strength=a.inherit({initialize:function(b,c,d,e){this.name=b,this.symbolicWeight=c instanceof a.SymbolicWeight?c:new a.SymbolicWeight(c,d,e)},get required(){return this===a.Strength.required},toString:function(){return this.name+(this.isRequired?"":":"+this.symbolicWeight)}}),a.Strength.required=new a.Strength("",1e3,1e3,1e3),a.Strength.strong=new a.Strength("strong",1,0,0),a.Strength.medium=new a.Strength("medium",0,1,0),a.Strength.weak=new a.Strength("weak",0,0,1)}(this.c||("undefined"!=typeof module?module.parent.exports.c:{})),function(a){"use strict";a.AbstractVariable=a.inherit({isDummy:!1,isExternal:!1,isPivotable:!1,isRestricted:!1,_init:function(b,c){this.hashCode=a._inc(),this.name=(c||"")+this.hashCode,b&&("undefined"!=typeof b.name&&(this.name=b.name),"undefined"!=typeof b.value&&(this.value=b.value),"undefined"!=typeof b.prefix&&(this._prefix=b.prefix))},_prefix:"",name:"",value:0,valueOf:function(){return this.value},toJSON:function(){var a={};return this._t&&(a._t=this._t),this.name&&(a.name=this.name),"undefined"!=typeof this.value&&(a.value=this.value),this._prefix&&(a._prefix=this._prefix),this._t&&(a._t=this._t),a},fromJSON:function(b,c){var d=new c;return a.extend(d,b),d},toString:function(){return this._prefix+"["+this.name+":"+this.value+"]"}}),a.Variable=a.inherit({_t:"c.Variable","extends":a.AbstractVariable,initialize:function(b){this._init(b,"v");var c=a.Variable._map;c&&(c[this.name]=this)},isExternal:!0}),a.DummyVariable=a.inherit({_t:"c.DummyVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"d")},isDummy:!0,isRestricted:!0,value:"dummy"}),a.ObjectiveVariable=a.inherit({_t:"c.ObjectiveVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"o")},value:"obj"}),a.SlackVariable=a.inherit({_t:"c.SlackVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"s")},isPivotable:!0,isRestricted:!0,value:"slack"})}(this.c||module.parent.exports||{}),function(a){"use strict";a.Point=a.inherit({initialize:function(b,c,d){if(b instanceof a.Variable)this._x=b;else{var e={value:b};d&&(e.name="x"+d),this._x=new a.Variable(e)}if(c instanceof a.Variable)this._y=c;else{var f={value:c};d&&(f.name="y"+d),this._y=new a.Variable(f)}},get x(){return this._x},set x(b){b instanceof a.Variable?this._x=b:this._x.value=b},get y(){return this._y},set y(b){b instanceof a.Variable?this._y=b:this._y.value=b},toString:function(){return"("+this.x+", "+this.y+")"}})}(this.c||module.parent.exports||{}),function(a){"use strict";var b=function(a,b){return"number"==typeof a?a:b};a.Expression=a.inherit({initialize:function(c,d,e){this.constant=b(e,0),this.terms=new a.HashTable,c instanceof a.AbstractVariable?(d=b(d,1),this.setVariable(c,d)):"number"==typeof c&&(isNaN(c)?console.trace():this.constant=c)},initializeFromHash:function(b,c){return a.verbose&&(console.log("*******************************"),console.log("clone c.initializeFromHash"),console.log("*******************************")),a.GC&&console.log("clone c.Expression"),this.constant=b,this.terms=c.clone(),this},multiplyMe:function(a){this.constant*=a;var b=this.terms;return b.each(function(c,d){b.set(c,d*a)}),this},clone:function(){a.verbose&&(console.log("*******************************"),console.log("clone c.Expression"),console.log("*******************************"));var b=a.Expression.empty();return b.initializeFromHash(this.constant,this.terms),b},times:function(b){if("number"==typeof b)return this.clone().multiplyMe(b);if(this.isConstant)return b.times(this.constant);if(b.isConstant)return this.times(b.constant);throw new a.NonExpression},plus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,1):b instanceof a.Variable?this.clone().addVariable(b,1):void 0},minus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,-1):b instanceof a.Variable?this.clone().addVariable(b,-1):void 0},divide:function(b){if("number"==typeof b){if(a.approx(b,0))throw new a.NonExpression;return this.times(1/b)}if(b instanceof a.Expression){if(!b.isConstant)throw new a.NonExpression;return this.times(1/b.constant)}},addExpression:function(c,d,e,f){return c instanceof a.AbstractVariable&&(c=a.Expression.fromVariable(c)),d=b(d,1),this.constant+=d*c.constant,c.terms.each(function(a,b){this.addVariable(a,b*d,e,f)},this),this},addVariable:function(b,c,d,e){null==c&&(c=1);var f=this.terms.get(b);if(f){var g=f+c;0==g||a.approx(g,0)?(e&&e.noteRemovedVariable(b,d),this.terms.delete(b)):this.setVariable(b,g)}else a.approx(c,0)||(this.setVariable(b,c),e&&e.noteAddedVariable(b,d));return this},setVariable:function(a,b){return this.terms.set(a,b),this},anyPivotableVariable:function(){if(this.isConstant)throw new a.InternalError("anyPivotableVariable called on a constant");var b=this.terms.escapingEach(function(a){return a.isPivotable?{retval:a}:void 0});return b&&void 0!==b.retval?b.retval:null},substituteOut:function(b,c,d,e){this.setVariable.bind(this);var f=this.terms,g=f.get(b);f.delete(b),this.constant+=g*c.constant,c.terms.each(function(b,c){var h=f.get(b);if(h){var i=h+g*c;a.approx(i,0)?(e.noteRemovedVariable(b,d),f.delete(b)):f.set(b,i)}else f.set(b,g*c),e&&e.noteAddedVariable(b,d)})},changeSubject:function(a,b){this.setVariable(a,this.newSubject(b))},newSubject:function(a){var b=1/this.terms.get(a);return this.terms.delete(a),this.multiplyMe(-b),b},coefficientFor:function(a){return this.terms.get(a)||0},get isConstant(){return 0==this.terms.size},toString:function(){var b="",c=!1;if(!a.approx(this.constant,0)||this.isConstant){if(b+=this.constant,this.isConstant)return b;c=!0}return this.terms.each(function(a,d){c&&(b+=" + "),b+=d+"*"+a,c=!0}),b},equals:function(b){return b===this?!0:b instanceof a.Expression&&b.constant===this.constant&&b.terms.equals(this.terms)},Plus:function(a,b){return a.plus(b)},Minus:function(a,b){return a.minus(b)},Times:function(a,b){return a.times(b)},Divide:function(a,b){return a.divide(b)}}),a.Expression.empty=function(){return new a.Expression(void 0,1,0)},a.Expression.fromConstant=function(b){return new a.Expression(b)},a.Expression.fromValue=function(b){return b=+b,new a.Expression(void 0,b,0)},a.Expression.fromVariable=function(b){return new a.Expression(b,1,0)}}(this.c||module.parent.exports||{}),function(a){"use strict";a.AbstractConstraint=a.inherit({initialize:function(b,c){this.hashCode=a._inc(),this.strength=b||a.Strength.required,this.weight=c||1},isEditConstraint:!1,isInequality:!1,isStayConstraint:!1,get required(){return this.strength===a.Strength.required},toString:function(){return this.strength+" {"+this.weight+"} ("+this.expression+")"}});var b=a.AbstractConstraint.prototype.toString,c=function(b,c,d){a.AbstractConstraint.call(this,c||a.Strength.strong,d),this.variable=b,this.expression=new a.Expression(b,-1,b.value)};a.EditConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isEditConstraint:!0,toString:function(){return"edit:"+b.call(this)}}),a.StayConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isStayConstraint:!0,toString:function(){return"stay:"+b.call(this)}});var d=a.Constraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(b,c,d){a.AbstractConstraint.call(this,c,d),this.expression=b}});a.Inequality=a.inherit({"extends":a.Constraint,_cloneOrNewCle:function(b){return b.clone?b.clone():new a.Expression(b)},initialize:function(b,c,e,f,g){var h=b instanceof a.Expression,i=e instanceof a.Expression,j=b instanceof a.AbstractVariable,k=e instanceof a.AbstractVariable,l="number"==typeof b,m="number"==typeof e;if((h||l)&&k){var n=b,o=c,p=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else if(j&&(i||m)){var n=e,o=c,p=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else{if(h&&m){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(l&&i){var s=e,o=c,t=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(h&&i){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(t),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(s));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(s),-1)}}else{if(h)return d.call(this,b,c,e);if(c==a.GEQ)d.call(this,new a.Expression(e),f,g),this.expression.multiplyMe(-1),this.expression.addVariable(b);else{if(c!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");d.call(this,new a.Expression(e),f,g),this.expression.addVariable(b,-1)}}}},isInequality:!0,toString:function(){return d.prototype.toString.call(this)+" >= 0) id: "+this.hashCode}}),a.Equation=a.inherit({"extends":a.Constraint,initialize:function(b,c,e,f){if(b instanceof a.Expression&&!c||c instanceof a.Strength)d.call(this,b,c,e);else if(b instanceof a.AbstractVariable&&c instanceof a.Expression){var g=b,h=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.AbstractVariable&&"number"==typeof c){var g=b,k=c,i=e,j=f;d.call(this,new a.Expression(k),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.Expression&&c instanceof a.AbstractVariable){var h=b,g=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else{if(!(b instanceof a.Expression||b instanceof a.AbstractVariable||"number"==typeof b)||!(c instanceof a.Expression||c instanceof a.AbstractVariable||"number"==typeof c))throw"Bad initializer to c.Equation";b=b instanceof a.Expression?b.clone():new a.Expression(b),c=c instanceof a.Expression?c.clone():new a.Expression(c),d.call(this,b,e,f),this.expression.addExpression(c,-1)}a.assert(this.strength instanceof a.Strength,"_strength not set")},toString:function(){return d.prototype.toString.call(this)+" = 0)"}})}(this.c||module.parent.exports||{}),function(a){"use strict";a.EditInfo=a.inherit({initialize:function(a,b,c,d,e){this.constraint=a,this.editPlus=b,this.editMinus=c,this.prevEditConstant=d,this.index=e},toString:function(){return""}})}(this.c||module.parent.exports||{}),function(a){"use strict";a.Tableau=a.inherit({initialize:function(){this.columns=new a.HashTable,this.rows=new a.HashTable,this._infeasibleRows=new a.HashSet,this._externalRows=new a.HashSet,this._externalParametricVars=new a.HashSet},noteRemovedVariable:function(b,c){a.trace&&console.log("c.Tableau::noteRemovedVariable: ",b,c);var d=this.columns.get(b);c&&d&&d.delete(c)},noteAddedVariable:function(a,b){b&&this.insertColVar(a,b)},getInternalInfo:function(){var a="Tableau Information:\n";return a+="Rows: "+this.rows.size,a+=" (= "+(this.rows.size-1)+" constraints)",a+="\nColumns: "+this.columns.size,a+="\nInfeasible Rows: "+this._infeasibleRows.size,a+="\nExternal basic variables: "+this._externalRows.size,a+="\nExternal parametric variables: ",a+=this._externalParametricVars.size,a+="\n"},toString:function(){var a="Tableau:\n";return this.rows.each(function(b,c){a+=b,a+=" <==> ",a+=c,a+="\n"}),a+="\nColumns:\n",a+=this.columns,a+="\nInfeasible rows: ",a+=this._infeasibleRows,a+="External basic variables: ",a+=this._externalRows,a+="External parametric variables: ",a+=this._externalParametricVars},insertColVar:function(b,c){var d=this.columns.get(b);d||(d=new a.HashSet,this.columns.set(b,d)),d.add(c)},addRow:function(b,c){a.trace&&a.fnenterprint("addRow: "+b+", "+c),this.rows.set(b,c),c.terms.each(function(a){this.insertColVar(a,b),a.isExternal&&this._externalParametricVars.add(a)},this),b.isExternal&&this._externalRows.add(b),a.trace&&a.traceprint(this.toString())},removeColumn:function(b){a.trace&&a.fnenterprint("removeColumn:"+b);var c=this.columns.get(b);c?(this.columns.delete(b),c.each(function(a){var c=this.rows.get(a);c.terms.delete(b)},this)):a.trace&&console.log("Could not find var",b,"in columns"),b.isExternal&&(this._externalRows.delete(b),this._externalParametricVars.delete(b))},removeRow:function(b){a.trace&&a.fnenterprint("removeRow:"+b);var c=this.rows.get(b);return a.assert(null!=c),c.terms.each(function(c){var d=this.columns.get(c);null!=d&&(a.trace&&console.log("removing from varset:",b),d.delete(b))},this),this._infeasibleRows.delete(b),b.isExternal&&this._externalRows.delete(b),this.rows.delete(b),a.trace&&a.fnexitprint("returning "+c),c},substituteOut:function(b,c){a.trace&&a.fnenterprint("substituteOut:"+b+", "+c),a.trace&&a.traceprint(this.toString());var d=this.columns.get(b);d.each(function(a){var d=this.rows.get(a);d.substituteOut(b,c,a,this),a.isRestricted&&d.constant<0&&this._infeasibleRows.add(a)},this),b.isExternal&&(this._externalRows.add(b),this._externalParametricVars.delete(b)),this.columns.delete(b)},columnsHasKey:function(a){return!!this.columns.get(a)}})}(this.c||module.parent.exports||{}),function(a){var b=a.Tableau,c=b.prototype,d=1e-8,e=a.Strength.weak;a.SimplexSolver=a.inherit({"extends":a.Tableau,initialize:function(){a.Tableau.call(this),this._stayMinusErrorVars=[],this._stayPlusErrorVars=[],this._errorVars=new a.HashTable,this._markerVars=new a.HashTable,this._objective=new a.ObjectiveVariable({name:"Z"}),this._editVarMap=new a.HashTable,this._editVarList=[],this._slackCounter=0,this._artificialCounter=0,this._dummyCounter=0,this.autoSolve=!0,this._needsSolving=!1,this._optimizeCount=0,this.rows.set(this._objective,a.Expression.empty()),this._editVariableStack=[0],a.trace&&a.traceprint("objective expr == "+this.rows.get(this._objective))},add:function(){for(var a=0;a0,"_editVarMap.size > 0"),this._infeasibleRows.clear(),this._resetStayConstants(),this._editVariableStack[this._editVariableStack.length]=this._editVarMap.size,this},endEdit:function(){return a.assert(this._editVarMap.size>0,"_editVarMap.size > 0"),this.resolve(),this._editVariableStack.pop(),this.removeEditVarsTo(this._editVariableStack[this._editVariableStack.length-1]),this},removeAllEditVars:function(){return this.removeEditVarsTo(0)},removeEditVarsTo:function(b){try{for(var c=this._editVarList.length,d=b;c>d;d++)this._editVarList[d]&&this.removeConstraint(this._editVarMap.get(this._editVarList[d].v).constraint);return this._editVarList.length=b,a.assert(this._editVarMap.size==b,"_editVarMap.size == n"),this}catch(e){throw new a.InternalError("Constraint not found in removeEditVarsTo")}},addPointStays:function(b){return a.trace&&console.log("addPointStays",b),b.forEach(function(a,b){this.addStay(a.x,e,Math.pow(2,b)),this.addStay(a.y,e,Math.pow(2,b))},this),this},addStay:function(b,c,d){var f=new a.StayConstraint(b,c||e,d||1);return this.addConstraint(f)},removeConstraint:function(b){a.trace&&a.fnenterprint("removeConstraintInternal: "+b),a.trace&&a.traceprint(this.toString()),this._needsSolving=!0,this._resetStayConstants();var c=this.rows.get(this._objective),d=this._errorVars.get(b);a.trace&&a.traceprint("eVars == "+d),null!=d&&d.each(function(e){var f=this.rows.get(e);null==f?c.addVariable(e,-b.weight*b.strength.symbolicWeight.value,this._objective,this):c.addExpression(f,-b.weight*b.strength.symbolicWeight.value,this._objective,this),a.trace&&a.traceprint("now eVars == "+d)},this);var e=this._markerVars.get(b);if(this._markerVars.delete(b),null==e)throw new a.InternalError("Constraint not found in removeConstraintInternal");if(a.trace&&a.traceprint("Looking to remove var "+e),null==this.rows.get(e)){var f=this.columns.get(e);a.trace&&a.traceprint("Must pivot -- columns are "+f);var g=null,h=0;f.each(function(b){if(b.isRestricted){var c=this.rows.get(b),d=c.coefficientFor(e);if(a.trace&&a.traceprint("Marker "+e+"'s coefficient in "+c+" is "+d),0>d){var f=-c.constant/d;(null==g||h>f||a.approx(f,h)&&b.hashCoded)&&(h=d,g=a)}},this)),null==g&&(0==f.size?this.removeColumn(e):f.escapingEach(function(a){return a!=this._objective?(g=a,{brk:!0}):void 0},this)),null!=g&&this.pivot(e,g)}if(null!=this.rows.get(e)&&this.removeRow(e),null!=d&&d.each(function(a){a!=e&&this.removeColumn(a)},this),b.isStayConstraint){if(null!=d)for(var i=0;ie&&this.suggestValue(a,b[e])},this),this.resolve()},resolvePair:function(a,b){this.suggestValue(this._editVarList[0].v,a),this.suggestValue(this._editVarList[1].v,b),this.resolve()},resolve:function(){a.trace&&a.fnenterprint("resolve()"),this.dualOptimize(),this._setExternalVariables(),this._infeasibleRows.clear(),this._resetStayConstants()},suggestValue:function(b,c){a.trace&&console.log("suggestValue("+b+", "+c+")");var d=this._editVarMap.get(b);if(!d)throw new a.Error("suggestValue for variable "+b+", but var is not an edit variable");var e=c-d.prevEditConstant;return d.prevEditConstant=c,this.deltaEditConstant(e,d.editPlus,d.editMinus),this},solve:function(){return this._needsSolving&&(this.optimize(this._objective),this._setExternalVariables()),this},setEditedValue:function(b,c){if(!this.columnsHasKey(b)&&null==this.rows.get(b))return b.value=c,this;if(!a.approx(c,b.value)){this.addEditVar(b),this.beginEdit();try{this.suggestValue(b,c)}catch(d){throw new a.InternalError("Error in setEditedValue")}this.endEdit()}return this},addVar:function(b){if(!this.columnsHasKey(b)&&null==this.rows.get(b)){try{this.addStay(b)}catch(c){throw new a.InternalError("Error in addVar -- required failure is impossible")}a.trace&&a.traceprint("added initial stay on "+b)}return this},getInternalInfo:function(){var a=c.getInternalInfo.call(this);return a+="\nSolver info:\n",a+="Stay Error Variables: ",a+=this._stayPlusErrorVars.length+this._stayMinusErrorVars.length,a+=" ("+this._stayPlusErrorVars.length+" +, ",a+=this._stayMinusErrorVars.length+" -)\n",a+="Edit Variables: "+this._editVarMap.size,a+="\n"},getDebugInfo:function(){return this.toString()+this.getInternalInfo()+"\n"},toString:function(){var a=c.getInternalInfo.call(this);return a+="\n_stayPlusErrorVars: ",a+="["+this._stayPlusErrorVars+"]",a+="\n_stayMinusErrorVars: ",a+="["+this._stayMinusErrorVars+"]",a+="\n",a+="_editVarMap:\n"+this._editVarMap,a+="\n"},addWithArtificialVariable:function(b){a.trace&&a.fnenterprint("addWithArtificialVariable: "+b);var c=new a.SlackVariable({value:++this._artificialCounter,prefix:"a"}),d=new a.ObjectiveVariable({name:"az"}),e=b.clone();a.trace&&a.traceprint("before addRows:\n"+this),this.addRow(d,e),this.addRow(c,b),a.trace&&a.traceprint("after addRows:\n"+this),this.optimize(d);var f=this.rows.get(d);if(a.trace&&a.traceprint("azTableauRow.constant == "+f.constant),!a.approx(f.constant,0))throw this.removeRow(d),this.removeColumn(c),new a.RequiredFailure;var g=this.rows.get(c);if(null!=g){if(g.isConstant)return this.removeRow(c),void this.removeRow(d);var h=g.anyPivotableVariable();this.pivot(h,c)}a.assert(null==this.rows.get(c),"rowExpression(av) == null"),this.removeColumn(c),this.removeRow(d)},tryAddingDirectly:function(b){a.trace&&a.fnenterprint("tryAddingDirectly: "+b);var c=this.chooseSubject(b);return null==c?(a.trace&&a.fnexitprint("returning false"),!1):(b.newSubject(c),this.columnsHasKey(c)&&this.substituteOut(c,b),this.addRow(c,b),a.trace&&a.fnexitprint("returning true"),!0)},chooseSubject:function(b){a.trace&&a.fnenterprint("chooseSubject: "+b);var c=null,d=!1,e=!1,f=b.terms,g=f.escapingEach(function(a,b){if(d){if(!a.isRestricted&&!this.columnsHasKey(a))return{retval:a}}else if(a.isRestricted){if(!e&&!a.isDummy&&0>b){var f=this.columns.get(a);(null==f||1==f.size&&this.columnsHasKey(this._objective))&&(c=a,e=!0)}}else c=a,d=!0},this);if(g&&void 0!==g.retval)return g.retval;if(null!=c)return c;var h=0,g=f.escapingEach(function(a,b){return a.isDummy?void(this.columnsHasKey(a)||(c=a,h=b)):{retval:null}},this);if(g&&void 0!==g.retval)return g.retval;if(!a.approx(b.constant,0))throw new a.RequiredFailure;return h>0&&b.multiplyMe(-1),c},deltaEditConstant:function(b,c,d){a.trace&&a.fnenterprint("deltaEditConstant :"+b+", "+c+", "+d);var e=this.rows.get(c);if(null!=e)return e.constant+=b,void(e.constant<0&&this._infeasibleRows.add(c));var f=this.rows.get(d);if(null!=f)return f.constant+=-b,void(f.constant<0&&this._infeasibleRows.add(d));var g=this.columns.get(d);g||console.log("columnVars is null -- tableau is:\n"+this),g.each(function(a){var c=this.rows.get(a),e=c.coefficientFor(d);c.constant+=e*b,a.isRestricted&&c.constant<0&&this._infeasibleRows.add(a)},this)},dualOptimize:function(){a.trace&&a.fnenterprint("dualOptimize:");for(var b=this.rows.get(this._objective);this._infeasibleRows.size;){var c=this._infeasibleRows.values()[0];this._infeasibleRows.delete(c);var d=null,e=this.rows.get(c);if(e&&e.constant<0){var f,g=Number.MAX_VALUE,h=e.terms;if(h.each(function(c,e){if(e>0&&c.isPivotable){var h=b.coefficientFor(c);f=h/e,(g>f||a.approx(f,g)&&c.hashCodeb?(e=b,g=a,{brk:1}):void 0},this),e>=-d)return;a.trace&&console.log("entryVar:",g,"objectiveCoeff:",e);var i=Number.MAX_VALUE,j=this.columns.get(g),k=0;if(j.each(function(b){if(a.trace&&a.traceprint("Checking "+b),b.isPivotable){var c=this.rows.get(b),d=c.coefficientFor(g);a.trace&&a.traceprint("pivotable, coeff = "+d),0>d&&(k=-c.constant/d,(i>k||a.approx(k,i)&&b.hashCoded;d++){var e=this.rows.get(b[d]);null===e&&(e=this.rows.get(this._stayMinusErrorVars[d])),null!=e&&(e.constant=0)}},_setExternalVariables:function(){a.trace&&a.fnenterprint("_setExternalVariables:"),a.trace&&a.traceprint(this.toString());var b={};this._externalParametricVars.each(function(c){null!=this.rows.get(c)?a.trace&&console.log("Error: variable"+c+" in _externalParametricVars is basic"):(c.value=0,b[c.name]=0)},this),this._externalRows.each(function(a){var c=this.rows.get(a);a.value!=c.constant&&(a.value=c.constant,b[a.name]=c.constant)},this),this._changed=b,this._needsSolving=!1,this._informCallbacks(),this.onsolved()},onsolved:function(){},_informCallbacks:function(){if(this._callbacks){var a=this._changed;this._callbacks.forEach(function(b){b(a)})}},_addCallback:function(a){var b=this._callbacks||(this._callbacks=[]);b[b.length]=a},insertErrorVar:function(b,c){a.trace&&a.fnenterprint("insertErrorVar:"+b+", "+c);var d=this._errorVars.get(c);d||(d=new a.HashSet,this._errorVars.set(b,d)),d.add(c)}})}(this.c||module.parent.exports||{}),function(a){"use strict";a.Timer=a.inherit({initialize:function(){this.isRunning=!1,this._elapsedMs=0},start:function(){return this.isRunning=!0,this._startReading=new Date,this},stop:function(){return this.isRunning=!1,this._elapsedMs+=new Date-this._startReading,this},reset:function(){return this.isRunning=!1,this._elapsedMs=0,this},elapsedTime:function(){return this.isRunning?(this._elapsedMs+(new Date-this._startReading))/1e3:this._elapsedMs/1e3}})}(this.c||module.parent.exports||{}),this.c.parser=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function d(a){O>M||(M>O&&(O=M,P=[]),P.push(a))}function e(){var a,b,c,d,e;if(d=M,e=M,a=s(),null!==a){for(b=[],c=f();null!==c;)b.push(c),c=f();null!==b?(c=s(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)}else a=null,M=e;return null!==a&&(a=function(a,b){return b}(d,a[1])),null===a&&(M=d),a}function f(){var a,b,c,d;return c=M,d=M,a=I(),null!==a?(b=l(),null!==b?a=[a,b]:(a=null,M=d)):(a=null,M=d),null!==a&&(a=function(a,b){return b}(c,a[0])),null===a&&(M=c),a}function g(){var a;return b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),a}function h(){var a;return/^[a-zA-Z]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[a-zA-Z]")),null===a&&(36===b.charCodeAt(M)?(a="$",M++):(a=null,0===N&&d('"$"')),null===a&&(95===b.charCodeAt(M)?(a="_",M++):(a=null,0===N&&d('"_"')))),a}function i(){var a;return N++,/^[\t\x0B\f \xA0\uFEFF]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\t\\x0B\\f \\xA0\\uFEFF]")),N--,0===N&&null===a&&d("whitespace"),a}function j(){var a;return/^[\n\r\u2028\u2029]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\n\\r\\u2028\\u2029]")),a}function k(){var a;return N++,10===b.charCodeAt(M)?(a="\n",M++):(a=null,0===N&&d('"\\n"')),null===a&&("\r\n"===b.substr(M,2)?(a="\r\n",M+=2):(a=null,0===N&&d('"\\r\\n"')),null===a&&(13===b.charCodeAt(M)?(a="\r",M++):(a=null,0===N&&d('"\\r"')),null===a&&(8232===b.charCodeAt(M)?(a="\u2028",M++):(a=null,0===N&&d('"\\u2028"')),null===a&&(8233===b.charCodeAt(M)?(a="\u2029",M++):(a=null,0===N&&d('"\\u2029"')))))),N--,0===N&&null===a&&d("end of line"),a}function l(){var a,c,e;return e=M,a=s(),null!==a?(59===b.charCodeAt(M)?(c=";",M++):(c=null,0===N&&d('";"')),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=r(),null!==a?(c=k(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=s(),null!==a?(c=m(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e))),a}function m(){var a,c;return c=M,N++,b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),N--,null===a?a="":(a=null,M=c),a}function n(){var a;return N++,a=o(),null===a&&(a=q()),N--,0===N&&null===a&&d("comment"),a}function o(){var a,c,e,f,h,i,j;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function p(){var a,c,e,f,h,i,k;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function q(){var a,c,e,f,h,i,k;if(h=M,"//"===b.substr(M,2)?(a="//",M+=2):(a=null,0===N&&d('"//"')),null!==a){for(c=[],i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?(e=j(),null===e&&(e=m()),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function r(){var a,b;for(a=[],b=i(),null===b&&(b=p(),null===b&&(b=q()));null!==b;)a.push(b),b=i(),null===b&&(b=p(),null===b&&(b=q()));return a}function s(){var a,b;for(a=[],b=i(),null===b&&(b=k(),null===b&&(b=n()));null!==b;)a.push(b),b=i(),null===b&&(b=k(),null===b&&(b=n()));return a}function t(){var a,b;return b=M,a=v(),null===a&&(a=u()),null!==a&&(a=function(a,b){return{type:"NumericLiteral",value:b}}(b,a)),null===a&&(M=b),a}function u(){var a,c,e;if(e=M,/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]")),null!==c)for(a=[];null!==c;)a.push(c),/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]"));else a=null;return null!==a&&(a=function(a,b){return parseInt(b.join(""))}(e,a)),null===a&&(M=e),a}function v(){var a,c,e,f,g;return f=M,g=M,a=u(),null!==a?(46===b.charCodeAt(M)?(c=".",M++):(c=null,0===N&&d('"."')),null!==c?(e=u(),null!==e?a=[a,c,e]:(a=null,M=g)):(a=null,M=g)):(a=null,M=g),null!==a&&(a=function(a,b){return parseFloat(b.join(""))}(f,a)),null===a&&(M=f),a}function w(){var a,c,e,f;if(f=M,/^[\-+]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\-+]")),a=null!==a?a:"",null!==a){if(/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]")),null!==e)for(c=[];null!==e;)c.push(e),/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]"));else c=null;null!==c?a=[a,c]:(a=null,M=f)}else a=null,M=f;return a}function x(){var a,b;return N++,b=M,a=y(),null!==a&&(a=function(a,b){return b}(b,a)),null===a&&(M=b),N--,0===N&&null===a&&d("identifier"),a}function y(){var a,b,c,e,f;if(N++,e=M,f=M,a=h(),null!==a){for(b=[],c=h();null!==c;)b.push(c),c=h();null!==b?a=[a,b]:(a=null,M=f)}else a=null,M=f;return null!==a&&(a=function(a,b,c){return b+c.join("")}(e,a[0],a[1])),null===a&&(M=e),N--,0===N&&null===a&&d("identifier"),a}function z(){var a,c,e,f,g,h,i;return h=M,a=x(),null!==a&&(a=function(a,b){return{type:"Variable",name:b}}(h,a)),null===a&&(M=h),null===a&&(a=t(),null===a&&(h=M,i=M,40===b.charCodeAt(M)?(a="(",M++):(a=null,0===N&&d('"("')),null!==a?(c=s(),null!==c?(e=I(),null!==e?(f=s(),null!==f?(41===b.charCodeAt(M)?(g=")",M++):(g=null,0===N&&d('")"')),null!==g?a=[a,c,e,f,g]:(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i),null!==a&&(a=function(a,b){return b}(h,a[2])),null===a&&(M=h))),a}function A(){var a,b,c,d,e;return a=z(),null===a&&(d=M,e=M,a=B(),null!==a?(b=s(),null!==b?(c=A(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)):(a=null,M=e),null!==a&&(a=function(a,b,c){return{type:"UnaryExpression",operator:b,expression:c}}(d,a[0],a[2])),null===a&&(M=d)),a}function B(){var a;return 43===b.charCodeAt(M)?(a="+",M++):(a=null,0===N&&d('"+"')),null===a&&(45===b.charCodeAt(M)?(a="-",M++):(a=null,0===N&&d('"-"')),null===a&&(33===b.charCodeAt(M)?(a="!",M++):(a=null,0===N&&d('"!"')))),a}function C(){var a,b,c,d,e,f,g,h,i;if(g=M,h=M,a=A(),null!==a){for(b=[],i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==c;)b.push(c),i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==b?a=[a,b]:(a=null,M=h)}else a=null,M=h;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;e="===b.substr(M,2)?(a=">=",M+=2):(a=null,0===N&&d('">="')),null===a&&(60===b.charCodeAt(M)?(a="<",M++):(a=null,0===N&&d('"<"')),null===a&&(62===b.charCodeAt(M)?(a=">",M++):(a=null,0===N&&d('">"'))))),a}function I(){var a,c,e,f,g,h,i,j,k;if(i=M,j=M,a=G(),null!==a){for(c=[],k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==e;)c.push(e),k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==c?a=[a,c]:(a=null,M=j)}else a=null,M=j;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;ed;d++)b=f[d],this._trackRootIfNeeded(b,c),this._execute(b,b);return this},a.prototype._execute=function(a,b){var c,d,e,f,g;if(e=a,c=this[e[0]],null==c)throw new Error("Thread.execute broke - couldn't find method: "+e[0]);for(d=e.length-1;d>0;)f=e[d],f instanceof Array&&(g=this._execute(f,b),"IGNORE"===g?e.splice(d,1):e.splice(d,1,g)),d--;return c.call.apply(c,[this,b].concat(__slice.call(e.slice(1,e.length))))},a.prototype.getValues=function(){var a,b;this._solve(),b={};for(a in this.cachedVars)b[a]=this.cachedVars[a].value;return b},a.prototype._solve=function(a){var b,c,d,e;if(null==a&&(a=0),this.solver.solve(),this.conditionals.length>0&&0===a){for(e=this.conditionals,c=0,d=e.length;d>c;c++)b=e[c],b.update();return a++,this._solve(a)}},a.prototype.virtual=function(a){return a},a.prototype.track=function(a,b){return this._trackRootIfNeeded(a,b),"IGNORE"},a.prototype._trackRootIfNeeded=function(a,b){return b&&(a._is_tracked=!0,a._trackers||(a._trackers=[]),-1===a._trackers.indexOf(b))?a._trackers.push(b):void 0},a.prototype.remove=function(){var a,b,c,d,e,f;for(a=__slice.call(arguments),c=__slice.call(a.slice(1,a.length)),f=[],d=0,e=c.length;e>d;d++)b=c[d],f.push(this._remove(b));return f},a.prototype._remove=function(a){return this._removeConstraintByTracker(a),this._removeVarByTracker(a)},a.prototype._removeVarByTracker=function(a){var b,c,d,e,f;if(this.varIdsByTracker[a]){for(f=this.varIdsByTracker[a],d=0,e=f.length;e>d;d++)b=f[d],delete this.cachedVars[b],c=this.__editVarNames.indexOf(b),c>=0&&this.__editVarNames.splice(c,1);return delete this.varIdsByTracker[a]}},a.prototype._removeConstraintByTracker=function(a,b){var c,d,e,f;if(null==b&&(b=!0),this.constraintsByTracker[a]){for(f=this.constraintsByTracker[a],d=0,e=f.length;e>d;d++)c=f[d],c._gss_removed||(this.solver.removeConstraint(c),c._gss_removed=!0);if(b)return this.constraintsByTracker[a]=null}},a.prototype._addConstraintByTracker=function(a){var b,c,d,e,f;if(this.constraintsByTracker[a]){for(e=this.constraintsByTracker[a],f=[],c=0,d=e.length;d>c;c++)b=e[c],f.push(this.solver.addConstraint(b));return f}},a.prototype.where=function(a,b,c){return a._condition_bound=!0,this._trackRootIfNeeded(a,b),this._trackRootIfNeeded(a,b+c),"IGNORE"},a.prototype.cond=function(){var a,b,c,d,e,f,g;for(a=__slice.call(arguments),c=[],g=a.slice(1,a.length),e=0,f=g.length;f>e;e++)b=g[e],c.push(b);return d=this,this.conditionals.push({clauses:c,activeLabel:null,update:function(){var a,e,f,g,h;for(a=!1,f=this.activeLabel,g=0,h=c.length;h>g;g++)if(b=c[g],e=b.test()){a=!0;break}if(a){if(f!==e)return null!=f&&(d.activeClauses.splice(d.activeClauses.indexOf(f),1),d._removeConstraintByTracker(f,!1)),d._addConstraintByTracker(e),d.activeClauses.push(e),this.activeLabel=e}else if(null!=f)return d.activeClauses.splice(d.activeClauses.indexOf(f),1),d._removeConstraintByTracker(f,!1)}})},a.prototype.clause=function(a,b,c){return{label:c,test:function(){return c?b?b.call(this)?c:null:c:b}}},a.prototype["?>="]=function(a,b,c){return function(){return valueOf(b)>=valueOf(c)}},a.prototype["?<="]=function(a,b,c){return function(){return valueOf(b)<=valueOf(c)}},a.prototype["?=="]=function(a,b,c){return function(){return valueOf(b)===valueOf(c)}},a.prototype["?>"]=function(a,b,c){return function(){return valueOf(b)>valueOf(c)}},a.prototype["?<"]=function(a,b,c){return function(){return valueOf(b)d;d++)c=f[d],this.constraintsByTracker[c]||(this.constraintsByTracker[c]=[]),this.constraintsByTracker[c].push(b);return b},a.prototype.eq=function(a,b,d,e,f){return this._addConstraint(a,new c.Equation(b,d,this._strength(e),this._weight(f)))},a.prototype.lte=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.LEQ,d,this._strength(e),this._weight(f)))},a.prototype.gte=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.GEQ,d,this._strength(e),this._weight(f)))},a.prototype.lt=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.LEQ,d,this._strength(e),this._weight(f)))},a.prototype.gt=function(a,b,d,e,f){return this._addConstraint(a,new c.Inequality(b,c.GEQ,d,this._strength(e),this._weight(f)))},a.prototype._editvar=function(a,b,c){return-1===this.__editVarNames.indexOf(a.name)&&(this.__editVarNames.push(a.name),this.solver.addEditVar(a,this._strength(b),this._weight(c))),this},a.prototype.suggest=function(a,b,c,d,e){return null==d&&(d="strong"),"string"==typeof b&&(b=this.get(a,b)),this.solver.solve(),this._editvar(b,d,e),this.solver.suggestValue(b,c),this.solver.resolve()},a.prototype.stay=function(){var a,b,c,d,e;for(a=__slice.call(arguments),e=a.slice(1,a.length),c=0,d=e.length;d>c;c++)b=e[c],this.solver.addStay(b);return this.solver},a}(),("undefined"!=typeof module&&null!==module?module.exports:void 0)&&(module.exports=Thread);var thread;thread=null,self.onmessage=function(a){var b;return thread||(b=a.data.config||{},thread=new Thread(b)),thread.postMessage(a.data),self.postMessage(thread.output())}; \ No newline at end of file diff --git a/lib/GSS.js b/lib/GSS.js index 1b7cd4f4..7ca0d600 100644 --- a/lib/GSS.js +++ b/lib/GSS.js @@ -1,4 +1,4 @@ -var GSS, LOG_PASS, TIME, TIME_END, key, val, _ref; +var GSS, LOG_PASS, TIME, TIME_END, key, val, _ref, _ref1; require("customevent-polyfill"); @@ -67,6 +67,10 @@ if (typeof GSS_CONFIG !== "undefined" && GSS_CONFIG !== null) { } } +if (((_ref = location.search) != null ? _ref.substring(1) : void 0) === 'noworker') { + GSS.config.useWorker = false; +} + GSS.deblog = function() { if (GSS.config.debug) { return console.log.apply(console, arguments); @@ -128,9 +132,9 @@ GSS.Rule = require("./gssom/Rule.js"); require("./gssom/StyleSheet.js"); -_ref = require("./dom/IdMixin.js"); -for (key in _ref) { - val = _ref[key]; +_ref1 = require("./dom/IdMixin.js"); +for (key in _ref1) { + val = _ref1[key]; if (GSS[key]) { throw new Error("IdMixin key clash: " + key); } diff --git a/package.json b/package.json index 428000a8..a7957833 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ ], "devDependencies": { "grunt": "~0.4.1", - "chai": "~1.9.0", - "mocha": "~1.17.0", + "chai": "~1.9.1", + "mocha": "~1.20.1", "grunt-contrib-watch": "~0.3.1", - "grunt-mocha-phantomjs": "~0.4.0", + "grunt-mocha-phantomjs": "~0.5.0", "grunt-contrib-uglify": "~0.2.1", "grunt-contrib-coffee": "~0.7.0", "grunt-contrib-concat": "~0.3.0", diff --git a/spec/end-to-end.coffee b/spec/end-to-end.coffee index 9174dec0..eeaa8d44 100644 --- a/spec/end-to-end.coffee +++ b/spec/end-to-end.coffee @@ -423,6 +423,31 @@ describe 'End - to - End', -> "$async1[height]": 100 "$async1[-test]": 0 done() + + + describe 'variable math', -> + + it 'should compute values', (done) -> + container.innerHTML = """ + + """ + + engine.once 'display', (e) -> + try + expect(engine.vars).to.deep.equal + "[message-height]": 230 + "[message-width]": 240 + "[large-message-height]": 460 + "[large-message-width]": 480 + done() + catch error + done error @@ -1442,4 +1467,137 @@ describe 'End - to - End', -> margin-right: 9px; } - ### \ No newline at end of file + ### + + + describe 'implied property values', -> + + it 'should compute values', (done) -> + container.innerHTML = """ + + + + """ + + windowWidth = window.innerWidth - GSS.get.scrollbarWidth() + + engine.once 'display', (e) -> + try + expect(engine.vars).to.deep.equal + "::window[x]": 0 + "::window[width]": windowWidth + "$header[x]": 0 + "$header[width]": windowWidth + "[header-center-x]": windowWidth / 2 + done() + catch error + done error + + + describe 'chain-width', -> + + it 'should compute values', (done) -> + container.innerHTML = """ +
+

+

+
+ + + """ + + margin = 20 + padding = 25 + + windowLeft = 0 + windowWidth = window.innerWidth - GSS.get.scrollbarWidth() + + pWidth = (windowWidth - ((margin + padding) * 2)) / 3 + pTop = 0 + firstPLeft = windowLeft + padding + pWidth + margin + secondPLeft = firstPLeft + pWidth + margin + + engine.once 'display', (e) -> + try + delta = 0.0000000000001 + + expect(engine.vars["[p-width]"]).to.be.closeTo pWidth, delta + expect(engine.vars["$platform-first-p[width]"]).to.be.closeTo pWidth, delta + expect(engine.vars["$platform-first-p[x]"]).to.be.closeTo firstPLeft, delta + expect(engine.vars["$platform-second-p[width]"]).to.be.closeTo pWidth, delta + expect(engine.vars["$platform-second-p[x]"]).to.be.closeTo secondPLeft, delta + + delete engine.vars["[p-width]"] + delete engine.vars["$platform-first-p[width]"] + delete engine.vars["$platform-first-p[x]"] + delete engine.vars["$platform-second-p[width]"] + delete engine.vars["$platform-second-p[x]"] + + expect(engine.vars).to.deep.equal + "[margin]": margin + "[padding]": padding + "[p-top]": pTop + "::window[x]": windowLeft + "::window[width]": windowWidth + "$platform[x]": windowLeft + "$platform[width]": windowWidth + "$platform-first-p[y]": pTop + "$platform-second-p[y]": pTop + + done() + catch error + done error + + + describe 'virtuals', -> + + it 'should compute values', (done) -> + container.innerHTML = """ +
+ + + """ + + windowWidth = window.innerWidth - GSS.get.scrollbarWidth() + padding = 25 + + engine.once 'display', (e) -> + try + expect(engine.vars).to.deep.equal + "[padding]": padding + "::window[x]": 0 + "::window[width]": windowWidth + "$platform[x]": 0 + "$platform[width]": windowWidth + "$platform\"platform\"[x]": padding + "$platform\"platform\"[width]": windowWidth - (padding * 2) + + done() + catch error + done error