uri-js-rails 1.14.2.1 → 1.15.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c64c4db98bbe8e6e4988594e413a9c8407a54243
4
- data.tar.gz: a9bda7e4c91071dd48c043c10bf55243520d00cc
3
+ metadata.gz: 0a6d7795cc060816225f5a2c01e4d03f7354c9d9
4
+ data.tar.gz: 662a1babca79c1ec69b3cdc336862b3dc0e04802
5
5
  SHA512:
6
- metadata.gz: db0769f73941b1df2e258ab772573c1958b64540f27f47f23af14736dc239532a4271bfd5f2891d50091e2bbd0596bfc433152608045d7fe90d02e7888c224e5
7
- data.tar.gz: 3d46235d07634b419296875a6698e079a1dd4efa59966acc189d446fa1e0e951c575bae434ea951fe33c7b2d0d2ce0b0299dc1770e12d5863bee92917f13be74
6
+ metadata.gz: 84402d64633c3581178d48b21825114cd62b4c3c1445211717da39032cbe48d13890aecf9c8e009003027121c8937a0f141a7ca82773cb6ad779fe6d153bb27d
7
+ data.tar.gz: 8b0ecb733a8db9e20e1e4245f8108b4b55ca5f8cc44b5a1a2fd34329474d2c63f6c0162328f32c9d48fc1b8379e76297db4474db3596c22f3a2077bdf69a118f
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .idea/
@@ -1,3 +1,11 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## 1.15.2 - 2015-07-21
5
+
6
+ ### Changed
7
+ - Update upstream to `1.15.2`
8
+
1
9
  ## 1.14.1
2
10
 
3
11
  - Update upstream to `1.14.1`
@@ -1,7 +1,7 @@
1
1
  module Uri
2
2
  module Js
3
3
  module Rails
4
- VERSION = "1.14.2.1"
4
+ VERSION = "1.15.2"
5
5
  end
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
  * URI.js - Mutating URLs
3
3
  * IPv6 Support
4
4
  *
5
- * Version: 1.14.2
5
+ * Version: 1.15.2
6
6
  *
7
7
  * Author: Rodney Rehm
8
8
  * Web: http://medialize.github.io/URI.js/
@@ -2,7 +2,7 @@
2
2
  * URI.js - Mutating URLs
3
3
  * Second Level Domain (SLD) Support
4
4
  *
5
- * Version: 1.14.2
5
+ * Version: 1.15.2
6
6
  *
7
7
  * Author: Rodney Rehm
8
8
  * Web: http://medialize.github.io/URI.js/
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * URI.js - Mutating URLs
3
3
  *
4
- * Version: 1.14.2
4
+ * Version: 1.15.2
5
5
  *
6
6
  * Author: Rodney Rehm
7
7
  * Web: http://medialize.github.io/URI.js/
@@ -34,12 +34,27 @@
34
34
  var _URI = root && root.URI;
35
35
 
36
36
  function URI(url, base) {
37
+ var _urlSupplied = arguments.length >= 1;
38
+ var _baseSupplied = arguments.length >= 2;
39
+
37
40
  // Allow instantiation without the 'new' keyword
38
41
  if (!(this instanceof URI)) {
39
- return new URI(url, base);
42
+ if (_urlSupplied) {
43
+ if (_baseSupplied) {
44
+ return new URI(url, base);
45
+ }
46
+
47
+ return new URI(url);
48
+ }
49
+
50
+ return new URI();
40
51
  }
41
52
 
42
53
  if (url === undefined) {
54
+ if (_urlSupplied) {
55
+ throw new TypeError('undefined is not a valid argument for URI');
56
+ }
57
+
43
58
  if (typeof location !== 'undefined') {
44
59
  url = location.href + '';
45
60
  } else {
@@ -57,7 +72,7 @@
57
72
  return this;
58
73
  }
59
74
 
60
- URI.version = '1.14.2';
75
+ URI.version = '1.15.2';
61
76
 
62
77
  var p = URI.prototype;
63
78
  var hasOwn = Object.prototype.hasOwnProperty;
@@ -84,7 +99,9 @@
84
99
  var lookup = {};
85
100
  var i, length;
86
101
 
87
- if (isArray(value)) {
102
+ if (getType(value) === 'RegExp') {
103
+ lookup = null;
104
+ } else if (isArray(value)) {
88
105
  for (i = 0, length = value.length; i < length; i++) {
89
106
  lookup[value[i]] = true;
90
107
  }
@@ -93,7 +110,11 @@
93
110
  }
94
111
 
95
112
  for (i = 0, length = data.length; i < length; i++) {
96
- if (lookup[data[i]] !== undefined) {
113
+ /*jshint laxbreak: true */
114
+ var _match = lookup && lookup[data[i]] !== undefined
115
+ || !lookup && value.test(data[i]);
116
+ /*jshint laxbreak: false */
117
+ if (_match) {
97
118
  data.splice(i, 1);
98
119
  length--;
99
120
  i--;
@@ -320,6 +341,42 @@
320
341
  '%3D': '='
321
342
  }
322
343
  }
344
+ },
345
+ urnpath: {
346
+ // The characters under `encode` are the characters called out by RFC 2141 as being acceptable
347
+ // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but
348
+ // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also
349
+ // note that the colon character is not featured in the encoding map; this is because URI.js
350
+ // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it
351
+ // should not appear unencoded in a segment itself.
352
+ // See also the note above about RFC3986 and capitalalized hex digits.
353
+ encode: {
354
+ expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
355
+ map: {
356
+ '%21': '!',
357
+ '%24': '$',
358
+ '%27': '\'',
359
+ '%28': '(',
360
+ '%29': ')',
361
+ '%2A': '*',
362
+ '%2B': '+',
363
+ '%2C': ',',
364
+ '%3B': ';',
365
+ '%3D': '=',
366
+ '%40': '@'
367
+ }
368
+ },
369
+ // These characters are the characters called out by RFC2141 as "reserved" characters that
370
+ // should never appear in a URN, plus the colon character (see note above).
371
+ decode: {
372
+ expression: /[\/\?#:]/g,
373
+ map: {
374
+ '/': '%2F',
375
+ '?': '%3F',
376
+ '#': '%23',
377
+ ':': '%3A'
378
+ }
379
+ }
323
380
  }
324
381
  };
325
382
  URI.encodeQuery = function(string, escapeQuerySpace) {
@@ -346,22 +403,6 @@
346
403
  return string;
347
404
  }
348
405
  };
349
- URI.recodePath = function(string) {
350
- var segments = (string + '').split('/');
351
- for (var i = 0, length = segments.length; i < length; i++) {
352
- segments[i] = URI.encodePathSegment(URI.decode(segments[i]));
353
- }
354
-
355
- return segments.join('/');
356
- };
357
- URI.decodePath = function(string) {
358
- var segments = (string + '').split('/');
359
- for (var i = 0, length = segments.length; i < length; i++) {
360
- segments[i] = URI.decodePathSegment(segments[i]);
361
- }
362
-
363
- return segments.join('/');
364
- };
365
406
  // generate encode/decode path functions
366
407
  var _parts = {'encode':'encode', 'decode':'decode'};
367
408
  var _part;
@@ -383,8 +424,40 @@
383
424
 
384
425
  for (_part in _parts) {
385
426
  URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);
427
+ URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);
386
428
  }
387
429
 
430
+ var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
431
+ return function(string) {
432
+ // Why pass in names of functions, rather than the function objects themselves? The
433
+ // definitions of some functions (but in particular, URI.decode) will occasionally change due
434
+ // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure
435
+ // that the functions we use here are "fresh".
436
+ var actualCodingFunc;
437
+ if (!_innerCodingFuncName) {
438
+ actualCodingFunc = URI[_codingFuncName];
439
+ } else {
440
+ actualCodingFunc = function(string) {
441
+ return URI[_codingFuncName](URI[_innerCodingFuncName](string));
442
+ };
443
+ }
444
+
445
+ var segments = (string + '').split(_sep);
446
+
447
+ for (var i = 0, length = segments.length; i < length; i++) {
448
+ segments[i] = actualCodingFunc(segments[i]);
449
+ }
450
+
451
+ return segments.join(_sep);
452
+ };
453
+ };
454
+
455
+ // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.
456
+ URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');
457
+ URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');
458
+ URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');
459
+ URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');
460
+
388
461
  URI.encodeReserved = generateAccessor('reserved', 'encode');
389
462
 
