New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gremlin-script

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gremlin-script - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

src/boundparameter.js

4

build/gremlin-script.min.js

@@ -1,2 +0,2 @@

!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.GremlinScript=t()}}(function(){var t;return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var a="function"==typeof require&&require;if(!s&&a)return a(i,!0);if(u)return u(i,!0);throw new Error("Cannot find module '"+i+"'")}var p=n[i]={exports:{}};t[i][0].call(p.exports,function(e){var n=t[i][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e){e.exports={GremlinScript:t("./src/gremlinscript"),ObjectWrapper:t("./src/objects/objectwrapper"),Classes:t("./src/classes/classes"),Structure:{Graph:t("./src/objects/structure/graph"),Vertex:t("./src/objects/structure/vertex"),Edge:t("./src/objects/structure/edge"),Traversal:t("./src/objects/process/traversal")}}},{"./src/classes/classes":13,"./src/gremlinscript":30,"./src/objects/objectwrapper":31,"./src/objects/process/traversal":32,"./src/objects/structure/edge":33,"./src/objects/structure/graph":35,"./src/objects/structure/vertex":36}],2:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],3:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],5:[function(t,e,n){(function(e,r){function o(t,e){var r={seen:[],stylize:i};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(e)?r.showHidden=e:e&&n._extend(r,e),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),a(r,t,r.depth)}function u(t,e){var n=o.styles[e];return n?"["+o.colors[n][0]+"m"+t+"["+o.colors[n][1]+"m":t}function i(t){return t}function s(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function a(t,e,r){if(t.customInspect&&e&&O(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(r,t);return w(o)||(o=a(t,o,r)),o}var u=p(t,e);if(u)return u;var i=Object.keys(e),v=s(i);if(t.showHidden&&(i=Object.getOwnPropertyNames(e)),k(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return c(e);if(0===i.length){if(O(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(G(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(j(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return c(e)}var m="",d=!1,b=["{","}"];if(y(e)&&(d=!0,b=["[","]"]),O(e)){var _=e.name?": "+e.name:"";m=" [Function"+_+"]"}if(G(e)&&(m=" "+RegExp.prototype.toString.call(e)),j(e)&&(m=" "+Date.prototype.toUTCString.call(e)),k(e)&&(m=" "+c(e)),0===i.length&&(!d||0==e.length))return b[0]+m+b[1];if(0>r)return G(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var x;return x=d?f(t,e,r,v,i):i.map(function(n){return l(t,e,r,v,n,d)}),t.seen.pop(),h(x,m,b)}function p(t,e){if(_(e))return t.stylize("undefined","undefined");if(w(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return d(e)?t.stylize(""+e,"number"):v(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,o){for(var u=[],i=0,s=e.length;s>i;++i)u.push(C(e,String(i))?l(t,e,n,r,String(i),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||u.push(l(t,e,n,r,o,!0))}),u}function l(t,e,n,r,o,u){var i,s,p;if(p=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},p.get?s=p.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):p.set&&(s=t.stylize("[Setter]","special")),C(r,o)||(i="["+o+"]"),s||(t.seen.indexOf(p.value)<0?(s=g(n)?a(t,p.value,null):a(t,p.value,n-1),s.indexOf("\n")>-1&&(s=u?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(i)){if(u&&o.match(/^\d+$/))return s;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+s}function h(t,e,n){var r=0,o=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function y(t){return Array.isArray(t)}function v(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return null==t}function d(t){return"number"==typeof t}function w(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function _(t){return void 0===t}function G(t){return x(t)&&"[object RegExp]"===E(t)}function x(t){return"object"==typeof t&&null!==t}function j(t){return x(t)&&"[object Date]"===E(t)}function k(t){return x(t)&&("[object Error]"===E(t)||t instanceof Error)}function O(t){return"function"==typeof t}function N(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function E(t){return Object.prototype.toString.call(t)}function S(t){return 10>t?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),z[t.getMonth()],e].join(" ")}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var T=/%[sdj%]/g;n.format=function(t){if(!w(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,u=r.length,i=String(t).replace(T,function(t){if("%%"===t)return"%";if(n>=u)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),s=r[n];u>n;s=r[++n])i+=g(s)||!x(s)?" "+s:" "+o(s);return i},n.deprecate=function(t,o){function u(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?console.trace(o):console.error(o),i=!0}return t.apply(this,arguments)}if(_(r.process))return function(){return n.deprecate(t,o).apply(this,arguments)};if(e.noDeprecation===!0)return t;var i=!1;return u};var A,P={};n.debuglog=function(t){if(_(A)&&(A=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!P[t])if(new RegExp("\\b"+t+"\\b","i").test(A)){var r=e.pid;P[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else P[t]=function(){};return P[t]},n.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=y,n.isBoolean=v,n.isNull=g,n.isNullOrUndefined=m,n.isNumber=d,n.isString=w,n.isSymbol=b,n.isUndefined=_,n.isRegExp=G,n.isObject=x,n.isDate=j,n.isError=k,n.isFunction=O,n.isPrimitive=N,n.isBuffer=t("./support/isBuffer");var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",I(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!x(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("IrXUsu"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":4,IrXUsu:3,inherits:2}],6:[function(e,n,r){(function(e){(function(){function o(t,e,n){for(var r=(n||0)-1,o=t?t.length:0;++r<o;)if(t[r]===e)return r;return-1}function u(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var r="number"==n?e:_+e;return t=(t=t[n])&&t[r],"object"==n?t&&o(t,e)>-1?0:-1:t?0:-1}function i(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:_+t,o=e[n]||(e[n]={});"object"==n?(o[r]||(o[r]=[])).push(t):o[r]=!0}}function s(t){return t.charCodeAt(0)}function a(t,e){for(var n=t.criteria,r=e.criteria,o=-1,u=n.length;++o<u;){var i=n[o],s=r[o];if(i!==s){if(i>s||"undefined"==typeof i)return 1;if(s>i||"undefined"==typeof s)return-1}}return t.index-e.index}function p(t){var e=-1,n=t.length,r=t[0],o=t[n/2|0],u=t[n-1];if(r&&"object"==typeof r&&o&&"object"==typeof o&&u&&"object"==typeof u)return!1;var s=l();s["false"]=s["null"]=s["true"]=s.undefined=!1;var a=l();for(a.array=t,a.cache=s,a.push=i;++e<n;)a.push(t[e]);return a}function c(t){return"\\"+Z[t]}function f(){return d.pop()||[]}function l(){return w.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function h(t){t.length=0,d.length<x&&d.push(t)}function y(t){var e=t.cache;e&&y(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,w.length<x&&w.push(t)}function v(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,u=Array(0>o?0:o);++r<o;)u[r]=t[e+r];return u}function g(t){function e(t){return t&&"object"==typeof t&&!Qr(t)&&Pr.call(t,"__wrapped__")?t:new n(t)}function n(t,e){this.__chain__=!!e,this.__wrapped__=t}function r(t){function e(){if(r){var t=v(r);zr.apply(t,arguments)}if(this instanceof e){var u=d(n.prototype),i=n.apply(u,t||arguments);return Ie(i)?i:u}return n.apply(o,t||arguments)}var n=t[0],r=t[2],o=t[4];return Zr(e,t),e}function i(t,e,n,r,o){if(n){var u=n(t);if("undefined"!=typeof u)return u}var s=Ie(t);if(!s)return t;var a=Nr.call(t);if(!H[a])return t;var p=Wr[a];switch(a){case L:case R:return new p(+t);case q:case U:return new p(t);case M:return u=p(t.source,S.exec(t)),u.lastIndex=t.lastIndex,u}var c=Qr(t);if(e){var l=!r;r||(r=f()),o||(o=f());for(var y=r.length;y--;)if(r[y]==t)return o[y];u=c?p(t.length):{}}else u=c?v(t):uo({},t);return c&&(Pr.call(t,"index")&&(u.index=t.index),Pr.call(t,"input")&&(u.input=t.input)),e?(r.push(t),o.push(u),(c?Xe:ao)(t,function(t,s){u[s]=i(t,e,n,r,o)}),l&&(h(r),h(o)),u):u}function d(t){return Ie(t)?Lr(t):{}}function w(t,e,n){if("function"!=typeof t)return Qn;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(Xr.funcNames&&(r=!t.name),r=r||!Xr.funcDecomp,!r)){var o=Tr.call(t);Xr.funcNames||(r=!I.test(o)),r||(r=P.test(o),Zr(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,u){return t.call(e,n,r,o,u)}}return zn(t,e)}function x(t){function e(){var t=a?i:this;if(o){var h=v(o);zr.apply(h,arguments)}if((u||c)&&(h||(h=v(arguments)),u&&zr.apply(h,u),c&&h.length<s))return r|=16,x([n,f?r:-4&r,h,null,i,s]);if(h||(h=arguments),p&&(n=t[l]),this instanceof e){t=d(n.prototype);var y=n.apply(t,h);return Ie(y)?y:t}return n.apply(t,h)}var n=t[0],r=t[1],o=t[2],u=t[3],i=t[4],s=t[5],a=1&r,p=2&r,c=4&r,f=8&r,l=n;return Zr(e,t),e}function Z(t,e){var n=-1,r=ae(),i=t?t.length:0,s=i>=G&&r===o,a=[];if(s){var c=p(e);c?(r=u,e=c):s=!1}for(;++n<i;){var f=t[n];r(e,f)<0&&a.push(f)}return s&&y(e),a}function Y(t,e,n,r){for(var o=(r||0)-1,u=t?t.length:0,i=[];++o<u;){var s=t[o];if(s&&"object"==typeof s&&"number"==typeof s.length&&(Qr(s)||le(s))){e||(s=Y(s,e,n));var a=-1,p=s.length,c=i.length;for(i.length+=p;++a<p;)i[c++]=s[a]}else n||i.push(s)}return i}function te(t,e,n,r,o,u){if(n){var i=n(t,e);if("undefined"!=typeof i)return!!i}if(t===e)return 0!==t||1/t==1/e;var s=typeof t,a=typeof e;if(!(t!==t||t&&X[s]||e&&X[a]))return!1;if(null==t||null==e)return t===e;var p=Nr.call(t),c=Nr.call(e);if(p==K&&(p=F),c==K&&(c=F),p!=c)return!1;switch(p){case L:case R:return+t==+e;case q:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case M:case U:return t==Gr(e)}var l=p==B;if(!l){var y=Pr.call(t,"__wrapped__"),v=Pr.call(e,"__wrapped__");if(y||v)return te(y?t.__wrapped__:t,v?e.__wrapped__:e,n,r,o,u);if(p!=F)return!1;var g=t.constructor,m=e.constructor;if(g!=m&&!(Se(g)&&g instanceof g&&Se(m)&&m instanceof m)&&"constructor"in t&&"constructor"in e)return!1}var d=!o;o||(o=f()),u||(u=f());for(var w=o.length;w--;)if(o[w]==t)return u[w]==e;var b=0;if(i=!0,o.push(t),u.push(e),l){if(w=t.length,b=e.length,i=b==w,i||r)for(;b--;){var _=w,G=e[b];if(r)for(;_--&&!(i=te(t[_],G,n,r,o,u)););else if(!(i=te(t[b],G,n,r,o,u)))break}}else so(e,function(e,s,a){return Pr.call(a,s)?(b++,i=Pr.call(t,s)&&te(t[s],e,n,r,o,u)):void 0}),i&&!r&&so(t,function(t,e,n){return Pr.call(n,e)?i=--b>-1:void 0});return o.pop(),u.pop(),d&&(h(o),h(u)),i}function ee(t,e,n,r,o){(Qr(e)?Xe:ao)(e,function(e,u){var i,s,a=e,p=t[u];if(e&&((s=Qr(e))||po(e))){for(var c=r.length;c--;)if(i=r[c]==e){p=o[c];break}if(!i){var f;n&&(a=n(p,e),(f="undefined"!=typeof a)&&(p=a)),f||(p=s?Qr(p)?p:[]:po(p)?p:{}),r.push(e),o.push(p),f||ee(p,e,n,r,o)}}else n&&(a=n(p,e),"undefined"==typeof a&&(a=e)),"undefined"!=typeof a&&(p=a);t[u]=p})}function ne(t,e){return t+Cr(Jr()*(e-t+1))}function oe(t,e,n){var r=-1,i=ae(),s=t?t.length:0,a=[],c=!e&&s>=G&&i===o,l=n||c?f():a;if(c){var v=p(l);i=u,l=v}for(;++r<s;){var g=t[r],m=n?n(g,r,t):g;(e?!r||l[l.length-1]!==m:i(l,m)<0)&&((n||c)&&l.push(m),a.push(g))}return c?(h(l.array),y(l)):n&&h(l),a}function ue(t){return function(n,r,o){var u={};r=e.createCallback(r,o,3);var i=-1,s=n?n.length:0;if("number"==typeof s)for(;++i<s;){var a=n[i];t(u,a,r(a,i,n),n)}else ao(n,function(e,n,o){t(u,e,r(e,n,o),o)});return u}}function ie(t,e,n,o,u,i){var s=1&e,a=2&e,p=4&e,c=16&e,f=32&e;if(!a&&!Se(t))throw new xr;c&&!n.length&&(e&=-17,c=n=!1),f&&!o.length&&(e&=-33,f=o=!1);var l=t&&t.__bindData__;if(l&&l!==!0)return l=v(l),l[2]&&(l[2]=v(l[2])),l[3]&&(l[3]=v(l[3])),!s||1&l[1]||(l[4]=u),!s&&1&l[1]&&(e|=8),!p||4&l[1]||(l[5]=i),c&&zr.apply(l[2]||(l[2]=[]),n),f&&Kr.apply(l[3]||(l[3]=[]),o),l[1]|=e,ie.apply(null,l);var h=1==e||17===e?r:x;return h([t,e,n,o,u,i])}function se(t){return eo[t]}function ae(){var t=(t=e.indexOf)===dn?o:t;return t}function pe(t){return"function"==typeof t&&Er.test(t)}function ce(t){var e,n;return t&&Nr.call(t)==F&&(e=t.constructor,!Se(e)||e instanceof e)?(so(t,function(t,e){n=e}),"undefined"==typeof n||Pr.call(t,n)):!1}function fe(t){return no[t]}function le(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Nr.call(t)==K||!1}function he(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),i(t,e,"function"==typeof n&&w(n,r,1))}function ye(t,e,n){return i(t,!0,"function"==typeof e&&w(e,n,1))}function ve(t,e){var n=d(t);return e?uo(n,e):n}function ge(t,n,r){var o;return n=e.createCallback(n,r,3),ao(t,function(t,e,r){return n(t,e,r)?(o=e,!1):void 0}),o}function me(t,n,r){var o;return n=e.createCallback(n,r,3),we(t,function(t,e,r){return n(t,e,r)?(o=e,!1):void 0}),o}function de(t,e,n){var r=[];so(t,function(t,e){r.push(e,t)});var o=r.length;for(e=w(e,n,3);o--&&e(r[o--],r[o],t)!==!1;);return t}function we(t,e,n){var r=to(t),o=r.length;for(e=w(e,n,3);o--;){var u=r[o];if(e(t[u],u,t)===!1)break}return t}function be(t){var e=[];return so(t,function(t,n){Se(t)&&e.push(n)}),e.sort()}function _e(t,e){return t?Pr.call(t,e):!1}function Ge(t){for(var e=-1,n=to(t),r=n.length,o={};++e<r;){var u=n[e];o[t[u]]=u}return o}function xe(t){return t===!0||t===!1||t&&"object"==typeof t&&Nr.call(t)==L||!1}function je(t){return t&&"object"==typeof t&&Nr.call(t)==R||!1}function ke(t){return t&&1===t.nodeType||!1}function Oe(t){var e=!0;if(!t)return e;var n=Nr.call(t),r=t.length;return n==B||n==U||n==K||n==F&&"number"==typeof r&&Se(t.splice)?!r:(ao(t,function(){return e=!1}),e)}function Ne(t,e,n,r){return te(t,e,"function"==typeof n&&w(n,r,2))}function Ee(t){return Vr(t)&&!qr(parseFloat(t))}function Se(t){return"function"==typeof t}function Ie(t){return!(!t||!X[typeof t])}function Ce(t){return Ae(t)&&t!=+t}function Te(t){return null===t}function Ae(t){return"number"==typeof t||t&&"object"==typeof t&&Nr.call(t)==q||!1}function Pe(t){return t&&"object"==typeof t&&Nr.call(t)==M||!1}function ze(t){return"string"==typeof t||t&&"object"==typeof t&&Nr.call(t)==U||!1}function De(t){return"undefined"==typeof t}function $e(t,n,r){var o={};return n=e.createCallback(n,r,3),ao(t,function(t,e,r){o[e]=n(t,e,r)}),o}function Ke(t){var e=arguments,n=2;if(!Ie(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=w(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var o=v(arguments,1,n),u=-1,i=f(),s=f();++u<n;)ee(t,o[u],r,i,s);return h(i),h(s),t}function Be(t,n,r){var o={};if("function"!=typeof n){var u=[];so(t,function(t,e){u.push(e)}),u=Z(u,Y(arguments,!0,!1,1));for(var i=-1,s=u.length;++i<s;){var a=u[i];o[a]=t[a]}}else n=e.createCallback(n,r,3),so(t,function(t,e,r){n(t,e,r)||(o[e]=t)});return o}function Le(t){for(var e=-1,n=to(t),r=n.length,o=yr(r);++e<r;){var u=n[e];o[e]=[u,t[u]]}return o}function Re(t,n,r){var o={};if("function"!=typeof n)for(var u=-1,i=Y(arguments,!0,!1,1),s=Ie(t)?i.length:0;++u<s;){var a=i[u];a in t&&(o[a]=t[a])}else n=e.createCallback(n,r,3),so(t,function(t,e,r){n(t,e,r)&&(o[e]=t)});return o}function Ve(t,n,r,o){var u=Qr(t);if(null==r)if(u)r=[];else{var i=t&&t.constructor,s=i&&i.prototype;r=d(s)}return n&&(n=e.createCallback(n,o,4),(u?Xe:ao)(t,function(t,e,o){return n(r,t,e,o)})),r}function qe(t){for(var e=-1,n=to(t),r=n.length,o=yr(r);++e<r;)o[e]=t[n[e]];return o}function Fe(t){for(var e=arguments,n=-1,r=Y(e,!0,!1,1),o=e[2]&&e[2][e[1]]===t?1:r.length,u=yr(o);++n<o;)u[n]=t[r[n]];return u}function Me(t,e,n){var r=-1,o=ae(),u=t?t.length:0,i=!1;return n=(0>n?Mr(0,u+n):n)||0,Qr(t)?i=o(t,e,n)>-1:"number"==typeof u?i=(ze(t)?t.indexOf(e,n):o(t,e,n))>-1:ao(t,function(t){return++r>=n?!(i=t===e):void 0}),i}function Ue(t,n,r){var o=!0;n=e.createCallback(n,r,3);var u=-1,i=t?t.length:0;if("number"==typeof i)for(;++u<i&&(o=!!n(t[u],u,t)););else ao(t,function(t,e,r){return o=!!n(t,e,r)});return o}function He(t,n,r){var o=[];n=e.createCallback(n,r,3);var u=-1,i=t?t.length:0;if("number"==typeof i)for(;++u<i;){var s=t[u];n(s,u,t)&&o.push(s)}else ao(t,function(t,e,r){n(t,e,r)&&o.push(t)});return o}function Je(t,n,r){n=e.createCallback(n,r,3);var o=-1,u=t?t.length:0;if("number"!=typeof u){var i;return ao(t,function(t,e,r){return n(t,e,r)?(i=t,!1):void 0}),i}for(;++o<u;){var s=t[o];if(n(s,o,t))return s}}function We(t,n,r){var o;return n=e.createCallback(n,r,3),Ze(t,function(t,e,r){return n(t,e,r)?(o=t,!1):void 0}),o}function Xe(t,e,n){var r=-1,o=t?t.length:0;if(e=e&&"undefined"==typeof n?e:w(e,n,3),"number"==typeof o)for(;++r<o&&e(t[r],r,t)!==!1;);else ao(t,e);return t}function Ze(t,e,n){var r=t?t.length:0;if(e=e&&"undefined"==typeof n?e:w(e,n,3),"number"==typeof r)for(;r--&&e(t[r],r,t)!==!1;);else{var o=to(t);r=o.length,ao(t,function(t,n,u){return n=o?o[--r]:--r,e(u[n],n,u)})}return t}function Qe(t,e){var n=v(arguments,2),r=-1,o="function"==typeof e,u=t?t.length:0,i=yr("number"==typeof u?u:0);return Xe(t,function(t){i[++r]=(o?e:t[e]).apply(t,n)}),i}function Ye(t,n,r){var o=-1,u=t?t.length:0;if(n=e.createCallback(n,r,3),"number"==typeof u)for(var i=yr(u);++o<u;)i[o]=n(t[o],o,t);else i=[],ao(t,function(t,e,r){i[++o]=n(t,e,r)});return i}function tn(t,n,r){var o=-1/0,u=o;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Qr(t))for(var i=-1,a=t.length;++i<a;){var p=t[i];p>u&&(u=p)}else n=null==n&&ze(t)?s:e.createCallback(n,r,3),Xe(t,function(t,e,r){var i=n(t,e,r);i>o&&(o=i,u=t)});return u}function en(t,n,r){var o=1/0,u=o;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Qr(t))for(var i=-1,a=t.length;++i<a;){var p=t[i];u>p&&(u=p)}else n=null==n&&ze(t)?s:e.createCallback(n,r,3),Xe(t,function(t,e,r){var i=n(t,e,r);o>i&&(o=i,u=t)});return u}function nn(t,n,r,o){if(!t)return r;var u=arguments.length<3;n=e.createCallback(n,o,4);var i=-1,s=t.length;if("number"==typeof s)for(u&&(r=t[++i]);++i<s;)r=n(r,t[i],i,t);else ao(t,function(t,e,o){r=u?(u=!1,t):n(r,t,e,o)});return r}function rn(t,n,r,o){var u=arguments.length<3;return n=e.createCallback(n,o,4),Ze(t,function(t,e,o){r=u?(u=!1,t):n(r,t,e,o)}),r}function on(t,n,r){return n=e.createCallback(n,r,3),He(t,function(t,e,r){return!n(t,e,r)})}function un(t,e,n){if(t&&"number"!=typeof t.length&&(t=qe(t)),null==e||n)return t?t[ne(0,t.length-1)]:m;var r=sn(t);return r.length=Ur(Mr(0,e),r.length),r}function sn(t){var e=-1,n=t?t.length:0,r=yr("number"==typeof n?n:0);return Xe(t,function(t){var n=ne(0,++e);r[e]=r[n],r[n]=t}),r}function an(t){var e=t?t.length:0;return"number"==typeof e?e:to(t).length}function pn(t,n,r){var o;n=e.createCallback(n,r,3);var u=-1,i=t?t.length:0;if("number"==typeof i)for(;++u<i&&!(o=n(t[u],u,t)););else ao(t,function(t,e,r){return!(o=n(t,e,r))});return!!o}function cn(t,n,r){var o=-1,u=Qr(n),i=t?t.length:0,s=yr("number"==typeof i?i:0);for(u||(n=e.createCallback(n,r,3)),Xe(t,function(t,e,r){var i=s[++o]=l();u?i.criteria=Ye(n,function(e){return t[e]}):(i.criteria=f())[0]=n(t,e,r),i.index=o,i.value=t}),i=s.length,s.sort(a);i--;){var p=s[i];s[i]=p.value,u||h(p.criteria),y(p)}return s}function fn(t){return t&&"number"==typeof t.length?v(t):qe(t)}function ln(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var o=t[e];o&&r.push(o)}return r}function hn(t){return Z(t,Y(arguments,!0,!0,1))}function yn(t,n,r){var o=-1,u=t?t.length:0;for(n=e.createCallback(n,r,3);++o<u;)if(n(t[o],o,t))return o;return-1}function vn(t,n,r){var o=t?t.length:0;for(n=e.createCallback(n,r,3);o--;)if(n(t[o],o,t))return o;return-1}function gn(t,n,r){var o=0,u=t?t.length:0;if("number"!=typeof n&&null!=n){var i=-1;for(n=e.createCallback(n,r,3);++i<u&&n(t[i],i,t);)o++}else if(o=n,null==o||r)return t?t[0]:m;return v(t,0,Ur(Mr(0,o),u))}function mn(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n="function"!=typeof e&&r&&r[e]===t?null:e,e=!1),null!=n&&(t=Ye(t,n,r)),Y(t,e)}function dn(t,e,n){if("number"==typeof n){var r=t?t.length:0;n=0>n?Mr(0,r+n):n||0}else if(n){var u=Nn(t,e);return t[u]===e?u:-1}return o(t,e,n)}function wn(t,n,r){var o=0,u=t?t.length:0;if("number"!=typeof n&&null!=n){var i=u;for(n=e.createCallback(n,r,3);i--&&n(t[i],i,t);)o++}else o=null==n||r?1:n||o;return v(t,0,Ur(Mr(0,u-o),u))}function bn(){for(var t=[],e=-1,n=arguments.length,r=f(),i=ae(),s=i===o,a=f();++e<n;){var c=arguments[e];(Qr(c)||le(c))&&(t.push(c),r.push(s&&c.length>=G&&p(e?t[e]:a)))}var l=t[0],v=-1,g=l?l.length:0,m=[];t:for(;++v<g;){var d=r[0];if(c=l[v],(d?u(d,c):i(a,c))<0){for(e=n,(d||a).push(c);--e;)if(d=r[e],(d?u(d,c):i(t[e],c))<0)continue t;m.push(c)}}for(;n--;)d=r[n],d&&y(d);return h(r),h(a),m}function _n(t,n,r){var o=0,u=t?t.length:0;if("number"!=typeof n&&null!=n){var i=u;for(n=e.createCallback(n,r,3);i--&&n(t[i],i,t);)o++}else if(o=n,null==o||r)return t?t[u-1]:m;return v(t,Mr(0,u-o))}function Gn(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Mr(0,r+n):Ur(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function xn(t){for(var e=arguments,n=0,r=e.length,o=t?t.length:0;++n<r;)for(var u=-1,i=e[n];++u<o;)t[u]===i&&($r.call(t,u--,1),o--);return t}function jn(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,o=Mr(0,Sr((e-t)/(n||1))),u=yr(o);++r<o;)u[r]=t,t+=n;return u}function kn(t,n,r){var o=-1,u=t?t.length:0,i=[];for(n=e.createCallback(n,r,3);++o<u;){var s=t[o];n(s,o,t)&&(i.push(s),$r.call(t,o--,1),u--)}return i}function On(t,n,r){if("number"!=typeof n&&null!=n){var o=0,u=-1,i=t?t.length:0;for(n=e.createCallback(n,r,3);++u<i&&n(t[u],u,t);)o++}else o=null==n||r?1:Mr(0,n);return v(t,o)}function Nn(t,n,r,o){var u=0,i=t?t.length:u;for(r=r?e.createCallback(r,o,1):Qn,n=r(n);i>u;){var s=u+i>>>1;r(t[s])<n?u=s+1:i=s}return u}function En(){return oe(Y(arguments,!0,!0))}function Sn(t,n,r,o){return"boolean"!=typeof n&&null!=n&&(o=r,r="function"!=typeof n&&o&&o[n]===t?null:n,n=!1),null!=r&&(r=e.createCallback(r,o,3)),oe(t,n,r)}function In(t){return Z(t,v(arguments,1))}function Cn(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(Qr(n)||le(n))var r=r?oe(Z(r,n).concat(Z(n,r))):n}return r||[]}function Tn(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?tn(ho(t,"length")):0,r=yr(0>n?0:n);++e<n;)r[e]=ho(t,e);return r}function An(t,e){var n=-1,r=t?t.length:0,o={};for(e||!r||Qr(t[0])||(e=[]);++n<r;){var u=t[n];e?o[u]=e[n]:u&&(o[u[0]]=u[1])}return o}function Pn(t,e){if(!Se(e))throw new xr;return function(){return--t<1?e.apply(this,arguments):void 0}}function zn(t,e){return arguments.length>2?ie(t,17,v(arguments,2),null,e):ie(t,1,null,null,e)}function Dn(t){for(var e=arguments.length>1?Y(arguments,!0,!1,1):be(t),n=-1,r=e.length;++n<r;){var o=e[n];t[o]=ie(t[o],1,null,null,t)}return t}function $n(t,e){return arguments.length>2?ie(e,19,v(arguments,2),null,t):ie(e,3,null,null,t)}function Kn(){for(var t=arguments,e=t.length;e--;)if(!Se(t[e]))throw new xr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Bn(t,e){return e="number"==typeof e?e:+e||t.length,ie(t,4,null,null,null,e)}function Ln(t,e,n){var r,o,u,i,s,a,p,c=0,f=!1,l=!0;if(!Se(t))throw new xr;if(e=Mr(0,e)||0,n===!0){var h=!0;l=!1}else Ie(n)&&(h=n.leading,f="maxWait"in n&&(Mr(e,n.maxWait)||0),l="trailing"in n?n.trailing:l);var y=function(){var n=e-(vo()-i);if(0>=n){o&&Ir(o);var f=p;o=a=p=m,f&&(c=vo(),u=t.apply(s,r),a||o||(r=s=null))}else a=Dr(y,n)},v=function(){a&&Ir(a),o=a=p=m,(l||f!==e)&&(c=vo(),u=t.apply(s,r),a||o||(r=s=null))};return function(){if(r=arguments,i=vo(),s=this,p=l&&(a||!h),f===!1)var n=h&&!a;else{o||h||(c=i);var g=f-(i-c),m=0>=g;m?(o&&(o=Ir(o)),c=i,u=t.apply(s,r)):o||(o=Dr(v,g))}return m&&a?a=Ir(a):a||e===f||(a=Dr(y,e)),n&&(m=!0,u=t.apply(s,r)),!m||a||o||(r=s=null),u}}function Rn(t){if(!Se(t))throw new xr;var e=v(arguments,1);return Dr(function(){t.apply(m,e)},1)}function Vn(t,e){if(!Se(t))throw new xr;var n=v(arguments,2);return Dr(function(){t.apply(m,n)},e)}function qn(t,e){if(!Se(t))throw new xr;var n=function(){var r=n.cache,o=e?e.apply(this,arguments):_+arguments[0];return Pr.call(r,o)?r[o]:r[o]=t.apply(this,arguments)};return n.cache={},n}function Fn(t){var e,n;if(!Se(t))throw new xr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function Mn(t){return ie(t,16,v(arguments,1))}function Un(t){return ie(t,32,null,v(arguments,1))}function Hn(t,e,n){var r=!0,o=!0;if(!Se(t))throw new xr;return n===!1?r=!1:Ie(n)&&(r="leading"in n?n.leading:r,o="trailing"in n?n.trailing:o),J.leading=r,J.maxWait=e,J.trailing=o,Ln(t,e,J)}function Jn(t,e){return ie(e,16,[t])}function Wn(t){return function(){return t}}function Xn(t,e,n){var r=typeof t;if(null==t||"function"==r)return w(t,e,n);if("object"!=r)return nr(t);var o=to(t),u=o[0],i=t[u];return 1!=o.length||i!==i||Ie(i)?function(e){for(var n=o.length,r=!1;n--&&(r=te(e[o[n]],t[o[n]],null,!0)););return r}:function(t){var e=t[u];return i===e&&(0!==i||1/i==1/e)}}function Zn(t){return null==t?"":Gr(t).replace(oo,se)}function Qn(t){return t}function Yn(t,r,o){var u=!0,i=r&&be(r);r&&(o||i.length)||(null==o&&(o=r),s=n,r=t,t=e,i=be(r)),o===!1?u=!1:Ie(o)&&"chain"in o&&(u=o.chain);var s=t,a=Se(s);Xe(i,function(e){var n=t[e]=r[e];a&&(s.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,o=[r];zr.apply(o,arguments);var i=n.apply(t,o);if(u||e){if(r===i&&Ie(i))return this;i=new s(i),i.__chain__=e}return i})})}function tr(){return t._=Or,this}function er(){}function nr(t){return function(e){return e[t]}}function rr(t,e,n){var r=null==t,o=null==e;if(null==n&&("boolean"==typeof t&&o?(n=t,t=1):o||"boolean"!=typeof e||(n=e,o=!0)),r&&o&&(e=1),t=+t||0,o?(e=t,t=0):e=+e||0,n||t%1||e%1){var u=Jr();return Ur(t+u*(e-t+parseFloat("1e-"+((u+"").length-1))),e)}return ne(t,e)}function or(t,e){if(t){var n=t[e];return Se(n)?t[e]():n}}function ur(t,n,r){var o=e.templateSettings;t=Gr(t||""),r=io({},r,o);var u,i=io({},r.imports,o.imports),s=to(i),a=qe(i),p=0,f=r.interpolate||A,l="__p += '",h=_r((r.escape||A).source+"|"+f.source+"|"+(f===C?E:A).source+"|"+(r.evaluate||A).source+"|$","g");t.replace(h,function(e,n,r,o,i,s){return r||(r=o),l+=t.slice(p,s).replace(z,c),n&&(l+="' +\n__e("+n+") +\n'"),i&&(u=!0,l+="';\n"+i+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),p=s+e.length,e}),l+="';\n";var y=r.variable,v=y;v||(y="obj",l="with ("+y+") {\n"+l+"\n}\n"),l=(u?l.replace(k,""):l).replace(O,"$1").replace(N,"$1;"),l="function("+y+") {\n"+(v?"":y+" || ("+y+" = {});\n")+"var __t, __p = '', __e = _.escape"+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var g="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+$++ +"]")+"\n*/";try{var d=mr(s,"return "+l+g).apply(m,a)}catch(w){throw w.source=l,w}return n?d(n):(d.source=l,d)}function ir(t,e,n){t=(t=+t)>-1?t:0;var r=-1,o=yr(t);for(e=w(e,n,1);++r<t;)o[r]=e(r);return o}function sr(t){return null==t?"":Gr(t).replace(ro,fe)}function ar(t){var e=++b;return Gr(null==t?"":t)+e}function pr(t){return t=new n(t),t.__chain__=!0,t}function cr(t,e){return e(t),t}function fr(){return this.__chain__=!0,this}function lr(){return Gr(this.__wrapped__)}function hr(){return this.__wrapped__}t=t?re.defaults(Q.Object(),t,re.pick(Q,D)):Q;var yr=t.Array,vr=t.Boolean,gr=t.Date,mr=t.Function,dr=t.Math,wr=t.Number,br=t.Object,_r=t.RegExp,Gr=t.String,xr=t.TypeError,jr=[],kr=br.prototype,Or=t._,Nr=kr.toString,Er=_r("^"+Gr(Nr).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Sr=dr.ceil,Ir=t.clearTimeout,Cr=dr.floor,Tr=mr.prototype.toString,Ar=pe(Ar=br.getPrototypeOf)&&Ar,Pr=kr.hasOwnProperty,zr=jr.push,Dr=t.setTimeout,$r=jr.splice,Kr=jr.unshift,Br=function(){try{var t={},e=pe(e=br.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),Lr=pe(Lr=br.create)&&Lr,Rr=pe(Rr=yr.isArray)&&Rr,Vr=t.isFinite,qr=t.isNaN,Fr=pe(Fr=br.keys)&&Fr,Mr=dr.max,Ur=dr.min,Hr=t.parseInt,Jr=dr.random,Wr={};Wr[B]=yr,Wr[L]=vr,Wr[R]=gr,Wr[V]=mr,Wr[F]=br,Wr[q]=wr,Wr[M]=_r,Wr[U]=Gr,n.prototype=e.prototype;var Xr=e.support={};Xr.funcDecomp=!pe(t.WinRTError)&&P.test(g),Xr.funcNames="string"==typeof mr.name,e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:C,variable:"",imports:{_:e}},Lr||(d=function(){function e(){}return function(n){if(Ie(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Zr=Br?function(t,e){W.value=e,Br(t,"__bindData__",W)}:er,Qr=Rr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Nr.call(t)==B||!1},Yr=function(t){var e,n=t,r=[];if(!n)return r;if(!X[typeof t])return r;for(e in n)Pr.call(n,e)&&r.push(e);return r},to=Fr?function(t){return Ie(t)?Fr(t):[]}:Yr,eo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},no=Ge(eo),ro=_r("("+to(no).join("|")+")","g"),oo=_r("["+to(eo).join("")+"]","g"),uo=function(t,e,n){var r,o=t,u=o;
if(!o)return u;var i=arguments,s=0,a="number"==typeof n?2:i.length;if(a>3&&"function"==typeof i[a-2])var p=w(i[--a-1],i[a--],2);else a>2&&"function"==typeof i[a-1]&&(p=i[--a]);for(;++s<a;)if(o=i[s],o&&X[typeof o])for(var c=-1,f=X[typeof o]&&to(o),l=f?f.length:0;++c<l;)r=f[c],u[r]=p?p(u[r],o[r]):o[r];return u},io=function(t,e,n){var r,o=t,u=o;if(!o)return u;for(var i=arguments,s=0,a="number"==typeof n?2:i.length;++s<a;)if(o=i[s],o&&X[typeof o])for(var p=-1,c=X[typeof o]&&to(o),f=c?c.length:0;++p<f;)r=c[p],"undefined"==typeof u[r]&&(u[r]=o[r]);return u},so=function(t,e,n){var r,o=t,u=o;if(!o)return u;if(!X[typeof o])return u;e=e&&"undefined"==typeof n?e:w(e,n,3);for(r in o)if(e(o[r],r,t)===!1)return u;return u},ao=function(t,e,n){var r,o=t,u=o;if(!o)return u;if(!X[typeof o])return u;e=e&&"undefined"==typeof n?e:w(e,n,3);for(var i=-1,s=X[typeof o]&&to(o),a=s?s.length:0;++i<a;)if(r=s[i],e(o[r],r,t)===!1)return u;return u},po=Ar?function(t){if(!t||Nr.call(t)!=F)return!1;var e=t.valueOf,n=pe(e)&&(n=Ar(e))&&Ar(n);return n?t==n||Ar(t)==n:ce(t)}:ce,co=ue(function(t,e,n){Pr.call(t,n)?t[n]++:t[n]=1}),fo=ue(function(t,e,n){(Pr.call(t,n)?t[n]:t[n]=[]).push(e)}),lo=ue(function(t,e,n){t[n]=e}),ho=Ye,yo=He,vo=pe(vo=gr.now)&&vo||function(){return(new gr).getTime()},go=8==Hr(j+"08")?Hr:function(t,e){return Hr(ze(t)?t.replace(T,""):t,e||0)};return e.after=Pn,e.assign=uo,e.at=Fe,e.bind=zn,e.bindAll=Dn,e.bindKey=$n,e.chain=pr,e.compact=ln,e.compose=Kn,e.constant=Wn,e.countBy=co,e.create=ve,e.createCallback=Xn,e.curry=Bn,e.debounce=Ln,e.defaults=io,e.defer=Rn,e.delay=Vn,e.difference=hn,e.filter=He,e.flatten=mn,e.forEach=Xe,e.forEachRight=Ze,e.forIn=so,e.forInRight=de,e.forOwn=ao,e.forOwnRight=we,e.functions=be,e.groupBy=fo,e.indexBy=lo,e.initial=wn,e.intersection=bn,e.invert=Ge,e.invoke=Qe,e.keys=to,e.map=Ye,e.mapValues=$e,e.max=tn,e.memoize=qn,e.merge=Ke,e.min=en,e.omit=Be,e.once=Fn,e.pairs=Le,e.partial=Mn,e.partialRight=Un,e.pick=Re,e.pluck=ho,e.property=nr,e.pull=xn,e.range=jn,e.reject=on,e.remove=kn,e.rest=On,e.shuffle=sn,e.sortBy=cn,e.tap=cr,e.throttle=Hn,e.times=ir,e.toArray=fn,e.transform=Ve,e.union=En,e.uniq=Sn,e.values=qe,e.where=yo,e.without=In,e.wrap=Jn,e.xor=Cn,e.zip=Tn,e.zipObject=An,e.collect=Ye,e.drop=On,e.each=Xe,e.eachRight=Ze,e.extend=uo,e.methods=be,e.object=An,e.select=He,e.tail=On,e.unique=Sn,e.unzip=Tn,Yn(e),e.clone=he,e.cloneDeep=ye,e.contains=Me,e.escape=Zn,e.every=Ue,e.find=Je,e.findIndex=yn,e.findKey=ge,e.findLast=We,e.findLastIndex=vn,e.findLastKey=me,e.has=_e,e.identity=Qn,e.indexOf=dn,e.isArguments=le,e.isArray=Qr,e.isBoolean=xe,e.isDate=je,e.isElement=ke,e.isEmpty=Oe,e.isEqual=Ne,e.isFinite=Ee,e.isFunction=Se,e.isNaN=Ce,e.isNull=Te,e.isNumber=Ae,e.isObject=Ie,e.isPlainObject=po,e.isRegExp=Pe,e.isString=ze,e.isUndefined=De,e.lastIndexOf=Gn,e.mixin=Yn,e.noConflict=tr,e.noop=er,e.now=vo,e.parseInt=go,e.random=rr,e.reduce=nn,e.reduceRight=rn,e.result=or,e.runInContext=g,e.size=an,e.some=pn,e.sortedIndex=Nn,e.template=ur,e.unescape=sr,e.uniqueId=ar,e.all=Ue,e.any=pn,e.detect=Je,e.findWhere=Je,e.foldl=nn,e.foldr=rn,e.include=Me,e.inject=nn,Yn(function(){var t={};return ao(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.first=gn,e.last=_n,e.sample=un,e.take=gn,e.head=gn,ao(e,function(t,r){var o="sample"!==r;e.prototype[r]||(e.prototype[r]=function(e,r){var u=this.__chain__,i=t(this.__wrapped__,e,r);return u||null!=e&&(!r||o&&"function"==typeof e)?new n(i,u):i})}),e.VERSION="2.4.1",e.prototype.chain=fr,e.prototype.toString=lr,e.prototype.value=hr,e.prototype.valueOf=hr,Xe(["join","pop","shift"],function(t){var r=jr[t];e.prototype[t]=function(){var t=this.__chain__,e=r.apply(this.__wrapped__,arguments);return t?new n(e,t):e}}),Xe(["push","reverse","sort","unshift"],function(t){var n=jr[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(t){var r=jr[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),e}var m,d=[],w=[],b=0,_=+new Date+"",G=75,x=40,j=" \f \n\r\u2028\u2029 ᠎              ",k=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,E=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,I=/^\s*function[ \n\r\t]+\w/,C=/<%=([\s\S]+?)%>/g,T=RegExp("^["+j+"]*0+(?=.$)"),A=/($^)/,P=/\bthis\b/,z=/['\n\r\t\u2028\u2029\\]/g,D=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],$=0,K="[object Arguments]",B="[object Array]",L="[object Boolean]",R="[object Date]",V="[object Function]",q="[object Number]",F="[object Object]",M="[object RegExp]",U="[object String]",H={};H[V]=!1,H[K]=H[B]=H[L]=H[R]=H[q]=H[F]=H[M]=H[U]=!0;var J={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},X={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Q=X[typeof window]&&window||this,Y=X[typeof r]&&r&&!r.nodeType&&r,te=X[typeof n]&&n&&!n.nodeType&&n,ee=te&&te.exports===Y&&Y,ne=X[typeof e]&&e;!ne||ne.global!==ne&&ne.window!==ne||(Q=ne);var re=g();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(Q._=re,t(function(){return re})):Y&&te?ee?(te.exports=re)._=re:Y._=re:Q._=re}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(t,e){"use strict";function n(t,e){this.value=t,this.func=e}var r=t("lodash");n.prototype.toGroovy=function(){return this.parse()},n.prototype.parse=function(){var t=this.value;if(null===t)return"null";if(this.isClassReference())return t.toString();if(this.isFloat())return this.value;if(r.isString(t)&&this.isFloat())return"'"+t+"'";if(r.isArray(t)){var e=r.map(t,function(t){return r.isString(t)?"'"+t+"'":t});return e.toString()}return r.isBoolean(t)?t.toString():"'"+t+"'"},n.prototype.isFloat=function(){return!r.isNaN(parseFloat(this.value))&&"f"===this.value.slice(-1)},n.prototype.isClassReference=function(){var t=/^T\.(gt|gte|eq|neq|lte|lt|decr|incr|notin|in)$|^Contains\.(IN|NOT_IN)$|^g\.|^Vertex(\.class)$|^Edge(\.class)$|^String(\.class)$|^Integer(\.class)$|^Geoshape(\.class)$|^Direction\.(OUT|IN|BOTH)$|^TitanKey(\.class)$|^TitanLabel(\.class)$/;return r.isString(this.value)&&t.test(this.value)},e.exports=n},{lodash:6}],8:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./argument");r(n,o),n.prototype.toGroovy=function(){return"["+this.parse()+"]"},e.exports=n},{"./argument":7,util:5}],9:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./argument");r(n,o),n.prototype.toGroovy=function(){return this.value.toGroovy()},e.exports=n},{"./argument":7,util:5}],10:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./argument");r(n,o),n.prototype.toGroovy=function(){return this.value},e.exports=n},{"./argument":7,util:5}],11:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./argument");r(n,o),n.prototype.toGroovy=function(){return this.value},e.exports=n},{"./argument":7,util:5}],12:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./argument");r(n,o),n.prototype.toGroovy=function(){return JSON.stringify(this.value).replace("{","[").replace("}","]")},e.exports=n},{"./argument":7,util:5}],13:[function(t,e){"use strict";var n=t("../objects/structure/vertex"),r=t("../objects/structure/edge"),o=t("./javaclass"),u={Vertex:n,Edge:r,Geoshape:new o("Geoshape"),String:new o("String"),Integer:new o("Integer"),T:{gt:"T.gt",gte:"T.gte",eq:"T.eq",neq:"T.neq",lte:"T.lte",lt:"T.lt",decr:"T.decr",incr:"T.incr",notin:"T.notin","in":"T.in"},Contains:{IN:"Contains.IN",NOT_IN:"Contains.NOT_IN"},Direction:{OUT:"Direction.OUT",IN:"Direction.IN",BOTH:"Direction.BOTH"},TitanKey:new o("TitanKey"),TitanLabel:new o("TitanLabel")};e.exports=u},{"../objects/structure/edge":33,"../objects/structure/vertex":36,"./javaclass":14}],14:[function(t,e){"use strict";function n(t){this.name=t}n.prototype.toGroovy=function(){return this.name+".class"},Object.defineProperty(n.prototype,"class",{get:function(){return this.toGroovy()}}),e.exports=n},{}],15:[function(t,e){"use strict";function n(){o.call(this,null,arguments[0])}var r=t("util").inherits,o=t("./method");r(n,o),n.prototype.toGroovy=function(){var t="["+this.arguments[0].toString()+"]";return t},e.exports=n},{"./method":25,util:5}],16:[function(t,e){"use strict";function n(){o.call(this,"addProperties",arguments[0])}var r=t("util").inherits,o=t("../function");r(n,o),n.prototype.run=function(t){var e,n=this.arguments;for(e in n)t[e]=n[e];return t},n.prototype.toGroovy=function(){return".addProperties("+this.stringifyArgument(this.arguments)+")"},e.exports=n},{"../function":21,util:5}],17:[function(t,e){"use strict";function n(){o.call(this,"addProperty",arguments[0])}var r=t("util").inherits,o=t("../function");r(n,o),n.prototype.run=function(t){var e=this.arguments.key,n=this.arguments.value;return t[e]=n,t},n.prototype.toGroovy=function(){var t=this.arguments.key,e=this.arguments.value;return".addProperty('"+t+"','"+e+"')"},e.exports=n},{"../function":21,util:5}],18:[function(t,e){"use strict";function n(){o.call(this,"getProperties",arguments[0])}var r=t("util").inherits,o=(t("lodash"),t("../function"));r(n,o),n.prototype.run=function(t){return t.properties},e.exports=n},{"../function":21,lodash:6,util:5}],19:[function(t,e){"use strict";function n(){o.call(this,"setProperties",arguments[0])}var r=t("util").inherits,o=t("../function");r(n,o),n.prototype.run=function(t){var e,n=this.arguments;for(e in n)t[e]=n[e];return t},n.prototype.toGroovy=function(){return".setProperties("+this.stringifyArgument(this.arguments)+")"},e.exports=n},{"../function":21,util:5}],20:[function(t,e){"use strict";function n(){o.call(this,"setProperty",arguments[0])}var r=t("util").inherits,o=t("../function");r(n,o),n.prototype.run=function(t){var e=this.arguments.key,n=this.arguments.value;return t.properties[e]=n,t},n.prototype.toGroovy=function(){var t=this.arguments.key,e=this.arguments.value;return".setProperty('"+t+"','"+e+"')"},e.exports=n},{"../function":21,util:5}],21:[function(t,e){"use strict";function n(t,e){this.name=t,this.arguments=e,this.closures=[],this.parenthesizedArguments=[],this.buildArguments()}var r=t("lodash"),o=t("../arguments/argument"),u=t("../arguments/closure"),i=t("../arguments/object"),s=t("../arguments/array"),a=t("../arguments/class"),p=t("../arguments/number");n.prototype.toGroovy=function(){return this.name+this.groovifyArguments()},n.prototype.groovifyArguments=function(){var t="("+r.map(this.parenthesizedArguments,function(t){return t.toGroovy()}).join(",")+")";return t+=r.map(this.closures,function(t){return t.toGroovy()}).join(",")},n.prototype.buildArguments=function(){var t;r.each(this.arguments,function(e){this.isClosure(e)?(t=new u(e,this),this.closures.push(t)):r.isArray(e)?(t=new s(e,this),this.parenthesizedArguments.push(t)):this.isClass(e)?(t=new a(e,this),this.parenthesizedArguments.push(t)):r.isObject(e)?(t=new i(e,this),this.parenthesizedArguments.push(t)):r.isNumber(e)?(t=new p(e,this),this.parenthesizedArguments.push(t)):(t=new o(e,this),this.parenthesizedArguments.push(t))},this)},n.prototype.isClosure=function(t){var e=/^\{.*\}$/;return r.isString(t)&&e.test(t)},n.prototype.isClass=function(t){return t&&!!t.class};var c=function(t,e,n,o){var u,i,s=JSON.stringify(n);return t&&(t+=","),"undefined"==typeof e&&(e=null),u=r.isObject(e)?"["+r.reduce(e,c,"")+"]":JSON.stringify(e),i=r.isObject(o)&&!r.isArray(o)?s+":"+u:u,t+=i};n.prototype.stringifyArgument=function(t){var e=c("",t,null,null);return e},e.exports=n},{"../arguments/argument":7,"../arguments/array":8,"../arguments/class":9,"../arguments/closure":10,"../arguments/number":11,"../arguments/object":12,lodash:6}],22:[function(t,e){"use strict";function n(t,e){this.edge=t,u.call(this,"addEdge",e)}var r=t("util").inherits,o=t("lodash"),u=t("../method");r(n,u),n.prototype.run=function(){this.arguments.properties&&this.arguments.properties._id&&(this.edge._id=this.arguments.properties._id),this.edge._outV=this.arguments.v1,this.edge._inV=this.arguments.v2,this.edge._label=this.arguments.label;var t=this.arguments.properties;return o.each(t,function(t,e){this.edge[e]=t},this),delete this.arguments._id,this.edge},n.prototype.groovifyArguments=function(){var t=this.edge._id?this.edge._id+",":"",e=this.arguments.properties,n=o.isEmpty(e)?"":","+this.stringifyArgument(this.arguments.properties),r=this.edge._outV.identifier||this.arguments.v1,u=this.edge._inV.identifier||this.arguments.v2;return"("+t+r+","+u+',"'+this.edge._label+'"'+n+")"},e.exports=n},{"../method":25,lodash:6,util:5}],23:[function(t,e){"use strict";function n(t,e){this.vertex=t,u.call(this,"addVertex",e)}var r=t("util").inherits,o=t("lodash"),u=t("../method");r(n,u),n.prototype.run=function(){return o.each(this.arguments,function(t,e){this.vertex.properties[e]=t},this),this.vertex},n.prototype.groovifyArguments=function(){{var t=[];this.vertex._id?this.vertex._id+",":""}return this.arguments&&this.arguments._id&&(t.push(this.arguments._id),delete this.arguments._id),o.isEmpty(this.arguments)||t.push(this.stringifyArgument(this.arguments)),"("+t.join(",")+")"},e.exports=n},{"../method":25,lodash:6,util:5}],24:[function(t,e){"use strict";function n(){o.call(this,"idx",arguments[0])}var r=t("util").inherits,o=t("../function");r(n,o),n.prototype.toGroovy=function(){var t=".idx('"+this.arguments[0]+"')",e=this.arguments[1];if(e){var n=[];for(var r in e)n.push(r+":'"+e[r]+"'");t+="[["+n.join(",")+"]]"}return t},e.exports=n},{"../function":21,util:5}],25:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("./function");r(n,o),n.prototype.toGroovy=function(){return"."+this.name+this.groovifyArguments()},e.exports=n},{"./function":21,util:5}],26:[function(t,e){"use strict";function n(){u.apply(this,arguments)}var r=t("util").inherits,o=t("lodash"),u=t("./step");r(n,u),n.prototype.toGroovy=function(){var t="."+this.name,e=this.arguments,n=e[0];if(o.isArray(n)){var r=o.map(n,function(t){return t.toGroovy()}).join(",");t+="(["+r+"])"}else t+="('"+this.arguments[0]+"')";return t},e.exports=n},{"./step":29,lodash:6,util:5}],27:[function(t,e){"use strict";function n(){u.apply(this,arguments)}var r=t("util").inherits,o=t("lodash"),u=t("./step"),i=t("../../arguments/argument");r(n,u),n.prototype.toGroovy=function(){var t="",e=[],n=this.arguments;return n=o.isArray(n[0])?n[0]:n,o.each(n,function(t){var n=new i(t),r=t.toGroovy&&t.toGroovy()||n.parse();e.push(r)},this),t+="."+this.name+"("+e.join(",")+")"},e.exports=n},{"../../arguments/argument":7,"./step":29,lodash:6,util:5}],28:[function(t,e){"use strict";function n(){o.call(this,"select",arguments[0])}var r=t("util").inherits,o=t("./step");r(n,o),n.prototype.toGroovy=function(){return".select"+this.groovifyArguments().replace(/\"/g,"'")},e.exports=n},{"./step":29,util:5}],29:[function(t,e){"use strict";function n(){o.apply(this,arguments)}var r=t("util").inherits,o=t("../method");r(n,o),e.exports=n},{"../method":25,util:5}],30:[function(t,e){"use strict";function n(){this.script="",this.params={},this.paramCount=0,this.identifierCount=0}var r=t("lodash"),o=t("util");n.prototype.appendLine=function(t){this.script+=t+"\n"},n.prototype.addBoundParams=function(t){var e,n=[];return r.each(t,function(t){e="p"+this.paramCount++,this.params[e]=t,n.push(e)},this),n},n.prototype.handleString=function(t){var e=[t];e=e.concat(this.addBoundParams(r.rest(arguments))),this.appendLine(o.format.apply(o.format,e))},n.prototype.handleHelper=function(t){return this.appendLine(t.toGroovy()),t},n.prototype.var=function(t,e){e=e||"i"+this.identifierCount++,t.identifier=e;var n=e+"=",r=t.toGroovy?t.toGroovy():t;return this.script+=n+r+"\n",t},n.prototype.line=function(t){arguments.length>1?this.handleString.apply(this,arguments):r.isString(t)?this.appendLine(t):t&&this.handleHelper(t)},n.prototype.getAppender=function(){function t(){return e.line.apply(e,arguments),e}var e=this;return t.var=n.prototype.var.bind(this),Object.defineProperty(t,"script",{get:function(){return e.script}}),Object.defineProperty(t,"params",{get:function(){return e.params}}),t},e.exports=n},{lodash:6,util:5}],31:[function(t,e){"use strict";function n(t){this.objectName=t,this.methods=[],this.identifier="",this.properties={}}n.prototype.toGroovy=function(){return this.objectName+this.methods.join("")},n.prototype.asObject=function(){return this.properties},e.exports=n},{}],32:[function(t,e){"use strict";function n(t){p.call(this,t)}var r=t("util").inherits,o=t("../../functions/steps/step"),u=t("../../functions/collectionaccessor"),i=t("../../functions/steps/collectionstep"),s=t("../../functions/steps/pipesstep"),a=t("../../functions/steps/select"),p=t("../objectwrapper");r(n,p),n.prototype.both=function(){var t=new o("both",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.bothE=function(){var t=new o("bothE",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.bothV=function(){var t=new o("bothV",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.cap=function(){var t=new o("cap",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.gather=function(){var t=new o("gather",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.id=function(){var t=new o("id",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.in=function(){var t=new o("in",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.inE=function(){var t=new o("inE",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.inV=function(){var t=new o("inV",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.property=function(){var t=new o("property",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.label=function(){var t=new o("label",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.map=function(){var t=new o("map",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.memoize=function(){var t=new o("memoize",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.order=function(){var t=new o("order",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.out=function(){var t=new o("out",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.outE=function(){var t=new o("outE",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.outV=function(){var t=new o("outV",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.path=function(){var t=new o("path",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.scatter=function(){var t=new o("scatter",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.select=function(){var t=new a(arguments);return this.methods.push(t.toGroovy()),this},n.prototype.transform=function(){var t=new o("transform",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.orderMap=function(){var t=new o("orderMap",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.index=function(){var t=new u(arguments);return this.methods.push(t.toGroovy()),this},n.prototype.range=function(){var t=new u(arguments);return this.methods.push(t.toGroovy()),this},n.prototype.and=function(){var t=new s("and",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.back=function(){var t=new o("back",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.dedup=function(){var t=new o("dedup",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.except=function(){var t=new i("except",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.filter=function(){var t=new o("filter",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.has=function(){var t=new o("has",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.hasNot=function(){var t=new o("hasNot",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.interval=function(){var t=new o("interval",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.or=function(){var t=new s("or",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.random=function(){var t=new o("random",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.retain=function(){var t=new i("retain",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.simplePath=function(){var t=new o("simplePath",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.aggregate=function(){throw new Error("Not implemented.")},n.prototype.as=function(){var t=new o("as",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.groupBy=function(){var t=new o("groupBy",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.groupCount=function(){var t=new o("groupCount",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.optional=function(){var t=new o("optional",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.sideEffect=function(){var t=new o("sideEffect",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.linkBoth=function(){var t=new o("linkBoth",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.linkIn=function(){var t=new o("linkIn",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.linkOut=function(){var t=new o("linkOut",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.store=function(){throw new Error("Not implemented")},n.prototype.table=function(){throw new Error("Not implemented")},n.prototype.tree=function(){throw new Error("Not implemented")},n.prototype.copySplit=function(){var t=new s("copySplit",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.exhaustMerge=function(){var t=new o("exhaustMerge",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.fairMerge=function(){var t=new o("fairMerge",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.ifThenElse=function(){var t=new o("ifThenElse",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.loop=function(){var t=new o("loop",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.fill=function(){throw new Error("Not implemented")},n.prototype.count=function(){var t=new o("count",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.iterate=function(){var t=new o("iterate",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.next=function(){var t=new o("next",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.toList=function(){var t=new o("toList",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.keys=function(){var t=new o("keys",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.remove=function(){var t=new o("remove",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.values=function(){var t=new o("values",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.put=function(){var t=new s("put",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.getPropertyKeys=function(){var t=new o("getPropertyKeys",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.setProperty=function(){var t=new o("setProperty",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.getProperty=function(){var t=new o("getProperty",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.name=function(){var t=new o("name",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.dataType=function(){var t=new o("dataType",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.indexed=function(){var t=new o("indexed",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.unique=function(){var t=new o("unique",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.makePropertyKey=function(){var t=new o("makePropertyKey",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.group=function(){var t=new o("group",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.makeEdgeLabel=function(){var t=new o("makeEdgeLabel",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.query=function(){var t=new o("query",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.single=function(){var t=new o("single",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.list=function(){var t=new o("list",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.oneToMany=function(){var t=new o("oneToMany",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.manyToOne=function(){var t=new o("manyToOne",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.oneToOne=function(){var t=new o("oneToOne",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.makeKey=function(){var t=new o("makeKey",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.makeLabel=function(){var t=new o("makeLabel",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.make=function(){var t=new o("make",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.sortKey=function(){var t=new o("sortKey",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.signature=function(){var t=new o("signature",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.unidirected=function(){var t=new o("unidirected",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.createKeyIndex=function(){var t=new o("createKeyIndex",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.getIndexes=function(){var t=new o("getIndexes",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.hasIndex=function(){var t=new o("hasIndex",arguments);return this.methods.push(t.toGroovy()),this},n.prototype.key=function(){return this.methods.push("."+arguments[0]),this},e.exports=n},{"../../functions/collectionaccessor":15,"../../functions/steps/collectionstep":26,"../../functions/steps/pipesstep":27,"../../functions/steps/select":28,"../../functions/steps/step":29,"../objectwrapper":31,util:5}],33:[function(t,e){"use strict";function n(){o.apply(this,arguments),this.properties._type="edge"}var r=t("util").inherits,o=t("./element");r(n,o),n.toGroovy=function(){return"Edge.class"},Object.defineProperty(n,"class",{get:function(){return this.toGroovy()}}),e.exports=n},{"./element":34,util:5}],34:[function(t,e){"use strict";function n(){c.apply(this,arguments),this.properties._id=null}var r=t("util").inherits,o=t("../../functions/element/getproperties"),u=t("../../functions/element/setproperties"),i=t("../../functions/element/addproperties"),s=t("../../functions/element/setproperty"),a=t("../../functions/element/addproperty"),p=t("../../functions/method"),c=t("../objectwrapper");r(n,c),n.prototype.getProperties=function(){var t=new o;return this.methods.push(t.toGroovy()),t.run(this)},n.prototype.setProperty=function(t,e){var n=new s({key:t,value:e});return this.methods.push(n.toGroovy()),n.run(this)},n.prototype.setProperties=function(t){var e=new u(t);return this.methods.push(e.toGroovy()),e.run(this)},n.prototype.addProperty=function(t,e){var n=new a({key:t,value:e});return this.methods.push(n.toGroovy()),n.run(this)},n.prototype.addProperties=function(t){var e=new i(t);return this.methods.push(e.toGroovy()),e.run(this)},n.prototype.remove=function(){var t=new p("remove",[]);return this.methods.push(t.toGroovy()),this},e.exports=n},{"../../functions/element/addproperties":16,"../../functions/element/addproperty":17,"../../functions/element/getproperties":18,"../../functions/element/setproperties":19,"../../functions/element/setproperty":20,"../../functions/method":25,"../objectwrapper":31,util:5}],35:[function(t,e){"use strict";function n(){p.apply(this,arguments)}var r=t("util").inherits,o=t("../../functions/method"),u=t("../../functions/graph/idx"),i=t("../../functions/graph/addvertex"),s=t("../../functions/graph/addedge"),a=t("../process/traversal"),p=t("../objectwrapper"),c=t("./vertex"),f=t("./edge");r(n,p),n.prototype.E=function(){var t=new o("E",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.V=function(){var t=new o("V",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.e=function(){var t=new o("e",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.idx=function(){var t=new u(arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.v=function(){var t=new o("v",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.createIndex=function(){var t=new o("createIndex",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.createKeyIndex=function(){var t=new o("createKeyIndex",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.getIndices=function(){var t=new o("getIndices",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.getIndexedKeys=function(){var t=new o("getIndexedKeys",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.getIndex=function(){var t=new o("getIndex",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.dropIndex=function(){var t=new o("dropIndex",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.dropKeyIndex=function(){var t=new o("dropKeyIndex",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.makeKey=function(){var t=new o("makeKey",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.clear=function(){var t=new o("clear",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.shutdown=function(){var t=new o("shutdown",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.getFeatures=function(){var t=new o("getFeatures",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.getTypes=function(){var t=new o("getTypes",arguments),e=new a(this.objectName);return e.methods.push(t.toGroovy()),e},n.prototype.addVertex=function(t){var e=new c("g"),n=new i(e,t);return n.run(),e.methods.push(n.toGroovy()),e},n.prototype.addEdge=function(t,e,n,r){var o={v1:t,v2:e,label:n,properties:r},u=new f("g"),i=new s(u,o);return i.run(),u.methods.push(i.toGroovy()),u},e.exports=n},{"../../functions/graph/addedge":22,"../../functions/graph/addvertex":23,"../../functions/graph/idx":24,"../../functions/method":25,"../objectwrapper":31,"../process/traversal":32,"./edge":33,"./vertex":36,util:5}],36:[function(t,e){"use strict";function n(){o.apply(this,arguments),this.properties._type="vertex"}var r=t("util").inherits,o=t("./element");r(n,o),n.toGroovy=function(){return"Vertex.class"},Object.defineProperty(n,"class",{get:function(){return this.toGroovy()}}),e.exports=n},{"./element":34,util:5}]},{},[1])(1)});
!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.GremlinScript=t()}}(function(){var t;return function n(t,e,r){function i(o,a){if(!e[o]){if(!t[o]){var s="function"==typeof require&&require;if(!a&&s)return s(o,!0);if(u)return u(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=e[o]={exports:{}};t[o][0].call(c.exports,function(n){var e=t[o][1][n];return i(e?e:n)},c,c.exports,n,t,e,r)}return e[o].exports}for(var u="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,n){"use strict";var e=t("./src/boundparameter");n.exports={GremlinScript:t("./src/gremlinscript"),ObjectWrapper:t("./src/objects/objectwrapper"),Classes:t("./src/classes/classes"),Structure:{Graph:t("./src/objects/structure/graph"),Vertex:t("./src/objects/structure/vertex"),Edge:t("./src/objects/structure/edge"),Traversal:t("./src/objects/process/traversal")},bindParameter:function(t){return new e(t)}}},{"./src/boundparameter":13,"./src/classes/classes":14,"./src/gremlinscript":30,"./src/objects/objectwrapper":31,"./src/objects/process/traversal":32,"./src/objects/structure/edge":33,"./src/objects/structure/graph":35,"./src/objects/structure/vertex":36}],2:[function(t,n){n.exports="function"==typeof Object.create?function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,n){t.super_=n;var e=function(){};e.prototype=n.prototype,t.prototype=new e,t.prototype.constructor=t}},{}],3:[function(t,n){function e(){}var r=n.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(n){var e=[];return window.addEventListener("message",function(t){var n=t.source;if((n===window||null===n)&&"process-tick"===t.data&&(t.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(t){e.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,n){n.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],5:[function(t,n,e){(function(n,r){function i(t,n){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),s(r,t,r.depth)}function u(t,n){var e=i.styles[n];return e?"["+i.colors[e][0]+"m"+t+"["+i.colors[e][1]+"m":t}function o(t){return t}function a(t){var n={};return t.forEach(function(t){n[t]=!0}),n}function s(t,n,r){if(t.customInspect&&n&&N(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return b(i)||(i=s(t,i,r)),i}var u=c(t,n);if(u)return u;var o=Object.keys(n),y=a(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(n)),O(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(n);if(0===o.length){if(N(n)){var v=n.name?": "+n.name:"";return t.stylize("[Function"+v+"]","special")}if(x(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(k(n))return t.stylize(Date.prototype.toString.call(n),"date");if(O(n))return p(n)}var m="",d=!1,w=["{","}"];if(g(n)&&(d=!0,w=["[","]"]),N(n)){var _=n.name?": "+n.name:"";m=" [Function"+_+"]"}if(x(n)&&(m=" "+RegExp.prototype.toString.call(n)),k(n)&&(m=" "+Date.prototype.toUTCString.call(n)),O(n)&&(m=" "+p(n)),0===o.length&&(!d||0==n.length))return w[0]+m+w[1];if(0>r)return x(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var j;return j=d?f(t,n,r,y,o):o.map(function(e){return l(t,n,r,y,e,d)}),t.seen.pop(),h(j,m,w)}function c(t,n){if(_(n))return t.stylize("undefined","undefined");if(b(n)){var e="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(e,"string")}return d(n)?t.stylize(""+n,"number"):y(n)?t.stylize(""+n,"boolean"):v(n)?t.stylize("null","null"):void 0}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,n,e,r,i){for(var u=[],o=0,a=n.length;a>o;++o)u.push(A(n,String(o))?l(t,n,e,r,String(o),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||u.push(l(t,n,e,r,i,!0))}),u}function l(t,n,e,r,i,u){var o,a,c;if(c=Object.getOwnPropertyDescriptor(n,i)||{value:n[i]},c.get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),A(r,i)||(o="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=v(e)?s(t,c.value,null):s(t,c.value,e-1),a.indexOf("\n")>-1&&(a=u?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),_(o)){if(u&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function h(t,n,e){var r=0,i=t.reduce(function(t,n){return r++,n.indexOf("\n")>=0&&r++,t+n.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?e[0]+(""===n?"":n+"\n ")+" "+t.join(",\n ")+" "+e[1]:e[0]+n+" "+t.join(", ")+" "+e[1]}function g(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function v(t){return null===t}function m(t){return null==t}function d(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function _(t){return void 0===t}function x(t){return j(t)&&"[object RegExp]"===E(t)}function j(t){return"object"==typeof t&&null!==t}function k(t){return j(t)&&"[object Date]"===E(t)}function O(t){return j(t)&&("[object Error]"===E(t)||t instanceof Error)}function N(t){return"function"==typeof t}function S(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function E(t){return Object.prototype.toString.call(t)}function I(t){return 10>t?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,n=[I(t.getHours()),I(t.getMinutes()),I(t.getSeconds())].join(":");return[t.getDate(),z[t.getMonth()],n].join(" ")}function A(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var P=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var n=[],e=0;e<arguments.length;e++)n.push(i(arguments[e]));return n.join(" ")}for(var e=1,r=arguments,u=r.length,o=String(t).replace(P,function(t){if("%%"===t)return"%";if(e>=u)return t;switch(t){case"%s":return String(r[e++]);case"%d":return Number(r[e++]);case"%j":try{return JSON.stringify(r[e++])}catch(n){return"[Circular]"}default:return t}}),a=r[e];u>e;a=r[++e])o+=v(a)||!j(a)?" "+a:" "+i(a);return o},e.deprecate=function(t,i){function u(){if(!o){if(n.throwDeprecation)throw new Error(i);n.traceDeprecation?console.trace(i):console.error(i),o=!0}return t.apply(this,arguments)}if(_(r.process))return function(){return e.deprecate(t,i).apply(this,arguments)};if(n.noDeprecation===!0)return t;var o=!1;return u};var T,G={};e.debuglog=function(t){if(_(T)&&(T=n.env.NODE_DEBUG||""),t=t.toUpperCase(),!G[t])if(new RegExp("\\b"+t+"\\b","i").test(T)){var r=n.pid;G[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else G[t]=function(){};return G[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=g,e.isBoolean=y,e.isNull=v,e.isNullOrUndefined=m,e.isNumber=d,e.isString=b,e.isSymbol=w,e.isUndefined=_,e.isRegExp=x,e.isObject=j,e.isDate=k,e.isError=O,e.isFunction=N,e.isPrimitive=S,e.isBuffer=t("./support/isBuffer");var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=t("inherits"),e._extend=function(t,n){if(!n||!j(n))return t;for(var e=Object.keys(n),r=e.length;r--;)t[e[r]]=n[e[r]];return t}}).call(this,t("IrXUsu"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":4,IrXUsu:3,inherits:2}],6:[function(n,e,r){(function(n){(function(){function i(t,n,e){for(var r=(e||0)-1,i=t?t.length:0;++r<i;)if(t[r]===n)return r;return-1}function u(t,n){var e=typeof n;if(t=t.cache,"boolean"==e||null==n)return t[n]?0:-1;"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:_+n;return t=(t=t[e])&&t[r],"object"==e?t&&i(t,n)>-1?0:-1:t?0:-1}function o(t){var n=this.cache,e=typeof t;if("boolean"==e||null==t)n[t]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?t:_+t,i=n[e]||(n[e]={});"object"==e?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function a(t){return t.charCodeAt(0)}function s(t,n){for(var e=t.criteria,r=n.criteria,i=-1,u=e.length;++i<u;){var o=e[i],a=r[i];if(o!==a){if(o>a||"undefined"==typeof o)return 1;if(a>o||"undefined"==typeof a)return-1}}return t.index-n.index}function c(t){var n=-1,e=t.length,r=t[0],i=t[e/2|0],u=t[e-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&u&&"object"==typeof u)return!1;var a=l();a["false"]=a["null"]=a["true"]=a.undefined=!1;var s=l();for(s.array=t,s.cache=a,s.push=o;++n<e;)s.push(t[n]);return s}function p(t){return"\\"+Z[t]}function f(){return d.pop()||[]}function l(){return b.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function h(t){t.length=0,d.length<j&&d.push(t)}function g(t){var n=t.cache;n&&g(n),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,b.length<j&&b.push(t)}function y(t,n,e){n||(n=0),"undefined"==typeof e&&(e=t?t.length:0);for(var r=-1,i=e-n||0,u=Array(0>i?0:i);++r<i;)u[r]=t[n+r];return u}function v(t){function n(t){return t&&"object"==typeof t&&!Qr(t)&&Gr.call(t,"__wrapped__")?t:new e(t)}function e(t,n){this.__chain__=!!n,this.__wrapped__=t}function r(t){function n(){if(r){var t=y(r);zr.apply(t,arguments)}if(this instanceof n){var u=d(e.prototype),o=e.apply(u,t||arguments);return An(o)?o:u}return e.apply(i,t||arguments)}var e=t[0],r=t[2],i=t[4];return Zr(n,t),n}function o(t,n,e,r,i){if(e){var u=e(t);if("undefined"!=typeof u)return u}var a=An(t);if(!a)return t;var s=Sr.call(t);if(!H[s])return t;var c=Wr[s];switch(s){case L:case R:return new c(+t);case q:case U:return new c(t);case M:return u=c(t.source,I.exec(t)),u.lastIndex=t.lastIndex,u}var p=Qr(t);if(n){var l=!r;r||(r=f()),i||(i=f());for(var g=r.length;g--;)if(r[g]==t)return i[g];u=p?c(t.length):{}}else u=p?y(t):ui({},t);return p&&(Gr.call(t,"index")&&(u.index=t.index),Gr.call(t,"input")&&(u.input=t.input)),n?(r.push(t),i.push(u),(p?Zn:si)(t,function(t,a){u[a]=o(t,n,e,r,i)}),l&&(h(r),h(i)),u):u}function d(t){return An(t)?Lr(t):{}}function b(t,n,e){if("function"!=typeof t)return Qe;if("undefined"==typeof n||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(Xr.funcNames&&(r=!t.name),r=r||!Xr.funcDecomp,!r)){var i=Pr.call(t);Xr.funcNames||(r=!C.test(i)),r||(r=G.test(i),Zr(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,i){return t.call(n,e,r,i)};case 4:return function(e,r,i,u){return t.call(n,e,r,i,u)}}return ze(t,n)}function j(t){function n(){var t=s?o:this;if(i){var h=y(i);zr.apply(h,arguments)}if((u||p)&&(h||(h=y(arguments)),u&&zr.apply(h,u),p&&h.length<a))return r|=16,j([e,f?r:-4&r,h,null,o,a]);if(h||(h=arguments),c&&(e=t[l]),this instanceof n){t=d(e.prototype);var g=e.apply(t,h);return An(g)?g:t}return e.apply(t,h)}var e=t[0],r=t[1],i=t[2],u=t[3],o=t[4],a=t[5],s=1&r,c=2&r,p=4&r,f=8&r,l=e;return Zr(n,t),n}function Z(t,n){var e=-1,r=cn(),o=t?t.length:0,a=o>=x&&r===i,s=[];if(a){var p=c(n);p?(r=u,n=p):a=!1}for(;++e<o;){var f=t[e];r(n,f)<0&&s.push(f)}return a&&g(n),s}function Y(t,n,e,r){for(var i=(r||0)-1,u=t?t.length:0,o=[];++i<u;){var a=t[i];if(a&&"object"==typeof a&&"number"==typeof a.length&&(Qr(a)||hn(a))){n||(a=Y(a,n,e));var s=-1,c=a.length,p=o.length;for(o.length+=c;++s<c;)o[p++]=a[s]}else e||o.push(a)}return o}function tn(t,n,e,r,i,u){if(e){var o=e(t,n);if("undefined"!=typeof o)return!!o}if(t===n)return 0!==t||1/t==1/n;var a=typeof t,s=typeof n;if(!(t!==t||t&&X[a]||n&&X[s]))return!1;if(null==t||null==n)return t===n;var c=Sr.call(t),p=Sr.call(n);if(c==$&&(c=F),p==$&&(p=F),c!=p)return!1;switch(c){case L:case R:return+t==+n;case q:return t!=+t?n!=+n:0==t?1/t==1/n:t==+n;case M:case U:return t==xr(n)}var l=c==K;if(!l){var g=Gr.call(t,"__wrapped__"),y=Gr.call(n,"__wrapped__");if(g||y)return tn(g?t.__wrapped__:t,y?n.__wrapped__:n,e,r,i,u);if(c!=F)return!1;var v=t.constructor,m=n.constructor;if(v!=m&&!(Cn(v)&&v instanceof v&&Cn(m)&&m instanceof m)&&"constructor"in t&&"constructor"in n)return!1}var d=!i;i||(i=f()),u||(u=f());for(var b=i.length;b--;)if(i[b]==t)return u[b]==n;var w=0;if(o=!0,i.push(t),u.push(n),l){if(b=t.length,w=n.length,o=w==b,o||r)for(;w--;){var _=b,x=n[w];if(r)for(;_--&&!(o=tn(t[_],x,e,r,i,u)););else if(!(o=tn(t[w],x,e,r,i,u)))break}}else ai(n,function(n,a,s){return Gr.call(s,a)?(w++,o=Gr.call(t,a)&&tn(t[a],n,e,r,i,u)):void 0}),o&&!r&&ai(t,function(t,n,e){return Gr.call(e,n)?o=--w>-1:void 0});return i.pop(),u.pop(),d&&(h(i),h(u)),o}function nn(t,n,e,r,i){(Qr(n)?Zn:si)(n,function(n,u){var o,a,s=n,c=t[u];if(n&&((a=Qr(n))||ci(n))){for(var p=r.length;p--;)if(o=r[p]==n){c=i[p];break}if(!o){var f;e&&(s=e(c,n),(f="undefined"!=typeof s)&&(c=s)),f||(c=a?Qr(c)?c:[]:ci(c)?c:{}),r.push(n),i.push(c),f||nn(c,n,e,r,i)}}else e&&(s=e(c,n),"undefined"==typeof s&&(s=n)),"undefined"!=typeof s&&(c=s);t[u]=c})}function en(t,n){return t+Ar(Jr()*(n-t+1))}function un(t,n,e){var r=-1,o=cn(),a=t?t.length:0,s=[],p=!n&&a>=x&&o===i,l=e||p?f():s;if(p){var y=c(l);o=u,l=y}for(;++r<a;){var v=t[r],m=e?e(v,r,t):v;(n?!r||l[l.length-1]!==m:o(l,m)<0)&&((e||p)&&l.push(m),s.push(v))}return p?(h(l.array),g(l)):e&&h(l),s}function on(t){return function(e,r,i){var u={};r=n.createCallback(r,i,3);var o=-1,a=e?e.length:0;if("number"==typeof a)for(;++o<a;){var s=e[o];t(u,s,r(s,o,e),e)}else si(e,function(n,e,i){t(u,n,r(n,e,i),i)});return u}}function an(t,n,e,i,u,o){var a=1&n,s=2&n,c=4&n,p=16&n,f=32&n;if(!s&&!Cn(t))throw new jr;p&&!e.length&&(n&=-17,p=e=!1),f&&!i.length&&(n&=-33,f=i=!1);var l=t&&t.__bindData__;if(l&&l!==!0)return l=y(l),l[2]&&(l[2]=y(l[2])),l[3]&&(l[3]=y(l[3])),!a||1&l[1]||(l[4]=u),!a&&1&l[1]&&(n|=8),!c||4&l[1]||(l[5]=o),p&&zr.apply(l[2]||(l[2]=[]),e),f&&$r.apply(l[3]||(l[3]=[]),i),l[1]|=n,an.apply(null,l);var h=1==n||17===n?r:j;return h([t,n,e,i,u,o])}function sn(t){return ni[t]}function cn(){var t=(t=n.indexOf)===de?i:t;return t}function pn(t){return"function"==typeof t&&Er.test(t)}function fn(t){var n,e;return t&&Sr.call(t)==F&&(n=t.constructor,!Cn(n)||n instanceof n)?(ai(t,function(t,n){e=n}),"undefined"==typeof e||Gr.call(t,e)):!1}function ln(t){return ei[t]}function hn(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==$||!1}function gn(t,n,e,r){return"boolean"!=typeof n&&null!=n&&(r=e,e=n,n=!1),o(t,n,"function"==typeof e&&b(e,r,1))}function yn(t,n,e){return o(t,!0,"function"==typeof n&&b(n,e,1))}function vn(t,n){var e=d(t);return n?ui(e,n):e}function mn(t,e,r){var i;return e=n.createCallback(e,r,3),si(t,function(t,n,r){return e(t,n,r)?(i=n,!1):void 0}),i}function dn(t,e,r){var i;return e=n.createCallback(e,r,3),wn(t,function(t,n,r){return e(t,n,r)?(i=n,!1):void 0}),i}function bn(t,n,e){var r=[];ai(t,function(t,n){r.push(n,t)});var i=r.length;for(n=b(n,e,3);i--&&n(r[i--],r[i],t)!==!1;);return t}function wn(t,n,e){var r=ti(t),i=r.length;for(n=b(n,e,3);i--;){var u=r[i];if(n(t[u],u,t)===!1)break}return t}function _n(t){var n=[];return ai(t,function(t,e){Cn(t)&&n.push(e)}),n.sort()}function xn(t,n){return t?Gr.call(t,n):!1}function jn(t){for(var n=-1,e=ti(t),r=e.length,i={};++n<r;){var u=e[n];i[t[u]]=u}return i}function kn(t){return t===!0||t===!1||t&&"object"==typeof t&&Sr.call(t)==L||!1}function On(t){return t&&"object"==typeof t&&Sr.call(t)==R||!1}function Nn(t){return t&&1===t.nodeType||!1}function Sn(t){var n=!0;if(!t)return n;var e=Sr.call(t),r=t.length;return e==K||e==U||e==$||e==F&&"number"==typeof r&&Cn(t.splice)?!r:(si(t,function(){return n=!1}),n)}function En(t,n,e,r){return tn(t,n,"function"==typeof e&&b(e,r,2))}function In(t){return Vr(t)&&!qr(parseFloat(t))}function Cn(t){return"function"==typeof t}function An(t){return!(!t||!X[typeof t])}function Pn(t){return Gn(t)&&t!=+t}function Tn(t){return null===t}function Gn(t){return"number"==typeof t||t&&"object"==typeof t&&Sr.call(t)==q||!1}function zn(t){return t&&"object"==typeof t&&Sr.call(t)==M||!1}function Bn(t){return"string"==typeof t||t&&"object"==typeof t&&Sr.call(t)==U||!1}function Dn(t){return"undefined"==typeof t}function $n(t,e,r){var i={};return e=n.createCallback(e,r,3),si(t,function(t,n,r){i[n]=e(t,n,r)}),i}function Kn(t){var n=arguments,e=2;if(!An(t))return t;if("number"!=typeof n[2]&&(e=n.length),e>3&&"function"==typeof n[e-2])var r=b(n[--e-1],n[e--],2);else e>2&&"function"==typeof n[e-1]&&(r=n[--e]);for(var i=y(arguments,1,e),u=-1,o=f(),a=f();++u<e;)nn(t,i[u],r,o,a);return h(o),h(a),t}function Ln(t,e,r){var i={};if("function"!=typeof e){var u=[];ai(t,function(t,n){u.push(n)}),u=Z(u,Y(arguments,!0,!1,1));for(var o=-1,a=u.length;++o<a;){var s=u[o];i[s]=t[s]}}else e=n.createCallback(e,r,3),ai(t,function(t,n,r){e(t,n,r)||(i[n]=t)});return i}function Rn(t){for(var n=-1,e=ti(t),r=e.length,i=gr(r);++n<r;){var u=e[n];i[n]=[u,t[u]]}return i}function Vn(t,e,r){var i={};if("function"!=typeof e)for(var u=-1,o=Y(arguments,!0,!1,1),a=An(t)?o.length:0;++u<a;){var s=o[u];s in t&&(i[s]=t[s])}else e=n.createCallback(e,r,3),ai(t,function(t,n,r){e(t,n,r)&&(i[n]=t)});return i}function qn(t,e,r,i){var u=Qr(t);if(null==r)if(u)r=[];else{var o=t&&t.constructor,a=o&&o.prototype;r=d(a)}return e&&(e=n.createCallback(e,i,4),(u?Zn:si)(t,function(t,n,i){return e(r,t,n,i)})),r}function Fn(t){for(var n=-1,e=ti(t),r=e.length,i=gr(r);++n<r;)i[n]=t[e[n]];return i}function Mn(t){for(var n=arguments,e=-1,r=Y(n,!0,!1,1),i=n[2]&&n[2][n[1]]===t?1:r.length,u=gr(i);++e<i;)u[e]=t[r[e]];return u}function Un(t,n,e){var r=-1,i=cn(),u=t?t.length:0,o=!1;return e=(0>e?Mr(0,u+e):e)||0,Qr(t)?o=i(t,n,e)>-1:"number"==typeof u?o=(Bn(t)?t.indexOf(n,e):i(t,n,e))>-1:si(t,function(t){return++r>=e?!(o=t===n):void 0}),o}function Hn(t,e,r){var i=!0;e=n.createCallback(e,r,3);var u=-1,o=t?t.length:0;if("number"==typeof o)for(;++u<o&&(i=!!e(t[u],u,t)););else si(t,function(t,n,r){return i=!!e(t,n,r)});return i}function Jn(t,e,r){var i=[];e=n.createCallback(e,r,3);var u=-1,o=t?t.length:0;if("number"==typeof o)for(;++u<o;){var a=t[u];e(a,u,t)&&i.push(a)}else si(t,function(t,n,r){e(t,n,r)&&i.push(t)});return i}function Wn(t,e,r){e=n.createCallback(e,r,3);var i=-1,u=t?t.length:0;if("number"!=typeof u){var o;return si(t,function(t,n,r){return e(t,n,r)?(o=t,!1):void 0}),o}for(;++i<u;){var a=t[i];if(e(a,i,t))return a}}function Xn(t,e,r){var i;return e=n.createCallback(e,r,3),Qn(t,function(t,n,r){return e(t,n,r)?(i=t,!1):void 0}),i}function Zn(t,n,e){var r=-1,i=t?t.length:0;if(n=n&&"undefined"==typeof e?n:b(n,e,3),"number"==typeof i)for(;++r<i&&n(t[r],r,t)!==!1;);else si(t,n);return t}function Qn(t,n,e){var r=t?t.length:0;if(n=n&&"undefined"==typeof e?n:b(n,e,3),"number"==typeof r)for(;r--&&n(t[r],r,t)!==!1;);else{var i=ti(t);r=i.length,si(t,function(t,e,u){return e=i?i[--r]:--r,n(u[e],e,u)})}return t}function Yn(t,n){var e=y(arguments,2),r=-1,i="function"==typeof n,u=t?t.length:0,o=gr("number"==typeof u?u:0);return Zn(t,function(t){o[++r]=(i?n:t[n]).apply(t,e)}),o}function te(t,e,r){var i=-1,u=t?t.length:0;if(e=n.createCallback(e,r,3),"number"==typeof u)for(var o=gr(u);++i<u;)o[i]=e(t[i],i,t);else o=[],si(t,function(t,n,r){o[++i]=e(t,n,r)});return o}function ne(t,e,r){var i=-1/0,u=i;if("function"!=typeof e&&r&&r[e]===t&&(e=null),null==e&&Qr(t))for(var o=-1,s=t.length;++o<s;){var c=t[o];c>u&&(u=c)}else e=null==e&&Bn(t)?a:n.createCallback(e,r,3),Zn(t,function(t,n,r){var o=e(t,n,r);o>i&&(i=o,u=t)});return u}function ee(t,e,r){var i=1/0,u=i;if("function"!=typeof e&&r&&r[e]===t&&(e=null),null==e&&Qr(t))for(var o=-1,s=t.length;++o<s;){var c=t[o];u>c&&(u=c)}else e=null==e&&Bn(t)?a:n.createCallback(e,r,3),Zn(t,function(t,n,r){var o=e(t,n,r);i>o&&(i=o,u=t)});return u}function re(t,e,r,i){if(!t)return r;var u=arguments.length<3;e=n.createCallback(e,i,4);var o=-1,a=t.length;if("number"==typeof a)for(u&&(r=t[++o]);++o<a;)r=e(r,t[o],o,t);else si(t,function(t,n,i){r=u?(u=!1,t):e(r,t,n,i)});return r}function ie(t,e,r,i){var u=arguments.length<3;return e=n.createCallback(e,i,4),Qn(t,function(t,n,i){r=u?(u=!1,t):e(r,t,n,i)}),r}function ue(t,e,r){return e=n.createCallback(e,r,3),Jn(t,function(t,n,r){return!e(t,n,r)})}function oe(t,n,e){if(t&&"number"!=typeof t.length&&(t=Fn(t)),null==n||e)return t?t[en(0,t.length-1)]:m;var r=ae(t);return r.length=Ur(Mr(0,n),r.length),r}function ae(t){var n=-1,e=t?t.length:0,r=gr("number"==typeof e?e:0);return Zn(t,function(t){var e=en(0,++n);r[n]=r[e],r[e]=t}),r}function se(t){var n=t?t.length:0;return"number"==typeof n?n:ti(t).length}function ce(t,e,r){var i;e=n.createCallback(e,r,3);var u=-1,o=t?t.length:0;if("number"==typeof o)for(;++u<o&&!(i=e(t[u],u,t)););else si(t,function(t,n,r){return!(i=e(t,n,r))});return!!i}function pe(t,e,r){var i=-1,u=Qr(e),o=t?t.length:0,a=gr("number"==typeof o?o:0);for(u||(e=n.createCallback(e,r,3)),Zn(t,function(t,n,r){var o=a[++i]=l();u?o.criteria=te(e,function(n){return t[n]}):(o.criteria=f())[0]=e(t,n,r),o.index=i,o.value=t}),o=a.length,a.sort(s);o--;){var c=a[o];a[o]=c.value,u||h(c.criteria),g(c)}return a}function fe(t){return t&&"number"==typeof t.length?y(t):Fn(t)}function le(t){for(var n=-1,e=t?t.length:0,r=[];++n<e;){var i=t[n];i&&r.push(i)}return r}function he(t){return Z(t,Y(arguments,!0,!0,1))}function ge(t,e,r){var i=-1,u=t?t.length:0;for(e=n.createCallback(e,r,3);++i<u;)if(e(t[i],i,t))return i;return-1}function ye(t,e,r){var i=t?t.length:0;for(e=n.createCallback(e,r,3);i--;)if(e(t[i],i,t))return i;return-1}function ve(t,e,r){var i=0,u=t?t.length:0;if("number"!=typeof e&&null!=e){var o=-1;for(e=n.createCallback(e,r,3);++o<u&&e(t[o],o,t);)i++}else if(i=e,null==i||r)return t?t[0]:m;return y(t,0,Ur(Mr(0,i),u))}function me(t,n,e,r){return"boolean"!=typeof n&&null!=n&&(r=e,e="function"!=typeof n&&r&&r[n]===t?null:n,n=!1),null!=e&&(t=te(t,e,r)),Y(t,n)}function de(t,n,e){if("number"==typeof e){var r=t?t.length:0;e=0>e?Mr(0,r+e):e||0}else if(e){var u=Se(t,n);return t[u]===n?u:-1}return i(t,n,e)}function be(t,e,r){var i=0,u=t?t.length:0;if("number"!=typeof e&&null!=e){var o=u;for(e=n.createCallback(e,r,3);o--&&e(t[o],o,t);)i++}else i=null==e||r?1:e||i;return y(t,0,Ur(Mr(0,u-i),u))}function we(){for(var t=[],n=-1,e=arguments.length,r=f(),o=cn(),a=o===i,s=f();++n<e;){var p=arguments[n];(Qr(p)||hn(p))&&(t.push(p),r.push(a&&p.length>=x&&c(n?t[n]:s)))}var l=t[0],y=-1,v=l?l.length:0,m=[];t:for(;++y<v;){var d=r[0];if(p=l[y],(d?u(d,p):o(s,p))<0){for(n=e,(d||s).push(p);--n;)if(d=r[n],(d?u(d,p):o(t[n],p))<0)continue t;m.push(p)}}for(;e--;)d=r[e],d&&g(d);return h(r),h(s),m}function _e(t,e,r){var i=0,u=t?t.length:0;if("number"!=typeof e&&null!=e){var o=u;for(e=n.createCallback(e,r,3);o--&&e(t[o],o,t);)i++}else if(i=e,null==i||r)return t?t[u-1]:m;return y(t,Mr(0,u-i))}function xe(t,n,e){var r=t?t.length:0;for("number"==typeof e&&(r=(0>e?Mr(0,r+e):Ur(e,r-1))+1);r--;)if(t[r]===n)return r;return-1}function je(t){for(var n=arguments,e=0,r=n.length,i=t?t.length:0;++e<r;)for(var u=-1,o=n[e];++u<i;)t[u]===o&&(Dr.call(t,u--,1),i--);return t}function ke(t,n,e){t=+t||0,e="number"==typeof e?e:+e||1,null==n&&(n=t,t=0);for(var r=-1,i=Mr(0,Ir((n-t)/(e||1))),u=gr(i);++r<i;)u[r]=t,t+=e;return u}function Oe(t,e,r){var i=-1,u=t?t.length:0,o=[];for(e=n.createCallback(e,r,3);++i<u;){var a=t[i];e(a,i,t)&&(o.push(a),Dr.call(t,i--,1),u--)}return o}function Ne(t,e,r){if("number"!=typeof e&&null!=e){var i=0,u=-1,o=t?t.length:0;for(e=n.createCallback(e,r,3);++u<o&&e(t[u],u,t);)i++}else i=null==e||r?1:Mr(0,e);return y(t,i)}function Se(t,e,r,i){var u=0,o=t?t.length:u;for(r=r?n.createCallback(r,i,1):Qe,e=r(e);o>u;){var a=u+o>>>1;r(t[a])<e?u=a+1:o=a}return u}function Ee(){return un(Y(arguments,!0,!0))}function Ie(t,e,r,i){return"boolean"!=typeof e&&null!=e&&(i=r,r="function"!=typeof e&&i&&i[e]===t?null:e,e=!1),null!=r&&(r=n.createCallback(r,i,3)),un(t,e,r)}function Ce(t){return Z(t,y(arguments,1))}function Ae(){for(var t=-1,n=arguments.length;++t<n;){var e=arguments[t];if(Qr(e)||hn(e))var r=r?un(Z(r,e).concat(Z(e,r))):e}return r||[]}function Pe(){for(var t=arguments.length>1?arguments:arguments[0],n=-1,e=t?ne(hi(t,"length")):0,r=gr(0>e?0:e);++n<e;)r[n]=hi(t,n);return r}function Te(t,n){var e=-1,r=t?t.length:0,i={};for(n||!r||Qr(t[0])||(n=[]);++e<r;){var u=t[e];n?i[u]=n[e]:u&&(i[u[0]]=u[1])}return i}function Ge(t,n){if(!Cn(n))throw new jr;return function(){return--t<1?n.apply(this,arguments):void 0}}function ze(t,n){return arguments.length>2?an(t,17,y(arguments,2),null,n):an(t,1,null,null,n)}function Be(t){for(var n=arguments.length>1?Y(arguments,!0,!1,1):_n(t),e=-1,r=n.length;++e<r;){var i=n[e];t[i]=an(t[i],1,null,null,t)}return t}function De(t,n){return arguments.length>2?an(n,19,y(arguments,2),null,t):an(n,3,null,null,t)}function $e(){for(var t=arguments,n=t.length;n--;)if(!Cn(t[n]))throw new jr;return function(){for(var n=arguments,e=t.length;e--;)n=[t[e].apply(this,n)];return n[0]}}function Ke(t,n){return n="number"==typeof n?n:+n||t.length,an(t,4,null,null,null,n)}function Le(t,n,e){var r,i,u,o,a,s,c,p=0,f=!1,l=!0;if(!Cn(t))throw new jr;if(n=Mr(0,n)||0,e===!0){var h=!0;l=!1}else An(e)&&(h=e.leading,f="maxWait"in e&&(Mr(n,e.maxWait)||0),l="trailing"in e?e.trailing:l);var g=function(){var e=n-(yi()-o);if(0>=e){i&&Cr(i);var f=c;i=s=c=m,f&&(p=yi(),u=t.apply(a,r),s||i||(r=a=null))}else s=Br(g,e)},y=function(){s&&Cr(s),i=s=c=m,(l||f!==n)&&(p=yi(),u=t.apply(a,r),s||i||(r=a=null))};return function(){if(r=arguments,o=yi(),a=this,c=l&&(s||!h),f===!1)var e=h&&!s;else{i||h||(p=o);var v=f-(o-p),m=0>=v;m?(i&&(i=Cr(i)),p=o,u=t.apply(a,r)):i||(i=Br(y,v))}return m&&s?s=Cr(s):s||n===f||(s=Br(g,n)),e&&(m=!0,u=t.apply(a,r)),!m||s||i||(r=a=null),u}}function Re(t){if(!Cn(t))throw new jr;var n=y(arguments,1);return Br(function(){t.apply(m,n)},1)}function Ve(t,n){if(!Cn(t))throw new jr;var e=y(arguments,2);return Br(function(){t.apply(m,e)},n)}function qe(t,n){if(!Cn(t))throw new jr;var e=function(){var r=e.cache,i=n?n.apply(this,arguments):_+arguments[0];return Gr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return e.cache={},e}function Fe(t){var n,e;if(!Cn(t))throw new jr;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}function Me(t){return an(t,16,y(arguments,1))}function Ue(t){return an(t,32,null,y(arguments,1))}function He(t,n,e){var r=!0,i=!0;if(!Cn(t))throw new jr;return e===!1?r=!1:An(e)&&(r="leading"in e?e.leading:r,i="trailing"in e?e.trailing:i),J.leading=r,J.maxWait=n,J.trailing=i,Le(t,n,J)}function Je(t,n){return an(n,16,[t])}function We(t){return function(){return t}}function Xe(t,n,e){var r=typeof t;if(null==t||"function"==r)return b(t,n,e);if("object"!=r)return er(t);var i=ti(t),u=i[0],o=t[u];return 1!=i.length||o!==o||An(o)?function(n){for(var e=i.length,r=!1;e--&&(r=tn(n[i[e]],t[i[e]],null,!0)););return r}:function(t){var n=t[u];return o===n&&(0!==o||1/o==1/n)}}function Ze(t){return null==t?"":xr(t).replace(ii,sn)}function Qe(t){return t}function Ye(t,r,i){var u=!0,o=r&&_n(r);r&&(i||o.length)||(null==i&&(i=r),a=e,r=t,t=n,o=_n(r)),i===!1?u=!1:An(i)&&"chain"in i&&(u=i.chain);var a=t,s=Cn(a);Zn(o,function(n){var e=t[n]=r[n];s&&(a.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,i=[r];zr.apply(i,arguments);var o=e.apply(t,i);if(u||n){if(r===o&&An(o))return this;o=new a(o),o.__chain__=n}return o})})}function tr(){return t._=Nr,this}function nr(){}function er(t){return function(n){return n[t]}}function rr(t,n,e){var r=null==t,i=null==n;if(null==e&&("boolean"==typeof t&&i?(e=t,t=1):i||"boolean"!=typeof n||(e=n,i=!0)),r&&i&&(n=1),t=+t||0,i?(n=t,t=0):n=+n||0,e||t%1||n%1){var u=Jr();return Ur(t+u*(n-t+parseFloat("1e-"+((u+"").length-1))),n)}return en(t,n)}function ir(t,n){if(t){var e=t[n];return Cn(e)?t[n]():e}}function ur(t,e,r){var i=n.templateSettings;t=xr(t||""),r=oi({},r,i);var u,o=oi({},r.imports,i.imports),a=ti(o),s=Fn(o),c=0,f=r.interpolate||T,l="__p += '",h=_r((r.escape||T).source+"|"+f.source+"|"+(f===A?E:T).source+"|"+(r.evaluate||T).source+"|$","g");t.replace(h,function(n,e,r,i,o,a){return r||(r=i),l+=t.slice(c,a).replace(z,p),e&&(l+="' +\n__e("+e+") +\n'"),o&&(u=!0,l+="';\n"+o+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=a+n.length,n}),l+="';\n";var g=r.variable,y=g;y||(g="obj",l="with ("+g+") {\n"+l+"\n}\n"),l=(u?l.replace(O,""):l).replace(N,"$1").replace(S,"$1;"),l="function("+g+") {\n"+(y?"":g+" || ("+g+" = {});\n")+"var __t, __p = '', __e = _.escape"+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var v="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+D++ +"]")+"\n*/";try{var d=mr(a,"return "+l+v).apply(m,s)}catch(b){throw b.source=l,b}return e?d(e):(d.source=l,d)}function or(t,n,e){t=(t=+t)>-1?t:0;var r=-1,i=gr(t);for(n=b(n,e,1);++r<t;)i[r]=n(r);return i}function ar(t){return null==t?"":xr(t).replace(ri,ln)}function sr(t){var n=++w;return xr(null==t?"":t)+n}function cr(t){return t=new e(t),t.__chain__=!0,t}function pr(t,n){return n(t),t}function fr(){return this.__chain__=!0,this}function lr(){return xr(this.__wrapped__)}function hr(){return this.__wrapped__}t=t?rn.defaults(Q.Object(),t,rn.pick(Q,B)):Q;var gr=t.Array,yr=t.Boolean,vr=t.Date,mr=t.Function,dr=t.Math,br=t.Number,wr=t.Object,_r=t.RegExp,xr=t.String,jr=t.TypeError,kr=[],Or=wr.prototype,Nr=t._,Sr=Or.toString,Er=_r("^"+xr(Sr).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Ir=dr.ceil,Cr=t.clearTimeout,Ar=dr.floor,Pr=mr.prototype.toString,Tr=pn(Tr=wr.getPrototypeOf)&&Tr,Gr=Or.hasOwnProperty,zr=kr.push,Br=t.setTimeout,Dr=kr.splice,$r=kr.unshift,Kr=function(){try{var t={},n=pn(n=wr.defineProperty)&&n,e=n(t,t,t)&&n}catch(r){}return e}(),Lr=pn(Lr=wr.create)&&Lr,Rr=pn(Rr=gr.isArray)&&Rr,Vr=t.isFinite,qr=t.isNaN,Fr=pn(Fr=wr.keys)&&Fr,Mr=dr.max,Ur=dr.min,Hr=t.parseInt,Jr=dr.random,Wr={};Wr[K]=gr,Wr[L]=yr,Wr[R]=vr,Wr[V]=mr,Wr[F]=wr,Wr[q]=br,Wr[M]=_r,Wr[U]=xr,e.prototype=n.prototype;var Xr=n.support={};Xr.funcDecomp=!pn(t.WinRTError)&&G.test(v),Xr.funcNames="string"==typeof mr.name,n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:n}},Lr||(d=function(){function n(){}return function(e){if(An(e)){n.prototype=e;var r=new n;n.prototype=null}return r||t.Object()}}());var Zr=Kr?function(t,n){W.value=n,Kr(t,"__bindData__",W)}:nr,Qr=Rr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==K||!1},Yr=function(t){var n,e=t,r=[];if(!e)return r;if(!X[typeof t])return r;for(n in e)Gr.call(e,n)&&r.push(n);return r},ti=Fr?function(t){return An(t)?Fr(t):[]}:Yr,ni={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ei=jn(ni),ri=_r("("+ti(ei).join("|")+")","g"),ii=_r("["+ti(ni).join("")+"]","g"),ui=function(t,n,e){var r,i=t,u=i;
if(!i)return u;var o=arguments,a=0,s="number"==typeof e?2:o.length;if(s>3&&"function"==typeof o[s-2])var c=b(o[--s-1],o[s--],2);else s>2&&"function"==typeof o[s-1]&&(c=o[--s]);for(;++a<s;)if(i=o[a],i&&X[typeof i])for(var p=-1,f=X[typeof i]&&ti(i),l=f?f.length:0;++p<l;)r=f[p],u[r]=c?c(u[r],i[r]):i[r];return u},oi=function(t,n,e){var r,i=t,u=i;if(!i)return u;for(var o=arguments,a=0,s="number"==typeof e?2:o.length;++a<s;)if(i=o[a],i&&X[typeof i])for(var c=-1,p=X[typeof i]&&ti(i),f=p?p.length:0;++c<f;)r=p[c],"undefined"==typeof u[r]&&(u[r]=i[r]);return u},ai=function(t,n,e){var r,i=t,u=i;if(!i)return u;if(!X[typeof i])return u;n=n&&"undefined"==typeof e?n:b(n,e,3);for(r in i)if(n(i[r],r,t)===!1)return u;return u},si=function(t,n,e){var r,i=t,u=i;if(!i)return u;if(!X[typeof i])return u;n=n&&"undefined"==typeof e?n:b(n,e,3);for(var o=-1,a=X[typeof i]&&ti(i),s=a?a.length:0;++o<s;)if(r=a[o],n(i[r],r,t)===!1)return u;return u},ci=Tr?function(t){if(!t||Sr.call(t)!=F)return!1;var n=t.valueOf,e=pn(n)&&(e=Tr(n))&&Tr(e);return e?t==e||Tr(t)==e:fn(t)}:fn,pi=on(function(t,n,e){Gr.call(t,e)?t[e]++:t[e]=1}),fi=on(function(t,n,e){(Gr.call(t,e)?t[e]:t[e]=[]).push(n)}),li=on(function(t,n,e){t[e]=n}),hi=te,gi=Jn,yi=pn(yi=vr.now)&&yi||function(){return(new vr).getTime()},vi=8==Hr(k+"08")?Hr:function(t,n){return Hr(Bn(t)?t.replace(P,""):t,n||0)};return n.after=Ge,n.assign=ui,n.at=Mn,n.bind=ze,n.bindAll=Be,n.bindKey=De,n.chain=cr,n.compact=le,n.compose=$e,n.constant=We,n.countBy=pi,n.create=vn,n.createCallback=Xe,n.curry=Ke,n.debounce=Le,n.defaults=oi,n.defer=Re,n.delay=Ve,n.difference=he,n.filter=Jn,n.flatten=me,n.forEach=Zn,n.forEachRight=Qn,n.forIn=ai,n.forInRight=bn,n.forOwn=si,n.forOwnRight=wn,n.functions=_n,n.groupBy=fi,n.indexBy=li,n.initial=be,n.intersection=we,n.invert=jn,n.invoke=Yn,n.keys=ti,n.map=te,n.mapValues=$n,n.max=ne,n.memoize=qe,n.merge=Kn,n.min=ee,n.omit=Ln,n.once=Fe,n.pairs=Rn,n.partial=Me,n.partialRight=Ue,n.pick=Vn,n.pluck=hi,n.property=er,n.pull=je,n.range=ke,n.reject=ue,n.remove=Oe,n.rest=Ne,n.shuffle=ae,n.sortBy=pe,n.tap=pr,n.throttle=He,n.times=or,n.toArray=fe,n.transform=qn,n.union=Ee,n.uniq=Ie,n.values=Fn,n.where=gi,n.without=Ce,n.wrap=Je,n.xor=Ae,n.zip=Pe,n.zipObject=Te,n.collect=te,n.drop=Ne,n.each=Zn,n.eachRight=Qn,n.extend=ui,n.methods=_n,n.object=Te,n.select=Jn,n.tail=Ne,n.unique=Ie,n.unzip=Pe,Ye(n),n.clone=gn,n.cloneDeep=yn,n.contains=Un,n.escape=Ze,n.every=Hn,n.find=Wn,n.findIndex=ge,n.findKey=mn,n.findLast=Xn,n.findLastIndex=ye,n.findLastKey=dn,n.has=xn,n.identity=Qe,n.indexOf=de,n.isArguments=hn,n.isArray=Qr,n.isBoolean=kn,n.isDate=On,n.isElement=Nn,n.isEmpty=Sn,n.isEqual=En,n.isFinite=In,n.isFunction=Cn,n.isNaN=Pn,n.isNull=Tn,n.isNumber=Gn,n.isObject=An,n.isPlainObject=ci,n.isRegExp=zn,n.isString=Bn,n.isUndefined=Dn,n.lastIndexOf=xe,n.mixin=Ye,n.noConflict=tr,n.noop=nr,n.now=yi,n.parseInt=vi,n.random=rr,n.reduce=re,n.reduceRight=ie,n.result=ir,n.runInContext=v,n.size=se,n.some=ce,n.sortedIndex=Se,n.template=ur,n.unescape=ar,n.uniqueId=sr,n.all=Hn,n.any=ce,n.detect=Wn,n.findWhere=Wn,n.foldl=re,n.foldr=ie,n.include=Un,n.inject=re,Ye(function(){var t={};return si(n,function(e,r){n.prototype[r]||(t[r]=e)}),t}(),!1),n.first=ve,n.last=_e,n.sample=oe,n.take=ve,n.head=ve,si(n,function(t,r){var i="sample"!==r;n.prototype[r]||(n.prototype[r]=function(n,r){var u=this.__chain__,o=t(this.__wrapped__,n,r);return u||null!=n&&(!r||i&&"function"==typeof n)?new e(o,u):o})}),n.VERSION="2.4.1",n.prototype.chain=fr,n.prototype.toString=lr,n.prototype.value=hr,n.prototype.valueOf=hr,Zn(["join","pop","shift"],function(t){var r=kr[t];n.prototype[t]=function(){var t=this.__chain__,n=r.apply(this.__wrapped__,arguments);return t?new e(n,t):n}}),Zn(["push","reverse","sort","unshift"],function(t){var e=kr[t];n.prototype[t]=function(){return e.apply(this.__wrapped__,arguments),this}}),Zn(["concat","slice","splice"],function(t){var r=kr[t];n.prototype[t]=function(){return new e(r.apply(this.__wrapped__,arguments),this.__chain__)}}),n}var m,d=[],b=[],w=0,_=+new Date+"",x=75,j=40,k=" \f \n\r\u2028\u2029 ᠎              ",O=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,S=/(__e\(.*?\)|\b__t\)) \+\n'';/g,E=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,I=/\w*$/,C=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,P=RegExp("^["+k+"]*0+(?=.$)"),T=/($^)/,G=/\bthis\b/,z=/['\n\r\t\u2028\u2029\\]/g,B=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],D=0,$="[object Arguments]",K="[object Array]",L="[object Boolean]",R="[object Date]",V="[object Function]",q="[object Number]",F="[object Object]",M="[object RegExp]",U="[object String]",H={};H[V]=!1,H[$]=H[K]=H[L]=H[R]=H[q]=H[F]=H[M]=H[U]=!0;var J={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},X={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},Q=X[typeof window]&&window||this,Y=X[typeof r]&&r&&!r.nodeType&&r,tn=X[typeof e]&&e&&!e.nodeType&&e,nn=tn&&tn.exports===Y&&Y,en=X[typeof n]&&n;!en||en.global!==en&&en.window!==en||(Q=en);var rn=v();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(Q._=rn,t(function(){return rn})):Y&&tn?nn?(tn.exports=rn)._=rn:Y._=rn:Q._=rn}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(t,n){"use strict";function e(t){this.value=t}var r=t("lodash"),i=function(t,n,e,u){var o,a,s=JSON.stringify(e);return t&&(t+=","),"undefined"==typeof n&&(n=null),o=r.isObject(n)?"["+r.reduce(n,i,"")+"]":JSON.stringify(n),a=r.isObject(u)&&!r.isArray(u)?s+":"+o:o,t+=a};e.prototype.stringify=function(){var t=i("",this.value,null,null);return t},e.prototype.toGroovy=function(){return this.parse()},e.prototype.parse=function(){var t=this.value;if(null===t)return"null";if(this.isClassReference())return t.toString();if(this.isFloat())return this.value;if(r.isString(t)&&this.isFloat())return"'"+t+"'";if(r.isArray(t)){var n=r.map(t,function(t){return r.isString(t)?"'"+t+"'":t});return n.toString()}return r.isBoolean(t)?t.toString():"'"+t+"'"},e.prototype.isFloat=function(){return!r.isNaN(parseFloat(this.value))&&"f"===this.value.slice(-1)},e.prototype.isClassReference=function(){var t=/^T\.(gt|gte|eq|neq|lte|lt|decr|incr|notin|in)$|^Contains\.(IN|NOT_IN)$|^g\.|^Vertex(\.class)$|^Edge(\.class)$|^String(\.class)$|^Integer(\.class)$|^Geoshape(\.class)$|^Direction\.(OUT|IN|BOTH)$|^TitanKey(\.class)$|^TitanLabel(\.class)$/;return r.isString(this.value)&&t.test(this.value)},n.exports=e},{lodash:6}],8:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./argument");r(e,i),e.prototype.toGroovy=function(){return"["+this.parse()+"]"},n.exports=e},{"./argument":7,util:5}],9:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./argument");r(e,i),e.prototype.toGroovy=function(){return this.value.toGroovy()},n.exports=e},{"./argument":7,util:5}],10:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./argument");r(e,i),e.prototype.toGroovy=function(){return this.value},n.exports=e},{"./argument":7,util:5}],11:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./argument");r(e,i),e.prototype.toGroovy=function(){return this.value},n.exports=e},{"./argument":7,util:5}],12:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./argument");r(e,i),e.prototype.toGroovy=function(){return this.stringify()},n.exports=e},{"./argument":7,util:5}],13:[function(t,n){"use strict";function e(t){this.value=t}n.exports=e},{}],14:[function(t,n){"use strict";var e=t("../objects/structure/vertex"),r=t("../objects/structure/edge"),i=t("./javaclass"),u={Vertex:e,Edge:r,Geoshape:new i("Geoshape"),String:new i("String"),Integer:new i("Integer"),T:{gt:"T.gt",gte:"T.gte",eq:"T.eq",neq:"T.neq",lte:"T.lte",lt:"T.lt",decr:"T.decr",incr:"T.incr",notin:"T.notin","in":"T.in"},Contains:{IN:"Contains.IN",NOT_IN:"Contains.NOT_IN"},Direction:{OUT:"Direction.OUT",IN:"Direction.IN",BOTH:"Direction.BOTH"},TitanKey:new i("TitanKey"),TitanLabel:new i("TitanLabel")};n.exports=u},{"../objects/structure/edge":33,"../objects/structure/vertex":36,"./javaclass":15}],15:[function(t,n){"use strict";function e(t){this.name=t}e.prototype.toGroovy=function(){return this.name+".class"},Object.defineProperty(e.prototype,"class",{get:function(){return this.toGroovy()}}),n.exports=e},{}],16:[function(t,n){"use strict";function e(){i.call(this,null,arguments[0])}var r=t("util").inherits,i=t("./method");r(e,i),e.prototype.toGroovy=function(){var t="["+this.arguments[0].toString()+"]";return t},n.exports=e},{"./method":26,util:5}],17:[function(t,n){"use strict";function e(){i.call(this,"addProperties",arguments[0])}var r=t("util").inherits,i=t("../function");r(e,i),e.prototype.run=function(t){var n,e=this.arguments;for(n in e)t[n]=e[n];return t},e.prototype.toGroovy=function(){return".addProperties("+this.stringifyArgument(this.arguments)+")"},n.exports=e},{"../function":22,util:5}],18:[function(t,n){"use strict";function e(){i.call(this,"addProperty",arguments[0])}var r=t("util").inherits,i=t("../function");r(e,i),e.prototype.run=function(t){var n=this.arguments.key,e=this.arguments.value;return t[n]=e,t},e.prototype.toGroovy=function(){var t=this.arguments.key,n=this.arguments.value;return".addProperty('"+t+"','"+n+"')"},n.exports=e},{"../function":22,util:5}],19:[function(t,n){"use strict";function e(){i.call(this,"getProperties",arguments[0])}var r=t("util").inherits,i=(t("lodash"),t("../function"));r(e,i),e.prototype.run=function(t){return t.properties},n.exports=e},{"../function":22,lodash:6,util:5}],20:[function(t,n){"use strict";function e(){i.call(this,"setProperties",arguments[0])}var r=t("util").inherits,i=t("../function");r(e,i),e.prototype.run=function(t){var n,e=this.arguments;for(n in e)t[n]=e[n];return t},e.prototype.toGroovy=function(){return".setProperties("+this.stringifyArgument(this.arguments)+")"},n.exports=e},{"../function":22,util:5}],21:[function(t,n){"use strict";function e(){i.call(this,"setProperty",arguments[0])}var r=t("util").inherits,i=t("../function");r(e,i),e.prototype.run=function(t){var n=this.arguments.key,e=this.arguments.value;return t.properties[n]=e,t},e.prototype.toGroovy=function(){var t=this.arguments.key,n=this.arguments.value;return".setProperty('"+t+"','"+n+"')"},n.exports=e},{"../function":22,util:5}],22:[function(t,n){"use strict";function e(t,n){u.call(this),this.name=t,this.arguments=n,this.closures=[],this.parenthesizedArguments=[],this.boundParameters={},this.buildArguments()}var r=t("util").inherits,i=t("lodash"),u=t("../objects/objectwrapper"),o=t("../boundparameter"),a=t("../arguments/argument"),s=t("../arguments/closure"),c=t("../arguments/object"),p=t("../arguments/array"),f=t("../arguments/class"),l=t("../arguments/number");r(e,u),e.prototype.getBoundParameters=function(){return this.boundParameters},e.prototype.toGroovy=function(t){return this.name+this.generateArgumentString(t)},e.prototype.generateArgumentString=function(t){var n="("+i.map(this.parenthesizedArguments,function(n){return this.processArgument(n,t)},this).join(",")+")";return n+=i.map(this.closures,function(t){return t.toGroovy()}).join(",")},e.prototype.processArgument=function(t,n){if(!i.isUndefined(t)&&!i.isEmpty(t)){if(t instanceof o){var e=n.addBoundParam(t.value);return e.identifier}return t instanceof u?t.toGroovy():(t instanceof a==!1&&(t=new c(t)),t.toGroovy())}},e.prototype.buildArguments=function(){var t;i.each(this.arguments,function(n){n instanceof o?this.parenthesizedArguments.push(n):n instanceof u?this.parenthesizedArguments.push(n):this.isClosure(n)?(t=new s(n),this.closures.push(t)):i.isArray(n)?(t=new p(n),this.parenthesizedArguments.push(t)):this.isClass(n)?(t=new f(n),this.parenthesizedArguments.push(t)):!i.isObject(n)||n instanceof o?i.isNumber(n)?(t=new l(n),this.parenthesizedArguments.push(t)):(t=new a(n),this.parenthesizedArguments.push(t)):(t=new c(n),this.parenthesizedArguments.push(t))},this)},e.prototype.isClosure=function(t){var n=/^\{.*\}$/;return i.isString(t)&&n.test(t)},e.prototype.isClass=function(t){return t&&!!t.class};var h=function(t,n,e,r){var u,o,a=JSON.stringify(e);return t&&(t+=","),"undefined"==typeof n&&(n=null),u=i.isObject(n)?"["+i.reduce(n,h,"")+"]":JSON.stringify(n),o=i.isObject(r)&&!i.isArray(r)?a+":"+u:u,t+=o};e.prototype.stringifyArgument=function(t){var n=h("",t,null,null);return n},n.exports=e},{"../arguments/argument":7,"../arguments/array":8,"../arguments/class":9,"../arguments/closure":10,"../arguments/number":11,"../arguments/object":12,"../boundparameter":13,"../objects/objectwrapper":31,lodash:6,util:5}],23:[function(t,n){"use strict";function e(t,n){this.edge=t,u.call(this,"addEdge",n)}var r=t("util").inherits,i=t("lodash"),u=t("../method");r(e,u),e.prototype.run=function(){this.arguments.properties&&this.arguments.properties._id&&(this.edge._id=this.arguments.properties._id),this.edge._outV=this.arguments.v1,this.edge._inV=this.arguments.v2,this.edge._label=this.arguments.label;var t=this.arguments.properties;return i.each(t,function(t,n){this.edge[n]=t},this),delete this.arguments._id,this.edge},e.prototype.generateArgumentString=function(t){var n=this.edge._id?this.edge._id+",":"",e=this.arguments.properties,r=i.isEmpty(e)?"":","+this.processArgument(this.arguments.properties,t),u=this.edge._outV.identifier||this.arguments.v1,o=this.edge._inV.identifier||this.arguments.v2;return"("+n+u+","+o+",'"+this.edge._label+"'"+r+")"},n.exports=e},{"../method":26,lodash:6,util:5}],24:[function(t,n){"use strict";function e(t,n){this.vertex=t,o.call(this,"addVertex",n)}var r=t("util").inherits,i=t("lodash"),u=t("../../arguments/object"),o=t("../method");r(e,o),e.prototype.run=function(){return i.each(this.arguments,function(t,n){this.vertex.properties[n]=t},this),this.vertex},e.prototype.generateArgumentString=function(t){var n=[];return this.arguments&&this.arguments._id&&(n.push(new u(this.arguments._id)),delete this.arguments._id),n.push(this.arguments),this.parenthesizedArguments=n,o.prototype.generateArgumentString.call(this,t)},n.exports=e},{"../../arguments/object":12,"../method":26,lodash:6,util:5}],25:[function(t,n){"use strict";function e(){i.call(this,"idx",arguments[0])}var r=t("util").inherits,i=t("../function");r(e,i),e.prototype.toGroovy=function(){var t=".idx('"+this.arguments[0]+"')",n=this.arguments[1];if(n){var e=[];for(var r in n)e.push(r+":'"+n[r]+"'");t+="[["+e.join(",")+"]]"}return t},n.exports=e},{"../function":22,util:5}],26:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./function");r(e,i),e.prototype.toGroovy=function(t){return"."+i.prototype.toGroovy.call(this,t)},n.exports=e},{"./function":22,util:5}],27:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("./function");r(e,i),e.prototype.toGroovy=function(){return"."+this.name},n.exports=e},{"./function":22,util:5}],28:[function(t,n){"use strict";function e(){u.apply(this,arguments)}var r=t("util").inherits,i=t("lodash"),u=t("./step");r(e,u),e.prototype.toGroovy=function(){var t="."+this.name,n=this.arguments,e=n[0];if(i.isArray(e)){var r=i.map(e,function(t){return t.toGroovy()}).join(",");t+="(["+r+"])"}else t+="('"+this.arguments[0]+"')";return t},n.exports=e},{"./step":29,lodash:6,util:5}],29:[function(t,n){"use strict";function e(){i.apply(this,arguments)}var r=t("util").inherits,i=t("../method");r(e,i),n.exports=e},{"../method":26,util:5}],30:[function(t,n){"use strict";function e(){this.script="",this.params={},this.paramCount=0,this.identifierCount=0}var r=t("lodash"),i=t("util");e.prototype.appendLine=function(t){this.script+=t+"\n"},e.prototype.addBoundParams=function(t){var n,e=[];return r.each(t,function(t){n="p"+this.paramCount++,this.params[n]=t,e.push(n)},this),e},e.prototype.addBoundParam=function(t){var n="p"+this.paramCount++;return this.params[n]=t,{identifier:n,value:t}},e.prototype.handleString=function(t){var n=[t];n=n.concat(this.addBoundParams(r.rest(arguments))),this.appendLine(i.format.apply(i.format,n))},e.prototype.handleHelper=function(t){var n=t.getScriptAndParams(this);return this.appendLine(n.script),t},e.prototype.var=function(t,n){n=n||"i"+this.identifierCount++,t.identifier=n;var e=n+"=",r=t.getScriptAndParams&&t.getScriptAndParams(this)||t;return this.line(e+r.script),t},e.prototype.line=function(t){arguments.length>1?this.handleString.apply(this,arguments):r.isString(t)?this.appendLine(t):t&&this.handleHelper(t)},e.prototype.getAppender=function(){function t(){return n.line.apply(n,arguments),n}var n=this;return t.var=e.prototype.var.bind(this),Object.defineProperty(t,"script",{get:function(){return n.script}}),Object.defineProperty(t,"params",{get:function(){return n.params}}),t},n.exports=e},{lodash:6,util:5}],31:[function(t,n){"use strict";function e(t){this.objectName=t,this.chain=[],this.identifier="",this.properties={}}e.prototype.toGroovy=function(t){return this.objectName+this.chain.map(function(n){return n.toGroovy(t)}).join("")},e.prototype.getScriptAndParams=function(t){var n=this.toGroovy(t),e=this.getBoundParameters(),r={script:n,params:e};return r},e.prototype.getBoundParameters=function(){var t=[];return this.chain.forEach(function(n){var e=n.getBoundParameters();t.push(e)}),t},e.prototype.asObject=function(){return this.properties},n.exports=e},{}],32:[function(t,n){"use strict";function e(t){s.call(this,t)}var r=t("util").inherits,i=t("../../functions/steps/step"),u=t("../../functions/collectionaccessor"),o=t("../../functions/steps/collectionstep"),a=t("../../functions/property"),s=t("../objectwrapper");r(e,s),e.prototype.both=function(){var t=new i("both",arguments);return this.chain.push(t),this},e.prototype.bothE=function(){var t=new i("bothE",arguments);return this.chain.push(t),this},e.prototype.bothV=function(){var t=new i("bothV",arguments);return this.chain.push(t),this},e.prototype.cap=function(){var t=new i("cap",arguments);return this.chain.push(t),this},e.prototype.gather=function(){var t=new i("gather",arguments);return this.chain.push(t),this},e.prototype.id=function(){var t=new i("id",arguments);return this.chain.push(t),this},e.prototype.in=function(){var t=new i("in",arguments);return this.chain.push(t),this},e.prototype.inE=function(){var t=new i("inE",arguments);return this.chain.push(t),this},e.prototype.inV=function(){var t=new i("inV",arguments);return this.chain.push(t),this},e.prototype.property=function(){var t=new i("property",arguments);return this.chain.push(t),this},e.prototype.label=function(){var t=new i("label",arguments);return this.chain.push(t),this},e.prototype.map=function(){var t=new i("map",arguments);return this.chain.push(t),this},e.prototype.memoize=function(){var t=new i("memoize",arguments);return this.chain.push(t),this},e.prototype.order=function(){var t=new i("order",arguments);return this.chain.push(t),this},e.prototype.out=function(){var t=new i("out",arguments);return this.chain.push(t),this},e.prototype.outE=function(){var t=new i("outE",arguments);return this.chain.push(t),this},e.prototype.outV=function(){var t=new i("outV",arguments);return this.chain.push(t),this},e.prototype.path=function(){var t=new i("path",arguments);return this.chain.push(t),this},e.prototype.scatter=function(){var t=new i("scatter",arguments);return this.chain.push(t),this},e.prototype.select=function(){var t=new i("select",arguments);return this.chain.push(t),this},e.prototype.transform=function(){var t=new i("transform",arguments);return this.chain.push(t),this},e.prototype.orderMap=function(){var t=new i("orderMap",arguments);return this.chain.push(t),this},e.prototype.index=function(){var t=new u(arguments);return this.chain.push(t),this},e.prototype.range=function(){var t=new u(arguments);return this.chain.push(t),this},e.prototype.and=function(){var t=new i("and",arguments);return this.chain.push(t),this},e.prototype.back=function(){var t=new i("back",arguments);return this.chain.push(t),this},e.prototype.dedup=function(){var t=new i("dedup",arguments);return this.chain.push(t),this},e.prototype.except=function(){var t=new o("except",arguments);return this.chain.push(t),this},e.prototype.filter=function(){var t=new i("filter",arguments);return this.chain.push(t),this},e.prototype.has=function(){var t=new i("has",arguments);return this.chain.push(t),this},e.prototype.hasNot=function(){var t=new i("hasNot",arguments);return this.chain.push(t),this},e.prototype.interval=function(){var t=new i("interval",arguments);return this.chain.push(t),this},e.prototype.or=function(){var t=new i("or",arguments);return this.chain.push(t),this},e.prototype.random=function(){var t=new i("random",arguments);return this.chain.push(t),this},e.prototype.retain=function(){var t=new o("retain",arguments);return this.chain.push(t),this},e.prototype.simplePath=function(){var t=new i("simplePath",arguments);return this.chain.push(t),this},e.prototype.aggregate=function(){throw new Error("Not implemented.")},e.prototype.as=function(){var t=new i("as",arguments);return this.chain.push(t),this},e.prototype.groupBy=function(){var t=new i("groupBy",arguments);return this.chain.push(t),this},e.prototype.groupCount=function(){var t=new i("groupCount",arguments);return this.chain.push(t),this},e.prototype.optional=function(){var t=new i("optional",arguments);return this.chain.push(t),this},e.prototype.sideEffect=function(){var t=new i("sideEffect",arguments);return this.chain.push(t),this},e.prototype.linkBoth=function(){var t=new i("linkBoth",arguments);return this.chain.push(t),this},e.prototype.linkIn=function(){var t=new i("linkIn",arguments);return this.chain.push(t),this},e.prototype.linkOut=function(){var t=new i("linkOut",arguments);return this.chain.push(t),this},e.prototype.store=function(){throw new Error("Not implemented")},e.prototype.table=function(){throw new Error("Not implemented")},e.prototype.tree=function(){throw new Error("Not implemented")},e.prototype.copySplit=function(){var t=new i("copySplit",arguments);return this.chain.push(t),this},e.prototype.exhaustMerge=function(){var t=new i("exhaustMerge",arguments);return this.chain.push(t),this},e.prototype.fairMerge=function(){var t=new i("fairMerge",arguments);return this.chain.push(t),this},e.prototype.ifThenElse=function(){var t=new i("ifThenElse",arguments);return this.chain.push(t),this},e.prototype.loop=function(){var t=new i("loop",arguments);return this.chain.push(t),this},e.prototype.fill=function(){throw new Error("Not implemented")},e.prototype.count=function(){var t=new i("count",arguments);return this.chain.push(t),this},e.prototype.iterate=function(){var t=new i("iterate",arguments);return this.chain.push(t),this},e.prototype.next=function(){var t=new i("next",arguments);return this.chain.push(t),this},e.prototype.toList=function(){var t=new i("toList",arguments);return this.chain.push(t),this},e.prototype.keys=function(){var t=new i("keys",arguments);return this.chain.push(t),this},e.prototype.remove=function(){var t=new i("remove",arguments);return this.chain.push(t),this},e.prototype.values=function(){var t=new i("values",arguments);return this.chain.push(t),this},e.prototype.put=function(){var t=new i("put",arguments);return this.chain.push(t),this},e.prototype.getPropertyKeys=function(){var t=new i("getPropertyKeys",arguments);return this.chain.push(t),this},e.prototype.setProperty=function(){var t=new i("setProperty",arguments);return this.chain.push(t),this},e.prototype.getProperty=function(){var t=new i("getProperty",arguments);return this.chain.push(t),this},e.prototype.name=function(){var t=new i("name",arguments);return this.chain.push(t),this},e.prototype.dataType=function(){var t=new i("dataType",arguments);return this.chain.push(t),this},e.prototype.indexed=function(){var t=new i("indexed",arguments);return this.chain.push(t),this},e.prototype.unique=function(){var t=new i("unique",arguments);return this.chain.push(t),this},e.prototype.makePropertyKey=function(){var t=new i("makePropertyKey",arguments);return this.chain.push(t),this},e.prototype.group=function(){var t=new i("group",arguments);return this.chain.push(t),this},e.prototype.makeEdgeLabel=function(){var t=new i("makeEdgeLabel",arguments);return this.chain.push(t),this},e.prototype.query=function(){var t=new i("query",arguments);return this.chain.push(t),this},e.prototype.single=function(){var t=new i("single",arguments);return this.chain.push(t),this},e.prototype.list=function(){var t=new i("list",arguments);return this.chain.push(t),this},e.prototype.oneToMany=function(){var t=new i("oneToMany",arguments);return this.chain.push(t),this},e.prototype.manyToOne=function(){var t=new i("manyToOne",arguments);return this.chain.push(t),this},e.prototype.oneToOne=function(){var t=new i("oneToOne",arguments);return this.chain.push(t),this},e.prototype.makeKey=function(){var t=new i("makeKey",arguments);return this.chain.push(t),this},e.prototype.makeLabel=function(){var t=new i("makeLabel",arguments);return this.chain.push(t),this},e.prototype.make=function(){var t=new i("make",arguments);return this.chain.push(t),this},e.prototype.sortKey=function(){var t=new i("sortKey",arguments);return this.chain.push(t),this},e.prototype.signature=function(){var t=new i("signature",arguments);return this.chain.push(t),this},e.prototype.unidirected=function(){var t=new i("unidirected",arguments);return this.chain.push(t),this},e.prototype.createKeyIndex=function(){var t=new i("createKeyIndex",arguments);return this.chain.push(t),this},e.prototype.getIndexes=function(){var t=new i("getIndexes",arguments);return this.chain.push(t),this},e.prototype.hasIndex=function(){var t=new i("hasIndex",arguments);return this.chain.push(t),this},e.prototype.key=function(){var t=new a(arguments[0]);return this.chain.push(t),this},n.exports=e},{"../../functions/collectionaccessor":16,"../../functions/property":27,"../../functions/steps/collectionstep":28,"../../functions/steps/step":29,"../objectwrapper":31,util:5}],33:[function(t,n){"use strict";function e(){i.apply(this,arguments),this.properties._type="edge"}var r=t("util").inherits,i=t("./element");r(e,i),e.toGroovy=function(){return"Edge.class"},Object.defineProperty(e,"class",{get:function(){return this.toGroovy()}}),n.exports=e},{"./element":34,util:5}],34:[function(t,n){"use strict";function e(){p.apply(this,arguments),this.properties._id=null}var r=t("util").inherits,i=t("../../functions/element/getproperties"),u=t("../../functions/element/setproperties"),o=t("../../functions/element/addproperties"),a=t("../../functions/element/setproperty"),s=t("../../functions/element/addproperty"),c=t("../../functions/method"),p=t("../objectwrapper");r(e,p),e.prototype.getProperties=function(){var t=new i;return this.chain.push(t),t.run(this)},e.prototype.setProperty=function(t,n){var e=new a({key:t,value:n});return this.chain.push(e),e.run(this)},e.prototype.setProperties=function(t){var n=new u(t);return this.chain.push(n),n.run(this)},e.prototype.addProperty=function(t,n){var e=new s({key:t,value:n});return this.chain.push(e),e.run(this)},e.prototype.addProperties=function(t){var n=new o(t);return this.chain.push(n),n.run(this)},e.prototype.remove=function(){var t=new c("remove",[]);return this.chain.push(t),this},n.exports=e},{"../../functions/element/addproperties":17,"../../functions/element/addproperty":18,"../../functions/element/getproperties":19,"../../functions/element/setproperties":20,"../../functions/element/setproperty":21,"../../functions/method":26,"../objectwrapper":31,util:5}],35:[function(t,n){"use strict";function e(){c.apply(this,arguments)}var r=t("util").inherits,i=t("../../functions/method"),u=t("../../functions/graph/idx"),o=t("../../functions/graph/addvertex"),a=t("../../functions/graph/addedge"),s=t("../process/traversal"),c=t("../objectwrapper"),p=t("./vertex"),f=t("./edge");r(e,c),e.prototype.E=function(){var t=new i("E",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.V=function(){var t=new i("V",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.e=function(){var t=new i("e",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.idx=function(){var t=new u(arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.v=function(){var t=new i("v",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.createIndex=function(){var t=new i("createIndex",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.createKeyIndex=function(){var t=new i("createKeyIndex",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.getIndices=function(){var t=new i("getIndices",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.getIndexedKeys=function(){var t=new i("getIndexedKeys",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.getIndex=function(){var t=new i("getIndex",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.dropIndex=function(){var t=new i("dropIndex",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.dropKeyIndex=function(){var t=new i("dropKeyIndex",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.makeKey=function(){var t=new i("makeKey",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.clear=function(){var t=new i("clear",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.shutdown=function(){var t=new i("shutdown",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.getFeatures=function(){var t=new i("getFeatures",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.getTypes=function(){var t=new i("getTypes",arguments),n=new s(this.objectName);return n.chain.push(t),n},e.prototype.addVertex=function(t){var n=new p("g"),e=new o(n,t);return e.run(),n.chain.push(e),n},e.prototype.addEdge=function(t,n,e,r){var i={v1:t,v2:n,label:e,properties:r},u=new f("g"),o=new a(u,i);return o.run(),u.chain.push(o),u},n.exports=e},{"../../functions/graph/addedge":23,"../../functions/graph/addvertex":24,"../../functions/graph/idx":25,"../../functions/method":26,"../objectwrapper":31,"../process/traversal":32,"./edge":33,"./vertex":36,util:5}],36:[function(t,n){"use strict";function e(){i.apply(this,arguments),this.properties._type="vertex"}var r=t("util").inherits,i=t("./element");r(e,i),e.toGroovy=function(){return"Vertex.class"},Object.defineProperty(e,"class",{get:function(){return this.toGroovy()}}),n.exports=e},{"./element":34,util:5}]},{},[1])(1)});

@@ -0,1 +1,5 @@

'use strict';
var BoundParameter = require('./src/boundparameter');
module.exports = {

@@ -10,3 +14,6 @@ GremlinScript: require('./src/gremlinscript'),

Traversal: require('./src/objects/process/traversal'),
},
bindParameter: function(value) {
return new BoundParameter(value);
}
};
};
{
"name": "gremlin-script",
"version": "1.0.2",
"version": "1.1.0",
"description": "Generate Gremlin scripts with ease",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -67,3 +67,3 @@ gremlin-script

#### Adding a line with Graph and Element helpers
#### Adding a line with Graph and Element (Vertex/Edge) helpers

@@ -78,4 +78,22 @@ ```javascript

Binding parameters is currently not supported when using helpers.
#### Bound parameters when using helpers
Using the `bindParameter()` function flags the argument passed to a function as a `BoundParameter`. When generating the string, Gremlin-Script will automatically replace such wrapped argument with an automatically generated variable name and push the argument to the `gremlin.params` Array.
```javascript
var bind = require('gremlin-script').bindParameter;
var gremlin = new GremlinScript();
var g = new Graph('g');
var v1 = gremlin.var(g.addVertex(bind({ name: 'Alice' })), 'v1');
var v2 = gremlin.var(g.addVertex(bind({ name: 'Bob' })), 'v2');
gremlin.line(g.addEdge(v1, v2, 'knows', bind({ foo: 'bar' })));
gremlin.script.should.equal("v1=g.addVertex(p0)\nv2=g.addVertex(p1)\ng.addEdge(v1,v2,'knows',p2)\n");
gremlin.params.p0.name.should.equal('Alice');
gremlin.params.p1.name.should.equal('Bob');
gremlin.params.p2.foo.should.equal('bar');
```
## Author

@@ -82,0 +100,0 @@

@@ -5,7 +5,39 @@ 'use strict';

function Argument(value, func) {
function Argument(value) {
this.value = value;
this.func = func;
}
var stringify = function(accumulated, value, key, obj) {
var newVal;
var newKey = JSON.stringify(key);
var newEntry;
if (accumulated) {
accumulated += ',';
}
if (typeof value === 'undefined') {
value = null;
}
if (_.isObject(value)) {
newVal = '[' + _.reduce(value, stringify, '') + ']' ;
} else {
newVal = JSON.stringify(value);
}
if (_.isObject(obj) && !_.isArray(obj)) {
newEntry = newKey + ':' + newVal;
} else {
newEntry = newVal;
}
return accumulated += newEntry;
};
Argument.prototype.stringify = function() {
var string = stringify('', this.value, null, null);
return string;
};
Argument.prototype.toGroovy = function() {

@@ -12,0 +44,0 @@ return this.parse();

@@ -13,5 +13,5 @@ 'use strict';

ObjectArgument.prototype.toGroovy = function() {
return JSON.stringify(this.value).replace('{', '[').replace('}', ']');
return this.stringify();
};
module.exports = ObjectArgument;
'use strict';
var inherits = require('util').inherits;
var _ = require('lodash');
var ObjectWrapper = require('../objects/objectwrapper');
var BoundParameter = require('../boundparameter');
var Argument = require('../arguments/argument');

@@ -13,2 +17,4 @@ var ClosureArgument = require('../arguments/closure');

function GremlinFunction(name, args) {
ObjectWrapper.call(this);
this.name = name;

@@ -18,18 +24,21 @@ this.arguments = args;

this.parenthesizedArguments = [];
this.boundParameters = {};
this.buildArguments();
}
GremlinFunction.prototype.toGroovy = function() {
return this.name + this.groovifyArguments();
inherits(GremlinFunction, ObjectWrapper);
GremlinFunction.prototype.getBoundParameters = function() {
return this.boundParameters;
};
GremlinFunction.prototype.groovifyArguments = function() {
var args = [];
GremlinFunction.prototype.toGroovy = function(gremlinScript) {
return this.name + this.generateArgumentString(gremlinScript);
};
// Append arguments between parentheses, if any
GremlinFunction.prototype.generateArgumentString = function(gremlinScript) {
var groovy = '(' + _.map(this.parenthesizedArguments, function(argument) {
return argument.toGroovy();
}).join(',') + ')';
return this.processArgument(argument, gremlinScript);
}, this).join(',') + ')';
// Append closures, if any
groovy += _.map(this.closures, function(closure) {

@@ -42,22 +51,47 @@ return closure.toGroovy();

GremlinFunction.prototype.processArgument = function(argument, gremlinScript) {
if (_.isUndefined(argument) || _.isEmpty(argument)) {
return;
}
if (argument instanceof BoundParameter) {
var bp = gremlinScript.addBoundParam(argument.value);
return bp.identifier;
}
if (argument instanceof ObjectWrapper) {
return argument.toGroovy();
}
if (argument instanceof Argument === false) {
argument = new ObjectArgument(argument);
}
return argument.toGroovy();
};
GremlinFunction.prototype.buildArguments = function() {
var built;
_.each(this.arguments, function(argument) {
if (this.isClosure(argument)) {
built = new ClosureArgument(argument, this);
if (argument instanceof BoundParameter) {
this.parenthesizedArguments.push(argument);
} else if (argument instanceof ObjectWrapper) {
this.parenthesizedArguments.push(argument);
} else if (this.isClosure(argument)) {
built = new ClosureArgument(argument);
this.closures.push(built);
} else if (_.isArray(argument)) {
built = new ArrayArgument(argument, this);
built = new ArrayArgument(argument);
this.parenthesizedArguments.push(built);
} else if (this.isClass(argument)) {
built = new ClassArgument(argument, this);
built = new ClassArgument(argument);
this.parenthesizedArguments.push(built);
} else if (_.isObject(argument)) {
built = new ObjectArgument(argument, this);
} else if (_.isObject(argument) && !(argument instanceof BoundParameter)) {
built = new ObjectArgument(argument);
this.parenthesizedArguments.push(built);
} else if (_.isNumber(argument)) {
built = new NumberArgument(argument, this);
built = new NumberArgument(argument);
this.parenthesizedArguments.push(built);
} else {
built = new Argument(argument, this);
built = new Argument(argument);
this.parenthesizedArguments.push(built);

@@ -64,0 +98,0 @@ }

@@ -36,7 +36,7 @@ 'use strict';

AddEdgeMethod.prototype.groovifyArguments = function() {
AddEdgeMethod.prototype.generateArgumentString = function(gremlinScript) {
var id = this.edge._id ? this.edge._id + ',' : '';
var properties = this.arguments.properties;
var propArgument = !_.isEmpty(properties) ? ','+ this.stringifyArgument(this.arguments.properties) : '';
var propArgument = _.isEmpty(properties) ? '': ',' + this.processArgument(this.arguments.properties, gremlinScript);

@@ -46,5 +46,5 @@ var _outV = this.edge._outV.identifier || this.arguments.v1;

return '('+ id + _outV +','+ _inV +',"'+ this.edge._label +'"'+ propArgument + ')';
return '('+ id + _outV +','+ _inV +',\''+ this.edge._label +'\''+ propArgument + ')';
};
module.exports = AddEdgeMethod;

@@ -6,2 +6,3 @@ 'use strict';

var Argument = require('../../arguments/object');
var GremlinMethod = require('../method');

@@ -25,18 +26,17 @@

AddVertexMethod.prototype.groovifyArguments = function() {
AddVertexMethod.prototype.generateArgumentString = function(gremlinScript) {
var args = [];
var id = this.vertex._id ? this.vertex._id +',' : '';
if (this.arguments && this.arguments._id) {
args.push(this.arguments._id);
args.push(new Argument(this.arguments._id));
delete this.arguments._id;
}
if (!_.isEmpty(this.arguments)) {
args.push(this.stringifyArgument(this.arguments));
}
args.push(this.arguments);
return '('+ args.join(',') + ')';
this.parenthesizedArguments = args;
return GremlinMethod.prototype.generateArgumentString.call(this, gremlinScript);
};
module.exports = AddVertexMethod;

@@ -13,6 +13,6 @@ 'use strict';

GremlinMethod.prototype.toGroovy = function() {
return '.' + this.name + this.groovifyArguments();
GremlinMethod.prototype.toGroovy = function(gremlinScript) {
return '.' + GremlinFunction.prototype.toGroovy.call(this, gremlinScript);
};
module.exports = GremlinMethod;

@@ -43,2 +43,12 @@ 'use strict';

GremlinScript.prototype.addBoundParam = function(boundParam) {
var identifier = 'p'+ this.paramCount++;
this.params[identifier] = boundParam;
return {
identifier: identifier,
value: boundParam
};
};
/**

@@ -65,3 +75,4 @@ * Handle a string statement using Node util.format() function.

GremlinScript.prototype.handleHelper = function(wrapper) {
this.appendLine(wrapper.toGroovy());
var scriptData = wrapper.getScriptAndParams(this);
this.appendLine(scriptData.script);

@@ -73,3 +84,3 @@ return wrapper;

* Identify a statement within the script with the provided optional
* identifier. Will assign an automatica identifier instead.
* identifier. Will assign an automatical identifier instead.
*

@@ -85,5 +96,5 @@ * @public

var groovyCode = wrapper.toGroovy ? wrapper.toGroovy() : wrapper;
var scriptData = wrapper.getScriptAndParams && wrapper.getScriptAndParams(this) || wrapper;
this.script += prefix + groovyCode + '\n';
this.line(prefix + scriptData.script);

@@ -90,0 +101,0 @@ return wrapper;

@@ -5,3 +5,3 @@ 'use strict';

this.objectName = objectName;
this.methods = [];
this.chain = [];
this.identifier = '';

@@ -11,6 +11,33 @@ this.properties = {};

ObjectWrapper.prototype.toGroovy = function() {
return this.objectName + this.methods.join('');
ObjectWrapper.prototype.toGroovy = function(gremlinScript) {
return this.objectName + this.chain
.map(function(chained) {
return chained.toGroovy(gremlinScript);
})
.join('');
};
ObjectWrapper.prototype.getScriptAndParams = function(gremlinScript) {
var script = this.toGroovy(gremlinScript);
var params = this.getBoundParameters();
var scriptData = {
script: script,
params: params
};
return scriptData;
};
ObjectWrapper.prototype.getBoundParameters = function() {
var boundParameters = [];
this.chain.forEach(function(chained) {
var bounds = chained.getBoundParameters();
boundParameters.push(bounds);
});
return boundParameters;
};
ObjectWrapper.prototype.asObject = function() {

@@ -17,0 +44,0 @@ return this.properties;

@@ -7,4 +7,3 @@ 'use strict';

var CollectionStep = require('../../functions/steps/collectionstep');
var PipesStep = require('../../functions/steps/pipesstep');
var SelectStep = require('../../functions/steps/select');
var GremlinProperty = require('../../functions/property');
var ObjectWrapper = require('../objectwrapper');

@@ -21,3 +20,3 @@

var step = new GremlinStep('both', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -29,3 +28,3 @@ return this;

var step = new GremlinStep('bothE', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -37,3 +36,3 @@ return this;

var step = new GremlinStep('bothV', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -45,3 +44,3 @@ return this;

var step = new GremlinStep('cap', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -53,3 +52,3 @@ return this;

var step = new GremlinStep('gather', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -61,3 +60,3 @@ return this;

var step = new GremlinStep('id', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -69,3 +68,3 @@ return this;

var step = new GremlinStep('in', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -77,3 +76,3 @@ return this;

var step = new GremlinStep('inE', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -85,3 +84,3 @@ return this;

var step = new GremlinStep('inV', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -93,3 +92,3 @@ return this;

var step = new GremlinStep('property', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -101,3 +100,3 @@ return this;

var step = new GremlinStep('label', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -109,3 +108,3 @@ return this;

var step = new GremlinStep('map', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -117,3 +116,3 @@ return this;

var step = new GremlinStep('memoize', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -125,3 +124,3 @@ return this;

var step = new GremlinStep('order', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -133,3 +132,3 @@ return this;

var step = new GremlinStep('out', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -141,3 +140,3 @@ return this;

var step = new GremlinStep('outE', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -149,3 +148,3 @@ return this;

var step = new GremlinStep('outV', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -157,3 +156,3 @@ return this;

var step = new GremlinStep('path', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -165,3 +164,3 @@ return this;

var step = new GremlinStep('scatter', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -172,4 +171,4 @@ return this;

Traversal.prototype.select = function() {
var step = new SelectStep(arguments);
this.methods.push(step.toGroovy());
var step = new GremlinStep('select', arguments);
this.chain.push(step);

@@ -181,3 +180,3 @@ return this;

var step = new GremlinStep('transform', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -189,3 +188,3 @@ return this;

var step = new GremlinStep('orderMap', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -199,3 +198,3 @@ return this;

var step = new CollectionAccessor(arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -208,3 +207,3 @@ return this;

var step = new CollectionAccessor(arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -215,4 +214,4 @@ return this;

Traversal.prototype.and = function() {
var step = new PipesStep('and', arguments);
this.methods.push(step.toGroovy());
var step = new GremlinStep('and', arguments);
this.chain.push(step);

@@ -224,3 +223,3 @@ return this;

var step = new GremlinStep('back', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -232,3 +231,3 @@ return this;

var step = new GremlinStep('dedup', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -240,3 +239,3 @@ return this;

var step = new CollectionStep('except', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -248,3 +247,3 @@ return this;

var step = new GremlinStep('filter', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -256,3 +255,3 @@ return this;

var step = new GremlinStep('has', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -264,3 +263,3 @@ return this;

var step = new GremlinStep('hasNot', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -272,3 +271,3 @@ return this;

var step = new GremlinStep('interval', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -279,4 +278,4 @@ return this;

Traversal.prototype.or = function() {
var step = new PipesStep('or', arguments);
this.methods.push(step.toGroovy());
var step = new GremlinStep('or', arguments);
this.chain.push(step);

@@ -288,3 +287,3 @@ return this;

var step = new GremlinStep('random', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -296,3 +295,3 @@ return this;

var step = new CollectionStep('retain', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -304,3 +303,3 @@ return this;

var step = new GremlinStep('simplePath', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -317,3 +316,3 @@ return this;

var step = new GremlinStep('as', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -325,3 +324,3 @@ return this;

var step = new GremlinStep('groupBy', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -334,3 +333,3 @@ return this;

var step = new GremlinStep('groupCount', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -342,3 +341,3 @@ return this;

var step = new GremlinStep('optional', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -350,3 +349,3 @@ return this;

var step = new GremlinStep('sideEffect', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -358,3 +357,3 @@ return this;

var step = new GremlinStep('linkBoth', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -366,3 +365,3 @@ return this;

var step = new GremlinStep('linkIn', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -374,3 +373,3 @@ return this;

var step = new GremlinStep('linkOut', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -394,4 +393,4 @@ return this;

Traversal.prototype.copySplit = function() {
var step = new PipesStep('copySplit', arguments);
this.methods.push(step.toGroovy());
var step = new GremlinStep('copySplit', arguments);
this.chain.push(step);

@@ -402,3 +401,3 @@ return this;

var step = new GremlinStep('exhaustMerge', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -410,3 +409,3 @@ return this;

var step = new GremlinStep('fairMerge', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -419,3 +418,3 @@ return this;

var step = new GremlinStep('ifThenElse', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -427,3 +426,3 @@ return this;

var step = new GremlinStep('loop', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -433,3 +432,3 @@ return this;

/*** Methods ***/
/*** chain ***/
Traversal.prototype.fill = function() {

@@ -441,3 +440,3 @@ throw new Error('Not implemented');

var step = new GremlinStep('count', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -449,3 +448,3 @@ return this;

var step = new GremlinStep('iterate', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -457,3 +456,3 @@ return this;

var step = new GremlinStep('next', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -465,3 +464,3 @@ return this;

var step = new GremlinStep('toList', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -473,3 +472,3 @@ return this;

var step = new GremlinStep('keys', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -481,3 +480,3 @@ return this;

var step = new GremlinStep('remove', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -489,3 +488,3 @@ return this;

var step = new GremlinStep('values', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -496,4 +495,4 @@ return this;

Traversal.prototype.put = function() {
var step = new PipesStep('put', arguments);
this.methods.push(step.toGroovy());
var step = new GremlinStep('put', arguments);
this.chain.push(step);

@@ -505,3 +504,3 @@ return this;

var step = new GremlinStep('getPropertyKeys', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -513,3 +512,3 @@ return this;

var step = new GremlinStep('setProperty', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -521,3 +520,3 @@ return this;

var step = new GremlinStep('getProperty', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -530,3 +529,3 @@ return this;

var step = new GremlinStep('name', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -538,3 +537,3 @@ return this;

var step = new GremlinStep('dataType', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -546,3 +545,3 @@ return this;

var step = new GremlinStep('indexed', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -554,3 +553,3 @@ return this;

var step = new GremlinStep('unique', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -562,3 +561,3 @@ return this;

var step = new GremlinStep('makePropertyKey', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -570,3 +569,3 @@ return this;

var step = new GremlinStep('group', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -578,3 +577,3 @@ return this;

var step = new GremlinStep('makeEdgeLabel', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -586,3 +585,3 @@ return this;

var step = new GremlinStep('query', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -595,3 +594,3 @@ return this;

var step = new GremlinStep('single', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -604,3 +603,3 @@ return this;

var step = new GremlinStep('list', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -613,3 +612,3 @@ return this;

var step = new GremlinStep('oneToMany', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -622,3 +621,3 @@ return this;

var step = new GremlinStep('manyToOne', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -631,3 +630,3 @@ return this;

var step = new GremlinStep('oneToOne', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -640,3 +639,3 @@ return this;

var step = new GremlinStep('makeKey', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -649,3 +648,3 @@ return this;

var step = new GremlinStep('makeLabel', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -657,3 +656,3 @@ return this;

var step = new GremlinStep('make', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -665,3 +664,3 @@ return this;

var step = new GremlinStep('sortKey', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -673,3 +672,3 @@ return this;

var step = new GremlinStep('signature', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -681,3 +680,3 @@ return this;

var step = new GremlinStep('unidirected', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -689,3 +688,3 @@ return this;

var step = new GremlinStep('createKeyIndex', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -697,3 +696,3 @@ return this;

var step = new GremlinStep('getIndexes', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -705,3 +704,3 @@ return this;

var step = new GremlinStep('hasIndex', arguments);
this.methods.push(step.toGroovy());
this.chain.push(step);

@@ -712,3 +711,4 @@ return this;

Traversal.prototype.key = function() {
this.methods.push('.'+ arguments[0]);
var property = new GremlinProperty(arguments[0]);
this.chain.push(property);

@@ -715,0 +715,0 @@ return this;

@@ -25,3 +25,3 @@ 'use strict';

var method = new GetPropertiesMethod();
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -33,3 +33,3 @@ return method.run(this);

var method = new SetPropertyMethod({ key: key, value: value });
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -41,3 +41,3 @@ return method.run(this);

var method = new SetPropertiesMethod(properties);
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -58,3 +58,3 @@ return method.run(this);

var method = new AddPropertyMethod({ key: key, value: value });
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -74,3 +74,3 @@ return method.run(this);

var method = new AddPropertiesMethod(properties);
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -82,3 +82,3 @@ return method.run(this);

var method = new GremlinMethod('remove', []);
this.methods.push(method.toGroovy());
this.chain.push(method);

@@ -85,0 +85,0 @@ return this;

@@ -24,3 +24,3 @@ 'use strict';

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -34,3 +34,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -44,3 +44,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -54,3 +54,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -64,3 +64,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -75,3 +75,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -85,3 +85,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -95,3 +95,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -105,3 +105,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -115,3 +115,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -125,3 +125,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -135,3 +135,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -146,3 +146,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -156,3 +156,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -166,3 +166,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -176,3 +176,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -187,3 +187,3 @@ return traversal;

var traversal = new TraversalWrapper(this.objectName);
traversal.methods.push(func.toGroovy());
traversal.chain.push(func);

@@ -214,3 +214,3 @@ return traversal;

vertex.methods.push(method.toGroovy());
vertex.chain.push(method);

@@ -242,3 +242,3 @@ return vertex;

edge.methods.push(method.toGroovy());
edge.chain.push(method);

@@ -245,0 +245,0 @@ return edge;

'use strict';
var Argument = require('../src/arguments/argument');
var ArrayArgument = require('../src/arguments/array');
var ObjectArgument = require('../src/arguments/object');

@@ -10,5 +11,5 @@

it('should handle arrays', function() {
var arg = new Argument(['Foo', 'Bar']);
var arg = new Argument(['Foo', 2]);
arg.toGroovy().should.eql("'Foo','Bar'");
arg.toGroovy().should.eql("'Foo',2");
});

@@ -27,8 +28,29 @@

it('should return the appropriate string', function() {
var array = new ArrayArgument(['Foo', 'Bar']);
var array = new ArrayArgument(['Foo', 2]);
array.toGroovy().should.equal("['Foo','Bar']");
array.toGroovy().should.equal("['Foo',2]");
});
});
});
describe('ObjectArgument', function() {
describe('.toGroovy()', function() {
it('should handle nested objects', function () {
var arg = new ObjectArgument({ one: { two: 3 }});
arg.toGroovy().should.equal('["one":["two":3]]');
});
it('should handle curly braces in values', function () {
var arg = new ObjectArgument({ one: { left: '{', right: '}' }});
arg.toGroovy().should.equal('["one":["left":"{","right":"}"]]');
});
it('should handle undefined and null values as null', function () {
var arg = new ObjectArgument({ 'null': null, 'undefined': undefined });
arg.toGroovy().should.equal('["null":null,"undefined":null]');
});
});
});
});

@@ -20,3 +20,2 @@ 'use strict';

it('should return a vertex', function() {

@@ -33,3 +32,3 @@ vertex.should.be.an.instanceof(Vertex);

it('should generate Groovy script', function() {
var gremlin = (new GremlinScript().getAppender());
var gremlin = (new GremlinScript()).getAppender();
var query = gremlin(vertex);

@@ -56,3 +55,3 @@ query.script.should.equal('g.addVertex()\n');

it('should generate Groovy script', function() {
var gremlin = (new GremlinScript().getAppender());
var gremlin = (new GremlinScript()).getAppender();
var query = gremlin(vertex);

@@ -84,3 +83,3 @@

it('should generate Groovy script', function() {
var gremlin = (new GremlinScript().getAppender());
var gremlin = (new GremlinScript()).getAppender();
var query = gremlin(vertex);

@@ -113,3 +112,3 @@

it('should generate Groovy script', function() {
var gremlin = (new GremlinScript().getAppender());
var gremlin = (new GremlinScript()).getAppender();
var query = gremlin(vertex);

@@ -145,3 +144,3 @@

query.script.should.equal('g.addEdge(1,2,"knows")\n');
query.script.should.equal("g.addEdge(1,2,'knows')\n");
});

@@ -179,3 +178,3 @@ });

query.script.should.equal('g.addEdge(20,30,"knows",["since":"now"])\n');
query.script.should.equal("g.addEdge(20,30,'knows',[\"since\":\"now\"])\n");
});

@@ -182,0 +181,0 @@ });

'use strict';
var Graph = require('../').Structure.Graph;
var GremlinScript = require('../').GremlinScript;
var g;
var bind = require('../').bindParameter;

@@ -65,2 +65,52 @@

});
describe('Bound parameters with helpers', function() {
it('should handle a bound parameter', function() {
var gremlin = new GremlinScript();
var g = new Graph('g');
gremlin.line(g.v(bind(1)));
gremlin.script.should.equal('g.v(p0)\n');
gremlin.params.p0.should.equal(1);
});
it('should handle multiple bound parameters', function() {
var gremlin = new GremlinScript();
var g = new Graph('g');
gremlin.line(g.V('name', bind('Alice')).has('age', bind(28)));
gremlin.script.should.equal("g.V('name',p0).has('age',p1)\n");
gremlin.params.p0.should.equal('Alice');
gremlin.params.p1.should.equal(28);
});
it('should handle a bound parameter with .var() method', function() {
var gremlin = new GremlinScript();
var g = new Graph('g');
gremlin.var(g.V('name', bind('Alice')), 't');
gremlin.script.should.equal("t=g.V('name',p0)\n");
gremlin.params.p0.should.equal('Alice');
});
it('should handle bound parameters when adding graph elements', function() {
var gremlin = new GremlinScript();
var g = new Graph('g');
var alice = { name: 'Alice', age: 30 };
var bob = { name: 'Bob', age: 24 };
var properties = { foo: 'bar' };
var v1 = gremlin.var(g.addVertex(bind(alice)), 'v1');
var v2 = gremlin.var(g.addVertex(bind(bob)), 'v2');
gremlin.line(g.addEdge(v1, v2, 'knows', bind(properties)));
gremlin.script.should.equal("v1=g.addVertex(p0)\nv2=g.addVertex(p1)\ng.addEdge(v1,v2,'knows',p2)\n");
gremlin.params.p0.should.equal(alice);
gremlin.params.p0.name.should.equal('Alice');
gremlin.params.p0.age.should.equal(30);
gremlin.params.p1.should.equal(bob);
gremlin.params.p2.should.equal(properties);
});
});
});

@@ -176,3 +176,3 @@ 'use strict';

describe('.order()', function () {
describe('order()', function () {
it('should be chainable', function() {

@@ -179,0 +179,0 @@ var query = gremlin(g.V().key('name').order());

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc