@synnaxlabs/x 0.42.1 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/.turbo/turbo-build.log +93 -105
  2. package/.vscode/settings.json +4 -6
  3. package/README.md +1 -7
  4. package/dist/array.cjs +1 -0
  5. package/dist/array.js +7 -0
  6. package/dist/base-B5lQIJKc.js +38 -0
  7. package/dist/base-CTq-lhpU.cjs +1 -0
  8. package/dist/binary.cjs +1 -1
  9. package/dist/binary.js +1 -1
  10. package/dist/bounds.cjs +1 -1
  11. package/dist/bounds.js +2 -2
  12. package/dist/box.cjs +1 -1
  13. package/dist/box.js +1 -1
  14. package/dist/caseconv.cjs +1 -1
  15. package/dist/caseconv.js +2 -2
  16. package/dist/change.cjs +1 -1
  17. package/dist/change.js +10 -2
  18. package/dist/compare.cjs +1 -1
  19. package/dist/compare.js +1 -1
  20. package/dist/deep.cjs +1 -1
  21. package/dist/deep.js +92 -79
  22. package/dist/dimensions.cjs +1 -1
  23. package/dist/dimensions.js +41 -2
  24. package/dist/direction.cjs +1 -1
  25. package/dist/direction.js +1 -1
  26. package/dist/index-4GlOgZuh.js +99 -0
  27. package/dist/{direction-C-b6XTeU.cjs → index-B58dnYRu.cjs} +1 -1
  28. package/dist/index-BMGaoK93.cjs +1 -0
  29. package/dist/index-BTet04Hd.cjs +6 -0
  30. package/dist/{scale-DfJe9755.js → index-BUa-NXAX.js} +46 -46
  31. package/dist/{xy-D_LqxaGt.js → index-C-qYOegc.js} +62 -62
  32. package/dist/index-C07SBJhr.js +128 -0
  33. package/dist/{bounds-Bn5_l4Z3.js → index-C9EdKeu1.js} +77 -76
  34. package/dist/index-CM8ZDZ6s.cjs +1 -0
  35. package/dist/index-CV2JaHfw.cjs +1 -0
  36. package/dist/index-CeBvOwG8.cjs +3 -0
  37. package/dist/index-ClrGyGDp.js +205 -0
  38. package/dist/index-CqQXXeCI.cjs +1 -0
  39. package/dist/{location-C3aeu046.js → index-D6V-8SKw.js} +26 -26
  40. package/dist/index-DBGAIs_7.js +2492 -0
  41. package/dist/index-DEdq2tza.cjs +1 -0
  42. package/dist/index-DKMnHBGR.cjs +1 -0
  43. package/dist/index-Dql5FMcH.js +47 -0
  44. package/dist/{direction-BL0PhD1k.js → index-DxU1zwsd.js} +1 -1
  45. package/dist/index-WwMnwoLy.cjs +1 -0
  46. package/dist/index.cjs +5 -3
  47. package/dist/index.js +5372 -649
  48. package/dist/kv.cjs +1 -1
  49. package/dist/kv.js +45 -2
  50. package/dist/location.cjs +1 -1
  51. package/dist/location.js +1 -1
  52. package/dist/position.cjs +1 -1
  53. package/dist/position.js +83 -2
  54. package/dist/record.cjs +1 -1
  55. package/dist/record.js +8 -10
  56. package/dist/runtime.cjs +1 -1
  57. package/dist/runtime.js +27 -2
  58. package/dist/scale.cjs +1 -1
  59. package/dist/scale.js +1 -1
  60. package/dist/schemas-55Usj0Fg.js +3998 -0
  61. package/dist/schemas-DbXuI2Qr.cjs +27 -0
  62. package/dist/spatial.cjs +1 -1
  63. package/dist/spatial.js +25 -18
  64. package/dist/src/array/index.d.ts +2 -0
  65. package/dist/src/array/index.d.ts.map +1 -0
  66. package/dist/src/array/toArray.d.ts +19 -0
  67. package/dist/src/array/toArray.d.ts.map +1 -0
  68. package/dist/src/array/toArray.spec.d.ts +2 -0
  69. package/dist/src/array/toArray.spec.d.ts.map +1 -0
  70. package/dist/src/binary/codec.d.ts +8 -16
  71. package/dist/src/binary/codec.d.ts.map +1 -1
  72. package/dist/src/breaker/breaker.d.ts +6 -6
  73. package/dist/src/breaker/breaker.d.ts.map +1 -1
  74. package/dist/src/caseconv/caseconv.d.ts +1 -1
  75. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  76. package/dist/src/change/change.d.ts +3 -3
  77. package/dist/src/change/change.d.ts.map +1 -1
  78. package/dist/src/color/color.d.ts +63 -28
  79. package/dist/src/color/color.d.ts.map +1 -1
  80. package/dist/src/color/external.d.ts +0 -1
  81. package/dist/src/color/external.d.ts.map +1 -1
  82. package/dist/src/color/gradient.d.ts +9 -5
  83. package/dist/src/color/gradient.d.ts.map +1 -1
  84. package/dist/src/color/palette.d.ts +14 -6
  85. package/dist/src/color/palette.d.ts.map +1 -1
  86. package/dist/src/compare/compare.d.ts +4 -4
  87. package/dist/src/compare/compare.d.ts.map +1 -1
  88. package/dist/src/control/control.d.ts +32 -32
  89. package/dist/src/control/control.d.ts.map +1 -1
  90. package/dist/src/debounce/debounce.d.ts +1 -1
  91. package/dist/src/debounce/debounce.d.ts.map +1 -1
  92. package/dist/src/deep/delete.d.ts +1 -1
  93. package/dist/src/deep/delete.d.ts.map +1 -1
  94. package/dist/src/deep/difference.d.ts.map +1 -1
  95. package/dist/src/deep/equal.d.ts +4 -4
  96. package/dist/src/deep/equal.d.ts.map +1 -1
  97. package/dist/src/deep/merge.d.ts +1 -1
  98. package/dist/src/deep/merge.d.ts.map +1 -1
  99. package/dist/src/errors/errors.d.ts +62 -36
  100. package/dist/src/errors/errors.d.ts.map +1 -1
  101. package/dist/src/index.d.ts +4 -1
  102. package/dist/src/index.d.ts.map +1 -1
  103. package/dist/src/instance/index.d.ts +2 -0
  104. package/dist/src/instance/index.d.ts.map +1 -0
  105. package/dist/src/instance/matcher.d.ts +79 -0
  106. package/dist/src/instance/matcher.d.ts.map +1 -0
  107. package/dist/src/instance/matcher.spec.d.ts +2 -0
  108. package/dist/src/instance/matcher.spec.d.ts.map +1 -0
  109. package/dist/src/jsonrpc/jsonrpc.d.ts +40 -9
  110. package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
  111. package/dist/src/kv/types.d.ts +2 -2
  112. package/dist/src/kv/types.d.ts.map +1 -1
  113. package/dist/src/migrate/migrate.d.ts +5 -5
  114. package/dist/src/migrate/migrate.d.ts.map +1 -1
  115. package/dist/src/notation/notation.d.ts +1 -1
  116. package/dist/src/notation/notation.d.ts.map +1 -1
  117. package/dist/src/primitive/index.d.ts +2 -0
  118. package/dist/src/primitive/index.d.ts.map +1 -0
  119. package/dist/src/primitive/primitive.d.ts +39 -0
  120. package/dist/src/primitive/primitive.d.ts.map +1 -0
  121. package/dist/src/primitive/primitive.spec.d.ts +2 -0
  122. package/dist/src/primitive/primitive.spec.d.ts.map +1 -0
  123. package/dist/src/record.d.ts +2 -2
  124. package/dist/src/record.d.ts.map +1 -1
  125. package/dist/src/renderable.d.ts +1 -1
  126. package/dist/src/renderable.d.ts.map +1 -1
  127. package/dist/src/replace.d.ts.map +1 -1
  128. package/dist/src/runtime/detect.d.ts.map +1 -1
  129. package/dist/src/runtime/os.d.ts +1 -1
  130. package/dist/src/runtime/os.d.ts.map +1 -1
  131. package/dist/src/spatial/base.d.ts +10 -10
  132. package/dist/src/spatial/base.d.ts.map +1 -1
  133. package/dist/src/spatial/bounds/bounds.d.ts +82 -16
  134. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  135. package/dist/src/spatial/box/box.d.ts +7 -7
  136. package/dist/src/spatial/box/box.d.ts.map +1 -1
  137. package/dist/src/spatial/dimensions/dimensions.d.ts +5 -5
  138. package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
  139. package/dist/src/spatial/direction/direction.d.ts +1 -1
  140. package/dist/src/spatial/location/location.d.ts +4 -4
  141. package/dist/src/spatial/location/location.d.ts.map +1 -1
  142. package/dist/src/spatial/scale/scale.d.ts +11 -11
  143. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  144. package/dist/src/spatial/xy/xy.d.ts +5 -5
  145. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  146. package/dist/src/status/index.d.ts +2 -0
  147. package/dist/src/status/index.d.ts.map +1 -0
  148. package/dist/src/status/types.d.ts +11 -0
  149. package/dist/src/status/types.d.ts.map +1 -0
  150. package/dist/src/sync/index.d.ts.map +1 -1
  151. package/dist/src/sync/mutex.d.ts +0 -1
  152. package/dist/src/sync/mutex.d.ts.map +1 -1
  153. package/dist/src/telem/gl.d.ts +1 -1
  154. package/dist/src/telem/gl.d.ts.map +1 -1
  155. package/dist/src/telem/series.d.ts +468 -62
  156. package/dist/src/telem/series.d.ts.map +1 -1
  157. package/dist/src/telem/telem.d.ts +243 -53
  158. package/dist/src/telem/telem.d.ts.map +1 -1
  159. package/dist/src/uuid/index.d.ts +2 -0
  160. package/dist/src/uuid/index.d.ts.map +1 -0
  161. package/dist/src/uuid/uuid.d.ts +35 -0
  162. package/dist/src/uuid/uuid.d.ts.map +1 -0
  163. package/dist/src/uuid/uuid.spec.d.ts +2 -0
  164. package/dist/src/uuid/uuid.spec.d.ts.map +1 -0
  165. package/dist/src/zod/external.d.ts +1 -1
  166. package/dist/src/zod/external.d.ts.map +1 -1
  167. package/dist/src/zod/nullToUndefined.d.ts +3 -0
  168. package/dist/src/zod/nullToUndefined.d.ts.map +1 -0
  169. package/dist/src/zod/nullToUndefined.spec.d.ts +2 -0
  170. package/dist/src/zod/nullToUndefined.spec.d.ts.map +1 -0
  171. package/dist/src/zod/util.d.ts +2 -2
  172. package/dist/src/zod/util.d.ts.map +1 -1
  173. package/dist/telem.cjs +1 -1
  174. package/dist/telem.js +1 -1
  175. package/dist/xy.cjs +1 -1
  176. package/dist/xy.js +1 -1
  177. package/dist/zod.cjs +1 -1
  178. package/dist/zod.js +19 -2
  179. package/eslint.config.js +1 -1
  180. package/package.json +16 -14
  181. package/src/{toArray.ts → array/index.ts} +1 -5
  182. package/src/array/toArray.spec.ts +56 -0
  183. package/src/array/toArray.ts +28 -0
  184. package/src/binary/codec.spec.ts +201 -278
  185. package/src/binary/codec.ts +20 -76
  186. package/src/breaker/breaker.ts +3 -3
  187. package/src/caseconv/caseconv.ts +6 -4
  188. package/src/change/change.ts +2 -2
  189. package/src/color/color.spec.ts +121 -2
  190. package/src/color/color.ts +90 -54
  191. package/src/color/external.ts +0 -1
  192. package/src/color/gradient.ts +20 -28
  193. package/src/color/palette.ts +1 -1
  194. package/src/compare/compare.ts +5 -5
  195. package/src/control/control.ts +22 -19
  196. package/src/debounce/debounce.ts +1 -1
  197. package/src/deep/delete.ts +5 -4
  198. package/src/deep/difference.ts +6 -2
  199. package/src/deep/equal.spec.ts +1 -1
  200. package/src/deep/equal.ts +5 -5
  201. package/src/deep/merge.spec.ts +13 -1
  202. package/src/deep/merge.ts +16 -7
  203. package/src/deep/path.ts +1 -1
  204. package/src/errors/errors.ts +65 -44
  205. package/src/index.ts +4 -1
  206. package/src/instance/index.ts +10 -0
  207. package/src/instance/matcher.spec.ts +78 -0
  208. package/src/instance/matcher.ts +98 -0
  209. package/src/jsonrpc/jsonrpc.spec.ts +2 -1
  210. package/src/jsonrpc/jsonrpc.ts +36 -7
  211. package/src/kv/types.ts +1 -1
  212. package/src/migrate/migrate.spec.ts +1 -1
  213. package/src/migrate/migrate.ts +7 -7
  214. package/src/notation/notation.ts +1 -1
  215. package/src/primitive/index.ts +10 -0
  216. package/src/primitive/primitive.spec.ts +126 -0
  217. package/src/primitive/primitive.ts +82 -0
  218. package/src/record.ts +3 -5
  219. package/src/renderable.ts +1 -1
  220. package/src/replace.ts +9 -0
  221. package/src/runtime/detect.ts +0 -2
  222. package/src/runtime/os.ts +1 -1
  223. package/src/spatial/base.ts +1 -1
  224. package/src/spatial/bounds/bounds.spec.ts +20 -0
  225. package/src/spatial/bounds/bounds.ts +101 -18
  226. package/src/spatial/box/box.ts +1 -1
  227. package/src/spatial/dimensions/dimensions.ts +3 -3
  228. package/src/spatial/location/location.ts +1 -1
  229. package/src/spatial/scale/scale.ts +1 -1
  230. package/src/spatial/xy/xy.ts +1 -1
  231. package/src/status/index.ts +10 -0
  232. package/src/status/types.ts +22 -0
  233. package/src/sync/index.ts +9 -0
  234. package/src/sync/mutex.ts +9 -4
  235. package/src/telem/gl.ts +1 -1
  236. package/src/telem/series.spec.ts +735 -68
  237. package/src/telem/series.ts +536 -195
  238. package/src/telem/telem.spec.ts +60 -7
  239. package/src/telem/telem.ts +287 -95
  240. package/src/uuid/index.ts +10 -0
  241. package/src/uuid/uuid.spec.ts +82 -0
  242. package/src/uuid/uuid.ts +48 -0
  243. package/src/zod/external.ts +1 -1
  244. package/src/zod/nullToUndefined.spec.ts +31 -0
  245. package/src/zod/nullToUndefined.ts +23 -0
  246. package/src/zod/util.spec.ts +1 -1
  247. package/src/zod/util.ts +6 -6
  248. package/tsconfig.json +1 -1
  249. package/tsconfig.tsbuildinfo +1 -1
  250. package/vite.config.ts +1 -1
  251. package/dist/base-BAM2mqCy.cjs +0 -1
  252. package/dist/base-DFq0vvGn.js +0 -38
  253. package/dist/bounds-BQo7rvs9.cjs +0 -1
  254. package/dist/box-0YrQibkB.cjs +0 -1
  255. package/dist/box-Cc8IzcNo.js +0 -205
  256. package/dist/change-C-YELKx6.cjs +0 -1
  257. package/dist/change-DLl6DccR.js +0 -12
  258. package/dist/dimensions-CRgergMS.js +0 -43
  259. package/dist/dimensions-D2QGoNXO.cjs +0 -1
  260. package/dist/external-BPgtxa8d.js +0 -29
  261. package/dist/external-C-dNgNQw.cjs +0 -1
  262. package/dist/external-C8TFju8Q.js +0 -29
  263. package/dist/external-DWQITF5_.cjs +0 -1
  264. package/dist/external-DqPrWKvU.js +0 -47
  265. package/dist/external-uXk0Avrg.cjs +0 -1
  266. package/dist/index-BywOGO8U.js +0 -1074
  267. package/dist/index-CYYjI7Uf.cjs +0 -1
  268. package/dist/index-C_6NXBlg.cjs +0 -3
  269. package/dist/index-Dd8DLyMx.cjs +0 -1
  270. package/dist/index-DizUWH6z.js +0 -47
  271. package/dist/index-QGplUHuy.js +0 -98
  272. package/dist/location-BGl5Ddds.cjs +0 -1
  273. package/dist/position-Cai5-wi1.cjs +0 -1
  274. package/dist/position-DIglP1l2.js +0 -85
  275. package/dist/scale-BtZINJ-A.cjs +0 -1
  276. package/dist/series-B9JERcqi.js +0 -1977
  277. package/dist/series-DqJ6f97G.cjs +0 -11
  278. package/dist/spatial-BSWPzMkK.js +0 -11
  279. package/dist/spatial-DGpZ2sO3.cjs +0 -1
  280. package/dist/src/color/transformColorsToHex.d.ts +0 -6
  281. package/dist/src/color/transformColorsToHex.d.ts.map +0 -1
  282. package/dist/src/primitive.d.ts +0 -9
  283. package/dist/src/primitive.d.ts.map +0 -1
  284. package/dist/src/toArray.d.ts +0 -3
  285. package/dist/src/toArray.d.ts.map +0 -1
  286. package/dist/src/zod/integer.d.ts +0 -10
  287. package/dist/src/zod/integer.d.ts.map +0 -1
  288. package/dist/src/zod/integer.spec.d.ts +0 -2
  289. package/dist/src/zod/integer.spec.d.ts.map +0 -1
  290. package/dist/toArray.cjs +0 -1
  291. package/dist/toArray.js +0 -5
  292. package/dist/xy-B7065J2S.cjs +0 -1
  293. package/src/color/transformColorsToHex.ts +0 -30
  294. package/src/primitive.ts +0 -46
  295. package/src/zod/integer.spec.ts +0 -148
  296. package/src/zod/integer.ts +0 -38
