swim-proto-js
Advanced tools
Comparing version 0.0.0 to 0.0.2
{ | ||
"name": "swim-proto-js", | ||
"version": "0.0.0", | ||
"version": "0.0.2", | ||
"description": "Structural Web Integrated Messaging (SWIM) JavaScript Protocol Implementation", | ||
@@ -29,3 +29,3 @@ "homepage": "https://github.com/coeffect/swim-proto-js", | ||
"dependencies": { | ||
"recon-js": "^0.0.4" | ||
"recon-js": "^0.0.5" | ||
}, | ||
@@ -37,6 +37,6 @@ "devDependencies": { | ||
"gulp-coveralls": "^0.1.3", | ||
"gulp-istanbul": "^0.6.0", | ||
"gulp-jshint": "^1.9.2", | ||
"gulp-mocha": "^2.0.0", | ||
"gulp-sourcemaps": "^1.5.0", | ||
"gulp-istanbul": "^0.7.0", | ||
"gulp-jshint": "^1.9.4", | ||
"gulp-mocha": "^2.0.1", | ||
"gulp-sourcemaps": "^1.5.1", | ||
"gulp-uglify": "^1.1.0", | ||
@@ -43,0 +43,0 @@ "jshint-stylish": "^1.0.1", |
@@ -69,5 +69,6 @@ # Structural Web Integrated Messaging (SWIM) Protocol | ||
Receive an event message that propagated through a linked model node on a | ||
monitored lane. `node_uri` and `lane_uri` refer to origin node and lane to | ||
which the event was published. `link_uris` enumerates all model links the | ||
Send an event message to a model node on some lane, or receive an event | ||
message that propagated through a linked model node on a subscribed lane. | ||
`node_uri` and `lane_uri` always refer to origin node and lane to which | ||
the event was published. `link_uris` enumerates all model links the | ||
event passed through prior to reaching the receiver. | ||
@@ -95,5 +96,6 @@ | ||
Receive a command message that propagated through a linked model node on a | ||
monitored lane. `node_uri` and `lane_uri` refer to origin node and lane to | ||
which the command was published. `link_uris` enumerates all model links the | ||
Send a command message to a model node on some lane, or receive a command | ||
message that propagated through a linked model node on a subscribed lane. | ||
`node_uri` and `lane_uri` always refer to origin node and lane to which | ||
the command was published. `link_uris` enumerates all model links the | ||
command passed through prior to reaching the receiver. | ||
@@ -115,22 +117,2 @@ | ||
### @send | ||
Publish a message to a model node on some lane. | ||
``` | ||
>> @send @event([node:] <node_uri>, [lane:] <lane_uri>) <body> | ||
>> @send @command([node:] <node_uri>, [lane:] <lane_uri>) <body> | ||
``` | ||
#### Examples | ||
``` | ||
>> @send @event(node: "house#kitchen", lane: "toaster/done") { | ||
items: 2 | ||
} | ||
>> @send @command(node: "house#kitchen", lane: "light/on") | ||
``` | ||
### @get | ||
@@ -137,0 +119,0 @@ |
@@ -225,156 +225,2 @@ 'use strict'; | ||
describe('@send @event message', function () { | ||
it('should have required properties', function () { | ||
var envelope = new proto.SendEventMessage('node_uri', 'lane_uri'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should encode recon with an empty body', function () { | ||
var envelope = new proto.SendEventMessage('node_uri', 'lane_uri'); | ||
assert.same(envelope.encode(), recon.parse('@send @event(node: node_uri, lane: lane_uri)')); | ||
}); | ||
it('should encode recon with a non-empty body', function () { | ||
var envelope = new proto.SendEventMessage('node_uri', 'lane_uri', recon.parse('a:1,foo')); | ||
assert.same(envelope.encode(), recon.parse('@send @event(node: node_uri, lane: lane_uri) {a:1,foo}')); | ||
}); | ||
it('should decode recon with named headers and an empty body', function () { | ||
var envelope = proto.parse('@send @event(node: node_uri, lane: lane_uri)'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with named headers and a non-empty body', function () { | ||
var envelope = proto.parse('@send @event(node: node_uri, lane: lane_uri) {a:1,foo}'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.parse('a:1,foo')); | ||
}); | ||
it('should decode recon with positional headers and an empty body', function () { | ||
var envelope = proto.parse('@send @event(node_uri, lane_uri)'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with positional headers and a non-empty body', function () { | ||
var envelope = proto.parse('@send @event(node_uri, lane_uri) {a:1,foo}'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.parse('a:1,foo')); | ||
}); | ||
it('should decode recon with named and unknown headers', function () { | ||
var envelope = proto.parse('@send @event(node: node_uri, lane: lane_uri, foo: bar)'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with positional and unknown headers', function () { | ||
var envelope = proto.parse('@send @event(node_uri, lane_uri, bar)'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with missing headers', function () { | ||
var envelope = proto.parse('@send @event()'); | ||
assert(envelope.isSendEventMessage); | ||
assert.same(envelope.node, ''); | ||
assert.same(envelope.lane, ''); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
}); | ||
describe('@send @command message', function () { | ||
it('should have required properties', function () { | ||
var envelope = new proto.SendCommandMessage('node_uri', 'lane_uri'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should encode recon with an empty body', function () { | ||
var envelope = new proto.SendCommandMessage('node_uri', 'lane_uri'); | ||
assert.same(envelope.encode(), recon.parse('@send @command(node: node_uri, lane: lane_uri)')); | ||
}); | ||
it('should encode recon with a non-empty body', function () { | ||
var envelope = new proto.SendCommandMessage('node_uri', 'lane_uri', recon.parse('a:1,foo')); | ||
assert.same(envelope.encode(), recon.parse('@send @command(node: node_uri, lane: lane_uri) {a:1,foo}')); | ||
}); | ||
it('should decode recon with named headers and an empty body', function () { | ||
var envelope = proto.parse('@send @command(node: node_uri, lane: lane_uri)'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with named headers and a non-empty body', function () { | ||
var envelope = proto.parse('@send @command(node: node_uri, lane: lane_uri) {a:1,foo}'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.parse('a:1,foo')); | ||
}); | ||
it('should decode recon with positional headers and an empty body', function () { | ||
var envelope = proto.parse('@send @command(node_uri, lane_uri)'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with positional headers and a non-empty body', function () { | ||
var envelope = proto.parse('@send @command(node_uri, lane_uri) {a:1,foo}'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.parse('a:1,foo')); | ||
}); | ||
it('should decode recon with named and unknown headers', function () { | ||
var envelope = proto.parse('@send @command(node: node_uri, lane: lane_uri, foo: bar)'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with positional and unknown headers', function () { | ||
var envelope = proto.parse('@send @command(node_uri, lane_uri, bar)'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, 'node_uri'); | ||
assert.same(envelope.lane, 'lane_uri'); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
it('should decode recon with missing headers', function () { | ||
var envelope = proto.parse('@send @command()'); | ||
assert(envelope.isSendCommandMessage); | ||
assert.same(envelope.node, ''); | ||
assert.same(envelope.lane, ''); | ||
assert.same(envelope.body, recon.empty()); | ||
}); | ||
}); | ||
describe('@get request', function () { | ||
@@ -381,0 +227,0 @@ it('should have required properties', function () { |
@@ -6,3 +6,3 @@ 'use strict'; | ||
function decode(record) { | ||
if (record instanceof recon.Record) { | ||
if (record.isRecord) { | ||
var heading = record.head(); | ||
@@ -12,3 +12,2 @@ if (heading.isField) switch (heading.key) { | ||
case 'command': return CommandMessage.decode(record); | ||
case 'send': return SendMessage.decode(record); | ||
case 'get': return GetRequest.decode(record); | ||
@@ -44,5 +43,2 @@ case 'put': return PutRequest.decode(record); | ||
Object.defineProperty(Envelope.prototype, 'isCommandMessage', {value: false}); | ||
Object.defineProperty(Envelope.prototype, 'isSendMessage', {value: false}); | ||
Object.defineProperty(Envelope.prototype, 'isSendEventMessage', {value: false}); | ||
Object.defineProperty(Envelope.prototype, 'isSendCommandMessage', {value: false}); | ||
Object.defineProperty(Envelope.prototype, 'isGetRequest', {value: false}); | ||
@@ -107,3 +103,3 @@ Object.defineProperty(Envelope.prototype, 'isPutRequest', {value: false}); | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -156,3 +152,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -179,107 +175,2 @@ var i = 0; | ||
function SendMessage() { | ||
MessageEnvelope.call(this); | ||
} | ||
SendMessage.prototype = Object.create(MessageEnvelope.prototype); | ||
SendMessage.prototype.constructor = SendMessage; | ||
Object.defineProperty(SendMessage.prototype, 'isSendMessage', {value: true}); | ||
SendMessage.decode = function (record) { | ||
var heading = record(1); | ||
switch (heading.key) { | ||
case 'event': return SendEventMessage.decode(record); | ||
case 'command': return SendCommandMessage.decode(record); | ||
} | ||
}; | ||
function SendEventMessage(node, lane, body) { | ||
SendMessage.call(this); | ||
Object.defineProperty(this, 'node', {enumerable: true, value: node}); | ||
Object.defineProperty(this, 'lane', {enumerable: true, value: lane}); | ||
Object.defineProperty(this, 'body', {enumerable: true, value: body || recon.empty()}); | ||
} | ||
SendEventMessage.prototype = Object.create(SendMessage.prototype); | ||
SendEventMessage.prototype.constructor = SendEventMessage; | ||
Object.defineProperty(SendEventMessage.prototype, 'isSendEventMessage', {value: true}); | ||
SendEventMessage.prototype.encode = function () { | ||
var builder = recon.builder(); | ||
builder.attr('send'); | ||
builder.attr('event', recon( | ||
recon.slot('node', this.node), | ||
recon.slot('lane', this.lane))); | ||
builder.appendRecord(this.body); | ||
return builder.state(); | ||
}; | ||
SendEventMessage.decode = function (record) { | ||
var node = ''; | ||
var lane = ''; | ||
var items = record.iterator(); | ||
items.step(); // @send | ||
var heading = items.next(); | ||
if (heading.value instanceof recon.Record) { | ||
var headers = heading.value.iterator(); | ||
var i = 0; | ||
while (!headers.isEmpty()) { | ||
var header = headers.next(); | ||
if (header.isField) switch (header.key) { | ||
case 'node': node = header.value; break; | ||
case 'lane': lane = header.value; break; | ||
} | ||
else switch (i) { | ||
case 0: node = header; break; | ||
case 1: lane = header; break; | ||
} | ||
i += 1; | ||
} | ||
} | ||
var body = items.toRecord(); | ||
return new SendEventMessage(node, lane, body); | ||
}; | ||
function SendCommandMessage(node, lane, body) { | ||
SendMessage.call(this); | ||
Object.defineProperty(this, 'node', {enumerable: true, value: node}); | ||
Object.defineProperty(this, 'lane', {enumerable: true, value: lane}); | ||
Object.defineProperty(this, 'body', {enumerable: true, value: body || recon.empty()}); | ||
} | ||
SendCommandMessage.prototype = Object.create(SendMessage.prototype); | ||
SendCommandMessage.prototype.constructor = SendCommandMessage; | ||
Object.defineProperty(SendCommandMessage.prototype, 'isSendCommandMessage', {value: true}); | ||
SendCommandMessage.prototype.encode = function () { | ||
var builder = recon.builder(); | ||
builder.attr('send'); | ||
builder.attr('command', recon( | ||
recon.slot('node', this.node), | ||
recon.slot('lane', this.lane))); | ||
builder.appendRecord(this.body); | ||
return builder.state(); | ||
}; | ||
SendCommandMessage.decode = function (record) { | ||
var node = ''; | ||
var lane = ''; | ||
var items = record.iterator(); | ||
items.step(); // @send | ||
var heading = items.next(); | ||
if (heading.value instanceof recon.Record) { | ||
var headers = heading.value.iterator(); | ||
var i = 0; | ||
while (!headers.isEmpty()) { | ||
var header = headers.next(); | ||
if (header.isField) switch (header.key) { | ||
case 'node': node = header.value; break; | ||
case 'lane': lane = header.value; break; | ||
} | ||
else switch (i) { | ||
case 0: node = header; break; | ||
case 1: lane = header; break; | ||
} | ||
i += 1; | ||
} | ||
} | ||
var body = items.toRecord(); | ||
return new SendCommandMessage(node, lane, body); | ||
}; | ||
function GetRequest(node) { | ||
@@ -300,3 +191,3 @@ RequestEnvelope.call(this); | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -339,3 +230,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -378,3 +269,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -416,3 +307,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -455,3 +346,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -494,3 +385,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -533,3 +424,3 @@ var i = 0; | ||
var heading = record.head(); | ||
if (heading.value instanceof recon.Record) { | ||
if (heading.value.isRecord) { | ||
var headers = heading.value.iterator(); | ||
@@ -564,5 +455,2 @@ var i = 0; | ||
exports.CommandMessage = CommandMessage; | ||
exports.SendMessage = SendMessage; | ||
exports.SendEventMessage = SendEventMessage; | ||
exports.SendCommandMessage = SendCommandMessage; | ||
exports.GetRequest = GetRequest; | ||
@@ -569,0 +457,0 @@ exports.PutRequest = PutRequest; |
@@ -1,3 +0,3 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.swim||(t.swim={})).proto=e()}}(function(){return function e(t,i,r){function n(o,p){if(!i[o]){if(!t[o]){var a="function"==typeof require&&require;if(!p&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[o]={exports:{}};t[o][0].call(f.exports,function(e){var i=t[o][1][e];return n(i?i:e)},f,f.exports,e,t,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)n(r[o]);return n}({1:[function(e,t,i){"use strict";function r(e){if(e instanceof j.Record){var t=e.head();if(t.isField)switch(t.key){case"event":return d.decode(e);case"command":return l.decode(e);case"send":return c.decode(e);case"get":return b.decode(e);case"put":return v.decode(e);case"state":return m.decode(e);case"link":return w.decode(e);case"linked":return E.decode(e);case"unlink":return O.decode(e);case"unlinked":return D.decode(e)}}}function n(e){return e.encode()}function s(e){return r(j.parse(e))}function o(e){return j.stringify(n(e))}function p(){}function a(){p.call(this)}function u(){p.call(this)}function f(){p.call(this)}function d(e,t,i,r){f.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"via",{enumerable:!0,value:i||j.absent}),Object.defineProperty(this,"body",{enumerable:!0,value:r||j.empty()})}function l(e,t,i,r){f.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"via",{enumerable:!0,value:i||j.absent}),Object.defineProperty(this,"body",{enumerable:!0,value:r||j.empty()})}function c(){f.call(this)}function h(e,t,i){c.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"body",{enumerable:!0,value:i||j.empty()})}function y(e,t,i){c.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"body",{enumerable:!0,value:i||j.empty()})}function b(e){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e})}function v(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"body",{enumerable:!0,value:t||j.empty()})}function m(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"body",{enumerable:!0,value:t||j.empty()})}function w(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function E(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function O(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function D(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}var j=e("recon-js");Object.defineProperty(p.prototype,"isRequest",{value:!1}),Object.defineProperty(p.prototype,"isResponse",{value:!1}),Object.defineProperty(p.prototype,"isMessage",{value:!1}),Object.defineProperty(p.prototype,"isEventMessage",{value:!1}),Object.defineProperty(p.prototype,"isCommandMessage",{value:!1}),Object.defineProperty(p.prototype,"isSendMessage",{value:!1}),Object.defineProperty(p.prototype,"isSendEventMessage",{value:!1}),Object.defineProperty(p.prototype,"isSendCommandMessage",{value:!1}),Object.defineProperty(p.prototype,"isGetRequest",{value:!1}),Object.defineProperty(p.prototype,"isPutRequest",{value:!1}),Object.defineProperty(p.prototype,"isStateResponse",{value:!1}),Object.defineProperty(p.prototype,"isLinkRequest",{value:!1}),Object.defineProperty(p.prototype,"isLinkedResponse",{value:!1}),Object.defineProperty(p.prototype,"isUnlinkRequest",{value:!1}),Object.defineProperty(p.prototype,"isUnlinkedResponse",{value:!1}),a.prototype=Object.create(p.prototype),a.prototype.constructor=a,Object.defineProperty(a.prototype,"isRequest",{value:!0}),u.prototype=Object.create(p.prototype),u.prototype.constructor=u,Object.defineProperty(a.prototype,"isResponse",{value:!0}),f.prototype=Object.create(p.prototype),f.prototype.constructor=f,Object.defineProperty(a.prototype,"isMessage",{value:!0}),d.prototype=Object.create(f.prototype),d.prototype.constructor=d,Object.defineProperty(d.prototype,"isEventMessage",{value:!0}),d.prototype.encode=function(){var e=j.builder(),t=j.builder();return t.slot("node",this.node),t.slot("lane",this.lane),this.via.isAbsent||t.slot("via",this.via),e.attr("event",t.state()),e.appendRecord(this.body),e.state()},d.decode=function(e){var t="",i="",r=j.absent,n=e.tail(),s=e.head();if(s.value instanceof j.Record)for(var o=s.value.iterator(),p=0;!o.isEmpty();){var a=o.next();if(a.isField)switch(a.key){case"node":t=a.value;break;case"lane":i=a.value;break;case"via":r=a.value}else switch(p){case 0:t=a;break;case 1:i=a;break;case 2:r=a}p+=1}return new d(t,i,r,n)},l.prototype=Object.create(f.prototype),l.prototype.constructor=l,Object.defineProperty(l.prototype,"isCommandMessage",{value:!0}),l.prototype.encode=function(){var e=j.builder(),t=j.builder();return t.slot("node",this.node),t.slot("lane",this.lane),this.via.isAbsent||t.slot("via",this.via),e.attr("command",t.state()),e.appendRecord(this.body),e.state()},l.decode=function(e){var t="",i="",r=j.absent,n=e.tail(),s=e.head();if(s.value instanceof j.Record)for(var o=s.value.iterator(),p=0;!o.isEmpty();){var a=o.next();if(a.isField)switch(a.key){case"node":t=a.value;break;case"lane":i=a.value;break;case"via":r=a.value}else switch(p){case 0:t=a;break;case 1:i=a;break;case 2:r=a}p+=1}return new l(t,i,r,n)},c.prototype=Object.create(f.prototype),c.prototype.constructor=c,Object.defineProperty(c.prototype,"isSendMessage",{value:!0}),c.decode=function(e){var t=e(1);switch(t.key){case"event":return h.decode(e);case"command":return y.decode(e)}},h.prototype=Object.create(c.prototype),h.prototype.constructor=h,Object.defineProperty(h.prototype,"isSendEventMessage",{value:!0}),h.prototype.encode=function(){var e=j.builder();return e.attr("send"),e.attr("event",j(j.slot("node",this.node),j.slot("lane",this.lane))),e.appendRecord(this.body),e.state()},h.decode=function(e){var t="",i="",r=e.iterator();r.step();var n=r.next();if(n.value instanceof j.Record)for(var s=n.value.iterator(),o=0;!s.isEmpty();){var p=s.next();if(p.isField)switch(p.key){case"node":t=p.value;break;case"lane":i=p.value}else switch(o){case 0:t=p;break;case 1:i=p}o+=1}var a=r.toRecord();return new h(t,i,a)},y.prototype=Object.create(c.prototype),y.prototype.constructor=y,Object.defineProperty(y.prototype,"isSendCommandMessage",{value:!0}),y.prototype.encode=function(){var e=j.builder();return e.attr("send"),e.attr("command",j(j.slot("node",this.node),j.slot("lane",this.lane))),e.appendRecord(this.body),e.state()},y.decode=function(e){var t="",i="",r=e.iterator();r.step();var n=r.next();if(n.value instanceof j.Record)for(var s=n.value.iterator(),o=0;!s.isEmpty();){var p=s.next();if(p.isField)switch(p.key){case"node":t=p.value;break;case"lane":i=p.value}else switch(o){case 0:t=p;break;case 1:i=p}o+=1}var a=r.toRecord();return new y(t,i,a)},b.prototype=Object.create(a.prototype),b.prototype.constructor=b,Object.defineProperty(b.prototype,"isGetRequest",{value:!0}),b.prototype.encode=function(){return j(j.attr("get",j(j.slot("node",this.node))))},b.decode=function(e){var t="",i=e.head();if(i.value instanceof j.Record)for(var r=i.value.iterator(),n=0;!r.isEmpty();){var s=r.next();if(s.isField)switch(s.key){case"node":t=s.value}else switch(n){case 0:t=s}n+=1}else i.value.isExtant||(t=i.value);return new b(t)},v.prototype=Object.create(a.prototype),v.prototype.constructor=v,Object.defineProperty(v.prototype,"isPutRequest",{value:!0}),v.prototype.encode=function(){var e=j.builder();return e.attr("put",j(j.slot("node",this.node))),e.appendRecord(this.body),e.state()},v.decode=function(e){var t="",i=e.tail(),r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value}else switch(s){case 0:t=o}s+=1}else r.value.isExtant||(t=r.value);return new v(t,i)},m.prototype=Object.create(u.prototype),m.prototype.constructor=m,Object.defineProperty(m.prototype,"isStateResponse",{value:!0}),m.prototype.encode=function(){var e=j.builder();return e.attr("state",j(j.slot("node",this.node))),e.appendRecord(this.body),e.state()},m.decode=function(e){var t="",i=e.tail(),r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value}else switch(s){case 0:t=o}s+=1}else r.value.isExtant||(t=r.value);return new m(t,i)},w.prototype=Object.create(a.prototype),w.prototype.constructor=w,Object.defineProperty(w.prototype,"isLinkRequest",{value:!0}),w.prototype.encode=function(){return j(j.attr("link",j(j.slot("node",this.node),j.slot("lane",this.lane))))},w.decode=function(e){var t="",i="",r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new w(t,i)},E.prototype=Object.create(u.prototype),E.prototype.constructor=E,Object.defineProperty(E.prototype,"isLinkedResponse",{value:!0}),E.prototype.encode=function(){return j(j.attr("linked",j(j.slot("node",this.node),j.slot("lane",this.lane))))},E.decode=function(e){var t="",i="",r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new E(t,i)},O.prototype=Object.create(a.prototype),O.prototype.constructor=O,Object.defineProperty(O.prototype,"isUnlinkRequest",{value:!0}),O.prototype.encode=function(){return j(j.attr("unlink",j(j.slot("node",this.node),j.slot("lane",this.lane))))},O.decode=function(e){var t="",i="",r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new O(t,i)},D.prototype=Object.create(u.prototype),D.prototype.constructor=D,Object.defineProperty(D.prototype,"isUnlinkedResponse",{value:!0}),D.prototype.encode=function(){return j(j.attr("unlinked",j(j.slot("node",this.node),j.slot("lane",this.lane))))},D.decode=function(e){var t="",i="",r=e.head();if(r.value instanceof j.Record)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new D(t,i)},i.decode=r,i.encode=n,i.parse=s,i.stringify=o,i.Envelope=p,i.RequestEnvelope=a,i.ResponseEnvelope=u,i.MessageEnvelope=f,i.EventMessage=d,i.CommandMessage=l,i.SendMessage=c,i.SendEventMessage=h,i.SendCommandMessage=y,i.GetRequest=b,i.PutRequest=v,i.StateResponse=m,i.LinkRequest=w,i.LinkedResponse=E,i.UnlinkRequest=O,i.UnlinkedResponse=D},{"recon-js":2}],2:[function(e,t,i){"use strict";function r(){if(1===arguments.length){var e=arguments[0];if(null===e)return J;if("undefined"==typeof e)return K;if(e instanceof E||e instanceof O){var t=new j;return t.appendField(e),t.state()}return n(e)}return arguments.length>1?s(arguments):K}function n(e){return null===e?J:e instanceof m||e instanceof E||e instanceof O||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||e instanceof Uint8Array||e===J||e===K?e:Array.isArray(e)?s(e):"object"==typeof e?e.toRecon&&"function"==typeof e.toRecon?e.toRecon():o(e):K}function s(e){for(var t=new j,i=e.length,r=0;i>r;){var s=n(e[r]);s.isField?t.appendField(s):t.appendValue(s),r+=1}return t.state()}function o(e){var t,i,n,s=new j,o=e["@"];for(t in o)i=r(t),"string"==typeof i&&(n=r(o[t]),n.isAbsent||s.appendField(new E(i,n)));for(t in e)"@"!==t&&(i=r(t),i.isAbsent||(n=r(e[t]),n.isAbsent||s.appendField(new O(i,n))));return s.state()}function p(e){var t=new g(e),i=(new B).run(t);return i.state()}function a(){var e=new H;return e.writeBlock(r.apply(null,arguments)),e.state()}function u(e){return null===e||"undefined"==typeof e||e.isExtant?null:e.isAbsent?void 0:e instanceof m?e.isArray()?f(e):d(e):e}function f(e){for(var t=[],i=e.iterator();!i.isEmpty();){var r=u(i.head());t.push(r),i.step()}return t}function d(e){for(var t,i,r=e.iterator(),n={},s=null,o=0;!r.isEmpty();){var p=r.head();p.isField?(t=u(p.key),i=u(p.value),p.isAttr?(null===s&&(s={}),s[t]=i):n[t]=i):(i=u(p),n[o]=i),r.step(),o+=1}return null!==s&&(n["@"]=s),n}function l(e){if("undefined"==typeof e)return new Uint8Array(0);for(var t=new F,i=new g(e);!i.isEmpty();)t.appendBase64Char(i.head()),i.step();return t.state()}function c(e,t){return"undefined"==typeof t&&(t=J),new E(r(e),r(t))}function h(e,t){return"undefined"==typeof t&&(t=J),new O(r(e),r(t))}function y(){return new m([],{})}function b(){return new j}function v(e,t){if(e===t)return!0;if(e instanceof m&&t instanceof m)return e.equals(t);if(e.isField&&t.isField)return e.equals(t);if(e instanceof Uint8Array&&t instanceof Uint8Array&&e.length===t.length){for(var i=0,r=e.length;r>i&&e[i]===t[i];)i+=1;if(i===r)return!0}return!1}function m(e,t){if("undefined"==typeof t){t={};for(var i=0,r=e.length;r>i;){var n=e[i];n.isField&&(t[n.key]=n.value),i+=1}}var s=function(i){var r=t[i];return"undefined"==typeof r&&"number"==typeof i&&(r=e[i]),r};return s.__proto__=m.prototype,Object.defineProperty(s,"items",{value:e}),Object.defineProperty(s,"index",{value:t}),s}function w(){}function E(e,t){w.call(this),Object.defineProperty(this,"key",{enumerable:!0,value:e}),"undefined"==typeof t&&(t=J),Object.defineProperty(this,"value",{enumerable:!0,value:t})}function O(e,t){w.call(this),Object.defineProperty(this,"key",{enumerable:!0,value:e}),"undefined"==typeof t&&(t=J),Object.defineProperty(this,"value",{enumerable:!0,value:t})}function D(e,t){Object.defineProperty(this,"items",{value:e}),Object.defineProperty(this,"index",{value:t||0,writable:!0})}function j(){Object.defineProperty(this,"items",{value:[]}),Object.defineProperty(this,"index",{value:{}})}function x(){Object.defineProperty(this,"items",{value:null,writable:!0}),Object.defineProperty(this,"index",{value:null,writable:!0}),Object.defineProperty(this,"value",{value:null,writable:!0})}function g(e,t){Object.defineProperty(this,"string",{value:e||""}),Object.defineProperty(this,"index",{value:t||0,writable:!0})}function P(){}function k(){Object.defineProperty(this,"string",{value:"",writable:!0})}function F(){Object.defineProperty(this,"buffer",{value:null,writable:!0}),Object.defineProperty(this,"offset",{value:0,writable:!0}),Object.defineProperty(this,"aliased",{value:!0,writable:!0}),Object.defineProperty(this,"p",{value:0,writable:!0}),Object.defineProperty(this,"q",{value:0,writable:!0}),Object.defineProperty(this,"r",{value:0,writable:!0}),Object.defineProperty(this,"s",{value:0,writable:!0})}function R(e){return 32===e||9===e}function A(e){return 10===e||13===e}function C(e){return R(e)||A(e)}function S(e){return e>=65&&90>=e||95===e||e>=97&&122>=e||e>=192&&214>=e||e>=216&&246>=e||e>=248&&767>=e||e>=880&&893>=e||e>=895&&8191>=e||e>=8204&&8205>=e||e>=8304&&8591>=e||e>=11264&&12271>=e||e>=12289&&55295>=e||e>=63744&&64975>=e||e>=65008&&65533>=e||e>=65536&&983039>=e}function q(e){return 45===e||e>=48&&57>=e||e>=65&&90>=e||95===e||e>=97&&122>=e||183===e||e>=192&&214>=e||e>=216&&246>=e||e>=248&&893>=e||e>=895&&8191>=e||e>=8204&&8205>=e||e>=8255&&8256>=e||e>=8304&&8591>=e||e>=11264&&12271>=e||e>=12289&&55295>=e||e>=63744&&64975>=e||e>=65008&&65533>=e||e>=65536&&983039>=e}function M(e){return e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e||43===e||45===e||47===e||95===e}function B(e){P.call(this),this.value=e||new V}function V(e,t,i,r){P.call(this),this.builder=e||null,this.key=t||null,this.value=i||null,this.s=r||1}function U(e,t,i){P.call(this),this.ident=e||new z,this.value=t||new V,this.s=i||1}function I(e,t,i,r){P.call(this),this.builder=e||null,this.field=t||null,this.value=i||null,this.s=r||1}function N(e,t,i,r){P.call(this),this.builder=e||null,this.field=t||null,this.value=i||null,this.s=r||1}function L(e,t,i,r){P.call(this),this.builder=e||null,this.key=t||null,this.value=i||null,this.s=r||1}function _(e,t,i,r){P.call(this),this.builder=e||null,this.text=t||null,this.value=i||null,this.s=r||1}function T(e,t){P.call(this),this.text=e||null,this.s=t||1}function G(e,t){P.call(this),this.data=e||null,this.s=t||1}function Q(e,t){P.call(this),this.builder=e||null,this.s=t||1}function z(e,t){P.call(this),this.builder=e||null,this.s=t||1}function H(e){Object.defineProperty(this,"builder",{value:e||new k})}m.prototype=Object.create(Function.prototype),m.prototype.constructor=m,Object.defineProperty(m.prototype,"size",{enumerable:!0,get:function(){return this.items.length}}),m.prototype.isEmpty=function(){return 0===this.items.length},m.prototype.isArray=function(){return this.items.length>=0&&0===Object.getOwnPropertyNames(this.index).length},m.prototype.isMarkup=function(){function e(e){for(var t=new g(e);!t.isEmpty()&&R(t.head());)t.step();return t.isEmpty()}for(var t=this.iterator(),i=!1,r=!1,n=0;!t.isEmpty();){var s=t.head();if("string"!=typeof s){if(i)return!1;i=!0,r=!0}else i&&!e(s)?(i=!1,n+=1):0===n&&(n=1);t.step()}return r&&n>=2},m.prototype.hasAttrs=function(){return this.items.length>0&&(this.items[0].isAttr||this.items[this.items.length-1].isAttr)},m.prototype.hasPrefixAttrs=function(){return this.items.length>0&&this.items[0].isAttr},m.prototype.hasPostfixAttrs=function(){return this.items.length>0&&this.items[this.items.length-1].isAttr},m.prototype.contains=function(e){return"undefined"!=typeof this(e)},m.prototype.head=function(){return this.items.length>0?this.items[0]:K},m.prototype.tail=function(){return new m(this.items.slice(1))},m.prototype.body=function(){return new m(this.items.slice(0,-1))},m.prototype.foot=function(){return this.items.length>0?this.items[this.items.length-1]:K},m.prototype.target=function(){for(var e=this.iterator();!e.isEmpty();){var t=e.next();if(!t.isField)return t}return K},m.prototype.concat=function(){var e=new j;e.appendRecord(this);var t=r.apply(null,arguments);return t instanceof m?e.appendRecord(t):e.appendValue(t),e.state()},m.prototype.iterator=function(){return new D(this.items)},m.prototype.forEach=function(e){for(var t=this.iterator();!t.isEmpty();)e(t.next())},m.prototype.equals=function(e){for(var t=this.iterator(),i=e.iterator();!t.isEmpty()&&!i.isEmpty();)if(!v(t.next(),i.next()))return!1;return t.isEmpty()&&i.isEmpty()},m.prototype.toString=function(){var e=new H;return e.writeRecord(this),e.state()},Object.defineProperty(w.prototype,"isField",{enumerable:!0,value:!0}),Object.defineProperty(w.prototype,"isAttr",{enumerable:!0,value:!1}),Object.defineProperty(w.prototype,"isSlot",{enumerable:!0,value:!1}),E.prototype=Object.create(w.prototype),E.prototype.constructor=E,Object.defineProperty(E.prototype,"isAttr",{enumerable:!0,value:!0}),E.prototype.equals=function(e){return e.isAttr&&v(this.key,e.key)&&v(this.value,e.value)},E.prototype.toString=function(){var e=new H;return e.writeAttr(this),e.state()},O.prototype=Object.create(w.prototype),O.prototype.constructor=O,Object.defineProperty(O.prototype,"isSlot",{enumerable:!0,value:!0}),O.prototype.equals=function(e){return e.isSlot&&v(this.key,e.key)&&v(this.value,e.value)},O.prototype.toString=function(){var e=new H;return e.writeItem(this),e.state()};var J={};Object.defineProperty(J,"isExtant",{enumerable:!0,value:!0});var K={};Object.defineProperty(K,"isAbsent",{enumerable:!0,value:!0}),D.prototype.isEmpty=function(){return this.index>=this.items.length},D.prototype.head=function(){if(this.index>=this.items.length)throw"head of empty iterator";return this.items[this.index]},D.prototype.step=function(){if(this.index>=this.items.length)throw"empty iterator step";this.index+=1},D.prototype.next=function(){if(this.index>=this.items.length)return null;var e=this.items[this.index];return this.index+=1,e},D.prototype.dup=function(){return new D(this.items,this.index)},D.prototype.toRecord=function(){return new m(this.items.slice(this.index))},D.prototype.isAllAttrs=function(){for(var e=this.dup();!e.isEmpty();)if(!e.next().isAttr)return!1;return!0},j.prototype.appendField=function(e){this.items.push(e),this.index[e.key]=e.value},j.prototype.appendValue=function(e){this.items.push(e)},j.prototype.appendRecord=function(e){for(var t=e.iterator();!t.isEmpty();){var i=t.next();i.isField?this.appendField(i):this.appendValue(i)}},j.prototype.attr=function(e,t){return this.appendField(c(e,t)),this},j.prototype.slot=function(e,t){return this.appendField(h(e,t)),this},j.prototype.item=function(e){return this.appendValue(n(e)),this},j.prototype.state=function(){return new m(this.items,this.index)},x.prototype.appendField=function(e){null===this.items&&(this.items=[],this.index={},null!==this.value&&(this.items.push(this.value),this.value=null)),this.items.push(e),this.index[e.key]=e.value},x.prototype.appendValue=function(e){null!==this.items?this.items.push(e):null===this.value?this.value=e:(this.items=[],this.index={},this.items.push(this.value),this.value=null,this.items.push(e))},x.prototype.state=function(){return null!==this.value?this.value:null!==this.items?new m(this.items,this.index):K},g.prototype.isDone=function(){return!1},g.prototype.isEmpty=function(){return this.index>=this.string.length},g.prototype.head=function(){var e=this.string.charCodeAt(this.index);if(55295>=e||e>=57344)return e;if(56319>=e&&this.index+1<this.string.length){var t=this.string.charCodeAt(this.index+1);return t>=56320&&57343>=t?((1023&e)<<10|1023&t)+65536:65533}return 65533},g.prototype.step=function(){var e=this.string.charCodeAt(this.index);if(55295>=e||e>=57344)this.index+=1;else if(56319>=e&&this.index+1<this.string.length){var t=this.string.charCodeAt(this.index+1);this.index+=t>=56320&&57343>=t?2:1}else this.index+=1},g.Done={isDone:function(){return!0},isEmpty:function(){return!0},head:function(){throw"head of empty iterator"},step:function(){throw"empty iterator step"}},g.Done.prototype=Object.create(g.prototype),P.prototype.isCont=function(){return!0},P.prototype.isDone=function(){return!1},P.prototype.isError=function(){return!1},P.prototype.feed=function(){return this},P.prototype.run=function(e){for(var t=this;!e.isEmpty()&&t.isCont();)t=t.feed(e);return e.isEmpty()&&!e.isDone()&&t.isCont()&&(t=t.feed(g.Done)),t},P.Done=function(e){P.call(this),this.value=e},P.Done.prototype=Object.create(P.prototype),P.Done.prototype.constructor=P.Done,P.Done.prototype.isCont=function(){return!1},P.Done.prototype.isDone=function(){return!0},P.Done.prototype.feed=function(){return this},P.Done.prototype.state=function(){return this.value},P.Error=function(e){P.call(this),this.error=e},P.Error.prototype=Object.create(P.prototype),P.Error.prototype.constructor=P.Error,P.Error.prototype.isCont=function(){return!1},P.Error.prototype.isError=function(){return!0},P.Error.prototype.feed=function(){return this},P.Error.prototype.state=function(){throw this.error},P.unexpectedEOF=new P.Error("unexpected end of input"),k.prototype.append=function(e){if(e>=0&&55295>=e||e>=57344&&65535>=e)this.string+=String.fromCharCode(e);else if(e>=65536&&1114111>=e){var t=e-65536;this.string+=String.fromCharCode(55296|t>>>10,56320|1023&t)}else this.string+=String.fromCharCode(65533)},k.prototype.appendString=function(e){for(var t=new g(e);!t.isEmpty();)this.append(t.head()),t.step()},k.prototype.state=function(){return this.string},F.prototype.prepare=function(e){function t(e,t){var i=Math.max(e,t)-1;return i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i+1}if(this.aliased||e>this.buffer.length){var i=new Uint8Array(t(256,e));this.buffer&&i.set(this.buffer),this.buffer=i,this.aliased=!1}},F.prototype.appendByte=function(e){this.prepare(this.offset+1),this.buffer[this.offset]=e,this.offset+=1},F.prototype.decodeBase64Digit=function(e){return e>=65&&90>=e?e-65:e>=97&&122>=e?e-71:e>=48&&57>=e?e+4:43===e||45===e?62:47===e||95===e?63:void 0},F.prototype.decodeBase64Quantum=function(){var e=this.decodeBase64Digit(this.p),t=this.decodeBase64Digit(this.q);if(61!==this.r){var i=this.decodeBase64Digit(this.r);if(61!==this.s){var r=this.decodeBase64Digit(this.s);this.appendByte(e<<2|t>>>4),this.appendByte(t<<4|i>>>2),this.appendByte(i<<6|r)}else this.appendByte(e<<2|t>>>4),this.appendByte(t<<4|i>>>2)}else{if(61!==this.s)throw"incomplete base64 quantum";this.appendByte(e<<2|t>>>4)}},F.prototype.appendBase64Char=function(e){0===this.p?this.p=e:0===this.q?this.q=e:0===this.r?this.r=e:(this.s=e,this.decodeBase64Quantum(),this.s=0,this.r=0,this.q=0,this.p=0)},F.prototype.state=function(){if(this.buffer){if(this.buffer.length!==this.offset){var e=new Uint8Array(this.offset);e.set(this.buffer.subarray(0,this.offset)),this.buffer=e}}else this.buffer=new Uint8Array(0);return this.aliased=!0,this.buffer},B.prototype=Object.create(P.prototype),B.prototype.constructor=B,B.prototype.feed=function(e){for(var t=this.value;(!e.isEmpty()||e.isDone())&&t.isCont();)t=t.feed(e);if(t.isError())return t;if(t.isDone()){if(!e.isEmpty())return new P.Error({found:e.head()});if(e.isDone())return t}return new B(t)},V.prototype=Object.create(P.prototype),V.prototype.constructor=V,V.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.key,s=this.builder||new x;!e.isEmpty()||e.isDone();){if(1===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=2}if(2===i){for(n=n||new I;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&(t=e.head(),R(t));)e.step();if(e.isEmpty()){if(e.isDone())return s.appendValue(n.state()),new P.Done(s.state())}else 58===t?(e.step(),i=4):(s.appendValue(n.state()),n=null,i=6)}if(4===i){for(;!e.isEmpty()&&R(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return s.appendField(new O(n.state())),new P.Done(s.state())}else i=5}if(5===i){for(r=r||new I;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendField(new O(n.state(),r.state())),n=null,r=null,i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&(t=e.head(),R(t));)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else{if(44!==t&&59!==t&&!A(t))return new P.Done(s.state());e.step(),i=1}}}return new V(s,n,r,i)},U.prototype=Object.create(P.prototype),U.prototype.constructor=U,U.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.ident;if(1===i)if(e.isEmpty()||(t=e.head(),64!==t)){if(!e.isEmpty())return new P.Error({expected:"'@'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;if(2===i)if(n=n.feed(e),n.isDone())i=3;else if(n.isError())return n;if(3===i)if(e.isEmpty()||40!==e.head()){if(!e.isEmpty()||e.isDone())return new P.Done(new E(n.state()))}else e.step(),i=4;if(4===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(41===t)return e.step(),new P.Done(new E(n.state()));i=5}}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(!e.isEmpty())return 41===t?(e.step(),new P.Done(new E(n.state(),r.state()))):new P.Error({expected:"')'",found:t});if(e.isDone())return P.unexpectedEOF}return new U(n,r,i)},I.prototype=Object.create(P.prototype),I.prototype.constructor=I,I.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.field,s=this.builder;!e.isEmpty()||e.isDone();){if(1===i)if(e.isEmpty()){if(e.isDone())return new P.Done(s?s.state():K)}else if(t=e.head(),64===t)n=new U,i=2;else if(123===t)s=s||new j,r=new L(s),i=5;else if(91===t)s=s||new j,r=new _(s),i=5;else if(34===t)r=new T,i=4;else if(37===t)r=new G,i=4;else if(45===t||t>=48&&57>=t)r=new Q,i=4;else{if(!S(t))return new P.Done(s?s.state():K);r=new z,i=4}if(2===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new x,s.appendField(n.state()),n=null,i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&R(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=1}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s=s||new x,s.appendValue(r.state()),r=null,i=6;else if(r.isError())return r}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())r=null,i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&R(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else{if(64!==e.head())return new P.Done(s.state());n=new U,i=7}}if(7===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new x,s.appendField(n.state()),n=null,i=6;else if(n.isError())return n}}return new I(s,n,r,i)},N.prototype=Object.create(P.prototype),N.prototype.constructor=N,N.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.field,s=this.builder;!e.isEmpty()||e.isDone();){if(1===i)if(e.isEmpty()){if(e.isDone())return new P.Done(s?s.state():K)}else if(t=e.head(),64===t)n=new U,i=2;else if(123===t)s?(r=new L(s),i=5):(r=new L,i=4);else{if(91!==t)return new P.Done(s?s.state():K);s?(r=new _(s),i=5):(r=new _,i=4)}if(2===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new x,s.appendField(n.state()),n=null,i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&R(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=1}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())return s=s||new x,s.appendValue(r.state()),new P.Done(s.state());if(r.isError())return r}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())return new P.Done(s.state());if(r.isError())return r}}return new N(s,n,r,i)},L.prototype=Object.create(P.prototype),L.prototype.constructor=L,L.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.key,s=this.builder||new j;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),123!==t)return new P.Error({expected:"'{'",found:t});e.step(),i=2}for(;!e.isEmpty()||e.isDone();){if(2===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(125===t)return e.step(),new P.Done(s.state());i=3}}if(3===i){for(n=n||new I;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())i=4;else if(n.isError())return n}if(4===i){for(;!e.isEmpty()&&(t=e.head(),R(t));)e.step();if(e.isEmpty()){if(e.isDone())return s.appendValue(n.state()),new P.Done(s.state())}else 58===t?(e.step(),i=5):(s.appendValue(n.state()),n=null,i=7)}if(5===i){for(;!e.isEmpty()&&R(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return s.appendField(new O(n.state())),new P.Done(s.state())}else i=6}if(6===i){for(r=r||new I;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendField(new O(n.state(),r.state())),n=null,r=null,i=7;else if(r.isError())return r}if(7===i){for(;!e.isEmpty()&&(t=e.head(),R(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(44!==t&&59!==t&&!A(t))return 125===t?(e.step(),new P.Done(s.state())):new P.Error({expected:"'}', ';', ',', or newline",found:t});e.step(),i=2}}}return new L(s,n,r,i) | ||
},_.prototype=Object.create(P.prototype),_.prototype.constructor=_,_.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.text,s=this.builder;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),91!==t)return new P.Error({expected:"'['",found:t});e.step(),i=2}for(;!e.isEmpty()||e.isDone();){if(2===i){for(;!e.isEmpty()&&(t=e.head(),64!==t&&91!==t&&92!==t&&93!==t&&123!==t&&125!==t);)e.step(),n=n||new k,n.append(t);if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(93===t)return e.step(),s=s||new j,n&&s.appendValue(n.state()),new P.Done(s.state());64===t?(s=s||new j,n&&(s.appendValue(n.state()),n=null),r=new N,i=3):123===t?(s=s||new j,n&&(s.appendValue(n.state()),n=null),r=new L(s),i=4):91===t?(s=s||new j,n&&(s.appendValue(n.state()),n=null),r=new _(s),i=4):92===t?(e.step(),i=5):new P.Error({found:t})}}if(3===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendValue(r.state()),r=null,i=2;else if(r.isError())return r}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())r=null,i=2;else if(r.isError())return r}if(5===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),n=n||new k,34===t||47===t||64===t||91===t||92===t||93===t||123===t||125===t)e.step(),n.append(t),i=2;else if(98===t)e.step(),n.append(8),i=2;else if(102===t)e.step(),n.append(12),i=2;else if(110===t)e.step(),n.append(10),i=2;else if(114===t)e.step(),n.append(13),i=2;else{if(116!==t)return new P.Error({expected:"escape character",found:t});e.step(),n.append(9),i=2}}return new _(s,n,r,i)},T.prototype=Object.create(P.prototype),T.prototype.constructor=T,T.prototype.feed=function(e){var t=0,i=this.s,r=this.text;if(1===i)if(e.isEmpty()||(t=e.head(),34!==t)){if(!e.isEmpty())return new P.Error({expected:"'\"'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;for(;!e.isEmpty()||e.isDone();){if(2===i){for(r=r||new k;!e.isEmpty()&&(t=e.head(),34!==t&&92!==t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(34===t)return e.step(),new P.Done(r.state());92===t&&(e.step(),i=3)}}if(3===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),34===t||47===t||64===t||91===t||92===t||93===t||123===t||125===t)e.step(),r.append(t),i=2;else if(98===t)e.step(),r.append(8),i=2;else if(102===t)e.step(),r.append(12),i=2;else if(110===t)e.step(),r.append(10),i=2;else if(114===t)e.step(),r.append(13),i=2;else{if(116!==t)return new P.Error({expected:"escape character",found:t});e.step(),r.append(9),i=2}}return new T(r,i)},G.prototype=Object.create(P.prototype),G.prototype.constructor=G,G.prototype.feed=function(e){var t=0,i=this.s,r=this.data||new F;if(1===i)if(e.isEmpty()||(t=e.head(),37!==t)){if(!e.isEmpty())return new P.Error({expected:"'%'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;for(;!e.isEmpty()||e.isDone();){if(2===i)if(!e.isEmpty()&&(t=e.head(),M(t)))e.step(),r.appendBase64Char(t),i=3;else if(!e.isEmpty()||e.isDone())return new P.Done(r.state());if(3===i)if(!e.isEmpty()&&(t=e.head(),M(t)))e.step(),r.appendBase64Char(t),i=4;else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}if(4===i)if(!e.isEmpty()&&(t=e.head(),M(t)||61===t))e.step(),r.appendBase64Char(t),i=61!==t?5:6;else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}if(5===i)if(!e.isEmpty()&&(t=e.head(),M(t)||61===t)){if(e.step(),r.appendBase64Char(t),61===t)return new P.Done(r.state());i=2}else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}else if(6===i){if(!e.isEmpty()&&(t=e.head(),61===t))return e.step(),r.appendBase64Char(t),new P.Done(r.state());if(!e.isEmpty())return new P.Error({expected:"'='",found:t});if(e.isDone())return P.unexpectedEOF}}return new G(r,i)},Q.prototype=Object.create(P.prototype),Q.prototype.constructor=Q,Q.prototype.feed=function(e){var t=0,i=this.s,r=this.builder||new k;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else t=e.head(),45===t&&(e.step(),r.append(t)),i=2;if(2===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),48===t)e.step(),r.append(t),i=4;else{if(!(t>=49&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=3}if(3===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else i=4}if(4===i)if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else if(t=e.head(),46===t)e.step(),r.append(t),i=5;else{if(69!==t&&101!==t)return new P.Done(Number(r.state()));e.step(),r.append(t),i=8}if(5===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),!(t>=48&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=6}if(6===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else i=7}if(7===i){if(t=e.head(),69!==t&&101!==t)return new P.Done(Number(r.state()));e.step(),r.append(t),i=8}if(8===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else t=e.head(),(43===t||45===t)&&(e.step(),r.append(t)),i=9;if(9===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),!(t>=48&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=10}if(10===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(!e.isEmpty()||e.isDone())return new P.Done(Number(r.state()))}return new Q(r,i)},z.prototype=Object.create(P.prototype),z.prototype.constructor=z,z.prototype.feed=function(e){var t=0,i=this.s,r=this.builder;if(1===i)if(!e.isEmpty()&&(t=e.head(),S(t)))r=r||new k,e.step(),r.append(t),i=2;else{if(!e.isEmpty())return new P.Error({expected:"identitifer",found:t});if(e.isDone())return P.unexpectedEOF}if(2===i){for(;!e.isEmpty()&&(t=e.head(),q(t));)e.step(),r.append(t);if(!e.isEmpty()||e.isDone()){var n=r.state();return"true"===n?n=!0:"false"===n&&(n=!1),new P.Done(n)}}return new z(r,i)},H.prototype.writeValue=function(e,t){e instanceof m?this.writeRecord(e,t):"string"==typeof e?this.writeText(e,t):"number"==typeof e?this.writeNumber(e):"boolean"==typeof e?this.writeBool(e):e instanceof Uint8Array&&this.writeData(e)},H.prototype.writeAttr=function(e){this.builder.append(64),this.writeIdent(e.key),e.value.isExtant||(this.builder.append(40),this.writeBlock(e.value),this.builder.append(41))},H.prototype.writeItem=function(e){e.isField?(this.writeValue(e.key),this.builder.append(58),e.value.isExtant||this.writeValue(e.value)):this.writeValue(e)},H.prototype.writeBlock=function(e){if(e instanceof m)if(e.isMarkup())this.writeMarkup(e);else if(e.hasAttrs())this.writeRecord(e);else{var t=e.iterator();if(!t.isEmpty())for(this.writeItem(t.next());!t.isEmpty();)this.builder.append(44),this.writeItem(t.next())}else this.writeValue(e)},H.prototype.writeRecord=function(e,t){if(e.isMarkup())this.writeMarkup(e);else{for(var i,r=e.iterator(),n=!1;!r.isEmpty()&&(i=r.head(),i.isAttr);)this.writeAttr(i),r.step(),n=!0;if(r.isEmpty())n||(this.builder.append(123),this.builder.append(125));else{if(r.step(),n&&r.isEmpty())t?i instanceof m||"string"==typeof i?this.writeValue(i,t):(this.builder.append(123),this.writeItem(i),this.builder.append(125)):i instanceof m||i.isSlot?(this.builder.append(123),this.writeItem(i),this.builder.append(125)):(this.builder.append(32),this.writeValue(i));else if(!r.isEmpty()&&r.isAllAttrs())i instanceof m||i.isSlot?(this.builder.append(123),this.writeItem(i),this.builder.append(125)):(n&&this.builder.append(32),this.writeValue(i));else{for(this.builder.append(123),this.writeItem(i);!r.isEmpty()&&(i=r.head(),!i.isAttr||!r.isAllAttrs);)this.builder.append(44),this.writeItem(i),r.step();this.builder.append(125)}for(;!r.isEmpty();)this.writeAttr(r.next())}}},H.prototype.writeMarkup=function(e){for(var t,i=e.iterator(),r=!1;!i.isEmpty()&&(t=i.head(),t.isAttr);)this.writeAttr(t),i.step(),r=!0;for(this.builder.append(91);!i.isEmpty();){if(t=i.head(),"string"==typeof t)for(var n=new g(t);!n.isEmpty();){var s=n.head();switch(s){case 64:case 91:case 92:case 93:case 123:case 125:this.builder.append(92),this.builder.append(s);break;default:this.builder.append(s)}n.step()}else t instanceof m?this.writeRecord(t,!0):(this.builder.append(123),this.writeItem(t),this.builder.append(125));i.step()}this.builder.append(93)},H.prototype.writeText=function(e,t){function i(){var t=new g(e);if(t.isEmpty()||!S(t.head()))return!1;for(t.step();!t.isEmpty()&&q(t.head());)t.step();return t.isEmpty()}t?this.writeTextMarkup(e):i()?this.writeIdent(e):this.writeString(e)},H.prototype.writeString=function(e){var t=new g(e);for(this.builder.append(34);!t.isEmpty();){var i=t.head();switch(i){case 34:case 92:this.builder.append(92),this.builder.append(i);break;case 8:this.builder.append(92),this.builder.append(98);break;case 12:this.builder.append(92),this.builder.append(102);break;case 10:this.builder.append(92),this.builder.append(110);break;case 13:this.builder.append(92),this.builder.append(114);break;case 9:this.builder.append(92),this.builder.append(116);break;default:this.builder.append(i)}t.step()}this.builder.append(34)},H.prototype.writeIdent=function(e){this.builder.appendString(e)},H.prototype.writeTextMarkup=function(e){var t=new g(e);for(this.builder.append(91);!t.isEmpty();){var i=t.head();switch(i){case 64:case 91:case 92:case 93:case 123:case 125:this.builder.append(92),this.builder.append(i);break;default:this.builder.append(i)}t.step()}this.builder.append(93)},H.prototype.writeNumber=function(e){this.builder.appendString(e.toString())},H.prototype.writeBool=function(e){this.builder.appendString(e.toString())},H.prototype.writeData=function(e){function t(e){return e>=0&&26>e?e+65:e>=26&&52>e?e+71:e>=52&&62>e?e-4:62===e?43:63===e?47:void 0}this.builder.append(37);for(var i,r,n,s=0,o=e.length;o>s+2;)i=e[s],r=e[s+1],n=e[s+2],this.builder.append(t(i>>>2)),this.builder.append(t(63&(i<<4|r>>>4))),this.builder.append(t(63&(r<<2|n>>>6))),this.builder.append(t(63&n)),s+=3;o>s+1?(i=e[s],r=e[s+1],this.builder.append(t(i>>>2)),this.builder.append(t(63&(i<<4|r>>>4))),this.builder.append(t(r<<2&63)),this.builder.append(61),s+=2):o>s&&(i=e[s],this.builder.append(t(i>>>2)),this.builder.append(t(i<<4&63)),this.builder.append(61),this.builder.append(61),s+=1)},H.prototype.state=function(){return this.builder.state()},t.exports=function(){return r.apply(null,arguments)},i=t.exports,i.parse=p,i.stringify=a,i.objectify=u,i.Record=m,i.Field=w,i.Attr=E,i.Slot=O,i.attr=c,i.slot=h,i.base64=l,i.extant=J,i.absent=K,i.empty=y,i.builder=b,i.compare=v},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.swim||(t.swim={})).proto=e()}}(function(){return function e(t,i,r){function n(o,p){if(!i[o]){if(!t[o]){var a="function"==typeof require&&require;if(!p&&a)return a(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=i[o]={exports:{}};t[o][0].call(f.exports,function(e){var i=t[o][1][e];return n(i?i:e)},f,f.exports,e,t,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)n(r[o]);return n}({1:[function(e,t,i){"use strict";function r(e){if(e.isRecord){var t=e.head();if(t.isField)switch(t.key){case"event":return l.decode(e);case"command":return d.decode(e);case"get":return c.decode(e);case"put":return h.decode(e);case"state":return y.decode(e);case"link":return b.decode(e);case"linked":return v.decode(e);case"unlink":return m.decode(e);case"unlinked":return w.decode(e)}}}function n(e){return e.encode()}function s(e){return r(E.parse(e))}function o(e){return E.stringify(n(e))}function p(){}function a(){p.call(this)}function u(){p.call(this)}function f(){p.call(this)}function l(e,t,i,r){f.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"via",{enumerable:!0,value:i||E.absent}),Object.defineProperty(this,"body",{enumerable:!0,value:r||E.empty()})}function d(e,t,i,r){f.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t}),Object.defineProperty(this,"via",{enumerable:!0,value:i||E.absent}),Object.defineProperty(this,"body",{enumerable:!0,value:r||E.empty()})}function c(e){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e})}function h(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"body",{enumerable:!0,value:t||E.empty()})}function y(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"body",{enumerable:!0,value:t||E.empty()})}function b(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function v(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function m(e,t){a.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}function w(e,t){u.call(this),Object.defineProperty(this,"node",{enumerable:!0,value:e}),Object.defineProperty(this,"lane",{enumerable:!0,value:t})}var E=e("recon-js");Object.defineProperty(p.prototype,"isRequest",{value:!1}),Object.defineProperty(p.prototype,"isResponse",{value:!1}),Object.defineProperty(p.prototype,"isMessage",{value:!1}),Object.defineProperty(p.prototype,"isEventMessage",{value:!1}),Object.defineProperty(p.prototype,"isCommandMessage",{value:!1}),Object.defineProperty(p.prototype,"isGetRequest",{value:!1}),Object.defineProperty(p.prototype,"isPutRequest",{value:!1}),Object.defineProperty(p.prototype,"isStateResponse",{value:!1}),Object.defineProperty(p.prototype,"isLinkRequest",{value:!1}),Object.defineProperty(p.prototype,"isLinkedResponse",{value:!1}),Object.defineProperty(p.prototype,"isUnlinkRequest",{value:!1}),Object.defineProperty(p.prototype,"isUnlinkedResponse",{value:!1}),a.prototype=Object.create(p.prototype),a.prototype.constructor=a,Object.defineProperty(a.prototype,"isRequest",{value:!0}),u.prototype=Object.create(p.prototype),u.prototype.constructor=u,Object.defineProperty(a.prototype,"isResponse",{value:!0}),f.prototype=Object.create(p.prototype),f.prototype.constructor=f,Object.defineProperty(a.prototype,"isMessage",{value:!0}),l.prototype=Object.create(f.prototype),l.prototype.constructor=l,Object.defineProperty(l.prototype,"isEventMessage",{value:!0}),l.prototype.encode=function(){var e=E.builder(),t=E.builder();return t.slot("node",this.node),t.slot("lane",this.lane),this.via.isAbsent||t.slot("via",this.via),e.attr("event",t.state()),e.appendRecord(this.body),e.state()},l.decode=function(e){var t="",i="",r=E.absent,n=e.tail(),s=e.head();if(s.value.isRecord)for(var o=s.value.iterator(),p=0;!o.isEmpty();){var a=o.next();if(a.isField)switch(a.key){case"node":t=a.value;break;case"lane":i=a.value;break;case"via":r=a.value}else switch(p){case 0:t=a;break;case 1:i=a;break;case 2:r=a}p+=1}return new l(t,i,r,n)},d.prototype=Object.create(f.prototype),d.prototype.constructor=d,Object.defineProperty(d.prototype,"isCommandMessage",{value:!0}),d.prototype.encode=function(){var e=E.builder(),t=E.builder();return t.slot("node",this.node),t.slot("lane",this.lane),this.via.isAbsent||t.slot("via",this.via),e.attr("command",t.state()),e.appendRecord(this.body),e.state()},d.decode=function(e){var t="",i="",r=E.absent,n=e.tail(),s=e.head();if(s.value.isRecord)for(var o=s.value.iterator(),p=0;!o.isEmpty();){var a=o.next();if(a.isField)switch(a.key){case"node":t=a.value;break;case"lane":i=a.value;break;case"via":r=a.value}else switch(p){case 0:t=a;break;case 1:i=a;break;case 2:r=a}p+=1}return new d(t,i,r,n)},c.prototype=Object.create(a.prototype),c.prototype.constructor=c,Object.defineProperty(c.prototype,"isGetRequest",{value:!0}),c.prototype.encode=function(){return E(E.attr("get",E(E.slot("node",this.node))))},c.decode=function(e){var t="",i=e.head();if(i.value.isRecord)for(var r=i.value.iterator(),n=0;!r.isEmpty();){var s=r.next();if(s.isField)switch(s.key){case"node":t=s.value}else switch(n){case 0:t=s}n+=1}else i.value.isExtant||(t=i.value);return new c(t)},h.prototype=Object.create(a.prototype),h.prototype.constructor=h,Object.defineProperty(h.prototype,"isPutRequest",{value:!0}),h.prototype.encode=function(){var e=E.builder();return e.attr("put",E(E.slot("node",this.node))),e.appendRecord(this.body),e.state()},h.decode=function(e){var t="",i=e.tail(),r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value}else switch(s){case 0:t=o}s+=1}else r.value.isExtant||(t=r.value);return new h(t,i)},y.prototype=Object.create(u.prototype),y.prototype.constructor=y,Object.defineProperty(y.prototype,"isStateResponse",{value:!0}),y.prototype.encode=function(){var e=E.builder();return e.attr("state",E(E.slot("node",this.node))),e.appendRecord(this.body),e.state()},y.decode=function(e){var t="",i=e.tail(),r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value}else switch(s){case 0:t=o}s+=1}else r.value.isExtant||(t=r.value);return new y(t,i)},b.prototype=Object.create(a.prototype),b.prototype.constructor=b,Object.defineProperty(b.prototype,"isLinkRequest",{value:!0}),b.prototype.encode=function(){return E(E.attr("link",E(E.slot("node",this.node),E.slot("lane",this.lane))))},b.decode=function(e){var t="",i="",r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new b(t,i)},v.prototype=Object.create(u.prototype),v.prototype.constructor=v,Object.defineProperty(v.prototype,"isLinkedResponse",{value:!0}),v.prototype.encode=function(){return E(E.attr("linked",E(E.slot("node",this.node),E.slot("lane",this.lane))))},v.decode=function(e){var t="",i="",r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new v(t,i)},m.prototype=Object.create(a.prototype),m.prototype.constructor=m,Object.defineProperty(m.prototype,"isUnlinkRequest",{value:!0}),m.prototype.encode=function(){return E(E.attr("unlink",E(E.slot("node",this.node),E.slot("lane",this.lane))))},m.decode=function(e){var t="",i="",r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new m(t,i)},w.prototype=Object.create(u.prototype),w.prototype.constructor=w,Object.defineProperty(w.prototype,"isUnlinkedResponse",{value:!0}),w.prototype.encode=function(){return E(E.attr("unlinked",E(E.slot("node",this.node),E.slot("lane",this.lane))))},w.decode=function(e){var t="",i="",r=e.head();if(r.value.isRecord)for(var n=r.value.iterator(),s=0;!n.isEmpty();){var o=n.next();if(o.isField)switch(o.key){case"node":t=o.value;break;case"lane":i=o.value}else switch(s){case 0:t=o;break;case 1:i=o}s+=1}return new w(t,i)},i.decode=r,i.encode=n,i.parse=s,i.stringify=o,i.Envelope=p,i.RequestEnvelope=a,i.ResponseEnvelope=u,i.MessageEnvelope=f,i.EventMessage=l,i.CommandMessage=d,i.GetRequest=c,i.PutRequest=h,i.StateResponse=y,i.LinkRequest=b,i.LinkedResponse=v,i.UnlinkRequest=m,i.UnlinkedResponse=w},{"recon-js":2}],2:[function(e,t,i){"use strict";function r(){if(1===arguments.length){var e=arguments[0];if(void 0===e)return K;if(null===e)return J;if(e.isAttr||e.isSlot){var t=new x;return t.appendField(e),t.state()}return n(e)}return arguments.length>1?s(arguments):K}function n(e){return null===e?J:e.isRecord||e.isAttr||e.isSlot||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||e instanceof Uint8Array||e===J||e===K?e:Array.isArray(e)?s(e):"object"==typeof e?e.toRecon&&"function"==typeof e.toRecon?e.toRecon():o(e):K}function s(e){for(var t=new x,i=e.length,r=0;i>r;){var s=n(e[r]);s.isField?t.appendField(s):t.appendValue(s),r+=1}return t.state()}function o(e){var t,i,n,s=new x,o=e["@"];for(t in o)i=r(t),"string"==typeof i&&(n=r(o[t]),n.isAbsent||s.appendField(new E(i,n)));for(t in e)"@"!==t&&(i=r(t),i.isAbsent||(n=r(e[t]),n.isAbsent||s.appendField(new D(i,n))));return s.state()}function p(e){var t=new g(e),i=(new V).run(t);return i.state()}function a(){var e=new H;return e.writeBlock(r.apply(null,arguments)),e.state()}function u(e){return void 0===e||null===e||e.isExtant?null:e.isAbsent?void 0:e.isRecord?e.isArray()?f(e):l(e):e}function f(e){for(var t=[],i=e.iterator();!i.isEmpty();){var r=u(i.head());t.push(r),i.step()}return t}function l(e){for(var t,i,r=e.iterator(),n={},s=null,o=0;!r.isEmpty();){var p=r.head();p.isField?(t=u(p.key),i=u(p.value),p.isAttr?(null===s&&(s={}),s[t]=i):n[t]=i):(i=u(p),n[o]=i),r.step(),o+=1}return null!==s&&(n["@"]=s),n}function d(e){if(void 0===e)return new Uint8Array(0);for(var t=new R,i=new g(e);!i.isEmpty();)t.appendBase64Char(i.head()),i.step();return t.state()}function c(e,t){return void 0===t&&(t=J),new E(r(e),r(t))}function h(e,t){return void 0===t&&(t=J),new D(r(e),r(t))}function y(){return new m([],{})}function b(){return new x}function v(e,t){if(e===t)return!0;if(e.isRecord&&t.isRecord)return e.equals(t);if(e.isField&&t.isField)return e.equals(t);if(e instanceof Uint8Array&&t instanceof Uint8Array&&e.length===t.length){for(var i=0,r=e.length;r>i&&e[i]===t[i];)i+=1;if(i===r)return!0}return!1}function m(e,t){if(void 0===t){t={};for(var i=0,r=e.length;r>i;){var n=e[i];n.isField&&(t[n.key]=n.value),i+=1}}var s=function(i){var r=t[i];return void 0===r&&"number"==typeof i&&(r=e[i]),r};return s.__proto__=m.prototype,Object.defineProperty(s,"items",{value:e}),Object.defineProperty(s,"index",{value:t}),s}function w(){}function E(e,t){w.call(this),Object.defineProperty(this,"key",{enumerable:!0,value:e}),void 0===t&&(t=J),Object.defineProperty(this,"value",{enumerable:!0,value:t})}function D(e,t){w.call(this),Object.defineProperty(this,"key",{enumerable:!0,value:e}),void 0===t&&(t=J),Object.defineProperty(this,"value",{enumerable:!0,value:t})}function O(e,t){Object.defineProperty(this,"items",{value:e}),Object.defineProperty(this,"index",{value:t||0,writable:!0})}function x(){Object.defineProperty(this,"items",{value:[]}),Object.defineProperty(this,"index",{value:{}})}function j(){Object.defineProperty(this,"items",{value:null,writable:!0}),Object.defineProperty(this,"index",{value:null,writable:!0}),Object.defineProperty(this,"value",{value:null,writable:!0})}function g(e,t){Object.defineProperty(this,"string",{value:e||""}),Object.defineProperty(this,"index",{value:t||0,writable:!0})}function P(){}function k(){Object.defineProperty(this,"string",{value:"",writable:!0})}function R(){Object.defineProperty(this,"buffer",{value:null,writable:!0}),Object.defineProperty(this,"offset",{value:0,writable:!0}),Object.defineProperty(this,"aliased",{value:!0,writable:!0}),Object.defineProperty(this,"p",{value:0,writable:!0}),Object.defineProperty(this,"q",{value:0,writable:!0}),Object.defineProperty(this,"r",{value:0,writable:!0}),Object.defineProperty(this,"s",{value:0,writable:!0})}function F(e){return 32===e||9===e}function A(e){return 10===e||13===e}function C(e){return F(e)||A(e)}function q(e){return e>=65&&90>=e||95===e||e>=97&&122>=e||e>=192&&214>=e||e>=216&&246>=e||e>=248&&767>=e||e>=880&&893>=e||e>=895&&8191>=e||e>=8204&&8205>=e||e>=8304&&8591>=e||e>=11264&&12271>=e||e>=12289&&55295>=e||e>=63744&&64975>=e||e>=65008&&65533>=e||e>=65536&&983039>=e}function B(e){return 45===e||e>=48&&57>=e||e>=65&&90>=e||95===e||e>=97&&122>=e||183===e||e>=192&&214>=e||e>=216&&246>=e||e>=248&&893>=e||e>=895&&8191>=e||e>=8204&&8205>=e||e>=8255&&8256>=e||e>=8304&&8591>=e||e>=11264&&12271>=e||e>=12289&&55295>=e||e>=63744&&64975>=e||e>=65008&&65533>=e||e>=65536&&983039>=e}function S(e){return e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e||43===e||45===e||47===e||95===e}function V(e){P.call(this),this.value=e||new M}function M(e,t,i,r){P.call(this),this.builder=e||null,this.key=t||null,this.value=i||null,this.s=r||1}function U(e,t,i){P.call(this),this.ident=e||new z,this.value=t||new M,this.s=i||1}function I(e,t,i,r){P.call(this),this.builder=e||null,this.field=t||null,this.value=i||null,this.s=r||1}function N(e,t,i,r){P.call(this),this.builder=e||null,this.field=t||null,this.value=i||null,this.s=r||1}function L(e,t,i,r){P.call(this),this.builder=e||null,this.key=t||null,this.value=i||null,this.s=r||1}function _(e,t,i,r){P.call(this),this.builder=e||null,this.text=t||null,this.value=i||null,this.s=r||1}function T(e,t){P.call(this),this.text=e||null,this.s=t||1}function G(e,t){P.call(this),this.data=e||null,this.s=t||1}function Q(e,t){P.call(this),this.builder=e||null,this.s=t||1}function z(e,t){P.call(this),this.builder=e||null,this.s=t||1}function H(e){Object.defineProperty(this,"builder",{value:e||new k})}m.prototype=Object.create(Function.prototype),m.prototype.constructor=m,Object.defineProperty(m.prototype,"isRecord",{enumerable:!0,value:!0}),Object.defineProperty(m.prototype,"size",{enumerable:!0,get:function(){return this.items.length}}),m.prototype.isEmpty=function(){return 0===this.items.length},m.prototype.isArray=function(){return this.items.length>=0&&0===Object.getOwnPropertyNames(this.index).length},m.prototype.isMarkup=function(){function e(e){for(var t=new g(e);!t.isEmpty()&&F(t.head());)t.step();return t.isEmpty()}for(var t=this.iterator(),i=!1,r=!1,n=0;!t.isEmpty();){var s=t.head();if("string"!=typeof s){if(i)return!1;i=!0,r=!0}else i&&!e(s)?(i=!1,n+=1):0===n&&(n=1);t.step()}return r&&n>=2},m.prototype.hasAttrs=function(){return this.items.length>0&&(this.items[0].isAttr||this.items[this.items.length-1].isAttr)},m.prototype.hasPrefixAttrs=function(){return this.items.length>0&&this.items[0].isAttr},m.prototype.hasPostfixAttrs=function(){return this.items.length>0&&this.items[this.items.length-1].isAttr},m.prototype.contains=function(e){return void 0!==this(e)},m.prototype.head=function(){return this.items.length>0?this.items[0]:K},m.prototype.tail=function(){return new m(this.items.slice(1))},m.prototype.body=function(){return new m(this.items.slice(0,-1))},m.prototype.foot=function(){return this.items.length>0?this.items[this.items.length-1]:K},m.prototype.target=function(){for(var e=this.iterator();!e.isEmpty();){var t=e.next();if(!t.isField)return t}return K},m.prototype.concat=function(){var e=new x;e.appendRecord(this);var t=r.apply(null,arguments);return t.isRecord?e.appendRecord(t):e.appendValue(t),e.state()},m.prototype.iterator=function(){return new O(this.items)},m.prototype.forEach=function(e){for(var t=this.iterator();!t.isEmpty();)e(t.next())},m.prototype.equals=function(e){for(var t=this.iterator(),i=e.iterator();!t.isEmpty()&&!i.isEmpty();)if(!v(t.next(),i.next()))return!1;return t.isEmpty()&&i.isEmpty()},m.prototype.toString=function(){var e=new H;return e.writeRecord(this),e.state()},Object.defineProperty(w.prototype,"isField",{enumerable:!0,value:!0}),Object.defineProperty(w.prototype,"isAttr",{enumerable:!0,value:!1}),Object.defineProperty(w.prototype,"isSlot",{enumerable:!0,value:!1}),E.prototype=Object.create(w.prototype),E.prototype.constructor=E,Object.defineProperty(E.prototype,"isAttr",{enumerable:!0,value:!0}),E.prototype.equals=function(e){return e.isAttr&&v(this.key,e.key)&&v(this.value,e.value)},E.prototype.toString=function(){var e=new H;return e.writeAttr(this),e.state()},D.prototype=Object.create(w.prototype),D.prototype.constructor=D,Object.defineProperty(D.prototype,"isSlot",{enumerable:!0,value:!0}),D.prototype.equals=function(e){return e.isSlot&&v(this.key,e.key)&&v(this.value,e.value)},D.prototype.toString=function(){var e=new H;return e.writeItem(this),e.state()};var J={};Object.defineProperty(J,"isExtant",{enumerable:!0,value:!0});var K={};Object.defineProperty(K,"isAbsent",{enumerable:!0,value:!0}),O.prototype.isEmpty=function(){return this.index>=this.items.length},O.prototype.head=function(){if(this.index>=this.items.length)throw"head of empty iterator";return this.items[this.index]},O.prototype.step=function(){if(this.index>=this.items.length)throw"empty iterator step";this.index+=1},O.prototype.next=function(){if(this.index>=this.items.length)return null;var e=this.items[this.index];return this.index+=1,e},O.prototype.dup=function(){return new O(this.items,this.index)},O.prototype.toRecord=function(){return new m(this.items.slice(this.index))},O.prototype.isAllAttrs=function(){for(var e=this.dup();!e.isEmpty();)if(!e.next().isAttr)return!1;return!0},x.prototype.appendField=function(e){this.items.push(e),this.index[e.key]=e.value},x.prototype.appendValue=function(e){this.items.push(e)},x.prototype.appendRecord=function(e){for(var t=e.iterator();!t.isEmpty();){var i=t.next();i.isField?this.appendField(i):this.appendValue(i)}},x.prototype.attr=function(e,t){return this.appendField(c(e,t)),this},x.prototype.slot=function(e,t){return this.appendField(h(e,t)),this},x.prototype.item=function(e){return this.appendValue(n(e)),this},x.prototype.state=function(){return new m(this.items,this.index)},j.prototype.appendField=function(e){null===this.items&&(this.items=[],this.index={},null!==this.value&&(this.items.push(this.value),this.value=null)),this.items.push(e),this.index[e.key]=e.value},j.prototype.appendValue=function(e){null!==this.items?this.items.push(e):null===this.value?this.value=e:(this.items=[],this.index={},this.items.push(this.value),this.value=null,this.items.push(e))},j.prototype.state=function(){return null!==this.value?this.value:null!==this.items?new m(this.items,this.index):K},g.prototype.isDone=function(){return!1},g.prototype.isEmpty=function(){return this.index>=this.string.length},g.prototype.head=function(){var e=this.string.charCodeAt(this.index);if(55295>=e||e>=57344)return e;if(56319>=e&&this.index+1<this.string.length){var t=this.string.charCodeAt(this.index+1);return t>=56320&&57343>=t?((1023&e)<<10|1023&t)+65536:65533}return 65533},g.prototype.step=function(){var e=this.string.charCodeAt(this.index);if(55295>=e||e>=57344)this.index+=1;else if(56319>=e&&this.index+1<this.string.length){var t=this.string.charCodeAt(this.index+1);this.index+=t>=56320&&57343>=t?2:1}else this.index+=1},g.Done={isDone:function(){return!0},isEmpty:function(){return!0},head:function(){throw"head of empty iterator"},step:function(){throw"empty iterator step"}},g.Done.prototype=Object.create(g.prototype),P.prototype.isCont=function(){return!0},P.prototype.isDone=function(){return!1},P.prototype.isError=function(){return!1},P.prototype.feed=function(){return this},P.prototype.run=function(e){for(var t=this;!e.isEmpty()&&t.isCont();)t=t.feed(e);return e.isEmpty()&&!e.isDone()&&t.isCont()&&(t=t.feed(g.Done)),t},P.Done=function(e){P.call(this),this.value=e},P.Done.prototype=Object.create(P.prototype),P.Done.prototype.constructor=P.Done,P.Done.prototype.isCont=function(){return!1},P.Done.prototype.isDone=function(){return!0},P.Done.prototype.feed=function(){return this},P.Done.prototype.state=function(){return this.value},P.Error=function(e){P.call(this),this.error=e},P.Error.prototype=Object.create(P.prototype),P.Error.prototype.constructor=P.Error,P.Error.prototype.isCont=function(){return!1},P.Error.prototype.isError=function(){return!0},P.Error.prototype.feed=function(){return this},P.Error.prototype.state=function(){throw this.error},P.unexpectedEOF=new P.Error("unexpected end of input"),k.prototype.append=function(e){if(e>=0&&55295>=e||e>=57344&&65535>=e)this.string+=String.fromCharCode(e);else if(e>=65536&&1114111>=e){var t=e-65536;this.string+=String.fromCharCode(55296|t>>>10,56320|1023&t)}else this.string+=String.fromCharCode(65533)},k.prototype.appendString=function(e){for(var t=new g(e);!t.isEmpty();)this.append(t.head()),t.step()},k.prototype.state=function(){return this.string},R.prototype.prepare=function(e){function t(e,t){var i=Math.max(e,t)-1;return i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i+1}if(this.aliased||e>this.buffer.length){var i=new Uint8Array(t(256,e));this.buffer&&i.set(this.buffer),this.buffer=i,this.aliased=!1}},R.prototype.appendByte=function(e){this.prepare(this.offset+1),this.buffer[this.offset]=e,this.offset+=1},R.prototype.decodeBase64Digit=function(e){return e>=65&&90>=e?e-65:e>=97&&122>=e?e-71:e>=48&&57>=e?e+4:43===e||45===e?62:47===e||95===e?63:void 0},R.prototype.decodeBase64Quantum=function(){var e=this.decodeBase64Digit(this.p),t=this.decodeBase64Digit(this.q);if(61!==this.r){var i=this.decodeBase64Digit(this.r);if(61!==this.s){var r=this.decodeBase64Digit(this.s);this.appendByte(e<<2|t>>>4),this.appendByte(t<<4|i>>>2),this.appendByte(i<<6|r)}else this.appendByte(e<<2|t>>>4),this.appendByte(t<<4|i>>>2)}else{if(61!==this.s)throw"incomplete base64 quantum";this.appendByte(e<<2|t>>>4)}},R.prototype.appendBase64Char=function(e){0===this.p?this.p=e:0===this.q?this.q=e:0===this.r?this.r=e:(this.s=e,this.decodeBase64Quantum(),this.s=0,this.r=0,this.q=0,this.p=0)},R.prototype.state=function(){if(this.buffer){if(this.buffer.length!==this.offset){var e=new Uint8Array(this.offset);e.set(this.buffer.subarray(0,this.offset)),this.buffer=e}}else this.buffer=new Uint8Array(0);return this.aliased=!0,this.buffer},V.prototype=Object.create(P.prototype),V.prototype.constructor=V,V.prototype.feed=function(e){for(var t=this.value;(!e.isEmpty()||e.isDone())&&t.isCont();)t=t.feed(e);if(t.isError())return t;if(t.isDone()){if(!e.isEmpty())return new P.Error({found:e.head()});if(e.isDone())return t}return new V(t)},M.prototype=Object.create(P.prototype),M.prototype.constructor=M,M.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.key,s=this.builder||new j;!e.isEmpty()||e.isDone();){if(1===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=2}if(2===i){for(n=n||new I;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&(t=e.head(),F(t));)e.step();if(e.isEmpty()){if(e.isDone())return s.appendValue(n.state()),new P.Done(s.state())}else 58===t?(e.step(),i=4):(s.appendValue(n.state()),n=null,i=6)}if(4===i){for(;!e.isEmpty()&&F(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return s.appendField(new D(n.state())),new P.Done(s.state())}else i=5}if(5===i){for(r=r||new I;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendField(new D(n.state(),r.state())),n=null,r=null,i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&(t=e.head(),F(t));)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else{if(44!==t&&59!==t&&!A(t))return new P.Done(s.state());e.step(),i=1}}}return new M(s,n,r,i)},U.prototype=Object.create(P.prototype),U.prototype.constructor=U,U.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.ident;if(1===i)if(e.isEmpty()||(t=e.head(),64!==t)){if(!e.isEmpty())return new P.Error({expected:"'@'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;if(2===i)if(n=n.feed(e),n.isDone())i=3;else if(n.isError())return n;if(3===i)if(e.isEmpty()||40!==e.head()){if(!e.isEmpty()||e.isDone())return new P.Done(new E(n.state()))}else e.step(),i=4;if(4===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(41===t)return e.step(),new P.Done(new E(n.state()));i=5}}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(!e.isEmpty())return 41===t?(e.step(),new P.Done(new E(n.state(),r.state()))):new P.Error({expected:"')'",found:t});if(e.isDone())return P.unexpectedEOF}return new U(n,r,i)},I.prototype=Object.create(P.prototype),I.prototype.constructor=I,I.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.field,s=this.builder;!e.isEmpty()||e.isDone();){if(1===i)if(e.isEmpty()){if(e.isDone())return new P.Done(s?s.state():K)}else if(t=e.head(),64===t)n=new U,i=2;else if(123===t)s=s||new x,r=new L(s),i=5;else if(91===t)s=s||new x,r=new _(s),i=5;else if(34===t)r=new T,i=4;else if(37===t)r=new G,i=4;else if(45===t||t>=48&&57>=t)r=new Q,i=4;else{if(!q(t))return new P.Done(s?s.state():K);r=new z,i=4}if(2===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new j,s.appendField(n.state()),n=null,i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&F(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=1}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s=s||new j,s.appendValue(r.state()),r=null,i=6;else if(r.isError())return r}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())r=null,i=6;else if(r.isError())return r}if(6===i){for(;!e.isEmpty()&&F(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else{if(64!==e.head())return new P.Done(s.state());n=new U,i=7}}if(7===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new j,s.appendField(n.state()),n=null,i=6;else if(n.isError())return n}}return new I(s,n,r,i)},N.prototype=Object.create(P.prototype),N.prototype.constructor=N,N.prototype.feed=function(e){for(var t=0,i=this.s,r=this.value,n=this.field,s=this.builder;!e.isEmpty()||e.isDone();){if(1===i)if(e.isEmpty()){if(e.isDone())return new P.Done(s?s.state():K)}else if(t=e.head(),64===t)n=new U,i=2;else if(123===t)s?(r=new L(s),i=5):(r=new L,i=4);else{if(91!==t)return new P.Done(s?s.state():K);s?(r=new _(s),i=5):(r=new _,i=4)}if(2===i){for(;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())s=s||new j,s.appendField(n.state()),n=null,i=3;else if(n.isError())return n}if(3===i){for(;!e.isEmpty()&&F(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return new P.Done(s.state())}else i=1}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())return s=s||new j,s.appendValue(r.state()),new P.Done(s.state());if(r.isError())return r}if(5===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())return new P.Done(s.state());if(r.isError())return r}}return new N(s,n,r,i)},L.prototype=Object.create(P.prototype),L.prototype.constructor=L,L.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.key,s=this.builder||new x;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),123!==t)return new P.Error({expected:"'{'",found:t});e.step(),i=2}for(;!e.isEmpty()||e.isDone();){if(2===i){for(;!e.isEmpty()&&(t=e.head(),C(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(125===t)return e.step(),new P.Done(s.state());i=3}}if(3===i){for(n=n||new I;(!e.isEmpty()||e.isDone())&&n.isCont();)n=n.feed(e);if(n.isDone())i=4;else if(n.isError())return n}if(4===i){for(;!e.isEmpty()&&(t=e.head(),F(t));)e.step();if(e.isEmpty()){if(e.isDone())return s.appendValue(n.state()),new P.Done(s.state())}else 58===t?(e.step(),i=5):(s.appendValue(n.state()),n=null,i=7)}if(5===i){for(;!e.isEmpty()&&F(e.head());)e.step();if(e.isEmpty()){if(e.isDone())return s.appendField(new D(n.state())),new P.Done(s.state())}else i=6}if(6===i){for(r=r||new I;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendField(new D(n.state(),r.state())),n=null,r=null,i=7;else if(r.isError())return r}if(7===i){for(;!e.isEmpty()&&(t=e.head(),F(t));)e.step();if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(44!==t&&59!==t&&!A(t))return 125===t?(e.step(),new P.Done(s.state())):new P.Error({expected:"'}', ';', ',', or newline",found:t});e.step(),i=2}}}return new L(s,n,r,i)},_.prototype=Object.create(P.prototype),_.prototype.constructor=_,_.prototype.feed=function(e){var t=0,i=this.s,r=this.value,n=this.text,s=this.builder;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),91!==t)return new P.Error({expected:"'['",found:t});e.step(),i=2}for(;!e.isEmpty()||e.isDone();){if(2===i){for(;!e.isEmpty()&&(t=e.head(),64!==t&&91!==t&&92!==t&&93!==t&&123!==t&&125!==t);)e.step(),n=n||new k,n.append(t);if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(93===t)return e.step(),s=s||new x,n&&s.appendValue(n.state()),new P.Done(s.state());64===t?(s=s||new x,n&&(s.appendValue(n.state()),n=null),r=new N,i=3):123===t?(s=s||new x,n&&(s.appendValue(n.state()),n=null),r=new L(s),i=4):91===t?(s=s||new x,n&&(s.appendValue(n.state()),n=null),r=new _(s),i=4):92===t?(e.step(),i=5):new P.Error({found:t})}}if(3===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())s.appendValue(r.state()),r=null,i=2;else if(r.isError())return r}if(4===i){for(;(!e.isEmpty()||e.isDone())&&r.isCont();)r=r.feed(e);if(r.isDone())r=null,i=2;else if(r.isError())return r}if(5===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),n=n||new k,34===t||47===t||64===t||91===t||92===t||93===t||123===t||125===t)e.step(),n.append(t),i=2;else if(98===t)e.step(),n.append(8),i=2;else if(102===t)e.step(),n.append(12),i=2;else if(110===t)e.step(),n.append(10),i=2;else if(114===t)e.step(),n.append(13),i=2;else{if(116!==t)return new P.Error({expected:"escape character",found:t});e.step(),n.append(9),i=2}}return new _(s,n,r,i)},T.prototype=Object.create(P.prototype),T.prototype.constructor=T,T.prototype.feed=function(e){var t=0,i=this.s,r=this.text;if(1===i)if(e.isEmpty()||(t=e.head(),34!==t)){if(!e.isEmpty())return new P.Error({expected:"'\"'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;for(;!e.isEmpty()||e.isDone();){if(2===i){for(r=r||new k;!e.isEmpty()&&(t=e.head(),34!==t&&92!==t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(34===t)return e.step(),new P.Done(r.state());92===t&&(e.step(),i=3)}}if(3===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),34===t||47===t||64===t||91===t||92===t||93===t||123===t||125===t)e.step(),r.append(t),i=2;else if(98===t)e.step(),r.append(8),i=2;else if(102===t)e.step(),r.append(12),i=2;else if(110===t)e.step(),r.append(10),i=2;else if(114===t)e.step(),r.append(13),i=2; | ||
else{if(116!==t)return new P.Error({expected:"escape character",found:t});e.step(),r.append(9),i=2}}return new T(r,i)},G.prototype=Object.create(P.prototype),G.prototype.constructor=G,G.prototype.feed=function(e){var t=0,i=this.s,r=this.data||new R;if(1===i)if(e.isEmpty()||(t=e.head(),37!==t)){if(!e.isEmpty())return new P.Error({expected:"'%'",found:t});if(e.isDone())return P.unexpectedEOF}else e.step(),i=2;for(;!e.isEmpty()||e.isDone();){if(2===i)if(!e.isEmpty()&&(t=e.head(),S(t)))e.step(),r.appendBase64Char(t),i=3;else if(!e.isEmpty()||e.isDone())return new P.Done(r.state());if(3===i)if(!e.isEmpty()&&(t=e.head(),S(t)))e.step(),r.appendBase64Char(t),i=4;else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}if(4===i)if(!e.isEmpty()&&(t=e.head(),S(t)||61===t))e.step(),r.appendBase64Char(t),i=61!==t?5:6;else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}if(5===i)if(!e.isEmpty()&&(t=e.head(),S(t)||61===t)){if(e.step(),r.appendBase64Char(t),61===t)return new P.Done(r.state());i=2}else{if(!e.isEmpty())return new P.Error({expected:"base64 digit",found:t});if(e.isDone())return P.unexpectedEOF}else if(6===i){if(!e.isEmpty()&&(t=e.head(),61===t))return e.step(),r.appendBase64Char(t),new P.Done(r.state());if(!e.isEmpty())return new P.Error({expected:"'='",found:t});if(e.isDone())return P.unexpectedEOF}}return new G(r,i)},Q.prototype=Object.create(P.prototype),Q.prototype.constructor=Q,Q.prototype.feed=function(e){var t=0,i=this.s,r=this.builder||new k;if(1===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else t=e.head(),45===t&&(e.step(),r.append(t)),i=2;if(2===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else if(t=e.head(),48===t)e.step(),r.append(t),i=4;else{if(!(t>=49&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=3}if(3===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else i=4}if(4===i)if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else if(t=e.head(),46===t)e.step(),r.append(t),i=5;else{if(69!==t&&101!==t)return new P.Done(Number(r.state()));e.step(),r.append(t),i=8}if(5===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),!(t>=48&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=6}if(6===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(e.isEmpty()){if(e.isDone())return new P.Done(Number(r.state()))}else i=7}if(7===i){if(t=e.head(),69!==t&&101!==t)return new P.Done(Number(r.state()));e.step(),r.append(t),i=8}if(8===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else t=e.head(),(43===t||45===t)&&(e.step(),r.append(t)),i=9;if(9===i)if(e.isEmpty()){if(e.isDone())return P.unexpectedEOF}else{if(t=e.head(),!(t>=48&&57>=t))return new P.Error({expected:"digit",found:t});e.step(),r.append(t),i=10}if(10===i){for(;!e.isEmpty()&&(t=e.head(),t>=48&&57>=t);)e.step(),r.append(t);if(!e.isEmpty()||e.isDone())return new P.Done(Number(r.state()))}return new Q(r,i)},z.prototype=Object.create(P.prototype),z.prototype.constructor=z,z.prototype.feed=function(e){var t=0,i=this.s,r=this.builder;if(1===i)if(!e.isEmpty()&&(t=e.head(),q(t)))r=r||new k,e.step(),r.append(t),i=2;else{if(!e.isEmpty())return new P.Error({expected:"identitifer",found:t});if(e.isDone())return P.unexpectedEOF}if(2===i){for(;!e.isEmpty()&&(t=e.head(),B(t));)e.step(),r.append(t);if(!e.isEmpty()||e.isDone()){var n=r.state();return"true"===n?n=!0:"false"===n&&(n=!1),new P.Done(n)}}return new z(r,i)},H.prototype.writeValue=function(e,t){e.isRecord?this.writeRecord(e,t):"string"==typeof e?this.writeText(e,t):"number"==typeof e?this.writeNumber(e):"boolean"==typeof e?this.writeBool(e):e instanceof Uint8Array&&this.writeData(e)},H.prototype.writeAttr=function(e){this.builder.append(64),this.writeIdent(e.key),e.value.isExtant||(this.builder.append(40),this.writeBlock(e.value),this.builder.append(41))},H.prototype.writeItem=function(e){e.isField?(this.writeValue(e.key),this.builder.append(58),e.value.isExtant||this.writeValue(e.value)):this.writeValue(e)},H.prototype.writeBlock=function(e){if(e.isRecord)if(e.isMarkup())this.writeMarkup(e);else if(e.hasAttrs())this.writeRecord(e);else{var t=e.iterator();if(!t.isEmpty())for(this.writeItem(t.next());!t.isEmpty();)this.builder.append(44),this.writeItem(t.next())}else this.writeValue(e)},H.prototype.writeRecord=function(e,t){if(e.isMarkup())this.writeMarkup(e);else{for(var i,r=e.iterator(),n=!1;!r.isEmpty()&&(i=r.head(),i.isAttr);)this.writeAttr(i),r.step(),n=!0;if(r.isEmpty())n||(this.builder.append(123),this.builder.append(125));else{if(r.step(),n&&r.isEmpty())t?i.isRecord||"string"==typeof i?this.writeValue(i,t):(this.builder.append(123),this.writeItem(i),this.builder.append(125)):i.isRecord||i.isSlot?(this.builder.append(123),this.writeItem(i),this.builder.append(125)):(this.builder.append(32),this.writeValue(i));else if(!r.isEmpty()&&r.isAllAttrs())i.isRecord||i.isSlot?(this.builder.append(123),this.writeItem(i),this.builder.append(125)):(n&&this.builder.append(32),this.writeValue(i));else{for(this.builder.append(123),this.writeItem(i);!r.isEmpty()&&(i=r.head(),!i.isAttr||!r.isAllAttrs);)this.builder.append(44),this.writeItem(i),r.step();this.builder.append(125)}for(;!r.isEmpty();)this.writeAttr(r.next())}}},H.prototype.writeMarkup=function(e){for(var t,i=e.iterator(),r=!1;!i.isEmpty()&&(t=i.head(),t.isAttr);)this.writeAttr(t),i.step(),r=!0;for(this.builder.append(91);!i.isEmpty();){if(t=i.head(),"string"==typeof t)for(var n=new g(t);!n.isEmpty();){var s=n.head();switch(s){case 64:case 91:case 92:case 93:case 123:case 125:this.builder.append(92),this.builder.append(s);break;default:this.builder.append(s)}n.step()}else t.isRecord?this.writeRecord(t,!0):(this.builder.append(123),this.writeItem(t),this.builder.append(125));i.step()}this.builder.append(93)},H.prototype.writeText=function(e,t){function i(){var t=new g(e);if(t.isEmpty()||!q(t.head()))return!1;for(t.step();!t.isEmpty()&&B(t.head());)t.step();return t.isEmpty()}t?this.writeTextMarkup(e):i()?this.writeIdent(e):this.writeString(e)},H.prototype.writeString=function(e){var t=new g(e);for(this.builder.append(34);!t.isEmpty();){var i=t.head();switch(i){case 34:case 92:this.builder.append(92),this.builder.append(i);break;case 8:this.builder.append(92),this.builder.append(98);break;case 12:this.builder.append(92),this.builder.append(102);break;case 10:this.builder.append(92),this.builder.append(110);break;case 13:this.builder.append(92),this.builder.append(114);break;case 9:this.builder.append(92),this.builder.append(116);break;default:this.builder.append(i)}t.step()}this.builder.append(34)},H.prototype.writeIdent=function(e){this.builder.appendString(e)},H.prototype.writeTextMarkup=function(e){var t=new g(e);for(this.builder.append(91);!t.isEmpty();){var i=t.head();switch(i){case 64:case 91:case 92:case 93:case 123:case 125:this.builder.append(92),this.builder.append(i);break;default:this.builder.append(i)}t.step()}this.builder.append(93)},H.prototype.writeNumber=function(e){this.builder.appendString(e.toString())},H.prototype.writeBool=function(e){this.builder.appendString(e.toString())},H.prototype.writeData=function(e){function t(e){return e>=0&&26>e?e+65:e>=26&&52>e?e+71:e>=52&&62>e?e-4:62===e?43:63===e?47:void 0}this.builder.append(37);for(var i,r,n,s=0,o=e.length;o>s+2;)i=e[s],r=e[s+1],n=e[s+2],this.builder.append(t(i>>>2)),this.builder.append(t(63&(i<<4|r>>>4))),this.builder.append(t(63&(r<<2|n>>>6))),this.builder.append(t(63&n)),s+=3;o>s+1?(i=e[s],r=e[s+1],this.builder.append(t(i>>>2)),this.builder.append(t(63&(i<<4|r>>>4))),this.builder.append(t(r<<2&63)),this.builder.append(61),s+=2):o>s&&(i=e[s],this.builder.append(t(i>>>2)),this.builder.append(t(i<<4&63)),this.builder.append(61),this.builder.append(61),s+=1)},H.prototype.state=function(){return this.builder.state()},t.exports=function(){return r.apply(null,arguments)},i=t.exports,i.parse=p,i.stringify=a,i.objectify=u,i.Record=m,i.Field=w,i.Attr=E,i.Slot=D,i.attr=c,i.slot=h,i.base64=d,i.extant=J,i.absent=K,i.empty=y,i.builder=b,i.compare=v},{}]},{},[1])(1)}); | ||
//# sourceMappingURL=swim-proto.min.js.map |
Sorry, the diff of this file is not supported yet
216049
1133
180
+ Addedrecon-js@0.0.5(transitive)
- Removedrecon-js@0.0.4(transitive)
Updatedrecon-js@^0.0.5