390
463
  URI.parse = function(string, parts) {
@@ -533,7 +606,7 @@
533
606
  value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;
534
607
 
535
608
  if (hasOwn.call(items, name)) {
536
- if (typeof items[name] === 'string') {
609
+ if (typeof items[name] === 'string' || items[name] === null) {
537
610
  items[name] = [items[name]];
538
611
  }
539
612
 
@@ -677,6 +750,12 @@
677
750
  for (i = 0, length = name.length; i < length; i++) {
678
751
  data[name[i]] = undefined;
679
752
  }
753
+ } else if (getType(name) === 'RegExp') {
754
+ for (key in data) {
755
+ if (name.test(key)) {
756
+ data[key] = undefined;
757
+ }
758
+ }
680
759
  } else if (typeof name === 'object') {
681
760
  for (key in name) {
682
761
  if (hasOwn.call(name, key)) {
@@ -685,7 +764,13 @@
685
764
  }
686
765
  } else if (typeof name === 'string') {
687
766
  if (value !== undefined) {
688
- if (data[name] === value) {
767
+ if (getType(value) === 'RegExp') {
768
+ if (!isArray(data[name]) && value.test(data[name])) {
769
+ data[name] = undefined;
770
+ } else {
771
+ data[name] = filterArrayValues(data[name], value);
772
+ }
773
+ } else if (data[name] === value) {
689
774
  data[name] = undefined;
690
775
  } else if (isArray(data[name])) {
691
776
  data[name] = filterArrayValues(data[name], value);
@@ -694,7 +779,7 @@
694
779
  data[name] = undefined;
695
780
  }
696
781
  } else {
697
- throw new TypeError('URI.removeQuery() accepts an object, string as the first parameter');
782
+ throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');
698
783
  }
699
784
  };
700
785
  URI.hasQuery = function(data, name, value, withinArray) {
@@ -942,9 +1027,13 @@
942
1027
  p.pathname = function(v, build) {
943
1028
  if (v === undefined || v === true) {
944
1029
  var res = this._parts.path || (this._parts.hostname ? '/' : '');
945
- return v ? URI.decodePath(res) : res;
1030
+ return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
946
1031
  } else {
947
- this._parts.path = v ? URI.recodePath(v) : '/';
1032
+ if (this._parts.urn) {
1033
+ this._parts.path = v ? URI.recodeUrnPath(v) : '';
1034
+ } else {
1035
+ this._parts.path = v ? URI.recodePath(v) : '/';
1036
+ }
948
1037
  this.build(!build);
949
1038
  return this;
950
1039
  }
@@ -1535,7 +1624,7 @@
1535
1624
  v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;
1536
1625
  } else {
1537
1626
  for (i = 0, l = v.length; i < l; i++) {
1538
- v[i] = URI.decode(v[i]);
1627
+ v[i] = URI.encode(v[i]);
1539
1628
  }
1540
1629
  }
1541
1630
 
@@ -1620,6 +1709,7 @@
1620
1709
  if (this._parts.urn) {
1621
1710
  return this
1622
1711
  .normalizeProtocol(false)
1712
+ .normalizePath(false)
1623
1713
  .normalizeQuery(false)
1624
1714
  .normalizeFragment(false)
1625
1715
  .build();
@@ -1666,16 +1756,22 @@
1666
1756
  return this;
1667
1757
  };
1668
1758
  p.normalizePath = function(build) {
1759
+ var _path = this._parts.path;
1760
+ if (!_path) {
1761
+ return this;
1762
+ }
1763
+
1669
1764
  if (this._parts.urn) {
1765
+ this._parts.path = URI.recodeUrnPath(this._parts.path);
1766
+ this.build(!build);
1670
1767
  return this;
1671
1768
  }
1672
1769
 
1673
- if (!this._parts.path || this._parts.path === '/') {
1770
+ if (this._parts.path === '/') {
1674
1771
  return this;
1675
1772
  }
1676
1773
 
1677
1774
  var _was_relative;
1678
- var _path = this._parts.path;
1679
1775
  var _leadingParents = '';
1680
1776
  var _parent, _pos;
1681
1777
 
@@ -1685,6 +1781,11 @@
1685
1781
  _path = '/' + _path;
1686
1782
  }
1687
1783
 
1784
+ // handle relative files (as opposed to directories)
1785
+ if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {
1786
+ _path += '/';
1787
+ }
1788
+
1688
1789
  // resolve simples
1689
1790
  _path = _path
1690
1791
  .replace(/(\/(\.\/)+)|(\/\.$)/g, '/')
@@ -1759,9 +1860,12 @@
1759
1860
 
1760
1861
  URI.encode = escape;
1761
1862
  URI.decode = decodeURIComponent;
1762
- this.normalize();
1763
- URI.encode = e;
1764
- URI.decode = d;
1863
+ try {
1864
+ this.normalize();
1865
+ } finally {
1866
+ URI.encode = e;
1867
+ URI.decode = d;
1868
+ }
1765
1869
  return this;
1766
1870
  };
1767
1871
 
@@ -1772,9 +1876,12 @@
1772
1876
 
1773
1877
  URI.encode = strictEncodeURIComponent;
1774
1878
  URI.decode = unescape;
1775
- this.normalize();
1776
- URI.encode = e;
1777
- URI.decode = d;
1879
+ try {
1880
+ this.normalize();
1881
+ } finally {
1882
+ URI.encode = e;
1883
+ URI.decode = d;
1884
+ }
1778
1885
  return this;
1779
1886
  };
1780
1887
 
@@ -1859,6 +1966,7 @@
1859
1966
 
1860
1967
  if (resolved.path().charAt(0) !== '/') {
1861
1968
  basedir = base.directory();
1969
+ basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';
1862
1970
  resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;
1863
1971
  resolved.normalizePath();
1864
1972
  }
@@ -1913,7 +2021,7 @@
1913
2021
  }
1914
2022
 
1915
2023
  // determine common sub path
1916
- common = URI.commonPath(relative.path(), base.path());
2024
+ common = URI.commonPath(relativePath, basePath);
1917
2025
 
1918
2026
  // If the paths have nothing in common, return a relative URL with the absolute path.
1919
2027
  if (!common) {
@@ -1925,7 +2033,7 @@
1925
2033
  .replace(/[^\/]*$/, '')
1926
2034
  .replace(/.*?\//g, '../');
1927
2035
 
1928
- relativeParts.path = parents + relativeParts.path.substring(common.length);
2036
+ relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';
1929
2037
 
1930
2038
  return relative.build();
1931
2039
  };
@@ -1,14 +1,14 @@
1
- /*! URI.js v1.14.2 http://medialize.github.io/URI.js/ */
1
+ /*! URI.js v1.15.2 http://medialize.github.io/URI.js/ */
2
2
  /* build contains: IPv6.js, punycode.js, SecondLevelDomains.js, URI.js, URITemplate.js */
3
- (function(f,l){"object"===typeof exports?module.exports=l():"function"===typeof define&&define.amd?define(l):f.IPv6=l(f)})(this,function(f){var l=f&&f.IPv6;return{best:function(g){g=g.toLowerCase().split(":");var m=g.length,b=8;""===g[0]&&""===g[1]&&""===g[2]?(g.shift(),g.shift()):""===g[0]&&""===g[1]?g.shift():""===g[m-1]&&""===g[m-2]&&g.pop();m=g.length;-1!==g[m-1].indexOf(".")&&(b=7);var k;for(k=0;k<m&&""!==g[k];k++);if(k<b)for(g.splice(k,1,"0000");g.length<b;)g.splice(k,0,"0000");for(k=0;k<b;k++){for(var m=
4
- g[k].split(""),f=0;3>f;f++)if("0"===m[0]&&1<m.length)m.splice(0,1);else break;g[k]=m.join("")}var m=-1,l=f=0,h=-1,n=!1;for(k=0;k<b;k++)n?"0"===g[k]?l+=1:(n=!1,l>f&&(m=h,f=l)):"0"===g[k]&&(n=!0,h=k,l=1);l>f&&(m=h,f=l);1<f&&g.splice(m,f,"");m=g.length;b="";""===g[0]&&(b=":");for(k=0;k<m;k++){b+=g[k];if(k===m-1)break;b+=":"}""===g[m-1]&&(b+=":");return b},noConflict:function(){f.IPv6===this&&(f.IPv6=l);return this}}});
5
- (function(f){function l(b){throw RangeError(v[b]);}function g(b,e){for(var h=b.length;h--;)b[h]=e(b[h]);return b}function m(b,e){return g(b.split(u),e).join(".")}function b(b){for(var e=[],h=0,a=b.length,c,d;h<a;)c=b.charCodeAt(h++),55296<=c&&56319>=c&&h<a?(d=b.charCodeAt(h++),56320==(d&64512)?e.push(((c&1023)<<10)+(d&1023)+65536):(e.push(c),h--)):e.push(c);return e}function k(b){return g(b,function(b){var e="";65535<b&&(b-=65536,e+=B(b>>>10&1023|55296),b=56320|b&1023);return e+=B(b)}).join("")}function z(b,
6
- e){return b+22+75*(26>b)-((0!=e)<<5)}function q(b,e,h){var a=0;b=h?r(b/700):b>>1;for(b+=r(b/e);455<b;a+=36)b=r(b/35);return r(a+36*b/(b+38))}function h(b){var e=[],h=b.length,a,c=0,d=128,x=72,w,y,g,f,m;w=b.lastIndexOf("-");0>w&&(w=0);for(y=0;y<w;++y)128<=b.charCodeAt(y)&&l("not-basic"),e.push(b.charCodeAt(y));for(w=0<w?w+1:0;w<h;){y=c;a=1;for(g=36;;g+=36){w>=h&&l("invalid-input");f=b.charCodeAt(w++);f=10>f-48?f-22:26>f-65?f-65:26>f-97?f-97:36;(36<=f||f>r((2147483647-c)/a))&&l("overflow");c+=f*a;m=
7
- g<=x?1:g>=x+26?26:g-x;if(f<m)break;f=36-m;a>r(2147483647/f)&&l("overflow");a*=f}a=e.length+1;x=q(c-y,a,0==y);r(c/a)>2147483647-d&&l("overflow");d+=r(c/a);c%=a;e.splice(c++,0,d)}return k(e)}function n(e){var h,g,a,c,d,x,w,y,f,m=[],n,k,p;e=b(e);n=e.length;h=128;g=0;d=72;for(x=0;x<n;++x)f=e[x],128>f&&m.push(B(f));for((a=c=m.length)&&m.push("-");a<n;){w=2147483647;for(x=0;x<n;++x)f=e[x],f>=h&&f<w&&(w=f);k=a+1;w-h>r((2147483647-g)/k)&&l("overflow");g+=(w-h)*k;h=w;for(x=0;x<n;++x)if(f=e[x],f<h&&2147483647<
8
- ++g&&l("overflow"),f==h){y=g;for(w=36;;w+=36){f=w<=d?1:w>=d+26?26:w-d;if(y<f)break;p=y-f;y=36-f;m.push(B(z(f+p%y,0)));y=r(p/y)}m.push(B(z(y,0)));d=q(g,k,a==c);g=0;++a}++g;++h}return m.join("")}var C="object"==typeof exports&&exports,D="object"==typeof module&&module&&module.exports==C&&module,A="object"==typeof global&&global;if(A.global===A||A.window===A)f=A;var t,p=/^xn--/,e=/[^ -~]/,u=/\x2E|\u3002|\uFF0E|\uFF61/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)",
9
- "invalid-input":"Invalid input"},r=Math.floor,B=String.fromCharCode,E;t={version:"1.2.3",ucs2:{decode:b,encode:k},decode:h,encode:n,toASCII:function(b){return m(b,function(b){return e.test(b)?"xn--"+n(b):b})},toUnicode:function(b){return m(b,function(b){return p.test(b)?h(b.slice(4).toLowerCase()):b})}};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return t});else if(C&&!C.nodeType)if(D)D.exports=t;else for(E in t)t.hasOwnProperty(E)&&(C[E]=t[E]);else f.punycode=
3
+ (function(e,n){"object"===typeof exports?module.exports=n():"function"===typeof define&&define.amd?define(n):e.IPv6=n(e)})(this,function(e){var n=e&&e.IPv6;return{best:function(g){g=g.toLowerCase().split(":");var l=g.length,b=8;""===g[0]&&""===g[1]&&""===g[2]?(g.shift(),g.shift()):""===g[0]&&""===g[1]?g.shift():""===g[l-1]&&""===g[l-2]&&g.pop();l=g.length;-1!==g[l-1].indexOf(".")&&(b=7);var h;for(h=0;h<l&&""!==g[h];h++);if(h<b)for(g.splice(h,1,"0000");g.length<b;)g.splice(h,0,"0000");for(h=0;h<b;h++){for(var l=
4
+ g[h].split(""),e=0;3>e;e++)if("0"===l[0]&&1<l.length)l.splice(0,1);else break;g[h]=l.join("")}var l=-1,n=e=0,k=-1,u=!1;for(h=0;h<b;h++)u?"0"===g[h]?n+=1:(u=!1,n>e&&(l=k,e=n)):"0"===g[h]&&(u=!0,k=h,n=1);n>e&&(l=k,e=n);1<e&&g.splice(l,e,"");l=g.length;b="";""===g[0]&&(b=":");for(h=0;h<l;h++){b+=g[h];if(h===l-1)break;b+=":"}""===g[l-1]&&(b+=":");return b},noConflict:function(){e.IPv6===this&&(e.IPv6=n);return this}}});
5
+ (function(e){function n(b){throw RangeError(v[b]);}function g(b,f){for(var k=b.length;k--;)b[k]=f(b[k]);return b}function l(b,k){return g(b.split(f),k).join(".")}function b(b){for(var f=[],k=0,g=b.length,a,c;k<g;)a=b.charCodeAt(k++),55296<=a&&56319>=a&&k<g?(c=b.charCodeAt(k++),56320==(c&64512)?f.push(((a&1023)<<10)+(c&1023)+65536):(f.push(a),k--)):f.push(a);return f}function h(b){return g(b,function(b){var f="";65535<b&&(b-=65536,f+=x(b>>>10&1023|55296),b=56320|b&1023);return f+=x(b)}).join("")}function A(b,
6
+ f){return b+22+75*(26>b)-((0!=f)<<5)}function w(b,f,k){var g=0;b=k?q(b/700):b>>1;for(b+=q(b/f);455<b;g+=36)b=q(b/35);return q(g+36*b/(b+38))}function k(b){var f=[],k=b.length,g,a=0,c=128,d=72,m,z,y,e,l;m=b.lastIndexOf("-");0>m&&(m=0);for(z=0;z<m;++z)128<=b.charCodeAt(z)&&n("not-basic"),f.push(b.charCodeAt(z));for(m=0<m?m+1:0;m<k;){z=a;g=1;for(y=36;;y+=36){m>=k&&n("invalid-input");e=b.charCodeAt(m++);e=10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:36;(36<=e||e>q((2147483647-a)/g))&&n("overflow");a+=e*g;l=
7
+ y<=d?1:y>=d+26?26:y-d;if(e<l)break;e=36-l;g>q(2147483647/e)&&n("overflow");g*=e}g=f.length+1;d=w(a-z,g,0==z);q(a/g)>2147483647-c&&n("overflow");c+=q(a/g);a%=g;f.splice(a++,0,c)}return h(f)}function u(f){var g,k,e,a,c,d,m,z,y,l=[],u,h,p;f=b(f);u=f.length;g=128;k=0;c=72;for(d=0;d<u;++d)y=f[d],128>y&&l.push(x(y));for((e=a=l.length)&&l.push("-");e<u;){m=2147483647;for(d=0;d<u;++d)y=f[d],y>=g&&y<m&&(m=y);h=e+1;m-g>q((2147483647-k)/h)&&n("overflow");k+=(m-g)*h;g=m;for(d=0;d<u;++d)if(y=f[d],y<g&&2147483647<
8
+ ++k&&n("overflow"),y==g){z=k;for(m=36;;m+=36){y=m<=c?1:m>=c+26?26:m-c;if(z<y)break;p=z-y;z=36-y;l.push(x(A(y+p%z,0)));z=q(p/z)}l.push(x(A(z,0)));c=w(k,h,e==a);k=0;++e}++k;++g}return l.join("")}var D="object"==typeof exports&&exports,E="object"==typeof module&&module&&module.exports==D&&module,B="object"==typeof global&&global;if(B.global===B||B.window===B)e=B;var t,r=/^xn--/,p=/[^ -~]/,f=/\x2E|\u3002|\uFF0E|\uFF61/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)",
9
+ "invalid-input":"Invalid input"},q=Math.floor,x=String.fromCharCode,C;t={version:"1.2.3",ucs2:{decode:b,encode:h},decode:k,encode:u,toASCII:function(b){return l(b,function(b){return p.test(b)?"xn--"+u(b):b})},toUnicode:function(b){return l(b,function(b){return r.test(b)?k(b.slice(4).toLowerCase()):b})}};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return t});else if(D&&!D.nodeType)if(E)E.exports=t;else for(C in t)t.hasOwnProperty(C)&&(D[C]=t[C]);else e.punycode=
10
10
  t})(this);
