-
Notifications
You must be signed in to change notification settings - Fork 0
/
built_rt.min.js
14 lines (10 loc) · 291 KB
/
built_rt.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
!function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){t.exports={host:"api.built.io",rtHost:"realtime.built.io",port:443,rtPort:443,protocol:"https",rtProtocol:"https",version:"v2",adaptor:"RestfullAdaptor",persistSession:"COOKIE",cachePolicy:"ONLY_NETWORK",socketData:null,userJSON:null,isSessionUpdated:!1,isUserMetricsEnabled:!1,analyticsConfig:{trackAnonymously:!1},app_info:{name:"",app_variables:{},uid:""},metaData:{isUserMetricsSent:!1}}},{}],2:[function(e,t,n){function r(e){return s.mixin({},c(e))}function o(e,t,n){return s.find(s.where({uid:e}),n.data[t])||{}}function i(e,t){var n=s.indexOf(e.uid,s.map(s.prop("uid"),t));return s.remove(n,1,t)}var s=e(72),a=e(33),u=e(29)(),c=s.prop("data"),f=s.compose(s.prop("others"),c),p=t.exports=function(e){var n=s.mixin({},e);e.users&&a.isArray(e.users)||(n.users=[]),e.roles&&a.isArray(e.roles)||(n.roles=[]),e.others&&a.isObject(e.others)||(n.others={}),e.can&&a.isArray(e.can)||(n.can=[]);var r={toJSON:function(){return e},data:n};return u.build(t.exports,r)},l=s.curry(function(e,t,n,o,a){var u=r(a);u[t]=[].concat(a.data[t]);var f=s.mixin({},s.find(s.propEq("uid",n),c(a)[t]));if(f.uid)u[t]=i(f,u[t]),f[e]=o,u[t].push(f);else{var l={};l.uid=n,l[e]=o,u[t].push(l)}return p(u)});t.exports.getPublicDeleteAccess=function(e){return!!f(e)["delete"]},u.define("getPublicDeleteAccess",1),t.exports.getPublicReadAccess=function(e){return!!f(e).read},u.define("getPublicReadAccess",1),t.exports.getPublicUpdateAccess=function(e){return!!f(e).update},u.define("getPublicUpdateAccess",1),t.exports.getRoleDeleteAccess=s.curry(function(e,t){return o(e,"roles",t)["delete"]}),u.define("getRoleDeleteAccess",2),t.exports.getRoleReadAccess=s.curry(function(e,t){return o(e,"roles",t).read}),u.define("getRoleReadAccess",2),t.exports.getRoleUpdateAccess=s.curry(function(e,t){return o(e,"roles",t).update}),u.define("getRoleUpdateAccess",2),t.exports.getUserDeleteAccess=s.curry(function(e,t){return o(e,"users",t)["delete"]}),u.define("getUserDeleteAccess",2),t.exports.getUserReadAccess=s.curry(function(e,t){return o(e,"users",t).read}),u.define("getUserReadAccess",2),t.exports.getUserUpdateAccess=s.curry(function(e,t){return o(e,"users",t).update}),u.define("getUserUpdateAccess",2),t.exports.isDisabled=function(e){return!!c(e).disable},u.define("isDisabled",1),t.exports.setPublicDeleteAccess=s.curry(function(e,t){var n=r(t);return n.others=s.mixin({},t.data.others),n.others["delete"]=e,p(n)}),u.define("setPublicDeleteAccess",2),t.exports.setPublicUpdateAccess=s.curry(function(e,t){var n=r(t);return n.others=s.mixin({},t.data.others),n.others.update=e,p(n)}),u.define("setPublicUpdateAccess",2),t.exports.setPublicReadAccess=s.curry(function(e,t){var n=r(t);return n.others=s.mixin({},t.data.others),n.others.read=e,p(n)}),u.define("setPublicReadAccess",2),t.exports.setRoleDeleteAccess=l("delete","roles"),u.define("setRoleDeleteAccess",3),t.exports.setRoleUpdateAccess=l("update","roles"),u.define("setRoleUpdateAccess",3),t.exports.setRoleReadAccess=l("read","roles"),u.define("setRoleReadAccess",3),t.exports.setUserDeleteAccess=l("delete","users"),u.define("setUserDeleteAccess",3),t.exports.setUserUpdateAccess=l("update","users"),u.define("setUserUpdateAccess",3),t.exports.setUserReadAccess=l("read","users"),u.define("setUserReadAccess",3),t.exports.setAnonymousDeleteAccess=t.exports.setUserDeleteAccess("anonymous"),u.define("setAnonymousDeleteAccess",2),t.exports.setAnonymousUpdateAccess=t.exports.setUserUpdateAccess("anonymous"),u.define("setAnonymousUpdateAccess",2),t.exports.setAnonymousReadAccess=t.exports.setUserReadAccess("anonymous"),u.define("setAnonymousReadAccess",2),t.exports.disable=function(e){var t=s.mixin({},c(e));return t.disable=!0,p(t)},u.define("disable",1),t.exports.enable=function(e){var t=s.mixin({},c(e));return t.disable=!1,p(t)},u.define("enable",1),t.exports.canUpdate=function(e){return c(e).can.indexOf("update")>-1},u.define("canUpdate",1),t.exports.canDelete=function(e){return c(e).can.indexOf("delete")>-1},u.define("canDelete",1)},{29:29,33:33,72:72}],3:[function(e,t,n){function r(e){return{headers:e.headers,status:e.status,entity:e.entity}}function o(e){var t=u.defer();return e.onreadystatechange=function(n){4==e.readyState&&(e.status>=200&&e.status<300?(c.trigger("upload:end"),t.resolve(e.responseText)):t.reject(e.statusText))},e.ontimeout=e.onerror=function(n){t.reject(e.statusText)},t}var i=e(82),s=e(78),a=e(77),u=e(150),c=e(11),f=i.wrap(s,{mime:"application/json"}).wrap(a,{code:400});t.exports.makeCall=function(e){return"DELETE"===e.method.toUpperCase()&&(e.entity={_method:"DELETE"},e.method="POST"),c.trigger("http:start"),f(e).then(function(e){return c.trigger("http:end"),r(e)})["catch"](function(e){throw r(e)})},t.exports.makeXMLHttpRequest=function(e){c.trigger("upload:start");var t=new XMLHttpRequest;t.open("POST",e.url,!0);for(var n in e.headers)t.setRequestHeader(n,e.headers[n]);var r=o(t);return t.upload.onprogress=function(e){r.notify({bytesUploaded:e.loaded,bytesTotal:e.total,timestamp:e.timeStamp})},t.send(e.formData),r.promise}},{11:11,150:150,77:77,78:78,82:82}],4:[function(e,t,n){function r(e){return{headers:e.headers,status:e.statusCode,entity:e.body}}function o(e){var t=s.defer();return e.onreadystatechange=function(n){4==e.readyState&&(e.status>=200&&e.status<300?(a.trigger("upload:end"),t.resolve(e.responseText)):t.reject(e.statusText))},e.ontimeout=e.onerror=function(n){t.reject(e.statusText)},t}var i=e(72),s=e(150),a=e(11),u=e(33);t.exports.makeCall=i.curry(function(e,t){function n(e){e.emit("api",{headers:t.headers,method:t.method,url:a,body:t.entity},function(e,t){t.statusCode>=200&&t.statusCode<300?o.resolve(r(t)):o.reject(r(t)),e&&o.reject(r(e))})}var o=s.defer(),i=t.path,a=i.substr(i.search("/v"));if(t.params)for(var c in t.params)a=u.addParam(a,c,t.params);return e.isSocketConnected()?n(e.getSocket()):e.getAdhocOperations().push(n),o.promise}),t.exports.makeXMLHttpRequest=function(e){a.trigger("upload:start");var t=new XMLHttpRequest;t.open("POST",e.url,!0);for(var n in e.headers)t.setRequestHeader(n,e.headers[n]);var r=o(t);return t.upload.onprogress=function(e){r.notify({bytesUploaded:e.loaded,bytesTotal:e.total,timestamp:e.timeStamp})},t.send(e.formData),r.promise}},{11:11,150:150,33:33,72:72}],5:[function(e,t,n){function r(e,t){i(e),t.resetBatchQueue()}function o(t){var n=e(8);return c.mixin(t.headers,n.App.getHeaders(t.app))}function i(e){var t,n=f.keyValue;if(f.isArray(e)){if(!(e.length>0))throw new Error("Events array is empty");t=e[0].analytics}var r=h.getUUIDForAPI(t.app.getApiKey()),i=c.mixin(n("events",s(e)),n("super_properties",c.mixin(t.getSuperProperties()["static"],{blt_uuid:r}))),a=t.app.options.adaptor,p=f.getAdaptorObj("POST",u(t.app),o(t),i,null);return a.makeCall(p).then(function(t){return e})}function s(e){var t={};return e.forEach(function(e){var n=t[e.getUid()]||[];n.push(f.keyValue("properties",a(e))),t[e.getUid()]=n}),t}function a(e){var t=e.analytics.getTrackAnonymously()?"anonymous":e.app.getUserJSON()?e.app.getUserJSON().uid:"anonymous";return e=e.setProperties({app_user_object_uid:t}),c.mixin(e.analytics.getSuperProperties().dynamic(),e.getProperties())}function u(e){return e.getURL()+d}var c=e(72),f=e(33),p=e(29)(),l=(e(8),e(6)),h=e(32),d="/events/trigger_multiple",g=t.exports=c.curry(function(e,n,r,o,i,s){if(!s["static"]&&!s.dynamic)throw new Error("Super properties is expected to have atleast a static or dynamic property");s["static"]=s["static"]||{},s.dynamic=s.dynamic||function(){return{}};var a={app:e,headers:n,queue:r,trackAnonymously:o,batchSize:i,superProperties:s,toJSON:function(){return s}},u=l(e,a);return a.Event=function(e,t){if(!e)throw new Error("uid not found");return t?u(e,t):u(e,{})},f.copyProperties(a.Event,l),p.build(t.exports,a)}),m=t.exports.set=c.curry(function(e,t,n){var r=n.queue,o=n.trackAnonymously,i=n.batchSize,s=n.superProperties,a=n.headers;switch(e){case"headers":a=t;break;case"queue":r=t;break;case"trackAnonymously":o=t;break;case"batchSize":i=t;break;case"superProperties":s=t}return g(n.app,a,r,o,i,s)});p.define("set",3);var y=t.exports.get=c.curry(function(e,t){return t[e]});p.define("get",2),t.exports.setBatchSize=m("batchSize"),p.define("setBatchSize",2),t.exports.getBatchSize=y("batchSize"),p.define("getBatchSize",1),t.exports.setTrackAnonymously=m("trackAnonymously"),p.define("setTrackAnonymously",2),t.exports.getTrackAnonymously=y("trackAnonymously"),p.define("getTrackAnonymously",1),t.exports.setSuperProperties=m("superProperties"),p.define("setSuperProperties",2),t.exports.setStaticSuperProperties=c.curry(function(e,t){var n=c.mixin({},t.getSuperProperties());return n["static"]=e,m("superProperties",n,t)}),p.define("setStaticSuperProperties",2),t.exports.setDynamicSuperProperties=c.curry(function(e,t){var n=c.mixin({},t.getSuperProperties());return n.dynamic=e,m("superProperties",n,t)}),p.define("setDynamicSuperProperties",2),t.exports.getSuperProperties=y("superProperties"),p.define("getSuperProperties",1),t.exports.setHeader=c.curry(function(e,t,n){var r=c.mixin({},n.headers);return r[e]=t,m("headers",r,n)}),p.define("setHeader",3),t.exports.getHeaders=y("headers"),p.define("getHeaders",1),t.exports.trigger=function(e,t,n){f.isArray(e)||(e=[e]);var o=n.get("queue");if(t)return r(e,n);if(1===n.get("batchSize"))return r(e,n);var i=o.concat(e);return i.length>=n.getBatchSize()?r(o,n):void(n.queue=i)},p.define("trigger",3,[!1]),t.exports.flush=function(e){t.exports.trigger(e.queue,!0,e),e.resetBatchQueue()},p.define("flush",1),t.exports.getQueue=y("queue"),p.define("getQueue",1);t.exports.resetBatchQueue=function(e){return e.queue=[],e};p.define("resetBatchQueue",1),t.exports.pushEventInQueue=c.curry(function(e,n){n.queue=n.get("queue").concat(e),n.queue.length===n.getBatchSize()&&(t.exports.trigger(n.get("queue"),!0,n),n.resetBatchQueue())}),p.define("pushEventInQueue",2)},{29:29,32:32,33:33,6:6,72:72,8:8}],6:[function(e,t,n){function r(e){var t=e.app;return t.getURL()+"/events/"+e.getUid()+f}function o(e){return s.mixin(e.analytics.getSuperProperties().dynamic(),e.getProperties())}function i(e){return s.mixin({},e.getProperties())}{var s=e(72),a=e(33),u=e(29)(),c=e(32),f="/trigger",p=t.exports=s.curry(function(e,n,r,o){var i={app:e,analytics:n,uid:r,properties:o};return u.build(t.exports,i)});t.exports.getProperties=function(e){return e.properties}}u.define("getProperties",1);t.exports.getUid=function(e){return e.uid};u.define("getUid",1),t.exports.setUid=s.curry(function(e,t){return p(t.app,t.analytics,e,t.properties)}),u.define("setUid",2);var l=s.curry(function(e,t,n){t instanceof Date&&(t=t.toISOString());var r=i(n);return r[e]=t,p(n.app,n.analytics,n.uid,r)});t.exports.setProperties=s.curry(function(e,t){var n=s.mixin(e,i(t));return p(t.app,t.analytics,t.uid,n)}),u.define("setProperties",2),t.exports.setCreatedAt=l("created_at"),u.define("setCreatedAt",2),t.exports.trigger=function(e,t){var n=a.keyValue;if(t.analytics.getBatchSize()>1&&!e)t=t.setCreatedAt(new Date),t.analytics.pushEventInQueue(t);else{var i=t.analytics.getTrackAnonymously()?"anonymous":t.app.getUserJSON()?t.app.getUserJSON().uid:"anonymous";t=t.setProperties({app_user_object_uid:i});var u=c.getUUIDForAPI(t.app.getApiKey()),f=n("event",n("properties",o(t))),p=n("super_properties",s.mixin(t.analytics.getSuperProperties()["static"],{blt_uuid:u})),l=s.mixin(p,f),h=t.app.options.adaptor,d=a.getAdaptorObj("POST",r(t),t.app.getHeaders(),l,null);h.makeCall(d)}},u.define("trigger",2,[!1])},{29:29,32:32,33:33,72:72}],7:[function(e,t,n){function r(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onAppInstance&&t.realtime.onAppInstance(e)})}function o(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onClassCons&&t.realtime.onClassCons(e),t.realtime&&t.realtime.onUploadCons&&t.realtime.onUploadCons(e),t.realtime&&t.realtime.onUserCons&&t.realtime.onUserCons(e),t.realtime&&t.realtime.onRoleCons&&t.realtime.onRoleCons(e),t.realtime&&t.realtime.onInstallationCons&&t.realtime.onInstallationCons(e)})}function i(e,t){w.Session.COOKIE===L(t).persistSession?_.set(l(H(t)),e.authtoken):w.Session.LOCAL_STORAGE===L(t).persistSession&&O.set(l(H(t)),e)}function s(e){var n=y.getAdaptorObj("GET",t.exports.getURL(e)+"/application/users/current",t.exports.getHeaders(e),null,null);return a(e,n).then(function(t){return e.setSession(t.toJSON()),t})}function a(e,t){var n=e.options.adaptor;return n.makeCall(t).then(function(t){var n=u(t.entity.application_user,e);return e.setSession(n.toJSON()),n})}function u(e,t){return c(C.APP_USER_CLS,e,t)}function c(e,t,n){return n.Class(e).ObjectCons({},{},t,{})}function f(){try{if(!window.localStorage)throw new Error("Local Storage doesn't exist");return O.set("builttestkey","value"),O.get("builttestkey"),O["delete"]("builttestkey"),!0}catch(e){return console.warn("Local storage was downgraded to cookie",e),!1}}function p(e,t){var n={};return n.application_api_key=t,y.isBrowser()&&(w.Session.COOKIE===e.persistSession&&""!==_.get(l(t))?n.authtoken=_.get(l(t)):w.Session.LOCAL_STORAGE===e.persistSession&&O.get(l(t))&&(n.authtoken=O.get(l(t)).authtoken)),n}function l(e){return U+"_"+e}var h=e(72),d=e(150),g=(e(1),e(9)),m=e(24),y=e(33),v=e(27),b=e(29)(),w=e(8),x=e(21),A=e(15),E=e(26),k=e(12),S=e(5),_=e(22),O=e(23),C=e(10),R=(e(3),e(4),e(32));e(20);var U="bauthtoken",j=t.exports=h.curry(function(e,n,i){var s={},a=w.Session[e.persistSession];if(y.isObject(n)||!n)throw new Error("Api Key not found");y.isBrowser()||(a=w.Session.NONE),s.options=void 0!==e.headers?e:P(i.host||e.host,y.isNumber(i.port)&&i.port||e.port,i.protocol||e.protocol,i.rtHost||e.rtHost,y.isNumber(i.rtPort)&&i.rtPort||e.rtPort,i.rtProtocol||e.rtProtocol,e.version,e.adaptor,p(e,n),a,w.CachePolicy[e.cachePolicy],e.app_info,e.analyticsConfig,e.socketData,e.isSessionUpdated,e.userJSON,y.isBoolean(i.isUserMetricsEnabled)?!!i.isUserMetricsEnabled:e.isUserMetricsEnabled,e.metaData),s.Class=g(s,{},{}),s.ClassCons=y.wrapper(g(s,{}),[{}]),y.copyProperties(s.Class,g);var u=(v(s,s.Class(C.APP_USER_CLS)),v(s,s.Class(C.APP_USER_CLS),{},{},{})),c=x(s,s.Class(C.APP_ROLE_CLS),{},{},{}),f=A(s,s.Class(C.APP_INSTALLATION_CLS),{},{},{}),l=E(s,s.Class(C.APP_USER_ROLE_MAPPER),{},{},{}),h=m(s,{},{}),d=S(s,{},[]),_=k.execute(s),O=m(s);s.User=y.wrapper(u,[{}]),y.copyProperties(s.User,v),s.User.isAuthenticated=v.isAuthenticated(s),s.User.getSession=v.getSession(s),s.User.getCurrentUser=v.getSession(s),s.User.setSession=v.setSession(s),s.User.clearSessinoon=v.clearSession(s),s.User.generateAuthtoken=v.generateAuthtoken(s),s.User.anyAuth=v.anyAuth(s),s.Upload=y.wrapper(h,[{}]),y.copyProperties(s.Upload,m),s.UploadCons=y.wrapper(O,[{},{},{}]),y.copyProperties(s.UploadCons,m),s.Role=y.wrapper(c,[{}]),y.copyProperties(s.Role,x),s.Role.getRoleQuery=s.Role.getRoleQuery(s),s.Installation=y.wrapper(f,[{}]),y.copyProperties(s.Installation,A),s.UserRoleMapper=y.wrapper(l,[{}]),y.copyProperties(s.UserRoleMapper,E),s.Extension={},s.Extension.execute=y.wrapper(_,[null,null]),s.Analytics=y.wrapper(d,[e.analyticsConfig.trackAnonymously,1,{"static":{},dynamic:function(){return{}}}]);var R=b.build(t.exports,s);return r(R),o(R),R.sendUserMetrics(),R}),P=t.exports.consOptions=h.curry(function(e,t,n,r,o,i,s,a,u,c,f,p,l,h,d,g,m,y){return{host:e,port:t,protocol:n,rtHost:r,rtPort:o,rtProtocol:i,version:s,adaptor:a,headers:u,persistSession:c,cachePolicy:f,app_info:p,analyticsConfig:l,socketData:h,isSessionUpdated:d,userJSON:g,isUserMetricsEnabled:m,metaData:y}}),T=t.exports.setAppOptions=function(e,t,n){var r=n.host,o=n.port,i=n.protocol,s=n.rtHost,a=n.rtPort,u=n.rtProtocol,c=n.version,f=n.adaptor,p=n.headers,l=n.persistSession,h=n.cachePolicy,d=n.app_info,g=n.analyticsConfig,m=n.socketData,y=n.isSessionUpdated,v=n.userJSON,b=n.isUserMetricsEnabled,w=n.metaData;switch(e){case"host":r=t;break;case"port":o=t;break;case"protocol":i=t;break;case"rtHost":s=t;break;case"rtPort":a=t;break;case"rtProtocol":u=t;break;case"version":c=t;break;case"adaptor":f=t;break;case"headers":p=t;break;case"persistSession":l=t;break;case"cachePolicy":h=t;break;case"app_info":d=t;break;case"analyticsConfig":g=t;break;case"socketData":m=t;break;case"isSessionUpdated":y=t;break;case"userJSON":v=t;break;case"isUserMetricsEnabled":b=t;break;case"metaData":w=t}return P(r,o,i,s,a,u,c,f,p,l,h,d,g,m,y,v,b,w)},L=t.exports.getOptions=h.prop("options");b.define("getOptions",1);var M=t.exports.getOption=function(e,t){return h.prop(e,L(t))};b.define("getOption",2);var N=t.exports.setOptions=h.curry(function(e,t){return j(e,H(t),{})});b.define("setOptions",2),t.exports.setSession=function(e,t){if(!e.authtoken)throw new Error("Authtoken not found in JSON");var n=!1;return y.isBrowser()&&(t.getOption("persistSession")!=w.Session.NONE&&(n=!0),i(e,t)),t.getOption("persistSession")===w.Session.MEMORY&&(n=!0),n&&(t.setAuthToken(e.authtoken),t.setUserJSON(e)),t.sendUserMetrics(!0),w.Events.trigger("user:save-session"),t},b.define("setSession",2),t.exports.clearSession=function(e){return e.setUserJSON(null),e.removeAuthToken(),y.isBrowser()&&(w.Session.COOKIE===L(e).persistSession?_["delete"](l(H(e))):w.Session.LOCAL_STORAGE===L(e).persistSession&&O["delete"](l(H(e)))),e.sendUserMetrics(!0),w.Events.trigger("user:clear-session"),e},b.define("clearSession",1),t.exports.getSession=function(e,t){var n=L(t).persistSession;if(t.isSessionUpdated()&&n!==w.Session.NONE||(e=!0),e)return t.setSessionUpdate(!0),s(t);var r=t.getUserJSON();if(r)return d(u(r,t));if(n===w.Session.COOKIE)return t=t.setAuthToken(_.get(l(H(t)))),s(t);if(n===w.Session.LOCAL_STORAGE){var o=d.defer(),i=O.get(l(H(t)));return i?o.resolve(t.Class(C.APP_USER_CLS).ObjectCons({},{},i,{})):o.reject(),o.promise}},b.define("getSession",2,[!1]),t.exports.generateAuthtoken=function(e,n,r,o){if(!h.prop("master_key",t.exports.getHeaders(o)))throw new Error("Master key not found in headers");if(!y.isQueryInstance(e))throw new Error("Query instance inappropriate");if(!y.isBoolean(n))throw new Error("Upsert argument should be a boolean value");if(!y.isObject(r))throw new Error("Update object inappropriate");var i={insert:n,query:e.getQueryObj(),application_user:r},s=y.getAdaptorObj("POST",t.exports.getURL(o)+"/application/users/generate_authtoken",t.exports.getHeaders(o),i,null);return a(o,s)},b.define("generateAuthtoken",4),t.exports.anyAuth=function(e,t,n,r){return t.device_type=y.getDeviceTypeFromUA(),r.Extension.execute(e,t,n).then(function(e){var t=r.Class(C.APP_USER_CLS).ObjectCons({},{},e.application_user,{});return r.setSession(t.toJSON()),t})},b.define("anyAuth",4);t.exports.setAuthToken=h.curry(function(e,t){if(t.getOption("persistSession")===w.Session.NONE)return t;var n=q(t);return n.authtoken=e,t.getOptions().userJSON=null,t});b.define("setAuthToken",2),t.exports.setUserJSON=h.curry(function(e,t){var n=T("userJSON",e,L(t));return t.options=n,t}),b.define("setUserJSON",2),t.exports.getUserJSON=function(e){return e.getOption("userJSON")},b.define("getUserJSON",1),t.exports.getAuthToken=function(e){return q(e).authtoken},b.define("getAuthToken",1),t.exports.removeAuthToken=function(e){var t=q(e);return delete t.authtoken,e},b.define("removeAuthToken",1);t.exports.isAuthenticated=function(e){return!!q(e).authtoken};b.define("isAuthenticated",1),t.exports.persistSessionWith=h.curry(function(e,t){e!==w.Session.LOCAL_STORAGE||f()||(e=w.Session.COOKIE);var n=L(t),r=T("persistSession",e,n),o=h.mixin(p(r,t.getApiKey(t)),n.headers);return r=T("headers",o,r),N(r,t)}),b.define("persistSessionWith",2);t.exports.validateCachePolicy=function(e,t){return!!w.CachePolicy[e]};b.define("validateCachePolicy",2),t.exports.setCachePolicy=h.curry(function(e,t){if(t.validateCachePolicy(e)){{var n=L(t),r=T("cachePolicy",e,n);N(r,t)}return N(r,t)}throw new Error("Invalid cache policy")}),b.define("setCachePolicy",2),t.exports.getCachePolicy=function(e){return L(e).cachePolicy},b.define("getCachePolicy",1);var B=t.exports.setHeader=h.curry(function(e,t,n){var r=L(n),o=h.mixin({},r.headers);o[e]=t;var i=T("headers",o,r);return N(i,n)});b.define("setHeader",3);var I=t.exports.removeHeader=h.curry(function(e,t){var n=L(t),r=h.mixin({},n.headers);delete r[e];var o=T("headers",r,n);return N(o,t)});b.define("removeHeader",2),t.exports.setHost=h.curry(function(e,t){var n=L(t),r=T("host",e,n),o=N(r,t);return o.sendUserMetrics(!0),o}),b.define("setHost",2);var D=h.curry(function(e,t,n){var r=L(n),o=T(e,t,r);return N(o,n)});t.exports.setRtHost=D("rtHost"),b.define("setRtHost",2),t.exports.setPort=h.curry(function(e,t){if("number"!=typeof e)throw new Error("Port number should be number");var n=L(t),r=T("port",e,n),o=N(r,t);return o.sendUserMetrics(!0),o}),b.define("setPort",2),t.exports.setRtPort=h.curry(function(e,t){if("number"!=typeof e)throw new Error("Port number should be number");return D("rtPort",e,t)}),b.define("setRtPort",2),t.exports.setProtocol=h.curry(function(e,t){if("http"!==e&&"https"!==e)throw new Error("Supported protocols are http and https");var n=L(t),r=T("protocol",e,n),o=N(r,t);return o.sendUserMetrics(!0),o}),b.define("setProtocol",2),t.exports.setRtProtocol=h.curry(function(e,t){if("http"!==e&&"https"!==e)throw new Error("Supported protocols are http and https");return D("rtProtocol",e,t)}),b.define("setRtProtocol",2),t.exports.setMasterKey=B("master_key"),b.define("setMasterKey",2),t.exports.setApiKey=B("application_api_key"),b.define("setApiKey",2),t.exports.getMasterKey=function(e){return e.getHeaders().master_key},b.define("getMasterKey",1),t.exports.setTenant=B("tenant_uid"),b.define("setTenant",2),t.exports.removeMasterKey=I("master_key"),b.define("removeMasterKey",1),t.exports.removeTenant=I("tenant_uid"),b.define("removeTenant",1);var q=t.exports.getHeaders=function(e){return e.options.headers};b.define("getHeaders",1);t.exports.getURL=function(e){var t=L(e);return t.protocol+"://"+t.host+":"+t.port+"/"+t.version};b.define("getURL",1),t.exports.getVersion=function(e){return L(e).version},b.define("getVersion",1),t.exports.setVersion=h.curry(function(e,t){var n=L(t),r=T("version",e,n);return N(r,t)}),b.define("setVersion",2),t.exports.setAdaptor=h.curry(function(t,n){var r=L(n),o=h.mixin({},e(t));t===w.Adaptor.SOCKET&&(o.makeCall=o.makeCall(n));var i=T("adaptor",o,r);return n.options=i,n}),b.define("setAdaptor",2),t.exports.setUserMetrics=h.curry(function(e,t){return N(T("isUserMetricsEnabled",e,L(t)),t)}),b.define("setUserMetrics",2),t.exports.enableUserMetrics=function(e){var t=e.setUserMetrics(!0);return t.sendUserMetrics(),t},b.define("enableUserMetrics",1),t.exports.disableUserMetrics=t.exports.setUserMetrics(!1),b.define("disableUserMetrics",1),t.exports.setSessionUpdate=h.curry(function(e,t){var n=L(t),r=T("isSessionUpdated",e,n);return t.options=r,t}),b.define("setSessionUpdate",2),t.exports.isSessionUpdated=function(e){return M("isSessionUpdated",e)},b.define("isSessionUpdated",1),t.exports.fetch=function(e){var n=L(e),r=e.options.adaptor,o=e.getURL()+"/applications/abc",i=y.getAdaptorObj("GET",o,t.exports.getHeaders(e),null,null);return r.makeCall(i).then(function(t){t=t.entity.application;var r={name:t.name,uid:t.uid,app_variables:t.application_variables};return N(T("app_info",r,n),e)})},b.define("fetch",1),t.exports.getName=function(e){return L(e).app_info.name},b.define("getName",1);var H=t.exports.getApiKey=function(e){return L(e).headers.application_api_key};b.define("getApiKey",1),t.exports.fetchApplicationClassesSchema=function(e){var n=y.getAdaptorObj("GET",t.exports.getURL(e)+"/classes",t.exports.getHeaders(e),null,null),r=e.options.adaptor;return r.makeCall(n)},b.define("fetchApplicationClassesSchema",1),t.exports.getLastActivities=function(e){var n={only_last_activity:!0},r=y.getAdaptorObj("GET",t.exports.getURL(e)+"/classes",t.exports.getHeaders(e),n,null),o=e.options.adaptor;return o.makeCall(r)},b.define("getLastActivities",1),t.exports.getAppVariables=function(e){return L(e).app_info.app_variables},b.define("getAppVariables",1),t.exports.sendUserMetrics=function(e,n){var r,o="";if(n.getOption("isUserMetricsEnabled")&&(!n.getOption("metaData").isUserMetricsSent||e)){if(y.isBrowser())try{r=O.get(n.getApiKey()+"_blt_uuid")}catch(i){r=_.get(n.getApiKey()+"_blt_uuid")}if(!r||e){if(n.getOption("metaData").isUserMetricsSent=!0,!n.getOption("analyticsConfig").trackAnonymously){var s=n.getOption("userJSON");o=s&&s.uid||""}var a={super_properties:R.generateUserMetrics(n.getApiKey(),o)},u=y.getAdaptorObj("POST",t.exports.getURL(n)+"/analytics/user_metrics",t.exports.getHeaders(n),a,null),c=n.options.adaptor;return c.makeCall(u)}}},b.define("sendUserMetrics",2,[!1]),t.exports.setTrackAnonymously=h.curry(function(e,t){var n=h.mixin({},t.getOptions()),r=h.mixin({},n.analyticsConfig),o=h.mixin({},n.metaData);r.trackAnonymously=e;var i=T("analyticsConfig",r,n);o.isUserMetricsSent=!1;var s=T("metaData",r,i);return N(s,t)}),b.define("setTrackAnonymously",2)},{1:1,10:10,12:12,15:15,150:150,20:20,21:21,22:22,23:23,24:24,26:26,27:27,29:29,3:3,32:32,33:33,4:4,5:5,72:72,8:8,9:9}],8:[function(e,t,n){pluginsHelper={plugins:[],registerPlugin:function(e,t){var n={};n[e]=t,this.plugins.push(n)}};var r=e(72),o=e(1),i=e(2),s=e(33),a=e(7),u=e(16),c=r.mixin({},o),f=e(11),p=e(18),l=e(10),h=e(13),d=e(14),g=e(25),m=e(30).Mixin;c.adaptor=e(3);var y="./adaptors/RestfullAdaptor",v=s.wrapper(a(c),["",{}]);t.exports.App=v;var b=s.wrapper(i,[{}]);t.exports.ACL=b;var w=s.wrapper(u,["",""]);t.exports.Location=w;var x=f;t.exports.Events=x;var A=s.wrapper(p,[{}]);t.exports.Presence=A;var E=d;t.exports.Group=E;var k=h;t.exports.GroupMultiple=k;var S=m;t.exports.Mixin=S;var _=g;t.exports.Upsert=_;var O={COOKIE:"COOKIE",LOCAL_STORAGE:"LOCAL_STORAGE",MEMORY:"MEMORY",NONE:"NONE"},l={APPLICATION_USER:l.APP_USER_CLS,APPLICATION_USER_ROLE:l.APP_ROLE_CLS,INSTALLATION:l.APP_INSTALLATION_CLS},C={ONLY_NETWORK:"ONLY_NETWORK",CACHE_ELSE_NETWORK:"CACHE_ELSE_NETWORK",NETWORK_ELSE_CACHE:"NETWORK_ELSE_CACHE",CACHE_THEN_NETWORK:"CACHE_THEN_NETWORK"},R={HTTP:y};t.exports.Constants=l,t.exports.Session=O,t.exports.CachePolicy=C,t.exports.Adaptor=R,s.copyProperties(t.exports.ACL,i),s.copyProperties(t.exports.App,a),s.copyProperties(t.exports.Location,u),s.copyProperties(t.exports.Presence,p),Built=t.exports,Built=t.exports},{1:1,10:10,11:11,13:13,14:14,16:16,18:18,2:2,25:25,3:3,30:30,33:33,7:7,72:72}],9:[function(e,t,n){function r(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onClassInstance&&t.realtime.onClassInstance(e)})}function o(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onObjectCons&&t.realtime.onObjectCons(e)})}var i=e(72),s=e(17),a=e(27),u=e(15),c=e(21),f=e(19),p=e(8),l=e(33),h=e(29)(),d="built_io_application_user",g="built_io_application_user_role",m="built_io_installation_data",y={};y[d]=a,y[g]=c,y[m]=u;t.exports=i.curry(function(e,n,p,y){var v={app:e,headers:n,data:p,uid:y,toJSON:function(){return p}},b=l.wrapper(s(e,v,{},{},{}),[{}]),w=l.wrapper(a(e,v,{},{},{}),[{}]),x=l.wrapper(c(e,v,{},{},{}),[{}]),A=l.wrapper(u(e,v,{},{},{}),[{}]),E=l.wrapper(s(e,v),[{},{},{},{}]),k=l.wrapper(a(e,v),[{},{},{},{}]),S=l.wrapper(c(e,v),[{},{},{},{}]),_=l.wrapper(u(e,v),[{},{},{},{}]);switch(y){case d:v.Object=w,v.ObjectCons=k,l.copyProperties(v.Object,a),l.copyProperties(v.ObjectCons,a);break;case g:v.Object=x,v.ObjectCons=S,l.copyProperties(v.Object,c),l.copyProperties(v.ObjectCons,c);break;case m:v.Object=A,v.ObjectCons=_,l.copyProperties(v.Object,u),l.copyProperties(v.ObjectCons,u);break;default:v.Object=b,v.ObjectCons=E,l.copyProperties(v.Object,s),l.copyProperties(v.ObjectCons,s)}var O=f(e,v,{},e.options.cachePolicy);return v.Query=i.wrap(O,function(e,t){return e(t?t:{})}),l.copyProperties(v.Query,f),r(v),o(v),h.build(t.exports,v)});t.exports.getHeaders=function(e){return e.headers},h.define("getHeaders",1);var v=t.exports.getCombinedHeaders=function(e){return{headers:i.mixin(e.headers,p.App.getHeaders(e.app))}};h.define("getCombinedHeaders",1),t.exports.getSchema=function(e){var t=e.app.options.adaptor,n=l.getAdaptorObj("GET",b(e),v(e).headers,null,null);return t.makeCall(n).then(function(e){return e.entity["class"].schema})},h.define("getSchema",1);var b=t.exports.getURL=function(e){return p.App.getURL(e.app)+"/classes/"+e.uid};h.define("getURL",1),t.exports.getUid=function(e){return e.uid},h.define("getUid",1),t.exports.isNew=function(e){return!!e.uid},h.define("isNew",1)},{15:15,17:17,19:19,21:21,27:27,29:29,33:33,72:72,8:8}],10:[function(e,t,n){t.exports.APP_USER_CLS="built_io_application_user",t.exports.APP_ROLE_CLS="built_io_application_user_role",t.exports.APP_INSTALLATION_CLS="built_io_installation_data",t.exports.APP_USER_ROLE_MAPPER="built_io_application_user_role_mapper",t.exports.UPLOAD_KEY_NAME="upload[upload]",t.exports.BASE_64_REGEX=/^data:([a-zA-Z]*\/[a-zA-Z+.-]*);(charset=[a-zA-Z0-9\-\/\s]*,)?base64,(\S+)/,t.exports.MIME_TYPES={ai:"application/postscript",aif:"audio/x-aiff",aifc:"audio/x-aiff",aiff:"audio/x-aiff",asc:"text/plain",atom:"application/atom+xml",au:"audio/basic",avi:"video/x-msvideo",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",cdf:"application/x-netcdf",cgm:"image/cgm","class":"application/octet-stream",cpio:"application/x-cpio",cpt:"application/mac-compactpro",csh:"application/x-csh",css:"text/css",dcr:"application/x-director",dif:"video/x-dv",dir:"application/x-director",djv:"image/vnd.djvu",djvu:"image/vnd.djvu",dll:"application/octet-stream",dmg:"application/octet-stream",dms:"application/octet-stream",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",docm:"application/vnd.ms-word.document.macroEnabled.12",dotm:"application/vnd.ms-word.template.macroEnabled.12",dtd:"application/xml-dtd",dv:"video/x-dv",dvi:"application/x-dvi",dxr:"application/x-director",eps:"application/postscript",etx:"text/x-setext",exe:"application/octet-stream",ez:"application/andrew-inset",gif:"image/gif",gram:"application/srgs",grxml:"application/srgs+xml",gtar:"application/x-gtar",hdf:"application/x-hdf",hqx:"application/mac-binhex40",htm:"text/html",html:"text/html",ice:"x-conference/x-cooltalk",ico:"image/x-icon",ics:"text/calendar",ief:"image/ief",ifb:"text/calendar",iges:"model/iges",igs:"model/iges",jnlp:"application/x-java-jnlp-file",jp2:"image/jp2",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",js:"application/x-javascript",kar:"audio/midi",latex:"application/x-latex",lha:"application/octet-stream",lzh:"application/octet-stream",m3u:"audio/x-mpegurl",m4a:"audio/mp4a-latm",m4b:"audio/mp4a-latm",m4p:"audio/mp4a-latm",m4u:"video/vnd.mpegurl",m4v:"video/x-m4v",mac:"image/x-macpaint",man:"application/x-troff-man",mathml:"application/mathml+xml",me:"application/x-troff-me",mesh:"model/mesh",mid:"audio/midi",midi:"audio/midi",mif:"application/vnd.mif",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",ms:"application/x-troff-ms",msh:"model/mesh",mxu:"video/vnd.mpegurl",nc:"application/x-netcdf",oda:"application/oda",ogg:"application/ogg",pbm:"image/x-portable-bitmap",pct:"image/pict",pdb:"chemical/x-pdb",pdf:"application/pdf",pgm:"image/x-portable-graymap",pgn:"application/x-chess-pgn",pic:"image/pict",pict:"image/pict",png:"image/png",pnm:"image/x-portable-anymap",pnt:"image/x-macpaint",pntg:"image/x-macpaint",ppm:"image/x-portable-pixmap",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",
potx:"application/vnd.openxmlformats-officedocument.presentationml.template",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",ppam:"application/vnd.ms-powerpoint.addin.macroEnabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroEnabled.12",potm:"application/vnd.ms-powerpoint.template.macroEnabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroEnabled.12",ps:"application/postscript",qt:"video/quicktime",qti:"image/x-quicktime",qtif:"image/x-quicktime",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",ras:"image/x-cmu-raster",rdf:"application/rdf+xml",rgb:"image/x-rgb",rm:"application/vnd.rn-realmedia",roff:"application/x-troff",rtf:"text/rtf",rtx:"text/richtext",sgm:"text/sgml",sgml:"text/sgml",sh:"application/x-sh",shar:"application/x-shar",silo:"model/mesh",sit:"application/x-stuffit",skd:"application/x-koan",skm:"application/x-koan",skp:"application/x-koan",skt:"application/x-koan",smi:"application/smil",smil:"application/smil",snd:"audio/basic",so:"application/octet-stream",spl:"application/x-futuresplash",src:"application/x-wais-source",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",svg:"image/svg+xml",swf:"application/x-shockwave-flash",t:"application/x-troff",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",texi:"application/x-texinfo",texinfo:"application/x-texinfo",tif:"image/tiff",tiff:"image/tiff",tr:"application/x-troff",tsv:"text/tab-separated-values",txt:"text/plain",ustar:"application/x-ustar",vcd:"application/x-cdlink",vrml:"model/vrml",vxml:"application/voicexml+xml",wav:"audio/x-wav",wbmp:"image/vnd.wap.wbmp",wbmxl:"application/vnd.wap.wbxml",wml:"text/vnd.wap.wml",wmlc:"application/vnd.wap.wmlc",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wrl:"model/vrml",xbm:"image/x-xbitmap",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xml:"application/xml",xpm:"image/x-xpixmap",xsl:"application/xml",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.12",xltm:"application/vnd.ms-excel.template.macroEnabled.12",xlam:"application/vnd.ms-excel.addin.macroEnabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.12",xslt:"application/xslt+xml",xul:"application/vnd.mozilla.xul+xml",xwd:"image/x-xwindowdump",xyz:"chemical/x-xyz",zip:"application/zip"}},{}],11:[function(e,t,n){var r=(e(72),e(33),e(29)(),{});r["http:start"]=[],r["http:end"]=[],r["upload:start"]=[],r["upload:end"]=[],r["user:register"]=[],r["user:activate"]=[],r["user:deactivate"]=[],r["user:login"]=[],r["user:logout"]=[],r["user:save-session"]=[],r["user:clear-session"]=[],r["user:set-current-user"]=[],t.exports.trigger=function(e,t){r[e].map(function(e){e(t)})},t.exports.on=function(e,t){var n=r[e];n.push(t)},t.exports.off=function(e,t){var n=r[e];if(2===arguments.length){var o=n.indexOf(t);o>-1&&n.splice(o,1)}else n=[]}},{29:29,33:33,72:72}],12:[function(e,t,n){function r(e,t){return t.getURL()+a+"/"+e}function o(e,t){t=t||{};var n=i.mixin(e.getHeaders(),t);return n}var i=e(72),s=e(33),a="/functions";t.exports.execute=i.curry(function(e,t,n,a){var u=e.options.adaptor,c=r(t,e),f=s.getAdaptorObj("POST",c,o(e,a),n,null);return u.makeCall(f).then(function(e){return i.prop("result",e.entity)})})},{33:33,72:72}],13:[function(e,t,n){function r(e){var t=e.data[e.field].slice(0),n=o.mixin({},e.data);return n[e.field]=t,n}var o=e(72),i=e(33),s=e(29)(),a=t.exports=o.curry(function(e,n){var r={};if(!i.isArray(n))throw new Error("Expected 'Array' found '"+typeof n+"'");n=JSON.parse(JSON.stringify(n)),r[e]=n;var o={data:r,field:e,_isGroupMultiple:!0,toJSON:function(){return r}};return s.build(t.exports,o)}),u=o.curry(function(e,t,n){var o=r(n);return o[n.field][e](t._isGroup||t._isGroupMultiple?t.toJSON():t),a(n.field,o[n.field])});t.exports.push=u("push"),s.define("push",2),t.exports.pop=u("pop",{}),s.define("pop",1),t.exports.shift=u("shift",{}),s.define("shift",1),t.exports.unshift=u("unshift"),s.define("unshift",2)},{29:29,33:33,72:72}],14:[function(e,t,n){function r(e,t){return e=e||{},o.mixin(e,t.data[t.field])}var o=e(72),i=e(33),s=e(29)(),a=e(8),u="$dummy",c=t.exports=o.curry(function(e,n){var r={};if(!i.isObject(n)||i.isArray(n))throw new Error("Expected JavaScript Object found '"+typeof n+"'");n.toJSON&&(n=n.toJSON()),n=JSON.parse(JSON.stringify(n)),r[e]=n;var o={data:r,field:e,_isGroup:!0,toJSON:function(){return e===u?r[e]:r}};return s.build(t.exports,o)});t.exports.set=o.curry(function(e,t,n){var o=r({},n);return o[e]=t,c(n.field,o)}),s.define("set",3),t.exports.get=o.curry(function(e,t){if(t.field===u)return t.toJSON()[e];var n=t.toJSON();return n[t.field][e]}),s.define("get",2),t.exports.assign=o.curry(function(e,t){var n=r({},t);return n=o.mixin(e,n),c(t.field,n)}),s.define("assign",2),t.exports.remove=o.curry(function(e,t){var n=r({},t);return n[e]&&delete n[e],c(t.field,n)}),s.define("remove",2);var f=o.curry(function(e,t,n,o,s){if(n.toJSON&&(n=n.toJSON()[t]),""!==o&&!i.isNumber(o))throw new Error("Index value inappropriate");var a=i.keyValue(t,i.keyValue(e,{data:n,index:o})),u=r(a,s);return c(s.field,u)}),p=o.curry(function(e,t,n){t=JSON.parse(JSON.stringify(t));var o=r({},n);return o[e]=t,c(n.field,o)});t.exports.setReference=o.curry(function(e,t,n){var r=t;if(i.isArray(t)){if(t[0]&&t[0].app){r=[];for(var o=0;o<t.length;o++){if(!t[o].getUid())throw new Error("Uid not found");r.push(t[o].getUid())}}}else t.app&&(r=t.getUid());return p(e,r,n)}),s.define("setReference",3),t.exports.setReferenceWhere=o.curry(function(e,t,n){var r={WHERE:t};return p(e,r,n)}),s.define("setReferenceWhere",3),t.exports.setReferenceWithObject=o.curry(function(e,t,n){var r=t;if(i.isArray(t)){if(t[0]&&t[0].app){r=[];for(var o=0;o<t.length;o++)r.push(t[o].toJSON())}}else t.app&&(r=t.toJSON());return p(e,r,n)}),s.define("setReferenceWithObject",3),t.exports.upsertForReference=p,s.define("upsertForReference",3),t.exports.pushValue=function(e,t,n){return f("PUSH",e,t,"",n)},s.define("pushValue",3),t.exports.updateValueAtIndex=function(e,t,n,r){return f("UPDATE",e,t,n,r)},s.define("updateValueAtIndex",4),t.exports.addGroup=function(e,t){var n=r(e.toJSON(),t);return c(t.field,n)},s.define("addGroup",2),t.exports.pullValue=function(e,t,n){return f("PULL",e,t,"",n)},s.define("pullValue",3),t.exports.pullValueAtIndex=function(e,t,n){return f("PULL",e,"",t,n)},s.define("pullValueAtIndex",3),t.exports.getGroupForKey=function(e,t){var n=r({},t);if(!n[e])throw new Error("Key not found in group");return i.isArray(n[e])?a.GroupMultiple(e,n[e]):c(e,n[e])},s.define("getGroupForKey",2)},{29:29,33:33,72:72,8:8}],15:[function(e,t,n){{var r=e(72),o=e(17),i=e(33),s=e(29)();t.exports=r.curry(function(e,n,r,i,a,u){var c=o(e,n,r,{},a,u);return c.cons=t.exports,s.build(t.exports,c)})}i.copyProperties(t.exports,o),t.exports.setCurrentTimeZone=function(e){var t=(new Date).getTimezoneOffset(),n=Math.abs(t)<60?(0>t?"+":"-")+"0:"+Math.abs(t):(0>t?"+":"-")+(Math.floor(Math.abs(t)/60)+":"+Math.abs(t)%60);return e.set("timezone",n)},s.define("setCurrentTimeZone",1),t.exports.setDeviceToken=t.exports.set("device_token"),s.define("setDeviceToken",2),t.exports.setDeviceType=t.exports.set("device_type"),s.define("setDeviceType",2),t.exports.setCredentailsName=t.exports.set("credentails_name"),s.define("setCredentailsName",2),t.exports.subscribeChannels=r.curry(function(e,t){if(!i.isArray(e))throw new Error("Channels should be array");return t.pushValue("subscribed_to_channels",e)}),s.define("subscribeChannels",2),t.exports.unsubscribeChannels=r.curry(function(e,t){if(!i.isArray(e))throw new Error("Channels should be array");return t.pullValue("subscribed_to_channels",e)}),s.define("unsubscribeChannels",2),t.exports.getDeviceToken=t.exports.get("device_token"),s.define("getDeviceToken",1),t.exports.getCredentailsName=t.exports.get("credentails_name"),s.define("getCredentailsName",1),t.exports.getDeviceType=t.exports.get("device_type"),s.define("getDeviceType",1),t.exports.getSubscribedChannelList=function(e){var t=e.get("subscribed_to_channels");return t&&i.isArray(t)?t:e.delta.subscribed_to_channels.PUSH.data},s.define("getSubscribedChannelList",1),t.exports.save=function(e){return e.getDeviceType()||(e=e.setDeviceType(i.getDeviceTypeFromUA())),e.get("uid")||(e=e.upsert({device_token:e.getDeviceToken()})),o.save(e).then(function(e){return e})},s.define("save",1)},{17:17,29:29,33:33,72:72}],16:[function(e,t,n){function r(e,t){if("number"!=typeof e||"number"!=typeof t)throw new TypeError("Invalid data type");if(-180>e||e>180)throw new Error("Longitutde should be in the range of -180 to 180");if(-90>t||t>90)throw new Error("Latitude should be in the range of -90 to 90")}function o(e,t,n,r,o){var i=Math.PI/180,s=6378.1*o,a=t*i,u=e*i,c=r*i,f=n*i,p=u-f,l=a-c,h=Math.pow(Math.sin(l/2),2)+Math.cos(a)*Math.cos(c)*Math.pow(Math.sin(p/2),2),d=2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),g=s*d;return Math.ceil(g)}var i=e(72),s=(e(33),e(29)()),a=e(150),u=t.exports=function(e,n){var o={};e&&n&&r(e,n),o.longitude=e,o.latitude=n;var i={toJSON:function(){return o},data:o};return s.build(t.exports,i)};t.exports.setLocation=i.curry(function(e,t,n){return u(e,t)}),s.define("setLocation",3),t.exports.getCurrentLocation=function(){var e=a.defer();return"undefined"!=typeof navigator&&"undefined"!=typeof navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(t){return e.resolve(u(t.coords.longitude,t.coords.latitude))},function(t){e.reject(t)}),e.promise},t.exports.kilometersFrom=function(e,t){var n=e.toJSON(),r=t.toJSON();return o(r.longitude,r.latitude,n.longitude,n.latitude,1)},s.define("kilometersFrom",2),t.exports.metersFrom=function(e,t){var n=e.toJSON(),r=t.toJSON();return o(r.longitude,r.latitude,n.longitude,n.latitude,1e3)},s.define("metersFrom",2),t.exports.milesFrom=function(e,t){var n=e.toJSON(),r=t.toJSON();return o(r.longitude,r.latitude,n.longitude,n.latitude,.621371)},s.define("milesFrom",2)},{150:150,29:29,33:33,72:72}],17:[function(e,t,n){function r(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onObjectInstance&&t.realtime.onObjectInstance(e)})}function o(e,t){return e.cls.ObjectCons(e.headers,{},t,{})}function i(e,t){var n;return n=e?e.extend({sync:a(t)}):s(t)}function s(e){var t=Backbone.Model.extend({idAttribute:"uid",sync:a(e)});return t}function a(e){return function(t,n,r){2==arguments.length&&(r=n,n=this),r=r||{};var o=l.mixin(n.changed,p(e)),i=e.cls.ObjectCons(e.headers,f(e),w(e),o);return"read"==t?i.fetch().then(function(e){r.success(e.toJSON())},function(e){r.error(e)}):"create"==t||"update"==t?i.save().then(function(e){r.success(e.toJSON())},function(e){r.error(e)}):"delete"==t&&i["delete"]().then(function(e){r.success(e)},function(e){r.error(e)}),null}}function u(e,t,n,r){if(!h.isNumber(n))throw new Error("Not a number");var o=l.mixin({},p(r)),i=!!p(r)[t];return console.log("keyPresent",i),i?o[t][e]=n:o[t]=h.keyValue(e,n),r.cls.ObjectCons(r.headers,f(r),w(r),o)}function c(e,t,n,r,o){if(""!==r&&!h.isNumber(r))throw new Error("Index value inappropriate");var i=h.keyValue(t,h.keyValue(e,{data:n,index:r})),s=l.mixin(p(o),i);return o.cls.ObjectCons(o.headers,f(o),w(o),s)}function f(e){return e.query}function p(e){return e.delta}{var l=e(72),h=e(33),d=e(29)(),g=e(8),m="/objects",y=t.exports=l.curry(function(e,n,o,i,s,a){var u={},c={};u=h.isObject(a)?a:{uid:a},c=h.isEmpty(s)?u:s;var f={app:e,cls:n,headers:o,query:i,data:c,delta:u,toJSON:function(){return c}};return f=d.build(t.exports,f),r(f),f});t.exports.get=l.curry(function(e,t){return w(t)[e]||p(t)[e]})}d.define("get",2);var v=t.exports.getHeaders=function(e){return e.headers};d.define("getHeaders",1),t.exports.getCombinedHeaders=function(t){var n=e(9),r=n.getCombinedHeaders(t.cls),o=l.mixin(r.headers,t.headers);return o},d.define("getCombinedHeaders",1);t.exports.setHeader=l.curry(function(e,t,n){var r=n.headers,o=l.mixin({},r);return o[e]=t,n.cls.ObjectCons(o,f(n),w(n),p(n))});d.define("setHeader",3),t.exports.removeHeader=l.curry(function(e,t){var n=l.mixin({},t.headers);return delete n[e],t.cls.ObjectCons(n,f(t),w(t),p(t))}),d.define("removeHeader",2);var b=t.exports.getURL=function(t){var n=e(9);return t.isNew()?n.getURL(t.cls)+m+"/"+t.getUid():n.getURL(t.cls)+m};d.define("getURL",1),t.exports.decrement=l.curry(function(e,t,n){return u("SUB",e,t,n)}),d.define("decrement",3),t.exports.increment=l.curry(function(e,t,n){return u("ADD",e,t,n)}),d.define("increment",3);var w=t.exports.getData=function(e){return e.data};d.define("getData",1),t.exports.assign=l.curry(function(e,t){var n=l.mixin(w(t),e),r=l.mixin(p(t),e);return t.cls.ObjectCons(t.headers,f(t),n,r)}),d.define("assign",2);var x=t.exports.set=l.curry(function(e,t,n){var r=l.mixin({},w(n)),o=l.mixin({},p(n));return r[e]=t,o[e]=t,n.cls.ObjectCons(n.headers,f(n),r,o)});d.define("set",3);t.exports.getUid=function(e){return p(e).uid||w(e).uid};d.define("getUid",1),t.exports.setUid=x("uid"),d.define("setUid",2),t.exports.setTags=l.curry(function(e,t){var n=p(t);return n.tags=e,t.cls.ObjectCons(t.headers,f(t),w(t),n)}),d.define("setTags",2),t.exports.setLocation=l.curry(function(e,t){var n=l.mixin({},p(t)),r=e.toJSON();return n.__loc=[r.longitude,r.latitude],t.cls.ObjectCons(t.headers,f(t),w(t),n)}),d.define("setLocation",2),t.exports.getLocation=l.curry(function(e){var t=g.Location,n=e.get("__loc"),r=t(n[0],n[1]);return r}),d.define("getLocation",1),t.exports.isNew=function(e){return!!e.getUid()},d.define("isNew",1),t.exports.pushValue=l.curry(function(e,t,n){return c("PUSH",e,t,"",n)}),d.define("pushValue",3),t.exports.pullValue=l.curry(function(e,t,n){return c("PULL",e,t,"",n)}),d.define("pullValue",3),t.exports.updateValueAtIndex=l.curry(function(e,t,n,r){return c("UPDATE",e,t,n,r)}),d.define("updateValueAtIndex",4),t.exports.upsert=l.curry(function(e,t){var n=l.mixin({},p(t));return n.UPSERT=e,t.cls.ObjectCons(t.headers,f(t),w(t),n)}),d.define("upsert",2),t.exports.has=l.curry(function(e,t){return t.data.hasOwnProperty(e)}),d.define("has",2),t.exports.setACL=l.curry(function(e,t){var n=l.mixin({},p(t));return n.ACL=e.toJSON(),t.cls.ObjectCons(t.headers,f(t),w(t),n)}),d.define("setACL",2),t.exports.getACL=function(e){return g.ACL(e.get("ACL"))},d.define("getACL",1);t.exports.addGroup=l.curry(function(e,t){var n=l.mixin({},p(t));return e=JSON.parse(JSON.stringify(e)),n=l.mixin(e,n),t.cls.ObjectCons(t.headers,f(t),w(t),n)});d.define("addGroup",2),t.exports.setReference=l.curry(function(e,t,n){var r=l.mixin({},p(n)),o=t;if(h.isArray(t)){if(t[0]&&t[0].app){o=[];for(var i=0;i<t.length;i++){if(!t[i].getUid())throw new Error("Uid not found");o.push(t[i].getUid())}}}else t.app&&(o=t.getUid());return r[e]=o,n.cls.ObjectCons(n.headers,f(n),w(n),r)}),d.define("setReference",3),t.exports.setReferenceWithObject=l.curry(function(e,t,n){var r=l.mixin({},p(n)),o=t;if(h.isArray(t)){if(t[0]&&t[0].app){o=[];for(var i=0;i<t.length;i++)o.push(t[i].toJSON())}}else t.app&&(o=t.toJSON());return r[e]=o,n.cls.ObjectCons(n.headers,f(n),w(n),r)}),d.define("setReferenceWithObject",3),t.exports.setReferenceWhere=l.curry(function(e,t,n){var r=l.mixin({},p(n)),o={WHERE:t};return r[e]=o,n.cls.ObjectCons(n.headers,f(n),w(n),r)}),d.define("setReferenceWhere",3),t.exports.upsertForReference=l.curry(function(e,t,n){var r=l.mixin({},p(n));return r[e]=t,n.cls.ObjectCons(n.headers,f(n),w(n),r)}),d.define("upsertForReference",3),t.exports.timeless=function(e){var t=v(e);return t.timeless=!0,e.cls.ObjectCons(t,f(e),w(e),p(e))},d.define("timeless",1);var A=t.exports.addQuery=l.curry(function(e,t,n){var r=l.mixin({},f(n));return r[e]=t,n.cls.ObjectCons(n.headers,r,w(n),p(n))});d.define("addQuery",3),t.exports.includeOwner=A("include_owner",!0),d.define("includeOwner",1),t.exports.include=A("include"),d.define("include",2);var E=l.curry(function(e,t,n,r){var o=l.mixin({},f(r));return o[e]=o[e]?l.mixin(o[e],h.keyValue(t,n)):h.keyValue(t,n),r.cls.ObjectCons(v(r),o,w(r),p(r))});t.exports.except=E("except","BASE"),d.define("except",2),t.exports.exceptReference=E("except"),d.define("exceptReference",3),t.exports.only=E("only","BASE"),d.define("only",2),t.exports.onlyReference=E("only"),d.define("onlyReference",3),t.exports.saveAsDraft=function(e){var n=l.mixin({},p(e));n.published=!1;var r=e.cls.ObjectCons(e.headers,f(e),w(e),n);return t.exports.save(r)},d.define("saveAsDraft",1),t.exports.save=function(e){var n,r={object:p(e)},i=e.app.options.adaptor;n=e.isNew()?"PUT":"POST";var s=f(e);0===Object.keys(s).length&&(s=null);var a=h.getAdaptorObj(n,b(e),t.exports.getCombinedHeaders(e),r,s);return i.makeCall(a).then(function(t){if(t.entity.count){var n=[];return n.push(t.entity.count),n.push(o(e,t.entity.object)),n}return o(e,t.entity.object)})},d.define("save",1),t.exports.fetch=function(e){var n=e.app.options.adaptor,r=h.keyValue("_method","GET");if(r=l.mixin(r,f(e)),!e.isNew())throw new Error("Uid not found");var o=h.getAdaptorObj("POST",t.exports.getURL(e),t.exports.getCombinedHeaders(e),r,null);return n.makeCall(o).then(function(t){return e.cls.ObjectCons(v(e),f(e),t.entity.object,p(e))})},d.define("fetch",1),t.exports["delete"]=function(e){var n=e.app.options.adaptor;if(!e.isNew())throw new Error("Uid not found");var r=h.getAdaptorObj("DELETE",t.exports.getURL(e),t.exports.getCombinedHeaders(e),null,null);return n.makeCall(r).then(function(e){return null})},d.define("delete",1),t.exports.getGroupForKey=function(e,t){var n=t.get(e);if(!n)throw new Error("Key not found in object");return h.isArray(n)?g.GroupMultiple(e,n):g.Group(e,n)},d.define("getGroupForKey",2),t.exports.toBackboneModel=function(e,t){if(!h.backboneExist())throw new Error("BACKBONE not included");var n=i(e,t);return h.isObject(t)?new n(t.toJSON()):void 0},d.define("toBackboneModel",2,[null]),y.BackboneCollection=function(e){var t=this;if(h.backboneExist()){if(e.objects){var n=Backbone.Collection.extend({sync:function(n,r,o){2==arguments.length&&(o=r,r=this),o=o||{};var s=this;if("read"===n&&t){var a=t.cls.Query();a.exec().then(function(t){for(var n=0;n<t.length;n++)if("object"==typeof t[n]){var r=i(e.model,t[n]);s.add(new r(t[n].toJSON()))}o.success(s.models)},function(e){o.error(e)})}return null}});n=new n;for(var r=0;r<e.objects.length;r++)if("object"==typeof e.objects[r]){var o=i(e.model,e.objects[r]);n.add(new o(e.objects[r].toJSON()))}return n}if(e.query){var n=Backbone.Collection.extend({sync:function(t,n,r){2==arguments.length&&(r=n,n=this),r=r||{};var o=this;if("read"==t){var s=e.query;s.exec().then(function(t){for(var n=0;n<t.length;n++){var s=i(e.model,t[n]);o.add(new s(t[n].toJSON()))}r.success(o.models)},function(e){r.error(e)})}return null}});return new n}new Error("Config argument not set properly")}}},{29:29,33:33,72:72,8:8,9:9}],18:[function(e,t,n){function r(e){return o.mixin({},u(e))}var o=e(72),i=e(150),s=(e(33),e(29)()),a=(e(8),t.exports=o.curry(function(e,n){var r={toJSON:function(){return n},data:n,app:e};return s.build(t.exports,r)})),u=o.prop("data"),c=t.exports.set=o.curry(function(e,t,n){var o=r(n);return o[e]=t,a(n.app,o)});t.exports.enable=c("enabled"),s.define("enable",2),t.exports.getLastSeen=function(e){return e.get("last_seen")},s.define("getLastSeen",1),t.exports.getStatus=function(e){return e.get("status")},s.define("getStatus",1),t.exports.save=function(e){return p("setPresence",u(e),e)},s.define("save",1);var f=t.exports.get=o.curry(function(e,t){return o.prop(e,u(t))});s.define("get",2),t.exports.isEnabled=f("enabled"),s.define("isEnabled",1),t.exports.getApplicationUser=function(e){return o.prop("application_user",u(e))},s.define("getApplicationUser",1);var p=o.curry(function(e,t,n){function r(n){n.emit(e,t,function(e,t){e&&s.reject(e),!e&&t&&s.resolve(a(o,t.presence))})}var o=n.app,s=(o.getSocket(),i.defer());return o.isSocketConnected()?o.isSocketAuthStarted()?o.getAdhocOperations().push(r):r(o.getSocket()):o.getAdhocOperations().push(r),s.promise})},{150:150,29:29,33:33,72:72,8:8}],19:[function(e,t,n){function r(e,t){return g.isArray(e)?t(e):o(e,t)}function o(e,t){var n={};return e.created_at&&(n.created=t(e.created_at)),e.deleted_at&&(n.deleted=t(e.deleted_at)),e.updated_at&&(n.updated=t(e.updated_at)),n}function i(e){return e}function s(e){var t=d.mixin({},E(e));return e.getBlacklist()&&(t=u(t,e.getBlacklist())),{conditions:t,headers:e.headers,className:e.cls.uid,apiKey:e.app.getApiKey()}}function a(e,t){for(var n in e)n===t?delete e[n]:g.isArray(e[n])?e[n].map(function(e){a(e,t)}):"object"==typeof e[n]&&a(e[n],t);return e}function u(e,t){for(var n=JSON.parse(JSON.stringify(e)),r=0;r<t.length;r++)n=a(n,t[r]);return n}function c(e){return y(JSON.stringify(e))}function f(e){var t=v.defer();if(g.isLocalStroageAvaliable()){var n=localStorage.getItem(e);n?t.resolve(JSON.parse(n)):t.reject(null)}else t.reject();return t.promise}function p(e){var n=e.app.options.adaptor,r=d.mixin({},E(e));r._method="GET";var o=g.getAdaptorObj("POST",h(e),t.exports.getCombinedHeaders(e),r,null);return l(o,n)}function l(e,t){return t.makeCall(e).then(function(e){return e.entity})}function h(t){var n=e(9);return n.getURL(t.cls)+"/objects"}var d=e(72),g=e(33),m=(e(17),e(29)()),y=e(35).md5,v=e(150),b=e(8),w="BACKBONE_TRANSFORM",x="JSON_TRANSFORM",A=t.exports=d.curry(function(e,n,r,o,i){var s={app:e,cls:n,headers:r,cachePolicy:o,data:i||{}};return m.build(t.exports,s)}),E=t.exports.getConditions=d.prop("data");m.define("getConditions",1);var k=t.exports.getQueryObj=d.compose(d.prop("query"),E);m.define("getQueryObj",1),t.exports.getTransform=d.compose(d.prop("transform"),d.prop("data")),m.define("getTransform",1),t.exports.toJSON=function(e){var t=d.mixin({},E(e));return t.transform=x,A(e.app,e.cls,e.headers,e.cachePolicy,t)},m.define("toJSON",1),t.exports.toBackbone=function(e){var t=d.mixin({},E(e));return t.transform=w,A(e.app,e.cls,e.headers,e.cachePolicy,t)},m.define("toBackbone",1);var S=t.exports.setHeader=d.curry(function(e,t,n){var r=n.headers,o=d.mixin({},r);return o[e]=t,A(n.app,n.cls,o,n.cachePolicy,E(n))});m.define("setHeader",3);var _=t.exports.removeHeader=d.curry(function(e,t){var n=t.header,r=d.mixin({},n);return delete r[e],A(t.app,t.cls,r,t.cachePolicy,E(t))});m.define("removeHeader",2),t.exports.setMasterKey=S("master_key"),m.define("setMasterKey",2),t.exports.removeMasterKey=_("master_key"),m.define("removeMasterKey",1),t.exports.getHeaders=function(e){return e.headers},m.define("getHeaders",1),t.exports.getCombinedHeaders=function(t){var n=e(9),r=n.getCombinedHeaders(t.cls),o=d.mixin(r.headers,t.headers);return o},m.define("getCombinedHeaders",1);var O=d.curry(function(e,t,n){var r=d.mixin({},E(n)),o=d.mixin({},k(n));return o[t]={$exists:e},r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)});t.exports.exists=O(!0),m.define("exists",2),t.exports.doesNotExists=O(!1),m.define("doesNotExists",2);var C=d.curry(function(e,t,n,r,o){var i=d.mixin({},E(o)),s=d.mixin({},k(o));return s[t]=g.keyValue(e,{query:E(n).query,class_uid:n.cls.uid,key:r}),i.query=s,A(o.app,o.cls,o.headers,o.cachePolicy,i)});t.exports.select=C("$select"),m.define("select",4),t.exports.dontSelect=C("$dont_select"),m.define("dontSelect",4),t.exports.where=d.curry(function(e,t,n){var r=d.mixin({},E(n)),o=d.mixin({},k(n));return o[e]=t,r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)}),m.define("where",3);var R=t.exports.addQueryParams=d.curry(function(e,t,n){var r=d.mixin({},E(n));return r[e]=t,A(n.app,n.cls,n.headers,n.cachePolicy,r)});m.define("addQueryParams",3),t.exports.includeCount=R("include_count",!0),m.define("includeCount",1),t.exports.count=R("count",!0),m.define("count",1),t.exports.include=R("include"),m.define("include",2),t.exports.skip=R("skip"),m.define("skip",2),t.exports.limit=R("limit"),m.define("limit",2),t.exports.includeOwner=R("include_owner",!0),m.define("includeOwner",1),t.exports.includeSchema=R("include_schema",!0),m.define("includeSchema",1),t.exports.includeDrafts=R("include_unpublished",!0),m.define("includeDrafts",1),t.exports.onlyDrafts=function(e){var t=e.includeDrafts(),n=d.mixin({},E(t)),r=d.mixin({},k(t));return r.published=!1,n.query=r,A(e.app,e.cls,e.headers,e.cachePolicy,n)},m.define("onlyDrafts",1);var U=d.curry(function(e,t,n,r){var o=d.mixin({},E(r)),i=d.mixin({},k(r));return i[t]=g.keyValue(e,k(n)),o.query=i,A(r.app,r.cls,r.headers,r.cachePolicy,o)});t.exports.inQuery=U("$in_query"),m.define("inQuery",3),t.exports.notInQuery=U("$nin_query"),m.define("notInQuery",3),t.exports.matches=d.curry(function(e,t,n,r){var o=d.mixin({},E(r)),i=d.mixin({},k(r));return i[e]={$regex:t,$options:n},o.query=i,A(r.app,r.cls,r.headers,r.cachePolicy,o)}),m.define("matches",4,["i"]),t.exports.withinLocation=d.curry(function(e,t){var n=d.mixin({},E(t)),r=d.mixin({},k(t));if(!g.isArray(e))throw new Error("Locations should be a Array");if(e.length<3)throw new Error("Minimum 3 locations or objectUids required");var o=e.map(function(e){if(e.data)return[e.toJSON().longitude,e.toJSON().latitude];if(g.isString(e))return{object:e};throw new Error("Invalid parameter"+e)});return r.$within=o,n.query=r,A(t.app,t.cls,t.headers,t.cachePolicy,n)}),m.define("withinLocation",2),t.exports.containedIn=d.curry(function(e,t,n){var r=d.mixin({},E(n)),o=d.mixin({},k(n));return g.isArray(t)||(t=[t]),o[e]={$in:t},r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)}),m.define("containedIn",3),t.exports.notContainedIn=d.curry(function(e,t,n){var r=d.mixin({},E(n)),o=d.mixin({},k(n));return g.isArray(t)||(t=[t]),o[e]={$nin:t},r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)}),m.define("notContainedIn",3),t.exports.ascending=R("asc"),m.define("ascending",2),t.exports.descending=R("desc"),m.define("descending",2);var j=d.curry(function(e,t,n){var r=d.mixin({},E(n)),o=d.mixin({},k(n));o[e]=[];for(var i=0;i<t.length;i++){var s=E(t[i]);o[e].push(s.query),r=d.mixin(r,s)}return r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)});t.exports.and=j("$and"),m.define("and",2),t.exports.or=j("$or"),m.define("or",2);var P=d.curry(function(e,t,n,r){var o=d.mixin({},E(r)),i=d.mixin({},k(r));return i[t]=g.keyValue(e,n),o.query=i,A(r.app,r.cls,r.headers,r.cachePolicy,o)});t.exports.greaterThan=P("$gt"),m.define("greaterThan",3),t.exports.greaterThanOrEqualTo=P("$gte"),m.define("greaterThanOrEqualTo",3),t.exports.lessThan=P("$lt"),m.define("lessThan",3),t.exports.lessThanOrEqualTo=P("$lte"),m.define("lessThanOrEqualTo",3),t.exports.notEqualTo=P("$ne"),m.define("notEqualTo",3),t.exports.setCachePolicy=d.curry(function(e,t){if(t.app.validateCachePolicy(e))return A(t.app,t.cls,t.headers,e,E(t));throw new Error("Invalid cache policy")}),m.define("setCachePolicy",2);{var T=d.curry(function(e,t){if(g.isLocalStroageAvaliable())try{localStorage.setItem(e,JSON.stringify(t))}catch(n){n.stack||console.log("built.io sdk | Cache Error",n)}return t}),L=d.curry(function(e,t,n){t instanceof Date&&(t=t.toISOString());var r=d.mixin({},E(n)),o=d.mixin({},r.delta);return o[e]=t,r.delta=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)});t.exports.deltaCreatedFrom=L("created_at")}m.define("deltaCreatedFrom",2);t.exports.deltaUpdatedFrom=L("updated_at");m.define("deltaUpdatedFrom",2);t.exports.deltaDeletedFrom=L("deleted_at");m.define("deltaDeletedFrom",2),t.exports.deltaAll=L("ALL"),m.define("deltaAll",2);var M=d.curry(function(e,t){var n=e.cls.ObjectCons,o=Object.keys(t),s=t.objects,a=e.getTransform(),u=N(n);switch(a){case w:u=B(n);break;case x:u=i}if(o.length>1){var c=[];return c.push(r(s,u)),t.schema&&c.push(t.schema),t.count&&c.push(t.count),c}return g.isNumber(s)?s:r(s,u)}),N=d.curry(function(e,t){return t.map(function(t){return e({},{},t,{})})}),B=d.curry(function(e,t){var n=N(e,t),r=e.BackboneCollection({objects:n});return r});t.exports.exec=function(e){var t=c(s(e)),n=T(t),r=M(e);switch(e.cachePolicy){case b.CachePolicy.ONLY_NETWORK:return p(e).then(r);case b.CachePolicy.CACHE_ELSE_NETWORK:return f(t).then(r)["catch"](function(){return p(e).then(n).then(r)});case b.CachePolicy.NETWORK_ELSE_CACHE:return p(e).then(n).then(r)["catch"](function(e){return f(t).then(r)["catch"](function(){throw e})});case b.CachePolicy.CACHE_THEN_NETWORK:var o=function(){};return{cache:f(t).then(r).then(function(e){return o(null,e),e}),network:p(e).then(n).then(r).then(function(e){return o(null,e),e})["catch"](function(e){o(e,null)}),both:function(e){o=e}}}},m.define("exec",1),t.exports.setBlacklist=function(e,t){if(!g.isArray(e))throw new Error("Expected 'Array' found '"+typeof e+"'");var n=d.mixin({},E(t));return n.blacklists=e,A(t.app,t.cls,t.headers,t.cachePolicy,n)},m.define("setBlacklist",2),t.exports.getBlacklist=function(e){return E(e).blacklists},m.define("getBlacklist",1),t.exports.nearLocation=d.curry(function(e,t,n){t=t||1e3;var r=d.mixin({},E(n)),o=d.mixin({},k(n));if(e&&e.data&&g.isNumber(t)){var i=e.toJSON();o.$near={coords:[i.longitude,i.latitude],radius:t}}else{if(!g.isString(e)||!g.isNumber(t))throw new Error("Invalid parameters");o.$near={coords:{object:e},radius:t}}return r.query=o,A(n.app,n.cls,n.headers,n.cachePolicy,r)}),m.define("nearLocation",3,[null]),t.exports["delete"]=function(e){var n=e.app.options.adaptor,r=d.mixin({},E(e));r._method="DELETE";var o=g.getAdaptorObj("POST",h(e),t.exports.getCombinedHeaders(e),r,null);return l(o,n)["yield"](null)},m.define("delete",1);var I=d.curry(function(e,t,n,r){var o=d.mixin({},E(r));return o[e]=o[e]?d.mixin(o[e],g.keyValue(t,n)):g.keyValue(t,n),A(r.app,r.cls,r.headers,r.cachePolicy,o)});t.exports.except=I("except","BASE"),m.define("except",2),t.exports.exceptReference=I("except"),m.define("exceptReference",3),t.exports.only=I("only","BASE"),m.define("only",2),t.exports.onlyReference=I("only"),m.define("onlyReference",3),t.exports.setRawQuery=d.curry(function(e,t){var n=d.mixin({},E(t));return n.query=e,A(t.app,t.cls,t.headers,t.cachePolicy,n)}),m.define("setRawQuery",2)},{150:150,17:17,29:29,33:33,35:35,72:72,8:8,9:9}],20:[function(e,t,n){function r(e){var t=e.app;return t.isRealtimeEnabled&&t.isRealtimeEnabled()?t.isSocketConnected()?q(t)["yield"](e):(t.getMetaMap().authorization=q,e):e}function o(e,t,n,o){return e(t,n,o).then(function(e){return r(e)})}function i(e,t,n){return e(t,n).then(function(e){return r(e)})}function s(e,t,n){return e(t,n).then(function(e){return r(e)})}function a(e,t,n,o,i,s){return e(t,n,o,i,s).then(function(e){return r(e)})}function u(e,t){return e(t).then(function(e){return t.app.isRealtimeEnabled()?q(t.app)["yield"](e):e})}function c(e,t,n){e.getMetaMap()&&(e.getMetaMap()[t]=n)}function f(e,t){switch(e){case"connect":c(this,"connect",t);break;case"reconnect":c(this,"reconnect",t);break;case"auth":c(this,"auth",t);break;case"subscription":c(this,"subscription",t);break;case"disconnect":c(this,"disconnect",t);break;case"error":c(this,"errorHandler",t)}}function p(e,t){if(!Z.isString(e))throw new Error("Event name is invalid");if(!t)throw new Error("Callback to be removed is missing");this.getMetaMap()&&delete this.getMetaMap()[e]}function l(e,t,n){var r=n.getOptions(),o=X.mixin({},r.socketData);return o[e]=t,r.socketData=o,n.setOptions(r,n)}function h(e,t,n,r){var o="message."+t+"."+n;g(e,o,r)}function d(e,t,n,r){var o=e.getSocket(),i="channel."+t+"."+n,s="subscription."+t,a="isDone."+t;g(e,i,r),m(e,t,s),y(e,a,!1),e.isSocketConnected()&&e.getMetaMap()[s](o)}function g(e,t,n){var r=e.getMetaMap()[t]||[];r.push(n),e.getMetaMap()[t]=r}function m(e,t,n){var r="cache."+t;e.getMetaMap()[n]=function(n){var o="isDone."+t,i=e.getMetaMap()[o];if(i)return te.resolve();e.getMetaMap()[o]=!0;var s=te.defer();return n.emit("subscribe",{channel:t},function(t,n){!t&&n&&n.resource&&(e.getMetaMap()[r]=n.resource),t&&$(e,"errorHandler",t),s.resolve()}),s.promise}}function y(e,t,n){e.getMetaMap()[t]=n}function v(e,t){if(Z.isFunction(e))throw new Error("Event name is missing")}function b(e,t){var n="channel."+e,r="message."+e;Object.keys(t.getMetaMap()).map(function(e){(e.indexOf(n)>-1||e.indexOf(r)>-1)&&delete t.getMetaMap()[e];
})}function w(e,t,n){var r="channel."+e+"."+t;"broadcast"===t&&(r="message."+e+"."+t);var o=n.getMetaMap()[r];o&&delete n.getMetaMap()[r]}function x(e,t,n,r){var o="message."+t+"."+n;E(o,e,n,t,r)}function A(e,t,n,r){var o="channel."+t+"."+n;E(o,e,n,t,r)}function E(e,t,n,r,o){var i=t.getMetaMap()[e];if(i){var s=i.indexOf(o);i.splice(s,1),0===i.length&&delete t.getMetaMap()[e]}}function k(e,t,n){var r=X.pickBy(function(e){return e.indexOf("channel."+t)>-1||e.indexOf("message."+t)>-1?!0:!1},Object.keys(e.getMetaMap()));0===Object.keys(r).length&&delete e.getMetaMap()[n]}function S(e,t){if(!t.isNew())throw new Error("Uid not found");switch(e){case"object":return"notifications."+t.cls.uid+"."+t.getUid();case"class":return"notifications."+t.uid;case"upload":return"notifications.upload."+t.getUid()}}function _(e){var t,n=this,t=O(n);return e||(n=C(t,this)),n=n.setSocket(t),N(n),n.getSocket().once("connect",function(){$(n,"connect"),D(n)}),(n.isAuthenticated()||n.getHeaders().master_key)&&(n.getMetaMap().authorization=q),n}function O(e){var t=Math.ceil(1e7*Math.random()),n=e.getURLForRealtime(),r=Q(n,{query:"api_key="+e.getApiKey()+"&conn_id="+t,reconnectionAttempts:10,forceNew:!0});return r}function C(e,t){var n=t.addAdhocOpterations().addMetaMapp();return n}function R(e){U("create",e),U("update",e),U("delete",e),U("broadcast",e),U("presence",e)}function U(e,t){var n=t.getSocket();switch(e){case"broadcast":n.on(e,we(e,t));break;case"presence":n.on(e,be(e,t));break;default:n.on(e,xe(e,t))}}function j(e,t,n){switch(P(t.channel)){case"objectInst":return M(!0,e,t,n);case"object":return M(!1,e,t,n);case"uploadInst":return L(e,t,n);case"upload":return L(e,t,n);case"classInst":return T(e,t,n);case"class":return T(e,t,n);default:return te.resolve(t.resource)}}function P(e){return e.match(se)?"upload":e.match(ie)?"class":e.match(ae)?"object":e.match(fe)?"objectInst":e.match(ce)?"classInst":e.match(ue)?"uploadInst":void 0}function T(e,t,n){return te.resolve("delete"===e?t.resource:n.ClassCons(t.resource,t.resource.uid))}function L(e,t,n){return te.resolve("delete"===e?t.resource:n.UploadCons({},t.resource,t.resource.uid))}function M(e,t,n,r){var o=te.defer();if(e)var i="cache."+n.channel;else var i="cache."+oe+"."+n.classuid+"."+n.objectuid;if("update"===t)if(r.getMetaMap()[i]&&r.getMetaMap()[i]._version+1===n.version){var s=r.Class(n.classuid).ObjectCons({},{},ee.applyPatch(r.getMetaMap()[i],n.resource),n.objectuid);r.getMetaMap()[i]=s.toJSON(),o.resolve(s)}else r.Class(n.classuid).Object(n.objectuid).includeOwner().fetch().then(function(e){r.getMetaMap()[i]=e.toJSON(),o.resolve(e)});else o.resolve(r.Class(n.classuid).ObjectCons({},{},n.resource,n.resource.uid));return o.promise}function N(e){var t=e.getSocket(),n=t.io.socket("/");t.on("reconnect",function(){console.log("reconnecting socket"),$(e,"reconnect"),B(e),D(e)}),t.on("disconnect",function(){console.log("Socket disconnected"),$(e,"disconnect")}),t.on("error",function(t){console.log("Socket error:",t),$(e,"errorHandler",t),$(e,"error",t)}),n.on("error",function(t){console.log("Socket namespace error",t),$(e,"errorHandler",t),$(e,"error",t)})}function B(e){var t=Object.keys(e.getMetaMap()).filter(I);t.map(function(t){e.getMetaMap()[t]=!1})}function I(e){return 0===e.indexOf("isDone")?!0:!1}function D(e){console.log("Socket connected");var t=e.getSocket();t.removeAllListeners(),N(e),R(e);var n=te.resolve();e.getMetaMap().authorization&&(n=e.getMetaMap().authorization(e)),n.then(function(){return F(e)}).then(function(){$(e,"subscription")}).then(function(){e.isSocketAuthStarted()||J(e)})}function q(e){var t=te.defer();e.setAuthStarted(!0);var n=setInterval(function(){H(e).then(function(){clearInterval(n),t.resolve()})["catch"](function(e){clearInterval(n),t.reject(e)})},2e3);return H(e).then(function(){clearInterval(n),t.resolve()})["catch"](function(e){clearInterval(n),t.reject(e)}),t.promise}function H(e){var t=te.defer(),n=e.getSocket(),r={};return e.getAuthToken()&&(r.authtoken=e.getAuthToken()),e.getMasterKey()&&(r.master_key=e.getMasterKey()),n.emit("auth",r,function(n){n||(console.log("socket authorized"),$(e,"auth"),t.resolve()),n&&($(e,"errorHandler",n),t.reject(n)),e.setAuthStarted(!1)}),t.promise}function F(e){var t=Object.keys(e.getMetaMap()).filter(z);return te.map(t,function(t){return te.resolve(e.getMetaMap()[t](e.getSocket()))})}function J(e){e.getAdhocOperations().map(function(t){t(e.getSocket())}),e.options.socketData.adhocOperations=[]}function z(e){return 0===e.indexOf("subscription")?!0:!1}function W(){var e=this,t=e.getSocket();t.disconnect(),t.destroy(),t.removeAllListeners();var n=K(e);return n}function K(e){var t=e.getOptions(),n=X.mixin({},t),r=X.mixin({},t.socketData);return r=null,n.socketData=null,e.setOptions(n)}function Y(){return!!this.getSocket()}function V(e){this.getMetaMap()&&(this.getMetaMap().errorHandler=e)}function G(e){this.getMetaMap()&&(this.getMetaMap().connect=e)}function $(e,t,n){n=n||e,e.getMetaMap()[t]&&e.getMetaMap()[t](n)}var X=e(72),Q=e(86),Z=e(33),ee=(e(29)(),e(28)),te=e(150),ne=e(8),re=e(10),oe="notifications",ie=/^notifications\.class$/,se=/^notifications\.upload$/,ae=/^notifications\.(.*)\.object$/,ue=/^notifications\.upload\.(.*)$/,ce=/^notifications\.(.*)$/,fe=/^notifications\.(.*)\.(.*)$/;pluginsHelper.registerPlugin("realtime",{onAppInstance:function(e){var t=e.setAuthToken;e.onRealtimeConnect=G,e.enableRealtime=_,e.disableRealtime=W,e.isRealtimeEnabled=Y,e.onRealtimeError=V,e.authorizeSocket=q,e.on=f,e.off=p,e.setAuthToken=function(e){var n=this,r=t(e,n);return n.isRealtimeEnabled&&n.isRealtimeEnabled()&&(n.isSocketConnected()&&q(r),r.getMetaMap().authorization=q),r},e.addMetaMapp=function(){return l("metaMap",{},this)},e.addAdhocOpterations=function(){return l("adhocOperations",[],this)},e.setAuthStarted=function(e){return l("authStarted",e,this)},e.setSocket=function(e){return l("socket",e,this)},e.getSocket=function(e){return this.getOptions().socketData?this.options.socketData.socket:null},e.isSocketConnected=function(){return this.isRealtimeEnabled&&this.isRealtimeEnabled()?this.getOptions().socketData.socket.connected:null},e.getMetaMap=function(){return this.isRealtimeEnabled&&this.isRealtimeEnabled()?this.getOptions().socketData.metaMap:null},e.getAdhocOperations=function(){return this.isRealtimeEnabled&&this.isRealtimeEnabled()?this.getOptions().socketData.adhocOperations:null},e.isSocketAuthStarted=function(){return this.isRealtimeEnabled&&this.isRealtimeEnabled()?this.getOptions().socketData.authStarted:null},e.getURLForRealtime=function(){return this.getOption("rtProtocol")+"://"+this.getOption("rtHost")+":"+this.getOption("rtPort")+"/"+this.getApiKey()}},onObjectInstance:function(e){e.on=ge("object"),e.off=Z.wrapper(ye("object"),[null,null]),e.broadcast=pe("object")},onObjectCons:function(e){var t="notifications."+e.uid+".object";e.Object.on=me(e.app,t),e.Object.off=Z.wrapper(ve(e.app,t),[null,null]),e.Object.broadcast=le(e.app,t)},onClassCons:function(e){var t="notifications.class";e.Class.on=me(e,t),e.Class.off=Z.wrapper(ve(e,t),[null,null]),e.Class.broadcast=le(e,t)},onClassInstance:function(e){e.on=ge("class"),e.off=Z.wrapper(ye("class"),[null,null]),e.broadcast=pe("class")},onUploadCons:function(e){var t="notifications.upload";e.Upload.on=me(e,t),e.Upload.off=Z.wrapper(ve(e,t),[null,null]),e.Upload.broadcast=le(e,t)},onUploadInstance:function(e){e.on=ge("upload"),e.off=Z.wrapper(ye("upload"),[null,null]),e.broadcast=pe("upload")},onUserCons:function(e){var t=e.User.login,n=e.User.loginWithGoogle,r=e.User.loginWithFacebook,c=e.User.loginWithTwitter,f=e.User.logout,p="notifications."+re.APP_USER_CLS+".object";e.User.on=me(e,p),e.User.off=Z.wrapper(ve(e,p),[null,null]),e.User.broadcast=le(e,p),e.User.getPresence=e.User.getCurrentUserPresence=function(){return de("getPresence",{},e)},e.User.login=function(e,n,r){return o(t,e,n,r)},e.User.logout=function(e){return u(f,e)},e.User.loginWithGoogle=function(e,t){return i(n,e,t)},e.User.loginWithFacebook=function(e,t){return s(r,e,t)},e.User.loginWithTwitter=function(e,t,n,r,o){return a(c,e,t,n,r,o)}},onUserInstance:function(e){var t=e.login,n=e.loginWithGoogle,r=e.loginWithFacebook,c=e.loginWithTwitterT,f=e.logout;e.getPresence=function(t){var n=this;if(t)return te.resolve(ne.Presence(e.app,n.get("_presence")));if(!this.getUid())throw new Error("Uid not found");return de("getPresence",{application_user:this.getUid()},e.app)},e.login=function(e,n){var r=this;return o(t,e,n,r)},e.logout=function(){var e=this;return u(f,e)},e.loginWithGoogle=function(e){return i(n,e,this)},e.loginWithFacebook=function(e){return s(r,e,this)},e.loginWithTwitter=function(e,t,n,r){return a(c,e,t,n,r,this)}},onRoleCons:function(e){var t="notifications."+re.APP_ROLE_CLS+".object";e.Role.on=me(e,t),e.Role.off=Z.wrapper(ve(e,t),[null,null]),e.Role.broadcast=le(e,t)},onInstallationCons:function(e){var t="notifications."+re.APP_INSTALLATION_CLS+".object";e.Installation.on=me(e,t),e.Installation.off=Z.wrapper(ve(e,t),[null,null]),e.Installation.broadcast=le(e,t)}});var pe=X.curry(function(e,t){return le.bind(this)(this.app,S(e,this),t)}),le=X.curry(function(e,t,n){var r=this,o=e.getSocket(),i="subscription."+t,s=he(t,n,e);return e.getMasterKey()?e.isSocketConnected()?s(o):e.getAdhocOperations().push(s):(e.getMetaMap()[i]||m(e,t,i),e.isSocketConnected()?e.getMetaMap()[i](o).then(function(){s(o)}):e.getAdhocOperations().push(s),r)}),he=X.curry(function(e,t,n,r){r.emit("broadcast",{channel:e,data:t},function(e){e||console.log("broadcast done"),e&&$(n,"errorHandler",e)})}),de=X.curry(function(e,t,n){function r(r){r.emit(e,t,function(e,t){e&&o.reject(e),e||(t?o.resolve(ne.Presence(n,t.presence)):o.resolve())})}var o=te.defer();return n.isSocketConnected()?r(n.getSocket(),o):n.getAdhocOperations().push(r),o.promise}),ge=X.curry(function(e,t,n){return me.bind(this)(this.app,S(e,this),t,n)}),me=X.curry(function(e,t,n,r){var o=this;switch(n){case"presence":g(e,n,r);break;case"broadcast":h(e,t,n,r);default:d(e,t,n,r)}return o}),ye=X.curry(function(e,t,n){return ve.bind(this)(this.app,S(e,this),t,n)}),ve=X.curry(function(e,t,n,r){var o=this;v(n,r),null===r&&null===n?b(t,e):null===r?w(t,n,e):"broadcast"===n?x(e,t,n,r):A(e,t,n,r);var i="subscription."+t;return k(e,t,i),o}),be=X.curry(function(e,t,n){t.getMetaMap()[e]&&t.getMetaMap()[e].map(function(e){var r=X.mixin({},n.presence);r.application_user=n.application_user,e(ne.Presence(t,r))})}),we=X.curry(function(e,t,n){var r="message."+n.channel+"."+e;t.getMetaMap()[r]&&t.getMetaMap()[r].map(function(e){e(n.resource)})}),xe=X.curry(function(e,t,n){var r="channel."+n.channel+"."+e;t.getMetaMap()[r]&&j(e,n,t).then(function(e){t.getMetaMap()[r].map(function(t){t(e)})})})},{10:10,150:150,28:28,29:29,33:33,72:72,8:8,86:86}],21:[function(e,t,n){function r(e){return u.mixin({},i(e))}function o(e){return u.mixin({},s(e))}function i(e){return e.delta}function s(e){return e.data}function a(e,t){var n;if(s(t)[e])var n=[].concat(s(t)[e]);else n=[];return n}{var u=e(72),c=e(33),f=e(29)(),p=e(17),l=e(10);t.exports=u.curry(function(e,n,r,o,i,s){var a=p(e,n,r,{},i,s);return f.build(t.exports,a)})}c.copyProperties(t.exports,p),t.exports.getRoleQuery=function(e){return function(){return e.Class(l.APP_ROLE_CLS).Query()}};var h=u.curry(function(e,t,n){c.isObject(t)&&t.get("uid")&&(t=t.get("uid"));var i=r(n),s=o(n),u=a(e,n);return u.push(t),i[e]=u,s[e]=u,n.cls.ObjectCons(n.getHeaders(),{},s,i)});t.exports.addRole=h("roles"),f.define("addRole",2),t.exports.addUser=h("users"),f.define("addUser",2),t.exports.addRoles=u.curry(function(e,t){var n=u.mixin({},t);return e.forEach(function(e){n=n.addRole(e)}),n}),f.define("addRoles",2),t.exports.addUsers=u.curry(function(e,t){var n=u.mixin({},t);return e.forEach(function(e){n=n.addUser(e)}),n}),f.define("addUsers",2),t.exports.setUsersWithQuery=u.curry(function(e,t){var n=r(t);return e.app&&(e=e.data),n.users=e,t.cls.ObjectCons(t.getHeaders(),{},t.data,n)}),f.define("setUsersWithQuery",2),t.exports.getName=t.exports.get("name"),f.define("getName",1),t.exports.getRoles=t.exports.get("roles"),f.define("getRoles",1),t.exports.getRoleUid=t.exports.get("uid"),f.define("getRoleUid",1),t.exports.getUsers=t.exports.get("users"),f.define("getUsers",1),t.exports.setName=t.exports.set("name"),f.define("setName",2),t.exports.setRoleUid=t.exports.set("uid"),f.define("setRoleUid",2);var d=u.curry(function(e,t,n){return u.contains(t,s(n)[e])});t.exports.hasRole=d("roles"),f.define("hasRole",2),t.exports.hasUser=d("users"),f.define("hasUser",2);var g=u.curry(function(e,t,n){var i=r(n),s=o(n),u=a(e,n),c=u.indexOf(t);return c>-1&&u.splice(c,1),i[e]=u,s[e]=u,n.cls.ObjectCons(n.getHeaders(),{},s,i)});t.exports.removeRole=g("roles"),f.define("removeRole",2),t.exports.removeUser=g("users"),f.define("removeUser",2)},{10:10,17:17,29:29,33:33,72:72}],22:[function(e,t,n){function r(){return window.location.host.match("localhost")?"":"."+window.location.host}var o=t.exports.set=function(e,t){document.cookie=e+"="+t+";domain="+r()+";path=/"};t.exports["delete"]=function(e){o(e,"")},t.exports.get=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(-1!=o.indexOf(t))return o.substring(t.length,o.length)}return""}},{}],23:[function(e,t,n){t.exports.set=function(e,t){t=JSON.stringify(t),window.localStorage.setItem(e,t)},t.exports["delete"]=function(e){window.localStorage.removeItem(e)},t.exports.get=function(e){return window.localStorage.getItem(e)?JSON.parse(window.localStorage.getItem(e)):void 0}},{}],24:[function(e,t,n){(function(n){function r(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onUploadInstance&&t.realtime.onUploadInstance(e)})}function o(e,t){if(E(t))e.encodedUpload=i(t);else if(O.isBrowser())if("undefined"!=typeof t[0])e.file=t[0];else{if(!(t&&(1===t.nodeType||9===t.nodeType)||"undefined"!=typeof FormData&&t instanceof FormData||"undefined"!=typeof File&&t instanceof File))throw new Error("The parameter is not valid or not supported by the platform. Please pass an html input elment.");e.file=t}else if(t.indexOf("://")>=0)e.file=t;else if(k.existsSync(t)){if(!k.statSync(t).isFile())throw new Error("invalid file path: "+t);e.file=t}return e}function i(e){var t=/\.([^.]*)$/.exec(e.name);t&&(t=t[1].toLowerCase());var r=e.contentType||U.MIME_TYPES[t]||"text/plain";if(e.bytes)return{bytesData:e.bytes,contentType:r,name:e.name};if(e.base64){var o=e.base64,i=U.BASE_64_REGEX.exec(o);i&&i.length>0&&(o=4===i.length?i[3]:i[2],r=i[1]);var s=new n(o,"base64");return{bytesData:s,contentType:r,name:e.name}}throw new Error("Invalid file format")}function s(e){return e.data}function a(e){return e.params}function u(e){return I(e)?"PUT":"POST"}function c(e){if(D(e)instanceof FormData)return D(e);if("undefined"!=typeof File&&D(e)instanceof File){var t=new FormData;return t.append("upload[upload]",D(e)),t}if(!D(e)||1!==D(e).nodeType&&9!==D(e).nodeType)throw new Error("HTML input file element or FormData or File required");var t=new FormData;if("file"==D(e).getAttribute("type"))return t.append("upload[upload]",D(e).files[0]),t;throw new Error("input file element required")}function f(e){if("https://api.built.io"===e.origin){var t=e.data?e.data:e.message;t=JSON.parse(t);var n=t.postmessage_payload;N[n](t),delete N[n],l(n)}}function p(){window?window.addEventListener("message",f,!1):window.attachEvent("onmessage",f)}function l(e){var t=document.getElementById("builtUploadForm"+e),n=document.getElementById("builtIFrame"+e);t.parentNode.removeChild(t),n.parentNode.removeChild(n)}function h(e){var n=e.app.options.adaptor,r={},o=c(e);return r.formData=o,r.headers=t.exports.getCombinedHeaders(e),r.url=t.exports.getURL(e),o.append("PARAM",JSON.stringify({upload:a(e)})),o.append("_method",u(e)),delete r.headers["Content-Type"],n.makeXMLHttpRequest(r).then(function(t){var n=JSON.parse(t);return B(e.app,e.headers,n.upload,n.upload.uid)})}function d(e){return O.isString(s(e).file)?m(e):g(s(e).encodedUpload,e)}function g(e,t){var e=s(t).encodedUpload;return y(e.contentType,e.name,e.bytesData,t)}function m(e){var t=/\.([^.]*)$/.exec(s(e).file);t&&(t=t[1].toLowerCase());var n=D(e),r=U.MIME_TYPES[t],o=M.basename(n),i=k.readFileSync(n);return y(r,o,i,e)}function y(e,n,r,o){var i=v(o),s=t.exports.getCombinedHeaders(o),u=JSON.stringify({PARAM:{upload:a(o)}}),c=[{contentType:e,keyName:U.UPLOAD_KEY_NAME,fileName:n,data:r}];return R.postData(u,c,i,s).then(function(e){var t=JSON.parse(e);return B(o.app,o.headers,t.upload,t.upload.uid)})}function v(e){var n=t.exports.getURL(e),r="",o="",i="POST";e.getUid()&&(i="PUT"),"http://"===n.substr(0,7)?r=n.split("http://")[1].split(":")[0]:"https://"===n.substr(0,8)&&(r=n.split("https://")[1].split(":")[0]);for(var s=n.split("https://")[1].split(":")[1].split("/"),a=1;a<s.length;a++)o+="/"+s[a];return{host:r,path:o,method:i,encoding:"utf8"}}function b(e){var n=D(e).cloneNode();D(e).style.display="none",D(e).parentNode.insertBefore(n,D(e));var r=Math.floor(1e3*Math.random()),o=_.defer();N[r]=function(t){t.upload?(P.trigger("upload:end"),o.resolve(B(e.app,e.headers,t.upload,t.upload.uid))):o.reject(t)};var i=w(e,r),s=x(e,t.exports.getURL(e),t.exports.getCombinedHeaders(e),u(e),JSON.stringify({upload:a(e)}),D(e),r);return document.body.appendChild(i),document.body.appendChild(s),P.trigger("upload:start"),s.submit(),o.promise}function w(e,t){var n=document.createElement("iframe");return n.setAttribute("id","builtIFrame"+t),n.setAttribute("name","builtIFrame"+t),n.setAttribute("width","0"),n.setAttribute("height","0"),n.setAttribute("style","display:none"),n}function x(e,t,n,r,o,i,s){var a=document.createElement("form");a.setAttribute("id","builtUploadForm"+s),a.setAttribute("target","builtIFrame"+s),a.setAttribute("method","post"),a.setAttribute("height","0"),a.setAttribute("width","0"),a.setAttribute("style","display:none"),a.setAttribute("enctype","multipart/form-data"),a.setAttribute("encoding","multipart/form-data"),a.setAttribute("action",t+".postmessage"),a.appendChild(A("PARAM",o)),a.appendChild(A("postmessage_payload",s)),a.appendChild(A("_method",r)),a.appendChild(A("host",document.location.origin?document.location.origin:document.location.protocol+"//"+document.location.host)),i.setAttribute("name","upload[upload]"),a.appendChild(i);for(var u in n)a.appendChild(A(u.toUpperCase(),n[u]));return a}function A(e,t){var n;return n=document.createElement("input"),n.type="hidden",n.name=e,n.value=t,n}function E(e){return!(!O.isObject(e)||!e.name||!e.base64&&!e.bytes)}var k,S=e(72),_=e(150),O=e(33),C=e(29)(),R=e(31),U=e(10),j=e(8),P=e(11),T=e(36),L=T.https,M=T.path;O.isBrowser()||(k=T.fs);var N={};O.isBrowser()&&p();var B=t.exports=S.curry(function(e,n,i,s){var a={};O.isString(s)&&s.match(/^blt[a-z0-9]*/i)?a.uid=s:a=!S.isEmpty(S.keys(s))&&s.name&&(s.base64||s.bytes)?o(a,s):s;var u={app:e,headers:n,params:i,data:a,toJSON:function(){return i}};return r(u),C.build(t.exports,u)});t.exports.download=function(e){if(!e.getDownloadLink())throw new Error("Object cannot be downloaded as download link not found");if(!O.isBrowser()){var t=_.defer();return L.get(e.getDownloadLink(),function(e){t.resolve(e)}),t.promise}window.open(e.getDownloadLink())},C.define("download",1),t.exports.isNew=function(e){return!!e.data.uid},C.define("isNew",1),t.exports.setUid=S.curry(function(e,t){var n=S.mixin({},s(t));return n.uid=e,B(t.app,t.headers,t.params,n)}),C.define("setUid",2);var I=t.exports.getUid=function(e){return s(e).uid};C.define("getUid",1);var D=t.exports.getUploadPayload=function(e){return s(e).file?s(e).file:s(e).encodedUpload?s(e).encodedUpload:s(e).uid};C.define("getUploadPayload",1),t.exports.setFile=S.curry(function(e,t){var n=S.mixin({},s(t));return B(t.app,t.headers,t.params,o(n,e))}),C.define("setFile",2),t.exports.unsetFile=function(e){return I(e)?B(e.app,e.headers,e.params,data.uid):B(e.app,e.headers,e.params,{})},C.define("unsetFile",1),t.exports.save=function(e){var t=(e.app.options.adaptor,D(e));if(t){if(O.isBrowser()){if(s(e).encodedUpload)return g(s(e).encodedUpload,e);if(O.supportsFormData())return h(e);if("file"==D(e).getAttribute("type"))return b(e);throw new Error("Input file element required for upload")}return d(e)}throw new Error("No upload found")},C.define("save",1),t.exports["delete"]=function(e){var n=e.app.options.adaptor;if(!I(e))throw new Error("Upload object needs to be associated with a uid");var r=O.getAdaptorObj("DELETE",t.exports.getURL(e),t.exports.getCombinedHeaders(e),null,null);return n.makeCall(r).then(function(e){return null})},C.define("delete",1),t.exports.fetch=function(e){var n=e.app.options.adaptor;if(!I(e))throw new Error("Upload object needs to be associated with a uid");var r=O.getAdaptorObj("GET",t.exports.getURL(e),t.exports.getCombinedHeaders(e),null,null);return n.makeCall(r).then(function(n){return B(e.app,t.exports.getCombinedHeaders(e),n.entity.upload,n.entity.upload.uid)})},C.define("fetch",1);var q=S.curry(function(e,t,n){var r=S.mixin({},a(n));return r[e]=t,B(n.app,n.headers,r,n.data)});t.exports.setACL=S.curry(function(e,t){var n=S.mixin({},a(t));return n.ACL=e.toJSON(),B(t.app,t.headers,n,t.data)}),C.define("setACL",2),t.exports.getACL=function(e){return j.ACL(a(e).ACL)},C.define("getACL",1),t.exports.setTags=q("tags"),C.define("setTags",2);var H=S.curry(function(e,t){return a(t)[e]});t.exports.getDownloadLink=H("url"),C.define("getDownloadLink",1),t.exports.getTags=H("tags"),C.define("getTags",1),t.exports.getContentType=H("content_type"),C.define("getContentType",1),t.exports.getFileSize=H("file_size"),C.define("getFileSize",1),t.exports.getFileName=H("filename"),C.define("getFileName",1),t.exports.getHeaders=function(e){return e.headers},C.define("getHeaders",1),t.exports.getURL=function(t){var n=e(8);return I(t)?n.App.getURL(t.app)+"/uploads/"+I(t):n.App.getURL(t.app)+"/uploads"},C.define("getURL",1),t.exports.getCombinedHeaders=function(t){var n=e(8);return S.mixin(t.headers,n.App.getHeaders(t.app))},C.define("getHeaders",1)}).call(this,e(38).Buffer)},{10:10,11:11,150:150,29:29,31:31,33:33,36:36,38:38,72:72,8:8}],25:[function(e,t,n){function r(e){return e.map(function(e){return o(e)})}function o(e){var t={UPSERT:e.condition};return i.mixin(t,e.replacement)}{var i=e(72),s=e(33),a=e(29)();t.exports=function(e){var n=e;n=s.isArray(e)?r(e):o(e);var i={data:n,_isUpsert:!0,toJSON:function(){return this.data}};return a.build(t.exports,i)}}},{29:29,33:33,72:72}],26:[function(e,t,n){{var r=e(72),o=e(17),i=e(33),s=(e(150),e(29)());t.exports=r.curry(function(e,n,r,i,a,u){var c=o(e,n,r,{},a,u);return c=s.build(t.exports,c)})}i.copyProperties(t.exports,o);var a=r.curry(function(e,t,n){return n.set(e,t)});t.exports.setRoleUid=a("role_uid"),s.define("setRoleUid",2),t.exports.setUserUid=a("user_uid"),s.define("setUserUid",2),t.exports.getUserUid=function(e){return e.get("user_uid")},s.define("getUserUid",1),t.exports.getRoleUid=function(e){return e.get("role_uid")},s.define("getRoleUid",1)},{150:150,17:17,29:29,33:33,72:72}],27:[function(e,t,n){function r(e){pluginsHelper.plugins.map(function(t){t.realtime&&t.realtime.onUserInstance&&t.realtime.onUserInstance(e)})}function o(e,n,r,o){var i=u(o)+"/retrieve_user_uid",s=l("auth_data",l(e,l(n,r))),a={application_user:d.assign(s,o).data},c=o.app.options.adaptor,f=g.getAdaptorObj("POST",i,t.exports.getCombinedHeaders(o),a,null);return c.makeCall(f).then(function(e){return o.cls.ObjectCons(t.exports.getHeaders(o),{},{},e.entity.uid)})}function i(e,t){var n={application_user:d.assign(e,t).data};n=a(n);var r=u(t);return s("POST",r,n,t).then(function(e){return v.trigger("user:login"),e.app.setSession(e.toJSON()),e})}function s(e,n,r,o){var i=o.app.options.adaptor,s=g.getAdaptorObj(e,n,t.exports.getCombinedHeaders(o),r,null);return i.makeCall(s).then(function(e){return o.cls.ObjectCons(t.exports.getHeaders(o),{},e.entity.application_user,{})})}function a(e){return e.application_user.device_type=g.getDeviceTypeFromUA(),e}function u(t){var n,r=e(8),o=t.app;return n=f(t).uid?r.App.getURL(o)+b+"/"+f(t).uid:r.App.getURL(o)+b}function c(e){return e.app.getURL()+b+"/logout"}function f(e){return e.data}function p(e){return e.delta}function l(e,t){var n={};return n[e]=t,n}{var h=e(72),d=e(17),g=e(33),m=e(150),y=e(29)(),v=(e(22),e(11)),b="/application/users";t.exports=h.curry(function(e,n,o,i,s,a){var u=d(e,n,o,{},s,a);return u=y.build(t.exports,u),r(u),u})}g.copyProperties(t.exports,d),t.exports.login=h.curry(function(e,t,n){var r={email:e,password:t},o={application_user:d.assign(r,n).data};o=a(o);var i=n.app.getURL()+b+"/login";return s("POST",i,o,n).then(function(e){return v.trigger("user:login"),e.app.setSession(e.toJSON()),e})}),y.define("login",3),t.exports.logout=function(e){if(!e.app.isAuthenticated())throw new Error("User not logged in");var n=c(e),r=e.app.options.adaptor,o=g.getAdaptorObj("DELETE",n,t.exports.getCombinedHeaders(e),null,null);return r.makeCall(o).then(function(t){return v.trigger("user:logout"),e.app.clearSession(),null})},y.define("logout",1),t.exports.isAuthenticated=g.appProxyHelper("isAuthenticated"),t.exports.getSession=g.appProxyHelper("getSession"),t.exports.getCurrentUser=g.appProxyHelper("getSession"),t.exports.setSession=g.appProxyHelper("setSession"),t.exports.clearSession=g.appProxyHelper("clearSession"),t.exports.generateAuthtoken=g.appProxyHelper("generateAuthtoken"),t.exports.anyAuth=g.appProxyHelper("anyAuth"),t.exports.activate=h.curry(function(e,n){if(!p(n).uid)throw new Error("Uid not found");var r=u(n)+"/activate/"+e,o=n.app.options.adaptor,i=g.getAdaptorObj("GET",r,t.exports.getCombinedHeaders(n),null,null);return o.makeCall(i).then(function(e){return v.trigger("user:activate",e.entity),null})}),y.define("activate",2),t.exports.deactivate=h.curry(function(e){if(!e.getHeaders().authtoken)throw new Error("Authentication token not found in headers");if(!f(e).uid)throw new Error("Uid not found");var n=u(e),r=e.app.options.adaptor,o=g.getAdaptorObj("DELETE",n,t.exports.getCombinedHeaders(e),null,null);return r.makeCall(o).then(function(e){return v.trigger("user:deactivate",e.entity),null})}),y.define("deactivate",1),t.exports.fetchUserUidByEmail=h.curry(function(e,n){if(!e)throw new Error("Email not found");var r=u(n)+"/retrieve_user_uid",o={email:e},i={application_user:d.assign(o,n).data},s=n.app.options.adaptor,a=g.getAdaptorObj("POST",r,t.exports.getCombinedHeaders(n),i,null);return s.makeCall(a).then(function(e){return n.cls.ObjectCons(t.exports.getHeaders(n),{},{},e.entity.uid)})}),y.define("fetchUserUidByEmail",2),t.exports.fetchUserUidByFacebookUserId=h.curry(function(e,t){if(!e)throw new Error("User id not found");return o("facebook","user_id",e,t)}),y.define("fetchUserUidByFacebookUserId",2),t.exports.fetchUserUidByGoogleEmail=h.curry(function(e,t){if(!e)throw new Error("Email address not found");return o("google","email",e,t)}),y.define("fetchUserUidByGoogleEmail",2),t.exports.fetchUserUidByTwitterUserId=h.curry(function(e,t){if(!e)throw new Error("User_id not found");return o("twitter","user_id",e,t)}),y.define("fetchUserUidByTwitterUserId",2),t.exports.register=h.curry(function(e,t,n,r,o){var i={email:e,password:t,password_confirmation:n};i=h.mixin(r,i);var c={application_user:d.assign(i,o).data};return c=a(c),s("POST",u(o),c,o).then(function(e){return v.trigger("user:register",e),e})}),y.define("register",5,[{}]),t.exports.forgotPassword=h.curry(function(e,n){var r=n.app.options.adaptor,o={email:e},i={application_user:d.assign(o,n).data},s=u(n)+"/forgot_password/request_password_reset",a=g.getAdaptorObj("POST",s,t.exports.getCombinedHeaders(n),i,null);return r.makeCall(a).then(function(e){return null})}),y.define("forgotPassword",2),t.exports.resetPassword=h.curry(function(e,n,r,o){var i=o.app.options.adaptor,s={reset_password_token:r,password:e,password_confirmation:n},a={application_user:d.assign(s,o).data},c=u(o)+"/forgot_password/reset_password",f=g.getAdaptorObj("POST",c,t.exports.getCombinedHeaders(o),a,null);return i.makeCall(f).then(function(e){return null})}),y.define("resetPassword",4),t.exports.updateUserProfile=h.curry(function(e,n){var r={application_user:e};if(!n.get("uid"))return m.reject(new Error("Uid not found"));var o=u(n),i=n.app.options.adaptor,s=g.getAdaptorObj("PUT",o,t.exports.getCombinedHeaders(n),r,null);return i.makeCall(s).then(function(e){var r=n.cls.ObjectCons(t.exports.getHeaders(n),{},h.mixin({authtoken:n.app.getAuthToken()},e.entity.application_user),{});return r=r.set("authtoken",n.app.getAuthToken()),r.app.setSession(r.toJSON()),r})}),y.define("updateUserProfile",2),t.exports.loginWithGoogle=h.curry(function(e,t){var n={auth_data:{google:{access_token:e}}};return i(n,t)}),y.define("loginWithGoogle",2),t.exports.loginWithFacebook=h.curry(function(e,t){var n={auth_data:{facebook:{access_token:e}}};return i(n,t)}),y.define("loginWithFacebook",2),t.exports.loginWithTwitter=h.curry(function(e,t,n,r,o){var s={auth_data:{twitter:{token:e,token_secret:t,consumer_key:n,consumer_secret:r}}};return i(s,o)}),y.define("loginWithTwitter",5),t.exports.getLastLoginAt=function(e){return e.get("last_login_at")},y.define("getLastLoginAt",1)},{11:11,150:150,17:17,22:22,29:29,33:33,72:72,8:8}],28:[function(e,t,n){(function(e){!function(r){"use strict";function o(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function i(e,t){Object.defineProperty(this,"k",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"p",{value:t,enumerable:!0})}function s(e,t,n){s.super_.call(this,"E",e),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function a(e,t){a.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function u(e,t){u.super_.call(this,"D",e)}function c(e,t,n){c.super_.call(this,"A",e),Object.defineProperty(this,"i",{value:t,enumerable:!0}),Object.defineProperty(this,"m",{value:n,enumerable:!0})}function f(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,r),e}function p(e,t,n,o,i,l){o=o||[];var h=o.slice(0);i&&h.push(i);var d=typeof e,g=typeof t;if("undefined"===d)"undefined"!==g&&n(new a(h,t));else if("undefined"===g)n(new u(h,e));else if(d!==g)n(new s(h,e,t));else if(e instanceof Date&&t instanceof Date&&e-t!=0)n(new s(h,e,t));else if("object"===d&&null!=e&&null!=t){if(l=l||[],l.indexOf(e)<0){if(l.push(e),Array.isArray(e)){var m,y=(e.length,function(e){n(new c(h,m,e))});for(m=0;m<e.length;m++)m>=t.length?n(new c(h,m,new u(r,e[m]))):p(e[m],t[m],y,[],null,l);for(;m<t.length;)n(new c(h,m,new a(r,t[m++])))}else{var v=Object.keys(e),b=Object.keys(t);v.forEach(function(o){var i=b.indexOf(o);i>=0?(p(e[o],t[o],n,h,o,l),b=f(b,i)):p(e[o],r,n,h,o,l)}),b.forEach(function(e){p(r,t[e],n,h,e,l)})}l.length=l.length-1}}else e!==t&&("number"===d&&isNaN(e)&&isNaN(t)||n(new s(h,e,t)))}function l(e,t,n){return n=n||[],p(e,t,function(e){e&&n.push(e)}),n.length?n:r}function h(e,t,n){if(n.p&&n.p.length){var r,o=e[t],i=n.p.length-1;for(r=0;i>r;r++)o=o[n.p[r]];switch(n.k){case"A":h(o[n.p[r]],n.i,n.m);break;case"D":delete o[n.p[r]];break;case"E":case"N":o[n.p[r]]=n.rhs}}else switch(n.k){case"A":h(e[t],n.i,n.m);break;case"D":e=f(e,t);break;case"E":case"N":e[t]=n.rhs}return e}function d(e,t,n){if(e&&t&&n){var r,o,i=e;for(o=n.p.length-1,r=0;o>r;r++)"undefined"==typeof i[n.p[r]]&&(i[n.p[r]]={}),i=i[n.p[r]];switch(n.k){case"A":h(i[n.p[r]],n.i,n.m);break;case"D":delete i[n.p[r]];break;case"E":case"N":i[n.p[r]]=n.rhs}}}function g(e,t,n){if(e&&t){var r=function(r){(!n||n(e,t,r))&&d(e,t,r)};p(e,t,r)}}function m(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r];o.i||0===o.i?n.push(o):d(e,{},o)}n.sort(function(e,t){return e.i<t.i});for(var r=0;r<n.length;r++){var o=n[r];d(e,{},o)}return e}var y,v,b=[];y="object"==typeof e&&e?e:"undefined"!=typeof window?window:{},v=y.DeepDiff,v&&b.push(function(){"undefined"!=typeof v&&y.DeepDiff===l&&(y.DeepDiff=v,v=r)}),o(s,i),o(a,i),o(u,i),
o(c,i),Object.defineProperties(l,{diff:{value:l,enumerable:!0},observableDiff:{value:p,enumerable:!0},applyDiff:{value:g,enumerable:!0},applyChange:{value:d,enumerable:!0},applyPatch:{value:m,enumerable:!0},isConflict:{get:function(){return"undefined"!=typeof v},enumerable:!0},noConflict:{value:function(){return b&&(b.forEach(function(e){e()}),b=null),l},enumerable:!0}}),"undefined"!=typeof t&&t&&"object"==typeof n&&n&&t.exports===n?t.exports=l:y.DeepDiff=l}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],29:[function(e,t,n){var r=e(72);t.exports=function(){var e=[];return{define:function(t,n,r){e.push({name:t,argsLength:n,defaultValues:r})},build:function(t,n){return e.forEach(function(e){if(1===e.argsLength)n[e.name]=function(){return t[e.name].apply(null,[n])};else{var o=r.curry(r.nAry(e.argsLength,function(){var n=Array.prototype.slice.call(arguments,1,arguments.length);return n.push(arguments[0]),t[e.name].apply(null,n)}));o=o(n),n[e.name]=e.defaultValues?function(){var t=Array.prototype.slice.call(arguments,0);return t=t.concat(e.defaultValues.slice(-(e.argsLength-arguments.length))),o.apply(null,t)}:o}}),n}}}},{72:72}],30:[function(e,t,n){var r=e(72);t.exports.Mixin=function(){var e={};return Array.prototype.forEach.call(arguments,function(t){e=t._isGroup||t._isGroupMultiple?r.mixin(e,t.toJSON()):r.mixin(e,t)}),e}},{72:72}],31:[function(e,t,n){(function(n){function r(e,t){function r(e,t,n){var r="--"+e+"\r\n";return r+='Content-Disposition: form-data; name="'+t+'"\r\n\r\n',r+=n+"\r\n"}function o(e,t,n,r){var o="--"+e+"\r\n";return o+='Content-Disposition: form-data; name="'+n+'"; filename="'+r+'"\r\n',o+="Content-Type: "+t+"\r\n\r\n"}var i=Math.random(),s=[];if(e)for(var a in e){var u=e[a];s.push(new n(r(i,a,u),"ascii"))}if(t)for(var a in t){var u=t[a];s.push(new n(o(i,u.contentType,u.keyName,u.fileName),"ascii")),s.push(new n(u.data,"utf8"))}s.push(new n("\r\n--"+i+"--"),"ascii");for(var c=0,f=0;f<s.length;f++)c+=s[f].length;var p={postdata:s,length:c,headers:{"Content-Type":"multipart/form-data; boundary="+i,"Content-Length":c}};return p}function o(e,t,n,o){var u=i.defer(),c=r(e,t),f=c.headers;for(var p in o)f[p]=o[p];var l={host:n.host,path:n.path,method:n.method||"POST",headers:f};a.trigger("upload:start");for(var h=s.request(l,function(e){e.body="",e.setEncoding&&e.setEncoding(n.encoding),e.on("data",function(t){e.body+=t}),e.on("end",function(){a.trigger("upload:end",JSON.parse(e.body)),u.resolve(e.body)}),e.on("error",function(){u.reject(e)})}),d=0;d<c.postdata.length;d++)h.write(c.postdata[d]);return h.end(),u.promise}{var i=e(150),s=e(47),a=e(11);e(36)}t.exports={getFormDataForPost:r,postData:o}}).call(this,e(38).Buffer)},{11:11,150:150,36:36,38:38,47:47}],32:[function(e,t,n){function r(){var e=u.type();return e.match(/windows/i)?"windows":e.match(/darwin/i)?"macintosh":e}function o(e,t){var n=e+"_"+h,r=p.get(n)||l.get(n);if(r)return r;t=t||16;var r="blt"+s(2*t,"0123456789abcde");try{p.set(n,r)}catch(o){console.warn("Analytics blt_uuid is stored in cookie as localStorage wasn't avaliable"),l.set(n,r)}return r}function i(e,t){return d[e]?d[e]:(t=t||16,d[e]="blt"+s(2*t,"0123456789abcde"),d[e])}function s(e,t){for(var n="",r=e;r>0;--r)n+=t[Math.round(Math.random()*(t.length-1))];return n}var a=e(133),u=e(50),c=e(33),f=e(34).version,p=e(23),l=e(22),h="blt_uuid",d={};t.exports.generateUserMetrics=function(e,t){var n=16;if(""===t&&(t="anonymous"),c.isBrowser()){var s=navigator.userAgent,p=(new a).setUA(s).getResult(),l=window.screen?window.screen.height:"unknown",h=window.screen?window.screen.width:"unknown",d="browser|"+p.browser.name+"|"+p.browser.version;return p.device.model&&("WebKit"===p.device.model&&(p.device.model="WebView"),d=p.device.model+"|"+d),{blt_uuid:o(e,n),app_user_object_uid:t,blt_os:p.os.name,blt_screen_width:h,blt_sdk_version:f,blt_screen_height:l,blt_os_version:p.os.version,blt_sdk:"JavaScript",blt_device:d}}var g=r();return{blt_uuid:i(e,n),app_user_object_uid:t,blt_sdk:"JavaScript",blt_sdk_version:f,blt_os:g,blt_os_version:u.release(),blt_device:"nodejs"}},t.exports.getUUIDForAPI=function(e){if(c.isBrowser()){var t=e+"_"+h;return p.get(t)||l.get(t)}return d[e]}},{133:133,22:22,23:23,33:33,34:34,50:50}],33:[function(e,t,n){t.exports.appProxyHelper=function(e){return function(t){return function(){return t[e].apply(t,arguments)}}},t.exports.copyProperties=function(e,t){for(method in t)e[method]=t[method]},t.exports.getAdaptorObj=function(e,t,n,r,o){if(!e)throw new Error("Http method is not specified");if(!t)throw new Error("Path for http request not specified");if(!n)throw new Error("Headers for http request not specified");var i={};return i.path=t,i.headers=n,i.method=e,r&&(i.entity=r),o&&(i.params=o),i},t.exports.wrapper=function(e,t){return function(){var n=Array.prototype.slice.call(arguments,0);return n=n.concat(t.slice(-(e.length-arguments.length))),e.apply(this,n)}},t.exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.exports.isNumber=function(e){return"number"==typeof e},t.exports.isBoolean=function(e){return"boolean"==typeof e},t.exports.isString=function(e){return"string"==typeof e},t.exports.isQueryInstance=function(e){return!!e.where},t.exports.isFunction=function(e){var t={};return e&&"[object Function]"===t.toString.call(e)},t.exports.isObject=function(e){return"object"==typeof e},t.exports.isBrowser=function(){return!("undefined"==typeof window||!window.document)},t.exports.isLocalStroageAvaliable=function(){return!("undefined"==typeof localStorage)},t.exports.isEmpty=function(e){return e?0===Object.keys(e).length:void 0},t.exports.keyValue=function(){for(var e=null,t={},n=0;n<arguments.length;n++){var r=arguments[n];n%2===0?e=r:t[e]=r}return t},t.exports.backboneExist=function(){return!("undefined"==typeof Backbone||!Backbone.Model||!Backbone.Collection)},t.exports.supportsFormData=function(){return!("object"!=typeof window||"undefined"==typeof window.FormData)};var r=t.exports.encodeParam=function(e,n){return t.exports.isObject(n[e])?e+"="+encodeURIComponent(JSON.stringify(n[e])):e+"="+n[e]};t.exports.addParam=function(e,t,n){return e+=e.indexOf("?")>=0?"&"+r(t,n):"?"+r(t,n)},t.exports.findAndRemove=function(e,t){var n=t.indexOf(e);return n>=-1?t.splice(n,1):t},t.exports.getDeviceTypeFromUA=function(){if(t.exports.isBrowser()){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPad/i)||e.match(/iPhone/i)||e.match(/iPod/i)?"ios":e.match(/Android/i)?"android":"other"}return"other"},t.exports.createNestedObject=function(e,t,n){for(var r=3===arguments.length?t.pop():!1,o=0;o<t.length;o++)e=e[t[o]]=e[t[o]]||{};return r&&(e=e[r]=n),e}},{}],34:[function(e,t,n){t.exports={name:"built.io",description:"SDK for Built.io Backend",license:"MIT",author:"Built.io Backend",version:"3.1.1",dependencies:{when:"3.4.3",rest:"1.1.1",ramda:"0.8.0",mime:"1.2.11","blueimp-md5":"1.1.0","ua-parser-js":"0.7.3","socket.io-client":"1.2.1"},devDependencies:{browserify:"^8.1.1","bundle-collapser":"^1.2.1",chai:"^1.9.2","chai-as-promised":"^4.1.1",gulp:"*","gulp-add-src":"^0.2.0","gulp-buffer":"0.0.2","gulp-clean":"^0.3.1","gulp-cog":"^0.1.2","gulp-concat":"^2.4.2","gulp-json-editor":"^2.2.1","gulp-load-plugins":"^0.7.1","gulp-replace":"*","gulp-rimraf":"^0.1.1","gulp-run":"^1.6.4","gulp-shell":"^0.2.10","gulp-uglify":"^1.0.1","gulp-unpathify":"^0.1.1","gulp-zip":"^2.0.2",gutil:"*","jaguarjs-jsdoc":"0.0.1",jsdoc:"*",mocha:"*",nock:"0.27.2",rimraf:"^2.2.8","run-sequence":"^1.0.2",semver:"^4.1.0","socket.io":"*","vinyl-buffer":"^1.0.0","vinyl-source-stream":"^1.0.0"},keywords:["built","backend","baas","mbaas","sdk","javascript"],scripts:{generateDocsForWRT:"jsdoc -t /usr/local/lib/node_modules/jaguarjs-jsdoc/ -c templateConfig.json lib/ -d docs/docsWRT -r /home/abhijeet/Documents/node/built/jsdocReadMe/README_WRT.md",generateDocsForRT:"jsdoc -t /usr/local/lib/node_modules/jaguarjs-jsdoc/ -c templateConfig.json lib/ -d docs/docsRT -r /home/abhijeet/Documents/node/built/jsdocReadMe/README_RT.md"},main:"./lib/built"}},{}],35:[function(e,t,n){!function(e){"use strict";function t(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function n(e,t){return e<<t|e>>>32-t}function r(e,r,o,i,s,a){return t(n(t(t(r,e),t(i,a)),s),o)}function o(e,t,n,o,i,s,a){return r(t&n|~t&o,e,t,i,s,a)}function i(e,t,n,o,i,s,a){return r(t&o|n&~o,e,t,i,s,a)}function s(e,t,n,o,i,s,a){return r(t^n^o,e,t,i,s,a)}function a(e,t,n,o,i,s,a){return r(n^(t|~o),e,t,i,s,a)}function u(e,n){e[n>>5]|=128<<n%32,e[(n+64>>>9<<4)+14]=n;var r,u,c,f,p,l=1732584193,h=-271733879,d=-1732584194,g=271733878;for(r=0;r<e.length;r+=16)u=l,c=h,f=d,p=g,l=o(l,h,d,g,e[r],7,-680876936),g=o(g,l,h,d,e[r+1],12,-389564586),d=o(d,g,l,h,e[r+2],17,606105819),h=o(h,d,g,l,e[r+3],22,-1044525330),l=o(l,h,d,g,e[r+4],7,-176418897),g=o(g,l,h,d,e[r+5],12,1200080426),d=o(d,g,l,h,e[r+6],17,-1473231341),h=o(h,d,g,l,e[r+7],22,-45705983),l=o(l,h,d,g,e[r+8],7,1770035416),g=o(g,l,h,d,e[r+9],12,-1958414417),d=o(d,g,l,h,e[r+10],17,-42063),h=o(h,d,g,l,e[r+11],22,-1990404162),l=o(l,h,d,g,e[r+12],7,1804603682),g=o(g,l,h,d,e[r+13],12,-40341101),d=o(d,g,l,h,e[r+14],17,-1502002290),h=o(h,d,g,l,e[r+15],22,1236535329),l=i(l,h,d,g,e[r+1],5,-165796510),g=i(g,l,h,d,e[r+6],9,-1069501632),d=i(d,g,l,h,e[r+11],14,643717713),h=i(h,d,g,l,e[r],20,-373897302),l=i(l,h,d,g,e[r+5],5,-701558691),g=i(g,l,h,d,e[r+10],9,38016083),d=i(d,g,l,h,e[r+15],14,-660478335),h=i(h,d,g,l,e[r+4],20,-405537848),l=i(l,h,d,g,e[r+9],5,568446438),g=i(g,l,h,d,e[r+14],9,-1019803690),d=i(d,g,l,h,e[r+3],14,-187363961),h=i(h,d,g,l,e[r+8],20,1163531501),l=i(l,h,d,g,e[r+13],5,-1444681467),g=i(g,l,h,d,e[r+2],9,-51403784),d=i(d,g,l,h,e[r+7],14,1735328473),h=i(h,d,g,l,e[r+12],20,-1926607734),l=s(l,h,d,g,e[r+5],4,-378558),g=s(g,l,h,d,e[r+8],11,-2022574463),d=s(d,g,l,h,e[r+11],16,1839030562),h=s(h,d,g,l,e[r+14],23,-35309556),l=s(l,h,d,g,e[r+1],4,-1530992060),g=s(g,l,h,d,e[r+4],11,1272893353),d=s(d,g,l,h,e[r+7],16,-155497632),h=s(h,d,g,l,e[r+10],23,-1094730640),l=s(l,h,d,g,e[r+13],4,681279174),g=s(g,l,h,d,e[r],11,-358537222),d=s(d,g,l,h,e[r+3],16,-722521979),h=s(h,d,g,l,e[r+6],23,76029189),l=s(l,h,d,g,e[r+9],4,-640364487),g=s(g,l,h,d,e[r+12],11,-421815835),d=s(d,g,l,h,e[r+15],16,530742520),h=s(h,d,g,l,e[r+2],23,-995338651),l=a(l,h,d,g,e[r],6,-198630844),g=a(g,l,h,d,e[r+7],10,1126891415),d=a(d,g,l,h,e[r+14],15,-1416354905),h=a(h,d,g,l,e[r+5],21,-57434055),l=a(l,h,d,g,e[r+12],6,1700485571),g=a(g,l,h,d,e[r+3],10,-1894986606),d=a(d,g,l,h,e[r+10],15,-1051523),h=a(h,d,g,l,e[r+1],21,-2054922799),l=a(l,h,d,g,e[r+8],6,1873313359),g=a(g,l,h,d,e[r+15],10,-30611744),d=a(d,g,l,h,e[r+6],15,-1560198380),h=a(h,d,g,l,e[r+13],21,1309151649),l=a(l,h,d,g,e[r+4],6,-145523070),g=a(g,l,h,d,e[r+11],10,-1120210379),d=a(d,g,l,h,e[r+2],15,718787259),h=a(h,d,g,l,e[r+9],21,-343485551),l=t(l,u),h=t(h,c),d=t(d,f),g=t(g,p);return[l,h,d,g]}function c(e){var t,n="";for(t=0;t<32*e.length;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function f(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;for(t=0;t<8*e.length;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function p(e){return c(u(f(e),8*e.length))}function l(e,t){var n,r,o=f(e),i=[],s=[];for(i[15]=s[15]=void 0,o.length>16&&(o=u(o,8*e.length)),n=0;16>n;n+=1)i[n]=909522486^o[n],s[n]=1549556828^o[n];return r=u(i.concat(f(t)),512+8*t.length),c(u(s.concat(r),640))}function h(e){var t,n,r="0123456789abcdef",o="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),o+=r.charAt(t>>>4&15)+r.charAt(15&t);return o}function d(e){return unescape(encodeURIComponent(e))}function g(e){return p(d(e))}function m(e){return h(g(e))}function y(e,t){return l(d(e),d(t))}function v(e,t){return h(y(e,t))}function b(e,t,n){return t?n?y(t,e):v(t,e):n?g(e):m(e)}"function"==typeof define&&define.amd?define(function(){return b}):e.md5=b}(this)},{}],36:[function(e,t,n){},{}],37:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{36:36}],38:[function(e,t,n){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e){return this instanceof o?(this.length=0,this.parent=void 0,"number"==typeof e?i(this,e):"string"==typeof e?s(this,e,arguments.length>1?arguments[1]:"utf8"):a(this,e)):arguments.length>1?new o(e,arguments[1]):new o(e)}function i(e,t){if(e=d(e,0>t?0:0|g(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function s(e,t,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|y(t,n);return e=d(e,r),e.write(t,n),e}function a(e,t){if(o.isBuffer(t))return u(e,t);if(G(t))return c(e,t);if(null==t)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(t.buffer instanceof ArrayBuffer)return f(e,t);if(t instanceof ArrayBuffer)return p(e,t)}return t.length?l(e,t):h(e,t)}function u(e,t){var n=0|g(t.length);return e=d(e,n),t.copy(e,0,0,n),e}function c(e,t){var n=0|g(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function f(e,t){var n=0|g(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t){return o.TYPED_ARRAY_SUPPORT?(t.byteLength,e=o._augment(new Uint8Array(t))):e=f(e,new Uint8Array(t)),e}function l(e,t){var n=0|g(t.length);e=d(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function h(e,t){var n,r=0;"Buffer"===t.type&&G(t.data)&&(n=t.data,r=0|g(n.length)),e=d(e,r);for(var o=0;r>o;o+=1)e[o]=255&n[o];return e}function d(e,t){o.TYPED_ARRAY_SUPPORT?e=o._augment(new Uint8Array(t)):(e.length=t,e._isBuffer=!0);var n=0!==t&&t<=o.poolSize>>>1;return n&&(e.parent=$),e}function g(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e,t){if(!(this instanceof m))return new m(e,t);var n=new o(e,t);return delete n.parent,n}function y(e,t){"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if(t=0|t,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return O(this,t,n);case"binary":return C(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;r>s;s++){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");e[n+s]=a}return s}function w(e,t,n,r){return W(H(t,e.length-n),e,n,r)}function x(e,t,n,r){return W(F(t),e,n,r)}function A(e,t,n,r){return x(e,t,n,r)}function E(e,t,n,r){return W(z(t),e,n,r)}function k(e,t,n,r){return W(J(t,e.length-n),e,n,r)}function S(e,t,n){return Y.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function _(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;n>i;i++)e[i]<=127?(r+=K(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+K(o)}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;n>i;i++)o+=q(e[i]);return o}function U(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function j(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,s){if(!o.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||s>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range")}function T(e,t,n,r){0>t&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);i>o;o++)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function L(e,t,n,r){0>t&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);i>o;o++)e[n+o]=t>>>8*(r?o:3-o)&255}function M(e,t,n,r,o,i){if(t>o||i>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function N(e,t,n,r,o){return o||M(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),V.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,o){return o||M(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),V.write(e,t,n,r,52,8),n+8}function I(e){if(e=D(e).replace(Q,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function D(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],s=0;r>s;s++){if(n=e.charCodeAt(s),n>55295&&57344>n){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(56320>n){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=o-55296<<10|n-56320|65536,o=null}else o&&((t-=3)>-1&&i.push(239,191,189),o=null);if(128>n){if((t-=1)<0)break;i.push(n)}else if(2048>n){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(2097152>n))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function J(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);s++)n=e.charCodeAt(s),r=n>>8,o=n%256,i.push(o),i.push(r);return i}function z(e){return Y.toByteArray(I(e))}function W(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function K(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}var Y=e(39),V=e(40),G=e(41);n.Buffer=o,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,o.poolSize=8192;var $={};o.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);return t.foo=function(){return 42},t.constructor=e,42===t.foo()&&t.constructor===e&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(n){return!1}}(),o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);s>i&&e[i]===t[i];)++i;return i!==s&&(n=e[i],r=t[i]),r>n?-1:n>r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!G(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new o(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new o(t),i=0;for(n=0;n<e.length;n++){var s=e[n];s.copy(r,i),i+=s.length}return r},o.byteLength=y,o.prototype.length=void 0,o.prototype.parent=void 0,o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?_(this,0,e):v.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:o.compare(this,e)},o.prototype.indexOf=function(e,t){function n(e,t,n){for(var r=-1,o=0;n+o<e.length;o++)if(e[n+o]===t[-1===r?0:o-r]){if(-1===r&&(r=o),o-r+1===t.length)return n+r}else r=-1;return-1}if(t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,t);if(o.isBuffer(e))return n(this,e,t);if("number"==typeof e)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):n(this,[e],t);throw new TypeError("val must be string, number or Buffer")},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var o=r;r=t,t=0|n,n=o}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"binary":return A(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=o._augment(this.subarray(e,t));else{var i=t-e;r=new o(i,void 0);for(var s=0;i>s;s++)r[s]=this[s+e]}return r.length&&(r.parent=this.parent||this),r},o.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||j(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},o.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||j(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},o.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||j(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||j(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),V.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),V.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),V.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),V.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||P(this,e,t,n,Math.pow(2,8*n),0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||P(this,e,t,n,Math.pow(2,8*n),0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):T(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e):L(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):L(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=0,s=1,a=0>e?1:0;for(this[t]=255&e;++i<n&&(s*=256);)this[t+i]=(e/s>>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0>e?1:0;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=(e/s>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e):T(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e):L(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,s=r-n;if(this===e&&t>n&&r>t)for(i=s-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>s||!o.TYPED_ARRAY_SUPPORT)for(i=0;s>i;i++)e[i+t]=this[i+n];else e._set(this.subarray(n,n+s),t);return s},o.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var o=H(e.toString()),i=o.length;for(r=t;n>r;r++)this[r]=o[r%i]}return this}},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o.TYPED_ARRAY_SUPPORT)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var X=o.prototype;o._augment=function(e){return e.constructor=o,e._isBuffer=!0,e._set=e.set,e.get=X.get,e.set=X.set,e.write=X.write,e.toString=X.toString,e.toLocaleString=X.toString,e.toJSON=X.toJSON,e.equals=X.equals,e.compare=X.compare,e.indexOf=X.indexOf,e.copy=X.copy,e.slice=X.slice,e.readUIntLE=X.readUIntLE,e.readUIntBE=X.readUIntBE,e.readUInt8=X.readUInt8,e.readUInt16LE=X.readUInt16LE,e.readUInt16BE=X.readUInt16BE,e.readUInt32LE=X.readUInt32LE,e.readUInt32BE=X.readUInt32BE,e.readIntLE=X.readIntLE,e.readIntBE=X.readIntBE,e.readInt8=X.readInt8,e.readInt16LE=X.readInt16LE,e.readInt16BE=X.readInt16BE,e.readInt32LE=X.readInt32LE,e.readInt32BE=X.readInt32BE,e.readFloatLE=X.readFloatLE,e.readFloatBE=X.readFloatBE,e.readDoubleLE=X.readDoubleLE,e.readDoubleBE=X.readDoubleBE,e.writeUInt8=X.writeUInt8,e.writeUIntLE=X.writeUIntLE,e.writeUIntBE=X.writeUIntBE,e.writeUInt16LE=X.writeUInt16LE,e.writeUInt16BE=X.writeUInt16BE,e.writeUInt32LE=X.writeUInt32LE,e.writeUInt32BE=X.writeUInt32BE,e.writeIntLE=X.writeIntLE,e.writeIntBE=X.writeIntBE,e.writeInt8=X.writeInt8,e.writeInt16LE=X.writeInt16LE,e.writeInt16BE=X.writeInt16BE,e.writeInt32LE=X.writeInt32LE,e.writeInt32BE=X.writeInt32BE,e.writeFloatLE=X.writeFloatLE,e.writeFloatBE=X.writeFloatBE,e.writeDoubleLE=X.writeDoubleLE,e.writeDoubleBE=X.writeDoubleBE,e.fill=X.fill,e.inspect=X.inspect,e.toArrayBuffer=X.toArrayBuffer,e};var Q=/[^+\/0-9A-Za-z-_]/g},{39:39,40:40,41:41}],39:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===s||t===p?62:t===a||t===l?63:u>t?-1:u+10>t?t-u+26+26:f+26>t?t-f:c+26>t?t-c+26:void 0}function n(e){function n(e){c[p++]=e}var r,o,s,a,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=e.length;u="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0,c=new i(3*e.length/4-u),s=u>0?e.length-4:e.length;var p=0;for(r=0,o=0;s>r;r+=4,o+=3)a=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===u?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===u&&(a=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(a>>8&255),n(255&a)),c}function o(e){function t(e){return r.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var o,i,s,a=e.length%3,u="";for(o=0,s=e.length-a;s>o;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=n(i);switch(a){case 1:i=e[e.length-1],u+=t(i>>2),u+=t(i<<4&63),u+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],u+=t(i>>10),u+=t(i>>4&63),u+=t(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),f="A".charCodeAt(0),p="-".charCodeAt(0),l="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=o}("undefined"==typeof n?this.base64js={}:n)},{}],40:[function(e,t,n){n.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,f=-7,p=n?o-1:0,l=n?-1:1,h=e[t+p];for(p+=l,i=h&(1<<-f)-1,h>>=-f,f+=a;f>0;i=256*i+e[t+p],p+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=r;f>0;s=256*s+e[t+p],p+=l,f-=8);if(0===i)i=1-c;else{if(i===u)return s?0/0:(h?-1:1)*(1/0);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,p=f>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+p>=1?l/u:l*Math.pow(2,1-p),t*u>=2&&(s++,u/=2),s+p>=f?(a=0,s=f):s+p>=1?(a=(t*u-1)*Math.pow(2,o),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,o),
s=0));o>=8;e[n+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=255&s,h+=d,s/=256,c-=8);e[n+h-d]|=128*g}},{}],41:[function(e,t,n){var r=Array.isArray,o=Object.prototype.toString;t.exports=r||function(e){return!!e&&"[object Array]"==o.call(e)}},{}],42:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,i,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],a(n))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),u=1;r>u;u++)i[u-1]=arguments[u];n.apply(this,i)}else if(s(n)){for(r=arguments.length,i=new Array(r-1),u=1;r>u;u++)i[u-1]=arguments[u];for(c=n.slice(),r=c.length,u=0;r>u;u++)c[u].apply(this,i)}return!0},r.prototype.addListener=function(e,t){var n;if(!o(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned){var n;n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,i,a;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=i;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?o(e._events[t])?1:e._events[t].length:0}},{}],43:[function(e,t,n){var r=t.exports,o=(e(42).EventEmitter,e(44)),i=e(69);r.request=function(e,t){"string"==typeof e&&(e=i.parse(e)),e||(e={}),e.host||e.port||(e.port=parseInt(window.location.port,10)),!e.host&&e.hostname&&(e.host=e.hostname),e.protocol||(e.protocol=e.scheme?e.scheme+":":window.location.protocol),e.host||(e.host=window.location.hostname||window.location.host),/:/.test(e.host)&&(e.port||(e.port=e.host.split(":")[1]),e.host=e.host.split(":")[0]),e.port||(e.port="https:"==e.protocol?443:80);var n=new o(new s,e);return t&&n.on("response",t),n},r.get=function(e,t){e.method="GET";var n=r.request(e,t);return n.end(),n},r.Agent=function(){},r.Agent.defaultMaxSockets=4;var s=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{var n=new window.ActiveXObject(e[t]);return function(){if(n){var r=n;return n=null,r}return new window.ActiveXObject(e[t])}}catch(r){}throw new Error("ajax not supported in this browser")}throw new Error("ajax not supported in this browser")}();r.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{42:42,44:44,69:69}],44:[function(e,t,n){var r=e(67),o=e(45),i=e(46),s=e(48),a=t.exports=function(e,t){var n=this;n.writable=!0,n.xhr=e,n.body=[],n.uri=(t.protocol||"http:")+"//"+t.host+(t.port?":"+t.port:"")+(t.path||"/"),"undefined"==typeof t.withCredentials&&(t.withCredentials=!0);try{e.withCredentials=t.withCredentials}catch(r){}if(t.responseType)try{e.responseType=t.responseType}catch(r){}if(e.open(t.method||"GET",n.uri,!0),e.onerror=function(e){n.emit("error",new Error("Network error"))},n._headers={},t.headers)for(var s=u(t.headers),a=0;a<s.length;a++){var c=s[a];if(n.isSafeRequestHeader(c)){var f=t.headers[c];n.setHeader(c,f)}}t.auth&&this.setHeader("Authorization","Basic "+i.btoa(t.auth));var p=new o;p.on("close",function(){n.emit("close")}),p.on("ready",function(){n.emit("response",p)}),p.on("error",function(e){n.emit("error",e)}),e.onreadystatechange=function(){e.__aborted||p.handle(e)}};s(a,r),a.prototype.setHeader=function(e,t){this._headers[e.toLowerCase()]=t},a.prototype.getHeader=function(e){return this._headers[e.toLowerCase()]},a.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},a.prototype.write=function(e){this.body.push(e)},a.prototype.destroy=function(e){this.xhr.__aborted=!0,this.xhr.abort(),this.emit("close")},a.prototype.end=function(e){void 0!==e&&this.body.push(e);for(var t=u(this._headers),n=0;n<t.length;n++){var r=t[n],o=this._headers[r];if(c(o))for(var i=0;i<o.length;i++)this.xhr.setRequestHeader(r,o[i]);else this.xhr.setRequestHeader(r,o)}if(0===this.body.length)this.xhr.send("");else if("string"==typeof this.body[0])this.xhr.send(this.body.join(""));else if(c(this.body[0])){for(var s=[],n=0;n<this.body.length;n++)s.push.apply(s,this.body[n]);this.xhr.send(s)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){for(var a=0,n=0;n<this.body.length;n++)a+=this.body[n].length;for(var s=new this.body[0].constructor(a),f=0,n=0;n<this.body.length;n++)for(var l=this.body[n],i=0;i<l.length;i++)s[f++]=l[i];this.xhr.send(s)}else if(p(this.body[0]))this.xhr.send(this.body[0]);else{for(var s="",n=0;n<this.body.length;n++)s+=this.body[n].toString();this.xhr.send(s)}},a.unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"],a.prototype.isSafeRequestHeader=function(e){return e?-1===f(a.unsafeHeaders,e.toLowerCase()):!1};var u=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},f=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},p=function(e){return"undefined"!=typeof Blob&&e instanceof Blob?!0:"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?!0:"undefined"!=typeof FormData&&e instanceof FormData?!0:void 0}},{45:45,46:46,48:48,67:67}],45:[function(e,t,n){function r(e){for(var t=e.getAllResponseHeaders().split(/\r?\n/),n={},r=0;r<t.length;r++){var o=t[r];if(""!==o){var i=o.match(/^([^:]+):\s*(.*)/);if(i){var s=i[1].toLowerCase(),a=i[2];void 0!==n[s]?u(n[s])?n[s].push(a):n[s]=[n[s],a]:n[s]=a}else n[o]=!0}}return n}var o=e(67),i=e(71),s=t.exports=function(e){this.offset=0,this.readable=!0};i.inherits(s,o);var a={streaming:!0,status2:!0};s.prototype.getResponse=function(e){var t=String(e.responseType).toLowerCase();return"blob"===t?e.responseBlob||e.response:"arraybuffer"===t?e.response:e.responseText},s.prototype.getHeader=function(e){return this.headers[e.toLowerCase()]},s.prototype.handle=function(e){if(2===e.readyState&&a.status2){try{this.statusCode=e.status,this.headers=r(e)}catch(t){a.status2=!1}a.status2&&this.emit("ready")}else if(a.streaming&&3===e.readyState){try{this.statusCode||(this.statusCode=e.status,this.headers=r(e),this.emit("ready"))}catch(t){}try{this._emitData(e)}catch(t){a.streaming=!1}}else 4===e.readyState&&(this.statusCode||(this.statusCode=e.status,this.emit("ready")),this._emitData(e),e.error?this.emit("error",this.getResponse(e)):this.emit("end"),this.emit("close"))},s.prototype._emitData=function(e){var t=this.getResponse(e);return t.toString().match(/ArrayBuffer/)?(this.emit("data",new Uint8Array(t,this.offset)),void(this.offset=t.byteLength)):void(t.length>this.offset&&(this.emit("data",t.slice(this.offset)),this.offset=t.length))};var u=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{67:67,71:71}],46:[function(e,t,n){!function(){function e(e){this.message=e}var t="undefined"!=typeof n?n:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.prototype=new Error,e.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var n,o,i=0,s=r,a="";t.charAt(0|i)||(s="=",i%1);a+=s.charAt(63&n>>8-i%1*8)){if(o=t.charCodeAt(i+=.75),o>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return a}),t.atob||(t.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,i=0,s=0,a="";o=t.charAt(s++);~o&&(n=i%4?64*n+o:o,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)o=r.indexOf(o);return a})}()},{}],47:[function(e,t,n){var r=e(43),o=t.exports;for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);o.request=function(e,t){return e||(e={}),e.scheme="https",r.request.call(this,e,t)}},{43:43}],48:[function(e,t,n){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],49:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],50:[function(e,t,n){n.endianness=function(){return"LE"},n.hostname=function(){return"undefined"!=typeof location?location.hostname:""},n.loadavg=function(){return[]},n.uptime=function(){return 0},n.freemem=function(){return Number.MAX_VALUE},n.totalmem=function(){return Number.MAX_VALUE},n.cpus=function(){return[]},n.type=function(){return"Browser"},n.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},n.networkInterfaces=n.getNetworkInterfaces=function(){return{}},n.arch=function(){return"javascript"},n.platform=function(){return"browser"},n.tmpdir=n.tmpDir=function(){return"/tmp"},n.EOL="\n"},{}],51:[function(e,t,n){function r(){if(!a){a=!0;for(var e,t=s.length;t;){e=s,s=[];for(var n=-1;++n<t;)e[n]();t=s.length}a=!1}}function o(){}var i=t.exports={},s=[],a=!1;i.nextTick=function(e){s.push(e),a||setTimeout(r,0)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=o,i.addListener=o,i.once=o,i.off=o,i.removeListener=o,i.removeAllListeners=o,i.emit=o,i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],52:[function(e,t,n){(function(e){!function(r){function o(e){throw RangeError(T[e])}function i(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function s(e,t){return i(e.split(P),t).join(".")}function a(e){for(var t,n,r=[],o=0,i=e.length;i>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&i>o?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function u(e){return i(e,function(e){var t="";return e>65535&&(e-=65536,t+=N(e>>>10&1023|55296),e=56320|1023&e),t+=N(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:A}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function p(e,t,n){var r=0;for(e=n?M(e/_):e>>1,e+=M(e/t);e>L*k>>1;r+=A)e=M(e/L);return M(r+(L+1)*e/(e+S))}function l(e){var t,n,r,i,s,a,f,l,h,d,g=[],m=e.length,y=0,v=C,b=O;for(n=e.lastIndexOf(R),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&o("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;m>i;){for(s=y,a=1,f=A;i>=m&&o("invalid-input"),l=c(e.charCodeAt(i++)),(l>=A||l>M((x-y)/a))&&o("overflow"),y+=l*a,h=b>=f?E:f>=b+k?k:f-b,!(h>l);f+=A)d=A-h,a>M(x/d)&&o("overflow"),a*=d;t=g.length+1,b=p(y-s,t,0==s),M(y/t)>x-v&&o("overflow"),v+=M(y/t),y%=t,g.splice(y++,0,v)}return u(g)}function h(e){var t,n,r,i,s,u,c,l,h,d,g,m,y,v,b,w=[];for(e=a(e),m=e.length,t=C,n=0,s=O,u=0;m>u;++u)g=e[u],128>g&&w.push(N(g));for(r=i=w.length,i&&w.push(R);m>r;){for(c=x,u=0;m>u;++u)g=e[u],g>=t&&c>g&&(c=g);for(y=r+1,c-t>M((x-n)/y)&&o("overflow"),n+=(c-t)*y,t=c,u=0;m>u;++u)if(g=e[u],t>g&&++n>x&&o("overflow"),g==t){for(l=n,h=A;d=s>=h?E:h>=s+k?k:h-s,!(d>l);h+=A)b=l-d,v=A-d,w.push(N(f(d+b%v,0))),l=M(b/v);w.push(N(f(l,0))),s=p(n,y,r==i),n=0,++r}++n,++t}return w.join("")}function d(e){return s(e,function(e){return U.test(e)?l(e.slice(4).toLowerCase()):e})}function g(e){return s(e,function(e){return j.test(e)?"xn--"+h(e):e})}var m="object"==typeof n&&n,y="object"==typeof t&&t&&t.exports==m&&t,v="object"==typeof e&&e;(v.global===v||v.window===v)&&(r=v);var b,w,x=2147483647,A=36,E=1,k=26,S=38,_=700,O=72,C=128,R="-",U=/^xn--/,j=/[^ -~]/,P=/\x2E|\u3002|\uFF0E|\uFF61/g,T={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=A-E,M=Math.floor,N=String.fromCharCode;if(b={version:"1.2.4",ucs2:{decode:a,encode:u},decode:l,encode:h,toASCII:g,toUnicode:d},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return b});else if(m&&!m.nodeType)if(y)y.exports=b;else for(w in b)b.hasOwnProperty(w)&&(m[w]=b[w]);else r.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],53:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,i){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;i&&"number"==typeof i.maxKeys&&(u=i.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var f=0;c>f;++f){var p,l,h,d,g=e[f].replace(a,"%20"),m=g.indexOf(n);m>=0?(p=g.substr(0,m),l=g.substr(m+1)):(p=g,l=""),h=decodeURIComponent(p),d=decodeURIComponent(l),r(s,h)?o(s[h])?s[h].push(d):s[h]=[s[h],d]:s[h]=d}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],54:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var o=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(s(e),function(s){var a=encodeURIComponent(o(s))+n;return i(e[s])?r(e[s],function(e){return a+encodeURIComponent(o(e))}).join(t):a+encodeURIComponent(o(e[s]))}).join(t):a?encodeURIComponent(o(a))+n+encodeURIComponent(o(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],55:[function(e,t,n){"use strict";n.decode=n.parse=e(53),n.encode=n.stringify=e(54)},{53:53,54:54}],56:[function(e,t,n){t.exports=e(57)},{57:57}],57:[function(e,t,n){(function(n){function r(e){return this instanceof r?(u.call(this,e),c.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",o)):new r(e)}function o(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}function i(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}t.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=e(62);a.inherits=e(48);var u=e(59),c=e(61);a.inherits(r,u),i(s(c.prototype),function(e){r.prototype[e]||(r.prototype[e]=c.prototype[e])})}).call(this,e(51))},{48:48,51:51,59:59,61:61,62:62}],58:[function(e,t,n){function r(e){return this instanceof r?void o.call(this,e):new r(e)}t.exports=r;var o=e(60),i=e(62);i.inherits=e(48),i.inherits(r,o),r.prototype._transform=function(e,t,n){n(null,e)}},{48:48,60:60,62:62}],59:[function(e,t,n){(function(n){function r(t,n){var r=e(57);t=t||{};var o=t.highWaterMark,i=t.objectMode?16:16384;this.highWaterMark=o||0===o?o:i,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(C||(C=e(68).StringDecoder),this.decoder=new C(t.encoding),this.encoding=t.encoding)}function o(t){e(57);return this instanceof o?(this._readableState=new r(t,this),this.readable=!0,void _.call(this)):new o(t)}function i(e,t,n,r,o){var i=c(t,n);if(i)e.emit("error",i);else if(O.isNullOrUndefined(n))t.reading=!1,t.ended||f(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&o){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||o||r||(n=t.decoder.write(n)),o||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&p(e)),h(e,t);else o||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=U)e=U;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||O.isNull(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return O.isBuffer(t)||O.isString(t)||O.isNullOrUndefined(t)||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,p(e)}function p(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(R("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(function(){l(e)}):l(e))}function l(e){R("emit readable"),e.emit("readable"),v(e)}function h(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){d(e,t)}))}function d(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(R("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function g(e){return function(){var t=e._readableState;R("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&S.listenerCount(e,"data")&&(t.flowing=!0,v(e))}}function m(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(function(){y(e,t)}))}function y(e,t){t.resumeScheduled=!1,e.emit("resume"),v(e),t.flowing&&!t.reading&&e.read(0)}function v(e){var t=e._readableState;if(R("flow",t.flowing),t.flowing)do var n=e.read();while(null!==n&&t.flowing)}function b(e,t){var n,r=t.buffer,o=t.length,i=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===o)n=null;else if(s)n=r.shift();else if(!e||e>=o)n=i?r.join(""):k.concat(r,o),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=i?"":new k(e);for(var u=0,c=0,f=r.length;f>c&&e>u;c++){var a=r[0],p=Math.min(e-u,a.length);i?n+=a.slice(0,p):a.copy(n,u,0,p),p<a.length?r[0]=a.slice(p):r.shift(),u+=p}}return n}function w(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function x(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function A(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=o;var E=e(49),k=e(38).Buffer;o.ReadableState=r;var S=e(42).EventEmitter;S.listenerCount||(S.listenerCount=function(e,t){return e.listeners(t).length});var _=e(67),O=e(62);O.inherits=e(48);var C,R=e(37);R=R&&R.debuglog?R.debuglog("stream"):function(){},O.inherits(o,_),o.prototype.push=function(e,t){var n=this._readableState;return O.isString(e)&&!n.objectMode&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=new k(e,t),t="")),i(this,n,e,t,!1)},o.prototype.unshift=function(e){var t=this._readableState;return i(this,t,e,"",!0)},o.prototype.setEncoding=function(t){return C||(C=e(68).StringDecoder),this._readableState.decoder=new C(t),this._readableState.encoding=t,this};var U=8388608;o.prototype.read=function(e){R("read",e);var t=this._readableState,n=e;if((!O.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return R("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?w(this):p(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(this),null;var r=t.needReadable;R("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,R("length less than watermark",r)),(t.ended||t.reading)&&(r=!1,R("reading or ended",r)),r&&(R("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=u(n,t));var o;return o=e>0?b(e,t):null,O.isNull(o)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&w(this),O.isNull(o)||this.emit("data",o),o},o.prototype._read=function(e){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(e,t){function r(e){R("onunpipe"),e===p&&i()}function o(){R("onend"),e.end()}function i(){R("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",m),e.removeListener("error",a),e.removeListener("unpipe",r),p.removeListener("end",o),p.removeListener("end",i),p.removeListener("data",s),!l.awaitDrain||e._writableState&&!e._writableState.needDrain||m()}function s(t){R("ondata");var n=e.write(t);!1===n&&(R("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,p.pause())}function a(t){R("onerror",t),f(),e.removeListener("error",a),0===S.listenerCount(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),f()}function c(){R("onfinish"),e.removeListener("close",u),f()}function f(){R("unpipe"),p.unpipe(e)}var p=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1,R("pipe count=%d opts=%j",l.pipesCount,t);var h=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,d=h?o:i;l.endEmitted?n.nextTick(d):p.once("end",d),e.on("unpipe",r);var m=g(p);return e.on("drain",m),p.on("data",s),e._events&&e._events.error?E(e._events.error)?e._events.error.unshift(a):e._events.error=[a,e._events.error]:e.on("error",a),e.once("close",u),e.once("finish",c),e.emit("pipe",p),l.flowing||(R("pipe resume"),p.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;r>o;o++)n[o].emit("unpipe",this);return this}var o=A(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},o.prototype.on=function(e,t){var r=_.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var o=this._readableState;if(!o.readableListening)if(o.readableListening=!0,o.emittedReadable=!1,o.needReadable=!0,o.reading)o.length&&p(this,o);else{var i=this;n.nextTick(function(){R("readable nexttick read 0"),i.read(0)})}}return r},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(R("resume"),e.flowing=!0,e.reading||(R("resume read 0"),this.read(0)),m(this,e)),this},o.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(R("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(o){if(R("wrapped data"),t.decoder&&(o=t.decoder.write(o)),o&&(t.objectMode||o.length)){var i=r.push(o);i||(n=!0,e.pause())}});for(var o in e)O.isFunction(e[o])&&O.isUndefined(this[o])&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));var i=["error","close","destroy","pause","resume"];return x(i,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){R("wrapped _read",t),n&&(n=!1,e.resume())},r},o._fromList=b}).call(this,e(51))},{37:37,38:38,42:42,48:48,49:49,51:51,57:57,62:62,67:67,68:68}],60:[function(e,t,n){function r(e,t){this.afterTransform=function(e,n){return o(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function o(e,t,n){var r=e._transformState;r.transforming=!1;var o=r.writecb;if(!o)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,u.isNullOrUndefined(n)||e.push(n),o&&o(t);var i=e._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&e._read(i.highWaterMark)}function i(e){if(!(this instanceof i))return new i(e);a.call(this,e),this._transformState=new r(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){u.isFunction(this._flush)?this._flush(function(e){s(t,e)}):s(t)})}function s(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=i;var a=e(57),u=e(62);u.inherits=e(48),u.inherits(i,a),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,n){throw new Error("not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;u.isNull(t.writechunk)||!t.writecb||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))}},{48:48,57:57,62:62}],61:[function(e,t,n){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function o(t,n){var r=e(57);t=t||{};var o=t.highWaterMark,i=t.objectMode?16:16384;this.highWaterMark=o||0===o?o:i,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){h(n,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function i(t){var n=e(57);return this instanceof i||this instanceof n?(this._writableState=new o(t,this),this.writable=!0,void E.call(this)):new i(t)}function s(e,t,r){var o=new Error("write after end");e.emit("error",o),n.nextTick(function(){r(o)})}function a(e,t,r,o){var i=!0;if(!(A.isBuffer(r)||A.isString(r)||A.isNullOrUndefined(r)||t.objectMode)){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),n.nextTick(function(){o(s)}),i=!1}return i}function u(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&A.isString(t)&&(t=new x(t,n)),t}function c(e,t,n,o,i){n=u(t,n,o),A.isBuffer(n)&&(o="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked?t.buffer.push(new r(n,o,i)):f(e,t,!1,s,n,o,i),a}function f(e,t,n,r,o,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function p(e,t,r,o,i){r?n.nextTick(function(){t.pendingcb--,i(o)}):(t.pendingcb--,i(o)),e._writableState.errorEmitted=!0,e.emit("error",o)}function l(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function h(e,t){var r=e._writableState,o=r.sync,i=r.writecb;if(l(r),t)p(e,r,o,t,i);else{var s=y(e,r);s||r.corked||r.bufferProcessing||!r.buffer.length||m(e,r),o?n.nextTick(function(){d(e,r,s,i)}):d(e,r,s,i)}}function d(e,t,n,r){n||g(e,t),t.pendingcb--,r(),b(e,t)}function g(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function m(e,t){if(t.bufferProcessing=!0,e._writev&&t.buffer.length>1){for(var n=[],r=0;r<t.buffer.length;r++)n.push(t.buffer[r].callback);t.pendingcb++,f(e,t,!0,t.length,t.buffer,"",function(e){
for(var r=0;r<n.length;r++)t.pendingcb--,n[r](e)}),t.buffer=[]}else{for(var r=0;r<t.buffer.length;r++){var o=t.buffer[r],i=o.chunk,s=o.encoding,a=o.callback,u=t.objectMode?1:i.length;if(f(e,t,!1,u,i,s,a),t.writing){r++;break}}r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}t.bufferProcessing=!1}function y(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function v(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function b(e,t){var n=y(e,t);return n&&(0===t.pendingcb?(v(e,t),t.finished=!0,e.emit("finish")):v(e,t)),n}function w(e,t,r){t.ending=!0,b(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=i;var x=e(38).Buffer;i.WritableState=o;var A=e(62);A.inherits=e(48);var E=e(67);A.inherits(i,E),i.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},i.prototype.write=function(e,t,n){var r=this._writableState,o=!1;return A.isFunction(t)&&(n=t,t=null),A.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),A.isFunction(n)||(n=function(){}),r.ended?s(this,r,n):a(this,r,e,n)&&(r.pendingcb++,o=c(this,r,e,t,n)),o},i.prototype.cork=function(){var e=this._writableState;e.corked++},i.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||m(this,e))},i.prototype._write=function(e,t,n){n(new Error("not implemented"))},i.prototype._writev=null,i.prototype.end=function(e,t,n){var r=this._writableState;A.isFunction(e)?(n=e,e=null,t=null):A.isFunction(t)&&(n=t,t=null),A.isNullOrUndefined(e)||this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||w(this,r,n)}}).call(this,e(51))},{38:38,48:48,51:51,57:57,62:62,67:67}],62:[function(e,t,n){(function(e){function t(e){return Array.isArray(e)}function r(e){return"boolean"==typeof e}function o(e){return null===e}function i(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function c(e){return void 0===e}function f(e){return p(e)&&"[object RegExp]"===y(e)}function p(e){return"object"==typeof e&&null!==e}function l(e){return p(e)&&"[object Date]"===y(e)}function h(e){return p(e)&&("[object Error]"===y(e)||e instanceof Error)}function d(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function m(t){return e.isBuffer(t)}function y(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=o,n.isNullOrUndefined=i,n.isNumber=s,n.isString=a,n.isSymbol=u,n.isUndefined=c,n.isRegExp=f,n.isObject=p,n.isDate=l,n.isError=h,n.isFunction=d,n.isPrimitive=g,n.isBuffer=m}).call(this,e(38).Buffer)},{38:38}],63:[function(e,t,n){t.exports=e(58)},{58:58}],64:[function(e,t,n){n=t.exports=e(59),n.Stream=e(67),n.Readable=n,n.Writable=e(61),n.Duplex=e(57),n.Transform=e(60),n.PassThrough=e(58)},{57:57,58:58,59:59,60:60,61:61,67:67}],65:[function(e,t,n){t.exports=e(60)},{60:60}],66:[function(e,t,n){t.exports=e(61)},{61:61}],67:[function(e,t,n){function r(){o.call(this)}t.exports=r;var o=e(42).EventEmitter,i=e(48);i(r,o),r.Readable=e(64),r.Writable=e(66),r.Duplex=e(56),r.Transform=e(65),r.PassThrough=e(63),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function i(){f||(f=!0,e.end())}function s(){f||(f=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===o.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",r),c.removeListener("end",i),c.removeListener("close",s),c.removeListener("error",a),e.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(c.on("end",i),c.on("close",s));var f=!1;return c.on("error",a),e.on("error",a),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}},{42:42,48:48,56:56,63:63,64:64,65:65,66:66}],68:[function(e,t,n){function r(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function o(e){return e.toString(this.encoding)}function i(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e(38).Buffer,u=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=o)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&56319>=r)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var o=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,o),o-=this.charReceived),t+=e.toString(this.encoding,0,o);var o=t.length-1,r=t.charCodeAt(o);if(r>=55296&&56319>=r){var i=this.surrogateSize;return this.charLength+=i,this.charReceived+=i,this.charBuffer.copy(this.charBuffer,i,0,i),e.copy(this.charBuffer,0,0,i),t.substring(0,o)}return t},c.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}this.charReceived=t},c.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,o=this.encoding;t+=r.slice(0,n).toString(o)}return t}},{38:38}],69:[function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function o(e,t,n){if(e&&c(e)&&e instanceof r)return e;var o=new r;return o.parse(e,t,n),o}function i(e){return u(e)&&(e=o(e)),e instanceof r?e.format():r.prototype.format.call(e)}function s(e,t){return o(e,!1,!0).resolve(t)}function a(e,t){return e?o(e,!1,!0).resolveObject(t):t}function u(e){return"string"==typeof e}function c(e){return"object"==typeof e&&null!==e}function f(e){return null===e}function p(e){return null==e}var l=e(52);n.parse=o,n.resolve=s,n.resolveObject=a,n.format=i,n.Url=r;var h=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,g=["<",">",'"',"`"," ","\r","\n"," "],m=["{","}","|","\\","^","`"].concat(g),y=["'"].concat(m),v=["%","/","?",";","#"].concat(y),b=["/","?","#"],w=255,x=/^[a-z0-9A-Z_-]{0,63}$/,A=/^([a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},k={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=e(55);r.prototype.parse=function(e,t,n){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var o=h.exec(r);if(o){o=o[0];var i=o.toLowerCase();this.protocol=i,r=r.substr(o.length)}if(n||o||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===r.substr(0,2);!s||o&&k[o]||(r=r.substr(2),this.slashes=!0)}if(!k[o]&&(s||o&&!S[o])){for(var a=-1,c=0;c<b.length;c++){var f=r.indexOf(b[c]);-1!==f&&(-1===a||a>f)&&(a=f)}var p,d;d=-1===a?r.lastIndexOf("@"):r.lastIndexOf("@",a),-1!==d&&(p=r.slice(0,d),r=r.slice(d+1),this.auth=decodeURIComponent(p)),a=-1;for(var c=0;c<v.length;c++){var f=r.indexOf(v[c]);-1!==f&&(-1===a||a>f)&&(a=f)}-1===a&&(a=r.length),this.host=r.slice(0,a),r=r.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var m=this.hostname.split(/\./),c=0,O=m.length;O>c;c++){var C=m[c];if(C&&!C.match(x)){for(var R="",U=0,j=C.length;j>U;U++)R+=C.charCodeAt(U)>127?"x":C[U];if(!R.match(x)){var P=m.slice(0,c),T=m.slice(c+1),L=C.match(A);L&&(P.push(L[1]),T.unshift(L[2])),T.length&&(r="/"+T.join(".")+r),this.hostname=P.join(".");break}}}if(this.hostname=this.hostname.length>w?"":this.hostname.toLowerCase(),!g){for(var M=this.hostname.split("."),N=[],c=0;c<M.length;++c){var B=M[c];N.push(B.match(/[^A-Za-z0-9_-]/)?"xn--"+l.encode(B):B)}this.hostname=N.join(".")}var I=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+I,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!E[i])for(var c=0,O=y.length;O>c;c++){var q=y[c],H=encodeURIComponent(q);H===q&&(H=escape(q)),r=r.split(q).join(H)}var F=r.indexOf("#");-1!==F&&(this.hash=r.substr(F),r=r.slice(0,F));var J=r.indexOf("?");if(-1!==J?(this.search=r.substr(J),this.query=r.substr(J+1),t&&(this.query=_.parse(this.query)),r=r.slice(0,J)):t&&(this.search="",this.query={}),r&&(this.pathname=r),S[i]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var I=this.pathname||"",B=this.search||"";this.path=I+B}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(i=_.stringify(this.query));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||S[t])&&o!==!1?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+n+s+r},r.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(u(e)){var t=new r;t.parse(e,!1,!0),e=t}var n=new r;if(Object.keys(this).forEach(function(e){n[e]=this[e]},this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(n[t]=e[t])}),S[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!S[e.protocol])return Object.keys(e).forEach(function(t){n[t]=e[t]}),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||k[e.protocol])n.pathname=e.pathname;else{for(var o=(e.pathname||"").split("/");o.length&&!(e.host=o.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),n.pathname=o.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var i=n.pathname||"",s=n.search||"";n.path=i+s}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=c||a||n.host&&e.pathname,h=l,d=n.pathname&&n.pathname.split("/")||[],o=e.pathname&&e.pathname.split("/")||[],g=n.protocol&&!S[n.protocol];if(g&&(n.hostname="",n.port=null,n.host&&(""===d[0]?d[0]=n.host:d.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===o[0]?o[0]=e.host:o.unshift(e.host)),e.host=null),l=l&&(""===o[0]||""===d[0])),c)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,d=o;else if(o.length)d||(d=[]),d.pop(),d=d.concat(o),n.search=e.search,n.query=e.query;else if(!p(e.search)){if(g){n.hostname=n.host=d.shift();var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=e.search,n.query=e.query,f(n.pathname)&&f(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!d.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var y=d.slice(-1)[0],v=(n.host||e.host)&&("."===y||".."===y)||""===y,b=0,w=d.length;w>=0;w--)y=d[w],"."==y?d.splice(w,1):".."===y?(d.splice(w,1),b++):b&&(d.splice(w,1),b--);if(!l&&!h)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),v&&"/"!==d.join("/").substr(-1)&&d.push("");var x=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(g){n.hostname=n.host=x?"":d.length?d.shift():"";var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return l=l||n.host&&d.length,l&&!x&&d.unshift(""),d.length?n.pathname=d.join("/"):(n.pathname=null,n.path=null),f(n.pathname)&&f(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{52:52,55:55}],70:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],71:[function(e,t,n){(function(t,r){function o(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&n._extend(r,t),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),u(r,e,r.depth)}function i(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return b(o)||(o=u(e,o,r)),o}var i=c(e,t);if(i)return i;var s=Object.keys(t),g=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),S(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(t);if(0===s.length){if(_(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(A(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return f(t)}var y="",v=!1,w=["{","}"];if(d(t)&&(v=!0,w=["[","]"]),_(t)){var x=t.name?": "+t.name:"";y=" [Function"+x+"]"}if(A(t)&&(y=" "+RegExp.prototype.toString.call(t)),k(t)&&(y=" "+Date.prototype.toUTCString.call(t)),S(t)&&(y=" "+f(t)),0===s.length&&(!v||0==t.length))return w[0]+y+w[1];if(0>r)return A(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var E;return E=v?p(e,t,r,g,s):s.map(function(n){return l(e,t,r,g,n,v)}),e.seen.pop(),h(E,y,w)}function c(e,t){if(x(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,o){for(var i=[],s=0,a=t.length;a>s;++s)i.push(j(t,String(s))?l(e,t,n,r,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(l(e,t,n,r,o,!0))}),i}function l(e,t,n,r,o,i){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),j(r,o)||(s="["+o+"]"),a||(e.seen.indexOf(c.value)<0?(a=m(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),x(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e,t,n){var r=0,o=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function y(e){return null==e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function x(e){return void 0===e}function A(e){return E(e)&&"[object RegExp]"===C(e)}function E(e){return"object"==typeof e&&null!==e}function k(e){return E(e)&&"[object Date]"===C(e)}function S(e){return E(e)&&("[object Error]"===C(e)||e instanceof Error)}function _(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function R(e){return 10>e?"0"+e.toString(10):e.toString(10)}function U(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(e).replace(P,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];i>n;a=r[++n])s+=m(a)||!E(a)?" "+a:" "+o(a);return s},n.deprecate=function(e,o){function i(){if(!s){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),s=!0}return e.apply(this,arguments)}if(x(r.process))return function(){return n.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return i};var T,L={};n.debuglog=function(e){if(x(T)&&(T=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(T)){var r=t.pid;L[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else L[e]=function(){};return L[e]},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=d,n.isBoolean=g,n.isNull=m,n.isNullOrUndefined=y,n.isNumber=v,n.isString=b,n.isSymbol=w,n.isUndefined=x,n.isRegExp=A,n.isObject=E,n.isDate=k,n.isError=S,n.isFunction=_,n.isPrimitive=O,n.isBuffer=e(70);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",U(),n.format.apply(n,arguments))},n.inherits=e(48),n._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e(51),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{48:48,51:51,70:70}],72:[function(e,t,n){!function(e){"object"==typeof n?t.exports=e(this):"function"==typeof define&&define.amd?define(e):this.R=e(this)}(function(){"use strict";function e(){return new TypeError("Function called with no arguments")}function t(n,r,o){switch(arguments.length){case 0:throw e();case 1:return t(n,0,n.length);case 2:return t(n,r,n.length);default:for(var i=Math.max(0,o-r),s=new Array(i),a=-1;++a<i;)s[a]=n[r+a];return s}}function n(e,t){e=e||[],t=t||[];var n,r=e.length,o=t.length,i=new Array(r+o);for(n=-1;++n<r;)i[n]=e[n];for(n=-1;++n<o;)i[r+n]=t[n];return i}function r(t){return function(n,r){switch(arguments.length){case 0:throw e();case 1:return function(e){return t(n,e)};default:return t(n,r)}}}function o(t){return function(n,o,i){switch(arguments.length){case 0:throw e();case 1:return r(function(e,r){return t(n,e,r)});case 2:return function(e){return t(n,o,e)};default:return t(n,o,i)}}}function i(e,t){return null!=t&&!W(t)&&"function"==typeof t[e]}function s(e,t){return function(n,r,o){var i=arguments.length,s=arguments[i-1],a=s&&!W(s)&&"function"==typeof s[e];switch(arguments.length){case 0:return t();case 1:return a?s[e]():t(n);case 2:return a?s[e](n):t(n,r);case 3:return a?s[e](n,r):t(n,r,o)}}}function a(e,t){for(var n=-1,r=t.length;++n<r;)e(t[n]);return t}function u(e,t,n){switch(e&&z.call(e)){case"[object Object]":return c(e,{},t,n);case"[object Array]":return c(e,[],t,n);case"[object Function]":return e;case"[object Date]":return new Date(e);default:return e}}function c(e,t,n,r){for(var o=n.length,i=-1;++i<o;)if(e===n[i])return r[i];n.push(e),r.push(t);for(var s in e)t[s]=u(e[s],n,r);return t}function f(e,t){return n([e],t)}function p(e,t){return n(t,[e])}function l(e,t){return function(){return e.call(this,t.apply(this,arguments))}}function h(e,t){return function(){var n=this,r=t.apply(this,arguments);return d(r)?r.then(function(t){return e.call(n,t)}):e.call(this,r)}}function d(e){return null!=e&&e===Object(e)&&e.then&&"function"==typeof e.then}function g(t){return function(){switch(arguments.length){case 0:throw e();case 1:return arguments[0];default:for(var n=arguments.length-1,r=arguments[n],o=r.length;n--;)r=t(arguments[n],r);return te(o,r)}}}function m(e){return function(n){var r=t(arguments,1);return te(Math.max(0,n.length-r.length),function(){return n.apply(this,e(r,arguments))})}}function y(e,t){for(var n=-1,r=t.length,o=new Array(r);++n<r;)o[n]=e(t[n]);return o}function v(e,t){for(var n=-1,r=t.length,o=[];++n<r;)e(t[n])&&o.push(t[n]);return o}function b(e,t){for(var n=-1,r=t.length,o=[];++n<r;)e(t[n],n,t)&&o.push(t[n]);return o}function w(e,t){for(var n=-1;++n<t.length;)if(!e(t[n]))return!1;return!0}function x(e,t){for(var n=-1;++n<t.length;)if(e(t[n]))return!0;return!1}function A(e,t,n){var r=0,o=e.length;for("number"==typeof n&&(r=0>n?Math.max(0,o+n):n);o>r;){if(e[r]===t)return r;++r}return-1}function E(e,t,n){var r=e.length;for("number"==typeof n&&(r=0>n?r+n+1:Math.min(r,n+1));--r>=0;)if(e[r]===t)return r;return-1}function k(e,t){return A(t,e)>=0}function S(e,t,n){for(var r=-1,o=n.length;++r<o;)if(e(t,n[r]))return!0;return!1}function _(e){return function t(n){for(var r,o,i,s=[],a=-1,u=n.length;++a<u;)if(K(n[a]))for(r=e?t(n[a]):n[a],o=-1,i=r.length;++o<i;)s.push(r[o]);else s.push(n[a]);return s}}function O(e){return function(t){return y(function(e){return[e,t[e]]},e(t))}}function C(e,t){for(var n,r={},o=He(t),i=o.length,s=-1;++s<i;)n=o[s],e(t[n],n,t)&&(r[n]=t[n]);return r}function R(e,t){var n={};return a(function(e){n[e]=t[e]},e),n}function U(e,t){for(var n=qe(t),r=-1,o=n.length;++r<o;)e[n[r]]=t[n[r]];return e}function j(e,t,n){if(e===n)return!0;if(null==n)return!1;t.fn=t.fn||[],t.obj=t.obj||[];for(var r,o,i=-1,s=t.fn.length,a=-1,u=t.obj.length;++i<s;){if(r=t.fn[i],o=e[r],!(r in n))return!1;if(!o(n[r],n))return!1}for(;++a<u;)if(r=t.obj[a],e[r]!==n[r])return!1;return!0}function P(e){return function(n){var r=function(){var t=arguments;return e(function(e){return e.apply(null,t)},n)};return arguments.length>1?r.apply(null,t(arguments,1)):te(Ve(Ue("length",n)),r)}}function T(e,t){return e+t}function L(e,t){return e*t}function M(e,t){return t>e}function N(e,t){return e>t}function B(t,n){return function(r){if(0===arguments.length)throw e();for(var o,i=-1,s=n;++i<r.length;)o=+r[i],t(o,s)&&(s=o);return s}}function I(e){return function(t,n){if(n&&n.length>0){for(var r,o=0,i=n[o],s=t(i);++o<n.length;)r=t(n[o]),e(r,s)&&(s=r,i=n[o]);return i}}}function D(e,t){var n,r=-1,o=e.length;if(null!=t){for(n=t;null!=n&&++r<o;)n=n[e[r]];return n}}function q(e,t){return y(function(t){return{key:e(t),val:t}},t)}function H(e){return function(t){return v(function(e){return"function"==typeof t[e]},e(t))}}var F,J={version:"0.8.0"},z=Object.prototype.toString,W=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===z.call(e)},K=J.isArrayLike=function(e){return W(e)?!0:e?"object"!=typeof e?!1:e instanceof String?!1:1===e.nodeType?!!e.length:0===e.length?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1:!1};try{Object.defineProperty(J,"__",{writable:!1,value:F})}catch(Y){J.__=F}var V=J.op=function(t){var n=t.length;if(2!==n)throw new Error("Expected binary function.");return function r(n,o){switch(arguments.length){case 0:throw e();case 1:return n===F?ee(X(r)):Z(ge(t,n));default:return n===F?Z(me(t,o)):t(n,o)}}},G=J.curryN=function(t,r){return function o(i){return te(Math.max(t-(i&&i.length||0),0),function(){if(0===arguments.length)throw e();var s=n(i,arguments);return s.length>=t?r.apply(this,s):o(s)})}([])},$=J.curry=function(e){return G(e.length,e)},X=J.flip=function(r){return function(o,i){switch(arguments.length){case 0:throw e();case 1:return function(e){return r.apply(this,[e,o].concat(t(arguments,1)))};default:return r.apply(this,n([i,o],t(arguments,2)))}}},Q=J.nAry=function(e,t){switch(e){case 0:return function(){return t.call(this)};case 1:return function(e){return t.call(this,e)};case 2:return function(e,n){return t.call(this,e,n)};case 3:return function(e,n,r){return t.call(this,e,n,r)};case 4:return function(e,n,r,o){return t.call(this,e,n,r,o)};case 5:return function(e,n,r,o,i){return t.call(this,e,n,r,o,i)};case 6:return function(e,n,r,o,i,s){return t.call(this,e,n,r,o,i,s)};case 7:return function(e,n,r,o,i,s,a){return t.call(this,e,n,r,o,i,s,a)};case 8:return function(e,n,r,o,i,s,a,u){return t.call(this,e,n,r,o,i,s,a,u)};case 9:return function(e,n,r,o,i,s,a,u,c){return t.call(this,e,n,r,o,i,s,a,u,c)};case 10:return function(e,n,r,o,i,s,a,u,c,f){return t.call(this,e,n,r,o,i,s,a,u,c,f)};default:return t}},Z=J.unary=function(e){return Q(1,e)},ee=J.binary=function(e){return Q(2,e)},te=J.arity=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,s){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,s,a){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,s,a,u){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,s,a,u,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,s,a,u,c,f){return t.apply(this,arguments)};default:return t}},ne=J.invokerN=function(e,n){var r=t(arguments,2),o=e-r.length;return G(o+1,function(){var e=arguments[o],i=r.concat(t(arguments,0,o));return e[n].apply(e,i)})},re=J.useWith=function(e){var n=t(arguments,1),r=n.length;return $(te(r,function(){for(var o=[],i=-1;++i<r;)o.push(n[i](arguments[i]));return e.apply(this,o.concat(t(arguments,r)))}))};J.forEach=r(a),J.forEach.idx=r(function(e,t){for(var n=-1,r=t.length;++n<r;)e(t[n],n,t);return t});var oe=J.clone=function(e){return t(e)};J.cloneDeep=function(e){return u(e,[],[])};var ie=J.isEmpty=function(e){return null==e||0===e.length},se=J.prepend=r(f);J.cons=se,J.prependTo=X(f);var ae=J.nth=r(function(e,t){return 0>e?t[t.length+e]:t[e]}),ue=J.head=ae(0);J.car=ue,J.last=ae(-1);var ce=J.tail=s("tail",function(e){return t(e,1)});J.cdr=ce;var fe=J.append=r(p);J.push=fe,J.appendTo=X(p),J.concat=r(function(e,t){if(W(t))return n(e,t);if(i("concat",e))return e.concat(t);throw new TypeError("can't concat "+typeof e)});var pe=J.identity=function(e){return e};J.I=pe,J.argN=function(e){return function(){return arguments[e]}};var le=J.times=r(function(e,t){for(var n=new Array(t),r=-1;++r<t;)n[r]=e(r);return n});J.repeatN=r(function(e,t){return le(De(e),t)}),J.apply=r(function(e,t){return e.apply(this,t)}),J.unapply=function(n){if(0===arguments.length)throw e();return function(){return n(t(arguments))}};var he=J.compose=g(l),de=J.pCompose=g(h);J.pipe=function(){return he.apply(this,Le(arguments))},J.pPipe=function(){return de.apply(this,Le(arguments))};var ge=J.lPartial=m(n),me=J.rPartial=m(X(n));J.memoize=function(e){if(!e.length)return ye(e);var n={};return function(){if(arguments.length){var r=be(function(e,t){return e[t]||(e[t]={})},n,t(arguments,0,arguments.length-1)),o=arguments[arguments.length-1];return r[o]||(r[o]=e.apply(this,arguments))}}};var ye=J.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments))}};J.wrap=function(e,t){return te(e.length,function(){return t.apply(this,n([e],arguments))})};var ve=J.constructN=r(function(e,t){var n=function(){var e,n,r=function(){};return r.prototype=t.prototype,e=new r,n=t.apply(e,arguments),Object(n)===n?n:e};return e>1?$(Q(e,n)):n});J.construct=function(e){return ve(e.length,e)},J.converge=function(e){var n=t(arguments,1);return function(){var t=arguments;return e.apply(this,y(function(e){return e.apply(this,t)},n))}};var be=J.reduce=o(function(e,t,n){for(var r=-1,o=n.length;++r<o;)t=e(t,n[r]);return t});J.foldl=be,J.reduce.idx=o(function(e,t,n){for(var r=-1,o=n.length;++r<o;)t=e(t,n[r],r,n);return t}),J.foldl.idx=be.idx;var we=J.reduceRight=o(s("reduceRight",function(e,t,n){for(var r=n.length;r--;)t=e(t,n[r]);return t}));J.foldr=we,J.reduceRight.idx=o(function(e,t,n){for(var r=n.length;r--;)t=e(t,n[r],r,n);return t}),J.foldr.idx=we.idx,J.unfoldr=r(function(e,t){for(var n=e(t),r=[];n&&n.length;)r.push(n[0]),n=e(n[1]);return r});var xe=J.map=r(s("map",y));J.map.idx=r(function(e,t){for(var n=-1,r=t.length,o=new Array(r);++n<r;)o[n]=e(t[n],n,t);return o}),J.mapObj=r(function(e,t){return be(function(n,r){return n[r]=e(t[r]),n},{},qe(t))}),J.mapObj.idx=r(function(e,t){return be(function(n,r){return n[r]=e(t[r],r,t),n},{},qe(t))}),J.scanl=o(function(e,t,n){var r=0,o=n.length+1,i=new Array(o);for(i[r]=t;++r<o;)t=e(t,n[r-1]),i[r]=t;return i});var Ae=J.liftN=r(function(n,r){var o=G(n,r);if(0===arguments.length)throw e();return G(n,function(){return be(Ee,y(o,arguments[0]),t(arguments,1))})});J.lift=function(t){if(0===arguments.length)throw e();return Ae(t.length,t)};var Ee=J.ap=r(function(e,t){return i("ap",e)?e.ap(t):be(function(e,r){return n(e,y(r,t))},[],e)});J.of=function(e,t){return i("of",t)?t.of(e):[e]},J.empty=function(e){return i("empty",e)?e.empty():[]},J.chain=r(s("chain",function(e,t){return je(y(e,t))}));var ke=J.commuteMap=o(function(e,t,n){function r(t,n){return Ee(xe(fe,e(n)),t)}return be(r,t([]),n)});J.commute=ke(xe(pe));var Se=J.size=function(e){return e.length};J.length=Se,J.filter=r(s("filter",v)),J.filter.idx=r(b);var _e=function(e,t){return v(We(e),t)};J.reject=r(_e),J.reject.idx=r(function(e,t){return b(We(e),t)}),J.takeWhile=r(s("takeWhile",function(e,n){for(var r=-1,o=n.length;++r<o&&e(n[r]););return t(n,0,r)})),J.take=r(s("take",function(e,n){return t(n,0,Math.min(e,n.length))})),J.skipUntil=r(function(e,n){for(var r=-1,o=n.length;++r<o&&!e(n[r]););return t(n,r)}),J.skip=r(s("skip",function(e,n){return e<n.length?t(n,e):[]})),J.find=r(function(e,t){for(var n=-1,r=t.length;++n<r;)if(e(t[n]))return t[n]}),J.findIndex=r(function(e,t){for(var n=-1,r=t.length;++n<r;)if(e(t[n]))return n;
return-1}),J.findLast=r(function(e,t){for(var n=t.length;n--;)if(e(t[n]))return t[n]}),J.findLastIndex=r(function(e,t){for(var n=t.length;n--;)if(e(t[n]))return n;return-1}),J.every=r(w),J.some=r(x),J.indexOf=r(function(e,t){return A(t,e)}),J.indexOf.from=o(function(e,t,n){return A(n,e,t)}),J.lastIndexOf=r(function(e,t){return E(t,e)}),J.lastIndexOf.from=o(function(e,t,n){return E(n,e,t)}),J.contains=r(k);var Oe=J.containsWith=o(S),Ce=J.uniq=function(e){for(var t,n=-1,r=e.length,o=[];++n<r;)t=e[n],k(t,o)||o.push(t);return o};J.isSet=function(e){for(var t=e.length,n=-1;++n<t;)if(A(e,e[n],n+1)>=0)return!1;return!0};var Re=J.uniqWith=r(function(e,t){for(var n,r=-1,o=t.length,i=[];++r<o;)n=t[r],S(e,n,i)||i.push(n);return i}),Ue=J.pluck=r(function(e,t){return y(Be(e),t)});J.flatten=_(!0);var je=J.unnest=_(!1);J.zipWith=o(function(e,t,n){for(var r=[],o=-1,i=Math.min(t.length,n.length);++o<i;)r[o]=e(t[o],n[o]);return r}),J.zip=r(function(e,t){for(var n=[],r=-1,o=Math.min(e.length,t.length);++r<o;)n[r]=[e[r],t[r]];return n}),J.zipObj=r(function(e,t){for(var n=-1,r=e.length,o={};++n<r;)o[e[n]]=t[n];return o});var Pe=J.fromPairs=function(e){for(var t=-1,n=e.length,r={};++t<n;)W(e[t])&&e[t].length&&(r[e[t][0]]=e[t][1]);return r},Te=J.createMapEntry=r(function(e,t){var n={};return n[e]=t,n});J.lens=r(function(e,t){var n=function(t){return e(t)};return n.set=t,n.map=function(n,r){return t(n(e(r)),r)},n}),J.xprod=r(function(e,t){if(ie(e)||ie(t))return[];for(var n,r=-1,o=e.length,i=t.length,s=[];++r<o;)for(n=-1;++n<i;)s.push([e[r],t[n]]);return s});var Le=J.reverse=function(e){for(var t=-1,n=e.length,r=n,o=new Array(n);++t<n;)o[--r]=e[t];return o};J.range=r(function(e,t){if(e>=t)return[];for(var n=0,r=new Array(Math.floor(t)-Math.ceil(e));t>e;)r[n++]=e++;return r}),J.join=ne(1,"join"),J.slice=ne(2,"slice"),J.slice.from=r(function(e,t){return t.slice(e,t.length)}),J.remove=o(function(e,r,o){return n(t(o,0,Math.min(e,o.length)),t(o,Math.min(o.length,e+r)))}),J.insert=o(function(e,r,o){return e=e<o.length&&e>=0?e:o.length,n(p(r,t(o,0,e)),t(o,e))}),J.insert.all=o(function(e,r,o){return e=e<o.length&&e>=0?e:o.length,n(n(t(o,0,e),r),t(o,e))});var Me=J.comparator=function(e){return function(t,n){return e(t,n)?-1:e(n,t)?1:0}};J.sort=r(function(e,t){return oe(t).sort(e)});var Ne=J.groupBy=r(function(e,t){return be(function(t,n){var r=e(n);return t[r]=p(n,t[r]||(t[r]=[])),t},{},t)});J.partition=r(function(e,t){return be(function(t,n){return t[e(n)?0:1].push(n),t},[[],[]],t)}),J.tap=r(function(e,t){return e(t),t}),J.eq=r(function(e,t){return e===t});var Be=J.prop=function(t,n){switch(arguments.length){case 0:throw e();case 1:return function(e){return e[t]}}return n[t]};J.get=Be,J.propOf=X(Be),J.props=r(function(e,t){for(var n=e.length,r=new Array(n),o=-1;++o<n;)r[o]=t[e[o]];return r});var Ie=Object.prototype.hasOwnProperty;J.propOr=o(function(e,t,n){return Ie.call(n,e)?n[e]:t}),J.has=r(function(e,t){return Ie.call(t,e)}),J.hasIn=r(function(e,t){return e in t}),J.func=function(n,r){switch(arguments.length){case 0:throw e();case 1:return function(e){return e[n].apply(e,t(arguments,1))};default:return r[n].apply(r,t(arguments,2))}};var De=J.always=function(e){return function(){return e}};J.bind=r(function(e,t){return function(){return e.apply(t,arguments)}});var qe=J.keys=function(){var e=!{toString:null}.propertyIsEnumerable("toString"),t=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return function(n){if(Object(n)!==n)return[];if(Object.keys)return Object.keys(n);var r,o,i=[];for(r in n)Ie.call(n,r)&&i.push(r);if(e)for(o=t.length;o--;)r=t[o],Ie.call(n,r)&&!k(r,i)&&i.push(r);return i}}(),He=J.keysIn=function(e){var t,n=[];for(t in e)n.push(t);return n};J.toPairs=O(qe),J.toPairsIn=O(He),J.values=function(e){for(var t=qe(e),n=t.length,r=new Array(n),o=-1;++o<n;)r[o]=e[t[o]];return r},J.valuesIn=function(e){var t,n=[];for(t in e)n.push(e[t]);return n},J.pick=r(function(e,t){return C(function(t,n){return k(n,e)},t)}),J.omit=r(function(e,t){return C(function(t,n){return!k(n,e)},t)}),J.pickBy=r(C);var Fe=J.pickAll=r(R);J.mixin=r(function(e,t){return U(U({},e),t)}),J.cloneObj=function(e){return U({},e)},J.eqProps=o(function(e,t,n){return t[e]===n[e]}),J.where=function(t,n){var r=Ne(function(e){return"function"==typeof t[e]?"fn":"obj"},qe(t));switch(arguments.length){case 0:throw e();case 1:return function(e){return j(t,r,e)}}return j(t,r,n)};var Je=J.assoc=o(function(e,t,n){return U(Pe(y(function(e){return[e,n[e]]},He(n))),Te(e,t))});J.assocPath=function(){var n=function(e,r,o){if(1===e.length)return Je(e[0],r,o);var i=o[e[0]];return Je(e[0],n(t(e,1),r,ze(Object,i)?i:{}),o)};return function(t,o,i){var s=arguments.length;if(0===s)throw e();var a=$e(".",t),u=r(function(e,t){return n(a,e,t)});switch(s){case 1:return u;case 2:return u(o);default:return u(o,i)}}}(),J.installTo=function(e){return U(e,J)};var ze=J.is=r(function(e,t){return null!=t&&t.constructor===e||t instanceof e});J.type=function(e){return null===e?"Null":void 0===e?"Undefined":z.call(e).slice(8,-1)},J.alwaysZero=De(0),J.alwaysFalse=De(!1),J.alwaysTrue=De(!0),J.and=r(function(e,t){return function(){return e.apply(this,arguments)&&t.apply(this,arguments)}}),J.or=r(function(e,t){return function(){return e.apply(this,arguments)||t.apply(this,arguments)}});var We=J.not=function(e){return function(){return!e.apply(this,arguments)}};J.allPredicates=P(w),J.anyPredicates=P(x);var Ke=J.ifElse=o(function(e,t,n){return function(){return e.apply(this,arguments)?t.apply(this,arguments):n.apply(this,arguments)}});J["if"]=Ke,J.cond=function(){var e=arguments;return function(){for(var t=-1;++t<e.length;)if(e[t][0].apply(this,arguments))return e[t][1].apply(this,arguments)}},J.add=r(T),J.multiply=r(L),J.subtract=V(function(e,t){return e-t}),J.divide=V(function(e,t){return e/t}),J.modulo=V(function(e,t){return e%t});var Ye=Number.isInteger||function(e){return e<<0===e};J.mathMod=V(function(e,t){return Ye(e)?!Ye(t)||1>t?0/0:(e%t+t)%t:0/0}),J.sum=be(T,0),J.product=be(L,1),J.lt=V(M),J.lte=V(function(e,t){return t>=e}),J.gt=V(N),J.gte=V(function(e,t){return e>=t});var Ve=J.max=B(N,-(1/0));J.maxBy=r(I(N)),J.min=B(M,1/0),J.minBy=r(I(M));var Ge=J.substring=ne(2,"substring");J.substringFrom=X(Ge)(void 0),J.substringTo=Ge(0),J.charAt=ne(1,"charAt"),J.charCodeAt=ne(1,"charCodeAt"),J.match=ne(1,"match"),J.replace=o(function(e,t,n){return n.replace(e,t)}),J.strIndexOf=r(function(e,t){return t.indexOf(e)}),J.strLastIndexOf=r(function(e,t){return t.lastIndexOf(e)}),J.toUpperCase=ne(0,"toUpperCase"),J.toLowerCase=ne(0,"toLowerCase"),J.trim=function(){var e=" \n\f\r \u2028\u2029\ufeff",t="",n="function"==typeof String.prototype.trim;return n&&!e.trim()&&t.trim()?function(e){return e.trim()}:function(t){var n=new RegExp("^["+e+"]["+e+"]*"),r=new RegExp("["+e+"]["+e+"]*$");return t.replace(n,"").replace(r,"")}}();var $e=J.split=ne(1,"split"),Xe=J.pathOn=o(function(e,t,n){return D(t.split(e),n)});J.path=Xe("."),J.pathEq=o(function(e,t,n){return D(e.split("."),n)===t}),J.project=re(y,Fe,pe),J.propEq=o(function(e,t,n){return n[e]===t}),J.union=he(Ce,n),J.unionWith=o(function(e,t,r){return Re(e,n(t,r))}),J.difference=r(function(e,t){for(var n=[],r=-1,o=e.length;++r<o;)k(e[r],t)||k(e[r],n)||n.push(e[r]);return n}),J.differenceWith=o(function(e,t,n){for(var r=[],o=-1,i=t.length,s=Oe(e);++o<i;)s(t[o],n)||s(t[o],r)||r.push(t[o]);return r}),J.intersection=r(function(e,t){return Ce(v(X(k)(e),t))}),J.intersectionWith=o(function(e,t,n){for(var r=[],o=-1;++o<t.length;)S(e,t[o],n)&&(r[r.length]=t[o]);return Re(e,r)});var Qe=Me(function(e,t){return e.key<t.key});return J.sortBy=r(function(e,t){return Ue("val",q(e,t).sort(Qe))}),J.countBy=r(function(e,t){return be(function(e,t){return e[t.key]=(e[t.key]||0)+1,e},{},q(e,t))}),J.functions=H(qe),J.functionsIn=H(He),J})},{}],73:[function(e,t,n){!function(e,t){"use strict";var n;e(function(e){function r(e,t){var n,r,o,i;if(n=e,o={},t){for(r in t)i=new RegExp("\\{"+r+"\\}"),i.test(n)?n=n.replace(i,encodeURIComponent(t[r]),"g"):o[r]=t[r];for(r in o)n+=-1===n.indexOf("?")?"?":"&",n+=encodeURIComponent(r),null!==o[r]&&void 0!==o[r]&&(n+="=",n+=encodeURIComponent(o[r]))}return n}function o(e,t){return 0===e.indexOf(t)}function i(e,t){return this instanceof i?void(e instanceof i?(this._template=e.template,this._params=s({},this._params,t)):(this._template=(e||"").toString(),this._params=t||{})):new i(e,t)}var s,a,u,c,f;return s=e(83),u=/([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?(\/[^?#]*)?(\?[^#]*)?(#\S*)?/i,c=/^([a-z][a-z0-9\-\+\.]*:\/\/|\/)/i,f=/([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?\//i,i.prototype={append:function(e,t){return new i(this._template+e,s({},this._params,t))},fullyQualify:function(){if(!t)return this;if(this.isFullyQualified())return this;var e=this._template;return o(e,"//")?e=a.protocol+e:o(e,"/")?e=a.origin+e:this.isAbsolute()||(e=a.origin+a.pathname.substring(0,a.pathname.lastIndexOf("/")+1)),-1===e.indexOf("/",8)&&(e+="/"),new i(e,this._params)},isAbsolute:function(){return c.test(this.build())},isFullyQualified:function(){return f.test(this.build())},isCrossOrigin:function(){if(!a)return!0;var e=this.parts();return e.protocol!==a.protocol||e.hostname!==a.hostname||e.port!==a.port},parts:function(){var e,t;return e=this.fullyQualify().build().match(u),t={href:e[0],protocol:e[1],host:e[3]||"",hostname:e[4]||"",port:e[6],pathname:e[7]||"",search:e[8]||"",hash:e[9]||""},t.origin=t.protocol+"//"+t.host,t.port=t.port||("https:"===t.protocol?"443":"http:"===t.protocol?"80":""),t},build:function(e){return r(this._template,s({},this._params,e))},toString:function(){return this.build()}},a=t?new i(t.href).parts():n,i})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)},"undefined"!=typeof window?window.location:void 0)},{83:83}],74:[function(e,t,n){!function(e){"use strict";e(function(){return function(e,t){return t&&(e.skip=function(){return t}),e.wrap=function(t,n){return t(e,n)},e.chain=function(){return console&&(console.warn||console.log).call(console,"rest.js: client.chain() is deprecated, use client.wrap() instead"),e.wrap.apply(this,arguments)},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],75:[function(e,t,n){!function(e,t){"use strict";e(function(e){function n(e){var t={};return e?(e.trim().split(u).forEach(function(e){var n,r,o;n=e.indexOf(":"),r=i(e.substring(0,n).trim()),o=e.substring(n+1).trim(),t[r]?Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]:t[r]=o}),t):t}var r,o,i,s,a,u;return r=e(150),o=e(73),i=e(84),s=e(85),a=e(74),u=/[\r|\n]+/,a(function(e){return new s.ResponsePromise(function(r,i){var s,a,u,c,f,p,l,h;if(e="string"==typeof e?{path:e}:e||{},l={request:e},e.canceled)return l.error="precanceled",void i(l);if(h=e.engine||t.XMLHttpRequest,!h)return void i({request:e,error:"xhr-not-available"});f=e.entity,e.method=e.method||(f?"POST":"GET"),a=e.method,u=new o(e.path||"",e.params).build();try{s=l.raw=new h,s.open(a,u,!0),e.mixin&&Object.keys(e.mixin).forEach(function(t){e.mixin.hasOwnProperty(t)&&t in s&&(s[t]=e.mixin[t])}),c=e.headers;for(p in c)s.setRequestHeader(p,c[p]);e.canceled=!1,e.cancel=function(){e.canceled=!0,s.abort(),i(l)},s.onreadystatechange=function(){e.canceled||s.readyState===(h.DONE||4)&&(l.status={code:s.status,text:s.statusText},l.headers=n(s.getAllResponseHeaders()),l.entity=s.responseText,l.status.code>0&&r(l))};try{s.onerror=function(){l.error="loaderror",i(l)}}catch(d){}s.send(f)}catch(d){l.error="loaderror",i(l)}})})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)},"undefined"!=typeof window?window:void 0)},{150:150,73:73,74:74,84:84,85:85}],76:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){return e}function n(e){return e}function r(e){return e}function o(e){return p.promise(function(t,n){e.forEach(function(e){p(e,t,n)})})}function i(e){return this instanceof i?void u(this,e):new i(e)}function s(e){var s,u,l,h;return e=e||{},s=e.init||t,u=e.request||n,l=e.success||e.response||r,h=e.error||function(){return p((e.response||r).apply(this,arguments),p.reject,p.reject)},function(t,n){function r(e){var s,a;return s={},a={arguments:Array.prototype.slice.call(arguments),client:r},e="string"==typeof e?{path:e}:e||{},e.originator=e.originator||r,c(p(u.call(s,e,n,a),function(e){var r,u,c;return c=t,e instanceof i&&(u=e.abort,c=e.client||c,r=e.response,e=e.request),r=r||p(e,function(e){return p(c(e),function(e){return l.call(s,e,n,a)},function(e){return h.call(s,e,n,a)})}),u?o([r,u]):r},function(t){return p.reject({request:e,error:t})}))}return"object"==typeof t&&(n=t),"function"!=typeof t&&(t=e.client||a),n=s(Object.create(n||{})),f(r,t)}}var a,u,c,f,p;return a=e(82),u=e(83),c=e(85),f=e(74),p=e(150),s.ComplexRequest=i,s})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{150:150,74:74,82:82,83:83,85:85}],77:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n;return t=e(76),n=e(150),t({init:function(e){return e.code=e.code||400,e},response:function(e,t){return e.status&&e.status.code>=t.code?n.reject(e):e}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{150:150,76:76}],78:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n,r,o;return t=e(76),n=e(79),o=e(150),r=n.lookup("text/plain"),t({init:function(e){return e.registry=e.registry||n,e},request:function(e,t){var n,r;return r=e.headers||(e.headers={}),n=r["Content-Type"]=r["Content-Type"]||t.mime||"text/plain",r.Accept=r.Accept||t.accept||n+", application/json;q=0.8, text/plain;q=0.5, */*;q=0.2","entity"in e?t.registry.lookup(n).then(function(n){var r=t.client||e.originator;return o.attempt(n.write,e.entity,{client:r,request:e}).otherwise(function(){throw"mime-serialization"}).then(function(t){return e.entity=t,e})},function(){throw"mime-unknown"}):e},response:function(e,t){if(!(e.headers&&e.headers["Content-Type"]&&e.entity))return e;var n=e.headers["Content-Type"];return t.registry.lookup(n).otherwise(function(){return r}).then(function(n){var r=t.client||e.request&&e.request.originator;return o.attempt(n.read,e.entity,{client:r,response:e}).otherwise(function(t){throw e.error="mime-deserialization",e.cause=t,e}).then(function(t){return e.entity=t,e})})}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{150:150,76:76,79:79}],79:[function(e,t,n){!function(e){"use strict";e(function(t){function n(e){return e.split(/[;\+]/)[0].trim()}function r(e){var t={};"function"==typeof e&&(e=function(e){return{lookup:function(n){return t[n]=e(n),t[n]}}}(e)),this.lookup=function(r){return r=n(r),r in t?t[r]:e.lookup(r)},this.register=function(e,r){return e=n(e),t[e]=s.resolve(r),t[e]}}function o(e){var n;return s.promise(function(r,o){n=setTimeout(o,1e3),t(["./type/"+e],r,o)}).otherwise(function(t){return s.reject(t||new Error("Timeout while loading mime module: "+e))}).ensure(function(){clearTimeout(n)})}function i(e){return s.promise(function(n,r){try{n(t("./type/"+e))}catch(o){r(o)}})}var s,a;return s=t(150),r.prototype={child:function(){return new r(this)}},a=new r("function"==typeof e&&e.amd?o:i),a.register("text/plain",t(81)),a.register("application/json",t(80)),a})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{150:150,80:80,81:81}],80:[function(e,t,n){!function(e){"use strict";e(function(){return{read:function(e){return JSON.parse(e)},write:function(e){return JSON.stringify(e)}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],81:[function(e,t,n){!function(e){"use strict";e(function(){return{read:function(e){return e},write:function(e){return e.toString()}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],82:[function(e,t,n){(function(n){!function(e,t){"use strict";var n;e(function(e){function r(){return i.apply(n,arguments)}var o,i,s;return o=e(74),i=s=function(){if(t&&t.versions&&t.versions.node){var n="./client/node";return e(n)}return e(75)}(),r.setDefaultClient=function(e){i=e},r.getDefaultClient=function(){return i},r.resetDefaultClient=function(){i=s},o(r)})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)},"undefined"==typeof n?void 0:n)}).call(this,e(51))},{51:51,74:74,75:75}],83:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n,r,o,i;for(e||(e={}),n=1,r=arguments.length;r>n;n+=1){o=arguments[n];for(i in o)i in e&&(e[i]===o[i]||i in t&&t[i]===o[i])||(e[i]=o[i])}return e}var t={};return e})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],84:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){return e.toLowerCase().split("-").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join("-")}return e})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],85:[function(e,t,n){!function(e){"use strict";e(function(e){function t(){return o.apply(this,arguments)}function n(e,t){return e.then(function(e){return e&&e[t]},function(e){return i.reject(e&&e[t])})}function r(e){return new t(e.then.bind(e))}var o=e(134),i=e(150),s=e(84);return t.prototype=Object.create(o.prototype),t.prototype.entity=function(){return n(this,"entity")},t.prototype.status=function(){return n(n(this,"status"),"code")},t.prototype.headers=function(){return n(this,"headers")},t.prototype.header=function(e){return e=s(e),n(this.headers(),e)},r.ResponsePromise=t,r})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{134:134,150:150,84:84}],86:[function(e,t,n){t.exports=e(87)},{87:87}],87:[function(e,t,n){function r(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=o(e),i=r.source,c=r.id;return t.forceNew||t["force new connection"]||!1===t.multiplex?(a("ignoring socket cache for %s",i),n=s(i,t)):(u[c]||(a("new io instance for %s",i),u[c]=s(i,t)),n=u[c]),n.socket(r.path)}var o=e(91),i=e(128),s=e(88),a=e(94)("socket.io-client");t.exports=n=r;var u=n.managers={};n.protocol=i.protocol,n.connect=r,n.Manager=e(88),n.Socket=e(90)},{128:128,88:88,90:90,91:91,94:94}],88:[function(e,t,n){function r(e,t){return this instanceof r?(e&&"object"==typeof e&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connected=[],this.attempts=0,this.encoding=!1,this.packetBuffer=[],this.encoder=new a.Encoder,this.decoder=new a.Decoder,this.autoConnect=t.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(e,t)}var o=(e(91),e(95)),i=e(90),s=e(93),a=e(128),u=e(89),c=e(92),f=(e(125),e(94)("socket.io-client:manager")),p=e(124);t.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var e in this.nsps)this.nsps[e].emit.apply(this.nsps[e],arguments)},s(r.prototype),r.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},r.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this):this._reconnectionDelay},r.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this):this._reconnectionDelayMax},r.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){this.openReconnect||this.reconnecting||!this._reconnection||0!==this.attempts||(this.openReconnect=!0,this.reconnect())},r.prototype.open=r.prototype.connect=function(e){if(f("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;f("opening %s",this.uri),this.engine=o(this.uri,this.opts);var t=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var r=u(t,"open",function(){n.onopen(),e&&e()}),i=u(t,"error",function(t){if(f("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}n.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;f("connect attempt will timeout after %d",s);var a=setTimeout(function(){f("connect attempt timed out after %d",s),r.destroy(),t.close(),t.emit("error","timeout"),n.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(r),this.subs.push(i),this},r.prototype.onopen=function(){f("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(u(e,"data",c(this,"ondata"))),this.subs.push(u(this.decoder,"decoded",c(this,"ondecoded"))),this.subs.push(u(e,"error",c(this,"onerror"))),this.subs.push(u(e,"close",c(this,"onclose")))},r.prototype.ondata=function(e){this.decoder.add(e)},r.prototype.ondecoded=function(e){this.emit("packet",e)},r.prototype.onerror=function(e){f("error",e),this.emitAll("error",e)},r.prototype.socket=function(e){var t=this.nsps[e];if(!t){t=new i(this,e),this.nsps[e]=t;var n=this;t.on("connect",function(){~p(n.connected,t)||n.connected.push(t)})}return t},r.prototype.destroy=function(e){var t=p(this.connected,e);~t&&this.connected.splice(t,1),this.connected.length||this.close()},r.prototype.packet=function(e){f("writing packet %j",e);var t=this;t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(e){for(var n=0;n<e.length;n++)t.engine.write(e[n]);t.encoding=!1,t.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},r.prototype.cleanup=function(){for(var e;e=this.subs.shift();)e.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(e){f("close"),this.cleanup(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.attempts++,this.attempts>this._reconnectionAttempts)f("reconnect failed"),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.attempts*this.reconnectionDelay();t=Math.min(t,this.reconnectionDelayMax()),f("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(f("attempting reconnect"),e.emitAll("reconnect_attempt",e.attempts),e.emitAll("reconnecting",e.attempts),e.skipReconnect||e.open(function(t){t?(f("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(f("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var e=this.attempts;this.attempts=0,this.reconnecting=!1,this.emitAll("reconnect",e)}},{124:124,125:125,128:128,89:89,90:90,91:91,92:92,93:93,94:94,95:95}],89:[function(e,t,n){function r(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}t.exports=r},{}],90:[function(e,t,n){function r(e,t){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var o=e(128),i=e(93),s=e(132),a=e(89),u=e(92),c=e(94)("socket.io-client:socket"),f=e(122);t.exports=n=r;var p={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},l=i.prototype.emit;i(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[a(e,"open",u(this,"onopen")),a(e,"packet",u(this,"onpacket")),a(e,"close",u(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},r.prototype.send=function(){var e=s(arguments);return e.unshift("message"),this.emit.apply(this,e),this},r.prototype.emit=function(e){if(p.hasOwnProperty(e))return l.apply(this,arguments),this;var t=s(arguments),n=o.EVENT;f(t)&&(n=o.BINARY_EVENT);var r={type:n,data:t};return"function"==typeof t[t.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this},r.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},r.prototype.onopen=function(){c("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:o.CONNECT})},r.prototype.onclose=function(e){c("close (%s)",e),this.connected=!1,this.disconnected=!0,this.emit("disconnect",e)},r.prototype.onpacket=function(e){if(e.nsp==this.nsp)switch(e.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(e);break;case o.BINARY_EVENT:this.onevent(e);break;case o.ACK:this.onack(e);break;case o.BINARY_ACK:this.onack(e);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",e.data)}},r.prototype.onevent=function(e){var t=e.data||[];c("emitting event %j",t),null!=e.id&&(c("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?l.apply(this,t):this.receiveBuffer.push(t)},r.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=s(arguments);c("sending ack %j",r);var i=f(r)?o.BINARY_ACK:o.ACK;t.packet({type:i,id:e,data:r})}}},r.prototype.onack=function(e){c("calling ack %s with %j",e.id,e.data);var t=this.acks[e.id];t.apply(this,e.data),delete this.acks[e.id]},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)l.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:o.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{122:122,128:128,132:132,89:89,92:92,93:93,94:94}],91:[function(e,t,n){(function(n){function r(e,t){var r=e,t=t||n.location;return null==e&&(e=t.protocol+"//"+t.hostname),"string"==typeof e&&("/"==e.charAt(0)&&(e="/"==e.charAt(1)?t.protocol+e:t.hostname+e),/^(https?|wss?):\/\//.test(e)||(i("protocol-less url %s",e),e="undefined"!=typeof t?t.protocol+"//"+e:"https://"+e),i("parse %s",e),r=o(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/",r.id=r.protocol+"://"+r.host+":"+r.port,r.href=r.protocol+"://"+r.host+(t&&t.port==r.port?"":":"+r.port),r}var o=e(126),i=e(94)("socket.io-client:url");t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{126:126,94:94}],92:[function(e,t,n){var r=[].slice;t.exports=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return t.apply(e,n.concat(r.call(arguments)))}}},{}],93:[function(e,t,n){function r(e){return e?o(e):void 0}function o(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,o=n.length;o>r;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],94:[function(e,t,n){function r(e){return r.enabled(e)?function(t){t=o(t);var n=new Date,i=n-(r[e]||n);r[e]=n,t=e+" "+t+" +"+r.humanize(i),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function o(e){return e instanceof Error?e.stack||e.message:e}t.exports=r,r.names=[],r.skips=[],r.enable=function(e){try{localStorage.debug=e}catch(t){}for(var n=(e||"").split(/[\s,]+/),o=n.length,i=0;o>i;i++)e=n[i].replace("*",".*?"),"-"===e[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$"))},r.disable=function(){r.enable("")},r.humanize=function(e){var t=1e3,n=6e4,r=60*n;return e>=r?(e/r).toFixed(1)+"h":e>=n?(e/n).toFixed(1)+"m":e>=t?(e/t|0)+"s":e+"ms"},r.enabled=function(e){for(var t=0,n=r.skips.length;n>t;t++)if(r.skips[t].test(e))return!1;for(var t=0,n=r.names.length;n>t;t++)if(r.names[t].test(e))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch(i){}},{}],95:[function(e,t,n){t.exports=e(96)},{96:96}],96:[function(e,t,n){t.exports=e(97),t.exports.parser=e(109)},{109:109,97:97}],97:[function(e,t,n){(function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);if(t=t||{},e&&"object"==typeof e&&(t=e,e=null),e&&(e=f(e),t.host=e.host,t.secure="https"==e.protocol||"wss"==e.protocol,t.port=e.port,e.query&&(t.query=e.query)),this.secure=null!=t.secure?t.secure:n.location&&"https:"==location.protocol,t.host){var o=t.host.split(":");t.hostname=o.shift(),o.length&&(t.port=o.pop())}this.agent=t.agent||!1,this.hostname=t.hostname||(n.location?location.hostname:"localhost"),this.port=t.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=l.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.open(),this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades}function o(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var i=e(99),s=e(93),a=e(106)("engine.io-client:socket"),u=e(124),c=e(109),f=e(120),p=e(118),l=e(119);t.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=c.protocol,r.Socket=r,r.Transport=e(98),r.transports=e(99),r.parser=e(109),r.prototype.createTransport=function(e){a('creating transport "%s"',e);var t=o(this.query);t.EIO=c.protocol,t.transport=e,this.id&&(t.sid=this.id);var n=new i[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,
timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this});return n},r.prototype.open=function(){var e;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&-1!=this.transports.indexOf("websocket"))e="websocket";else{if(0==this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";var e;try{e=this.createTransport(e)}catch(n){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},r.prototype.setTransport=function(e){a("setting transport %s",e.name);var t=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},r.prototype.probe=function(e){function t(){if(l.onlyBinaryUpgrades){var t=!this.supportsBinary&&l.transport.supportsBinary;p=p||t}p||(a('probe transport "%s" opened',e),f.send([{type:"ping",data:"probe"}]),f.once("packet",function(t){if(!p)if("pong"==t.type&&"probe"==t.data){if(a('probe transport "%s" pong',e),l.upgrading=!0,l.emit("upgrading",f),!f)return;r.priorWebsocketSuccess="websocket"==f.name,a('pausing current transport "%s"',l.transport.name),l.transport.pause(function(){p||"closed"!=l.readyState&&(a("changing transport and sending upgrade packet"),c(),l.setTransport(f),f.send([{type:"upgrade"}]),l.emit("upgrade",f),f=null,l.upgrading=!1,l.flush())})}else{a('probe transport "%s" failed',e);var n=new Error("probe error");n.transport=f.name,l.emit("upgradeError",n)}}))}function n(){p||(p=!0,c(),f.close(),f=null)}function o(t){var r=new Error("probe error: "+t);r.transport=f.name,n(),a('probe transport "%s" failed because of error: %s',e,t),l.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function u(e){f&&e.name!=f.name&&(a('"%s" works - aborting "%s"',e.name,f.name),n())}function c(){f.removeListener("open",t),f.removeListener("error",o),f.removeListener("close",i),l.removeListener("close",s),l.removeListener("upgrading",u)}a('probing transport "%s"',e);var f=this.createTransport(e,{probe:1}),p=!1,l=this;r.priorWebsocketSuccess=!1,f.once("open",t),f.once("error",o),f.once("close",i),this.once("close",s),this.once("upgrading",u),f.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"==this.transport.name,this.emit("open"),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var e=0,t=this.upgrades.length;t>e;e++)this.probe(this.upgrades[e])}},r.prototype.onPacket=function(e){if("opening"==this.readyState||"open"==this.readyState)switch(a('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(p(e.data));break;case"pong":this.setPing();break;case"error":var t=new Error("server error");t.code=e.data,this.emit("error",t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!=this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!=t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},r.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},r.prototype.ping=function(){this.sendPacket("ping")},r.prototype.onDrain=function(){for(var e=0;e<this.prevBufferLen;e++)this.callbackBuffer[e]&&this.callbackBuffer[e]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0==this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(e,t){return this.sendPacket("message",e,t),this},r.prototype.sendPacket=function(e,t,n){if("closing"!=this.readyState&&"closed"!=this.readyState){var r={type:e,data:t};this.emit("packetCreate",r),this.writeBuffer.push(r),this.callbackBuffer.push(n),this.flush()}},r.prototype.close=function(){function e(){r.onClose("forced close"),a("socket closing - telling transport to close"),r.transport.close()}function t(){r.removeListener("upgrade",t),r.removeListener("upgradeError",t),e()}function n(){r.once("upgrade",t),r.once("upgradeError",t)}if("opening"==this.readyState||"open"==this.readyState){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}return this},r.prototype.onError=function(e){a("socket error %j",e),r.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},r.prototype.onClose=function(e,t){if("opening"==this.readyState||"open"==this.readyState||"closing"==this.readyState){a('socket close with reason: "%s"',e);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){n.writeBuffer=[],n.callbackBuffer=[],n.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t)}},r.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;r>n;n++)~u(this.transports,e[n])&&t.push(e[n]);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{106:106,109:109,118:118,119:119,120:120,124:124,93:93,98:98,99:99}],98:[function(e,t,n){function r(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR}var o=e(109),i=e(93);t.exports=r,i(r.prototype),r.timestamps=0,r.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},r.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},r.prototype.send=function(e){if("open"!=this.readyState)throw new Error("Transport not open");this.write(e)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(e){var t=o.decodePacket(e,this.socket.binaryType);this.onPacket(t)},r.prototype.onPacket=function(e){this.emit("packet",e)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{109:109,93:93}],99:[function(e,t,n){(function(t){function r(e){var n,r=!1,a=!1,u=!1!==e.jsonp;if(t.location){var c="https:"==location.protocol,f=location.port;f||(f=c?443:80),r=e.hostname!=location.hostname||f!=e.port,a=e.secure!=c}if(e.xdomain=r,e.xscheme=a,n=new o(e),"open"in n&&!e.forceJSONP)return new i(e);if(!u)throw new Error("JSONP disabled");return new s(e)}var o=e(104),i=e(101),s=e(100),a=e(103);n.polling=r,n.websocket=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{100:100,101:101,103:103,104:104}],100:[function(e,t,n){(function(n){function r(){}function o(e){i.call(this,e),this.query=this.query||{},a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var t=this;a.push(function(e){t.onData(e)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){t.script&&(t.script.onerror=r)},!1)}var i=e(102),s=e(105);t.exports=o;var a,u=/\n/g,c=/\\n/g;s(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),this.script=t;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},o.prototype.doWrite=function(e,t){function n(){r(),t()}function r(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(e){o.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(t)}catch(e){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),f=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=f,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),e=e.replace(c,"\\\n"),this.area.value=e.replace(u,"\\n");try{this.form.submit()}catch(p){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{102:102,105:105}],101:[function(e,t,n){(function(n){function r(){}function o(e){if(u.call(this,e),n.location){var t="https:"==location.protocol,r=location.port;r||(r=t?443:80),this.xd=e.hostname!=n.location.hostname||r!=e.port,this.xs=e.secure!=t}}function i(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!=e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.create()}function s(){for(var e in i.requests)i.requests.hasOwnProperty(e)&&i.requests[e].abort()}var a=e(104),u=e(102),c=e(93),f=e(105),p=e(106)("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=i,f(o,u),o.prototype.supportsBinary=!0,o.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,new i(e)},o.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",function(e){o.onError("xhr post error",e)}),this.sendXhr=r},o.prototype.doPoll=function(){p("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},c(i.prototype),i.prototype.create=function(){var e=this.xhr=new a({agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR}),t=this;try{if(p("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async),this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){t.onLoad()},e.onerror=function(){t.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?t.onLoad():setTimeout(function(){t.onError(e.status)},0))},p("xhr data %s",this.data),e.send(this.data)}catch(r){return void setTimeout(function(){t.onError(r)},0)}n.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},i.prototype.onError=function(e){this.emit("error",e),this.cleanup()},i.prototype.cleanup=function(){if("undefined"!=typeof this.xhr&&null!==this.xhr){this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r;try{this.xhr.abort()}catch(e){}n.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(n){}e="application/octet-stream"===t?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(n){this.onError(n)}null!=e&&this.onData(e)},i.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},n.document&&(i.requestsCount=0,i.requests={},n.attachEvent?n.attachEvent("onunload",s):n.addEventListener&&n.addEventListener("beforeunload",s,!1))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{102:102,104:104,105:105,106:106,93:93}],102:[function(e,t,n){function r(e){var t=e&&e.forceBase64;(!c||t)&&(this.supportsBinary=!1),o.call(this,e)}var o=e(98),i=e(119),s=e(109),a=e(105),u=e(106)("engine.io-client:polling");t.exports=r;var c=function(){var t=e(104),n=new t({xdomain:!1});return null!=n.responseType}();a(r,o),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(e){function t(){u("paused"),n.readyState="paused",e()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){u("pre-pause polling complete"),--r||t()})),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",function(){u("pre-pause writing complete"),--r||t()}))}else t()},r.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(e){var t=this;u("polling got data %s",e);var n=function(e,n,r){return"opening"==t.readyState&&t.onOpen(),"close"==e.type?(t.onClose(),!1):void t.onPacket(e)};s.decodePayload(e,this.socket.binaryType,n),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function e(){u("writing close packet"),t.write([{type:"close"}])}var t=this;"open"==this.readyState?(u("transport open - closing"),e()):(u("transport not open - deferring close"),this.once("open",e))},r.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")},t=this;s.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},r.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||e.sid||(e.b64=1),e=i.encode(e),this.port&&("https"==t&&443!=this.port||"http"==t&&80!=this.port)&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e}},{104:104,105:105,106:106,109:109,119:119,98:98}],103:[function(e,t,n){function r(e){var t=e&&e.forceBase64;t&&(this.supportsBinary=!1),o.call(this,e)}var o=e(98),i=e(109),s=e(119),a=e(105),u=e(106)("engine.io-client:websocket"),c=e(121);t.exports=r,a(r,o),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=void 0,n={agent:this.agent};this.ws=new c(e,t,n),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(r.prototype.onData=function(e){var t=this;setTimeout(function(){o.prototype.onData.call(t,e)},0)}),r.prototype.write=function(e){function t(){n.writable=!0,n.emit("drain")}var n=this;this.writable=!1;for(var r=0,o=e.length;o>r;r++)i.encodePacket(e[r],this.supportsBinary,function(e){try{n.ws.send(e)}catch(t){u("websocket closed before onclose event")}});setTimeout(t,0)},r.prototype.onClose=function(){o.prototype.onClose.call(this)},r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},r.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"==t&&443!=this.port||"ws"==t&&80!=this.port)&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=+new Date),this.supportsBinary||(e.b64=1),e=s.encode(e),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e},r.prototype.check=function(){return!(!c||"__initialize"in c&&this.name===r.prototype.name)}},{105:105,106:106,109:109,119:119,121:121,98:98}],104:[function(e,t,n){var r=e(116);t.exports=function(e){var t=e.xdomain,n=e.xscheme,o=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||r))return new XMLHttpRequest}catch(i){}try{if("undefined"!=typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(i){}if(!t)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(i){}}},{116:116}],105:[function(e,t,n){t.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],106:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,i=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,r),e}function i(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?localStorage.removeItem("debug"):localStorage.debug=e}catch(t){}}function a(){var e;try{e=localStorage.debug}catch(t){}return e}n=t.exports=e(107),n.log=i,n.formatArgs=o,n.save=s,n.load=a,n.useColors=r,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(a())},{107:107}],107:[function(e,t,n){function r(){return n.colors[f++%n.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,i=t-(c||t);e.diff=i,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var o=n.formatters[r];if("function"==typeof o){var i=s[a];t=o.call(e,i),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var u=o.log||n.log||console.log.bind(console);u.apply(e,s)}t.enabled=!1,o.enabled=!0;var i=n.enabled(e)?o:t;return i.namespace=e,i}function i(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,o=0;r>o;o++)t[o]&&(e=t[o].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function s(){n.enable("")}function a(e){var t,r;for(t=0,r=n.skips.length;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=o,n.coerce=u,n.disable=s,n.enable=i,n.enabled=a,n.humanize=e(108),n.names=[],n.skips=[],n.formatters={};var c,f=0},{108:108}],108:[function(e,t,n){function r(e){var t=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*p;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"h":return n*c;case"minutes":case"minute":case"m":return n*u;case"seconds":case"second":case"s":return n*a;case"ms":return n}}}function o(e){return e>=f?Math.round(e/f)+"d":e>=c?Math.round(e/c)+"h":e>=u?Math.round(e/u)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function i(e){return s(e,f,"day")||s(e,c,"hour")||s(e,u,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var a=1e3,u=60*a,c=60*u,f=24*c,p=365.25*f;t.exports=function(e,t){return t=t||{},"string"==typeof e?r(e):t["long"]?i(e):o(e)}},{}],109:[function(e,t,n){(function(t){function r(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var o=e.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=h[e.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return r(s.buffer)}function o(e,t,r){if(!t)return n.encodeBase64Packet(e,r);var o=new FileReader;return o.onload=function(){e.data=o.result,n.encodePacket(e,t,!0,r)},o.readAsArrayBuffer(e.data)}function i(e,t,r){if(!t)return n.encodeBase64Packet(e,r);if(l)return o(e,t,r);var i=new Uint8Array(1);i[0]=h[e.type];var s=new m([i.buffer,e.data]);return r(s)}function s(e,t,n){for(var r=new Array(e.length),o=f(e.length,n),i=function(e,n,o){t(n,function(t,n){r[e]=n,o(t,r)})},s=0;s<e.length;s++)i(s,e[s],o)}var a=e(110),u=e(112),c=e(113),f=e(111),p=e(115),l=navigator.userAgent.match(/Android/i);n.protocol=3;var h=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=a(h),g={type:"error",data:"parser error"},m=e(114);n.encodePacket=function(e,n,o,s){"function"==typeof n&&(s=n,n=!1),"function"==typeof o&&(s=o,o=null);var a=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&a instanceof ArrayBuffer)return r(e,n,s);if(m&&a instanceof t.Blob)return i(e,n,s);var u=h[e.type];return void 0!==e.data&&(u+=o?p.encode(String(e.data)):String(e.data)),s(""+u)},n.encodeBase64Packet=function(e,r){var o="b"+n.packets[e.type];if(m&&e.data instanceof m){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];r(o+e)},i.readAsDataURL(e.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(a){for(var u=new Uint8Array(e.data),c=new Array(u.length),f=0;f<u.length;f++)c[f]=u[f];s=String.fromCharCode.apply(null,c)}return o+=t.btoa(s),r(o)},n.decodePacket=function(e,t,r){if("string"==typeof e||void 0===e){if("b"==e.charAt(0))return n.decodeBase64Packet(e.substr(1),t);if(r)try{e=p.decode(e)}catch(o){return g}var i=e.charAt(0);return Number(i)==i&&d[i]?e.length>1?{type:d[i],data:e.substring(1)}:{type:d[i]}:g}var s=new Uint8Array(e),i=s[0],a=u(e,1);return m&&"blob"===t&&(a=new m([a])),{type:d[i],data:a}},n.decodeBase64Packet=function(e,n){var r=d[e.charAt(0)];if(!t.ArrayBuffer)return{type:r,data:{base64:!0,data:e.substr(1)}};var o=c.decode(e.substr(1));return"blob"===n&&m&&(o=new m([o])),{type:r,data:o}},n.encodePayload=function(e,t,r){function o(e){return e.length+":"+e}function i(e,r){n.encodePacket(e,t,!0,function(e){r(null,o(e))})}return"function"==typeof t&&(r=t,t=null),t?m&&!l?n.encodePayloadAsBlob(e,r):n.encodePayloadAsArrayBuffer(e,r):e.length?void s(e,i,function(e,t){return r(t.join(""))}):r("0:")},n.decodePayload=function(e,t,r){if("string"!=typeof e)return n.decodePayloadAsBinary(e,t,r);"function"==typeof t&&(r=t,t=null);var o;if(""==e)return r(g,0,1);for(var i,s,a="",u=0,c=e.length;c>u;u++){var f=e.charAt(u);if(":"!=f)a+=f;else{if(""==a||a!=(i=Number(a)))return r(g,0,1);if(s=e.substr(u+1,i),a!=s.length)return r(g,0,1);if(s.length){if(o=n.decodePacket(s,t,!0),g.type==o.type&&g.data==o.data)return r(g,0,1);var p=r(o,u+i,c);if(!1===p)return}u+=i,a=""}}return""!=a?r(g,0,1):void 0},n.encodePayloadAsArrayBuffer=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){return t(null,e)})}return e.length?void s(e,r,function(e,n){var r=n.reduce(function(e,t){var n;return n="string"==typeof t?t.length:t.byteLength,e+n.toString().length+n+2},0),o=new Uint8Array(r),i=0;return n.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);n=r.buffer}o[i++]=t?0:1;for(var a=n.byteLength.toString(),s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(var r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),t(o.buffer)}):t(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(e,t){function r(e,t){n.encodePacket(e,!0,!0,function(e){var n=new Uint8Array(1);if(n[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,n[0]=0}for(var i=e instanceof ArrayBuffer?e.byteLength:e.size,s=i.toString(),a=new Uint8Array(s.length+1),o=0;o<s.length;o++)a[o]=parseInt(s[o]);if(a[s.length]=255,m){var u=new m([n.buffer,a.buffer,e]);t(null,u)}})}s(e,r,function(e,n){return t(new m(n))})},n.decodePayloadAsBinary=function(e,t,r){"function"==typeof t&&(r=t,t=null);for(var o=e,i=[],s=!1;o.byteLength>0;){for(var a=new Uint8Array(o),c=0===a[0],f="",p=1;255!=a[p];p++){if(f.length>310){s=!0;break}f+=a[p]}if(s)return r(g,0,1);o=u(o,2+f.length),f=parseInt(f);var l=u(o,0,f);if(c)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(h){var d=new Uint8Array(l);l="";for(var p=0;p<d.length;p++)l+=String.fromCharCode(d[p])}i.push(l),o=u(o,f)}var m=i.length;i.forEach(function(e,o){r(n.decodePacket(e,t,!0),o,m)})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{110:110,111:111,112:112,113:113,114:114,115:115}],110:[function(e,t,n){t.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}},{}],111:[function(e,t,n){function r(e,t,n){function r(e,o){if(r.count<=0)throw new Error("after called too many times");--r.count,e?(i=!0,t(e),t=n):0!==r.count||i||t(null,o)}var i=!1;return n=n||o,r.count=e,0===e?t():r}function o(){}t.exports=r},{}],112:[function(e,t,n){t.exports=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(0>t&&(t+=r),0>n&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),s=t,a=0;n>s;s++,a++)i[a]=o[s];return i.buffer}},{}],113:[function(e,t,n){!function(e){"use strict";n.encode=function(t){var n,r=new Uint8Array(t),o=r.length,i="";for(n=0;o>n;n+=3)i+=e[r[n]>>2],i+=e[(3&r[n])<<4|r[n+1]>>4],i+=e[(15&r[n+1])<<2|r[n+2]>>6],i+=e[63&r[n+2]];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},n.decode=function(t){var n,r,o,i,s,a=.75*t.length,u=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var f=new ArrayBuffer(a),p=new Uint8Array(f);for(n=0;u>n;n+=4)r=e.indexOf(t[n]),o=e.indexOf(t[n+1]),i=e.indexOf(t[n+2]),s=e.indexOf(t[n+3]),p[c++]=r<<2|o>>4,p[c++]=(15&o)<<4|i>>2,p[c++]=(3&i)<<6|63&s;return f}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],114:[function(e,t,n){(function(e){function n(e,t){t=t||{};for(var n=new r,o=0;o<e.length;o++)n.append(e[o]);return t.type?n.getBlob(t.type):n.getBlob()}var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,o=function(){try{var e=new Blob(["hi"]);return 2==e.size}catch(t){return!1}}(),i=r&&r.prototype.append&&r.prototype.getBlob;t.exports=function(){return o?e.Blob:i?n:void 0}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,n){(function(e){!function(r){function o(e){for(var t,n,r=[],o=0,i=e.length;i>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&i>o?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function i(e){for(var t,n=e.length,r=-1,o="";++r<n;)t=e[r],t>65535&&(t-=65536,o+=v(t>>>10&1023|55296),t=56320|1023&t),o+=v(t);return o}function s(e,t){return v(e>>t&63|128)}function a(e){if(0==(4294967168&e))return v(e);var t="";return 0==(4294965248&e)?t=v(e>>6&31|192):0==(4294901760&e)?(t=v(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=v(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+=v(63&e|128)}function u(e){for(var t,n=o(e),r=n.length,i=-1,s="";++i<r;)t=n[i],s+=a(t);return s}function c(){if(y>=m)throw Error("Invalid byte index");var e=255&g[y];if(y++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,t,n,r,o;if(y>m)throw Error("Invalid byte index");if(y==m)return!1;if(e=255&g[y],y++,0==(128&e))return e;if(192==(224&e)){var t=c();if(o=(31&e)<<6|t,o>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if(t=c(),n=c(),o=(15&e)<<12|t<<6|n,o>=2048)return o;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=c(),n=c(),r=c(),o=(15&e)<<18|t<<12|n<<6|r,o>=65536&&1114111>=o))return o;throw Error("Invalid UTF-8 detected")}function p(e){g=o(e),m=g.length,y=0;for(var t,n=[];(t=f())!==!1;)n.push(t);return i(n)}var l="object"==typeof n&&n,h="object"==typeof t&&t&&t.exports==l&&t,d="object"==typeof e&&e;(d.global===d||d.window===d)&&(r=d);var g,m,y,v=String.fromCharCode,b={version:"2.0.0",encode:u,decode:p};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return b});else if(l&&!l.nodeType)if(h)h.exports=b;else{var w={},x=w.hasOwnProperty;for(var A in b)x.call(b,A)&&(l[A]=b[A])}else r.utf8=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],116:[function(e,t,n){var r=e(117);try{t.exports="XMLHttpRequest"in r&&"withCredentials"in new r.XMLHttpRequest}catch(o){t.exports=!1}},{117:117}],117:[function(e,t,n){t.exports=function(){return this}()},{}],118:[function(e,t,n){(function(e){var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,i=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,a=/\s+$/;t.exports=function(t){return"string"==typeof t&&t?(t=t.replace(s,"").replace(a,""),e.JSON&&JSON.parse?JSON.parse(t):n.test(t.replace(r,"@").replace(o,"]").replace(i,""))?new Function("return "+t)():void 0):null}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],119:[function(e,t,n){n.encode=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},n.decode=function(e){for(var t={},n=e.split("&"),r=0,o=n.length;o>r;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},{}],120:[function(e,t,n){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];
t.exports=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");-1!=n&&-1!=i&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var s=r.exec(e||""),a={},u=14;u--;)a[o[u]]=s[u]||"";return-1!=n&&-1!=i&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},{}],121:[function(e,t,n){function r(e,t,n){var r;return r=t?new i(e,t):new i(e)}var o=function(){return this}(),i=o.WebSocket||o.MozWebSocket;t.exports=i?r:null,i&&(r.prototype=i.prototype)},{}],122:[function(e,t,n){(function(n){function r(e){function t(e){if(!e)return!1;if(n.Buffer&&n.Buffer.isBuffer(e)||n.ArrayBuffer&&e instanceof ArrayBuffer||n.Blob&&e instanceof Blob||n.File&&e instanceof File)return!0;if(o(e)){for(var r=0;r<e.length;r++)if(t(e[r]))return!0}else if(e&&"object"==typeof e){e.toJSON&&(e=e.toJSON());for(var i in e)if(e.hasOwnProperty(i)&&t(e[i]))return!0}return!1}return t(e)}var o=e(123);t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{123:123}],123:[function(e,t,n){arguments[4][49][0].apply(n,arguments)},{49:49}],124:[function(e,t,n){var r=[].indexOf;t.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],125:[function(e,t,n){var r=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t},n.values=function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(e[n]);return t},n.merge=function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);return e},n.length=function(e){return n.keys(e).length},n.isEmpty=function(e){return 0==n.length(e)}},{}],126:[function(e,t,n){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(e){for(var t=r.exec(e||""),n={},i=14;i--;)n[o[i]]=t[i]||"";return n}},{}],127:[function(e,t,n){(function(t){var r=e(130),o=e(129);n.deconstructPacket=function(e){function t(e){if(!e)return e;if(o(e)){var i={_placeholder:!0,num:n.length};return n.push(e),i}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a]);return s}if("object"==typeof e&&!(e instanceof Date)){var s={};for(var u in e)s[u]=t(e[u]);return s}return e}var n=[],i=e.data,s=e;return s.data=t(i),s.attachments=n.length,{packet:s,buffers:n}},n.reconstructPacket=function(e,t){function n(e){if(e&&e._placeholder){var o=t[e.num];return o}if(r(e)){for(var i=0;i<e.length;i++)e[i]=n(e[i]);return e}if(e&&"object"==typeof e){for(var s in e)e[s]=n(e[s]);return e}return e}return e.data=n(e.data),e.attachments=void 0,e},n.removeBlobs=function(e,n){function i(e,u,c){if(!e)return e;if(t.Blob&&e instanceof Blob||t.File&&e instanceof File){s++;var f=new FileReader;f.onload=function(){c?c[u]=this.result:a=this.result,--s||n(a)},f.readAsArrayBuffer(e)}else if(r(e))for(var p=0;p<e.length;p++)i(e[p],p,e);else if(e&&"object"==typeof e&&!o(e))for(var l in e)i(e[l],l,e)}var s=0,a=e;i(a),s||n(a)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{129:129,130:130}],128:[function(e,t,n){function r(){}function o(e){var t="",r=!1;return t+=e.type,(n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)&&(t+=e.attachments,t+="-"),e.nsp&&"/"!=e.nsp&&(r=!0,t+=e.nsp),null!=e.id&&(r&&(t+=",",r=!1),t+=e.id),null!=e.data&&(r&&(t+=","),t+=p.stringify(e.data)),f("encoded %j as %s",e,t),t}function i(e,t){function n(e){var n=h.deconstructPacket(e),r=o(n.packet),i=n.buffers;i.unshift(r),t(i)}h.removeBlobs(e,n)}function s(){this.reconstructor=null}function a(e){var t={},r=0;if(t.type=Number(e.charAt(0)),null==n.types[t.type])return c();if(n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type){for(t.attachments="";"-"!=e.charAt(++r);)t.attachments+=e.charAt(r);t.attachments=Number(t.attachments)}if("/"==e.charAt(r+1))for(t.nsp="";++r;){var o=e.charAt(r);if(","==o)break;if(t.nsp+=o,r+1==e.length)break}else t.nsp="/";var i=e.charAt(r+1);if(""!=i&&Number(i)==i){for(t.id="";++r;){var o=e.charAt(r);if(null==o||Number(o)!=o){--r;break}if(t.id+=e.charAt(r),r+1==e.length)break}t.id=Number(t.id)}if(e.charAt(++r))try{t.data=p.parse(e.substr(r))}catch(s){return c()}return f("decoded %s as %j",e,t),t}function u(e){this.reconPack=e,this.buffers=[]}function c(e){return{type:n.ERROR,data:"parser error"}}var f=e(94)("socket.io-parser"),p=e(131),l=(e(130),e(93)),h=e(127),d=e(129);n.protocol=4,n.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],n.CONNECT=0,n.DISCONNECT=1,n.EVENT=2,n.ACK=3,n.ERROR=4,n.BINARY_EVENT=5,n.BINARY_ACK=6,n.Encoder=r,n.Decoder=s,r.prototype.encode=function(e,t){if(f("encoding packet %j",e),n.BINARY_EVENT==e.type||n.BINARY_ACK==e.type)i(e,t);else{var r=o(e);t([r])}},l(s.prototype),s.prototype.add=function(e){var t;if("string"==typeof e)t=a(e),n.BINARY_EVENT==t.type||n.BINARY_ACK==t.type?(this.reconstructor=new u(t),0==this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!d(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,this.emit("decoded",t))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length==this.reconPack.attachments){var t=h.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{127:127,129:129,130:130,131:131,93:93,94:94}],129:[function(e,t,n){(function(e){function n(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],130:[function(e,t,n){arguments[4][49][0].apply(n,arguments)},{49:49}],131:[function(e,t,n){!function(e){function t(e){if(t[e]!==i)return t[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=t("json-stringify")&&t("json-parse");else{var r,o='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var a=c.stringify,u="function"==typeof a&&f;if(u){(r=function(){return 1}).toJSON=r;try{u="0"===a(0)&&"0"===a(new Number)&&'""'==a(new String)&&a(s)===i&&a(i)===i&&a()===i&&"1"===a(r)&&"[1]"==a([r])&&"[null]"==a([i])&&"null"==a(null)&&"[null,null,null]"==a([i,s,null])&&a({a:[r,!0,!1,null,"\x00\b\n\f\r "]})==o&&"1"===a(null,r)&&"[\n 1,\n 2\n]"==a([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==a(new Date(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==a(new Date(864e13))&&'"-000001-01-01T00:00:00.000Z"'==a(new Date(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==a(new Date(-1))}catch(p){u=!1}}n=u}if("json-parse"==e){var l=c.parse;if("function"==typeof l)try{if(0===l("0")&&!l(!1)){r=l(o);var h=5==r.a.length&&1===r.a[0];if(h){try{h=!l('" "')}catch(p){}if(h)try{h=1!==l("01")}catch(p){}if(h)try{h=1!==l("1.")}catch(p){}}}}catch(p){h=!1}n=h}}return t[e]=!!n}var r,o,i,s={}.toString,a="function"==typeof define&&define.amd,u="object"==typeof JSON&&JSON,c="object"==typeof n&&n&&!n.nodeType&&n;c&&u?(c.stringify=u.stringify,c.parse=u.parse):c=e.JSON=u||{};var f=new Date(-0xc782b5b800cec);try{f=-109252==f.getUTCFullYear()&&0===f.getUTCMonth()&&1===f.getUTCDate()&&10==f.getUTCHours()&&37==f.getUTCMinutes()&&6==f.getUTCSeconds()&&708==f.getUTCMilliseconds()}catch(p){}if(!t("json")){var l="[object Function]",h="[object Date]",d="[object Number]",g="[object String]",m="[object Array]",y="[object Boolean]",v=t("bug-string-char-index");if(!f)var b=Math.floor,w=[0,31,59,90,120,151,181,212,243,273,304,334],x=function(e,t){return w[t]+365*(e-1970)+b((e-1969+(t=+(t>1)))/4)-b((e-1901+t)/100)+b((e-1601+t)/400)};(r={}.hasOwnProperty)||(r=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=s?r=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,r=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,r.call(this,e)});var A={"boolean":1,number:1,string:1,undefined:1},E=function(e,t){var n=typeof e[t];return"object"==n?!!e[t]:!A[n]};if(o=function(e,t){var n,i,a,u=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)r.call(i,a)&&u++;return n=i=null,u?o=2==u?function(e,t){var n,o={},i=s.call(e)==l;for(n in e)i&&"prototype"==n||r.call(o,n)||!(o[n]=1)||!r.call(e,n)||t(n)}:function(e,t){var n,o,i=s.call(e)==l;for(n in e)i&&"prototype"==n||!r.call(e,n)||(o="constructor"===n)||t(n);(o||r.call(e,n="constructor"))&&t(n)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],o=function(e,t){var n,o,a=s.call(e)==l,u=!a&&"function"!=typeof e.constructor&&E(e,"hasOwnProperty")?e.hasOwnProperty:r;for(n in e)a&&"prototype"==n||!u.call(e,n)||t(n);for(o=i.length;n=i[--o];u.call(e,n)&&t(n));}),o(e,t)},!t("json-stringify")){var k={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},S="000000",_=function(e,t){return(S+(t||0)).slice(-e)},O="\\u00",C=function(e){var t,n='"',r=0,o=e.length,i=o>10&&v;for(i&&(t=e.split(""));o>r;r++){var s=e.charCodeAt(r);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:n+=k[s];break;default:if(32>s){n+=O+_(2,s.toString(16));break}n+=i?t[r]:v?e.charAt(r):e[r]}}return n+'"'},R=function(e,t,n,a,u,c,f){var p,l,v,w,A,E,k,S,O,U,j,P,T,L,M,N;try{p=t[e]}catch(B){}if("object"==typeof p&&p)if(l=s.call(p),l!=h||r.call(p,"toJSON"))"function"==typeof p.toJSON&&(l!=d&&l!=g&&l!=m||r.call(p,"toJSON"))&&(p=p.toJSON(e));else if(p>-1/0&&1/0>p){if(x){for(A=b(p/864e5),v=b(A/365.2425)+1970-1;x(v+1,0)<=A;v++);for(w=b((A-x(v,0))/30.42);x(v,w+1)<=A;w++);A=1+A-x(v,w),E=(p%864e5+864e5)%864e5,k=b(E/36e5)%24,S=b(E/6e4)%60,O=b(E/1e3)%60,U=E%1e3}else v=p.getUTCFullYear(),w=p.getUTCMonth(),A=p.getUTCDate(),k=p.getUTCHours(),S=p.getUTCMinutes(),O=p.getUTCSeconds(),U=p.getUTCMilliseconds();p=(0>=v||v>=1e4?(0>v?"-":"+")+_(6,0>v?-v:v):_(4,v))+"-"+_(2,w+1)+"-"+_(2,A)+"T"+_(2,k)+":"+_(2,S)+":"+_(2,O)+"."+_(3,U)+"Z"}else p=null;if(n&&(p=n.call(t,e,p)),null===p)return"null";if(l=s.call(p),l==y)return""+p;if(l==d)return p>-1/0&&1/0>p?""+p:"null";if(l==g)return C(""+p);if("object"==typeof p){for(L=f.length;L--;)if(f[L]===p)throw TypeError();if(f.push(p),j=[],M=c,c+=u,l==m){for(T=0,L=p.length;L>T;T++)P=R(T,p,n,a,u,c,f),j.push(P===i?"null":P);N=j.length?u?"[\n"+c+j.join(",\n"+c)+"\n"+M+"]":"["+j.join(",")+"]":"[]"}else o(a||p,function(e){var t=R(e,p,n,a,u,c,f);t!==i&&j.push(C(e)+":"+(u?" ":"")+t)}),N=j.length?u?"{\n"+c+j.join(",\n"+c)+"\n"+M+"}":"{"+j.join(",")+"}":"{}";return f.pop(),N}};c.stringify=function(e,t,n){var r,o,i,a;if("function"==typeof t||"object"==typeof t&&t)if((a=s.call(t))==l)o=t;else if(a==m){i={};for(var u,c=0,f=t.length;f>c;u=t[c++],a=s.call(u),(a==g||a==d)&&(i[u]=1));}if(n)if((a=s.call(n))==d){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else a==g&&(r=n.length<=10?n:n.slice(0,10));return R("",(u={},u[""]=e,u),o,i,r,"",[])}}if(!t("json-parse")){var U,j,P=String.fromCharCode,T={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:"\n",102:"\f",114:"\r"},L=function(){throw U=j=null,SyntaxError()},M=function(){for(var e,t,n,r,o,i=j,s=i.length;s>U;)switch(o=i.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=v?i.charAt(U):i[U],U++,e;case 34:for(e="@",U++;s>U;)if(o=i.charCodeAt(U),32>o)L();else if(92==o)switch(o=i.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=T[o],U++;break;case 117:for(t=++U,n=U+4;n>U;U++)o=i.charCodeAt(U),o>=48&&57>=o||o>=97&&102>=o||o>=65&&70>=o||L();e+=P("0x"+i.slice(t,U));break;default:L()}else{if(34==o)break;for(o=i.charCodeAt(U),t=U;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;L();default:if(t=U,45==o&&(r=!0,o=i.charCodeAt(++U)),o>=48&&57>=o){for(48==o&&(o=i.charCodeAt(U+1),o>=48&&57>=o)&&L(),r=!1;s>U&&(o=i.charCodeAt(U),o>=48&&57>=o);U++);if(46==i.charCodeAt(U)){for(n=++U;s>n&&(o=i.charCodeAt(n),o>=48&&57>=o);n++);n==U&&L(),U=n}if(o=i.charCodeAt(U),101==o||69==o){for(o=i.charCodeAt(++U),(43==o||45==o)&&U++,n=U;s>n&&(o=i.charCodeAt(n),o>=48&&57>=o);n++);n==U&&L(),U=n}return+i.slice(t,U)}if(r&&L(),"true"==i.slice(U,U+4))return U+=4,!0;if("false"==i.slice(U,U+5))return U+=5,!1;if("null"==i.slice(U,U+4))return U+=4,null;L()}return"$"},N=function(e){var t,n;if("$"==e&&L(),"string"==typeof e){if("@"==(v?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=M(),"]"!=e;n||(n=!0))n&&(","==e?(e=M(),"]"==e&&L()):L()),","==e&&L(),t.push(N(e));return t}if("{"==e){for(t={};e=M(),"}"!=e;n||(n=!0))n&&(","==e?(e=M(),"}"==e&&L()):L()),(","==e||"string"!=typeof e||"@"!=(v?e.charAt(0):e[0])||":"!=M())&&L(),t[e.slice(1)]=N(M());return t}L()}return e},B=function(e,t,n){var r=I(e,t,n);r===i?delete e[t]:e[t]=r},I=function(e,t,n){var r,i=e[t];if("object"==typeof i&&i)if(s.call(i)==m)for(r=i.length;r--;)B(i,r,n);else o(i,function(e){B(i,e,n)});return n.call(e,t,i)};c.parse=function(e,t){var n,r;return U=0,j=""+e,n=N(M()),"$"!=M()&&L(),U=j=null,t&&s.call(t)==l?I((r={},r[""]=n,r),"",t):n}}}a&&define(function(){return c})}(this)},{}],132:[function(e,t,n){function r(e,t){var n=[];t=t||0;for(var r=t||0;r<e.length;r++)n[r-t]=e[r];return n}t.exports=r},{}],133:[function(e,t,n){!function(e,r){"use strict";var o="0.7.3",i="",s="?",a="function",u="undefined",c="object",f="major",p="model",l="name",h="type",d="vendor",g="version",m="architecture",y="console",v="mobile",b="tablet",w="smarttv",x="wearable",A="embedded",E={extend:function(e,t){for(var n in t)-1!=="browser cpu device engine os".indexOf(n)&&t[n].length%2===0&&(e[n]=t[n].concat(e[n]));return e},has:function(e,t){return"string"==typeof e?-1!==t.toLowerCase().indexOf(e.toLowerCase()):void 0},lowerize:function(e){return e.toLowerCase()}},k={rgx:function(){for(var e,t,n,o,i,s,f,p=0,l=arguments;p<l.length&&!s;){var h=l[p],d=l[p+1];if(typeof e===u){e={};for(o in d)i=d[o],typeof i===c?e[i[0]]=r:e[i]=r}for(t=n=0;t<h.length&&!s;)if(s=h[t++].exec(this.getUA()))for(o=0;o<d.length;o++)f=s[++n],i=d[o],typeof i===c&&i.length>0?2==i.length?e[i[0]]=typeof i[1]==a?i[1].call(this,f):i[1]:3==i.length?e[i[0]]=typeof i[1]!==a||i[1].exec&&i[1].test?f?f.replace(i[1],i[2]):r:f?i[1].call(this,f,i[2]):r:4==i.length&&(e[i[0]]=f?i[3].call(this,f.replace(i[1],i[2])):r):e[i]=f?f:r;p+=2}return e},str:function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(E.has(t[n][o],e))return n===s?r:n}else if(E.has(t[n],e))return n===s?r:n;return e}},S={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:"NT 6.4",RT:"ARM"}}}},_={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i],[l,g,f],[/\s(opr)\/((\d+)?[\w\.]+)/i],[[l,"Opera"],g,f],[/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i],[l,g,f],[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],[[l,"IE"],g,f],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[l,"Yandex"],g,f],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[l,/_/g," "],g,f],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i],[l,g,f],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[l,"Dolphin"],g,f],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[l,"Chrome"],g,f],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[g,f,[l,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[g,f,l],[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[l,[f,k.str,S.browser.oldsafari.major],[g,k.str,S.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(webkit|khtml)\/((\d+)?[\w\.]+)/i],[l,g,f],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[l,"Netscape"],g,f],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[l,g,f]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,E.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[m,/ower/,"",E.lowerize]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[m,E.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[p,d,[h,b]],[/applecoremedia\/[\w\.]+ \((ipad)/],[p,[d,"Apple"],[h,b]],[/(apple\s{0,1}tv)/i],[[p,"Apple TV"],[d,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[d,p,[h,b]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[p,[d,"Amazon"],[h,b]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[p,k.str,S.device.amazon.model],[d,"Amazon"],[h,v]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[p,d,[h,v]],[/\((ip[honed|\s\w*]+);/i],[p,[d,"Apple"],[h,v]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[d,p,[h,v]],[/\(bb10;\s(\w+)/i],[p,[d,"BlackBerry"],[h,v]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],[p,[d,"Asus"],[h,b]],[/(sony)\s(tablet\s[ps])/i],[d,p,[h,b]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[d,p,[h,y]],[/android.+;\s(shield)\sbuild/i],[p,[d,"Nvidia"],[h,y]],[/(playstation\s[3portablevi]+)/i],[p,[d,"Sony"],[h,y]],[/(sprint\s(\w+))/i],[[d,k.str,S.device.sprint.vendor],[p,k.str,S.device.sprint.model],[h,v]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[d,p,[h,b]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[d,[p,/_/g," "],[h,v]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[p,[d,"Microsoft"],[h,y]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[d,"Microsoft"],[h,v]],[/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,/(mot)[\s-]?(\w+)*/i],[[d,"Motorola"],p,[h,v]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[p,[d,"Motorola"],[h,b]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[d,"Samsung"],p,[h,b]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[d,"Samsung"],p,[h,v]],[/(samsung);smarttv/i],[d,p,[h,w]],[/\(dtv[\);].+(aquos)/i],[p,[d,"Sharp"],[h,w]],[/sie-(\w+)*/i],[p,[d,"Siemens"],[h,v]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[d,"Nokia"],p,[h,v]],[/android\s3\.[\s\w-;]{10}(a\d{3})/i],[p,[d,"Acer"],[h,b]],[/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],[[d,"LG"],p,[h,b]],[/(lg) netcast\.tv/i],[d,p,[h,w]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[p,[d,"LG"],[h,v]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[p,[d,"Lenovo"],[h,b]],[/linux;.+((jolla));/i],[d,p,[h,v]],[/((pebble))app\/[\d\.]+\s/i],[d,p,[h,x]],[/android.+;\s(glass)\s\d/i],[p,[d,"Google"],[h,x]],[/(mobile|tablet);.+rv\:.+gecko\//i],[[h,E.lowerize],d,p]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,g],[/rv\:([\w\.]+).*(gecko)/i],[g,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,g],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[g,k.str,S.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[g,k.str,S.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],g],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[l,g],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[l,"Symbian"],g],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],g],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[l,g],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],g],[/(sunos)\s?([\w\.]+\d)*/i],[[l,"Solaris"],g],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[l,g],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[l,"iOS"],[g,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[g,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[l,g]]},O=function(t,n){if(!(this instanceof O))return new O(t,n).getResult();var r=t||(e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:i),o=n?E.extend(_,n):_;this.getBrowser=function(){return k.rgx.apply(this,o.browser)},this.getCPU=function(){return k.rgx.apply(this,o.cpu)},this.getDevice=function(){return k.rgx.apply(this,o.device)},this.getEngine=function(){return k.rgx.apply(this,o.engine)},this.getOS=function(){return k.rgx.apply(this,o.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this.setUA(r)};if(O.VERSION=o,O.BROWSER={NAME:l,MAJOR:f,VERSION:g},O.CPU={ARCHITECTURE:m},O.DEVICE={MODEL:p,VENDOR:d,TYPE:h,CONSOLE:y,MOBILE:v,SMARTTV:w,TABLET:b,WEARABLE:x,EMBEDDED:A},O.ENGINE={NAME:l,VERSION:g},O.OS={NAME:l,VERSION:g},typeof n!==u)typeof t!==u&&t.exports&&(n=t.exports=O),n.UAParser=O;else{e.UAParser=O,typeof define===a&&define.amd&&define(function(){return O});var C=e.jQuery||e.Zepto;if(typeof C!==u){var R=new O;C.ua=R.getResult(),C.ua.get=function(){return R.getUA()},C.ua.set=function(e){R.setUA(e);var t=R.getResult();for(var n in t)C.ua[n]=t[n]}}}}(this)},{}],134:[function(e,t,n){!function(e){"use strict";e(function(e){var t=e(148),n=e(136),r=e(138);return t({scheduler:new n(r)})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{136:136,138:138,148:148}],135:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){this.head=this.tail=this.length=0,this.buffer=new Array(1<<e)}return e.prototype.push=function(e){return this.length===this.buffer.length&&this._ensureCapacity(2*this.length),this.buffer[this.tail]=e,this.tail=this.tail+1&this.buffer.length-1,++this.length,this.length},e.prototype.shift=function(){var e=this.buffer[this.head];return this.buffer[this.head]=void 0,this.head=this.head+1&this.buffer.length-1,--this.length,e},e.prototype._ensureCapacity=function(e){var t,n=this.head,r=this.buffer,o=new Array(e),i=0;if(0===n)for(t=this.length;t>i;++i)o[i]=r[i];else{for(e=r.length,t=this.tail;e>n;++i,++n)o[i]=r[n];for(n=0;t>n;++i,++n)o[i]=r[n]}this.buffer=o,this.head=0,this.tail=this.length},e})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],136:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){this._async=e,this._queue=new r(15),this._afterQueue=new r(5),this._running=!1;var t=this;this.drain=function(){t._drain()}}function n(e){for(;e.length>0;)e.shift().run()}var r=e(135);return t.prototype.enqueue=function(e){this._add(this._queue,e)},t.prototype.afterQueue=function(e){this._add(this._afterQueue,e)},t.prototype._drain=function(){n(this._queue),this._running=!1,n(this._afterQueue)},t.prototype._add=function(e,t){e.push(t),this._running||(this._running=!0,this._async(this.drain))},t})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{135:135}],137:[function(e,t,n){!function(e){"use strict";e(function(){function e(t){Error.call(this),this.message=t,this.name=e.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],138:[function(e,t,n){(function(n){!function(e){"use strict";e(function(e){var t,r;return t="undefined"!=typeof n&&null!==n&&"function"==typeof n.nextTick?function(e){n.nextTick(e)}:(r="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver)?function(e,t){function n(){var e=r;r=void 0,e()}var r,o=e.createElement("div"),i=new t(n);return i.observe(o,{attributes:!0}),function(e){r=e,o.setAttribute("class","x")}}(document,r):function(e){try{return e("vertx").runOnLoop||e("vertx").runOnContext}catch(t){}var n=setTimeout;return function(e){n(e,0)}}(e)})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})}).call(this,e(51))},{51:51}],139:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(t){return new e(function(e,n){function o(e){i.push(e),0===--s&&n(i)}var i=[],s=r(t,e,o);0===s&&n(new RangeError("any() input must not be empty"))})}function n(t,n){return new e(function(e,o,i){function s(t){p>0&&(--p,c.push(t),0===p&&e(c))}function a(e){u>0&&(--u,f.push(e),0===u&&o(f))}var u,c=[],f=[],p=r(t,s,a,i);n=Math.max(n,0),u=p-n+1,p=Math.min(n,p),n>p?o(new RangeError("some() input must contain at least "+n+" element(s), but had "+p)):0===p&&e(c)})}function r(e,t,n,r){return p.call(e,function(e,o){return h(o).then(t,n,r),e+1},0)}function o(e,t){function n(e,n){return t(n,e)}return"object"!=typeof e?h([]):d(f(function(e,t){return h(e).fold(n,t)},e))}function i(e,t){return d(e).then(function(e){return d(f(t,e)).then(function(t){for(var n,r=t.length,o=new Array(r),i=0,s=0;r>i;++i)n=t[i],(void 0!==n||i in t)&&t[i]&&(o[s++]=e[i]);return o.length=s,o})})}function s(e){return d(f(function(e){function t(){return e.inspect()}return e=h(e),e.then(t,t)},e))}function a(e,t){var n=c(t);return arguments.length>2?p.call(e,n,arguments[2]):p.call(e,n)}function u(e,t){var n=c(t);return arguments.length>2?l.call(e,n,arguments[2]):l.call(e,n)}function c(e){return function(t,n,r){return h(t).then(function(t){return h(n).then(function(n){return e(t,n,r)})})}}function f(e,t){for(var n,r=t.length,o=new Array(r),i=0;r>i;++i)n=t[i],(void 0!==n||i in t)&&(o[i]=e(t[i],i));return o}var p=Array.prototype.reduce,l=Array.prototype.reduceRight,h=e.resolve,d=e.all;return e.any=t,e.some=n,e.settle=s,e.map=o,e.filter=i,e.reduce=a,e.reduceRight=u,e.prototype.spread=function(e){return this.then(d).then(function(t){return e.apply(void 0,t)})},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],140:[function(e,t,n){!function(e){"use strict";e(function(){function e(){throw new TypeError("catch predicate must be a function")}function t(e,t){return n(t)?e instanceof t:t(e)}function n(e){return e===Error||null!=e&&e.prototype instanceof Error}function r(e){return function(){return e.call(this)}}return function(n){function o(e,n){return function(r){return t(r,n)?e.call(this,r):i(r)}}var i=n.reject,s=n.prototype["catch"];return n.prototype.done=function(e,t){this._handler.visit(this._handler.receiver,e,t)},n.prototype["catch"]=n.prototype.otherwise=function(t){return arguments.length<2?s.call(this,t):"function"!=typeof t?this.ensure(e):s.call(this,o(arguments[1],t))},n.prototype["finally"]=n.prototype.ensure=function(e){if("function"!=typeof e)return this;var t=r(e);return this.then(t,t)["yield"](this)},n.prototype["else"]=n.prototype.orElse=function(e){return this.then(void 0,function(){return e})},n.prototype["yield"]=function(e){return this.then(function(){return e})},n.prototype.tap=function(e){return this.then(e)["yield"](this)},n}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],141:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype.fold=function(t,n){var r=this._beget();return this._handler.fold(function(n,r,o){e._handler(n).fold(function(e,n,r){r.resolve(t.call(this,n,e))},r,this,o)},n,r._handler.receiver,r._handler),r},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],142:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e){var t=e.state();return 0===t?{state:"pending"}:t>0?{state:"fulfilled",value:e.value}:{state:"rejected",reason:e.value}}return e.prototype.inspect=function(){return t(e._handler(this))},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],143:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t,r,o){return n(function(t){return[t,e(t)]},t,r,o)}function n(e,t,o,i){function s(i,s){return r(o(i)).then(function(){return n(e,t,o,s)})}return r(i).then(function(n){return r(t(n)).then(function(t){return t?n:r(e(n)).spread(s)})})}var r=e.resolve;return e.iterate=t,e.unfold=n,e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],144:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype.progress=function(e){return this.then(void 0,void 0,e)},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],145:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e,t,r,o){return n.set(function(){e(r,o,t)},t)}var n=e(149),r=e(137);return function(e){function o(e,n,r){t(i,e,n,r)}function i(e,t){t.resolve(e)}function s(e,t,n){var o="undefined"==typeof e?new r("timed out after "+n+"ms"):e;t.reject(o)}return e.prototype.delay=function(e){var t=this._beget();return this._handler.fold(o,e,void 0,t._handler),t},e.prototype.timeout=function(e,r){var o=this._beget(),i=o._handler,a=t(s,e,r,o._handler);return this._handler.visit(i,function(e){n.clear(a),this.resolve(e)},function(e){n.clear(a),this.reject(e)},i.notify),o},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{137:137,149:149}],146:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){var t="object"==typeof e&&e.stack?e.stack:n(e);return e instanceof Error?t:t+" (WARNING: non-Error used)"}function n(e){var t=String(e);return"[object Object]"===t&&"undefined"!=typeof JSON&&(t=r(e,t)),t}function r(e,t){try{return JSON.stringify(e)}catch(e){return t}}function o(e){throw e}function i(){}var s=e(149);return function(e){function r(e){e.handled||(h.push(e),f("Potentially unhandled rejection ["+e.id+"] "+t(e.value)));
}function a(e){var t=h.indexOf(e);t>=0&&(h.splice(t,1),p("Handled previous rejection ["+e.id+"] "+n(e.value)))}function u(e,t){l.push(e,t),d||(d=!0,d=s.set(c,0))}function c(){for(d=!1;l.length>0;)l.shift()(l.shift())}var f=i,p=i;"undefined"!=typeof console&&(f="undefined"!=typeof console.error?function(e){console.error(e)}:function(e){console.log(e)},p="undefined"!=typeof console.info?function(e){console.info(e)}:function(e){console.log(e)}),e.onPotentiallyUnhandledRejection=function(e){u(r,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){u(a,e)},e.onFatalRejection=function(e){u(o,e.value)};var l=[],h=[],d=!1;return e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{149:149}],147:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype["with"]=e.prototype.withThis=function(e){var t=this._beget(),n=t._handler;return n.receiver=e,this._handler.chain(n,e),t},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],148:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t){this._handler=e===p?t:n(e)}function n(e){function t(e){o.resolve(e)}function n(e){o.reject(e)}function r(e){o.notify(e)}var o=new h;try{e(t,n,r)}catch(i){n(i)}return o}function r(e){return S(e)?e:new t(p,new d(c(e)))}function o(e){return new t(p,new d(new y(e)))}function i(){return q}function s(){return new t(p,new h)}function a(e){function n(e,t,n){this[e]=t,0===--u&&n.become(new m(this))}var r,o,i,s,a=new h,u=e.length>>>0,c=new Array(u);for(r=0;r<e.length;++r)if(i=e[r],void 0!==i||r in e)if(_(i))if(o=S(i)?i._handler.join():f(i),s=o.state(),0===s)o.fold(n,r,c,a);else{if(!(s>0)){a.become(o);break}c[r]=o.value,--u}else c[r]=i,--u;else--u;return 0===u&&a.become(new m(c)),new t(p,a)}function u(e){if(Object(e)===e&&0===e.length)return i();var n,r,o=new h;for(n=0;n<e.length;++n)r=e[n],void 0!==r&&n in e&&c(r).visit(o,o.resolve,o.reject);return new t(p,o)}function c(e){return S(e)?e._handler.join():_(e)?f(e):new m(e)}function f(e){try{var t=e.then;return"function"==typeof t?new g(t,e):new m(e)}catch(n){return new y(n)}}function p(){}function l(){}function h(e,n){t.createContext(this,n),this.consumers=void 0,this.receiver=e,this.handler=void 0,this.resolved=!1}function d(e){this.handler=e}function g(e,t){h.call(this),M.enqueue(new E(e,t,this))}function m(e){t.createContext(this),this.value=e}function y(e){t.createContext(this),this.id=++I,this.value=e,this.handled=!1,this.reported=!1,this._report()}function v(e,t){this.rejection=e,this.context=t}function b(e){this.rejection=e}function w(){return new y(new TypeError("Promise cycle"))}function x(e,t){this.continuation=e,this.handler=t}function A(e,t){this.handler=t,this.value=e}function E(e,t,n){this._then=e,this.thenable=t,this.resolver=n}function k(e,t,n,r,o){try{e.call(t,n,r,o)}catch(i){r(i)}}function S(e){return e instanceof t}function _(e){return("object"==typeof e||"function"==typeof e)&&null!==e}function O(e,n,r,o){return"function"!=typeof e?o.become(n):(t.enterContext(n),U(e,n.value,r,o),void t.exitContext())}function C(e,n,r,o,i){return"function"!=typeof e?i.become(r):(t.enterContext(r),j(e,n,r.value,o,i),void t.exitContext())}function R(e,n,r,o,i){return"function"!=typeof e?i.notify(n):(t.enterContext(r),P(e,n,o,i),void t.exitContext())}function U(e,t,n,r){try{r.become(c(e.call(n,t)))}catch(o){r.become(new y(o))}}function j(e,t,n,r,o){try{e.call(r,t,n,o)}catch(i){o.become(new y(i))}}function P(e,t,n,r){try{r.notify(e.call(n,t))}catch(o){r.notify(o)}}function T(e,t){t.prototype=N(e.prototype),t.prototype.constructor=t}function L(){}var M=e.scheduler,N=Object.create||function(e){function t(){}return t.prototype=e,new t};t.resolve=r,t.reject=o,t.never=i,t._defer=s,t._handler=c,t.prototype.then=function(e,n){var r=this._handler;if("function"!=typeof e&&r.join().state()>0)return new t(p,r);var o=this._beget(),i=o._handler;return r.chain(i,r.receiver,e,n,arguments.length>2?arguments[2]:void 0),o},t.prototype["catch"]=function(e){return this.then(void 0,e)},t.prototype._beget=function(){var e=this._handler,t=new h(e.receiver,e.join().context);return new this.constructor(p,t)},t.all=a,t.race=u,p.prototype.when=p.prototype.become=p.prototype.notify=p.prototype.fail=p.prototype._unreport=p.prototype._report=L,p.prototype._state=0,p.prototype.state=function(){return this._state},p.prototype.join=function(){for(var e=this;void 0!==e.handler;)e=e.handler;return e},p.prototype.chain=function(e,t,n,r,o){this.when({resolver:e,receiver:t,fulfilled:n,rejected:r,progress:o})},p.prototype.visit=function(e,t,n,r){this.chain(B,e,t,n,r)},p.prototype.fold=function(e,t,n,r){this.visit(r,function(r){e.call(n,t,r,this)},r.reject,r.notify)},T(p,l),l.prototype.become=function(e){e.fail()};var B=new l;T(p,h),h.prototype._state=0,h.prototype.resolve=function(e){this.become(c(e))},h.prototype.reject=function(e){this.resolved||this.become(new y(e))},h.prototype.join=function(){if(!this.resolved)return this;for(var e=this;void 0!==e.handler;)if(e=e.handler,e===this)return this.handler=w();return e},h.prototype.run=function(){var e=this.consumers,t=this.join();this.consumers=void 0;for(var n=0;n<e.length;++n)t.when(e[n])},h.prototype.become=function(e){this.resolved||(this.resolved=!0,this.handler=e,void 0!==this.consumers&&M.enqueue(this),void 0!==this.context&&e._report(this.context))},h.prototype.when=function(e){this.resolved?M.enqueue(new x(e,this.handler)):void 0===this.consumers?this.consumers=[e]:this.consumers.push(e)},h.prototype.notify=function(e){this.resolved||M.enqueue(new A(e,this))},h.prototype.fail=function(e){var t="undefined"==typeof e?this.context:e;this.resolved&&this.handler.join().fail(t)},h.prototype._report=function(e){this.resolved&&this.handler.join()._report(e)},h.prototype._unreport=function(){this.resolved&&this.handler.join()._unreport()},T(p,d),d.prototype.when=function(e){M.enqueue(new x(e,this))},d.prototype._report=function(e){this.join()._report(e)},d.prototype._unreport=function(){this.join()._unreport()},T(h,g),T(p,m),m.prototype._state=1,m.prototype.fold=function(e,t,n,r){C(e,t,this,n,r)},m.prototype.when=function(e){O(e.fulfilled,this,e.receiver,e.resolver)};var I=0;T(p,y),y.prototype._state=-1,y.prototype.fold=function(e,t,n,r){r.become(this)},y.prototype.when=function(e){"function"==typeof e.rejected&&this._unreport(),O(e.rejected,this,e.receiver,e.resolver)},y.prototype._report=function(e){M.afterQueue(new v(this,e))},y.prototype._unreport=function(){this.handled=!0,M.afterQueue(new b(this))},y.prototype.fail=function(e){t.onFatalRejection(this,void 0===e?this.context:e)},v.prototype.run=function(){this.rejection.handled||(this.rejection.reported=!0,t.onPotentiallyUnhandledRejection(this.rejection,this.context))},b.prototype.run=function(){this.rejection.reported&&t.onPotentiallyUnhandledRejectionHandled(this.rejection)},t.createContext=t.enterContext=t.exitContext=t.onPotentiallyUnhandledRejection=t.onPotentiallyUnhandledRejectionHandled=t.onFatalRejection=L;var D=new p,q=new t(p,D);return x.prototype.run=function(){this.handler.join().when(this.continuation)},A.prototype.run=function(){var e=this.handler.consumers;if(void 0!==e)for(var t,n=0;n<e.length;++n)t=e[n],R(t.progress,this.value,this.handler,t.receiver,t.resolver)},E.prototype.run=function(){function e(e){r.resolve(e)}function t(e){r.reject(e)}function n(e){r.notify(e)}var r=this.resolver;k(this._then,this.thenable,e,t,n)},t}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],149:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n,r,o;t=e;try{n=t("vertx"),r=function(e,t){return n.setTimer(t,e)},o=n.cancelTimer}catch(i){r=function(e,t){return setTimeout(e,t)},o=function(e){return clearTimeout(e)}}return{set:r,clear:o}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],150:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e,t,n){var r=_.resolve(e);return arguments.length<2?r:arguments.length>3?r.then(t,n,arguments[3]):r.then(t,n)}function n(e){return new _(e)}function r(e){return function(){return i(e,this,O.call(arguments))}}function o(e){return i(e,this,O.call(arguments,1))}function i(e,t,n){return _.all(n).then(function(n){return e.apply(t,n)})}function s(){return new a}function a(){function e(e){r._handler.resolve(e)}function t(e){r._handler.reject(e)}function n(e){r._handler.notify(e)}var r=_._defer();this.promise=r,this.resolve=e,this.reject=t,this.notify=n,this.resolver={resolve:e,reject:t,notify:n}}function u(e){return e&&"function"==typeof e.then}function c(){return _.all(arguments)}function f(e){return t(e,_.all)}function p(e){return t(e,_.settle)}function l(e,n){return t(e,function(e){return _.map(e,n)})}function h(e,n){return t(e,function(e){return _.filter(e,n)})}function d(e,n){var r=O.call(arguments,1);return t(e,function(e){return r.unshift(e),_.reduce.apply(_,r)})}function g(e,n){var r=O.call(arguments,1);return t(e,function(e){return r.unshift(e),_.reduceRight.apply(_,r)})}var m=e(145),y=e(139),v=e(140),b=e(141),w=e(142),x=e(143),A=e(144),E=e(147),k=e(146),S=e(137),_=[y,v,b,x,A,w,E,m,k].reduce(function(e,t){return t(e)},e(134)),O=Array.prototype.slice;return t.promise=n,t.resolve=_.resolve,t.reject=_.reject,t.lift=r,t["try"]=o,t.attempt=o,t.iterate=_.iterate,t.unfold=_.unfold,t.join=c,t.all=f,t.settle=p,t.any=r(_.any),t.some=r(_.some),t.race=r(_.race),t.map=l,t.filter=h,t.reduce=d,t.reduceRight=g,t.isPromiseLike=u,t.Promise=_,t.defer=s,t.TimeoutError=S,t})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{134:134,137:137,139:139,140:140,141:141,142:142,143:143,144:144,145:145,146:146,147:147}]},{},[8]);