/** * @license almond 0.3.0 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ // ┌────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël 2.1.2 - JavaScript Vector Library │ \\ // ├────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\ // ├────────────────────────────────────────────────────────────────────┤ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\ // └────────────────────────────────────────────────────────────────────┘ \\ // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ┌────────────────────────────────────────────────────────────┐ \\ // │ Eve 0.4.2 - JavaScript Events Library │ \\ // ├────────────────────────────────────────────────────────────┤ \\ // │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\ // └────────────────────────────────────────────────────────────┘ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ "Raphaël 2.1.2" - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ SVG Module │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\ // │ Raphaël - JavaScript Vector Library │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ VML Module │ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\ // │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // └─────────────────────────────────────────────────────────────────────┘ \\ var requirejs,require,define;if(function(t){function e(t,e){return v.call(t,e)}function r(t,e){var r,n,i,a,s,o,c,h,u,l,f,p=e&&e.split("/"),d=g.map,x=d&&d["*"]||{};if(t&&"."===t.charAt(0))if(e){for(p=p.slice(0,p.length-1),t=t.split("/"),s=t.length-1,g.nodeIdCompat&&m.test(t[s])&&(t[s]=t[s].replace(m,"")),t=p.concat(t),u=0;u0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((p||x)&&d){for(r=t.split("/"),u=r.length;u>0;u-=1){if(n=r.slice(0,u).join("/"),p)for(l=p.length;l>0;l-=1)if((i=d[p.slice(0,l).join("/")])&&(i=i[n])){a=i,o=u;break}if(a)break;!c&&x&&x[n]&&(c=x[n],h=u)}!a&&c&&(a=c,o=h),a&&(r.splice(0,o,a),t=r.join("/"))}return t}function n(e,r){return function(){var n=y.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),u.apply(t,n.concat([e,r]))}}function i(t){return function(e){return r(e,t)}}function a(t){return function(e){p[t]=e}}function s(r){if(e(d,r)){var n=d[r];delete d[r],x[r]=!0,h.apply(t,n)}if(!e(p,r)&&!e(x,r))throw new Error("No "+r);return p[r]}function o(t){var e,r=t?t.indexOf("!"):-1;return r>-1&&(e=t.substring(0,r),t=t.substring(r+1,t.length)),[e,t]}function c(t){return function(){return g&&g.config&&g.config[t]||{}}}var h,u,l,f,p={},d={},g={},x={},v=Object.prototype.hasOwnProperty,y=[].slice,m=/\.js$/;l=function(t,e){var n,a=o(t),c=a[0];return t=a[1],c&&(c=r(c,e),n=s(c)),c?t=n&&n.normalize?n.normalize(t,i(e)):r(t,e):(t=r(t,e),a=o(t),c=a[0],t=a[1],c&&(n=s(c))),{f:c?c+"!"+t:t,n:t,pr:c,p:n}},f={require:function(t){return n(t)},exports:function(t){var e=p[t];return void 0!==e?e:p[t]={}},module:function(t){return{id:t,uri:"",exports:p[t],config:c(t)}}},h=function(r,i,o,c){var h,u,g,v,y,m,b=[],_=typeof o;if(c=c||r,"undefined"===_||"function"===_){for(i=!i.length&&o.length?["require","exports","module"]:i,y=0;y>1),(a=n(r,t[i]))===C)return i;a===E?c=i-1:s=i+1}while(s<=c);return-1}function n(t){var e=t.length;if(e<=1)return t;for(var r,n,a,s=1,o=e/3|0;s0;){for(r=s;r=s&&t[n]=h){c===h&&(u[h]=!0);break}var g=n(t.join("").split("")),x=Object.keys(u),v=g[0],y=Object.create(null),m=Object.create(null);for(e=0;ev)break;for(e=0,a=g.length-1;eh));r++)s[0]<=c&&h<=s[1]&&(y[s].push(v),x.push(v));if(c=g[e],h=g[e+1],u[h])for(r=0;rh));r++)s[0]<=h&&h<=s[1]&&y[s].push(h)}x=n(x);for(i in y)m[i[0]===i[1]?i[0]:i]=y[i];return{ranges:x,map:m}}function c(t){var e=String.fromCharCode(65535);t=o(t).ranges;var r=[];if(!t.length)return r;"\0"!==t[0][0]&&t.unshift(e);var n=t.length-1;return(t[n][1]||t[n][0])!==e&&t.push("\0"),t.reduce(function(t,e){var n=d(t[1]||t[0]),i=p(e[0]);return n1&&t.shift();return t.forEach(function(t){if("-"==e[0]&&e.length>1){if(e[1]>t)throw new Error("Charset range out of order:"+e[1]+"-"+t+"!");r.push(e[1]+t),e.splice(0,2)}else e.unshift(t)}),r=r.concat(e),n?c(r):o(r).ranges}function u(t){if(!t.length)return[];var e=[t[0]];return t.reduce(function(t,r){var n=e.length-1;return t[t.length-1]===p(r[0])?e[n]=e[n][0]+r[r.length-1]:(e.push(r),r)}),e.reduce(function(t,e){return 2===e.length&&e[0]===p(e[1])?(t.push(e[0]),t.push(e[1])):t.push(e),t},[])}function l(t){return String.fromCharCode(t)}function f(t){return t.charCodeAt(0)}function p(t){return String.fromCharCode(t.charCodeAt(0)-1)}function d(t){return String.fromCharCode(t.charCodeAt(0)+1)}function g(t,e){var r=/[\x00-\x1F\x7F-\x9F]/,n=/[\u009F-\uFFFF]/;return t=t.split("").map(function(t){return!e&&S.hasOwnProperty(t)?S[t]:n.test(t)?"\\u"+("00"+f(t).toString(16).toUpperCase()).slice(-4):r.test(t)?"\\x"+("0"+f(t).toString(16).toUpperCase()).slice(-2):t}).join("")}function x(t){return[].concat.apply([],t)}function v(t,e){return new Array(e+1).join(t)}function y(){var t=_.call(arguments);if(w)Function.prototype.apply.apply(console.log,[console,t]);else{var e=require("util");t.forEach(function(t){console.log(e.inspect(t,{showHidden:!1,customInspect:!0,depth:64,colors:!0}))})}}function m(t){for(var e,r=t.toString(),n=/^\s+function\s+([a-zA-Z]\w+)\s*\(/gm,i=[];e=n.exec(r);)i.push(e[1]);for(var t,a=[];t=i.pop();)a.push(t+":"+t);return"{\n"+a.join(",\n")+"\n}"}var b=Array.prototype,_=b.slice,w=function(){return"[object Window]"===this.toString()}(),E=-1,C=0,k=1,S={"\n":"\\n","\t":"\\t","\f":"\\f","\r":"\\r"," ":" ","\\":"\\\\","\0":"\\0"};return{sortUnique:n,idUnique:s,hashUnique:a,Set:t,repeats:v,negate:c,coalesce:u,classify:o,parseCharset:h,chr:l,ord:f,pred:p,succ:d,toPrint:g,flatten2:x,log:y,isBrowser:w,locals:m}}),"function"!=typeof define)var define=require("amdefine")(module);if(define("NFA",["./Kit"],function(t){function e(e){e=e.compact?c(e):e;var s,o={},h=e.trans,u={};for(s=0,n=e.accepts.length;s1)throw new Error("DFA Assertion Fail!\nFrom state `"+n[i]+"` can goto to multi ε-move states!");for(var s=e.charMove,o=Object.keys(s),c=0,h=o.length;c"+y.to),E===C-1){r+=f,o=y.to;continue t}if(b=i(e,r+f,y.to,c,h),b.acceptable)return b;p=b}if(p)return p;break}return{stack:c,lastIndex:h,lastState:o,acceptable:a.accept(o)}}r=r||0;var a=this;return i(e,r,"start",[],r-1)}function s(t,e){var r=t.indexOf(e,o);return!!~r&&t[r]}function o(t,e){var r=e[0];return t>e[1]?1:t"),n=r[0].split(","),i=r[1].split(","),a[s]={from:n,to:i,charset:e[1],action:e[2],assert:e[3]};return t.compact=!1,t}return e}),"function"!=typeof define)var define=require("amdefine")(module);if(define("parse",["./NFA","./Kit"],function(t,e){function r(){var t=Object.keys(p).map(function(t){return t+"="+JSON.stringify(p[t])}).join(";");(function(){return this})().eval(t)}function n(t){this.raw=t.raw,this.tree=t.tree,this.groupCount=t.groupCount}function i(t,e){d=e;var r,i,s,p=a();r=p.input(t,0,e),i=r.stack,i=v.endChoice(i),s=r.lastState;var g=r.acceptable&&r.lastIndex===t.length-1;if(!g){var x;switch(s){case"charsetRangeEndWithNullChar":x={type:"CharsetRangeEndWithNullChar",message:"Charset range end with NUL char does not make sense!\nBecause [a-\\0] is not a valid range.\nAnd [\\0-\\0] should be rewritten into [\\0]."};break;case"repeatErrorFinal":x={type:"NothingRepeat",message:"Nothing to repeat!"};break;case"digitFollowNullError":x={type:"DigitFollowNullError",message:"The '\\0' represents the char and cannot be followed by a decimal digit!"};break;case"charsetRangeEndClass":x={type:"CharsetRangeEndClass",message:'Charset range ends with class such as "\\w\\W\\d\\D\\s\\S" is invalid!'};break;case"charsetOctEscape":x={type:"DecimalEscape",message:"Decimal escape appears in charset is invalid.Because it can't be explained as backreference.And octal escape is deprecated!"};break;default:0===s.indexOf("charset")?x={type:"UnclosedCharset",message:"Unterminated character class!"}:")"===t[r.lastIndex]?x={type:"UnmatchedParen",message:"Unmatched end parenthesis!"}:(x={type:"UnexpectedChar",message:"Unexpected char!"},r.lastIndex++)}if(x)throw x.lastIndex=r.lastIndex,x.astStack=r.stack,x.lastState=s,new f(x)}if(i._parentGroup)throw new f({type:"UnterminatedGroup",message:"Unterminated group!",lastIndex:i._parentGroup.indices[0],lastState:s,astStack:i});if(g){var y=i.groupCounter?i.groupCounter.i:0;delete i.groupCounter,h(i,t,t.length),i=o(i);var m=new n({raw:t,groupCount:y,tree:i});return m.traverse(l,CHARSET_NODE),m.traverse(u,ASSERT_NODE),c(i),d=!1,m}}function a(){return g||(g=t(E,d)),g}function s(t,e,r){Object.defineProperty(t,e,{value:r,enumerable:d,writable:!0,configurable:!0})}function o(t){return t.filter(function(t){return t.type==EXACT_NODE&&t.concatTemp?(delete t.concatTemp,!!t.chars):(t.sub?t.sub=o(t.sub):t.branches&&(t.branches=t.branches.map(o)),!0)})}function c(t){function e(t){t.sub?c(t.sub):t.branches&&t.branches.map(c)}var r=t[0];e(r);for(var n,i=1,a=1,s=t.length;it[1])throw new f({type:"OutOfOrder",lastIndex:t.lastIndex,message:"Range ["+t.join("-")+"] out of order in character class!"});return t.join("")}))}function f(t){this.name="RegexSyntaxError",this.type=t.type,this.lastIndex=t.lastIndex,this.lastState=t.lastState,this.astStack=t.astStack,this.message=t.message,Object.defineProperty(this,"stack",{value:new Error(t.message).stack,enumerable:!1})}var p={EXACT_NODE:"exact",CHARSET_NODE:"charset",CHOICE_NODE:"choice",GROUP_NODE:"group",ASSERT_NODE:"assert",DOT_NODE:"dot",BACKREF_NODE:"backref",EMPTY_NODE:"empty",AssertLookahead:"AssertLookahead",AssertNegativeLookahead:"AssertNegativeLookahead",AssertNonWordBoundary:"AssertNonWordBoundary",AssertWordBoundary:"AssertWordBoundary",AssertEnd:"AssertEnd",AssertBegin:"AssertBegin"};r(),n.prototype.traverse=function(t,e){function r(t,n){t.forEach(function(t){e&&t.type!==e||n(t),t.sub?r(t.sub,n):t.branches&&t.branches.forEach(function(t){r(t,n)})})}r(this.tree,t)};var d;i.Constants=p,i.exportConstants=r,i.RegexSyntaxError=f,i.getNFAParser=a;var g;f.prototype.toString=function(){return this.name+" "+this.type+":"+this.message};var x={n:"\n",r:"\r",t:"\t",v:"\v",f:"\f"},v=function(){function t(t,e,r){var n=t[0];(!n||n.type!=EXACT_NODE||n.repeat||n.chars&&!n.concatTemp)&&t.unshift({type:EXACT_NODE,indices:[r]}),n&&n.concatTemp&&(n.chars+=e)}function e(t,e,r){t.unshift({type:DOT_NODE,indices:[r]})}function r(t,e,r){t.unshift({type:EXACT_NODE,chars:"\0",indices:[r-1]})}function n(t,e,r){t.unshift({type:ASSERT_NODE,indices:[r],assertionType:AssertBegin})}function i(t,e,r,n,i){t.unshift({type:ASSERT_NODE,indices:[r],assertionType:AssertEnd})}function a(t,e,r){t.unshift({type:ASSERT_NODE,indices:[r-1],assertionType:"b"==e?AssertWordBoundary:AssertNonWordBoundary})}function o(t,e,r){t[0].type!==EXACT_NODE&&t.unshift({type:EXACT_NODE,indices:[r]})}function c(t,e,r){s(t[0],"_commaIndex",r)}function h(t,e,r,n,i){var a,s=t[0],o=i.lastIndexOf("{",r),c=parseInt(i.slice(o+1,s._commaIndex||r),10);if(s._commaIndex){if((a=s._commaIndex+1==r?1/0:parseInt(i.slice(s._commaIndex+1,r),10))=o&&t.shift(),d(t,c,a,o,i)}function u(t,e,r,n,i){d(t,0,1/0,r,i)}function l(t,e,r,n,i){d(t,0,1,r,i)}function p(t,e,r,n,i){d(t,1,1/0,r,i)}function d(t,e,r,n,i){var a=t[0],o={min:e,max:r,nonGreedy:!1},c=n-1;if(a.chars&&1===a.chars.length&&(c=a.indices[0]),a.type===EXACT_NODE){var h={type:EXACT_NODE,repeat:o,chars:a.chars?a.chars:i[c],indices:[c]};a.indices[0]===c&&t.shift(),t.unshift(h)}else a.repeat=o;s(o,"beginIndex",n-t[0].indices[0])}function g(t){t[0].repeat.nonGreedy=!0}function v(t,e,r){t.unshift({concatTemp:!0,type:EXACT_NODE,chars:"",indices:[r]})}function y(t,e,r){x.hasOwnProperty(e)&&(e=x[e]),t.unshift({type:EXACT_NODE,chars:e,indices:[r-1]})}function m(t,e,r){t.unshift({type:CHARSET_NODE,indices:[r-1],chars:"",ranges:[],classes:[e],exclude:!1})}function b(t,e,r,n,i){e=String.fromCharCode(parseInt(i[r-1]+e,16)),t.shift(),t.unshift({type:EXACT_NODE,chars:e,indices:[r-3]})}function _(t,e,r,n,i){e=String.fromCharCode(parseInt(i.slice(r-3,r+1),16)),t.shift(),t.unshift({type:EXACT_NODE,chars:e,indices:[r-5]})}function w(t,e,r){var n=t.groupCounter=t.groupCounter||{i:0};n.i++;var i={type:GROUP_NODE,num:n.i,sub:[],indices:[r],_parentStack:t};return t=i.sub,s(t,"_parentGroup",i),t.groupCounter=n,t}function E(t){var e=t._parentGroup;e.nonCapture=!0,e.num=void 0,t.groupCounter.i--}function C(t,e,r){var n=t._parentGroup;n.type=ASSERT_NODE,n.assertionType="="==e?AssertLookahead:AssertNegativeLookahead,n.num=void 0,t.groupCounter.i--}function k(t,e,r,n,i){t=A(t);var a=t._parentGroup;if(!a)throw new f({type:"UnexpectedChar",lastIndex:r,lastState:n,astStack:t,message:"Unexpected end parenthesis!"});return delete t._parentGroup,delete t.groupCounter,t=a._parentStack,delete a._parentStack,t.unshift(a),a.endParenIndex=r,t}function S(t,e,r){var n,i=[];if(t._parentChoice)n=t._parentChoice,n.branches.unshift(i),s(i,"_parentChoice",n),s(i,"_parentGroup",n),i.groupCounter=t.groupCounter,delete t._parentChoice,delete t.groupCounter;else{var a=t[t.length-1];n={type:CHOICE_NODE,indices:[a?a.indices[0]:r-1],branches:[]},s(n,"_parentStack",t),n.branches.unshift(t.slice()),t.length=0,t.unshift(n),i.groupCounter=t.groupCounter,s(i,"_parentChoice",n),s(i,"_parentGroup",n),n.branches.unshift(i)}return i}function A(t){if(t._parentChoice){var e=t._parentChoice;delete t._parentChoice,delete t._parentGroup,delete t.groupCounter;var r=e._parentStack;return delete e._parentStack,r}return t}function B(t,e,r){t.unshift({type:CHARSET_NODE,indices:[r],classes:[],ranges:[],chars:""})}function N(t){t[0].exclude=!0}function O(t,e,r){t[0].chars+=e}function T(t,e,r){x.hasOwnProperty(e)&&(e=x[e]),t[0].chars+=e}function R(t,e,r){t[0].chars+="\0"}function I(t,e){t[0].classes.push(e)}function M(t,e,r,n,i){var a=t[0];e=String.fromCharCode(parseInt(a.chars.slice(-1)+e,16)),a.chars=a.chars.slice(0,-2),a.chars+=e}function F(t,e,r,n,i){var a=t[0];e=String.fromCharCode(parseInt(a.chars.slice(-3)+e,16)),a.chars=a.chars.slice(0,-4),a.chars+=e}function D(t,e,r,n,i){var a=t[0],s=a.chars.slice(-2);s=[s[0],e],s.lastIndex=r,a.ranges.push(s),a.chars=a.chars.slice(0,-2)}function P(t,e){x.hasOwnProperty(e)&&(e=x[e]),D.apply(this,arguments)}function L(t,e,r){var n=t[0],i=n.chars.slice(-3)+e;n.chars=n.chars.slice(0,-3);var a=n.ranges.pop();e=String.fromCharCode(parseInt(i,16)),a=[a[0],e],a.lastIndex=r,n.ranges.push(a)}function z(t,e,r){var n=t[0],i=n.chars.slice(-1)+e;n.chars=n.chars.slice(0,-1);var a=n.ranges.pop();e=String.fromCharCode(parseInt(i,16)),a=[a[0],e],a.lastIndex=r,n.ranges.push(a)}function j(t,e,r,n){function i(t,e){return!!e._parentGroup&&(e._parentGroup.num==t?t:i(t,e._parentGroup._parentStack))}var a=t[0],s=parseInt(e,10),o="escape"===n,c=t.groupCounter,h=c&&c.i||0;if(o?(a={type:BACKREF_NODE,indices:[r-1]},t.unshift(a)):s=parseInt(a.num+""+s,10),s>h)throw new f({type:"InvalidBackReference",lastIndex:r,astStack:t,lastState:n,message:"Back reference number("+s+") greater than current groups count("+h+")."});if(i(s,t))throw new f({type:"InvalidBackReference",lastIndex:r,astStack:t,lastState:n,message:"Recursive back reference in group ("+s+") itself."});a.num=s}return{escapeStart:v,exact:t,dot:e,nullChar:r,assertBegin:n,assertEnd:i,assertWordBoundary:a,repeatnStart:o,repeatnComma:c,repeatNonGreedy:g,repeatnEnd:h,repeat1:p,repeat01:l,repeat0:u,charClassEscape:m,normalEscape:y,unicodeEscape:_,hexEscape:b,charClassEscape:m,groupStart:w,groupNonCapture:E,backref:j,groupToAssertion:C,groupEnd:k,choice:S,endChoice:A,charsetStart:B,charsetExclude:N,charsetContent:O,charsetNullChar:R,charsetClassEscape:I,charsetHexEscape:M,charsetUnicodeEscape:F,charsetRangeEnd:D,charsetNormalEscape:T,charsetRangeEndNormalEscape:P,charsetRangeEndUnicodeEscape:L,charsetRangeEndHexEscape:z}}(),y="0-9a-fA-F",m="repeatnStart,repeatn_1,repeatn_2,repeatnErrorStart,repeatnError_1,repeatnError_2",b="hexEscape1,hexEscape2",_="unicodeEscape1,unicodeEscape2,unicodeEscape3,unicodeEscape4",w="charsetUnicodeEscape1,charsetUnicodeEscape2,charsetUnicodeEscape3,charsetUnicodeEscape4,charsetHexEscape1,charsetHexEscape2",E={compact:!0,accepts:"start,begin,end,repeat0,repeat1,exact,repeatn,repeat01,repeatNonGreedy,choice,"+m+",nullChar,digitBackref,"+_+","+b,trans:[["start,begin,end,exact,repeatNonGreedy,repeat0,repeat1,repeat01,groupStart,groupQualifiedStart,choice,repeatn>exact","^+*?^$.|(){[\\",v.exact],["hexEscape1,hexEscape2,unicodeEscape1,unicodeEscape2,unicodeEscape3,unicodeEscape4>exact","^+*?^$.|(){[\\0-9a-fA-F",v.exact],["nullChar>exact","^+*?^$.|(){[\\0-9",v.exact],[m+",nullChar,digitBackref,"+_+","+b+",start,begin,end,exact,repeatNonGreedy,repeat0,repeat1,repeat01,groupStart,groupQualifiedStart,choice,repeatn>exact",".",v.dot],["start,groupStart,groupQualifiedStart,end,begin,exact,repeat0,repeat1,repeat01,repeatn,repeatNonGreedy,choice,"+m+",nullChar,digitBackref,"+_+","+b+">begin","^",v.assertBegin],[m+",nullChar,digitBackref,"+_+","+b+",exact>repeatnStart","{",v.repeatnStart],["start,begin,end,groupQualifiedStart,groupStart,repeat0,repeat1,repeatn,repeat01,repeatNonGreedy,choice>repeatnErrorStart","{",v.exact],["repeatnStart>repeatn_1","0-9",v.exact],["repeatn_1>repeatn_1","0-9",v.exact],["repeatn_1>repeatn_2",",",v.repeatnComma],["repeatn_2>repeatn_2","0-9",v.exact],["repeatn_1,repeatn_2>repeatn","}",v.repeatnEnd],["repeatnStart,repeatnErrorStart>exact","}",v.exact],["repeatnStart,repeatnErrorStart>exact","^+*?^$.|(){[\\0-9}",v.exact],["repeatnErrorStart>repeatnError_1","0-9",v.exact],["repeatnError_1>repeatnError_1","0-9",v.exact],["repeatnError_1>repeatnError_2",",",v.exact],["repeatnError_2>repeatnError_2","0-9",v.exact],["repeatnError_2,repeatnError_1>repeatErrorFinal","}"],["repeatn_1,repeatnError_1>exact","^+*?^$.|(){[\\0-9,}",v.exact],["repeatn_2,repeatnError_2>exact","^+*?^$.|(){[\\0-9}",v.exact],["exact,"+m+",nullChar,digitBackref,"+_+","+b+">repeat0","*",v.repeat0],["exact,"+m+",nullChar,digitBackref,"+_+","+b+">repeat1","+",v.repeat1],["exact,"+m+",nullChar,digitBackref,"+_+","+b+">repeat01","?",v.repeat01],["choice>repeatErrorFinal","*+?"],["repeat0,repeat1,repeat01,repeatn>repeatNonGreedy","?",v.repeatNonGreedy],["repeat0,repeat1,repeat01,repeatn>repeatErrorFinal","+*"],["start,begin,end,groupStart,groupQualifiedStart,exact,repeatNonGreedy,repeat0,repeat1,repeat01,repeatn,choice,"+m+",nullChar,digitBackref,"+_+","+b+">escape","\\",v.escapeStart],["escape>nullChar","0",v.nullChar],["nullChar>digitFollowNullError","0-9"],["escape>exact","^dDwWsSux0-9bB1-9",v.normalEscape],["escape>exact","bB",v.assertWordBoundary],["escape>exact","dDwWsS",v.charClassEscape],["escape>unicodeEscape1","u",v.exact],["unicodeEscape1>unicodeEscape2",y,v.exact],["unicodeEscape2>unicodeEscape3",y,v.exact],["unicodeEscape3>unicodeEscape4",y,v.exact],["unicodeEscape4>exact",y,v.unicodeEscape],["escape>hexEscape1","x",v.exact],["hexEscape1>hexEscape2",y,v.exact],["hexEscape2>exact",y,v.hexEscape],["escape>digitBackref","1-9",v.backref],["digitBackref>digitBackref","0-9",v.backref],["digitBackref>exact","^+*?^$.|(){[\\0-9",v.exact],["exact,begin,end,repeat0,repeat1,repeat01,repeatn,repeatNonGreedy,start,groupStart,groupQualifiedStart,choice,"+m+",nullChar,digitBackref,"+_+","+b+">groupStart","(",v.groupStart],["groupStart>groupQualify","?"],["groupQualify>groupQualifiedStart",":",v.groupNonCapture],["groupQualify>groupQualifiedStart","=",v.groupToAssertion],["groupQualify>groupQualifiedStart","!",v.groupToAssertion],[m+",nullChar,digitBackref,"+_+","+b+",groupStart,groupQualifiedStart,begin,end,exact,repeat1,repeat0,repeat01,repeatn,repeatNonGreedy,choice>exact",")",v.groupEnd],["start,begin,end,groupStart,groupQualifiedStart,exact,repeat0,repeat1,repeat01,repeatn,repeatNonGreedy,choice,"+m+",nullChar,digitBackref,"+_+","+b+">choice","|",v.choice],["start,groupStart,groupQualifiedStart,begin,exact,repeat0,repeat1,repeat01,repeatn,repeatNonGreedy,choice,"+m+",nullChar,digitBackref,"+_+","+b+">end","$",v.assertEnd],["exact,begin,end,repeat0,repeat1,repeat01,repeatn,repeatNonGreedy,groupQualifiedStart,groupStart,start,choice,"+m+",nullChar,digitBackref,"+_+","+b+">charsetStart","[",v.charsetStart],["charsetStart>charsetExclude","^",v.charsetExclude],["charsetStart>charsetContent","^\\]^",v.charsetContent],["charsetExclude>charsetContent","^\\]",v.charsetContent],["charsetContent,charsetClass>charsetContent","^\\]-",v.charsetContent],["charsetClass>charsetContent","-",v.charsetContent],[w+",charsetStart,charsetContent,charsetNullChar,charsetClass,charsetExclude,charsetRangeEnd>charsetEscape","\\"],["charsetEscape>charsetContent","^dDwWsSux0-9",v.charsetNormalEscape],["charsetEscape>charsetNullChar","0",v.charsetNullChar],["charsetEscape>charsetOctEscape","1-9"],["charsetRangeEndEscape>charsetOctEscape","1-9"],["charsetNullChar>digitFollowNullError","0-9"],["charsetNullChar>charsetContent","^0-9\\]-",v.charsetContent],["charsetEscape>charsetClass","dDwWsS",v.charsetClassEscape],["charsetEscape>charsetUnicodeEscape1","u",v.charsetContent],["charsetUnicodeEscape1>charsetUnicodeEscape2",y,v.charsetContent],["charsetUnicodeEscape2>charsetUnicodeEscape3",y,v.charsetContent],["charsetUnicodeEscape3>charsetUnicodeEscape4",y,v.charsetContent],["charsetUnicodeEscape4>charsetContent",y,v.charsetUnicodeEscape],["charsetEscape>charsetHexEscape1","x",v.charsetContent],["charsetHexEscape1>charsetHexEscape2",y,v.charsetContent],["charsetHexEscape2>charsetContent",y,v.charsetHexEscape],[w+">charsetContent","^\\]0-9a-fA-F-",v.charsetContent],[w+",charsetNullChar,charsetContent>charsetRangeStart","-",v.charsetContent],["charsetRangeStart>charsetRangeEnd","^\\]",v.charsetRangeEnd],["charsetRangeEnd>charsetContent","^\\]",v.charsetContent],["charsetRangeStart>charsetRangeEndEscape","\\"],["charsetRangeEndEscape>charsetRangeEnd","^dDwWsSux0-9bB1-9",v.charsetRangeEndNormalEscape],["charsetRangeEndEscape>charsetRangeEndWithNullChar","0"],["charsetRangeEndEscape>charsetRangeEndUnicodeEscape1","u",v.charsetRangeEnd],["charsetRangeEndUnicodeEscape1>charsetRangeEndUnicodeEscape2",y,v.charsetContent],["charsetRangeEndUnicodeEscape2>charsetRangeEndUnicodeEscape3",y,v.charsetContent],["charsetRangeEndUnicodeEscape3>charsetRangeEndUnicodeEscape4",y,v.charsetContent],["charsetRangeEndUnicodeEscape4>charsetRangeEnd",y,v.charsetRangeEndUnicodeEscape],["charsetRangeEndEscape>charsetRangeEndHexEscape1","x",v.charsetRangeEnd],["charsetRangeEndHexEscape1>charsetRangeEndHexEscape2",y,v.charsetContent],["charsetRangeEndHexEscape2>charsetRangeEnd",y,v.charsetRangeEndHexEscape],["charsetRangeEndEscape>charsetRangeEndClass","dDwWsS"],["charsetRangeEndUnicodeEscape1,charsetRangeEndHexEscape1>charsetContent","^\\]0-9a-fA-F",v.charsetContent],["charsetRangeEndUnicodeEscape2,charsetRangeEndUnicodeEscape3,charsetRangeEndUnicodeEscape4,charsetRangeEndHexEscape2>charsetRangeStart","-",v.charsetContent],[w+",charsetRangeEndUnicodeEscape1,charsetRangeEndHexEscape1,charsetRangeEndUnicodeEscape2,charsetRangeEndUnicodeEscape3,charsetRangeEndUnicodeEscape4,charsetRangeEndHexEscape2,charsetNullChar,charsetRangeStart,charsetContent,charsetClass,charsetExclude,charsetRangeEnd>exact","]"]]};return i}),"function"!=typeof define)var define=require("amdefine")(module);if(define("RegExp",["./parse","./Kit","./NFA"],function(t,e,r){function n(e,r){if(!(this instanceof n))return new n(e,r);e+="";var o={};"string"==typeof r?(r=r.toLowerCase(),~r.indexOf("i")&&(o.ignoreCase=!0),~r.indexOf("m")&&(o.multiline=!0),~r.indexOf("g")&&(o.global=!0),~r.indexOf("d")&&(o.debug=!0)):o=r;var c=this.ast=t(e);this.source=e,this.multiline=!!o.multiline,this.global=!!o.global,this.ignoreCase=!!o.ignoreCase,this.debug=!!o.debug,this.flags="",this.multiline&&(this.flags+="m"),this.ignoreCase&&(this.flags+="i"),this.global&&(this.flags+="g"),p(this,["source","options","multiline","global","ignoreCase","flags","debug"]);var h=this.ignoreCase;c.traverse(function(t){s(t,h)},CHARSET_NODE),c.traverse(function(t){i(t,h)},EXACT_NODE),this.multiline&&c.traverse(a,ASSERT_NODE)}function i(t,e){var r;r=t.chars.split(""),r=e?r.map(function(t){return/[a-z]/.test(t)?[t,t.toUpperCase()]:/[A-Z]/.test(t)?[t,t.toLowerCase()]:[t]}):r.map(function(t){return[t]}),t.explained=r}function a(t){var e=t.assertionType;e!==AssertBegin&&e!==AssertEnd||(t.multiline=!0)}function s(t,r){var n=t.chars.split("");n=n.concat(e.flatten2(t.classes.map(function(t){return g[t]}))),n=n.concat(t.ranges),r&&(n=o(n)),n=e.classify(n).ranges,t.exclude&&(n=e.negate(n)),n=e.coalesce(n),t.explained=n}function o(t){return e.flatten2(t.map(function(t){var r=e.classify([t,"az","AZ"]).map[t];return e.flatten2(r.map(function(t){return/[a-z]/.test(t)?[t,t.toUpperCase()]:/[A-Z]/.test(t)?[t,t.toLowerCase()]:[t]}))}))}function c(t,e){var r,n=[];return e=e||["start"],r=t.reduce(function(t,e){var r=h(e,t);return n=n.concat(r.trans),r.accepts},e),{accepts:r,trans:n}}function h(t,e){return t.repeat?f(t,e):m[t.type](t,e)}function u(t,e,r){for(var n,i,a,s=0,o=t.length;so;c--)r=i(t,e),h=h.concat(r.trans),e=r.accepts,u=u.concat(r.accepts);else{var f=e.slice();r=i(t,e),h=h.concat(r.trans),u=u.concat(r.accepts),h.push({from:r.accepts,to:f,charset:!1})}var p=[l()];return s.nonGreedy?(a.push({from:u,to:p,charset:!1}),a=a.concat(h)):(a=a.concat(h),a.push({from:u,to:p,charset:!1})),{accepts:p,trans:a}}function p(t,e){e.forEach(function(e){Object.defineProperty(t,e,{writable:!1,enumerable:!0})})}t.exportConstants(),n.DEBUG=n.D=1,n.MULTILINE=n.M=2,n.GLOBAL=n.G=4,n.IGNORECASE=n.I=8,n.prototype={toString:function(){return"/"+this.source+"/"+this.flags},test:function(t){return null!==this.exec(t)},exec:function(t){for(var e,r=this.getNFA(),n=this.global?this.lastIndex||0:0,i=t.length;n1?Math.max.apply(Math,o.map(function(t){return t.length})):n.length,a*=s.width;return{label:{type:"text",x:t,y:e-c/2-4,text:n,"font-size":b,"font-family":E,fill:i||"#444"},x:t-a/2,y:e-c-4,width:a,height:c+4}}function u(t,e,r){return{type:"path",x:t,y:e,path:["M",t,e,"H",r],"stroke-linecap":"butt","stroke-linejoin":"round",stroke:"#333","stroke-width":2,_translate:function(t,e){var r=this.path;r[1]+=t,r[2]+=e,r[4]+=t}}}function l(t,e,r,n){var i,a,s=t>r?-1:1,o=e>n?-1:1;return Math.abs(e-n)<15?(i=["M",t,e,"C",t+Math.min(Math.abs(r-t)/2,10)*s,e,r-(r-t)/2,n,r,n],a=function(t,e){var r=this.path;r[1]+=t,r[2]+=e,r[4]+=t,r[5]+=e,r[6]+=t,r[7]+=e,r[8]+=t,r[9]+=e}):(i=["M",t,e,"Q",t+10*s,e,t+10*s,e+10*o,"V",Math.abs(e-n)<20?e+10*o:n-10*o,"Q",t+10*s,n,t+10*s*2,n,"H",r],a=function(t,e){var r=this.path;r[1]+=t,r[2]+=e,r[4]+=t,r[5]+=e,r[6]+=t,r[7]+=e,r[9]+=e,r[11]+=t,r[12]+=e,r[13]+=t,r[14]+=e,r[16]+=t}),{type:"path",path:i,"stroke-linecap":"butt","stroke-linejoin":"round",stroke:"#333","stroke-width":2,_translate:a}}function f(t,e,r){return{items:[{type:"circle",fill:r,cx:t+10,cy:e,r:10,stroke:"none",_translate:function(t,e){this.cx+=t,this.cy+=e}}],width:20,height:20,x:t,y:e,lineInX:t,lineOutX:t+20}}function p(t){if(Array.isArray(t)){for(var e=t,r=0;r1?" to ":" or ")+n(a.max):o+=" or more times");var d=10,g=0,x=10,v=u.y+u.height-r,y=20+u.width;l=y;var m;1!==a.max?(v+=10,f+=10,m={type:"path",path:["M",u.x+10,r,"Q",e,r,e,r+x,"V",r+v-x,"Q",e,r+v,e+x,r+v,"H",e+y-x,"Q",e+y,r+v,e+y,r+v-x,"V",r+x,"Q",e+y,r,u.x+u.width+10,r],_translate:i,stroke:"maroon","stroke-width":2},a.nonGreedy&&(m.stroke="Brown",m["stroke-dasharray"]="-"),c.push(m)):o=!1;var b;if(0===a.min){var _=r-u.y+10,w=y+20;d+=10,g=-12,l=w,f+=10,b={type:"path",path:["M",e,r,"Q",e+x,r,e+x,r-x,"V",r-_+x,"Q",e+x,r-_,e+20,r-_,"H",e+w-20,"Q",e+w-x,r-_,e+w-x,r-_+x,"V",r-x,"Q",e+w-x,r,e+w,r],_translate:i,stroke:a.nonGreedy?"darkgreen":"#333","stroke-width":2},m&&s([m],10,0),c.push(b)}if(o){var E=h(e+l/2,r,o);s([E.label],0,v+E.height+4),c.push(E.label),f+=4+E.height;var C=(Math.max(E.width,l)-l)/2;C&&s(c,C,0),l=Math.max(E.width,l),d+=C}return s(u.items,d,0),c=c.concat(u.items),{items:c,width:l,height:f,x:e,y:u.y+g,lineInX:u.lineInX+d,lineOutX:u.lineOutX+d}},choice:function(t,e,r){if(p(t))return A.empty(null,e,r);var n=0,i=0,a=t.branches.map(function(t){var a=o(t,e,r);return n+=a.height,i=Math.max(i,a.width),a});n+=6*(a.length-1)+8,i+=40;var c=e+i/2,h=r-n/2+4,f=e+i,d=[];return a.forEach(function(t){var n=c-t.width/2;s(t.items,n-t.x,h-t.y),d=d.concat(t.items);var a=r+h-t.y,o=l(e,r,e+20,a),p=l(f,r,e+i-20,a);d.push(o,p),e+20!==n-t.x+t.lineInX&&d.push(u(e+20,a,n-t.x+t.lineInX)),t.lineOutX+n-t.x!=e+i-20&&d.push(u(t.lineOutX+n-t.x,a,e+i-20)),t.x=n,t.y=h,h+=t.height+6}),{items:d,width:i,height:n,x:e,y:r-n/2,lineInX:e,lineOutX:f}},charset:function(t,e,r){var n={d:"Digit",D:"NonDigit",w:"Word",W:"NonWord",s:"WhiteSpace",S:"NonWhiteSpace"},i=t.exclude?"Pink":"Khaki",a=t.exclude?"#C00":"";if(v(t)){var o=c(n[t.classes[0]],e,r,"Green","white");if(o.rect.r=5,t.exclude){var u=h(o.x+o.width/2,o.y,"None of:",a),l=o.items;l.push(u.label);var f=o.width,p=Math.max(u.width,o.width),d=(p-f)/2;return s(l,d,0),{items:l,width:p,height:o.height+u.height,x:Math.min(u.x,o.x),y:u.y,lineInX:d+o.x,lineOutX:d+o.x+o.width}}return o}if(!t.chars&&!t.ranges.length&&!t.classes.length){var o=c("AnyChar",e,r,"green","white");return o.rect.r=5,o}var g,x,y=[],p=0,m=0;t.chars&&(g=c(t.chars,e,r,"LightSkyBlue","black"),g.rect.r=5,y.push(g),p=g.width),t.ranges.forEach(function(t){t=t.split("").join("-");var n=c(t,e,r,"teal","white");n.rect.r=5,y.push(n),p=Math.max(n.width,p)}),t.classes.forEach(function(t){var i=c(n[t],e,r,"Green","white");i.rect.r=5,y.push(i),p=Math.max(i.width,p)}),x=y[0].height;var b=[],_=[];y.sort(function(t,e){return e.width-t.width}),y.forEach(function(t){2*t.width+4>p?b.push(t):_.push(t)}),y=b;for(var w,E;_.length;){if(w=_.pop(),!(E=_.pop())){y.push(w);break}w.width-E.width>2?(y.push(w),_.push(E)):(s(E.items,w.width+4,0),y.push({items:w.items.concat(E.items),width:w.width+E.width+4,height:w.height,x:w.x,y:w.y}),m-=w.height)}p+=12,m=4*(y.length-1)+y.length*x+12;var C={type:"rect",x:e,y:r-m/2,r:4,width:p,height:m,stroke:"none",fill:i},k=C.y+6,l=[C];y.forEach(function(t){s(t.items,e-t.x+(p-t.width)/2,k-t.y),l=l.concat(t.items),k+=t.height+4});var u=h(C.x+C.width/2,C.y,(t.exclude?"None":"One")+" of:",a);l.push(u.label);var f=p;p=Math.max(u.width,p);var d=(p-f)/2;return s(l,d,0),{items:l,width:p,height:m+u.height,x:Math.min(u.x,e),y:u.y,lineInX:d+e,lineOutX:d+e+C.width}},group:function(t,e,r){if(p(t))return A.empty(null,e,r);var n=o(t.sub,e,r);if(t.num){s(n.items,10,0);var i=n.width+20,a=n.height+20,c={type:"rect",x:e,y:n.y-10,r:6,width:i,height:a,"stroke-dasharray":".",stroke:"silver","stroke-width":2},u=h(c.x+c.width/2,c.y-2,"Group #"+t.num),l=n.items.concat([c,u.label]),f=Math.max(u.width,i),d=(f-i)/2;return d&&s(l,d,0),{items:l,width:f,height:a+u.height+4,x:e,y:u.y,lineInX:d+n.lineInX+10,lineOutX:d+n.lineOutX+10}}return n},assert:function(t,e,r){var n,i={AssertNonWordBoundary:{bg:"maroon",fg:"white"},AssertWordBoundary:{bg:"purple",fg:"white"},AssertEnd:{bg:"Indigo",fg:"white"},AssertBegin:{bg:"Indigo",fg:"white"}},a=t.assertionType,o=a.replace("Assert","")+"!";if(n=i[a])return!C||"AssertBegin"!==a&&"AssertEnd"!==a||(o="Line"+o),c(o,e,r,n.bg,n.fg);var u,l;a===AssertLookahead?(u="CornflowerBlue",l="darkgreen",o="Followed by:"):a===AssertNegativeLookahead&&(u="#F63",l="Purple",o="Not followed by:");var f=A.group(t,e,r),p=f.height+16,d=f.width+16,g={type:"rect",x:e,y:f.y-8,r:6,width:d,height:p,"stroke-dasharray":"-",stroke:u,"stroke-width":2},x=h(g.x+d/2,g.y,o,l),v=Math.max(d,x.width),y=(v-d)/2;return s(f.items,y+8,0),y&&s([g,x.label],y,0),{items:f.items.concat([g,x.label]),width:v,height:g.height+x.height,x:e,y:x.y,lineInX:y+f.lineInX+8,lineOutX:y+f.lineOutX+8}}},B={delimiter:"Indigo",flags:"darkgreen",exact:"#334",dot:"darkblue",backref:"teal",$:"purple","^":"purple","\\b":"#F30","\\B":"#F30","(":"blue",")":"blue","?=":"darkgreen","?!":"red","?:":"grey","[":"navy","]":"navy","|":"blue","{":"maroon",",":"maroon","}":"maroon","*":"maroon","+":"maroon","?":"maroon",repeatNonGreedy:"#F61",defaults:"black",charsetRange:"olive",charsetClass:"navy",charsetExclude:"red",charsetChars:"#534"};return i}),function(t){var e,r,n="hasOwnProperty",i=/[\.\/]/,a=function(){},s=function(t,e){return t-e},o={n:{}},c=function(t,n){t=String(t);var i,a=r,o=Array.prototype.slice.call(arguments,2),h=c.listeners(t),u=0,l=[],f={},p=[],d=e;e=t,r=0;for(var g=0,x=h.length;g=1e3&&delete o[c.shift()],c.push(s),o[s]=t[N](e,a),r?r(o[s]):o[s])}return n}function s(){return this.hex}function o(t,e){for(var r=[],n=0,i=t.length;i-2*!e>n;n+=2){var a=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?i-4==n?a[3]={x:+t[0],y:+t[1]}:i-2==n&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4==n?a[3]=a[2]:n||(a[0]={x:+t[n],y:+t[n+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}function c(t,e,r,n,i){return t*(t*(-3*e+9*r-9*n+3*i)+6*e-12*r+6*n)-3*e+3*r}function h(t,e,r,n,i,a,s,o,h){null==h&&(h=1),h=h>1?1:h<0?0:h;for(var u=h/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,d=0;d<12;d++){var g=u*l[d]+u,x=c(g,t,r,i,s),v=c(g,e,n,a,o),y=x*x+v*v;p+=f[d]*z.sqrt(y)}return u*p}function u(t,e,r,n,i,a,s,o,c){if(!(c<0||h(t,e,r,n,i,a,s,o).01;)l/=2,f+=(uj(i,s)||j(e,n)j(a,o))){var c=(t*n-e*r)*(i-s)-(t-r)*(i*o-a*s),h=(t*n-e*r)*(a-o)-(e-n)*(i*o-a*s),u=(t-r)*(a-o)-(e-n)*(i-s);if(u){var l=c/u,f=h/u,p=+l.toFixed(2),d=+f.toFixed(2);if(!(p<+U(t,r).toFixed(2)||p>+j(t,r).toFixed(2)||p<+U(i,s).toFixed(2)||p>+j(i,s).toFixed(2)||d<+U(e,n).toFixed(2)||d>+j(e,n).toFixed(2)||d<+U(a,o).toFixed(2)||d>+j(a,o).toFixed(2)))return{x:l,y:f}}}}function f(t,e,n){var i=r.bezierBBox(t),a=r.bezierBBox(e);if(!r.isBBoxIntersect(i,a))return n?0:[];for(var s=h.apply(0,t),o=h.apply(0,e),c=j(~~(s/5),1),u=j(~~(o/5),1),f=[],p=[],d={},g=n?0:[],x=0;x=0&&S<=1.001&&A>=0&&A<=1.001&&(n?g++:g.push({x:k.x,y:k.y,t1:U(S,1),t2:U(A,1)}))}}return g}function p(t,e,n){t=r._path2curve(t),e=r._path2curve(e);for(var i,a,s,o,c,h,u,l,p,d,g=n?0:[],x=0,v=t.length;xn)return n;for(;ra?r=i:n=i,i=(n-r)/2+r}return i}var c=3*e,h=3*(n-e)-c,u=1-c-h,l=3*r,f=3*(i-r)-l,p=1-l-f;return function(t,e){var r=o(t,e);return((p*r+f)*r+l)*r}(t,1/(200*a))}function v(t,e){var r=[],n={};if(this.ms=e,this.times=1,t){for(var i in t)t[k](i)&&(n[Z(i)]=t[i],r.push(Z(i)));r.sort(ut)}this.anim=n,this.top=r[r.length-1],this.percents=r}function y(t,n,i,a,s,o){i=Z(i);var c,h,u,l,f,p,g=t.ms,v={},y={},m={};if(a)for(_=0,E=oe.length;_a*t.top){i=t.percents[_],f=t.percents[_-1]||0,g=g/t.top*(i-f),l=t.percents[_+1],c=t.anim[i];break}a&&n.attr(t.anim[t.percents[_]])}if(c){if(h)h.initstatus=a,h.start=new Date-h.ms*a;else{for(var C in c)if(c[k](C)&&(rt[k](C)||n.paper.customAttributes[k](C)))switch(v[C]=n.attr(C),null==v[C]&&(v[C]=et[C]),y[C]=c[C],rt[C]){case H:m[C]=(y[C]-v[C])/g;break;case"colour":v[C]=r.getRGB(v[C]);var S=r.getRGB(y[C]);m[C]={r:(S.r-v[C].r)/g,g:(S.g-v[C].g)/g,b:(S.b-v[C].b)/g};break;case"path":var A=Ft(v[C],y[C]),B=A[1];for(v[C]=A[0],m[C]=[],_=0,E=v[C].length;_',vt=yt.firstChild,vt.style.behavior="url(#default#VML)",!vt||"object"!=typeof vt.adj)return r.type=R;yt=null}r.svg=!(r.vml="VML"==r.type),r._Paper=B,r.fn=_=B.prototype=r.prototype,r._id=0,r._oid=0,r.is=function(t,e){return e=L.call(e),"finite"==e?!Y[k](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||V.call(t).slice(8,-1).toLowerCase()==e},r.angle=function(t,e,n,i,a,s){if(null==a){var o=t-n,c=e-i;return o||c?(180+180*z.atan2(-c,-o)/q+360)%360:0}return r.angle(t,e,a,s)-r.angle(n,i,a,s)},r.rad=function(t){return t%360*q/180},r.deg=function(t){return 180*t/q%360},r.snapTo=function(t,e,n){if(n=r.is(n,"finite")?n:10,r.is(t,W)){for(var i=t.length;i--;)if(X(t[i]-e)<=n)return t[i]}else{t=+t;var a=e%t;if(at-n)return e-a+t}return e};r.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*z.random()|0;return("x"==t?e:3&e|8).toString(16)});r.setWindow=function(t){e("raphael.setWindow",r,S.win,t),S.win=t,S.doc=S.win.document,r._engine.initWin&&r._engine.initWin(S.win)};var mt=function(t){if(r.vml){var e,n=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write(""),i.close(),e=i.body}catch(t){e=createPopup().document.body}var s=e.createTextRange();mt=a(function(t){try{e.style.color=M(t).replace(n,R);var r=s.queryCommandValue("ForeColor");return r=(255&r)<<16|65280&r|(16711680&r)>>>16,"#"+("000000"+r.toString(16)).slice(-6)}catch(t){return"none"}})}else{var o=S.doc.createElement("i");o.title="Raphaël Colour Picker",o.style.display="none",S.doc.body.appendChild(o),mt=a(function(t){return o.style.color=t,S.doc.defaultView.getComputedStyle(o,R).getPropertyValue("color")})}return mt(t)},bt=function(){return"hsb("+[this.h,this.s,this.b]+")"},_t=function(){return"hsl("+[this.h,this.s,this.l]+")"},wt=function(){return this.hex},Et=function(t,e,n){if(null==e&&r.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(n=t.b,e=t.g,t=t.r),null==e&&r.is(t,"string")){var i=r.getRGB(t);t=i.r,e=i.g,n=i.b}return(t>1||e>1||n>1)&&(t/=255,e/=255,n/=255),[t,e,n]},Ct=function(t,e,n,i){t*=255,e*=255,n*=255;var a={r:t,g:e,b:n,hex:r.rgb(t,e,n),toString:wt};return r.is(i,"finite")&&(a.opacity=i),a};r.color=function(t){var e;return r.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=r.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):r.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=r.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):(r.is(t,"string")&&(t=r.getRGB(t)),r.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(e=r.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=r.rgb2hsb(t),t.v=e.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.toString=wt,t},r.hsb2rgb=function(t,e,r,n){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,t=t.h,n=t.o),t*=360;var i,a,s,o,c;return t=t%360/60,c=r*e,o=c*(1-X(t%2-1)),i=a=s=r-c,t=~~t,i+=[c,o,0,0,o,c][t],a+=[o,c,c,o,0,0][t],s+=[0,0,o,c,c,o][t],Ct(i,a,s,n)},r.hsl2rgb=function(t,e,r,n){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t*=360;var i,a,s,o,c;return t=t%360/60,c=2*e*(r<.5?r:1-r),o=c*(1-X(t%2-1)),i=a=s=r-c/2,t=~~t,i+=[c,o,0,0,o,c][t],a+=[o,c,c,o,0,0][t],s+=[0,0,o,c,c,o][t],Ct(i,a,s,n)},r.rgb2hsb=function(t,e,r){r=Et(t,e,r),t=r[0],e=r[1],r=r[2];var n,i,a,s;return a=j(t,e,r),s=a-U(t,e,r),n=0==s?null:a==t?(e-r)/s:a==e?(r-t)/s+2:(t-e)/s+4,n=(n+360)%6*60/360,i=0==s?0:s/a,{h:n,s:i,b:a,toString:bt}},r.rgb2hsl=function(t,e,r){r=Et(t,e,r),t=r[0],e=r[1],r=r[2];var n,i,a,s,o,c;return s=j(t,e,r),o=U(t,e,r),c=s-o,n=0==c?null:s==t?(e-r)/c:s==e?(r-t)/c+2:(t-e)/c+4,n=(n+360)%6*60/360,a=(s+o)/2,i=0==c?0:a<.5?c/(2*a):c/(2-2*a),{h:n,s:i,l:a,toString:_t}},r._path2string=function(){return this.join(",").replace(at,"$1")};r._preload=function(t,e){var r=S.doc.createElement("img");r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,S.doc.body.removeChild(this)},r.onerror=function(){S.doc.body.removeChild(this)},S.doc.body.appendChild(r),r.src=t};r.getRGB=a(function(t){if(!t||(t=M(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:s};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:s};!(it[k](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=mt(t));var e,n,i,a,o,c,h=t.match(Q);return h?(h[2]&&(i=J(h[2].substring(5),16),n=J(h[2].substring(3,5),16),e=J(h[2].substring(1,3),16)),h[3]&&(i=J((o=h[3].charAt(3))+o,16), n=J((o=h[3].charAt(2))+o,16),e=J((o=h[3].charAt(1))+o,16)),h[4]&&(c=h[4][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),"rgba"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100)),h[5]?(c=h[5][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsba"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),r.hsb2rgb(e,n,i,a)):h[6]?(c=h[6][F](nt),e=Z(c[0]),"%"==c[0].slice(-1)&&(e*=2.55),n=Z(c[1]),"%"==c[1].slice(-1)&&(n*=2.55),i=Z(c[2]),"%"==c[2].slice(-1)&&(i*=2.55),("deg"==c[0].slice(-3)||"°"==c[0].slice(-1))&&(e/=360),"hsla"==h[1].toLowerCase().slice(0,4)&&(a=Z(c[3])),c[3]&&"%"==c[3].slice(-1)&&(a/=100),r.hsl2rgb(e,n,i,a)):(h={r:e,g:n,b:i,toString:s},h.hex="#"+(16777216|i|n<<8|e<<16).toString(16).slice(1),r.is(a,"finite")&&(h.opacity=a),h)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:s}},r),r.hsb=a(function(t,e,n){return r.hsb2rgb(t,e,n).hex}),r.hsl=a(function(t,e,n){return r.hsl2rgb(t,e,n).hex}),r.rgb=a(function(t,e,r){return"#"+(16777216|r|e<<8|t<<16).toString(16).slice(1)}),r.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},r.getColor.reset=function(){delete this.start},r.parsePathString=function(t){if(!t)return null;var e=kt(t);if(e.arr)return At(e.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return r.is(t,W)&&r.is(t[0],W)&&(i=At(t)),i.length||M(t).replace(st,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(ct,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(i.push([e][O](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)i.push([e][O](a));else for(;a.length>=n[s]&&(i.push([e][O](a.splice(0,n[s]))),n[s]););}),i.toString=r._path2string,e.arr=At(i),i},r.parseTransformString=a(function(t){if(!t)return null;var e=[];return r.is(t,W)&&r.is(t[0],W)&&(e=At(t)),e.length||M(t).replace(ot,function(t,r,n){var i=[];L.call(r);n.replace(ct,function(t,e){e&&i.push(+e)}),e.push([r][O](i))}),e.toString=r._path2string,e});var kt=function(t){var e=kt.ps=kt.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[k](r)&&r!=t&&!--e[r].sleep&&delete e[r]}),e[t]};r.findDotsAtSegment=function(t,e,r,n,i,a,s,o,c){var h=1-c,u=G(h,3),l=G(h,2),f=c*c,p=f*c,d=u*t+3*l*c*r+3*h*c*c*i+p*s,g=u*e+3*l*c*n+3*h*c*c*a+p*o,x=t+2*c*(r-t)+f*(i-2*r+t),v=e+2*c*(n-e)+f*(a-2*n+e),y=r+2*c*(i-r)+f*(s-2*i+r),m=n+2*c*(a-n)+f*(o-2*a+n),b=h*t+c*r,_=h*e+c*n,w=h*i+c*s,E=h*a+c*o,C=90-180*z.atan2(x-y,v-m)/q;return(x>y||v=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},r.isBBoxIntersect=function(t,e){var n=r.isPointInsideBBox;return n(e,t.x,t.y)||n(e,t.x2,t.y)||n(e,t.x,t.y2)||n(e,t.x2,t.y2)||n(t,e.x,e.y)||n(t,e.x2,e.y)||n(t,e.x,e.y2)||n(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)},r.pathIntersection=function(t,e){return p(t,e)},r.pathIntersectionNumber=function(t,e){return p(t,e,1)},r.isPointInsidePath=function(t,e,n){var i=r.pathBBox(t);return r.isPointInsideBBox(i,e,n)&&p(t,[["M",e,n],["H",i.x2+10]],1)%2==1},r._removedFactory=function(t){return function(){e("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var St=r.pathBBox=function(t){var e=kt(t);if(e.bbox)return n(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=Ft(t);for(var r,i=0,a=0,s=[],o=[],c=0,h=t.length;c1&&(y=z.sqrt(y),r*=y,n*=y);var m=r*r,b=n*n,_=(s==o?-1:1)*z.sqrt(X((m*b-m*v*v-b*x*x)/(m*v*v+b*x*x))),w=_*r*v/n+(t+c)/2,E=_*-n*x/r+(e+h)/2,C=z.asin(((e-E)/n).toFixed(9)),k=z.asin(((h-E)/n).toFixed(9));C=tk&&(C-=2*q),!o&&k>C&&(k-=2*q)}var S=k-C;if(X(S)>f){var A=k,B=c,N=h;k=C+f*(o&&k>C?1:-1),c=w+r*z.cos(k),h=E+n*z.sin(k),d=Rt(c,h,r,n,i,0,o,B,N,[k,A,w,E])}S=k-C;var T=z.cos(C),R=z.sin(C),I=z.cos(k),M=z.sin(k),D=z.tan(S/4),P=4/3*r*D,L=4/3*n*D,j=[t,e],U=[t+P*R,e-L*T],G=[c+P*M,h-L*I],H=[c,h];if(U[0]=2*j[0]-U[0],U[1]=2*j[1]-U[1],u)return[U,G,H][O](d);d=[U,G,H][O](d).join()[F](",");for(var W=[],V=0,Q=d.length;V"1e12"&&(f=.5),X(p)>"1e12"&&(p=.5),f>0&&f<1&&(c=It(t,e,r,n,i,a,s,o,f),g.push(c.x),d.push(c.y)),p>0&&p<1&&(c=It(t,e,r,n,i,a,s,o,p),g.push(c.x),d.push(c.y)),h=a-2*n+e-(o-2*a+n),u=2*(n-e)-2*(a-n),l=e-n,f=(-u+z.sqrt(u*u-4*h*l))/2/h,p=(-u-z.sqrt(u*u-4*h*l))/2/h,X(f)>"1e12"&&(f=.5),X(p)>"1e12"&&(p=.5),f>0&&f<1&&(c=It(t,e,r,n,i,a,s,o,f),g.push(c.x),d.push(c.y)),p>0&&p<1&&(c=It(t,e,r,n,i,a,s,o,p),g.push(c.x),d.push(c.y)),{min:{x:U[N](0,g),y:U[N](0,d)},max:{x:j[N](0,g),y:j[N](0,d)}}}),Ft=r._path2curve=a(function(t,e){var r=!e&&kt(t);if(!e&&r.curve)return At(r.curve);for(var n=Nt(t),i=e&&Nt(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=(function(t,e,r){var n,i,a={T:1,Q:1};if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in a)&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][O](Rt[N](0,[e.x,e.y][O](t.slice(1))));break;case"S":"C"==r||"S"==r?(n=2*e.x-e.bx,i=2*e.y-e.by):(n=e.x,i=e.y),t=["C",n,i][O](t.slice(1));break;case"T":"Q"==r||"T"==r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][O](Tt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][O](Tt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][O](Ot(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][O](Ot(e.x,e.y,t[1],e.y));break;case"V":t=["C"][O](Ot(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][O](Ot(e.x,e.y,e.X,e.Y))}return t}),c=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)t.splice(e++,0,["C"][O](r.splice(0,6)));t.splice(e,1),l=j(n.length,i&&i.length||0)}},h=function(t,e,r,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],l=j(n.length,i&&i.length||0))},u=0,l=j(n.length,i&&i.length||0);ui){if(e&&!f.start){if(u=ee(s,o,c[1],c[2],c[3],c[4],c[5],c[6],i-p),l+=["C"+u.start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],a)return l;f.start=l,l=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,c[5],c[6]].join(),p+=h,s=+c[5],o=+c[6];continue}if(!t&&!e)return u=ee(s,o,c[1],c[2],c[3],c[4],c[5],c[6],i-p),{x:u.x,y:u.y,alpha:u.alpha}}p+=h,s=+c[5],o=+c[6]}l+=c.shift()+c}return f.end=l,u=t?p:e?f:r.findDotsAtSegment(s,o,c[0],c[1],c[2],c[3],c[4],c[5],1),u.alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},ne=re(1),ie=re(),ae=re(0,1);r.getTotalLength=ne,r.getPointAtLength=ie,r.getSubpath=function(t,e,r){if(this.getTotalLength(t)-r<1e-6)return ae(t,e).end;var n=ae(t,r,1);return e?ae(n,e).end:n},Kt.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():ne(t)},Kt.getPointAtLength=function(t){var e=this.getPath();if(e)return ie(e,t)},Kt.getPath=function(){var t,e=r._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return e&&(t=e(this)),t},Kt.getSubpath=function(t,e){var n=this.getPath();if(n)return r.getSubpath(n,t,e)};var se=r.easing_formulas={linear:function(t){return t},"<":function(t){return G(t,1.7)},">":function(t){return G(t,.48)},"<>":function(t){var e=.48-t/1.04,r=z.sqrt(.1734+e*e),n=r-e,i=G(X(n),1/3)*(n<0?-1:1),a=-r-e,s=G(X(a),1/3)*(a<0?-1:1),o=i+s+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:G(2,-10*t)*z.sin(2*q*(t-.075)/.3)+1},bounce:function(t){var e,r=7.5625,n=2.75;return t<1/n?e=r*t*t:t<2/n?(t-=1.5/n,e=r*t*t+.75):t<2.5/n?(t-=2.25/n,e=r*t*t+.9375):(t-=2.625/n,e=r*t*t+.984375),e}};se.easeIn=se["ease-in"]=se["<"],se.easeOut=se["ease-out"]=se[">"],se.easeInOut=se["ease-in-out"]=se["<>"],se["back-in"]=se.backIn,se["back-out"]=se.backOut;var oe=[],ce=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){setTimeout(t,16)},he=function(){for(var t=+new Date,n=0;n1&&!i.next){for(s in f)f[k](s)&&(g[s]=i.totalOrigin[s]);i.el.attr(g),y(i.anim,i.el,i.anim.percents[0],null,i.totalOrigin,i.repeat-1)}i.next&&!i.stop&&y(i.anim,i.el,i.next,null,i.totalOrigin,i.repeat)}}}r.svg&&p&&p.paper&&p.paper.safari(),oe.length&&ce(he)},ue=function(t){return t>255?255:t<0?0:t};Kt.animateWith=function(t,e,n,i,a,s){var o=this;if(o.removed)return s&&s.call(o),o;var c=n instanceof v?n:r.animation(n,i,a,s);y(c,o,c.percents[0],null,o.attr());for(var h=0,u=oe.length;h.5)-1;c(f-.5,2)+c(p-.5,2)>.25&&(p=a.sqrt(.25-c(f-.5,2))*i+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*i)}return l}),i=i.split(/\s*\-\s*/),"linear"==h){var m=i.shift();if(m=-n(m),isNaN(m))return null;var b=[0,0,a.cos(r.rad(m)),a.sin(r.rad(m))],_=1/(s(o(b[2]),o(b[3]))||1);b[2]*=_,b[3]*=_,b[2]<0&&(b[0]=-b[2],b[2]=0),b[3]<0&&(b[1]=-b[3],b[3]=0)}var w=r._parseDots(i);if(!w)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),t.gradient&&u!=t.gradient.id&&(g.defs.removeChild(t.gradient),delete t.gradient),!t.gradient){y=x(h+"Gradient",{id:u}),t.gradient=y,x(y,"radial"==h?{fx:f,fy:p}:{x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientTransform:t.matrix.invert()}),g.defs.appendChild(y);for(var E=0,C=w.length;E1?I.opacity/100:I.opacity});case"stroke":I=r.getRGB(g),c.setAttribute(d,I.hex),"stroke"==d&&I[t]("opacity")&&x(c,{"stroke-opacity":I.opacity>1?I.opacity/100:I.opacity}),"stroke"==d&&n._.arrows&&("startString"in n._.arrows&&m(n,n._.arrows.startString),"endString"in n._.arrows&&m(n,n._.arrows.endString,1));break;case"gradient":("circle"==n.type||"ellipse"==n.type||"r"!=e(g).charAt())&&v(n,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&x(c,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){M=r._g.doc.getElementById(c.getAttribute("fill").replace(/^url\(#|\)$/g,l)),M&&(F=M.getElementsByTagName("stop"),x(F[F.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=i(g,10)+"px");var D=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});c.style[D]=g,n._.dirty=1,c.setAttribute(d,g)}}E(n,a),c.style.visibility=f},E=function(n,a){if("text"==n.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var s=n.attrs,o=n.node,c=o.firstChild?i(r._g.doc.defaultView.getComputedStyle(o.firstChild,l).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h,u=e(a.text).split("\n"),f=[],p=0,d=u.length;p"));var W=q.getBoundingClientRect();v.W=p.w=(W.right-W.left)/100,v.H=p.h=(W.bottom-W.top)/100,v.X=p.x,v.Y=p.y+v.H/2,("x"in c||"y"in c)&&(v.path.v=r.format("m{0},{1}l{2},{1}",a(p.x*y),a(p.y*y),a(p.x*y)+1));for(var V=["x","y","text","font","font-family","font-weight","font-style","font-size"],Q=0,Y=V.length;Q.25&&(r=i.sqrt(.25-o(e-.5,2))*(2*(r>.5)-1)+.5),h=e+l+r),f}),a=a.split(/\s*\-\s*/),"linear"==c){var u=a.shift();if(u=-n(u),isNaN(u))return null}var p=r._parseDots(a);if(!p)return null;if(t=t.shape||t.node,p.length){t.removeChild(s),s.on=!0,s.method="none",s.color=p[0].color,s.color2=p[p.length-1].color;for(var d=[],g=0,x=p.length;g')}}catch(t){N=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},r._engine.initWin(r._g.win),r._engine.create=function(){var t=r._getContainer.apply(0,arguments),e=t.container,n=t.height,i=t.width,a=t.x,s=t.y;if(!e)throw new Error("VML container not found.");var o=new r._Paper,c=o.canvas=r._g.doc.createElement("div"),h=c.style;return a=a||0,s=s||0,i=i||512,n=n||342,o.width=i,o.height=n,i==+i&&(i+="px"),n==+n&&(n+="px"),o.coordsize=216e5+l+216e5,o.coordorigin="0 0",o.span=r._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",c.appendChild(o.span),h.cssText=r.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,n),1==e?(r._g.doc.body.appendChild(c),h.left=a+"px",h.top=s+"px",h.position="absolute"):e.firstChild?e.insertBefore(c,e.firstChild):e.appendChild(c),o.renderfix=function(){},o},r.prototype.clear=function(){r.eve("raphael.clear",this),this.canvas.innerHTML=f,this.span=r._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},r.prototype.remove=function(){r.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var t in this)this[t]="function"==typeof this[t]?r._removedFactory(t):null;return!0};var O=r.st;for(var T in B)B[t](T)&&!O[t](T)&&(O[T]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(T))}}(),A.was?S.win.Raphael=r:Raphael=r,r}),"function"!=typeof define)var define=require("amdefine")(module);define("regulex",["./Kit","./NFA","./RegExp","./parse","./visualize","./libs/raphael"],function(t,e,r,n,i,a){return{Kit:t,NFA:e,RegExp:r,parse:n,Raphael:a,visualize:i}});