@veritone-ce/design-system 2.8.13-next.1 → 2.8.13

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 (694) hide show
  1. package/dist/cjs/Dialog/components.js +90 -29
  2. package/dist/cjs/Dialog/state.js +8 -2
  3. package/dist/cjs/Dialog/styles.module.scss.js +2 -2
  4. package/dist/cjs/FileUploader/controlled.js +0 -7
  5. package/dist/cjs/Menu/controlled.js +77 -2
  6. package/dist/cjs/Select/controlled.js +3 -0
  7. package/dist/cjs/Table/AutoTable/controlled.js +1 -2
  8. package/dist/cjs/Table/AutoTable/styles.module.scss.js +1 -1
  9. package/dist/cjs/TablePagination/index.js +8 -21
  10. package/dist/cjs/index.js +0 -11
  11. package/dist/cjs/styles/createPalette.js +0 -11
  12. package/dist/cjs/styles.css +1 -1
  13. package/dist/cjs/unstable/Card/index.js +33 -0
  14. package/dist/cjs/unstable/Card/styles.module.scss.js +1 -1
  15. package/dist/cjs/unstable/index.js +13 -39
  16. package/dist/esm/Dialog/components.js +89 -28
  17. package/dist/esm/Dialog/state.js +8 -2
  18. package/dist/esm/Dialog/styles.module.scss.js +2 -2
  19. package/dist/esm/FileUploader/controlled.js +0 -7
  20. package/dist/esm/Menu/controlled.js +77 -2
  21. package/dist/esm/Select/controlled.js +3 -0
  22. package/dist/esm/Table/AutoTable/controlled.js +1 -2
  23. package/dist/esm/Table/AutoTable/styles.module.scss.js +1 -1
  24. package/dist/esm/TablePagination/index.js +8 -21
  25. package/dist/esm/index.js +1 -1
  26. package/dist/esm/styles/createPalette.js +1 -1
  27. package/dist/esm/styles.css +1 -1
  28. package/dist/esm/unstable/Card/index.js +29 -0
  29. package/dist/esm/unstable/Card/styles.module.scss.js +1 -1
  30. package/dist/esm/unstable/index.js +1 -5
  31. package/dist/types/Dialog/components.d.ts +20 -27
  32. package/dist/types/Dialog/factory.d.ts +5 -4
  33. package/dist/types/Dialog/state.d.ts +15 -1
  34. package/dist/types/Menu/controlled.d.ts +9 -1
  35. package/dist/types/Select/types.d.ts +8 -0
  36. package/dist/types/TablePagination/index.d.ts +1 -1
  37. package/dist/types/styles/createPalette.d.ts +2 -13
  38. package/dist/types/unstable/Card/index.d.ts +11 -2
  39. package/dist/types/unstable/extras/chart/index.d.ts +33 -15
  40. package/dist/types/unstable/index.d.ts +0 -3
  41. package/package.json +7 -1
  42. package/dist/cjs/bundled_modules/d3-array/src/ascending.js +0 -9
  43. package/dist/cjs/bundled_modules/d3-array/src/bisect.js +0 -16
  44. package/dist/cjs/bundled_modules/d3-array/src/bisector.js +0 -62
  45. package/dist/cjs/bundled_modules/d3-array/src/descending.js +0 -13
  46. package/dist/cjs/bundled_modules/d3-array/src/deviation.js +0 -12
  47. package/dist/cjs/bundled_modules/d3-array/src/fsum.js +0 -45
  48. package/dist/cjs/bundled_modules/d3-array/src/intersection.js +0 -25
  49. package/dist/cjs/bundled_modules/d3-array/src/max.js +0 -26
  50. package/dist/cjs/bundled_modules/d3-array/src/mean.js +0 -25
  51. package/dist/cjs/bundled_modules/d3-array/src/median.js +0 -11
  52. package/dist/cjs/bundled_modules/d3-array/src/merge.js +0 -15
  53. package/dist/cjs/bundled_modules/d3-array/src/min.js +0 -26
  54. package/dist/cjs/bundled_modules/d3-array/src/number.js +0 -27
  55. package/dist/cjs/bundled_modules/d3-array/src/permute.js +0 -9
  56. package/dist/cjs/bundled_modules/d3-array/src/quantile.js +0 -36
  57. package/dist/cjs/bundled_modules/d3-array/src/quickselect.js +0 -59
  58. package/dist/cjs/bundled_modules/d3-array/src/range.js +0 -19
  59. package/dist/cjs/bundled_modules/d3-array/src/sort.js +0 -20
  60. package/dist/cjs/bundled_modules/d3-array/src/sum.js +0 -17
  61. package/dist/cjs/bundled_modules/d3-array/src/ticks.js +0 -63
  62. package/dist/cjs/bundled_modules/d3-array/src/union.js +0 -17
  63. package/dist/cjs/bundled_modules/d3-array/src/variance.js +0 -31
  64. package/dist/cjs/bundled_modules/d3-color/src/color.js +0 -410
  65. package/dist/cjs/bundled_modules/d3-color/src/cubehelix.js +0 -68
  66. package/dist/cjs/bundled_modules/d3-color/src/define.js +0 -17
  67. package/dist/cjs/bundled_modules/d3-color/src/lab.js +0 -124
  68. package/dist/cjs/bundled_modules/d3-color/src/math.js +0 -7
  69. package/dist/cjs/bundled_modules/d3-delaunay/src/delaunay.js +0 -254
  70. package/dist/cjs/bundled_modules/d3-delaunay/src/path.js +0 -43
  71. package/dist/cjs/bundled_modules/d3-delaunay/src/polygon.js +0 -23
  72. package/dist/cjs/bundled_modules/d3-delaunay/src/voronoi.js +0 -338
  73. package/dist/cjs/bundled_modules/d3-dispatch/src/dispatch.js +0 -88
  74. package/dist/cjs/bundled_modules/d3-dsv/src/dsv.js +0 -170
  75. package/dist/cjs/bundled_modules/d3-force/src/center.js +0 -46
  76. package/dist/cjs/bundled_modules/d3-force/src/collide.js +0 -106
  77. package/dist/cjs/bundled_modules/d3-force/src/constant.js +0 -11
  78. package/dist/cjs/bundled_modules/d3-force/src/jiggle.js +0 -9
  79. package/dist/cjs/bundled_modules/d3-force/src/lcg.js +0 -15
  80. package/dist/cjs/bundled_modules/d3-force/src/link.js +0 -123
  81. package/dist/cjs/bundled_modules/d3-force/src/manyBody.js +0 -122
  82. package/dist/cjs/bundled_modules/d3-force/src/simulation.js +0 -164
  83. package/dist/cjs/bundled_modules/d3-force/src/x.js +0 -47
  84. package/dist/cjs/bundled_modules/d3-force/src/y.js +0 -47
  85. package/dist/cjs/bundled_modules/d3-format/src/defaultLocale.js +0 -24
  86. package/dist/cjs/bundled_modules/d3-format/src/exponent.js +0 -11
  87. package/dist/cjs/bundled_modules/d3-format/src/formatDecimal.js +0 -27
  88. package/dist/cjs/bundled_modules/d3-format/src/formatGroup.js +0 -24
  89. package/dist/cjs/bundled_modules/d3-format/src/formatNumerals.js +0 -13
  90. package/dist/cjs/bundled_modules/d3-format/src/formatPrefixAuto.js +0 -22
  91. package/dist/cjs/bundled_modules/d3-format/src/formatRounded.js +0 -17
  92. package/dist/cjs/bundled_modules/d3-format/src/formatSpecifier.js +0 -54
  93. package/dist/cjs/bundled_modules/d3-format/src/formatTrim.js +0 -17
  94. package/dist/cjs/bundled_modules/d3-format/src/formatTypes.js +0 -25
  95. package/dist/cjs/bundled_modules/d3-format/src/identity.js +0 -9
  96. package/dist/cjs/bundled_modules/d3-format/src/locale.js +0 -154
  97. package/dist/cjs/bundled_modules/d3-format/src/precisionFixed.js +0 -11
  98. package/dist/cjs/bundled_modules/d3-format/src/precisionPrefix.js +0 -11
  99. package/dist/cjs/bundled_modules/d3-format/src/precisionRound.js +0 -12
  100. package/dist/cjs/bundled_modules/d3-geo/src/area.js +0 -83
  101. package/dist/cjs/bundled_modules/d3-geo/src/bounds.js +0 -185
  102. package/dist/cjs/bundled_modules/d3-geo/src/cartesian.js +0 -43
  103. package/dist/cjs/bundled_modules/d3-geo/src/centroid.js +0 -149
  104. package/dist/cjs/bundled_modules/d3-geo/src/circle.js +0 -35
  105. package/dist/cjs/bundled_modules/d3-geo/src/clip/antimeridian.js +0 -98
  106. package/dist/cjs/bundled_modules/d3-geo/src/clip/buffer.js +0 -30
  107. package/dist/cjs/bundled_modules/d3-geo/src/clip/circle.js +0 -183
  108. package/dist/cjs/bundled_modules/d3-geo/src/clip/index.js +0 -137
  109. package/dist/cjs/bundled_modules/d3-geo/src/clip/line.js +0 -65
  110. package/dist/cjs/bundled_modules/d3-geo/src/clip/rectangle.js +0 -174
  111. package/dist/cjs/bundled_modules/d3-geo/src/clip/rejoin.js +0 -109
  112. package/dist/cjs/bundled_modules/d3-geo/src/compose.js +0 -18
  113. package/dist/cjs/bundled_modules/d3-geo/src/graticule.js +0 -107
  114. package/dist/cjs/bundled_modules/d3-geo/src/identity.js +0 -7
  115. package/dist/cjs/bundled_modules/d3-geo/src/math.js +0 -57
  116. package/dist/cjs/bundled_modules/d3-geo/src/noop.js +0 -7
  117. package/dist/cjs/bundled_modules/d3-geo/src/path/area.js +0 -54
  118. package/dist/cjs/bundled_modules/d3-geo/src/path/bounds.js +0 -32
  119. package/dist/cjs/bundled_modules/d3-geo/src/path/centroid.js +0 -104
  120. package/dist/cjs/bundled_modules/d3-geo/src/path/context.js +0 -51
  121. package/dist/cjs/bundled_modules/d3-geo/src/path/index.js +0 -82
  122. package/dist/cjs/bundled_modules/d3-geo/src/path/measure.js +0 -49
  123. package/dist/cjs/bundled_modules/d3-geo/src/path/string.js +0 -92
  124. package/dist/cjs/bundled_modules/d3-geo/src/pointEqual.js +0 -11
  125. package/dist/cjs/bundled_modules/d3-geo/src/polygonContains.js +0 -80
  126. package/dist/cjs/bundled_modules/d3-geo/src/projection/albers.js +0 -16
  127. package/dist/cjs/bundled_modules/d3-geo/src/projection/albersUsa.js +0 -117
  128. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthal.js +0 -32
  129. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthalEqualArea.js +0 -24
  130. package/dist/cjs/bundled_modules/d3-geo/src/projection/azimuthalEquidistant.js +0 -24
  131. package/dist/cjs/bundled_modules/d3-geo/src/projection/conic.js +0 -19
  132. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicConformal.js +0 -45
  133. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicEqualArea.js +0 -40
  134. package/dist/cjs/bundled_modules/d3-geo/src/projection/conicEquidistant.js +0 -39
  135. package/dist/cjs/bundled_modules/d3-geo/src/projection/cylindricalEqualArea.js +0 -19
  136. package/dist/cjs/bundled_modules/d3-geo/src/projection/equalEarth.js +0 -43
  137. package/dist/cjs/bundled_modules/d3-geo/src/projection/equirectangular.js +0 -19
  138. package/dist/cjs/bundled_modules/d3-geo/src/projection/fit.js +0 -54
  139. package/dist/cjs/bundled_modules/d3-geo/src/projection/gnomonic.js +0 -23
  140. package/dist/cjs/bundled_modules/d3-geo/src/projection/identity.js +0 -91
  141. package/dist/cjs/bundled_modules/d3-geo/src/projection/index.js +0 -184
  142. package/dist/cjs/bundled_modules/d3-geo/src/projection/mercator.js +0 -60
  143. package/dist/cjs/bundled_modules/d3-geo/src/projection/naturalEarth1.js +0 -35
  144. package/dist/cjs/bundled_modules/d3-geo/src/projection/orthographic.js +0 -22
  145. package/dist/cjs/bundled_modules/d3-geo/src/projection/resample.js +0 -108
  146. package/dist/cjs/bundled_modules/d3-geo/src/projection/stereographic.js +0 -25
  147. package/dist/cjs/bundled_modules/d3-geo/src/projection/transverseMercator.js +0 -34
  148. package/dist/cjs/bundled_modules/d3-geo/src/rotation.js +0 -86
  149. package/dist/cjs/bundled_modules/d3-geo/src/stream.js +0 -75
  150. package/dist/cjs/bundled_modules/d3-geo/src/transform.js +0 -24
  151. package/dist/cjs/bundled_modules/d3-geo-projection/src/math.js +0 -28
  152. package/dist/cjs/bundled_modules/d3-geo-projection/src/mollweide.js +0 -38
  153. package/dist/cjs/bundled_modules/d3-hierarchy/src/accessors.js +0 -13
  154. package/dist/cjs/bundled_modules/d3-hierarchy/src/array.js +0 -27
  155. package/dist/cjs/bundled_modules/d3-hierarchy/src/cluster.js +0 -90
  156. package/dist/cjs/bundled_modules/d3-hierarchy/src/constant.js +0 -16
  157. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/ancestors.js +0 -13
  158. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/count.js +0 -18
  159. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/descendants.js +0 -9
  160. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/each.js +0 -13
  161. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/eachAfter.js +0 -21
  162. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/eachBefore.js +0 -18
  163. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/find.js +0 -14
  164. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/index.js +0 -99
  165. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/iterator.js +0 -20
  166. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/leaves.js +0 -15
  167. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/links.js +0 -15
  168. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/path.js +0 -36
  169. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/sort.js +0 -13
  170. package/dist/cjs/bundled_modules/d3-hierarchy/src/hierarchy/sum.js +0 -15
  171. package/dist/cjs/bundled_modules/d3-hierarchy/src/lcg.js +0 -15
  172. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/enclose.js +0 -122
  173. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/index.js +0 -87
  174. package/dist/cjs/bundled_modules/d3-hierarchy/src/pack/siblings.js +0 -118
  175. package/dist/cjs/bundled_modules/d3-hierarchy/src/partition.js +0 -58
  176. package/dist/cjs/bundled_modules/d3-hierarchy/src/stratify.js +0 -151
  177. package/dist/cjs/bundled_modules/d3-hierarchy/src/tree.js +0 -243
  178. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/binary.js +0 -52
  179. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/dice.js +0 -18
  180. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/index.js +0 -100
  181. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/resquarify.js +0 -42
  182. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/round.js +0 -12
  183. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/slice.js +0 -18
  184. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/sliceDice.js +0 -12
  185. package/dist/cjs/bundled_modules/d3-hierarchy/src/treemap/squarify.js +0 -74
  186. package/dist/cjs/bundled_modules/d3-interpolate/src/array.js +0 -29
  187. package/dist/cjs/bundled_modules/d3-interpolate/src/basis.js +0 -26
  188. package/dist/cjs/bundled_modules/d3-interpolate/src/basisClosed.js +0 -19
  189. package/dist/cjs/bundled_modules/d3-interpolate/src/color.js +0 -37
  190. package/dist/cjs/bundled_modules/d3-interpolate/src/constant.js +0 -7
  191. package/dist/cjs/bundled_modules/d3-interpolate/src/cubehelix.js +0 -36
  192. package/dist/cjs/bundled_modules/d3-interpolate/src/date.js +0 -12
  193. package/dist/cjs/bundled_modules/d3-interpolate/src/discrete.js +0 -12
  194. package/dist/cjs/bundled_modules/d3-interpolate/src/hcl.js +0 -28
  195. package/dist/cjs/bundled_modules/d3-interpolate/src/hsl.js +0 -28
  196. package/dist/cjs/bundled_modules/d3-interpolate/src/hue.js +0 -15
  197. package/dist/cjs/bundled_modules/d3-interpolate/src/index.js +0 -53
  198. package/dist/cjs/bundled_modules/d3-interpolate/src/lab.js +0 -22
  199. package/dist/cjs/bundled_modules/d3-interpolate/src/number.js +0 -11
  200. package/dist/cjs/bundled_modules/d3-interpolate/src/numberArray.js +0 -21
  201. package/dist/cjs/bundled_modules/d3-interpolate/src/object.js +0 -29
  202. package/dist/cjs/bundled_modules/d3-interpolate/src/piecewise.js +0 -17
  203. package/dist/cjs/bundled_modules/d3-interpolate/src/quantize.js +0 -11
  204. package/dist/cjs/bundled_modules/d3-interpolate/src/rgb.js +0 -63
  205. package/dist/cjs/bundled_modules/d3-interpolate/src/round.js +0 -11
  206. package/dist/cjs/bundled_modules/d3-interpolate/src/string.js +0 -70
  207. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/decompose.js +0 -33
  208. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/index.js +0 -68
  209. package/dist/cjs/bundled_modules/d3-interpolate/src/transform/parse.js +0 -23
  210. package/dist/cjs/bundled_modules/d3-interpolate/src/value.js +0 -28
  211. package/dist/cjs/bundled_modules/d3-interpolate/src/zoom.js +0 -77
  212. package/dist/cjs/bundled_modules/d3-path/src/path.js +0 -157
  213. package/dist/cjs/bundled_modules/d3-quadtree/src/add.js +0 -91
  214. package/dist/cjs/bundled_modules/d3-quadtree/src/cover.js +0 -49
  215. package/dist/cjs/bundled_modules/d3-quadtree/src/data.js +0 -13
  216. package/dist/cjs/bundled_modules/d3-quadtree/src/extent.js +0 -11
  217. package/dist/cjs/bundled_modules/d3-quadtree/src/find.js +0 -76
  218. package/dist/cjs/bundled_modules/d3-quadtree/src/quad.js +0 -13
  219. package/dist/cjs/bundled_modules/d3-quadtree/src/quadtree.js +0 -79
  220. package/dist/cjs/bundled_modules/d3-quadtree/src/remove.js +0 -69
  221. package/dist/cjs/bundled_modules/d3-quadtree/src/root.js +0 -9
  222. package/dist/cjs/bundled_modules/d3-quadtree/src/size.js +0 -13
  223. package/dist/cjs/bundled_modules/d3-quadtree/src/visit.js +0 -22
  224. package/dist/cjs/bundled_modules/d3-quadtree/src/visitAfter.js +0 -27
  225. package/dist/cjs/bundled_modules/d3-quadtree/src/x.js +0 -14
  226. package/dist/cjs/bundled_modules/d3-quadtree/src/y.js +0 -14
  227. package/dist/cjs/bundled_modules/d3-scale/src/constant.js +0 -11
  228. package/dist/cjs/bundled_modules/d3-scale/src/continuous.js +0 -136
  229. package/dist/cjs/bundled_modules/d3-scale/src/diverging.js +0 -116
  230. package/dist/cjs/bundled_modules/d3-scale/src/identity.js +0 -34
  231. package/dist/cjs/bundled_modules/d3-scale/src/init.js +0 -31
  232. package/dist/cjs/bundled_modules/d3-scale/src/linear.js +0 -77
  233. package/dist/cjs/bundled_modules/d3-scale/src/log.js +0 -148
  234. package/dist/cjs/bundled_modules/d3-scale/src/nice.js +0 -24
  235. package/dist/cjs/bundled_modules/d3-scale/src/number.js +0 -9
  236. package/dist/cjs/bundled_modules/d3-scale/src/ordinal.js +0 -53
  237. package/dist/cjs/bundled_modules/d3-scale/src/pow.js +0 -58
  238. package/dist/cjs/bundled_modules/d3-scale/src/quantile.js +0 -65
  239. package/dist/cjs/bundled_modules/d3-scale/src/quantize.js +0 -62
  240. package/dist/cjs/bundled_modules/d3-scale/src/sequential.js +0 -119
  241. package/dist/cjs/bundled_modules/d3-scale/src/symlog.js +0 -42
  242. package/dist/cjs/bundled_modules/d3-scale/src/threshold.js +0 -45
  243. package/dist/cjs/bundled_modules/d3-scale/src/tickFormat.js +0 -39
  244. package/dist/cjs/bundled_modules/d3-scale/src/time.js +0 -85
  245. package/dist/cjs/bundled_modules/d3-scale/src/utcTime.js +0 -21
  246. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Accent.js +0 -9
  247. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Dark2.js +0 -9
  248. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Paired.js +0 -9
  249. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Pastel1.js +0 -9
  250. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Pastel2.js +0 -9
  251. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set1.js +0 -9
  252. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set2.js +0 -9
  253. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/Set3.js +0 -9
  254. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/category10.js +0 -9
  255. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/categorical/observable10.js +0 -9
  256. package/dist/cjs/bundled_modules/d3-scale-chromatic/src/colors.js +0 -11
  257. package/dist/cjs/bundled_modules/d3-shape/src/arc.js +0 -274
  258. package/dist/cjs/bundled_modules/d3-shape/src/area.js +0 -118
  259. package/dist/cjs/bundled_modules/d3-shape/src/array.js +0 -11
  260. package/dist/cjs/bundled_modules/d3-shape/src/constant.js +0 -11
  261. package/dist/cjs/bundled_modules/d3-shape/src/curve/basis.js +0 -59
  262. package/dist/cjs/bundled_modules/d3-shape/src/curve/basisClosed.js +0 -58
  263. package/dist/cjs/bundled_modules/d3-shape/src/curve/basisOpen.js +0 -45
  264. package/dist/cjs/bundled_modules/d3-shape/src/curve/bundle.js +0 -62
  265. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinal.js +0 -69
  266. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinalClosed.js +0 -68
  267. package/dist/cjs/bundled_modules/d3-shape/src/curve/cardinalOpen.js +0 -56
  268. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRom.js +0 -95
  269. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRomClosed.js +0 -80
  270. package/dist/cjs/bundled_modules/d3-shape/src/curve/catmullRomOpen.js +0 -68
  271. package/dist/cjs/bundled_modules/d3-shape/src/curve/linear.js +0 -37
  272. package/dist/cjs/bundled_modules/d3-shape/src/curve/linearClosed.js +0 -31
  273. package/dist/cjs/bundled_modules/d3-shape/src/curve/monotone.js +0 -109
  274. package/dist/cjs/bundled_modules/d3-shape/src/curve/natural.js +0 -71
  275. package/dist/cjs/bundled_modules/d3-shape/src/curve/step.js +0 -61
  276. package/dist/cjs/bundled_modules/d3-shape/src/line.js +0 -64
  277. package/dist/cjs/bundled_modules/d3-shape/src/math.js +0 -36
  278. package/dist/cjs/bundled_modules/d3-shape/src/noop.js +0 -7
  279. package/dist/cjs/bundled_modules/d3-shape/src/path.js +0 -23
  280. package/dist/cjs/bundled_modules/d3-shape/src/point.js +0 -12
  281. package/dist/cjs/bundled_modules/d3-shape/src/symbol/circle.js +0 -15
  282. package/dist/cjs/bundled_modules/d3-shape/src/symbol.js +0 -38
  283. package/dist/cjs/bundled_modules/d3-time/src/day.js +0 -41
  284. package/dist/cjs/bundled_modules/d3-time/src/duration.js +0 -17
  285. package/dist/cjs/bundled_modules/d3-time/src/hour.js +0 -31
  286. package/dist/cjs/bundled_modules/d3-time/src/interval.js +0 -73
  287. package/dist/cjs/bundled_modules/d3-time/src/millisecond.js +0 -29
  288. package/dist/cjs/bundled_modules/d3-time/src/minute.js +0 -31
  289. package/dist/cjs/bundled_modules/d3-time/src/month.js +0 -32
  290. package/dist/cjs/bundled_modules/d3-time/src/second.js +0 -18
  291. package/dist/cjs/bundled_modules/d3-time/src/ticks.js +0 -64
  292. package/dist/cjs/bundled_modules/d3-time/src/week.js +0 -73
  293. package/dist/cjs/bundled_modules/d3-time/src/year.js +0 -54
  294. package/dist/cjs/bundled_modules/d3-time-format/src/defaultLocale.js +0 -33
  295. package/dist/cjs/bundled_modules/d3-time-format/src/locale.js +0 -694
  296. package/dist/cjs/bundled_modules/d3-timer/src/interval.js +0 -23
  297. package/dist/cjs/bundled_modules/d3-timer/src/timer.js +0 -117
  298. package/dist/cjs/bundled_modules/delaunator/index.js +0 -485
  299. package/dist/cjs/bundled_modules/internmap/src/index.js +0 -66
  300. package/dist/cjs/bundled_modules/json-stringify-pretty-compact/index.js +0 -104
  301. package/dist/cjs/bundled_modules/robust-predicates/esm/orient2d.js +0 -184
  302. package/dist/cjs/bundled_modules/robust-predicates/esm/util.js +0 -95
  303. package/dist/cjs/bundled_modules/topojson-client/src/feature.js +0 -77
  304. package/dist/cjs/bundled_modules/topojson-client/src/identity.js +0 -9
  305. package/dist/cjs/bundled_modules/topojson-client/src/mesh.js +0 -60
  306. package/dist/cjs/bundled_modules/topojson-client/src/reverse.js +0 -10
  307. package/dist/cjs/bundled_modules/topojson-client/src/stitch.js +0 -79
  308. package/dist/cjs/bundled_modules/topojson-client/src/transform.js +0 -25
  309. package/dist/cjs/bundled_modules/vega/build/vega.module.js +0 -272
  310. package/dist/cjs/bundled_modules/vega-canvas/build/vega-canvas.browser.js +0 -18
  311. package/dist/cjs/bundled_modules/vega-crossfilter/build/vega-crossfilter.js +0 -676
  312. package/dist/cjs/bundled_modules/vega-dataflow/build/vega-dataflow.js +0 -2102
  313. package/dist/cjs/bundled_modules/vega-embed/build/embed.js +0 -2939
  314. package/dist/cjs/bundled_modules/vega-encode/build/vega-encode.js +0 -962
  315. package/dist/cjs/bundled_modules/vega-event-selector/build/vega-event-selector.js +0 -192
  316. package/dist/cjs/bundled_modules/vega-expression/build/vega-expression.js +0 -1615
  317. package/dist/cjs/bundled_modules/vega-force/build/vega-force.js +0 -295
  318. package/dist/cjs/bundled_modules/vega-format/build/vega-format.js +0 -201
  319. package/dist/cjs/bundled_modules/vega-functions/build/vega-functions.js +0 -842
  320. package/dist/cjs/bundled_modules/vega-geo/build/vega-geo.js +0 -1333
  321. package/dist/cjs/bundled_modules/vega-hierarchy/build/vega-hierarchy.js +0 -580
  322. package/dist/cjs/bundled_modules/vega-interpreter/build/vega-interpreter.js +0 -310
  323. package/dist/cjs/bundled_modules/vega-label/build/vega-label.js +0 -876
  324. package/dist/cjs/bundled_modules/vega-lite/build/index.js +0 -20157
  325. package/dist/cjs/bundled_modules/vega-loader/build/vega-loader.browser.js +0 -337
  326. package/dist/cjs/bundled_modules/vega-parser/build/vega-parser.js +0 -3805
  327. package/dist/cjs/bundled_modules/vega-projection/build/vega-projection.js +0 -90
  328. package/dist/cjs/bundled_modules/vega-regression/build/vega-regression.js +0 -236
  329. package/dist/cjs/bundled_modules/vega-runtime/build/vega-runtime.js +0 -588
  330. package/dist/cjs/bundled_modules/vega-scale/build/vega-scale.js +0 -846
  331. package/dist/cjs/bundled_modules/vega-scenegraph/build/vega-scenegraph.js +0 -5040
  332. package/dist/cjs/bundled_modules/vega-schema-url-parser/dist/parser.modern.js +0 -7
  333. package/dist/cjs/bundled_modules/vega-selections/build/vega-selection.js +0 -342
  334. package/dist/cjs/bundled_modules/vega-statistics/build/vega-statistics.js +0 -1193
  335. package/dist/cjs/bundled_modules/vega-themes/build/index.js +0 -853
  336. package/dist/cjs/bundled_modules/vega-time/build/vega-time.js +0 -342
  337. package/dist/cjs/bundled_modules/vega-tooltip/build/index.js +0 -353
  338. package/dist/cjs/bundled_modules/vega-transforms/build/vega-transforms.js +0 -3781
  339. package/dist/cjs/bundled_modules/vega-util/build/vega-util.js +0 -824
  340. package/dist/cjs/bundled_modules/vega-view/build/vega-view.js +0 -1306
  341. package/dist/cjs/bundled_modules/vega-view-transforms/build/vega-view-transforms.js +0 -1313
  342. package/dist/cjs/bundled_modules/vega-voronoi/build/vega-voronoi.js +0 -80
  343. package/dist/cjs/bundled_modules/vega-wordcloud/build/vega-wordcloud.js +0 -540
  344. package/dist/cjs/styles/entrypoint.scss.js +0 -7
  345. package/dist/cjs/unstable/Card/components.js +0 -213
  346. package/dist/cjs/unstable/Card/state.js +0 -53
  347. package/dist/cjs/unstable/StatCard/index.js +0 -124
  348. package/dist/cjs/unstable/StatCard/index.module.scss.js +0 -7
  349. package/dist/cjs/unstable/extras/chart/BarChart.js +0 -42
  350. package/dist/cjs/unstable/extras/chart/Chart.js +0 -100
  351. package/dist/cjs/unstable/extras/chart/DistributionChart.js +0 -84
  352. package/dist/cjs/unstable/extras/chart/DonutChart.js +0 -43
  353. package/dist/cjs/unstable/extras/chart/LineChart.js +0 -45
  354. package/dist/cjs/unstable/extras/chart/PieChart.js +0 -39
  355. package/dist/cjs/unstable/extras/chart/TimelineChart.js +0 -48
  356. package/dist/cjs/unstable/extras/chart/index.js +0 -23
  357. package/dist/cjs/unstable/skeleton/index.js +0 -74
  358. package/dist/cjs/unstable/skeleton/index.module.scss.js +0 -7
  359. package/dist/cjs/unstable/suspense/index.js +0 -18
  360. package/dist/cjs/unstable/suspense/index.module.scss.js +0 -7
  361. package/dist/cjs/unstable/suspense/loader.js +0 -23
  362. package/dist/esm/bundled_modules/d3-array/src/ascending.js +0 -5
  363. package/dist/esm/bundled_modules/d3-array/src/bisect.js +0 -10
  364. package/dist/esm/bundled_modules/d3-array/src/bisector.js +0 -58
  365. package/dist/esm/bundled_modules/d3-array/src/descending.js +0 -9
  366. package/dist/esm/bundled_modules/d3-array/src/deviation.js +0 -8
  367. package/dist/esm/bundled_modules/d3-array/src/fsum.js +0 -43
  368. package/dist/esm/bundled_modules/d3-array/src/intersection.js +0 -21
  369. package/dist/esm/bundled_modules/d3-array/src/max.js +0 -22
  370. package/dist/esm/bundled_modules/d3-array/src/mean.js +0 -21
  371. package/dist/esm/bundled_modules/d3-array/src/median.js +0 -7
  372. package/dist/esm/bundled_modules/d3-array/src/merge.js +0 -11
  373. package/dist/esm/bundled_modules/d3-array/src/min.js +0 -22
  374. package/dist/esm/bundled_modules/d3-array/src/number.js +0 -22
  375. package/dist/esm/bundled_modules/d3-array/src/permute.js +0 -5
  376. package/dist/esm/bundled_modules/d3-array/src/quantile.js +0 -31
  377. package/dist/esm/bundled_modules/d3-array/src/quickselect.js +0 -55
  378. package/dist/esm/bundled_modules/d3-array/src/range.js +0 -15
  379. package/dist/esm/bundled_modules/d3-array/src/sort.js +0 -17
  380. package/dist/esm/bundled_modules/d3-array/src/sum.js +0 -13
  381. package/dist/esm/bundled_modules/d3-array/src/ticks.js +0 -57
  382. package/dist/esm/bundled_modules/d3-array/src/union.js +0 -13
  383. package/dist/esm/bundled_modules/d3-array/src/variance.js +0 -27
  384. package/dist/esm/bundled_modules/d3-color/src/color.js +0 -398
  385. package/dist/esm/bundled_modules/d3-color/src/cubehelix.js +0 -63
  386. package/dist/esm/bundled_modules/d3-color/src/define.js +0 -12
  387. package/dist/esm/bundled_modules/d3-color/src/lab.js +0 -117
  388. package/dist/esm/bundled_modules/d3-color/src/math.js +0 -4
  389. package/dist/esm/bundled_modules/d3-delaunay/src/delaunay.js +0 -250
  390. package/dist/esm/bundled_modules/d3-delaunay/src/path.js +0 -39
  391. package/dist/esm/bundled_modules/d3-delaunay/src/polygon.js +0 -19
  392. package/dist/esm/bundled_modules/d3-delaunay/src/voronoi.js +0 -334
  393. package/dist/esm/bundled_modules/d3-dispatch/src/dispatch.js +0 -84
  394. package/dist/esm/bundled_modules/d3-dsv/src/dsv.js +0 -166
  395. package/dist/esm/bundled_modules/d3-force/src/center.js +0 -42
  396. package/dist/esm/bundled_modules/d3-force/src/collide.js +0 -102
  397. package/dist/esm/bundled_modules/d3-force/src/constant.js +0 -7
  398. package/dist/esm/bundled_modules/d3-force/src/jiggle.js +0 -5
  399. package/dist/esm/bundled_modules/d3-force/src/lcg.js +0 -11
  400. package/dist/esm/bundled_modules/d3-force/src/link.js +0 -119
  401. package/dist/esm/bundled_modules/d3-force/src/manyBody.js +0 -118
  402. package/dist/esm/bundled_modules/d3-force/src/simulation.js +0 -158
  403. package/dist/esm/bundled_modules/d3-force/src/x.js +0 -43
  404. package/dist/esm/bundled_modules/d3-force/src/y.js +0 -43
  405. package/dist/esm/bundled_modules/d3-format/src/defaultLocale.js +0 -20
  406. package/dist/esm/bundled_modules/d3-format/src/exponent.js +0 -7
  407. package/dist/esm/bundled_modules/d3-format/src/formatDecimal.js +0 -22
  408. package/dist/esm/bundled_modules/d3-format/src/formatGroup.js +0 -20
  409. package/dist/esm/bundled_modules/d3-format/src/formatNumerals.js +0 -9
  410. package/dist/esm/bundled_modules/d3-format/src/formatPrefixAuto.js +0 -18
  411. package/dist/esm/bundled_modules/d3-format/src/formatRounded.js +0 -13
  412. package/dist/esm/bundled_modules/d3-format/src/formatSpecifier.js +0 -49
  413. package/dist/esm/bundled_modules/d3-format/src/formatTrim.js +0 -13
  414. package/dist/esm/bundled_modules/d3-format/src/formatTypes.js +0 -21
  415. package/dist/esm/bundled_modules/d3-format/src/identity.js +0 -5
  416. package/dist/esm/bundled_modules/d3-format/src/locale.js +0 -150
  417. package/dist/esm/bundled_modules/d3-format/src/precisionFixed.js +0 -7
  418. package/dist/esm/bundled_modules/d3-format/src/precisionPrefix.js +0 -7
  419. package/dist/esm/bundled_modules/d3-format/src/precisionRound.js +0 -8
  420. package/dist/esm/bundled_modules/d3-geo/src/area.js +0 -78
  421. package/dist/esm/bundled_modules/d3-geo/src/bounds.js +0 -181
  422. package/dist/esm/bundled_modules/d3-geo/src/cartesian.js +0 -35
  423. package/dist/esm/bundled_modules/d3-geo/src/centroid.js +0 -145
  424. package/dist/esm/bundled_modules/d3-geo/src/circle.js +0 -33
  425. package/dist/esm/bundled_modules/d3-geo/src/clip/antimeridian.js +0 -94
  426. package/dist/esm/bundled_modules/d3-geo/src/clip/buffer.js +0 -26
  427. package/dist/esm/bundled_modules/d3-geo/src/clip/circle.js +0 -179
  428. package/dist/esm/bundled_modules/d3-geo/src/clip/index.js +0 -133
  429. package/dist/esm/bundled_modules/d3-geo/src/clip/line.js +0 -61
  430. package/dist/esm/bundled_modules/d3-geo/src/clip/rectangle.js +0 -170
  431. package/dist/esm/bundled_modules/d3-geo/src/clip/rejoin.js +0 -105
  432. package/dist/esm/bundled_modules/d3-geo/src/compose.js +0 -14
  433. package/dist/esm/bundled_modules/d3-geo/src/graticule.js +0 -103
  434. package/dist/esm/bundled_modules/d3-geo/src/identity.js +0 -3
  435. package/dist/esm/bundled_modules/d3-geo/src/math.js +0 -33
  436. package/dist/esm/bundled_modules/d3-geo/src/noop.js +0 -3
  437. package/dist/esm/bundled_modules/d3-geo/src/path/area.js +0 -50
  438. package/dist/esm/bundled_modules/d3-geo/src/path/bounds.js +0 -28
  439. package/dist/esm/bundled_modules/d3-geo/src/path/centroid.js +0 -100
  440. package/dist/esm/bundled_modules/d3-geo/src/path/context.js +0 -47
  441. package/dist/esm/bundled_modules/d3-geo/src/path/index.js +0 -78
  442. package/dist/esm/bundled_modules/d3-geo/src/path/measure.js +0 -45
  443. package/dist/esm/bundled_modules/d3-geo/src/path/string.js +0 -88
  444. package/dist/esm/bundled_modules/d3-geo/src/pointEqual.js +0 -7
  445. package/dist/esm/bundled_modules/d3-geo/src/polygonContains.js +0 -76
  446. package/dist/esm/bundled_modules/d3-geo/src/projection/albers.js +0 -12
  447. package/dist/esm/bundled_modules/d3-geo/src/projection/albersUsa.js +0 -113
  448. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthal.js +0 -29
  449. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthalEqualArea.js +0 -19
  450. package/dist/esm/bundled_modules/d3-geo/src/projection/azimuthalEquidistant.js +0 -19
  451. package/dist/esm/bundled_modules/d3-geo/src/projection/conic.js +0 -17
  452. package/dist/esm/bundled_modules/d3-geo/src/projection/conicConformal.js +0 -40
  453. package/dist/esm/bundled_modules/d3-geo/src/projection/conicEqualArea.js +0 -35
  454. package/dist/esm/bundled_modules/d3-geo/src/projection/conicEquidistant.js +0 -34
  455. package/dist/esm/bundled_modules/d3-geo/src/projection/cylindricalEqualArea.js +0 -17
  456. package/dist/esm/bundled_modules/d3-geo/src/projection/equalEarth.js +0 -38
  457. package/dist/esm/bundled_modules/d3-geo/src/projection/equirectangular.js +0 -14
  458. package/dist/esm/bundled_modules/d3-geo/src/projection/fit.js +0 -49
  459. package/dist/esm/bundled_modules/d3-geo/src/projection/gnomonic.js +0 -18
  460. package/dist/esm/bundled_modules/d3-geo/src/projection/identity.js +0 -87
  461. package/dist/esm/bundled_modules/d3-geo/src/projection/index.js +0 -179
  462. package/dist/esm/bundled_modules/d3-geo/src/projection/mercator.js +0 -54
  463. package/dist/esm/bundled_modules/d3-geo/src/projection/naturalEarth1.js +0 -30
  464. package/dist/esm/bundled_modules/d3-geo/src/projection/orthographic.js +0 -17
  465. package/dist/esm/bundled_modules/d3-geo/src/projection/resample.js +0 -104
  466. package/dist/esm/bundled_modules/d3-geo/src/projection/stereographic.js +0 -20
  467. package/dist/esm/bundled_modules/d3-geo/src/projection/transverseMercator.js +0 -29
  468. package/dist/esm/bundled_modules/d3-geo/src/rotation.js +0 -81
  469. package/dist/esm/bundled_modules/d3-geo/src/stream.js +0 -71
  470. package/dist/esm/bundled_modules/d3-geo/src/transform.js +0 -22
  471. package/dist/esm/bundled_modules/d3-geo-projection/src/math.js +0 -18
  472. package/dist/esm/bundled_modules/d3-geo-projection/src/mollweide.js +0 -31
  473. package/dist/esm/bundled_modules/d3-hierarchy/src/accessors.js +0 -10
  474. package/dist/esm/bundled_modules/d3-hierarchy/src/array.js +0 -22
  475. package/dist/esm/bundled_modules/d3-hierarchy/src/cluster.js +0 -86
  476. package/dist/esm/bundled_modules/d3-hierarchy/src/constant.js +0 -11
  477. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/ancestors.js +0 -9
  478. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/count.js +0 -14
  479. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/descendants.js +0 -5
  480. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/each.js +0 -9
  481. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/eachAfter.js +0 -17
  482. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/eachBefore.js +0 -14
  483. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/find.js +0 -10
  484. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/index.js +0 -93
  485. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/iterator.js +0 -16
  486. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/leaves.js +0 -11
  487. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/links.js +0 -11
  488. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/path.js +0 -32
  489. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/sort.js +0 -9
  490. package/dist/esm/bundled_modules/d3-hierarchy/src/hierarchy/sum.js +0 -11
  491. package/dist/esm/bundled_modules/d3-hierarchy/src/lcg.js +0 -11
  492. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/enclose.js +0 -120
  493. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/index.js +0 -83
  494. package/dist/esm/bundled_modules/d3-hierarchy/src/pack/siblings.js +0 -116
  495. package/dist/esm/bundled_modules/d3-hierarchy/src/partition.js +0 -54
  496. package/dist/esm/bundled_modules/d3-hierarchy/src/stratify.js +0 -147
  497. package/dist/esm/bundled_modules/d3-hierarchy/src/tree.js +0 -239
  498. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/binary.js +0 -48
  499. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/dice.js +0 -14
  500. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/index.js +0 -96
  501. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/resquarify.js +0 -38
  502. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/round.js +0 -8
  503. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/slice.js +0 -14
  504. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/sliceDice.js +0 -8
  505. package/dist/esm/bundled_modules/d3-hierarchy/src/treemap/squarify.js +0 -68
  506. package/dist/esm/bundled_modules/d3-interpolate/src/array.js +0 -24
  507. package/dist/esm/bundled_modules/d3-interpolate/src/basis.js +0 -21
  508. package/dist/esm/bundled_modules/d3-interpolate/src/basisClosed.js +0 -15
  509. package/dist/esm/bundled_modules/d3-interpolate/src/color.js +0 -31
  510. package/dist/esm/bundled_modules/d3-interpolate/src/constant.js +0 -3
  511. package/dist/esm/bundled_modules/d3-interpolate/src/cubehelix.js +0 -31
  512. package/dist/esm/bundled_modules/d3-interpolate/src/date.js +0 -8
  513. package/dist/esm/bundled_modules/d3-interpolate/src/discrete.js +0 -8
  514. package/dist/esm/bundled_modules/d3-interpolate/src/hcl.js +0 -23
  515. package/dist/esm/bundled_modules/d3-interpolate/src/hsl.js +0 -23
  516. package/dist/esm/bundled_modules/d3-interpolate/src/hue.js +0 -11
  517. package/dist/esm/bundled_modules/d3-interpolate/src/index.js +0 -21
  518. package/dist/esm/bundled_modules/d3-interpolate/src/lab.js +0 -18
  519. package/dist/esm/bundled_modules/d3-interpolate/src/number.js +0 -7
  520. package/dist/esm/bundled_modules/d3-interpolate/src/numberArray.js +0 -16
  521. package/dist/esm/bundled_modules/d3-interpolate/src/object.js +0 -25
  522. package/dist/esm/bundled_modules/d3-interpolate/src/piecewise.js +0 -13
  523. package/dist/esm/bundled_modules/d3-interpolate/src/quantize.js +0 -7
  524. package/dist/esm/bundled_modules/d3-interpolate/src/rgb.js +0 -57
  525. package/dist/esm/bundled_modules/d3-interpolate/src/round.js +0 -7
  526. package/dist/esm/bundled_modules/d3-interpolate/src/string.js +0 -66
  527. package/dist/esm/bundled_modules/d3-interpolate/src/transform/decompose.js +0 -28
  528. package/dist/esm/bundled_modules/d3-interpolate/src/transform/index.js +0 -65
  529. package/dist/esm/bundled_modules/d3-interpolate/src/transform/parse.js +0 -20
  530. package/dist/esm/bundled_modules/d3-interpolate/src/value.js +0 -24
  531. package/dist/esm/bundled_modules/d3-interpolate/src/zoom.js +0 -73
  532. package/dist/esm/bundled_modules/d3-path/src/path.js +0 -154
  533. package/dist/esm/bundled_modules/d3-quadtree/src/add.js +0 -86
  534. package/dist/esm/bundled_modules/d3-quadtree/src/cover.js +0 -45
  535. package/dist/esm/bundled_modules/d3-quadtree/src/data.js +0 -9
  536. package/dist/esm/bundled_modules/d3-quadtree/src/extent.js +0 -7
  537. package/dist/esm/bundled_modules/d3-quadtree/src/find.js +0 -72
  538. package/dist/esm/bundled_modules/d3-quadtree/src/quad.js +0 -9
  539. package/dist/esm/bundled_modules/d3-quadtree/src/quadtree.js +0 -75
  540. package/dist/esm/bundled_modules/d3-quadtree/src/remove.js +0 -64
  541. package/dist/esm/bundled_modules/d3-quadtree/src/root.js +0 -5
  542. package/dist/esm/bundled_modules/d3-quadtree/src/size.js +0 -9
  543. package/dist/esm/bundled_modules/d3-quadtree/src/visit.js +0 -18
  544. package/dist/esm/bundled_modules/d3-quadtree/src/visitAfter.js +0 -23
  545. package/dist/esm/bundled_modules/d3-quadtree/src/x.js +0 -9
  546. package/dist/esm/bundled_modules/d3-quadtree/src/y.js +0 -9
  547. package/dist/esm/bundled_modules/d3-scale/src/constant.js +0 -7
  548. package/dist/esm/bundled_modules/d3-scale/src/continuous.js +0 -129
  549. package/dist/esm/bundled_modules/d3-scale/src/diverging.js +0 -108
  550. package/dist/esm/bundled_modules/d3-scale/src/identity.js +0 -30
  551. package/dist/esm/bundled_modules/d3-scale/src/init.js +0 -28
  552. package/dist/esm/bundled_modules/d3-scale/src/linear.js +0 -72
  553. package/dist/esm/bundled_modules/d3-scale/src/log.js +0 -143
  554. package/dist/esm/bundled_modules/d3-scale/src/nice.js +0 -20
  555. package/dist/esm/bundled_modules/d3-scale/src/number.js +0 -5
  556. package/dist/esm/bundled_modules/d3-scale/src/ordinal.js +0 -48
  557. package/dist/esm/bundled_modules/d3-scale/src/pow.js +0 -52
  558. package/dist/esm/bundled_modules/d3-scale/src/quantile.js +0 -61
  559. package/dist/esm/bundled_modules/d3-scale/src/quantize.js +0 -58
  560. package/dist/esm/bundled_modules/d3-scale/src/sequential.js +0 -110
  561. package/dist/esm/bundled_modules/d3-scale/src/symlog.js +0 -37
  562. package/dist/esm/bundled_modules/d3-scale/src/threshold.js +0 -41
  563. package/dist/esm/bundled_modules/d3-scale/src/tickFormat.js +0 -35
  564. package/dist/esm/bundled_modules/d3-scale/src/time.js +0 -80
  565. package/dist/esm/bundled_modules/d3-scale/src/utcTime.js +0 -17
  566. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Accent.js +0 -5
  567. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Dark2.js +0 -5
  568. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Paired.js +0 -5
  569. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Pastel1.js +0 -5
  570. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Pastel2.js +0 -5
  571. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set1.js +0 -5
  572. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set2.js +0 -5
  573. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/Set3.js +0 -5
  574. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/category10.js +0 -5
  575. package/dist/esm/bundled_modules/d3-scale-chromatic/src/categorical/observable10.js +0 -5
  576. package/dist/esm/bundled_modules/d3-scale-chromatic/src/colors.js +0 -7
  577. package/dist/esm/bundled_modules/d3-shape/src/arc.js +0 -270
  578. package/dist/esm/bundled_modules/d3-shape/src/area.js +0 -114
  579. package/dist/esm/bundled_modules/d3-shape/src/array.js +0 -7
  580. package/dist/esm/bundled_modules/d3-shape/src/constant.js +0 -7
  581. package/dist/esm/bundled_modules/d3-shape/src/curve/basis.js +0 -53
  582. package/dist/esm/bundled_modules/d3-shape/src/curve/basisClosed.js +0 -54
  583. package/dist/esm/bundled_modules/d3-shape/src/curve/basisOpen.js +0 -41
  584. package/dist/esm/bundled_modules/d3-shape/src/curve/bundle.js +0 -58
  585. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinal.js +0 -63
  586. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinalClosed.js +0 -63
  587. package/dist/esm/bundled_modules/d3-shape/src/curve/cardinalOpen.js +0 -51
  588. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRom.js +0 -90
  589. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRomClosed.js +0 -76
  590. package/dist/esm/bundled_modules/d3-shape/src/curve/catmullRomOpen.js +0 -64
  591. package/dist/esm/bundled_modules/d3-shape/src/curve/linear.js +0 -33
  592. package/dist/esm/bundled_modules/d3-shape/src/curve/linearClosed.js +0 -27
  593. package/dist/esm/bundled_modules/d3-shape/src/curve/monotone.js +0 -106
  594. package/dist/esm/bundled_modules/d3-shape/src/curve/natural.js +0 -67
  595. package/dist/esm/bundled_modules/d3-shape/src/curve/step.js +0 -55
  596. package/dist/esm/bundled_modules/d3-shape/src/line.js +0 -60
  597. package/dist/esm/bundled_modules/d3-shape/src/math.js +0 -22
  598. package/dist/esm/bundled_modules/d3-shape/src/noop.js +0 -3
  599. package/dist/esm/bundled_modules/d3-shape/src/path.js +0 -21
  600. package/dist/esm/bundled_modules/d3-shape/src/point.js +0 -9
  601. package/dist/esm/bundled_modules/d3-shape/src/symbol/circle.js +0 -11
  602. package/dist/esm/bundled_modules/d3-shape/src/symbol.js +0 -34
  603. package/dist/esm/bundled_modules/d3-time/src/day.js +0 -37
  604. package/dist/esm/bundled_modules/d3-time/src/duration.js +0 -9
  605. package/dist/esm/bundled_modules/d3-time/src/hour.js +0 -28
  606. package/dist/esm/bundled_modules/d3-time/src/interval.js +0 -71
  607. package/dist/esm/bundled_modules/d3-time/src/millisecond.js +0 -27
  608. package/dist/esm/bundled_modules/d3-time/src/minute.js +0 -28
  609. package/dist/esm/bundled_modules/d3-time/src/month.js +0 -29
  610. package/dist/esm/bundled_modules/d3-time/src/second.js +0 -16
  611. package/dist/esm/bundled_modules/d3-time/src/ticks.js +0 -59
  612. package/dist/esm/bundled_modules/d3-time/src/week.js +0 -58
  613. package/dist/esm/bundled_modules/d3-time/src/year.js +0 -51
  614. package/dist/esm/bundled_modules/d3-time-format/src/defaultLocale.js +0 -29
  615. package/dist/esm/bundled_modules/d3-time-format/src/locale.js +0 -690
  616. package/dist/esm/bundled_modules/d3-timer/src/interval.js +0 -19
  617. package/dist/esm/bundled_modules/d3-timer/src/timer.js +0 -112
  618. package/dist/esm/bundled_modules/delaunator/index.js +0 -481
  619. package/dist/esm/bundled_modules/internmap/src/index.js +0 -63
  620. package/dist/esm/bundled_modules/json-stringify-pretty-compact/index.js +0 -100
  621. package/dist/esm/bundled_modules/robust-predicates/esm/orient2d.js +0 -182
  622. package/dist/esm/bundled_modules/robust-predicates/esm/util.js +0 -88
  623. package/dist/esm/bundled_modules/topojson-client/src/feature.js +0 -72
  624. package/dist/esm/bundled_modules/topojson-client/src/identity.js +0 -5
  625. package/dist/esm/bundled_modules/topojson-client/src/mesh.js +0 -55
  626. package/dist/esm/bundled_modules/topojson-client/src/reverse.js +0 -6
  627. package/dist/esm/bundled_modules/topojson-client/src/stitch.js +0 -75
  628. package/dist/esm/bundled_modules/topojson-client/src/transform.js +0 -21
  629. package/dist/esm/bundled_modules/vega/build/vega.module.js +0 -38
  630. package/dist/esm/bundled_modules/vega-canvas/build/vega-canvas.browser.js +0 -14
  631. package/dist/esm/bundled_modules/vega-crossfilter/build/vega-crossfilter.js +0 -673
  632. package/dist/esm/bundled_modules/vega-dataflow/build/vega-dataflow.js +0 -2080
  633. package/dist/esm/bundled_modules/vega-embed/build/embed.js +0 -2932
  634. package/dist/esm/bundled_modules/vega-encode/build/vega-encode.js +0 -952
  635. package/dist/esm/bundled_modules/vega-event-selector/build/vega-event-selector.js +0 -190
  636. package/dist/esm/bundled_modules/vega-expression/build/vega-expression.js +0 -1597
  637. package/dist/esm/bundled_modules/vega-force/build/vega-force.js +0 -293
  638. package/dist/esm/bundled_modules/vega-format/build/vega-format.js +0 -191
  639. package/dist/esm/bundled_modules/vega-functions/build/vega-functions.js +0 -779
  640. package/dist/esm/bundled_modules/vega-geo/build/vega-geo.js +0 -1322
  641. package/dist/esm/bundled_modules/vega-hierarchy/build/vega-hierarchy.js +0 -572
  642. package/dist/esm/bundled_modules/vega-interpreter/build/vega-interpreter.js +0 -308
  643. package/dist/esm/bundled_modules/vega-label/build/vega-label.js +0 -874
  644. package/dist/esm/bundled_modules/vega-lite/build/index.js +0 -20110
  645. package/dist/esm/bundled_modules/vega-loader/build/vega-loader.browser.js +0 -328
  646. package/dist/esm/bundled_modules/vega-parser/build/vega-parser.js +0 -3783
  647. package/dist/esm/bundled_modules/vega-projection/build/vega-projection.js +0 -86
  648. package/dist/esm/bundled_modules/vega-regression/build/vega-regression.js +0 -233
  649. package/dist/esm/bundled_modules/vega-runtime/build/vega-runtime.js +0 -586
  650. package/dist/esm/bundled_modules/vega-scale/build/vega-scale.js +0 -799
  651. package/dist/esm/bundled_modules/vega-scenegraph/build/vega-scenegraph.js +0 -4982
  652. package/dist/esm/bundled_modules/vega-schema-url-parser/dist/parser.modern.js +0 -3
  653. package/dist/esm/bundled_modules/vega-selections/build/vega-selection.js +0 -336
  654. package/dist/esm/bundled_modules/vega-statistics/build/vega-statistics.js +0 -1157
  655. package/dist/esm/bundled_modules/vega-themes/build/index.js +0 -837
  656. package/dist/esm/bundled_modules/vega-time/build/vega-time.js +0 -314
  657. package/dist/esm/bundled_modules/vega-tooltip/build/index.js +0 -339
  658. package/dist/esm/bundled_modules/vega-transforms/build/vega-transforms.js +0 -3740
  659. package/dist/esm/bundled_modules/vega-util/build/vega-util.js +0 -753
  660. package/dist/esm/bundled_modules/vega-view/build/vega-view.js +0 -1304
  661. package/dist/esm/bundled_modules/vega-view-transforms/build/vega-view-transforms.js +0 -1306
  662. package/dist/esm/bundled_modules/vega-voronoi/build/vega-voronoi.js +0 -78
  663. package/dist/esm/bundled_modules/vega-wordcloud/build/vega-wordcloud.js +0 -538
  664. package/dist/esm/styles/entrypoint.scss.js +0 -3
  665. package/dist/esm/unstable/Card/components.js +0 -182
  666. package/dist/esm/unstable/Card/state.js +0 -30
  667. package/dist/esm/unstable/StatCard/index.js +0 -116
  668. package/dist/esm/unstable/StatCard/index.module.scss.js +0 -3
  669. package/dist/esm/unstable/extras/chart/BarChart.js +0 -40
  670. package/dist/esm/unstable/extras/chart/Chart.js +0 -96
  671. package/dist/esm/unstable/extras/chart/DistributionChart.js +0 -82
  672. package/dist/esm/unstable/extras/chart/DonutChart.js +0 -41
  673. package/dist/esm/unstable/extras/chart/LineChart.js +0 -43
  674. package/dist/esm/unstable/extras/chart/PieChart.js +0 -37
  675. package/dist/esm/unstable/extras/chart/TimelineChart.js +0 -46
  676. package/dist/esm/unstable/extras/chart/index.js +0 -8
  677. package/dist/esm/unstable/skeleton/index.js +0 -69
  678. package/dist/esm/unstable/skeleton/index.module.scss.js +0 -3
  679. package/dist/esm/unstable/suspense/index.js +0 -15
  680. package/dist/esm/unstable/suspense/index.module.scss.js +0 -3
  681. package/dist/esm/unstable/suspense/loader.js +0 -20
  682. package/dist/types/unstable/Card/components.d.ts +0 -90
  683. package/dist/types/unstable/Card/state.d.ts +0 -20
  684. package/dist/types/unstable/StatCard/index.d.ts +0 -33
  685. package/dist/types/unstable/extras/chart/BarChart.d.ts +0 -16
  686. package/dist/types/unstable/extras/chart/Chart.d.ts +0 -33
  687. package/dist/types/unstable/extras/chart/DistributionChart.d.ts +0 -18
  688. package/dist/types/unstable/extras/chart/DonutChart.d.ts +0 -16
  689. package/dist/types/unstable/extras/chart/LineChart.d.ts +0 -16
  690. package/dist/types/unstable/extras/chart/PieChart.d.ts +0 -14
  691. package/dist/types/unstable/extras/chart/TimelineChart.d.ts +0 -15
  692. package/dist/types/unstable/skeleton/index.d.ts +0 -15
  693. package/dist/types/unstable/suspense/index.d.ts +0 -9
  694. package/dist/types/unstable/suspense/loader.d.ts +0 -7
