-
Notifications
You must be signed in to change notification settings - Fork 2
/
trak.io.automagic.min.js
2 lines (2 loc) · 40.8 KB
/
trak.io.automagic.min.js
1
2
!function(){var e,t,n;!function(r){function i(e,t){return _.call(e,t)}function o(e,t){var n,r,i,o,u,a,s,l,c,f,p,d=t&&t.split("/"),h=v.map,g=h&&h["*"]||{};if(e&&"."===e.charAt(0))if(t){for(d=d.slice(0,d.length-1),e=e.split("/"),u=e.length-1,v.nodeIdCompat&&x.test(e[u])&&(e[u]=e[u].replace(x,"")),e=d.concat(e),c=0;c<e.length;c+=1)if(p=e[c],"."===p)e.splice(c,1),c-=1;else if(".."===p){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((d||g)&&h){for(n=e.split("/"),c=n.length;c>0;c-=1){if(r=n.slice(0,c).join("/"),d)for(f=d.length;f>0;f-=1)if(i=h[d.slice(0,f).join("/")],i&&(i=i[r])){o=i,a=c;break}if(o)break;!s&&g&&g[r]&&(s=g[r],l=c)}!o&&s&&(o=s,a=l),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function u(e,t){return function(){return d.apply(r,w.call(arguments,0).concat([e,t]))}}function a(e){return function(t){return o(t,e)}}function s(e){return function(t){m[e]=t}}function l(e){if(i(y,e)){var t=y[e];delete y[e],b[e]=!0,p.apply(r,t)}if(!i(m,e)&&!i(b,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function f(e){return function(){return v&&v.config&&v.config[e]||{}}}var p,d,h,g,m={},y={},v={},b={},_=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;h=function(e,t){var n,r=c(e),i=r[0];return e=r[1],i&&(i=o(i,t),n=l(i)),i?e=n&&n.normalize?n.normalize(e,a(t)):o(e,t):(e=o(e,t),r=c(e),i=r[0],e=r[1],i&&(n=l(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},g={require:function(e){return u(e)},exports:function(e){var t=m[e];return"undefined"!=typeof t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:f(e)}}},p=function(e,t,n,o){var a,c,f,p,d,v,_=[],w=typeof n;if(o=o||e,"undefined"===w||"function"===w){for(t=!t.length&&n.length?["require","exports","module"]:t,d=0;d<t.length;d+=1)if(p=h(t[d],o),c=p.f,"require"===c)_[d]=g.require(e);else if("exports"===c)_[d]=g.exports(e),v=!0;else if("module"===c)a=_[d]=g.module(e);else if(i(m,c)||i(y,c)||i(b,c))_[d]=l(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,u(o,!0),s(c),{}),_[d]=m[c]}f=n?n.apply(m[e],_):void 0,e&&(a&&a.exports!==r&&a.exports!==m[e]?m[e]=a.exports:f===r&&v||(m[e]=f))}else e&&(m[e]=n)},e=t=d=function(e,t,n,i,o){if("string"==typeof e)return g[e]?g[e](t):l(h(e,t).f);if(!e.splice){if(v=e,v.deps&&d(v.deps,v.callback),!t)return;t.splice?(e=t,t=n,n=null):e=r}return t=t||function(){},"function"==typeof n&&(n=i,i=o),i?p(r,e,t,n):setTimeout(function(){p(r,e,t,n)},4),d},d.config=function(e){return d(e)},e._defined=m,n=function(e,t,n){t.splice||(n=t,t=[]),i(m,e)||i(y,e)||(y[e]=[e,t,n])},n.amd={jQuery:!0}}(),n("../bower_components/almond/almond",function(){}),function(e){function t(e,t,n,r){var i,o,u,a,s,l,c,p,h,g;if((t?t.ownerDocument||t:H)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(I&&!r){if(i=bt.exec(e))if(u=i[1]){if(9===a){if(o=t.getElementById(u),!o||!o.parentNode)return n;if(o.id===u)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(u))&&z(t,o)&&o.id===u)return n.push(o),n}else{if(i[2])return et.apply(n,t.getElementsByTagName(e)),n;if((u=i[3])&&x.getElementsByClassName&&t.getElementsByClassName)return et.apply(n,t.getElementsByClassName(u)),n}if(x.qsa&&(!$||!$.test(e))){if(p=c=q,h=t,g=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(l=N(e),(c=t.getAttribute("id"))?p=c.replace(wt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",s=l.length;s--;)l[s]=p+d(l[s]);h=_t.test(e)&&f(t.parentNode)||t,g=l.join(",")}if(g)try{return et.apply(n,h.querySelectorAll(g)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return T(e.replace(lt,"$1"),t,n,r)}function r(){function e(n,r){return t.push(n+" ")>k.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function i(e){return e[q]=!0,e}function o(e){var t=L.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function u(e,t){for(var n=e.split("|"),r=e.length;r--;)k.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||W)-(~e.sourceIndex||W);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),u=o.length;u--;)n[i=o[u]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&typeof e.getElementsByTagName!==Q&&e}function p(){}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=F++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,u){var a,s,l=[M,o];if(u){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||i){if(s=t[q]||(t[q]={}),(a=s[r])&&a[0]===M&&a[1]===o)return l[2]=a[2];if(s[r]=l,l[2]=e(t,n,u))return!0}}}function g(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function y(e,t,n,r,i){for(var o,u=[],a=0,s=e.length,l=null!=t;s>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(u.push(o),l&&t.push(a));return u}function v(e,t,n,r,o,u){return r&&!r[q]&&(r=v(r)),o&&!o[q]&&(o=v(o,u)),i(function(i,u,a,s){var l,c,f,p=[],d=[],h=u.length,g=i||m(t||"*",a.nodeType?[a]:a,[]),v=!e||!i&&t?g:y(g,p,e,a,s),b=n?o||(i?e:h||r)?[]:u:v;if(n&&n(v,b,a,s),r)for(l=y(b,d),r(l,[],a,s),c=l.length;c--;)(f=l[c])&&(b[d[c]]=!(v[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=b.length;c--;)(f=b[c])&&l.push(v[c]=f);o(null,b=[],l,s)}for(c=b.length;c--;)(f=b[c])&&(l=o?nt.call(i,f):p[c])>-1&&(i[l]=!(u[l]=f))}}else b=y(b===u?b.splice(h,b.length):b),o?o(null,u,b,s):et.apply(u,b)})}function b(e){for(var t,n,r,i=e.length,o=k.relative[e[0].type],u=o||k.relative[" "],a=o?1:0,s=h(function(e){return e===t},u,!0),l=h(function(e){return nt.call(t,e)>-1},u,!0),c=[function(e,n,r){return!o&&(r||n!==S)||((t=n).nodeType?s(e,n,r):l(e,n,r))}];i>a;a++)if(n=k.relative[e[a].type])c=[h(g(c),n)];else{if(n=k.filter[e[a].type].apply(null,e[a].matches),n[q]){for(r=++a;i>r&&!k.relative[e[r].type];r++);return v(a>1&&g(c),a>1&&d(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(lt,"$1"),n,r>a&&b(e.slice(a,r)),i>r&&b(e=e.slice(r)),i>r&&d(e))}c.push(n)}return g(c)}function _(e,n){var r=n.length>0,o=e.length>0,u=function(i,u,a,s,l){var c,f,p,d=0,h="0",g=i&&[],m=[],v=S,b=i||o&&k.find.TAG("*",l),_=M+=null==v?1:Math.random()||.1,w=b.length;for(l&&(S=u!==L&&u);h!==w&&null!=(c=b[h]);h++){if(o&&c){for(f=0;p=e[f++];)if(p(c,u,a)){s.push(c);break}l&&(M=_)}r&&((c=!p&&c)&&d--,i&&g.push(c))}if(d+=h,r&&h!==d){for(f=0;p=n[f++];)p(g,m,u,a);if(i){if(d>0)for(;h--;)g[h]||m[h]||(m[h]=Y.call(s));m=y(m)}et.apply(s,m),l&&!i&&m.length>0&&d+n.length>1&&t.uniqueSort(s)}return l&&(M=_,S=v),g};return r?i(u):u}var w,x,k,E,C,N,A,T,S,O,j,D,L,P,I,$,B,R,z,q="sizzle"+-new Date,H=e.document,M=0,F=0,U=r(),V=r(),G=r(),K=function(e,t){return e===t&&(j=!0),0},Q="undefined",W=1<<31,X={}.hasOwnProperty,J=[],Y=J.pop,Z=J.push,et=J.push,tt=J.slice,nt=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},rt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",ot="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ut=ot.replace("w","w#"),at="\\["+it+"*("+ot+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ut+"))|)"+it+"*\\]",st=":("+ot+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+at+")*)|.*)\\)|)",lt=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),ct=new RegExp("^"+it+"*,"+it+"*"),ft=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),pt=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),dt=new RegExp(st),ht=new RegExp("^"+ut+"$"),gt={ID:new RegExp("^#("+ot+")"),CLASS:new RegExp("^\\.("+ot+")"),TAG:new RegExp("^("+ot.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+rt+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_t=/[+~]/,wt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),kt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{et.apply(J=tt.call(H.childNodes),H.childNodes),J[H.childNodes.length].nodeType}catch(Et){et={apply:J.length?function(e,t){Z.apply(e,tt.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=t.setDocument=function(e){var t,n=e?e.ownerDocument||e:H,r=n.defaultView;return n!==L&&9===n.nodeType&&n.documentElement?(L=n,P=n.documentElement,I=!C(n),r&&r!==r.top&&(r.addEventListener?r.addEventListener("unload",function(){D()},!1):r.attachEvent&&r.attachEvent("onunload",function(){D()})),x.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=o(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=vt.test(n.getElementsByClassName)&&o(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),x.getById=o(function(e){return P.appendChild(e).id=q,!n.getElementsByName||!n.getElementsByName(q).length}),x.getById?(k.find.ID=function(e,t){if(typeof t.getElementById!==Q&&I){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},k.filter.ID=function(e){var t=e.replace(xt,kt);return function(e){return e.getAttribute("id")===t}}):(delete k.find.ID,k.filter.ID=function(e){var t=e.replace(xt,kt);return function(e){var n=typeof e.getAttributeNode!==Q&&e.getAttributeNode("id");return n&&n.value===t}}),k.find.TAG=x.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Q?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},k.find.CLASS=x.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==Q&&I?t.getElementsByClassName(e):void 0},B=[],$=[],(x.qsa=vt.test(n.querySelectorAll))&&(o(function(e){e.innerHTML="<select msallowclip=''><option selected=''></option></select>",e.querySelectorAll("[msallowclip^='']").length&&$.push("[*^$]="+it+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||$.push("\\["+it+"*(?:value|"+rt+")"),e.querySelectorAll(":checked").length||$.push(":checked")}),o(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&$.push("name"+it+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||$.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),$.push(",.*:")})),(x.matchesSelector=vt.test(R=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&o(function(e){x.disconnectedMatch=R.call(e,"div"),R.call(e,"[s!='']:x"),B.push("!=",st)}),$=$.length&&new RegExp($.join("|")),B=B.length&&new RegExp(B.join("|")),t=vt.test(P.compareDocumentPosition),z=t||vt.test(P.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=t?function(e,t){if(e===t)return j=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!x.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===H&&z(H,e)?-1:t===n||t.ownerDocument===H&&z(H,t)?1:O?nt.call(O,e)-nt.call(O,t):0:4&r?-1:1)}:function(e,t){if(e===t)return j=!0,0;var r,i=0,o=e.parentNode,u=t.parentNode,s=[e],l=[t];if(!o||!u)return e===n?-1:t===n?1:o?-1:u?1:O?nt.call(O,e)-nt.call(O,t):0;if(o===u)return a(e,t);for(r=e;r=r.parentNode;)s.unshift(r);for(r=t;r=r.parentNode;)l.unshift(r);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]===H?-1:l[i]===H?1:0},n):L},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==L&&D(e),n=n.replace(pt,"='$1']"),!(!x.matchesSelector||!I||B&&B.test(n)||$&&$.test(n)))try{var r=R.call(e,n);if(r||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,L,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),z(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==L&&D(e);var n=k.attrHandle[t.toLowerCase()],r=n&&X.call(k.attrHandle,t.toLowerCase())?n(e,t,!I):void 0;return void 0!==r?r:x.attributes||!I?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!x.detectDuplicates,O=!x.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return O=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},k=t.selectors={cacheLength:50,createPseudo:i,match:gt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,kt),e[3]=(e[3]||e[4]||e[5]||"").replace(xt,kt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return gt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&dt.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xt,kt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+it+")"+e+"("+it+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Q&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,s){var l,c,f,p,d,h,g=o!==u?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),v=!s&&!a;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(a?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[u?m.firstChild:m.lastChild],u&&v){for(c=m[q]||(m[q]={}),l=c[e]||[],d=l[0]===M&&l[1],p=l[0]===M&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[M,d,p];break}}else if(v&&(l=(t[q]||(t[q]={}))[e])&&l[0]===M)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((a?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[q]||(f[q]={}))[e]=[M,p]),f!==t)););return p-=i,p===r||p%r===0&&p/r>=0}}},PSEUDO:function(e,n){var r,o=k.pseudos[e]||k.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[q]?o(n):o.length>1?(r=[e,e,"",n],k.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var r,i=o(e,n),u=i.length;u--;)r=nt.call(e,i[u]),e[r]=!(t[r]=i[u])}):function(e){return o(e,0,r)}):o}},pseudos:{not:i(function(e){var t=[],n=[],r=A(e.replace(lt,"$1"));return r[q]?i(function(e,t,n,i){for(var o,u=r(e,null,i,[]),a=e.length;a--;)(o=u[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(n){return t(e,n).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:i(function(e){return ht.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xt,kt).toLowerCase(),function(t){var n;do if(n=I?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===P},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!k.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++r<t;)e.push(r);return e})}},k.pseudos.nth=k.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})k.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})k.pseudos[w]=l(w);p.prototype=k.filters=k.pseudos,k.setFilters=new p,N=t.tokenize=function(e,n){var r,i,o,u,a,s,l,c=V[e+" "];if(c)return n?0:c.slice(0);for(a=e,s=[],l=k.preFilter;a;){(!r||(i=ct.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),s.push(o=[])),r=!1,(i=ft.exec(a))&&(r=i.shift(),o.push({value:r,type:i[0].replace(lt," ")}),a=a.slice(r.length));for(u in k.filter)!(i=gt[u].exec(a))||l[u]&&!(i=l[u](i))||(r=i.shift(),o.push({value:r,type:u,matches:i}),a=a.slice(r.length));if(!r)break}return n?a.length:a?t.error(e):V(e,s).slice(0)},A=t.compile=function(e,t){var n,r=[],i=[],o=G[e+" "];if(!o){for(t||(t=N(e)),n=t.length;n--;)o=b(t[n]),o[q]?r.push(o):i.push(o);o=G(e,_(i,r)),o.selector=e}return o},T=t.select=function(e,t,n,r){var i,o,u,a,s,l="function"==typeof e&&e,c=!r&&N(e=l.selector||e);if(n=n||[],1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(u=o[0]).type&&x.getById&&9===t.nodeType&&I&&k.relative[o[1].type]){if(t=(k.find.ID(u.matches[0].replace(xt,kt),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=gt.needsContext.test(e)?0:o.length;i--&&(u=o[i],!k.relative[a=u.type]);)if((s=k.find[a])&&(r=s(u.matches[0].replace(xt,kt),_t.test(o[0].type)&&f(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return et.apply(n,r),n;break}}return(l||A(e,c))(r,t,!I,n,_t.test(e)&&f(t.parentNode)||t),n},x.sortStable=q.split("").sort(K).join("")===q,x.detectDuplicates=!!j,D(),x.sortDetached=o(function(e){return 1&e.compareDocumentPosition(L.createElement("div"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||u("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||u("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||u(rt,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),"function"==typeof n&&n.amd?n("sizzle",[],function(){return t}):"undefined"!=typeof module&&module.exports?module.exports=t:e.Sizzle=t}(window),function(e){function t(){return o.pop()||[]}function r(e){e.length=0,o.length<p&&o.push(e)}function i(n){function i(){}function o(){for(var e,t={shadowedProps:h,arrays:"isArray(iterable)",bottom:"",init:"iterable",loop:"",top:"",useHas:!0,useKeys:!!ht},n=0;e=arguments[n];n++)for(var r in e)t[r]=e[r];var o=t.args;t.firstArg=/^[^,]+/.exec(o)[0];var u=Function("hasOwnProperty, isArguments, isArray, isString, keys, lodash, objectTypes","return function("+o+") {\n"+ct(t)+"\n}");return u(tt,p,T,L,ht,i,E)}function u(e){return"function"!=typeof e.toString&&"string"==typeof(e+"")}function a(e){var t=!1;if(!e||nt.call(e)!=w||!lt.argsClass&&p(e))return t;var n=e.constructor;return(j(n)?n instanceof n:lt.nodeClass||!u(e))?lt.ownLast?(mt(e,function(e,n,r){return t=tt.call(r,n),!1}),t===!0):(mt(e,function(e,n){t=n}),t===!1||tt.call(e,t)):t}function s(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,i=n-t||0,o=Array(0>i?0:i);++r<i;)o[r]=e[t+r];return o}function p(e){return nt.call(e)==g}function T(e){return lt.argsObject&&e instanceof Array||(it?it(e):nt.call(e)==m)}function S(e){return e===!0||e===!1||nt.call(e)==y}function O(e,t,n,r,o,a){var s=n===l;if("function"==typeof n&&!s){n=i.createCallback(n,r,2);var c=n(e,t);if("undefined"!=typeof c)return!!c}if(e===t)return 0!==e||1/e==1/t;var f=typeof e,d=typeof t;if(e===e&&(!e||"function"!=f&&"object"!=f)&&(!t||"function"!=d&&"object"!=d))return!1;if(null==e||null==t)return e===t;var h=nt.call(e),b=nt.call(t);if(h==g&&(h=w),b==g&&(b=w),h!=b)return!1;switch(h){case y:case v:return+e==+t;case _:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case x:case k:return e==String(t)}var E=h==m;if(!E){if(tt.call(e,"__wrapped__ ")||tt.call(t,"__wrapped__"))return O(e.__wrapped__||e,t.__wrapped__||t,n,r,o,a);if(h!=w||!lt.nodeClass&&(u(e)||u(t)))return!1;var C=!lt.argsObject&&p(e)?Object:e.constructor,N=!lt.argsObject&&p(t)?Object:t.constructor;if(C!=N&&!(j(C)&&C instanceof C&&j(N)&&N instanceof N))return!1}o||(o=[]),a||(a=[]);for(var A=o.length;A--;)if(o[A]==e)return a[A]==t;var T=0;if(c=!0,o.push(e),a.push(t),E){if(A=e.length,T=t.length,c=T==e.length,!c&&!s)return c;for(;T--;){var S=A,D=t[T];if(s)for(;S--&&!(c=O(e[S],D,n,r,o,a)););else if(!(c=O(e[T],D,n,r,o,a)))break}return c}return mt(t,function(t,i,u){return tt.call(u,i)?(T++,c=tt.call(e,i)&&O(e[i],t,n,r,o,a)):void 0}),c&&!s&&mt(e,function(e,t,n){return tt.call(n,t)?c=--T>-1:void 0}),c}function j(e){return"function"==typeof e}function D(e){return e?E[typeof e]:!1}function L(e){return"string"==typeof e||nt.call(e)==k}function P(e){return"undefined"==typeof e}function I(e,t,n){var r=arguments,o=0,u=2;if(!D(e))return e;if(n===l)var a=r[3],s=r[4],c=r[5];else s=[],c=[],"number"!=typeof n&&(u=r.length),u>3&&"function"==typeof r[u-2]?a=i.createCallback(r[--u-1],r[u--],2):u>2&&"function"==typeof r[u-1]&&(a=r[--u]);for(;++o<u;)(T(r[o])?$:yt)(r[o],function(t,n){var r,i,o=t,u=e[n];if(t&&((i=T(t))||vt(t))){for(var f=s.length;f--;)if(r=s[f]==t){u=c[f];break}if(!r){var p;a&&(o=a(u,t),(p="undefined"!=typeof o)&&(u=o)),p||(u=i?T(u)?u:[]:vt(u)?u:{}),s.push(t),c.push(u),p||(u=I(u,t,l,a,s,c))}}else a&&(o=a(u,t),"undefined"==typeof o&&(o=t)),"undefined"!=typeof o&&(u=o);e[n]=u});return e}function $(e,t,n){if(t&&"undefined"==typeof n&&T(e))for(var r=-1,i=e.length;++r<i&&t(e[r],r,e)!==!1;);else gt(e,t,n);return e}function B(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof n)r=(0>n?ut(0,i+n):n||0)-1;else if(n)return r=z(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function R(e,t,n){var r=-1,i=U(),o=e?e.length:0,u=!1;return n=(0>n?ut(0,o+n):n)||0,T(e)?u=i(e,t,n)>-1:"number"==typeof o?u=(L(e)?e.indexOf(t,n):i(e,t,n))>-1:yt(e,function(e){return++r>=n?!(u=e===t):void 0}),u}function z(e,t,n,r){var o=0,u=e?e.length:o;for(n=n?i.createCallback(n,r,1):W,t=n(t);u>o;){var a=o+u>>>1;n(e[a])<t?o=a+1:u=a}return o}function q(){return n._=Y,this}function H(e,t,n,r){var o=-1,u=e?e.length:0,a=[],s=a;"boolean"!=typeof t&&null!=t&&(r=n,n=t,t=!1);var l=!t&&u>=f;if(l)var p={};for(null!=n&&(s=[],n=i.createCallback(n,r));++o<u;){var d=e[o],h=n?n(d,o,e):d;if(l)var g=c+h,m=p[g]?!(s=p[g]):s=p[g]=[];(t?!o||s[s.length-1]!==h:m||B(s,h)<0)&&((n||l)&&s.push(h),a.push(d))}return a}function M(e,t,n){var r=[];t=i.createCallback(t,n,3);var o=-1,u=e?e.length:0;if("number"==typeof u)for(;++o<u;){var a=e[o];t(a,o,e)&&r.push(a)}else yt(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function F(e,t,n){if(null==e)return W;var r=typeof e;if("function"!=r){if("object"!=r)return function(t){return t[e]};var i=ht(e);return function(t){for(var n=i.length,r=!1;n--&&(r=O(t[i[n]],e[i[n]],l)););return r}}return"undefined"!=typeof t?1===n?function(n){return e.call(t,n)}:2===n?function(n,r){return e.call(t,n,r)}:4===n?function(n,r,i,o){return e.call(t,n,r,i,o)}:function(n,r,i){return e.call(t,n,r,i)}:e}function U(){var e=(e=i.indexOf)===B?V:e;return e}function V(e,t,n){for(var r=(n||0)-1,i=e?e.length:0;++r<i;)if(e[r]===t)return r;return-1}function G(e,t,n){return K(e,!0,"function"==typeof t&&baseCreateCallback(t,n,1))}function K(e,n,i,o,u){if(i){var a=i(e);if("undefined"!=typeof a)return a}var l=D(e);if(!l)return e;var c=nt.call(e);if(!C[c])return e;var f=N[c];switch(c){case y:case v:return new f(+e);case _:case k:return new f(e);case x:return a=f(e.source,d.exec(e)),a.lastIndex=e.lastIndex,a}var p=T(e);if(n){var h=!o;o||(o=t()),u||(u=t());for(var g=o.length;g--;)if(o[g]==e)return u[g];a=p?f(e.length):{}}else a=p?s(e):assign({},e);return p&&(tt.call(e,"index")&&(a.index=e.index),tt.call(e,"input")&&(a.input=e.input)),n?(o.push(e),u.push(a),(p?$:yt)(e,function(e,t){a[t]=K(e,n,i,o,u)}),h&&(r(o),r(u)),a):a}function Q(e,t,n){t=i.createCallback(t,n,3);var r=-1,o=e?e.length:0;if("number"!=typeof o){var u;return yt(e,function(e,n,r){return t(e,n,r)?(u=e,!1):void 0}),u}for(;++r<o;){var a=e[r];if(t(a,r,e))return a}}function W(e){return e}n=n?A.defaults(e.Object(),n,A.pick(e,contextProps)):e;var X=Array(),J=Object(),Y=e._,Z=RegExp("^"+String(J.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),et=(Math.ceil,e.clearTimeout,X.concat,Math.floor,Z.test(et=Object.getPrototypeOf)&&et),tt=J.hasOwnProperty,nt=(X.push,e.setTimeout,J.toString),rt=Z.test(rt=nt.bind)&&rt,it=Z.test(it=Array.isArray)&&it,ot=(e.isFinite,e.isNaN,Z.test(ot=Object.keys)&&ot),ut=Math.max,at=(Math.min,Math.random,X.slice,Z.test(e.attachEvent)),st=rt&&!/\n|true/.test(rt+at),lt=i.support={};!function(){var e=function(){this.x=1},t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments);lt.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),lt.argsClass=p(arguments),lt.enumPrototypes=e.propertyIsEnumerable("prototype"),lt.fastBind=rt&&!st,lt.ownLast="x"!=t[0],lt.nonEnumArgs=0!=n,lt.nonEnumShadows=!/valueOf/.test(t),lt.unindexedChars="x"[0]+Object("x")[0]!="xx";try{lt.nodeClass=!(nt.call(document)==w&&!({toString:0}+""))}catch(r){lt.nodeClass=!0}}(1);var ct=function(e){var t="var index, iterable = "+e.firstArg+", result = "+e.init+";\nif (!iterable) return result;\n"+e.top+";\n";if(e.arrays?(t+="var length = iterable.length; index = -1;\nif ("+e.arrays+") { ",lt.unindexedChars&&(t+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),t+="\n while (++index < length) {\n "+e.loop+"\n }\n}\nelse { "):lt.nonEnumArgs&&(t+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+e.loop+"\n }\n } else { "),lt.enumPrototypes&&(t+="\n var skipProto = typeof iterable == 'function';\n "),e.useHas&&e.useKeys)t+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? keys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n ",lt.enumPrototypes&&(t+="if (!(skipProto && index == 'prototype')) {\n "),t+=e.loop,lt.enumPrototypes&&(t+="}\n"),t+=" } ";else if(t+="\n for (index in iterable) {",(lt.enumPrototypes||e.useHas)&&(t+="\n if (",lt.enumPrototypes&&(t+="!(skipProto && index == 'prototype')"),lt.enumPrototypes&&e.useHas&&(t+=" && "),e.useHas&&(t+="hasOwnProperty.call(iterable, index)"),t+=") { "),t+=e.loop+"; ",(lt.enumPrototypes||e.useHas)&&(t+="\n }"),t+="\n } ",lt.nonEnumShadows){t+="\n\n var ctor = iterable.constructor;\n ";for(var n=0;7>n;n++)t+="\n index = '"+e.shadowedProps[n]+"';\n if (","constructor"==e.shadowedProps[n]&&(t+="!(ctor && ctor.prototype === iterable) && "),t+="hasOwnProperty.call(iterable, index)) {\n "+e.loop+"\n } "}return(e.arrays||lt.nonEnumArgs)&&(t+="\n}"),t+=e.bottom+";\nreturn result"},ft={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg)",arrays:"typeof length == 'number'",loop:"if (callback(iterable[index], index, collection) === false) return result"},pt={top:"if (!objectTypes[typeof iterable]) return result;\n"+ft.top,arrays:!1};lt.argsClass||(p=function(e){return e?tt.call(e,"callee"):!1});var dt=o({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)",arrays:!1}),ht=ot?function(e){return D(e)?lt.enumPrototypes&&"function"==typeof e||lt.nonEnumArgs&&e.length&&p(e)?dt(e):ot(e):[]}:dt,gt=o(ft),mt=o(ft,pt,{useHas:!1}),yt=o(ft,pt);j(/x/)&&(j=function(e){return e instanceof Function||nt.call(e)==b});var vt=et?function(e){if(!e||nt.call(e)!=w||!lt.argsClass&&p(e))return!1;var t=e.valueOf,n="function"==typeof t&&(n=et(t))&&et(n);return n?e==n||et(e)==n:a(e)}:a;return i.createCallback=F,i.forEach=$,i.forIn=mt,i.forOwn=yt,i.keys=ht,i.merge=I,i.uniq=H,i.each=$,i.unique=H,i.identity=W,i.indexOf=B,i.getIndexOf=U,i.contains=R,i.filter=M,i.find=Q,i.cloneDeep=G,i.baseClone=K,i.isArguments=p,i.isArray=T,i.isBoolean=S,i.isEqual=O,i.isFunction=j,i.isObject=D,i.isPlainObject=vt,i.isString=L,i.isUndefined=P,i.sortedIndex=z,i.noConflict=q,i.VERSION="1.2.0",i}var o=[],u="object"==typeof exports&&exports,a="object"==typeof module&&module&&module.exports==u&&module,s="object"==typeof global&&global;(s.global===s||s.window===s)&&(e=s);var l={},c=+new Date+"",f=200,p=40,d=/\w*$/,h=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Function]",_="[object Number]",w="[object Object]",x="[object RegExp]",k="[object String]",E={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},C={};C[b]=!1,C[g]=C[m]=C[y]=C[v]=C[_]=C[w]=C[x]=C[k]=!0;var N={};N[m]=Array,N[y]=Boolean,N[v]=Date,N[b]=Function,N[w]=Object,N[_]=Number,N[x]=RegExp,N[k]=String;var A=i();"function"==typeof n&&"object"==typeof n.amd&&n.amd?(e._=A,n("lodash",[],function(){return A})):u&&!u.nodeType?a?(a.exports=A)._=A:u._=A:e._=A
}({}),n("trakio/lodash/events",[],function(){var e;return e={addEvent:function(e,t,n){var r;e.addEventListener?e.addEventListener(t,n,!1):(n.$$guid||(n.$$guid=this.addEvent.guid++),e.events||(e.events={}),r=e.events[t],r||(r=e.events[t]={},e["on"+t]&&(r[0]=e["on"+t])),r[n.$$guid]=n,e["on"+t]=this.handleEvent)},removeEvent:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.events&&e.events[t]&&delete e.events[t][n.$$guid]},handleEvent:function(e){var t,n,r;r=!0,e=e||fixEvent(((this.ownerDocument||this.document||this).parentWindow||window).event),t=this.events[e.type];for(n in t)this.$$handleEvent=t[n],this.$$handleEvent(e)===!1&&(r=!1);return r},fixEvent:function(e){return e.preventDefault=this.fixEvent.preventDefault,e.stopPropagation=this.fixEvent.stopPropagation,e}},e.fixEvent.preventDefault=function(){this.returnValue=!1},e.fixEvent.stopPropagation=function(){this.cancelBubble=!0},e.addEvent.guid=1,e}),n("trakio/lodash",["sizzle","lodash","trakio/lodash/events"],function(e,t,n){return t.find=function(t,n){return null==n&&(n=null),e(t,n)},t.matches=function(t,n){return e.matchesSelector(t,n)},t.attr=function(e,t,n){return null==n&&(n=!1),e?n?e.setAttribute(t,n):e.getAttribute(t):void 0},t.merge(t,n),t});var r=function(e,t){return function(){return e.apply(t,arguments)}};n("trakio/automagic/identify",["trakio/lodash"],function(e){var t;return t=function(){function t(){this.map_properties=r(this.map_properties,this),this.distinct_id=r(this.distinct_id,this),this.should_identify=r(this.should_identify,this),this.event_fired=r(this.event_fired,this),this.page_ready=r(this.page_ready,this),this.initialize=r(this.initialize,this)}return t.prototype.initialize=function(e,t){this.automagic=e,this.options=t},t.prototype.page_ready=function(){},t.prototype.event_fired=function(t,n,r,i){var o;try{e.matches(t,this.options.selector)&&this.options.should_identify.call(this.automagic,t,n)&&trak.io.identify(this.distinct_id(t),this.map_properties(t),function(){return i.identify=!0,r()})}catch(u){o=u,trak.io.debug_error(o)}return i.identify=!0,r()},t.prototype.should_identify=function(t){var n,r,i;return i=this.map_properties(t),r=e.filter(i,function(t){return function(n,r){return e.contains(t.options.has_any_fields,r)}}(this)).length>0,n=e.filter(i,function(t){return function(n,r){return e.contains(t.options.has_all_fields,r)}}(this)).length>=this.options.has_all_fields.length,r&&n},t.prototype.distinct_id=function(t){var n,r,i,o,u,a;o={},a=this.map_properties(t);for(i in a)u=a[i],(n=e.indexOf(this.options.distinct_ids,i))>-1&&(o[n]=u);for(r in o)if(u=o[r],u&&""!==u)return u;return trak.io.distinct_id()},t.prototype.map_properties=function(t){var n,r,i,o,u,a,s,l,c,f;for(i=e.find("input",t),a={},l=0,c=i.length;c>l;l++)if(r=i[l],!e.matches(r,this.options.excluded_field_selector)){o=e.attr(r,"name"),f=this.options.property_map;for(u in f)if(n=f[u],"string"==typeof n&&n===o||"function"==typeof n.test&&n.test(o)){s=r.value,s&&""!==s&&(a[u]=s);break}}return a},t}()});var r=function(e,t){return function(){return e.apply(t,arguments)}};n("trakio/automagic/track",["trakio/lodash"],function(e){var t;return t=function(){function t(){this.map_form_inputs=r(this.map_form_inputs,this),this.map_properties=r(this.map_properties,this),this.track_properties=r(this.track_properties,this),this.events=r(this.events,this),this.should_track=r(this.should_track,this),this.event_fired=r(this.event_fired,this),this.page_ready=r(this.page_ready,this),this.initialize=r(this.initialize,this)}return t.prototype.initialize=function(e,t){this.automagic=e,this.options=t},t.prototype.page_ready=function(){},t.prototype.event_fired=function(t,n,r,i){var o,u,a,s,l;try{if(e.matches(t,this.options.selector)&&this.options.should_track.call(this.automagic,t,n)&&(u=this.events(t,n),a=0,u.length>0)){for(s=0,l=u.length;l>s;s++)n=u[s],trak.io.track(n,this.track_properties(t),function(){return a+=1,a>=u.length?(i.track=!0,r()):void 0});return}}catch(c){o=c,trak.io.debug_error(o)}return i.track=!0,r()},t.prototype.should_track=function(){return!0},t.prototype.should_track_events={signed_in:function(t){var n,r,i,o,u;return o=this.map_properties(t),i=this.map_form_inputs(t),n=r=e.find("input:not([type=submit]), select",t).length,e.find("input[type=checkbox]",t).length>0&&(r=n-1),u=e.find("[type=submit]",t)[0],!(!o.username&&!o.email||1!==e.find("[type=password]",t).length||u&&u.value.match(/(sign.?up)|register|create/i)||2!==r)},signed_up:function(t,n){var r,i,o,u;return u=this.map_properties(t),o=this.map_form_inputs(t),r=i=e.find("input:not([type=submit]), select",t).length,e.find("input[type=checkbox]",t).length>0&&(i=r-1),!this.should_track_events.signed_in.call(this,t,n)&&(u.username||u.email)&&i>=2},subscribed_with_email:function(t){var n;return n=this.map_properties(t),1===e.find("input:not([type=submit])").length&&n.email},submitted_form:function(t){return e.matches(t,"form")}},t.prototype.events=function(e){var t,n,r,i;r=[],i=this.options.should_track_events;for(n in i)t=i[n],t.call(this.automagic,e)&&r.push(n);return r},t.prototype.track_properties=function(t){var n,r,i,o,u;return o={},(i=t.id).length>0&&(o.id=i),(r=e.attr(t,"class"))&&r.length>0&&(o["class"]=r.split(" ")),(n=e.attr(t,"action"))&&n.length>0&&(o.action=n),(u=window.location.href).length>0&&(o.referrer=u),o},t.prototype.map_properties=function(e){return this.automagic.identify.map_properties(e)},t.prototype.map_form_inputs=function(t){var n,r,i,o,u,a,s,l,c;for(r={},l=e.find("input:not([type=submit])",t),o=0,a=l.length;a>o;o++)n=l[o],r[e.attr(n,"name")]=e.attr(n,"type");for(c=e.find("select",t),u=0,s=c.length;s>u;u++)i=c[u],r[e.attr(n,"name")]="select";return r},t}()});var r=function(e,t){return function(){return e.apply(t,arguments)}};return n("trakio/automagic",["trakio/lodash","trakio/automagic/identify","trakio/automagic/track"],function(e,t,n){var i,o,u,a,s,l;i=function(){function i(){this.event_fired=r(this.event_fired,this),this.emulated_event_fired=r(this.emulated_event_fired,this),this.bind_events=r(this.bind_events,this),this.submit_bubbles=r(this.submit_bubbles,this),this.page_ready=r(this.page_ready,this),this.page_body=r(this.page_body,this),this.merge_options=r(this.merge_options,this)}return i.prototype.default_options={test_hooks:[],bind_events:!0,selector:"form",identify:{selector:"form",excluded_field_selector:"[type=password]",property_map:{username:/.*username.*/,name:/^(?!(.*first.*|.*last.*|.*user|.*f.?|.*l.?)name).*name.*/,first_name:/.*(first.*|f.?)name.*/,last_name:/.*(last.*|l.?)name.*/,email:/.*email.*/,position:/.*position.*/,company:/.*company.*/,organization:/.*organi(z|s)ation.*/,industry:/.*industry.*/,location:/.*location.*/,latlng:/.*latl(ng|on).*/,birthday:/.*(birthday|dob|date.*of.*birth).*/},has_any_fields:["username","name","first_name","last_name","email"],has_all_fields:[],distinct_ids:["username","email"],should_identify:function(e,t){return this.identify.should_identify(e,t)}},track:{selector:"form",should_track:function(e,t){return this.track.should_track(e,t)},should_track_events:{signed_in:function(e,t){return this.track.should_track_events.signed_in.call(this.track,e,t)},signed_up:function(e,t){return this.track.should_track_events.signed_up.call(this.track,e,t)},subscribed_with_email:function(e,t){return this.track.should_track_events.subscribed_with_email.call(this.track,e,t)},submitted_form:function(e,t){return this.track.should_track_events.submitted_form.call(this.track,e,t)}}}},i.prototype.initialize=function(r){var i;null==r&&(r={});try{return this.options=e.cloneDeep(this.default_options),e.merge(this.options,r,this.merge_options),this.identify=new t,this.identify.initialize(this,this.options.identify),this.track=new n,this.track.initialize(this,this.options.track),trak.io.page_ready_event_fired&&this.page_ready(),this}catch(o){return i=o,trak.io.debug_error(i)}},i.prototype.merge_options=function(t,n){return e.isArray(t)?n:void 0},i.prototype.page_body=function(){return e.find("body")[0]},i.prototype.page_ready=function(){return e.attr(this.page_body(),"data-trakio-automagic","1"),this.identify.page_ready(),this.track.page_ready(),this.options.bind_events?this.bind_events():void 0},i.prototype.submit_bubbles=function(){return"onsubmit"in window},i.prototype.bind_events=function(){var t,n;try{return t=document.body||document.getElementsByTagName("body")[0],this.submit_bubbles()?e.addEvent(t,"submit",this.event_fired):(e.addEvent(t,"click",this.emulated_event_fired),e.addEvent(t,"keypress",this.emulated_event_fired))}catch(r){return n=r,trak.io.debug_error(n)}},i.prototype.emulated_event_fired=function(e,t){var n,r,i,o,u;try{if(u=e.srcElement||e.target,"INPUT"===u.nodeName||"BUTTON"===u.nodeName)if(u.form)r=u.form;else{for(o=u.parentNode;o&&"FORM"!==o.nodeName;)o=u.parentNode;"FORM"===o.nodeName&&(r=o)}if(!r||!e.type)return;if(u.form||(u.form=r),"click"===e.type&&"submit"===u.type)return this.event_fired(e,t);if("keypress"===e.type&&(i=e.keyCode||e.which,13===i))return this.event_fired(e,t)}catch(a){return n=a,trak.io.debug_error(n)}},i.prototype.event_fired=function(e,t){var n,r,i,o,u;try{return o=e.srcElement||e.target,e.preventDefault(),n={identify:!1,track:!1},u=setTimeout(function(){return t?t():o.submit()},1e3),r=function(){return clearTimeout(u),n.identify&&n.track?(t?t():o.submit?o.submit():o.form.submit(),!0):void 0},this.identify.event_fired(o,e,r,n),this.track.event_fired(o,e,r,n),!1}catch(a){return i=a,trak.io.debug_error(i),e.automagic_ready={identify:!0,track:!0},e.callback(),!0}},i}(),Trak.Automagic=i,Trak.Automagic.Identify=t,Trak.Automagic.Track=n,s=Trak.instances,l=[];for(u=0,a=s.length;a>u;u++)o=s[u],l.push(o.loaded_automagic());return l}),t("trakio/automagic")}();