account-dev
Version:
5 lines (4 loc) • 20.9 kB
HTML
<html>
<script>!function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){t("lambdajs").expose(window);var r="account",o=(t("superagent"),t("divsense-adda-helper")),i=t("divsense-alien-body")(r),a=o.init,s=o.makeNode,u=o.setChild,c=o.toArray,l=compose(c,u("__root__","_welcome"),s("_welcome",{t:"Welcome!",u:{type:"text"},k:{fontweight:"bold",color:"blue"}}),a),f=compose(c,u("__root__","_password"),u("__root__","_username"),s("_password",{u:{type:"input",subtype:"password",fixed:"true",tag:"form",name:"password"},k:{placeholder:"password",icon:"fa-circle-o"}}),s("_username",{u:{type:"input",subtype:"text",fixed:"true",tag:"form",name:"username"},k:{placeholder:"username",icon:"fa-circle-o"}}),a),h=function(){return{icon:"fa-sign-in",text:"sign in",data_attrs:[["tag","signin"],["fixed","true"],["change","content nodes dataset tag form"]],content:f()}},p=function(t,e,n){console.log("ACCOUNT HANDLE HEAD EVENT",t);var r=t.params.user_input;"in"===r?e.content={head:h()}:"out"===r&&(e.content={head:{icon:"fa-sign-out",text:"Bye, bye!",data_attrs:[["fixed","true"]]}}),n(e)},d=function(t,e,n){if(console.log("ACCOUNT SIGNAL",t),"signal"===t.method){var r=o.getUnitData("u","tag",t.params.head);if("signin"===r){var i=reduce(function(t,e){var n=o.getUnitData("u","name",e);return("username"===n||"password"===n)&&(t[n]=e.t),t},{},t.params.content);i.username&&i.password&&(e.content={head:{icon:"fa-home",text:i.username,data_attrs:[["tag","home"],["save","content all"]],content:l()}})}}n(e)};i.on("channel",d),i.on("head",p)},{"divsense-adda-helper":2,"divsense-alien-body":3,lambdajs:4,superagent:14}],2:[function(t,e,n){var r=function(t){return Object.keys(t).reduce(function(e,n){return e.push([n,t[n]]),e},[])},o=function(t,e){return function(n){n=n||{};var o=n[t]={};return e.t&&(o.t=e.t),e.u&&(o.u=r(e.u)),e.k&&(o.k=r(e.k)),n}},i=function(t,e,n){return function(r){n=n||"children-mmap";var o=r[t];return o.c=o.c||[],o.c.push([n,e]),e.forEach(function(e){r[e].p=t}),r}},a=function(t,e,n){return function(r){n=n||"children-mmap";var o=r[t];return o.c=o.c||[],o.c.length||o.c.push([n,[]]),o.c=o.c.map(function(t){return t[0]===n&&t[1].push(e),t}),r[e].p=t,r}},s=o("__root__",{}),u=function(t,e,n){var r=t[e];return r.id=e,delete r.p,n.push(r),(r.c||[]).reduce(function(e,n){return e=n[1].reduce(function(e,n){return e=u(t,n,e)},e)},n)},c=function(t,e,n){return(n[t]||[]).reduce(function(t,n){return n[0]===e&&(t=n[1]),t},"")};n.makeNode=o,n.setChildNodes=i,n.setChild=a,n.init=s,n.getUnitData=c,n.toArray=function(t){return u(t,"__root__",[])}},{}],3:[function(t,e,n){"use strict";var r,o={},i=["head","channel"],a=function(t,e){return o[t]=o[t]||[],o[t].push(e),[t,e]},s=function(t,e,n,r){o[t]&&o[t].forEach(function(t){t(e,n,r)})},u=function(t,e,n){-1!==i.indexOf(t.source)?(r&&console.log("ALIEN-BODY EVENT:",t.source,t.method),s(t.source,t,e,n)):r&&console.log("ALIEN-BODY ERROR. INVALID METHOD:",t.source)},c=function(t){try{var e=JSON.parse(t.data);r&&console.log("ALIEN-BODY. MSG FROM DIVSENSE:",e);var n={id:e.id,status:"ok",content:{}};u(e,n,function(e){t.source.postMessage(JSON.stringify(e),t.origin)})}catch(o){r&&console.log("ALIEN-BODY ERROR. INVALID MESSAGE:",t.data)}};e.exports=function(t,e){return r=e||!1,r&&console.log("ALIEN-BODY IS UP"),window.onload=function(){var e={id:t,status:"alive"};parent.postMessage(JSON.stringify(e),"*")},window.addEventListener("message",c,!1),{on:a}}},{}],4:[function(t,e,n){e.exports=t("./src/lambda.js")},{"./src/lambda.js":13}],5:[function(t,e,n){function r(){for(var t=arguments,e=t.length;e--;)if(!o(t[e]))throw new TypeError;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}var o=t("lodash.isfunction");e.exports=r},{"lodash.isfunction":6}],6:[function(t,e,n){function r(t){return"function"==typeof t}e.exports=r},{}],7:[function(t,e,n){function r(t){function e(n,r,a){a&&i(n,r,a)&&(r=null);var s=o(n,t,null,null,null,null,null,r);return s.placeholder=e.placeholder,s}return e}var o=t("lodash._createwrapper"),i=t("lodash._isiterateecall"),a=8,s=r(a);s.placeholder={},e.exports=s},{"lodash._createwrapper":8,"lodash._isiterateecall":12}],8:[function(t,e,n){(function(n){function r(t,e,n){for(var r=n.length,o=-1,i=J(t.length-r,0),a=-1,s=e.length,u=Array(i+s);++a<s;)u[a]=e[a];for(;++o<r;)u[n[o]]=t[o];for(;i--;)u[a++]=t[o++];return u}function o(t,e,n){for(var r=-1,o=n.length,i=-1,a=J(t.length-o,0),s=-1,u=e.length,c=Array(a+u);++i<a;)c[i]=t[i];for(var l=i;++s<u;)c[l+s]=e[s];for(;++r<o;)c[l+n[r]]=t[i++];return c}function i(t,e){function r(){var i=this&&this!==n&&this instanceof r?o:t;return i.apply(e,arguments)}var o=a(t);return r}function a(t){return function(){var e=d(t.prototype),n=t.apply(e,arguments);return h(n)?n:e}}function s(t,e,i,u,c,l,h,d,x,E){function O(){for(var y=arguments.length,v=y,g=Array(y);v--;)g[v]=arguments[v];if(u&&(g=r(g,u,c)),l&&(g=o(g,l,h)),C||j){var S=O.placeholder,N=m(g,S);if(y-=N.length,E>y){var R=d?p(d):null,M=J(E-y,0),P=C?N:null,I=C?null:N,U=C?g:null,X=C?null:g;e|=C?L:w,e&=~(C?w:L),D||(e&=~(_|b));var B=s(t,e,i,U,P,X,I,R,x,M);return B.placeholder=S,B}}var F=A?i:this;k&&(t=F[q]),d&&(g=f(g,d)),T&&x<g.length&&(g.length=x);var G=this&&this!==n&&this instanceof O?H||a(t):t;return G.apply(F,g)}var T=e&S,A=e&_,k=e&b,C=e&v,D=e&y,j=e&g,H=!k&&a(t),q=t;return O}function u(t,e,r,o){function i(){for(var e=-1,a=arguments.length,c=-1,l=o.length,f=Array(a+l);++c<l;)f[c]=o[c];for(;a--;)f[c++]=arguments[++e];var h=this&&this!==n&&this instanceof i?u:t;return h.apply(s?r:this,f)}var s=e&_,u=a(t);return i}function c(t,e,n,r,o,a,c,l){var f=e&b;if(!f&&"function"!=typeof t)throw new TypeError(x);var h=r?r.length:0;if(h||(e&=~(L|w),r=o=null),h-=o?o.length:0,e&w){var p=r,d=o;r=o=null}var m=[t,e,n,r,o,p,d,a,c,l];if(m[9]=null==l?f?0:t.length:J(l-h,0)||0,e==_)var y=i(m[0],m[2]);else y=e!=L&&e!=(_|L)||m[4].length?s.apply(void 0,m):u.apply(void 0,m);return y}function l(t,e){return t=+t,e=null==e?O:e,t>-1&&t%1==0&&e>t}function f(t,e){for(var n=t.length,r=E(e.length,n),o=p(t);r--;){var i=e[r];t[r]=l(i,n)?o[i]:void 0}return t}function h(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var p=t("lodash._arraycopy"),d=t("lodash._basecreate"),m=t("lodash._replaceholders"),_=1,b=2,y=4,v=8,g=16,L=32,w=64,S=128,x="Expected a function",J=Math.max,E=Math.min,O=Math.pow(2,53)-1;e.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":9,"lodash._basecreate":10,"lodash._replaceholders":11}],9:[function(t,e,n){function r(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}e.exports=r},{}],10:[function(t,e,n){(function(t){function n(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var r=function(){function e(){}return function(r){if(n(r)){e.prototype=r;var o=new e;e.prototype=null}return o||t.Object()}}();e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(t,e,n){function r(t,e){for(var n=-1,r=t.length,i=-1,a=[];++n<r;)t[n]===e&&(t[n]=o,a[++i]=n);return a}var o="__lodash_placeholder__";e.exports=r},{}],12:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t){return null!=t&&s(l(t))}function i(t,e){return t=+t,e=null==e?c:e,t>-1&&t%1==0&&e>t}function a(t,e,n){if(!u(n))return!1;var r=typeof e;if("number"==r?o(n)&&i(e,n.length):"string"==r&&e in n){var a=n[e];return t===t?t===a:a!==a}return!1}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&c>=t}function u(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var c=Math.pow(2,53)-1,l=r("length");e.exports=a},{}],13:[function(t,e,n){var r=t("lodash.curry"),o=t("lodash.compose");_LambdaJS={},_LambdaJS.get=r(function(t,e){return e[t]}),_LambdaJS.multiply=r(function(t,e){return t*e}),_LambdaJS.div=r(function(t,e){return t/e}),_LambdaJS.add=r(function(t,e){return t+e}),_LambdaJS.subtract=r(function(t,e){return t-e}),_LambdaJS.mod=r(function(t,e){return t%e}),_LambdaJS.gt=r(function(t,e){return t>e}),_LambdaJS.gte=r(function(t,e){return t>=e}),_LambdaJS.lt=r(function(t,e){return e>t}),_LambdaJS.lte=r(function(t,e){return e>=t}),_LambdaJS.equal=r(function(t,e){return t===e}),_LambdaJS.eq=r(function(t,e){return t==e}),_LambdaJS.charAt=r(function(t,e){return e.charAt(t)}),_LambdaJS.charCodeAt=r(function(t,e){return e.charCodeAt(t)}),_LambdaJS.indexOf=r(function(t,e){return e.indexOf(t)}),_LambdaJS.indexOf_=r(function(t,e,n){return n.indexOf(t,e)}),_LambdaJS.lastIndexOf=r(function(t,e){return e.lastIndexOf(t)}),_LambdaJS.match=r(function(t,e){return e.match(t)}),_LambdaJS.replace=r(function(t,e,n){return n.replace(t,e)}),_LambdaJS.search=r(function(t,e){return e.search(t)}),_LambdaJS.split=r(function(t,e){return e.split(t)}),_LambdaJS.split_=r(function(t,e,n){return n.split(t,e)}),_LambdaJS.substring=r(function(t,e){return e.substring(t)}),_LambdaJS.substring_=r(function(t,e,n){return n.substring(t,e)}),_LambdaJS.toLocaleLowerCase=function(t){return t.toLocaleLowerCase()},_LambdaJS.toLocaleUpperCase=function(t){return t.toLocaleUpperCase()},_LambdaJS.toLocaleString=function(t){return t.toLocaleString()},_LambdaJS.toLowerCase=function(t){return t.toLowerCase()},_LambdaJS.toUpperCase=function(t){return t.toUpperCase()},_LambdaJS.trim=function(t){return t.trim()},_LambdaJS.every=r(function(t,e){return e.every(t)}),_LambdaJS.filter=r(function(t,e){return e.filter(t)}),_LambdaJS.forEach=r(function(t,e){return e.forEach(t)}),_LambdaJS.indexOf=r(function(t,e){return e.indexOf(t)}),_LambdaJS.indexOf_=r(function(t,e,n){return n.indexOf(t,e)}),_LambdaJS.join=r(function(t,e){return e.join(t)}),_LambdaJS.lastIndexOf=r(function(t,e){return e.lastIndexOf(t)}),_LambdaJS.map=r(function(t,e){return e.map(t)}),_LambdaJS.pop=function(t){return t.slice(0,-1)},_LambdaJS.push=r(function(t,e){var n=e.slice(0);return n.push(t),n}),_LambdaJS.reduce=r(function(t,e,n){return n.reduce(t,e)}),_LambdaJS.reduceRight=r(function(t,e,n){return n.reduceRight(t,e)}),_LambdaJS.reverse=function(t){return t.slice(0).reverse()},_LambdaJS.shift=function(t){return t.slice(1)},_LambdaJS.some=r(function(t,e){return e.some(t)}),_LambdaJS.sort=function(t){return t.slice(0).sort()},_LambdaJS.splice=r(function(t,e,n){var r=n.slice(0);return r.splice(t,e),r}),_LambdaJS.unshift=r(function(t,e){var n=e.slice(0);return n.unshift(t),n}),_LambdaJS.exec=r(function(t,e){return t.exec(e)}),_LambdaJS.test=r(function(t,e){return t.test(e)}),_LambdaJS.hasOwnProperty=r(function(t,e){return e.hasOwnProperty(t)}),_LambdaJS.isPrototypeOf=r(function(t,e){return e.prototype.isPrototypeOf(t)}),_LambdaJS.toExponential=r(function(t,e){return e.toExponential(t)}),_LambdaJS.toFixed=r(function(t,e){return e.toFixed(t)}),_LambdaJS.toPrecision=r(function(t,e){return e.toPrecision(t)}),_LambdaJS.concat=r(function(t){var e="string"==typeof t?"":[];return e.concat.apply(e,arguments)},2),_LambdaJS.slice=r(function(t,e){return e.slice(t)}),_LambdaJS.slice_=r(function(t,e,n){return n.slice(t,e)}),_LambdaJS.toString=function(t){return t.toString()},_LambdaJS.valueOf=function(t){return t.valueOf()},_LambdaJS.curry=r,_LambdaJS.compose=o,_LambdaJS.expose=function(t){var e;for(e in _LambdaJS)"expose"!==e&&_LambdaJS.hasOwnProperty(e)&&(t[e]=_LambdaJS[e]);return _LambdaJS},e.exports=_LambdaJS,"object"==typeof window&&(LambdaJS=_LambdaJS)},{"lodash.compose":5,"lodash.curry":7}],14:[function(t,e,n){function r(){}function o(t){var e={}.toString.call(t);switch(e){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function i(t){return t===Object(t)}function a(t){if(!i(t))return t;var e=[];for(var n in t)null!=t[n]&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}function s(t){for(var e,n,r={},o=t.split("&"),i=0,a=o.length;a>i;++i)n=o[i],e=n.split("="),r[decodeURIComponent(e[0])]=decodeURIComponent(e[1]);return r}function u(t){var e,n,r,o,i=t.split(/\r?\n/),a={};i.pop();for(var s=0,u=i.length;u>s;++s)n=i[s],e=n.indexOf(":"),r=n.slice(0,e).toLowerCase(),o=b(n.slice(e+1)),a[r]=o;return a}function c(t){return t.split(/ *; */).shift()}function l(t){return m(t.split(/ *; */),function(t,e){var n=e.split(/ *= */),r=n.shift(),o=n.shift();return r&&o&&(t[r]=o),t},{})}function f(t,e){e=e||{},this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(t,e){var n=this;d.call(this),this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",function(){var t=null,e=null;try{e=new f(n)}catch(r){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=r,n.callback(t)}if(n.emit("response",e),t)return n.callback(t,e);if(e.status>=200&&e.status<300)return n.callback(t,e);var o=new Error(e.statusText||"Unsuccessful HTTP response");o.original=t,o.response=e,o.status=e.status,n.callback(t||o,e)})}function p(t,e){return"function"==typeof e?new h("GET",t).end(e):1==arguments.length?new h("GET",t):new h(t,e)}var d=t("emitter"),m=t("reduce"),_="undefined"==typeof window?this||self:window;p.getXHR=function(){if(!(!_.XMLHttpRequest||_.location&&"file:"==_.location.protocol&&_.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}return!1};var b="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};p.serializeObject=a,p.parseString=s,p.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":a,"application/json":JSON.stringify},p.parse={"application/x-www-form-urlencoded":s,"application/json":JSON.parse},f.prototype.get=function(t){return this.header[t.toLowerCase()]},f.prototype.setHeaderProperties=function(t){var e=this.header["content-type"]||"";this.type=c(e);var n=l(e);for(var r in n)this[r]=n[r]},f.prototype.parseBody=function(t){var e=p.parse[this.type];return e&&t&&(t.length||t instanceof Object)?e(t):null},f.prototype.setStatusProperties=function(t){1223===t&&(t=204);var e=t/100|0;this.status=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.clientError=4==e,this.serverError=5==e,this.error=4==e||5==e?this.toError():!1,this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.notFound=404==t,this.forbidden=403==t},f.prototype.toError=function(){var t=this.req,e=t.method,n=t.url,r="cannot "+e+" "+n+" ("+this.status+")",o=new Error(r);return o.status=this.status,o.method=e,o.url=n,o},p.Response=f,d(h.prototype),h.prototype.use=function(t){return t(this),this},h.prototype.timeout=function(t){return this._timeout=t,this},h.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.set=function(t,e){if(i(t)){for(var n in t)this.set(n,t[n]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},h.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},h.prototype.getHeader=function(t){return this._header[t.toLowerCase()]},h.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},h.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},h.prototype.auth=function(t,e){var n=btoa(t+":"+e);return this.set("Authorization","Basic "+n),this},h.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},h.prototype.field=function(t,e){return this._formData||(this._formData=new _.FormData),this._formData.append(t,e),this},h.prototype.attach=function(t,e,n){return this._formData||(this._formData=new _.FormData),this._formData.append(t,e,n),this},h.prototype.send=function(t){var e=i(t),n=this.getHeader("Content-Type");if(e&&i(this._data))for(var r in t)this._data[r]=t[r];else"string"==typeof t?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+t:t:this._data=(this._data||"")+t):this._data=t;return!e||o(t)?this:(n||this.type("json"),this)},h.prototype.callback=function(t,e){var n=this._callback;this.clearTimeout(),n(t,e)},h.prototype.crossDomainError=function(){var t=new Error("Origin is not allowed by Access-Control-Allow-Origin");t.crossDomain=!0,this.callback(t)},h.prototype.timeoutError=function(){var t=this._timeout,e=new Error("timeout of "+t+"ms exceeded");e.timeout=t,this.callback(e)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(t){var e=this,n=this.xhr=p.getXHR(),i=this._query.join("&"),a=this._timeout,s=this._formData||this._data;this._callback=t||r,n.onreadystatechange=function(){if(4==n.readyState){var t;try{t=n.status}catch(r){t=0}if(0==t){if(e.timedout)return e.timeoutError();if(e.aborted)return;return e.crossDomainError()}e.emit("end")}};var u=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.emit("progress",t)};this.hasListeners("progress")&&(n.onprogress=u);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=u)}catch(c){}if(a&&!this._timer&&(this._timer=setTimeout(function(){e.timedout=!0,e.abort()},a)),i&&(i=p.serializeObject(i),this.url+=~this.url.indexOf("?")?"&"+i:"?"+i),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof s&&!o(s)){var l=p.serialize[this.getHeader("Content-Type")];l&&(s=l(s))}for(var f in this.header)null!=this.header[f]&&n.setRequestHeader(f,this.header[f]);return this.emit("request",this),n.send(s),this},p.Request=h,p.get=function(t,e,n){var r=p("GET",t);return"function"==typeof e&&(n=e,e=null),e&&r.query(e),n&&r.end(n),r},p.head=function(t,e,n){var r=p("HEAD",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.del=function(t,e){var n=p("DELETE",t);return e&&n.end(e),n},p.patch=function(t,e,n){var r=p("PATCH",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.post=function(t,e,n){var r=p("POST",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},p.put=function(t,e,n){var r=p("PUT",t);return"function"==typeof e&&(n=e,e=null),e&&r.send(e),n&&r.end(n),r},e.exports=p},{emitter:15,reduce:16}],15:[function(t,e,n){function r(t){return t?o(t):void 0}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks[t];if(n){n=n.slice(0);for(var r=0,o=n.length;o>r;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],16:[function(t,e,n){e.exports=function(t,e,n){for(var r=0,o=t.length,i=3==arguments.length?n:t[r++];o>r;)i=e.call(null,i,t[r],++r,t);return i}},{}]},{},[1]);</script>
<body></body>
</html>