@@ -1,2939 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var index$3 = require('../../json-stringify-pretty-compact/index.js');
6
- var vega_module = require('../../vega/build/vega.module.js');
7
- var vegaInterpreter = require('../../vega-interpreter/build/vega-interpreter.js');
8
- var index = require('../../vega-lite/build/index.js');
9
- var parser_modern = require('../../vega-schema-url-parser/dist/parser.modern.js');
10
- var index$1 = require('../../vega-themes/build/index.js');
11
- var index$2 = require('../../vega-tooltip/build/index.js');
12
- var vegaUtil = require('../../vega-util/build/vega-util.js');
13
-
14
- /*!
15
- * https://github.com/Starcounter-Jack/JSON-Patch
16
- * (c) 2017-2022 Joachim Wester
17
- * MIT licensed
18
- */
19
- var __extends = (function () {
20
- var extendStatics = function (d, b) {
21
- extendStatics = Object.setPrototypeOf ||
22
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
24
- return extendStatics(d, b);
25
- };
26
- return function (d, b) {
27
- extendStatics(d, b);
28
- function __() { this.constructor = d; }
29
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
- };
31
- })();
32
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
33
- function hasOwnProperty(obj, key) {
34
- return _hasOwnProperty.call(obj, key);
35
- }
36
- function _objectKeys(obj) {
37
- if (Array.isArray(obj)) {
38
- var keys_1 = new Array(obj.length);
39
- for (var k = 0; k < keys_1.length; k++) {
40
- keys_1[k] = "" + k;
41
- }
42
- return keys_1;
43
- }
44
- if (Object.keys) {
45
- return Object.keys(obj);
46
- }
47
- var keys = [];
48
- for (var i in obj) {
49
- if (hasOwnProperty(obj, i)) {
50
- keys.push(i);
51
- }
52
- }
53
- return keys;
54
- }
55
- /**
56
- * Deeply clone the object.
57
- * https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy)
58
- * @param {any} obj value to clone
59
- * @return {any} cloned obj
60
- */
61
- function _deepClone(obj) {
62
- switch (typeof obj) {
63
- case "object":
64
- return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5
65
- case "undefined":
66
- return null; //this is how JSON.stringify behaves for array items
67
- default:
68
- return obj; //no need to clone primitives
69
- }
70
- }
71
- //3x faster than cached /^\d+$/.test(str)
72
- function isInteger(str) {
73
- var i = 0;
74
- var len = str.length;
75
- var charCode;
76
- while (i < len) {
77
- charCode = str.charCodeAt(i);
78
- if (charCode >= 48 && charCode <= 57) {
79
- i++;
80
- continue;
81
- }
82
- return false;
83
- }
84
- return true;
85
- }
86
- /**
87
- * Escapes a json pointer path
88
- * @param path The raw pointer
89
- * @return the Escaped path
90
- */
91
- function escapePathComponent(path) {
92
- if (path.indexOf('/') === -1 && path.indexOf('~') === -1)
93
- return path;
94
- return path.replace(/~/g, '~0').replace(/\//g, '~1');
95
- }
96
- /**
97
- * Unescapes a json pointer path
98
- * @param path The escaped pointer
99
- * @return The unescaped path
100
- */
101
- function unescapePathComponent(path) {
102
- return path.replace(/~1/g, '/').replace(/~0/g, '~');
103
- }
104
- /**
105
- * Recursively checks whether an object has any undefined values inside.
106
- */
107
- function hasUndefined(obj) {
108
- if (obj === undefined) {
109
- return true;
110
- }
111
- if (obj) {
112
- if (Array.isArray(obj)) {
113
- for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {
114
- if (hasUndefined(obj[i_1])) {
115
- return true;
116
- }
117
- }
118
- }
119
- else if (typeof obj === "object") {
120
- var objKeys = _objectKeys(obj);
121
- var objKeysLength = objKeys.length;
122
- for (var i = 0; i < objKeysLength; i++) {
123
- if (hasUndefined(obj[objKeys[i]])) {
124
- return true;
125
- }
126
- }
127
- }
128
- }
129
- return false;
130
- }
131
- function patchErrorMessageFormatter(message, args) {
132
- var messageParts = [message];
133
- for (var key in args) {
134
- var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print
135
- if (typeof value !== 'undefined') {
136
- messageParts.push(key + ": " + value);
137
- }
138
- }
139
- return messageParts.join('\n');
140
- }
141
- var PatchError = /** @class */ (function (_super) {
142
- __extends(PatchError, _super);
143
- function PatchError(message, name, index, operation, tree) {
144
- var _newTarget = this.constructor;
145
- var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;
146
- _this.name = name;
147
- _this.index = index;
148
- _this.operation = operation;
149
- _this.tree = tree;
150
- Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359
151
- _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });
152
- return _this;
153
- }
154
- return PatchError;
155
- }(Error));
156
-
157
- var JsonPatchError = PatchError;
158
- var deepClone = _deepClone;
159
- /* We use a Javascript hash to store each
160
- function. Each hash entry (property) uses
161
- the operation identifiers specified in rfc6902.
162
- In this way, we can map each patch operation
163
- to its dedicated function in efficient way.
164
- */
165
- /* The operations applicable to an object */
166
- var objOps = {
167
- add: function (obj, key, document) {
168
- obj[key] = this.value;
169
- return { newDocument: document };
170
- },
171
- remove: function (obj, key, document) {
172
- var removed = obj[key];
173
- delete obj[key];
174
- return { newDocument: document, removed: removed };
175
- },
176
- replace: function (obj, key, document) {
177
- var removed = obj[key];
178
- obj[key] = this.value;
179
- return { newDocument: document, removed: removed };
180
- },
181
- move: function (obj, key, document) {
182
- /* in case move target overwrites an existing value,
183
- return the removed value, this can be taxing performance-wise,
184
- and is potentially unneeded */
185
- var removed = getValueByPointer(document, this.path);
186
- if (removed) {
187
- removed = _deepClone(removed);
188
- }
189
- var originalValue = applyOperation(document, { op: "remove", path: this.from }).removed;
190
- applyOperation(document, { op: "add", path: this.path, value: originalValue });
191
- return { newDocument: document, removed: removed };
192
- },
193
- copy: function (obj, key, document) {
194
- var valueToCopy = getValueByPointer(document, this.from);
195
- // enforce copy by value so further operations don't affect source (see issue #177)
196
- applyOperation(document, { op: "add", path: this.path, value: _deepClone(valueToCopy) });
197
- return { newDocument: document };
198
- },
199
- test: function (obj, key, document) {
200
- return { newDocument: document, test: _areEquals(obj[key], this.value) };
201
- },
202
- _get: function (obj, key, document) {
203
- this.value = obj[key];
204
- return { newDocument: document };
205
- }
206
- };
207
- /* The operations applicable to an array. Many are the same as for the object */
208
- var arrOps = {
209
- add: function (arr, i, document) {
210
- if (isInteger(i)) {
211
- arr.splice(i, 0, this.value);
212
- }
213
- else { // array props
214
- arr[i] = this.value;
215
- }
216
- // this may be needed when using '-' in an array
217
- return { newDocument: document, index: i };
218
- },
219
- remove: function (arr, i, document) {
220
- var removedList = arr.splice(i, 1);
221
- return { newDocument: document, removed: removedList[0] };
222
- },
223
- replace: function (arr, i, document) {
224
- var removed = arr[i];
225
- arr[i] = this.value;
226
- return { newDocument: document, removed: removed };
227
- },
228
- move: objOps.move,
229
- copy: objOps.copy,
230
- test: objOps.test,
231
- _get: objOps._get
232
- };
233
- /**
234
- * Retrieves a value from a JSON document by a JSON pointer.
235
- * Returns the value.
236
- *
237
- * @param document The document to get the value from
238
- * @param pointer an escaped JSON pointer
239
- * @return The retrieved value
240
- */
241
- function getValueByPointer(document, pointer) {
242
- if (pointer == '') {
243
- return document;
244
- }
245
- var getOriginalDestination = { op: "_get", path: pointer };
246
- applyOperation(document, getOriginalDestination);
247
- return getOriginalDestination.value;
248
- }
249
- /**
250
- * Apply a single JSON Patch Operation on a JSON document.
251
- * Returns the {newDocument, result} of the operation.
252
- * It modifies the `document` and `operation` objects - it gets the values by reference.
253
- * If you would like to avoid touching your values, clone them:
254
- * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.
255
- *
256
- * @param document The document to patch
257
- * @param operation The operation to apply
258
- * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
259
- * @param mutateDocument Whether to mutate the original document or clone it before applying
260
- * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
261
- * @return `{newDocument, result}` after the operation
262
- */
263
- function applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {
264
- if (validateOperation === void 0) { validateOperation = false; }
265
- if (mutateDocument === void 0) { mutateDocument = true; }
266
- if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }
267
- if (index === void 0) { index = 0; }
268
- if (validateOperation) {
269
- if (typeof validateOperation == 'function') {
270
- validateOperation(operation, 0, document, operation.path);
271
- }
272
- else {
273
- validator(operation, 0);
274
- }
275
- }
276
- /* ROOT OPERATIONS */
277
- if (operation.path === "") {
278
- var returnValue = { newDocument: document };
279
- if (operation.op === 'add') {
280
- returnValue.newDocument = operation.value;
281
- return returnValue;
282
- }
283
- else if (operation.op === 'replace') {
284
- returnValue.newDocument = operation.value;
285
- returnValue.removed = document; //document we removed
286
- return returnValue;
287
- }
288
- else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root
289
- returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field
290
- if (operation.op === 'move') { // report removed item
291
- returnValue.removed = document;
292
- }
293
- return returnValue;
294
- }
295
- else if (operation.op === 'test') {
296
- returnValue.test = _areEquals(document, operation.value);
297
- if (returnValue.test === false) {
298
- throw new JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
299
- }
300
- returnValue.newDocument = document;
301
- return returnValue;
302
- }
303
- else if (operation.op === 'remove') { // a remove on root
304
- returnValue.removed = document;
305
- returnValue.newDocument = null;
306
- return returnValue;
307
- }
308
- else if (operation.op === '_get') {
309
- operation.value = document;
310
- return returnValue;
311
- }
312
- else { /* bad operation */
313
- if (validateOperation) {
314
- throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);
315
- }
316
- else {
317
- return returnValue;
318
- }
319
- }
320
- } /* END ROOT OPERATIONS */
321
- else {
322
- if (!mutateDocument) {
323
- document = _deepClone(document);
324
- }
325
- var path = operation.path || "";
326
- var keys = path.split('/');
327
- var obj = document;
328
- var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift
329
- var len = keys.length;
330
- var existingPathFragment = undefined;
331
- var key = void 0;
332
- var validateFunction = void 0;
333
- if (typeof validateOperation == 'function') {
334
- validateFunction = validateOperation;
335
- }
336
- else {
337
- validateFunction = validator;
338
- }
339
- while (true) {
340
- key = keys[t];
341
- if (key && key.indexOf('~') != -1) {
342
- key = unescapePathComponent(key);
343
- }
344
- if (banPrototypeModifications &&
345
- (key == '__proto__' ||
346
- (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {
347
- throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');
348
- }
349
- if (validateOperation) {
350
- if (existingPathFragment === undefined) {
351
- if (obj[key] === undefined) {
352
- existingPathFragment = keys.slice(0, t).join('/');
353
- }
354
- else if (t == len - 1) {
355
- existingPathFragment = operation.path;
356
- }
357
- if (existingPathFragment !== undefined) {
358
- validateFunction(operation, 0, document, existingPathFragment);
359
- }
360
- }
361
- }
362
- t++;
363
- if (Array.isArray(obj)) {
364
- if (key === '-') {
365
- key = obj.length;
366
- }
367
- else {
368
- if (validateOperation && !isInteger(key)) {
369
- throw new JsonPatchError("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index", "OPERATION_PATH_ILLEGAL_ARRAY_INDEX", index, operation, document);
370
- } // only parse key when it's an integer for `arr.prop` to work
371
- else if (isInteger(key)) {
372
- key = ~~key;
373
- }
374
- }
375
- if (t >= len) {
376
- if (validateOperation && operation.op === "add" && key > obj.length) {
377
- throw new JsonPatchError("The specified index MUST NOT be greater than the number of elements in the array", "OPERATION_VALUE_OUT_OF_BOUNDS", index, operation, document);
378
- }
379
- var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch
380
- if (returnValue.test === false) {
381
- throw new JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
382
- }
383
- return returnValue;
384
- }
385
- }
386
- else {
387
- if (t >= len) {
388
- var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch
389
- if (returnValue.test === false) {
390
- throw new JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
391
- }
392
- return returnValue;
393
- }
394
- }
395
- obj = obj[key];
396
- // If we have more keys in the path, but the next value isn't a non-null object,
397
- // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.
398
- if (validateOperation && t < len && (!obj || typeof obj !== "object")) {
399
- throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);
400
- }
401
- }
402
- }
403
- }
404
- /**
405
- * Apply a full JSON Patch array on a JSON document.
406
- * Returns the {newDocument, result} of the patch.
407
- * It modifies the `document` object and `patch` - it gets the values by reference.
408
- * If you would like to avoid touching your values, clone them:
409
- * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.
410
- *
411
- * @param document The document to patch
412
- * @param patch The patch to apply
413
- * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.
414
- * @param mutateDocument Whether to mutate the original document or clone it before applying
415
- * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.
416
- * @return An array of `{newDocument, result}` after the patch
417
- */
418
- function applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {
419
- if (mutateDocument === void 0) { mutateDocument = true; }
420
- if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }
421
- if (validateOperation) {
422
- if (!Array.isArray(patch)) {
423
- throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
424
- }
425
- }
426
- if (!mutateDocument) {
427
- document = _deepClone(document);
428
- }
429
- var results = new Array(patch.length);
430
- for (var i = 0, length_1 = patch.length; i < length_1; i++) {
431
- // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`
432
- results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);
433
- document = results[i].newDocument; // in case root was replaced
434
- }
435
- results.newDocument = document;
436
- return results;
437
- }
438
- /**
439
- * Apply a single JSON Patch Operation on a JSON document.
440
- * Returns the updated document.
441
- * Suitable as a reducer.
442
- *
443
- * @param document The document to patch
444
- * @param operation The operation to apply
445
- * @return The updated document
446
- */
447
- function applyReducer(document, operation, index) {
448
- var operationResult = applyOperation(document, operation);
449
- if (operationResult.test === false) { // failed test
450
- throw new JsonPatchError("Test operation failed", 'TEST_OPERATION_FAILED', index, operation, document);
451
- }
452
- return operationResult.newDocument;
453
- }
454
- /**
455
- * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.
456
- * @param {object} operation - operation object (patch)
457
- * @param {number} index - index of operation in the sequence
458
- * @param {object} [document] - object where the operation is supposed to be applied
459
- * @param {string} [existingPathFragment] - comes along with `document`
460
- */
461
- function validator(operation, index, document, existingPathFragment) {
462
- if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {
463
- throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);
464
- }
465
- else if (!objOps[operation.op]) {
466
- throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);
467
- }
468
- else if (typeof operation.path !== 'string') {
469
- throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);
470
- }
471
- else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {
472
- // paths that aren't empty string should start with "/"
473
- throw new JsonPatchError('Operation `path` property must start with "/"', 'OPERATION_PATH_INVALID', index, operation, document);
474
- }
475
- else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {
476
- throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);
477
- }
478
- else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {
479
- throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);
480
- }
481
- else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && hasUndefined(operation.value)) {
482
- throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);
483
- }
484
- else if (document) {
485
- if (operation.op == "add") {
486
- var pathLen = operation.path.split("/").length;
487
- var existingPathLen = existingPathFragment.split("/").length;
488
- if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {
489
- throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);
490
- }
491
- }
492
- else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {
493
- if (operation.path !== existingPathFragment) {
494
- throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);
495
- }
496
- }
497
- else if (operation.op === 'move' || operation.op === 'copy') {
498
- var existingValue = { op: "_get", path: operation.from, value: undefined };
499
- var error = validate([existingValue], document);
500
- if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {
501
- throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);
502
- }
503
- }
504
- }
505
- }
506
- /**
507
- * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.
508
- * If error is encountered, returns a JsonPatchError object
509
- * @param sequence
510
- * @param document
511
- * @returns {JsonPatchError|undefined}
512
- */
513
- function validate(sequence, document, externalValidator) {
514
- try {
515
- if (!Array.isArray(sequence)) {
516
- throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');
517
- }
518
- if (document) {
519
- //clone document and sequence so that we can safely try applying operations
520
- applyPatch(_deepClone(document), _deepClone(sequence), externalValidator || true);
521
- }
522
- else {
523
- externalValidator = externalValidator || validator;
524
- for (var i = 0; i < sequence.length; i++) {
525
- externalValidator(sequence[i], i, document, undefined);
526
- }
527
- }
528
- }
529
- catch (e) {
530
- if (e instanceof JsonPatchError) {
531
- return e;
532
- }
533
- else {
534
- throw e;
535
- }
536
- }
537
- }
538
- // based on https://github.com/epoberezkin/fast-deep-equal
539
- // MIT License
540
- // Copyright (c) 2017 Evgeny Poberezkin
541
- // Permission is hereby granted, free of charge, to any person obtaining a copy
542
- // of this software and associated documentation files (the "Software"), to deal
543
- // in the Software without restriction, including without limitation the rights
544
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
545
- // copies of the Software, and to permit persons to whom the Software is
546
- // furnished to do so, subject to the following conditions:
547
- // The above copyright notice and this permission notice shall be included in all
548
- // copies or substantial portions of the Software.
549
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
550
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
551
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
552
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
553
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
554
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
555
- // SOFTWARE.
556
- function _areEquals(a, b) {
557
- if (a === b)
558
- return true;
559
- if (a && b && typeof a == 'object' && typeof b == 'object') {
560
- var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;
561
- if (arrA && arrB) {
562
- length = a.length;
563
- if (length != b.length)
564
- return false;
565
- for (i = length; i-- !== 0;)
566
- if (!_areEquals(a[i], b[i]))
567
- return false;
568
- return true;
569
- }
570
- if (arrA != arrB)
571
- return false;
572
- var keys = Object.keys(a);
573
- length = keys.length;
574
- if (length !== Object.keys(b).length)
575
- return false;
576
- for (i = length; i-- !== 0;)
577
- if (!b.hasOwnProperty(keys[i]))
578
- return false;
579
- for (i = length; i-- !== 0;) {
580
- key = keys[i];
581
- if (!_areEquals(a[key], b[key]))
582
- return false;
583
- }
584
- return true;
585
- }
586
- return a !== a && b !== b;
587
- }
588
-
589
- var core = /*#__PURE__*/Object.freeze({
590
- __proto__: null,
591
- JsonPatchError: JsonPatchError,
592
- _areEquals: _areEquals,
593
- applyOperation: applyOperation,
594
- applyPatch: applyPatch,
595
- applyReducer: applyReducer,
596
- deepClone: deepClone,
597
- getValueByPointer: getValueByPointer,
598
- validate: validate,
599
- validator: validator
600
- });
601
-
602
- /*!
603
- * https://github.com/Starcounter-Jack/JSON-Patch
604
- * (c) 2017-2021 Joachim Wester
605
- * MIT license
606
- */
607
- var beforeDict = new WeakMap();
608
- var Mirror = /** @class */ (function () {
609
- function Mirror(obj) {
610
- this.observers = new Map();
611
- this.obj = obj;
612
- }
613
- return Mirror;
614
- }());
615
- var ObserverInfo = /** @class */ (function () {
616
- function ObserverInfo(callback, observer) {
617
- this.callback = callback;
618
- this.observer = observer;
619
- }
620
- return ObserverInfo;
621
- }());
622
- function getMirror(obj) {
623
- return beforeDict.get(obj);
624
- }
625
- function getObserverFromMirror(mirror, callback) {
626
- return mirror.observers.get(callback);
627
- }
628
- function removeObserverFromMirror(mirror, observer) {
629
- mirror.observers.delete(observer.callback);
630
- }
631
- /**
632
- * Detach an observer from an object
633
- */
634
- function unobserve(root, observer) {
635
- observer.unobserve();
636
- }
637
- /**
638
- * Observes changes made to an object, which can then be retrieved using generate
639
- */
640
- function observe(obj, callback) {
641
- var patches = [];
642
- var observer;
643
- var mirror = getMirror(obj);
644
- if (!mirror) {
645
- mirror = new Mirror(obj);
646
- beforeDict.set(obj, mirror);
647
- }
648
- else {
649
- var observerInfo = getObserverFromMirror(mirror, callback);
650
- observer = observerInfo && observerInfo.observer;
651
- }
652
- if (observer) {
653
- return observer;
654
- }
655
- observer = {};
656
- mirror.value = _deepClone(obj);
657
- if (callback) {
658
- observer.callback = callback;
659
- observer.next = null;
660
- var dirtyCheck = function () {
661
- generate(observer);
662
- };
663
- var fastCheck = function () {
664
- clearTimeout(observer.next);
665
- observer.next = setTimeout(dirtyCheck);
666
- };
667
- if (typeof window !== 'undefined') { //not Node
668
- window.addEventListener('mouseup', fastCheck);
669
- window.addEventListener('keyup', fastCheck);
670
- window.addEventListener('mousedown', fastCheck);
671
- window.addEventListener('keydown', fastCheck);
672
- window.addEventListener('change', fastCheck);
673
- }
674
- }
675
- observer.patches = patches;
676
- observer.object = obj;
677
- observer.unobserve = function () {
678
- generate(observer);
679
- clearTimeout(observer.next);
680
- removeObserverFromMirror(mirror, observer);
681
- if (typeof window !== 'undefined') {
682
- window.removeEventListener('mouseup', fastCheck);
683
- window.removeEventListener('keyup', fastCheck);
684
- window.removeEventListener('mousedown', fastCheck);
685
- window.removeEventListener('keydown', fastCheck);
686
- window.removeEventListener('change', fastCheck);
687
- }
688
- };
689
- mirror.observers.set(callback, new ObserverInfo(callback, observer));
690
- return observer;
691
- }
692
- /**
693
- * Generate an array of patches from an observer
694
- */
695
- function generate(observer, invertible) {
696
- if (invertible === void 0) { invertible = false; }
697
- var mirror = beforeDict.get(observer.object);
698
- _generate(mirror.value, observer.object, observer.patches, "", invertible);
699
- if (observer.patches.length) {
700
- applyPatch(mirror.value, observer.patches);
701
- }
702
- var temp = observer.patches;
703
- if (temp.length > 0) {
704
- observer.patches = [];
705
- if (observer.callback) {
706
- observer.callback(temp);
707
- }
708
- }
709
- return temp;
710
- }
711
- // Dirty check if obj is different from mirror, generate patches and update mirror
712
- function _generate(mirror, obj, patches, path, invertible) {
713
- if (obj === mirror) {
714
- return;
715
- }
716
- if (typeof obj.toJSON === "function") {
717
- obj = obj.toJSON();
718
- }
719
- var newKeys = _objectKeys(obj);
720
- var oldKeys = _objectKeys(mirror);
721
- var deleted = false;
722
- //if ever "move" operation is implemented here, make sure this test runs OK: "should not generate the same patch twice (move)"
723
- for (var t = oldKeys.length - 1; t >= 0; t--) {
724
- var key = oldKeys[t];
725
- var oldVal = mirror[key];
726
- if (hasOwnProperty(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {
727
- var newVal = obj[key];
728
- if (typeof oldVal == "object" && oldVal != null && typeof newVal == "object" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {
729
- _generate(oldVal, newVal, patches, path + "/" + escapePathComponent(key), invertible);
730
- }
731
- else {
732
- if (oldVal !== newVal) {
733
- if (invertible) {
734
- patches.push({ op: "test", path: path + "/" + escapePathComponent(key), value: _deepClone(oldVal) });
735
- }
736
- patches.push({ op: "replace", path: path + "/" + escapePathComponent(key), value: _deepClone(newVal) });
737
- }
738
- }
739
- }
740
- else if (Array.isArray(mirror) === Array.isArray(obj)) {
741
- if (invertible) {
742
- patches.push({ op: "test", path: path + "/" + escapePathComponent(key), value: _deepClone(oldVal) });
743
- }
744
- patches.push({ op: "remove", path: path + "/" + escapePathComponent(key) });
745
- deleted = true; // property has been deleted
746
- }
747
- else {
748
- if (invertible) {
749
- patches.push({ op: "test", path: path, value: mirror });
750
- }
751
- patches.push({ op: "replace", path: path, value: obj });
752
- }
753
- }
754
- if (!deleted && newKeys.length == oldKeys.length) {
755
- return;
756
- }
757
- for (var t = 0; t < newKeys.length; t++) {
758
- var key = newKeys[t];
759
- if (!hasOwnProperty(mirror, key) && obj[key] !== undefined) {
760
- patches.push({ op: "add", path: path + "/" + escapePathComponent(key), value: _deepClone(obj[key]) });
761
- }
762
- }
763
- }
764
- /**
765
- * Create an array of patches from the differences in two objects
766
- */
767
- function compare(tree1, tree2, invertible) {
768
- if (invertible === void 0) { invertible = false; }
769
- var patches = [];
770
- _generate(tree1, tree2, patches, '', invertible);
771
- return patches;
772
- }
773
-
774
- var duplex = /*#__PURE__*/Object.freeze({
775
- __proto__: null,
776
- compare: compare,
777
- generate: generate,
778
- observe: observe,
779
- unobserve: unobserve
780
- });
781
-
782
- Object.assign({}, core, duplex, {
783
- JsonPatchError: PatchError,
784
- deepClone: _deepClone,
785
- escapePathComponent,
786
- unescapePathComponent
787
- });
788
-
789
- function getDefaultExportFromCjs (x) {
790
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
791
- }
792
-
793
- var lrucache;
794
- var hasRequiredLrucache;
795
-
796
- function requireLrucache () {
797
- if (hasRequiredLrucache) return lrucache;
798
- hasRequiredLrucache = 1;
799
-
800
- class LRUCache {
801
- constructor () {
802
- this.max = 1000;
803
- this.map = new Map();
804
- }
805
-
806
- get (key) {
807
- const value = this.map.get(key);
808
- if (value === undefined) {
809
- return undefined
810
- } else {
811
- // Remove the key from the map and add it to the end
812
- this.map.delete(key);
813
- this.map.set(key, value);
814
- return value
815
- }
816
- }
817
-
818
- delete (key) {
819
- return this.map.delete(key)
820
- }
821
-
822
- set (key, value) {
823
- const deleted = this.delete(key);
824
-
825
- if (!deleted && value !== undefined) {
826
- // If cache is full, delete the least recently used item
827
- if (this.map.size >= this.max) {
828
- const firstKey = this.map.keys().next().value;
829
- this.delete(firstKey);
830
- }
831
-
832
- this.map.set(key, value);
833
- }
834
-
835
- return this
836
- }
837
- }
838
-
839
- lrucache = LRUCache;
840
- return lrucache;
841
- }
842
-
843
- var parseOptions_1;
844
- var hasRequiredParseOptions;
845
-
846
- function requireParseOptions () {
847
- if (hasRequiredParseOptions) return parseOptions_1;
848
- hasRequiredParseOptions = 1;
849
-
850
- // parse out just the options we care about
851
- const looseOption = Object.freeze({ loose: true });
852
- const emptyOpts = Object.freeze({ });
853
- const parseOptions = options => {
854
- if (!options) {
855
- return emptyOpts
856
- }
857
-
858
- if (typeof options !== 'object') {
859
- return looseOption
860
- }
861
-
862
- return options
863
- };
864
- parseOptions_1 = parseOptions;
865
- return parseOptions_1;
866
- }
867
-
868
- var re = {exports: {}};
869
-
870
- var constants;
871
- var hasRequiredConstants;
872
-
873
- function requireConstants () {
874
- if (hasRequiredConstants) return constants;
875
- hasRequiredConstants = 1;
876
-
877
- // Note: this is the semver.org version of the spec that it implements
878
- // Not necessarily the package version of this code.
879
- const SEMVER_SPEC_VERSION = '2.0.0';
880
-
881
- const MAX_LENGTH = 256;
882
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
883
- /* istanbul ignore next */ 9007199254740991;
884
-
885
- // Max safe segment length for coercion.
886
- const MAX_SAFE_COMPONENT_LENGTH = 16;
887
-
888
- // Max safe length for a build identifier. The max length minus 6 characters for
889
- // the shortest version with a build 0.0.0+BUILD.
890
- const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
891
-
892
- const RELEASE_TYPES = [
893
- 'major',
894
- 'premajor',
895
- 'minor',
896
- 'preminor',
897
- 'patch',
898
- 'prepatch',
899
- 'prerelease',
900
- ];
901
-
902
- constants = {
903
- MAX_LENGTH,
904
- MAX_SAFE_COMPONENT_LENGTH,
905
- MAX_SAFE_BUILD_LENGTH,
906
- MAX_SAFE_INTEGER,
907
- RELEASE_TYPES,
908
- SEMVER_SPEC_VERSION,
909
- FLAG_INCLUDE_PRERELEASE: 0b001,
910
- FLAG_LOOSE: 0b010,
911
- };
912
- return constants;
913
- }
914
-
915
- var debug_1;
916
- var hasRequiredDebug;
917
-
918
- function requireDebug () {
919
- if (hasRequiredDebug) return debug_1;
920
- hasRequiredDebug = 1;
921
-
922
- const debug = (
923
- typeof process === 'object' &&
924
- process.env &&
925
- process.env.NODE_DEBUG &&
926
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
927
- ) ? (...args) => console.error('SEMVER', ...args)
928
- : () => {};
929
-
930
- debug_1 = debug;
931
- return debug_1;
932
- }
933
-
934
- var hasRequiredRe;
935
-
936
- function requireRe () {
937
- if (hasRequiredRe) return re.exports;
938
- hasRequiredRe = 1;
939
- (function (module, exports) {
940
-
941
- const {
942
- MAX_SAFE_COMPONENT_LENGTH,
943
- MAX_SAFE_BUILD_LENGTH,
944
- MAX_LENGTH,
945
- } = requireConstants();
946
- const debug = requireDebug();
947
- exports = module.exports = {};
948
-
949
- // The actual regexps go on exports.re
950
- const re = exports.re = [];
951
- const safeRe = exports.safeRe = [];
952
- const src = exports.src = [];
953
- const safeSrc = exports.safeSrc = [];
954
- const t = exports.t = {};
955
- let R = 0;
956
-
957
- const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
958
-
959
- // Replace some greedy regex tokens to prevent regex dos issues. These regex are
960
- // used internally via the safeRe object since all inputs in this library get
961
- // normalized first to trim and collapse all extra whitespace. The original
962
- // regexes are exported for userland consumption and lower level usage. A
963
- // future breaking change could export the safer regex only with a note that
964
- // all input should have extra whitespace removed.
965
- const safeRegexReplacements = [
966
- ['\\s', 1],
967
- ['\\d', MAX_LENGTH],
968
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
969
- ];
970
-
971
- const makeSafeRegex = (value) => {
972
- for (const [token, max] of safeRegexReplacements) {
973
- value = value
974
- .split(`${token}*`).join(`${token}{0,${max}}`)
975
- .split(`${token}+`).join(`${token}{1,${max}}`);
976
- }
977
- return value
978
- };
979
-
980
- const createToken = (name, value, isGlobal) => {
981
- const safe = makeSafeRegex(value);
982
- const index = R++;
983
- debug(name, index, value);
984
- t[name] = index;
985
- src[index] = value;
986
- safeSrc[index] = safe;
987
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
988
- safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
989
- };
990
-
991
- // The following Regular Expressions can be used for tokenizing,
992
- // validating, and parsing SemVer version strings.
993
-
994
- // ## Numeric Identifier
995
- // A single `0`, or a non-zero digit followed by zero or more digits.
996
-
997
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
998
- createToken('NUMERICIDENTIFIERLOOSE', '\\d+');
999
-
1000
- // ## Non-numeric Identifier
1001
- // Zero or more digits, followed by a letter or hyphen, and then zero or
1002
- // more letters, digits, or hyphens.
1003
-
1004
- createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
1005
-
1006
- // ## Main Version
1007
- // Three dot-separated numeric identifiers.
1008
-
1009
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
1010
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
1011
- `(${src[t.NUMERICIDENTIFIER]})`);
1012
-
1013
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
1014
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
1015
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
1016
-
1017
- // ## Pre-release Version Identifier
1018
- // A numeric identifier, or a non-numeric identifier.
1019
- // Non-numberic identifiers include numberic identifiers but can be longer.
1020
- // Therefore non-numberic identifiers must go first.
1021
-
1022
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
1023
- }|${src[t.NUMERICIDENTIFIER]})`);
1024
-
1025
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
1026
- }|${src[t.NUMERICIDENTIFIERLOOSE]})`);
1027
-
1028
- // ## Pre-release Version
1029
- // Hyphen, followed by one or more dot-separated pre-release version
1030
- // identifiers.
1031
-
1032
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
1033
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
1034
-
1035
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
1036
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1037
-
1038
- // ## Build Metadata Identifier
1039
- // Any combination of digits, letters, or hyphens.
1040
-
1041
- createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`);
1042
-
1043
- // ## Build Metadata
1044
- // Plus sign, followed by one or more period-separated build metadata
1045
- // identifiers.
1046
-
1047
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
1048
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
1049
-
1050
- // ## Full Version String
1051
- // A main version, followed optionally by a pre-release version and
1052
- // build metadata.
1053
-
1054
- // Note that the only major, minor, patch, and pre-release sections of
1055
- // the version string are capturing groups. The build metadata is not a
1056
- // capturing group, because it should not ever be used in version
1057
- // comparison.
1058
-
1059
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
1060
- }${src[t.PRERELEASE]}?${
1061
- src[t.BUILD]}?`);
1062
-
1063
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
1064
-
1065
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
1066
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
1067
- // common in the npm registry.
1068
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
1069
- }${src[t.PRERELEASELOOSE]}?${
1070
- src[t.BUILD]}?`);
1071
-
1072
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
1073
-
1074
- createToken('GTLT', '((?:<|>)?=?)');
1075
-
1076
- // Something like "2.*" or "1.2.x".
1077
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
1078
- // Only the first item is strictly required.
1079
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1080
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1081
-
1082
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
1083
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
1084
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
1085
- `(?:${src[t.PRERELEASE]})?${
1086
- src[t.BUILD]}?` +
1087
- `)?)?`);
1088
-
1089
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1090
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1091
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
1092
- `(?:${src[t.PRERELEASELOOSE]})?${
1093
- src[t.BUILD]}?` +
1094
- `)?)?`);
1095
-
1096
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
1097
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
1098
-
1099
- // Coercion.
1100
- // Extract anything that could conceivably be a part of a valid semver
1101
- createToken('COERCEPLAIN', `${'(^|[^\\d])' +
1102
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
1103
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
1104
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
1105
- createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
1106
- createToken('COERCEFULL', src[t.COERCEPLAIN] +
1107
- `(?:${src[t.PRERELEASE]})?` +
1108
- `(?:${src[t.BUILD]})?` +
1109
- `(?:$|[^\\d])`);
1110
- createToken('COERCERTL', src[t.COERCE], true);
1111
- createToken('COERCERTLFULL', src[t.COERCEFULL], true);
1112
-
1113
- // Tilde ranges.
1114
- // Meaning is "reasonably at or greater than"
1115
- createToken('LONETILDE', '(?:~>?)');
1116
-
1117
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1118
- exports.tildeTrimReplace = '$1~';
1119
-
1120
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1121
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1122
-
1123
- // Caret ranges.
1124
- // Meaning is "at least and backwards compatible with"
1125
- createToken('LONECARET', '(?:\\^)');
1126
-
1127
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
1128
- exports.caretTrimReplace = '$1^';
1129
-
1130
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1131
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1132
-
1133
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
1134
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1135
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1136
-
1137
- // An expression to strip any whitespace between the gtlt and the thing
1138
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
1139
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
1140
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1141
- exports.comparatorTrimReplace = '$1$2$3';
1142
-
1143
- // Something like `1.2.3 - 1.2.4`
1144
- // Note that these all use the loose form, because they'll be
1145
- // checked against either the strict or loose comparator form
1146
- // later.
1147
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
1148
- `\\s+-\\s+` +
1149
- `(${src[t.XRANGEPLAIN]})` +
1150
- `\\s*$`);
1151
-
1152
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
1153
- `\\s+-\\s+` +
1154
- `(${src[t.XRANGEPLAINLOOSE]})` +
1155
- `\\s*$`);
1156
-
1157
- // Star ranges basically just allow anything at all.
1158
- createToken('STAR', '(<|>)?=?\\s*\\*');
1159
- // >=0.0.0 is like a star
1160
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
1161
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
1162
- } (re, re.exports));
1163
- return re.exports;
1164
- }
1165
-
1166
- var identifiers;
1167
- var hasRequiredIdentifiers;
1168
-
1169
- function requireIdentifiers () {
1170
- if (hasRequiredIdentifiers) return identifiers;
1171
- hasRequiredIdentifiers = 1;
1172
-
1173
- const numeric = /^[0-9]+$/;
1174
- const compareIdentifiers = (a, b) => {
1175
- const anum = numeric.test(a);
1176
- const bnum = numeric.test(b);
1177
-
1178
- if (anum && bnum) {
1179
- a = +a;
1180
- b = +b;
1181
- }
1182
-
1183
- return a === b ? 0
1184
- : (anum && !bnum) ? -1
1185
- : (bnum && !anum) ? 1
1186
- : a < b ? -1
1187
- : 1
1188
- };
1189
-
1190
- const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
1191
-
1192
- identifiers = {
1193
- compareIdentifiers,
1194
- rcompareIdentifiers,
1195
- };
1196
- return identifiers;
1197
- }
1198
-
1199
- var semver;
1200
- var hasRequiredSemver;
1201
-
1202
- function requireSemver () {
1203
- if (hasRequiredSemver) return semver;
1204
- hasRequiredSemver = 1;
1205
-
1206
- const debug = requireDebug();
1207
- const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();
1208
- const { safeRe: re, t } = requireRe();
1209
-
1210
- const parseOptions = requireParseOptions();
1211
- const { compareIdentifiers } = requireIdentifiers();
1212
- class SemVer {
1213
- constructor (version, options) {
1214
- options = parseOptions(options);
1215
-
1216
- if (version instanceof SemVer) {
1217
- if (version.loose === !!options.loose &&
1218
- version.includePrerelease === !!options.includePrerelease) {
1219
- return version
1220
- } else {
1221
- version = version.version;
1222
- }
1223
- } else if (typeof version !== 'string') {
1224
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
1225
- }
1226
-
1227
- if (version.length > MAX_LENGTH) {
1228
- throw new TypeError(
1229
- `version is longer than ${MAX_LENGTH} characters`
1230
- )
1231
- }
1232
-
1233
- debug('SemVer', version, options);
1234
- this.options = options;
1235
- this.loose = !!options.loose;
1236
- // this isn't actually relevant for versions, but keep it so that we
1237
- // don't run into trouble passing this.options around.
1238
- this.includePrerelease = !!options.includePrerelease;
1239
-
1240
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
1241
-
1242
- if (!m) {
1243
- throw new TypeError(`Invalid Version: ${version}`)
1244
- }
1245
-
1246
- this.raw = version;
1247
-
1248
- // these are actually numbers
1249
- this.major = +m[1];
1250
- this.minor = +m[2];
1251
- this.patch = +m[3];
1252
-
1253
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
1254
- throw new TypeError('Invalid major version')
1255
- }
1256
-
1257
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
1258
- throw new TypeError('Invalid minor version')
1259
- }
1260
-
1261
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
1262
- throw new TypeError('Invalid patch version')
1263
- }
1264
-
1265
- // numberify any prerelease numeric ids
1266
- if (!m[4]) {
1267
- this.prerelease = [];
1268
- } else {
1269
- this.prerelease = m[4].split('.').map((id) => {
1270
- if (/^[0-9]+$/.test(id)) {
1271
- const num = +id;
1272
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
1273
- return num
1274
- }
1275
- }
1276
- return id
1277
- });
1278
- }
1279
-
1280
- this.build = m[5] ? m[5].split('.') : [];
1281
- this.format();
1282
- }
1283
-
1284
- format () {
1285
- this.version = `${this.major}.${this.minor}.${this.patch}`;
1286
- if (this.prerelease.length) {
1287
- this.version += `-${this.prerelease.join('.')}`;
1288
- }
1289
- return this.version
1290
- }
1291
-
1292
- toString () {
1293
- return this.version
1294
- }
1295
-
1296
- compare (other) {
1297
- debug('SemVer.compare', this.version, this.options, other);
1298
- if (!(other instanceof SemVer)) {
1299
- if (typeof other === 'string' && other === this.version) {
1300
- return 0
1301
- }
1302
- other = new SemVer(other, this.options);
1303
- }
1304
-
1305
- if (other.version === this.version) {
1306
- return 0
1307
- }
1308
-
1309
- return this.compareMain(other) || this.comparePre(other)
1310
- }
1311
-
1312
- compareMain (other) {
1313
- if (!(other instanceof SemVer)) {
1314
- other = new SemVer(other, this.options);
1315
- }
1316
-
1317
- return (
1318
- compareIdentifiers(this.major, other.major) ||
1319
- compareIdentifiers(this.minor, other.minor) ||
1320
- compareIdentifiers(this.patch, other.patch)
1321
- )
1322
- }
1323
-
1324
- comparePre (other) {
1325
- if (!(other instanceof SemVer)) {
1326
- other = new SemVer(other, this.options);
1327
- }
1328
-
1329
- // NOT having a prerelease is > having one
1330
- if (this.prerelease.length && !other.prerelease.length) {
1331
- return -1
1332
- } else if (!this.prerelease.length && other.prerelease.length) {
1333
- return 1
1334
- } else if (!this.prerelease.length && !other.prerelease.length) {
1335
- return 0
1336
- }
1337
-
1338
- let i = 0;
1339
- do {
1340
- const a = this.prerelease[i];
1341
- const b = other.prerelease[i];
1342
- debug('prerelease compare', i, a, b);
1343
- if (a === undefined && b === undefined) {
1344
- return 0
1345
- } else if (b === undefined) {
1346
- return 1
1347
- } else if (a === undefined) {
1348
- return -1
1349
- } else if (a === b) {
1350
- continue
1351
- } else {
1352
- return compareIdentifiers(a, b)
1353
- }
1354
- } while (++i)
1355
- }
1356
-
1357
- compareBuild (other) {
1358
- if (!(other instanceof SemVer)) {
1359
- other = new SemVer(other, this.options);
1360
- }
1361
-
1362
- let i = 0;
1363
- do {
1364
- const a = this.build[i];
1365
- const b = other.build[i];
1366
- debug('build compare', i, a, b);
1367
- if (a === undefined && b === undefined) {
1368
- return 0
1369
- } else if (b === undefined) {
1370
- return 1
1371
- } else if (a === undefined) {
1372
- return -1
1373
- } else if (a === b) {
1374
- continue
1375
- } else {
1376
- return compareIdentifiers(a, b)
1377
- }
1378
- } while (++i)
1379
- }
1380
-
1381
- // preminor will bump the version up to the next minor release, and immediately
1382
- // down to pre-release. premajor and prepatch work the same way.
1383
- inc (release, identifier, identifierBase) {
1384
- if (release.startsWith('pre')) {
1385
- if (!identifier && identifierBase === false) {
1386
- throw new Error('invalid increment argument: identifier is empty')
1387
- }
1388
- // Avoid an invalid semver results
1389
- if (identifier) {
1390
- const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
1391
- if (!match || match[1] !== identifier) {
1392
- throw new Error(`invalid identifier: ${identifier}`)
1393
- }
1394
- }
1395
- }
1396
-
1397
- switch (release) {
1398
- case 'premajor':
1399
- this.prerelease.length = 0;
1400
- this.patch = 0;
1401
- this.minor = 0;
1402
- this.major++;
1403
- this.inc('pre', identifier, identifierBase);
1404
- break
1405
- case 'preminor':
1406
- this.prerelease.length = 0;
1407
- this.patch = 0;
1408
- this.minor++;
1409
- this.inc('pre', identifier, identifierBase);
1410
- break
1411
- case 'prepatch':
1412
- // If this is already a prerelease, it will bump to the next version
1413
- // drop any prereleases that might already exist, since they are not
1414
- // relevant at this point.
1415
- this.prerelease.length = 0;
1416
- this.inc('patch', identifier, identifierBase);
1417
- this.inc('pre', identifier, identifierBase);
1418
- break
1419
- // If the input is a non-prerelease version, this acts the same as
1420
- // prepatch.
1421
- case 'prerelease':
1422
- if (this.prerelease.length === 0) {
1423
- this.inc('patch', identifier, identifierBase);
1424
- }
1425
- this.inc('pre', identifier, identifierBase);
1426
- break
1427
- case 'release':
1428
- if (this.prerelease.length === 0) {
1429
- throw new Error(`version ${this.raw} is not a prerelease`)
1430
- }
1431
- this.prerelease.length = 0;
1432
- break
1433
-
1434
- case 'major':
1435
- // If this is a pre-major version, bump up to the same major version.
1436
- // Otherwise increment major.
1437
- // 1.0.0-5 bumps to 1.0.0
1438
- // 1.1.0 bumps to 2.0.0
1439
- if (
1440
- this.minor !== 0 ||
1441
- this.patch !== 0 ||
1442
- this.prerelease.length === 0
1443
- ) {
1444
- this.major++;
1445
- }
1446
- this.minor = 0;
1447
- this.patch = 0;
1448
- this.prerelease = [];
1449
- break
1450
- case 'minor':
1451
- // If this is a pre-minor version, bump up to the same minor version.
1452
- // Otherwise increment minor.
1453
- // 1.2.0-5 bumps to 1.2.0
1454
- // 1.2.1 bumps to 1.3.0
1455
- if (this.patch !== 0 || this.prerelease.length === 0) {
1456
- this.minor++;
1457
- }
1458
- this.patch = 0;
1459
- this.prerelease = [];
1460
- break
1461
- case 'patch':
1462
- // If this is not a pre-release version, it will increment the patch.
1463
- // If it is a pre-release it will bump up to the same patch version.
1464
- // 1.2.0-5 patches to 1.2.0
1465
- // 1.2.0 patches to 1.2.1
1466
- if (this.prerelease.length === 0) {
1467
- this.patch++;
1468
- }
1469
- this.prerelease = [];
1470
- break
1471
- // This probably shouldn't be used publicly.
1472
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
1473
- case 'pre': {
1474
- const base = Number(identifierBase) ? 1 : 0;
1475
-
1476
- if (this.prerelease.length === 0) {
1477
- this.prerelease = [base];
1478
- } else {
1479
- let i = this.prerelease.length;
1480
- while (--i >= 0) {
1481
- if (typeof this.prerelease[i] === 'number') {
1482
- this.prerelease[i]++;
1483
- i = -2;
1484
- }
1485
- }
1486
- if (i === -1) {
1487
- // didn't increment anything
1488
- if (identifier === this.prerelease.join('.') && identifierBase === false) {
1489
- throw new Error('invalid increment argument: identifier already exists')
1490
- }
1491
- this.prerelease.push(base);
1492
- }
1493
- }
1494
- if (identifier) {
1495
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
1496
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
1497
- let prerelease = [identifier, base];
1498
- if (identifierBase === false) {
1499
- prerelease = [identifier];
1500
- }
1501
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
1502
- if (isNaN(this.prerelease[1])) {
1503
- this.prerelease = prerelease;
1504
- }
1505
- } else {
1506
- this.prerelease = prerelease;
1507
- }
1508
- }
1509
- break
1510
- }
1511
- default:
1512
- throw new Error(`invalid increment argument: ${release}`)
1513
- }
1514
- this.raw = this.format();
1515
- if (this.build.length) {
1516
- this.raw += `+${this.build.join('.')}`;
1517
- }
1518
- return this
1519
- }
1520
- }
1521
-
1522
- semver = SemVer;
1523
- return semver;
1524
- }
1525
-
1526
- var compare_1;
1527
- var hasRequiredCompare;
1528
-
1529
- function requireCompare () {
1530
- if (hasRequiredCompare) return compare_1;
1531
- hasRequiredCompare = 1;
1532
-
1533
- const SemVer = requireSemver();
1534
- const compare = (a, b, loose) =>
1535
- new SemVer(a, loose).compare(new SemVer(b, loose));
1536
-
1537
- compare_1 = compare;
1538
- return compare_1;
1539
- }
1540
-
1541
- var eq_1;
1542
- var hasRequiredEq;
1543
-
1544
- function requireEq () {
1545
- if (hasRequiredEq) return eq_1;
1546
- hasRequiredEq = 1;
1547
-
1548
- const compare = requireCompare();
1549
- const eq = (a, b, loose) => compare(a, b, loose) === 0;
1550
- eq_1 = eq;
1551
- return eq_1;
1552
- }
1553
-
1554
- var neq_1;
1555
- var hasRequiredNeq;
1556
-
1557
- function requireNeq () {
1558
- if (hasRequiredNeq) return neq_1;
1559
- hasRequiredNeq = 1;
1560
-
1561
- const compare = requireCompare();
1562
- const neq = (a, b, loose) => compare(a, b, loose) !== 0;
1563
- neq_1 = neq;
1564
- return neq_1;
1565
- }
1566
-
1567
- var gt_1;
1568
- var hasRequiredGt;
1569
-
1570
- function requireGt () {
1571
- if (hasRequiredGt) return gt_1;
1572
- hasRequiredGt = 1;
1573
-
1574
- const compare = requireCompare();
1575
- const gt = (a, b, loose) => compare(a, b, loose) > 0;
1576
- gt_1 = gt;
1577
- return gt_1;
1578
- }
1579
-
1580
- var gte_1;
1581
- var hasRequiredGte;
1582
-
1583
- function requireGte () {
1584
- if (hasRequiredGte) return gte_1;
1585
- hasRequiredGte = 1;
1586
-
1587
- const compare = requireCompare();
1588
- const gte = (a, b, loose) => compare(a, b, loose) >= 0;
1589
- gte_1 = gte;
1590
- return gte_1;
1591
- }
1592
-
1593
- var lt_1;
1594
- var hasRequiredLt;
1595
-
1596
- function requireLt () {
1597
- if (hasRequiredLt) return lt_1;
1598
- hasRequiredLt = 1;
1599
-
1600
- const compare = requireCompare();
1601
- const lt = (a, b, loose) => compare(a, b, loose) < 0;
1602
- lt_1 = lt;
1603
- return lt_1;
1604
- }
1605
-
1606
- var lte_1;
1607
- var hasRequiredLte;
1608
-
1609
- function requireLte () {
1610
- if (hasRequiredLte) return lte_1;
1611
- hasRequiredLte = 1;
1612
-
1613
- const compare = requireCompare();
1614
- const lte = (a, b, loose) => compare(a, b, loose) <= 0;
1615
- lte_1 = lte;
1616
- return lte_1;
1617
- }
1618
-
1619
- var cmp_1;
1620
- var hasRequiredCmp;
1621
-
1622
- function requireCmp () {
1623
- if (hasRequiredCmp) return cmp_1;
1624
- hasRequiredCmp = 1;
1625
-
1626
- const eq = requireEq();
1627
- const neq = requireNeq();
1628
- const gt = requireGt();
1629
- const gte = requireGte();
1630
- const lt = requireLt();
1631
- const lte = requireLte();
1632
-
1633
- const cmp = (a, op, b, loose) => {
1634
- switch (op) {
1635
- case '===':
1636
- if (typeof a === 'object') {
1637
- a = a.version;
1638
- }
1639
- if (typeof b === 'object') {
1640
- b = b.version;
1641
- }
1642
- return a === b
1643
-
1644
- case '!==':
1645
- if (typeof a === 'object') {
1646
- a = a.version;
1647
- }
1648
- if (typeof b === 'object') {
1649
- b = b.version;
1650
- }
1651
- return a !== b
1652
-
1653
- case '':
1654
- case '=':
1655
- case '==':
1656
- return eq(a, b, loose)
1657
-
1658
- case '!=':
1659
- return neq(a, b, loose)
1660
-
1661
- case '>':
1662
- return gt(a, b, loose)
1663
-
1664
- case '>=':
1665
- return gte(a, b, loose)
1666
-
1667
- case '<':
1668
- return lt(a, b, loose)
1669
-
1670
- case '<=':
1671
- return lte(a, b, loose)
1672
-
1673
- default:
1674
- throw new TypeError(`Invalid operator: ${op}`)
1675
- }
1676
- };
1677
- cmp_1 = cmp;
1678
- return cmp_1;
1679
- }
1680
-
1681
- var comparator;
1682
- var hasRequiredComparator;
1683
-
1684
- function requireComparator () {
1685
- if (hasRequiredComparator) return comparator;
1686
- hasRequiredComparator = 1;
1687
-
1688
- const ANY = Symbol('SemVer ANY');
1689
- // hoisted class for cyclic dependency
1690
- class Comparator {
1691
- static get ANY () {
1692
- return ANY
1693
- }
1694
-
1695
- constructor (comp, options) {
1696
- options = parseOptions(options);
1697
-
1698
- if (comp instanceof Comparator) {
1699
- if (comp.loose === !!options.loose) {
1700
- return comp
1701
- } else {
1702
- comp = comp.value;
1703
- }
1704
- }
1705
-
1706
- comp = comp.trim().split(/\s+/).join(' ');
1707
- debug('comparator', comp, options);
1708
- this.options = options;
1709
- this.loose = !!options.loose;
1710
- this.parse(comp);
1711
-
1712
- if (this.semver === ANY) {
1713
- this.value = '';
1714
- } else {
1715
- this.value = this.operator + this.semver.version;
1716
- }
1717
-
1718
- debug('comp', this);
1719
- }
1720
-
1721
- parse (comp) {
1722
- const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
1723
- const m = comp.match(r);
1724
-
1725
- if (!m) {
1726
- throw new TypeError(`Invalid comparator: ${comp}`)
1727
- }
1728
-
1729
- this.operator = m[1] !== undefined ? m[1] : '';
1730
- if (this.operator === '=') {
1731
- this.operator = '';
1732
- }
1733
-
1734
- // if it literally is just '>' or '' then allow anything.
1735
- if (!m[2]) {
1736
- this.semver = ANY;
1737
- } else {
1738
- this.semver = new SemVer(m[2], this.options.loose);
1739
- }
1740
- }
1741
-
1742
- toString () {
1743
- return this.value
1744
- }
1745
-
1746
- test (version) {
1747
- debug('Comparator.test', version, this.options.loose);
1748
-
1749
- if (this.semver === ANY || version === ANY) {
1750
- return true
1751
- }
1752
-
1753
- if (typeof version === 'string') {
1754
- try {
1755
- version = new SemVer(version, this.options);
1756
- } catch (er) {
1757
- return false
1758
- }
1759
- }
1760
-
1761
- return cmp(version, this.operator, this.semver, this.options)
1762
- }
1763
-
1764
- intersects (comp, options) {
1765
- if (!(comp instanceof Comparator)) {
1766
- throw new TypeError('a Comparator is required')
1767
- }
1768
-
1769
- if (this.operator === '') {
1770
- if (this.value === '') {
1771
- return true
1772
- }
1773
- return new Range(comp.value, options).test(this.value)
1774
- } else if (comp.operator === '') {
1775
- if (comp.value === '') {
1776
- return true
1777
- }
1778
- return new Range(this.value, options).test(comp.semver)
1779
- }
1780
-
1781
- options = parseOptions(options);
1782
-
1783
- // Special cases where nothing can possibly be lower
1784
- if (options.includePrerelease &&
1785
- (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
1786
- return false
1787
- }
1788
- if (!options.includePrerelease &&
1789
- (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
1790
- return false
1791
- }
1792
-
1793
- // Same direction increasing (> or >=)
1794
- if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
1795
- return true
1796
- }
1797
- // Same direction decreasing (< or <=)
1798
- if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
1799
- return true
1800
- }
1801
- // same SemVer and both sides are inclusive (<= or >=)
1802
- if (
1803
- (this.semver.version === comp.semver.version) &&
1804
- this.operator.includes('=') && comp.operator.includes('=')) {
1805
- return true
1806
- }
1807
- // opposite directions less than
1808
- if (cmp(this.semver, '<', comp.semver, options) &&
1809
- this.operator.startsWith('>') && comp.operator.startsWith('<')) {
1810
- return true
1811
- }
1812
- // opposite directions greater than
1813
- if (cmp(this.semver, '>', comp.semver, options) &&
1814
- this.operator.startsWith('<') && comp.operator.startsWith('>')) {
1815
- return true
1816
- }
1817
- return false
1818
- }
1819
- }
1820
-
1821
- comparator = Comparator;
1822
-
1823
- const parseOptions = requireParseOptions();
1824
- const { safeRe: re, t } = requireRe();
1825
- const cmp = requireCmp();
1826
- const debug = requireDebug();
1827
- const SemVer = requireSemver();
1828
- const Range = requireRange();
1829
- return comparator;
1830
- }
1831
-
1832
- var range;
1833
- var hasRequiredRange;
1834
-
1835
- function requireRange () {
1836
- if (hasRequiredRange) return range;
1837
- hasRequiredRange = 1;
1838
-
1839
- const SPACE_CHARACTERS = /\s+/g;
1840
-
1841
- // hoisted class for cyclic dependency
1842
- class Range {
1843
- constructor (range, options) {
1844
- options = parseOptions(options);
1845
-
1846
- if (range instanceof Range) {
1847
- if (
1848
- range.loose === !!options.loose &&
1849
- range.includePrerelease === !!options.includePrerelease
1850
- ) {
1851
- return range
1852
- } else {
1853
- return new Range(range.raw, options)
1854
- }
1855
- }
1856
-
1857
- if (range instanceof Comparator) {
1858
- // just put it in the set and return
1859
- this.raw = range.value;
1860
- this.set = [[range]];
1861
- this.formatted = undefined;
1862
- return this
1863
- }
1864
-
1865
- this.options = options;
1866
- this.loose = !!options.loose;
1867
- this.includePrerelease = !!options.includePrerelease;
1868
-
1869
- // First reduce all whitespace as much as possible so we do not have to rely
1870
- // on potentially slow regexes like \s*. This is then stored and used for
1871
- // future error messages as well.
1872
- this.raw = range.trim().replace(SPACE_CHARACTERS, ' ');
1873
-
1874
- // First, split on ||
1875
- this.set = this.raw
1876
- .split('||')
1877
- // map the range to a 2d array of comparators
1878
- .map(r => this.parseRange(r.trim()))
1879
- // throw out any comparator lists that are empty
1880
- // this generally means that it was not a valid range, which is allowed
1881
- // in loose mode, but will still throw if the WHOLE range is invalid.
1882
- .filter(c => c.length);
1883
-
1884
- if (!this.set.length) {
1885
- throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
1886
- }
1887
-
1888
- // if we have any that are not the null set, throw out null sets.
1889
- if (this.set.length > 1) {
1890
- // keep the first one, in case they're all null sets
1891
- const first = this.set[0];
1892
- this.set = this.set.filter(c => !isNullSet(c[0]));
1893
- if (this.set.length === 0) {
1894
- this.set = [first];
1895
- } else if (this.set.length > 1) {
1896
- // if we have any that are *, then the range is just *
1897
- for (const c of this.set) {
1898
- if (c.length === 1 && isAny(c[0])) {
1899
- this.set = [c];
1900
- break
1901
- }
1902
- }
1903
- }
1904
- }
1905
-
1906
- this.formatted = undefined;
1907
- }
1908
-
1909
- get range () {
1910
- if (this.formatted === undefined) {
1911
- this.formatted = '';
1912
- for (let i = 0; i < this.set.length; i++) {
1913
- if (i > 0) {
1914
- this.formatted += '||';
1915
- }
1916
- const comps = this.set[i];
1917
- for (let k = 0; k < comps.length; k++) {
1918
- if (k > 0) {
1919
- this.formatted += ' ';
1920
- }
1921
- this.formatted += comps[k].toString().trim();
1922
- }
1923
- }
1924
- }
1925
- return this.formatted
1926
- }
1927
-
1928
- format () {
1929
- return this.range
1930
- }
1931
-
1932
- toString () {
1933
- return this.range
1934
- }
1935
-
1936
- parseRange (range) {
1937
- // memoize range parsing for performance.
1938
- // this is a very hot path, and fully deterministic.
1939
- const memoOpts =
1940
- (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
1941
- (this.options.loose && FLAG_LOOSE);
1942
- const memoKey = memoOpts + ':' + range;
1943
- const cached = cache.get(memoKey);
1944
- if (cached) {
1945
- return cached
1946
- }
1947
-
1948
- const loose = this.options.loose;
1949
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
1950
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1951
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1952
- debug('hyphen replace', range);
1953
-
1954
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
1955
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1956
- debug('comparator trim', range);
1957
-
1958
- // `~ 1.2.3` => `~1.2.3`
1959
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1960
- debug('tilde trim', range);
1961
-
1962
- // `^ 1.2.3` => `^1.2.3`
1963
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1964
- debug('caret trim', range);
1965
-
1966
- // At this point, the range is completely trimmed and
1967
- // ready to be split into comparators.
1968
-
1969
- let rangeList = range
1970
- .split(' ')
1971
- .map(comp => parseComparator(comp, this.options))
1972
- .join(' ')
1973
- .split(/\s+/)
1974
- // >=0.0.0 is equivalent to *
1975
- .map(comp => replaceGTE0(comp, this.options));
1976
-
1977
- if (loose) {
1978
- // in loose mode, throw out any that are not valid comparators
1979
- rangeList = rangeList.filter(comp => {
1980
- debug('loose invalid filter', comp, this.options);
1981
- return !!comp.match(re[t.COMPARATORLOOSE])
1982
- });
1983
- }
1984
- debug('range list', rangeList);
1985
-
1986
- // if any comparators are the null set, then replace with JUST null set
1987
- // if more than one comparator, remove any * comparators
1988
- // also, don't include the same comparator more than once
1989
- const rangeMap = new Map();
1990
- const comparators = rangeList.map(comp => new Comparator(comp, this.options));
1991
- for (const comp of comparators) {
1992
- if (isNullSet(comp)) {
1993
- return [comp]
1994
- }
1995
- rangeMap.set(comp.value, comp);
1996
- }
1997
- if (rangeMap.size > 1 && rangeMap.has('')) {
1998
- rangeMap.delete('');
1999
- }
2000
-
2001
- const result = [...rangeMap.values()];
2002
- cache.set(memoKey, result);
2003
- return result
2004
- }
2005
-
2006
- intersects (range, options) {
2007
- if (!(range instanceof Range)) {
2008
- throw new TypeError('a Range is required')
2009
- }
2010
-
2011
- return this.set.some((thisComparators) => {
2012
- return (
2013
- isSatisfiable(thisComparators, options) &&
2014
- range.set.some((rangeComparators) => {
2015
- return (
2016
- isSatisfiable(rangeComparators, options) &&
2017
- thisComparators.every((thisComparator) => {
2018
- return rangeComparators.every((rangeComparator) => {
2019
- return thisComparator.intersects(rangeComparator, options)
2020
- })
2021
- })
2022
- )
2023
- })
2024
- )
2025
- })
2026
- }
2027
-
2028
- // if ANY of the sets match ALL of its comparators, then pass
2029
- test (version) {
2030
- if (!version) {
2031
- return false
2032
- }
2033
-
2034
- if (typeof version === 'string') {
2035
- try {
2036
- version = new SemVer(version, this.options);
2037
- } catch (er) {
2038
- return false
2039
- }
2040
- }
2041
-
2042
- for (let i = 0; i < this.set.length; i++) {
2043
- if (testSet(this.set[i], version, this.options)) {
2044
- return true
2045
- }
2046
- }
2047
- return false
2048
- }
2049
- }
2050
-
2051
- range = Range;
2052
-
2053
- const LRU = requireLrucache();
2054
- const cache = new LRU();
2055
-
2056
- const parseOptions = requireParseOptions();
2057
- const Comparator = requireComparator();
2058
- const debug = requireDebug();
2059
- const SemVer = requireSemver();
2060
- const {
2061
- safeRe: re,
2062
- t,
2063
- comparatorTrimReplace,
2064
- tildeTrimReplace,
2065
- caretTrimReplace,
2066
- } = requireRe();
2067
- const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = requireConstants();
2068
-
2069
- const isNullSet = c => c.value === '<0.0.0-0';
2070
- const isAny = c => c.value === '';
2071
-
2072
- // take a set of comparators and determine whether there
2073
- // exists a version which can satisfy it
2074
- const isSatisfiable = (comparators, options) => {
2075
- let result = true;
2076
- const remainingComparators = comparators.slice();
2077
- let testComparator = remainingComparators.pop();
2078
-
2079
- while (result && remainingComparators.length) {
2080
- result = remainingComparators.every((otherComparator) => {
2081
- return testComparator.intersects(otherComparator, options)
2082
- });
2083
-
2084
- testComparator = remainingComparators.pop();
2085
- }
2086
-
2087
- return result
2088
- };
2089
-
2090
- // comprised of xranges, tildes, stars, and gtlt's at this point.
2091
- // already replaced the hyphen ranges
2092
- // turn into a set of JUST comparators.
2093
- const parseComparator = (comp, options) => {
2094
- debug('comp', comp, options);
2095
- comp = replaceCarets(comp, options);
2096
- debug('caret', comp);
2097
- comp = replaceTildes(comp, options);
2098
- debug('tildes', comp);
2099
- comp = replaceXRanges(comp, options);
2100
- debug('xrange', comp);
2101
- comp = replaceStars(comp, options);
2102
- debug('stars', comp);
2103
- return comp
2104
- };
2105
-
2106
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
2107
-
2108
- // ~, ~> --> * (any, kinda silly)
2109
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
2110
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
2111
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
2112
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
2113
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
2114
- // ~0.0.1 --> >=0.0.1 <0.1.0-0
2115
- const replaceTildes = (comp, options) => {
2116
- return comp
2117
- .trim()
2118
- .split(/\s+/)
2119
- .map((c) => replaceTilde(c, options))
2120
- .join(' ')
2121
- };
2122
-
2123
- const replaceTilde = (comp, options) => {
2124
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
2125
- return comp.replace(r, (_, M, m, p, pr) => {
2126
- debug('tilde', comp, _, M, m, p, pr);
2127
- let ret;
2128
-
2129
- if (isX(M)) {
2130
- ret = '';
2131
- } else if (isX(m)) {
2132
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
2133
- } else if (isX(p)) {
2134
- // ~1.2 == >=1.2.0 <1.3.0-0
2135
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
2136
- } else if (pr) {
2137
- debug('replaceTilde pr', pr);
2138
- ret = `>=${M}.${m}.${p}-${pr
2139
- } <${M}.${+m + 1}.0-0`;
2140
- } else {
2141
- // ~1.2.3 == >=1.2.3 <1.3.0-0
2142
- ret = `>=${M}.${m}.${p
2143
- } <${M}.${+m + 1}.0-0`;
2144
- }
2145
-
2146
- debug('tilde return', ret);
2147
- return ret
2148
- })
2149
- };
2150
-
2151
- // ^ --> * (any, kinda silly)
2152
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
2153
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
2154
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
2155
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
2156
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
2157
- // ^0.0.1 --> >=0.0.1 <0.0.2-0
2158
- // ^0.1.0 --> >=0.1.0 <0.2.0-0
2159
- const replaceCarets = (comp, options) => {
2160
- return comp
2161
- .trim()
2162
- .split(/\s+/)
2163
- .map((c) => replaceCaret(c, options))
2164
- .join(' ')
2165
- };
2166
-
2167
- const replaceCaret = (comp, options) => {
2168
- debug('caret', comp, options);
2169
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
2170
- const z = options.includePrerelease ? '-0' : '';
2171
- return comp.replace(r, (_, M, m, p, pr) => {
2172
- debug('caret', comp, _, M, m, p, pr);
2173
- let ret;
2174
-
2175
- if (isX(M)) {
2176
- ret = '';
2177
- } else if (isX(m)) {
2178
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
2179
- } else if (isX(p)) {
2180
- if (M === '0') {
2181
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
2182
- } else {
2183
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
2184
- }
2185
- } else if (pr) {
2186
- debug('replaceCaret pr', pr);
2187
- if (M === '0') {
2188
- if (m === '0') {
2189
- ret = `>=${M}.${m}.${p}-${pr
2190
- } <${M}.${m}.${+p + 1}-0`;
2191
- } else {
2192
- ret = `>=${M}.${m}.${p}-${pr
2193
- } <${M}.${+m + 1}.0-0`;
2194
- }
2195
- } else {
2196
- ret = `>=${M}.${m}.${p}-${pr
2197
- } <${+M + 1}.0.0-0`;
2198
- }
2199
- } else {
2200
- debug('no pr');
2201
- if (M === '0') {
2202
- if (m === '0') {
2203
- ret = `>=${M}.${m}.${p
2204
- }${z} <${M}.${m}.${+p + 1}-0`;
2205
- } else {
2206
- ret = `>=${M}.${m}.${p
2207
- }${z} <${M}.${+m + 1}.0-0`;
2208
- }
2209
- } else {
2210
- ret = `>=${M}.${m}.${p
2211
- } <${+M + 1}.0.0-0`;
2212
- }
2213
- }
2214
-
2215
- debug('caret return', ret);
2216
- return ret
2217
- })
2218
- };
2219
-
2220
- const replaceXRanges = (comp, options) => {
2221
- debug('replaceXRanges', comp, options);
2222
- return comp
2223
- .split(/\s+/)
2224
- .map((c) => replaceXRange(c, options))
2225
- .join(' ')
2226
- };
2227
-
2228
- const replaceXRange = (comp, options) => {
2229
- comp = comp.trim();
2230
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2231
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2232
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
2233
- const xM = isX(M);
2234
- const xm = xM || isX(m);
2235
- const xp = xm || isX(p);
2236
- const anyX = xp;
2237
-
2238
- if (gtlt === '=' && anyX) {
2239
- gtlt = '';
2240
- }
2241
-
2242
- // if we're including prereleases in the match, then we need
2243
- // to fix this to -0, the lowest possible prerelease value
2244
- pr = options.includePrerelease ? '-0' : '';
2245
-
2246
- if (xM) {
2247
- if (gtlt === '>' || gtlt === '<') {
2248
- // nothing is allowed
2249
- ret = '<0.0.0-0';
2250
- } else {
2251
- // nothing is forbidden
2252
- ret = '*';
2253
- }
2254
- } else if (gtlt && anyX) {
2255
- // we know patch is an x, because we have any x at all.
2256
- // replace X with 0
2257
- if (xm) {
2258
- m = 0;
2259
- }
2260
- p = 0;
2261
-
2262
- if (gtlt === '>') {
2263
- // >1 => >=2.0.0
2264
- // >1.2 => >=1.3.0
2265
- gtlt = '>=';
2266
- if (xm) {
2267
- M = +M + 1;
2268
- m = 0;
2269
- p = 0;
2270
- } else {
2271
- m = +m + 1;
2272
- p = 0;
2273
- }
2274
- } else if (gtlt === '<=') {
2275
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
2276
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
2277
- gtlt = '<';
2278
- if (xm) {
2279
- M = +M + 1;
2280
- } else {
2281
- m = +m + 1;
2282
- }
2283
- }
2284
-
2285
- if (gtlt === '<') {
2286
- pr = '-0';
2287
- }
2288
-
2289
- ret = `${gtlt + M}.${m}.${p}${pr}`;
2290
- } else if (xm) {
2291
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
2292
- } else if (xp) {
2293
- ret = `>=${M}.${m}.0${pr
2294
- } <${M}.${+m + 1}.0-0`;
2295
- }
2296
-
2297
- debug('xRange return', ret);
2298
-
2299
- return ret
2300
- })
2301
- };
2302
-
2303
- // Because * is AND-ed with everything else in the comparator,
2304
- // and '' means "any version", just remove the *s entirely.
2305
- const replaceStars = (comp, options) => {
2306
- debug('replaceStars', comp, options);
2307
- // Looseness is ignored here. star is always as loose as it gets!
2308
- return comp
2309
- .trim()
2310
- .replace(re[t.STAR], '')
2311
- };
2312
-
2313
- const replaceGTE0 = (comp, options) => {
2314
- debug('replaceGTE0', comp, options);
2315
- return comp
2316
- .trim()
2317
- .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
2318
- };
2319
-
2320
- // This function is passed to string.replace(re[t.HYPHENRANGE])
2321
- // M, m, patch, prerelease, build
2322
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
2323
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
2324
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
2325
- // TODO build?
2326
- const hyphenReplace = incPr => ($0,
2327
- from, fM, fm, fp, fpr, fb,
2328
- to, tM, tm, tp, tpr) => {
2329
- if (isX(fM)) {
2330
- from = '';
2331
- } else if (isX(fm)) {
2332
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
2333
- } else if (isX(fp)) {
2334
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
2335
- } else if (fpr) {
2336
- from = `>=${from}`;
2337
- } else {
2338
- from = `>=${from}${incPr ? '-0' : ''}`;
2339
- }
2340
-
2341
- if (isX(tM)) {
2342
- to = '';
2343
- } else if (isX(tm)) {
2344
- to = `<${+tM + 1}.0.0-0`;
2345
- } else if (isX(tp)) {
2346
- to = `<${tM}.${+tm + 1}.0-0`;
2347
- } else if (tpr) {
2348
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
2349
- } else if (incPr) {
2350
- to = `<${tM}.${tm}.${+tp + 1}-0`;
2351
- } else {
2352
- to = `<=${to}`;
2353
- }
2354
-
2355
- return `${from} ${to}`.trim()
2356
- };
2357
-
2358
- const testSet = (set, version, options) => {
2359
- for (let i = 0; i < set.length; i++) {
2360
- if (!set[i].test(version)) {
2361
- return false
2362
- }
2363
- }
2364
-
2365
- if (version.prerelease.length && !options.includePrerelease) {
2366
- // Find the set of versions that are allowed to have prereleases
2367
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
2368
- // That should allow `1.2.3-pr.2` to pass.
2369
- // However, `1.2.4-alpha.notready` should NOT be allowed,
2370
- // even though it's within the range set by the comparators.
2371
- for (let i = 0; i < set.length; i++) {
2372
- debug(set[i].semver);
2373
- if (set[i].semver === Comparator.ANY) {
2374
- continue
2375
- }
2376
-
2377
- if (set[i].semver.prerelease.length > 0) {
2378
- const allowed = set[i].semver;
2379
- if (allowed.major === version.major &&
2380
- allowed.minor === version.minor &&
2381
- allowed.patch === version.patch) {
2382
- return true
2383
- }
2384
- }
2385
- }
2386
-
2387
- // Version has a -pre, but it's not one of the ones we like.
2388
- return false
2389
- }
2390
-
2391
- return true
2392
- };
2393
- return range;
2394
- }
2395
-
2396
- var satisfies_1;
2397
- var hasRequiredSatisfies;
2398
-
2399
- function requireSatisfies () {
2400
- if (hasRequiredSatisfies) return satisfies_1;
2401
- hasRequiredSatisfies = 1;
2402
-
2403
- const Range = requireRange();
2404
- const satisfies = (version, range, options) => {
2405
- try {
2406
- range = new Range(range, options);
2407
- } catch (er) {
2408
- return false
2409
- }
2410
- return range.test(version)
2411
- };
2412
- satisfies_1 = satisfies;
2413
- return satisfies_1;
2414
- }
2415
-
2416
- var satisfiesExports = requireSatisfies();
2417
- var satisfies = /*@__PURE__*/getDefaultExportFromCjs(satisfiesExports);
2418
-
2419
- /**
2420
- * Open editor url in a new window, and pass a message.
2421
- */
2422
- function post (window, url, data) {
2423
- const editor = window.open(url);
2424
- const step = 250;
2425
- const { origin } = new URL(url);
2426
- let count = 40;
2427
- function listen(evt) {
2428
- if (evt.source === editor) {
2429
- count = 0;
2430
- window.removeEventListener('message', listen, false);
2431
- }
2432
- }
2433
- window.addEventListener('message', listen, false);
2434
- // send message
2435
- // periodically resend until ack received or timeout
2436
- function send() {
2437
- if (count <= 0) {
2438
- return;
2439
- }
2440
- editor.postMessage(data, origin);
2441
- setTimeout(send, step);
2442
- count -= 1;
2443
- }
2444
- setTimeout(send, step);
2445
- }
2446
-
2447
- // generated with build-style.sh
2448
- var embedStyle = `.vega-embed {
2449
- position: relative;
2450
- display: inline-block;
2451
- box-sizing: border-box;
2452
- }
2453
- .vega-embed.has-actions {
2454
- padding-right: 38px;
2455
- }
2456
- .vega-embed details:not([open]) > :not(summary) {
2457
- display: none !important;
2458
- }
2459
- .vega-embed summary {
2460
- list-style: none;
2461
- position: absolute;
2462
- top: 0;
2463
- right: 0;
2464
- padding: 6px;
2465
- z-index: 1000;
2466
- background: white;
2467
- box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
2468
- color: #1b1e23;
2469
- border: 1px solid #aaa;
2470
- border-radius: 999px;
2471
- opacity: 0.2;
2472
- transition: opacity 0.4s ease-in;
2473
- cursor: pointer;
2474
- line-height: 0px;
2475
- }
2476
- .vega-embed summary::-webkit-details-marker {
2477
- display: none;
2478
- }
2479
- .vega-embed summary:active {
2480
- box-shadow: #aaa 0px 0px 0px 1px inset;
2481
- }
2482
- .vega-embed summary svg {
2483
- width: 14px;
2484
- height: 14px;
2485
- }
2486
- .vega-embed details[open] summary {
2487
- opacity: 0.7;
2488
- }
2489
- .vega-embed:hover summary, .vega-embed:focus-within summary {
2490
- opacity: 1 !important;
2491
- transition: opacity 0.2s ease;
2492
- }
2493
- .vega-embed .vega-actions {
2494
- position: absolute;
2495
- z-index: 1001;
2496
- top: 35px;
2497
- right: -9px;
2498
- display: flex;
2499
- flex-direction: column;
2500
- padding-bottom: 8px;
2501
- padding-top: 8px;
2502
- border-radius: 4px;
2503
- box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
2504
- border: 1px solid #d9d9d9;
2505
- background: white;
2506
- animation-duration: 0.15s;
2507
- animation-name: scale-in;
2508
- animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
2509
- text-align: left;
2510
- }
2511
- .vega-embed .vega-actions a {
2512
- padding: 8px 16px;
2513
- font-family: sans-serif;
2514
- font-size: 14px;
2515
- font-weight: 600;
2516
- white-space: nowrap;
2517
- color: #434a56;
2518
- text-decoration: none;
2519
- }
2520
- .vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
2521
- background-color: #f7f7f9;
2522
- color: black;
2523
- }
2524
- .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
2525
- content: "";
2526
- display: inline-block;
2527
- position: absolute;
2528
- }
2529
- .vega-embed .vega-actions::before {
2530
- left: auto;
2531
- right: 14px;
2532
- top: -16px;
2533
- border: 8px solid rgba(0, 0, 0, 0);
2534
- border-bottom-color: #d9d9d9;
2535
- }
2536
- .vega-embed .vega-actions::after {
2537
- left: auto;
2538
- right: 15px;
2539
- top: -14px;
2540
- border: 7px solid rgba(0, 0, 0, 0);
2541
- border-bottom-color: #fff;
2542
- }
2543
- .vega-embed .chart-wrapper.fit-x {
2544
- width: 100%;
2545
- }
2546
- .vega-embed .chart-wrapper.fit-y {
2547
- height: 100%;
2548
- }
2549
-
2550
- .vega-embed-wrapper {
2551
- max-width: 100%;
2552
- overflow: auto;
2553
- padding-right: 14px;
2554
- }
2555
-
2556
- @keyframes scale-in {
2557
- from {
2558
- opacity: 0;
2559
- transform: scale(0.6);
2560
- }
2561
- to {
2562
- opacity: 1;
2563
- transform: scale(1);
2564
- }
2565
- }
2566
- `;
2567
-
2568
- function mergeDeep(dest, ...src) {
2569
- for (const s of src) {
2570
- deepMerge_(dest, s);
2571
- }
2572
- return dest;
2573
- }
2574
- function deepMerge_(dest, src) {
2575
- for (const property of Object.keys(src)) {
2576
- vegaUtil.writeConfig(dest, property, src[property], true);
2577
- }
2578
- }
2579
- const vega = vega_module;
2580
- exports.vegaLite = index;
2581
- // For backwards compatibility with Vega-Lite before v4.
2582
- const w = (typeof window !== 'undefined' ? window : undefined);
2583
- if (exports.vegaLite === undefined && w?.vl?.compile) {
2584
- exports.vegaLite = w.vl;
2585
- }
2586
- const DEFAULT_ACTIONS = { export: { svg: true, png: true }, source: true, compiled: true, editor: true };
2587
- const I18N = {
2588
- CLICK_TO_VIEW_ACTIONS: 'Click to view actions',
2589
- COMPILED_ACTION: 'View Compiled Vega',
2590
- EDITOR_ACTION: 'Open in Vega Editor',
2591
- PNG_ACTION: 'Save as PNG',
2592
- SOURCE_ACTION: 'View Source',
2593
- SVG_ACTION: 'Save as SVG',
2594
- };
2595
- const NAMES = {
2596
- vega: 'Vega',
2597
- 'vega-lite': 'Vega-Lite',
2598
- };
2599
- const VERSION = {
2600
- vega: vega.version,
2601
- 'vega-lite': exports.vegaLite ? exports.vegaLite.version : 'not available',
2602
- };
2603
- const PREPROCESSOR = {
2604
- vega: (vgSpec) => vgSpec,
2605
- 'vega-lite': (vlSpec, logger, config) => exports.vegaLite.compile(vlSpec, { config: config, logger }).spec,
2606
- };
2607
- const SVG_CIRCLES = `
2608
- <svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
2609
- <circle r="2" cy="8" cx="2"></circle>
2610
- <circle r="2" cy="8" cx="8"></circle>
2611
- <circle r="2" cy="8" cx="14"></circle>
2612
- </svg>`;
2613
- const CHART_WRAPPER_CLASS = 'chart-wrapper';
2614
- function isTooltipHandler(h) {
2615
- return typeof h === 'function';
2616
- }
2617
- function viewSource(source, sourceHeader, sourceFooter, mode) {
2618
- const header = `<html><head>${sourceHeader}</head><body><pre><code class="json">`;
2619
- const footer = `</code></pre>${sourceFooter}</body></html>`;
2620
- const win = window.open('');
2621
- win.document.write(header + source + footer);
2622
- win.document.title = `${NAMES[mode]} JSON Source`;
2623
- }
2624
- /**
2625
- * Try to guess the type of spec.
2626
- *
2627
- * @param spec Vega or Vega-Lite spec.
2628
- */
2629
- function guessMode(spec, logger, providedMode) {
2630
- // Decide mode
2631
- if (spec.$schema) {
2632
- const parsed = parser_modern.default(spec.$schema);
2633
- if (providedMode && providedMode !== parsed.library) {
2634
- logger.warn(`The given visualization spec is written in ${NAMES[parsed.library]}, but mode argument sets ${NAMES[providedMode] ?? providedMode}.`);
2635
- }
2636
- const mode = parsed.library;
2637
- if (!satisfies(VERSION[mode], `^${parsed.version.slice(1)}`)) {
2638
- logger.warn(`The input spec uses ${NAMES[mode]} ${parsed.version}, but the current version of ${NAMES[mode]} is v${VERSION[mode]}.`);
2639
- }
2640
- return mode;
2641
- }
2642
- // try to guess from the provided spec
2643
- if ('mark' in spec ||
2644
- 'encoding' in spec ||
2645
- 'layer' in spec ||
2646
- 'hconcat' in spec ||
2647
- 'vconcat' in spec ||
2648
- 'facet' in spec ||
2649
- 'repeat' in spec) {
2650
- return 'vega-lite';
2651
- }
2652
- if ('marks' in spec || 'signals' in spec || 'scales' in spec || 'axes' in spec) {
2653
- return 'vega';
2654
- }
2655
- return providedMode ?? 'vega';
2656
- }
2657
- function isLoader(o) {
2658
- return !!(o && 'load' in o);
2659
- }
2660
- function createLoader(opts) {
2661
- return isLoader(opts) ? opts : vega.loader(opts);
2662
- }
2663
- function embedOptionsFromUsermeta(parsedSpec) {
2664
- const opts = parsedSpec.usermeta?.embedOptions ?? {};
2665
- if (vegaUtil.isString(opts.defaultStyle)) {
2666
- // we don't allow styles set via usermeta since it would allow injection of logic (we set the style via innerHTML)
2667
- opts.defaultStyle = false;
2668
- }
2669
- return opts;
2670
- }
2671
- /**
2672
- * Embed a Vega visualization component in a web page. This function returns a promise.
2673
- *
2674
- * @param el DOM element in which to place component (DOM node or CSS selector).
2675
- * @param spec String : A URL string from which to load the Vega specification.
2676
- * Object : The Vega/Vega-Lite specification as a parsed JSON object.
2677
- * @param opts A JavaScript object containing options for embedding.
2678
- */
2679
- async function embed(el, spec, opts = {}) {
2680
- let parsedSpec;
2681
- let loader;
2682
- if (vegaUtil.isString(spec)) {
2683
- loader = createLoader(opts.loader);
2684
- parsedSpec = JSON.parse(await loader.load(spec));
2685
- }
2686
- else {
2687
- parsedSpec = spec;
2688
- }
2689
- const loadedEmbedOptions = embedOptionsFromUsermeta(parsedSpec);
2690
- const usermetaLoader = loadedEmbedOptions.loader;
2691
- // either create the loader for the first time or create a new loader if the spec has new loader options
2692
- if (!loader || usermetaLoader) {
2693
- loader = createLoader(opts.loader ?? usermetaLoader);
2694
- }
2695
- const usermetaOpts = await loadOpts(loadedEmbedOptions, loader);
2696
- const parsedOpts = await loadOpts(opts, loader);
2697
- const mergedOpts = {
2698
- ...mergeDeep(parsedOpts, usermetaOpts),
2699
- config: vegaUtil.mergeConfig(parsedOpts.config ?? {}, usermetaOpts.config ?? {}),
2700
- };
2701
- return await _embed(el, parsedSpec, mergedOpts, loader);
2702
- }
2703
- async function loadOpts(opt, loader) {
2704
- const config = vegaUtil.isString(opt.config) ? JSON.parse(await loader.load(opt.config)) : (opt.config ?? {});
2705
- const patch = vegaUtil.isString(opt.patch) ? JSON.parse(await loader.load(opt.patch)) : opt.patch;
2706
- return {
2707
- ...opt,
2708
- ...(patch ? { patch } : {}),
2709
- ...(config ? { config } : {}),
2710
- };
2711
- }
2712
- function getRoot(el) {
2713
- const possibleRoot = el.getRootNode ? el.getRootNode() : document;
2714
- return possibleRoot instanceof ShadowRoot
2715
- ? { root: possibleRoot, rootContainer: possibleRoot }
2716
- : { root: document, rootContainer: document.head ?? document.body };
2717
- }
2718
- async function _embed(el, spec, opts = {}, loader) {
2719
- const config = opts.theme ? vegaUtil.mergeConfig(index$1[opts.theme], opts.config ?? {}) : opts.config;
2720
- const actions = vegaUtil.isBoolean(opts.actions) ? opts.actions : mergeDeep({}, DEFAULT_ACTIONS, opts.actions ?? {});
2721
- const i18n = { ...I18N, ...opts.i18n };
2722
- const renderer = opts.renderer ?? 'svg';
2723
- const logger$1 = opts.logger ?? vegaUtil.logger(vega.Warn);
2724
- if (opts.logLevel !== undefined)
2725
- logger$1.level(opts.logLevel);
2726
- const downloadFileName = opts.downloadFileName ?? 'visualization';
2727
- const element = typeof el === 'string' ? document.querySelector(el) : el;
2728
- if (!element) {
2729
- throw new Error(`${el} does not exist`);
2730
- }
2731
- if (opts.defaultStyle !== false) {
2732
- const ID = 'vega-embed-style';
2733
- const { root, rootContainer } = getRoot(element);
2734
- if (!root.getElementById(ID)) {
2735
- const style = document.createElement('style');
2736
- style.id = ID;
2737
- style.innerHTML =
2738
- opts.defaultStyle === undefined || opts.defaultStyle === true
2739
- ? (embedStyle).toString()
2740
- : opts.defaultStyle;
2741
- rootContainer.appendChild(style);
2742
- }
2743
- }
2744
- const mode = guessMode(spec, logger$1, opts.mode);
2745
- let vgSpec = PREPROCESSOR[mode](spec, logger$1, config);
2746
- if (mode === 'vega-lite') {
2747
- if (vgSpec.$schema) {
2748
- const parsed = parser_modern.default(vgSpec.$schema);
2749
- if (!satisfies(VERSION.vega, `^${parsed.version.slice(1)}`)) {
2750
- logger$1.warn(`The compiled spec uses Vega ${parsed.version}, but current version is v${VERSION.vega}.`);
2751
- }
2752
- }
2753
- }
2754
- element.classList.add('vega-embed');
2755
- if (actions) {
2756
- element.classList.add('has-actions');
2757
- }
2758
- element.innerHTML = ''; // clear container
2759
- let container = element;
2760
- if (actions) {
2761
- const chartWrapper = document.createElement('div');
2762
- chartWrapper.classList.add(CHART_WRAPPER_CLASS);
2763
- element.appendChild(chartWrapper);
2764
- container = chartWrapper;
2765
- }
2766
- const patch = opts.patch;
2767
- if (patch) {
2768
- vgSpec = patch instanceof Function ? patch(vgSpec) : applyPatch(vgSpec, patch, true, false).newDocument;
2769
- }
2770
- // Set locale. Note that this is a global setting.
2771
- if (opts.formatLocale) {
2772
- vega.formatLocale(opts.formatLocale);
2773
- }
2774
- if (opts.timeFormatLocale) {
2775
- vega.timeFormatLocale(opts.timeFormatLocale);
2776
- }
2777
- // Set custom expression functions
2778
- if (opts.expressionFunctions) {
2779
- for (const name in opts.expressionFunctions) {
2780
- const expressionFunction = opts.expressionFunctions[name];
2781
- if ('fn' in expressionFunction) {
2782
- vega.expressionFunction(name, expressionFunction.fn, expressionFunction['visitor']);
2783
- }
2784
- else if (expressionFunction instanceof Function) {
2785
- vega.expressionFunction(name, expressionFunction);
2786
- }
2787
- }
2788
- }
2789
- const { ast } = opts;
2790
- // Do not apply the config to Vega when we have already applied it to Vega-Lite.
2791
- // This call may throw an Error if parsing fails.
2792
- const runtime = vega.parse(vgSpec, mode === 'vega-lite' ? {} : config, { ast });
2793
- const view = new (opts.viewClass || vega.View)(runtime, {
2794
- loader,
2795
- logger: logger$1,
2796
- renderer,
2797
- ...(ast ? { expr: vega.expressionInterpreter ?? opts.expr ?? vegaInterpreter.expressionInterpreter } : {}),
2798
- });
2799
- view.addSignalListener('autosize', (_, autosize) => {
2800
- const { type } = autosize;
2801
- if (type == 'fit-x') {
2802
- container.classList.add('fit-x');
2803
- container.classList.remove('fit-y');
2804
- }
2805
- else if (type == 'fit-y') {
2806
- container.classList.remove('fit-x');
2807
- container.classList.add('fit-y');
2808
- }
2809
- else if (type == 'fit') {
2810
- container.classList.add('fit-x', 'fit-y');
2811
- }
2812
- else {
2813
- container.classList.remove('fit-x', 'fit-y');
2814
- }
2815
- });
2816
- if (opts.tooltip !== false) {
2817
- const { loader: loader_, tooltip } = opts;
2818
- const baseURL = loader_ && !isLoader(loader_) ? loader_?.baseURL : undefined;
2819
- const handler = isTooltipHandler(tooltip)
2820
- ? tooltip
2821
- : // user provided boolean true or tooltip options
2822
- new index$2.Handler({ baseURL, ...(tooltip === true ? {} : tooltip) }).call;
2823
- view.tooltip(handler);
2824
- }
2825
- let { hover } = opts;
2826
- if (hover === undefined) {
2827
- hover = mode === 'vega';
2828
- }
2829
- if (hover) {
2830
- const { hoverSet, updateSet } = (typeof hover === 'boolean' ? {} : hover);
2831
- view.hover(hoverSet, updateSet);
2832
- }
2833
- if (opts) {
2834
- if (opts.width != null) {
2835
- view.width(opts.width);
2836
- }
2837
- if (opts.height != null) {
2838
- view.height(opts.height);
2839
- }
2840
- if (opts.padding != null) {
2841
- view.padding(opts.padding);
2842
- }
2843
- }
2844
- await view.initialize(container, opts.bind).runAsync();
2845
- let documentClickHandler;
2846
- if (actions !== false) {
2847
- let wrapper = element;
2848
- if (opts.defaultStyle !== false || opts.forceActionsMenu) {
2849
- const details = document.createElement('details');
2850
- details.title = i18n.CLICK_TO_VIEW_ACTIONS;
2851
- element.append(details);
2852
- wrapper = details;
2853
- const summary = document.createElement('summary');
2854
- summary.innerHTML = SVG_CIRCLES;
2855
- details.append(summary);
2856
- documentClickHandler = (ev) => {
2857
- if (!details.contains(ev.target)) {
2858
- details.removeAttribute('open');
2859
- }
2860
- };
2861
- document.addEventListener('click', documentClickHandler);
2862
- }
2863
- const ctrl = document.createElement('div');
2864
- wrapper.append(ctrl);
2865
- ctrl.classList.add('vega-actions');
2866
- // add 'Export' action
2867
- if (actions === true || actions.export !== false) {
2868
- for (const ext of ['svg', 'png']) {
2869
- if (actions === true || actions.export === true || actions.export[ext]) {
2870
- const i18nExportAction = i18n[`${ext.toUpperCase()}_ACTION`];
2871
- const exportLink = document.createElement('a');
2872
- const scaleFactor = vegaUtil.isObject(opts.scaleFactor) ? opts.scaleFactor[ext] : opts.scaleFactor;
2873
- exportLink.text = i18nExportAction;
2874
- exportLink.href = '#';
2875
- exportLink.target = '_blank';
2876
- exportLink.download = `${downloadFileName}.${ext}`;
2877
- // add link on mousedown so that it's correct when the click happens
2878
- exportLink.addEventListener('mousedown', async function (e) {
2879
- e.preventDefault();
2880
- const url = await view.toImageURL(ext, scaleFactor);
2881
- this.href = url;
2882
- });
2883
- ctrl.append(exportLink);
2884
- }
2885
- }
2886
- }
2887
- // add 'View Source' action
2888
- if (actions === true || actions.source !== false) {
2889
- const viewSourceLink = document.createElement('a');
2890
- viewSourceLink.text = i18n.SOURCE_ACTION;
2891
- viewSourceLink.href = '#';
2892
- viewSourceLink.addEventListener('click', function (e) {
2893
- viewSource(index$3.default(spec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', mode);
2894
- e.preventDefault();
2895
- });
2896
- ctrl.append(viewSourceLink);
2897
- }
2898
- // add 'View Compiled' action
2899
- if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {
2900
- const compileLink = document.createElement('a');
2901
- compileLink.text = i18n.COMPILED_ACTION;
2902
- compileLink.href = '#';
2903
- compileLink.addEventListener('click', function (e) {
2904
- viewSource(index$3.default(vgSpec), opts.sourceHeader ?? '', opts.sourceFooter ?? '', 'vega');
2905
- e.preventDefault();
2906
- });
2907
- ctrl.append(compileLink);
2908
- }
2909
- // add 'Open in Vega Editor' action
2910
- if (actions === true || actions.editor !== false) {
2911
- const editorUrl = opts.editorUrl ?? 'https://vega.github.io/editor/';
2912
- const editorLink = document.createElement('a');
2913
- editorLink.text = i18n.EDITOR_ACTION;
2914
- editorLink.href = '#';
2915
- editorLink.addEventListener('click', function (e) {
2916
- post(window, editorUrl, {
2917
- config: config,
2918
- mode: patch ? 'vega' : mode,
2919
- renderer,
2920
- spec: index$3.default(patch ? vgSpec : spec),
2921
- });
2922
- e.preventDefault();
2923
- });
2924
- ctrl.append(editorLink);
2925
- }
2926
- }
2927
- function finalize() {
2928
- if (documentClickHandler) {
2929
- document.removeEventListener('click', documentClickHandler);
2930
- }
2931
- view.finalize();
2932
- }
2933
- return { view, spec, vgSpec, finalize, embedOptions: opts };
2934
- }
2935
-
2936
- exports.DEFAULT_ACTIONS = DEFAULT_ACTIONS;
2937
- exports.default = embed;
2938
- exports.guessMode = guessMode;
2939
- exports.vega = vega;