11
- (function(f,l){"object"===typeof exports?module.exports=l():"function"===typeof define&&define.amd?define(l):f.SecondLevelDomains=l(f)})(this,function(f){var l=f&&f.SecondLevelDomains,g={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",
11
+ (function(e,n){"object"===typeof exports?module.exports=n():"function"===typeof define&&define.amd?define(n):e.SecondLevelDomains=n(e)})(this,function(e){var n=e&&e.SecondLevelDomains,g={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",
12
12
  bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",
13
13
  cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ","do":" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",
14
14
  et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",
@@ -20,65 +20,67 @@ ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com fir
20
20
  tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",
21
21
  rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",
22
22
  tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",
23
- us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch "},has:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1)return!1;
24
- var k=f.lastIndexOf(".",b-1);if(0>=k||k>=b-1)return!1;var l=g.list[f.slice(b+1)];return l?0<=l.indexOf(" "+f.slice(k+1,b)+" "):!1},is:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1||0<=f.lastIndexOf(".",b-1))return!1;var k=g.list[f.slice(b+1)];return k?0<=k.indexOf(" "+f.slice(0,b)+" "):!1},get:function(f){var b=f.lastIndexOf(".");if(0>=b||b>=f.length-1)return null;var k=f.lastIndexOf(".",b-1);if(0>=k||k>=b-1)return null;var l=g.list[f.slice(b+1)];return!l||0>l.indexOf(" "+f.slice(k+
25
- 1,b)+" ")?null:f.slice(k+1)},noConflict:function(){f.SecondLevelDomains===this&&(f.SecondLevelDomains=l);return this}};return g});
26
- (function(f,l){"object"===typeof exports?module.exports=l(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],l):f.URI=l(f.punycode,f.IPv6,f.SecondLevelDomains,f)})(this,function(f,l,g,m){function b(a,c){if(!(this instanceof b))return new b(a,c);void 0===a&&(a="undefined"!==typeof location?location.href+"":"");this.href(a);return void 0!==c?this.absoluteTo(c):this}function k(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,
27
- "\\$1")}function z(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function q(a){return"Array"===z(a)}function h(a,c){var d,b;if(q(c)){d=0;for(b=c.length;d<b;d++)if(!h(a,c[d]))return!1;return!0}var e=z(c);d=0;for(b=a.length;d<b;d++)if("RegExp"===e){if("string"===typeof a[d]&&a[d].match(c))return!0}else if(a[d]===c)return!0;return!1}function n(a,c){if(!q(a)||!q(c)||a.length!==c.length)return!1;a.sort();c.sort();for(var d=0,b=a.length;d<b;d++)if(a[d]!==c[d])return!1;
28
- return!0}function C(a){return escape(a)}function D(a){return encodeURIComponent(a).replace(/[!'()*]/g,C).replace(/\*/g,"%2A")}function A(a){return function(c,d){if(void 0===c)return this._parts[a]||"";this._parts[a]=c||null;this.build(!d);return this}}function t(a,c){return function(d,b){if(void 0===d)return this._parts[a]||"";null!==d&&(d+="",d.charAt(0)===c&&(d=d.substring(1)));this._parts[a]=d;this.build(!b);return this}}var p=m&&m.URI;b.version="1.14.2";var e=b.prototype,u=Object.prototype.hasOwnProperty;
29
- b._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,duplicateQueryParameters:b.duplicateQueryParameters,escapeQuerySpace:b.escapeQuerySpace}};b.duplicateQueryParameters=!1;b.escapeQuerySpace=!0;b.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;b.idn_expression=/[^a-z0-9\.-]/i;b.punycode_expression=/(xn--)/i;b.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;b.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
23
+ us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch "},has:function(e){var b=e.lastIndexOf(".");if(0>=b||b>=e.length-1)return!1;
24
+ var h=e.lastIndexOf(".",b-1);if(0>=h||h>=b-1)return!1;var n=g.list[e.slice(b+1)];return n?0<=n.indexOf(" "+e.slice(h+1,b)+" "):!1},is:function(e){var b=e.lastIndexOf(".");if(0>=b||b>=e.length-1||0<=e.lastIndexOf(".",b-1))return!1;var h=g.list[e.slice(b+1)];return h?0<=h.indexOf(" "+e.slice(0,b)+" "):!1},get:function(e){var b=e.lastIndexOf(".");if(0>=b||b>=e.length-1)return null;var h=e.lastIndexOf(".",b-1);if(0>=h||h>=b-1)return null;var n=g.list[e.slice(b+1)];return!n||0>n.indexOf(" "+e.slice(h+
25
+ 1,b)+" ")?null:e.slice(h+1)},noConflict:function(){e.SecondLevelDomains===this&&(e.SecondLevelDomains=n);return this}};return g});
26
+ (function(e,n){"object"===typeof exports?module.exports=n(require("./punycode"),require("./IPv6"),require("./SecondLevelDomains")):"function"===typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],n):e.URI=n(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(this,function(e,n,g,l){function b(a,c){var d=1<=arguments.length,m=2<=arguments.length;if(!(this instanceof b))return d?m?new b(a,c):new b(a):new b;if(void 0===a){if(d)throw new TypeError("undefined is not a valid argument for URI");
27
+ a="undefined"!==typeof location?location.href+"":""}this.href(a);return void 0!==c?this.absoluteTo(c):this}function h(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function A(a){return void 0===a?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function w(a){return"Array"===A(a)}function k(a,c){var d={},b,f;if("RegExp"===A(c))d=null;else if(w(c))for(b=0,f=c.length;b<f;b++)d[c[b]]=!0;else d[c]=!0;b=0;for(f=a.length;b<f;b++)if(d&&void 0!==d[a[b]]||!d&&c.test(a[b]))a.splice(b,
28
+ 1),f--,b--;return a}function u(a,c){var d,b;if(w(c)){d=0;for(b=c.length;d<b;d++)if(!u(a,c[d]))return!1;return!0}var f=A(c);d=0;for(b=a.length;d<b;d++)if("RegExp"===f){if("string"===typeof a[d]&&a[d].match(c))return!0}else if(a[d]===c)return!0;return!1}function D(a,c){if(!w(a)||!w(c)||a.length!==c.length)return!1;a.sort();c.sort();for(var d=0,b=a.length;d<b;d++)if(a[d]!==c[d])return!1;return!0}function E(a){return escape(a)}function B(a){return encodeURIComponent(a).replace(/[!'()*]/g,E).replace(/\*/g,
29
+ "%2A")}function t(a){return function(c,d){if(void 0===c)return this._parts[a]||"";this._parts[a]=c||null;this.build(!d);return this}}function r(a,c){return function(d,b){if(void 0===d)return this._parts[a]||"";null!==d&&(d+="",d.charAt(0)===c&&(d=d.substring(1)));this._parts[a]=d;this.build(!b);return this}}var p=l&&l.URI;b.version="1.15.2";var f=b.prototype,v=Object.prototype.hasOwnProperty;b._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,
30
+ query:null,fragment:null,duplicateQueryParameters:b.duplicateQueryParameters,escapeQuerySpace:b.escapeQuerySpace}};b.duplicateQueryParameters=!1;b.escapeQuerySpace=!0;b.protocol_expression=/^[a-z][a-z0-9.+-]*$/i;b.idn_expression=/[^a-z0-9\.-]/i;b.punycode_expression=/(xn--)/i;b.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;b.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
30
31
  b.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019]))/ig;b.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\u00ab\u00bb\u201c\u201d\u201e\u2018\u2019]+$/};b.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"};b.invalid_hostname_characters=
31
- /[^a-zA-Z0-9\.-]/;b.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};b.getDomAttribute=function(a){if(a&&a.nodeName){var c=a.nodeName.toLowerCase();return"input"===c&&"image"!==a.type?void 0:b.domAttributes[c]}};b.encode=D;b.decode=decodeURIComponent;b.iso8859=function(){b.encode=escape;b.decode=unescape};b.unicode=function(){b.encode=D;b.decode=
32
+ /[^a-zA-Z0-9\.-]/;b.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"};b.getDomAttribute=function(a){if(a&&a.nodeName){var c=a.nodeName.toLowerCase();return"input"===c&&"image"!==a.type?void 0:b.domAttributes[c]}};b.encode=B;b.decode=decodeURIComponent;b.iso8859=function(){b.encode=escape;b.decode=unescape};b.unicode=function(){b.encode=B;b.decode=
32
33
  decodeURIComponent};b.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",",
