node-red-contrib-web-worldmap 2.27.2 → 2.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '39 16 * * 6'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'javascript' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v2
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
- - v2.27.2 - Try to handle greatcircles crossing antimeridian
3
+ - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
4
+ - v2.28.0 - Better Handling of sidc icons in geojson
5
+ - v2.27.3 - Try to handle greatcircles crossing antimeridian
4
6
  - v2.27.1 - Reload existing markers for late joiners
5
7
  - v2.26.1 - Add QTH/Maidenhead option also
6
8
  - v2.26.0 - Add UTM and MGRS to coordinate display options.
package/README.md CHANGED
@@ -11,7 +11,9 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
- - v2.27.2 - Try to handle greatcircles crossing antimeridian
14
+ - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
15
+ - v2.28.0 - Better Handling of sidc icons in geojson
16
+ - v2.27.3 - Try to handle greatcircles crossing antimeridian
15
17
  - v2.27.1 - Reload existing markers for late joiners
16
18
  - v2.26.1 - Add QTH/Maidenhead option also
17
19
  - v2.26.0 - Add UTM and MGRS to coordinate display options.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "2.27.2",
3
+ "version": "2.28.1",
4
4
  "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
5
5
  "dependencies": {
6
6
  "@turf/bezier-spline": "~6.5.0",
@@ -18,238 +18,247 @@
18
18
  <script>
19
19
 
20
20
  // TO MAKE THE MAP APPEAR YOU MUST ADD YOUR ACCESS TOKEN FROM https://account.mapbox.com
21
- // This needs to be set as an environment variable MAPBOXGL_TOKEN available to the Node-RED session on your server
21
+ // This can also be set as an environment variable MAPBOXGL_TOKEN available to the Node-RED session on your server
22
22
  mapboxgl.accessToken = '';
23
23
 
24
- var people = {};
24
+ // You can also replace this with a custom style if you like.
25
25
  var mbstyle = 'mapbox://styles/mapbox/streets-v10';
26
26
  // var mbstyle = 'mapbox://styles/mapbox/light-v10';
27
27
 
28
- fetch('/-worldmap3d-key')
29
- .then(response => response.json())
30
- .then(data => {
31
- mapboxgl.accessToken = data.key;
32
- if (mapboxgl.accessToken === "") {
33
- alert("To make the map appear you must add your Access Token from https://account.mapbox.com by setting the MAPBOXGL_TOKEN environment variable on your server.");
34
- return;
28
+ var do3dMap = function() {
29
+ var people = {};
30
+ var map = new mapboxgl.Map({
31
+ container: 'map',
32
+ style: mbstyle,
33
+ center: [-1.3971, 51.0259],
34
+ zoom: 16,
35
+ pitch: 40,
36
+ bearing: 20,
37
+ attributionControl: true
38
+ });
39
+
40
+ map.on('load', function() {
41
+ var layers = map.getStyle().layers;
42
+ var firstSymbolId;
43
+ for (var i = 0; i < layers.length; i++) {
44
+ if (layers[i].type === 'symbol') {
45
+ firstSymbolId = layers[i].id;
46
+ break;
47
+ }
35
48
  }
36
49
 
37
- var map = new mapboxgl.Map({
38
- container: 'map',
39
- style: mbstyle,
40
- center: [-1.3971, 51.0259],
41
- zoom: 16,
42
- pitch: 40,
43
- bearing: 20,
44
- attributionControl: true
45
- });
50
+ /// Add the base 3D buildings layer
51
+ map.addLayer({
52
+ 'id': '3d-buildings',
53
+ 'source': 'composite',
54
+ 'source-layer': 'building',
55
+ 'filter': ['==', 'extrude', 'true'],
56
+ 'type': 'fill-extrusion',
57
+ 'minzoom': 15,
58
+ 'paint': {
59
+ 'fill-extrusion-color': '#ddd',
60
+ 'fill-extrusion-height': [
61
+ "interpolate", ["linear"], ["zoom"],
62
+ 15, 0, 15.05, ["get", "height"]
63
+ ],
64
+ 'fill-extrusion-base': [
65
+ "interpolate", ["linear"], ["zoom"],
66
+ 15, 0, 15.05, ["get", "min_height"]
67
+ ],
68
+ 'fill-extrusion-opacity': .4
69
+ }
70
+ }, firstSymbolId);
46
71
 
47
- map.on('load', function() {
48
- var layers = map.getStyle().layers;
49
- var firstSymbolId;
50
- for (var i = 0; i < layers.length; i++) {
51
- if (layers[i].type === 'symbol') {
52
- firstSymbolId = layers[i].id;
53
- break;
72
+ // ---- Connect to the Node-RED Events Websocket --------------------
73
+
74
+ var connect = function() {
75
+ ws = new SockJS(location.pathname.split("index")[0] + 'socket');
76
+ ws.onopen = function() {
77
+ console.log("CONNECTED");
78
+ // if (!inIframe) {
79
+ // document.getElementById("foot").innerHTML = "<font color='#494'>"+pagefoot+"</font>";
80
+ // }
81
+ ws.send(JSON.stringify({action:"connected"}));
82
+ };
83
+ ws.onclose = function() {
84
+ console.log("DISCONNECTED");
85
+ // if (!inIframe) {
86
+ // document.getElementById("foot").innerHTML = "<font color='#900'>"+pagefoot+"</font>";
87
+ // }
88
+ setTimeout(function() { connect(); }, 2500);
89
+ };
90
+ ws.onmessage = function(e) {
91
+ var data = JSON.parse(e.data);
92
+ //console.log("GOT",data);
93
+ if (Array.isArray(data)) {
94
+ //console.log("ARRAY");
95
+ for (var prop in data) {
96
+ if (data[prop].command) { doCommand(data[prop].command); delete data[prop].command; }
97
+ if (data[prop].hasOwnProperty("name")) { setMarker(data[prop]); }
98
+ else { console.log("SKIP A",data[prop]); }
99
+ }
100
+ }
101
+ else {
102
+ if (data.command) { doCommand(data.command); delete data.command; }
103
+ if (data.hasOwnProperty("name")) { setMarker(data); }
104
+ else { console.log("SKIP",data); }
54
105
  }
106
+ };
107
+ }
108
+ console.log("CONNECT TO",location.pathname + 'socket');
109
+ connect();
110
+
111
+ var doCommand = function(c) {
112
+ console.log("CMD",c);
113
+ // Add our own overlay geojson layer if necessary
114
+ if (c.hasOwnProperty("map") && c.map.hasOwnProperty("geojson") && c.map.hasOwnProperty("overlay")) {
115
+ addGeo(c.map.overlay,c.map.geojson);
55
116
  }
117
+ var clat,clon;
118
+ if (c.hasOwnProperty("lat")) { clat = c.lat; }
119
+ if (c.hasOwnProperty("lon")) { clon = c.lon; }
120
+ if (clat && clon) { map.setCenter([clon,clat]); }
121
+ if (c.hasOwnProperty("zoom")) { map.setZoom(c.zoom); }
122
+ if (c.hasOwnProperty("pitch")) { map.setPitch(c.pitch); }
123
+ if (c.hasOwnProperty("bearing")) { map.setBearing(c.bearing); }
124
+ }
56
125
 
57
- /// Add the base 3D buildings layer
126
+ var addGeo = function(o,g) {
58
127
  map.addLayer({
59
- 'id': '3d-buildings',
60
- 'source': 'composite',
61
- 'source-layer': 'building',
62
- 'filter': ['==', 'extrude', 'true'],
128
+ 'id': o,
63
129
  'type': 'fill-extrusion',
64
- 'minzoom': 15,
130
+ 'source': {
131
+ 'type': 'geojson',
132
+ 'data': g
133
+ },
65
134
  'paint': {
66
- 'fill-extrusion-color': '#ddd',
67
- 'fill-extrusion-height': [
68
- "interpolate", ["linear"], ["zoom"],
69
- 15, 0, 15.05, ["get", "height"]
70
- ],
71
- 'fill-extrusion-base': [
72
- "interpolate", ["linear"], ["zoom"],
73
- 15, 0, 15.05, ["get", "min_height"]
74
- ],
75
- 'fill-extrusion-opacity': .4
135
+ // https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions
136
+ 'fill-extrusion-color': ['get', 'color'],
137
+ 'fill-extrusion-height': ['get', 'height'],
138
+ 'fill-extrusion-base': ['get', 'base_height'],
139
+ 'fill-extrusion-opacity': 0.5
76
140
  }
77
- }, firstSymbolId);
78
-
79
- // ---- Connect to the Node-RED Events Websocket --------------------
80
-
81
- var connect = function() {
82
- ws = new SockJS(location.pathname.split("index")[0] + 'socket');
83
- ws.onopen = function() {
84
- console.log("CONNECTED");
85
- // if (!inIframe) {
86
- // document.getElementById("foot").innerHTML = "<font color='#494'>"+pagefoot+"</font>";
87
- // }
88
- ws.send(JSON.stringify({action:"connected"}));
89
- };
90
- ws.onclose = function() {
91
- console.log("DISCONNECTED");
92
- // if (!inIframe) {
93
- // document.getElementById("foot").innerHTML = "<font color='#900'>"+pagefoot+"</font>";
94
- // }
95
- setTimeout(function() { connect(); }, 2500);
96
- };
97
- ws.onmessage = function(e) {
98
- var data = JSON.parse(e.data);
99
- //console.log("GOT",data);
100
- if (Array.isArray(data)) {
101
- //console.log("ARRAY");
102
- for (var prop in data) {
103
- if (data[prop].command) { doCommand(data[prop].command); delete data[prop].command; }
104
- if (data[prop].hasOwnProperty("name")) { setMarker(data[prop]); }
105
- else { console.log("SKIP A",data[prop]); }
106
- }
107
- }
108
- else {
109
- if (data.command) { doCommand(data.command); delete data.command; }
110
- if (data.hasOwnProperty("name")) { setMarker(data); }
111
- else { console.log("SKIP",data); }
112
- }
113
- };
114
- }
115
- console.log("CONNECT TO",location.pathname + 'socket');
116
- connect();
141
+ });
142
+ }
117
143
 
118
- var doCommand = function(c) {
119
- console.log("CMD",c);
120
- // Add our own overlay geojson layer if necessary
121
- if (c.hasOwnProperty("map") && c.map.hasOwnProperty("geojson") && c.map.hasOwnProperty("overlay")) {
122
- addGeo(c.map.overlay,c.map.geojson);
123
- }
124
- var clat,clon;
125
- if (c.hasOwnProperty("lat")) { clat = c.lat; }
126
- if (c.hasOwnProperty("lon")) { clon = c.lon; }
127
- if (clat && clon) { map.setCenter([clon,clat]); }
128
- if (c.hasOwnProperty("zoom")) { map.setZoom(c.zoom); }
129
- if (c.hasOwnProperty("pitch")) { map.setPitch(c.pitch); }
130
- if (c.hasOwnProperty("bearing")) { map.setBearing(c.bearing); }
144
+ var setMarker = function(d) {
145
+ if (d.hasOwnProperty("area")) { return; } // ignore areas for now.
146
+ console.log("DATA",d);
147
+ if (people.hasOwnProperty(d.name)) {
148
+ map.getSource(d.name).setData(getPoints(d)); // Just update existing marker
131
149
  }
132
-
133
- var addGeo = function(o,g) {
150
+ else { // it's a new thing
151
+ people[d.name] = d;
134
152
  map.addLayer({
135
- 'id': o,
153
+ 'id': d.name,
136
154
  'type': 'fill-extrusion',
137
155
  'source': {
138
156
  'type': 'geojson',
139
- 'data': g
157
+ 'data': getPoints(d)
140
158
  },
141
159
  'paint': {
142
160
  // https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions
143
161
  'fill-extrusion-color': ['get', 'color'],
144
162
  'fill-extrusion-height': ['get', 'height'],
145
163
  'fill-extrusion-base': ['get', 'base_height'],
146
- 'fill-extrusion-opacity': 0.5
164
+ 'fill-extrusion-opacity': 1
147
165
  }
148
- });
166
+ },firstSymbolId);
149
167
  }
168
+ }
150
169
 
151
- var setMarker = function(d) {
152
- if (d.hasOwnProperty("area")) { return; } // ignore areas for now.
153
- console.log("DATA",d);
154
- if (people.hasOwnProperty(d.name)) {
155
- map.getSource(d.name).setData(getPoints(d)); // Just update existing marker
156
- }
157
- else { // it's a new thing
158
- people[d.name] = d;
159
- map.addLayer({
160
- 'id': d.name,
161
- 'type': 'fill-extrusion',
162
- 'source': {
163
- 'type': 'geojson',
164
- 'data': getPoints(d)
165
- },
166
- 'paint': {
167
- // https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions
168
- 'fill-extrusion-color': ['get', 'color'],
169
- 'fill-extrusion-height': ['get', 'height'],
170
- 'fill-extrusion-base': ['get', 'base_height'],
171
- 'fill-extrusion-opacity': 1
172
- }
173
- },firstSymbolId);
174
- }
175
- }
170
+ var lookupColor = function(s) {
171
+ var c = s.charAt(1);
172
+ if (c === "F") { return "#79DFFF"; }
173
+ if (c === "N") { return "#A4FFA3"; }
174
+ if (c === "U") { return "#FFFF78"; }
175
+ if (c === "H") { return "#FF7779"; }
176
+ if (c === "S") { return "#FF7779"; }
177
+ }
176
178
 
177
- var lookupColor = function(s) {
178
- var c = s.charAt(1);
179
- if (c === "F") { return "#79DFFF"; }
180
- if (c === "N") { return "#A4FFA3"; }
181
- if (c === "U") { return "#FFFF78"; }
182
- if (c === "H") { return "#FF7779"; }
183
- if (c === "S") { return "#FF7779"; }
179
+ // create the points for the marker and return the geojson
180
+ var getPoints = function(p) {
181
+ var fac = 0.000007; // basic size for bock icon in degrees....
182
+ var thing = "";
183
+ if (p.hasOwnProperty("icon")) {
184
+ if (p.icon.indexOf("male") !== -1) { thing = "person"; }
184
185
  }
185
-
186
- // create the points for the marker and return the geojson
187
- var getPoints = function(p) {
188
- var fac = 0.000007; // basic size for bock icon in degrees....
189
- var thing = "";
190
- if (p.hasOwnProperty("icon")) {
191
- if (p.icon.indexOf("male") !== -1) { thing = "person"; }
192
- }
193
- p.SDIC = p.SIDC || p.sidc;
194
- if (p.hasOwnProperty("SIDC")) {
195
- if (p.SIDC.indexOf("SFGPU") !== -1) { thing = "person"; }
196
- if (p.SIDC.indexOf("SFGPUC") !== -1) { thing = "block"; }
197
- if (p.SIDC.indexOf("GPEV") !== -1) { thing = "block"; }
198
- p.iconColor = lookupColor(p.SIDC);
199
- }
200
- var t = p.type || thing;
201
- var base = p.height || 0;
202
- if (t === "person") { tall = 3; } // person slightly tall and thin
203
- else if (t === "bar") { base = 0; tall = p.height; } // bar from ground to height
204
- else if (t === "block") { fac = fac * 4; tall = 5; } // block large and cube
205
- else { tall = 2; fac = fac * 2; } // else small cube
206
- //console.log({p},{t},{fac},{base},{tall});
207
- var sin = 1;
208
- var cos = 0;
209
- p.hdg = Number(p.hdg || p.heading);
210
- if (p.hasOwnProperty("hdg") && !isNaN(p.hdg)) {
211
- sin = Math.sin((90 - p.hdg) * Math.PI / 180);
212
- cos = Math.cos((90 - p.hdg) * Math.PI / 180);
213
- }
214
- var dx = 1 * cos - 1 * sin;
215
- var dy = 1 * sin + 1 * cos;
216
- var d = {
217
- "type": "Feature",
218
- "properties": {
219
- "name": p.name,
220
- "type": t,
221
- "color": p.iconColor || "#910000",
222
- "height": base + tall,
223
- "base_height": base
224
- },
225
- "geometry": {
226
- "type": "Polygon",
227
- "coordinates": [
228
- [
229
- [ p.lon + (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dy) ],
230
- [ p.lon - (fac * dy ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dx) ],
231
- [ p.lon - (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat - (fac * dy) ],
232
- [ p.lon + (fac * dy ) / Math.cos( Math.PI / 180 * p.lat ), p.lat - (fac * dx) ],
233
- [ p.lon + (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dy) ],
234
- ]
186
+ p.SDIC = p.SIDC || p.sidc;
187
+ if (p.hasOwnProperty("SIDC")) {
188
+ if (p.SIDC.indexOf("SFGPU") !== -1) { thing = "person"; }
189
+ if (p.SIDC.indexOf("SFGPUC") !== -1) { thing = "block"; }
190
+ if (p.SIDC.indexOf("GPEV") !== -1) { thing = "block"; }
191
+ p.iconColor = lookupColor(p.SIDC);
192
+ }
193
+ var t = p.type || thing;
194
+ var base = p.height || 0;
195
+ if (t === "person") { tall = 3; } // person slightly tall and thin
196
+ else if (t === "bar") { base = 0; tall = p.height; } // bar from ground to height
197
+ else if (t === "block") { fac = fac * 4; tall = 5; } // block large and cube
198
+ else { tall = 2; fac = fac * 2; } // else small cube
199
+ //console.log({p},{t},{fac},{base},{tall});
200
+ var sin = 1;
201
+ var cos = 0;
202
+ p.hdg = Number(p.hdg || p.heading);
203
+ if (p.hasOwnProperty("hdg") && !isNaN(p.hdg)) {
204
+ sin = Math.sin((90 - p.hdg) * Math.PI / 180);
205
+ cos = Math.cos((90 - p.hdg) * Math.PI / 180);
206
+ }
207
+ var dx = 1 * cos - 1 * sin;
208
+ var dy = 1 * sin + 1 * cos;
209
+ var d = {
210
+ "type": "Feature",
211
+ "properties": {
212
+ "name": p.name,
213
+ "type": t,
214
+ "color": p.iconColor || "#910000",
215
+ "height": base + tall,
216
+ "base_height": base
217
+ },
218
+ "geometry": {
219
+ "type": "Polygon",
220
+ "coordinates": [
221
+ [
222
+ [ p.lon + (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dy) ],
223
+ [ p.lon - (fac * dy ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dx) ],
224
+ [ p.lon - (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat - (fac * dy) ],
225
+ [ p.lon + (fac * dy ) / Math.cos( Math.PI / 180 * p.lat ), p.lat - (fac * dx) ],
226
+ [ p.lon + (fac * dx ) / Math.cos( Math.PI / 180 * p.lat ), p.lat + (fac * dy) ],
235
227
  ]
236
- }
228
+ ]
237
229
  }
238
- return d;
239
230
  }
231
+ return d;
232
+ }
240
233
 
241
- document.addEventListener ("keydown", function (ev) {
242
- if (ev.ctrlKey && ev.altKey && ev.code === "Digit3") {
243
- ws.close();
244
- //window.onbeforeunload = null;
245
- window.location.href = "index.html";
246
- }
247
- });
234
+ document.addEventListener ("keydown", function (ev) {
235
+ if (ev.ctrlKey && ev.altKey && ev.code === "Digit3") {
236
+ ws.close();
237
+ //window.onbeforeunload = null;
238
+ window.location.href = "index.html";
239
+ }
240
+ });
241
+
242
+ });
248
243
 
249
- });
244
+ }
250
245
 
251
- })
252
- .catch(error => { console.log("Unable to fetch MAPBOXGL_TOKEN.",error)} );
246
+ if (mapboxgl.accessToken !== '') {
247
+ do3dMap();
248
+ }
249
+ else {
250
+ fetch('/-worldmap3d-key', { credentials:'same-origin' })
251
+ .then(response => response.json())
252
+ .then(data => {
253
+ mapboxgl.accessToken = data.key;
254
+ if (mapboxgl.accessToken === "") {
255
+ alert("To make the map appear you must add your Access Token from https://account.mapbox.com by setting the MAPBOXGL_TOKEN environment variable on your server.");
256
+ return;
257
+ }
258
+ do3dMap();
259
+ })
260
+ .catch(error => { console.log("Unable to fetch MAPBOXGL_TOKEN.",error)} );
261
+ }
253
262
 
254
263
  </script>
255
264
  </body>
@@ -1,3 +1,3 @@
1
- /* sockjs-client v1.5.2 | http://sockjs.org | MIT license */
2
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SockJS=t()}}(function(){return function i(s,a,l){function u(e,t){if(!a[e]){if(!s[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(c)return c(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(t){return u(s[e][1][t]||t)},o,o.exports,i,s,a,l)}return a[e].exports}for(var c="function"==typeof require&&require,t=0;t<l.length;t++)u(l[t]);return u}({1:[function(n,r,t){(function(t){"use strict";var e=n("./transport-list");r.exports=n("./main")(e),"_sockjs_onload"in t&&setTimeout(t._sockjs_onload,1)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./main":14,"./transport-list":16}],2:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./event");function i(){o.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}r(i,o),e.exports=i},{"./event":4,"inherits":54}],3:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./eventtarget");function i(){o.call(this)}r(i,o),i.prototype.removeAllListeners=function(t){t?delete this._listeners[t]:this._listeners={}},i.prototype.once=function(e,n){var r=this,o=!1;this.on(e,function t(){r.removeListener(e,t),o||(o=!0,n.apply(this,arguments))})},i.prototype.emit=function(){var t=arguments[0],e=this._listeners[t];if(e){for(var n=arguments.length,r=new Array(n-1),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0;i<e.length;i++)e[i].apply(this,r)}},i.prototype.on=i.prototype.addListener=o.prototype.addEventListener,i.prototype.removeListener=o.prototype.removeEventListener,e.exports.EventEmitter=i},{"./eventtarget":5,"inherits":54}],4:[function(t,e,n){"use strict";function r(t){this.type=t}r.prototype.initEvent=function(t,e,n){return this.type=t,this.bubbles=e,this.cancelable=n,this.timeStamp=+new Date,this},r.prototype.stopPropagation=function(){},r.prototype.preventDefault=function(){},r.CAPTURING_PHASE=1,r.AT_TARGET=2,r.BUBBLING_PHASE=3,e.exports=r},{}],5:[function(t,e,n){"use strict";function r(){this._listeners={}}r.prototype.addEventListener=function(t,e){t in this._listeners||(this._listeners[t]=[]);var n=this._listeners[t];-1===n.indexOf(e)&&(n=n.concat([e])),this._listeners[t]=n},r.prototype.removeEventListener=function(t,e){var n=this._listeners[t];if(n){var r=n.indexOf(e);-1===r||(1<n.length?this._listeners[t]=n.slice(0,r).concat(n.slice(r+1)):delete this._listeners[t])}},r.prototype.dispatchEvent=function(){var t=arguments[0],e=t.type,n=1===arguments.length?[t]:Array.apply(null,arguments);if(this["on"+e]&&this["on"+e].apply(this,n),e in this._listeners)for(var r=this._listeners[e],o=0;o<r.length;o++)r[o].apply(this,n)},e.exports=r},{}],6:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./event");function i(t){o.call(this),this.initEvent("message",!1,!1),this.data=t}r(i,o),e.exports=i},{"./event":4,"inherits":54}],7:[function(t,e,n){"use strict";var r=t("json3"),o=t("./utils/iframe");function i(t){(this._transport=t).on("message",this._transportMessage.bind(this)),t.on("close",this._transportClose.bind(this))}i.prototype._transportClose=function(t,e){o.postMessage("c",r.stringify([t,e]))},i.prototype._transportMessage=function(t){o.postMessage("t",t)},i.prototype._send=function(t){this._transport.send(t)},i.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},e.exports=i},{"./utils/iframe":47,"json3":55}],8:[function(t,e,n){"use strict";var f=t("./utils/url"),r=t("./utils/event"),h=t("json3"),d=t("./facade"),o=t("./info-iframe-receiver"),p=t("./utils/iframe"),m=t("./location"),v=function(){};e.exports=function(l,t){var u,c={};t.forEach(function(t){t.facadeTransport&&(c[t.facadeTransport.transportName]=t.facadeTransport)}),c[o.transportName]=o,l.bootstrap_iframe=function(){var a;p.currentWindowId=m.hash.slice(1);r.attachEvent("message",function(e){if(e.source===parent&&(void 0===u&&(u=e.origin),e.origin===u)){var n;try{n=h.parse(e.data)}catch(t){return void v("bad json",e.data)}if(n.windowId===p.currentWindowId)switch(n.type){case"s":var t;try{t=h.parse(n.data)}catch(t){v("bad json",n.data);break}var r=t[0],o=t[1],i=t[2],s=t[3];if(v(r,o,i,s),r!==l.version)throw new Error('Incompatible SockJS! Main site uses: "'+r+'", the iframe: "'+l.version+'".');if(!f.isOriginEqual(i,m.href)||!f.isOriginEqual(s,m.href))throw new Error("Can't connect to different domain from within an iframe. ("+m.href+", "+i+", "+s+")");a=new d(new c[o](i,s));break;case"m":a._send(n.data);break;case"c":a&&a._close(),a=null}}}),p.postMessage("s")}}},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,"debug":void 0,"json3":55}],9:[function(t,e,n){"use strict";var r=t("events").EventEmitter,o=t("inherits"),s=t("json3"),a=t("./utils/object"),l=function(){};function i(t,e){r.call(this);var o=this,i=+new Date;this.xo=new e("GET",t),this.xo.once("finish",function(t,e){var n,r;if(200===t){if(r=+new Date-i,e)try{n=s.parse(e)}catch(t){l("bad json",e)}a.isObject(n)||(n={})}o.emit("finish",n,r),o.removeAllListeners()})}o(i,r),i.prototype.close=function(){this.removeAllListeners(),this.xo.close()},e.exports=i},{"./utils/object":49,"debug":void 0,"events":3,"inherits":54,"json3":55}],10:[function(t,e,n){"use strict";var r=t("inherits"),o=t("events").EventEmitter,i=t("json3"),s=t("./transport/sender/xhr-local"),a=t("./info-ajax");function l(t){var n=this;o.call(this),this.ir=new a(t,s),this.ir.once("finish",function(t,e){n.ir=null,n.emit("message",i.stringify([t,e]))})}r(l,o),l.transportName="iframe-info-receiver",l.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},e.exports=l},{"./info-ajax":9,"./transport/sender/xhr-local":37,"events":3,"inherits":54,"json3":55}],11:[function(n,o,t){(function(r){"use strict";var i=n("events").EventEmitter,t=n("inherits"),s=n("json3"),a=n("./utils/event"),l=n("./transport/iframe"),u=n("./info-iframe-receiver"),c=function(){};function e(e,n){var o=this;i.call(this);function t(){var t=o.ifr=new l(u.transportName,n,e);t.once("message",function(e){if(e){var t;try{t=s.parse(e)}catch(t){return c("bad json",e),o.emit("finish"),void o.close()}var n=t[0],r=t[1];o.emit("finish",n,r)}o.close()}),t.once("close",function(){o.emit("finish"),o.close()})}r.document.body?t():a.attachEvent("load",t)}t(e,i),e.enabled=function(){return l.enabled()},e.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},o.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,"debug":void 0,"events":3,"inherits":54,"json3":55}],12:[function(t,e,n){"use strict";var r=t("events").EventEmitter,o=t("inherits"),i=t("./utils/url"),s=t("./transport/sender/xdr"),a=t("./transport/sender/xhr-cors"),l=t("./transport/sender/xhr-local"),u=t("./transport/sender/xhr-fake"),c=t("./info-iframe"),f=t("./info-ajax"),h=function(){};function d(t,e){h(t);var n=this;r.call(this),setTimeout(function(){n.doXhr(t,e)},0)}o(d,r),d._getReceiver=function(t,e,n){return n.sameOrigin?new f(e,l):a.enabled?new f(e,a):s.enabled&&n.sameScheme?new f(e,s):c.enabled()?new c(t,e):new f(e,u)},d.prototype.doXhr=function(t,e){var n=this,r=i.addPath(t,"/info");h("doXhr",r),this.xo=d._getReceiver(t,r,e),this.timeoutRef=setTimeout(function(){h("timeout"),n._cleanup(!1),n.emit("finish")},d.timeout),this.xo.once("finish",function(t,e){h("finish",t,e),n._cleanup(!0),n.emit("finish",t,e)})},d.prototype._cleanup=function(t){h("_cleanup"),clearTimeout(this.timeoutRef),this.timeoutRef=null,!t&&this.xo&&this.xo.close(),this.xo=null},d.prototype.close=function(){h("close"),this.removeAllListeners(),this._cleanup(!1)},d.timeout=8e3,e.exports=d},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,"debug":void 0,"events":3,"inherits":54}],13:[function(t,e,n){(function(t){"use strict";e.exports=t.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(_,E,t){(function(i){"use strict";_("./shims");var r,l=_("url-parse"),t=_("inherits"),s=_("json3"),u=_("./utils/random"),e=_("./utils/escape"),c=_("./utils/url"),a=_("./utils/event"),n=_("./utils/transport"),o=_("./utils/object"),f=_("./utils/browser"),h=_("./utils/log"),d=_("./event/event"),p=_("./event/eventtarget"),m=_("./location"),v=_("./event/close"),b=_("./event/trans-message"),y=_("./info-receiver"),g=function(){};function w(t,e,n){if(!(this instanceof w))return new w(t,e,n);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");p.call(this),this.readyState=w.CONNECTING,this.extensions="",this.protocol="",(n=n||{}).protocols_whitelist&&h.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=n.transports,this._transportOptions=n.transportOptions||{},this._timeout=n.timeout||0;var r=n.sessionId||8;if("function"==typeof r)this._generateSessionId=r;else{if("number"!=typeof r)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return u.string(r)}}this._server=n.server||u.numberString(1e3);var o=new l(t);if(!o.host||!o.protocol)throw new SyntaxError("The URL '"+t+"' is invalid");if(o.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==o.protocol&&"https:"!==o.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+o.protocol+"' is not allowed.");var i="https:"===o.protocol;if("https:"===m.protocol&&!i&&!c.isLoopbackAddr(o.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");e?Array.isArray(e)||(e=[e]):e=[];var s=e.sort();s.forEach(function(t,e){if(!t)throw new SyntaxError("The protocols entry '"+t+"' is invalid.");if(e<s.length-1&&t===s[e+1])throw new SyntaxError("The protocols entry '"+t+"' is duplicated.")});var a=c.getOrigin(m.href);this._origin=a?a.toLowerCase():null,o.set("pathname",o.pathname.replace(/\/+$/,"")),this.url=o.href,g("using url",this.url),this._urlInfo={nullOrigin:!f.hasDomain(),sameOrigin:c.isOriginEqual(this.url,m.href),sameScheme:c.isSchemeEqual(this.url,m.href)},this._ir=new y(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function x(t){return 1e3===t||3e3<=t&&t<=4999}t(w,p),w.prototype.close=function(t,e){if(t&&!x(t))throw new Error("InvalidAccessError: Invalid code");if(e&&123<e.length)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==w.CLOSING&&this.readyState!==w.CLOSED){this._close(t||1e3,e||"Normal closure",!0)}},w.prototype.send=function(t){if("string"!=typeof t&&(t=""+t),this.readyState===w.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===w.OPEN&&this._transport.send(e.quote(t))},w.version=_("./version"),w.CONNECTING=0,w.OPEN=1,w.CLOSING=2,w.CLOSED=3,w.prototype._receiveInfo=function(t,e){if(g("_receiveInfo",e),this._ir=null,t){this._rto=this.countRTO(e),this._transUrl=t.base_url?t.base_url:this.url,t=o.extend(t,this._urlInfo),g("info",t);var n=r.filterToEnabled(this._transportsWhitelist,t);this._transports=n.main,g(this._transports.length+" enabled transports"),this._connect()}else this._close(1002,"Cannot connect to server")},w.prototype._connect=function(){for(var t=this._transports.shift();t;t=this._transports.shift()){if(g("attempt",t.transportName),t.needBody&&(!i.document.body||void 0!==i.document.readyState&&"complete"!==i.document.readyState&&"interactive"!==i.document.readyState))return g("waiting for body"),this._transports.unshift(t),void a.attachEvent("load",this._connect.bind(this));var e=Math.max(this._timeout,this._rto*t.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),e),g("using timeout",e);var n=c.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),r=this._transportOptions[t.transportName];g("transport url",n);var o=new t(n,this._transUrl,r);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=t.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},w.prototype._transportTimeout=function(){g("_transportTimeout"),this.readyState===w.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},w.prototype._transportMessage=function(t){g("_transportMessage",t);var e,n=this,r=t.slice(0,1),o=t.slice(1);switch(r){case"o":return void this._open();case"h":return this.dispatchEvent(new d("heartbeat")),void g("heartbeat",this.transport)}if(o)try{e=s.parse(o)}catch(t){g("bad json",o)}if(void 0!==e)switch(r){case"a":Array.isArray(e)&&e.forEach(function(t){g("message",n.transport,t),n.dispatchEvent(new b(t))});break;case"m":g("message",this.transport,e),this.dispatchEvent(new b(e));break;case"c":Array.isArray(e)&&2===e.length&&this._close(e[0],e[1],!0)}else g("empty payload",o)},w.prototype._transportClose=function(t,e){g("_transportClose",this.transport,t,e),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),x(t)||2e3===t||this.readyState!==w.CONNECTING?this._close(t,e):this._connect()},w.prototype._open=function(){g("_open",this._transport&&this._transport.transportName,this.readyState),this.readyState===w.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=w.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new d("open")),g("connected",this.transport)):this._close(1006,"Server lost session")},w.prototype._close=function(e,n,r){g("_close",this.transport,e,n,r,this.readyState);var o=!1;if(this._ir&&(o=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===w.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=w.CLOSING,setTimeout(function(){this.readyState=w.CLOSED,o&&this.dispatchEvent(new d("error"));var t=new v("close");t.wasClean=r||!1,t.code=e||1e3,t.reason=n,this.dispatchEvent(t),this.onmessage=this.onclose=this.onerror=null,g("disconnected")}.bind(this),0)},w.prototype.countRTO=function(t){return 100<t?4*t:300+t},E.exports=function(t){return r=n(t),_("./iframe-bootstrap")(w,t),w}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,"debug":void 0,"inherits":54,"json3":55,"url-parse":58}],15:[function(t,e,n){"use strict";function a(t){return"[object Function]"===i.toString.call(t)}function l(t){return"[object String]"===f.call(t)}var o,c=Array.prototype,i=Object.prototype,r=Function.prototype,s=String.prototype,u=c.slice,f=i.toString,h=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}();o=h?function(t,e,n,r){!r&&e in t||Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(t,e,n,r){!r&&e in t||(t[e]=n)};function d(t,e,n){for(var r in e)i.hasOwnProperty.call(e,r)&&o(t,r,e[r],n)}function p(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)}function m(){}d(r,{bind:function(e){var n=this;if(!a(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r=u.call(arguments,1),t=Math.max(0,n.length-r.length),o=[],i=0;i<t;i++)o.push("$"+i);var s=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof s){var t=n.apply(this,r.concat(u.call(arguments)));return Object(t)===t?t:this}return n.apply(e,r.concat(u.call(arguments)))});return n.prototype&&(m.prototype=n.prototype,s.prototype=new m,m.prototype=null),s}}),d(Array,{isArray:function(t){return"[object Array]"===f.call(t)}});var v,b,y,g=Object("a"),w="a"!==g[0]||!(0 in g);d(c,{forEach:function(t,e){var n=p(this),r=w&&l(this)?this.split(""):n,o=e,i=-1,s=r.length>>>0;if(!a(t))throw new TypeError;for(;++i<s;)i in r&&t.call(o,r[i],i,n)}},(v=c.forEach,y=b=!0,v&&(v.call("foo",function(t,e,n){"object"!=typeof n&&(b=!1)}),v.call([1],function(){y="string"==typeof this},"x")),!(v&&b&&y)));var x=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);d(c,{indexOf:function(t,e){var n=w&&l(this)?this.split(""):p(this),r=n.length>>>0;if(!r)return-1;var o=0;for(1<arguments.length&&(o=function(t){var e=+t;return e!=e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(0<e||-1)*Math.floor(Math.abs(e))),e}(e)),o=0<=o?o:Math.max(0,r+o);o<r;o++)if(o in n&&n[o]===t)return o;return-1}},x);var _,E=s.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||1<".".split(/()()/).length?(_=void 0===/()??/.exec("")[1],s.split=function(t,e){var n=this;if(void 0===t&&0===e)return[];if("[object RegExp]"!==f.call(t))return E.call(this,t,e);var r,o,i,s,a=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),u=0;for(t=new RegExp(t.source,l+"g"),n+="",_||(r=new RegExp("^"+t.source+"$(?!\\s)",l)),e=void 0===e?-1>>>0:function(t){return t>>>0}(e);(o=t.exec(n))&&!(u<(i=o.index+o[0].length)&&(a.push(n.slice(u,o.index)),!_&&1<o.length&&o[0].replace(r,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(o[t]=void 0)}),1<o.length&&o.index<n.length&&c.push.apply(a,o.slice(1)),s=o[0].length,u=i,a.length>=e));)t.lastIndex===o.index&&t.lastIndex++;return u===n.length?!s&&t.test("")||a.push(""):a.push(n.slice(u)),a.length>e?a.slice(0,e):a}):"0".split(void 0,0).length&&(s.split=function(t,e){return void 0===t&&0===e?[]:E.call(this,t,e)});var j=s.substr,S="".substr&&"b"!=="0b".substr(-1);d(s,{substr:function(t,e){return j.call(this,t<0&&(t=this.length+t)<0?0:t,e)}},S)},{}],16:[function(t,e,n){"use strict";e.exports=[t("./transport/websocket"),t("./transport/xhr-streaming"),t("./transport/xdr-streaming"),t("./transport/eventsource"),t("./transport/lib/iframe-wrap")(t("./transport/eventsource")),t("./transport/htmlfile"),t("./transport/lib/iframe-wrap")(t("./transport/htmlfile")),t("./transport/xhr-polling"),t("./transport/xdr-polling"),t("./transport/lib/iframe-wrap")(t("./transport/xhr-polling")),t("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(o,f,t){(function(t){"use strict";var i=o("events").EventEmitter,e=o("inherits"),s=o("../../utils/event"),a=o("../../utils/url"),l=t.XMLHttpRequest,u=function(){};function c(t,e,n,r){u(t,e);var o=this;i.call(this),setTimeout(function(){o._start(t,e,n,r)},0)}e(c,i),c.prototype._start=function(t,e,n,r){var o=this;try{this.xhr=new l}catch(t){}if(!this.xhr)return u("no xhr"),this.emit("finish",0,"no xhr support"),void this._cleanup();e=a.addQuery(e,"t="+ +new Date),this.unloadRef=s.unloadAdd(function(){u("unload cleanup"),o._cleanup(!0)});try{this.xhr.open(t,e,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){u("xhr timeout"),o.emit("finish",0,""),o._cleanup(!1)})}catch(t){return u("exception",t),this.emit("finish",0,""),void this._cleanup(!1)}if(r&&r.noCredentials||!c.supportsCORS||(u("withCredentials"),this.xhr.withCredentials=!0),r&&r.headers)for(var i in r.headers)this.xhr.setRequestHeader(i,r.headers[i]);this.xhr.onreadystatechange=function(){if(o.xhr){var t,e,n=o.xhr;switch(u("readyState",n.readyState),n.readyState){case 3:try{e=n.status,t=n.responseText}catch(t){}u("status",e),1223===e&&(e=204),200===e&&t&&0<t.length&&(u("chunk"),o.emit("chunk",e,t));break;case 4:e=n.status,u("status",e),1223===e&&(e=204),12005!==e&&12029!==e||(e=0),u("finish",e,n.responseText),o.emit("finish",e,n.responseText),o._cleanup(!1)}}};try{o.xhr.send(n)}catch(t){o.emit("finish",0,""),o._cleanup(!1)}},c.prototype._cleanup=function(t){if(u("cleanup"),this.xhr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),t)try{this.xhr.abort()}catch(t){}this.unloadRef=this.xhr=null}},c.prototype.close=function(){u("close"),this._cleanup(!0)},c.enabled=!!l;var n=["Active"].concat("Object").join("X");!c.enabled&&n in t&&(u("overriding xmlhttprequest"),c.enabled=!!new(l=function(){try{return new t[n]("Microsoft.XMLHTTP")}catch(t){return null}}));var r=!1;try{r="withCredentials"in new l}catch(t){}c.supportsCORS=r,f.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],18:[function(t,e,n){(function(t){e.exports=t.EventSource}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(t,n,e){(function(t){"use strict";var e=t.WebSocket||t.MozWebSocket;n.exports=e?function(t){return new e(t)}:void 0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./lib/ajax-based"),i=t("./receiver/eventsource"),s=t("./sender/xhr-cors"),a=t("eventsource");function l(t){if(!l.enabled())throw new Error("Transport created when disabled");o.call(this,t,"/eventsource",i,s)}r(l,o),l.enabled=function(){return!!a},l.transportName="eventsource",l.roundTrips=2,e.exports=l},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,"eventsource":18,"inherits":54}],21:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./receiver/htmlfile"),i=t("./sender/xhr-local"),s=t("./lib/ajax-based");function a(t){if(!o.enabled)throw new Error("Transport created when disabled");s.call(this,t,"/htmlfile",o,i)}r(a,s),a.enabled=function(t){return o.enabled&&t.sameOrigin},a.transportName="htmlfile",a.roundTrips=2,e.exports=a},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,"inherits":54}],22:[function(t,e,n){"use strict";var r=t("inherits"),o=t("json3"),i=t("events").EventEmitter,s=t("../version"),a=t("../utils/url"),l=t("../utils/iframe"),u=t("../utils/event"),c=t("../utils/random"),f=function(){};function h(t,e,n){if(!h.enabled())throw new Error("Transport created when disabled");i.call(this);var r=this;this.origin=a.getOrigin(n),this.baseUrl=n,this.transUrl=e,this.transport=t,this.windowId=c.string(8);var o=a.addPath(n,"/iframe.html")+"#"+this.windowId;f(t,e,o),this.iframeObj=l.createIframe(o,function(t){f("err callback"),r.emit("close",1006,"Unable to load an iframe ("+t+")"),r.close()}),this.onmessageCallback=this._message.bind(this),u.attachEvent("message",this.onmessageCallback)}r(h,i),h.prototype.close=function(){if(f("close"),this.removeAllListeners(),this.iframeObj){u.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(t){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},h.prototype._message=function(e){if(f("message",e.data),a.isOriginEqual(e.origin,this.origin)){var n;try{n=o.parse(e.data)}catch(t){return void f("bad json",e.data)}if(n.windowId===this.windowId)switch(n.type){case"s":this.iframeObj.loaded(),this.postMessage("s",o.stringify([s,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",n.data);break;case"c":var t;try{t=o.parse(n.data)}catch(t){return void f("bad json",n.data)}this.emit("close",t[0],t[1]),this.close()}else f("mismatched window id",n.windowId,this.windowId)}else f("not same origin",e.origin,this.origin)},h.prototype.postMessage=function(t,e){f("postMessage",t,e),this.iframeObj.post(o.stringify({windowId:this.windowId,type:t,data:e||""}),this.origin)},h.prototype.send=function(t){f("send",t),this.postMessage("m",t)},h.enabled=function(){return l.iframeEnabled},h.transportName="iframe",h.roundTrips=2,e.exports=h},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,"debug":void 0,"events":3,"inherits":54,"json3":55}],23:[function(s,a,t){(function(t){"use strict";var e=s("inherits"),n=s("./lib/sender-receiver"),r=s("./receiver/jsonp"),o=s("./sender/jsonp");function i(t){if(!i.enabled())throw new Error("Transport created when disabled");n.call(this,t,"/jsonp",o,r)}e(i,n),i.enabled=function(){return!!t.document},i.transportName="jsonp-polling",i.roundTrips=1,i.needBody=!0,a.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,"inherits":54}],24:[function(t,e,n){"use strict";var r=t("inherits"),a=t("../../utils/url"),o=t("./sender-receiver"),l=function(){};function i(t,e,n,r){o.call(this,t,e,function(s){return function(t,e,n){l("create ajax sender",t,e);var r={};"string"==typeof e&&(r.headers={"Content-type":"text/plain"});var o=a.addPath(t,"/xhr_send"),i=new s("POST",o,e,r);return i.once("finish",function(t){if(l("finish",t),i=null,200!==t&&204!==t)return n(new Error("http status "+t));n()}),function(){l("abort"),i.close(),i=null;var t=new Error("Aborted");t.code=1e3,n(t)}}}(r),n,r)}r(i,o),e.exports=i},{"../../utils/url":52,"./sender-receiver":28,"debug":void 0,"inherits":54}],25:[function(t,e,n){"use strict";var r=t("inherits"),o=t("events").EventEmitter,i=function(){};function s(t,e){i(t),o.call(this),this.sendBuffer=[],this.sender=e,this.url=t}r(s,o),s.prototype.send=function(t){i("send",t),this.sendBuffer.push(t),this.sendStop||this.sendSchedule()},s.prototype.sendScheduleWait=function(){i("sendScheduleWait");var t,e=this;this.sendStop=function(){i("sendStop"),e.sendStop=null,clearTimeout(t)},t=setTimeout(function(){i("timeout"),e.sendStop=null,e.sendSchedule()},25)},s.prototype.sendSchedule=function(){i("sendSchedule",this.sendBuffer.length);var e=this;if(0<this.sendBuffer.length){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(i("error",t),e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},s.prototype._cleanup=function(){i("_cleanup"),this.removeAllListeners()},s.prototype.close=function(){i("close"),this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},e.exports=s},{"debug":void 0,"events":3,"inherits":54}],26:[function(t,n,e){(function(o){"use strict";var e=t("inherits"),i=t("../iframe"),s=t("../../utils/object");n.exports=function(r){function t(t,e){i.call(this,r.transportName,t,e)}return e(t,i),t.enabled=function(t,e){if(!o.document)return!1;var n=s.extend({},e);return n.sameOrigin=!0,r.enabled(n)&&i.enabled()},t.transportName="iframe-"+r.transportName,t.needBody=!0,t.roundTrips=i.roundTrips+r.roundTrips-1,t.facadeTransport=r,t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,"inherits":54}],27:[function(t,e,n){"use strict";var r=t("inherits"),o=t("events").EventEmitter,i=function(){};function s(t,e,n){i(e),o.call(this),this.Receiver=t,this.receiveUrl=e,this.AjaxObject=n,this._scheduleReceiver()}r(s,o),s.prototype._scheduleReceiver=function(){i("_scheduleReceiver");var n=this,r=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);r.on("message",function(t){i("message",t),n.emit("message",t)}),r.once("close",function(t,e){i("close",t,e,n.pollIsClosing),n.poll=r=null,n.pollIsClosing||("network"===e?n._scheduleReceiver():(n.emit("close",t||1006,e),n.removeAllListeners()))})},s.prototype.abort=function(){i("abort"),this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},e.exports=s},{"debug":void 0,"events":3,"inherits":54}],28:[function(t,e,n){"use strict";var r=t("inherits"),a=t("../../utils/url"),l=t("./buffered-sender"),u=t("./polling"),c=function(){};function o(t,e,n,r,o){var i=a.addPath(t,e);c(i);var s=this;l.call(this,t,n),this.poll=new u(r,i,o),this.poll.on("message",function(t){c("poll message",t),s.emit("message",t)}),this.poll.once("close",function(t,e){c("poll close",t,e),s.poll=null,s.emit("close",t,e),s.close()})}r(o,l),o.prototype.close=function(){l.prototype.close.call(this),c("close"),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},e.exports=o},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,"debug":void 0,"inherits":54}],29:[function(t,e,n){"use strict";var r=t("inherits"),o=t("events").EventEmitter,i=t("eventsource"),s=function(){};function a(t){s(t),o.call(this);var n=this,r=this.es=new i(t);r.onmessage=function(t){s("message",t.data),n.emit("message",decodeURI(t.data))},r.onerror=function(t){s("error",r.readyState,t);var e=2!==r.readyState?"network":"permanent";n._cleanup(),n._close(e)}}r(a,o),a.prototype.abort=function(){s("abort"),this._cleanup(),this._close("user")},a.prototype._cleanup=function(){s("cleanup");var t=this.es;t&&(t.onmessage=t.onerror=null,t.close(),this.es=null)},a.prototype._close=function(t){s("close",t);var e=this;setTimeout(function(){e.emit("close",null,t),e.removeAllListeners()},200)},e.exports=a},{"debug":void 0,"events":3,"eventsource":18,"inherits":54}],30:[function(n,c,t){(function(r){"use strict";var t=n("inherits"),o=n("../../utils/iframe"),i=n("../../utils/url"),s=n("events").EventEmitter,a=n("../../utils/random"),l=function(){};function u(t){l(t),s.call(this);var e=this;o.polluteGlobalNamespace(),this.id="a"+a.string(6),t=i.addQuery(t,"c="+decodeURIComponent(o.WPrefix+"."+this.id)),l("using htmlfile",u.htmlfileEnabled);var n=u.htmlfileEnabled?o.createHtmlfile:o.createIframe;r[o.WPrefix][this.id]={start:function(){l("start"),e.iframeObj.loaded()},message:function(t){l("message",t),e.emit("message",t)},stop:function(){l("stop"),e._cleanup(),e._close("network")}},this.iframeObj=n(t,function(){l("callback"),e._cleanup(),e._close("permanent")})}t(u,s),u.prototype.abort=function(){l("abort"),this._cleanup(),this._close("user")},u.prototype._cleanup=function(){l("_cleanup"),this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete r[o.WPrefix][this.id]},u.prototype._close=function(t){l("_close",t),this.emit("close",null,t),this.removeAllListeners()},u.htmlfileEnabled=!1;var e=["Active"].concat("Object").join("X");if(e in r)try{u.htmlfileEnabled=!!new r[e]("htmlfile")}catch(t){}u.enabled=u.htmlfileEnabled||o.iframeEnabled,c.exports=u}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],31:[function(e,n,t){(function(i){"use strict";var r=e("../../utils/iframe"),s=e("../../utils/random"),a=e("../../utils/browser"),o=e("../../utils/url"),t=e("inherits"),l=e("events").EventEmitter,u=function(){};function c(t){u(t);var e=this;l.call(this),r.polluteGlobalNamespace(),this.id="a"+s.string(6);var n=o.addQuery(t,"c="+encodeURIComponent(r.WPrefix+"."+this.id));i[r.WPrefix][this.id]=this._callback.bind(this),this._createScript(n),this.timeoutId=setTimeout(function(){u("timeout"),e._abort(new Error("JSONP script loaded abnormally (timeout)"))},c.timeout)}t(c,l),c.prototype.abort=function(){if(u("abort"),i[r.WPrefix][this.id]){var t=new Error("JSONP user aborted read");t.code=1e3,this._abort(t)}},c.timeout=35e3,c.scriptErrorTimeout=1e3,c.prototype._callback=function(t){u("_callback",t),this._cleanup(),this.aborting||(t&&(u("message",t),this.emit("message",t)),this.emit("close",null,"network"),this.removeAllListeners())},c.prototype._abort=function(t){u("_abort",t),this._cleanup(),this.aborting=!0,this.emit("close",t.code,t.message),this.removeAllListeners()},c.prototype._cleanup=function(){if(u("_cleanup"),clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var t=this.script;t.parentNode.removeChild(t),t.onreadystatechange=t.onerror=t.onload=t.onclick=null,this.script=null}delete i[r.WPrefix][this.id]},c.prototype._scriptError=function(){u("_scriptError");var t=this;this.errorTimer||(this.errorTimer=setTimeout(function(){t.loadedOkay||t._abort(new Error("JSONP script loaded abnormally (onerror)"))},c.scriptErrorTimeout))},c.prototype._createScript=function(t){u("_createScript",t);var e,n=this,r=this.script=i.document.createElement("script");if(r.id="a"+s.string(8),r.src=t,r.type="text/javascript",r.charset="UTF-8",r.onerror=this._scriptError.bind(this),r.onload=function(){u("onload"),n._abort(new Error("JSONP script loaded abnormally (onload)"))},r.onreadystatechange=function(){if(u("onreadystatechange",r.readyState),/loaded|closed/.test(r.readyState)){if(r&&r.htmlFor&&r.onclick){n.loadedOkay=!0;try{r.onclick()}catch(t){}}r&&n._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===r.async&&i.document.attachEvent)if(a.isOpera())(e=this.script2=i.document.createElement("script")).text="try{var a = document.getElementById('"+r.id+"'); if(a)a.onerror();}catch(x){};",r.async=e.async=!1;else{try{r.htmlFor=r.id,r.event="onclick"}catch(t){}r.async=!0}void 0!==r.async&&(r.async=!0);var o=i.document.getElementsByTagName("head")[0];o.insertBefore(r,o.firstChild),e&&o.insertBefore(e,o.firstChild)},n.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],32:[function(t,e,n){"use strict";var r=t("inherits"),o=t("events").EventEmitter,i=function(){};function s(t,e){i(t),o.call(this);var r=this;this.bufferPosition=0,this.xo=new e("POST",t,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(t,e){i("finish",t,e),r._chunkHandler(t,e),r.xo=null;var n=200===t?"network":"permanent";i("close",n),r.emit("close",null,n),r._cleanup()})}r(s,o),s.prototype._chunkHandler=function(t,e){if(i("_chunkHandler",t),200===t&&e)for(var n=-1;;this.bufferPosition+=n+1){var r=e.slice(this.bufferPosition);if(-1===(n=r.indexOf("\n")))break;var o=r.slice(0,n);o&&(i("message",o),this.emit("message",o))}},s.prototype._cleanup=function(){i("_cleanup"),this.removeAllListeners()},s.prototype.abort=function(){i("abort"),this.xo&&(this.xo.close(),i("close"),this.emit("close",null,"user"),this.xo=null),this._cleanup()},e.exports=s},{"debug":void 0,"events":3,"inherits":54}],33:[function(t,e,n){(function(s){"use strict";var a,l,u=t("../../utils/random"),c=t("../../utils/url"),f=function(){};e.exports=function(t,e,n){f(t,e),a||(f("createForm"),(a=s.document.createElement("form")).style.display="none",a.style.position="absolute",a.method="POST",a.enctype="application/x-www-form-urlencoded",a.acceptCharset="UTF-8",(l=s.document.createElement("textarea")).name="d",a.appendChild(l),s.document.body.appendChild(a));var r="a"+u.string(8);a.target=r,a.action=c.addQuery(c.addPath(t,"/jsonp_send"),"i="+r);var o=function(e){f("createIframe",e);try{return s.document.createElement('<iframe name="'+e+'">')}catch(t){var n=s.document.createElement("iframe");return n.name=e,n}}(r);o.id=r,o.style.display="none",a.appendChild(o);try{l.value=e}catch(t){}a.submit();function i(t){f("completed",r,t),o.onerror&&(o.onreadystatechange=o.onerror=o.onload=null,setTimeout(function(){f("cleaning up",r),o.parentNode.removeChild(o),o=null},500),l.value="",n(t))}return o.onerror=function(){f("onerror",r),i()},o.onload=function(){f("onload",r),i()},o.onreadystatechange=function(t){f("onreadystatechange",r,o.readyState,t),"complete"===o.readyState&&i()},function(){f("aborted",r),i(new Error("Aborted"))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/random":50,"../../utils/url":52,"debug":void 0}],34:[function(r,u,t){(function(i){"use strict";var o=r("events").EventEmitter,t=r("inherits"),s=r("../../utils/event"),e=r("../../utils/browser"),a=r("../../utils/url"),l=function(){};function n(t,e,n){l(t,e);var r=this;o.call(this),setTimeout(function(){r._start(t,e,n)},0)}t(n,o),n.prototype._start=function(t,e,n){l("_start");var r=this,o=new i.XDomainRequest;e=a.addQuery(e,"t="+ +new Date),o.onerror=function(){l("onerror"),r._error()},o.ontimeout=function(){l("ontimeout"),r._error()},o.onprogress=function(){l("progress",o.responseText),r.emit("chunk",200,o.responseText)},o.onload=function(){l("load"),r.emit("finish",200,o.responseText),r._cleanup(!1)},this.xdr=o,this.unloadRef=s.unloadAdd(function(){r._cleanup(!0)});try{this.xdr.open(t,e),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(n)}catch(t){this._error()}},n.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},n.prototype._cleanup=function(t){if(l("cleanup",t),this.xdr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,t)try{this.xdr.abort()}catch(t){}this.unloadRef=this.xdr=null}},n.prototype.close=function(){l("close"),this._cleanup(!0)},n.enabled=!(!i.XDomainRequest||!e.hasDomain()),u.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],35:[function(t,e,n){"use strict";var r=t("inherits"),o=t("../driver/xhr");function i(t,e,n,r){o.call(this,t,e,n,r)}r(i,o),i.enabled=o.enabled&&o.supportsCORS,e.exports=i},{"../driver/xhr":17,"inherits":54}],36:[function(t,e,n){"use strict";var r=t("events").EventEmitter;function o(){var t=this;r.call(this),this.to=setTimeout(function(){t.emit("finish",200,"{}")},o.timeout)}t("inherits")(o,r),o.prototype.close=function(){clearTimeout(this.to)},o.timeout=2e3,e.exports=o},{"events":3,"inherits":54}],37:[function(t,e,n){"use strict";var r=t("inherits"),o=t("../driver/xhr");function i(t,e,n){o.call(this,t,e,n,{noCredentials:!0})}r(i,o),i.enabled=o.enabled,e.exports=i},{"../driver/xhr":17,"inherits":54}],38:[function(t,e,n){"use strict";var i=t("../utils/event"),s=t("../utils/url"),r=t("inherits"),a=t("events").EventEmitter,l=t("./driver/websocket"),u=function(){};function c(t,e,n){if(!c.enabled())throw new Error("Transport created when disabled");a.call(this),u("constructor",t);var r=this,o=s.addPath(t,"/websocket");o="https"===o.slice(0,5)?"wss"+o.slice(5):"ws"+o.slice(4),this.url=o,this.ws=new l(this.url,[],n),this.ws.onmessage=function(t){u("message event",t.data),r.emit("message",t.data)},this.unloadRef=i.unloadAdd(function(){u("unload"),r.ws.close()}),this.ws.onclose=function(t){u("close event",t.code,t.reason),r.emit("close",t.code,t.reason),r._cleanup()},this.ws.onerror=function(t){u("error event",t),r.emit("close",1006,"WebSocket connection broken"),r._cleanup()}}r(c,a),c.prototype.send=function(t){var e="["+t+"]";u("send",e),this.ws.send(e)},c.prototype.close=function(){u("close");var t=this.ws;this._cleanup(),t&&t.close()},c.prototype._cleanup=function(){u("_cleanup");var t=this.ws;t&&(t.onmessage=t.onclose=t.onerror=null),i.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},c.enabled=function(){return u("enabled"),!!l},c.transportName="websocket",c.roundTrips=2,e.exports=c},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,"debug":void 0,"events":3,"inherits":54}],39:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./lib/ajax-based"),i=t("./xdr-streaming"),s=t("./receiver/xhr"),a=t("./sender/xdr");function l(t){if(!a.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr",s,a)}r(l,o),l.enabled=i.enabled,l.transportName="xdr-polling",l.roundTrips=2,e.exports=l},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,"inherits":54}],40:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./lib/ajax-based"),i=t("./receiver/xhr"),s=t("./sender/xdr");function a(t){if(!s.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr_streaming",i,s)}r(a,o),a.enabled=function(t){return!t.cookie_needed&&!t.nullOrigin&&(s.enabled&&t.sameScheme)},a.transportName="xdr-streaming",a.roundTrips=2,e.exports=a},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"inherits":54}],41:[function(t,e,n){"use strict";var r=t("inherits"),o=t("./lib/ajax-based"),i=t("./receiver/xhr"),s=t("./sender/xhr-cors"),a=t("./sender/xhr-local");function l(t){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr",i,s)}r(l,o),l.enabled=function(t){return!t.nullOrigin&&(!(!a.enabled||!t.sameOrigin)||s.enabled)},l.transportName="xhr-polling",l.roundTrips=2,e.exports=l},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":54}],42:[function(l,u,t){(function(t){"use strict";var e=l("inherits"),n=l("./lib/ajax-based"),r=l("./receiver/xhr"),o=l("./sender/xhr-cors"),i=l("./sender/xhr-local"),s=l("../utils/browser");function a(t){if(!i.enabled&&!o.enabled)throw new Error("Transport created when disabled");n.call(this,t,"/xhr_streaming",r,o)}e(a,n),a.enabled=function(t){return!t.nullOrigin&&(!s.isOpera()&&o.enabled)},a.transportName="xhr-streaming",a.roundTrips=2,a.needBody=!!t.document,u.exports=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":54}],43:[function(t,e,n){(function(n){"use strict";n.crypto&&n.crypto.getRandomValues?e.exports.randomBytes=function(t){var e=new Uint8Array(t);return n.crypto.getRandomValues(e),e}:e.exports.randomBytes=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=Math.floor(256*Math.random());return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(t,e,n){(function(t){"use strict";e.exports={isOpera:function(){return t.navigator&&/opera/i.test(t.navigator.userAgent)},isKonqueror:function(){return t.navigator&&/konqueror/i.test(t.navigator.userAgent)},hasDomain:function(){if(!t.document)return!0;try{return!!t.document.domain}catch(t){return!1}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(t,e,n){"use strict";var r,o=t("json3"),i=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;e.exports={quote:function(t){var e=o.stringify(t);return i.lastIndex=0,i.test(e)?(r=r||function(t){var e,n={},r=[];for(e=0;e<65536;e++)r.push(String.fromCharCode(e));return t.lastIndex=0,r.join("").replace(t,function(t){return n[t]="\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4),""}),t.lastIndex=0,n}(i),e.replace(i,function(t){return r[t]})):e}}},{"json3":55}],46:[function(t,e,n){(function(n){"use strict";var r=t("./random"),o={},i=!1,s=n.chrome&&n.chrome.app&&n.chrome.app.runtime;e.exports={attachEvent:function(t,e){void 0!==n.addEventListener?n.addEventListener(t,e,!1):n.document&&n.attachEvent&&(n.document.attachEvent("on"+t,e),n.attachEvent("on"+t,e))},detachEvent:function(t,e){void 0!==n.addEventListener?n.removeEventListener(t,e,!1):n.document&&n.detachEvent&&(n.document.detachEvent("on"+t,e),n.detachEvent("on"+t,e))},unloadAdd:function(t){if(s)return null;var e=r.string(8);return o[e]=t,i&&setTimeout(this.triggerUnloadCallbacks,0),e},unloadDel:function(t){t in o&&delete o[t]},triggerUnloadCallbacks:function(){for(var t in o)o[t](),delete o[t]}};s||e.exports.attachEvent("unload",function(){i||(i=!0,e.exports.triggerUnloadCallbacks())})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./random":50}],47:[function(e,p,t){(function(f){"use strict";var h=e("./event"),n=e("json3"),t=e("./browser"),d=function(){};p.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){p.exports.WPrefix in f||(f[p.exports.WPrefix]={})},postMessage:function(t,e){f.parent!==f?f.parent.postMessage(n.stringify({windowId:p.exports.currentWindowId,type:t,data:e||""}),"*"):d("Cannot postMessage, no parent window.",t,e)},createIframe:function(t,e){function n(){d("unattach"),clearTimeout(i);try{a.onload=null}catch(t){}a.onerror=null}function r(){d("cleanup"),a&&(n(),setTimeout(function(){a&&a.parentNode.removeChild(a),a=null},0),h.unloadDel(s))}function o(t){d("onerror",t),a&&(r(),e(t))}var i,s,a=f.document.createElement("iframe");return a.src=t,a.style.display="none",a.style.position="absolute",a.onerror=function(){o("onerror")},a.onload=function(){d("onload"),clearTimeout(i),i=setTimeout(function(){o("onload timeout")},2e3)},f.document.body.appendChild(a),i=setTimeout(function(){o("timeout")},15e3),s=h.unloadAdd(r),{post:function(t,e){d("post",t,e),setTimeout(function(){try{a&&a.contentWindow&&a.contentWindow.postMessage(t,e)}catch(t){}},0)},cleanup:r,loaded:n}},createHtmlfile:function(t,e){function n(){clearTimeout(i),a.onerror=null}function r(){u&&(n(),h.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())}function o(t){d("onerror",t),u&&(r(),e(t))}var i,s,a,l=["Active"].concat("Object").join("X"),u=new f[l]("htmlfile");u.open(),u.write('<html><script>document.domain="'+f.document.domain+'";<\/script></html>'),u.close(),u.parentWindow[p.exports.WPrefix]=f[p.exports.WPrefix];var c=u.createElement("div");return u.body.appendChild(c),a=u.createElement("iframe"),c.appendChild(a),a.src=t,a.onerror=function(){o("onerror")},i=setTimeout(function(){o("timeout")},15e3),s=h.unloadAdd(r),{post:function(t,e){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(t,e)},0)}catch(t){}},cleanup:r,loaded:n}}},p.exports.iframeEnabled=!1,f.document&&(p.exports.iframeEnabled=("function"==typeof f.postMessage||"object"==typeof f.postMessage)&&!t.isKonqueror())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./browser":44,"./event":46,"debug":void 0,"json3":55}],48:[function(t,e,n){(function(n){"use strict";var r={};["log","debug","warn"].forEach(function(t){var e;try{e=n.console&&n.console[t]&&n.console[t].apply}catch(t){}r[t]=e?function(){return n.console[t].apply(n.console,arguments)}:"log"===t?function(){}:r.log}),e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],49:[function(t,e,n){"use strict";e.exports={isObject:function(t){var e=typeof t;return"function"==e||"object"==e&&!!t},extend:function(t){if(!this.isObject(t))return t;for(var e,n,r=1,o=arguments.length;r<o;r++)for(n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}}},{}],50:[function(t,e,n){"use strict";var i=t("crypto"),s="abcdefghijklmnopqrstuvwxyz012345";e.exports={string:function(t){for(var e=s.length,n=i.randomBytes(t),r=[],o=0;o<t;o++)r.push(s.substr(n[o]%e,1));return r.join("")},number:function(t){return Math.floor(Math.random()*t)},numberString:function(t){var e=(""+(t-1)).length;return(new Array(e+1).join("0")+this.number(t)).slice(-e)}}},{"crypto":43}],51:[function(t,e,n){"use strict";var o=function(){};e.exports=function(t){return{filterToEnabled:function(e,n){var r={main:[],facade:[]};return e?"string"==typeof e&&(e=[e]):e=[],t.forEach(function(t){t&&("websocket"!==t.transportName||!1!==n.websocket?e.length&&-1===e.indexOf(t.transportName)?o("not in whitelist",t.transportName):t.enabled(n)?(o("enabled",t.transportName),r.main.push(t),t.facadeTransport&&r.facade.push(t.facadeTransport)):o("disabled",t.transportName):o("disabled from server","websocket"))}),r}}}},{"debug":void 0}],52:[function(t,e,n){"use strict";var r=t("url-parse"),o=function(){};e.exports={getOrigin:function(t){if(!t)return null;var e=new r(t);if("file:"===e.protocol)return null;var n=e.port;return n=n||("https:"===e.protocol?"443":"80"),e.protocol+"//"+e.hostname+":"+n},isOriginEqual:function(t,e){var n=this.getOrigin(t)===this.getOrigin(e);return o("same",t,e,n),n},isSchemeEqual:function(t,e){return t.split(":")[0]===e.split(":")[0]},addPath:function(t,e){var n=t.split("?");return n[0]+e+(n[1]?"?"+n[1]:"")},addQuery:function(t,e){return t+(-1===t.indexOf("?")?"?"+e:"&"+e)},isLoopbackAddr:function(t){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(t)||/^\[::1\]$/.test(t)}}},{"debug":void 0,"url-parse":58}],53:[function(t,e,n){e.exports="1.5.2"},{}],54:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},{}],55:[function(t,a,l){(function(s){(function(){var J={"function":!0,"object":!0},t=J[typeof l]&&l&&!l.nodeType&&l,B=J[typeof window]&&window||this,e=t&&J[typeof a]&&a&&!a.nodeType&&"object"==typeof s&&s;function F(t,l){t=t||B.Object(),l=l||B.Object();var u=t.Number||B.Number,c=t.String||B.String,e=t.Object||B.Object,v=t.Date||B.Date,n=t.SyntaxError||B.SyntaxError,b=t.TypeError||B.TypeError,d=t.Math||B.Math,r=t.JSON||B.JSON;"object"==typeof r&&r&&(l.stringify=r.stringify,l.parse=r.parse);var y,o=e.prototype,g=o.toString,a=o.hasOwnProperty;function w(t,e){try{t()}catch(t){e&&e()}}var p=new v(-0xc782b5b800cec);function f(t){if(null!=f[t])return f[t];var e;if("bug-string-char-index"==t)e="a"!="a"[0];else if("json"==t)e=f("json-stringify")&&f("date-serialization")&&f("json-parse");else if("date-serialization"==t){if(e=f("json-stringify")&&p){var n=l.stringify;w(function(){e='"-271821-04-20T00:00:00.000Z"'==n(new v(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==n(new v(864e13))&&'"-000001-01-01T00:00:00.000Z"'==n(new v(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==n(new v(-1))})}}else{var r,o='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==t){var i="function"==typeof(n=l.stringify);i&&((r=function(){return 1}).toJSON=r,w(function(){i="0"===n(0)&&"0"===n(new u)&&'""'==n(new c)&&n(g)===y&&n(y)===y&&n()===y&&"1"===n(r)&&"[1]"==n([r])&&"[null]"==n([y])&&"null"==n(null)&&"[null,null,null]"==n([y,g,null])&&n({"a":[r,!0,!1,null,"\0\b\n\f\r\t"]})==o&&"1"===n(null,r)&&"[\n 1,\n 2\n]"==n([1,2],null,1)},function(){i=!1})),e=i}if("json-parse"==t){var s,a=l.parse;"function"==typeof a&&w(function(){0!==a("0")||a(!1)||(r=a(o),(s=5==r.a.length&&1===r.a[0])&&(w(function(){s=!a('"\t"')}),s&&w(function(){s=1!==a("01")}),s&&w(function(){s=1!==a("1.")})))},function(){s=!1}),e=s}}return f[t]=!!e}if(w(function(){p=-109252==p.getUTCFullYear()&&0===p.getUTCMonth()&&1===p.getUTCDate()&&10==p.getUTCHours()&&37==p.getUTCMinutes()&&6==p.getUTCSeconds()&&708==p.getUTCMilliseconds()}),f["bug-string-char-index"]=f["date-serialization"]=f.json=f["json-stringify"]=f["json-parse"]=null,!f("json")){var h="[object Function]",x="[object Number]",_="[object String]",E="[object Array]",m=f("bug-string-char-index"),j=function(t,e){var n,s,r,o=0;for(r in(n=function(){this.valueOf=0}).prototype.valueOf=0,s=new n)a.call(s,r)&&o++;return n=s=null,(j=o?function(t,e){var n,r,o=g.call(t)==h;for(n in t)o&&"prototype"==n||!a.call(t,n)||(r="constructor"===n)||e(n);(r||a.call(t,n="constructor"))&&e(n)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],function(t,e){var n,r,o=g.call(t)==h,i=!o&&"function"!=typeof t.constructor&&J[typeof t.hasOwnProperty]&&t.hasOwnProperty||a;for(n in t)o&&"prototype"==n||!i.call(t,n)||e(n);for(r=s.length;n=s[--r];)i.call(t,n)&&e(n)}))(t,e)};if(!f("json-stringify")&&!f("date-serialization")){function S(t,e){return("000000"+(e||0)).slice(-t)}var i={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T=function(t){var e,n,r,o,i,s,a,l,u;if(p)e=function(t){n=t.getUTCFullYear(),r=t.getUTCMonth(),o=t.getUTCDate(),s=t.getUTCHours(),a=t.getUTCMinutes(),l=t.getUTCSeconds(),u=t.getUTCMilliseconds()};else{function c(t,e){return h[e]+365*(t-1970)+f((t-1969+(e=+(1<e)))/4)-f((t-1901+e)/100)+f((t-1601+e)/400)}var f=d.floor,h=[0,31,59,90,120,151,181,212,243,273,304,334];e=function(t){for(o=f(t/864e5),n=f(o/365.2425)+1970-1;c(n+1,0)<=o;n++);for(r=f((o-c(n,0))/30.42);c(n,r+1)<=o;r++);o=1+o-c(n,r),s=f((i=(t%864e5+864e5)%864e5)/36e5)%24,a=f(i/6e4)%60,l=f(i/1e3)%60,u=i%1e3}}return(T=function(t){return-1/0<t&&t<1/0?(e(t),t=(n<=0||1e4<=n?(n<0?"-":"+")+S(6,n<0?-n:n):S(4,n))+"-"+S(2,r+1)+"-"+S(2,o)+"T"+S(2,s)+":"+S(2,a)+":"+S(2,l)+"."+S(3,u)+"Z",n=r=o=s=a=l=u=null):t=null,t})(t)};if(f("json-stringify")&&!f("date-serialization")){function s(t){return T(this)}var O=l.stringify;l.stringify=function(t,e,n){var r=v.prototype.toJSON;v.prototype.toJSON=s;var o=O(t,e,n);return v.prototype.toJSON=r,o}}else{function C(t){var e=t.charCodeAt(0),n=i[e];return n||"\\u00"+S(2,e.toString(16))}function A(t){return N.lastIndex=0,'"'+(N.test(t)?t.replace(N,C):t)+'"'}var N=/[\x00-\x1f\x22\x5c]/g,k=function(t,e,n,r,o,i,s){var a,l,u,c,f,h,d,p,m;if(w(function(){a=e[t]}),"object"==typeof a&&a&&(a.getUTCFullYear&&"[object Date]"==g.call(a)&&a.toJSON===v.prototype.toJSON?a=T(a):"function"==typeof a.toJSON&&(a=a.toJSON(t))),n&&(a=n.call(e,t,a)),a==y)return a===y?a:"null";switch("object"==(l=typeof a)&&(u=g.call(a)),u||l){case"boolean":case"[object Boolean]":return""+a;case"number":case x:return-1/0<a&&a<1/0?""+a:"null";case"string":case _:return A(""+a)}if("object"==typeof a){for(d=s.length;d--;)if(s[d]===a)throw b();if(s.push(a),c=[],p=i,i+=o,u==E){for(h=0,d=a.length;h<d;h++)f=k(h,a,n,r,o,i,s),c.push(f===y?"null":f);m=c.length?o?"[\n"+i+c.join(",\n"+i)+"\n"+p+"]":"["+c.join(",")+"]":"[]"}else j(r||a,function(t){var e=k(t,a,n,r,o,i,s);e!==y&&c.push(A(t)+":"+(o?" ":"")+e)}),m=c.length?o?"{\n"+i+c.join(",\n"+i)+"\n"+p+"}":"{"+c.join(",")+"}":"{}";return s.pop(),m}};l.stringify=function(t,e,n){var r,o,i,s;if(J[typeof e]&&e)if((s=g.call(e))==h)o=e;else if(s==E){i={};for(var a,l=0,u=e.length;l<u;)a=e[l++],"[object String]"!=(s=g.call(a))&&"[object Number]"!=s||(i[a]=1)}if(n)if((s=g.call(n))==x){if(0<(n-=n%1))for(10<n&&(n=10),r="";r.length<n;)r+=" "}else s==_&&(r=n.length<=10?n:n.slice(0,10));return k("",((a={})[""]=t,a),o,i,r,"",[])}}}if(!f("json-parse")){function I(){throw R=U=null,n()}function L(){for(var t,e,n,r,o,i=U,s=i.length;R<s;)switch(o=i.charCodeAt(R)){case 9:case 10:case 13:case 32:R++;break;case 123:case 125:case 91:case 93:case 58:case 44:return t=m?i.charAt(R):i[R],R++,t;case 34:for(t="@",R++;R<s;)if((o=i.charCodeAt(R))<32)I();else if(92==o)switch(o=i.charCodeAt(++R)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:t+=q[o],R++;break;case 117:for(e=++R,n=R+4;R<n;R++)48<=(o=i.charCodeAt(R))&&o<=57||97<=o&&o<=102||65<=o&&o<=70||I();t+=M("0x"+i.slice(e,R));break;default:I()}else{if(34==o)break;for(o=i.charCodeAt(R),e=R;32<=o&&92!=o&&34!=o;)o=i.charCodeAt(++R);t+=i.slice(e,R)}if(34==i.charCodeAt(R))return R++,t;I();default:if(e=R,45==o&&(r=!0,o=i.charCodeAt(++R)),48<=o&&o<=57){for(48==o&&(48<=(o=i.charCodeAt(R+1))&&o<=57)&&I(),r=!1;R<s&&(48<=(o=i.charCodeAt(R))&&o<=57);R++);if(46==i.charCodeAt(R)){for(n=++R;n<s&&!((o=i.charCodeAt(n))<48||57<o);n++);n==R&&I(),R=n}if(101==(o=i.charCodeAt(R))||69==o){for(43!=(o=i.charCodeAt(++R))&&45!=o||R++,n=R;n<s&&!((o=i.charCodeAt(n))<48||57<o);n++);n==R&&I(),R=n}return+i.slice(e,R)}r&&I();var a=i.slice(R,R+4);if("true"==a)return R+=4,!0;if("fals"==a&&101==i.charCodeAt(R+4))return R+=5,!1;if("null"==a)return R+=4,null;I()}return"$"}function P(t,e,n){var r=W(t,e,n);r===y?delete t[e]:t[e]=r}var R,U,M=c.fromCharCode,q={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},D=function(t){var e,n;if("$"==t&&I(),"string"==typeof t){if("@"==(m?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];"]"!=(t=L());)n?","==t?"]"==(t=L())&&I():I():n=!0,","==t&&I(),e.push(D(t));return e}if("{"==t){for(e={};"}"!=(t=L());)n?","==t?"}"==(t=L())&&I():I():n=!0,","!=t&&"string"==typeof t&&"@"==(m?t.charAt(0):t[0])&&":"==L()||I(),e[t.slice(1)]=D(L());return e}I()}return t},W=function(t,e,n){var r,o=t[e];if("object"==typeof o&&o)if(g.call(o)==E)for(r=o.length;r--;)P(g,j,o);else j(o,function(t){P(o,t,n)});return n.call(t,e,o)};l.parse=function(t,e){var n,r;return R=0,U=""+t,n=D(L()),"$"!=L()&&I(),R=U=null,e&&g.call(e)==h?W(((r={})[""]=n,r),"",e):n}}}return l.runInContext=F,l}if(!e||e.global!==e&&e.window!==e&&e.self!==e||(B=e),t)F(B,t);else{var n=B.JSON,r=B.JSON3,o=!1,i=F(B,B.JSON3={"noConflict":function(){return o||(o=!0,B.JSON=n,B.JSON3=r,n=r=null),i}});B.JSON={"parse":i.parse,"stringify":i.stringify}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],56:[function(t,e,n){"use strict";var i=Object.prototype.hasOwnProperty;function s(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}n.stringify=function(t,e){e=e||"";var n,r,o=[];for(r in"string"!=typeof e&&(e="?"),t)if(i.call(t,r)){if((n=t[r])||null!=n&&!isNaN(n)||(n=""),r=encodeURIComponent(r),n=encodeURIComponent(n),null===r||null===n)continue;o.push(r+"="+n)}return o.length?e+o.join("&"):""},n.parse=function(t){for(var e,n=/([^=?&]+)=?([^&]*)/g,r={};e=n.exec(t);){var o=s(e[1]),i=s(e[2]);null===o||null===i||o in r||(r[o]=i)}return r}},{}],57:[function(t,e,n){"use strict";e.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},{}],58:[function(t,n,e){(function(i){"use strict";var d=t("requires-port"),p=t("querystringify"),s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,m=/^[a-zA-Z]:/,e=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function v(t){return(t||"").toString().replace(e,"")}var b=[["#","hash"],["?","query"],function(t,e){return g(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],a={hash:1,query:1};function y(t){var e,n=("undefined"!=typeof window?window:void 0!==i?i:"undefined"!=typeof self?self:{}).location||{},r={},o=typeof(t=t||n);if("blob:"===t.protocol)r=new x(unescape(t.pathname),{});else if("string"==o)for(e in r=new x(t,{}),a)delete r[e];else if("object"==o){for(e in t)e in a||(r[e]=t[e]);void 0===r.slashes&&(r.slashes=s.test(t.href))}return r}function g(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function w(t,e){t=v(t),e=e||{};var n,r=l.exec(t),o=r[1]?r[1].toLowerCase():"",i=!!r[2],s=!!r[3],a=0;return i?a=s?(n=r[2]+r[3]+r[4],r[2].length+r[3].length):(n=r[2]+r[4],r[2].length):s?(n=r[3]+r[4],a=r[3].length):n=r[4],"file:"===o?2<=a&&(n=n.slice(2)):g(o)?n=r[4]:o?i&&(n=n.slice(2)):2<=a&&g(e.protocol)&&(n=r[4]),{protocol:o,slashes:i||g(o),slashesCount:a,rest:n}}function x(t,e,n){if(t=v(t),!(this instanceof x))return new x(t,e,n);var r,o,i,s,a,l,u=b.slice(),c=typeof e,f=this,h=0;for("object"!=c&&"string"!=c&&(n=e,e=null),n&&"function"!=typeof n&&(n=p.parse),r=!(o=w(t||"",e=y(e))).protocol&&!o.slashes,f.slashes=o.slashes||r&&e.slashes,f.protocol=o.protocol||e.protocol||"",t=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||m.test(t))||!o.slashes&&(o.protocol||o.slashesCount<2||!g(f.protocol)))&&(u[3]=[/(.*)/,"pathname"]);h<u.length;h++)"function"!=typeof(s=u[h])?(i=s[0],l=s[1],i!=i?f[l]=t:"string"==typeof i?~(a=t.indexOf(i))&&(t="number"==typeof s[2]?(f[l]=t.slice(0,a),t.slice(a+s[2])):(f[l]=t.slice(a),t.slice(0,a))):(a=i.exec(t))&&(f[l]=a[1],t=t.slice(0,a.index)),f[l]=f[l]||r&&s[3]&&e[l]||"",s[4]&&(f[l]=f[l].toLowerCase())):t=s(t,f);n&&(f.query=n(f.query)),r&&e.slashes&&"/"!==f.pathname.charAt(0)&&(""!==f.pathname||""!==e.pathname)&&(f.pathname=function(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,o=n[r-1],i=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(i=!0),n.splice(r,1),s--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(f.pathname,e.pathname)),"/"!==f.pathname.charAt(0)&&g(f.protocol)&&(f.pathname="/"+f.pathname),d(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(s=f.auth.split(":"),f.username=s[0]||"",f.password=s[1]||""),f.origin="file:"!==f.protocol&&g(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}x.prototype={set:function(t,e,n){var r=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||p.parse)(e)),r[t]=e;break;case"port":r[t]=e,d(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,/:\d+$/.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(e){var o="pathname"===t?"/":"#";r[t]=e.charAt(0)!==o?o+e:e}else r[t]=e;break;default:r[t]=e}for(var i=0;i<b.length;i++){var s=b[i];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.origin="file:"!==r.protocol&&g(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},toString:function(t){t&&"function"==typeof t||(t=p.stringify);var e,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var o=r+(n.slashes||g(n.protocol)?"//":"");return n.username&&(o+=n.username,n.password&&(o+=":"+n.password),o+="@"),o+=n.host+n.pathname,(e="object"==typeof n.query?t(n.query):n.query)&&(o+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(o+=n.hash),o}},x.extractProtocol=w,x.location=y,x.trimLeft=v,x.qs=p,n.exports=x}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"querystringify":56,"requires-port":57}]},{},[1])(1)});
3
- //# sourceMappingURL=sockjs.min.js.map
1
+ /* sockjs-client v1.6.0 | http://sockjs.org | MIT license */
2
+ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SockJS=e()}}(function(){return function i(s,a,l){function u(t,e){if(!a[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=a[t]={exports:{}};s[t][0].call(o.exports,function(e){return u(s[t][1][e]||e)},o,o.exports,i,s,a,l)}return a[t].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(n,r,e){(function(t){(function(){"use strict";var e=n("./transport-list");r.exports=n("./main")(e),"_sockjs_onload"in t&&setTimeout(t._sockjs_onload,1)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./main":14,"./transport-list":16}],2:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./event");function i(){o.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}r(i,o),t.exports=i},{"./event":4,"inherits":54}],3:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./eventtarget");function i(){o.call(this)}r(i,o),i.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},i.prototype.once=function(t,n){var r=this,o=!1;this.on(t,function e(){r.removeListener(t,e),o||(o=!0,n.apply(this,arguments))})},i.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var n=arguments.length,r=new Array(n-1),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0;i<t.length;i++)t[i].apply(this,r)}},i.prototype.on=i.prototype.addListener=o.prototype.addEventListener,i.prototype.removeListener=o.prototype.removeEventListener,t.exports.EventEmitter=i},{"./eventtarget":5,"inherits":54}],4:[function(e,t,n){"use strict";function r(e){this.type=e}r.prototype.initEvent=function(e,t,n){return this.type=e,this.bubbles=t,this.cancelable=n,this.timeStamp=+new Date,this},r.prototype.stopPropagation=function(){},r.prototype.preventDefault=function(){},r.CAPTURING_PHASE=1,r.AT_TARGET=2,r.BUBBLING_PHASE=3,t.exports=r},{}],5:[function(e,t,n){"use strict";function r(){this._listeners={}}r.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var n=this._listeners[e];-1===n.indexOf(t)&&(n=n.concat([t])),this._listeners[e]=n},r.prototype.removeEventListener=function(e,t){var n=this._listeners[e];if(n){var r=n.indexOf(t);-1===r||(1<n.length?this._listeners[e]=n.slice(0,r).concat(n.slice(r+1)):delete this._listeners[e])}},r.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,n=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,n),t in this._listeners)for(var r=this._listeners[t],o=0;o<r.length;o++)r[o].apply(this,n)},t.exports=r},{}],6:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./event");function i(e){o.call(this),this.initEvent("message",!1,!1),this.data=e}r(i,o),t.exports=i},{"./event":4,"inherits":54}],7:[function(e,t,n){"use strict";var r=e("./utils/iframe");function o(e){(this._transport=e).on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}o.prototype._transportClose=function(e,t){r.postMessage("c",JSON.stringify([e,t]))},o.prototype._transportMessage=function(e){r.postMessage("t",e)},o.prototype._send=function(e){this._transport.send(e)},o.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},t.exports=o},{"./utils/iframe":47}],8:[function(e,t,n){"use strict";var f=e("./utils/url"),r=e("./utils/event"),h=e("./facade"),o=e("./info-iframe-receiver"),d=e("./utils/iframe"),p=e("./location"),m=function(){};t.exports=function(l,e){var u,c={};e.forEach(function(e){e.facadeTransport&&(c[e.facadeTransport.transportName]=e.facadeTransport)}),c[o.transportName]=o,l.bootstrap_iframe=function(){var a;d.currentWindowId=p.hash.slice(1);r.attachEvent("message",function(t){if(t.source===parent&&(void 0===u&&(u=t.origin),t.origin===u)){var n;try{n=JSON.parse(t.data)}catch(e){return void m("bad json",t.data)}if(n.windowId===d.currentWindowId)switch(n.type){case"s":var e;try{e=JSON.parse(n.data)}catch(e){m("bad json",n.data);break}var r=e[0],o=e[1],i=e[2],s=e[3];if(m(r,o,i,s),r!==l.version)throw new Error('Incompatible SockJS! Main site uses: "'+r+'", the iframe: "'+l.version+'".');if(!f.isOriginEqual(i,p.href)||!f.isOriginEqual(s,p.href))throw new Error("Can't connect to different domain from within an iframe. ("+p.href+", "+i+", "+s+")");a=new h(new c[o](i,s));break;case"m":a._send(n.data);break;case"c":a&&a._close(),a=null}}}),d.postMessage("s")}}},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,"debug":void 0}],9:[function(e,t,n){"use strict";var r=e("events").EventEmitter,o=e("inherits"),s=e("./utils/object"),a=function(){};function i(e,t){r.call(this);var o=this,i=+new Date;this.xo=new t("GET",e),this.xo.once("finish",function(e,t){var n,r;if(200===e){if(r=+new Date-i,t)try{n=JSON.parse(t)}catch(e){a("bad json",t)}s.isObject(n)||(n={})}o.emit("finish",n,r),o.removeAllListeners()})}o(i,r),i.prototype.close=function(){this.removeAllListeners(),this.xo.close()},t.exports=i},{"./utils/object":49,"debug":void 0,"events":3,"inherits":54}],10:[function(e,t,n){"use strict";var r=e("inherits"),o=e("events").EventEmitter,i=e("./transport/sender/xhr-local"),s=e("./info-ajax");function a(e){var n=this;o.call(this),this.ir=new s(e,i),this.ir.once("finish",function(e,t){n.ir=null,n.emit("message",JSON.stringify([e,t]))})}r(a,o),a.transportName="iframe-info-receiver",a.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},t.exports=a},{"./info-ajax":9,"./transport/sender/xhr-local":37,"events":3,"inherits":54}],11:[function(n,o,e){(function(u){(function(){"use strict";var r=n("events").EventEmitter,e=n("inherits"),i=n("./utils/event"),s=n("./transport/iframe"),a=n("./info-iframe-receiver"),l=function(){};function t(t,n){var o=this;r.call(this);function e(){var e=o.ifr=new s(a.transportName,n,t);e.once("message",function(t){if(t){var e;try{e=JSON.parse(t)}catch(e){return l("bad json",t),o.emit("finish"),void o.close()}var n=e[0],r=e[1];o.emit("finish",n,r)}o.close()}),e.once("close",function(){o.emit("finish"),o.close()})}u.document.body?e():i.attachEvent("load",e)}e(t,r),t.enabled=function(){return s.enabled()},t.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},o.exports=t}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,"debug":void 0,"events":3,"inherits":54}],12:[function(e,t,n){"use strict";var r=e("events").EventEmitter,o=e("inherits"),i=e("./utils/url"),s=e("./transport/sender/xdr"),a=e("./transport/sender/xhr-cors"),l=e("./transport/sender/xhr-local"),u=e("./transport/sender/xhr-fake"),c=e("./info-iframe"),f=e("./info-ajax"),h=function(){};function d(e,t){h(e);var n=this;r.call(this),setTimeout(function(){n.doXhr(e,t)},0)}o(d,r),d._getReceiver=function(e,t,n){return n.sameOrigin?new f(t,l):a.enabled?new f(t,a):s.enabled&&n.sameScheme?new f(t,s):c.enabled()?new c(e,t):new f(t,u)},d.prototype.doXhr=function(e,t){var n=this,r=i.addPath(e,"/info");h("doXhr",r),this.xo=d._getReceiver(e,r,t),this.timeoutRef=setTimeout(function(){h("timeout"),n._cleanup(!1),n.emit("finish")},d.timeout),this.xo.once("finish",function(e,t){h("finish",e,t),n._cleanup(!0),n.emit("finish",e,t)})},d.prototype._cleanup=function(e){h("_cleanup"),clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},d.prototype.close=function(){h("close"),this.removeAllListeners(),this._cleanup(!1)},d.timeout=8e3,t.exports=d},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,"debug":void 0,"events":3,"inherits":54}],13:[function(e,t,n){(function(e){(function(){"use strict";t.exports=e.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(x,_,e){(function(w){(function(){"use strict";x("./shims");var r,l=x("url-parse"),e=x("inherits"),u=x("./utils/random"),t=x("./utils/escape"),c=x("./utils/url"),i=x("./utils/event"),n=x("./utils/transport"),o=x("./utils/object"),f=x("./utils/browser"),h=x("./utils/log"),s=x("./event/event"),d=x("./event/eventtarget"),p=x("./location"),a=x("./event/close"),m=x("./event/trans-message"),v=x("./info-receiver"),b=function(){};function y(e,t,n){if(!(this instanceof y))return new y(e,t,n);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");d.call(this),this.readyState=y.CONNECTING,this.extensions="",this.protocol="",(n=n||{}).protocols_whitelist&&h.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=n.transports,this._transportOptions=n.transportOptions||{},this._timeout=n.timeout||0;var r=n.sessionId||8;if("function"==typeof r)this._generateSessionId=r;else{if("number"!=typeof r)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return u.string(r)}}this._server=n.server||u.numberString(1e3);var o=new l(e);if(!o.host||!o.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(o.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==o.protocol&&"https:"!==o.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+o.protocol+"' is not allowed.");var i="https:"===o.protocol;if("https:"===p.protocol&&!i&&!c.isLoopbackAddr(o.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var s=t.sort();s.forEach(function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<s.length-1&&e===s[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")});var a=c.getOrigin(p.href);this._origin=a?a.toLowerCase():null,o.set("pathname",o.pathname.replace(/\/+$/,"")),this.url=o.href,b("using url",this.url),this._urlInfo={nullOrigin:!f.hasDomain(),sameOrigin:c.isOriginEqual(this.url,p.href),sameScheme:c.isSchemeEqual(this.url,p.href)},this._ir=new v(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function g(e){return 1e3===e||3e3<=e&&e<=4999}e(y,d),y.prototype.close=function(e,t){if(e&&!g(e))throw new Error("InvalidAccessError: Invalid code");if(t&&123<t.length)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==y.CLOSING&&this.readyState!==y.CLOSED){this._close(e||1e3,t||"Normal closure",!0)}},y.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===y.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===y.OPEN&&this._transport.send(t.quote(e))},y.version=x("./version"),y.CONNECTING=0,y.OPEN=1,y.CLOSING=2,y.CLOSED=3,y.prototype._receiveInfo=function(e,t){if(b("_receiveInfo",t),this._ir=null,e){this._rto=this.countRTO(t),this._transUrl=e.base_url?e.base_url:this.url,e=o.extend(e,this._urlInfo),b("info",e);var n=r.filterToEnabled(this._transportsWhitelist,e);this._transports=n.main,b(this._transports.length+" enabled transports"),this._connect()}else this._close(1002,"Cannot connect to server")},y.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(b("attempt",e.transportName),e.needBody&&(!w.document.body||void 0!==w.document.readyState&&"complete"!==w.document.readyState&&"interactive"!==w.document.readyState))return b("waiting for body"),this._transports.unshift(e),void i.attachEvent("load",this._connect.bind(this));var t=Math.max(this._timeout,this._rto*e.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),t),b("using timeout",t);var n=c.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),r=this._transportOptions[e.transportName];b("transport url",n);var o=new e(n,this._transUrl,r);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=e.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},y.prototype._transportTimeout=function(){b("_transportTimeout"),this.readyState===y.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},y.prototype._transportMessage=function(e){b("_transportMessage",e);var t,n=this,r=e.slice(0,1),o=e.slice(1);switch(r){case"o":return void this._open();case"h":return this.dispatchEvent(new s("heartbeat")),void b("heartbeat",this.transport)}if(o)try{t=JSON.parse(o)}catch(e){b("bad json",o)}if(void 0!==t)switch(r){case"a":Array.isArray(t)&&t.forEach(function(e){b("message",n.transport,e),n.dispatchEvent(new m(e))});break;case"m":b("message",this.transport,t),this.dispatchEvent(new m(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}else b("empty payload",o)},y.prototype._transportClose=function(e,t){b("_transportClose",this.transport,e,t),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),g(e)||2e3===e||this.readyState!==y.CONNECTING?this._close(e,t):this._connect()},y.prototype._open=function(){b("_open",this._transport&&this._transport.transportName,this.readyState),this.readyState===y.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=y.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new s("open")),b("connected",this.transport)):this._close(1006,"Server lost session")},y.prototype._close=function(t,n,r){b("_close",this.transport,t,n,r,this.readyState);var o=!1;if(this._ir&&(o=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===y.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=y.CLOSING,setTimeout(function(){this.readyState=y.CLOSED,o&&this.dispatchEvent(new s("error"));var e=new a("close");e.wasClean=r||!1,e.code=t||1e3,e.reason=n,this.dispatchEvent(e),this.onmessage=this.onclose=this.onerror=null,b("disconnected")}.bind(this),0)},y.prototype.countRTO=function(e){return 100<e?4*e:300+e},_.exports=function(e){return r=n(e),x("./iframe-bootstrap")(y,e),y}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,"debug":void 0,"inherits":54,"url-parse":57}],15:[function(e,t,n){"use strict";function a(e){return"[object Function]"===i.toString.call(e)}function l(e){return"[object String]"===f.call(e)}var o,c=Array.prototype,i=Object.prototype,r=Function.prototype,s=String.prototype,u=c.slice,f=i.toString,h=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();o=h?function(e,t,n,r){!r&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)};function d(e,t,n){for(var r in t)i.hasOwnProperty.call(t,r)&&o(e,r,t[r],n)}function p(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}function m(){}d(r,{bind:function(t){var n=this;if(!a(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r=u.call(arguments,1),e=Math.max(0,n.length-r.length),o=[],i=0;i<e;i++)o.push("$"+i);var s=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this, arguments); }")(function(){if(this instanceof s){var e=n.apply(this,r.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,r.concat(u.call(arguments)))});return n.prototype&&(m.prototype=n.prototype,s.prototype=new m,m.prototype=null),s}}),d(Array,{isArray:function(e){return"[object Array]"===f.call(e)}});var v,b,y,g=Object("a"),w="a"!==g[0]||!(0 in g);d(c,{forEach:function(e,t){var n=p(this),r=w&&l(this)?this.split(""):n,o=t,i=-1,s=r.length>>>0;if(!a(e))throw new TypeError;for(;++i<s;)i in r&&e.call(o,r[i],i,n)}},(v=c.forEach,y=b=!0,v&&(v.call("foo",function(e,t,n){"object"!=typeof n&&(b=!1)}),v.call([1],function(){y="string"==typeof this},"x")),!(v&&b&&y)));var x=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);d(c,{indexOf:function(e,t){var n=w&&l(this)?this.split(""):p(this),r=n.length>>>0;if(!r)return-1;var o=0;for(1<arguments.length&&(o=function(e){var t=+e;return t!=t?t=0:0!==t&&t!==1/0&&t!==-1/0&&(t=(0<t||-1)*Math.floor(Math.abs(t))),t}(t)),o=0<=o?o:Math.max(0,r+o);o<r;o++)if(o in n&&n[o]===e)return o;return-1}},x);var _,E=s.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||1<".".split(/()()/).length?(_=void 0===/()??/.exec("")[1],s.split=function(e,t){var n=this;if(void 0===e&&0===t)return[];if("[object RegExp]"!==f.call(e))return E.call(this,e,t);var r,o,i,s,a=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),u=0;for(e=new RegExp(e.source,l+"g"),n+="",_||(r=new RegExp("^"+e.source+"$(?!\\s)",l)),t=void 0===t?-1>>>0:function(e){return e>>>0}(t);(o=e.exec(n))&&!(u<(i=o.index+o[0].length)&&(a.push(n.slice(u,o.index)),!_&&1<o.length&&o[0].replace(r,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(o[e]=void 0)}),1<o.length&&o.index<n.length&&c.push.apply(a,o.slice(1)),s=o[0].length,u=i,a.length>=t));)e.lastIndex===o.index&&e.lastIndex++;return u===n.length?!s&&e.test("")||a.push(""):a.push(n.slice(u)),a.length>t?a.slice(0,t):a}):"0".split(void 0,0).length&&(s.split=function(e,t){return void 0===e&&0===t?[]:E.call(this,e,t)});var S=s.substr,O="".substr&&"b"!=="0b".substr(-1);d(s,{substr:function(e,t){return S.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},O)},{}],16:[function(e,t,n){"use strict";t.exports=[e("./transport/websocket"),e("./transport/xhr-streaming"),e("./transport/xdr-streaming"),e("./transport/eventsource"),e("./transport/lib/iframe-wrap")(e("./transport/eventsource")),e("./transport/htmlfile"),e("./transport/lib/iframe-wrap")(e("./transport/htmlfile")),e("./transport/xhr-polling"),e("./transport/xdr-polling"),e("./transport/lib/iframe-wrap")(e("./transport/xhr-polling")),e("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(o,f,e){(function(r){(function(){"use strict";var i=o("events").EventEmitter,e=o("inherits"),s=o("../../utils/event"),a=o("../../utils/url"),l=r.XMLHttpRequest,u=function(){};function c(e,t,n,r){u(e,t);var o=this;i.call(this),setTimeout(function(){o._start(e,t,n,r)},0)}e(c,i),c.prototype._start=function(e,t,n,r){var o=this;try{this.xhr=new l}catch(e){}if(!this.xhr)return u("no xhr"),this.emit("finish",0,"no xhr support"),void this._cleanup();t=a.addQuery(t,"t="+ +new Date),this.unloadRef=s.unloadAdd(function(){u("unload cleanup"),o._cleanup(!0)});try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){u("xhr timeout"),o.emit("finish",0,""),o._cleanup(!1)})}catch(e){return u("exception",e),this.emit("finish",0,""),void this._cleanup(!1)}if(r&&r.noCredentials||!c.supportsCORS||(u("withCredentials"),this.xhr.withCredentials=!0),r&&r.headers)for(var i in r.headers)this.xhr.setRequestHeader(i,r.headers[i]);this.xhr.onreadystatechange=function(){if(o.xhr){var e,t,n=o.xhr;switch(u("readyState",n.readyState),n.readyState){case 3:try{t=n.status,e=n.responseText}catch(e){}u("status",t),1223===t&&(t=204),200===t&&e&&0<e.length&&(u("chunk"),o.emit("chunk",t,e));break;case 4:t=n.status,u("status",t),1223===t&&(t=204),12005!==t&&12029!==t||(t=0),u("finish",t,n.responseText),o.emit("finish",t,n.responseText),o._cleanup(!1)}}};try{o.xhr.send(n)}catch(e){o.emit("finish",0,""),o._cleanup(!1)}},c.prototype._cleanup=function(e){if(u("cleanup"),this.xhr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},c.prototype.close=function(){u("close"),this._cleanup(!0)},c.enabled=!!l;var t=["Active"].concat("Object").join("X");!c.enabled&&t in r&&(u("overriding xmlhttprequest"),c.enabled=!!new(l=function(){try{return new r[t]("Microsoft.XMLHTTP")}catch(e){return null}}));var n=!1;try{n="withCredentials"in new l}catch(e){}c.supportsCORS=n,f.exports=c}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],18:[function(e,t,n){(function(e){(function(){t.exports=e.EventSource}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(e,n,t){(function(e){(function(){"use strict";var t=e.WebSocket||e.MozWebSocket;n.exports=t?function(e){return new t(e)}:void 0}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./lib/ajax-based"),i=e("./receiver/eventsource"),s=e("./sender/xhr-cors"),a=e("eventsource");function l(e){if(!l.enabled())throw new Error("Transport created when disabled");o.call(this,e,"/eventsource",i,s)}r(l,o),l.enabled=function(){return!!a},l.transportName="eventsource",l.roundTrips=2,t.exports=l},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,"eventsource":18,"inherits":54}],21:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./receiver/htmlfile"),i=e("./sender/xhr-local"),s=e("./lib/ajax-based");function a(e){if(!o.enabled)throw new Error("Transport created when disabled");s.call(this,e,"/htmlfile",o,i)}r(a,s),a.enabled=function(e){return o.enabled&&e.sameOrigin},a.transportName="htmlfile",a.roundTrips=2,t.exports=a},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,"inherits":54}],22:[function(e,t,n){"use strict";var r=e("inherits"),i=e("events").EventEmitter,o=e("../version"),s=e("../utils/url"),a=e("../utils/iframe"),l=e("../utils/event"),u=e("../utils/random"),c=function(){};function f(e,t,n){if(!f.enabled())throw new Error("Transport created when disabled");i.call(this);var r=this;this.origin=s.getOrigin(n),this.baseUrl=n,this.transUrl=t,this.transport=e,this.windowId=u.string(8);var o=s.addPath(n,"/iframe.html")+"#"+this.windowId;c(e,t,o),this.iframeObj=a.createIframe(o,function(e){c("err callback"),r.emit("close",1006,"Unable to load an iframe ("+e+")"),r.close()}),this.onmessageCallback=this._message.bind(this),l.attachEvent("message",this.onmessageCallback)}r(f,i),f.prototype.close=function(){if(c("close"),this.removeAllListeners(),this.iframeObj){l.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},f.prototype._message=function(t){if(c("message",t.data),s.isOriginEqual(t.origin,this.origin)){var n;try{n=JSON.parse(t.data)}catch(e){return void c("bad json",t.data)}if(n.windowId===this.windowId)switch(n.type){case"s":this.iframeObj.loaded(),this.postMessage("s",JSON.stringify([o,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",n.data);break;case"c":var e;try{e=JSON.parse(n.data)}catch(e){return void c("bad json",n.data)}this.emit("close",e[0],e[1]),this.close()}else c("mismatched window id",n.windowId,this.windowId)}else c("not same origin",t.origin,this.origin)},f.prototype.postMessage=function(e,t){c("postMessage",e,t),this.iframeObj.post(JSON.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},f.prototype.send=function(e){c("send",e),this.postMessage("m",e)},f.enabled=function(){return a.iframeEnabled},f.transportName="iframe",f.roundTrips=2,t.exports=f},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,"debug":void 0,"events":3,"inherits":54}],23:[function(s,a,e){(function(i){(function(){"use strict";var e=s("inherits"),t=s("./lib/sender-receiver"),n=s("./receiver/jsonp"),r=s("./sender/jsonp");function o(e){if(!o.enabled())throw new Error("Transport created when disabled");t.call(this,e,"/jsonp",r,n)}e(o,t),o.enabled=function(){return!!i.document},o.transportName="jsonp-polling",o.roundTrips=1,o.needBody=!0,a.exports=o}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,"inherits":54}],24:[function(e,t,n){"use strict";var r=e("inherits"),a=e("../../utils/url"),o=e("./sender-receiver"),l=function(){};function i(e,t,n,r){o.call(this,e,t,function(s){return function(e,t,n){l("create ajax sender",e,t);var r={};"string"==typeof t&&(r.headers={"Content-type":"text/plain"});var o=a.addPath(e,"/xhr_send"),i=new s("POST",o,t,r);return i.once("finish",function(e){if(l("finish",e),i=null,200!==e&&204!==e)return n(new Error("http status "+e));n()}),function(){l("abort"),i.close(),i=null;var e=new Error("Aborted");e.code=1e3,n(e)}}}(r),n,r)}r(i,o),t.exports=i},{"../../utils/url":52,"./sender-receiver":28,"debug":void 0,"inherits":54}],25:[function(e,t,n){"use strict";var r=e("inherits"),o=e("events").EventEmitter,i=function(){};function s(e,t){i(e),o.call(this),this.sendBuffer=[],this.sender=t,this.url=e}r(s,o),s.prototype.send=function(e){i("send",e),this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},s.prototype.sendScheduleWait=function(){i("sendScheduleWait");var e,t=this;this.sendStop=function(){i("sendStop"),t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){i("timeout"),t.sendStop=null,t.sendSchedule()},25)},s.prototype.sendSchedule=function(){i("sendSchedule",this.sendBuffer.length);var t=this;if(0<this.sendBuffer.length){var e="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,e,function(e){t.sendStop=null,e?(i("error",e),t.emit("close",e.code||1006,"Sending error: "+e),t.close()):t.sendScheduleWait()}),this.sendBuffer=[]}},s.prototype._cleanup=function(){i("_cleanup"),this.removeAllListeners()},s.prototype.close=function(){i("close"),this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},t.exports=s},{"debug":void 0,"events":3,"inherits":54}],26:[function(e,n,t){(function(s){(function(){"use strict";var t=e("inherits"),o=e("../iframe"),i=e("../../utils/object");n.exports=function(r){function e(e,t){o.call(this,r.transportName,e,t)}return t(e,o),e.enabled=function(e,t){if(!s.document)return!1;var n=i.extend({},t);return n.sameOrigin=!0,r.enabled(n)&&o.enabled()},e.transportName="iframe-"+r.transportName,e.needBody=!0,e.roundTrips=o.roundTrips+r.roundTrips-1,e.facadeTransport=r,e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,"inherits":54}],27:[function(e,t,n){"use strict";var r=e("inherits"),o=e("events").EventEmitter,i=function(){};function s(e,t,n){i(t),o.call(this),this.Receiver=e,this.receiveUrl=t,this.AjaxObject=n,this._scheduleReceiver()}r(s,o),s.prototype._scheduleReceiver=function(){i("_scheduleReceiver");var n=this,r=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);r.on("message",function(e){i("message",e),n.emit("message",e)}),r.once("close",function(e,t){i("close",e,t,n.pollIsClosing),n.poll=r=null,n.pollIsClosing||("network"===t?n._scheduleReceiver():(n.emit("close",e||1006,t),n.removeAllListeners()))})},s.prototype.abort=function(){i("abort"),this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},t.exports=s},{"debug":void 0,"events":3,"inherits":54}],28:[function(e,t,n){"use strict";var r=e("inherits"),a=e("../../utils/url"),l=e("./buffered-sender"),u=e("./polling"),c=function(){};function o(e,t,n,r,o){var i=a.addPath(e,t);c(i);var s=this;l.call(this,e,n),this.poll=new u(r,i,o),this.poll.on("message",function(e){c("poll message",e),s.emit("message",e)}),this.poll.once("close",function(e,t){c("poll close",e,t),s.poll=null,s.emit("close",e,t),s.close()})}r(o,l),o.prototype.close=function(){l.prototype.close.call(this),c("close"),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},t.exports=o},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,"debug":void 0,"inherits":54}],29:[function(e,t,n){"use strict";var r=e("inherits"),o=e("events").EventEmitter,i=e("eventsource"),s=function(){};function a(e){s(e),o.call(this);var n=this,r=this.es=new i(e);r.onmessage=function(e){s("message",e.data),n.emit("message",decodeURI(e.data))},r.onerror=function(e){s("error",r.readyState,e);var t=2!==r.readyState?"network":"permanent";n._cleanup(),n._close(t)}}r(a,o),a.prototype.abort=function(){s("abort"),this._cleanup(),this._close("user")},a.prototype._cleanup=function(){s("cleanup");var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},a.prototype._close=function(e){s("close",e);var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},t.exports=a},{"debug":void 0,"events":3,"eventsource":18,"inherits":54}],30:[function(n,c,e){(function(u){(function(){"use strict";var e=n("inherits"),r=n("../../utils/iframe"),o=n("../../utils/url"),i=n("events").EventEmitter,s=n("../../utils/random"),a=function(){};function l(e){a(e),i.call(this);var t=this;r.polluteGlobalNamespace(),this.id="a"+s.string(6),e=o.addQuery(e,"c="+decodeURIComponent(r.WPrefix+"."+this.id)),a("using htmlfile",l.htmlfileEnabled);var n=l.htmlfileEnabled?r.createHtmlfile:r.createIframe;u[r.WPrefix][this.id]={start:function(){a("start"),t.iframeObj.loaded()},message:function(e){a("message",e),t.emit("message",e)},stop:function(){a("stop"),t._cleanup(),t._close("network")}},this.iframeObj=n(e,function(){a("callback"),t._cleanup(),t._close("permanent")})}e(l,i),l.prototype.abort=function(){a("abort"),this._cleanup(),this._close("user")},l.prototype._cleanup=function(){a("_cleanup"),this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete u[r.WPrefix][this.id]},l.prototype._close=function(e){a("_close",e),this.emit("close",null,e),this.removeAllListeners()},l.htmlfileEnabled=!1;var t=["Active"].concat("Object").join("X");if(t in u)try{l.htmlfileEnabled=!!new u[t]("htmlfile")}catch(e){}l.enabled=l.htmlfileEnabled||r.iframeEnabled,c.exports=l}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],31:[function(t,n,e){(function(c){(function(){"use strict";var r=t("../../utils/iframe"),i=t("../../utils/random"),s=t("../../utils/browser"),o=t("../../utils/url"),e=t("inherits"),a=t("events").EventEmitter,l=function(){};function u(e){l(e);var t=this;a.call(this),r.polluteGlobalNamespace(),this.id="a"+i.string(6);var n=o.addQuery(e,"c="+encodeURIComponent(r.WPrefix+"."+this.id));c[r.WPrefix][this.id]=this._callback.bind(this),this._createScript(n),this.timeoutId=setTimeout(function(){l("timeout"),t._abort(new Error("JSONP script loaded abnormally (timeout)"))},u.timeout)}e(u,a),u.prototype.abort=function(){if(l("abort"),c[r.WPrefix][this.id]){var e=new Error("JSONP user aborted read");e.code=1e3,this._abort(e)}},u.timeout=35e3,u.scriptErrorTimeout=1e3,u.prototype._callback=function(e){l("_callback",e),this._cleanup(),this.aborting||(e&&(l("message",e),this.emit("message",e)),this.emit("close",null,"network"),this.removeAllListeners())},u.prototype._abort=function(e){l("_abort",e),this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},u.prototype._cleanup=function(){if(l("_cleanup"),clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var e=this.script;e.parentNode.removeChild(e),e.onreadystatechange=e.onerror=e.onload=e.onclick=null,this.script=null}delete c[r.WPrefix][this.id]},u.prototype._scriptError=function(){l("_scriptError");var e=this;this.errorTimer||(this.errorTimer=setTimeout(function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))},u.scriptErrorTimeout))},u.prototype._createScript=function(e){l("_createScript",e);var t,n=this,r=this.script=c.document.createElement("script");if(r.id="a"+i.string(8),r.src=e,r.type="text/javascript",r.charset="UTF-8",r.onerror=this._scriptError.bind(this),r.onload=function(){l("onload"),n._abort(new Error("JSONP script loaded abnormally (onload)"))},r.onreadystatechange=function(){if(l("onreadystatechange",r.readyState),/loaded|closed/.test(r.readyState)){if(r&&r.htmlFor&&r.onclick){n.loadedOkay=!0;try{r.onclick()}catch(e){}}r&&n._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===r.async&&c.document.attachEvent)if(s.isOpera())(t=this.script2=c.document.createElement("script")).text="try{var a = document.getElementById('"+r.id+"'); if(a)a.onerror();}catch(x){};",r.async=t.async=!1;else{try{r.htmlFor=r.id,r.event="onclick"}catch(e){}r.async=!0}void 0!==r.async&&(r.async=!0);var o=c.document.getElementsByTagName("head")[0];o.insertBefore(r,o.firstChild),t&&o.insertBefore(t,o.firstChild)},n.exports=u}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],32:[function(e,t,n){"use strict";var r=e("inherits"),o=e("events").EventEmitter,i=function(){};function s(e,t){i(e),o.call(this);var r=this;this.bufferPosition=0,this.xo=new t("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,t){i("finish",e,t),r._chunkHandler(e,t),r.xo=null;var n=200===e?"network":"permanent";i("close",n),r.emit("close",null,n),r._cleanup()})}r(s,o),s.prototype._chunkHandler=function(e,t){if(i("_chunkHandler",e),200===e&&t)for(var n=-1;;this.bufferPosition+=n+1){var r=t.slice(this.bufferPosition);if(-1===(n=r.indexOf("\n")))break;var o=r.slice(0,n);o&&(i("message",o),this.emit("message",o))}},s.prototype._cleanup=function(){i("_cleanup"),this.removeAllListeners()},s.prototype.abort=function(){i("abort"),this.xo&&(this.xo.close(),i("close"),this.emit("close",null,"user"),this.xo=null),this._cleanup()},t.exports=s},{"debug":void 0,"events":3,"inherits":54}],33:[function(e,t,n){(function(f){(function(){"use strict";var s,a,l=e("../../utils/random"),u=e("../../utils/url"),c=function(){};t.exports=function(e,t,n){c(e,t),s||(c("createForm"),(s=f.document.createElement("form")).style.display="none",s.style.position="absolute",s.method="POST",s.enctype="application/x-www-form-urlencoded",s.acceptCharset="UTF-8",(a=f.document.createElement("textarea")).name="d",s.appendChild(a),f.document.body.appendChild(s));var r="a"+l.string(8);s.target=r,s.action=u.addQuery(u.addPath(e,"/jsonp_send"),"i="+r);var o=function(t){c("createIframe",t);try{return f.document.createElement('<iframe name="'+t+'">')}catch(e){var n=f.document.createElement("iframe");return n.name=t,n}}(r);o.id=r,o.style.display="none",s.appendChild(o);try{a.value=t}catch(e){}s.submit();function i(e){c("completed",r,e),o.onerror&&(o.onreadystatechange=o.onerror=o.onload=null,setTimeout(function(){c("cleaning up",r),o.parentNode.removeChild(o),o=null},500),a.value="",n(e))}return o.onerror=function(){c("onerror",r),i()},o.onload=function(){c("onload",r),i()},o.onreadystatechange=function(e){c("onreadystatechange",r,o.readyState,e),"complete"===o.readyState&&i()},function(){c("aborted",r),i(new Error("Aborted"))}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/random":50,"../../utils/url":52,"debug":void 0}],34:[function(r,u,e){(function(l){(function(){"use strict";var o=r("events").EventEmitter,e=r("inherits"),i=r("../../utils/event"),t=r("../../utils/browser"),s=r("../../utils/url"),a=function(){};function n(e,t,n){a(e,t);var r=this;o.call(this),setTimeout(function(){r._start(e,t,n)},0)}e(n,o),n.prototype._start=function(e,t,n){a("_start");var r=this,o=new l.XDomainRequest;t=s.addQuery(t,"t="+ +new Date),o.onerror=function(){a("onerror"),r._error()},o.ontimeout=function(){a("ontimeout"),r._error()},o.onprogress=function(){a("progress",o.responseText),r.emit("chunk",200,o.responseText)},o.onload=function(){a("load"),r.emit("finish",200,o.responseText),r._cleanup(!1)},this.xdr=o,this.unloadRef=i.unloadAdd(function(){r._cleanup(!0)});try{this.xdr.open(e,t),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(n)}catch(e){this._error()}},n.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},n.prototype._cleanup=function(e){if(a("cleanup",e),this.xdr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},n.prototype.close=function(){a("close"),this._cleanup(!0)},n.enabled=!(!l.XDomainRequest||!t.hasDomain()),u.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,"debug":void 0,"events":3,"inherits":54}],35:[function(e,t,n){"use strict";var r=e("inherits"),o=e("../driver/xhr");function i(e,t,n,r){o.call(this,e,t,n,r)}r(i,o),i.enabled=o.enabled&&o.supportsCORS,t.exports=i},{"../driver/xhr":17,"inherits":54}],36:[function(e,t,n){"use strict";var r=e("events").EventEmitter;function o(){var e=this;r.call(this),this.to=setTimeout(function(){e.emit("finish",200,"{}")},o.timeout)}e("inherits")(o,r),o.prototype.close=function(){clearTimeout(this.to)},o.timeout=2e3,t.exports=o},{"events":3,"inherits":54}],37:[function(e,t,n){"use strict";var r=e("inherits"),o=e("../driver/xhr");function i(e,t,n){o.call(this,e,t,n,{noCredentials:!0})}r(i,o),i.enabled=o.enabled,t.exports=i},{"../driver/xhr":17,"inherits":54}],38:[function(e,t,n){"use strict";var i=e("../utils/event"),s=e("../utils/url"),r=e("inherits"),a=e("events").EventEmitter,l=e("./driver/websocket"),u=function(){};function c(e,t,n){if(!c.enabled())throw new Error("Transport created when disabled");a.call(this),u("constructor",e);var r=this,o=s.addPath(e,"/websocket");o="https"===o.slice(0,5)?"wss"+o.slice(5):"ws"+o.slice(4),this.url=o,this.ws=new l(this.url,[],n),this.ws.onmessage=function(e){u("message event",e.data),r.emit("message",e.data)},this.unloadRef=i.unloadAdd(function(){u("unload"),r.ws.close()}),this.ws.onclose=function(e){u("close event",e.code,e.reason),r.emit("close",e.code,e.reason),r._cleanup()},this.ws.onerror=function(e){u("error event",e),r.emit("close",1006,"WebSocket connection broken"),r._cleanup()}}r(c,a),c.prototype.send=function(e){var t="["+e+"]";u("send",t),this.ws.send(t)},c.prototype.close=function(){u("close");var e=this.ws;this._cleanup(),e&&e.close()},c.prototype._cleanup=function(){u("_cleanup");var e=this.ws;e&&(e.onmessage=e.onclose=e.onerror=null),i.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},c.enabled=function(){return u("enabled"),!!l},c.transportName="websocket",c.roundTrips=2,t.exports=c},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,"debug":void 0,"events":3,"inherits":54}],39:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./lib/ajax-based"),i=e("./xdr-streaming"),s=e("./receiver/xhr"),a=e("./sender/xdr");function l(e){if(!a.enabled)throw new Error("Transport created when disabled");o.call(this,e,"/xhr",s,a)}r(l,o),l.enabled=i.enabled,l.transportName="xdr-polling",l.roundTrips=2,t.exports=l},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,"inherits":54}],40:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./lib/ajax-based"),i=e("./receiver/xhr"),s=e("./sender/xdr");function a(e){if(!s.enabled)throw new Error("Transport created when disabled");o.call(this,e,"/xhr_streaming",i,s)}r(a,o),a.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&(s.enabled&&e.sameScheme)},a.transportName="xdr-streaming",a.roundTrips=2,t.exports=a},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"inherits":54}],41:[function(e,t,n){"use strict";var r=e("inherits"),o=e("./lib/ajax-based"),i=e("./receiver/xhr"),s=e("./sender/xhr-cors"),a=e("./sender/xhr-local");function l(e){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");o.call(this,e,"/xhr",i,s)}r(l,o),l.enabled=function(e){return!e.nullOrigin&&(!(!a.enabled||!e.sameOrigin)||s.enabled)},l.transportName="xhr-polling",l.roundTrips=2,t.exports=l},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":54}],42:[function(l,u,e){(function(a){(function(){"use strict";var e=l("inherits"),t=l("./lib/ajax-based"),n=l("./receiver/xhr"),r=l("./sender/xhr-cors"),o=l("./sender/xhr-local"),i=l("../utils/browser");function s(e){if(!o.enabled&&!r.enabled)throw new Error("Transport created when disabled");t.call(this,e,"/xhr_streaming",n,r)}e(s,t),s.enabled=function(e){return!e.nullOrigin&&(!i.isOpera()&&r.enabled)},s.transportName="xhr-streaming",s.roundTrips=2,s.needBody=!!a.document,u.exports=s}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":54}],43:[function(e,t,n){(function(n){(function(){"use strict";n.crypto&&n.crypto.getRandomValues?t.exports.randomBytes=function(e){var t=new Uint8Array(e);return n.crypto.getRandomValues(t),t}:t.exports.randomBytes=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=Math.floor(256*Math.random());return t}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(e,t,n){(function(e){(function(){"use strict";t.exports={isOpera:function(){return e.navigator&&/opera/i.test(e.navigator.userAgent)},isKonqueror:function(){return e.navigator&&/konqueror/i.test(e.navigator.userAgent)},hasDomain:function(){if(!e.document)return!0;try{return!!e.document.domain}catch(e){return!1}}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,t,n){"use strict";var r,o=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;t.exports={quote:function(e){var t=JSON.stringify(e);return o.lastIndex=0,o.test(t)?(r=r||function(e){var t,n={},r=[];for(t=0;t<65536;t++)r.push(String.fromCharCode(t));return e.lastIndex=0,r.join("").replace(e,function(e){return n[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""}),e.lastIndex=0,n}(o),t.replace(o,function(e){return r[e]})):t}}},{}],46:[function(e,t,n){(function(s){(function(){"use strict";var n=e("./random"),r={},o=!1,i=s.chrome&&s.chrome.app&&s.chrome.app.runtime;t.exports={attachEvent:function(e,t){void 0!==s.addEventListener?s.addEventListener(e,t,!1):s.document&&s.attachEvent&&(s.document.attachEvent("on"+e,t),s.attachEvent("on"+e,t))},detachEvent:function(e,t){void 0!==s.addEventListener?s.removeEventListener(e,t,!1):s.document&&s.detachEvent&&(s.document.detachEvent("on"+e,t),s.detachEvent("on"+e,t))},unloadAdd:function(e){if(i)return null;var t=n.string(8);return r[t]=e,o&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in r&&delete r[e]},triggerUnloadCallbacks:function(){for(var e in r)r[e](),delete r[e]}};i||t.exports.attachEvent("unload",function(){o||(o=!0,t.exports.triggerUnloadCallbacks())})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./random":50}],47:[function(t,p,e){(function(d){(function(){"use strict";var f=t("./event"),e=t("./browser"),h=function(){};p.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){p.exports.WPrefix in d||(d[p.exports.WPrefix]={})},postMessage:function(e,t){d.parent!==d?d.parent.postMessage(JSON.stringify({windowId:p.exports.currentWindowId,type:e,data:t||""}),"*"):h("Cannot postMessage, no parent window.",e,t)},createIframe:function(e,t){function n(){h("unattach"),clearTimeout(i);try{a.onload=null}catch(e){}a.onerror=null}function r(){h("cleanup"),a&&(n(),setTimeout(function(){a&&a.parentNode.removeChild(a),a=null},0),f.unloadDel(s))}function o(e){h("onerror",e),a&&(r(),t(e))}var i,s,a=d.document.createElement("iframe");return a.src=e,a.style.display="none",a.style.position="absolute",a.onerror=function(){o("onerror")},a.onload=function(){h("onload"),clearTimeout(i),i=setTimeout(function(){o("onload timeout")},2e3)},d.document.body.appendChild(a),i=setTimeout(function(){o("timeout")},15e3),s=f.unloadAdd(r),{post:function(e,t){h("post",e,t),setTimeout(function(){try{a&&a.contentWindow&&a.contentWindow.postMessage(e,t)}catch(e){}},0)},cleanup:r,loaded:n}},createHtmlfile:function(e,t){function n(){clearTimeout(i),a.onerror=null}function r(){u&&(n(),f.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())}function o(e){h("onerror",e),u&&(r(),t(e))}var i,s,a,l=["Active"].concat("Object").join("X"),u=new d[l]("htmlfile");u.open(),u.write('<html><script>document.domain="'+d.document.domain+'";<\/script></html>'),u.close(),u.parentWindow[p.exports.WPrefix]=d[p.exports.WPrefix];var c=u.createElement("div");return u.body.appendChild(c),a=u.createElement("iframe"),c.appendChild(a),a.src=e,a.onerror=function(){o("onerror")},i=setTimeout(function(){o("timeout")},15e3),s=f.unloadAdd(r),{post:function(e,t){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)},0)}catch(e){}},cleanup:r,loaded:n}}},p.exports.iframeEnabled=!1,d.document&&(p.exports.iframeEnabled=("function"==typeof d.postMessage||"object"==typeof d.postMessage)&&!e.isKonqueror())}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./browser":44,"./event":46,"debug":void 0}],48:[function(e,t,n){(function(r){(function(){"use strict";var n={};["log","debug","warn"].forEach(function(e){var t;try{t=r.console&&r.console[e]&&r.console[e].apply}catch(e){}n[e]=t?function(){return r.console[e].apply(r.console,arguments)}:"log"===e?function(){}:n.log}),t.exports=n}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],49:[function(e,t,n){"use strict";t.exports={isObject:function(e){var t=typeof e;return"function"==t||"object"==t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,n,r=1,o=arguments.length;r<o;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}}},{}],50:[function(e,t,n){"use strict";var i=e("crypto"),s="abcdefghijklmnopqrstuvwxyz012345";t.exports={string:function(e){for(var t=s.length,n=i.randomBytes(e),r=[],o=0;o<e;o++)r.push(s.substr(n[o]%t,1));return r.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}},{"crypto":43}],51:[function(e,t,n){"use strict";var o=function(){};t.exports=function(e){return{filterToEnabled:function(t,n){var r={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach(function(e){e&&("websocket"!==e.transportName||!1!==n.websocket?t.length&&-1===t.indexOf(e.transportName)?o("not in whitelist",e.transportName):e.enabled(n)?(o("enabled",e.transportName),r.main.push(e),e.facadeTransport&&r.facade.push(e.facadeTransport)):o("disabled",e.transportName):o("disabled from server","websocket"))}),r}}}},{"debug":void 0}],52:[function(e,t,n){"use strict";var r=e("url-parse"),o=function(){};t.exports={getOrigin:function(e){if(!e)return null;var t=new r(e);if("file:"===t.protocol)return null;var n=t.port;return n=n||("https:"===t.protocol?"443":"80"),t.protocol+"//"+t.hostname+":"+n},isOriginEqual:function(e,t){var n=this.getOrigin(e)===this.getOrigin(t);return o("same",e,t,n),n},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var n=e.split("?");return n[0]+t+(n[1]?"?"+n[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}}},{"debug":void 0,"url-parse":57}],53:[function(e,t,n){t.exports="1.6.0"},{}],54:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],55:[function(e,t,n){"use strict";var i=Object.prototype.hasOwnProperty;function s(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}n.stringify=function(e,t){t=t||"";var n,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(i.call(e,r)){if((n=e[r])||null!=n&&!isNaN(n)||(n=""),r=encodeURIComponent(r),n=encodeURIComponent(n),null===r||null===n)continue;o.push(r+"="+n)}return o.length?t+o.join("&"):""},n.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=s(t[1]),i=s(t[2]);null===o||null===i||o in r||(r[o]=i)}return r}},{}],56:[function(e,t,n){"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],57:[function(e,n,t){(function(a){(function(){"use strict";var d=e("requires-port"),p=e("querystringify"),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,m=/[\n\r\t]/g,i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,v=/^[a-zA-Z]:/;function b(e){return(e||"").toString().replace(t,"")}var y=[["#","hash"],["?","query"],function(e,t){return w(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],s={hash:1,query:1};function g(e){var t,n=("undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{}).location||{},r={},o=typeof(e=e||n);if("blob:"===e.protocol)r=new _(unescape(e.pathname),{});else if("string"==o)for(t in r=new _(e,{}),s)delete r[t];else if("object"==o){for(t in e)t in s||(r[t]=e[t]);void 0===r.slashes&&(r.slashes=i.test(e.href))}return r}function w(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function x(e,t){e=(e=b(e)).replace(m,""),t=t||{};var n,r=u.exec(e),o=r[1]?r[1].toLowerCase():"",i=!!r[2],s=!!r[3],a=0;return i?a=s?(n=r[2]+r[3]+r[4],r[2].length+r[3].length):(n=r[2]+r[4],r[2].length):s?(n=r[3]+r[4],a=r[3].length):n=r[4],"file:"===o?2<=a&&(n=n.slice(2)):w(o)?n=r[4]:o?i&&(n=n.slice(2)):2<=a&&w(t.protocol)&&(n=r[4]),{protocol:o,slashes:i||w(o),slashesCount:a,rest:n}}function _(e,t,n){if(e=(e=b(e)).replace(m,""),!(this instanceof _))return new _(e,t,n);var r,o,i,s,a,l,u=y.slice(),c=typeof t,f=this,h=0;for("object"!=c&&"string"!=c&&(n=t,t=null),n&&"function"!=typeof n&&(n=p.parse),r=!(o=x(e||"",t=g(t))).protocol&&!o.slashes,f.slashes=o.slashes||r&&t.slashes,f.protocol=o.protocol||t.protocol||"",e=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||v.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!w(f.protocol)))&&(u[3]=[/(.*)/,"pathname"]);h<u.length;h++)"function"!=typeof(s=u[h])?(i=s[0],l=s[1],i!=i?f[l]=e:"string"==typeof i?~(a="@"===i?e.lastIndexOf(i):e.indexOf(i))&&(e="number"==typeof s[2]?(f[l]=e.slice(0,a),e.slice(a+s[2])):(f[l]=e.slice(a),e.slice(0,a))):(a=i.exec(e))&&(f[l]=a[1],e=e.slice(0,a.index)),f[l]=f[l]||r&&s[3]&&t[l]||"",s[4]&&(f[l]=f[l].toLowerCase())):e=s(e,f);n&&(f.query=n(f.query)),r&&t.slashes&&"/"!==f.pathname.charAt(0)&&(""!==f.pathname||""!==t.pathname)&&(f.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(i=!0),n.splice(r,1),s--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(f.pathname,t.pathname)),"/"!==f.pathname.charAt(0)&&w(f.protocol)&&(f.pathname="/"+f.pathname),d(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(~(a=f.auth.indexOf(":"))?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin="file:"!==f.protocol&&w(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}_.prototype={set:function(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||p.parse)(t)),r[e]=t;break;case"port":r[e]=t,d(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,l.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";r[e]=t.charAt(0)!==o?o+t:t}else r[e]=t;break;case"username":case"password":r[e]=encodeURIComponent(t);break;case"auth":var i=t.indexOf(":");~i?(r.username=t.slice(0,i),r.username=encodeURIComponent(decodeURIComponent(r.username)),r.password=t.slice(i+1),r.password=encodeURIComponent(decodeURIComponent(r.password))):r.username=encodeURIComponent(decodeURIComponent(t))}for(var s=0;s<y.length;s++){var a=y[s];a[4]&&(r[a[1]]=r[a[1]].toLowerCase())}return r.auth=r.password?r.username+":"+r.password:r.username,r.origin="file:"!==r.protocol&&w(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},toString:function(e){e&&"function"==typeof e||(e=p.stringify);var t,n=this,r=n.host,o=n.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(n.protocol&&n.slashes||w(n.protocol)?"//":"");return n.username?(i+=n.username,n.password&&(i+=":"+n.password),i+="@"):n.password?(i+=":"+n.password,i+="@"):"file:"!==n.protocol&&w(n.protocol)&&!r&&"/"!==n.pathname&&(i+="@"),(":"===r[r.length-1]||l.test(n.hostname)&&!n.port)&&(r+=":"),i+=r+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(i+=n.hash),i}},_.extractProtocol=x,_.location=g,_.trimLeft=b,_.qs=p,n.exports=_}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"querystringify":55,"requires-port":56}]},{},[1])(1)});
3
+ //# sourceMappingURL=sockjs.min.js.map
@@ -733,20 +733,28 @@ map.on('contextmenu', function(e) {
733
733
  }
734
734
  });
735
735
 
736
+
737
+ // Layer control based on select box rather than radio buttons.
738
+ //var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map);
739
+ layercontrol = L.control.layers(basemaps, overlays);
740
+
736
741
  // Add all the base layer maps if we are online.
737
742
  var addBaseMaps = function(maplist,first) {
738
- //console.log("MAPS",first,maplist)
739
- if (navigator.onLine) {
740
- var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite",
741
- EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic",
742
- UKOS:"UK OS OpenData", UKOS45:"UK OS 1919-1947", UKOS00:"UK OS 1900", OpTop:"Open Topo Map",
743
- HB:"Hike Bike OSM", ST:"Stamen Topography", SW: "Stamen Watercolor", AN:"AutoNavi (Chinese)"
744
- }
743
+ // console.log("MAPS",first,maplist)
744
+ var layerlookup = { OSMG:"OSM grey", OSMC:"OSM", OSMH:"OSM Humanitarian", EsriC:"Esri", EsriS:"Esri Satellite",
745
+ EsriR:"Esri Relief", EsriT:"Esri Topography", EsriO:"Esri Ocean", EsriDG:"Esri Dark Grey", NatGeo: "National Geographic",
746
+ UKOS:"UK OS OpenData", OS45:"UK OS 1919-1947", OS00:"UK OS 1900", OpTop:"Open Topo Map",
747
+ HB:"Hike Bike OSM", ST:"Stamen Topography", SW:"Stamen Watercolor", AN:"AutoNavi (Chinese)"
748
+ }
745
749
 
750
+ if (navigator.onLine) {
746
751
  // Use this for OSM online maps
747
752
  var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
748
753
  var osmAttrib='Map data © OpenStreetMap contributors';
749
754
 
755
+ if (maplist.indexOf("MB3d")!==-1) { // handle the case of 3d by redirecting to that page instead.
756
+ window.location.href("index3d.html");
757
+ }
750
758
  if (maplist.indexOf("OSMG")!==-1) {
751
759
  basemaps[layerlookup["OSMG"]] = new L.TileLayer.Grayscale(osmUrl, {
752
760
  attribution:osmAttrib,
@@ -900,18 +908,19 @@ var addBaseMaps = function(maplist,first) {
900
908
  attribution: 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, under <a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'
901
909
  });
902
910
  }
911
+ }
903
912
 
904
- if (first) {
905
- if (layerlookup[first]) { basemaps[layerlookup[first]].addTo(map); }
906
- else { basemaps[first].addTo(map); }
907
- }
908
- else {
909
- basemaps[Object.keys(basemaps)[0]].addTo(map);
910
- }
911
- if (showLayerMenu) {
912
- map.removeControl(layercontrol);
913
- layercontrol = L.control.layers(basemaps, overlays).addTo(map);
914
- }
913
+ if (first) {
914
+ if (layerlookup[first]) { baselayername = layerlookup[first]; }
915
+ else { basenayername = first; }
916
+ }
917
+ else {
918
+ basenayername = Object.keys(basemaps)[0];
919
+ }
920
+ basemaps[baselayername].addTo(map);
921
+ if (showLayerMenu) {
922
+ map.removeControl(layercontrol);
923
+ layercontrol = L.control.layers(basemaps, overlays).addTo(map);
915
924
  }
916
925
  }
917
926
 
@@ -957,7 +966,7 @@ var addOverlays = function(overlist) {
957
966
  });
958
967
  var changeDrawColour = function(col) {
959
968
  drawingColour = col;
960
- console.log("COLOR",col)
969
+ // console.log("COLOR",col)
961
970
  drawControl.setDrawingOptions({
962
971
  polyline: { shapeOptions: { color:drawingColour } },
963
972
  circle: { shapeOptions: { color:drawingColour } },
@@ -1108,7 +1117,7 @@ var addOverlays = function(overlist) {
1108
1117
  }
1109
1118
 
1110
1119
  // Add the countries (world-110m) for offline use
1111
- if (overlist.indexOf("CO")!==-1 || (!navigator.onLine)) {
1120
+ if (overlist.indexOf("CO") !== -1 || !navigator.onLine) {
1112
1121
  var customTopoLayer = L.geoJson(null, {clickable:false, style: {color:"blue", weight:2, fillColor:"#cf6", fillOpacity:0.04}});
1113
1122
  layers["_countries"] = omnivore.topojson('images/world-50m-flat.json',null,customTopoLayer);
1114
1123
  overlays["countries"] = layers["_countries"];
@@ -1193,10 +1202,6 @@ var addOverlays = function(overlist) {
1193
1202
  }
1194
1203
  }
1195
1204
 
1196
- // Layer control based on select box rather than radio buttons.
1197
- //var layercontrol = L.control.selectLayers(basemaps, overlays).addTo(map);
1198
- layercontrol = L.control.layers(basemaps, overlays);
1199
-
1200
1205
  // Add the layers control widget
1201
1206
  if (!inIframe) { layercontrol.addTo(map); }
1202
1207
  else { showLayerMenu = false;}
@@ -1441,12 +1446,10 @@ function setMarker(data) {
1441
1446
  }
1442
1447
  if (data.hasOwnProperty("greatcircle") && Array.isArray(data.greatcircle) && data.greatcircle.length === 2) {
1443
1448
  delete opt.fill;
1444
- //opt.vertices = opt.vertices || 100;
1449
+ opt.vertices = opt.vertices || 20;
1445
1450
  if (!data.hasOwnProperty("weight")) { opt.weight = 3; } //Standard settings different for lines
1446
1451
  if (!data.hasOwnProperty("opacity")) { opt.opacity = 0.8; }
1447
1452
  var greatc = L.Polyline.Arc(data.greatcircle[0], data.greatcircle[1], opt);
1448
- // // opt.smoothFactor= 1;
1449
- // // opt.noWrap = true;
1450
1453
  var aml = new L.Wrapped.Polyline(greatc._latlngs, opt);
1451
1454
 
1452
1455
  polygons[data.name] = rightmenu(aml);
@@ -2223,7 +2226,7 @@ function doCommand(cmd) {
2223
2226
  var existsalready = false;
2224
2227
  // Add a new base map layer
2225
2228
  if (cmd.map && cmd.map.hasOwnProperty("name") && cmd.map.name.length>0 && cmd.map.hasOwnProperty("url") && cmd.map.hasOwnProperty("opt")) {
2226
- console.log("BASE",cmd.map);
2229
+ // console.log("BASE",cmd.map);
2227
2230
  if (basemaps.hasOwnProperty(cmd.map.name)) { existsalready = true; }
2228
2231
  if (cmd.map.hasOwnProperty("wms")) { // special case for wms
2229
2232
  console.log("New WMS:",cmd.map.name);
@@ -2522,6 +2525,7 @@ function doCommand(cmd) {
2522
2525
  baselayername = cmd.layer;
2523
2526
  basemaps[baselayername].addTo(map);
2524
2527
  }
2528
+ // If set to none then remove the baselayer...
2525
2529
  if (cmd.layer && (cmd.layer === "none")) {
2526
2530
  map.removeLayer(basemaps[baselayername]);
2527
2531
  baselayername = cmd.layer;
@@ -2660,14 +2664,25 @@ function doGeojson(n,g,l,o) {
2660
2664
  }}
2661
2665
  opt.pointToLayer = function (feature, latlng) {
2662
2666
  var myMarker;
2667
+ if (feature.properties.hasOwnProperty("icon")) {
2668
+ var regi = /^[S,G,E,I,O][A-Z]{3}.*/i; // if it looks like a SIDC code
2669
+ if (regi.test(feature.properties.icon)) {
2670
+ feature.properties.SIDC = (feature.properties.icon.toUpperCase()+"------------").substr(0,12);
2671
+ delete feature.properties.icon;
2672
+ }
2673
+ }
2663
2674
  if (feature.properties.hasOwnProperty("SIDC")) {
2664
2675
  myMarker = new ms.Symbol( feature.properties.SIDC.toUpperCase(), {
2665
- uniqueDesignation:unescape(encodeURIComponent(feature.properties.title)) ,
2676
+ uniqueDesignation:unescape(encodeURIComponent(feature.properties.title||feature.properties.unit)),
2666
2677
  country:feature.properties.country,
2667
2678
  direction:feature.properties.bearing,
2668
2679
  additionalInformation:feature.properties.modifier,
2669
- size:24
2680
+ size:25
2670
2681
  });
2682
+ if (myMarker.hasOwnProperty("metadata") && myMarker.metadata.hasOwnProperty("echelon")) {
2683
+ var sz = iconSz[myMarker.metadata.echelon];
2684
+ myMarker.setOptions({size:sz});
2685
+ }
2671
2686
  myMarker = L.icon({
2672
2687
  iconUrl: myMarker.toDataURL(),
2673
2688
  iconAnchor: [myMarker.getAnchor().x, myMarker.getAnchor().y],
package/worldmap.html CHANGED
@@ -173,7 +173,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
173
173
  <label for="node-input-maplist"><i class="fa fa-list"></i> Map list</label>
174
174
  <input type="text" id="node-input-maplist" placeholder="List of Maps">
175
175
  </div>
176
- <div class="form-row">
176
+ <div class="form-row" id="node-input-baselayer">
177
177
  <label for="node-input-layer"><i class="fa fa-map"></i> Base map</label>
178
178
  <input type="text" id="node-input-layer" placeholder="Initial Map">
179
179
  </div>
@@ -188,7 +188,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
188
188
  <input type="checkbox" id="node-input-mapwms" style="display:inline-block; width:20px; vertical-align:baseline;">
189
189
  Map server uses WMS
190
190
  </div>
191
- <div class="form-row">
191
+ <div class="form-row" id="node-input-overlaylist">
192
192
  <label for="node-input-overlist"><i class="fa fa-map-o"></i> Overlays</label>
193
193
  <input type="text" id="node-input-overlist" placeholder="Initial Overlays">
194
194
  </div>
@@ -369,7 +369,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
369
369
  allowFileDrop: {value:"false"},
370
370
  path: {value:"/worldmap"},
371
371
  overlist: {value:"DR,CO,RA,DN,HM"},
372
- maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW"},
372
+ maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS"},
373
373
  mapname: {value:""},
374
374
  mapurl: {value:""},
375
375
  mapopt: {value:"", validate:function(v) {try{ v.length===0 || JSON.parse(v); return true;} catch(e) {return false;}}},
@@ -391,8 +391,8 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
391
391
  oneditprepare: function() {
392
392
  var mshort;
393
393
  if (this.maplist === undefined) {
394
- $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
395
- this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
394
+ $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop");
395
+ this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop";
396
396
  }
397
397
  if (this.overlist === undefined) {
398
398
  $("#node-input-overlist").val("DR,CO,RA,DN,HM");
@@ -482,7 +482,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
482
482
  allowFileDrop: {value:"false"},
483
483
  path: {value:"/worldmap"},
484
484
  overlist: {value:"DR,CO,RA,DN,HM"},
485
- maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS,SW"},
485
+ maplist: {value:"OSMG,OSMC,EsriC,EsriS,EsriT,EsriDG,UKOS"},
486
486
  mapname: {value:""},
487
487
  mapurl: {value:""},
488
488
  mapopt: {value:""},
@@ -502,8 +502,8 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
502
502
  oneditprepare: function() {
503
503
  var mshort;
504
504
  if (this.maplist === undefined) {
505
- $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW");
506
- this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop,SW";
505
+ $("#node-input-maplist").val("OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop");
506
+ this.maplist = "OSMG,OSMC,EsriC,EsriS,EsriT,EsriO,EsriDG,NatGeo,UKOS,OpTop";
507
507
  }
508
508
  if (this.overlist === undefined) {
509
509
  $("#node-input-overlist").val("DR,CO,RA,DN,HM");
@@ -512,7 +512,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
512
512
  $("#node-input-maplist").typedInput({type:"mapitem", types:[{
513
513
  value: "mapitem",
514
514
  multiple: true,
515
- options: mlist
515
+ options: mlist.concat([{ value:"MB3d", label:"Mapbox 3D" }])
516
516
  }]});
517
517
  $("#node-input-layer").typedInput({type:"laye", types:[{
518
518
  value: "laye",
@@ -524,8 +524,20 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
524
524
  options: olist
525
525
  }]});
526
526
  $("#node-input-maplist").on('change', function(event, type, value) {
527
- mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
528
- mshort.push({ value:"Custom", label:"Custom Map Provider" });
527
+ if (value.indexOf("MB3d") > -1) {
528
+ mshort = [{ value:"MB3d", label:"Mapbox 3D" }];
529
+ $('#node-input-maplist option').prop('selected', false);
530
+ $("#node-input-maplist").val("MB3d");
531
+ this.maplist = "MB3d";
532
+ $("#node-input-baselayer").hide();
533
+ $("#node-input-overlaylist").hide();
534
+ }
535
+ else {
536
+ $("#node-input-baselayer").show();
537
+ $("#node-input-overlaylist").show();
538
+ mshort = mlist.filter(e => value.indexOf(e.value)!==-1);
539
+ mshort.push({ value:"Custom", label:"Custom Map Provider" });
540
+ }
529
541
  $("#node-input-layer").typedInput("types", [{
530
542
  value: "laye",
531
543
  options: mshort
package/worldmap.js CHANGED
@@ -56,7 +56,13 @@ module.exports = function(RED) {
56
56
  node.log("started at "+node.path);
57
57
  var clients = {};
58
58
  RED.httpNode.get("/-worldmap3d-key", RED.auth.needsPermission('worldmap3d.read'), function(req, res) {
59
- res.send({key:process.env.MAPBOXGL_TOKEN||""});
59
+ if (process.env.MAPBOXGL_TOKEN) {
60
+ res.send({key:process.env.MAPBOXGL_TOKEN});
61
+ }
62
+ else {
63
+ node.error("No API key set");
64
+ res.send({key:''})
65
+ }
60
66
  });
61
67
  RED.httpNode.use(compression());
62
68
  RED.httpNode.use(node.path, express.static(__dirname + '/worldmap'));
@@ -167,6 +173,7 @@ module.exports = function(RED) {
167
173
  var frameWidth = (size.sx + size.cx) * width - size.cx;
168
174
  var frameHeight = (size.sy + size.cy) * height - size.cy;
169
175
  var url = encodeURI(path.posix.join(RED.settings.httpNodeRoot||RED.settings.httpRoot,config.path));
176
+ if (config.layer === "MB3d") { url += "/index3d.html"; }
170
177
  var html = `<style>.nr-dashboard-ui_worldmap{padding:0;}</style><div style="overflow:hidden;">
171
178
  <iframe src="${url}" width="${frameWidth}px" height="${frameHeight}px" style="border:none;"></iframe></div>`;
172
179
  return html;