text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("ramda"),require("debug"),require("sanctuary")):"function"==typeof define&&define.amd?define(["ramda","debug","sanctuary"],t):t(e.R,e.debug,e.sanctuary)}(this,function(e,t,n){"use strict";function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}e="default"in e?e.default:e,t="default"in t?t.default:t,n="default"in n?n.default:n;var i=r(function(e){var t={doubledots:"::",comma:",",dash:"_",arrow:"->",doublearrow:"=>",middlepipe:"<|>",backpipe:"<|",forwardpipe:"|>",equals:"==",plus:"+",minus:"-",map:"[^]",define:":="},n={type:"type",R:"R",string:"string",number:"number",op:"operator",any:"any",context:"context",lex:"lexeme",F:"contextF",arg:"argument"},r=[["Array",Array],["Number",Number],["String",String],["Function",Function],["Object",Object],["Null",null],["RegExp",RegExp]],i=['"',"'","`"],u={piped:[n.R,n.context,n.lex],inserted:[n.number,n.string,n.type,n.any],control:[n.op]},a={pipe:"Pipe",context:"Context",atomic:"AtomicFunc",expr:"Expression",arg:"Argument"};e.exports={op:t,types:n,quotes:i,categories:u,jstypes:r,lexemeTypes:a}}),u=r(function(t){var n=e,r=i.types,u=n.curry(function(e,t){return{type:e,value:t}});t.exports=n.map(function(e){return u(r[e])},{Type:"type",R:"R",String:"string",Number:"number",Operator:"op",Any:"any",Context:"context",Arg:"arg"})}),a=r(function(t){function n(e){return function t(){return e.push(e.pop().apply(void 0,arguments)),t}}function r(e){var t=[],r=n(t);return Object.defineProperty(r,"store",{get:function(){return t}}),Object.defineProperty(r,"run",{get:function(){return i.pipe.apply(i,t)}}),o(t,r,e),r}var i=e,u=function(e,t){return function(n){return Object.defineProperty(t,n[0],{get:function(){return e(n[1]),t}})}},a=function(e){return function(t){return e.push(t)}},o=function(e,t,n){return i.pipe(i.toPairs,i.forEach(u(a(e),t)))(n)},p={};Object.defineProperty(p,"do",{get:function(){return r(i)}}),t.exports=function(){return p.do}}),o=r(function(t){function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t){return u.is(Array)(t)?p(t)(e):u.append(t,e)}function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var i=o(t);return u.pipe.apply(u,n(i))}var u=e,a=function(e){return u.reduce(e,[])},o=a(r),p=u.pipe(u.flatten,o,u.flip(u.concat));t.exports=i}),p=r(function(r){var i=e,u=t,p=a,c=o,s=c,f={String:i.is(String),Func:i.is(Function),Array:i.is(Array),Nil:i.isNil,Real:function(e){return!i.isNil(e)},Empty:i.isEmpty,Full:function(e){return!i.isEmpty(e)}},l=function(e,t){return f.Nil(t)?e:[e,t].join(":  ")},d=function(e){return function(t){return u(l(e,t))}},y=function(e){return function(t){return i.tap(d(e)(t))}},h=i.pipe(i.defaultTo([]),i.unless(f.Array,i.of)),v=s(h,i.flip(i.contains)),g=n,m=g.create,x=g.env,b=!1,w=m({checkTypes:b,env:x}),P=i.map(i.prop,{type:"type",val:"value",head:"head",tail:"tail",data:"data"}),k=f.String;r.exports={pipelog:y,log:d,isString:k,arrayify:h,P:s,isof:f,isContainOrEq:v,prop:P,RP:p,S:w}}),c=r(function(t){function n(e,t,n){var i=f(c.arrayify,r.allPass,s.either(r.__,r.F)),u=r.flip(r.concat),a=u([e,s.Right]),o=f(c.arrayify,a,f,function(e){return s.either(e,r.identity)});return r.when(i(t),o(n))}var r=e,a=i,o=u,c=p,s=c.S,f=c.P,l=c.isString,d=function(){var e=r.anyPass(r.map(r.equals,a.quotes)),t=r.allPass([f(r.head,e),f(r.last,e)]),i=f(r.init,r.tail);return n(o.String,[l,t],[r.trim,i])},y=function(){var e=new Map(a.jstypes),t=function(t){return!!l(t)&&e.has(t)};return n(o.Type,t,function(t){return e.get(t)})},h=n(o.Number,isFinite,parseFloat),v=function(){var e=r.is(Function),t=function(t){return e(r[t])};return n(o.R,[l,t],r.prop(r.__,r))},g=function(e){return f(r.match(/\D\w+/),r.head,r.equals(e))(e)},m=n(o.Context,g),x=r.both(f(r.head,r.equals("@")),f(r.tail,g)),b=n(o.Arg,x,r.tail),w=s.lift(r.when(l,r.trim)),P=r.identity;t.exports={isQuote:d(),isType:y(),isVendor:v(),isNumber:h,isContext:m,isArg:b,preprocess:w,postprocess:P}}),s=r(function(t){var n=e,r=p,a=r.P,o=u,c=r.pipelog("splitter"),s=n.values(i.op),f=function(e){return n.map(n.when(r.isof.String,e))},l=f(n.trim),d=n.reject(n.isEmpty),y=[n.split,a(o.Operator,n.intersperse)],h=[d,n.unnest],v=function(e){return n.cond([[r.isof.String,e],[n.T,c("uncaught")]])},g=function(e){return a(e,n.unnest)},m=[n.of,n.ap(y),n.concat(n.__,h),a,v,n.map,g,c("splitPipe")],x=a(a,n.map(n.__,s),a)(m),b=a(n.unnest,l,d,c("end")),w=[r.arrayify,x,b],P=a(w);t.exports={exec:P,cleaner:b}}),f=r(function(t){function n(e){var t=r.unless(a.isString,function(){throw new Error("`keywords` should be String")}),n=r.pipe(t,r.split(" "),r.reject(r.isEmpty)),i=r.map(r.ifElse(r.is(Object),o.Right,o.Left)),p=function(e,t){return r.allPass([r.propEq("type","operator"),r.propEq("obj",","),r.eqProps("obj",r.__,t)])(e)},c=r.dropRepeatsWith(p),s=r.unary(r.pipe(n,u.exec,i,f("тэг"),r.map(l),c));return s(e)}var r=e,i=c,u=s,a=p,o=a.S,f=a.pipelog("preproc"),l=r.pipe(i.preprocess,f("->isQuote"),i.isQuote,f("->isNumber"),i.isNumber,f("->isType"),i.isType,f("->isVendor"),i.isVendor,f("->isArg"),i.isArg,f("->isContext"),i.isContext,f("->postprocess"),i.postprocess);t.exports=n}),l=r(function(t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=e,a=i.lexemeTypes,o=function e(t,r){return n(this,e),r.index=r.head.index,r.lexeme=t,r},p=function(){function e(){n(this,e)}return r(e,null,[{key:"Pipe",value:function(e){return new o(a.pipe,e)}},{key:"AtomicFunc",value:function(e){return new o(a.atomic,e)}},{key:"Expression",value:function(e){return new o(a.expr,e)}},{key:"Argument",value:function(e){return new o(a.arg,e)}},{key:"Context",value:function(t){return new e(a.context,t)}},{key:"its",get:function(){var e=u.propEq("lexeme");return u.map(e,a)}}]),e}();t.exports=p}),d=r(function(t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e,u=p,a=u.S,o=u.P,c=function(){function e(t,r){return n(this,e),!i.is(Array,t)||i.isEmpty(t)?a.Left("No array recieved"):(i.isNil(r)?(this.head=i.head(t),this.tail=i.tail(t)):(this.head=r,this.tail=t||[]),void(this[Symbol.iterator]=regeneratorRuntime.mark(function e(){var t,n,r,i,u,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.head;case 2:t=!0,n=!1,r=void 0,e.prev=5,i=this.tail[Symbol.iterator]();case 7:if(t=(u=i.next()).done){e.next=14;break}return a=u.value,e.next=11,a;case 11:t=!0,e.next=7;break;case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(5),n=!0,r=e.t0;case 20:e.prev=20,e.prev=21,!t&&i.return&&i.return();case 23:if(e.prev=23,!n){e.next=26;break}throw r;case 26:return e.finish(23);case 27:return e.finish(20);case 28:case"end":return e.stop()}},e,this,[[5,16,20,28],[21,,23,27]])})))}return r(e,[{key:"append",value:function(e){return i.isEmpty(this.tail)&&i.isEmpty(this.head)?this.head=e:this.tail.push(e),this}},{key:"toArray",get:function(){return i.prepend(this.head,this.tail)}},{key:"length",get:function(){return i.defaultTo(0,this.tail.length)+i.isEmpty(this.head)?0:1}}],[{key:"cyclic",value:function(t){return function(n){var r=!0,u=!1,a=void 0;try{for(var p,c=n[Symbol.iterator]();!(r=(p=c.next()).done);r=!0){var s=p.value;s=o(i.when(e.isList,e.cyclic(t)),t)(s)}}catch(e){u=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(u)throw a}}return n}}},{key:"hasTail",value:function(e){return i.has("tail",e)&&!i.isEmpty(e.tail)}},{key:"last",value:function(t){return e.hasTail(t)?i.last(t.tail):t.head}},{key:"lastR",value:function(t){var n=!(arguments.length<=1||void 0===arguments[1])&&arguments[1],r=i.has("tail"),u=o(r,i.not),a=i.either(u,o(e.last,u));return i.until(n?a:u,e.last)(t)}},{key:"emptyList",value:function(){return new e([{}])}},{key:"isList",value:function(e){return i.has("head",e)}},{key:"prepend",get:function(){return i.curry(function(e,t){return t.tail=i.prepend(t.head,t.tail),t.head=e,t})}}]),e}();t.exports=c}),y=r(function(t){function n(e){return function t(n){return u.ifElse(u.either(u.isNil,function(){return u.isEmpty(e)}),function(){return t},u.anyPass(e))(n)}}function r(e){var t=[],r=n(t);return Object.defineProperty(r,"store",{get:function(){return t}}),g(t,r,e),r}var u=e,a=p,o=a.P,c=i,s=c.types,f=c.op,l=function(e){return function(t){return u.whereEq({type:e,value:t})}},d=l(s.op),y=u.propEq("type"),h=function(e,t){return function(n){return Object.defineProperty(t,n[0],{get:function(){return e(n[1]),t}})}},v=function(e){return function(t){return e.push(t)}},g=function(e,t,n){return o(u.toPairs,u.forEach(h(v(e),t)))(n)},m={op:u.map(d)(f),type:u.map(y)(s),typedVal:u.map(l)(s)},x={};Object.defineProperty(x,"op",{get:function(){return r(m.op)}}),Object.defineProperty(x,"type",{get:function(){return r(m.type)}}),Object.defineProperty(x,"typedVal",{get:function(){return r(m.typedVal)}}),t.exports={eq:m,equals:x}}),h=r(function(t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=e,u=p,a=u.S,o=u.P,c=u.log("tree"),s=d,f=function(){function e(){n(this,e)}return r(e,null,[{key:"_indexTag",value:function(e){return function(t){var n=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return o(u.arrayify,i.prepend(e),i.join(n),c)(t)}}},{key:"arr",value:function(t,n){var r=e._indexTag(t);return n.forEach(function(e,t){return r(t)(e)})}},{key:"to",value:function(e){return o(a.maybeToNullable,e)}},{key:"headList",value:function(t,n){var r=arguments.length<=2||void 0===arguments[2]?0:arguments[2],u=arguments.length<=3||void 0===arguments[3]?0:arguments[3],a=e._indexTag(t),p="   ",c=o(i.repeat(p),i.join("")),f=["value"],l=function(e){return function(t){return a(["  ",c(u),e,t[0]],"")(t[1])}},d=function(e){return o(i.props(e),i.zip(e),i.forEach(l(p)))},y=function(e){return e===-1?"#  ":e+1+(e+1>=10?" ":"  ")},h=i.add(2,u);s.isList(n)?(l(y(r))([n.lexeme,n.index]),e.headList(t,n.head,-1,h),s.hasTail(n)&&n.tail.forEach(function(n,r){return e.headList(t,n,r,h)})):(l(y(r))([n.type,n.index]),d(f)(n))}},{key:"funcReplace",get:function(){return i.when(o(i.last,i.is(Function)),function(e){return[e[0],"FUNC"]})}},{key:"pair",get:function(){return o(i.toPairs,i.map(e.funcReplace()))}}]),e}();t.exports=f}),v=r(function(t){function n(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e){var t=function(e,t){return b.lift(m.assoc("index",t))(e)},n=function(e){return e.map(t)};return n(e)}function u(e){var t=function(e){return w(m.splitWhen(L(e)),m.adjust(m.tail,1))},n={context:t(T.op.doubledots),define:t(T.op.define)},r=function(e,t){return function(n){return m.isEmpty(n[1])?(t[e]=!1,n[0]):(t[e]=b.rights(n[0]),n[1])}},i={},u=w(n.define,r("define",i),n.context,r("context",i));return i.data=u(e),i}function a(e,t,n){var r=P().length.dec.lensIndex.run,i=function(e){return m.append(N.Pipe(new j([e])))},u=function(e){return function(t){return m.ifElse(m.isEmpty,i(e),m.over(r(t),n(e)))(t)}},a=m.map(m.ifElse(e,t,u));return m.transduce(a,function(e,t){return t(e)})}function o(e){var t=function(e){return w(x.arrayify,m.append(e.value))},n=w(E.val,T.type.R.op.context),r=w(E.val,m.of,m.append),i=a(n,r,t);return i([],e)}function c(e){var t=function(e){return function(t){return t.append(e)}},n=T.op.forwardpipe.middlepipe.backpipe,r=m.both(j.isList,w(E.head,n)),i=w(m.identity,m.append),u=a(r,i,t);return u([],e)}function s(e){var t=[[T.op.dash,A.any,m.__],[T.op.equals,A.R,m.equals],[T.op.plus,A.R,m.add],[T.op.minus,A.R,m.subtract],[T.op.map,A.R,m.map]],r=function(e,t){return function(n){return n.value=t,n.type=e,n}},i=function(e,t,n){return m.map(m.when(e,r(t,n)))},u=function(e,t){return i.apply(void 0,n(t))(e)};return m.reduce(u,e,t)}function f(e){var t=function(e,t){return m.when(w(E.head,e),t)},n=t(T.type.R.context,N.AtomicFunc),r=t(T.type.op,N.Expression),i=w(function(e){return new j(e)},n,r,C("detectExpr ")),u=w(b.lift(s),q("checkReplace"),o,k("intoAtomics"),m.map(i));return u(e)}function v(e){var t=function(e){return m.when(T.type.arg.context,m.assoc("argName",e.value))(e)},n=function(e){return b.Right(t).ap(e)};return m.map(n,e)}function g(e){var t=w(r,q("indexation"),v,q("argName"),S,f,c),n=w(u,function(e){return m.assoc("tree",t(e.data),e)});return n(e)}var m=e,x=p,b=x.S,w=x.P,P=x.RP,k=(x.log("tree"),x.pipelog("tree")),E=x.prop,N=l,j=d,A=i.types,R=y,T=R.equals,O=h,q=function(e){return m.tap(function(t){return t.map(function(t,n){return k(e+" "+n)(t)})})},S=m.map(b.eitherToMaybe),_=m.propEq("value"),L=function(e){return function(t){return m.both(b.isRight,_(!0))(b.lift(e,t))}},C=function(e){return m.tap(function(t){return O.headList(e,t,-1)})};t.exports=g}),g=r(function(t){function n(e){var t=u.when(f.its.expr,c(a.prop.tail,function(e){return new s(e)},f.Pipe)),n=u.when(u.both(f.its.pipe,c(s.hasTail,u.not)),a.prop.head);return c(t,n)(e)}function r(){var e=this,t=function(e){return function(t){return e.append(t)}};this.value=[],this.push=function(n){return e.value.push(t(n))},this.pushLast=function(t){return e.push(s.lastR(t,!0))},this.pop=function(){return e.value.pop()},this.addToLast=function(t){return u.last(e.value)(t)}}function i(e){var t=e.tree;if(!u.is(Array,t))return o.Left("No array recieved");for(var i=s.emptyList(),a=new r,p=m.empty,l=0,d=t.length;l<d;){var y=t[l++],h=P(y),v=k[p][h];switch(v){case x.child:a.pushLast(i);break;case x.parent:a.pop()}p=h,a.addToLast(n(y))}return e.tree=c(f.Pipe,n)(i),e}var u=e,a=p,o=a.S,c=a.P,s=(a.log("tree"),a.pipelog("tree"),d),f=l,h=y,v=h.eq.op,g=["pipe","open","mid","close"],m={empty:0,pipe:1,open:2,mid:3,close:4},x={next:0,child:1,parent:-1,error:NaN},b=function(e){return u.both(f.its.expr,c(a.prop.head,e))},w={pipe:f.its.pipe,open:b(v.backpipe),mid:b(v.middlepipe),close:b(v.forwardpipe)},P=u.cond(u.append([u.T,m.pipe],u.map(function(e){return[w[e],function(){return m[e]}]},g))),k=[[NaN,1,1,NaN,1],[NaN,0,1,NaN,0],[NaN,-1,1,0,-1],[NaN,-1,1,0,-1],[NaN,0,1,NaN,0]];t.exports=i}),m=r(function(t){function n(){this.id=Math.round(1e6*Math.random()),this.updated=!1,this._data=null}function r(e,t,n){var r=Object.create(e,{data:{get:function(){return e._data},enumerable:!0},index:{get:function(){return t},enumerable:!0},id:{get:function(){return e.id},enumerable:!0},isArg:{value:n,enumerable:!0}});return Object.defineProperty(r,"pipe",{value:function(){return a("spout pipe")(r.data[r.index],r),u.isNil(r.data)?null:r.isArg?r.data[r.index]:r.data[r.index]},enumerable:!0}),r}var i=p,u=e,a=(i.P,i.pipelog("tree"));i.pipelog("tree");Object.defineProperty(n,"gate",{get:function(){return new n}}),Object.defineProperty(n.prototype,"pipe",{get:function(){var e=this;return function(t){return e.updated=!0,e._data=t,t[0]}}}),n.prototype.Spout=function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];return r(this,e,t)},t.exports=n}),x=r(function(t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){function n(t){if(!i(t))return t;s("ee")(t,i(t)),r.hasVal(t)||s("ERRRROR!")(t);var n=r.get(t.value),u=e[n];return s("refs")(t.type,n,u),t.value=u,t}var r=new v(t.context||[]),i=l.type.arg.context,u=h.cyclic(n);return t.tree=u(t.tree),t}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e,o=p,c=o.P,s=(o.S,o.log("tree")),f=(o.pipelog("tree"),o.prop),l=y.equals,h=d,v=(i.types,function(){function e(t){n(this,e);var r=e.indexation(t);s("index map")(r),this._map=new Map(r)}return u(e,null,[{key:"indexation",get:function(){return a.addIndex(a.map)(function(e,t){return a.pair(e.value,t)})}}]),u(e,[{key:"has",get:function(){var e=this._map;return function(t){return e.has(t)}}},{key:"get",get:function(){var e=this._map;return function(t){return e.get(t)}}},{key:"hasVal",get:function(){var e=this.has;return c(f.val,e)}}]),e}());t.exports={fillUserData:r}}),b=r(function(t){function n(e){this.message="Can not compile object "+e,this.name="Compile exeption"}function r(e){var t=c.cond([[c.is(Array),i],[f.its.pipe,i],[f.its.atomic,u],[v(s.isList,c.not),h.prop.val],[c.T,function(e){throw new n(e)}]]);return t(e)}function i(e){var t=c.when(s.isList,c.prop("toArray"));return v(t,c.map(r),c.apply(c.pipe))(e)}function u(e){var t=function(){return c.apply(r(e.head),c.map(r,e.tail))};return s.hasTail(e)?t():r(e.head)}function a(e){var t=function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];e.gate.pipe(n);var u=b.fillUserData(n,e),a=r(u.tree);return a.apply(void 0,n)};return Object.defineProperty(t,"data",{value:e}),Object.defineProperty(t,"source",{get:function(){return t.data.source}}),Object.defineProperty(t,"args",{get:function(){return w(t.data.context)}}),t}function o(e){return function(t){return t.source=e,t.gate=g.gate,new a(t)}}var c=e,s=d,f=l,h=p,v=h.P,g=(h.pipelog("tree"),m),b=(y.equals,x),w=v(c.when(c.equals(!1),function(){return[]}),c.when(h.isof.Empty,c.append({type:"fakeContext",value:"data"})),c.map(h.prop.val));o.sayPipe=i,o.collectData=r,t.exports=o});r(function(t){function n(e){return s(i,w("preproc"),u,x("getTree"),a,m("conv"),o(e))(e)}var r=e,i=f,u=v,a=g,o=b,c=p,s=c.P,l=c.log("index"),d=c.pipelog("index"),y=h,m=function(e){return r.tap(function(t){return y.headList(e,t.tree,-1)})},x=function(e){return r.tap(s(r.prop("tree"),r.map(function(t){return y.headList(e,t,-1)})))},w=function(e){return r.tap(r.map(d(e)))},P="indexes data sright :: head prop 'index' concat @data sright";l("example")(P);var k=n(P),E=[{index:[1,3]},{index:[0,1,2,3]},0],N=[0,5,20,30,40,50],j=r.objOf("result"),A=k(E,N,j);l("res")(A),t.exports=n})});
  //# sourceMappingURL=speak-r.js.map
  