@@ -1 +0,0 @@
1
- "use strict";const m=require("./index-udOjA9d-.cjs"),l=e=>e!=null&&typeof e=="object"&&"toString"in e,T=e=>{if(l(e))return(e==null?void 0:e.toString().length)===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return!0}},g=(e,t=!1)=>{const o=l(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?h(r):r},A=(e,t,o)=>{const r=g(t[e],o);return(n,s)=>r(n[e],s[e])},E=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,b=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=g(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},q=(e,t)=>{const o=m.unique$1(e),r=m.unique$1(t);return b(o,r)},_=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,h=e=>(t,o)=>e(o,t),c=0,N=-1,f=1,p=e=>e<c,d=e=>e>c,y=e=>e>=c,S=e=>e===c,w=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];if(isNaN(Number(i))&&isNaN(Number(a))){const u=i.localeCompare(a);if(u!==0)return u}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const u=Number(i)-Number(a);if(u!==0)return u}else return isNaN(Number(i))?-1:1}return r.length-n.length},F=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:c,GREATER_THAN:f,LESS_THAN:N,isEqualTo:S,isGreaterThan:d,isGreaterThanEqual:y,isLessThan:p,newF:g,newFieldF:A,order:_,primitiveArrays:E,reverseF:h,stringsWithNumbers:w,uniqueUnorderedPrimitiveArrays:q,unorderedPrimitiveArrays:b},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=c;exports.GREATER_THAN=f;exports.LESS_THAN=N;exports.compare=F;exports.isEqualTo=S;exports.isGreaterThan=d;exports.isLessThan=p;exports.isStringer=l;exports.newF=g;exports.primitiveIsZero=T;
@@ -1,3 +0,0 @@
1
- "use strict";var H=Object.defineProperty;var N=(n,e,t)=>e in n?H(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var u=(n,e,t)=>N(n,typeof e!="symbol"?e+"":e,t);const S=require("./index-Dd8DLyMx.cjs"),A=require("./identity.cjs");function K(n){const e=n.length;let t=0,s=0;for(;s<e;){let i=n.charCodeAt(s++);if((i&4294967168)===0){t++;continue}else if((i&4294965248)===0)t+=2;else{if(i>=55296&&i<=56319&&s<e){const r=n.charCodeAt(s);(r&64512)===56320&&(++s,i=((i&1023)<<10)+(r&1023)+65536)}(i&4294901760)===0?t+=3:t+=4}}return t}function O(n,e,t){const s=n.length;let i=t,r=0;for(;r<s;){let o=n.charCodeAt(r++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&r<s){const h=n.charCodeAt(r);(h&64512)===56320&&(++r,o=((o&1023)<<10)+(h&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const V=new TextEncoder,W=50;function X(n,e,t){V.encodeInto(n,e.subarray(t))}function J(n,e,t){n.length>W?X(n,e,t):O(n,e,t)}const Y=4096;function z(n,e,t){let s=e;const i=s+t,r=[];let o="";for(;s<i;){const h=n[s++];if((h&128)===0)r.push(h);else if((h&224)===192){const a=n[s++]&63;r.push((h&31)<<6|a)}else if((h&240)===224){const a=n[s++]&63,l=n[s++]&63;r.push((h&31)<<12|a<<6|l)}else if((h&248)===240){const a=n[s++]&63,l=n[s++]&63,m=n[s++]&63;let d=(h&7)<<18|a<<12|l<<6|m;d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|d&1023),r.push(d)}else r.push(h);r.length>=Y&&(o+=String.fromCharCode(...r),r.length=0)}return r.length>0&&(o+=String.fromCharCode(...r)),o}const q=new TextDecoder,G=200;function Z(n,e,t){const s=n.subarray(e,e+t);return q.decode(s)}function Q(n,e,t){return t>G?Z(n,e,t):z(n,e,t)}class p{constructor(e,t){this.type=e,this.data=t}}class c extends Error{constructor(e){super(e);const t=Object.create(c.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:c.name})}}const x=4294967295;function j(n,e,t){const s=t/4294967296,i=t;n.setUint32(e,s),n.setUint32(e+4,i)}function v(n,e,t){const s=Math.floor(t/4294967296),i=t;n.setUint32(e,s),n.setUint32(e+4,i)}function M(n,e){const t=n.getInt32(e),s=n.getUint32(e+4);return t*4294967296+s}function ee(n,e){const t=n.getUint32(e),s=n.getUint32(e+4);return t*4294967296+s}const te=-1,ie=4294967296-1,se=17179869184-1;function ne({sec:n,nsec:e}){if(n>=0&&e>=0&&n<=se)if(e===0&&n<=ie){const t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,n),t}else{const t=n/4294967296,s=n&4294967295,i=new Uint8Array(8),r=new DataView(i.buffer);return r.setUint32(0,e<<2|t&3),r.setUint32(4,s),i}else{const t=new Uint8Array(12),s=new DataView(t.buffer);return s.setUint32(0,e),v(s,4,n),t}}function re(n){const e=n.getTime(),t=Math.floor(e/1e3),s=(e-t*1e3)*1e6,i=Math.floor(s/1e9);return{sec:t+i,nsec:s-i*1e9}}function oe(n){if(n instanceof Date){const e=re(n);return ne(e)}else return null}function he(n){const e=new DataView(n.buffer,n.byteOffset,n.byteLength);switch(n.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const t=e.getUint32(0),s=e.getUint32(4),i=(t&3)*4294967296+s,r=t>>>2;return{sec:i,nsec:r}}case 12:{const t=M(e,4),s=e.getUint32(0);return{sec:t,nsec:s}}default:throw new c(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${n.length}`)}}function ce(n){const e=he(n);return new Date(e.sec*1e3+e.nsec/1e6)}const ae={type:te,encode:oe,decode:ce};class U{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(ae)}register({type:e,encode:t,decode:s}){if(e>=0)this.encoders[e]=t,this.decoders[e]=s;else{const i=-1-e;this.builtInEncoders[i]=t,this.builtInDecoders[i]=s}}tryToEncode(e,t){for(let s=0;s<this.builtInEncoders.length;s++){const i=this.builtInEncoders[s];if(i!=null){const r=i(e,t);if(r!=null){const o=-1-s;return new p(o,r)}}}for(let s=0;s<this.encoders.length;s++){const i=this.encoders[s];if(i!=null){const r=i(e,t);if(r!=null){const o=s;return new p(o,r)}}}return e instanceof p?e:null}decode(e,t,s){const i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(e,t,s):new p(t,e)}}U.defaultCodec=new U;function de(n){return n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer}function B(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):de(n)?new Uint8Array(n):Uint8Array.from(n)}const fe=100,le=2048;class I{constructor(e){this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??U.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??fe,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??le,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new I({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw new Error(`Too deep objects in depth ${t}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){const t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(e){const t=new ArrayBuffer(e),s=new Uint8Array(t),i=new DataView(t);s.set(this.bytes),this.view=i,this.bytes=s}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const s=K(e);this.ensureBufferSizeToWrite(5+s),this.writeStringHeader(s),J(e,this.bytes,this.pos),this.pos+=s}encodeObject(e,t){const s=this.extensionCodec.tryToEncode(e,this.context);if(s!=null)this.encodeExtension(s);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,t);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(`Too large binary: ${t}`);const s=B(e);this.writeU8a(s)}encodeArray(e,t){const s=e.length;if(s<16)this.writeU8(144+s);else if(s<65536)this.writeU8(220),this.writeU16(s);else if(s<4294967296)this.writeU8(221),this.writeU32(s);else throw new Error(`Too large array: ${s}`);for(const i of e)this.doEncode(i,t+1)}countWithoutUndefined(e,t){let s=0;for(const i of t)e[i]!==void 0&&s++;return s}encodeMap(e,t){const s=Object.keys(e);this.sortKeys&&s.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,s):s.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const r of s){const o=e[r];this.ignoreUndefined&&o===void 0||(this.encodeString(r),this.doEncode(o,t+1))}}encodeExtension(e){if(typeof e.data=="function"){const s=e.data(this.pos+6),i=s.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(s);return}const t=e.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),j(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),v(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function g(n,e){return new I(e).encodeSharedRef(n)}function E(n){return`${n<0?"-":""}0x${Math.abs(n).toString(16).padStart(2,"0")}`}const ue=16,xe=16;class we{constructor(e=ue,t=xe){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let s=0;s<this.maxKeyLength;s++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,s){const i=this.caches[s-1];e:for(const r of i){const o=r.bytes;for(let h=0;h<s;h++)if(o[h]!==e[t+h])continue e;return r.str}return null}store(e,t){const s=this.caches[e.length-1],i={bytes:e,str:t};s.length>=this.maxLengthPerKey?s[Math.random()*s.length|0]=i:s.push(i)}decode(e,t,s){const i=this.find(e,t,s);if(i!=null)return this.hit++,i;this.miss++;const r=z(e,t,s),o=Uint8Array.prototype.slice.call(e,t,t+s);return this.store(o,r),r}}const T="array",y="map_key",_="map_value",ge=n=>{if(typeof n=="string"||typeof n=="number")return n;throw new c("The type of key must be string or number but "+typeof n)};class ye{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const t=this.getUninitializedStateFromPool();t.type=T,t.position=0,t.size=e,t.array=new Array(e)}pushMapState(e){const t=this.getUninitializedStateFromPool();t.type=y,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===T){const s=e;s.size=0,s.array=void 0,s.position=0,s.type=void 0}if(e.type===y||e.type===_){const s=e;s.size=0,s.map=void 0,s.readCount=0,s.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const w=-1,k=new DataView(new ArrayBuffer(0)),Ue=new Uint8Array(k.buffer);try{k.getInt8(0)}catch(n){if(!(n instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const D=new RangeError("Insufficient data"),pe=new we;class C{constructor(e){this.totalPos=0,this.pos=0,this.view=k,this.bytes=Ue,this.headByte=w,this.stack=new ye,this.entered=!1,this.extensionCodec=(e==null?void 0:e.extensionCodec)??U.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??x,this.maxBinLength=(e==null?void 0:e.maxBinLength)??x,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??x,this.maxMapLength=(e==null?void 0:e.maxMapLength)??x,this.maxExtLength=(e==null?void 0:e.maxExtLength)??x,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:pe,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??ge}clone(){return new C({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=w,this.stack.reset()}setBuffer(e){const t=B(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===w&&!this.hasRemaining(1))this.setBuffer(e);else{const t=this.bytes.subarray(this.pos),s=B(e),i=new Uint8Array(t.length+s.length);i.set(t),i.set(s,t.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:t,pos:s}=this;return new RangeError(`Extra ${t.byteLength-s} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let t=!1,s;for await(const h of e){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(h);try{s=this.doDecodeSync(),t=!0}catch(a){if(!(a instanceof RangeError))throw a}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return s}const{headByte:i,pos:r,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${E(i)} at ${o} (${r} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,t){if(this.entered){yield*this.clone().decodeMultiAsync(e,t);return}try{this.entered=!0;let s=t,i=-1;for await(const r of e){if(t&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(r),s&&(i=this.readArraySize(),s=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let t;if(e>=224)t=e-256;else if(e<192)if(e<128)t=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else{const i=e-160;t=this.decodeString(i,0)}else if(e===192)t=null;else if(e===194)t=!1;else if(e===195)t=!0;else if(e===202)t=this.readF32();else if(e===203)t=this.readF64();else if(e===204)t=this.readU8();else if(e===205)t=this.readU16();else if(e===206)t=this.readU32();else if(e===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(e===208)t=this.readI8();else if(e===209)t=this.readI16();else if(e===210)t=this.readI32();else if(e===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(e===217){const i=this.lookU8();t=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();t=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();t=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else t=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else t={}}else if(e===196){const i=this.lookU8();t=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();t=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();t=this.decodeBinary(i,4)}else if(e===212)t=this.decodeExtension(1,0);else if(e===213)t=this.decodeExtension(2,0);else if(e===214)t=this.decodeExtension(4,0);else if(e===215)t=this.decodeExtension(8,0);else if(e===216)t=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();t=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();t=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();t=this.decodeExtension(i,4)}else throw new c(`Unrecognized type byte: ${E(e)}`);this.complete();const s=this.stack;for(;s.length>0;){const i=s.top();if(i.type===T)if(i.array[i.position]=t,i.position++,i.position===i.size)t=i.array,s.release(i);else continue e;else if(i.type===y){if(t==="__proto__")throw new c("The key __proto__ is not allowed");i.key=this.mapKeyConverter(t),i.type=_;continue e}else if(i.map[i.key]=t,i.readCount++,i.readCount===i.size)t=i.map,s.release(i);else{i.key=null,i.type=y;continue e}}return t}}readHeadByte(){return this.headByte===w&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=w}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new c(`Unrecognized array type byte: ${E(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new c(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new c(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){var r;if(e>this.maxStrLength)throw new c(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw D;const s=this.pos+t;let i;return this.stateIsMapKey()&&((r=this.keyDecoder)!=null&&r.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,s,e):i=Q(this.bytes,s,e),this.pos+=t+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===y:!1}decodeBinary(e,t){if(e>this.maxBinLength)throw new c(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw D;const s=this.pos+t,i=this.bytes.subarray(s,s+e);return this.pos+=t+e,i}decodeExtension(e,t){if(e>this.maxExtLength)throw new c(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const s=this.view.getInt8(this.pos+t),i=this.decodeBinary(e,t+1);return this.extensionCodec.decode(i,s,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=ee(this.view,this.pos);return this.pos+=8,e}readI64(){const e=M(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function L(n,e){return new C(e).decode(n)}class F{constructor(){u(this,"contentType","application/json");u(this,"decoder");u(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const s=JSON.parse(e),i=S.snakeToCamel(s);return t!=null?t.parse(i):i}encodeString(e){const t=S.camelToSnake(e);return JSON.stringify(t,(s,i)=>ArrayBuffer.isView(i)?Array.from(i):A.isObject(i)&&"encode_value"in i?typeof i.value=="bigint"?i.value.toString():i.value:typeof i=="bigint"?i.toString():i)}static registerCustomType(){}}class P{constructor(){u(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const s=new TextDecoder().decode(e);return this.decodeString(s,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!A.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),s=[t.join(",")];return e.forEach(i=>{const r=t.map(o=>JSON.stringify(i[o]??""));s.push(r.join(","))}),s.join(`
2
- `)}decodeString(e,t){const[s,...i]=e.trim().split(`
3
- `).map(h=>h.trim());if(s.length===0)return t!=null?t.parse({}):{};const r=s.split(",").map(h=>h.trim()),o={};return r.forEach(h=>{o[h]=[]}),i.forEach(h=>{const a=h.split(",").map(l=>l.trim());r.forEach((l,m)=>{const d=this.parseValue(a[m]);d!=null&&o[l].push(d)})}),t!=null?t.parse(o):o}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}}class b{constructor(){u(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e)}decode(e,t){const s=new TextDecoder().decode(e);return t!=null?t.parse(s):s}}const f=new U;f.register({type:0,encode:n=>{if(ArrayBuffer.isView(n)){const e=Array.from(n);return g(e,{extensionCodec:f})}return A.isObject(n)&&"encode_value"in n?typeof n.value=="bigint"?g(n.value.toString(),{extensionCodec:f}):g(n.value,{extensionCodec:f}):typeof n=="bigint"?g(n.toString(),{extensionCodec:f}):null},decode:n=>L(n,{extensionCodec:f})});class R{constructor(){u(this,"contentType","application/msgpack")}encode(e){const t=S.camelToSnake(e);return g(t,{extensionCodec:f}).slice()}decode(e,t){const s=L(e,{extensionCodec:f}),i=S.snakeToCamel(s);return t!=null?t.parse(i):i}static registerCustomType(){}}const $=new F,Se=new P,me=new b,Ee=new R,Be=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:P,CSV_CODEC:Se,JSONCodec:F,JSON_CODEC:$,MSGPACK_CODEC:Ee,MsgPackCodec:R,TEXT_CODEC:me,TextCodec:b},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=$;exports.codec=Be;
@@ -1 +0,0 @@
1
- "use strict";const T=e=>{const r=e.replace(/_[a-z]/g,n=>n[1].toUpperCase());return r.length>1&&r[0]===r[0].toUpperCase()&&r[1]===r[1].toUpperCase()||r.length===0?r:r[0].toLowerCase()+r.slice(1)},u=e=>{const r=(n,s=o)=>{if(typeof n=="string")return e(n);if(Array.isArray(n))return n.map(c=>r(c,s));if(!l(n))return n;s=v(s);const y={},f=n;return Object.keys(f).forEach(c=>{let t=f[c];const C=e(c);s.recursive&&(l(t)?m(t,s.keepTypesOnRecursion)||(t=r(t,s)):s.recursiveInArray&&p(t)&&(t=[...t].map(a=>{let i=a;return l(a)?m(i,s.keepTypesOnRecursion)||(i=r(a,s)):p(a)&&(i=r({key:a},s).key),i}))),y[C]=t}),y};return r},A=u(T),O=e=>e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n}_${s.toLowerCase()}`),g=u(O),k=e=>e.length===0?e:e[0].toUpperCase()+e.slice(1),o={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},v=(e=o)=>(e.recursive==null?e=o:e.recursiveInArray??(e.recursiveInArray=!1),e),p=e=>e!=null&&Array.isArray(e),l=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),m=(e,r)=>(r||[]).some(n=>e instanceof n),S=e=>e.replace(/\s+/g,"-").replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n}-${s.toLowerCase()}`).toLowerCase(),_=u(S),z=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:g,capitalize:k,snakeToCamel:A,toKebab:_},Symbol.toStringTag,{value:"Module"}));exports.camelToSnake=g;exports.capitalize=k;exports.caseconv=z;exports.snakeToCamel=A;
@@ -1,47 +0,0 @@
1
- const m = (e) => {
2
- const r = e.replace(/_[a-z]/g, (n) => n[1].toUpperCase());
3
- return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() || r.length === 0 ? r : r[0].toLowerCase() + r.slice(1);
4
- }, u = (e) => {
5
- const r = (n, s = o) => {
6
- if (typeof n == "string") return e(n);
7
- if (Array.isArray(n)) return n.map((c) => r(c, s));
8
- if (!l(n)) return n;
9
- s = v(s);
10
- const y = {}, f = n;
11
- return Object.keys(f).forEach((c) => {
12
- let t = f[c];
13
- const g = e(c);
14
- s.recursive && (l(t) ? A(t, s.keepTypesOnRecursion) || (t = r(t, s)) : s.recursiveInArray && p(t) && (t = [...t].map((a) => {
15
- let i = a;
16
- return l(a) ? A(i, s.keepTypesOnRecursion) || (i = r(a, s)) : p(a) && (i = r({ key: a }, s).key), i;
17
- }))), y[g] = t;
18
- }), y;
19
- };
20
- return r;
21
- }, C = u(m), O = (e) => (
22
- // Don't convert the first character and don't convert a character that is after a
23
- // non-alphanumeric character
24
- e.replace(
25
- /([a-z0-9])([A-Z])/g,
26
- (r, n, s) => `${n}_${s.toLowerCase()}`
27
- )
28
- ), k = u(O), T = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), o = {
29
- recursive: !0,
30
- recursiveInArray: !0,
31
- keepTypesOnRecursion: [Number, String, Uint8Array]
32
- }, v = (e = o) => (e.recursive == null ? e = o : e.recursiveInArray ?? (e.recursiveInArray = !1), e), p = (e) => e != null && Array.isArray(e), l = (e) => e != null && typeof e == "object" && !Array.isArray(e), A = (e, r) => (r || []).some((n) => e instanceof n), S = (e) => e.replace(/\s+/g, "-").replace(
33
- /([a-z0-9])([A-Z])/g,
34
- (r, n, s) => `${n}-${s.toLowerCase()}`
35
- ).toLowerCase(), _ = u(S), d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36
- __proto__: null,
37
- camelToSnake: k,
38
- capitalize: T,
39
- snakeToCamel: C,
40
- toKebab: _
41
- }, Symbol.toStringTag, { value: "Module" }));
42
- export {
43
- d as a,
44
- k as b,
45
- T as c,
46
- C as s
47
- };
@@ -1,98 +0,0 @@
1
- import { a as l } from "./index-D4NCYiQB.js";
2
- const m = (e) => e != null && typeof e == "object" && "toString" in e, w = (e) => {
3
- if (m(e)) return (e == null ? void 0 : e.toString().length) === 0;
4
- switch (typeof e) {
5
- case "string":
6
- return e.length === 0;
7
- case "number":
8
- return e === 0;
9
- case "bigint":
10
- return e === 0n;
11
- case "boolean":
12
- return !e;
13
- case "undefined":
14
- return !0;
15
- case "object":
16
- return !0;
17
- }
18
- }, g = (e, t = !1) => {
19
- const o = m(e) ? "stringer" : typeof e;
20
- let r;
21
- switch (o) {
22
- case "string":
23
- r = (n, s) => n.localeCompare(s);
24
- break;
25
- case "stringer":
26
- r = (n, s) => n.toString().localeCompare(s.toString());
27
- break;
28
- case "number":
29
- r = (n, s) => Number(n) - Number(s);
30
- break;
31
- case "bigint":
32
- r = (n, s) => BigInt(n) - BigInt(s) > 0n ? 1 : -1;
33
- break;
34
- case "boolean":
35
- r = (n, s) => Number(n) - Number(s);
36
- break;
37
- case "undefined":
38
- r = () => 0;
39
- break;
40
- default:
41
- return console.warn(`sortFunc: unknown type ${o}`), () => -1;
42
- }
43
- return t ? f(r) : r;
44
- }, h = (e, t, o) => {
45
- const r = g(t[e], o);
46
- return (n, s) => r(n[e], s[e]);
47
- }, N = (e, t) => e.length !== t.length ? e.length - t.length : e.every((o, r) => o === t[r]) ? 0 : -1, b = (e, t) => {
48
- if (e.length !== t.length) return e.length - t.length;
49
- if (e.length === 0) return 0;
50
- const o = g(e[0]), r = [...e].sort(o), n = [...t].sort(o);
51
- return r.every((s, i) => s === n[i]) ? 0 : -1;
52
- }, p = (e, t) => {
53
- const o = l(e), r = l(t);
54
- return b(o, r);
55
- }, d = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, f = (e) => (t, o) => e(o, t), a = 0, S = -1, y = 1, A = (e) => e < a, T = (e) => e > a, _ = (e) => e >= a, E = (e) => e === a, P = (e, t) => {
56
- const o = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(o), n = t.replace(/[\s_.-]+/g, "").match(o);
57
- if (!r || !n) return 0;
58
- for (let s = 0; s < Math.min(r.length, n.length); s++) {
59
- const i = r[s], u = n[s];
60
- if (isNaN(Number(i)) && isNaN(Number(u))) {
61
- const c = i.localeCompare(u);
62
- if (c !== 0) return c;
63
- } else if (!isNaN(Number(i)) && !isNaN(Number(u))) {
64
- const c = Number(i) - Number(u);
65
- if (c !== 0) return c;
66
- } else return isNaN(Number(i)) ? -1 : 1;
67
- }
68
- return r.length - n.length;
69
- }, F = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
70
- __proto__: null,
71
- EQUAL: a,
72
- GREATER_THAN: y,
73
- LESS_THAN: S,
74
- isEqualTo: E,
75
- isGreaterThan: T,
76
- isGreaterThanEqual: _,
77
- isLessThan: A,
78
- newF: g,
79
- newFieldF: h,
80
- order: d,
81
- primitiveArrays: N,
82
- reverseF: f,
83
- stringsWithNumbers: P,
84
- uniqueUnorderedPrimitiveArrays: p,
85
- unorderedPrimitiveArrays: b
86
- }, Symbol.toStringTag, { value: "Module" }));
87
- export {
88
- a as E,
89
- y as G,
90
- S as L,
91
- T as a,
92
- A as b,
93
- F as c,
94
- m as d,
95
- E as i,
96
- g as n,
97
- w as p
98
- };
@@ -1 +0,0 @@
1
- "use strict";const L=require("zod"),S=require("./index-Dd8DLyMx.cjs"),o=require("./base-BAM2mqCy.cjs"),z=o.xLocation,g=o.yLocation,h=o.centerLocation,d={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},m={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",b=t=>d[s(t)],M=t=>m[s(t)],i=t=>{const n=s(t);return n==="top"||n==="bottom"?"y":"x"},C=L.z.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),N=L.z.object({x:o.xLocation,y:o.yLocation}),y=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),E=Object.freeze({x:"right",y:"bottom"}),O=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),a=Object.freeze({x:"center",y:"bottom"}),u=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),p=Object.freeze([l,u,_,a,y,f,x,E,O]),R=(t,n)=>t.x===n.x&&t.y===n.y,j=(t,n)=>{if(typeof n=="object"){let e=!0;return"x"in n&&(t.x===n.x||(e=!1)),"y"in n&&(t.y===n.y||(e=!1)),e}return t.x===n||t.y===n},I=t=>[t.x,t.y],T=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${S.capitalize(t.y)}`,Y=(t,n)=>{let e,c;if(typeof t=="object"&&"x"in t?(e=t.x,c=t.y):(e=s(t),c=s(n??t)),i(e)===i(c)&&e!=="center"&&c!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${c.toString()}`);const r={...O};return e==="center"?T(c)?[r.x,r.y]=[c,e]:[r.x,r.y]=[e,c]:c==="center"?T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e]:T(e)?[r.x,r.y]=[e,c]:[r.x,r.y]=[c,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:a,BOTTOM_LEFT:x,BOTTOM_RIGHT:E,CENTER:O,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:u,TOP_CENTER:_,TOP_LEFT:y,TOP_RIGHT:f,XY_LOCATIONS:p,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:h,construct:s,constructXY:Y,corner:N,crude:A,direction:i,isX:T,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:b,x:z,xy:C,xyCouple:I,xyEquals:R,xyMatches:j,xyToString:X,y:g},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=a;exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=E;exports.CENTER=O;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=u;exports.TOP_CENTER=_;exports.TOP_LEFT=y;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=p;exports.corner=N;exports.location=w;exports.swap=b;exports.xy=C;exports.xyCouple=I;exports.xyEquals=R;exports.xyMatches=j;
@@ -1 +0,0 @@
1
- "use strict";const n=require("./box-0YrQibkB.cjs"),T=require("./direction-C-b6XTeU.cjs"),r=require("./location-BGl5Ddds.cjs"),b=require("./base-BAM2mqCy.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
@@ -1,85 +0,0 @@
1
- import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-Cc8IzcNo.js";
2
- import { c as w } from "./direction-BL0PhD1k.js";
3
- import { x as B, X as C, a as h, b as R, C as O, s as m, T as S } from "./location-C3aeu046.js";
4
- import { l as Y } from "./base-DFq0vvGn.js";
5
- const P = (t) => {
6
- if (t == null) return { x: void 0, y: void 0 };
7
- const s = B.safeParse(t);
8
- if (s.success) return s.data;
9
- const o = Y.safeParse(t);
10
- return o.success ? w(o.data) === "x" ? { x: o.data, y: void 0 } : { x: void 0, y: o.data } : t;
11
- }, D = ({
12
- container: t,
13
- target: s,
14
- dialog: o,
15
- initial: c,
16
- prefer: a,
17
- alignments: d = ["start"],
18
- disable: f = []
19
- }) => {
20
- const n = P(c);
21
- let u = C;
22
- if (a != null) {
23
- const e = a.map((r) => P(r));
24
- u = u.slice().sort((r, x) => {
25
- const i = e.findIndex((y) => h(r, y)), p = e.findIndex((y) => h(x, y));
26
- return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
27
- });
28
- }
29
- const T = u.filter(
30
- (e) => !R(e, O) && (n.x == null || e.x === n.x) && (n.y == null || e.y === n.y) && !f.some((r) => h(e, r))
31
- ).map((e) => d == null ? void 0 : d.map((r) => [e, r])).flat(), E = g(t), b = g(s), _ = g(o);
32
- let L = -1 / 0;
33
- const l = { location: O, adjustedDialog: _ };
34
- return T.forEach(([e, r]) => {
35
- const [x, i] = G({
36
- option: e,
37
- alignment: r,
38
- container: E,
39
- target: b,
40
- dialog: _
41
- });
42
- i > L && (L = i, l.location = e, l.adjustedDialog = x);
43
- }), l;
44
- }, G = ({
45
- option: t,
46
- alignment: s,
47
- container: o,
48
- target: c,
49
- dialog: a
50
- }) => {
51
- const d = A(t, s), f = v(c, t), n = I(
52
- f.x,
53
- f.y,
54
- N(a),
55
- M(a),
56
- d,
57
- S
58
- ), u = X(j(n, o));
59
- return [n, u];
60
- }, $ = {
61
- start: "left",
62
- center: "center",
63
- end: "right"
64
- }, q = {
65
- start: "bottom",
66
- center: "center",
67
- end: "top"
68
- }, A = (t, s) => {
69
- const o = { x: "center", y: "center" };
70
- if (t.y !== "center") {
71
- o.y = m(t.y);
72
- const c = t.x === "left" ? m : (a) => a;
73
- o.x = c($[s]);
74
- } else
75
- o.x = m(t.x), o.y = q[s];
76
- return o;
77
- }, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
78
- __proto__: null,
79
- dialog: D,
80
- getRoot: A,
81
- parseLocationOptions: P
82
- }, Symbol.toStringTag, { value: "Module" }));
83
- export {
84
- H as p
85
- };
@@ -1 +0,0 @@
1
- "use strict";var v=Object.defineProperty;var R=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>R(n,typeof t!="symbol"?t+"":t,e);const h=require("zod"),x=require("./bounds-BQo7rvs9.cjs"),u=require("./box-0YrQibkB.cjs"),T=require("./location-BGl5Ddds.cjs"),d=require("./xy-B7065J2S.cjs"),B=(n,t,e)=>t!==void 0&&n<t?t:e!==void 0&&n>e?e:n,q=h.z.object({offset:d.crudeZ,scale:d.crudeZ}),z=h.z.object({offset:h.z.number(),scale:h.z.number()}),E=n=>(t,e,s,r)=>e==="dimension"?[t,s]:[t,r?s-n:s+n],I=n=>(t,e,s,r)=>[t,r?s/n:s*n],j=n=>(t,e,s)=>{if(t===null)return[n,s];const{lower:r,upper:o}=t,{lower:p,upper:l}=n,w=o-r,m=l-p;if(e==="dimension")return[n,s*(m/w)];const g=(s-r)*(m/w)+p;return[n,g]},Y=n=>(t,e,s)=>[n,s],D=()=>(n,t,e)=>{if(n===null)throw new Error("cannot invert without bounds");if(t==="dimension")return[n,e];const{lower:s,upper:r}=n;return[n,r-(e-s)]},L=n=>(t,e,s)=>{const{lower:r,upper:o}=n;return s=B(s,r,o),[t,s]},a=class a{constructor(){i(this,"ops",[]);i(this,"currBounds",null);i(this,"currType",null);i(this,"reversed",!1);this.ops=[]}static translate(t){return new a().translate(t)}static magnify(t){return new a().magnify(t)}static scale(t,e){return new a().scale(t,e)}translate(t){const e=this.new(),s=E(t);return s.type="translate",e.ops.push(s),e}magnify(t){const e=this.new(),s=I(t);return s.type="magnify",e.ops.push(s),e}scale(t,e){const s=x.construct(t,e),r=this.new(),o=j(s);return o.type="scale",r.ops.push(o),r}clamp(t,e){const s=x.construct(t,e),r=this.new(),o=L(s);return o.type="clamp",r.ops.push(o),r}reBound(t,e){const s=x.construct(t,e),r=this.new(),o=Y(s);return o.type="re-bound",r.ops.push(o),r}invert(){const t=D();t.type="invert";const e=this.new();return e.ops.push(t),e}pos(t){return this.exec("position",t)}dim(t){return this.exec("dimension",t)}new(){const t=new a;return t.ops=this.ops.slice(),t.reversed=this.reversed,t}exec(t,e){return this.currBounds=null,this.ops.reduce(([s,r],o)=>o(s,t,r,this.reversed),[null,e])[1]}reverse(){const t=this.new();t.ops.reverse();const e=[];return t.ops.forEach((s,r)=>{if(s.type==="scale"||e.some(([p,l])=>r>=p&&r<=l))return;const o=t.ops.findIndex((p,l)=>p.type==="scale"&&l>r);o!==-1&&e.push([r,o])}),e.forEach(([s,r])=>{const o=t.ops.slice(s,r);o.unshift(t.ops[r]),t.ops.splice(s,r-s+1,...o)}),t.reversed=!t.reversed,t}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};i(a,"IDENTITY",new a);let y=a;const c=class c{constructor(t=new y,e=new y,s=null){i(this,"x");i(this,"y");i(this,"currRoot");this.x=t,this.y=e,this.currRoot=s}static translate(t,e){return new c().translate(t,e)}static translateX(t){return new c().translateX(t)}static translateY(t){return new c().translateY(t)}static clamp(t){return new c().clamp(t)}static magnify(t){return new c().magnify(t)}static scale(t){return new c().scale(t)}static reBound(t){return new c().reBound(t)}translate(t,e){const s=d.construct(t,e),r=this.copy();return r.x=this.x.translate(s.x),r.y=this.y.translate(s.y),r}translateX(t){const e=this.copy();return e.x=this.x.translate(t),e}translateY(t){const e=this.copy();return e.y=this.y.translate(t),e}magnify(t){const e=this.copy();return e.x=this.x.magnify(t.x),e.y=this.y.magnify(t.y),e}scale(t){const e=this.copy();if(u.isBox(t)){const s=this.currRoot;return e.currRoot=t.root,s!=null&&!T.xyEquals(s,t.root)&&(s.x!==t.root.x&&(e.x=e.x.invert()),s.y!==t.root.y&&(e.y=e.y.invert())),e.x=e.x.scale(u.xBounds(t)),e.y=e.y.scale(u.yBounds(t)),e}return e.x=e.x.scale(t.width),e.y=e.y.scale(t.height),e}reBound(t){const e=this.copy();return e.x=this.x.reBound(u.xBounds(t)),e.y=this.y.reBound(u.yBounds(t)),e}clamp(t){const e=this.copy();return e.x=this.x.clamp(u.xBounds(t)),e.y=this.y.clamp(u.yBounds(t)),e}copy(){const t=new c;return t.currRoot=this.currRoot,t.x=this.x,t.y=this.y,t}reverse(){const t=this.copy();return t.x=this.x.reverse(),t.y=this.y.reverse(),t}pos(t){return{x:this.x.pos(t.x),y:this.y.pos(t.y)}}dim(t){return{x:this.x.dim(t.x),y:this.y.dim(t.y)}}box(t){return u.construct(this.pos(t.one),this.pos(t.two),0,0,this.currRoot??t.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};i(c,"IDENTITY",new c);let f=c;const M=Object.freeze(Object.defineProperty({__proto__:null,Scale:y,XY:f,crudeXYTransform:q,transform:z},Symbol.toStringTag,{value:"Module"}));exports.clamp=B;exports.scale=M;