33
- "%3B":";","%3D":"="}}}};b.encodeQuery=function(a,c){var d=b.encode(a+"");void 0===c&&(c=b.escapeQuerySpace);return c?d.replace(/%20/g,"+"):d};b.decodeQuery=function(a,c){a+="";void 0===c&&(c=b.escapeQuerySpace);try{return b.decode(c?a.replace(/\+/g,"%20"):a)}catch(d){return a}};b.recodePath=function(a){a=(a+"").split("/");for(var c=0,d=a.length;c<d;c++)a[c]=b.encodePathSegment(b.decode(a[c]));return a.join("/")};b.decodePath=function(a){a=(a+"").split("/");for(var c=0,d=a.length;c<d;c++)a[c]=b.decodePathSegment(a[c]);
34
- return a.join("/")};var v={encode:"encode",decode:"decode"},r,B=function(a,c){return function(d){try{return b[c](d+"").replace(b.characters[a][c].expression,function(d){return b.characters[a][c].map[d]})}catch(x){return d}}};for(r in v)b[r+"PathSegment"]=B("pathname",v[r]);b.encodeReserved=B("reserved","encode");b.parse=function(a,c){var d;c||(c={});d=a.indexOf("#");-1<d&&(c.fragment=a.substring(d+1)||null,a=a.substring(0,d));d=a.indexOf("?");-1<d&&(c.query=a.substring(d+1)||null,a=a.substring(0,
35
- d));"//"===a.substring(0,2)?(c.protocol=null,a=a.substring(2),a=b.parseAuthority(a,c)):(d=a.indexOf(":"),-1<d&&(c.protocol=a.substring(0,d)||null,c.protocol&&!c.protocol.match(b.protocol_expression)?c.protocol=void 0:"//"===a.substring(d+1,d+3)?(a=a.substring(d+3),a=b.parseAuthority(a,c)):(a=a.substring(d+1),c.urn=!0)));c.path=a;return c};b.parseHost=function(a,c){var d=a.indexOf("/"),b;-1===d&&(d=a.length);if("["===a.charAt(0))b=a.indexOf("]"),c.hostname=a.substring(1,b)||null,c.port=a.substring(b+
36
- 2,d)||null,"/"===c.port&&(c.port=null);else{var e=a.indexOf(":");b=a.indexOf("/");e=a.indexOf(":",e+1);-1!==e&&(-1===b||e<b)?(c.hostname=a.substring(0,d)||null,c.port=null):(b=a.substring(0,d).split(":"),c.hostname=b[0]||null,c.port=b[1]||null)}c.hostname&&"/"!==a.substring(d).charAt(0)&&(d++,a="/"+a);return a.substring(d)||"/"};b.parseAuthority=function(a,c){a=b.parseUserinfo(a,c);return b.parseHost(a,c)};b.parseUserinfo=function(a,c){var d=a.indexOf("/"),e=a.lastIndexOf("@",-1<d?d:a.length-1);-1<
37
- e&&(-1===d||e<d)?(d=a.substring(0,e).split(":"),c.username=d[0]?b.decode(d[0]):null,d.shift(),c.password=d[0]?b.decode(d.join(":")):null,a=a.substring(e+1)):(c.username=null,c.password=null);return a};b.parseQuery=function(a,c){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"");if(!a)return{};for(var d={},e=a.split("&"),f=e.length,h,g,n=0;n<f;n++)h=e[n].split("="),g=b.decodeQuery(h.shift(),c),h=h.length?b.decodeQuery(h.join("="),c):null,u.call(d,g)?("string"===typeof d[g]&&(d[g]=[d[g]]),
38
- d[g].push(h)):d[g]=h;return d};b.build=function(a){var c="";a.protocol&&(c+=a.protocol+":");a.urn||!c&&!a.hostname||(c+="//");c+=b.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(c+="/"),c+=a.path);"string"===typeof a.query&&a.query&&(c+="?"+a.query);"string"===typeof a.fragment&&a.fragment&&(c+="#"+a.fragment);return c};b.buildHost=function(a){var c="";if(a.hostname)c=b.ip6_expression.test(a.hostname)?c+("["+a.hostname+"]"):c+a.hostname;else return"";
39
- a.port&&(c+=":"+a.port);return c};b.buildAuthority=function(a){return b.buildUserinfo(a)+b.buildHost(a)};b.buildUserinfo=function(a){var c="";a.username&&(c+=b.encode(a.username),a.password&&(c+=":"+b.encode(a.password)),c+="@");return c};b.buildQuery=function(a,c,d){var e="",f,h,g,n;for(h in a)if(u.call(a,h)&&h)if(q(a[h]))for(f={},g=0,n=a[h].length;g<n;g++)void 0!==a[h][g]&&void 0===f[a[h][g]+""]&&(e+="&"+b.buildQueryParameter(h,a[h][g],d),!0!==c&&(f[a[h][g]+""]=!0));else void 0!==a[h]&&(e+="&"+
40
- b.buildQueryParameter(h,a[h],d));return e.substring(1)};b.buildQueryParameter=function(a,c,d){return b.encodeQuery(a,d)+(null!==c?"="+b.encodeQuery(c,d):"")};b.addQuery=function(a,c,d){if("object"===typeof c)for(var e in c)u.call(c,e)&&b.addQuery(a,e,c[e]);else if("string"===typeof c)void 0===a[c]?a[c]=d:("string"===typeof a[c]&&(a[c]=[a[c]]),q(d)||(d=[d]),a[c]=(a[c]||[]).concat(d));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};b.removeQuery=function(a,
41
- c,d){var e;if(q(c))for(d=0,e=c.length;d<e;d++)a[c[d]]=void 0;else if("object"===typeof c)for(e in c)u.call(c,e)&&b.removeQuery(a,e,c[e]);else if("string"===typeof c)if(void 0!==d)if(a[c]===d)a[c]=void 0;else{if(q(a[c])){e=a[c];var h={},f,g;if(q(d))for(f=0,g=d.length;f<g;f++)h[d[f]]=!0;else h[d]=!0;f=0;for(g=e.length;f<g;f++)void 0!==h[e[f]]&&(e.splice(f,1),g--,f--);a[c]=e}}else a[c]=void 0;else throw new TypeError("URI.addQuery() accepts an object, string as the first parameter");};b.hasQuery=function(a,
42
- c,d,e){if("object"===typeof c){for(var f in c)if(u.call(c,f)&&!b.hasQuery(a,f,c[f]))return!1;return!0}if("string"!==typeof c)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");switch(z(d)){case "Undefined":return c in a;case "Boolean":return a=Boolean(q(a[c])?a[c].length:a[c]),d===a;case "Function":return!!d(a[c],c,a);case "Array":return q(a[c])?(e?h:n)(a[c],d):!1;case "RegExp":return q(a[c])?e?h(a[c],d):!1:Boolean(a[c]&&a[c].match(d));case "Number":d=String(d);
43
- case "String":return q(a[c])?e?h(a[c],d):!1:a[c]===d;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};b.commonPath=function(a,c){var d=Math.min(a.length,c.length),b;for(b=0;b<d;b++)if(a.charAt(b)!==c.charAt(b)){b--;break}if(1>b)return a.charAt(0)===c.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(b)||"/"!==c.charAt(b))b=a.substring(0,b).lastIndexOf("/");return a.substring(0,b+1)};b.withinString=function(a,c,
44
- d){d||(d={});var e=d.start||b.findUri.start,f=d.end||b.findUri.end,h=d.trim||b.findUri.trim,g=/[a-z0-9-]=["']?$/i;for(e.lastIndex=0;;){var n=e.exec(a);if(!n)break;n=n.index;if(d.ignoreHtml){var k=a.slice(Math.max(n-3,0),n);if(k&&g.test(k))continue}var k=n+a.slice(n).search(f),m=a.slice(n,k).replace(h,"");d.ignore&&d.ignore.test(m)||(k=n+m.length,m=c(m,n,k,a),a=a.slice(0,n)+m+a.slice(k),e.lastIndex=n+m.length)}e.lastIndex=0;return a};b.ensureValidHostname=function(a){if(a.match(b.invalid_hostname_characters)){if(!f)throw new TypeError('Hostname "'+
45
- a+'" contains characters other than [A-Z0-9.-] and Punycode.js is not available');if(f.toASCII(a).match(b.invalid_hostname_characters))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');}};b.noConflict=function(a){if(a)return a={URI:this.noConflict()},m.URITemplate&&"function"===typeof m.URITemplate.noConflict&&(a.URITemplate=m.URITemplate.noConflict()),m.IPv6&&"function"===typeof m.IPv6.noConflict&&(a.IPv6=m.IPv6.noConflict()),m.SecondLevelDomains&&"function"===typeof m.SecondLevelDomains.noConflict&&
46
- (a.SecondLevelDomains=m.SecondLevelDomains.noConflict()),a;m.URI===this&&(m.URI=p);return this};e.build=function(a){if(!0===a)this._deferred_build=!0;else if(void 0===a||this._deferred_build)this._string=b.build(this._parts),this._deferred_build=!1;return this};e.clone=function(){return new b(this)};e.valueOf=e.toString=function(){return this.build(!1)._string};e.protocol=A("protocol");e.username=A("username");e.password=A("password");e.hostname=A("hostname");e.port=A("port");e.query=t("query","?");
47
- e.fragment=t("fragment","#");e.search=function(a,c){var d=this.query(a,c);return"string"===typeof d&&d.length?"?"+d:d};e.hash=function(a,c){var d=this.fragment(a,c);return"string"===typeof d&&d.length?"#"+d:d};e.pathname=function(a,c){if(void 0===a||!0===a){var d=this._parts.path||(this._parts.hostname?"/":"");return a?b.decodePath(d):d}this._parts.path=a?b.recodePath(a):"/";this.build(!c);return this};e.path=e.pathname;e.href=function(a,c){var d;if(void 0===a)return this.toString();this._string=
48
- "";this._parts=b._parts();var e=a instanceof b,f="object"===typeof a&&(a.hostname||a.path||a.pathname);a.nodeName&&(f=b.getDomAttribute(a),a=a[f]||"",f=!1);!e&&f&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a||a instanceof String)this._parts=b.parse(String(a),this._parts);else if(e||f)for(d in e=e?a._parts:a,e)u.call(this._parts,d)&&(this._parts[d]=e[d]);else throw new TypeError("invalid input");this.build(!c);return this};e.is=function(a){var c=!1,d=!1,e=!1,f=!1,h=!1,n=!1,k=!1,m=!this._parts.urn;
49
- this._parts.hostname&&(m=!1,d=b.ip4_expression.test(this._parts.hostname),e=b.ip6_expression.test(this._parts.hostname),c=d||e,h=(f=!c)&&g&&g.has(this._parts.hostname),n=f&&b.idn_expression.test(this._parts.hostname),k=f&&b.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return m;case "absolute":return!m;case "domain":case "name":return f;case "sld":return h;case "ip":return c;case "ip4":case "ipv4":case "inet4":return d;case "ip6":case "ipv6":case "inet6":return e;
50
- case "idn":return n;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;case "punycode":return k}return null};var E=e.protocol,F=e.port,G=e.hostname;e.protocol=function(a,c){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(b.protocol_expression)))throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,a,c)};e.scheme=e.protocol;e.port=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0!==
51
- a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError('Port "'+a+'" contains characters other than [0-9]');return F.call(this,a,c)};e.hostname=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var d={};b.parseHost(a,d);a=d.hostname}return G.call(this,a,c)};e.host=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?b.buildHost(this._parts):"";b.parseHost(a,this._parts);this.build(!c);
52
- return this};e.authority=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?b.buildAuthority(this._parts):"";b.parseAuthority(a,this._parts);this.build(!c);return this};e.userinfo=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var d=b.buildUserinfo(this._parts);return d.substring(0,d.length-1)}"@"!==a[a.length-1]&&(a+="@");b.parseUserinfo(a,this._parts);this.build(!c);return this};e.resource=
53
- function(a,c){var d;if(void 0===a)return this.path()+this.search()+this.hash();d=b.parse(a);this._parts.path=d.path;this._parts.query=d.query;this._parts.fragment=d.fragment;this.build(!c);return this};e.subdomain=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,d)||""}d=this._parts.hostname.length-this.domain().length;d=this._parts.hostname.substring(0,
54
- d);d=new RegExp("^"+k(d));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&b.ensureValidHostname(a);this._parts.hostname=this._parts.hostname.replace(d,a);this.build(!c);return this};e.domain=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.match(/\./g);if(d&&2>d.length)return this._parts.hostname;d=this._parts.hostname.length-this.tld(c).length-1;d=this._parts.hostname.lastIndexOf(".",
55
- d-1)+1;return this._parts.hostname.substring(d)||""}if(!a)throw new TypeError("cannot set domain empty");b.ensureValidHostname(a);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(d=new RegExp(k(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(d,a));this.build(!c);return this};e.tld=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.lastIndexOf("."),
56
- d=this._parts.hostname.substring(d+1);return!0!==c&&g&&g.list[d.toLowerCase()]?g.get(this._parts.hostname)||d:d}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(g&&g.is(a))d=new RegExp(k(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(d,a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");d=new RegExp(k(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(d,
57
- a)}else throw new TypeError("cannot set TLD empty");this.build(!c);return this};e.directory=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var d=this._parts.path.length-this.filename().length-1,d=this._parts.path.substring(0,d)||(this._parts.hostname?"/":"");return a?b.decodePath(d):d}d=this._parts.path.length-this.filename().length;d=this._parts.path.substring(0,d);d=new RegExp("^"+
58
- k(d));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-1)&&(a+="/");a=b.recodePath(a);this._parts.path=this._parts.path.replace(d,a);this.build(!c);return this};e.filename=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this._parts.path.lastIndexOf("/"),d=this._parts.path.substring(d+1);return a?b.decodePathSegment(d):d}d=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&
59
- (d=!0);var e=new RegExp(k(this.filename())+"$");a=b.recodePath(a);this._parts.path=this._parts.path.replace(e,a);d?this.normalizePath(c):this.build(!c);return this};e.suffix=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this.filename(),e=d.lastIndexOf(".");if(-1===e)return"";d=d.substring(e+1);d=/^[a-z0-9%]+$/i.test(d)?d:"";return a?b.decodePathSegment(d):d}"."===a.charAt(0)&&(a=a.substring(1));if(d=this.suffix())e=
60
- a?new RegExp(k(d)+"$"):new RegExp(k("."+d)+"$");else{if(!a)return this;this._parts.path+="."+b.recodePath(a)}e&&(a=b.recodePath(a),this._parts.path=this._parts.path.replace(e,a));this.build(!c);return this};e.segment=function(a,c,d){var b=this._parts.urn?":":"/",e=this.path(),f="/"===e.substring(0,1),e=e.split(b);void 0!==a&&"number"!==typeof a&&(d=c,c=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error('Bad segment "'+a+'", must be 0-based integer');f&&e.shift();0>a&&(a=Math.max(e.length+
61
- a,0));if(void 0===c)return void 0===a?e:e[a];if(null===a||void 0===e[a])if(q(c)){e=[];a=0;for(var h=c.length;a<h;a++)if(c[a].length||e.length&&e[e.length-1].length)e.length&&!e[e.length-1].length&&e.pop(),e.push(c[a])}else{if(c||"string"===typeof c)""===e[e.length-1]?e[e.length-1]=c:e.push(c)}else c?e[a]=c:e.splice(a,1);f&&e.unshift("");return this.path(e.join(b),d)};e.segmentCoded=function(a,c,d){var e,f;"number"!==typeof a&&(d=c,c=a,a=void 0);if(void 0===c){a=this.segment(a,c,d);if(q(a))for(e=0,
62
- f=a.length;e<f;e++)a[e]=b.decode(a[e]);else a=void 0!==a?b.decode(a):void 0;return a}if(q(c))for(e=0,f=c.length;e<f;e++)c[e]=b.decode(c[e]);else c="string"===typeof c||c instanceof String?b.encode(c):c;return this.segment(a,c,d)};var H=e.query;e.query=function(a,c){if(!0===a)return b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof a){var d=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace),e=a.call(this,d);this._parts.query=b.buildQuery(e||d,this._parts.duplicateQueryParameters,
63
- this._parts.escapeQuerySpace);this.build(!c);return this}return void 0!==a&&"string"!==typeof a?(this._parts.query=b.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!c),this):H.call(this,a,c)};e.setQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof a||a instanceof String)e[a]=void 0!==c?c:null;else if("object"===typeof a)for(var f in a)u.call(a,f)&&(e[f]=a[f]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
64
- this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};e.addQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);b.addQuery(e,a,void 0===c?null:c);this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};e.removeQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,
65
- this._parts.escapeQuerySpace);b.removeQuery(e,a,c);this._parts.query=b.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};e.hasQuery=function(a,c,d){var e=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return b.hasQuery(e,a,c,d)};e.setSearch=e.setQuery;e.addSearch=e.addQuery;e.removeSearch=e.removeQuery;e.hasSearch=e.hasQuery;e.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizeQuery(!1).normalizeFragment(!1).build():
66
- this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};e.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a));return this};e.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&f?this._parts.hostname=f.toASCII(this._parts.hostname):this.is("IPv6")&&l&&(this._parts.hostname=l.best(this._parts.hostname)),this._parts.hostname=
67
- this._parts.hostname.toLowerCase(),this.build(!a));return this};e.normalizePort=function(a){"string"===typeof this._parts.protocol&&this._parts.port===b.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};e.normalizePath=function(a){if(this._parts.urn||!this._parts.path||"/"===this._parts.path)return this;var c,d=this._parts.path,e="",f,h;"/"!==d.charAt(0)&&(c=!0,d="/"+d);d=d.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");c&&(e=d.substring(1).match(/^(\.\.\/)+/)||
68
- "")&&(e=e[0]);for(;;){f=d.indexOf("/..");if(-1===f)break;else if(0===f){d=d.substring(3);continue}h=d.substring(0,f).lastIndexOf("/");-1===h&&(h=f);d=d.substring(0,h)+d.substring(f+3)}c&&this.is("relative")&&(d=e+d.substring(1));d=b.recodePath(d);this._parts.path=d;this.build(!a);return this};e.normalizePathname=e.normalizePath;e.normalizeQuery=function(a){"string"===typeof this._parts.query&&(this._parts.query.length?this.query(b.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=
69
- null,this.build(!a));return this};e.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};e.normalizeSearch=e.normalizeQuery;e.normalizeHash=e.normalizeFragment;e.iso8859=function(){var a=b.encode,c=b.decode;b.encode=escape;b.decode=decodeURIComponent;this.normalize();b.encode=a;b.decode=c;return this};e.unicode=function(){var a=b.encode,c=b.decode;b.encode=D;b.decode=unescape;this.normalize();b.encode=a;b.decode=c;return this};e.readable=function(){var a=
70
- this.clone();a.username("").password("").normalize();var c="";a._parts.protocol&&(c+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&f?(c+=f.toUnicode(a._parts.hostname),a._parts.port&&(c+=":"+a._parts.port)):c+=a.host());a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(c+="/");c+=a.path(!0);if(a._parts.query){for(var d="",e=0,h=a._parts.query.split("&"),g=h.length;e<g;e++){var n=(h[e]||"").split("="),d=d+("&"+b.decodeQuery(n[0],this._parts.escapeQuerySpace).replace(/&/g,
71
- "%26"));void 0!==n[1]&&(d+="="+b.decodeQuery(n[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}c+="?"+d.substring(1)}return c+=b.decodeQuery(a.hash(),!0)};e.absoluteTo=function(a){var c=this.clone(),d=["protocol","username","password","hostname","port"],e,f;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a instanceof b||(a=new b(a));c._parts.protocol||(c._parts.protocol=a._parts.protocol);if(this._parts.hostname)return c;for(e=0;f=d[e];e++)c._parts[f]=
72
- a._parts[f];c._parts.path?".."===c._parts.path.substring(-2)&&(c._parts.path+="/"):(c._parts.path=a._parts.path,c._parts.query||(c._parts.query=a._parts.query));"/"!==c.path().charAt(0)&&(a=a.directory(),c._parts.path=(a?a+"/":"")+c._parts.path,c.normalizePath());c.build();return c};e.relativeTo=function(a){var c=this.clone().normalize(),d,e,f,h;if(c._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new b(a)).normalize();d=c._parts;e=a._parts;f=c.path();h=
73
- a.path();if("/"!==f.charAt(0))throw Error("URI is already relative");if("/"!==h.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");d.protocol===e.protocol&&(d.protocol=null);if(d.username===e.username&&d.password===e.password&&null===d.protocol&&null===d.username&&null===d.password&&d.hostname===e.hostname&&d.port===e.port)d.hostname=null,d.port=null;else return c.build();if(f===h)return d.path="",c.build();a=b.commonPath(c.path(),a.path());if(!a)return c.build();e=e.path.substring(a.length).replace(/[^\/]*$/,
74
- "").replace(/.*?\//g,"../");d.path=e+d.path.substring(a.length);return c.build()};e.equals=function(a){var c=this.clone();a=new b(a);var d={},e={},f={},h;c.normalize();a.normalize();if(c.toString()===a.toString())return!0;d=c.query();e=a.query();c.query("");a.query("");if(c.toString()!==a.toString()||d.length!==e.length)return!1;d=b.parseQuery(d,this._parts.escapeQuerySpace);e=b.parseQuery(e,this._parts.escapeQuerySpace);for(h in d)if(u.call(d,h)){if(!q(d[h])){if(d[h]!==e[h])return!1}else if(!n(d[h],
75
- e[h]))return!1;f[h]=!0}for(h in e)if(u.call(e,h)&&!f[h])return!1;return!0};e.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};e.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return b});
76
- (function(f,l){"object"===typeof exports?module.exports=l(require("./URI")):"function"===typeof define&&define.amd?define(["./URI"],l):f.URITemplate=l(f.URI,f)})(this,function(f,l){function g(b){if(g._cache[b])return g._cache[b];if(!(this instanceof g))return new g(b);this.expression=b;g._cache[b]=this;return this}function m(b){this.data=b;this.cache={}}var b=l&&l.URITemplate,k=Object.prototype.hasOwnProperty,z=g.prototype,q={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},
34
+ "%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}};b.encodeQuery=function(a,c){var d=b.encode(a+"");void 0===c&&(c=b.escapeQuerySpace);return c?d.replace(/%20/g,"+"):d};b.decodeQuery=function(a,c){a+="";void 0===c&&(c=b.escapeQuerySpace);try{return b.decode(c?a.replace(/\+/g,
35
+ "%20"):a)}catch(d){return a}};var q={encode:"encode",decode:"decode"},x,C=function(a,c){return function(d){try{return b[c](d+"").replace(b.characters[a][c].expression,function(d){return b.characters[a][c].map[d]})}catch(m){return d}}};for(x in q)b[x+"PathSegment"]=C("pathname",q[x]),b[x+"UrnPathSegment"]=C("urnpath",q[x]);q=function(a,c,d){return function(m){var f;f=d?function(a){return b[c](b[d](a))}:b[c];m=(m+"").split(a);for(var e=0,k=m.length;e<k;e++)m[e]=f(m[e]);return m.join(a)}};b.decodePath=
36
+ q("/","decodePathSegment");b.decodeUrnPath=q(":","decodeUrnPathSegment");b.recodePath=q("/","encodePathSegment","decode");b.recodeUrnPath=q(":","encodeUrnPathSegment","decode");b.encodeReserved=C("reserved","encode");b.parse=function(a,c){var d;c||(c={});d=a.indexOf("#");-1<d&&(c.fragment=a.substring(d+1)||null,a=a.substring(0,d));d=a.indexOf("?");-1<d&&(c.query=a.substring(d+1)||null,a=a.substring(0,d));"//"===a.substring(0,2)?(c.protocol=null,a=a.substring(2),a=b.parseAuthority(a,c)):(d=a.indexOf(":"),
37
+ -1<d&&(c.protocol=a.substring(0,d)||null,c.protocol&&!c.protocol.match(b.protocol_expression)?c.protocol=void 0:"//"===a.substring(d+1,d+3)?(a=a.substring(d+3),a=b.parseAuthority(a,c)):(a=a.substring(d+1),c.urn=!0)));c.path=a;return c};b.parseHost=function(a,c){var d=a.indexOf("/"),b;-1===d&&(d=a.length);if("["===a.charAt(0))b=a.indexOf("]"),c.hostname=a.substring(1,b)||null,c.port=a.substring(b+2,d)||null,"/"===c.port&&(c.port=null);else{var f=a.indexOf(":");b=a.indexOf("/");f=a.indexOf(":",f+1);
38
+ -1!==f&&(-1===b||f<b)?(c.hostname=a.substring(0,d)||null,c.port=null):(b=a.substring(0,d).split(":"),c.hostname=b[0]||null,c.port=b[1]||null)}c.hostname&&"/"!==a.substring(d).charAt(0)&&(d++,a="/"+a);return a.substring(d)||"/"};b.parseAuthority=function(a,c){a=b.parseUserinfo(a,c);return b.parseHost(a,c)};b.parseUserinfo=function(a,c){var d=a.indexOf("/"),m=a.lastIndexOf("@",-1<d?d:a.length-1);-1<m&&(-1===d||m<d)?(d=a.substring(0,m).split(":"),c.username=d[0]?b.decode(d[0]):null,d.shift(),c.password=
39
+ d[0]?b.decode(d.join(":")):null,a=a.substring(m+1)):(c.username=null,c.password=null);return a};b.parseQuery=function(a,c){if(!a)return{};a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"");if(!a)return{};for(var d={},m=a.split("&"),f=m.length,e,k,g=0;g<f;g++)if(e=m[g].split("="),k=b.decodeQuery(e.shift(),c),e=e.length?b.decodeQuery(e.join("="),c):null,v.call(d,k)){if("string"===typeof d[k]||null===d[k])d[k]=[d[k]];d[k].push(e)}else d[k]=e;return d};b.build=function(a){var c="";a.protocol&&(c+=a.protocol+
40
+ ":");a.urn||!c&&!a.hostname||(c+="//");c+=b.buildAuthority(a)||"";"string"===typeof a.path&&("/"!==a.path.charAt(0)&&"string"===typeof a.hostname&&(c+="/"),c+=a.path);"string"===typeof a.query&&a.query&&(c+="?"+a.query);"string"===typeof a.fragment&&a.fragment&&(c+="#"+a.fragment);return c};b.buildHost=function(a){var c="";if(a.hostname)c=b.ip6_expression.test(a.hostname)?c+("["+a.hostname+"]"):c+a.hostname;else return"";a.port&&(c+=":"+a.port);return c};b.buildAuthority=function(a){return b.buildUserinfo(a)+
41
+ b.buildHost(a)};b.buildUserinfo=function(a){var c="";a.username&&(c+=b.encode(a.username),a.password&&(c+=":"+b.encode(a.password)),c+="@");return c};b.buildQuery=function(a,c,d){var m="",f,e,k,g;for(e in a)if(v.call(a,e)&&e)if(w(a[e]))for(f={},k=0,g=a[e].length;k<g;k++)void 0!==a[e][k]&&void 0===f[a[e][k]+""]&&(m+="&"+b.buildQueryParameter(e,a[e][k],d),!0!==c&&(f[a[e][k]+""]=!0));else void 0!==a[e]&&(m+="&"+b.buildQueryParameter(e,a[e],d));return m.substring(1)};b.buildQueryParameter=function(a,
42
+ c,d){return b.encodeQuery(a,d)+(null!==c?"="+b.encodeQuery(c,d):"")};b.addQuery=function(a,c,d){if("object"===typeof c)for(var m in c)v.call(c,m)&&b.addQuery(a,m,c[m]);else if("string"===typeof c)void 0===a[c]?a[c]=d:("string"===typeof a[c]&&(a[c]=[a[c]]),w(d)||(d=[d]),a[c]=(a[c]||[]).concat(d));else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");};b.removeQuery=function(a,c,d){var m;if(w(c))for(d=0,m=c.length;d<m;d++)a[c[d]]=void 0;else if("RegExp"===A(c))for(m in a)c.test(m)&&
43
+ (a[m]=void 0);else if("object"===typeof c)for(m in c)v.call(c,m)&&b.removeQuery(a,m,c[m]);else if("string"===typeof c)void 0!==d?"RegExp"===A(d)?!w(a[c])&&d.test(a[c])?a[c]=void 0:a[c]=k(a[c],d):a[c]===d?a[c]=void 0:w(a[c])&&(a[c]=k(a[c],d)):a[c]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");};b.hasQuery=function(a,c,d,m){if("object"===typeof c){for(var f in c)if(v.call(c,f)&&!b.hasQuery(a,f,c[f]))return!1;return!0}if("string"!==typeof c)throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter");
44
+ switch(A(d)){case "Undefined":return c in a;case "Boolean":return a=Boolean(w(a[c])?a[c].length:a[c]),d===a;case "Function":return!!d(a[c],c,a);case "Array":return w(a[c])?(m?u:D)(a[c],d):!1;case "RegExp":return w(a[c])?m?u(a[c],d):!1:Boolean(a[c]&&a[c].match(d));case "Number":d=String(d);case "String":return w(a[c])?m?u(a[c],d):!1:a[c]===d;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");}};b.commonPath=function(a,c){var d=
45
+ Math.min(a.length,c.length),b;for(b=0;b<d;b++)if(a.charAt(b)!==c.charAt(b)){b--;break}if(1>b)return a.charAt(0)===c.charAt(0)&&"/"===a.charAt(0)?"/":"";if("/"!==a.charAt(b)||"/"!==c.charAt(b))b=a.substring(0,b).lastIndexOf("/");return a.substring(0,b+1)};b.withinString=function(a,c,d){d||(d={});var m=d.start||b.findUri.start,f=d.end||b.findUri.end,e=d.trim||b.findUri.trim,k=/[a-z0-9-]=["']?$/i;for(m.lastIndex=0;;){var g=m.exec(a);if(!g)break;g=g.index;if(d.ignoreHtml){var u=a.slice(Math.max(g-3,0),
46
+ g);if(u&&k.test(u))continue}var u=g+a.slice(g).search(f),h=a.slice(g,u).replace(e,"");d.ignore&&d.ignore.test(h)||(u=g+h.length,h=c(h,g,u,a),a=a.slice(0,g)+h+a.slice(u),m.lastIndex=g+h.length)}m.lastIndex=0;return a};b.ensureValidHostname=function(a){if(a.match(b.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-] and Punycode.js is not available');if(e.toASCII(a).match(b.invalid_hostname_characters))throw new TypeError('Hostname "'+
47
+ a+'" contains characters other than [A-Z0-9.-]');}};b.noConflict=function(a){if(a)return a={URI:this.noConflict()},l.URITemplate&&"function"===typeof l.URITemplate.noConflict&&(a.URITemplate=l.URITemplate.noConflict()),l.IPv6&&"function"===typeof l.IPv6.noConflict&&(a.IPv6=l.IPv6.noConflict()),l.SecondLevelDomains&&"function"===typeof l.SecondLevelDomains.noConflict&&(a.SecondLevelDomains=l.SecondLevelDomains.noConflict()),a;l.URI===this&&(l.URI=p);return this};f.build=function(a){if(!0===a)this._deferred_build=
48
+ !0;else if(void 0===a||this._deferred_build)this._string=b.build(this._parts),this._deferred_build=!1;return this};f.clone=function(){return new b(this)};f.valueOf=f.toString=function(){return this.build(!1)._string};f.protocol=t("protocol");f.username=t("username");f.password=t("password");f.hostname=t("hostname");f.port=t("port");f.query=r("query","?");f.fragment=r("fragment","#");f.search=function(a,c){var b=this.query(a,c);return"string"===typeof b&&b.length?"?"+b:b};f.hash=function(a,c){var b=
49
+ this.fragment(a,c);return"string"===typeof b&&b.length?"#"+b:b};f.pathname=function(a,c){if(void 0===a||!0===a){var d=this._parts.path||(this._parts.hostname?"/":"");return a?(this._parts.urn?b.decodeUrnPath:b.decodePath)(d):d}this._parts.path=this._parts.urn?a?b.recodeUrnPath(a):"":a?b.recodePath(a):"/";this.build(!c);return this};f.path=f.pathname;f.href=function(a,c){var d;if(void 0===a)return this.toString();this._string="";this._parts=b._parts();var f=a instanceof b,e="object"===typeof a&&(a.hostname||
50
+ a.path||a.pathname);a.nodeName&&(e=b.getDomAttribute(a),a=a[e]||"",e=!1);!f&&e&&void 0!==a.pathname&&(a=a.toString());if("string"===typeof a||a instanceof String)this._parts=b.parse(String(a),this._parts);else if(f||e)for(d in f=f?a._parts:a,f)v.call(this._parts,d)&&(this._parts[d]=f[d]);else throw new TypeError("invalid input");this.build(!c);return this};f.is=function(a){var c=!1,d=!1,f=!1,e=!1,k=!1,u=!1,h=!1,l=!this._parts.urn;this._parts.hostname&&(l=!1,d=b.ip4_expression.test(this._parts.hostname),
51
+ f=b.ip6_expression.test(this._parts.hostname),c=d||f,k=(e=!c)&&g&&g.has(this._parts.hostname),u=e&&b.idn_expression.test(this._parts.hostname),h=e&&b.punycode_expression.test(this._parts.hostname));switch(a.toLowerCase()){case "relative":return l;case "absolute":return!l;case "domain":case "name":return e;case "sld":return k;case "ip":return c;case "ip4":case "ipv4":case "inet4":return d;case "ip6":case "ipv6":case "inet6":return f;case "idn":return u;case "url":return!this._parts.urn;case "urn":return!!this._parts.urn;
52
+ case "punycode":return h}return null};var F=f.protocol,G=f.port,H=f.hostname;f.protocol=function(a,c){if(void 0!==a&&a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(b.protocol_expression)))throw new TypeError('Protocol "'+a+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return F.call(this,a,c)};f.scheme=f.protocol;f.port=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a&&(0===a&&(a=null),a&&(a+="",":"===a.charAt(0)&&(a=a.substring(1)),a.match(/[^0-9]/))))throw new TypeError('Port "'+
53
+ a+'" contains characters other than [0-9]');return G.call(this,a,c)};f.hostname=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0!==a){var d={};b.parseHost(a,d);a=d.hostname}return H.call(this,a,c)};f.host=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?b.buildHost(this._parts):"";b.parseHost(a,this._parts);this.build(!c);return this};f.authority=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a)return this._parts.hostname?
54
+ b.buildAuthority(this._parts):"";b.parseAuthority(a,this._parts);this.build(!c);return this};f.userinfo=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.username)return"";var d=b.buildUserinfo(this._parts);return d.substring(0,d.length-1)}"@"!==a[a.length-1]&&(a+="@");b.parseUserinfo(a,this._parts);this.build(!c);return this};f.resource=function(a,c){var d;if(void 0===a)return this.path()+this.search()+this.hash();d=b.parse(a);this._parts.path=d.path;this._parts.query=
55
+ d.query;this._parts.fragment=d.fragment;this.build(!c);return this};f.subdomain=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,d)||""}d=this._parts.hostname.length-this.domain().length;d=this._parts.hostname.substring(0,d);d=new RegExp("^"+h(d));a&&"."!==a.charAt(a.length-1)&&(a+=".");a&&b.ensureValidHostname(a);this._parts.hostname=
56
+ this._parts.hostname.replace(d,a);this.build(!c);return this};f.domain=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var d=this._parts.hostname.match(/\./g);if(d&&2>d.length)return this._parts.hostname;d=this._parts.hostname.length-this.tld(c).length-1;d=this._parts.hostname.lastIndexOf(".",d-1)+1;return this._parts.hostname.substring(d)||""}if(!a)throw new TypeError("cannot set domain empty");
57
+ b.ensureValidHostname(a);!this._parts.hostname||this.is("IP")?this._parts.hostname=a:(d=new RegExp(h(this.domain())+"$"),this._parts.hostname=this._parts.hostname.replace(d,a));this.build(!c);return this};f.tld=function(a,c){if(this._parts.urn)return void 0===a?"":this;"boolean"===typeof a&&(c=a,a=void 0);if(void 0===a){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.lastIndexOf("."),b=this._parts.hostname.substring(b+1);return!0!==c&&g&&g.list[b.toLowerCase()]?g.get(this._parts.hostname)||
58
+ b:b}if(a)if(a.match(/[^a-zA-Z0-9-]/))if(g&&g.is(a))b=new RegExp(h(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(b,a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");b=new RegExp(h(this.tld())+"$");this._parts.hostname=this._parts.hostname.replace(b,a)}else throw new TypeError("cannot set TLD empty");this.build(!c);return this};f.directory=
59
+ function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var d=this._parts.path.length-this.filename().length-1,d=this._parts.path.substring(0,d)||(this._parts.hostname?"/":"");return a?b.decodePath(d):d}d=this._parts.path.length-this.filename().length;d=this._parts.path.substring(0,d);d=new RegExp("^"+h(d));this.is("relative")||(a||(a="/"),"/"!==a.charAt(0)&&(a="/"+a));a&&"/"!==a.charAt(a.length-
60
+ 1)&&(a+="/");a=b.recodePath(a);this._parts.path=this._parts.path.replace(d,a);this.build(!c);return this};f.filename=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this._parts.path.lastIndexOf("/"),d=this._parts.path.substring(d+1);return a?b.decodePathSegment(d):d}d=!1;"/"===a.charAt(0)&&(a=a.substring(1));a.match(/\.?\//)&&(d=!0);var f=new RegExp(h(this.filename())+"$");a=b.recodePath(a);this._parts.path=
61
+ this._parts.path.replace(f,a);d?this.normalizePath(c):this.build(!c);return this};f.suffix=function(a,c){if(this._parts.urn)return void 0===a?"":this;if(void 0===a||!0===a){if(!this._parts.path||"/"===this._parts.path)return"";var d=this.filename(),f=d.lastIndexOf(".");if(-1===f)return"";d=d.substring(f+1);d=/^[a-z0-9%]+$/i.test(d)?d:"";return a?b.decodePathSegment(d):d}"."===a.charAt(0)&&(a=a.substring(1));if(d=this.suffix())f=a?new RegExp(h(d)+"$"):new RegExp(h("."+d)+"$");else{if(!a)return this;
62
+ this._parts.path+="."+b.recodePath(a)}f&&(a=b.recodePath(a),this._parts.path=this._parts.path.replace(f,a));this.build(!c);return this};f.segment=function(a,c,b){var f=this._parts.urn?":":"/",e=this.path(),k="/"===e.substring(0,1),e=e.split(f);void 0!==a&&"number"!==typeof a&&(b=c,c=a,a=void 0);if(void 0!==a&&"number"!==typeof a)throw Error('Bad segment "'+a+'", must be 0-based integer');k&&e.shift();0>a&&(a=Math.max(e.length+a,0));if(void 0===c)return void 0===a?e:e[a];if(null===a||void 0===e[a])if(w(c)){e=
63
+ [];a=0;for(var g=c.length;a<g;a++)if(c[a].length||e.length&&e[e.length-1].length)e.length&&!e[e.length-1].length&&e.pop(),e.push(c[a])}else{if(c||"string"===typeof c)""===e[e.length-1]?e[e.length-1]=c:e.push(c)}else c?e[a]=c:e.splice(a,1);k&&e.unshift("");return this.path(e.join(f),b)};f.segmentCoded=function(a,c,d){var f,e;"number"!==typeof a&&(d=c,c=a,a=void 0);if(void 0===c){a=this.segment(a,c,d);if(w(a))for(f=0,e=a.length;f<e;f++)a[f]=b.decode(a[f]);else a=void 0!==a?b.decode(a):void 0;return a}if(w(c))for(f=
64
+ 0,e=c.length;f<e;f++)c[f]=b.encode(c[f]);else c="string"===typeof c||c instanceof String?b.encode(c):c;return this.segment(a,c,d)};var I=f.query;f.query=function(a,c){if(!0===a)return b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"===typeof a){var d=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace),f=a.call(this,d);this._parts.query=b.buildQuery(f||d,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);this.build(!c);return this}return void 0!==
65
+ a&&"string"!==typeof a?(this._parts.query=b.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!c),this):I.call(this,a,c)};f.setQuery=function(a,c,d){var f=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"===typeof a||a instanceof String)f[a]=void 0!==c?c:null;else if("object"===typeof a)for(var e in a)v.call(a,e)&&(f[e]=a[e]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");this._parts.query=
66
+ b.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};f.addQuery=function(a,c,d){var f=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);b.addQuery(f,a,void 0===c?null:c);this._parts.query=b.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};f.removeQuery=function(a,c,d){var f=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);
67
+ b.removeQuery(f,a,c);this._parts.query=b.buildQuery(f,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace);"string"!==typeof a&&(d=c);this.build(!d);return this};f.hasQuery=function(a,c,d){var f=b.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return b.hasQuery(f,a,c,d)};f.setSearch=f.setQuery;f.addSearch=f.addQuery;f.removeSearch=f.removeQuery;f.hasSearch=f.hasQuery;f.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():
68
+ this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()};f.normalizeProtocol=function(a){"string"===typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a));return this};f.normalizeHostname=function(a){this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=
69
+ this._parts.hostname.toLowerCase(),this.build(!a));return this};f.normalizePort=function(a){"string"===typeof this._parts.protocol&&this._parts.port===b.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a));return this};f.normalizePath=function(a){var c=this._parts.path;if(!c)return this;if(this._parts.urn)return this._parts.path=b.recodeUrnPath(this._parts.path),this.build(!a),this;if("/"===this._parts.path)return this;var d,f="",e,k;"/"!==c.charAt(0)&&(d=!0,c="/"+c);if("/.."===
70
+ c.slice(-3)||"/."===c.slice(-2))c+="/";c=c.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/");d&&(f=c.substring(1).match(/^(\.\.\/)+/)||"")&&(f=f[0]);for(;;){e=c.indexOf("/..");if(-1===e)break;else if(0===e){c=c.substring(3);continue}k=c.substring(0,e).lastIndexOf("/");-1===k&&(k=e);c=c.substring(0,k)+c.substring(e+3)}d&&this.is("relative")&&(c=f+c.substring(1));c=b.recodePath(c);this._parts.path=c;this.build(!a);return this};f.normalizePathname=f.normalizePath;f.normalizeQuery=function(a){"string"===
71
+ typeof this._parts.query&&(this._parts.query.length?this.query(b.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a));return this};f.normalizeFragment=function(a){this._parts.fragment||(this._parts.fragment=null,this.build(!a));return this};f.normalizeSearch=f.normalizeQuery;f.normalizeHash=f.normalizeFragment;f.iso8859=function(){var a=b.encode,c=b.decode;b.encode=escape;b.decode=decodeURIComponent;try{this.normalize()}finally{b.encode=a,b.decode=c}return this};
72
+ f.unicode=function(){var a=b.encode,c=b.decode;b.encode=B;b.decode=unescape;try{this.normalize()}finally{b.encode=a,b.decode=c}return this};f.readable=function(){var a=this.clone();a.username("").password("").normalize();var c="";a._parts.protocol&&(c+=a._parts.protocol+"://");a._parts.hostname&&(a.is("punycode")&&e?(c+=e.toUnicode(a._parts.hostname),a._parts.port&&(c+=":"+a._parts.port)):c+=a.host());a._parts.hostname&&a._parts.path&&"/"!==a._parts.path.charAt(0)&&(c+="/");c+=a.path(!0);if(a._parts.query){for(var d=
73
+ "",f=0,k=a._parts.query.split("&"),g=k.length;f<g;f++){var u=(k[f]||"").split("="),d=d+("&"+b.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"));void 0!==u[1]&&(d+="="+b.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}c+="?"+d.substring(1)}return c+=b.decodeQuery(a.hash(),!0)};f.absoluteTo=function(a){var c=this.clone(),d=["protocol","username","password","hostname","port"],f,e;if(this._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");
74
+ a instanceof b||(a=new b(a));c._parts.protocol||(c._parts.protocol=a._parts.protocol);if(this._parts.hostname)return c;for(f=0;e=d[f];f++)c._parts[e]=a._parts[e];c._parts.path?".."===c._parts.path.substring(-2)&&(c._parts.path+="/"):(c._parts.path=a._parts.path,c._parts.query||(c._parts.query=a._parts.query));"/"!==c.path().charAt(0)&&(d=(d=a.directory())?d:0===a.path().indexOf("/")?"/":"",c._parts.path=(d?d+"/":"")+c._parts.path,c.normalizePath());c.build();return c};f.relativeTo=function(a){var c=
75
+ this.clone().normalize(),d,f,e;if(c._parts.urn)throw Error("URNs do not have any generally defined hierarchical components");a=(new b(a)).normalize();d=c._parts;f=a._parts;e=c.path();a=a.path();if("/"!==e.charAt(0))throw Error("URI is already relative");if("/"!==a.charAt(0))throw Error("Cannot calculate a URI relative to another relative URI");d.protocol===f.protocol&&(d.protocol=null);if(d.username===f.username&&d.password===f.password&&null===d.protocol&&null===d.username&&null===d.password&&d.hostname===
76
+ f.hostname&&d.port===f.port)d.hostname=null,d.port=null;else return c.build();if(e===a)return d.path="",c.build();e=b.commonPath(e,a);if(!e)return c.build();f=f.path.substring(e.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");d.path=f+d.path.substring(e.length)||"./";return c.build()};f.equals=function(a){var c=this.clone();a=new b(a);var d={},f={},e={},k;c.normalize();a.normalize();if(c.toString()===a.toString())return!0;d=c.query();f=a.query();c.query("");a.query("");if(c.toString()!==a.toString()||
77
+ d.length!==f.length)return!1;d=b.parseQuery(d,this._parts.escapeQuerySpace);f=b.parseQuery(f,this._parts.escapeQuerySpace);for(k in d)if(v.call(d,k)){if(!w(d[k])){if(d[k]!==f[k])return!1}else if(!D(d[k],f[k]))return!1;e[k]=!0}for(k in f)if(v.call(f,k)&&!e[k])return!1;return!0};f.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};f.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return b});
78
+ (function(e,n){"object"===typeof exports?module.exports=n(require("./URI")):"function"===typeof define&&define.amd?define(["./URI"],n):e.URITemplate=n(e.URI,e)})(this,function(e,n){function g(b){if(g._cache[b])return g._cache[b];if(!(this instanceof g))return new g(b);this.expression=b;g._cache[b]=this;return this}function l(b){this.data=b;this.cache={}}var b=n&&n.URITemplate,h=Object.prototype.hasOwnProperty,A=g.prototype,w={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},
77
79
  "+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",
78
- separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};g._cache={};g.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g;g.VARIABLE_PATTERN=/^([^*:]+)((\*)|:(\d+))?$/;g.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_]/;g.expand=function(b,f){var k=q[b.operator],m=k.named?"Named":"Unnamed",l=b.variables,t=[],p,e,u;for(u=0;e=l[u];u++)p=f.get(e.name),p.val.length?t.push(g["expand"+m](p,k,e.explode,e.explode&&k.separator||",",e.maxlength,e.name)):p.type&&t.push("");return t.length?k.prefix+t.join(k.separator):
79
- ""};g.expandNamed=function(b,g,k,m,l,t){var p="",e=g.encode;g=g.empty_name_separator;var u=!b[e].length,v=2===b.type?"":f[e](t),r,q,z;q=0;for(z=b.val.length;q<z;q++)l?(r=f[e](b.val[q][1].substring(0,l)),2===b.type&&(v=f[e](b.val[q][0].substring(0,l)))):u?(r=f[e](b.val[q][1]),2===b.type?(v=f[e](b.val[q][0]),b[e].push([v,r])):b[e].push([void 0,r])):(r=b[e][q][1],2===b.type&&(v=b[e][q][0])),p&&(p+=m),k?p+=v+(g||r?"=":"")+r:(q||(p+=f[e](t)+(g||r?"=":"")),2===b.type&&(p+=v+","),p+=r);return p};g.expandUnnamed=
80
- function(b,g,k,m,l){var t="",p=g.encode;g=g.empty_name_separator;var e=!b[p].length,q,v,r,z;r=0;for(z=b.val.length;r<z;r++)l?v=f[p](b.val[r][1].substring(0,l)):e?(v=f[p](b.val[r][1]),b[p].push([2===b.type?f[p](b.val[r][0]):void 0,v])):v=b[p][r][1],t&&(t+=m),2===b.type&&(q=l?f[p](b.val[r][0].substring(0,l)):b[p][r][0],t+=q,t=k?t+(g||v?"=":""):t+","),t+=v;return t};g.noConflict=function(){l.URITemplate===g&&(l.URITemplate=b);return g};z.expand=function(b){var f="";this.parts&&this.parts.length||this.parse();
81
- b instanceof m||(b=new m(b));for(var k=0,l=this.parts.length;k<l;k++)f+="string"===typeof this.parts[k]?this.parts[k]:g.expand(this.parts[k],b);return f};z.parse=function(){var b=this.expression,f=g.EXPRESSION_PATTERN,k=g.VARIABLE_PATTERN,m=g.VARIABLE_NAME_PATTERN,l=[],t=0,p,e,u;for(f.lastIndex=0;;){e=f.exec(b);if(null===e){l.push(b.substring(t));break}else l.push(b.substring(t,e.index)),t=e.index+e[0].length;if(!q[e[1]])throw Error('Unknown Operator "'+e[1]+'" in "'+e[0]+'"');if(!e[3])throw Error('Unclosed Expression "'+
82
- e[0]+'"');p=e[2].split(",");for(var v=0,r=p.length;v<r;v++){u=p[v].match(k);if(null===u)throw Error('Invalid Variable "'+p[v]+'" in "'+e[0]+'"');if(u[1].match(m))throw Error('Invalid Variable Name "'+u[1]+'" in "'+e[0]+'"');p[v]={name:u[1],explode:!!u[3],maxlength:u[4]&&parseInt(u[4],10)}}if(!p.length)throw Error('Expression Missing Variable(s) "'+e[0]+'"');l.push({expression:e[0],operator:e[1],variables:p})}l.length||l.push(b);this.parts=l;return this};m.prototype.get=function(b){var f=this.data,
83
- g={type:0,val:[],encode:[],encodeReserved:[]},l;if(void 0!==this.cache[b])return this.cache[b];this.cache[b]=g;f="[object Function]"===String(Object.prototype.toString.call(f))?f(b):"[object Function]"===String(Object.prototype.toString.call(f[b]))?f[b](b):f[b];if(void 0!==f&&null!==f)if("[object Array]"===String(Object.prototype.toString.call(f))){l=0;for(b=f.length;l<b;l++)void 0!==f[l]&&null!==f[l]&&g.val.push([void 0,String(f[l])]);g.val.length&&(g.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(f))){for(l in f)k.call(f,
84
- l)&&void 0!==f[l]&&null!==f[l]&&g.val.push([l,String(f[l])]);g.val.length&&(g.type=2)}else g.type=1,g.val.push([void 0,String(f)]);return g};f.expand=function(b,k){var l=(new g(b)).expand(k);return new f(l)};return g});
80
+ separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};g._cache={};g.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g;g.VARIABLE_PATTERN=/^([^*:]+)((\*)|:(\d+))?$/;g.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_]/;g.expand=function(b,e){var h=w[b.operator],l=h.named?"Named":"Unnamed",n=b.variables,t=[],r,p,f;for(f=0;p=n[f];f++)r=e.get(p.name),r.val.length?t.push(g["expand"+l](r,h,p.explode,p.explode&&h.separator||",",p.maxlength,p.name)):r.type&&t.push("");return t.length?h.prefix+t.join(h.separator):
81
+ ""};g.expandNamed=function(b,g,h,l,n,t){var r="",p=g.encode;g=g.empty_name_separator;var f=!b[p].length,v=2===b.type?"":e[p](t),q,x,w;x=0;for(w=b.val.length;x<w;x++)n?(q=e[p](b.val[x][1].substring(0,n)),2===b.type&&(v=e[p](b.val[x][0].substring(0,n)))):f?(q=e[p](b.val[x][1]),2===b.type?(v=e[p](b.val[x][0]),b[p].push([v,q])):b[p].push([void 0,q])):(q=b[p][x][1],2===b.type&&(v=b[p][x][0])),r&&(r+=l),h?r+=v+(g||q?"=":"")+q:(x||(r+=e[p](t)+(g||q?"=":"")),2===b.type&&(r+=v+","),r+=q);return r};g.expandUnnamed=
82
+ function(b,g,h,l,n){var t="",r=g.encode;g=g.empty_name_separator;var p=!b[r].length,f,v,q,w;q=0;for(w=b.val.length;q<w;q++)n?v=e[r](b.val[q][1].substring(0,n)):p?(v=e[r](b.val[q][1]),b[r].push([2===b.type?e[r](b.val[q][0]):void 0,v])):v=b[r][q][1],t&&(t+=l),2===b.type&&(f=n?e[r](b.val[q][0].substring(0,n)):b[r][q][0],t+=f,t=h?t+(g||v?"=":""):t+","),t+=v;return t};g.noConflict=function(){n.URITemplate===g&&(n.URITemplate=b);return g};A.expand=function(b){var e="";this.parts&&this.parts.length||this.parse();
83
+ b instanceof l||(b=new l(b));for(var h=0,n=this.parts.length;h<n;h++)e+="string"===typeof this.parts[h]?this.parts[h]:g.expand(this.parts[h],b);return e};A.parse=function(){var b=this.expression,e=g.EXPRESSION_PATTERN,h=g.VARIABLE_PATTERN,n=g.VARIABLE_NAME_PATTERN,l=[],t=0,r,p,f;for(e.lastIndex=0;;){p=e.exec(b);if(null===p){l.push(b.substring(t));break}else l.push(b.substring(t,p.index)),t=p.index+p[0].length;if(!w[p[1]])throw Error('Unknown Operator "'+p[1]+'" in "'+p[0]+'"');if(!p[3])throw Error('Unclosed Expression "'+
84
+ p[0]+'"');r=p[2].split(",");for(var v=0,q=r.length;v<q;v++){f=r[v].match(h);if(null===f)throw Error('Invalid Variable "'+r[v]+'" in "'+p[0]+'"');if(f[1].match(n))throw Error('Invalid Variable Name "'+f[1]+'" in "'+p[0]+'"');r[v]={name:f[1],explode:!!f[3],maxlength:f[4]&&parseInt(f[4],10)}}if(!r.length)throw Error('Expression Missing Variable(s) "'+p[0]+'"');l.push({expression:p[0],operator:p[1],variables:r})}l.length||l.push(b);this.parts=l;return this};l.prototype.get=function(b){var e=this.data,
85
+ g={type:0,val:[],encode:[],encodeReserved:[]},l;if(void 0!==this.cache[b])return this.cache[b];this.cache[b]=g;e="[object Function]"===String(Object.prototype.toString.call(e))?e(b):"[object Function]"===String(Object.prototype.toString.call(e[b]))?e[b](b):e[b];if(void 0!==e&&null!==e)if("[object Array]"===String(Object.prototype.toString.call(e))){l=0;for(b=e.length;l<b;l++)void 0!==e[l]&&null!==e[l]&&g.val.push([void 0,String(e[l])]);g.val.length&&(g.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(e))){for(l in e)h.call(e,
86
+ l)&&void 0!==e[l]&&null!==e[l]&&g.val.push([l,String(e[l])]);g.val.length&&(g.type=2)}else g.type=1,g.val.push([void 0,String(e)]);return g};e.expand=function(b,h){var l=(new g(b)).expand(h);return new e(l)};return g});
@@ -2,7 +2,7 @@
2
2
  * URI.js - Mutating URLs
