chunk-CFVLY6NB.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. import {
  2. e
  3. } from "./chunk-U2XHEJM7.js";
  4. import {
  5. has
  6. } from "./chunk-SPWQ3AWG.js";
  7. // node_modules/@arcgis/core/core/pbf.js
  8. var e2;
  9. !function(t) {
  10. t[t.varint = 0] = "varint", t[t.fixed64 = 1] = "fixed64", t[t.delimited = 2] = "delimited", t[t.fixed32 = 5] = "fixed32", t[t.unknown = 99] = "unknown";
  11. }(e2 || (e2 = {}));
  12. var i = 4294967296;
  13. var s = new TextDecoder("utf-8");
  14. var r = has("safari") || has("ios") ? 6 : has("ff") ? 12 : 32;
  15. var n = class {
  16. constructor(t, i2, s2 = 0, r2 = t ? t.byteLength : 0) {
  17. this._tag = 0, this._dataType = e2.unknown, this._init(t, i2, s2, r2);
  18. }
  19. _init(t, e3, i2, s2) {
  20. this._data = t, this._dataView = e3, this._pos = i2, this._end = s2;
  21. }
  22. asUnsafe() {
  23. return this;
  24. }
  25. clone() {
  26. return new n(this._data, this._dataView, this._pos, this._end);
  27. }
  28. pos() {
  29. return this._pos;
  30. }
  31. move(t) {
  32. this._pos = t;
  33. }
  34. nextTag(t) {
  35. for (; ; ) {
  36. if (this._pos === this._end)
  37. return false;
  38. const e3 = this._decodeVarint();
  39. if (this._tag = e3 >> 3, this._dataType = 7 & e3, !t || t === this._tag)
  40. break;
  41. this.skip();
  42. }
  43. return true;
  44. }
  45. next() {
  46. if (this._pos === this._end)
  47. return false;
  48. const t = this._decodeVarint();
  49. return this._tag = t >> 3, this._dataType = 7 & t, true;
  50. }
  51. empty() {
  52. return this._pos >= this._end;
  53. }
  54. tag() {
  55. return this._tag;
  56. }
  57. getInt32() {
  58. return this._decodeVarint();
  59. }
  60. getInt64() {
  61. return this._decodeVarint();
  62. }
  63. getUInt32() {
  64. let t = 4294967295;
  65. return t = (127 & this._data[this._pos]) >>> 0, this._data[this._pos++] < 128 ? t : (t = (t | (127 & this._data[this._pos]) << 7) >>> 0, this._data[this._pos++] < 128 ? t : (t = (t | (127 & this._data[this._pos]) << 14) >>> 0, this._data[this._pos++] < 128 ? t : (t = (t | (127 & this._data[this._pos]) << 21) >>> 0, this._data[this._pos++] < 128 ? t : (t = (t | (15 & this._data[this._pos]) << 28) >>> 0, this._data[this._pos++] < 128 ? t : void 0))));
  66. }
  67. getUInt64() {
  68. return this._decodeVarint();
  69. }
  70. getSInt32() {
  71. const t = this.getUInt32();
  72. if (void 0 !== t)
  73. return t >>> 1 ^ -(1 & t) | 0;
  74. }
  75. getSInt64() {
  76. return this._decodeSVarint();
  77. }
  78. getBool() {
  79. const t = 0 !== this._data[this._pos];
  80. return this._skip(1), t;
  81. }
  82. getEnum() {
  83. return this._decodeVarint();
  84. }
  85. getFixed64() {
  86. const t = this._dataView, e3 = this._pos, s2 = t.getUint32(e3, true) + t.getUint32(e3 + 4, true) * i;
  87. return this._skip(8), s2;
  88. }
  89. getSFixed64() {
  90. const t = this._dataView, e3 = this._pos, s2 = t.getUint32(e3, true) + t.getInt32(e3 + 4, true) * i;
  91. return this._skip(8), s2;
  92. }
  93. getDouble() {
  94. const t = this._dataView.getFloat64(this._pos, true);
  95. return this._skip(8), t;
  96. }
  97. getFixed32() {
  98. const t = this._dataView.getUint32(this._pos, true);
  99. return this._skip(4), t;
  100. }
  101. getSFixed32() {
  102. const t = this._dataView.getInt32(this._pos, true);
  103. return this._skip(4), t;
  104. }
  105. getFloat() {
  106. const t = this._dataView.getFloat32(this._pos, true);
  107. return this._skip(4), t;
  108. }
  109. getString() {
  110. const t = this._getLength(), e3 = this._pos, i2 = this._toString(this._data, e3, e3 + t);
  111. return this._skip(t), i2;
  112. }
  113. getBytes() {
  114. const t = this._getLength(), e3 = this._pos, i2 = this._toBytes(this._data, e3, e3 + t);
  115. return this._skip(t), i2;
  116. }
  117. getLength() {
  118. return this._getLengthUnsafe();
  119. }
  120. processMessageWithArgs(t, e3, i2, s2) {
  121. const r2 = this.getMessage(), n2 = t(r2, e3, i2, s2);
  122. return r2.release(), n2;
  123. }
  124. processMessage(t) {
  125. const e3 = this.getMessage(), i2 = t(e3);
  126. return e3.release(), i2;
  127. }
  128. getMessage() {
  129. const t = this._getLength(), e3 = n.pool.acquire();
  130. return e3._init(this._data, this._dataView, this._pos, this._pos + t), this._skip(t), e3;
  131. }
  132. release() {
  133. n.pool.release(this);
  134. }
  135. dataType() {
  136. return this._dataType;
  137. }
  138. skip() {
  139. switch (this._dataType) {
  140. case e2.varint:
  141. this._decodeVarint();
  142. break;
  143. case e2.fixed64:
  144. this._skip(8);
  145. break;
  146. case e2.delimited:
  147. this._skip(this._getLength());
  148. break;
  149. case e2.fixed32:
  150. this._skip(4);
  151. break;
  152. default:
  153. throw new Error("Invalid data type!");
  154. }
  155. }
  156. skipLen(t) {
  157. this._skip(t);
  158. }
  159. _skip(t) {
  160. if (this._pos + t > this._end)
  161. throw new Error("Attempt to skip past the end of buffer!");
  162. this._pos += t;
  163. }
  164. _decodeVarint() {
  165. const t = this._data;
  166. let e3 = this._pos, i2 = 0, s2 = 0;
  167. if (this._end - e3 >= 10)
  168. do {
  169. if (s2 = t[e3++], i2 |= 127 & s2, 0 == (128 & s2))
  170. break;
  171. if (s2 = t[e3++], i2 |= (127 & s2) << 7, 0 == (128 & s2))
  172. break;
  173. if (s2 = t[e3++], i2 |= (127 & s2) << 14, 0 == (128 & s2))
  174. break;
  175. if (s2 = t[e3++], i2 |= (127 & s2) << 21, 0 == (128 & s2))
  176. break;
  177. if (s2 = t[e3++], i2 += 268435456 * (127 & s2), 0 == (128 & s2))
  178. break;
  179. if (s2 = t[e3++], i2 += 34359738368 * (127 & s2), 0 == (128 & s2))
  180. break;
  181. if (s2 = t[e3++], i2 += 4398046511104 * (127 & s2), 0 == (128 & s2))
  182. break;
  183. if (s2 = t[e3++], i2 += 562949953421312 * (127 & s2), 0 == (128 & s2))
  184. break;
  185. if (s2 = t[e3++], i2 += 72057594037927940 * (127 & s2), 0 == (128 & s2))
  186. break;
  187. if (s2 = t[e3++], i2 += 9223372036854776e3 * (127 & s2), 0 == (128 & s2))
  188. break;
  189. throw new Error("Varint too long!");
  190. } while (0);
  191. else {
  192. let r2 = 1;
  193. for (; e3 !== this._end && (s2 = t[e3], 0 != (128 & s2)); )
  194. ++e3, i2 += (127 & s2) * r2, r2 *= 128;
  195. if (e3 === this._end)
  196. throw new Error("Varint overrun!");
  197. ++e3, i2 += s2 * r2;
  198. }
  199. return this._pos = e3, i2;
  200. }
  201. _decodeSVarint() {
  202. const t = this._data;
  203. let e3 = this._pos, i2 = 0, s2 = 0;
  204. const r2 = 1 & t[e3];
  205. if (this._end - e3 >= 10)
  206. do {
  207. if (s2 = t[e3++], i2 |= 127 & s2, 0 == (128 & s2))
  208. break;
  209. if (s2 = t[e3++], i2 |= (127 & s2) << 7, 0 == (128 & s2))
  210. break;
  211. if (s2 = t[e3++], i2 |= (127 & s2) << 14, 0 == (128 & s2))
  212. break;
  213. if (s2 = t[e3++], i2 |= (127 & s2) << 21, 0 == (128 & s2))
  214. break;
  215. if (s2 = t[e3++], i2 += 268435456 * (127 & s2), 0 == (128 & s2))
  216. break;
  217. if (s2 = t[e3++], i2 += 34359738368 * (127 & s2), 0 == (128 & s2))
  218. break;
  219. if (s2 = t[e3++], i2 += 4398046511104 * (127 & s2), 0 == (128 & s2))
  220. break;
  221. if (s2 = t[e3++], i2 += 562949953421312 * (127 & s2), 0 == (128 & s2))
  222. break;
  223. if (s2 = t[e3++], i2 += 72057594037927940 * (127 & s2), 0 == (128 & s2))
  224. break;
  225. if (s2 = t[e3++], i2 += 9223372036854776e3 * (127 & s2), 0 == (128 & s2))
  226. break;
  227. throw new Error("Varint too long!");
  228. } while (0);
  229. else {
  230. let r3 = 1;
  231. for (; e3 !== this._end && (s2 = t[e3], 0 != (128 & s2)); )
  232. ++e3, i2 += (127 & s2) * r3, r3 *= 128;
  233. if (e3 === this._end)
  234. throw new Error("Varint overrun!");
  235. ++e3, i2 += s2 * r3;
  236. }
  237. return this._pos = e3, r2 ? -(i2 + 1) / 2 : i2 / 2;
  238. }
  239. _getLength() {
  240. if (this._dataType !== e2.delimited)
  241. throw new Error("Not a delimited data type!");
  242. return this._decodeVarint();
  243. }
  244. _getLengthUnsafe() {
  245. return this.getUInt32();
  246. }
  247. _toString(t, e3, i2) {
  248. if ((i2 = Math.min(this._end, i2)) - e3 > r) {
  249. const r2 = t.subarray(e3, i2);
  250. return s.decode(r2);
  251. }
  252. let n2 = "", a = "";
  253. for (let s2 = e3; s2 < i2; ++s2) {
  254. const e4 = t[s2];
  255. 128 & e4 ? a += "%" + e4.toString(16) : (n2 += decodeURIComponent(a) + String.fromCharCode(e4), a = "");
  256. }
  257. return a.length && (n2 += decodeURIComponent(a)), n2;
  258. }
  259. _toBytes(t, e3, i2) {
  260. return i2 = Math.min(this._end, i2), new Uint8Array(t.buffer, e3, i2 - e3);
  261. }
  262. };
  263. n.pool = new e(n, void 0, (t) => {
  264. t._data = null, t._dataView = null;
  265. });
  266. export {
  267. n
  268. };
  269. //# sourceMappingURL=chunk-CFVLY6NB.js.map