3
3
  * URI Template Support - http://tools.ietf.org/html/rfc6570
4
4
  *
5
- * Version: 1.14.2
5
+ * Version: 1.15.2
6
6
  *
7
7
  * Author: Rodney Rehm
8
8
  * Web: http://medialize.github.io/URI.js/
@@ -2,7 +2,7 @@
2
2
  * URI.js - Mutating URLs
3
3
  * jQuery Plugin
4
4
  *
5
- * Version: 1.14.2
5
+ * Version: 1.15.2
6
6
  *
7
7
  * Author: Rodney Rehm
8
8
  * Web: http://medialize.github.io/URI.js/jquery-uri-plugin.html
@@ -1,4 +1,4 @@
1
- /*! URI.js v1.14.2 http://medialize.github.io/URI.js/ */
1
+ /*! URI.js v1.15.2 http://medialize.github.io/URI.js/ */
2
2
  /* build contains: jquery.URI.js */
3
3
  (function(d,e){"object"===typeof exports?module.exports=e(require("jquery","./URI")):"function"===typeof define&&define.amd?define(["jquery","./URI"],e):e(d.jQuery,d.URI)})(this,function(d,e){function h(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function k(a){var b=a.nodeName.toLowerCase();return"input"===b&&"image"!==a.type?void 0:e.domAttributes[b]}function p(a){return{get:function(b){return d(b).uri()[a]()},set:function(b,c){d(b).uri()[a](c);return c}}}function l(a,b){var c,e,f;if(!k(a)||
4
4
  !b)return!1;c=b.match(q);if(!c||!c[5]&&":"!==c[2]&&!g[c[2]])return!1;f=d(a).uri();if(c[5])return f.is(c[5]);if(":"===c[2])return e=c[1].toLowerCase()+":",g[e]?g[e](f,c[4]):!1;e=c[1].toLowerCase();return m[e]?g[c[2]](f[e](),c[4],e):!1}var m={},g={"=":function(a,b){return a===b},"^=":function(a,b){return!!(a+"").match(new RegExp("^"+h(b),"i"))},"$=":function(a,b){return!!(a+"").match(new RegExp(h(b)+"$","i"))},"*=":function(a,b,c){"directory"===c&&(a+="/");return!!(a+"").match(new RegExp(h(b),"i"))},
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-js-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2.1
4
+ version: 1.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Wenglewski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email:
@@ -56,8 +56,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: '0'
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.2.2
59
+ rubygems_version: 2.4.6
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: URI.js for rails
63
63
  test_files: []
64
+ has_rdoc: